NEORV32 Software Framework Documentation
The NEORV32 RISC-V Processor
Loading...
Searching...
No Matches
main.c File Reference

NeoPixel (WS2812) interface demo using the processor's smart LED interface (NEOLED). More...

#include <neorv32.h>

Macros

User configuration
#define BAUD_RATE   19200
 
#define NUM_LEDS_24BIT   (12)
 
#define MAX_INTENSITY   (16)
 

Functions

uint32_t hsv2rgb (int h, int v)
 
int main ()
 

Detailed Description

NeoPixel (WS2812) interface demo using the processor's smart LED interface (NEOLED).

Author
Stephan Nolting

Macro Definition Documentation

◆ BAUD_RATE

#define BAUD_RATE   19200

UART BAUD rate

◆ MAX_INTENSITY

#define MAX_INTENSITY   (16)

Max intensity (0..255)

◆ NUM_LEDS_24BIT

#define NUM_LEDS_24BIT   (12)

Number of RGB LEDs in stripe (24-bit data)

Function Documentation

◆ hsv2rgb()

uint32_t hsv2rgb ( int h,
int v )

Convert HSV color to RGB.

Note
Very simple version: using integer arithmetic and ignoring saturation (saturation is always MAX).
Parameters
[in]hHue (color angle), 0..359
[in]vValue (intensity), 0..255
Returns
LSB-aligned 24-bit RGB data [G,R,B]

◆ main()

int main ( void )

Main function This demo uses a 12-LED RGB ring

Note
This program requires the NEOLED controller to be synthesized (UART0 is optional).
Returns
0 if execution was successful