From 63656e1bd899ac1f5705d041349e8e459ee645a7 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Fri, 11 Aug 2023 12:44:50 +0200 Subject: Change permissions and update README --- README.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 67d37e6..055c7e1 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,23 @@ # INA260-sysfs-driver +Link to the [ina260 datasheet](https://www.ti.com/lit/gpn/INA260). + ## Installation $ make $ sudo insmod ina260.ko -## Usage +## Managing INA260 devices +- Add device: `echo ina260 [devaddr] > /sys/bus/i2c/devices//new_device` +- Delete device: `echo [devaddr] > /sys/bus/i2c/devices//delete_device` + +## Sysfs structure +- Overview: `tree /sys/kernel/ina260` +- You can access to each device registers in `/sys/kernel/ina260//registers/` +- You can access to each device register fields in `/sys/kernel/ina260//fields/` +- You can access to the currently measured current, voltage and power via `/sys/kernel/ina260//` (units are watts, amperes and volts respectively) -- Add device: `echo ina260 > /sys/bus/i2c/devices//new_device` +For more informations on the registers/fields, please refer to the [ina260 datasheet](https://www.ti.com/lit/gpn/INA260). -- Next, run: `tree /sys/kernel/ina260` \ No newline at end of file +## Notes +- Tested so far on a [Beaglebone Black](https://www.beagleboard.org/boards/beaglebone-black) with a [Mikrobus Cape](https://www.mikroe.com/beaglebone-mikrobus-cape) with up to four ina260 devices attached. \ No newline at end of file -- cgit v1.2.3