Project

General

Profile

Statistics
| Revision:

root / branches / library_refactor / lib / include / libdragonfly / lights.h @ 1100

History | View | Annotate | Download (3.1 KB)

1
/**
2
 * Copyright (c) 2007 Colony Project
3
 * 
4
 * Permission is hereby granted, free of charge, to any person
5
 * obtaining a copy of this software and associated documentation
6
 * files (the "Software"), to deal in the Software without
7
 * restriction, including without limitation the rights to use,
8
 * copy, modify, merge, publish, distribute, sublicense, and/or sell
9
 * copies of the Software, and to permit persons to whom the
10
 * Software is furnished to do so, subject to the following
11
 * conditions:
12
 * 
13
 * The above copyright notice and this permission notice shall be
14
 * included in all copies or substantial portions of the Software.
15
 * 
16
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
18
 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20
 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23
 * OTHER DEALINGS IN THE SOFTWARE.
24
 **/
25

    
26

    
27
/**
28
 * @file lights.h
29
 * @brief Contains declarations for managing the orbs.
30
 *
31
 * Contains declarations for using the orbs and PWM.
32
 *
33
 * @author Colony Project, CMU Robotics Club
34
 * Based on Firefly Library, by Tom Lauwers and Steven Shamlian
35
 **/
36

    
37
#ifndef _LIGHTS_H_
38
#define _LIGHTS_H_
39

    
40

    
41
/**
42
 * @addtogroup orbs
43
 * @{
44
 **/
45

    
46
//ORB Colors
47
/** @brief Red **/
48
#define RED       0xE0
49
/** @brief Orange **/
50
#define ORANGE    0xE4
51
/** @brief Yellow **/
52
#define YELLOW    0xE8
53
/** @brief Lime **/
54
#define LIME      0x68
55
/** @brief Green **/
56
#define GREEN     0x1C
57
/** @brief Cyan **/
58
#define CYAN      0x1F
59
/** @brief Blue **/
60
#define BLUE      0x03
61
/** @brief Pink **/
62
#define PINK      0xA6 
63
/** @brief Purple **/
64
#define PURPLE    0x41
65
/** @brief Magenta **/
66
#define MAGENTA   0xE3
67
/** @brief White **/
68
#define WHITE     0xFE
69
/** @brief Turn the orb off (White) **/
70
#define ORB_OFF   0xFE      //ORB_OFF->WHITE
71

    
72

    
73
// ***** Initialization *****
74

    
75
/** @brief Enables the orbs **/
76
void orb_init(void);
77

    
78

    
79
// ***** Management *****
80

    
81
/** @brief Disable the orbs **/
82
void orb_disable(void);
83
/** @brief Enable the orbs **/
84
void orb_enable(void);
85

    
86

    
87
// ***** Setting RGB colors *****
88

    
89
// FIXME remove
90
typedef unsigned char uint8_t;
91

    
92
/** @brief Set both orbs to a specified color **/
93
void orb_set(uint8_t red, uint8_t green, uint8_t blue);
94

    
95
/** @brief Set orb1 to a specified color **/
96
void orb1_set(uint8_t red_led, uint8_t green_led, uint8_t blue_led); 
97

    
98
/** @brief Set orb2 to a specified color **/
99
void orb2_set(uint8_t red_led, uint8_t green_led, uint8_t blue_led);
100

    
101

    
102
// ***** Settings predefined colors *****
103

    
104
/** @brief Set both orbs to a specified color **/
105
void orb_set_color(uint8_t col);
106

    
107
/** @brief Set orb1 to a specified color **/
108
void orb1_set_color(uint8_t col);
109

    
110
/** @brief Set orb2 to a specified color **/
111
void orb2_set_color(uint8_t col);
112

    
113
/** @} **/ //end addtogroup
114

    
115

    
116
// Debug
117
void orb_tick(uint8_t t);
118

    
119
#endif
120