diff --git a/general/include/INA226.h b/general/include/INA226.h index f586d36..59c336d 100644 --- a/general/include/INA226.h +++ b/general/include/INA226.h @@ -6,6 +6,8 @@ #ifndef INA226_H #define INA226_H +#include +#include // REGISTERS #define INA226_CONFIGURATION 0x00 @@ -65,10 +67,12 @@ int ina226_configure(ina226_t *ina, uint8_t mode, uint8_t vshct, uint8_t vbusct, uint8_t avg); // Resets all registers to default values -int ina226_reset(ina226_t ina); +int ina226_reset(ina226_t *ina); // Reads manufacturer id register -int ina226_read_manufacturer_id(ina226_t ina, uint16_t *data); +int ina226_read_manufacturer_id(ina226_t *ina, uint16_t *data); // Reads die id -int ina226_read_die_id(ina226_t ina, uint16_t *data); \ No newline at end of file +int ina226_read_die_id(ina226_t *ina, uint16_t *data); + +#endif //INA226_H \ No newline at end of file diff --git a/general/src/INA226.c b/general/src/INA226.c index 16a98a3..0a440d1 100644 --- a/general/src/INA226.c +++ b/general/src/INA226.c @@ -108,14 +108,14 @@ int ina226_configure(ina226_t *ina, uint8_t mode, uint8_t vshct, uint8_t vbusct, } // Resets all registers to default values -int ina226_reset(ina226_t ina) +int ina226_reset(ina226_t *ina) { uint16_t reset = INA226_CONFIG_RESET_MASK; return ina226_write_reg(ina, INA226_CONFIGURATION, &reset); } // Reads manufacturer id register -int ina226_read_manufacturer_id(ina226_t ina, uint16_t *data) +int ina226_read_manufacturer_id(ina226_t *ina, uint16_t *data) { uint16_t manufacturer_id; @@ -131,7 +131,7 @@ int ina226_read_manufacturer_id(ina226_t ina, uint16_t *data) } // Reads die id -int ina226_read_die_id(ina226_t ina, uint16_t *data) +int ina226_read_die_id(ina226_t *ina, uint16_t *data) { uint16_t die_id;