feat: 新增LED的CPP支持,优化LED的C模块结构,新增interface

This commit is contained in:
2025-11-10 00:19:57 +08:00
parent c6365a7548
commit a49d1df0d5
12 changed files with 317 additions and 103 deletions

View File

@@ -0,0 +1,22 @@
//
// Created by Wind on 2025/11/9.
//
#include "include/led_cpp.h"
LED::LED(GPIO_TypeDef *port, const uint16_t pin) : Gpio(port, pin) {
}
LED::~LED() = default;
void LED::ledOn() const {
this->write(true);
}
void LED::ledOff() const {
this->write(false);
}
void LED::ledToggle() const {
this->toggle();
}