TiSmartCar/source/bsp/Board_Config.c
Boen_Shi 8be2866433 feat(base): 初始化 MSPM0 开发环境
- 添加头文件和配置文件支持
- 更新.gitignore忽略编译和IDE相关文件
- 添加基础的bsp代码
2026-07-16 14:45:26 +08:00

34 lines
639 B
C

#include <Board_Config.h>
#include <stdint.h>
void MSP_Delay_us(uint32_t nus) {
delay_cycles(nus * (CPUCLK_FREQ / 1000000));
}
void MSP_Delay_ms(uint32_t nms) {
for(uint32_t i = 0; i < nms; i++) {
MSP_Delay_us(1000); // 每毫秒延时1000微秒
}
}
/*******************LED控制函数********************/
void LED_ON() {
DL_GPIO_setPins(LED_PORT, DL_GPIO_PIN_22);
}
void LED_OFF() {
DL_GPIO_readPins(LED_PORT, DL_GPIO_PIN_22);
}
void LED_Toggle() {
DL_GPIO_togglePins(LED_PORT, DL_GPIO_PIN_22);
}
void LED_Set(bool state) {
if (state) {
LED_ON();
} else {
LED_OFF();
}
}