Revision 1142
Merged new orbs code
Added atomic.h
Fixed whitespace in eeprom.h
lights.h | ||
---|---|---|
1 |
// FIXME remove |
|
2 |
typedef unsigned char uint8_t; |
|
3 |
|
|
4 |
|
|
1 | 5 |
/** |
2 | 6 |
* Copyright (c) 2007 Colony Project |
3 | 7 |
* |
... | ... | |
37 | 41 |
#ifndef _LIGHTS_H_ |
38 | 42 |
#define _LIGHTS_H_ |
39 | 43 |
|
40 |
|
|
41 | 44 |
/** |
42 | 45 |
* @addtogroup orbs |
43 | 46 |
* @{ |
44 | 47 |
**/ |
45 | 48 |
|
46 |
//ORB Colors
|
|
49 |
// ***** Predefined colors *****
|
|
47 | 50 |
/** @brief Red **/ |
48 | 51 |
#define RED 0xE0 |
49 | 52 |
/** @brief Orange **/ |
... | ... | |
66 | 69 |
#define MAGENTA 0xE3 |
67 | 70 |
/** @brief White **/ |
68 | 71 |
#define WHITE 0xFE |
69 |
/** @brief Turn the orb off (White) **/
|
|
70 |
#define ORB_OFF 0xFE //ORB_OFF->WHITE
|
|
72 |
/** @brief Turn the orb off **/ |
|
73 |
#define ORB_OFF 0x00
|
|
71 | 74 |
|
72 |
/** @brief Enables the orbs **/ |
|
75 |
|
|
76 |
|
|
77 |
// ***** Initialization ***** |
|
78 |
|
|
79 |
/** @brief Enables the orbs in default mode **/ |
|
73 | 80 |
void orb_init(void); |
81 |
|
|
82 |
/** @brief Enables the orbs in binary mode **/ |
|
83 |
void orb_init_binary (void); |
|
84 |
|
|
85 |
/** @brief Enables the orbs in PWM mode **/ |
|
86 |
void orb_init_pwm (void); |
|
87 |
|
|
88 |
|
|
89 |
|
|
90 |
// ***** Mode setting ***** |
|
91 |
|
|
92 |
/** Specification of the orb mode **/ |
|
93 |
typedef uint8_t orb_mode_t; |
|
94 |
|
|
95 |
/** @brief PWM mode **/ |
|
96 |
#define orb_mode_pwm 0 |
|
97 |
|
|
98 |
/** @brief Binary mode **/ |
|
99 |
#define orb_mode_binary 1 |
|
100 |
|
|
101 |
|
|
102 |
/** @brief Switches the orbs to the specified mode **/ |
|
103 |
void orb_set_mode (orb_mode_t mode); |
|
104 |
|
|
105 |
/** @brief Disables the orb timer, but does not change the mode **/ |
|
106 |
void orb_disable_timer (void); |
|
107 |
|
|
108 |
/** @brief Enables the orb timer, but does not change the mode **/ |
|
109 |
void orb_enable_timer (void); |
|
110 |
|
|
111 |
|
|
112 |
|
|
113 |
// ***** Setting RGB colors ***** |
|
114 |
|
|
115 |
/** @brief set the specified orb to a specified color **/ |
|
116 |
void orb_n_set (uint8_t num, uint8_t red, uint8_t green, uint8_t blue); |
|
117 |
|
|
74 | 118 |
/** @brief Set both orbs to a specified color **/ |
75 |
void orb_set(unsigned char red_led, unsigned char green_led,
|
|
76 |
unsigned char blue_led); |
|
119 |
void orb_set(uint8_t red, uint8_t green, uint8_t blue);
|
|
120 |
|
|
77 | 121 |
/** @brief Set orb1 to a specified color **/ |
78 |
void orb1_set(unsigned char red_led, unsigned char green_led,
|
|
79 |
unsigned char blue_led); |
|
122 |
void orb1_set(uint8_t red_led, uint8_t green_led, uint8_t blue_led);
|
|
123 |
|
|
80 | 124 |
/** @brief Set orb2 to a specified color **/ |
81 |
void orb2_set(unsigned char red_led, unsigned char green_led, |
|
82 |
unsigned char blue_led); |
|
125 |
void orb2_set(uint8_t red_led, uint8_t green_led, uint8_t blue_led); |
|
83 | 126 |
|
84 |
/** @brief Set both orbs to a specified color **/ |
|
85 |
void orb_set_color(int col); |
|
127 |
void orbs_set (uint8_t red1, uint8_t green1, uint8_t blue1, uint8_t red2, uint8_t green2, uint8_t blue2); |
|
128 |
|
|
129 |
|
|
130 |
|
|
131 |
// ***** Settings predefined colors ***** |
|
132 |
|
|
133 |
/** @brief set the specified orb to the specified color **/ |
|
134 |
void orb_n_set_color(uint8_t num, uint8_t col); |
|
135 |
|
|
86 | 136 |
/** @brief Set orb1 to a specified color **/ |
87 |
void orb1_set_color(int col); |
|
137 |
void orb1_set_color(uint8_t col); |
|
138 |
|
|
88 | 139 |
/** @brief Set orb2 to a specified color **/ |
89 |
void orb2_set_color(int col);
|
|
140 |
void orb2_set_color(uint8_t col);
|
|
90 | 141 |
|
91 |
/** @brief Disable the orbs **/ |
|
92 |
void orb_disable(void); |
|
93 |
/** @brief Enable the orbs **/ |
|
94 |
void orb_enable(void); |
|
142 |
/** @brief set the orbs to specified colors **/ |
|
143 |
void orbs_set_color(uint8_t col1, uint8_t col2); |
|
95 | 144 |
|
145 |
/** @brief Set both orbs to a specified color **/ |
|
146 |
void orb_set_color(uint8_t col); |
|
147 |
|
|
148 |
|
|
149 |
|
|
96 | 150 |
/** @} **/ //end addtogroup |
97 | 151 |
|
98 | 152 |
#endif |
99 |
|
Also available in: Unified diff