blk_box_tc/main/drivers/leds.h

49 lines
1.0 KiB
C

#ifndef LEDS_H
#define LEDS_H
#include "led_strip.h"
#define LED_COUNT 21
#define NEOPIXEL_PIN GPIO_NUM_7
// 10MHz resolution, 1 tick = 0.1us (led strip needs a high resolution)
#define LED_STRIP_RMT_RES_HZ (10 * 1000 * 1000)
typedef enum {
led_shape1 = 0,
led_shape2 = 1,
led_shape3 = 2,
led_shape4 = 3,
led_module_sseg = 4,
led_game_sseg = 5,
led_tft = 6,
led_mic = 7,
led_ir_led = 8,
led_speaker = 9,
led_rfid = 10,
led_keypad = 11,
led_char_lcd = 12,
led_switch4 = 13,
led_switch3 = 14,
led_switch2 = 15,
led_switch1 = 16,
led_button4 = 17,
led_button3 = 18,
led_button2 = 19,
led_button1 = 20,
} IndicatorLED;
/// @brief Initializes the indicator LEDs
void init_leds();
/// Sets the color of an LED.
///
/// Call `flush_leds()` to send the data to the LEDs.
void leds_set(IndicatorLED led, uint8_t r, uint8_t g, uint8_t b);
/// Outputs the data to the leds.
void leds_flush();
/// Clears the LEDs
void leds_clear();
#endif /* LEDS_H */