battmon4 2.0.0.0
|
API for configuring and manipulating BATT-MON 4 Click driver. More...
Topics | |
BATT-MON 4 Registers List | |
List of registers of BATT-MON 4 Click driver. | |
BATT-MON 4 Registers Settings | |
Settings for registers of BATT-MON 4 Click driver. | |
BATT-MON 4 MikroBUS Map | |
MikroBUS pin mapping of BATT-MON 4 Click driver. | |
Functions | |
void | battmon4_cfg_setup (battmon4_cfg_t *cfg) |
BATT-MON 4 configuration object setup function. | |
err_t | battmon4_init (battmon4_t *ctx, battmon4_cfg_t *cfg) |
BATT-MON 4 initialization function. | |
err_t | battmon4_write_register (battmon4_t *ctx, uint8_t reg, uint16_t data_in) |
BATT-MON 4 write register function. | |
err_t | battmon4_read_register (battmon4_t *ctx, uint8_t reg, uint16_t *data_out) |
BATT-MON 4 read register function. | |
err_t | battmon4_get_die_temperature (battmon4_t *ctx, float *temperature) |
BATT-MON 4 get die temperature function. | |
err_t | battmon4_get_batt_in_voltage (battmon4_t *ctx, float *v_ipeak_on, float *v_ipeak_off) |
BATT-MON 4 get batt in voltage function. | |
err_t | battmon4_get_batt_out_voltage (battmon4_t *ctx, float *v_ipeak_on, float *v_ipeak_off) |
BATT-MON 4 get batt out voltage function. | |
uint8_t | battmon4_get_bok_pin (battmon4_t *ctx) |
BATT-MON 4 get bok pin function. | |
uint8_t | battmon4_get_int_pin (battmon4_t *ctx) |
BATT-MON 4 get int pin function. | |
API for configuring and manipulating BATT-MON 4 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void battmon4_cfg_setup | ( | battmon4_cfg_t * | cfg | ) |
BATT-MON 4 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See battmon4_cfg_t object definition for detailed explanation. |
err_t battmon4_get_batt_in_voltage | ( | battmon4_t * | ctx, |
float * | v_ipeak_on, | ||
float * | v_ipeak_off ) |
BATT-MON 4 get batt in voltage function.
This function reads the voltage from BATT IN when Ipeak is ON and OFF.
[in] | ctx | : Click context object. See battmon4_t object definition for detailed explanation. |
[out] | v_ipeak_on | : BATT IN voltage in millivolts when Ipeak is ON. |
[out] | v_ipeak_off | : BATT IN voltage in millivolts when Ipeak is OFF. |
0
- Success, -1
- Error.err_t battmon4_get_batt_out_voltage | ( | battmon4_t * | ctx, |
float * | v_ipeak_on, | ||
float * | v_ipeak_off ) |
BATT-MON 4 get batt out voltage function.
This function reads the voltage from BATT OUT when Ipeak is ON and OFF.
[in] | ctx | : Click context object. See battmon4_t object definition for detailed explanation. |
[out] | v_ipeak_on | : BATT OUT voltage in millivolts when Ipeak is ON. |
[out] | v_ipeak_off | : BATT OUT voltage in millivolts when Ipeak is OFF. |
0
- Success, -1
- Error.uint8_t battmon4_get_bok_pin | ( | battmon4_t * | ctx | ) |
BATT-MON 4 get bok pin function.
This function returns the BOK (Battery OK) pin logic state.
[in] | ctx | : Click context object. See battmon4_t object definition for detailed explanation. |
err_t battmon4_get_die_temperature | ( | battmon4_t * | ctx, |
float * | temperature ) |
BATT-MON 4 get die temperature function.
This function reads the chip DIE temperature in Celsius.
[in] | ctx | : Click context object. See battmon4_t object definition for detailed explanation. |
[out] | temperature | : Die temperature in Celsius. |
0
- Success, -1
- Error.uint8_t battmon4_get_int_pin | ( | battmon4_t * | ctx | ) |
BATT-MON 4 get int pin function.
This function returns the INT pin logic state.
[in] | ctx | : Click context object. See battmon4_t object definition for detailed explanation. |
err_t battmon4_init | ( | battmon4_t * | ctx, |
battmon4_cfg_t * | cfg ) |
BATT-MON 4 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See battmon4_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See battmon4_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t battmon4_read_register | ( | battmon4_t * | ctx, |
uint8_t | reg, | ||
uint16_t * | data_out ) |
BATT-MON 4 read register function.
This function reads data from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See battmon4_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data [2 bytes]. |
0
- Success, -1
- Error.err_t battmon4_write_register | ( | battmon4_t * | ctx, |
uint8_t | reg, | ||
uint16_t | data_in ) |
BATT-MON 4 write register function.
This function writes a desired data to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See battmon4_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written [2 bytes]. |
0
- Success, -1
- Error.