]> git.sur5r.net Git - freertos/blob - Demo/AVR32_UC3A_GCC/Atmel_SW_Framework/BOARDS/EVK1100/led.h
29f882229ba00b7da4904c0e7fdfd9def48f1c63
[freertos] / Demo / AVR32_UC3A_GCC / Atmel_SW_Framework / BOARDS / EVK1100 / led.h
1 /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */\r
2
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 and FAQ: http://support.atmel.no/\r
17  *\r
18  ******************************************************************************/\r
19 \r
20 /* Copyright (c) 2009 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, this\r
26  * 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  * 4. This software may only be redistributed and used in connection with an Atmel\r
36  * AVR product.\r
37  *\r
38  * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED\r
39  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
40  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE\r
41  * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR\r
42  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r
43  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r
44  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r
45  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
46  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\r
47  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\r
48  *\r
49  */\r
50 \r
51 #ifndef _LED_H_\r
52 #define _LED_H_\r
53 \r
54 #include "compiler.h"\r
55 \r
56 \r
57 /*! \name Identifiers of LEDs to Use with LED Functions\r
58  */\r
59 //! @{\r
60 #define LED0  0x01\r
61 #define LED1  0x02\r
62 #define LED2  0x04\r
63 #define LED3  0x08\r
64 #define LED4  0x10\r
65 #define LED5  0x20\r
66 #define LED6  0x40\r
67 #define LED7  0x80\r
68 //! @}\r
69 \r
70 \r
71 /*! \brief Gets the last state of all LEDs set through the LED API.\r
72  *\r
73  * \return State of all LEDs (1 bit per LED).\r
74  *\r
75  * \note The GPIO pin configuration of all LEDs is left unchanged.\r
76  */\r
77 extern U32 LED_Read_Display(void);\r
78 \r
79 /*! \brief Sets the state of all LEDs.\r
80  *\r
81  * \param leds New state of all LEDs (1 bit per LED).\r
82  *\r
83  * \note The pins of all LEDs are set to GPIO output mode.\r
84  */\r
85 extern void LED_Display(U32 leds);\r
86 \r
87 /*! \brief Gets the last state of the specified LEDs set through the LED API.\r
88  *\r
89  * \param mask LEDs of which to get the state (1 bit per LED).\r
90  *\r
91  * \return State of the specified LEDs (1 bit per LED).\r
92  *\r
93  * \note The GPIO pin configuration of all LEDs is left unchanged.\r
94  */\r
95 extern U32 LED_Read_Display_Mask(U32 mask);\r
96 \r
97 /*! \brief Sets the state of the specified LEDs.\r
98  *\r
99  * \param mask LEDs of which to set the state (1 bit per LED).\r
100  *\r
101  * \param leds New state of the specified LEDs (1 bit per LED).\r
102  *\r
103  * \note The pins of the specified LEDs are set to GPIO output mode.\r
104  */\r
105 extern void LED_Display_Mask(U32 mask, U32 leds);\r
106 \r
107 /*! \brief Tests the last state of the specified LEDs set through the LED API.\r
108  *\r
109  * \param leds LEDs of which to test the state (1 bit per LED).\r
110  *\r
111  * \return \c TRUE if at least one of the specified LEDs has a state on, else\r
112  *         \c FALSE.\r
113  *\r
114  * \note The GPIO pin configuration of all LEDs is left unchanged.\r
115  */\r
116 extern Bool LED_Test(U32 leds);\r
117 \r
118 /*! \brief Turns off the specified LEDs.\r
119  *\r
120  * \param leds LEDs to turn off (1 bit per LED).\r
121  *\r
122  * \note The pins of the specified LEDs are set to GPIO output mode.\r
123  */\r
124 extern void LED_Off(U32 leds);\r
125 \r
126 /*! \brief Turns on the specified LEDs.\r
127  *\r
128  * \param leds LEDs to turn on (1 bit per LED).\r
129  *\r
130  * \note The pins of the specified LEDs are set to GPIO output mode.\r
131  */\r
132 extern void LED_On(U32 leds);\r
133 \r
134 /*! \brief Toggles the specified LEDs.\r
135  *\r
136  * \param leds LEDs to toggle (1 bit per LED).\r
137  *\r
138  * \note The pins of the specified LEDs are set to GPIO output mode.\r
139  */\r
140 extern void LED_Toggle(U32 leds);\r
141 \r
142 /*! \brief Gets as a bit-field the last state of the specified LEDs set through\r
143  *         the LED API.\r
144  *\r
145  * \param field LEDs of which to get the state (1 bit per LED).\r
146  *\r
147  * \return State of the specified LEDs (1 bit per LED, beginning with the first\r
148  *         specified LED).\r
149  *\r
150  * \note The GPIO pin configuration of all LEDs is left unchanged.\r
151  */\r
152 extern U32 LED_Read_Display_Field(U32 field);\r
153 \r
154 /*! \brief Sets as a bit-field the state of the specified LEDs.\r
155  *\r
156  * \param field LEDs of which to set the state (1 bit per LED).\r
157  * \param leds New state of the specified LEDs (1 bit per LED, beginning with\r
158  *             the first specified LED).\r
159  *\r
160  * \note The pins of the specified LEDs are set to GPIO output mode.\r
161  */\r
162 extern void LED_Display_Field(U32 field, U32 leds);\r
163 \r
164 /*! \brief Gets the intensity of the specified LED.\r
165  *\r
166  * \param led LED of which to get the intensity (1 bit per LED; only the least\r
167  *            significant set bit is used).\r
168  *\r
169  * \return Intensity of the specified LED (0x00 to 0xFF).\r
170  *\r
171  * \warning The PWM channel of the specified LED is supposed to be used only by\r
172  *          this module.\r
173  *\r
174  * \note The GPIO pin configuration of all LEDs is left unchanged.\r
175  */\r
176 extern U8 LED_Get_Intensity(U32 led);\r
177 \r
178 /*! \brief Sets the intensity of the specified LEDs.\r
179  *\r
180  * \param leds LEDs of which to set the intensity (1 bit per LED).\r
181  * \param intensity New intensity of the specified LEDs (0x00 to 0xFF).\r
182  *\r
183  * \warning The PWM channels of the specified LEDs are supposed to be used only\r
184  *          by this module.\r
185  *\r
186  * \note The pins of the specified LEDs are set to PWM output mode.\r
187  */\r
188 extern void LED_Set_Intensity(U32 leds, U8 intensity);\r
189 \r
190 \r
191 #endif  // _LED_H_\r