+++ /dev/null
-/*This file is prepared for Doxygen automatic documentation generation.*/\r
-/*! \file *********************************************************************\r
- *\r
- * \brief AT32UC3A EVK1100 board header file.\r
- *\r
- * This file contains definitions and services related to the features of the\r
- * EVK1100 board.\r
- *\r
- * - Compiler: IAR EWAVR32 and GNU GCC for AVR32\r
- * - Supported devices: All AVR32 AT32UC3A devices can be used.\r
- * - AppNote:\r
- *\r
- * \author Atmel Corporation: http://www.atmel.com \n\r
- * Support and FAQ: http://support.atmel.no/\r
- *\r
- ******************************************************************************/\r
-\r
-/* Copyright (c) 2007, Atmel Corporation All rights reserved.\r
- *\r
- * Redistribution and use in source and binary forms, with or without\r
- * modification, are permitted provided that the following conditions are met:\r
- *\r
- * 1. Redistributions of source code must retain the above copyright notice,\r
- * this list of conditions and the following disclaimer.\r
- *\r
- * 2. Redistributions in binary form must reproduce the above copyright notice,\r
- * this list of conditions and the following disclaimer in the documentation\r
- * and/or other materials provided with the distribution.\r
- *\r
- * 3. The name of ATMEL may not be used to endorse or promote products derived\r
- * from this software without specific prior written permission.\r
- *\r
- * THIS SOFTWARE IS PROVIDED BY ATMEL ``AS IS'' AND ANY EXPRESS OR IMPLIED\r
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND\r
- * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT,\r
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\r
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
- */\r
-\r
-\r
-#ifndef _EVK1100_H_\r
-#define _EVK1100_H_\r
-\r
-#include "compiler.h"\r
-\r
-#ifdef __AVR32_ABI_COMPILER__ // Automatically defined when compiling for AVR32, not when assembling.\r
-# include "led.h"\r
-#endif // __AVR32_ABI_COMPILER__\r
-\r
-\r
-/*! \name Oscillator Definitions\r
- */\r
-//! @{\r
-\r
-// RCOsc has no custom calibration by default. Set the following definition to\r
-// the appropriate value if a custom RCOsc calibration has been applied to your\r
-// part.\r
-//#define FRCOSC 115200 //!< RCOsc frequency: Hz.\r
-\r
-#define FOSC32 32768 //!< Osc32 frequency: Hz.\r
-#define OSC32_STARTUP 3 //!< Osc32 startup time: RCOsc periods.\r
-\r
-#define FOSC0 12000000 //!< Osc0 frequency: Hz.\r
-#define OSC0_STARTUP 3 //!< Osc0 startup time: RCOsc periods.\r
-\r
-// Osc1 crystal is not mounted by default. Set the following definitions to the\r
-// appropriate values if a custom Osc1 crystal is mounted on your board.\r
-//#define FOSC1 12000000 //!< Osc1 frequency: Hz.\r
-//#define OSC1_STARTUP 3 //!< Osc1 startup time: RCOsc periods.\r
-\r
-//! @}\r
-\r
-\r
-/*! \name SDRAM Definitions\r
- */\r
-//! @{\r
-\r
-//! Part header file of used SDRAM(s).\r
-#define SDRAM_PART_HDR "MT48LC16M16A2TG7E/mt48lc16m16a2tg7e.h"\r
-\r
-//! Data bus width to use the SDRAM(s) with (16 or 32 bits; always 16 bits on\r
-//! UC3).\r
-#define SDRAM_DBW 16\r
-\r
-//! @}\r
-\r
-\r
-/*! \name USB Definitions\r
- */\r
-//! @{\r
-\r
-//! Multiplexed pin used for USB_ID: AVR32_USBB_USB_ID_x_x.\r
-//! To be selected according to the AVR32_USBB_USB_ID_x_x_PIN and\r
-//! AVR32_USBB_USB_ID_x_x_FUNCTION definitions from <avr32/uc3axxxx.h>.\r
-#define USB_ID AVR32_USBB_USB_ID_0_0\r
-\r
-//! Multiplexed pin used for USB_VBOF: AVR32_USBB_USB_VBOF_x_x.\r
-//! To be selected according to the AVR32_USBB_USB_VBOF_x_x_PIN and\r
-//! AVR32_USBB_USB_VBOF_x_x_FUNCTION definitions from <avr32/uc3axxxx.h>.\r
-#ifdef EVK1100_REVA\r
-# define USB_VBOF AVR32_USBB_USB_VBOF_0_0\r
-#else\r
-# define USB_VBOF AVR32_USBB_USB_VBOF_0_1\r
-#endif\r
-\r
-//! Active level of the USB_VBOF output pin.\r
-#ifdef EVK1100_REVA\r
-# define USB_VBOF_ACTIVE_LEVEL HIGH\r
-#else\r
-# define USB_VBOF_ACTIVE_LEVEL LOW\r
-#endif\r
-\r
-//! USB overcurrent detection pin.\r
-#ifdef EVK1100_REVA\r
-# define USB_OVERCURRENT_DETECT_PIN AVR32_PIN_PB18\r
-#else\r
-# define USB_OVERCURRENT_DETECT_PIN AVR32_PIN_PX33\r
-#endif\r
-\r
-//! @}\r
-\r
-\r
-//! GPIO connection of the MAC PHY PWR_DOWN/INT signal.\r
-#ifdef EVK1100_REVA\r
-# define MACB_INTERRUPT_PIN AVR32_PIN_PX12\r
-#else\r
-# define MACB_INTERRUPT_PIN AVR32_PIN_PA24\r
-#endif\r
-\r
-\r
-//! Number of LEDs.\r
-#define LED_COUNT 8\r
-\r
-/*! \name GPIO Connections of LEDs\r
- */\r
-//! @{\r
-#ifdef EVK1100_REVA\r
-# define LED0_GPIO AVR32_PIN_PX13\r
-# define LED1_GPIO AVR32_PIN_PX14\r
-# define LED2_GPIO AVR32_PIN_PX15\r
-# define LED3_GPIO AVR32_PIN_PX16\r
-# define LED4_GPIO AVR32_PIN_PB19\r
-# define LED5_GPIO AVR32_PIN_PB20\r
-# define LED6_GPIO AVR32_PIN_PB21\r
-# define LED7_GPIO AVR32_PIN_PB22\r
-#else\r
-# define LED0_GPIO AVR32_PIN_PB27\r
-# define LED1_GPIO AVR32_PIN_PB28\r
-# define LED2_GPIO AVR32_PIN_PB29\r
-# define LED3_GPIO AVR32_PIN_PB30\r
-# define LED4_GPIO AVR32_PIN_PB19\r
-# define LED5_GPIO AVR32_PIN_PB20\r
-# define LED6_GPIO AVR32_PIN_PB21\r
-# define LED7_GPIO AVR32_PIN_PB22\r
-#endif\r
-//! @}\r
-\r
-/*! \name PWM Channels of LEDs\r
- */\r
-//! @{\r
-#define LED0_PWM (-1)\r
-#define LED1_PWM (-1)\r
-#define LED2_PWM (-1)\r
-#define LED3_PWM (-1)\r
-#define LED4_PWM 0\r
-#define LED5_PWM 1\r
-#define LED6_PWM 2\r
-#define LED7_PWM 3\r
-//! @}\r
-\r
-/*! \name PWM Functions of LEDs\r
- */\r
-//! @{\r
-#define LED0_PWM_FUNCTION (-1)\r
-#define LED1_PWM_FUNCTION (-1)\r
-#define LED2_PWM_FUNCTION (-1)\r
-#define LED3_PWM_FUNCTION (-1)\r
-#define LED4_PWM_FUNCTION AVR32_PWM_PWM_0_FUNCTION\r
-#define LED5_PWM_FUNCTION AVR32_PWM_PWM_1_FUNCTION\r
-#define LED6_PWM_FUNCTION AVR32_PWM_PWM_2_FUNCTION\r
-#define LED7_PWM_FUNCTION AVR32_PWM_PWM_3_FUNCTION\r
-//! @}\r
-\r
-/*! \name Color Identifiers of LEDs to Use with LED Functions\r
- */\r
-//! @{\r
-#ifdef EVK1100_REVA\r
-# define LED_MONO0_GREEN LED4\r
-# define LED_MONO1_GREEN LED5\r
-# define LED_MONO2_GREEN LED6\r
-# define LED_MONO3_GREEN LED7\r
-# define LED_BI0_GREEN LED1\r
-# define LED_BI0_RED LED0\r
-# define LED_BI1_GREEN LED3\r
-# define LED_BI1_RED LED2\r
-#else\r
-# define LED_MONO0_GREEN LED0\r
-# define LED_MONO1_GREEN LED1\r
-# define LED_MONO2_GREEN LED2\r
-# define LED_MONO3_GREEN LED3\r
-# define LED_BI0_GREEN LED5\r
-# define LED_BI0_RED LED4\r
-# define LED_BI1_GREEN LED7\r
-# define LED_BI1_RED LED6\r
-#endif\r
-//! @}\r
-\r
-\r
-/*! \name GPIO Connections of Push Buttons\r
- */\r
-//! @{\r
-#ifdef EVK1100_REVA\r
-# define GPIO_PUSH_BUTTON_0 AVR32_PIN_PB28\r
-# define GPIO_PUSH_BUTTON_1 AVR32_PIN_PB29\r
-# define GPIO_PUSH_BUTTON_2 AVR32_PIN_PB27\r
-#else\r
-# define GPIO_PUSH_BUTTON_0 AVR32_PIN_PX16\r
-# define GPIO_PUSH_BUTTON_1 AVR32_PIN_PX19\r
-# define GPIO_PUSH_BUTTON_2 AVR32_PIN_PX22\r
-#endif\r
-//! @}\r
-\r
-\r
-/*! \name GPIO Connections of the Joystick\r
- */\r
-//! @{\r
-#define GPIO_JOYSTICK_PUSH AVR32_PIN_PA20\r
-#define GPIO_JOYSTICK_LEFT AVR32_PIN_PA25\r
-#define GPIO_JOYSTICK_RIGHT AVR32_PIN_PA28\r
-#define GPIO_JOYSTICK_UP AVR32_PIN_PA26\r
-#define GPIO_JOYSTICK_DOWN AVR32_PIN_PA27\r
-//! @}\r
-\r
-\r
-/*! \name ADC Connection of the Potentiometer\r
- */\r
-//! @{\r
-#define ADC_POTENTIOMETER_CHANNEL 1\r
-#define ADC_POTENTIOMETER_PIN AVR32_ADC_AD_1_PIN\r
-#define ADC_POTENTIOMETER_FUNCTION AVR32_ADC_AD_1_FUNCTION\r
-//! @}\r
-\r
-\r
-/*! \name ADC Connection of the Temperature Sensor\r
- */\r
-//! @{\r
-#define ADC_TEMPERATURE_CHANNEL 0\r
-#define ADC_TEMPERATURE_PIN AVR32_ADC_AD_0_PIN\r
-#define ADC_TEMPERATURE_FUNCTION AVR32_ADC_AD_0_FUNCTION\r
-//! @}\r
-\r
-\r
-/*! \name ADC Connection of the Light Sensor\r
- */\r
-//! @{\r
-#define ADC_LIGHT_CHANNEL 2\r
-#define ADC_LIGHT_PIN AVR32_ADC_AD_2_PIN\r
-#define ADC_LIGHT_FUNCTION AVR32_ADC_AD_2_FUNCTION\r
-//! @}\r
-\r
-\r
-/*! \name SPI Connections of the DIP204 LCD\r
- */\r
-//! @{\r
-#define DIP204_SPI (&AVR32_SPI1)\r
-#define DIP204_SPI_CS 2\r
-#define DIP204_SPI_SCK_PIN AVR32_SPI1_SCK_0_PIN\r
-#define DIP204_SPI_SCK_FUNCTION AVR32_SPI1_SCK_0_FUNCTION\r
-#define DIP204_SPI_MISO_PIN AVR32_SPI1_MISO_0_PIN\r
-#define DIP204_SPI_MISO_FUNCTION AVR32_SPI1_MISO_0_FUNCTION\r
-#define DIP204_SPI_MOSI_PIN AVR32_SPI1_MOSI_0_PIN\r
-#define DIP204_SPI_MOSI_FUNCTION AVR32_SPI1_MOSI_0_FUNCTION\r
-#define DIP204_SPI_NPCS_PIN AVR32_SPI1_NPCS_2_PIN\r
-#define DIP204_SPI_NPCS_FUNCTION AVR32_SPI1_NPCS_2_FUNCTION\r
-//! @}\r
-\r
-/*! \name GPIO and PWM Connections of the DIP204 LCD Backlight\r
- */\r
-//! @{\r
-#define DIP204_BACKLIGHT_PIN AVR32_PIN_PB18\r
-#define DIP204_PWM_CHANNEL 6\r
-#define DIP204_PWM_PIN AVR32_PWM_PWM_6_PIN\r
-#define DIP204_PWM_FUNCTION AVR32_PWM_PWM_6_FUNCTION\r
-//! @}\r
-\r
-\r
-/*! \name SPI Connections of the AT45DBX Data Flash Memory\r
- */\r
-//! @{\r
-#define AT45DBX_SPI (&AVR32_SPI1)\r
-#define AT45DBX_SPI_SCK_PIN AVR32_SPI1_SCK_0_PIN\r
-#define AT45DBX_SPI_SCK_FUNCTION AVR32_SPI1_SCK_0_FUNCTION\r
-#define AT45DBX_SPI_MISO_PIN AVR32_SPI1_MISO_0_PIN\r
-#define AT45DBX_SPI_MISO_FUNCTION AVR32_SPI1_MISO_0_FUNCTION\r
-#define AT45DBX_SPI_MOSI_PIN AVR32_SPI1_MOSI_0_PIN\r
-#define AT45DBX_SPI_MOSI_FUNCTION AVR32_SPI1_MOSI_0_FUNCTION\r
-#define AT45DBX_SPI_NPCS0_PIN AVR32_SPI1_NPCS_0_PIN\r
-#define AT45DBX_SPI_NPCS0_FUNCTION AVR32_SPI1_NPCS_0_FUNCTION\r
-//! @}\r
-\r
-\r
-/*! \name GPIO and SPI Connections of the SD/MMC Connector\r
- */\r
-//! @{\r
-#define SD_MMC_CARD_DETECT_PIN AVR32_PIN_PA02\r
-#define SD_MMC_WRITE_PROTECT_PIN AVR32_PIN_PA07\r
-#define SD_MMC_SPI (&AVR32_SPI1)\r
-#define SD_MMC_SPI_CS 1\r
-#define SD_MMC_SPI_SCK_PIN AVR32_SPI1_SCK_0_PIN\r
-#define SD_MMC_SPI_SCK_FUNCTION AVR32_SPI1_SCK_0_FUNCTION\r
-#define SD_MMC_SPI_MISO_PIN AVR32_SPI1_MISO_0_PIN\r
-#define SD_MMC_SPI_MISO_FUNCTION AVR32_SPI1_MISO_0_FUNCTION\r
-#define SD_MMC_SPI_MOSI_PIN AVR32_SPI1_MOSI_0_PIN\r
-#define SD_MMC_SPI_MOSI_FUNCTION AVR32_SPI1_MOSI_0_FUNCTION\r
-#define SD_MMC_SPI_NPCS_PIN AVR32_SPI1_NPCS_1_PIN\r
-#define SD_MMC_SPI_NPCS_FUNCTION AVR32_SPI1_NPCS_1_FUNCTION\r
-//! @}\r
-\r
-\r
-#endif // _EVK1100_H_\r
+++ /dev/null
-/* This header file is part of the ATMEL AVR32-SoftwareFramework-AT32UC3-1.5.0 Release */\r
-
-/*This file is prepared for Doxygen automatic documentation generation.*/\r
-/*! \file *********************************************************************\r
- *\r
- * \brief AT32UC3A EVK1100 board header file.\r
- *\r
- * This file contains definitions and services related to the features of the\r
- * EVK1100 board rev. A.\r
- *\r
- * To use this board, define BOARD=EVK1100 and EVK1100_REVA.\r
- *\r
- * - Compiler: IAR EWAVR32 and GNU GCC for AVR32\r
- * - Supported devices: All AVR32 AT32UC3A devices can be used.\r
- * - AppNote:\r
- *\r
- * \author Atmel Corporation: http://www.atmel.com \n\r
- * Support and FAQ: http://support.atmel.no/\r
- *\r
- ******************************************************************************/\r
-\r
-/* Copyright (c) 2009 Atmel Corporation. All rights reserved.\r
- *\r
- * Redistribution and use in source and binary forms, with or without\r
- * modification, are permitted provided that the following conditions are met:\r
- *\r
- * 1. Redistributions of source code must retain the above copyright notice, this\r
- * list of conditions and the following disclaimer.\r
- *\r
- * 2. Redistributions in binary form must reproduce the above copyright notice,\r
- * this list of conditions and the following disclaimer in the documentation\r
- * and/or other materials provided with the distribution.\r
- *\r
- * 3. The name of Atmel may not be used to endorse or promote products derived\r
- * from this software without specific prior written permission.\r
- *\r
- * 4. This software may only be redistributed and used in connection with an Atmel\r
- * AVR product.\r
- *\r
- * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED\r
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE\r
- * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR\r
- * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\r
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\r
- *\r
- */\r
-\r
-#ifndef _EVK1100_REVA_H_\r
-#define _EVK1100_REVA_H_\r
-\r
-#include "compiler.h"\r
-\r
-#ifdef __AVR32_ABI_COMPILER__ // Automatically defined when compiling for AVR32, not when assembling.\r
-# include "led.h"\r
-#endif // __AVR32_ABI_COMPILER__\r
-\r
-\r
-/*! \name Oscillator Definitions\r
- */\r
-//! @{\r
-\r
-// RCOsc has no custom calibration by default. Set the following definition to\r
-// the appropriate value if a custom RCOsc calibration has been applied to your\r
-// part.\r
-//#define FRCOSC AVR32_PM_RCOSC_FREQUENCY //!< RCOsc frequency: Hz.\r
-\r
-#define FOSC32 32768 //!< Osc32 frequency: Hz.\r
-#define OSC32_STARTUP AVR32_PM_OSCCTRL32_STARTUP_8192_RCOSC //!< Osc32 startup time: RCOsc periods.\r
-\r
-#define FOSC0 12000000 //!< Osc0 frequency: Hz.\r
-#define OSC0_STARTUP AVR32_PM_OSCCTRL0_STARTUP_2048_RCOSC //!< Osc0 startup time: RCOsc periods.\r
-\r
-// Osc1 crystal is not mounted by default. Set the following definitions to the\r
-// appropriate values if a custom Osc1 crystal is mounted on your board.\r
-//#define FOSC1 12000000 //!< Osc1 frequency: Hz.\r
-//#define OSC1_STARTUP AVR32_PM_OSCCTRL1_STARTUP_2048_RCOSC //!< Osc1 startup time: RCOsc periods.\r
-\r
-//! @}\r
-\r
-\r
-/*! \name SDRAM Definitions\r
- */\r
-//! @{\r
-\r
-//! Part header file of used SDRAM(s).\r
-#define SDRAM_PART_HDR "MT48LC16M16A2TG7E/mt48lc16m16a2tg7e.h"\r
-\r
-//! Data bus width to use the SDRAM(s) with (16 or 32 bits; always 16 bits on\r
-//! UC3).\r
-#define SDRAM_DBW 16\r
-\r
-//! @}\r
-\r
-\r
-/*! \name USB Definitions\r
- */\r
-//! @{\r
-\r
-//! Multiplexed pin used for USB_ID: AVR32_USBB_USB_ID_x_x.\r
-//! To be selected according to the AVR32_USBB_USB_ID_x_x_PIN and\r
-//! AVR32_USBB_USB_ID_x_x_FUNCTION definitions from <avr32/uc3axxxx.h>.\r
-#define USB_ID AVR32_USBB_USB_ID_0_0\r
-\r
-//! Multiplexed pin used for USB_VBOF: AVR32_USBB_USB_VBOF_x_x.\r
-//! To be selected according to the AVR32_USBB_USB_VBOF_x_x_PIN and\r
-//! AVR32_USBB_USB_VBOF_x_x_FUNCTION definitions from <avr32/uc3axxxx.h>.\r
-#define USB_VBOF AVR32_USBB_USB_VBOF_0_0\r
-\r
-//! Active level of the USB_VBOF output pin.\r
-#define USB_VBOF_ACTIVE_LEVEL HIGH\r
-\r
-//! USB overcurrent detection pin.\r
-#define USB_OVERCURRENT_DETECT_PIN AVR32_PIN_PB18\r
-\r
-//! @}\r
-\r
-\r
-//! GPIO connection of the MAC PHY PWR_DOWN/INT signal.\r
-#define MACB_INTERRUPT_PIN AVR32_PIN_PX12\r
-\r
-\r
-//! Number of LEDs.\r
-#define LED_COUNT 8\r
-\r
-/*! \name GPIO Connections of LEDs\r
- */\r
-//! @{\r
-#define LED0_GPIO AVR32_PIN_PX13\r
-#define LED1_GPIO AVR32_PIN_PX14\r
-#define LED2_GPIO AVR32_PIN_PX15\r
-#define LED3_GPIO AVR32_PIN_PX16\r
-#define LED4_GPIO AVR32_PIN_PB19\r
-#define LED5_GPIO AVR32_PIN_PB20\r
-#define LED6_GPIO AVR32_PIN_PB21\r
-#define LED7_GPIO AVR32_PIN_PB22\r
-//! @}\r
-\r
-/*! \name PWM Channels of LEDs\r
- */\r
-//! @{\r
-#define LED0_PWM (-1)\r
-#define LED1_PWM (-1)\r
-#define LED2_PWM (-1)\r
-#define LED3_PWM (-1)\r
-#define LED4_PWM 0\r
-#define LED5_PWM 1\r
-#define LED6_PWM 2\r
-#define LED7_PWM 3\r
-//! @}\r
-\r
-/*! \name PWM Functions of LEDs\r
- */\r
-//! @{\r
-#define LED0_PWM_FUNCTION (-1)\r
-#define LED1_PWM_FUNCTION (-1)\r
-#define LED2_PWM_FUNCTION (-1)\r
-#define LED3_PWM_FUNCTION (-1)\r
-#define LED4_PWM_FUNCTION AVR32_PWM_0_FUNCTION\r
-#define LED5_PWM_FUNCTION AVR32_PWM_1_FUNCTION\r
-#define LED6_PWM_FUNCTION AVR32_PWM_2_FUNCTION\r
-#define LED7_PWM_FUNCTION AVR32_PWM_3_FUNCTION\r
-//! @}\r
-\r
-/*! \name Color Identifiers of LEDs to Use with LED Functions\r
- */\r
-//! @{\r
-#define LED_MONO0_GREEN LED4\r
-#define LED_MONO1_GREEN LED5\r
-#define LED_MONO2_GREEN LED6\r
-#define LED_MONO3_GREEN LED7\r
-#define LED_BI0_GREEN LED1\r
-#define LED_BI0_RED LED0\r
-#define LED_BI1_GREEN LED3\r
-#define LED_BI1_RED LED2\r
-//! @}\r
-\r
-\r
-/*! \name GPIO Connections of Push Buttons\r
- */\r
-//! @{\r
-#define GPIO_PUSH_BUTTON_0 AVR32_PIN_PB28\r
-#define GPIO_PUSH_BUTTON_0_PRESSED 0\r
-#define GPIO_PUSH_BUTTON_1 AVR32_PIN_PB29\r
-#define GPIO_PUSH_BUTTON_1_PRESSED 0\r
-#define GPIO_PUSH_BUTTON_2 AVR32_PIN_PB27\r
-#define GPIO_PUSH_BUTTON_2_PRESSED 0\r
-//! @}\r
-\r
-\r
-/*! \name GPIO Connections of the Joystick\r
- */\r
-//! @{\r
-#define GPIO_JOYSTICK_PUSH AVR32_PIN_PA20\r
-#define GPIO_JOYSTICK_PUSH_PRESSED 0\r
-#define GPIO_JOYSTICK_LEFT AVR32_PIN_PA25\r
-#define GPIO_JOYSTICK_LEFT_PRESSED 0\r
-#define GPIO_JOYSTICK_RIGHT AVR32_PIN_PA28\r
-#define GPIO_JOYSTICK_RIGHT_PRESSED 0\r
-#define GPIO_JOYSTICK_UP AVR32_PIN_PA26\r
-#define GPIO_JOYSTICK_UP_PRESSED 0\r
-#define GPIO_JOYSTICK_DOWN AVR32_PIN_PA27\r
-#define GPIO_JOYSTICK_DOWN_PRESSED 0\r
-//! @}\r
-\r
-\r
-/*! \name ADC Connection of the Potentiometer\r
- */\r
-//! @{\r
-#define ADC_POTENTIOMETER_CHANNEL 1\r
-#define ADC_POTENTIOMETER_PIN AVR32_ADC_AD_1_PIN\r
-#define ADC_POTENTIOMETER_FUNCTION AVR32_ADC_AD_1_FUNCTION\r
-//! @}\r
-\r
-\r
-/*! \name ADC Connection of the Temperature Sensor\r
- */\r
-//! @{\r
-#define ADC_TEMPERATURE_CHANNEL 0\r
-#define ADC_TEMPERATURE_PIN AVR32_ADC_AD_0_PIN\r
-#define ADC_TEMPERATURE_FUNCTION AVR32_ADC_AD_0_FUNCTION\r
-//! @}\r
-\r
-\r
-/*! \name ADC Connection of the Light Sensor\r
- */\r
-//! @{\r
-#define ADC_LIGHT_CHANNEL 2\r
-#define ADC_LIGHT_PIN AVR32_ADC_AD_2_PIN\r
-#define ADC_LIGHT_FUNCTION AVR32_ADC_AD_2_FUNCTION\r
-//! @}\r
-\r
-\r
-/*! \name SPI Connections of the DIP204 LCD\r
- */\r
-//! @{\r
-#define DIP204_SPI (&AVR32_SPI1)\r
-#define DIP204_SPI_NPCS 2\r
-#define DIP204_SPI_SCK_PIN AVR32_SPI1_SCK_0_0_PIN\r
-#define DIP204_SPI_SCK_FUNCTION AVR32_SPI1_SCK_0_0_FUNCTION\r
-#define DIP204_SPI_MISO_PIN AVR32_SPI1_MISO_0_0_PIN\r
-#define DIP204_SPI_MISO_FUNCTION AVR32_SPI1_MISO_0_0_FUNCTION\r
-#define DIP204_SPI_MOSI_PIN AVR32_SPI1_MOSI_0_0_PIN\r
-#define DIP204_SPI_MOSI_FUNCTION AVR32_SPI1_MOSI_0_0_FUNCTION\r
-#define DIP204_SPI_NPCS_PIN AVR32_SPI1_NPCS_2_0_PIN\r
-#define DIP204_SPI_NPCS_FUNCTION AVR32_SPI1_NPCS_2_0_FUNCTION\r
-//! @}\r
-\r
-/*! \name GPIO and PWM Connections of the DIP204 LCD Backlight\r
- */\r
-//! @{\r
-#define DIP204_BACKLIGHT_PIN AVR32_PIN_PB18\r
-#define DIP204_PWM_CHANNEL 6\r
-#define DIP204_PWM_PIN AVR32_PWM_6_PIN\r
-#define DIP204_PWM_FUNCTION AVR32_PWM_6_FUNCTION\r
-//! @}\r
-\r
-\r
-/*! \name SPI Connections of the AT45DBX Data Flash Memory\r
- */\r
-//! @{\r
-#define AT45DBX_SPI (&AVR32_SPI1)\r
-#define AT45DBX_SPI_NPCS 0\r
-#define AT45DBX_SPI_SCK_PIN AVR32_SPI1_SCK_0_0_PIN\r
-#define AT45DBX_SPI_SCK_FUNCTION AVR32_SPI1_SCK_0_0_FUNCTION\r
-#define AT45DBX_SPI_MISO_PIN AVR32_SPI1_MISO_0_0_PIN\r
-#define AT45DBX_SPI_MISO_FUNCTION AVR32_SPI1_MISO_0_0_FUNCTION\r
-#define AT45DBX_SPI_MOSI_PIN AVR32_SPI1_MOSI_0_0_PIN\r
-#define AT45DBX_SPI_MOSI_FUNCTION AVR32_SPI1_MOSI_0_0_FUNCTION\r
-#define AT45DBX_SPI_NPCS0_PIN AVR32_SPI1_NPCS_0_0_PIN\r
-#define AT45DBX_SPI_NPCS0_FUNCTION AVR32_SPI1_NPCS_0_0_FUNCTION\r
-//! @}\r
-\r
-\r
-/*! \name GPIO and SPI Connections of the SD/MMC Connector\r
- */\r
-//! @{\r
-#define SD_MMC_CARD_DETECT_PIN AVR32_PIN_PA02\r
-#define SD_MMC_WRITE_PROTECT_PIN AVR32_PIN_PA07\r
-#define SD_MMC_SPI (&AVR32_SPI1)\r
-#define SD_MMC_SPI_NPCS 1\r
-#define SD_MMC_SPI_SCK_PIN AVR32_SPI1_SCK_0_0_PIN\r
-#define SD_MMC_SPI_SCK_FUNCTION AVR32_SPI1_SCK_0_0_FUNCTION\r
-#define SD_MMC_SPI_MISO_PIN AVR32_SPI1_MISO_0_0_PIN\r
-#define SD_MMC_SPI_MISO_FUNCTION AVR32_SPI1_MISO_0_0_FUNCTION\r
-#define SD_MMC_SPI_MOSI_PIN AVR32_SPI1_MOSI_0_0_PIN\r
-#define SD_MMC_SPI_MOSI_FUNCTION AVR32_SPI1_MOSI_0_0_FUNCTION\r
-#define SD_MMC_SPI_NPCS_PIN AVR32_SPI1_NPCS_1_0_PIN\r
-#define SD_MMC_SPI_NPCS_FUNCTION AVR32_SPI1_NPCS_1_0_FUNCTION\r
-//! @}\r
-\r
-\r
-/*! \name TWI Connections of the Spare TWI Connector\r
- */\r
-//! @{\r
-#define SPARE_TWI (&AVR32_TWI)\r
-#define SPARE_TWI_SCL_PIN AVR32_TWI_SCL_0_0_PIN\r
-#define SPARE_TWI_SCL_FUNCTION AVR32_TWI_SCL_0_0_FUNCTION\r
-#define SPARE_TWI_SDA_PIN AVR32_TWI_SDA_0_0_PIN\r
-#define SPARE_TWI_SDA_FUNCTION AVR32_TWI_SDA_0_0_FUNCTION\r
-//! @}\r
-\r
-\r
-/*! \name SPI Connections of the Spare SPI Connector\r
- */\r
-//! @{\r
-#define SPARE_SPI (&AVR32_SPI0)\r
-#define SPARE_SPI_NPCS 0\r
-#define SPARE_SPI_SCK_PIN AVR32_SPI0_SCK_0_0_PIN\r
-#define SPARE_SPI_SCK_FUNCTION AVR32_SPI0_SCK_0_0_FUNCTION\r
-#define SPARE_SPI_MISO_PIN AVR32_SPI0_MISO_0_0_PIN\r
-#define SPARE_SPI_MISO_FUNCTION AVR32_SPI0_MISO_0_0_FUNCTION\r
-#define SPARE_SPI_MOSI_PIN AVR32_SPI0_MOSI_0_0_PIN\r
-#define SPARE_SPI_MOSI_FUNCTION AVR32_SPI0_MOSI_0_0_FUNCTION\r
-#define SPARE_SPI_NPCS_PIN AVR32_SPI0_NPCS_0_0_PIN\r
-#define SPARE_SPI_NPCS_FUNCTION AVR32_SPI0_NPCS_0_0_FUNCTION\r
-//! @}\r
-\r
-\r
-#endif // _EVK1100_REVA_H_\r
+++ /dev/null
-/*This file is prepared for Doxygen automatic documentation generation.*/\r
-/*! \file *********************************************************************\r
- *\r
- * \brief AT32UC3A EVK1100 board LEDs support package.\r
- *\r
- * This file contains definitions and services related to the LED features of\r
- * the EVK1100 board.\r
- *\r
- * - Compiler: IAR EWAVR32 and GNU GCC for AVR32\r
- * - Supported devices: All AVR32 AT32UC3A devices can be used.\r
- * - AppNote:\r
- *\r
- * \author Atmel Corporation: http://www.atmel.com \n\r
- * Support and FAQ: http://support.atmel.no/\r
- *\r
- ******************************************************************************/\r
-\r
-/* Copyright (c) 2007, Atmel Corporation All rights reserved.\r
- *\r
- * Redistribution and use in source and binary forms, with or without\r
- * modification, are permitted provided that the following conditions are met:\r
- *\r
- * 1. Redistributions of source code must retain the above copyright notice,\r
- * this list of conditions and the following disclaimer.\r
- *\r
- * 2. Redistributions in binary form must reproduce the above copyright notice,\r
- * this list of conditions and the following disclaimer in the documentation\r
- * and/or other materials provided with the distribution.\r
- *\r
- * 3. The name of ATMEL may not be used to endorse or promote products derived\r
- * from this software without specific prior written permission.\r
- *\r
- * THIS SOFTWARE IS PROVIDED BY ATMEL ``AS IS'' AND ANY EXPRESS OR IMPLIED\r
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND\r
- * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT,\r
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\r
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
- */\r
-\r
-\r
-#include <avr32/io.h>\r
-#include "preprocessor.h"\r
-#include "compiler.h"\r
-#include "evk1100.h"\r
-#include "led.h"\r
-\r
-\r
-//! Structure describing LED hardware connections.\r
-typedef const struct\r
-{\r
- struct\r
- {\r
- U32 PORT; //!< LED GPIO port.\r
- U32 PIN_MASK; //!< Bit-mask of LED pin in GPIO port.\r
- } GPIO; //!< LED GPIO descriptor.\r
- struct\r
- {\r
- S32 CHANNEL; //!< LED PWM channel (< 0 if N/A).\r
- S32 FUNCTION; //!< LED pin PWM function (< 0 if N/A).\r
- } PWM; //!< LED PWM descriptor.\r
-} tLED_DESCRIPTOR;\r
-\r
-\r
-//! Hardware descriptors of all LEDs.\r
-static tLED_DESCRIPTOR LED_DESCRIPTOR[LED_COUNT] =\r
-{\r
-#define INSERT_LED_DESCRIPTOR(LED_NO, unused) \\r
- { \\r
- {LED##LED_NO##_GPIO / 32, 1 << (LED##LED_NO##_GPIO % 32)},\\r
- {LED##LED_NO##_PWM, LED##LED_NO##_PWM_FUNCTION } \\r
- },\r
- MREPEAT(LED_COUNT, INSERT_LED_DESCRIPTOR, ~)\r
-#undef INSERT_LED_DESCRIPTOR\r
-};\r
-\r
-\r
-//! Saved state of all LEDs.\r
-static volatile U32 LED_State = (1 << LED_COUNT) - 1;\r
-\r
-\r
-U32 LED_Read_Display(void)\r
-{\r
- return LED_State;\r
-}\r
-\r
-\r
-void LED_Display(U32 leds)\r
-{\r
- tLED_DESCRIPTOR *led_descriptor;\r
- volatile avr32_gpio_port_t *led_gpio_port;\r
-\r
- leds &= (1 << LED_COUNT) - 1;\r
- LED_State = leds;\r
- for (led_descriptor = &LED_DESCRIPTOR[0];\r
- led_descriptor < LED_DESCRIPTOR + LED_COUNT;\r
- led_descriptor++)\r
- {\r
- led_gpio_port = &AVR32_GPIO.port[led_descriptor->GPIO.PORT];\r
- if (leds & 1)\r
- {\r
- led_gpio_port->ovrc = led_descriptor->GPIO.PIN_MASK;\r
- }\r
- else\r
- {\r
- led_gpio_port->ovrs = led_descriptor->GPIO.PIN_MASK;\r
- }\r
- led_gpio_port->oders = led_descriptor->GPIO.PIN_MASK;\r
- led_gpio_port->gpers = led_descriptor->GPIO.PIN_MASK;\r
- leds >>= 1;\r
- }\r
-}\r
-\r
-\r
-U32 LED_Read_Display_Mask(U32 mask)\r
-{\r
- return Rd_bits(LED_State, mask);\r
-}\r
-\r
-\r
-void LED_Display_Mask(U32 mask, U32 leds)\r
-{\r
- tLED_DESCRIPTOR *led_descriptor = &LED_DESCRIPTOR[0] - 1;\r
- volatile avr32_gpio_port_t *led_gpio_port;\r
- U8 led_shift;\r
-\r
- mask &= (1 << LED_COUNT) - 1;\r
- Wr_bits(LED_State, mask, leds);\r
- while (mask)\r
- {\r
- led_shift = 1 + ctz(mask);\r
- led_descriptor += led_shift;\r
- led_gpio_port = &AVR32_GPIO.port[led_descriptor->GPIO.PORT];\r
- leds >>= led_shift - 1;\r
- if (leds & 1)\r
- {\r
- led_gpio_port->ovrc = led_descriptor->GPIO.PIN_MASK;\r
- }\r
- else\r
- {\r
- led_gpio_port->ovrs = led_descriptor->GPIO.PIN_MASK;\r
- }\r
- led_gpio_port->oders = led_descriptor->GPIO.PIN_MASK;\r
- led_gpio_port->gpers = led_descriptor->GPIO.PIN_MASK;\r
- leds >>= 1;\r
- mask >>= led_shift;\r
- }\r
-}\r
-\r
-\r
-Bool LED_Test(U32 leds)\r
-{\r
- return Tst_bits(LED_State, leds);\r
-}\r
-\r
-\r
-void LED_Off(U32 leds)\r
-{\r
- tLED_DESCRIPTOR *led_descriptor = &LED_DESCRIPTOR[0] - 1;\r
- volatile avr32_gpio_port_t *led_gpio_port;\r
- U8 led_shift;\r
-\r
- leds &= (1 << LED_COUNT) - 1;\r
- Clr_bits(LED_State, leds);\r
- while (leds)\r
- {\r
- led_shift = 1 + ctz(leds);\r
- led_descriptor += led_shift;\r
- led_gpio_port = &AVR32_GPIO.port[led_descriptor->GPIO.PORT];\r
- led_gpio_port->ovrs = led_descriptor->GPIO.PIN_MASK;\r
- led_gpio_port->oders = led_descriptor->GPIO.PIN_MASK;\r
- led_gpio_port->gpers = led_descriptor->GPIO.PIN_MASK;\r
- leds >>= led_shift;\r
- }\r
-}\r
-\r
-\r
-void LED_On(U32 leds)\r
-{\r
- tLED_DESCRIPTOR *led_descriptor = &LED_DESCRIPTOR[0] - 1;\r
- volatile avr32_gpio_port_t *led_gpio_port;\r
- U8 led_shift;\r
-\r
- leds &= (1 << LED_COUNT) - 1;\r
- Set_bits(LED_State, leds);\r
- while (leds)\r
- {\r
- led_shift = 1 + ctz(leds);\r
- led_descriptor += led_shift;\r
- led_gpio_port = &AVR32_GPIO.port[led_descriptor->GPIO.PORT];\r
- led_gpio_port->ovrc = led_descriptor->GPIO.PIN_MASK;\r
- led_gpio_port->oders = led_descriptor->GPIO.PIN_MASK;\r
- led_gpio_port->gpers = led_descriptor->GPIO.PIN_MASK;\r
- leds >>= led_shift;\r
- }\r
-}\r
-\r
-\r
-void LED_Toggle(U32 leds)\r
-{\r
- tLED_DESCRIPTOR *led_descriptor = &LED_DESCRIPTOR[0] - 1;\r
- volatile avr32_gpio_port_t *led_gpio_port;\r
- U8 led_shift;\r
-\r
- leds &= (1 << LED_COUNT) - 1;\r
- Tgl_bits(LED_State, leds);\r
- while (leds)\r
- {\r
- led_shift = 1 + ctz(leds);\r
- led_descriptor += led_shift;\r
- led_gpio_port = &AVR32_GPIO.port[led_descriptor->GPIO.PORT];\r
- led_gpio_port->ovrt = led_descriptor->GPIO.PIN_MASK;\r
- led_gpio_port->oders = led_descriptor->GPIO.PIN_MASK;\r
- led_gpio_port->gpers = led_descriptor->GPIO.PIN_MASK;\r
- leds >>= led_shift;\r
- }\r
-}\r
-\r
-\r
-U32 LED_Read_Display_Field(U32 field)\r
-{\r
- return Rd_bitfield(LED_State, field);\r
-}\r
-\r
-\r
-void LED_Display_Field(U32 field, U32 leds)\r
-{\r
- LED_Display_Mask(field, leds << ctz(field));\r
-}\r
-\r
-\r
-U8 LED_Get_Intensity(U32 led)\r
-{\r
- tLED_DESCRIPTOR *led_descriptor;\r
-\r
- // Check that the argument value is valid.\r
- led = ctz(led);\r
- led_descriptor = &LED_DESCRIPTOR[led];\r
- if (led >= LED_COUNT || led_descriptor->PWM.CHANNEL < 0) return 0;\r
-\r
- // Return the duty cycle value if the LED PWM channel is enabled, else 0.\r
- return (AVR32_PWM.sr & (1 << led_descriptor->PWM.CHANNEL)) ?\r
- AVR32_PWM.channel[led_descriptor->PWM.CHANNEL].cdty : 0;\r
-}\r
-\r
-\r
-void LED_Set_Intensity(U32 leds, U8 intensity)\r
-{\r
- tLED_DESCRIPTOR *led_descriptor = &LED_DESCRIPTOR[0] - 1;\r
- volatile avr32_pwm_channel_t *led_pwm_channel;\r
- volatile avr32_gpio_port_t *led_gpio_port;\r
- U8 led_shift;\r
-\r
- // For each specified LED...\r
- for (leds &= (1 << LED_COUNT) - 1; leds; leds >>= led_shift)\r
- {\r
- // Select the next specified LED and check that it has a PWM channel.\r
- led_shift = 1 + ctz(leds);\r
- led_descriptor += led_shift;\r
- if (led_descriptor->PWM.CHANNEL < 0) continue;\r
-\r
- // Initialize or update the LED PWM channel.\r
- led_pwm_channel = &AVR32_PWM.channel[led_descriptor->PWM.CHANNEL];\r
- if (!(AVR32_PWM.sr & (1 << led_descriptor->PWM.CHANNEL)))\r
- {\r
- led_pwm_channel->cmr = (AVR32_PWM_CPRE_MCK << AVR32_PWM_CPRE_OFFSET) &\r
- ~(AVR32_PWM_CALG_MASK |\r
- AVR32_PWM_CPOL_MASK |\r
- AVR32_PWM_CPD_MASK);\r
- led_pwm_channel->cprd = 0x000000FF;\r
- led_pwm_channel->cdty = intensity;\r
- AVR32_PWM.ena = 1 << led_descriptor->PWM.CHANNEL;\r
- }\r
- else\r
- {\r
- AVR32_PWM.isr;\r
- while (!(AVR32_PWM.isr & (1 << led_descriptor->PWM.CHANNEL)));\r
- led_pwm_channel->cupd = intensity;\r
- }\r
-\r
- // Switch the LED pin to its PWM function.\r
- led_gpio_port = &AVR32_GPIO.port[led_descriptor->GPIO.PORT];\r
- if (led_descriptor->PWM.FUNCTION & 0x1)\r
- {\r
- led_gpio_port->pmr0s = led_descriptor->GPIO.PIN_MASK;\r
- }\r
- else\r
- {\r
- led_gpio_port->pmr0c = led_descriptor->GPIO.PIN_MASK;\r
- }\r
- if (led_descriptor->PWM.FUNCTION & 0x2)\r
- {\r
- led_gpio_port->pmr1s = led_descriptor->GPIO.PIN_MASK;\r
- }\r
- else\r
- {\r
- led_gpio_port->pmr1c = led_descriptor->GPIO.PIN_MASK;\r
- }\r
- led_gpio_port->gperc = led_descriptor->GPIO.PIN_MASK;\r
- }\r
-}\r
+++ /dev/null
-/*This file is prepared for Doxygen automatic documentation generation.*/\r
-/*! \file *********************************************************************\r
- *\r
- * \brief AT32UC3A EVK1100 board LEDs support package.\r
- *\r
- * This file contains definitions and services related to the LED features of\r
- * the EVK1100 board.\r
- *\r
- * - Compiler: IAR EWAVR32 and GNU GCC for AVR32\r
- * - Supported devices: All AVR32 AT32UC3A devices can be used.\r
- * - AppNote:\r
- *\r
- * \author Atmel Corporation: http://www.atmel.com \n\r
- * Support and FAQ: http://support.atmel.no/\r
- *\r
- ******************************************************************************/\r
-\r
-/* Copyright (c) 2007, Atmel Corporation All rights reserved.\r
- *\r
- * Redistribution and use in source and binary forms, with or without\r
- * modification, are permitted provided that the following conditions are met:\r
- *\r
- * 1. Redistributions of source code must retain the above copyright notice,\r
- * this list of conditions and the following disclaimer.\r
- *\r
- * 2. Redistributions in binary form must reproduce the above copyright notice,\r
- * this list of conditions and the following disclaimer in the documentation\r
- * and/or other materials provided with the distribution.\r
- *\r
- * 3. The name of ATMEL may not be used to endorse or promote products derived\r
- * from this software without specific prior written permission.\r
- *\r
- * THIS SOFTWARE IS PROVIDED BY ATMEL ``AS IS'' AND ANY EXPRESS OR IMPLIED\r
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND\r
- * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT,\r
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\r
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
- */\r
-\r
-\r
-#ifndef _LED_H_\r
-#define _LED_H_\r
-\r
-#include "compiler.h"\r
-\r
-\r
-/*! \name Identifiers of LEDs to Use with LED Functions\r
- */\r
-//! @{\r
-#define LED0 0x01\r
-#define LED1 0x02\r
-#define LED2 0x04\r
-#define LED3 0x08\r
-#define LED4 0x10\r
-#define LED5 0x20\r
-#define LED6 0x40\r
-#define LED7 0x80\r
-//! @}\r
-\r
-\r
-/*! \brief Gets the last state of all LEDs set through the LED API.\r
- *\r
- * \return State of all LEDs (1 bit per LED).\r
- *\r
- * \note The GPIO pin configuration of all LEDs is left unchanged.\r
- */\r
-extern U32 LED_Read_Display(void);\r
-\r
-/*! \brief Sets the state of all LEDs.\r
- *\r
- * \param leds New state of all LEDs (1 bit per LED).\r
- *\r
- * \note The pins of all LEDs are set to GPIO output mode.\r
- */\r
-extern void LED_Display(U32 leds);\r
-\r
-/*! \brief Gets the last state of the specified LEDs set through the LED API.\r
- *\r
- * \param mask LEDs of which to get the state (1 bit per LED).\r
- *\r
- * \return State of the specified LEDs (1 bit per LED).\r
- *\r
- * \note The GPIO pin configuration of all LEDs is left unchanged.\r
- */\r
-extern U32 LED_Read_Display_Mask(U32 mask);\r
-\r
-/*! \brief Sets the state of the specified LEDs.\r
- *\r
- * \param mask LEDs of which to set the state (1 bit per LED).\r
- *\r
- * \param leds New state of the specified LEDs (1 bit per LED).\r
- *\r
- * \note The pins of the specified LEDs are set to GPIO output mode.\r
- */\r
-extern void LED_Display_Mask(U32 mask, U32 leds);\r
-\r
-/*! \brief Tests the last state of the specified LEDs set through the LED API.\r
- *\r
- * \param leds LEDs of which to test the state (1 bit per LED).\r
- *\r
- * \return \c TRUE if at least one of the specified LEDs has a state on, else\r
- * \c FALSE.\r
- *\r
- * \note The GPIO pin configuration of all LEDs is left unchanged.\r
- */\r
-extern Bool LED_Test(U32 leds);\r
-\r
-/*! \brief Turns off the specified LEDs.\r
- *\r
- * \param leds LEDs to turn off (1 bit per LED).\r
- *\r
- * \note The pins of the specified LEDs are set to GPIO output mode.\r
- */\r
-extern void LED_Off(U32 leds);\r
-\r
-/*! \brief Turns on the specified LEDs.\r
- *\r
- * \param leds LEDs to turn on (1 bit per LED).\r
- *\r
- * \note The pins of the specified LEDs are set to GPIO output mode.\r
- */\r
-extern void LED_On(U32 leds);\r
-\r
-/*! \brief Toggles the specified LEDs.\r
- *\r
- * \param leds LEDs to toggle (1 bit per LED).\r
- *\r
- * \note The pins of the specified LEDs are set to GPIO output mode.\r
- */\r
-extern void LED_Toggle(U32 leds);\r
-\r
-/*! \brief Gets as a bit-field the last state of the specified LEDs set through\r
- * the LED API.\r
- *\r
- * \param field LEDs of which to get the state (1 bit per LED).\r
- *\r
- * \return State of the specified LEDs (1 bit per LED, beginning with the first\r
- * specified LED).\r
- *\r
- * \note The GPIO pin configuration of all LEDs is left unchanged.\r
- */\r
-extern U32 LED_Read_Display_Field(U32 field);\r
-\r
-/*! \brief Sets as a bit-field the state of the specified LEDs.\r
- *\r
- * \param field LEDs of which to set the state (1 bit per LED).\r
- * \param leds New state of the specified LEDs (1 bit per LED, beginning with\r
- * the first specified LED).\r
- *\r
- * \note The pins of the specified LEDs are set to GPIO output mode.\r
- */\r
-extern void LED_Display_Field(U32 field, U32 leds);\r
-\r
-/*! \brief Gets the intensity of the specified LED.\r
- *\r
- * \param led LED of which to get the intensity (1 bit per LED; only the least\r
- * significant set bit is used).\r
- *\r
- * \return Intensity of the specified LED (0x00 to 0xFF).\r
- *\r
- * \warning The PWM channel of the specified LED is supposed to be used only by\r
- * this module.\r
- *\r
- * \note The GPIO pin configuration of all LEDs is left unchanged.\r
- */\r
-extern U8 LED_Get_Intensity(U32 led);\r
-\r
-/*! \brief Sets the intensity of the specified LEDs.\r
- *\r
- * \param leds LEDs of which to set the intensity (1 bit per LED).\r
- * \param intensity New intensity of the specified LEDs (0x00 to 0xFF).\r
- *\r
- * \warning The PWM channels of the specified LEDs are supposed to be used only\r
- * by this module.\r
- *\r
- * \note The pins of the specified LEDs are set to PWM output mode.\r
- */\r
-extern void LED_Set_Intensity(U32 leds, U8 intensity);\r
-\r
-\r
-#endif // _LED_H_\r
+++ /dev/null
-/*This file is prepared for Doxygen automatic documentation generation.*/\r
-/*! \file *********************************************************************\r
- *\r
- * \brief AT32UC3B EVK1101 board header file.\r
- *\r
- * This file contains definitions and services related to the features of the\r
- * EVK1101 board.\r
- *\r
- * - Compiler: IAR EWAVR32 and GNU GCC for AVR32\r
- * - Supported devices: All AVR32 AT32UC3B devices can be used.\r
- * - AppNote:\r
- *\r
- * \author Atmel Corporation: http://www.atmel.com \n\r
- * Support and FAQ: http://support.atmel.no/\r
- *\r
- ******************************************************************************/\r
-\r
-/* Copyright (c) 2007, Atmel Corporation All rights reserved.\r
- *\r
- * Redistribution and use in source and binary forms, with or without\r
- * modification, are permitted provided that the following conditions are met:\r
- *\r
- * 1. Redistributions of source code must retain the above copyright notice,\r
- * this list of conditions and the following disclaimer.\r
- *\r
- * 2. Redistributions in binary form must reproduce the above copyright notice,\r
- * this list of conditions and the following disclaimer in the documentation\r
- * and/or other materials provided with the distribution.\r
- *\r
- * 3. The name of ATMEL may not be used to endorse or promote products derived\r
- * from this software without specific prior written permission.\r
- *\r
- * THIS SOFTWARE IS PROVIDED BY ATMEL ``AS IS'' AND ANY EXPRESS OR IMPLIED\r
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND\r
- * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT,\r
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\r
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
- */\r
-\r
-\r
-#ifndef _EVK1101_H_\r
-#define _EVK1101_H_\r
-\r
-#include "compiler.h"\r
-\r
-#ifdef __AVR32_ABI_COMPILER__ // Automatically defined when compiling for AVR32, not when assembling.\r
-# include "led.h"\r
-#endif // __AVR32_ABI_COMPILER__\r
-\r
-\r
-/*! \name Oscillator Definitions\r
- */\r
-//! @{\r
-\r
-// RCOsc has no custom calibration by default. Set the following definition to\r
-// the appropriate value if a custom RCOsc calibration has been applied to your\r
-// part.\r
-//#define FRCOSC 115200 //!< RCOsc frequency: Hz.\r
-\r
-#define FOSC32 32768 //!< Osc32 frequency: Hz.\r
-#define OSC32_STARTUP 3 //!< Osc32 startup time: RCOsc periods.\r
-\r
-#define FOSC0 12000000 //!< Osc0 frequency: Hz.\r
-#define OSC0_STARTUP 3 //!< Osc0 startup time: RCOsc periods.\r
-\r
-// Osc1 crystal is not mounted by default. Set the following definitions to the\r
-// appropriate values if a custom Osc1 crystal is mounted on your board.\r
-//#define FOSC1 12000000 //!< Osc1 frequency: Hz.\r
-//#define OSC1_STARTUP 3 //!< Osc1 startup time: RCOsc periods.\r
-\r
-//! @}\r
-\r
-\r
-/*! \name USB Definitions\r
- */\r
-//! @{\r
-\r
-//! Multiplexed pin used for USB_ID: AVR32_USBB_USB_ID_x_x.\r
-//! To be selected according to the AVR32_USBB_USB_ID_x_x_PIN and\r
-//! AVR32_USBB_USB_ID_x_x_FUNCTION definitions from <avr32/uc3bxxxx.h>.\r
-#define USB_ID AVR32_USBB_USB_ID_0_0\r
-\r
-//! Multiplexed pin used for USB_VBOF: AVR32_USBB_USB_VBOF_x_x.\r
-//! To be selected according to the AVR32_USBB_USB_VBOF_x_x_PIN and\r
-//! AVR32_USBB_USB_VBOF_x_x_FUNCTION definitions from <avr32/uc3bxxxx.h>.\r
-#define USB_VBOF AVR32_USBB_USB_VBOF_0_0\r
-\r
-//! Active level of the USB_VBOF output pin.\r
-#define USB_VBOF_ACTIVE_LEVEL LOW\r
-\r
-//! USB overcurrent detection pin.\r
-#define USB_OVERCURRENT_DETECT_PIN AVR32_PIN_PA20\r
-\r
-//! @}\r
-\r
-\r
-//! Number of LEDs.\r
-#define LED_COUNT 4\r
-\r
-/*! \name GPIO Connections of LEDs\r
- */\r
-//! @{\r
-#define LED0_GPIO AVR32_PIN_PA07\r
-#define LED1_GPIO AVR32_PIN_PA08\r
-#define LED2_GPIO AVR32_PIN_PA21\r
-#define LED3_GPIO AVR32_PIN_PA22\r
-//! @}\r
-\r
-/*! \name PWM Channels of LEDs\r
- */\r
-//! @{\r
-#define LED0_PWM 0\r
-#define LED1_PWM 1\r
-#define LED2_PWM 2\r
-#define LED3_PWM 6\r
-//! @}\r
-\r
-/*! \name PWM Functions of LEDs\r
- */\r
-//! @{\r
-#define LED0_PWM_FUNCTION AVR32_PWM_PWM_0_0_FUNCTION\r
-#define LED1_PWM_FUNCTION AVR32_PWM_PWM_1_0_FUNCTION\r
-#define LED2_PWM_FUNCTION AVR32_PWM_PWM_2_0_FUNCTION\r
-#define LED3_PWM_FUNCTION AVR32_PWM_PWM_6_0_FUNCTION\r
-//! @}\r
-\r
-/*! \name Color Identifiers of LEDs to Use with LED Functions\r
- */\r
-//! @{\r
-#define LED_MONO0_GREEN LED0\r
-#define LED_MONO1_GREEN LED1\r
-#define LED_MONO2_GREEN LED2\r
-#define LED_MONO3_GREEN LED3\r
-//! @}\r
-\r
-\r
-/*! \name GPIO Connections of Push Buttons\r
- */\r
-//! @{\r
-#define GPIO_PUSH_BUTTON_0 AVR32_PIN_PB02\r
-#define GPIO_PUSH_BUTTON_1 AVR32_PIN_PB03\r
-//! @}\r
-\r
-\r
-/*! \name GPIO Connections of the Joystick\r
- */\r
-//! @{\r
-#define GPIO_JOYSTICK_PUSH AVR32_PIN_PA13\r
-#define GPIO_JOYSTICK_LEFT AVR32_PIN_PB06\r
-#define GPIO_JOYSTICK_RIGHT AVR32_PIN_PB09\r
-#define GPIO_JOYSTICK_UP AVR32_PIN_PB07\r
-#define GPIO_JOYSTICK_DOWN AVR32_PIN_PB08\r
-//! @}\r
-\r
-\r
-/*! \name ADC Connection of the Temperature Sensor\r
- */\r
-//! @{\r
-#define ADC_TEMPERATURE_CHANNEL 7\r
-#define ADC_TEMPERATURE_PIN AVR32_ADC_AD_7_PIN\r
-#define ADC_TEMPERATURE_FUNCTION AVR32_ADC_AD_7_FUNCTION\r
-//! @}\r
-\r
-\r
-/*! \name ADC Connection of the Light Sensor\r
- */\r
-//! @{\r
-#define ADC_LIGHT_CHANNEL 6\r
-#define ADC_LIGHT_PIN AVR32_ADC_AD_6_PIN\r
-#define ADC_LIGHT_FUNCTION AVR32_ADC_AD_6_FUNCTION\r
-//! @}\r
-\r
-\r
-/*! \name ADC Connections of the Accelerometer\r
- */\r
-//! @{\r
-#define ADC_ACC_X_CHANNEL 1\r
-#define ADC_ACC_X_PIN AVR32_ADC_AD_1_PIN\r
-#define ADC_ACC_X_FUNCTION AVR32_ADC_AD_1_FUNCTION\r
-#define ADC_ACC_Y_CHANNEL 2\r
-#define ADC_ACC_Y_PIN AVR32_ADC_AD_2_PIN\r
-#define ADC_ACC_Y_FUNCTION AVR32_ADC_AD_2_FUNCTION\r
-#define ADC_ACC_Z_CHANNEL 3\r
-#define ADC_ACC_Z_PIN AVR32_ADC_AD_3_PIN\r
-#define ADC_ACC_Z_FUNCTION AVR32_ADC_AD_3_FUNCTION\r
-//! @}\r
-\r
-\r
-/*! \name PWM Connections of Audio\r
- */\r
-//! @{\r
-#define AUDIO_LOW_PWM_CHANNEL 5\r
-#define AUDIO_LOW_PWM_PIN AVR32_PWM_PWM_5_0_PIN\r
-#define AUDIO_LOW_PWM_FUNCTION AVR32_PWM_PWM_5_0_FUNCTION\r
-#define AUDIO_HIGH_PWM_CHANNEL 6\r
-#define AUDIO_HIGH_PWM_PIN AVR32_PWM_PWM_6_1_PIN\r
-#define AUDIO_HIGH_PWM_FUNCTION AVR32_PWM_PWM_6_1_FUNCTION\r
-//! @}\r
-\r
-\r
-/*! \name SPI Connections of the AT45DBX Data Flash Memory\r
- */\r
-//! @{\r
-#define AT45DBX_SPI (&AVR32_SPI)\r
-#define AT45DBX_SPI_SCK_PIN AVR32_SPI_SCK_0_0_PIN\r
-#define AT45DBX_SPI_SCK_FUNCTION AVR32_SPI_SCK_0_0_FUNCTION\r
-#define AT45DBX_SPI_MISO_PIN AVR32_SPI_MISO_0_0_PIN\r
-#define AT45DBX_SPI_MISO_FUNCTION AVR32_SPI_MISO_0_0_FUNCTION\r
-#define AT45DBX_SPI_MOSI_PIN AVR32_SPI_MOSI_0_0_PIN\r
-#define AT45DBX_SPI_MOSI_FUNCTION AVR32_SPI_MOSI_0_0_FUNCTION\r
-#define AT45DBX_SPI_NPCS0_PIN AVR32_SPI_NPCS_0_0_PIN\r
-#define AT45DBX_SPI_NPCS0_FUNCTION AVR32_SPI_NPCS_0_0_FUNCTION\r
-//! @}\r
-\r
-\r
-/*! \name GPIO and SPI Connections of the SD/MMC Connector\r
- */\r
-//! @{\r
-#define SD_MMC_CARD_DETECT_PIN AVR32_PIN_PB00\r
-#define SD_MMC_WRITE_PROTECT_PIN AVR32_PIN_PB01\r
-#define SD_MMC_SPI (&AVR32_SPI)\r
-#define SD_MMC_SPI_CS 1\r
-#define SD_MMC_SPI_SCK_PIN AVR32_SPI_SCK_0_0_PIN\r
-#define SD_MMC_SPI_SCK_FUNCTION AVR32_SPI_SCK_0_0_FUNCTION\r
-#define SD_MMC_SPI_MISO_PIN AVR32_SPI_MISO_0_0_PIN\r
-#define SD_MMC_SPI_MISO_FUNCTION AVR32_SPI_MISO_0_0_FUNCTION\r
-#define SD_MMC_SPI_MOSI_PIN AVR32_SPI_MOSI_0_0_PIN\r
-#define SD_MMC_SPI_MOSI_FUNCTION AVR32_SPI_MOSI_0_0_FUNCTION\r
-#define SD_MMC_SPI_NPCS_PIN AVR32_SPI_NPCS_1_0_PIN\r
-#define SD_MMC_SPI_NPCS_FUNCTION AVR32_SPI_NPCS_1_0_FUNCTION\r
-//! @}\r
-\r
-\r
-#endif // _EVK1101_H_\r
+++ /dev/null
-/*This file is prepared for Doxygen automatic documentation generation.*/\r
-/*! \file *********************************************************************\r
- *\r
- * \brief AT32UC3B EVK1101 board LEDs support package.\r
- *\r
- * This file contains definitions and services related to the LED features of\r
- * the EVK1101 board.\r
- *\r
- * - Compiler: IAR EWAVR32 and GNU GCC for AVR32\r
- * - Supported devices: All AVR32 AT32UC3B devices can be used.\r
- * - AppNote:\r
- *\r
- * \author Atmel Corporation: http://www.atmel.com \n\r
- * Support and FAQ: http://support.atmel.no/\r
- *\r
- ******************************************************************************/\r
-\r
-/* Copyright (c) 2007, Atmel Corporation All rights reserved.\r
- *\r
- * Redistribution and use in source and binary forms, with or without\r
- * modification, are permitted provided that the following conditions are met:\r
- *\r
- * 1. Redistributions of source code must retain the above copyright notice,\r
- * this list of conditions and the following disclaimer.\r
- *\r
- * 2. Redistributions in binary form must reproduce the above copyright notice,\r
- * this list of conditions and the following disclaimer in the documentation\r
- * and/or other materials provided with the distribution.\r
- *\r
- * 3. The name of ATMEL may not be used to endorse or promote products derived\r
- * from this software without specific prior written permission.\r
- *\r
- * THIS SOFTWARE IS PROVIDED BY ATMEL ``AS IS'' AND ANY EXPRESS OR IMPLIED\r
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND\r
- * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT,\r
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\r
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
- */\r
-\r
-\r
-#include <avr32/io.h>\r
-#include "preprocessor.h"\r
-#include "compiler.h"\r
-#include "evk1101.h"\r
-#include "led.h"\r
-\r
-\r
-//! Structure describing LED hardware connections.\r
-typedef const struct\r
-{\r
- struct\r
- {\r
- U32 PORT; //!< LED GPIO port.\r
- U32 PIN_MASK; //!< Bit-mask of LED pin in GPIO port.\r
- } GPIO; //!< LED GPIO descriptor.\r
- struct\r
- {\r
- S32 CHANNEL; //!< LED PWM channel (< 0 if N/A).\r
- S32 FUNCTION; //!< LED pin PWM function (< 0 if N/A).\r
- } PWM; //!< LED PWM descriptor.\r
-} tLED_DESCRIPTOR;\r
-\r
-\r
-//! Hardware descriptors of all LEDs.\r
-static tLED_DESCRIPTOR LED_DESCRIPTOR[LED_COUNT] =\r
-{\r
-#define INSERT_LED_DESCRIPTOR(LED_NO, unused) \\r
- { \\r
- {LED##LED_NO##_GPIO / 32, 1 << (LED##LED_NO##_GPIO % 32)},\\r
- {LED##LED_NO##_PWM, LED##LED_NO##_PWM_FUNCTION } \\r
- },\r
- MREPEAT(LED_COUNT, INSERT_LED_DESCRIPTOR, ~)\r
-#undef INSERT_LED_DESCRIPTOR\r
-};\r
-\r
-\r
-//! Saved state of all LEDs.\r
-static volatile U32 LED_State = (1 << LED_COUNT) - 1;\r
-\r
-\r
-U32 LED_Read_Display(void)\r
-{\r
- return LED_State;\r
-}\r
-\r
-\r
-void LED_Display(U32 leds)\r
-{\r
- tLED_DESCRIPTOR *led_descriptor;\r
- volatile avr32_gpio_port_t *led_gpio_port;\r
-\r
- leds &= (1 << LED_COUNT) - 1;\r
- LED_State = leds;\r
- for (led_descriptor = &LED_DESCRIPTOR[0];\r
- led_descriptor < LED_DESCRIPTOR + LED_COUNT;\r
- led_descriptor++)\r
- {\r
- led_gpio_port = &AVR32_GPIO.port[led_descriptor->GPIO.PORT];\r
- if (leds & 1)\r
- {\r
- led_gpio_port->ovrc = led_descriptor->GPIO.PIN_MASK;\r
- }\r
- else\r
- {\r
- led_gpio_port->ovrs = led_descriptor->GPIO.PIN_MASK;\r
- }\r
- led_gpio_port->oders = led_descriptor->GPIO.PIN_MASK;\r
- led_gpio_port->gpers = led_descriptor->GPIO.PIN_MASK;\r
- leds >>= 1;\r
- }\r
-}\r
-\r
-\r
-U32 LED_Read_Display_Mask(U32 mask)\r
-{\r
- return Rd_bits(LED_State, mask);\r
-}\r
-\r
-\r
-void LED_Display_Mask(U32 mask, U32 leds)\r
-{\r
- tLED_DESCRIPTOR *led_descriptor = &LED_DESCRIPTOR[0] - 1;\r
- volatile avr32_gpio_port_t *led_gpio_port;\r
- U8 led_shift;\r
-\r
- mask &= (1 << LED_COUNT) - 1;\r
- Wr_bits(LED_State, mask, leds);\r
- while (mask)\r
- {\r
- led_shift = 1 + ctz(mask);\r
- led_descriptor += led_shift;\r
- led_gpio_port = &AVR32_GPIO.port[led_descriptor->GPIO.PORT];\r
- leds >>= led_shift - 1;\r
- if (leds & 1)\r
- {\r
- led_gpio_port->ovrc = led_descriptor->GPIO.PIN_MASK;\r
- }\r
- else\r
- {\r
- led_gpio_port->ovrs = led_descriptor->GPIO.PIN_MASK;\r
- }\r
- led_gpio_port->oders = led_descriptor->GPIO.PIN_MASK;\r
- led_gpio_port->gpers = led_descriptor->GPIO.PIN_MASK;\r
- leds >>= 1;\r
- mask >>= led_shift;\r
- }\r
-}\r
-\r
-\r
-Bool LED_Test(U32 leds)\r
-{\r
- return Tst_bits(LED_State, leds);\r
-}\r
-\r
-\r
-void LED_Off(U32 leds)\r
-{\r
- tLED_DESCRIPTOR *led_descriptor = &LED_DESCRIPTOR[0] - 1;\r
- volatile avr32_gpio_port_t *led_gpio_port;\r
- U8 led_shift;\r
-\r
- leds &= (1 << LED_COUNT) - 1;\r
- Clr_bits(LED_State, leds);\r
- while (leds)\r
- {\r
- led_shift = 1 + ctz(leds);\r
- led_descriptor += led_shift;\r
- led_gpio_port = &AVR32_GPIO.port[led_descriptor->GPIO.PORT];\r
- led_gpio_port->ovrs = led_descriptor->GPIO.PIN_MASK;\r
- led_gpio_port->oders = led_descriptor->GPIO.PIN_MASK;\r
- led_gpio_port->gpers = led_descriptor->GPIO.PIN_MASK;\r
- leds >>= led_shift;\r
- }\r
-}\r
-\r
-\r
-void LED_On(U32 leds)\r
-{\r
- tLED_DESCRIPTOR *led_descriptor = &LED_DESCRIPTOR[0] - 1;\r
- volatile avr32_gpio_port_t *led_gpio_port;\r
- U8 led_shift;\r
-\r
- leds &= (1 << LED_COUNT) - 1;\r
- Set_bits(LED_State, leds);\r
- while (leds)\r
- {\r
- led_shift = 1 + ctz(leds);\r
- led_descriptor += led_shift;\r
- led_gpio_port = &AVR32_GPIO.port[led_descriptor->GPIO.PORT];\r
- led_gpio_port->ovrc = led_descriptor->GPIO.PIN_MASK;\r
- led_gpio_port->oders = led_descriptor->GPIO.PIN_MASK;\r
- led_gpio_port->gpers = led_descriptor->GPIO.PIN_MASK;\r
- leds >>= led_shift;\r
- }\r
-}\r
-\r
-\r
-void LED_Toggle(U32 leds)\r
-{\r
- tLED_DESCRIPTOR *led_descriptor = &LED_DESCRIPTOR[0] - 1;\r
- volatile avr32_gpio_port_t *led_gpio_port;\r
- U8 led_shift;\r
-\r
- leds &= (1 << LED_COUNT) - 1;\r
- Tgl_bits(LED_State, leds);\r
- while (leds)\r
- {\r
- led_shift = 1 + ctz(leds);\r
- led_descriptor += led_shift;\r
- led_gpio_port = &AVR32_GPIO.port[led_descriptor->GPIO.PORT];\r
- led_gpio_port->ovrt = led_descriptor->GPIO.PIN_MASK;\r
- led_gpio_port->oders = led_descriptor->GPIO.PIN_MASK;\r
- led_gpio_port->gpers = led_descriptor->GPIO.PIN_MASK;\r
- leds >>= led_shift;\r
- }\r
-}\r
-\r
-\r
-U32 LED_Read_Display_Field(U32 field)\r
-{\r
- return Rd_bitfield(LED_State, field);\r
-}\r
-\r
-\r
-void LED_Display_Field(U32 field, U32 leds)\r
-{\r
- LED_Display_Mask(field, leds << ctz(field));\r
-}\r
-\r
-\r
-U8 LED_Get_Intensity(U32 led)\r
-{\r
- tLED_DESCRIPTOR *led_descriptor;\r
-\r
- // Check that the argument value is valid.\r
- led = ctz(led);\r
- led_descriptor = &LED_DESCRIPTOR[led];\r
- if (led >= LED_COUNT || led_descriptor->PWM.CHANNEL < 0) return 0;\r
-\r
- // Return the duty cycle value if the LED PWM channel is enabled, else 0.\r
- return (AVR32_PWM.sr & (1 << led_descriptor->PWM.CHANNEL)) ?\r
- AVR32_PWM.channel[led_descriptor->PWM.CHANNEL].cdty : 0;\r
-}\r
-\r
-\r
-void LED_Set_Intensity(U32 leds, U8 intensity)\r
-{\r
- tLED_DESCRIPTOR *led_descriptor = &LED_DESCRIPTOR[0] - 1;\r
- volatile avr32_pwm_channel_t *led_pwm_channel;\r
- volatile avr32_gpio_port_t *led_gpio_port;\r
- U8 led_shift;\r
-\r
- // For each specified LED...\r
- for (leds &= (1 << LED_COUNT) - 1; leds; leds >>= led_shift)\r
- {\r
- // Select the next specified LED and check that it has a PWM channel.\r
- led_shift = 1 + ctz(leds);\r
- led_descriptor += led_shift;\r
- if (led_descriptor->PWM.CHANNEL < 0) continue;\r
-\r
- // Initialize or update the LED PWM channel.\r
- led_pwm_channel = &AVR32_PWM.channel[led_descriptor->PWM.CHANNEL];\r
- if (!(AVR32_PWM.sr & (1 << led_descriptor->PWM.CHANNEL)))\r
- {\r
- led_pwm_channel->cmr = (AVR32_PWM_CPRE_MCK << AVR32_PWM_CPRE_OFFSET) &\r
- ~(AVR32_PWM_CALG_MASK |\r
- AVR32_PWM_CPOL_MASK |\r
- AVR32_PWM_CPD_MASK);\r
- led_pwm_channel->cprd = 0x000000FF;\r
- led_pwm_channel->cdty = intensity;\r
- AVR32_PWM.ena = 1 << led_descriptor->PWM.CHANNEL;\r
- }\r
- else\r
- {\r
- AVR32_PWM.isr;\r
- while (!(AVR32_PWM.isr & (1 << led_descriptor->PWM.CHANNEL)));\r
- led_pwm_channel->cupd = intensity;\r
- }\r
-\r
- // Switch the LED pin to its PWM function.\r
- led_gpio_port = &AVR32_GPIO.port[led_descriptor->GPIO.PORT];\r
- if (led_descriptor->PWM.FUNCTION & 0x1)\r
- {\r
- led_gpio_port->pmr0s = led_descriptor->GPIO.PIN_MASK;\r
- }\r
- else\r
- {\r
- led_gpio_port->pmr0c = led_descriptor->GPIO.PIN_MASK;\r
- }\r
- if (led_descriptor->PWM.FUNCTION & 0x2)\r
- {\r
- led_gpio_port->pmr1s = led_descriptor->GPIO.PIN_MASK;\r
- }\r
- else\r
- {\r
- led_gpio_port->pmr1c = led_descriptor->GPIO.PIN_MASK;\r
- }\r
- led_gpio_port->gperc = led_descriptor->GPIO.PIN_MASK;\r
- }\r
-}\r
+++ /dev/null
-/*This file is prepared for Doxygen automatic documentation generation.*/\r
-/*! \file *********************************************************************\r
- *\r
- * \brief AT32UC3B EVK1101 board LEDs support package.\r
- *\r
- * This file contains definitions and services related to the LED features of\r
- * the EVK1101 board.\r
- *\r
- * - Compiler: IAR EWAVR32 and GNU GCC for AVR32\r
- * - Supported devices: All AVR32 AT32UC3B devices can be used.\r
- * - AppNote:\r
- *\r
- * \author Atmel Corporation: http://www.atmel.com \n\r
- * Support and FAQ: http://support.atmel.no/\r
- *\r
- ******************************************************************************/\r
-\r
-/* Copyright (c) 2007, Atmel Corporation All rights reserved.\r
- *\r
- * Redistribution and use in source and binary forms, with or without\r
- * modification, are permitted provided that the following conditions are met:\r
- *\r
- * 1. Redistributions of source code must retain the above copyright notice,\r
- * this list of conditions and the following disclaimer.\r
- *\r
- * 2. Redistributions in binary form must reproduce the above copyright notice,\r
- * this list of conditions and the following disclaimer in the documentation\r
- * and/or other materials provided with the distribution.\r
- *\r
- * 3. The name of ATMEL may not be used to endorse or promote products derived\r
- * from this software without specific prior written permission.\r
- *\r
- * THIS SOFTWARE IS PROVIDED BY ATMEL ``AS IS'' AND ANY EXPRESS OR IMPLIED\r
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND\r
- * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT,\r
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\r
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
- */\r
-\r
-\r
-#ifndef _LED_H_\r
-#define _LED_H_\r
-\r
-#include "compiler.h"\r
-\r
-\r
-/*! \name Identifiers of LEDs to Use with LED Functions\r
- */\r
-//! @{\r
-#define LED0 0x01\r
-#define LED1 0x02\r
-#define LED2 0x04\r
-#define LED3 0x08\r
-//! @}\r
-\r
-\r
-/*! \brief Gets the last state of all LEDs set through the LED API.\r
- *\r
- * \return State of all LEDs (1 bit per LED).\r
- *\r
- * \note The GPIO pin configuration of all LEDs is left unchanged.\r
- */\r
-extern U32 LED_Read_Display(void);\r
-\r
-/*! \brief Sets the state of all LEDs.\r
- *\r
- * \param leds New state of all LEDs (1 bit per LED).\r
- *\r
- * \note The pins of all LEDs are set to GPIO output mode.\r
- */\r
-extern void LED_Display(U32 leds);\r
-\r
-/*! \brief Gets the last state of the specified LEDs set through the LED API.\r
- *\r
- * \param mask LEDs of which to get the state (1 bit per LED).\r
- *\r
- * \return State of the specified LEDs (1 bit per LED).\r
- *\r
- * \note The GPIO pin configuration of all LEDs is left unchanged.\r
- */\r
-extern U32 LED_Read_Display_Mask(U32 mask);\r
-\r
-/*! \brief Sets the state of the specified LEDs.\r
- *\r
- * \param mask LEDs of which to set the state (1 bit per LED).\r
- *\r
- * \param leds New state of the specified LEDs (1 bit per LED).\r
- *\r
- * \note The pins of the specified LEDs are set to GPIO output mode.\r
- */\r
-extern void LED_Display_Mask(U32 mask, U32 leds);\r
-\r
-/*! \brief Tests the last state of the specified LEDs set through the LED API.\r
- *\r
- * \param leds LEDs of which to test the state (1 bit per LED).\r
- *\r
- * \return \c TRUE if at least one of the specified LEDs has a state on, else\r
- * \c FALSE.\r
- *\r
- * \note The GPIO pin configuration of all LEDs is left unchanged.\r
- */\r
-extern Bool LED_Test(U32 leds);\r
-\r
-/*! \brief Turns off the specified LEDs.\r
- *\r
- * \param leds LEDs to turn off (1 bit per LED).\r
- *\r
- * \note The pins of the specified LEDs are set to GPIO output mode.\r
- */\r
-extern void LED_Off(U32 leds);\r
-\r
-/*! \brief Turns on the specified LEDs.\r
- *\r
- * \param leds LEDs to turn on (1 bit per LED).\r
- *\r
- * \note The pins of the specified LEDs are set to GPIO output mode.\r
- */\r
-extern void LED_On(U32 leds);\r
-\r
-/*! \brief Toggles the specified LEDs.\r
- *\r
- * \param leds LEDs to toggle (1 bit per LED).\r
- *\r
- * \note The pins of the specified LEDs are set to GPIO output mode.\r
- */\r
-extern void LED_Toggle(U32 leds);\r
-\r
-/*! \brief Gets as a bit-field the last state of the specified LEDs set through\r
- * the LED API.\r
- *\r
- * \param field LEDs of which to get the state (1 bit per LED).\r
- *\r
- * \return State of the specified LEDs (1 bit per LED, beginning with the first\r
- * specified LED).\r
- *\r
- * \note The GPIO pin configuration of all LEDs is left unchanged.\r
- */\r
-extern U32 LED_Read_Display_Field(U32 field);\r
-\r
-/*! \brief Sets as a bit-field the state of the specified LEDs.\r
- *\r
- * \param field LEDs of which to set the state (1 bit per LED).\r
- * \param leds New state of the specified LEDs (1 bit per LED, beginning with\r
- * the first specified LED).\r
- *\r
- * \note The pins of the specified LEDs are set to GPIO output mode.\r
- */\r
-extern void LED_Display_Field(U32 field, U32 leds);\r
-\r
-/*! \brief Gets the intensity of the specified LED.\r
- *\r
- * \param led LED of which to get the intensity (1 bit per LED; only the least\r
- * significant set bit is used).\r
- *\r
- * \return Intensity of the specified LED (0x00 to 0xFF).\r
- *\r
- * \warning The PWM channel of the specified LED is supposed to be used only by\r
- * this module.\r
- *\r
- * \note The GPIO pin configuration of all LEDs is left unchanged.\r
- */\r
-extern U8 LED_Get_Intensity(U32 led);\r
-\r
-/*! \brief Sets the intensity of the specified LEDs.\r
- *\r
- * \param leds LEDs of which to set the intensity (1 bit per LED).\r
- * \param intensity New intensity of the specified LEDs (0x00 to 0xFF).\r
- *\r
- * \warning The PWM channels of the specified LEDs are supposed to be used only\r
- * by this module.\r
- *\r
- * \note The pins of the specified LEDs are set to PWM output mode.\r
- */\r
-extern void LED_Set_Intensity(U32 leds, U8 intensity);\r
-\r
-\r
-#endif // _LED_H_\r
+++ /dev/null
-/*This file is prepared for Doxygen automatic documentation generation.*/\r
-/*! \file *********************************************************************\r
- *\r
- * \brief Standard board header file.\r
- *\r
- * This file includes the appropriate board header file according to the\r
- * defined board.\r
- *\r
- * - Compiler: IAR EWAVR32 and GNU GCC for AVR32\r
- * - Supported devices: All AVR32 devices can be used.\r
- * - AppNote:\r
- *\r
- * \author Atmel Corporation: http://www.atmel.com \n\r
- * Support and FAQ: http://support.atmel.no/\r
- *\r
- ******************************************************************************/\r
-\r
-/* Copyright (c) 2007, Atmel Corporation All rights reserved.\r
- *\r
- * Redistribution and use in source and binary forms, with or without\r
- * modification, are permitted provided that the following conditions are met:\r
- *\r
- * 1. Redistributions of source code must retain the above copyright notice,\r
- * this list of conditions and the following disclaimer.\r
- *\r
- * 2. Redistributions in binary form must reproduce the above copyright notice,\r
- * this list of conditions and the following disclaimer in the documentation\r
- * and/or other materials provided with the distribution.\r
- *\r
- * 3. The name of ATMEL may not be used to endorse or promote products derived\r
- * from this software without specific prior written permission.\r
- *\r
- * THIS SOFTWARE IS PROVIDED BY ATMEL ``AS IS'' AND ANY EXPRESS OR IMPLIED\r
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND\r
- * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT,\r
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\r
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\r
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\r
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\r
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
- */\r
-\r
-\r
-#ifndef _BOARD_H_\r
-#define _BOARD_H_\r
-\r
-#include <avr32/io.h>\r
-\r
-/*! \name Base Boards\r
- */\r
-//! @{\r
-#define EVK1100 1 //!< AT32UC3A EVK1100 board.\r
-#define EVK1101 2 //!< AT32UC3B EVK1101 board.\r
-//! @}\r
-\r
-/*! \name Extension Boards\r
- */\r
-//! @{\r
-#define EXT1102 1 //!< AT32UC3B EXT1102 board.\r
-//! @}\r
-\r
-#if BOARD == EVK1100\r
-# include "EVK1100/evk1100.h"\r
-#elif BOARD == EVK1101\r
-# include "EVK1101/evk1101.h"\r
-#else\r
-# error No known AVR32 board defined\r
-#endif\r
-\r
-#if EXT_BOARD == EXT1102\r
-# include "EXT1102/ext1102.h"\r
-#endif\r
-\r
-\r
-#ifndef FRCOSC\r
-# define FRCOSC AVR32_PM_RCOSC_FREQUENCY //!< Default RCOsc frequency.\r
-#endif\r
-\r
-\r
-#endif // _BOARD_H_\r