battmon3 2.0.0.0
|
API for configuring and manipulating BATT-MON 3 Click driver. More...
Topics | |
BATT-MON 3 Registers List | |
List of registers of BATT-MON 3 Click driver. | |
BATT-MON 3 Registers Settings | |
Settings for registers of BATT-MON 3 Click driver. | |
BATT-MON 3 MikroBUS Map | |
MikroBUS pin mapping of BATT-MON 3 Click driver. | |
Functions | |
void | battmon3_cfg_setup (battmon3_cfg_t *cfg) |
BATT-MON 3 configuration object setup function. | |
err_t | battmon3_init (battmon3_t *ctx, battmon3_cfg_t *cfg) |
BATT-MON 3 initialization function. | |
err_t | battmon3_default_cfg (battmon3_t *ctx) |
BATT-MON 3 default configuration function. | |
err_t | battmon3_generic_write (battmon3_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len) |
BATT-MON 3 I2C writing function. | |
err_t | battmon3_generic_read (battmon3_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len) |
BATT-MON 3 I2C reading function. | |
err_t | battmon3_write_two_bytes (battmon3_t *ctx, uint8_t reg, uint16_t data_in) |
BATT-MON 3 write two bytes function. | |
err_t | battmon3_read_two_bytes (battmon3_t *ctx, uint8_t reg, uint16_t *data_out) |
BATT-MON 3 read two bytes function. | |
err_t | battmon3_write_control (battmon3_t *ctx, uint16_t control) |
BATT-MON 3 write control function. | |
err_t | battmon3_read_control (battmon3_t *ctx, uint16_t control, uint16_t *data_out) |
BATT-MON 3 read control function. | |
err_t | battmon3_write_data_flash (battmon3_t *ctx, uint16_t address, uint8_t *tx_buf, uint8_t tx_len) |
BATT-MON 3 write data flash function. | |
err_t | battmon3_read_data_flash (battmon3_t *ctx, uint16_t address, uint8_t *rx_buf, uint8_t rx_len) |
BATT-MON 3 read data flash function. | |
err_t | battmon3_check_communication (battmon3_t *ctx) |
BATT-MON 3 check communication function. | |
err_t | battmon3_read_status (battmon3_t *ctx, uint16_t *status) |
BATT-MON 3 read status function. | |
err_t | battmon3_wait_for_status (battmon3_t *ctx, uint16_t mask, uint16_t status) |
BATT-MON 3 wait for status function. | |
void | battmon3_set_en_pin_high (battmon3_t *ctx) |
BATT-MON 3 set en pin high function. | |
void | battmon3_set_en_pin_low (battmon3_t *ctx) |
BATT-MON 3 set en pin low function. | |
uint8_t | battmon3_get_alert_pin (battmon3_t *ctx) |
BATT-MON 3 get alert pin function. | |
err_t | battmon3_start_gauge (battmon3_t *ctx) |
BATT-MON 3 start gauge function. | |
err_t | battmon3_stop_gauge (battmon3_t *ctx) |
BATT-MON 3 stop gauge function. | |
err_t | battmon3_disable_gauge (battmon3_t *ctx) |
BATT-MON 3 disable gauge function. | |
err_t | battmon3_set_gauge_mode (battmon3_t *ctx, uint8_t gauge_mode) |
BATT-MON 3 set gauge mode function. | |
err_t | battmon3_reset (battmon3_t *ctx) |
BATT-MON 3 reset function. | |
err_t | battmon3_read_security_mode (battmon3_t *ctx) |
BATT-MON 3 read security mode function. | |
err_t | battmon3_set_security_mode (battmon3_t *ctx, uint8_t security_mode) |
BATT-MON 3 set security mode function. | |
err_t | battmon3_new_battery (battmon3_t *ctx, uint16_t des_capacity) |
BATT-MON 3 new battery function. | |
err_t | battmon3_set_design_capacity (battmon3_t *ctx, uint16_t des_capacity) |
BATT-MON 3 set design capacity function. | |
err_t | battmon3_read_design_capacity (battmon3_t *ctx, uint16_t *des_capacity) |
BATT-MON 3 read design capacity function. | |
err_t | battmon3_read_used_capacity (battmon3_t *ctx, float *used_capacity) |
BATT-MON 3 read used capacity function. | |
err_t | battmon3_read_remaining_capacity (battmon3_t *ctx, float *rem_capacity) |
BATT-MON 3 read remaining capacity function. | |
err_t | battmon3_read_remaining_percentage (battmon3_t *ctx, float *rem_percentage) |
BATT-MON 3 read remaining percentage function. | |
err_t | battmon3_use_internal_temperature (battmon3_t *ctx) |
BATT-MON 3 use internal temperature function. | |
err_t | battmon3_use_external_temperature (battmon3_t *ctx) |
BATT-MON 3 use external temperature function. | |
err_t | battmon3_read_temperature (battmon3_t *ctx, float *temperature) |
BATT-MON 3 read temperature function. | |
err_t | battmon3_read_internal_temperature (battmon3_t *ctx, float *temperature) |
BATT-MON 3 read internal temperature function. | |
err_t | battmon3_read_voltage (battmon3_t *ctx, uint16_t *voltage) |
BATT-MON 3 read voltage function. | |
err_t | battmon3_read_current (battmon3_t *ctx, int16_t *current) |
BATT-MON 3 read current function. | |
err_t | battmon3_read_scaled_r (battmon3_t *ctx, uint16_t *scaled_r) |
BATT-MON 3 read scaled R function. | |
err_t | battmon3_read_measured_z (battmon3_t *ctx, uint16_t *measured_z) |
BATT-MON 3 read measured Z function. | |
err_t | battmon3_read_state_of_health (battmon3_t *ctx, uint8_t *state_of_health) |
BATT-MON 3 read state of health function. | |
err_t | battmon3_read_battery_status (battmon3_t *ctx, uint8_t *batt_status) |
BATT-MON 3 read battery status function. | |
err_t | battmon3_read_battery_alert (battmon3_t *ctx, uint8_t *batt_alert) |
BATT-MON 3 read battery alert function. | |
err_t | battmon3_enter_calibration_mode (battmon3_t *ctx) |
BATT-MON 3 enter calibration mode function. | |
err_t | battmon3_exit_calibration_mode (battmon3_t *ctx) |
BATT-MON 3 exit calibration mode function. | |
err_t | battmon3_read_raw_calibration_data (battmon3_t *ctx, uint8_t reg, uint16_t *cal_data) |
BATT-MON 3 read raw calibration data function. | |
err_t | battmon3_perform_cc_offset (battmon3_t *ctx) |
BATT-MON 3 perform CC offset function. | |
err_t | battmon3_perform_board_offset (battmon3_t *ctx) |
BATT-MON 3 perform board offset function. | |
err_t | battmon3_calibrate_voltage (battmon3_t *ctx, uint16_t voltage) |
BATT-MON 3 calibrate voltage function. | |
err_t | battmon3_calibrate_current (battmon3_t *ctx, int16_t current) |
BATT-MON 3 calibrate current function. | |
err_t | battmon3_calibrate_temperature (battmon3_t *ctx, float temperature) |
BATT-MON 3 calibrate temperature function. | |
API for configuring and manipulating BATT-MON 3 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
err_t battmon3_calibrate_current | ( | battmon3_t * | ctx, |
int16_t | current ) |
BATT-MON 3 calibrate current function.
This function calibrates the chip with known current flowing.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
[in] | current | : Known constant current in mA. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_calibrate_temperature | ( | battmon3_t * | ctx, |
float | temperature ) |
BATT-MON 3 calibrate temperature function.
This function calibrates the internal or external temperature. To determine which temperature source is selected calling battmon3_use_internal_temperature or battmon3_use_external_temperature functions is recommended prior to this.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
[in] | temperature | : Known temperature in Celsius. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_calibrate_voltage | ( | battmon3_t * | ctx, |
uint16_t | voltage ) |
BATT-MON 3 calibrate voltage function.
This function calibrates the chip with known voltage.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
[in] | voltage | : Known voltage in mV. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void battmon3_cfg_setup | ( | battmon3_cfg_t * | cfg | ) |
BATT-MON 3 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See battmon3_cfg_t object definition for detailed explanation. |
err_t battmon3_check_communication | ( | battmon3_t * | ctx | ) |
BATT-MON 3 check communication function.
This function checks the communication by reading and verifying the CHEM ID value.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_default_cfg | ( | battmon3_t * | ctx | ) |
BATT-MON 3 default configuration function.
This function executes a default configuration of BATT-MON 3 click board.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_disable_gauge | ( | battmon3_t * | ctx | ) |
BATT-MON 3 disable gauge function.
This function disables gauge by stopping it and waiting for G_DONE bit to be set. And after that it clears the EN pin.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_enter_calibration_mode | ( | battmon3_t * | ctx | ) |
BATT-MON 3 enter calibration mode function.
This function enters to the calibration mode.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_exit_calibration_mode | ( | battmon3_t * | ctx | ) |
BATT-MON 3 exit calibration mode function.
This function exits from the calibration mode.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_generic_read | ( | battmon3_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | rx_buf, | ||
uint8_t | rx_len ) |
BATT-MON 3 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 battmon3_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. See #err_t definition for detailed explanation. err_t battmon3_generic_write | ( | battmon3_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | tx_buf, | ||
uint8_t | tx_len ) |
BATT-MON 3 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 battmon3_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. See #err_t definition for detailed explanation. uint8_t battmon3_get_alert_pin | ( | battmon3_t * | ctx | ) |
BATT-MON 3 get alert pin function.
This function returns the Alert pin logic state.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
err_t battmon3_init | ( | battmon3_t * | ctx, |
battmon3_cfg_t * | cfg ) |
BATT-MON 3 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See battmon3_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_new_battery | ( | battmon3_t * | ctx, |
uint16_t | des_capacity ) |
BATT-MON 3 new battery function.
This function indicates to the chip that a new battery has been inserted.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
[in] | des_capacity | : The capacity of the battery (mAh), if zero use the previous set. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_perform_board_offset | ( | battmon3_t * | ctx | ) |
BATT-MON 3 perform board offset function.
This function performs the board offset (no current should be flowing).
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_perform_cc_offset | ( | battmon3_t * | ctx | ) |
BATT-MON 3 perform CC offset function.
This function performs the CC offset (no current should be flowing).
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_read_battery_alert | ( | battmon3_t * | ctx, |
uint8_t * | batt_alert ) |
BATT-MON 3 read battery alert function.
This function reads the battery alert register.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
[out] | batt_alert | : Battery alert register value. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_read_battery_status | ( | battmon3_t * | ctx, |
uint8_t * | batt_status ) |
BATT-MON 3 read battery status function.
This function reads the battery status register.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
[out] | batt_status | : Battery status register value. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_read_control | ( | battmon3_t * | ctx, |
uint16_t | control, | ||
uint16_t * | data_out ) |
BATT-MON 3 read control function.
This function reads data from the selected control subcommand.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
[in] | control | : Control subcommand. |
[out] | data_out | : Data output read [16-bit]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_read_current | ( | battmon3_t * | ctx, |
int16_t * | current ) |
BATT-MON 3 read current function.
This function reads the battery current load from BATT+ to GND in milliampers.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
[out] | current | : Battery current in mA. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_read_data_flash | ( | battmon3_t * | ctx, |
uint16_t | address, | ||
uint8_t * | rx_buf, | ||
uint8_t | rx_len ) |
BATT-MON 3 read data flash function.
This function reads a desired number of data bytes starting from the selected data flash address.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
[in] | address | : Data flash address. |
[out] | rx_buf | : Output read data. |
[in] | rx_len | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_read_design_capacity | ( | battmon3_t * | ctx, |
uint16_t * | des_capacity ) |
BATT-MON 3 read design capacity function.
This function reads the design capacity of the cell.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
[out] | des_capacity | : The capacity of the battery (mAh). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_read_internal_temperature | ( | battmon3_t * | ctx, |
float * | temperature ) |
BATT-MON 3 read internal temperature function.
This function reads the internal temperature in Celsius.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
[out] | temperature | : Temperature in Celsius. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_read_measured_z | ( | battmon3_t * | ctx, |
uint16_t * | measured_z ) |
BATT-MON 3 read measured Z function.
This function reads the measured impedance of the cell. It is updated upon a new resistance update in EOS mode only with a resolution of 1 mOhm per bit.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
[out] | measured_z | : Measured impedance of the cell. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_read_raw_calibration_data | ( | battmon3_t * | ctx, |
uint8_t | reg, | ||
uint16_t * | cal_data ) |
BATT-MON 3 read raw calibration data function.
This function reads the RAW calibration voltage, current or temperature data.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
[in] | reg | : Calibration voltage, current or temperature register address. |
[out] | cal_data | : Output read calibration data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_read_remaining_capacity | ( | battmon3_t * | ctx, |
float * | rem_capacity ) |
BATT-MON 3 read remaining capacity function.
This function reads the remaining battery capacity in mAh. This relies on the Design Capacity of the battery having been set correctly.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
[out] | rem_capacity | : The remaining capacity of the battery (mAh). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_read_remaining_percentage | ( | battmon3_t * | ctx, |
float * | rem_percentage ) |
BATT-MON 3 read remaining percentage function.
This function reads the remaining battery capacity in percent. This relies on the Design Capacity of the battery having been set correctly.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
[out] | rem_percentage | : The remaining capacity of the battery (%). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_read_scaled_r | ( | battmon3_t * | ctx, |
uint16_t * | scaled_r ) |
BATT-MON 3 read scaled R function.
This function reads the scaled resistance of the cell. It is updated upon a new resistance update in EOS mode only with a resolution of 1 mOhm per bit.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
[out] | scaled_r | : Scaled resistance of the cell. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_read_security_mode | ( | battmon3_t * | ctx | ) |
BATT-MON 3 read security mode function.
This function reads the security mode and stores the value in ctx->security_mode.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_read_state_of_health | ( | battmon3_t * | ctx, |
uint8_t * | state_of_health ) |
BATT-MON 3 read state of health function.
This function reads the state-of-health (SOH) value.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
[out] | state_of_health | : State-of-health (SOH) value. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_read_status | ( | battmon3_t * | ctx, |
uint16_t * | status ) |
BATT-MON 3 read status function.
This function reads the control status register.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
[out] | status | : Control status [16-bit]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_read_temperature | ( | battmon3_t * | ctx, |
float * | temperature ) |
BATT-MON 3 read temperature function.
This function reads the internal or external temperature in Celsius.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
[out] | temperature | : Temperature in Celsius. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_read_two_bytes | ( | battmon3_t * | ctx, |
uint8_t | reg, | ||
uint16_t * | data_out ) |
BATT-MON 3 read two bytes function.
This function reads two bytes of data from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Data output read [16-bit]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_read_used_capacity | ( | battmon3_t * | ctx, |
float * | used_capacity ) |
BATT-MON 3 read used capacity function.
This function reads the used battery capacity in mAh.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
[out] | used_capacity | : The used capacity of the battery (mAh). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_read_voltage | ( | battmon3_t * | ctx, |
uint16_t * | voltage ) |
BATT-MON 3 read voltage function.
This function reads the battery voltage in millivolts.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
[out] | voltage | : Battery voltage in mV. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_reset | ( | battmon3_t * | ctx | ) |
BATT-MON 3 reset function.
This function performs a hard reset of the chip, reinitialising RAM data to defaults from ROM.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_set_design_capacity | ( | battmon3_t * | ctx, |
uint16_t | des_capacity ) |
BATT-MON 3 set design capacity function.
This function sets the design capacity of the cell.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
[in] | des_capacity | : The capacity of the battery (mAh). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void battmon3_set_en_pin_high | ( | battmon3_t * | ctx | ) |
BATT-MON 3 set en pin high function.
This function sets the EN pin to high logic state.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
void battmon3_set_en_pin_low | ( | battmon3_t * | ctx | ) |
BATT-MON 3 set en pin low function.
This function sets the EN pin to low logic state.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
err_t battmon3_set_gauge_mode | ( | battmon3_t * | ctx, |
uint8_t | gauge_mode ) |
BATT-MON 3 set gauge mode function.
This function sets the gauging mode.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
[in] | gauge_mode | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_set_security_mode | ( | battmon3_t * | ctx, |
uint8_t | security_mode ) |
BATT-MON 3 set security mode function.
This function sets the security mode of the chip.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
[in] | security_mode | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_start_gauge | ( | battmon3_t * | ctx | ) |
BATT-MON 3 start gauge function.
This function starts the battery gauge. Battery gauging must be switched on for the battery capacity and percentage readings to be valid. The chip will consume more when battery gauging is switched on.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_stop_gauge | ( | battmon3_t * | ctx | ) |
BATT-MON 3 stop gauge function.
This function stops the battery gauging. It doesn't handle EN pin! If BATTMON3_GAUGE_MODE_ACCUMULATOR is activated, the accumulated capacity values will be stored in non-volatile memory. Please see the warning in section 5.1.1 of the TI BQ35100 technical reference manual concerning how frequently this should be done.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_use_external_temperature | ( | battmon3_t * | ctx | ) |
BATT-MON 3 use external temperature function.
This function selects the external temperature sensor (NTC) to be used for temperature measurements.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_use_internal_temperature | ( | battmon3_t * | ctx | ) |
BATT-MON 3 use internal temperature function.
This function selects the internal temperature sensor to be used for temperature measurements.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_wait_for_status | ( | battmon3_t * | ctx, |
uint16_t | mask, | ||
uint16_t | status ) |
BATT-MON 3 wait for status function.
This function waits for the specific status to occur (up to 10 seconds).
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
[in] | mask | : Bit mask to be matched. |
[in] | status | : Status of bit mask to be matched. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_write_control | ( | battmon3_t * | ctx, |
uint16_t | control ) |
BATT-MON 3 write control function.
This function writes the selected control subcommand.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
[in] | control | : Control subcommand. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_write_data_flash | ( | battmon3_t * | ctx, |
uint16_t | address, | ||
uint8_t * | tx_buf, | ||
uint8_t | tx_len ) |
BATT-MON 3 write data flash function.
This function writes a desired number of data bytes starting from the selected data flash address.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
[in] | address | : Data flash address. |
[in] | tx_buf | : Data to be written. |
[in] | tx_len | : Number of bytes to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t battmon3_write_two_bytes | ( | battmon3_t * | ctx, |
uint8_t | reg, | ||
uint16_t | data_in ) |
BATT-MON 3 write two bytes function.
This function writes two bytes of data to the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See battmon3_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written [16-bit]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.