charger19 2.1.0.0
Charger 19 Click Driver

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

Topics

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

Functions

void charger19_cfg_setup (charger19_cfg_t *cfg)
 Charger 19 configuration object setup function.
 
err_t charger19_init (charger19_t *ctx, charger19_cfg_t *cfg)
 Charger 19 initialization function.
 
err_t charger19_default_cfg (charger19_t *ctx)
 Charger 19 default configuration function.
 
err_t charger19_read_an_pin_value (charger19_t *ctx, uint16_t *data_out)
 Charger 19 read AN pin value function.
 
err_t charger19_read_an_pin_voltage (charger19_t *ctx, float *data_out)
 Charger 19 read AN pin voltage level function.
 
err_t charger19_set_vout (charger19_t *ctx, uint8_t vout_sel)
 Charger 19 set output voltage function.
 
void charger19_set_ship_mode (charger19_t *ctx, uint8_t ship_sel)
 Charger 19 set Ship mode function.
 
err_t charger19_get_vbat (charger19_t *ctx, float *vbat)
 Charger 19 get battery voltage function.
 

Detailed Description

API for configuring and manipulating Charger 19 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

◆ charger19_cfg_setup()

void charger19_cfg_setup ( charger19_cfg_t * cfg)

Charger 19 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ charger19_default_cfg()

err_t charger19_default_cfg ( charger19_t * ctx)

Charger 19 default configuration function.

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

Parameters
[in]ctx: Click context object. See charger19_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.

◆ charger19_get_vbat()

err_t charger19_get_vbat ( charger19_t * ctx,
float * vbat )

Charger 19 get battery voltage function.

This function is used to get battery voltage.

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

◆ charger19_init()

err_t charger19_init ( charger19_t * ctx,
charger19_cfg_t * cfg )

Charger 19 initialization function.

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

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

◆ charger19_read_an_pin_value()

err_t charger19_read_an_pin_value ( charger19_t * ctx,
uint16_t * data_out )

Charger 19 read AN pin value function.

This function reads results of AD conversion of the AN pin.

Parameters
[in]ctx: Click context object. See charger19_t object definition for detailed explanation.
[out]data_out: Output ADC result.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ charger19_read_an_pin_voltage()

err_t charger19_read_an_pin_voltage ( charger19_t * ctx,
float * data_out )

Charger 19 read AN pin voltage level function.

This function reads results of AD conversion of the AN pin and converts them to proportional voltage level.

Parameters
[in]ctx: Click context object. See charger19_t object definition for detailed explanation.
[out]data_out: Output voltage level of the analog pin [V].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
The conversion to voltage depends on the entered configuration of the ADC (resolution, reference voltage).

◆ charger19_set_ship_mode()

void charger19_set_ship_mode ( charger19_t * ctx,
uint8_t ship_sel )

Charger 19 set Ship mode function.

This function is used to enable ship mode.

Parameters
[in]ctx: Click context object. See charger19_t object definition for detailed explanation.
[in]ship_sel: Ship mode selection.
Returns
Nothing.
Note
None.

◆ charger19_set_vout()

err_t charger19_set_vout ( charger19_t * ctx,
uint8_t vout_sel )

Charger 19 set output voltage function.

This function is used to set voltage output.

Parameters
[in]ctx: Click context object. See charger19_t object definition for detailed explanation.
[in]vout_sel: Output voltage selection.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can be used only when Vsys is not existing.