app: add WS2812B
This commit is contained in:
parent
02f95f55ee
commit
af9d0d685a
|
@ -35,6 +35,7 @@
|
||||||
#include "terminal.h" // handle the terminal interface
|
#include "terminal.h" // handle the terminal interface
|
||||||
#include "menu.h" // menu utilities
|
#include "menu.h" // menu utilities
|
||||||
#include "font.h" // to draw text
|
#include "font.h" // to draw text
|
||||||
|
#include "led_ws2812b.h" // control WS2812b LEDs
|
||||||
|
|
||||||
/** watchdog period in ms */
|
/** watchdog period in ms */
|
||||||
#define WATCHDOG_PERIOD 10000
|
#define WATCHDOG_PERIOD 10000
|
||||||
|
@ -934,6 +935,13 @@ void main(void)
|
||||||
nvic_enable_irq(GPIO_NVIC_EXTI_IRQ(DIAL_SWITCH_PIN)); // enable interrupt
|
nvic_enable_irq(GPIO_NVIC_EXTI_IRQ(DIAL_SWITCH_PIN)); // enable interrupt
|
||||||
puts_debug("OK\n");
|
puts_debug("OK\n");
|
||||||
|
|
||||||
|
puts_debug("setup WS2812b LED matrix: ");
|
||||||
|
led_ws2812b_setup(); // configure peripheral for communication with WS2812b LEDs
|
||||||
|
led_ws2812b_set_rgb(0, 0xff, 0, 0); // set test color
|
||||||
|
led_ws2812b_set_rgb(1, 0, 0xff, 0); // set test color
|
||||||
|
led_ws2812b_set_rgb(2, 0, 0, 0xff); // set test color
|
||||||
|
puts_debug("OK\n");
|
||||||
|
|
||||||
puts_debug("setup RGB matrix: ");
|
puts_debug("setup RGB matrix: ");
|
||||||
// configure pin for output enable
|
// configure pin for output enable
|
||||||
rcc_periph_clock_enable(GPIO_RCC(RGBMATRIX_OE_PIN)); // enable clock for GPIO port peripheral
|
rcc_periph_clock_enable(GPIO_RCC(RGBMATRIX_OE_PIN)); // enable clock for GPIO port peripheral
|
||||||
|
|
Loading…
Reference in New Issue