charger8 2.0.0.0
main.c File Reference

Charger8 Click example. More...

#include "board.h"
#include "log.h"
#include "charger8.h"

Functions

void application_init (void)
 
void application_task (void)
 
int main (void)
 

Detailed Description

Charger8 Click example.

Description

This application is used for charging devices and battery diagnostics

The demo application is composed of two sections :

Application Init

Initialization driver init, enable moduele and default configuration, disable ALERT and USB suspand mode and sets max battery capacity

Application Task

Reads battery diagnostics and this data logs to USBUART every 1500 ms.

note: The user can charge a battery internally over mikroBUS or externally by supplying the VIN connectors with 5V. For more precise diagnosis and easier tracking of the charging battery status you can set its capacity

  • e.g. if you have a 2000mAh battery you can use the "charger8_setMaxBatteryCapacity()" function and pass the parameter for 2000mAh, by doing this you make the readings more precise. In the example we used only some possibilities of the diagnostics like temperature of the chip during charging, charging current, current battery voltage, current battery capacity and how much the battery is charged in percentage. In case of changing the battery to a different one, it is neccessary to reset the device and set the battery's maximum capacity.
Author
MikroE Team

Function Documentation

◆ application_init()

void application_init ( void )

Logger initialization. Default baud rate: 115200 Default log level: LOG_LEVEL_DEBUG

Note
If USB_UART_RX and USB_UART_TX are defined as HAL_PIN_NC, you will need to define them manually for log to work. See LOG_MAP_USB_UART macro definition for detailed explanation.

◆ application_task()

void application_task ( void )

◆ main()

int main ( void )