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