charger2 2.0.0.0
|
Functions | |
void | charger2_cfg_setup (charger2_cfg_t *cfg) |
Config Object Initialization function. | |
CHARGER2_RETVAL | charger2_init (charger2_t *ctx, charger2_cfg_t *cfg) |
Initialization function. | |
void | charger2_generic_write (charger2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | charger2_generic_read (charger2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
uint8_t | charger2_write_reg (charger2_t *ctx, uint8_t register_address, uint8_t transfer_data) |
Write reg function. | |
uint8_t | charger2_read_reg (charger2_t *ctx, uint8_t register_address, uint8_t *value_out, uint8_t n_bytes) |
Read reg function. | |
uint8_t | charger2_read_data (charger2_t *ctx, uint8_t data_mode, uint32_t *data_out) |
Data Read function. | |
uint8_t | charger2_reset (charger2_t *ctx, uint8_t reset_mode) |
Reset function. | |
uint8_t | charger2_check_conv_cycle (charger2_t *ctx, uint8_t conv_mode) |
Conversion Cycle Check function. | |
void charger2_cfg_setup | ( | charger2_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
uint8_t charger2_check_conv_cycle | ( | charger2_t * | ctx, |
uint8_t | conv_mode ) |
Conversion Cycle Check function.
ctx | Click object. |
conv_mode | Determines which conversion cycle be checked, for current (0), or for voltage and temperature (1). |
@description This function checks is conversion cycle for battery current, or for battery voltage and temperature, finished, and if is not, waits until one of this conversions be finished.
void charger2_generic_read | ( | charger2_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic read function.
ctx | Click object. |
reg | Register address. |
data_buf | Output data buf |
len | Number of the bytes to be read |
@description This function reads data from the desired register.
void charger2_generic_write | ( | charger2_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic write function.
ctx | Click object. |
reg | Register address. |
data_buf | Data buf to be written. |
len | Number of the bytes in data buf. |
@description This function writes data to the desired register.
CHARGER2_RETVAL charger2_init | ( | charger2_t * | ctx, |
charger2_cfg_t * | cfg ) |
Initialization function.
charger2 | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
uint8_t charger2_read_data | ( | charger2_t * | ctx, |
uint8_t | data_mode, | ||
uint32_t * | data_out ) |
Data Read function.
ctx | Click object. |
data_mode | Determines the data to be read. |
data_out | Buffer where data be stored. |
@description This function reads the desired data from data registers and converts this data to the appropriate unit.
uint8_t charger2_read_reg | ( | charger2_t * | ctx, |
uint8_t | register_address, | ||
uint8_t * | value_out, | ||
uint8_t | n_bytes ) |
Read reg function.
ctx | Click object. |
register_address | Address which from data be read. |
value_out | Buffer where data be stored. |
n_bytes | Number of bytes to be read. |
@description This function reads the desired number of data bytes.
uint8_t charger2_reset | ( | charger2_t * | ctx, |
uint8_t | reset_mode ) |
Reset function.
ctx | Click object. |
reset_mode | Determines which reset be performed, for counter and accumulator (0), or software reset (1). |
@description This function performs the counter and accumulator reset or the software reset.
uint8_t charger2_write_reg | ( | charger2_t * | ctx, |
uint8_t | register_address, | ||
uint8_t | transfer_data ) |
Write reg function.
ctx | Click object. |
register_address | Address where data be written. |
transfer_data | Data to be written. |
@description This function writes one byte data to the register.