Macros | Functions | Variables
main.c File Reference
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <signal.h>
#include <stdarg.h>
#include <getopt.h>
#include "clk.h"
#include "gpio.h"
#include "dma.h"
#include "pwm.h"
#include "version.h"
#include "ws2811.h"
Include dependency graph for main.c:

Go to the source code of this file.

Macros

#define ARRAY_SIZE(stuff)   (sizeof(stuff) / sizeof(stuff[0]))
 
#define DMA   10
 
#define GPIO_PIN   18
 
#define HEIGHT   8
 
#define LED_COUNT   (WIDTH * HEIGHT)
 
#define STRIP_TYPE   WS2811_STRIP_GBR
 
#define TARGET_FREQ   WS2811_TARGET_FREQ
 
#define WIDTH   8
 

Functions

static void ctrl_c_handler (int signum)
 
int main (int argc, char *argv[])
 
void matrix_bottom (void)
 
void matrix_clear (void)
 
void matrix_raise (void)
 
void matrix_render (void)
 
void parseargs (int argc, char **argv, ws2811_t *ws2811)
 
static void setup_handlers (void)
 

Variables

int clear_on_exit = 0
 
ws2811_led_t dotcolors []
 
ws2811_led_t dotcolors_rgbw []
 
int dotspos [] = { 0, 1, 2, 3, 4, 5, 6, 7 }
 
int height = HEIGHT
 
int led_count = LED_COUNT
 
ws2811_t ledstring
 
ws2811_led_tmatrix
 
static uint8_t running = 1
 
static char VERSION [] = "XX.YY.ZZ"
 
int width = WIDTH
 

Macro Definition Documentation

◆ ARRAY_SIZE

#define ARRAY_SIZE (   stuff)    (sizeof(stuff) / sizeof(stuff[0]))

Definition at line 56 of file main.c.

◆ DMA

#define DMA   10

Definition at line 61 of file main.c.

◆ GPIO_PIN

#define GPIO_PIN   18

Definition at line 60 of file main.c.

◆ HEIGHT

#define HEIGHT   8

Definition at line 67 of file main.c.

◆ LED_COUNT

#define LED_COUNT   (WIDTH * HEIGHT)

Definition at line 68 of file main.c.

◆ STRIP_TYPE

#define STRIP_TYPE   WS2811_STRIP_GBR

Definition at line 63 of file main.c.

◆ TARGET_FREQ

#define TARGET_FREQ   WS2811_TARGET_FREQ

Definition at line 59 of file main.c.

◆ WIDTH

#define WIDTH   8

Definition at line 66 of file main.c.

Function Documentation

◆ ctrl_c_handler()

static void ctrl_c_handler ( int  signum)
static

Definition at line 191 of file main.c.

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 375 of file main.c.

◆ matrix_bottom()

void matrix_bottom ( void  )

Definition at line 171 of file main.c.

◆ matrix_clear()

void matrix_clear ( void  )

Definition at line 132 of file main.c.

◆ matrix_raise()

void matrix_raise ( void  )

Definition at line 117 of file main.c.

◆ matrix_render()

void matrix_render ( void  )

Definition at line 104 of file main.c.

◆ parseargs()

void parseargs ( int  argc,
char **  argv,
ws2811_t ws2811 
)

Definition at line 209 of file main.c.

◆ setup_handlers()

static void setup_handlers ( void  )
static

Definition at line 197 of file main.c.

Variable Documentation

◆ clear_on_exit

int clear_on_exit = 0

Definition at line 74 of file main.c.

◆ dotcolors

ws2811_led_t dotcolors[]
Initial value:
=
{
0x00200000,
0x00201000,
0x00202000,
0x00002000,
0x00002020,
0x00000020,
0x00100010,
0x00200010,
}

Definition at line 146 of file main.c.

◆ dotcolors_rgbw

ws2811_led_t dotcolors_rgbw[]
Initial value:
=
{
0x00200000,
0x10200000,
0x00002000,
0x10002000,
0x00000020,
0x10000020,
0x00101010,
0x10101010,
}

Definition at line 158 of file main.c.

◆ dotspos

int dotspos[] = { 0, 1, 2, 3, 4, 5, 6, 7 }

Definition at line 145 of file main.c.

◆ height

int height = HEIGHT

Definition at line 71 of file main.c.

◆ led_count

int led_count = LED_COUNT

Definition at line 72 of file main.c.

◆ ledstring

ws2811_t ledstring
Initial value:
=
{
.freq = TARGET_FREQ,
.dmanum = DMA,
.channel =
{
[0] =
{
.gpionum = GPIO_PIN,
.count = LED_COUNT,
.invert = 0,
.brightness = 255,
.strip_type = STRIP_TYPE,
},
[1] =
{
.gpionum = 0,
.count = 0,
.invert = 0,
.brightness = 0,
},
},
}

Definition at line 76 of file main.c.

◆ matrix

ws2811_led_t* matrix

Definition at line 100 of file main.c.

◆ running

uint8_t running = 1
static

Definition at line 102 of file main.c.

◆ VERSION

char VERSION[] = "XX.YY.ZZ"
static

Definition at line 31 of file main.c.

◆ width

int width = WIDTH

Definition at line 70 of file main.c.

LED_COUNT
#define LED_COUNT
Definition: main.c:68
GPIO_PIN
#define GPIO_PIN
Definition: main.c:60
TARGET_FREQ
#define TARGET_FREQ
Definition: main.c:59
STRIP_TYPE
#define STRIP_TYPE
Definition: main.c:63
DMA
#define DMA
Definition: main.c:61


ws281x
Author(s): Alexey Rogachevskiy , Oleg Kalachev
autogenerated on Wed Jun 15 2022 02:21:36