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
+10 -40
View File
@@ -19,11 +19,16 @@
* GNU General Public License for more details.
*/
#include "stm32_hal.h"
#include "stm32_hal_ll.h"
#include "stm32_gpio.h"
#include "hal/adc_driver.h"
#include "hal/trainer_driver.h"
#include "hal/switch_driver.h"
#include "hal/rotary_encoder.h"
#include "hal/usb_driver.h"
#include "hal/gpio.h"
#include "board.h"
#include "boards/generic_stm32/module_ports.h"
@@ -51,37 +56,8 @@ bool boardBacklightOn = false;
void boardInit()
{
RCC_AHB1PeriphClockCmd(PWR_RCC_AHB1Periph |
PCBREV_RCC_AHB1Periph |
LED_RCC_AHB1Periph |
LCD_RCC_AHB1Periph |
BACKLIGHT_RCC_AHB1Periph |
KEYS_BACKLIGHT_RCC_AHB1Periph |
SD_RCC_AHB1Periph |
AUDIO_RCC_AHB1Periph |
TELEMETRY_RCC_AHB1Periph |
BT_RCC_AHB1Periph |
AUDIO_RCC_AHB1Periph |
HAPTIC_RCC_AHB1Periph |
INTMODULE_RCC_AHB1Periph |
EXTMODULE_RCC_AHB1Periph |
SPORT_UPDATE_RCC_AHB1Periph,
ENABLE);
RCC_APB1PeriphClockCmd(ROTARY_ENCODER_RCC_APB1Periph |
AUDIO_RCC_APB1Periph |
TELEMETRY_RCC_APB1Periph |
AUDIO_RCC_APB1Periph |
BACKLIGHT_RCC_APB1Periph,
ENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG |
LCD_RCC_APB2Periph |
HAPTIC_RCC_APB2Periph |
TELEMETRY_RCC_APB2Periph |
BT_RCC_APB2Periph |
BACKLIGHT_RCC_APB2Periph,
ENABLE);
LL_AHB1_GRP1_EnableClock(LCD_RCC_AHB1Periph);
LL_APB2_GRP1_EnableClock(LCD_RCC_APB2Periph);
#if defined(RADIO_FAMILY_T16)
void board_set_bor_level();
@@ -140,7 +116,7 @@ void boardInit()
#if defined(DEBUG)
DBGMCU_APB1PeriphConfig(DBGMCU_IWDG_STOP|DBGMCU_TIM1_STOP|DBGMCU_TIM2_STOP|DBGMCU_TIM3_STOP|DBGMCU_TIM4_STOP|DBGMCU_TIM5_STOP|DBGMCU_TIM6_STOP|DBGMCU_TIM7_STOP|DBGMCU_TIM8_STOP|DBGMCU_TIM9_STOP|DBGMCU_TIM10_STOP|DBGMCU_TIM11_STOP|DBGMCU_TIM12_STOP|DBGMCU_TIM13_STOP|DBGMCU_TIM14_STOP, ENABLE);
// DBGMCU_APB1PeriphConfig(DBGMCU_IWDG_STOP|DBGMCU_TIM1_STOP|DBGMCU_TIM2_STOP|DBGMCU_TIM3_STOP|DBGMCU_TIM4_STOP|DBGMCU_TIM5_STOP|DBGMCU_TIM6_STOP|DBGMCU_TIM7_STOP|DBGMCU_TIM8_STOP|DBGMCU_TIM9_STOP|DBGMCU_TIM10_STOP|DBGMCU_TIM11_STOP|DBGMCU_TIM12_STOP|DBGMCU_TIM13_STOP|DBGMCU_TIM14_STOP, ENABLE);
#endif
ledInit();
@@ -176,14 +152,8 @@ void boardOff()
#if defined(PCBX12S)
// Shutdown the Audio amp
GPIO_InitTypeDef GPIO_InitStructure;
GPIO_InitStructure.GPIO_Pin = AUDIO_SHUTDOWN_GPIO_PIN;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_25MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_Init(AUDIO_SHUTDOWN_GPIO, &GPIO_InitStructure);
GPIO_ResetBits(AUDIO_SHUTDOWN_GPIO, AUDIO_SHUTDOWN_GPIO_PIN);
gpio_init(AUDIO_SHUTDOWN_GPIO, GPIO_OUT, GPIO_PIN_SPEED_LOW);
gpio_clear(AUDIO_SHUTDOWN_GPIO);
#endif
// Shutdown the Haptic