source: arduino-1-6-7/trunk/fuentes/arduino-ide-amd64/hardware/arduino/avr/firmwares/wifishield/wifi_dnld/src/SOFTWARE_FRAMEWORK/BOARDS/ARDUINO/led.h @ 4837

Last change on this file since 4837 was 4837, checked in by daduve, 3 years ago

Adding new version

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