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.
 

Detailed Description

Function Documentation

◆ charger12_cfg_setup()

void charger12_cfg_setup ( charger12_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ charger12_cs_set()

void charger12_cs_set ( charger12_t * ctx,
uint8_t pin_state )

Setting CS pin state.

Parameters
ctxClick object.
pin_statePin state.

@description This function sets CS pin state.

◆ charger12_generic_transfer()

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.

Parameters
ctxClick object.
data_inData in.
data_outData output.
tx_lenTransmitter lenght.
rx_lenReceiver lenght.

@description Generic SPI transfer, for sending and receiving packages

◆ charger12_init()

CHARGER12_RETVAL charger12_init ( charger12_t * ctx,
charger12_cfg_t * cfg )

Initialization function.

Parameters
ctxClick object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ charger12_int_get()

uint8_t charger12_int_get ( charger12_t * ctx)

Getting INT pin state.

Parameters
ctxClick object.

@description This function return 0 if INT pin is in LOW state or 1 if INT pin is in HIGH state.

◆ charger12_mode_select()

uint8_t charger12_mode_select ( charger12_t * ctx,
uint8_t mode_select )

Selecting device operation mode.

Parameters
ctxClick object.
mode_selectMode selection.

@description This function selects device operation mode by setting RST(CHGEN) and PWM(MODE) pins.

◆ charger12_pwm_set()

void charger12_pwm_set ( charger12_t * ctx,
uint8_t pin_state )

Setting PWM pin state.

Parameters
ctxClick object.
pin_statePin state.

@description This function sets PWM pin state.

◆ charger12_rst_set()

void charger12_rst_set ( charger12_t * ctx,
uint8_t pin_state )

Setting RST pin state.

Parameters
ctxClick object.
pin_statePin state.

@description This function sets RST pin state.

◆ charger12_spi_decrement_wiper()

void charger12_spi_decrement_wiper ( charger12_t * ctx)

Decrementing wiper position.

Parameters
ctxClick object.

@description This function decrements wiper position by sending 8bit decrement wiper command.S

◆ charger12_spi_increment_wiper()

void charger12_spi_increment_wiper ( charger12_t * ctx)

Incrementing wiper position.

Parameters
ctxClick object.

@description This function increments wiper position by sending 8bit increment wiper command.

◆ charger12_spi_set_register()

void charger12_spi_set_register ( charger12_t * ctx,
uint8_t register_address,
uint16_t register_value )

Setting register.

Parameters
ctxClick object.
register_addressRegister address.
register_valueRegister value.

@description This function sets register value.