powermonitor 2.0.0.0
|
API for configuring and manipulating Power Monitor Click driver. More...
Topics | |
Power Monitor Registers List | |
List of registers of Power Monitor Click driver. | |
Power Monitor Registers Settings | |
Settings for registers of Power Monitor Click driver. | |
Power Monitor MikroBUS Map | |
MikroBUS pin mapping of Power Monitor Click driver. | |
Functions | |
void | powermonitor_cfg_setup (powermonitor_cfg_t *cfg) |
Power Monitor configuration object setup function. | |
err_t | powermonitor_init (powermonitor_t *ctx, powermonitor_cfg_t *cfg) |
Power Monitor initialization function. | |
err_t | powermonitor_default_cfg (powermonitor_t *ctx) |
Power Monitor default configuration function. | |
err_t | powermonitor_generic_write (powermonitor_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len) |
Power Monitor I2C writing function. | |
err_t | powermonitor_generic_read (powermonitor_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len) |
Power Monitor I2C reading function. | |
err_t | powermonitor_soft_reset (powermonitor_t *ctx) |
Power Monitor software reset function. | |
err_t | powermonitor_set_configuration (powermonitor_t *ctx, powermonitor_dev_cfg_t cfg_data) |
Power Monitor set configuration function. | |
err_t | powermonitor_get_configuration (powermonitor_t *ctx, powermonitor_dev_cfg_t *cfg_data) |
Power Monitor get configuration function. | |
err_t | powermonitor_set_adc_config (powermonitor_t *ctx, powermonitor_adc_cfg_t adc_cfg) |
Power Monitor set ADC configuration function. | |
err_t | powermonitor_get_adc_configu (powermonitor_t *ctx, powermonitor_adc_cfg_t *adc_cfg) |
Power Monitor get ADC configuration function. | |
err_t | powermonitor_set_bus_overvoltage_threshold (powermonitor_t *ctx, float bovl) |
Power Monitor set bus overvoltage threshold function. | |
err_t | powermonitor_set_bus_undervoltage_threshold (powermonitor_t *ctx, float buvl) |
Power Monitor set bus undervoltage threshold function. | |
err_t | powermonitor_set_shunt_overvoltage_threshold (powermonitor_t *ctx, float sovl) |
Power Monitor set shunt overvoltage threshold function. | |
err_t | powermonitor_set_shunt_undervoltage_threshold (powermonitor_t *ctx, float suvl) |
Power Monitor set shunt undervoltage threshold function. | |
err_t | powermonitor_get_vshunt (powermonitor_t *ctx, float *vshunt) |
Power Monitor get shunt voltage function. | |
err_t | powermonitor_get_vbus (powermonitor_t *ctx, float *vbus) |
Power Monitor get bus voltage function. | |
err_t | powermonitor_get_temperature (powermonitor_t *ctx, float *temperature) |
Power Monitor get temperature function. | |
err_t | powermonitor_get_current (powermonitor_t *ctx, float *current) |
Power Monitor get current function. | |
err_t | powermonitor_get_power (powermonitor_t *ctx, float *power) |
Power Monitor get power function. | |
err_t | powermonitor_get_energy_data (powermonitor_t *ctx, uint8_t *energy_data) |
Power Monitor get energy data function. | |
err_t | powermonitor_get_energy (powermonitor_t *ctx, float *energy) |
Power Monitor get energy function. | |
err_t | powermonitor_get_id (powermonitor_t *ctx, uint8_t *manufacturer_id, uint16_t *die_id, uint8_t *rev_id) |
Power Monitor get device ID function. | |
err_t | powermonitor_get_alert (powermonitor_t *ctx) |
Power Monitor get alert function. | |
API for configuring and manipulating Power Monitor Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void powermonitor_cfg_setup | ( | powermonitor_cfg_t * | cfg | ) |
Power Monitor configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See powermonitor_cfg_t object definition for detailed explanation. |
err_t powermonitor_default_cfg | ( | powermonitor_t * | ctx | ) |
Power Monitor default configuration function.
This function executes a default configuration of Power Monitor click board.
[in] | ctx | : Click context object. See powermonitor_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t powermonitor_generic_read | ( | powermonitor_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | rx_buf, | ||
uint8_t | rx_len ) |
Power Monitor I2C reading function.
This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See powermonitor_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | rx_buf | : Output read data. |
[in] | rx_len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t powermonitor_generic_write | ( | powermonitor_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | tx_buf, | ||
uint8_t | tx_len ) |
Power Monitor I2C writing function.
This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See powermonitor_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | tx_buf | : Data to be written. |
[in] | tx_len | : Number of bytes to be written. |
0
- Success, -1
- Error.err_t powermonitor_get_adc_configu | ( | powermonitor_t * | ctx, |
powermonitor_adc_cfg_t * | adc_cfg ) |
Power Monitor get ADC configuration function.
This function get ADC configuration of the INA228 85-V, 20-Bit, Ultra-Precise Power/Energy/Charge Monitor on the Power Monitor click board™.
[in] | ctx | : Click context object. See powermonitor_t object definition for detailed explanation. |
[out] | adc_cfg | : ADC configuration object. |
0
- Success, -1
- Error.err_t powermonitor_get_alert | ( | powermonitor_t * | ctx | ) |
Power Monitor get alert function.
This function get alert state of the value to detect Bus Undervoltage of the INA228 85-V, 20-Bit, Ultra-Precise Power/Energy/Charge Monitor on the Power Monitor click board™.
[in] | ctx | : Click context object. See powermonitor_t object definition for detailed explanation. |
0
- Alert state active, 1
- Alert state inactive.err_t powermonitor_get_configuration | ( | powermonitor_t * | ctx, |
powermonitor_dev_cfg_t * | cfg_data ) |
Power Monitor get configuration function.
This function get configuration of the INA228 85-V, 20-Bit, Ultra-Precise Power/Energy/Charge Monitor on the Power Monitor click board™.
[in] | ctx | : Click context object. See powermonitor_t object definition for detailed explanation. |
[out] | cfg_data | : Settings object. |
0
- Success, -1
- Error.err_t powermonitor_get_current | ( | powermonitor_t * | ctx, |
float * | current ) |
Power Monitor get current function.
This function get and calculate current output of the value to detect Bus Undervoltage of the INA228 85-V, 20-Bit, Ultra-Precise Power/Energy/Charge Monitor on the Power Monitor click board™.
[in] | ctx | : Click context object. See powermonitor_t object definition for detailed explanation. |
[out] | current | : Current output ( mA ). |
0
- Success, -1
- Error.err_t powermonitor_get_energy | ( | powermonitor_t * | ctx, |
float * | energy ) |
Power Monitor get energy function.
This function get and calculate energy output of the value to detect Bus Undervoltage of the INA228 85-V, 20-Bit, Ultra-Precise Power/Energy/Charge Monitor on the Power Monitor click board™.
[in] | ctx | : Click context object. See powermonitor_t object definition for detailed explanation. |
[out] | energy | : Energy output ( J ). |
0
- Success, -1
- Error.err_t powermonitor_get_energy_data | ( | powermonitor_t * | ctx, |
uint8_t * | energy_data ) |
Power Monitor get energy data function.
This function read energy data of the value to detect Bus Undervoltage of the INA228 85-V, 20-Bit, Ultra-Precise Power/Energy/Charge Monitor on the Power Monitor click board™.
[in] | ctx | : Click context object. See powermonitor_t object definition for detailed explanation. |
[out] | energy_data | : Pointer to the memory location where the data is stored. |
0
- Success, -1
- Error.err_t powermonitor_get_id | ( | powermonitor_t * | ctx, |
uint8_t * | manufacturer_id, | ||
uint16_t * | die_id, | ||
uint8_t * | rev_id ) |
Power Monitor get device ID function.
This function get device ID of the value to detect Bus Undervoltage of the INA228 85-V, 20-Bit, Ultra-Precise Power/Energy/Charge Monitor on the Power Monitor click board™.
[in] | ctx | : Click context object. See powermonitor_t object definition for detailed explanation. |
[out] | manufacturer_id | : Reads back TI in ASCII. |
[out] | die_id | : Stores the device identification bits. |
[out] | rev_id | : Device revision identification. |
0
- Success, -1
- Error.err_t powermonitor_get_power | ( | powermonitor_t * | ctx, |
float * | power ) |
Power Monitor get power function.
This function get and calculate power output of the value to detect Bus Undervoltage of the INA228 85-V, 20-Bit, Ultra-Precise Power/Energy/Charge Monitor on the Power Monitor click board™.
[in] | ctx | : Click context object. See powermonitor_t object definition for detailed explanation. |
[out] | power | : Power output ( W ). |
0
- Success, -1
- Error.err_t powermonitor_get_temperature | ( | powermonitor_t * | ctx, |
float * | temperature ) |
Power Monitor get temperature function.
This function get temperature measurement of the value to detect Bus Undervoltage of the INA228 85-V, 20-Bit, Ultra-Precise Power/Energy/Charge Monitor on the Power Monitor click board™.
[in] | ctx | : Click context object. See powermonitor_t object definition for detailed explanation. |
[out] | temperature | : Temperature ( degree Celsius ). |
0
- Success, -1
- Error.err_t powermonitor_get_vbus | ( | powermonitor_t * | ctx, |
float * | vbus ) |
Power Monitor get bus voltage function.
This function get bus voltage measurement of the value to detect Bus Undervoltage of the INA228 85-V, 20-Bit, Ultra-Precise Power/Energy/Charge Monitor on the Power Monitor click board™.
[in] | ctx | : Click context object. See powermonitor_t object definition for detailed explanation. |
[out] | vbus | : Bus voltage output ( mV ). |
0
- Success, -1
- Error.err_t powermonitor_get_vshunt | ( | powermonitor_t * | ctx, |
float * | vshunt ) |
Power Monitor get shunt voltage function.
This function get shunt voltage measurement of the value to detect Bus Undervoltage of the INA228 85-V, 20-Bit, Ultra-Precise Power/Energy/Charge Monitor on the Power Monitor click board™.
[in] | ctx | : Click context object. See powermonitor_t object definition for detailed explanation. |
[out] | vshunt | : Differential voltage measured ( mV ). |
0
- Success, -1
- Error.err_t powermonitor_init | ( | powermonitor_t * | ctx, |
powermonitor_cfg_t * | cfg ) |
Power Monitor initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See powermonitor_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See powermonitor_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t powermonitor_set_adc_config | ( | powermonitor_t * | ctx, |
powermonitor_adc_cfg_t | adc_cfg ) |
Power Monitor set ADC configuration function.
This function performs ADC configuration of the INA228 85-V, 20-Bit, Ultra-Precise Power/Energy/Charge Monitor on the Power Monitor click board™.
[in] | ctx | : Click context object. See powermonitor_t object definition for detailed explanation. |
[in] | adc_cfg | : ADC configuration object. |
0
- Success, -1
- Error.err_t powermonitor_set_bus_overvoltage_threshold | ( | powermonitor_t * | ctx, |
float | bovl ) |
Power Monitor set bus overvoltage threshold function.
This function sets the bus overvoltage threshold for comparison of the value to detect Bus Overvoltage of the INA228 85-V, 20-Bit, Ultra-Precise Power/Energy/Charge Monitor on the Power Monitor click board™.
[in] | ctx | : Click context object. See powermonitor_t object definition for detailed explanation. |
[in] | bovl | : Overvoltage threshold for comparison ( 0 mV - 102400 mV) . |
0
- Success, -1
- Error.err_t powermonitor_set_bus_undervoltage_threshold | ( | powermonitor_t * | ctx, |
float | buvl ) |
Power Monitor set bus undervoltage threshold function.
This function sets the bus undervoltage threshold for comparison of the value to detect Bus Undervoltage of the INA228 85-V, 20-Bit, Ultra-Precise Power/Energy/Charge Monitor on the Power Monitor click board™.
[in] | ctx | : Click context object. See powermonitor_t object definition for detailed explanation. |
[in] | buvl | : Undervoltage threshold for comparison ( 0 mV - 102400 mV) . |
0
- Success, -1
- Error.err_t powermonitor_set_configuration | ( | powermonitor_t * | ctx, |
powermonitor_dev_cfg_t | cfg_data ) |
Power Monitor set configuration function.
This function performs configuration of the INA228 85-V, 20-Bit, Ultra-Precise Power/Energy/Charge Monitor on the Power Monitor click board™.
[in] | ctx | : Click context object. See powermonitor_t object definition for detailed explanation. |
[in] | cfg_data | : Settings object. |
0
- Success, -1
- Error.err_t powermonitor_set_shunt_overvoltage_threshold | ( | powermonitor_t * | ctx, |
float | sovl ) |
Power Monitor set shunt overvoltage threshold function.
This function sets the shunt overvoltage threshold for comparison of the value to detect Bus Overvoltage of the INA228 85-V, 20-Bit, Ultra-Precise Power/Energy/Charge Monitor on the Power Monitor click board™.
[in] | ctx | : Click context object. See powermonitor_t object definition for detailed explanation. |
[in] | sovl | : Overvoltage threshold for comparison ( ADCRANGE = 0 : 0 mV - 327.680 mV; ADCRANGE = 1 : 0 mV - 81.920 mV ) . |
0
- Success, -1
- Error.err_t powermonitor_set_shunt_undervoltage_threshold | ( | powermonitor_t * | ctx, |
float | suvl ) |
Power Monitor set shunt undervoltage threshold function.
This function sets the shunt undervoltage threshold for comparison of the value to detect Bus Undervoltage of the INA228 85-V, 20-Bit, Ultra-Precise Power/Energy/Charge Monitor on the Power Monitor click board™.
[in] | ctx | : Click context object. See powermonitor_t object definition for detailed explanation. |
[in] | suvl | : Undervoltage threshold for comparison ( ADCRANGE = 0 : 0 mV - 327.680 mV; ADCRANGE = 1 : 0 mV - 81.920 mV ) . |
0
- Success, -1
- Error.err_t powermonitor_soft_reset | ( | powermonitor_t * | ctx | ) |
Power Monitor software reset function.
This function executes a software reset of the INA228 85-V, 20-Bit, Ultra-Precise Power/Energy/Charge Monitor on the Power Monitor click board™.
[in] | ctx | : Click context object. See powermonitor_t object definition for detailed explanation. |
0
- Success, -1
- Error.