charger6 2.0.0.0
Charger 6 Click Driver

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

Topics

 Charger 6 Registers List
 List of registers of Charger 6 Click driver.
 
 Charger 6 power source selection
 Power source selection of Charger 6 Click driver.
 
 Charger 6 system minimum voltage.
 System minimum voltage of Charger 6 Click driver.
 
 Charger 6 top off timer.
 Top off timer of Charger 6 Click driver.
 
 Charger 6 Registers Settings
 Settings for registers of Charger 6 Click driver.
 
 Charger 6 MikroBUS Map
 MikroBUS pin mapping of Charger 6 Click driver.
 

Functions

void charger6_cfg_setup (charger6_cfg_t *cfg)
 Charger 6 configuration object setup function.
 
err_t charger6_init (charger6_t *ctx, charger6_cfg_t *cfg)
 Charger 6 initialization function.
 
err_t charger6_default_cfg (charger6_t *ctx)
 Charger 6 default configuration function.
 
err_t charger6_generic_write (charger6_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len)
 Charger 6 I2C writing function.
 
err_t charger6_generic_read (charger6_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len)
 Charger 6 I2C reading function.
 
void charger6_enable_battery_charging (charger6_t *ctx)
 Charger 6 charge enable function.
 
void charger6_disable_battery_charging (charger6_t *ctx)
 Charger 6 charge disable function.
 
void charger6_power_source_selection (charger6_t *ctx, uint8_t pwr_sel)
 Charger 6 power source selection function.
 
err_t charger6_set_input_current_limit (charger6_t *ctx, uint16_t current_limit)
 Charger 6 set input current limit function.
 
err_t charger6_set_system_minimum_voltage (charger6_t *ctx, uint16_t sys_min_voltage)
 Charger 6 set system minimum voltage function.
 
err_t charger6_get_status (charger6_t *ctx, charger6_status_t *chg_status)
 Charger 6 get status function.
 
err_t charger6_set_fast_charge_current (charger6_t *ctx, uint16_t fast_chg_current)
 Charger 6 set fast charge current function.
 
uint16_t charger6_get_fast_charge_current (charger6_t *ctx)
 Charger 6 get fast charge current function.
 
err_t charger6_set_precharge_current (charger6_t *ctx, uint16_t precharge_current)
 Charger 6 set precharge current function.
 
err_t charger6_set_termination_current (charger6_t *ctx, uint16_t termination_current)
 Charger 6 set termination current function.
 
err_t charger6_set_charge_voltage (charger6_t *ctx, uint16_t charge_voltage)
 Charger 6 set charge voltage function.
 
err_t charger6_set_top_off_timer (charger6_t *ctx, uint8_t top_off_time)
 Charger 6 set top OFF timer function.
 
uint8_t charger6_check_interrupt (charger6_t *ctx)
 Charger 6 check interrupt function.
 
void charger6_hw_reset (charger6_t *ctx)
 Charger 6 hw reset function.
 

Detailed Description

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

◆ charger6_cfg_setup()

void charger6_cfg_setup ( charger6_cfg_t * cfg)

Charger 6 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ charger6_check_interrupt()

uint8_t charger6_check_interrupt ( charger6_t * ctx)

Charger 6 check interrupt function.

This function check the interrupt state, the state of the INT pin of the BQ25601, I2C Controlled 3-A Single-Cell Battery Charger for High Input Voltage and Narrow Voltage DC (NVDC) Power Path Management on the Charger 6 Click board.

Parameters
[in]ctx: Click context object. See #touchpad2_t object definition for detailed explanation.
Returns
  • 0 - INT pin state low,
  • 1 - INT pin state high.
Note
None.

◆ charger6_default_cfg()

err_t charger6_default_cfg ( charger6_t * ctx)

Charger 6 default configuration function.

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

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

◆ charger6_disable_battery_charging()

void charger6_disable_battery_charging ( charger6_t * ctx)

Charger 6 charge disable function.

This function disable battery charging of the BQ25601, I2C Controlled 3-A Single-Cell Battery Charger for High Input Voltage and Narrow Voltage DC (NVDC) Power Path Management on the Charger 6 Click board.

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

◆ charger6_enable_battery_charging()

void charger6_enable_battery_charging ( charger6_t * ctx)

Charger 6 charge enable function.

This function enable battery charging of the BQ25601, I2C Controlled 3-A Single-Cell Battery Charger for High Input Voltage and Narrow Voltage DC (NVDC) Power Path Management on the Charger 6 Click board.

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

◆ charger6_generic_read()

err_t charger6_generic_read ( charger6_t * ctx,
uint8_t reg,
uint8_t * rx_buf,
uint8_t rx_len )

Charger 6 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 charger6_t object definition for detailed explanation.
[in]reg: Start register address.
[out]rx_buf: Output read data.
[in]rx_len: Number of bytes to be read.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ charger6_generic_write()

err_t charger6_generic_write ( charger6_t * ctx,
uint8_t reg,
uint8_t * tx_buf,
uint8_t tx_len )

Charger 6 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 charger6_t object definition for detailed explanation.
[in]reg: Start register address.
[in]tx_buf: Data to be written.
[in]tx_len: Number of bytes to be written.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ charger6_get_fast_charge_current()

uint16_t charger6_get_fast_charge_current ( charger6_t * ctx)

Charger 6 get fast charge current function.

This function get fast charge current limit data of the BQ25601, I2C Controlled 3-A Single-Cell Battery Charger for High Input Voltage and Narrow Voltage DC (NVDC) Power Path Management on the Charger 6 Click board.

Parameters
[in]ctx: Click context object. See charger6_t object definition for detailed explanation.
Returns
Fast charge current limit ( mA ).
Note
None.

◆ charger6_get_status()

err_t charger6_get_status ( charger6_t * ctx,
charger6_status_t * chg_status )

Charger 6 get status function.

This function get status data of the BQ25601, I2C Controlled 3-A Single-Cell Battery Charger for High Input Voltage and Narrow Voltage DC (NVDC) Power Path Management on the Charger 6 Click board.

Parameters
[in]ctx: Click context object. See charger6_t object definition for detailed explanation.
[out]chg_status: Pointer to the memory location of the structure where data be stored.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ charger6_hw_reset()

void charger6_hw_reset ( charger6_t * ctx)

Charger 6 hw reset function.

This function performs hardware reset of the BQ25601, I2C Controlled 3-A Single-Cell Battery Charger for High Input Voltage and Narrow Voltage DC (NVDC) Power Path Management on the Charger 6 Click board.

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

◆ charger6_init()

err_t charger6_init ( charger6_t * ctx,
charger6_cfg_t * cfg )

Charger 6 initialization function.

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

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

◆ charger6_power_source_selection()

void charger6_power_source_selection ( charger6_t * ctx,
uint8_t pwr_sel )

Charger 6 power source selection function.

This function performs input current limit power source mode selection of the BQ25601, I2C Controlled 3-A Single-Cell Battery Charger for High Input Voltage and Narrow Voltage DC (NVDC) Power Path Management on the Charger 6 Click board.

Parameters
[in]ctx: Click context object. See charger6_t object definition for detailed explanation.
[in]pwr_sel:
  • 0x00 ( CHARGER6_PSEL_SW_MANUAL ) - Set 2400 mA input current limit,
  • 0x01 ( CHARGER6_PSEL_500_mA ) - Set 500 mA input current limit.
Returns
Nothing.
Note
Once the device gets into host ( Manual ) mode, the host can program different input current limits.

◆ charger6_set_charge_voltage()

err_t charger6_set_charge_voltage ( charger6_t * ctx,
uint16_t charge_voltage )

Charger 6 set charge voltage function.

This function set charge voltage ( Range: 3856 mV – 4624 mV ) of the BQ25601, I2C Controlled 3-A Single-Cell Battery Charger for High Input Voltage and Narrow Voltage DC (NVDC) Power Path Management on the Charger 6 Click board.

Parameters
[in]ctx: Click context object. See charger6_t object definition for detailed explanation.
[in]charge_voltage: Charge Voltage 3856 mV – 4624 mV.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ charger6_set_fast_charge_current()

err_t charger6_set_fast_charge_current ( charger6_t * ctx,
uint16_t fast_chg_current )

Charger 6 set fast charge current function.

This function set fast charge current limit ( Range: 0 mA – 3000 mA ) of the BQ25601, I2C Controlled 3-A Single-Cell Battery Charger for High Input Voltage and Narrow Voltage DC (NVDC) Power Path Management on the Charger 6 Click board.

Parameters
[in]ctx: Click context object. See charger6_t object definition for detailed explanation.
[in]fast_chg_current: Fast Charge Current 0 mA – 3000 mA.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
Charge current regulation range from 0 mA to 3000 mA. The device is compliant with USB 2.0 and USB 3.0 power spec with input current and voltage regulation. The device also meets USB On-the-Go (OTG) operation power rating specification by supplying 5150 mV on VBUS with constant current limit up to 1200 mA.

◆ charger6_set_input_current_limit()

err_t charger6_set_input_current_limit ( charger6_t * ctx,
uint16_t current_limit )

Charger 6 set input current limit function.

This function set the input current limit ( Range : 100 mA – 3200 mA ) of the BQ25601, I2C Controlled 3-A Single-Cell Battery Charger for High Input Voltage and Narrow Voltage DC (NVDC) Power Path Management on the Charger 6 Click board.

Parameters
[in]ctx: Click context object. See charger6_t object definition for detailed explanation.
[in]current_limit: Input Current Limit 100 mA – 3200 mA.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
If changed automatically after input source detection is completed ( device gets into host ( Manual ) mode ) Host can over-write IINDPM register bits after input source detection is completed.

◆ charger6_set_precharge_current()

err_t charger6_set_precharge_current ( charger6_t * ctx,
uint16_t precharge_current )

Charger 6 set precharge current function.

This function set precharge current limit ( Range: 60 mA – 780 mA ) of the BQ25601, I2C Controlled 3-A Single-Cell Battery Charger for High Input Voltage and Narrow Voltage DC (NVDC) Power Path Management on the Charger 6 Click board.

Parameters
[in]ctx: Click context object. See charger6_t object definition for detailed explanation.
[in]precharge_current: Precharge Charge Current 60 mA – 780 mA.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ charger6_set_system_minimum_voltage()

err_t charger6_set_system_minimum_voltage ( charger6_t * ctx,
uint16_t sys_min_voltage )

Charger 6 set system minimum voltage function.

This function set the system minimum voltag of the BQ25601, I2C Controlled 3-A Single-Cell Battery Charger for High Input Voltage and Narrow Voltage DC (NVDC) Power Path Management on the Charger 6 Click board.

Parameters
[in]ctx: Click context object. See charger6_t object definition for detailed explanation.
[in]sys_min_voltage: System Minimum Voltage 2600 mV – 3700 mV.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ charger6_set_termination_current()

err_t charger6_set_termination_current ( charger6_t * ctx,
uint16_t termination_current )

Charger 6 set termination current function.

This function set termination current limit ( Range: 60 mA – 780 mA ) of the BQ25601, I2C Controlled 3-A Single-Cell Battery Charger for High Input Voltage and Narrow Voltage DC (NVDC) Power Path Management on the Charger 6 Click board.

Parameters
[in]ctx: Click context object. See charger6_t object definition for detailed explanation.
[in]termination_current: Termination Charge Current 60 mA – 780 mA.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ charger6_set_top_off_timer()

err_t charger6_set_top_off_timer ( charger6_t * ctx,
uint8_t top_off_time )

Charger 6 set top OFF timer function.

This function set top OFF timer value of the BQ25601, I2C Controlled 3-A Single-Cell Battery Charger for High Input Voltage and Narrow Voltage DC (NVDC) Power Path Management on the Charger 6 Click board.

Parameters
[in]ctx: Click context object. See charger6_t object definition for detailed explanation.
[in]top_off_time:
  • 0 ( CHARGER6_TOPOFF_TIMER_DISABLE ) - Disabled (Default),
  • 30 ( CHARGER6_TOPOFF_TIMER_30_MINUTES ) - 30 minutes,
  • 15 ( CHARGER6_TOPOFF_TIMER_15_MINUTES ) - 15 minutes,
  • 45 ( CHARGER6_TOPOFF_TIMER_45_MINUTES ) - 45 minutes.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.