feat: 新增LED的CPP支持,优化LED的C模块结构,新增interface
This commit is contained in:
22
Core/driver/led/led_cpp.cpp
Normal file
22
Core/driver/led/led_cpp.cpp
Normal 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();
|
||||
}
|
||||
Reference in New Issue
Block a user