source: arduino-1-6-7/trunk/fuentes/arduino-ide-amd64/libraries/WiFi/extras/wifiHD/src/SOFTWARE_FRAMEWORK/BOARDS/EVK1105/led.h @ 46

Last change on this file since 46 was 46, checked in by jrpelegrina, 4 years ago

First release to Xenial

File size: 6.1 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 EVK1105 board LEDs support package.
7 *
8 * This file contains definitions and services related to the LED features of
9 * the EVK1105 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//! @}
65
66
67/*! \brief Gets the last state of all LEDs set through the LED API.
68 *
69 * \return State of all LEDs (1 bit per LED).
70 *
71 * \note The GPIO pin configuration of all LEDs is left unchanged.
72 */
73extern U32 LED_Read_Display(void);
74
75/*! \brief Sets the state of all LEDs.
76 *
77 * \param leds New state of all LEDs (1 bit per LED).
78 *
79 * \note The pins of all LEDs are set to GPIO output mode.
80 */
81extern void LED_Display(U32 leds);
82
83/*! \brief Gets the last state of the specified LEDs set through the LED API.
84 *
85 * \param mask LEDs of which to get the state (1 bit per LED).
86 *
87 * \return State of the specified LEDs (1 bit per LED).
88 *
89 * \note The GPIO pin configuration of all LEDs is left unchanged.
90 */
91extern U32 LED_Read_Display_Mask(U32 mask);
92
93/*! \brief Sets the state of the specified LEDs.
94 *
95 * \param mask LEDs of which to set the state (1 bit per LED).
96 *
97 * \param leds New state of the specified LEDs (1 bit per LED).
98 *
99 * \note The pins of the specified LEDs are set to GPIO output mode.
100 */
101extern void LED_Display_Mask(U32 mask, U32 leds);
102
103/*! \brief Tests the last state of the specified LEDs set through the LED API.
104 *
105 * \param leds LEDs of which to test the state (1 bit per LED).
106 *
107 * \return \c TRUE if at least one of the specified LEDs has a state on, else
108 *         \c FALSE.
109 *
110 * \note The GPIO pin configuration of all LEDs is left unchanged.
111 */
112extern Bool LED_Test(U32 leds);
113
114/*! \brief Turns off the specified LEDs.
115 *
116 * \param leds LEDs to turn off (1 bit per LED).
117 *
118 * \note The pins of the specified LEDs are set to GPIO output mode.
119 */
120extern void LED_Off(U32 leds);
121
122/*! \brief Turns on the specified LEDs.
123 *
124 * \param leds LEDs to turn on (1 bit per LED).
125 *
126 * \note The pins of the specified LEDs are set to GPIO output mode.
127 */
128extern void LED_On(U32 leds);
129
130/*! \brief Toggles the specified LEDs.
131 *
132 * \param leds LEDs to toggle (1 bit per LED).
133 *
134 * \note The pins of the specified LEDs are set to GPIO output mode.
135 */
136extern void LED_Toggle(U32 leds);
137
138/*! \brief Gets as a bit-field the last state of the specified LEDs set through
139 *         the LED API.
140 *
141 * \param field LEDs of which to get the state (1 bit per LED).
142 *
143 * \return State of the specified LEDs (1 bit per LED, beginning with the first
144 *         specified LED).
145 *
146 * \note The GPIO pin configuration of all LEDs is left unchanged.
147 */
148extern U32 LED_Read_Display_Field(U32 field);
149
150/*! \brief Sets as a bit-field the state of the specified LEDs.
151 *
152 * \param field LEDs of which to set the state (1 bit per LED).
153 * \param leds New state of the specified LEDs (1 bit per LED, beginning with
154 *             the first specified LED).
155 *
156 * \note The pins of the specified LEDs are set to GPIO output mode.
157 */
158extern void LED_Display_Field(U32 field, U32 leds);
159
160/*! \brief Gets the intensity of the specified LED.
161 *
162 * \param led LED of which to get the intensity (1 bit per LED; only the least
163 *            significant set bit is used).
164 *
165 * \return Intensity of the specified LED (0x00 to 0xFF).
166 *
167 * \warning The PWM channel of the specified LED is supposed to be used only by
168 *          this module.
169 *
170 * \note The GPIO pin configuration of all LEDs is left unchanged.
171 */
172extern U8 LED_Get_Intensity(U32 led);
173
174/*! \brief Sets the intensity of the specified LEDs.
175 *
176 * \param leds LEDs of which to set the intensity (1 bit per LED).
177 * \param intensity New intensity of the specified LEDs (0x00 to 0xFF).
178 *
179 * \warning The PWM channels of the specified LEDs are supposed to be used only
180 *          by this module.
181 *
182 * \note The pins of the specified LEDs are set to PWM output mode.
183 */
184extern void LED_Set_Intensity(U32 leds, U8 intensity);
185
186
187#endif  // _LED_H_
Note: See TracBrowser for help on using the repository browser.