2011-10-25 16:19:43 +02:00
|
|
|
/*
|
|
|
|
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
|
|
|
|
*/
|
2011-09-13 17:01:32 +02:00
|
|
|
|
|
|
|
#ifndef _VARIANT_ARDUINO_DUE_
|
|
|
|
#define _VARIANT_ARDUINO_DUE_
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------
|
|
|
|
* Headers
|
|
|
|
*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
#include "Arduino.h"
|
2011-11-06 14:00:02 +01:00
|
|
|
#ifdef __cplusplus
|
2011-10-16 19:49:47 +02:00
|
|
|
#include "UARTClass.h"
|
|
|
|
#include "USARTClass.h"
|
2011-11-06 14:00:02 +01:00
|
|
|
#endif
|
2011-09-13 17:01:32 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Libc porting layers
|
|
|
|
*/
|
|
|
|
#if defined ( __GNUC__ ) /* GCC CS3 */
|
|
|
|
# include <syscalls.h> /** RedHat Newlib minimal stub */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------
|
|
|
|
* Definitions
|
|
|
|
*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
2012-03-26 18:09:10 +02:00
|
|
|
#ifndef arduino_due_x
|
|
|
|
#define arduino_due_x
|
2011-09-13 17:01:32 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/** Name of the board */
|
|
|
|
#define VARIANT_NAME "ARDUINO_DUE"
|
|
|
|
|
|
|
|
/*
|
|
|
|
#define VARIANT_REV_A
|
|
|
|
#define VARIANT_REV_B
|
|
|
|
*/
|
|
|
|
|
|
|
|
/** Frequency of the board main oscillator */
|
|
|
|
#define VARIANT_MAINOSC 12000000
|
|
|
|
|
|
|
|
/** Master clock frequency */
|
2012-03-26 18:09:10 +02:00
|
|
|
#define VARIANT_MCK 84000000
|
2011-09-13 17:01:32 +02:00
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------
|
|
|
|
* Pins
|
|
|
|
*----------------------------------------------------------------------------*/
|
|
|
|
|
2011-12-07 00:22:03 +01:00
|
|
|
// Number of pins defined in PinDescription array
|
|
|
|
#define PINS_COUNT (84u)
|
|
|
|
|
|
|
|
// LEDs
|
2011-10-27 18:27:19 +02:00
|
|
|
#define PIN_LED_13 (13u)
|
2012-03-20 13:48:44 +01:00
|
|
|
#define PIN_LED_RXL (72u)
|
|
|
|
#define PIN_LED_TXL (73u)
|
2011-09-13 18:12:51 +02:00
|
|
|
#define PIN_LED PIN_LED_13
|
|
|
|
#define PIN_LED2 PIN_LED_RXL
|
|
|
|
#define PIN_LED3 PIN_LED_TXL
|
2011-09-13 17:01:32 +02:00
|
|
|
|
2011-12-07 00:22:03 +01:00
|
|
|
/*
|
|
|
|
* SPI Interfaces
|
|
|
|
*/
|
2011-12-02 16:29:50 +01:00
|
|
|
#define SPI_INTERFACES_COUNT 1
|
|
|
|
|
2012-04-23 15:50:30 +02:00
|
|
|
#define SPI_INTERFACE SPI0
|
|
|
|
#define SPI_INTERFACE_ID ID_SPI0
|
2012-03-20 13:48:44 +01:00
|
|
|
#define PIN_SPI_SS (77u)
|
|
|
|
#define PIN_SPI_MOSI (75u)
|
|
|
|
#define PIN_SPI_MISO (74u)
|
|
|
|
#define PIN_SPI_SCK (76u)
|
2011-12-02 16:29:50 +01:00
|
|
|
|
2012-03-20 13:48:44 +01:00
|
|
|
static const uint8_t SS = PIN_SPI_SS ;
|
|
|
|
static const uint8_t MOSI = PIN_SPI_MOSI ;
|
|
|
|
static const uint8_t MISO = PIN_SPI_MISO ;
|
|
|
|
static const uint8_t SCK = PIN_SPI_SCK ;
|
2011-12-07 00:22:03 +01:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Wire Interfaces
|
|
|
|
*/
|
2011-11-06 14:00:02 +01:00
|
|
|
#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
|
2011-11-12 01:16:51 +01:00
|
|
|
#define WIRE_ISR_HANDLER TWI1_IrqHandler
|
2011-11-06 14:00:02 +01:00
|
|
|
|
2012-03-20 13:48:44 +01:00
|
|
|
#define PIN_WIRE1_SDA (70u)
|
|
|
|
#define PIN_WIRE1_SCL (71u)
|
2011-11-06 14:00:02 +01:00
|
|
|
#define WIRE1_INTERFACE TWI0
|
|
|
|
#define WIRE1_INTERFACE_ID ID_TWI0
|
2011-11-12 01:16:51 +01:00
|
|
|
#define WIRE1_ISR_HANDLER TWI0_IrqHandler
|
2011-11-06 14:00:02 +01:00
|
|
|
|
2011-12-07 00:22:03 +01:00
|
|
|
/*
|
|
|
|
* UART/USART Interfaces
|
|
|
|
*/
|
2012-03-20 13:48:44 +01:00
|
|
|
#define PINS_UART (81u)
|
2011-10-27 18:27:19 +02:00
|
|
|
|
2012-03-20 13:48:44 +01:00
|
|
|
#define PINS_USART0 (82u)
|
|
|
|
#define PINS_USART1 (83u)
|
|
|
|
#define PINS_USART2 (84u)
|
2011-10-27 18:27:19 +02:00
|
|
|
|
2011-12-07 00:22:03 +01:00
|
|
|
/*
|
|
|
|
* Analog pins
|
|
|
|
*/
|
2011-10-27 18:27:19 +02:00
|
|
|
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;
|
2012-03-20 13:48:44 +01:00
|
|
|
static const uint8_t A14 = 68;
|
|
|
|
static const uint8_t A15 = 69;
|
2011-09-13 17:01:32 +02:00
|
|
|
|
2011-12-07 00:22:03 +01:00
|
|
|
/*
|
|
|
|
* PWM
|
|
|
|
*/
|
|
|
|
#define PWM_INTERFACE PWM
|
2011-12-14 13:35:58 +01:00
|
|
|
#define PWM_INTERFACE_ID ID_PWM
|
2011-12-07 00:22:03 +01:00
|
|
|
#define PWM_FREQUENCY 1000
|
|
|
|
#define PWM_MAX_DUTY_CYCLE 255
|
|
|
|
#define PWM_MIN_DUTY_CYCLE 0
|
|
|
|
|
2011-12-14 13:35:58 +01:00
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
|
2011-09-13 17:01:32 +02:00
|
|
|
/*----------------------------------------------------------------------------
|
|
|
|
* Arduino objects - C++ only
|
|
|
|
*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
2012-03-29 21:11:05 +02:00
|
|
|
extern UARTClass Serial1 ;
|
2011-09-13 17:01:32 +02:00
|
|
|
|
|
|
|
extern USARTClass Serial2 ;
|
|
|
|
extern USARTClass Serial3 ;
|
2011-09-13 18:12:51 +02:00
|
|
|
extern USARTClass Serial4 ;
|
2011-09-13 17:01:32 +02:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* _VARIANT_ARDUINO_DUE_ */
|
|
|
|
|