Subversion Repositories LedShow

Rev

Rev 6 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 mjames 1
/*
2
 * leds.h
3
 *
4
 *  Created on: 7 Jul 2019
5
 *      Author: Mike
6
 */
7
 
8
#pragma once
9
 
10
#define SPI_PRESCALE 8
11
 
5 mjames 12
#pragma pack(push,1)
2 mjames 13
typedef struct
14
{
8 mjames 15
        uint8_t fader; // set to 0..255 to fade chosen RGBW colour from 0..100% intensity
16
        uint8_t red;   // set to 0..255 to fade red component
17
        uint8_t green; // set to 0..255 to fade green component
18
        uint8_t blue;  // set to 0..255 to fade blue component
19
        uint8_t white; // set to 0..255 to fade white led component
5 mjames 20
} frgbw_t;
21
#pragma pack(pop)
8 mjames 22
 
23
// Usage initCode(), codeReset(); for (i=0; i< leds; i++ ) ( codeFRGBW(leds[i]) } codeStop();
24
extern void initCode( void); ///< Call this first to initialise coder pointer
25
 
26
extern void     codeReset(void); ///< Call this to send a reset code to LEDS
27
 
28
extern void codeFRGBW(frgbw_t led ); ///< code the RGBW descriptor into the next LED.
29
 
30
extern void codeStop (void); ///< Call this to send a dark LED stop pattern
31
 
32
extern void sendCode (void); ///< call this to send data via SPI DMA to LEDS.
33