charger2 2.0.0.0
Public function

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.
 

Detailed Description

Function Documentation

◆ charger2_cfg_setup()

void charger2_cfg_setup ( charger2_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.

◆ charger2_check_conv_cycle()

uint8_t charger2_check_conv_cycle ( charger2_t * ctx,
uint8_t conv_mode )

Conversion Cycle Check function.

Parameters
ctxClick object.
conv_modeDetermines 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.

◆ charger2_generic_read()

void charger2_generic_read ( charger2_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic read function.

Parameters
ctxClick object.
regRegister address.
data_bufOutput data buf
lenNumber of the bytes to be read

@description This function reads data from the desired register.

◆ charger2_generic_write()

void charger2_generic_write ( charger2_t * ctx,
uint8_t reg,
uint8_t * data_buf,
uint8_t len )

Generic write function.

Parameters
ctxClick object.
regRegister address.
data_bufData buf to be written.
lenNumber of the bytes in data buf.

@description This function writes data to the desired register.

◆ charger2_init()

CHARGER2_RETVAL charger2_init ( charger2_t * ctx,
charger2_cfg_t * cfg )

Initialization function.

Parameters
charger2Click object.
cfgClick configuration structure.

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

◆ charger2_read_data()

uint8_t charger2_read_data ( charger2_t * ctx,
uint8_t data_mode,
uint32_t * data_out )

Data Read function.

Parameters
ctxClick object.
data_modeDetermines the data to be read.
data_outBuffer where data be stored.

@description This function reads the desired data from data registers and converts this data to the appropriate unit.

◆ charger2_read_reg()

uint8_t charger2_read_reg ( charger2_t * ctx,
uint8_t register_address,
uint8_t * value_out,
uint8_t n_bytes )

Read reg function.

Parameters
ctxClick object.
register_addressAddress which from data be read.
value_outBuffer where data be stored.
n_bytesNumber of bytes to be read.

@description This function reads the desired number of data bytes.

◆ charger2_reset()

uint8_t charger2_reset ( charger2_t * ctx,
uint8_t reset_mode )

Reset function.

Parameters
ctxClick object.
reset_modeDetermines 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.

◆ charger2_write_reg()

uint8_t charger2_write_reg ( charger2_t * ctx,
uint8_t register_address,
uint8_t transfer_data )

Write reg function.

Parameters
ctxClick object.
register_addressAddress where data be written.
transfer_dataData to be written.

@description This function writes one byte data to the register.