Added alternate function inits for USART

This commit is contained in:
2025-09-07 21:30:32 -07:00
parent 84ab921291
commit b2c41e2cb4
21 changed files with 182 additions and 70 deletions

View File

@@ -13,6 +13,7 @@
#include <stm32f072xb.h>
#include "SHAL_CORE.h"
#include "SHAL_TIM_TYPES.h"
enum class Timer_Key : uint8_t { //For STM32F072
S_TIM1,
@@ -30,7 +31,7 @@ enum class Timer_Key : uint8_t { //For STM32F072
//Get TIMER_KEY peripheral struct including bus register, enable mask, TIMER_KEY mask
constexpr SHAL_Peripheral_Register getTimerRCC(Timer_Key t) {
constexpr TIM_RCC_Enable getTimerRCC(Timer_Key t) {
switch(t) {
case Timer_Key::S_TIM1: return {&RCC->APB2ENR, RCC_APB2ENR_TIM1EN_Pos};
case Timer_Key::S_TIM2: return {&RCC->APB1ENR, RCC_APB1ENR_TIM2EN_Pos};