|
|
ChaosDMX
Open-Source DMX-Interface
|
LED control component with flexible blinking and breathing modes. More...
#include "driver/ledc.h"#include "esp_err.h"#include "freertos/FreeRTOS.h"#include "freertos/semphr.h"#include "freertos/task.h"#include "logger.h"#include <math.h>#include <stdint.h>Go to the source code of this file.
Enumerations | |
| enum | led_mode_t { LED_MODE_OFF , LED_MODE_BOOT_BREATHING , LED_MODE_RESET , LED_MODE_NORMAL , LED_MODE_WARN , LED_MODE_ERROR } |
| Available operational modes for the status LED. More... | |
Functions | |
| esp_err_t | led_init (void) |
| Initializes the LEDC peripheral for the status LED. | |
| void | led_set_mode (led_mode_t mode) |
| Sets the current operational mode of the LED. | |
| void | led_set_brightness (uint8_t brightness) |
| Dynamically updates the LED maximum brightness. | |
LED control component with flexible blinking and breathing modes.
Definition in file led.h.
| enum led_mode_t |
| esp_err_t led_init | ( | void | ) |
Initializes the LEDC peripheral for the status LED.
Sets up the timer and channel configuration for the LED GPIO.
Definition at line 117 of file led.c.
References LED_CHANNEL, LED_DUTY_RES, LED_FREQUENCY, LED_GPIO_PIN, LED_SPEED_MODE, LED_TIMER, s_active_max_brightness, s_led_mutex, and set_pwm_duty().
Referenced by app_main().
| void led_set_brightness | ( | uint8_t | brightness | ) |
Dynamically updates the LED maximum brightness.
| [in] | brightness | Value from 0 (off) to 255 (max). |
Definition at line 188 of file led.c.
References LED_MODE_NORMAL, LED_MODE_WARN, s_active_max_brightness, s_config_brightness, s_current_mode, s_led_mutex, and set_pwm_duty().
Referenced by app_main(), and config_set_led_brightness().
| void led_set_mode | ( | led_mode_t | mode | ) |
Sets the current operational mode of the LED.
Modes include static, blinking, and breathing effects.
| [in] | mode | The desired led_mode_t to activate. |
Definition at line 141 of file led.c.
References LED_MODE_BOOT_BREATHING, LED_MODE_ERROR, LED_MODE_NORMAL, LED_MODE_OFF, LED_MODE_RESET, LED_MODE_WARN, s_active_max_brightness, s_config_brightness, s_current_mode, s_led_mutex, set_pwm_duty(), and update_led_generator_unsafe().
Referenced by app_main().