39 lines
688 B
C
39 lines
688 B
C
/*
|
|
* 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 |