chore: import local project into Gitea
This commit is contained in:
72
include/led_manager.h
Normal file
72
include/led_manager.h
Normal file
@@ -0,0 +1,72 @@
|
||||
/**
|
||||
* LED Manager - Status Indicators
|
||||
* Provides visual feedback for system status and operations
|
||||
*/
|
||||
|
||||
#ifndef LED_MANAGER_H
|
||||
#define LED_MANAGER_H
|
||||
|
||||
#include <esp_err.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// LED GPIO Pins for ESP32-P4-NANO
|
||||
#define LED_STATUS_GPIO 8 // Blue LED
|
||||
#define LED_ERROR_GPIO 15 // Red LED
|
||||
|
||||
// Additional indicator LEDs (optional, map to unused GPIOs if not present)
|
||||
#define LED_ETHERNET_GPIO 9 // Ethernet activity LED (optional)
|
||||
#define LED_WIFI_GPIO 10 // Wi-Fi activity LED (optional)
|
||||
#define LED_SCAN_GPIO 11 // Scan activity LED (optional)
|
||||
|
||||
// LED basic states for blinking patterns
|
||||
typedef enum {
|
||||
LED_STATE_OFF = 0,
|
||||
LED_STATE_ON,
|
||||
LED_STATE_BLINK_SLOW,
|
||||
LED_STATE_BLINK_FAST,
|
||||
LED_STATE_PULSE
|
||||
} led_state_t;
|
||||
|
||||
// Extended system status indicators (kept for backward compatibility)
|
||||
typedef enum {
|
||||
LED_STATUS_SYSTEM_READY = 0,
|
||||
LED_STATUS_SYSTEM_ERROR,
|
||||
LED_STATUS_ETHERNET_CONNECTED,
|
||||
LED_STATUS_ETHERNET_DISCONNECTED,
|
||||
LED_STATUS_WIFI_AP_ACTIVE,
|
||||
LED_STATUS_WIFI_CLIENT_CONNECTED,
|
||||
LED_STATUS_SCAN_ACTIVE,
|
||||
LED_STATUS_SCAN_COMPLETE,
|
||||
LED_STATUS_SD_CARD_ACCESS,
|
||||
LED_STATUS_OTA_UPDATE
|
||||
} led_status_t;
|
||||
|
||||
/**
|
||||
* Initialize LED manager
|
||||
* @return ESP_OK on success
|
||||
*/
|
||||
esp_err_t led_manager_init(void);
|
||||
|
||||
/**
|
||||
* Set LED status
|
||||
* @param status LED status to set
|
||||
* @return ESP_OK on success
|
||||
*/
|
||||
esp_err_t led_manager_set_status(led_status_t status);
|
||||
|
||||
// Forward-compatibility: keep previous prototypes so existing source builds
|
||||
esp_err_t led_manager_set_state(int gpio_num, led_state_t state);
|
||||
void led_manager_update(void);
|
||||
void led_manager_set_ethernet_activity(bool active);
|
||||
void led_manager_set_wifi_activity(bool active);
|
||||
void led_manager_set_scan_activity(bool active);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // LED_MANAGER_H
|
||||
Reference in New Issue
Block a user