charger 2.1.0.0
|
API for configuring and manipulating Charger Click driver. More...
Topics | |
Charger Commands List | |
List of commands of Charger Click driver. | |
Charger Settings | |
Settings of Charger Click driver. | |
Charger MikroBUS Map | |
MikroBUS pin mapping of Charger Click driver. | |
Functions | |
void | charger_cfg_setup (charger_cfg_t *cfg) |
Charger configuration object setup function. | |
void | charger_gpio_selection (charger_cfg_t *cfg, charger_gpio_sel_t gpio_sel) |
Charger driver interface setup function. | |
err_t | charger_init (charger_t *ctx, charger_cfg_t *cfg) |
Charger initialization function. | |
err_t | charger_default_cfg (charger_t *ctx) |
Charger default configuration function. | |
err_t | charger_check_communication (charger_t *ctx) |
Charger check communication function. | |
err_t | charger_select_device (charger_t *ctx) |
Charger select device function. | |
err_t | charger_read_scratchpad (charger_t *ctx, uint8_t page, uint8_t *data_out, uint8_t len) |
Charger read scratchpad function. | |
err_t | charger_write_scratchpad (charger_t *ctx, uint8_t page, uint8_t *data_in, uint8_t len) |
Charger write scratchpad function. | |
err_t | charger_copy_scratchpad (charger_t *ctx, uint8_t page) |
Charger copy scratchpad function. | |
err_t | charger_recall_memory (charger_t *ctx, uint8_t page) |
Charger recall scratchpad function. | |
err_t | charger_convert_temperature (charger_t *ctx) |
Charger convert temperature function. | |
err_t | charger_convert_voltage (charger_t *ctx) |
Charger convert voltage function. | |
err_t | charger_read_temperature (charger_t *ctx, float *temperature) |
Charger read temperature function. | |
err_t | charger_read_batt_vdd (charger_t *ctx, float *voltage) |
Charger read battery VDD function. | |
err_t | charger_read_system_vdd (charger_t *ctx, float *voltage) |
Charger read system VDD function. | |
err_t | charger_read_current (charger_t *ctx, float *current) |
Charger read current function. | |
err_t | charger_calibrate_current (charger_t *ctx) |
Charger calibrate current function. | |
err_t | charger_write_elapsed_time (charger_t *ctx, uint32_t seconds) |
Charger write elapsed time function. | |
err_t | charger_read_elapsed_time (charger_t *ctx, uint32_t *seconds) |
Charger read elapsed time function. | |
API for configuring and manipulating Charger Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
err_t charger_calibrate_current | ( | charger_t * | ctx | ) |
Charger calibrate current function.
This function calibrates the zero current charging output.
[in] | ctx | : Click context object. See charger_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void charger_cfg_setup | ( | charger_cfg_t * | cfg | ) |
Charger configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See charger_cfg_t object definition for detailed explanation. |
err_t charger_check_communication | ( | charger_t * | ctx | ) |
Charger check communication function.
This function checks the communication by reading the ROM address as well as verifying family code and CRC 8.
[in] | ctx | : Click context object. See charger_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t charger_convert_temperature | ( | charger_t * | ctx | ) |
Charger convert temperature function.
This function begins a temperature conversion.
[in] | ctx | : Click context object. See charger_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t charger_convert_voltage | ( | charger_t * | ctx | ) |
Charger convert voltage function.
This function initiates a voltage analog-to-digital conversion cycle.
[in] | ctx | : Click context object. See charger_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t charger_copy_scratchpad | ( | charger_t * | ctx, |
uint8_t | page ) |
Charger copy scratchpad function.
This function copies the scratchpad page into the EEPROM/SRAM memory page.
[in] | ctx | : Click context object. See charger_t object definition for detailed explanation. |
[in] | page | : Page number 0-7. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t charger_default_cfg | ( | charger_t * | ctx | ) |
Charger default configuration function.
This function executes a default configuration of Charger click board.
[in] | ctx | : Click context object. See charger_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void charger_gpio_selection | ( | charger_cfg_t * | cfg, |
charger_gpio_sel_t | gpio_sel ) |
Charger driver interface setup function.
This function sets a communication GPIO pin which will be used further in the click driver.
[out] | cfg | : Click configuration structure. See charger_cfg_t object definition for detailed explanation. |
[in] | gpio_sel | : GPIO pin selection. See charger_gpio_sel_t object definition for detailed explanation. |
err_t charger_init | ( | charger_t * | ctx, |
charger_cfg_t * | cfg ) |
Charger initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See charger_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See charger_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t charger_read_batt_vdd | ( | charger_t * | ctx, |
float * | voltage ) |
Charger read battery VDD function.
This function reads the battery input voltage.
[in] | ctx | : Click context object. See charger_t object definition for detailed explanation. |
[out] | voltage | : Voltage measurement output. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t charger_read_current | ( | charger_t * | ctx, |
float * | current ) |
Charger read current function.
This function reads the battery charging current.
[in] | ctx | : Click context object. See charger_t object definition for detailed explanation. |
[out] | current | : Current measurement output. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t charger_read_elapsed_time | ( | charger_t * | ctx, |
uint32_t * | seconds ) |
Charger read elapsed time function.
This function reads the elapsed time meter counter.
[in] | ctx | : Click context object. See charger_t object definition for detailed explanation. |
[out] | seconds | : 32-bit seconds counter value. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t charger_read_scratchpad | ( | charger_t * | ctx, |
uint8_t | page, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
Charger read scratchpad function.
This function reads a desired number of scratchpad bytes using One Wire communication protocol.
[in] | ctx | : Click context object. See charger_t object definition for detailed explanation. |
[in] | page | : Page number 0-7. |
[out] | data_out | : Output read scratchpad. |
[in] | len | : Scratchpad length in bytes. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t charger_read_system_vdd | ( | charger_t * | ctx, |
float * | voltage ) |
Charger read system VDD function.
This function reads the mikroBUS system input voltage.
[in] | ctx | : Click context object. See charger_t object definition for detailed explanation. |
[out] | voltage | : Voltage measurement output. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t charger_read_temperature | ( | charger_t * | ctx, |
float * | temperature ) |
Charger read temperature function.
This function reads the chip internal temperature measurement in degrees Celsius.
[in] | ctx | : Click context object. See charger_t object definition for detailed explanation. |
[out] | temperature | : Temperature measurement output. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t charger_recall_memory | ( | charger_t * | ctx, |
uint8_t | page ) |
Charger recall scratchpad function.
This function recalls the stored values in EEPROM/SRAM memory page to the scratchpad page.
[in] | ctx | : Click context object. See charger_t object definition for detailed explanation. |
[in] | page | : Page number 0-7. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t charger_select_device | ( | charger_t * | ctx | ) |
Charger select device function.
This function selects the device by performing a skip or match ROM commands depending on the address value set in the ctx->address.
[in] | ctx | : Click context object. See charger_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t charger_write_elapsed_time | ( | charger_t * | ctx, |
uint32_t | seconds ) |
Charger write elapsed time function.
This function writes the elapsed time meter counter.
[in] | ctx | : Click context object. See charger_t object definition for detailed explanation. |
[in] | seconds | : 32-bit seconds counter value. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t charger_write_scratchpad | ( | charger_t * | ctx, |
uint8_t | page, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
Charger write scratchpad function.
This function writes a desired number of scratchpad bytes using One Wire communication protocol.
[in] | ctx | : Click context object. See charger_t object definition for detailed explanation. |
[in] | page | : Page number 0-7. |
[in] | data_in | : Scratchpad to be written. |
[in] | len | : Scratchpad length in bytes. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.