Phase 7: EC11 encoder, life counter views, WS2812B RMT + LEDC buzzer feedback, E2E UI state machine; document build/hardware notes
This commit is contained in:
39
main/buzzer.h
Normal file
39
main/buzzer.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* MTG RFID Companion - Piezo buzzer driver (LEDC PWM)
|
||||
*
|
||||
* Phase 7 Step 7.4: Subtle audio cues on GPIO 14.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "esp_err.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Initialize LEDC PWM channel for the buzzer.
|
||||
*/
|
||||
esp_err_t buzzer_init(void);
|
||||
|
||||
/**
|
||||
* @brief Start a tone at the given frequency.
|
||||
*/
|
||||
esp_err_t buzzer_start(uint32_t freq_hz, uint32_t duty_percent);
|
||||
|
||||
/**
|
||||
* @brief Silence the buzzer.
|
||||
*/
|
||||
esp_err_t buzzer_stop(void);
|
||||
|
||||
/**
|
||||
* @brief Play a short chirp (blocking).
|
||||
* @param freq_hz Tone frequency
|
||||
* @param duration_ms Tone length in ms
|
||||
*/
|
||||
esp_err_t buzzer_chirp(uint32_t freq_hz, uint32_t duration_ms);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user