battmon 2.0.0.0
main.c File Reference

BattMon Click example. More...

#include "board.h"
#include "log.h"
#include "battmon.h"

Functions

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

Detailed Description

BattMon Click example.

Description

This application is battery charger.

The demo application is composed of two sections :

Application Init

Initializes I2C serial interface, reads the part ID and performs a device configuration and alarm setting.

Application Task

Checks the conversion counter value and when conversion was done reads data calculated to the properly unit and checks the alarm status. All results will be sent to the uart terminal.

note: Voltage and current conversion will be done after 4 seconds. Temperature conversion will be done after 16 seconds. After temperature reading the conversion counter will be cleared. Clearing the alarm while the corresponding low-voltage or low-SOC condition is still in progress does not generate another interrupt. This condition must disappear first and must be detected again before another interrupt (ALM pin driven low or alarm interrupt bits are set high) is generated for this alarm. Another alarm condition, if not yet triggered, can still generate an interrupt. Input voltage must be in the range from 2.7V to 4.5V. Maximal battery current is 5A.

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 )