charger17 2.1.0.0
|
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. | |
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.
void charger17_cfg_setup | ( | charger17_cfg_t * | cfg | ) |
Charger 17 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See charger17_cfg_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See charger17_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t charger17_default_cfg | ( | charger17_t * | ctx | ) |
Charger 17 default configuration function.
This function executes a default configuration of Charger 17 click board.
[in] | ctx | : Click context object. See charger17_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See charger17_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See charger17_t object definition for detailed explanation. |
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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t charger17_get_int_pin | ( | charger17_t * | ctx | ) |
Charger 17 get int pin function.
This function returns the INT pin logic state.
[in] | ctx | : Click context object. See charger17_t object definition for detailed explanation. |
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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See charger17_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See charger17_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See charger17_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See charger17_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
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.
[in] | ctx | : Click context object. See charger17_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.