powerbank 2.0.0.0
|
Functions | |
void | powerbank_cfg_setup (powerbank_cfg_t *cfg) |
Config Object Initialization function. | |
POWERBANK_RETVAL | powerbank_init (powerbank_t *ctx, powerbank_cfg_t *cfg) |
Initialization function. | |
void | powerbank_generic_write (powerbank_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | powerbank_generic_read (powerbank_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
uint16_t | powerbank_read_data (powerbank_t *ctx) |
Read data function. | |
uint16_t | powerbank_read_voltage (powerbank_t *ctx, uint16_t v_ref) |
Read voltage function. | |
void powerbank_cfg_setup | ( | powerbank_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void powerbank_generic_read | ( | powerbank_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 powerbank_generic_write | ( | powerbank_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.
POWERBANK_RETVAL powerbank_init | ( | powerbank_t * | ctx, |
powerbank_cfg_t * | cfg ) |
Initialization function.
powerbank | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
uint16_t powerbank_read_data | ( | powerbank_t * | ctx | ) |
Read data function.
ctx | Click object. |
@description This function is used to read raw data from MCP3221.
uint16_t powerbank_read_voltage | ( | powerbank_t * | ctx, |
uint16_t | v_ref ) |
Read voltage function.
ctx | Click object. |
v_ref | 16-bit value representing power supply voltage. |
@description This function is used to calculate voltage of the connected battery.