Initial commit

This commit is contained in:
SocChina2025
2025-05-07 22:22:44 +08:00
commit 7f9bede0c7
131 changed files with 190978 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
//
// Created by Engineer on 2024/1/11.
//
#include "delay_helper.h"
#include "tim.h"
void DelaySetup(void) {
HAL_TIM_Base_Start(&TIM_DELAY);
}
void DelayUs(const uint16_t nus) {
__HAL_TIM_SET_COUNTER(&TIM_DELAY, 0);
while (__HAL_TIM_GET_COUNTER(&TIM_DELAY) < nus) {
}
}
void DelayMs(const uint32_t nms) {
for (uint32_t i = 0; i < nms; ++i) {
DelayUs(1000);
}
}
void DelayS(const uint32_t ns) {
for (uint32_t i = 0; i < ns; ++i) {
DelayMs(1000);
}
}