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
|
2012-03-27 13:16:27 +02:00
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
2011-10-25 16:19:43 +02:00
|
|
|
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-12 01:55:10 +02:00
|
|
|
|
2012-04-28 17:36:57 +02:00
|
|
|
#ifndef _VARIANT_SAM3X_EK_
|
|
|
|
#define _VARIANT_SAM3X_EK_
|
2011-09-12 01:55:10 +02:00
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------
|
|
|
|
* Headers
|
|
|
|
*----------------------------------------------------------------------------*/
|
|
|
|
|
2012-05-02 17:00:55 +02:00
|
|
|
// We have native USB on this variant
|
|
|
|
#define USBCON
|
|
|
|
|
2011-09-12 01:55:10 +02:00
|
|
|
#include "Arduino.h"
|
2012-03-27 13:16:27 +02:00
|
|
|
#ifdef __cplusplus
|
2011-10-16 19:49:47 +02:00
|
|
|
#include "UARTClass.h"
|
|
|
|
#include "USARTClass.h"
|
2012-03-27 13:16:27 +02:00
|
|
|
#endif
|
2011-09-12 01:55:10 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Libc porting layers
|
|
|
|
*/
|
|
|
|
#if defined ( __GNUC__ ) /* GCC CS3 */
|
|
|
|
# include <syscalls.h> /** RedHat Newlib minimal stub */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------
|
|
|
|
* Definitions
|
|
|
|
*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------*/
|
|
|
|
|
2012-03-29 10:48:24 +02:00
|
|
|
#ifndef sam3x_ek
|
|
|
|
#define sam3x_ek
|
2011-09-12 01:55:10 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/** Name of the board */
|
2012-03-29 10:48:24 +02:00
|
|
|
#define VARIANT_NAME "SAM3X-EK"
|
2011-09-12 01:55:10 +02:00
|
|
|
|
|
|
|
|
|
|
|
/** Frequency of the board main oscillator */
|
|
|
|
#define VARIANT_MAINOSC 12000000
|
|
|
|
|
|
|
|
/** Master clock frequency */
|
2012-03-29 10:48:24 +02:00
|
|
|
#define VARIANT_MCK 84000000
|
2011-09-12 01:55:10 +02:00
|
|
|
|
|
|
|
/*----------------------------------------------------------------------------
|
|
|
|
* Pins
|
|
|
|
*----------------------------------------------------------------------------*/
|
|
|
|
|
2012-03-27 13:16:27 +02:00
|
|
|
// Number of pins defined in PinDescription array
|
2012-03-29 10:48:24 +02:00
|
|
|
#define PINS_COUNT (10u)
|
2012-03-27 13:16:27 +02:00
|
|
|
|
|
|
|
// LEDs
|
2012-03-29 10:48:24 +02:00
|
|
|
#define PIN_LED_BLUE (2u)
|
|
|
|
#define PIN_LED_AMBER (3u)
|
|
|
|
#define PIN_LED_GREEN (4u)
|
|
|
|
#define PIN_LED_RED (5u)
|
|
|
|
#define PIN_LED PIN_LED_AMBER
|
|
|
|
#define PIN_LED2 PIN_LED_BLUE
|
|
|
|
#define PIN_LED3 PIN_LED_GREEN
|
2012-03-27 13:16:27 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* UART/USART Interfaces
|
|
|
|
*/
|
2012-03-29 10:48:24 +02:00
|
|
|
#define PINS_UART (8u)
|
2012-03-27 13:16:27 +02:00
|
|
|
|
2012-03-29 10:48:24 +02:00
|
|
|
#define PINS_USART0 (9u)
|
2012-03-27 13:16:27 +02:00
|
|
|
|
|
|
|
|
2012-04-28 17:36:57 +02:00
|
|
|
/*
|
|
|
|
* Analog pins
|
|
|
|
*/
|
|
|
|
static const uint8_t A0 = 10;
|
2012-03-27 13:16:27 +02:00
|
|
|
|
2012-04-28 17:36:57 +02:00
|
|
|
/*
|
|
|
|
* 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
|
2012-05-02 17:00:55 +02:00
|
|
|
|
2011-09-12 01:55:10 +02:00
|
|
|
/*----------------------------------------------------------------------------
|
|
|
|
* Arduino objects - C++ only
|
|
|
|
*----------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
2012-04-28 17:36:57 +02:00
|
|
|
extern UARTClass Serial1 ;
|
2011-09-12 01:55:10 +02:00
|
|
|
|
|
|
|
extern USARTClass Serial2 ;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2012-04-28 17:36:57 +02:00
|
|
|
#endif /* _VARIANT_SAM3X_EK_ */
|
2011-09-12 01:55:10 +02:00
|
|
|
|