1 /*This file is prepared for Doxygen automatic documentation generation.*/
\r
2 /*! \file *********************************************************************
\r
4 * \brief AT32UC3B EVK1101 board LEDs support package.
\r
6 * This file contains definitions and services related to the LED features of
\r
9 * - Compiler: IAR EWAVR32 and GNU GCC for AVR32
\r
10 * - Supported devices: All AVR32 AT32UC3B devices can be used.
\r
13 * \author Atmel Corporation: http://www.atmel.com \n
\r
14 * Support and FAQ: http://support.atmel.no/
\r
16 ******************************************************************************/
\r
18 /* Copyright (c) 2007, Atmel Corporation All rights reserved.
\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
23 * 1. Redistributions of source code must retain the above copyright notice,
\r
24 * this list of conditions and the following disclaimer.
\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
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
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
49 #include "compiler.h"
\r
52 /*! \name Identifiers of LEDs to Use with LED Functions
\r
62 /*! \brief Gets the last state of all LEDs set through the LED API.
\r
64 * \return State of all LEDs (1 bit per LED).
\r
66 * \note The GPIO pin configuration of all LEDs is left unchanged.
\r
68 extern U32 LED_Read_Display(void);
\r
70 /*! \brief Sets the state of all LEDs.
\r
72 * \param leds New state of all LEDs (1 bit per LED).
\r
74 * \note The pins of all LEDs are set to GPIO output mode.
\r
76 extern void LED_Display(U32 leds);
\r
78 /*! \brief Gets the last state of the specified LEDs set through the LED API.
\r
80 * \param mask LEDs of which to get the state (1 bit per LED).
\r
82 * \return State of the specified LEDs (1 bit per LED).
\r
84 * \note The GPIO pin configuration of all LEDs is left unchanged.
\r
86 extern U32 LED_Read_Display_Mask(U32 mask);
\r
88 /*! \brief Sets the state of the specified LEDs.
\r
90 * \param mask LEDs of which to set the state (1 bit per LED).
\r
92 * \param leds New state of the specified LEDs (1 bit per LED).
\r
94 * \note The pins of the specified LEDs are set to GPIO output mode.
\r
96 extern void LED_Display_Mask(U32 mask, U32 leds);
\r
98 /*! \brief Tests the last state of the specified LEDs set through the LED API.
\r
100 * \param leds LEDs of which to test the state (1 bit per LED).
\r
102 * \return \c TRUE if at least one of the specified LEDs has a state on, else
\r
105 * \note The GPIO pin configuration of all LEDs is left unchanged.
\r
107 extern Bool LED_Test(U32 leds);
\r
109 /*! \brief Turns off the specified LEDs.
\r
111 * \param leds LEDs to turn off (1 bit per LED).
\r
113 * \note The pins of the specified LEDs are set to GPIO output mode.
\r
115 extern void LED_Off(U32 leds);
\r
117 /*! \brief Turns on the specified LEDs.
\r
119 * \param leds LEDs to turn on (1 bit per LED).
\r
121 * \note The pins of the specified LEDs are set to GPIO output mode.
\r
123 extern void LED_On(U32 leds);
\r
125 /*! \brief Toggles the specified LEDs.
\r
127 * \param leds LEDs to toggle (1 bit per LED).
\r
129 * \note The pins of the specified LEDs are set to GPIO output mode.
\r
131 extern void LED_Toggle(U32 leds);
\r
133 /*! \brief Gets as a bit-field the last state of the specified LEDs set through
\r
136 * \param field LEDs of which to get the state (1 bit per LED).
\r
138 * \return State of the specified LEDs (1 bit per LED, beginning with the first
\r
141 * \note The GPIO pin configuration of all LEDs is left unchanged.
\r
143 extern U32 LED_Read_Display_Field(U32 field);
\r
145 /*! \brief Sets as a bit-field the state of the specified LEDs.
\r
147 * \param field LEDs of which to set the state (1 bit per LED).
\r
148 * \param leds New state of the specified LEDs (1 bit per LED, beginning with
\r
149 * the first specified LED).
\r
151 * \note The pins of the specified LEDs are set to GPIO output mode.
\r
153 extern void LED_Display_Field(U32 field, U32 leds);
\r
155 /*! \brief Gets the intensity of the specified LED.
\r
157 * \param led LED of which to get the intensity (1 bit per LED; only the least
\r
158 * significant set bit is used).
\r
160 * \return Intensity of the specified LED (0x00 to 0xFF).
\r
162 * \warning The PWM channel of the specified LED is supposed to be used only by
\r
165 * \note The GPIO pin configuration of all LEDs is left unchanged.
\r
167 extern U8 LED_Get_Intensity(U32 led);
\r
169 /*! \brief Sets the intensity of the specified LEDs.
\r
171 * \param leds LEDs of which to set the intensity (1 bit per LED).
\r
172 * \param intensity New intensity of the specified LEDs (0x00 to 0xFF).
\r
174 * \warning The PWM channels of the specified LEDs are supposed to be used only
\r
177 * \note The pins of the specified LEDs are set to PWM output mode.
\r
179 extern void LED_Set_Intensity(U32 leds, U8 intensity);
\r