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