Add LED animatinos

This commit is contained in:
2023-03-25 00:36:56 +01:00
parent 3b2dac7240
commit 57c94b2423
4 changed files with 174 additions and 0 deletions

View File

@ -6,6 +6,7 @@ extern "C" {
#endif
#include "stm32h7xx_hal.h"
#include "tx_port.h"
#define N_LEDS 9
@ -16,6 +17,23 @@ extern "C" {
void led_init(SPI_HandleTypeDef *spi, TIM_HandleTypeDef *pwmtim);
void led_set(size_t idx, uint8_t r, uint8_t g, uint8_t b);
void led_all_off();
void led_thread_entry(ULONG child_thread_stack_addr);
typedef enum {
ANIM_TE_STARTUP,
ANIM_FT_STARTUP,
ANIM_KNIGHT_RIDER,
} LEDAnimation;
void led_start_animation(LEDAnimation anim);
void led_anim_te_startup(ULONG _);
void led_anim_ft_startup(ULONG _);
void led_anim_knight_rider(ULONG _);
void led_anim_blinker(uint8_t r, uint8_t g, uint8_t b,
uint32_t brightness_steps, uint32_t next_led_steps,
uint32_t delay);
#ifdef __cplusplus
}