16#include <circle/types.h>
17#include <circle/timer.h>
18#include <circle/logger.h>
19#include <circle/usertimer.h>
20#include <circle/gpiopin.h>
46 CHAL(CInterruptSystem *pInterruptSystem, CTimer *pTimer);
70 void StartBuzzer(
unsigned duty,
unsigned duration = 0);
94 static void UserTimerHandler(CUserTimer *pTimer,
void *pParam);
96 void HandleTimerTick();
98 void StopInternal(
boolean logMessage);
103 PWMFrequencyHz = 800,
104 PWMPeriodMicros = 1000000U / PWMFrequencyHz,
109 CInterruptSystem *m_pInterruptSystem;
111 CUserTimer m_UserTimer;
113 CGPIOPin m_RxTXSwitchPin;
115 boolean m_bGPIO16Configured;
116 boolean m_bBuzzerPinConfigured;
117 boolean m_bTimerInitialized;
120 boolean m_bHighPhase;
121 boolean m_bRxTxSwitchMode;
122 unsigned m_nConfiguredBuzzerVolume;
123 unsigned m_nStopTicks;
124 unsigned m_nOnMicros;
125 unsigned m_nOffMicros;
Provides buzzer control, GPIO switching, and timing utilities.
Definition hal.h:43
void StopBuzzer(void)
Halt buzzer activity immediately.
Definition hal.cpp:158
void Update(void)
Update fast timers to manage auto-stop behavior.
Definition hal.cpp:185
void ConfigureBuzzerVolume(unsigned volumePercent)
Store the buzzer volume percentage.
Definition hal.cpp:276
void Click(void)
Play a short click feedback tone.
Definition hal.cpp:101
void StartBuzzer(unsigned duty, unsigned duration=0)
Begin buzzer output with optional auto-stop duration.
Definition hal.cpp:106
void BEEP(void)
Play a fixed-duration beep using current volume setting.
Definition hal.cpp:96
void ConfigureRxTxSwap(boolean enableSwap)
Set the RX/TX swap mode explicitly.
Definition hal.cpp:255
boolean Initialize(void)
Prepare GPIO and timer resources required for HAL features.
Definition hal.cpp:57
void SwitchRxTx(void)
Toggle the hardware RX/TX pin swap relay.
Definition hal.cpp:244
~CHAL(void)
Ensure peripherals are quiesced on shutdown.
Definition hal.cpp:46
static CHAL * Get(void)
Access the singleton HAL instance.
Definition hal.cpp:19