Egoruch / Quick-Charge-STM32-HAL

Simple library for get 9V/12V/configurable output with step 0.2V from chargers with Quick Charge 2.0/3.0.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Quick-Charge-STM32-HAL

Simple library to get 9V/12V/20V/configurable output with step 0.2V from chargers with Quick Charge 2.0/3.0.


  • STM32F103C8; STM32CubeIDE; HAL

Connection diagram

alt text

CubeMX

alt text

How to use

Execute function corresponding to voltage:

  • 5V: QC_GPIO_5V();
  • 9V: QC_GPIO_9V();
  • 12V: QC_GPIO_12V();
  • 20V: QC_GPIO_20V();

For regulation (continuous) mode execute initialization and then set output voltage by using incrementation/decrementation functions (MAX 12V out):

  • QC_GPIO_Reg();
  • +0.2V: QC_GPIO_Inc();
  • -0.2V: QC_GPIO_Dec();

Tested with different QC chargers (USB-A and USB-C)

alt text

For USB Type-C resistors 5.1k between CC1, CC2 and GND are neccessary

alt text

Output voltage

alt text

About

Simple library for get 9V/12V/configurable output with step 0.2V from chargers with Quick Charge 2.0/3.0.


Languages

Language:C 94.7%Language:C++ 3.3%Language:Makefile 1.8%Language:Assembly 0.3%