Initial commit

This commit is contained in:
Radzhab Bisultanov
2026-02-17 19:10:09 +03:00
commit eecf8f2cc2
34 changed files with 27181 additions and 0 deletions

14
Source/Core/Src/timer.c Normal file
View File

@@ -0,0 +1,14 @@
#include "timer.h"
void tim6_init()
{
RCC->APB1ENR1 |= RCC_APB1ENR1_TIM6EN;
TIM6->PSC = 16000 - 1; // 16 MHz / 16000 = 1000 Hz (1 ms)
TIM6->ARR = 2 - 1; // 2 ms
TIM6->DIER |= TIM_DIER_UIE; // interrupt enable
TIM6->CR1 |= TIM_CR1_CEN; // counter enable
NVIC_EnableIRQ(TIM6_DAC_IRQn);
}