TOP Contributors

  1. MIKROE (2663 codes)
  2. Alcides Ramos (358 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (137109 times)
  2. FAT32 Library (70237 times)
  3. Network Ethernet Library (56129 times)
  4. USB Device Library (46434 times)
  5. Network WiFi Library (42079 times)
  6. FT800 Library (41390 times)
  7. GSM click (29118 times)
  8. mikroSDK (26564 times)
  9. PID Library (26503 times)
  10. microSD click (25487 times)
Libstock prefers package manager

Package Manager

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]

< Back
mikroSDK Library

Charger 12 click

Rating:

5

Author: MIKROE

Last Updated: 2019-09-18

Package Version: 1.0.0.0

mikroSDK Library: 1.0.0.0

Category: Power supply

Downloaded: 3343 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.

No Abuse Reported

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".

  • mikroSDK Library 2.0.0.0
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroBasic PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroBasic PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroC PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for ARM
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for AVR
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for dsPIC30/33 & PIC24
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for FT90x
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc
mikroPascal PRO for PIC32
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

mikroSDK Library Blog

Charger 12 click

Charger 12 click

Native view of the Charger 12 click board.

View full image
Charger 12 click

Charger 12 click

Front and back view of the Charger 12 click board.

View full image

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) pins
  • void charger12_spi_increment_wiper( void ) - increments wiper position by sending 8bit increment wiper command
  • void charger12_spi_decrement_wiper( void ) - decrements wiper position by sending 8bit decrement wiper command

Examples description

The application is composed of three sections :

  • System Initialization - Initializes GPIO pins, SPI and LOG modules
  • Application Initialization - Iniztializes SPI driver
  • Application Task - Executes additional functions based on user input
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 :

  • charger12_case_Plus() - Increments Wiper position
  • charger12_case_Minus() - Decrements Wiper position
  • charger12_case_One() - Selects 1st mode of operation
  • charger12_case_Two() - Selects 2nd mode of operation
  • charger12_case_Three() - Selects 3rd mode of operation
  • charger12_case_Four() - Selects 4th mode of operation

Other mikroE Libraries used in the example:

  • SPI
  • UART
  • Conversions

Additional notes and informations

Depending on the development board you are using, you may need USB UART clickUSB 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.

ALSO FROM THIS AUTHOR

EEPROM click

0

EEPROM Click is an accessory board in mikroBUS form factor. It features 24C08WP - a highly reliable, high performance CMOS technology serial 8K EEPROM in DIP packaging.

[Learn More]

GSM/GNSS click

0

GSM/GNSS click combines GPS/GLONASS location tracking with GSM module capability for mobile communication. The click features Quectel’s MC60 quad-band module.

[Learn More]

IR Grid 3 click

0

IR Grid 3 click is a thermal imaging sensor. It has an array of 768 very sensitive, factory calibrated IR elements (pixels), arranged in 32 rows of 24 pixels, each measuring an object temperature up to 300˚C within its local Field of View (FOV). The MLX90640ESF-BAA IR sensor used on this Click board™ has only four pins, and it is mounted inside of the industry standard TO39 package.

[Learn More]