charger17 2.1.0.0
Charger 17 Click Driver

API for configuring and manipulating Charger 17 Click driver. More...

Topics

 Charger 17 Registers List
 List of registers of Charger 17 Click driver.
 
 Charger 17 Registers Settings
 Settings for registers of Charger 17 Click driver.
 
 Charger 17 MikroBUS Map
 MikroBUS pin mapping of Charger 17 Click driver.
 

Functions

void charger17_cfg_setup (charger17_cfg_t *cfg)
 Charger 17 configuration object setup function.
 
err_t charger17_init (charger17_t *ctx, charger17_cfg_t *cfg)
 Charger 17 initialization function.
 
err_t charger17_default_cfg (charger17_t *ctx)
 Charger 17 default configuration function.
 
err_t charger17_generic_write (charger17_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Charger 17 I2C writing function.
 
err_t charger17_generic_read (charger17_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Charger 17 I2C reading function.
 
err_t charger17_write_register (charger17_t *ctx, uint8_t reg, uint8_t data_in)
 Charger 17 write register function.
 
err_t charger17_read_register (charger17_t *ctx, uint8_t reg, uint8_t *data_out)
 Charger 17 read register function.
 
err_t charger17_check_communication (charger17_t *ctx)
 Charger 17 check communication function.
 
void charger17_set_qon_pin (charger17_t *ctx, uint8_t state)
 Charger 17 set qon pin function.
 
void charger17_enable_charging (charger17_t *ctx)
 Charger 17 enable charging function.
 
void charger17_disable_charging (charger17_t *ctx)
 Charger 17 disable charging function.
 
void charger17_set_psel_500mA (charger17_t *ctx)
 Charger 17 set psel 500mA function.
 
void charger17_set_psel_2400mA (charger17_t *ctx)
 Charger 17 set psel 2400mA function.
 
uint8_t charger17_get_int_pin (charger17_t *ctx)
 Charger 17 get int pin function.
 

Detailed Description

API for configuring and manipulating Charger 17 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ charger17_cfg_setup()

void charger17_cfg_setup ( charger17_cfg_t * cfg)

Charger 17 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See charger17_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ charger17_check_communication()

err_t charger17_check_communication ( charger17_t * ctx)

Charger 17 check communication function.

This function checks the communication by reading and verifying the device ID.

Parameters
[in]ctx: Click context object. See charger17_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ charger17_default_cfg()

err_t charger17_default_cfg ( charger17_t * ctx)

Charger 17 default configuration function.

This function executes a default configuration of Charger 17 click board.

Parameters
[in]ctx: Click context object. See charger17_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ charger17_disable_charging()

void charger17_disable_charging ( charger17_t * ctx)

Charger 17 disable charging function.

This function disables charging by setting the CE pin to high logic state.

Parameters
[in]ctx: Click context object. See charger17_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ charger17_enable_charging()

void charger17_enable_charging ( charger17_t * ctx)

Charger 17 enable charging function.

This function enables charging by setting the CE pin to low logic state.

Parameters
[in]ctx: Click context object. See charger17_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ charger17_generic_read()

err_t charger17_generic_read ( charger17_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

Charger 17 I2C reading function.

This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See charger17_t object definition for detailed explanation.
[in]reg: Start register address.
[out]data_out: Output read data.
[in]len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ charger17_generic_write()

err_t charger17_generic_write ( charger17_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

Charger 17 I2C writing function.

This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See charger17_t object definition for detailed explanation.
[in]reg: Start register address.
[in]data_in: Data to be written.
[in]len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ charger17_get_int_pin()

uint8_t charger17_get_int_pin ( charger17_t * ctx)

Charger 17 get int pin function.

This function returns the INT pin logic state.

Parameters
[in]ctx: Click context object. See charger17_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ charger17_init()

err_t charger17_init ( charger17_t * ctx,
charger17_cfg_t * cfg )

Charger 17 initialization function.

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

Parameters
[out]ctx: Click context object. See charger17_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See charger17_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ charger17_read_register()

err_t charger17_read_register ( charger17_t * ctx,
uint8_t reg,
uint8_t * data_out )

Charger 17 read register function.

This function reads data from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See charger17_t object definition for detailed explanation.
[in]reg: Register address.
[out]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ charger17_set_psel_2400mA()

void charger17_set_psel_2400mA ( charger17_t * ctx)

Charger 17 set psel 2400mA function.

This function sets charging current to 2400mA by setting the PSEL pin to low logic state.

Parameters
[in]ctx: Click context object. See charger17_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ charger17_set_psel_500mA()

void charger17_set_psel_500mA ( charger17_t * ctx)

Charger 17 set psel 500mA function.

This function sets charging current to 500mA by setting the PSEL pin to high logic state.

Parameters
[in]ctx: Click context object. See charger17_t object definition for detailed explanation.
Returns
None.
Note
None.

◆ charger17_set_qon_pin()

void charger17_set_qon_pin ( charger17_t * ctx,
uint8_t state )

Charger 17 set qon pin function.

This function sets the QON pin logic state.

Parameters
[in]ctx: Click context object. See charger17_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
None.
Note
None.

◆ charger17_write_register()

err_t charger17_write_register ( charger17_t * ctx,
uint8_t reg,
uint8_t data_in )

Charger 17 write register function.

This function writes a data bytes to the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See charger17_t object definition for detailed explanation.
[in]reg: Register address.
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.