You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
898 B
55 lines
898 B
10 years ago
|
#pragma once
|
||
|
|
||
|
// -- AVR GCC utility for driving WS2812B and similar RGB LED stripes --
|
||
|
|
||
10 years ago
|
// You must define the following in config file or here:
|
||
10 years ago
|
// * WS_PORT
|
||
|
// * WS_BIT
|
||
|
|
||
|
#include "config.h"
|
||
|
|
||
|
// The pin must be set to OUTPUT before using the output functions
|
||
|
|
||
|
|
||
|
// --- timing constraints (NS) ---
|
||
|
|
||
|
#ifndef WS_T_1H
|
||
|
#define WS_T_1H 700
|
||
|
#endif
|
||
|
|
||
|
#ifndef WS_T_1L
|
||
|
#define WS_T_1L 150
|
||
|
#endif
|
||
|
|
||
|
#ifndef WS_T_0H
|
||
|
#define WS_T_0H 150
|
||
|
#endif
|
||
|
|
||
|
#ifndef WS_T_0L
|
||
|
#define WS_T_0L 700
|
||
|
#endif
|
||
|
|
||
|
#ifndef WS_T_LATCH
|
||
|
#define WS_T_LATCH 7000
|
||
|
#endif
|
||
|
|
||
|
|
||
10 years ago
|
// More precise timing
|
||
10 years ago
|
// #define WS_T_1H 800
|
||
|
// #define WS_T_1L 450
|
||
|
// #define WS_T_0H 200
|
||
|
// #define WS_T_0L 650
|
||
|
// #define WS_T_LATCH 50000
|
||
|
|
||
|
|
||
|
/** Latch and display the RGB values */
|
||
|
void ws_show(void);
|
||
|
|
||
10 years ago
|
|
||
10 years ago
|
/** Send one byte to the RGB strip */
|
||
|
void ws_send_byte(uint8_t b);
|
||
|
|
||
10 years ago
|
|
||
10 years ago
|
/** Send RGB color to the strip */
|
||
|
void ws_send_rgb(uint8_t r, uint8_t g, uint8_t b);
|