/* Copyright (c) 2011 Arduino. All right reserved. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #ifndef _VARIANT_SAM3S_EK_ #define _VARIANT_SAM3S_EK_ /*---------------------------------------------------------------------------- * Headers *----------------------------------------------------------------------------*/ #include "Arduino.h" #ifdef __cplusplus #include "UARTClass.h" #include "USARTClass.h" #endif /** * Libc porting layers */ #if defined ( __GNUC__ ) /* GCC CS3 */ # include /** RedHat Newlib minimal stub */ #endif /*---------------------------------------------------------------------------- * Definitions *----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/ #ifndef sam3s_ek #define sam3s_ek #endif /** Name of the board */ #define VARIANT_NAME "SAM3S-EK" #define VARIANT_REV_A /* #define VARIANT_REV_B */ /** Frequency of the board main oscillator */ #define VARIANT_MAINOSC 12000000 /** Master clock frequency */ #define VARIANT_MCK 64000000 /*---------------------------------------------------------------------------- * Pins *----------------------------------------------------------------------------*/ // Number of pins defined in PinDescription array #define PINS_COUNT (84u) // LEDs #define PIN_LED_BLUE (0u) #define PIN_LED_GREEN (1u) #define PIN_LED_RED (2u) #define PIN_LED PIN_LED_BLUE /* * SPI Interfaces */ #define SPI_INTERFACES_COUNT 1 #define SPI_INTERFACE SPI #define SPI_INTERFACE_ID ID_SPI #define PIN_SPI_SS (4u) #define PIN_SPI_MOSI (76u) #define PIN_SPI_MISO (75u) #define PIN_SPI_SCK (77u) static const uint8_t SS = 34 ; static const uint8_t MOSI = 32 ; static const uint8_t MISO = 31 ; static const uint8_t SCK = 33 ; /* * Wire Interfaces */ #define WIRE_INTERFACES_COUNT 2 #define PIN_WIRE_SDA (20u) #define PIN_WIRE_SCL (21u) #define WIRE_INTERFACE TWI1 #define WIRE_INTERFACE_ID ID_TWI1 #define WIRE_ISR_HANDLER TWI1_IrqHandler #define PIN_WIRE1_SDA (68u) #define PIN_WIRE1_SCL (69u) #define WIRE1_INTERFACE TWI0 #define WIRE1_INTERFACE_ID ID_TWI0 #define WIRE1_ISR_HANDLER TWI0_IrqHandler #if defined VARIANT_REV_A # define PIN_TSC_IRQ_WUP_ID (1UL << 3) #elif defined VARIANT_REV_B # define PIN_TSC_IRQ_WUP_ID (1UL << 15) #else #error "No board revision defined" #endif #define BOARD_LCD_PINS PIN_EBI_DATA_BUS, PIN_EBI_NRD, PIN_EBI_NWE, PIN_EBI_NCS1, PIN_EBI_LCD_RS #define BOARD_LCD_BASE 0x61000000 /** Define ILI9325 base address. */ #define BOARD_LCD_RS (1 << 1) /** Define ILI9325 register select signal. */ /* * UART/USART Interfaces */ #define PINS_UART (6u) #define PINS_USART0 (81u) #define PINS_USART1 (82u) /* * Analog pins */ static const uint8_t A0 = 54; static const uint8_t A1 = 55; static const uint8_t A2 = 56; static const uint8_t A3 = 57; static const uint8_t A4 = 58; static const uint8_t A5 = 59; static const uint8_t A6 = 60; static const uint8_t A7 = 61; static const uint8_t A8 = 62; static const uint8_t A9 = 63; static const uint8_t A10 = 64; static const uint8_t A11 = 65; static const uint8_t A12 = 66; static const uint8_t A13 = 67; static const uint8_t A14 = ; static const uint8_t A15 = ; #define PIN_DAC0 (u) /* * PWM */ #define PWM_INTERFACE PWM #define PWM_INTERFACE_ID ID_PWM #define PWM_FREQUENCY 1000 #define PWM_MAX_DUTY_CYCLE 255 #define PWM_MIN_DUTY_CYCLE 0 /* * TC */ #define TC_INTERFACE TC0 #define TC_INTERFACE_ID ID_TC0 #define TC_FREQUENCY 1000 #define TC_MAX_DUTY_CYCLE 255 #define TC_MIN_DUTY_CYCLE 0 /*---------------------------------------------------------------------------- * Arduino objects - C++ only *----------------------------------------------------------------------------*/ #ifdef __cplusplus extern UARTClass Serial ; extern UARTClass Serial2 ; extern USARTClass Serial3 ; #endif #endif /* _VARIANT_SAM3S_EK_ */