balancer5 2.0.0.0
|
Functions | |
void | balancer5_cfg_setup (balancer5_cfg_t *cfg) |
Config Object Initialization function. | |
BALANCER5_RETVAL | balancer5_init (balancer5_t *ctx, balancer5_cfg_t *cfg) |
Initialization function. | |
void | balancer5_default_cfg (balancer5_t *ctx) |
Click Default Configuration function. | |
void | balancer5_generic_write (balancer5_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | balancer5_generic_read (balancer5_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
uint8_t | balancer5_read_data (balancer5_t *ctx, uint8_t reg_addr) |
Generic function for reading one Byte data from registar. | |
void | balancer5_write_data (balancer5_t *ctx, uint8_t reg_addr, uint8_t write_data) |
Generic function for writing one Byte data to registar. | |
void | balancer5_charge (balancer5_t *ctx, uint8_t state) |
Function for setting charging status. | |
uint8_t | balancer5_get_int_status (balancer5_t *ctx) |
Gets state of the int pin. | |
uint8_t | balancer5_get_power_good_status (balancer5_t *ctx) |
Gets state of the pg pin on an. | |
uint8_t | balancer5_get_power_source_status (balancer5_t *ctx) |
Gets state of the psel pin on rst. | |
uint8_t | balancer5_check_id (balancer5_t *ctx) |
Checks if device ID is good. | |
void balancer5_cfg_setup | ( | balancer5_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void balancer5_charge | ( | balancer5_t * | ctx, |
uint8_t | state ) |
Function for setting charging status.
ctx | Click object. |
state | State of charge status to be set. |
@description This function sets charging status.
uint8_t balancer5_check_id | ( | balancer5_t * | ctx | ) |
Checks if device ID is good.
ctx | Click object. |
@description This function checks if device ID is good.
void balancer5_default_cfg | ( | balancer5_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
@description This function executes default configuration for Balancer5 click.
Default config in this implementation means "write BALANCER5_ADC_CTRL_ENABLE | BALANCER5_ADC_CTRL_CONT_CONV | BALANCER5_ADC_CTRL_15BIT_RES value to BALANCER5_REG_ADC_CTRL register address".
void balancer5_generic_read | ( | balancer5_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 balancer5_generic_write | ( | balancer5_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.
uint8_t balancer5_get_int_status | ( | balancer5_t * | ctx | ) |
Gets state of the int pin.
ctx | Click object. |
@description This function gets int pin status.
uint8_t balancer5_get_power_good_status | ( | balancer5_t * | ctx | ) |
Gets state of the pg pin on an.
ctx | Click object. |
@description This function gets state of an pin i.e pg pin status.
uint8_t balancer5_get_power_source_status | ( | balancer5_t * | ctx | ) |
Gets state of the psel pin on rst.
ctx | Click object. |
@description This function gets pss i.e rst pin status.
BALANCER5_RETVAL balancer5_init | ( | balancer5_t * | ctx, |
balancer5_cfg_t * | cfg ) |
Initialization function.
balancer5 | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
uint8_t balancer5_read_data | ( | balancer5_t * | ctx, |
uint8_t | reg_addr ) |
Generic function for reading one Byte data from registar.
ctx | Click object. |
reg_addr | Command Registar. |
@description This function reads one byte from address reg_addr
void balancer5_write_data | ( | balancer5_t * | ctx, |
uint8_t | reg_addr, | ||
uint8_t | write_data ) |
Generic function for writing one Byte data to registar.
ctx | Click object. |
reg_addr | Command Registar. |
write_data | data to be written to reg_addr. |
@description This function writes one byte to address reg_addr.