]> git.sur5r.net Git - freertos/blob - Demo/AVR32_UC3/BOARDS/EVK1100/led.h
Removed outdated AVR32 demo.
[freertos] / Demo / AVR32_UC3 / BOARDS / EVK1100 / led.h
1 /*This file is prepared for Doxygen automatic documentation generation.*/\r
2 /*! \file *********************************************************************\r
3  *\r
4  * \brief AT32UC3A EVK1100 board LEDs support package.\r
5  *\r
6  * This file contains definitions and services related to the LED features of\r
7  * the EVK1100 board.\r
8  *\r
9  * - Compiler:           IAR EWAVR32 and GNU GCC for AVR32\r
10  * - Supported devices:  All AVR32 AT32UC3A devices can be used.\r
11  * - AppNote:\r
12  *\r
13  * \author               Atmel Corporation: http://www.atmel.com \n\r
14  *                       Support and FAQ: http://support.atmel.no/\r
15  *\r
16  ******************************************************************************/\r
17 \r
18 /* Copyright (c) 2007, Atmel Corporation All rights reserved.\r
19  *\r
20  * Redistribution and use in source and binary forms, with or without\r
21  * modification, are permitted provided that the following conditions are met:\r
22  *\r
23  * 1. Redistributions of source code must retain the above copyright notice,\r
24  * this list of conditions and the following disclaimer.\r
25  *\r
26  * 2. Redistributions in binary form must reproduce the above copyright notice,\r
27  * this list of conditions and the following disclaimer in the documentation\r
28  * and/or other materials provided with the distribution.\r
29  *\r
30  * 3. The name of ATMEL may not be used to endorse or promote products derived\r
31  * from this software without specific prior written permission.\r
32  *\r
33  * THIS SOFTWARE IS PROVIDED BY ATMEL ``AS IS'' AND ANY EXPRESS OR IMPLIED\r
34  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
35  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND\r
36  * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT,\r
37  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r
38  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r
39  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r
40  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
41  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\r
42  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
43  */\r
44 \r
45 \r
46 #ifndef _LED_H_\r
47 #define _LED_H_\r
48 \r
49 #include "compiler.h"\r
50 \r
51 \r
52 /*! \name Identifiers of LEDs to Use with LED Functions\r
53  */\r
54 //! @{\r
55 #define LED0  0x01\r
56 #define LED1  0x02\r
57 #define LED2  0x04\r
58 #define LED3  0x08\r
59 #define LED4  0x10\r
60 #define LED5  0x20\r
61 #define LED6  0x40\r
62 #define LED7  0x80\r
63 //! @}\r
64 \r
65 \r
66 /*! \brief Gets the last state of all LEDs set through the LED API.\r
67  *\r
68  * \return State of all LEDs (1 bit per LED).\r
69  *\r
70  * \note The GPIO pin configuration of all LEDs is left unchanged.\r
71  */\r
72 extern U32 LED_Read_Display(void);\r
73 \r
74 /*! \brief Sets the state of all LEDs.\r
75  *\r
76  * \param leds New state of all LEDs (1 bit per LED).\r
77  *\r
78  * \note The pins of all LEDs are set to GPIO output mode.\r
79  */\r
80 extern void LED_Display(U32 leds);\r
81 \r
82 /*! \brief Gets the last state of the specified LEDs set through the LED API.\r
83  *\r
84  * \param mask LEDs of which to get the state (1 bit per LED).\r
85  *\r
86  * \return State of the specified LEDs (1 bit per LED).\r
87  *\r
88  * \note The GPIO pin configuration of all LEDs is left unchanged.\r
89  */\r
90 extern U32 LED_Read_Display_Mask(U32 mask);\r
91 \r
92 /*! \brief Sets the state of the specified LEDs.\r
93  *\r
94  * \param mask LEDs of which to set the state (1 bit per LED).\r
95  *\r
96  * \param leds New state of the specified LEDs (1 bit per LED).\r
97  *\r
98  * \note The pins of the specified LEDs are set to GPIO output mode.\r
99  */\r
100 extern void LED_Display_Mask(U32 mask, U32 leds);\r
101 \r
102 /*! \brief Tests the last state of the specified LEDs set through the LED API.\r
103  *\r
104  * \param leds LEDs of which to test the state (1 bit per LED).\r
105  *\r
106  * \return \c TRUE if at least one of the specified LEDs has a state on, else\r
107  *         \c FALSE.\r
108  *\r
109  * \note The GPIO pin configuration of all LEDs is left unchanged.\r
110  */\r
111 extern Bool LED_Test(U32 leds);\r
112 \r
113 /*! \brief Turns off the specified LEDs.\r
114  *\r
115  * \param leds LEDs to turn off (1 bit per LED).\r
116  *\r
117  * \note The pins of the specified LEDs are set to GPIO output mode.\r
118  */\r
119 extern void LED_Off(U32 leds);\r
120 \r
121 /*! \brief Turns on the specified LEDs.\r
122  *\r
123  * \param leds LEDs to turn on (1 bit per LED).\r
124  *\r
125  * \note The pins of the specified LEDs are set to GPIO output mode.\r
126  */\r
127 extern void LED_On(U32 leds);\r
128 \r
129 /*! \brief Toggles the specified LEDs.\r
130  *\r
131  * \param leds LEDs to toggle (1 bit per LED).\r
132  *\r
133  * \note The pins of the specified LEDs are set to GPIO output mode.\r
134  */\r
135 extern void LED_Toggle(U32 leds);\r
136 \r
137 /*! \brief Gets as a bit-field the last state of the specified LEDs set through\r
138  *         the LED API.\r
139  *\r
140  * \param field LEDs of which to get the state (1 bit per LED).\r
141  *\r
142  * \return State of the specified LEDs (1 bit per LED, beginning with the first\r
143  *         specified LED).\r
144  *\r
145  * \note The GPIO pin configuration of all LEDs is left unchanged.\r
146  */\r
147 extern U32 LED_Read_Display_Field(U32 field);\r
148 \r
149 /*! \brief Sets as a bit-field the state of the specified LEDs.\r
150  *\r
151  * \param field LEDs of which to set the state (1 bit per LED).\r
152  * \param leds New state of the specified LEDs (1 bit per LED, beginning with\r
153  *             the first specified LED).\r
154  *\r
155  * \note The pins of the specified LEDs are set to GPIO output mode.\r
156  */\r
157 extern void LED_Display_Field(U32 field, U32 leds);\r
158 \r
159 /*! \brief Gets the intensity of the specified LED.\r
160  *\r
161  * \param led LED of which to get the intensity (1 bit per LED; only the least\r
162  *            significant set bit is used).\r
163  *\r
164  * \return Intensity of the specified LED (0x00 to 0xFF).\r
165  *\r
166  * \warning The PWM channel of the specified LED is supposed to be used only by\r
167  *          this module.\r
168  *\r
169  * \note The GPIO pin configuration of all LEDs is left unchanged.\r
170  */\r
171 extern U8 LED_Get_Intensity(U32 led);\r
172 \r
173 /*! \brief Sets the intensity of the specified LEDs.\r
174  *\r
175  * \param leds LEDs of which to set the intensity (1 bit per LED).\r
176  * \param intensity New intensity of the specified LEDs (0x00 to 0xFF).\r
177  *\r
178  * \warning The PWM channels of the specified LEDs are supposed to be used only\r
179  *          by this module.\r
180  *\r
181  * \note The pins of the specified LEDs are set to PWM output mode.\r
182  */\r
183 extern void LED_Set_Intensity(U32 leds, U8 intensity);\r
184 \r
185 \r
186 #endif  // _LED_H_\r