Files
ETcontroller_PRO/lib/GPIO/BUZZER_Driver.h
2025-07-23 22:39:40 +02:00

39 lines
741 B
C++

#pragma once
#include <Arduino.h>
#define DEBUGLOG_DEFAULT_LOG_LEVEL_INFO
#include <DebugLog.h>
namespace drivers
{
class Buzzer
{
const uint8_t c_buzzerPin = 46; // hardware assigned
typedef struct
{
note_t note;
uint8_t pin;
uint16_t tOn;
uint16_t tOff;
TaskHandle_t beeperTask;
} beep_params_t;
public:
Buzzer();
~Buzzer();
void beep(const uint16_t tBeep, const note_t note);
void beepRepeat(const uint16_t tOn, const uint16_t tOff, const note_t note);
void beepStop();
private:
static void beepTask(void *params);
private:
beep_params_t m_bp;
};
}