29#define CURRENT_CLASS Esp32
31#define HAS_FLASH_READ 0
32#define HAS_HARDWARE_PWM 1
34#define HAS_INPUT_CAPTURE 0
36#define STRCPY_PF_CAST(x) (x)
48#define ISR(f) void ICACHE_RAM_ATTR IRTimer()
62 static hw_timer_t* timer;
65 void timerEnableIntr() {
70 Esp32::timer = timerBegin(1, 80, 1);
71 timerAttachInterrupt(Esp32::timer,
IRTimer,
true);
74 timerAlarmEnable(Esp32::timer);
77 void timerDisableIntr() {
78 if (Esp32::timer !=
nullptr) {
79 timerEnd(Esp32::timer);
80 timerDetachInterrupt(Esp32::timer);
84 void timerEnablePwm() {
88 void timerDisablePwm() {
93 onValue =
static_cast<uint8_t
>(256U * dutyCycle / 100U);
98 void timerConfigNormal() {
int8_t dutycycle_t
Type for duty cycle in percent.
uint32_t frequency_t
Type for modulation frequency in Hz.
This class serves as an HAL (Hardware Abstraction Layer).
static const unsigned long microsPerTick