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:
2026-09-09 18:36:17 +02:00
parent 8a95e1735a
commit 01c24d17b6
14 changed files with 914 additions and 29 deletions

39
main/buzzer.h Normal file
View 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