chore(hal): remove StdPeriph (#5023)

Co-authored-by: raphaelcoeffic <1050031+raphaelcoeffic@users.noreply.github.com>
Co-authored-by: Malte Langermann <malte@langermann.net>
Co-authored-by: 3djc <3djc@gh.com>
Co-authored-by: Richard Li <richard.li@ces.hk>
This commit is contained in:
Raphael Coeffic
2024-06-01 11:45:40 +10:00
committed by GitHub
co-authored by raphaelcoeffic Malte Langermann 3djc Richard Li
parent fea402a6e3
commit 6579905088
247 changed files with 2190 additions and 145252 deletions
+8 -25
View File
@@ -260,34 +260,20 @@ bool isChargerActive()
void battery_charge_init()
{
GPIO_InitTypeDef GPIO_InitStructure;
// Input pins
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
// USB charger status pins
GPIO_InitStructure.GPIO_Pin = UCHARGER_GPIO_PIN;
GPIO_Init(UCHARGER_GPIO, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = UCHARGER_CHARGE_END_GPIO_PIN;
GPIO_Init(UCHARGER_CHARGE_END_GPIO, &GPIO_InitStructure);
gpio_init(UCHARGER_GPIO, GPIO_IN, GPIO_PIN_SPEED_LOW);
gpio_init(UCHARGER_CHARGE_END_GPIO, GPIO_IN, GPIO_PIN_SPEED_LOW);
#if defined(WIRELESS_CHARGER)
// Wireless charger status pins
GPIO_InitStructure.GPIO_Pin = WCHARGER_GPIO_PIN;
GPIO_Init(WCHARGER_GPIO, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = WCHARGER_CHARGE_END_GPIO_PIN;
GPIO_Init(WCHARGER_CHARGE_END_GPIO, &GPIO_InitStructure);
gpio_init(WCHARGER_GPIO, GPIO_IN, GPIO_PIN_SPEED_LOW);
gpio_init(WCHARGER_CHARGE_END_GPIO, GPIO_IN, GPIO_PIN_SPEED_LOW);
#endif
// Output pins
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
// USB charger control pins
GPIO_InitStructure.GPIO_Pin = UCHARGER_EN_GPIO_PIN;
GPIO_Init(UCHARGER_EN_GPIO, &GPIO_InitStructure);
gpio_init(UCHARGER_EN_GPIO, GPIO_OUT, GPIO_PIN_SPEED_LOW);
// USB charger state init
ENABLE_UCHARGER();
@@ -297,10 +283,8 @@ void battery_charge_init()
#if defined(WIRELESS_CHARGER)
// Wireless charger control pins
GPIO_InitStructure.GPIO_Pin = WCHARGER_EN_GPIO_PIN;
GPIO_Init(WCHARGER_EN_GPIO, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = WCHARGER_I_CONTROL_GPIO_PIN;
GPIO_Init(WCHARGER_I_CONTROL_GPIO, &GPIO_InitStructure);
gpio_init(WCHARGER_EN_GPIO, GPIO_OUT, GPIO_PIN_SPEED_LOW);
gpio_init(WCHARGER_I_CONTROL_GPIO, GPIO_OUT, GPIO_PIN_SPEED_LOW);
// Wireless charger state init
ENABLE_WCHARGER();
@@ -308,7 +292,6 @@ void battery_charge_init()
wCharger.hasCharger = !IS_WCHARGER_ACTIVE(); // Init for sampling count works
wCharger.isChargerDetectionReady = false;
resetChargeEndDetection(&wCharger);
#endif
}