Basic INA219, with set calibaration and functions for reading raw register and write to register
INA219.h@0:cdfbda214bee, 2015-11-20 (annotated)
- Committer:
- tsoic
- Date:
- Fri Nov 20 08:24:43 2015 +0000
- Revision:
- 0:cdfbda214bee
- Child:
- 1:6b9f92e99dd7
Fork of INA219 library , just basic functions, read raw registar and write registar, calibration is changable only in library.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tsoic | 0:cdfbda214bee | 1 | #ifndef INA219_H |
tsoic | 0:cdfbda214bee | 2 | #define INA219_H |
tsoic | 0:cdfbda214bee | 3 | |
tsoic | 0:cdfbda214bee | 4 | #include "mbed.h" |
tsoic | 0:cdfbda214bee | 5 | #include "I2CR.h" |
tsoic | 0:cdfbda214bee | 6 | |
tsoic | 0:cdfbda214bee | 7 | class INA219 { |
tsoic | 0:cdfbda214bee | 8 | public: |
tsoic | 0:cdfbda214bee | 9 | |
tsoic | 0:cdfbda214bee | 10 | INA219(); |
tsoic | 0:cdfbda214bee | 11 | |
tsoic | 0:cdfbda214bee | 12 | uint16_t readRawReg(uint8_t); |
tsoic | 0:cdfbda214bee | 13 | uint8_t write_reg(uint8_t, uint8_t); |
tsoic | 0:cdfbda214bee | 14 | |
tsoic | 0:cdfbda214bee | 15 | private: |
tsoic | 0:cdfbda214bee | 16 | |
tsoic | 0:cdfbda214bee | 17 | I2CR i2cr; |
tsoic | 0:cdfbda214bee | 18 | |
tsoic | 0:cdfbda214bee | 19 | uint8_t dt[4]; |
tsoic | 0:cdfbda214bee | 20 | void calibration(); |
tsoic | 0:cdfbda214bee | 21 | }; |
tsoic | 0:cdfbda214bee | 22 | |
tsoic | 0:cdfbda214bee | 23 | #endif |