balancer5 2.0.0.0
Public function

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.
 

Detailed Description

Function Documentation

◆ balancer5_cfg_setup()

void balancer5_cfg_setup ( balancer5_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.

◆ balancer5_charge()

void balancer5_charge ( balancer5_t * ctx,
uint8_t state )

Function for setting charging status.

Parameters
ctxClick object.
stateState of charge status to be set.

@description This function sets charging status.

◆ balancer5_check_id()

uint8_t balancer5_check_id ( balancer5_t * ctx)

Checks if device ID is good.

Parameters
ctxClick object.
Returns
BALANCER5_ERROR_ID or BALANCER5_SUCCESSFUL.

@description This function checks if device ID is good.

◆ balancer5_default_cfg()

void balancer5_default_cfg ( balancer5_t * ctx)

Click Default Configuration function.

Parameters
ctxClick object.

@description This function executes default configuration for Balancer5 click.

Note
 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". 

◆ balancer5_generic_read()

void balancer5_generic_read ( balancer5_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.

◆ balancer5_generic_write()

void balancer5_generic_write ( balancer5_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.

◆ balancer5_get_int_status()

uint8_t balancer5_get_int_status ( balancer5_t * ctx)

Gets state of the int pin.

Parameters
ctxClick object.
Returns
State of the pin.

@description This function gets int pin status.

◆ balancer5_get_power_good_status()

uint8_t balancer5_get_power_good_status ( balancer5_t * ctx)

Gets state of the pg pin on an.

Parameters
ctxClick object.
Returns
State of the pin.

@description This function gets state of an pin i.e pg pin status.

◆ balancer5_get_power_source_status()

uint8_t balancer5_get_power_source_status ( balancer5_t * ctx)

Gets state of the psel pin on rst.

Parameters
ctxClick object.
Returns
State of the rst i.e pss pin.

@description This function gets pss i.e rst pin status.

◆ balancer5_init()

BALANCER5_RETVAL balancer5_init ( balancer5_t * ctx,
balancer5_cfg_t * cfg )

Initialization function.

Parameters
balancer5Click object.
cfgClick configuration structure.

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

◆ balancer5_read_data()

uint8_t balancer5_read_data ( balancer5_t * ctx,
uint8_t reg_addr )

Generic function for reading one Byte data from registar.

Parameters
ctxClick object.
reg_addrCommand Registar.
Returns
data read from reg_addr

@description This function reads one byte from address reg_addr

◆ balancer5_write_data()

void balancer5_write_data ( balancer5_t * ctx,
uint8_t reg_addr,
uint8_t write_data )

Generic function for writing one Byte data to registar.

Parameters
ctxClick object.
reg_addrCommand Registar.
write_datadata to be written to reg_addr.

@description This function writes one byte to address reg_addr.