#pragma once

#include <Arduino.h>

#define DEBUGLOG_DEFAULT_LOG_LEVEL_INFO
#include <DebugLog.h>

namespace drivers
{

    class Buzzer
    {
        const uint8_t 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;
    };

}