mirror of
https://github.com/arduino/Arduino.git
synced 2025-03-14 11:29:26 +01:00
[sam] Working LED Blink on variant SAM3S-EK using IAR EWARM
This commit is contained in:
parent
beefd467f9
commit
a60e8d7236
@ -165,6 +165,8 @@ typedef struct _PinDescription
|
|||||||
EAnalogChannel dwAnalogChannel ;
|
EAnalogChannel dwAnalogChannel ;
|
||||||
} PinDescription ;
|
} PinDescription ;
|
||||||
|
|
||||||
|
extern const PinDescription APinDescription[] ;
|
||||||
|
|
||||||
#include "pins_arduino.h"
|
#include "pins_arduino.h"
|
||||||
|
|
||||||
#endif // Arduino_h
|
#endif // Arduino_h
|
||||||
|
@ -87,7 +87,7 @@
|
|||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>OGLastSavedByProductVersion</name>
|
<name>OGLastSavedByProductVersion</name>
|
||||||
<state>6.21.1.52845</state>
|
<state>6.21.3.52923</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>GeneralEnableMisra</name>
|
<name>GeneralEnableMisra</name>
|
||||||
@ -293,7 +293,7 @@
|
|||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>CCIncludePath2</name>
|
<name>CCIncludePath2</name>
|
||||||
<state>$PROJ_DIR$/../../../variants/sam3s-ek</state>
|
<state>$PROJ_DIR$/../../../variants/sam3s_ek</state>
|
||||||
<state>$PROJ_DIR$/../../../system</state>
|
<state>$PROJ_DIR$/../../../system</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>MacFile</name>
|
<name>MacFile</name>
|
||||||
<state>$PROJ_DIR$\..\..\..\..\variants\sam3s-ek\debug_scripts\iar\sam3s_ek_flash.mac</state>
|
<state>$PROJ_DIR$\..\..\..\..\variants\sam3s_ek\debug_scripts\iar\sam3s_ek_flash.mac</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>MemOverride</name>
|
<name>MemOverride</name>
|
||||||
@ -77,7 +77,7 @@
|
|||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>OCDownloadVerifyAll</name>
|
<name>OCDownloadVerifyAll</name>
|
||||||
<state>0</state>
|
<state>1</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>OCProductVersion</name>
|
<name>OCProductVersion</name>
|
||||||
@ -89,7 +89,7 @@
|
|||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>OCLastSavedByProductVersion</name>
|
<name>OCLastSavedByProductVersion</name>
|
||||||
<state>6.21.1.52845</state>
|
<state>6.21.3.52923</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>OCDownloadAttachToProgram</name>
|
<name>OCDownloadAttachToProgram</name>
|
||||||
@ -97,7 +97,7 @@
|
|||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>UseFlashLoader</name>
|
<name>UseFlashLoader</name>
|
||||||
<state>0</state>
|
<state>1</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>CLowLevel</name>
|
<name>CLowLevel</name>
|
||||||
@ -423,7 +423,7 @@
|
|||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>CCJLinkResetList</name>
|
<name>CCJLinkResetList</name>
|
||||||
<version>5</version>
|
<version>6</version>
|
||||||
<state>7</state>
|
<state>7</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
@ -821,6 +821,10 @@
|
|||||||
</data>
|
</data>
|
||||||
</settings>
|
</settings>
|
||||||
<debuggerPlugins>
|
<debuggerPlugins>
|
||||||
|
<plugin>
|
||||||
|
<file>$TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin</file>
|
||||||
|
<loadFlag>0</loadFlag>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin</file>
|
<file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin</file>
|
||||||
<loadFlag>0</loadFlag>
|
<loadFlag>0</loadFlag>
|
||||||
@ -1300,7 +1304,7 @@
|
|||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>CCJLinkResetList</name>
|
<name>CCJLinkResetList</name>
|
||||||
<version>5</version>
|
<version>6</version>
|
||||||
<state>5</state>
|
<state>5</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
@ -1698,6 +1702,10 @@
|
|||||||
</data>
|
</data>
|
||||||
</settings>
|
</settings>
|
||||||
<debuggerPlugins>
|
<debuggerPlugins>
|
||||||
|
<plugin>
|
||||||
|
<file>$TOOLKIT_DIR$\plugins\rtos\AVIX\AVIX.ENU.ewplugin</file>
|
||||||
|
<loadFlag>0</loadFlag>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin</file>
|
<file>$TOOLKIT_DIR$\plugins\rtos\CMX\CmxArmPlugin.ENU.ewplugin</file>
|
||||||
<loadFlag>0</loadFlag>
|
<loadFlag>0</loadFlag>
|
||||||
|
@ -87,7 +87,7 @@
|
|||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>OGLastSavedByProductVersion</name>
|
<name>OGLastSavedByProductVersion</name>
|
||||||
<state>6.21.1.52845</state>
|
<state>6.21.3.52923</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>GeneralEnableMisra</name>
|
<name>GeneralEnableMisra</name>
|
||||||
@ -294,7 +294,7 @@
|
|||||||
<option>
|
<option>
|
||||||
<name>CCIncludePath2</name>
|
<name>CCIncludePath2</name>
|
||||||
<state>$PROJ_DIR$\..\..</state>
|
<state>$PROJ_DIR$\..\..</state>
|
||||||
<state>$PROJ_DIR$\..\..\..\..\variants\sam3s-ek</state>
|
<state>$PROJ_DIR$\..\..\..\..\variants\sam3s_ek</state>
|
||||||
<state>$PROJ_DIR$\..\..\..\..\system</state>
|
<state>$PROJ_DIR$\..\..\..\..\system</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
@ -688,7 +688,7 @@
|
|||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>IlinkIcfFile</name>
|
<name>IlinkIcfFile</name>
|
||||||
<state>$PROJ_DIR$\..\..\..\..\variants\sam3s-ek\linker_scripts\iar\sam3s_ek_flash.icf</state>
|
<state>$PROJ_DIR$\..\..\..\..\variants\sam3s_ek\linker_scripts\iar\sam3s_ek_flash.icf</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>IlinkIcfFileSlave</name>
|
<name>IlinkIcfFileSlave</name>
|
||||||
@ -1800,16 +1800,16 @@
|
|||||||
<group>
|
<group>
|
||||||
<name>sam3s_ek</name>
|
<name>sam3s_ek</name>
|
||||||
<file>
|
<file>
|
||||||
<name>$PROJ_DIR$\..\..\..\..\variants\sam3s-ek\linker_scripts\iar\sam3s_ek_flash.icf</name>
|
<name>$PROJ_DIR$\..\..\..\..\variants\sam3s_ek\linker_scripts\iar\sam3s_ek_flash.icf</name>
|
||||||
</file>
|
</file>
|
||||||
<file>
|
<file>
|
||||||
<name>$PROJ_DIR$\..\..\..\..\variants\sam3s-ek\debug_scripts\iar\sam3s_ek_flash.mac</name>
|
<name>$PROJ_DIR$\..\..\..\..\variants\sam3s_ek\debug_scripts\iar\sam3s_ek_flash.mac</name>
|
||||||
</file>
|
</file>
|
||||||
<file>
|
<file>
|
||||||
<name>$PROJ_DIR$\..\..\..\..\variants\sam3s-ek\linker_scripts\iar\sam3s_ek_sram.icf</name>
|
<name>$PROJ_DIR$\..\..\..\..\variants\sam3s_ek\linker_scripts\iar\sam3s_ek_sram.icf</name>
|
||||||
</file>
|
</file>
|
||||||
<file>
|
<file>
|
||||||
<name>$PROJ_DIR$\..\..\..\..\variants\sam3s-ek\debug_scripts\iar\sam3s_ek_sram.mac</name>
|
<name>$PROJ_DIR$\..\..\..\..\variants\sam3s_ek\debug_scripts\iar\sam3s_ek_sram.mac</name>
|
||||||
</file>
|
</file>
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
@ -1819,15 +1819,15 @@
|
|||||||
<group>
|
<group>
|
||||||
<name>variants</name>
|
<name>variants</name>
|
||||||
<group>
|
<group>
|
||||||
<name>sam3s-ek</name>
|
<name>sam3s_ek</name>
|
||||||
<file>
|
<file>
|
||||||
<name>$PROJ_DIR$\..\..\..\..\variants\sam3s-ek\pins_arduino.h</name>
|
<name>$PROJ_DIR$\..\..\..\..\variants\sam3s_ek\pins_arduino.h</name>
|
||||||
</file>
|
</file>
|
||||||
<file>
|
<file>
|
||||||
<name>$PROJ_DIR$\..\..\..\..\variants\sam3s-ek\variant.cpp</name>
|
<name>$PROJ_DIR$\..\..\..\..\variants\sam3s_ek\variant.cpp</name>
|
||||||
</file>
|
</file>
|
||||||
<file>
|
<file>
|
||||||
<name>$PROJ_DIR$\..\..\..\..\variants\sam3s-ek\variant.h</name>
|
<name>$PROJ_DIR$\..\..\..\..\variants\sam3s_ek\variant.h</name>
|
||||||
</file>
|
</file>
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
|
@ -2,22 +2,27 @@
|
|||||||
|
|
||||||
void setup( void )
|
void setup( void )
|
||||||
{
|
{
|
||||||
// initialize the digital pin as an output.
|
// Initialize the digital pin as an output.
|
||||||
// Pin PIN_LED has an LED connected on most Arduino boards:
|
// Pin PIN_LED has a LED connected on most Arduino boards:
|
||||||
pinMode( PIN_LED, OUTPUT ) ;
|
pinMode( PIN_LED, OUTPUT ) ;
|
||||||
pinMode( PIN_LED_RED, OUTPUT ) ;
|
digitalWrite( PIN_LED, LOW ) ;
|
||||||
digitalWrite( PIN_LED_RED, HIGH ) ;
|
|
||||||
|
// Initialize the PIN_LED_GREEN digital pin as an output.
|
||||||
|
pinMode( PIN_LED_GREEN, OUTPUT ) ;
|
||||||
|
digitalWrite( PIN_LED_GREEN, HIGH ) ;
|
||||||
|
|
||||||
// Serial1.begin( 19200 ) ;
|
// Serial1.begin( 19200 ) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop( void )
|
void loop( void )
|
||||||
{
|
{
|
||||||
//digitalWrite( PIN_LED, HIGH ) ; // set the LED on
|
digitalWrite( PIN_LED, HIGH ) ; // set the LED on
|
||||||
//delay( 1000 ) ; // wait for a second
|
digitalWrite( PIN_LED_GREEN, LOW ) ; // set the red LED off
|
||||||
//digitalWrite( PIN_LED, LOW ) ; // set the LED off
|
delay( 1000 ) ; // wait for a second
|
||||||
//delay( 1000 ) ; // wait for a second
|
digitalWrite( PIN_LED, LOW ) ; // set the LED off
|
||||||
//
|
digitalWrite( PIN_LED_GREEN, HIGH ) ; // set the red LED on
|
||||||
|
delay( 1000 ) ; // wait for a second
|
||||||
|
|
||||||
//Serial1.println( "test1" ) ; // send an initial string
|
//Serial1.println( "test1" ) ; // send an initial string
|
||||||
//delay( 1000 ) ; // wait for a second
|
//delay( 1000 ) ; // wait for a second
|
||||||
//Serial1.println( "test2" ) ; // send an initial string
|
//Serial1.println( "test2" ) ; // send an initial string
|
||||||
|
@ -92,16 +92,14 @@ extern void init( void )
|
|||||||
/* Disable watchdog, common to all SAM variants */
|
/* Disable watchdog, common to all SAM variants */
|
||||||
WDT_Disable( WDT ) ;
|
WDT_Disable( WDT ) ;
|
||||||
|
|
||||||
SysTick_Config( VARIANT_MCK/1000 ) ;
|
|
||||||
|
|
||||||
// Initialize Serial port UART0, common to all SAM3 variants
|
// Initialize Serial port UART0, common to all SAM3 variants
|
||||||
PIO_Configure( APinDescription[PINS_UART].pPort, APinDescription[PINS_UART].dwPinType,
|
PIO_Configure( APinDescription[PINS_UART].pPort, APinDescription[PINS_UART].dwPinType,
|
||||||
APinDescription[PINS_UART].dwPin, APinDescription[PINS_UART].dwPinAttribute ) ;
|
APinDescription[PINS_UART].dwPin, APinDescription[PINS_UART].dwPinAttribute ) ;
|
||||||
|
|
||||||
// Switch off Power LED
|
// Switch off Power LED
|
||||||
|
PIO_Configure( APinDescription[PIN_LED_RED].pPort, APinDescription[PIN_LED_RED].dwPinType,
|
||||||
|
APinDescription[PIN_LED_RED].dwPin, APinDescription[PIN_LED_RED].dwPinAttribute ) ;
|
||||||
PIO_Clear( APinDescription[PIN_LED_RED].pPort, APinDescription[PIN_LED_RED].dwPin ) ;
|
PIO_Clear( APinDescription[PIN_LED_RED].pPort, APinDescription[PIN_LED_RED].dwPin ) ;
|
||||||
//PIO_Configure( APinDescription[PIN_LED_RED].pPort, APinDescription[PIN_LED_RED].dwPinType,
|
|
||||||
// APinDescription[PIN_LED_RED].dwPin, APinDescription[PIN_LED_RED].dwPinAttribute ) ;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -87,7 +87,7 @@
|
|||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>OGLastSavedByProductVersion</name>
|
<name>OGLastSavedByProductVersion</name>
|
||||||
<state>6.21.1.52845</state>
|
<state>6.21.3.52923</state>
|
||||||
</option>
|
</option>
|
||||||
<option>
|
<option>
|
||||||
<name>GeneralEnableMisra</name>
|
<name>GeneralEnableMisra</name>
|
||||||
@ -4082,12 +4082,6 @@
|
|||||||
<name>templates</name>
|
<name>templates</name>
|
||||||
<group>
|
<group>
|
||||||
<name>iar</name>
|
<name>iar</name>
|
||||||
<file>
|
|
||||||
<name>$PROJ_DIR$\..\cmsis\sam3u\source\templates\iar\exceptions.c</name>
|
|
||||||
<excluded>
|
|
||||||
<configuration>Debug</configuration>
|
|
||||||
</excluded>
|
|
||||||
</file>
|
|
||||||
<file>
|
<file>
|
||||||
<name>$PROJ_DIR$\..\cmsis\sam3u\source\templates\iar\startup_sam3u.c</name>
|
<name>$PROJ_DIR$\..\cmsis\sam3u\source\templates\iar\startup_sam3u.c</name>
|
||||||
</file>
|
</file>
|
||||||
|
@ -104,6 +104,10 @@ const intvec_elem __vector_table[] =
|
|||||||
Dummy_Handler /* 35 not used */
|
Dummy_Handler /* 35 not used */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* TEMPORARY PATCH FOR SCB */
|
||||||
|
#define SCB_VTOR_TBLBASE_Pos 29 /*!< SCB VTOR: TBLBASE Position */
|
||||||
|
#define SCB_VTOR_TBLBASE_Msk (1UL << SCB_VTOR_TBLBASE_Pos) /*!< SCB VTOR: TBLBASE Mask */
|
||||||
|
|
||||||
/**------------------------------------------------------------------------------
|
/**------------------------------------------------------------------------------
|
||||||
* This is the code that gets called on processor reset. To initialize the
|
* This is the code that gets called on processor reset. To initialize the
|
||||||
* device.
|
* device.
|
||||||
|
@ -100,6 +100,10 @@ const intvec_elem __vector_table[] =
|
|||||||
Dummy_Handler /* 30 not used */
|
Dummy_Handler /* 30 not used */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/* TEMPORARY PATCH FOR SCB */
|
||||||
|
#define SCB_VTOR_TBLBASE_Pos 29 /*!< SCB VTOR: TBLBASE Position */
|
||||||
|
#define SCB_VTOR_TBLBASE_Msk (1UL << SCB_VTOR_TBLBASE_Pos) /*!< SCB VTOR: TBLBASE Mask */
|
||||||
|
|
||||||
/**------------------------------------------------------------------------------
|
/**------------------------------------------------------------------------------
|
||||||
* This is the code that gets called on processor reset. To initialize the
|
* This is the code that gets called on processor reset. To initialize the
|
||||||
* device.
|
* device.
|
||||||
@ -109,7 +113,7 @@ extern int __low_level_init( void )
|
|||||||
uint32_t* pSrc = __section_begin( ".intvec" ) ;
|
uint32_t* pSrc = __section_begin( ".intvec" ) ;
|
||||||
|
|
||||||
SCB->VTOR = ( (uint32_t)pSrc & SCB_VTOR_TBLOFF_Msk ) ;
|
SCB->VTOR = ( (uint32_t)pSrc & SCB_VTOR_TBLOFF_Msk ) ;
|
||||||
|
|
||||||
if ( ((uint32_t)pSrc >= IRAM0_ADDR) && ((uint32_t)pSrc < IRAM0_ADDR+IRAM_SIZE) )
|
if ( ((uint32_t)pSrc >= IRAM0_ADDR) && ((uint32_t)pSrc < IRAM0_ADDR+IRAM_SIZE) )
|
||||||
{
|
{
|
||||||
SCB->VTOR |= 1 << SCB_VTOR_TBLBASE_Pos ;
|
SCB->VTOR |= 1 << SCB_VTOR_TBLBASE_Pos ;
|
||||||
|
@ -17,116 +17,12 @@ static const uint8_t SCK = 33 ;
|
|||||||
|
|
||||||
#define PINS_UART (16u)
|
#define PINS_UART (16u)
|
||||||
|
|
||||||
static const PinDescription APinDescription[]=
|
#if defined VARIANT_REV_A
|
||||||
{
|
|
||||||
// LEDS, 0..2
|
|
||||||
#ifdef BOARD_REV_A
|
|
||||||
{ PIOC, PIO_PC20, ID_PIOC, PIO_OUTPUT_1, PIO_DEFAULT }, // LED BLUE
|
|
||||||
{ PIOC, PIO_PC21, ID_PIOC, PIO_OUTPUT_1, PIO_DEFAULT }, // LED GREEN
|
|
||||||
{ PIOC, PIO_PC22, ID_PIOC, PIO_OUTPUT_1, PIO_DEFAULT }, // LED RED
|
|
||||||
#endif
|
|
||||||
#ifdef BOARD_REV_B
|
|
||||||
{ PIOA, PIO_PA19, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT }, // LED BLUE
|
|
||||||
{ PIOA, PIO_PA20, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT }, // LED GREEN
|
|
||||||
{ PIOC, PIO_PC20, ID_PIOC, PIO_OUTPUT_1, PIO_DEFAULT }, // LED RED
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Clock 32KHz, 3..4
|
|
||||||
{ PIOA, PIO_PA7, ID_PIOA, PIO_NOT_A_PIN, PIO_DEFAULT }, // XIN32
|
|
||||||
{ PIOA, PIO_PA8, ID_PIOA, PIO_NOT_A_PIN, PIO_DEFAULT }, // XOUT32
|
|
||||||
|
|
||||||
// Clock 12MHz, 5..6
|
|
||||||
{ PIOB, PIO_PB9, ID_PIOB, PIO_NOT_A_PIN, PIO_DEFAULT }, // XIN
|
|
||||||
{ PIOB, PIO_PB8, ID_PIOB, PIO_NOT_A_PIN, PIO_DEFAULT }, // XOUT
|
|
||||||
|
|
||||||
// JTAG, 7..10
|
|
||||||
{ PIOB, PIO_PB4, ID_PIOB, PIO_NOT_A_PIN, PIO_DEFAULT }, // TDI
|
|
||||||
{ PIOB, PIO_PB5, ID_PIOB, PIO_NOT_A_PIN, PIO_DEFAULT }, // TDO
|
|
||||||
{ PIOB, PIO_PB6, ID_PIOB, PIO_NOT_A_PIN, PIO_DEFAULT }, // TMS
|
|
||||||
{ PIOB, PIO_PB7, ID_PIOB, PIO_NOT_A_PIN, PIO_DEFAULT }, // TCK
|
|
||||||
|
|
||||||
// USB, 11..13
|
|
||||||
{ PIOB, PIO_PB10, ID_PIOB, PIO_NOT_A_PIN, PIO_DEFAULT }, // DDM
|
|
||||||
{ PIOB, PIO_PB11, ID_PIOB, PIO_NOT_A_PIN, PIO_DEFAULT }, // DDP
|
|
||||||
#ifdef BOARD_REV_A
|
|
||||||
{ PIOC, PIO_PC23, ID_PIOC, PIO_INPUT, PIO_PULLUP }, // USB_VBUS
|
|
||||||
#endif
|
|
||||||
#ifdef BOARD_REV_B
|
|
||||||
{ PIOC, PIO_PC21, ID_PIOC, PIO_INPUT, PIO_PULLUP }, // USB_VBUS
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// UART0 (Serial), 14..16
|
|
||||||
{ PIOA, PIO_PA9, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT }, // URXD0
|
|
||||||
{ PIOA, PIO_PA10, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT }, // UTXD0
|
|
||||||
{ PIOA, PIO_PA9|PIO_PA10, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT }, // All UART0 pins
|
|
||||||
|
|
||||||
// Push buttons, 17..18
|
|
||||||
{ PIOB, PIO_PB3, ID_PIOB, PIO_INPUT, PIO_PULLUP | PIO_DEBOUNCE | PIO_IT_RISE_EDGE }, // PB1
|
|
||||||
{ PIOC, PIO_PC12, ID_PIOC, PIO_INPUT, PIO_PULLUP | PIO_DEBOUNCE | PIO_IT_FALL_EDGE }, // PB2
|
|
||||||
|
|
||||||
// QTouch Slider, 19..20
|
|
||||||
{ PIOA, (PIO_PA0 | PIO_PA2 | PIO_PA4), ID_PIOA, PIO_INPUT, PIO_DEFAULT }, // QTSLIDR SNS
|
|
||||||
{ PIOA, (PIO_PA1 | PIO_PA3 | PIO_PA5), ID_PIOA, PIO_INPUT, PIO_DEFAULT }, // QTSLIDR SNSK
|
|
||||||
|
|
||||||
// QTouch Buttons, 21..22
|
|
||||||
{ PIOC, (PIO_PC22 | PIO_PC24 | PIO_PC26 | PIO_PC28 | PIO_PC30), ID_PIOC, PIO_INPUT, PIO_DEFAULT }, // KEYS SNS
|
|
||||||
{ PIOC, (PIO_PC23 | PIO_PC25 | PIO_PC27 | PIO_PC29 | PIO_PC31), ID_PIOC, PIO_INPUT, PIO_DEFAULT }, // KEYS SNSK
|
|
||||||
|
|
||||||
// MCI (SDCARD), 23..30
|
|
||||||
#ifdef BOARD_REV_A
|
|
||||||
{ PIOA, PIO_PA15, ID_PIOA, PIO_INPUT, PIO_PULLUP }, // MCI Card Detect
|
|
||||||
#endif
|
|
||||||
#ifdef BOARD_REV_B
|
|
||||||
{ PIOA, PIO_PA6, ID_PIOA, PIO_INPUT, PIO_PULLUP }, // MCI Card Detect
|
|
||||||
#endif
|
|
||||||
{ PIOA, PIO_PA30, ID_PIOA, PIO_PERIPH_C, PIO_PULLUP }, // MCDA0
|
|
||||||
{ PIOA, PIO_PA31, ID_PIOA, PIO_PERIPH_C, PIO_PULLUP }, // MCDA1
|
|
||||||
{ PIOA, PIO_PA26, ID_PIOA, PIO_PERIPH_C, PIO_PULLUP }, // MCDA2
|
|
||||||
{ PIOA, PIO_PA27, ID_PIOA, PIO_PERIPH_C, PIO_PULLUP }, // MCDA3
|
|
||||||
{ PIOA, PIO_PA28, ID_PIOA, PIO_PERIPH_C, PIO_PULLUP }, // MCCDA
|
|
||||||
{ PIOA, PIO_PA29, ID_PIOA, PIO_PERIPH_C, PIO_PULLUP }, // MCCK
|
|
||||||
|
|
||||||
{ PIOA, PIO_PA26|PIO_PA27|PIO_PA28|PIO_PA29|PIO_PA30|PIO_PA31, ID_PIOA, PIO_PERIPH_C, PIO_PULLUP }, // All MCI Pins
|
|
||||||
|
|
||||||
// SPI, 31..34
|
|
||||||
{ PIOA, PIO_PA12A_MISO, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT }, // MISO
|
|
||||||
{ PIOA, PIO_PA13A_MOSI, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT }, // MOSI
|
|
||||||
{ PIOA, PIO_PA14A_SPCK, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT }, // SPCK
|
|
||||||
{ PIOA, PIO_PA11A_NPCS0, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT }, // NPCS0
|
|
||||||
|
|
||||||
// TouchScreen, 35..36
|
|
||||||
#ifdef BOARD_REV_A
|
|
||||||
{ PIOA, PIO_PA4, ID_PIOA, PIO_INPUT, PIO_PULLUP }, // IRQ_TSC
|
|
||||||
{ PIOA, PIO_PA5, ID_PIOA, PIO_INPUT, PIO_PULLUP }, // BUSY_TSC
|
|
||||||
#endif
|
|
||||||
#ifdef BOARD_REV_B
|
|
||||||
{ PIOA, PIO_PA16, ID_PIOA, PIO_INPUT, PIO_PULLUP }, // IRQ_TSC
|
|
||||||
{ PIOA, PIO_PA17, ID_PIOA, PIO_INPUT, PIO_PULLUP }, // BUSY_TSC
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// USART1, 37..41
|
|
||||||
{ PIOA, PIO_PA21A_RXD1, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT }, // RXD1
|
|
||||||
{ PIOA, PIO_PA22A_TXD1, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT }, // TXD1
|
|
||||||
{ PIOA, PIO_PA24A_RTS1, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT }, // RTS1
|
|
||||||
{ PIOA, PIO_PA25A_CTS1, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT }, // CTS1
|
|
||||||
{ PIOA, PIO_PA23A_SCK1, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT }, // COM1 ENABLE (MAX232)
|
|
||||||
|
|
||||||
// LCD, 42..47
|
|
||||||
{ PIOC, 0xFF, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP }, // EBI Data bus
|
|
||||||
{ PIOC, PIO_PC8, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP }, // EBI_NWE
|
|
||||||
{ PIOC, PIO_PC11, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP }, // EBI_NRD
|
|
||||||
{ PIOC, PIO_PC15, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP }, // LCD CS
|
|
||||||
{ PIOC, PIO_PC19, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP }, // LCD RS
|
|
||||||
{ PIOC, PIO_PC13, ID_PIOC, PIO_OUTPUT_0, PIO_DEFAULT }, // LCD BackLight
|
|
||||||
|
|
||||||
{ NULL, 0, 0, PIO_NOT_A_PIN, PIO_DEFAULT } // END
|
|
||||||
} ;
|
|
||||||
|
|
||||||
#ifdef BOARD_REV_A
|
|
||||||
# define PIN_TSC_IRQ_WUP_ID (1UL << 3)
|
# define PIN_TSC_IRQ_WUP_ID (1UL << 3)
|
||||||
#endif
|
#elif defined VARIANT_REV_B
|
||||||
#ifdef BOARD_REV_B
|
|
||||||
# define PIN_TSC_IRQ_WUP_ID (1UL << 15)
|
# define PIN_TSC_IRQ_WUP_ID (1UL << 15)
|
||||||
|
#else
|
||||||
|
#error "No board revision defined"
|
||||||
#endif
|
#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_PINS PIN_EBI_DATA_BUS, PIN_EBI_NRD, PIN_EBI_NWE, PIN_EBI_NCS1, PIN_EBI_LCD_RS
|
||||||
|
@ -1,5 +1,117 @@
|
|||||||
#include "Arduino.h"
|
#include "Arduino.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Pins descriptions
|
||||||
|
*/
|
||||||
|
extern const PinDescription APinDescription[]=
|
||||||
|
{
|
||||||
|
// LEDS, 0..2
|
||||||
|
#if defined VARIANT_REV_A
|
||||||
|
{ PIOC, PIO_PC20, ID_PIOC, PIO_OUTPUT_1, PIO_DEFAULT }, // LED BLUE
|
||||||
|
{ PIOC, PIO_PC21, ID_PIOC, PIO_OUTPUT_1, PIO_DEFAULT }, // LED GREEN
|
||||||
|
{ PIOC, PIO_PC22, ID_PIOC, PIO_OUTPUT_1, PIO_DEFAULT }, // LED RED
|
||||||
|
#elif defined VARIANT_REV_B
|
||||||
|
{ PIOA, PIO_PA19, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT }, // LED BLUE
|
||||||
|
{ PIOA, PIO_PA20, ID_PIOA, PIO_OUTPUT_1, PIO_DEFAULT }, // LED GREEN
|
||||||
|
{ PIOC, PIO_PC20, ID_PIOC, PIO_OUTPUT_1, PIO_DEFAULT }, // LED RED
|
||||||
|
#else
|
||||||
|
#error "No board revision defined"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// Clock 32KHz, 3..4
|
||||||
|
{ PIOA, PIO_PA7, ID_PIOA, PIO_NOT_A_PIN, PIO_DEFAULT }, // XIN32
|
||||||
|
{ PIOA, PIO_PA8, ID_PIOA, PIO_NOT_A_PIN, PIO_DEFAULT }, // XOUT32
|
||||||
|
|
||||||
|
// Clock 12MHz, 5..6
|
||||||
|
{ PIOB, PIO_PB9, ID_PIOB, PIO_NOT_A_PIN, PIO_DEFAULT }, // XIN
|
||||||
|
{ PIOB, PIO_PB8, ID_PIOB, PIO_NOT_A_PIN, PIO_DEFAULT }, // XOUT
|
||||||
|
|
||||||
|
// JTAG, 7..10
|
||||||
|
{ PIOB, PIO_PB4, ID_PIOB, PIO_NOT_A_PIN, PIO_DEFAULT }, // TDI
|
||||||
|
{ PIOB, PIO_PB5, ID_PIOB, PIO_NOT_A_PIN, PIO_DEFAULT }, // TDO
|
||||||
|
{ PIOB, PIO_PB6, ID_PIOB, PIO_NOT_A_PIN, PIO_DEFAULT }, // TMS
|
||||||
|
{ PIOB, PIO_PB7, ID_PIOB, PIO_NOT_A_PIN, PIO_DEFAULT }, // TCK
|
||||||
|
|
||||||
|
// USB, 11..13
|
||||||
|
{ PIOB, PIO_PB10, ID_PIOB, PIO_NOT_A_PIN, PIO_DEFAULT }, // DDM
|
||||||
|
{ PIOB, PIO_PB11, ID_PIOB, PIO_NOT_A_PIN, PIO_DEFAULT }, // DDP
|
||||||
|
#if defined VARIANT_REV_A
|
||||||
|
{ PIOC, PIO_PC23, ID_PIOC, PIO_INPUT, PIO_PULLUP }, // USB_VBUS
|
||||||
|
#elif defined VARIANT_REV_B
|
||||||
|
{ PIOC, PIO_PC21, ID_PIOC, PIO_INPUT, PIO_PULLUP }, // USB_VBUS
|
||||||
|
#else
|
||||||
|
#error "No board revision defined"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// UART0 (Serial), 14..16
|
||||||
|
{ PIOA, PIO_PA9, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT }, // URXD0
|
||||||
|
{ PIOA, PIO_PA10, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT }, // UTXD0
|
||||||
|
{ PIOA, PIO_PA9|PIO_PA10, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT }, // All UART0 pins
|
||||||
|
|
||||||
|
// Push buttons, 17..18
|
||||||
|
{ PIOB, PIO_PB3, ID_PIOB, PIO_INPUT, PIO_PULLUP | PIO_DEBOUNCE | PIO_IT_RISE_EDGE }, // PB1
|
||||||
|
{ PIOC, PIO_PC12, ID_PIOC, PIO_INPUT, PIO_PULLUP | PIO_DEBOUNCE | PIO_IT_FALL_EDGE }, // PB2
|
||||||
|
|
||||||
|
// QTouch Slider, 19..20
|
||||||
|
{ PIOA, (PIO_PA0 | PIO_PA2 | PIO_PA4), ID_PIOA, PIO_INPUT, PIO_DEFAULT }, // QTSLIDR SNS
|
||||||
|
{ PIOA, (PIO_PA1 | PIO_PA3 | PIO_PA5), ID_PIOA, PIO_INPUT, PIO_DEFAULT }, // QTSLIDR SNSK
|
||||||
|
|
||||||
|
// QTouch Buttons, 21..22
|
||||||
|
{ PIOC, (PIO_PC22 | PIO_PC24 | PIO_PC26 | PIO_PC28 | PIO_PC30), ID_PIOC, PIO_INPUT, PIO_DEFAULT }, // KEYS SNS
|
||||||
|
{ PIOC, (PIO_PC23 | PIO_PC25 | PIO_PC27 | PIO_PC29 | PIO_PC31), ID_PIOC, PIO_INPUT, PIO_DEFAULT }, // KEYS SNSK
|
||||||
|
|
||||||
|
// MCI (SDCARD), 23..30
|
||||||
|
#if defined VARIANT_REV_A
|
||||||
|
{ PIOA, PIO_PA15, ID_PIOA, PIO_INPUT, PIO_PULLUP }, // MCI Card Detect
|
||||||
|
#elif defined VARIANT_REV_B
|
||||||
|
{ PIOA, PIO_PA6, ID_PIOA, PIO_INPUT, PIO_PULLUP }, // MCI Card Detect
|
||||||
|
#else
|
||||||
|
#error "No board revision defined"
|
||||||
|
#endif
|
||||||
|
{ PIOA, PIO_PA30, ID_PIOA, PIO_PERIPH_C, PIO_PULLUP }, // MCDA0
|
||||||
|
{ PIOA, PIO_PA31, ID_PIOA, PIO_PERIPH_C, PIO_PULLUP }, // MCDA1
|
||||||
|
{ PIOA, PIO_PA26, ID_PIOA, PIO_PERIPH_C, PIO_PULLUP }, // MCDA2
|
||||||
|
{ PIOA, PIO_PA27, ID_PIOA, PIO_PERIPH_C, PIO_PULLUP }, // MCDA3
|
||||||
|
{ PIOA, PIO_PA28, ID_PIOA, PIO_PERIPH_C, PIO_PULLUP }, // MCCDA
|
||||||
|
{ PIOA, PIO_PA29, ID_PIOA, PIO_PERIPH_C, PIO_PULLUP }, // MCCK
|
||||||
|
|
||||||
|
{ PIOA, PIO_PA26|PIO_PA27|PIO_PA28|PIO_PA29|PIO_PA30|PIO_PA31, ID_PIOA, PIO_PERIPH_C, PIO_PULLUP }, // All MCI Pins
|
||||||
|
|
||||||
|
// SPI, 31..34
|
||||||
|
{ PIOA, PIO_PA12A_MISO, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT }, // MISO
|
||||||
|
{ PIOA, PIO_PA13A_MOSI, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT }, // MOSI
|
||||||
|
{ PIOA, PIO_PA14A_SPCK, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT }, // SPCK
|
||||||
|
{ PIOA, PIO_PA11A_NPCS0, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT }, // NPCS0
|
||||||
|
|
||||||
|
// TouchScreen, 35..36
|
||||||
|
#if defined VARIANT_REV_A
|
||||||
|
{ PIOA, PIO_PA4, ID_PIOA, PIO_INPUT, PIO_PULLUP }, // IRQ_TSC
|
||||||
|
{ PIOA, PIO_PA5, ID_PIOA, PIO_INPUT, PIO_PULLUP }, // BUSY_TSC
|
||||||
|
#elif defined VARIANT_REV_B
|
||||||
|
{ PIOA, PIO_PA16, ID_PIOA, PIO_INPUT, PIO_PULLUP }, // IRQ_TSC
|
||||||
|
{ PIOA, PIO_PA17, ID_PIOA, PIO_INPUT, PIO_PULLUP }, // BUSY_TSC
|
||||||
|
#else
|
||||||
|
#error "No board revision defined"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// USART1, 37..41
|
||||||
|
{ PIOA, PIO_PA21A_RXD1, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT }, // RXD1
|
||||||
|
{ PIOA, PIO_PA22A_TXD1, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT }, // TXD1
|
||||||
|
{ PIOA, PIO_PA24A_RTS1, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT }, // RTS1
|
||||||
|
{ PIOA, PIO_PA25A_CTS1, ID_PIOA, PIO_PERIPH_A, PIO_DEFAULT }, // CTS1
|
||||||
|
{ PIOA, PIO_PA23A_SCK1, ID_PIOA, PIO_OUTPUT_0, PIO_DEFAULT }, // COM1 ENABLE (MAX232)
|
||||||
|
|
||||||
|
// LCD, 42..47
|
||||||
|
{ PIOC, 0xFF, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP }, // EBI Data bus
|
||||||
|
{ PIOC, PIO_PC8, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP }, // EBI_NWE
|
||||||
|
{ PIOC, PIO_PC11, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP }, // EBI_NRD
|
||||||
|
{ PIOC, PIO_PC15, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP }, // LCD CS
|
||||||
|
{ PIOC, PIO_PC19, ID_PIOC, PIO_PERIPH_A, PIO_PULLUP }, // LCD RS
|
||||||
|
{ PIOC, PIO_PC13, ID_PIOC, PIO_OUTPUT_0, PIO_DEFAULT }, // LCD BackLight
|
||||||
|
|
||||||
|
{ NULL, 0, 0, PIO_NOT_A_PIN, PIO_DEFAULT } // END
|
||||||
|
} ;
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/*
|
/*
|
||||||
* UART objects
|
* UART objects
|
||||||
|
@ -27,10 +27,10 @@
|
|||||||
/** Name of the board */
|
/** Name of the board */
|
||||||
#define VARIANT_NAME "SAM3S-EK"
|
#define VARIANT_NAME "SAM3S-EK"
|
||||||
|
|
||||||
/*
|
|
||||||
#define VARIANT_REV_A
|
#define VARIANT_REV_A
|
||||||
*/
|
/*
|
||||||
#define VARIANT_REV_B
|
#define VARIANT_REV_B
|
||||||
|
*/
|
||||||
|
|
||||||
/** Frequency of the board main oscillator */
|
/** Frequency of the board main oscillator */
|
||||||
#define VARIANT_MAINOSC 12000000
|
#define VARIANT_MAINOSC 12000000
|
||||||
|
Loading…
x
Reference in New Issue
Block a user