NEORV32 Software Framework Documentation
The NEORV32 RISC-V Processor
|
Smart LED Interface (NEOLED) HW driver header file. More...
#include <stdint.h>
Go to the source code of this file.
Data Structures | |
struct | neorv32_neoled_t |
Functions | |
void | neorv32_neoled_write_nonblocking (uint32_t data) |
Prototypes | |
int | neorv32_neoled_available (void) |
void | neorv32_neoled_setup (uint32_t prsc, uint32_t t_total, uint32_t t_high_zero, uint32_t t_high_one, int irq_mode) |
void | neorv32_neoled_setup_ws2812 (int irq_mode) |
void | neorv32_neoled_set_mode (uint32_t mode) |
void | neorv32_neoled_strobe_blocking (void) |
void | neorv32_neoled_strobe_nonblocking (void) |
void | neorv32_neoled_enable (void) |
void | neorv32_neoled_disable (void) |
void | neorv32_neoled_write_blocking (uint32_t data) |
uint32_t | neorv32_neoled_get_buffer_size (void) |
IO Device: Smart LED Hardware Interface (NEOLED) | |
#define | NEORV32_NEOLED ((neorv32_neoled_t*) (NEORV32_NEOLED_BASE)) |
enum | NEORV32_NEOLED_CTRL_enum { NEOLED_CTRL_EN = 0 , NEOLED_CTRL_MODE = 1 , NEOLED_CTRL_STROBE = 2 , NEOLED_CTRL_PRSC0 = 3 , NEOLED_CTRL_PRSC1 = 4 , NEOLED_CTRL_PRSC2 = 5 , NEOLED_CTRL_BUFS_0 = 6 , NEOLED_CTRL_BUFS_1 = 7 , NEOLED_CTRL_BUFS_2 = 8 , NEOLED_CTRL_BUFS_3 = 9 , NEOLED_CTRL_T_TOT_0 = 10 , NEOLED_CTRL_T_TOT_1 = 11 , NEOLED_CTRL_T_TOT_2 = 12 , NEOLED_CTRL_T_TOT_3 = 13 , NEOLED_CTRL_T_TOT_4 = 14 , NEOLED_CTRL_T_ZERO_H_0 = 15 , NEOLED_CTRL_T_ZERO_H_1 = 16 , NEOLED_CTRL_T_ZERO_H_2 = 17 , NEOLED_CTRL_T_ZERO_H_3 = 18 , NEOLED_CTRL_T_ZERO_H_4 = 19 , NEOLED_CTRL_T_ONE_H_0 = 20 , NEOLED_CTRL_T_ONE_H_1 = 21 , NEOLED_CTRL_T_ONE_H_2 = 22 , NEOLED_CTRL_T_ONE_H_3 = 23 , NEOLED_CTRL_T_ONE_H_4 = 24 , NEOLED_CTRL_IRQ_CONF = 27 , NEOLED_CTRL_TX_EMPTY = 28 , NEOLED_CTRL_TX_HALF = 29 , NEOLED_CTRL_TX_FULL = 30 , NEOLED_CTRL_TX_BUSY = 31 } |
Smart LED Interface (NEOLED) HW driver header file.
#define NEORV32_NEOLED ((neorv32_neoled_t*) (NEORV32_NEOLED_BASE)) |
NEOLED module hardware access (neorv32_neoled_t)
NEOLED control register bits
int neorv32_neoled_available | ( | void | ) |
Check if NEOLED unit was synthesized.
void neorv32_neoled_disable | ( | void | ) |
Disable NEOLED controller.
void neorv32_neoled_enable | ( | void | ) |
Enable NEOLED controller.
uint32_t neorv32_neoled_get_buffer_size | ( | void | ) |
Get NEOLED hardware buffer size.
void neorv32_neoled_set_mode | ( | uint32_t | mode | ) |
Set NEOLED mode (24-bit RGB / 32-bit RGBW).
[in] | mode | 0 = 24-bit mode (RGB), 1 = 32-bit mode (RGBW) |
void neorv32_neoled_setup | ( | uint32_t | prsc, |
uint32_t | t_total, | ||
uint32_t | t_high_zero, | ||
uint32_t | t_high_one, | ||
int | irq_mode ) |
Enable and configure NEOLED controller. The NEOLED control register bits are listed in NEORV32_NEOLED_CTRL_enum. This function performs a "raw" configuration (just configuring the according control register bit).
[in] | prsc | Clock prescaler select (0..7). See NEORV32_CLOCK_PRSC_enum. |
[in] | t_total | Number of pre-scaled clock ticks for total bit period (0..31). |
[in] | t_high_zero | Number of pre-scaled clock ticks to generate high-time for sending a '0' (0..31). |
[in] | t_high_one | Number of pre-scaled clock ticks to generate high-time for sending a '1' (0..31). |
[in] | irq_mode | Interrupt condition (1=IRQ if FIFO is empty, 1=IRQ if FIFO is less than half-full). |
void neorv32_neoled_setup_ws2812 | ( | int | irq_mode | ) |
Configure NEOLED controller for using WS2812 LEDs (NeoPixel-compatible). This function computes all the required timings and finally calls neorv32_neoled_setup.
[in] | irq_mode | Interrupt condition (1=IRQ if FIFO is empty, 1=IRQ if FIFO is less than half-full). |
void neorv32_neoled_strobe_blocking | ( | void | ) |
Send strobe command ("RESET") - blocking.
void neorv32_neoled_strobe_nonblocking | ( | void | ) |
Send strobe command ("RESET") - non-blocking.
void neorv32_neoled_write_blocking | ( | uint32_t | data | ) |
Send single RGB(W) data word to NEOLED module (blocking).
[in] | data | LSB-aligned 24-bit RGB or 32-bit RGBW data |
|
inline |
Send single RGB(W) data word to NEOLED module (non-blocking).
[in] | data | LSB-aligned 24-bit RGB or 32-bit RGBW data |