Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

INA238

A platform-agnostic #![no_std] Rust driver for the Texas Instruments INA238 85V, 16-Bit High-Precision Power/Current/Voltage Monitor using embedded-hal.

Features

  • #![no_std] Support: Suitable for bare-metal microcontrollers (STM32, RP2040, ESP32, nRF, etc.).
  • embedded-hal Integration: Works with any I2C peripheral implementing embedded-hal 1.0 traits.
  • Measurements: Read Bus Voltage, Shunt Voltage, Current, Power, and Temperature.
  • Configurable: Set custom conversion times, averaging options, and calibration settings.

Getting Started

Add ina238 to your Cargo.toml:

[dependencies]
ina238 = "0.1.0"

Example

use embedded_hal::i2c::I2c;
use ina238::Ina238;

// Initialize your hardware I2C peripheral (platform-specific)
// let i2c = ...;

// Create driver instance (default I2C address is 0x40)
let mut sensor = Ina238::new(i2c, 0x40);

// Read bus voltage (in mV)
if let Ok(voltage) = sensor.read_bus_voltage() {
    // voltage in mV
}

About

A Rust driver for the INA238 current/voltage/power monitor IC.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages