-
Notifications
You must be signed in to change notification settings - Fork 1
/
POV_Helper.h
78 lines (63 loc) · 1.85 KB
/
POV_Helper.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//*****************************************************************************
// Filename: POV_Helper.h
// Author: Derek Chopp
// Last Update: 3/25/14
//
// Description: Header file for POV helper code
//
// TODO:
// same as POV_Helper.c
//
//*****************************************************************************
#ifndef POV_HELPER_H_
#define POV_HELPER_H_
#include <stdint.h>
//*****************************************************************************
// Define Constants
//*****************************************************************************
#define NUM_MODULES 2
#define NUM_DIVS 180
#define multiplier 2
#define CTRL0 0x96
#define CTRL1 0xC8
#define CTRL2 0xFF
#define CTRL3 0xFF
//*****************************************************************************
// Structures
//*****************************************************************************
//LED holds RGB data for individual LED's
typedef struct
{
uint16_t R;
uint16_t G;
uint16_t B;
} LED;
//LED_Module holds 4 LED Structs to represent 1 LED board (Module)
typedef struct
{
LED D[4];
} LED_Module;
//LED_Array holds a columns worth of LED_Module's
typedef struct
{
LED_Module M[NUM_MODULES];
} LED_Array;
//LED Packet
typedef struct
{
unsigned char Packet[28];
} LED_PACKET;
//LED Message
typedef struct
{
LED_PACKET Packets[NUM_MODULES];
} LED_MSG;
//*****************************************************************************
// Function Prototypes
//*****************************************************************************
void POV_Init(LED_Array *LEDS);
void POV_Make_MSG(LED_MSG *msg, LED_Array *LEDS);
void POV_Prepare_Data(LED_Array *LEDS, uint8_t *newData);
void POV_Set_All(LED_Array *LEDS, uint16_t newRed, uint16_t newBlue, uint16_t newGreen);
void POV_Shift_Up(LED_Array *LEDS, uint16_t newRed, uint16_t newBlue, uint16_t newGreen);
#endif /* POV_HELPER_H_ */