PWM works

This commit is contained in:
Edward Emelianov
2026-03-15 23:44:58 +03:00
parent 61262435a8
commit 03b05051aa
9 changed files with 292 additions and 161 deletions

View File

@@ -35,8 +35,8 @@ TRUE_INLINE void pins_setup(){ // setup some common GPIO
void hardware_setup(){
// enable all active GPIO clocking
RCC->AHBENR |= RCC_AHBENR_GPIOAEN | RCC_AHBENR_GPIOBEN | RCC_AHBENR_DMA1EN;
RCC->APB2ENR |= RCC_APB2ENR_USART1EN | RCC_APB2ENR_SYSCFGEN;
RCC->APB1ENR |= RCC_APB1ENR_USART2EN;
RCC->APB2ENR |= RCC_APB2ENR_USART1EN | RCC_APB2ENR_SYSCFGEN | RCC_APB2ENR_TIM1EN | RCC_APB2ENR_TIM16EN;
RCC->APB1ENR |= RCC_APB1ENR_USART2EN | RCC_APB1ENR_TIM2EN | RCC_APB1ENR_TIM3EN | RCC_APB1ENR_TIM14EN;
pins_setup();
adc_setup();
GPIO_init();