We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]
Rating:
Author: MIKROE
Last Updated: 2019-05-27
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Battery Charger
Downloaded: 3668 times
Not followed.
License: MIT license
Charger 9 click is a Li-Ion (Li+, Li-Po) battery charger, capable of charging one, two or three battery cells. It is based on the MAX1757, an integrated Li+ battery charger with many features that allow safe and reliable charging.
Do you want to subscribe in order to receive notifications regarding "Charger 9 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Charger 9 click" changes.
Do you want to report abuse regarding "Charger 9 click".
Library Description
This library allows user to perform a control of the Charger 9 Click board. Also user can check the indication status from the charger to get charging state. Fault condition also can be checked. For more details check documentation.
Key functions:
void charger9_gpioDriverInit(T_CHARGER9_P gpioObj)
- Convert ADC value to Pressure data in mBar.T_CHARGER9_RETVAL charger9_enable( T_CHARGER9_STATE pwr_state )
- Convert ADC value to Voltage in mV.T_CHARGER9_RETVAL charger9_faultInd( void )
- Sets max output voltage on the AN pin.Examples description
The application is composed of three sections :
void applicationTask()
{
rx_dat = UART_Rdy_Ptr();
if (rx_dat != 0)
{
rx_dat = UART_Rd_Ptr();
switch (rx_dat)
{
case 'e' :
{
if (en_flag == _CHARGER9_DISABLE)
{
charger9_enable( _CHARGER9_ENABLE );
en_flag = _CHARGER9_ENABLE;
mikrobus_logWrite( "** Charger 9 is enabled **", _LOG_LINE );
alarmOn();
}
else
{
mikrobus_logWrite( "** Charger 9 is already enabled **", _LOG_LINE );
}
break;
}
case 'd' :
{
if (en_flag == _CHARGER9_ENABLE)
{
charger9_enable( _CHARGER9_DISABLE );
en_flag = _CHARGER9_DISABLE;
mikrobus_logWrite( "** Charger 9 is disabled **", _LOG_LINE );
alarmOff();
}
else
{
mikrobus_logWrite( "** Charger 9 is already disabled **", _LOG_LINE );
}
break;
}
case 's' :
{
charge_state = charger9_fullChargeInd();
if (charge_state == _CHARGER9_IND_ACTIVE)
{
mikrobus_logWrite( "** Full-Charge state **", _LOG_LINE );
}
charge_state = charger9_fastChargeInd();
if (charge_state == _CHARGER9_IND_ACTIVE)
{
mikrobus_logWrite( "** Fast-Charge state **", _LOG_LINE );
}
break;
}
case 'l' :
{
writeLegend();
break;
}
default :
{
mikrobus_logWrite( "** Invalid command **", _LOG_LINE );
writeLegend();
break;
}
}
}
charge_state = charger9_faultInd();
if (charge_state == _CHARGER9_IND_ACTIVE)
{
charger9_enable( _CHARGER9_DISABLE );
en_flag = _CHARGER9_DISABLE;
mikrobus_logWrite( "** Fault condition! **", _LOG_LINE );
mikrobus_logWrite( "** Charger 9 is disabled **", _LOG_LINE );
alarmFault();
}
}
Additional Functions :
Other mikroE Libraries used in the example:
Additional notes and informations
Depending on the development board you are using, you may need USB UART click, USB UART 2 click or RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.