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-09-18
Package Version: 1.0.0.0
mikroSDK Library: 1.0.0.0
Category: Power supply
Downloaded: 3757 times
Not followed.
License: MIT license
Charger 12 Click is a single lithium-ion (Li+) cell or three-cell NiMH/NiCd battery charger. This click can be used for Low-Cost Li-Ion battery chargers, or Power Tools, toys, backup energy storage solutions, etc.
Do you want to subscribe in order to receive notifications regarding "Charger 12 click" changes.
Do you want to unsubscribe in order to stop receiving notifications regarding "Charger 12 click" changes.
Do you want to report abuse regarding "Charger 12 click".
Library Description
Library contains functions for getting and setting GPIO pin states Library contains function for mode selection Library contains function for SPI transfer operation Library contains function for SPI get register operation Library contains functions for incrementing and decrementing wiper position
Key functions:
uint8_t charger12_mode_select( uint8_t mode_select )
- selects device operation mode by setting RST(CHGEN) and PWM(MODE) pinsvoid charger12_spi_increment_wiper( void )
- increments wiper position by sending 8bit increment wiper commandvoid charger12_spi_decrement_wiper( void )
- decrements wiper position by sending 8bit decrement wiper commandExamples description
The application is composed of three sections :
void applicationTask( )
{
uart_ready = UART_Data_Ready( );
if (uart_ready == 1)
{
uart_char = UART_Read( );
switch (uart_char)
{
case '+' :
{
charger12_case_Plus( );
break;
}
case '-' :
{
charger12_case_Minus( );
break;
}
case '1' :
{
charger12_case_One( );
break;
}
case '2' :
{
charger12_case_Two( );
break;
}
case '3' :
{
charger12_case_Three( );
break;
}
case '4' :
{
charger12_case_Four( );
break;
}
default :
{
mikrobus_logWrite( "> Invalid command", _LOG_LINE );
break;
}
}
}
}
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.