Revision 1131
Cleaned up lights.h
Implemented predefined color setting
Implemented binary/PWM mode switching
lights.h | ||
---|---|---|
1 |
// FIXME remove |
|
2 |
typedef unsigned char uint8_t; |
|
3 |
|
|
4 |
|
|
1 | 5 |
/** |
2 | 6 |
* Copyright (c) 2007 Colony Project |
3 | 7 |
* |
... | ... | |
43 | 47 |
* @{ |
44 | 48 |
**/ |
45 | 49 |
|
46 |
//ORB Colors |
|
50 |
// ORB Colors
|
|
47 | 51 |
/** @brief Red **/ |
48 | 52 |
#define RED 0xE0 |
49 | 53 |
/** @brief Orange **/ |
... | ... | |
66 | 70 |
#define MAGENTA 0xE3 |
67 | 71 |
/** @brief White **/ |
68 | 72 |
#define WHITE 0xFE |
69 |
/** @brief Turn the orb off (White) **/
|
|
70 |
#define ORB_OFF 0xFE //ORB_OFF->WHITE
|
|
73 |
/** @brief Turn the orb off **/ |
|
74 |
#define ORB_OFF 0x00
|
|
71 | 75 |
|
72 | 76 |
|
73 | 77 |
// ***** Initialization ***** |
... | ... | |
76 | 80 |
void orb_init(void); |
77 | 81 |
|
78 | 82 |
|
79 |
// ***** Management ***** |
|
80 | 83 |
|
81 |
/** @brief Disable the orbs **/ |
|
82 |
void orb_disable(void); |
|
83 |
/** @brief Enable the orbs **/ |
|
84 |
void orb_enable(void); |
|
85 |
|
|
86 |
|
|
87 | 84 |
// ***** Setting RGB colors ***** |
88 | 85 |
|
89 |
// FIXME remove |
|
90 |
typedef unsigned char uint8_t; |
|
91 |
|
|
92 | 86 |
/** @brief Set both orbs to a specified color **/ |
93 | 87 |
void orb_set(uint8_t red, uint8_t green, uint8_t blue); |
94 | 88 |
|
... | ... | |
98 | 92 |
/** @brief Set orb2 to a specified color **/ |
99 | 93 |
void orb2_set(uint8_t red_led, uint8_t green_led, uint8_t blue_led); |
100 | 94 |
|
95 |
void orbs_set (uint8_t red1, uint8_t green1, uint8_t blue1, uint8_t red2, uint8_t green2, uint8_t blue2); |
|
101 | 96 |
|
97 |
|
|
102 | 98 |
// ***** Settings predefined colors ***** |
103 | 99 |
|
104 | 100 |
/** @brief Set both orbs to a specified color **/ |
... | ... | |
110 | 106 |
/** @brief Set orb2 to a specified color **/ |
111 | 107 |
void orb2_set_color(uint8_t col); |
112 | 108 |
|
113 |
/** @} **/ //end addtogroup
|
|
109 |
void orbs_set_color(uint8_t col1, uint8_t col2);
|
|
114 | 110 |
|
115 | 111 |
|
116 |
void orb_enable_timer (void); |
|
117 |
void orb_disable_timer (void); |
|
112 |
// ***** Mode setting ***** |
|
118 | 113 |
|
114 |
typedef uint8_t orb_mode_t; |
|
115 |
#define orb_mode_pwm 0 |
|
116 |
#define orb_mode_binary 1 |
|
119 | 117 |
|
120 |
// Debug |
|
121 |
void orb_tick(uint8_t t); |
|
118 |
void orb_set_mode (orb_mode_t mode); |
|
122 | 119 |
|
120 |
|
|
121 |
// ***** Initialization ***** |
|
122 |
|
|
123 |
void orb_init_binary (void); |
|
124 |
void orb_init_pwm (void); |
|
125 |
void orb_init (void); |
|
126 |
|
|
127 |
/** @} **/ //end addtogroup |
|
128 |
|
|
129 |
|
|
123 | 130 |
#endif |
124 | 131 |
|
Also available in: Unified diff