- Main Page
- Related Pages
- Data Structures
- Files

- File List
- Globals

# uc3l_ek.h

Go to the documentation of this file.

    00001 /*This file is prepared for Doxygen automatic documentation generation.*/
    00020 /* Copyright (c) 2009 Atmel Corporation. All rights reserved.
    00021  *
    00022  * Redistribution and use in source and binary forms, with or without
    00023  * modification, are permitted provided that the following conditions are met:
    00024  *
    00025  * 1. Redistributions of source code must retain the above copyright notice, this
    00026  * list of conditions and the following disclaimer.
    00027  *
    00028  * 2. Redistributions in binary form must reproduce the above copyright notice,
    00029  * this list of conditions and the following disclaimer in the documentation
    00030  * and/or other materials provided with the distribution.
    00031  *
    00032  * 3. The name of Atmel may not be used to endorse or promote products derived
    00033  * from this software without specific prior written permission.
    00034  *
    00035  * 4. This software may only be redistributed and used in connection with an Atmel
    00036  * AVR product.
    00037  *
    00038  * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
    00039  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
    00040  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE
    00041  * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR
    00042  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
    00043  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
    00044  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    00045  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    00046  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
    00047  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
    00048  *
    00049  */
    00050
    00051 #ifndef _UC3L_EK_H_
    00052 #define _UC3L_EK_H_
    00053
    00054 #include "compiler.h"
    00055
    00056 #ifdef __AVR32_ABI_COMPILER__ // Automatically defined when compiling for AVR32, not when assembling.
    00057 #  include "led.h"
    00058 #endif  // __AVR32_ABI_COMPILER__
    00059
    00060
    00063
    00064
    00065 // RCOsc has no custom calibration by default. Set the following definition to
    00066 // the appropriate value if a custom RCOsc calibration has been applied to your
    00067 // part.
    00068 #define FRCOSC          AVR32_SCIF_RCOSC_FREQUENCY
    00069
    00070 #define FOSC32          32768
    00071 #define OSC32_STARTUP   AVR32_SCIF_OSCCTRL32_STARTUP_8192_RCOSC
    00072
    00073 // No Osc0 crystal the AT32UC3L-EK
    00074 #define FOSC0           ((int)"NONE")
    00075 //#define OSC0_STARTUP    AVR32_SCIF_OSCCTRL0_STARTUP_2048_RCOSC
    00076
    00078
    00079
    00081 #if defined( UC3L_EK_REV1 )
    00082 #define LED_COUNT   4
    00083 #else // UC3L_EK_REV2
    00084 #define LED_COUNT   5
    00085 #endif
    00086
    00089
    00090 #  define LED0_GPIO   AVR32_PIN_PA21
    00091 #  define LED1_GPIO   AVR32_PIN_PB10
    00092 #  define LED3_GPIO   AVR32_PIN_PB03
    00093 #if defined(UC3L_EK_REV1)
    00094 #  define LED2_GPIO   AVR32_PIN_PA15
    00095 #else // UC3L_EK_REV2
    00096 #  define LED2_GPIO   AVR32_PIN_PB02
    00097 #  define LED4_GPIO   AVR32_PIN_PB11
    00098 #endif
    00100
    00101
    00103
    00104 #define LED0_PWM      21
    00105 #define LED1_PWM      33
    00106 #define LED3_PWM      26
    00107 #if defined(UC3L_EK_REV1)
    00108 #define LED2_PWM      15
    00109 #else // UC3L_EK_REV2
    00110 #define LED2_PWM      25
    00111 #define LED4_PWM      34
    00112 #endif
    00114
    00115
    00117
    00118
    00119 #if defined(AVR32_UC3L064_H_INCLUDED) || defined(AVR32_UC3L064T_H_INCLUDED) \
    00120     || defined(AVR32_UC3L032_H_INCLUDED) || defined(AVR32_UC3L032T_H_INCLUDED) \
    00121     || defined(AVR32_UC3L016_H_INCLUDED) || defined(AVR32_UC3L016T_H_INCLUDED)
    00122 #define AVR32_PWMA_21_FUNCTION  4
    00123 #define AVR32_PWMA_33_FUNCTION  4
    00124 #define AVR32_PWMA_26_FUNCTION  4
    00125 #if defined(UC3L_EK_REV1)
    00126 #define AVR32_PWMA_15_FUNCTION  4
    00127 #else // UC3L_EK_REV2
    00128 #define AVR32_PWMA_25_FUNCTION  4
    00129 #define AVR32_PWMA_34_FUNCTION  4
    00130 #endif
    00131 // These defines are missing from or wrong in the toolchain header file uc3l064.h
    00132 // #9565
    00133 #endif
    00134
    00136 #if defined(UC3L_EK_REV1)
    00137 #define LED_PWMA_CHANNELS_MASK  0x204208000ULL
    00138 #else // UC3L_EK_REV2
    00139 #define LED_PWMA_CHANNELS_MASK  0x606200000ULL
    00140 #endif
    00141
    00142
    00143 #define LED0_PWM_FUNCTION   AVR32_PWMA_21_FUNCTION
    00144 #define LED1_PWM_FUNCTION   AVR32_PWMA_33_FUNCTION
    00145 #define LED3_PWM_FUNCTION   AVR32_PWMA_26_FUNCTION
    00146 #if defined(UC3L_EK_REV1)
    00147 #define LED2_PWM_FUNCTION   AVR32_PWMA_15_FUNCTION
    00148 #else
    00149 #define LED2_PWM_FUNCTION   AVR32_PWMA_25_FUNCTION
    00150 #define LED4_PWM_FUNCTION   AVR32_PWMA_34_FUNCTION
    00151 #endif
    00152
    00154
    00157
    00158 #define GPIO_WAKE_BUTTON          AVR32_PIN_PA11
    00159 #define GPIO_WAKE_BUTTON_PRESSED  0
    00161
    00162
    00164
    00165 #define AT45DBX_SPI                 (&AVR32_SPI)
    00166 #define AT45DBX_SPI_NPCS            0
    00167 #define AT45DBX_SPI_SCK_PIN         AVR32_SPI_SCK_0_0_PIN
    00168 #define AT45DBX_SPI_SCK_FUNCTION    AVR32_SPI_SCK_0_0_FUNCTION
    00169 #define AT45DBX_SPI_MISO_PIN        AVR32_SPI_MISO_0_0_PIN
    00170 #define AT45DBX_SPI_MISO_FUNCTION   AVR32_SPI_MISO_0_0_FUNCTION
    00171 #define AT45DBX_SPI_MOSI_PIN        AVR32_SPI_MOSI_0_0_PIN
    00172 #define AT45DBX_SPI_MOSI_FUNCTION   AVR32_SPI_MOSI_0_0_FUNCTION
    00173 #define AT45DBX_SPI_NPCS0_PIN       AVR32_SPI_NPCS_0_0_PIN
    00174 #define AT45DBX_SPI_NPCS0_FUNCTION  AVR32_SPI_NPCS_0_0_FUNCTION
    00176
    00177
    00179
    00180 #define USART_RXD_PIN          AVR32_USART3_RXD_0_0_PIN
    00181 #define USART_RXD_FUNCTION     AVR32_USART3_RXD_0_0_FUNCTION
    00182 #define USART_TXD_PIN          AVR32_USART3_TXD_0_0_PIN
    00183 #define USART_TXD_FUNCTION     AVR32_USART3_TXD_0_0_FUNCTION
    00185
    00186 #if defined(AVR32_UC3L064_H_INCLUDED) || defined(AVR32_UC3L064T_H_INCLUDED) \
    00187     || defined(AVR32_UC3L032_H_INCLUDED) || defined(AVR32_UC3L032T_H_INCLUDED) \
    00188     || defined(AVR32_UC3L016_H_INCLUDED) || defined(AVR32_UC3L016T_H_INCLUDED)
    00189 #define AVR32_ADCIFB_AD_6_PIN           38
    00190 #define AVR32_ADCIFB_AD_6_FUNCTION      2
    00191 #define AVR32_ADCIFB_AD_7_PIN           39
    00192 #define AVR32_ADCIFB_AD_7_FUNCTION      2
    00193 #define AVR32_ADCIFB_AD_8_PIN           40
    00194 #define AVR32_ADCIFB_AD_8_FUNCTION      2
    00195
    00196 #define AVR32_CAT_CSA_5_FUNCTION        7
    00197 #define AVR32_CAT_CSB_5_FUNCTION        7
    00198 #if defined(UC3L_EK_REV1)
    00199 #define AVR32_CAT_CSA_8_FUNCTION        7
    00200 #define AVR32_CAT_CSB_8_FUNCTION        7
    00201 #else // UC3L_EK_REV2
    00202 #define AVR32_CAT_CSA_6_FUNCTION        7
    00203 #define AVR32_CAT_CSB_6_FUNCTION        7
    00204 #endif
    00205 #define AVR32_CAT_CSA_10_FUNCTION       7
    00206 #define AVR32_CAT_CSB_10_FUNCTION       7
    00207 #define AVR32_CAT_CSA_14_FUNCTION       7
    00208 #define AVR32_CAT_CSB_14_FUNCTION       7
    00209 #define AVR32_CAT_CSA_15_FUNCTION       7
    00210 #define AVR32_CAT_CSB_15_FUNCTION       7
    00211
    00212 #define AVR32_CAT_SMP_0_4_FUNCTION      5
    00213 // These defines are missing from or wrong in the toolchain header file uc3l064.h
    00214 // #9565
    00215 #endif
    00216
    00217
    00220
    00221 #define ADC_ACC_X_CHANNEL           6
    00222 #define ADC_ACC_X_PIN               AVR32_ADCIFB_AD_6_PIN
    00223 #define ADC_ACC_X_FUNCTION          AVR32_ADCIFB_AD_6_FUNCTION
    00224 #define ADC_ACC_Y_CHANNEL           7
    00225 #define ADC_ACC_Y_PIN               AVR32_ADCIFB_AD_7_PIN
    00226 #define ADC_ACC_Y_FUNCTION          AVR32_ADCIFB_AD_7_FUNCTION
    00227 #define ADC_ACC_Z_CHANNEL           8
    00228 #define ADC_ACC_Z_PIN               AVR32_ADCIFB_AD_8_PIN
    00229 #define ADC_ACC_Z_FUNCTION          AVR32_ADCIFB_AD_8_FUNCTION
    00231
    00232
    00234
    00235
    00237 #if defined(UC3L_EK_REV1)
    00238 #define QMATRIX_WHEEL_X8_UPRIGHT_PIN          AVR32_CAT_CSA_8_PIN       // X1 on schematics, DISCONNECTED ON AT32UC3L-EK REV1
    00239 #define QMATRIX_WHEEL_X8_UPRIGHT_FUNCTION     AVR32_CAT_CSA_8_FUNCTION
    00240 #define QMATRIX_WHEEL_X9_RIGHT_PIN            AVR32_CAT_CSB_8_PIN       // X2 on schematics
    00241 #define QMATRIX_WHEEL_X9_RIGHT_FUNCTION       AVR32_CAT_CSB_8_FUNCTION
    00242 #else // UC3L_EK_REV2
    00243 #define QMATRIX_WHEEL_X6_UPRIGHT_PIN          AVR32_CAT_CSA_6_PIN       // X1 on schematics
    00244 #define QMATRIX_WHEEL_X6_UPRIGHT_FUNCTION     AVR32_CAT_CSA_6_FUNCTION
    00245 #define QMATRIX_WHEEL_X7_RIGHT_PIN            AVR32_CAT_CSB_6_PIN       // X2 on schematics
    00246 #define QMATRIX_WHEEL_X7_RIGHT_FUNCTION       AVR32_CAT_CSB_6_FUNCTION
    00247 #endif
    00248 #define QMATRIX_WHEEL_X10_DOWNRIGHT_PIN       AVR32_CAT_CSA_10_PIN      // X3 on schematics
    00249 #define QMATRIX_WHEEL_X10_DOWNRIGHT_FUNCTION  AVR32_CAT_CSA_10_FUNCTION
    00250 #define QMATRIX_WHEEL_X11_DOWNLEFT_PIN        AVR32_CAT_CSB_10_PIN      // X4 on schematics
    00251 #define QMATRIX_WHEEL_X11_DOWNLEFT_FUNCTION   AVR32_CAT_CSB_10_FUNCTION
    00252 #define QMATRIX_WHEEL_X14_LEFT_PIN            AVR32_CAT_CSA_14_PIN      // X5 on schematics
    00253 #define QMATRIX_WHEEL_X14_LEFT_FUNCTION       AVR32_CAT_CSA_14_FUNCTION
    00254 #define QMATRIX_WHEEL_X15_UPLEFT_PIN          AVR32_CAT_CSB_14_PIN      // X6 on schematics
    00255 #define QMATRIX_WHEEL_X15_UPLEFT_FUNCTION     AVR32_CAT_CSB_14_FUNCTION
    00256
    00258 #define QMATRIX_WHEEL_Y2_PIN                  AVR32_CAT_CSA_5_PIN       // Y0 on schematics
    00259 #define QMATRIX_WHEEL_Y2_FUNCTION             AVR32_CAT_CSA_5_FUNCTION
    00260 #define QMATRIX_WHEEL_YK2_PIN                 AVR32_CAT_CSB_5_PIN       // YK0 on schematics
    00261 #define QMATRIX_WHEEL_YK2_FUNCTION            AVR32_CAT_CSB_5_FUNCTION
    00262
    00263 #if defined(UC3L_EK_REV1)
    00264 #define QMATRIX_SMP_PIN                       AVR32_CAT_SMP_0_1_PIN
    00265 #define QMATRIX_SMP_FUNCTION                  AVR32_CAT_SMP_0_1_FUNCTION
    00266 #else // UC3L_EK_REV2
    00267 #define QMATRIX_SMP_PIN                       AVR32_CAT_SMP_0_4_PIN
    00268 #define QMATRIX_SMP_FUNCTION                  AVR32_CAT_SMP_0_4_FUNCTION
    00269 #endif
    00270
    00272 #if defined(UC3L_EK_REV1)
    00273 #define QMATRIX_BTNS_DOWN_X8_PIN              AVR32_CAT_CSA_8_PIN       // X1 on schematics, DISCONNECTED ON AT32UC3L-EK REV1
    00274 #define QMATRIX_BTNS_DOWN_X8_FUNCTION         AVR32_CAT_CSA_8_FUNCTION
    00275 #define QMATRIX_BTNS_UP_X9_PIN                AVR32_CAT_CSB_8_PIN       // X2 on schematics
    00276 #define QMATRIX_BTNS_UP_X9_FUNCTION           AVR32_CAT_CSB_8_FUNCTION
    00277 #else // UC3L_EK_REV2
    00278 #define QMATRIX_BTNS_DOWN_X6_PIN              AVR32_CAT_CSA_6_PIN       // X1 on schematics
    00279 #define QMATRIX_BTNS_DOWN_X6_FUNCTION         AVR32_CAT_CSA_6_FUNCTION
    00280 #define QMATRIX_BTNS_UP_X7_PIN                AVR32_CAT_CSB_6_PIN       // X2 on schematics
    00281 #define QMATRIX_BTNS_UP_X7_FUNCTION           AVR32_CAT_CSB_6_FUNCTION
    00282 #endif
    00283 #define QMATRIX_BTNS_LEFT_X10_PIN             AVR32_CAT_CSA_10_PIN      // X3 on schematics
    00284 #define QMATRIX_BTNS_LEFT_X10_FUNCTION        AVR32_CAT_CSA_10_FUNCTION
    00285 #define QMATRIX_BTNS_PLAYPAUSE_X14_PIN        AVR32_CAT_CSA_14_PIN      // X5 on schematics
    00286 #define QMATRIX_BTNS_PLAYPAUSE_X14_FUNCTION   AVR32_CAT_CSA_14_FUNCTION
    00287 #define QMATRIX_BTNS_RIGHT_X15_PIN            AVR32_CAT_CSB_14_PIN      // X6 on schematics
    00288 #define QMATRIX_BTNS_RIGHT_X15_FUNCTION       AVR32_CAT_CSB_14_FUNCTION
    00289
    00291 #define QMATRIX_BTNS_Y7_PIN                   AVR32_CAT_CSA_15_PIN      // Y1 on schematics
    00292 #define QMATRIX_BTNS_Y7_FUNCTION              AVR32_CAT_CSA_15_FUNCTION
    00293 #define QMATRIX_BTNS_YK7_PIN                  AVR32_CAT_CSB_15_PIN      // YK1 on schematics
    00294 #define QMATRIX_BTNS_YK7_FUNCTION             AVR32_CAT_CSB_15_FUNCTION
    00295
    00297 #if defined( UC3L_EK_REV1 )
    00298 #define QMATRIX_NB_X                          6 // X8, X9, X10, X11, X14, X15
    00299 #else // UC3L_EK_REV2
    00300 #define QMATRIX_NB_X                          6 // X6, X7, X10, X11, X14, X15
    00301 #endif
    00302
    00304 #define QMATRIX_NB_Y                          2 // Y2, Y7
    00305
    00307
    00308 #if defined(UC3L_EK_REV1)
    00309
    00311
    00312 #define AT86RF231_SPI                 (&AVR32_SPI)
    00313 #define AT86RF231_SPI_NPCS            3
    00314 #define AT86RF231_SPI_SCK_PIN         AVR32_SPI_SCK_0_0_PIN
    00315 #define AT86RF231_SPI_SCK_FUNCTION    AVR32_SPI_SCK_0_0_FUNCTION
    00316 #define AT86RF231_SPI_MISO_PIN        AVR32_SPI_MISO_0_0_PIN
    00317 #define AT86RF231_SPI_MISO_FUNCTION   AVR32_SPI_MISO_0_0_FUNCTION
    00318 #define AT86RF231_SPI_MOSI_PIN        AVR32_SPI_MOSI_0_0_PIN
    00319 #define AT86RF231_SPI_MOSI_FUNCTION   AVR32_SPI_MOSI_0_0_FUNCTION
    00320 #define AT86RF231_SPI_NPCS3_PIN       AVR32_SPI_NPCS_3_0_PIN
    00321 #define AT86RF231_SPI_NPCS3_FUNCTION  AVR32_SPI_NPCS_3_0_FUNCTION
    00322 #define AT86RF231_NPRST               AVR32_PIN_PA01
    00323 #define AT86RF231_SLPTR               AVR32_PIN_PA00
    00324 #define AT86RF231_OB_IRQ              AVR32_PIN_PB11
    00325 #define AT86RF231_OB_OSCIN            AVR32_PIN_PA08
    00327 #else // UC3L_EK_REV2
    00328 #endif
    00329
    00330 #endif  // _UC3L_EK_H_