zephyr/samples/drivers/led_ws2812/f070rb-bindings.h
Simon Guinot 58d040ff2f samples: led_ws2812: add example for Everlight B1414
This patch adds a devicetree configuration example for the Everlight
B1414 LED controller.

An overlay for the nucleo_f070rb board is provided. It assumes that
a B1414 LED controller is connected to the PA7 pin (SPI 1 MOSI). The
WS2812 SPI driver is used.

Signed-off-by: Simon Guinot <simon.guinot@seagate.com>
2021-07-20 13:35:02 +02:00

27 lines
638 B
C

/*
* Copyright (c) 2021 Seagate Technology LLC
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_SAMPLES_DRIVERS_LED_WS2812_F070RB_BINDINGS_H
#define ZEPHYR_SAMPLES_DRIVERS_LED_WS2812_F070RB_BINDINGS_H
/*
* Everlight B1414 LED controller;
*
* Each bit of the control signal (waveform) is described with a 1.2 us pulse:
* 0 bit: 300 ns high and 900 ns low.
* 1 bit: 900 ns high and 300 ns low.
*
* At 6 MHz, one bit represents 166.666 ns.
* 1200 ns -> 7.2 bits
* 300 ns -> 1.8 bits
* 900 ns -> 5.4 bits
*/
#define B1414_SPI_FREQ 6000000
#define B1414_ZERO_FRAME 0x60
#define B1414_ONE_FRAME 0x7C
#endif