charger3 2.0.0.0
|
API for configuring and manipulating Charger 3 Click driver. More...
Topics | |
Charger 3 Registers Settings | |
Settings for registers of Charger 3 Click driver. | |
Charger 3 MikroBUS Map | |
MikroBUS pin mapping of Charger 3 Click driver. | |
Charger3_command | |
Mode | |
Status | |
Charger3_dummy | |
Functions | |
void | charger3_cfg_setup (charger3_cfg_t *cfg) |
Charger 3 configuration object setup function. | |
err_t | charger3_init (charger3_t *ctx, charger3_cfg_t *cfg) |
Charger 3 initialization function. | |
void | charger3_default_cfg (charger3_t *ctx) |
Charger 3 default configuration function. | |
err_t | charger3_generic_write (charger3_t *ctx, uint8_t reg, uint8_t *tx_buf, uint8_t tx_len) |
Charger 3 I2C writing function. | |
err_t | charger3_generic_read (charger3_t *ctx, uint8_t reg, uint8_t *rx_buf, uint8_t rx_len) |
Charger 3 I2C reading function. | |
void | charger3_enable_write (charger3_t *ctx) |
Charger 3 enable write function. | |
void | charger3_operating_mode (charger3_t *ctx, uint8_t mode) |
Charger 3 set operating mode function. | |
void | charger3_write_rdac (charger3_t *ctx, uint16_t rdac_data) |
Charger 3 write to rdac function. | |
uint8_t | charger3_set_digipot_res (charger3_t *ctx, uint16_t res_ohm) |
Charger 3 set digital potentiometer resistance function. | |
uint8_t | charger3_set_current (charger3_t *ctx, float curr_value) |
Charger 3 set current function. | |
uint16_t | charger3_read_rdac (charger3_t *ctx) |
Charger 3 read rdac function. | |
float | charger3_calc_digipot_res (charger3_t *ctx) |
Charger 3 calculate digipot resistance function. | |
API for configuring and manipulating Charger 3 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
float charger3_calc_digipot_res | ( | charger3_t * | ctx | ) |
Charger 3 calculate digipot resistance function.
This function returns calculated resistance of AD5175.
[in] | ctx | : Click context object. See charger3_t object definition for detailed explanation. |
void charger3_cfg_setup | ( | charger3_cfg_t * | cfg | ) |
Charger 3 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See charger3_cfg_t object definition for detailed explanation. |
void charger3_default_cfg | ( | charger3_t * | ctx | ) |
Charger 3 default configuration function.
This function executes a default configuration of Charger 3 click board.
[in] | ctx | : Click context object. See charger3_t object definition for detailed explanation. |
0
- Success, -1
- Error.void charger3_enable_write | ( | charger3_t * | ctx | ) |
Charger 3 enable write function.
This function enables write to the AD5175 Single-Channel, 1024-Position, Digital Rheostat over I2C Interface.
[in] | ctx | : Click context object. See charger3_t object definition for detailed explanation. |
err_t charger3_generic_read | ( | charger3_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | rx_buf, | ||
uint8_t | rx_len ) |
Charger 3 I2C reading function.
This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See charger3_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. |
0
- Success, -1
- Error.err_t charger3_generic_write | ( | charger3_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | tx_buf, | ||
uint8_t | tx_len ) |
Charger 3 I2C writing function.
This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.
[in] | ctx | : Click context object. See charger3_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. |
0
- Success, -1
- Error.err_t charger3_init | ( | charger3_t * | ctx, |
charger3_cfg_t * | cfg ) |
Charger 3 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See charger3_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See charger3_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.void charger3_operating_mode | ( | charger3_t * | ctx, |
uint8_t | mode ) |
Charger 3 set operating mode function.
This function shorts or creates open circuit on PROG pin enabling or disabling charging of the battery.
[in] | ctx | : Click context object. See charger3_t object definition for detailed explanation. |
[in] | mode | : Operating mode.
|
uint16_t charger3_read_rdac | ( | charger3_t * | ctx | ) |
Charger 3 read rdac function.
This function reads the 10-bit value of RDAC register of AD5175.
[in] | ctx | : Click context object. See charger3_t object definition for detailed explanation. |
uint8_t charger3_set_current | ( | charger3_t * | ctx, |
float | curr_value ) |
Charger 3 set current function.
This function sets the battery charging current.
[in] | ctx | : Click context object. See charger3_t object definition for detailed explanation. |
[in] | curr_value | : Current value. |
0x00
( CHARGER3_STATUS_ERROR_SUCCESS ), 0x01
( CHARGER3_STATUS_ERROR_FAILURE ).uint8_t charger3_set_digipot_res | ( | charger3_t * | ctx, |
uint16_t | res_ohm ) |
Charger 3 set digital potentiometer resistance function.
This function sets the actual resistance of AD5175 digital potentiometer.
[in] | ctx | : Click context object. See charger3_t object definition for detailed explanation. |
[in] | res_ohm | : Resistance value. |
0x00
( CHARGER3_STATUS_ERROR_SUCCESS ), 0x01
( CHARGER3_STATUS_ERROR_FAILURE ).void charger3_write_rdac | ( | charger3_t * | ctx, |
uint16_t | rdac_data ) |
Charger 3 write to rdac function.
This function writes 10-bit data directly to the RDAC register of AD5175.
[in] | ctx | : Click context object. See charger3_t object definition for detailed explanation. |
[in] | rdac_data | : RDAC value. |