charger12 2.0.0.0
|
Functions | |
void | charger12_cfg_setup (charger12_cfg_t *cfg) |
Config Object Initialization function. | |
CHARGER12_RETVAL | charger12_init (charger12_t *ctx, charger12_cfg_t *cfg) |
Initialization function. | |
void | charger12_generic_transfer (charger12_t *ctx, uint8_t *data_in, uint8_t *data_out, uint8_t tx_len, uint8_t rx_len) |
Generic transfer function. | |
uint8_t | charger12_int_get (charger12_t *ctx) |
Getting INT pin state. | |
void | charger12_pwm_set (charger12_t *ctx, uint8_t pin_state) |
Setting PWM pin state. | |
void | charger12_rst_set (charger12_t *ctx, uint8_t pin_state) |
Setting RST pin state. | |
void | charger12_cs_set (charger12_t *ctx, uint8_t pin_state) |
Setting CS pin state. | |
uint8_t | charger12_mode_select (charger12_t *ctx, uint8_t mode_select) |
Selecting device operation mode. | |
void | charger12_spi_set_register (charger12_t *ctx, uint8_t register_address, uint16_t register_value) |
Setting register. | |
void | charger12_spi_increment_wiper (charger12_t *ctx) |
Incrementing wiper position. | |
void | charger12_spi_decrement_wiper (charger12_t *ctx) |
Decrementing wiper position. | |
void charger12_cfg_setup | ( | charger12_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void charger12_cs_set | ( | charger12_t * | ctx, |
uint8_t | pin_state ) |
Setting CS pin state.
ctx | Click object. |
pin_state | Pin state. |
@description This function sets CS pin state.
void charger12_generic_transfer | ( | charger12_t * | ctx, |
uint8_t * | data_in, | ||
uint8_t * | data_out, | ||
uint8_t | tx_len, | ||
uint8_t | rx_len ) |
Generic transfer function.
ctx | Click object. |
data_in | Data in. |
data_out | Data output. |
tx_len | Transmitter lenght. |
rx_len | Receiver lenght. |
@description Generic SPI transfer, for sending and receiving packages
CHARGER12_RETVAL charger12_init | ( | charger12_t * | ctx, |
charger12_cfg_t * | cfg ) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
uint8_t charger12_int_get | ( | charger12_t * | ctx | ) |
Getting INT pin state.
ctx | Click object. |
@description This function return 0 if INT pin is in LOW state or 1 if INT pin is in HIGH state.
uint8_t charger12_mode_select | ( | charger12_t * | ctx, |
uint8_t | mode_select ) |
Selecting device operation mode.
ctx | Click object. |
mode_select | Mode selection. |
@description This function selects device operation mode by setting RST(CHGEN) and PWM(MODE) pins.
void charger12_pwm_set | ( | charger12_t * | ctx, |
uint8_t | pin_state ) |
Setting PWM pin state.
ctx | Click object. |
pin_state | Pin state. |
@description This function sets PWM pin state.
void charger12_rst_set | ( | charger12_t * | ctx, |
uint8_t | pin_state ) |
Setting RST pin state.
ctx | Click object. |
pin_state | Pin state. |
@description This function sets RST pin state.
void charger12_spi_decrement_wiper | ( | charger12_t * | ctx | ) |
Decrementing wiper position.
ctx | Click object. |
@description This function decrements wiper position by sending 8bit decrement wiper command.S
void charger12_spi_increment_wiper | ( | charger12_t * | ctx | ) |
Incrementing wiper position.
ctx | Click object. |
@description This function increments wiper position by sending 8bit increment wiper command.
void charger12_spi_set_register | ( | charger12_t * | ctx, |
uint8_t | register_address, | ||
uint16_t | register_value ) |
Setting register.
ctx | Click object. |
register_address | Register address. |
register_value | Register value. |
@description This function sets register value.