Driver for ina260 (sysfs)
Find a file
2023-08-14 18:53:14 +02:00
.gitignore Minor changes 2023-08-14 10:39:36 +02:00
ina260.c Minor changes 2023-08-14 18:53:14 +02:00
ina260_full.c Minor changes 2023-08-14 16:37:31 +02:00
Makefile Minor changes 2023-08-14 10:57:58 +02:00
README.md Minor changes 2023-08-14 12:25:17 +02:00

INA260 Linux Drivers

This project provides two drivers:

  1. ina260.c that is compatible with hwmon
  2. ina260_full.c that provides an entire support for registers and fields of the ina260 and maximize performance over compatibility

Installation

$ make
$ sudo insmod ina260.ko

Managing INA260 devices

  • Add device: echo ina260 [devaddr] > /sys/bus/i2c/devices/<bus>/new_device
  • Delete device: echo [devaddr] > /sys/bus/i2c/devices/<bus>/delete_device

Sysfs structure for the ina260.c

You will mostly use the lm-sensors utility. Although, the ina260 registers are accessible from /sys/class/hwmon/hwmon[0-9]+/registers/.

Sysfs structure for the ina260_full.c

  • Overview: tree /sys/kernel/ina260
  • You can access to each device registers in /sys/kernel/ina260/<device>/registers/
  • You can access to each device register fields in /sys/kernel/ina260/<device>/fields/
  • You can access to the currently measured current, voltage and power via /sys/kernel/ina260/<device>/<power|current|voltage> (units are watts, amperes and volts respectively)

For more informations on the registers/fields, please refer to the ina260 datasheet.

Notes