* updated mbed SDK tests for SAMR21G18A

pull/1297/head
akhilpanayam 2015-08-07 17:37:53 +05:30 committed by Karthik Purushothaman
parent 52d4ac3ce1
commit 079b7cd697
12 changed files with 79 additions and 0 deletions

View File

@ -1,8 +1,16 @@
#include "mbed.h"
#include "test_env.h"
#if defined(TARGET_SAMR21G18A)
BusOut bus1(PA06, PA07, PA13, PA28, PA18, PA19, PA22, PA23, PA16, PA17, PA05, PA04);
BusOut bus2(PB03, PB22, PB02, PB23);
#else
BusOut bus1(D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, D13, D14, D15);
BusOut bus2(A5, A4, A3, A2, A1, A0);
#endif
int i;
int main()

View File

@ -58,6 +58,10 @@ DigitalIn in(PC1);
DigitalOut out(PE10);
DigitalIn in(PC1);
#elif defined(TARGET_SAMR21G18A)
DigitalOut out(PA06);
DigitalIn in(PA07);
#else
DigitalOut out(p5);
DigitalIn in(p25);

View File

@ -58,6 +58,10 @@ DigitalInOut d2(PC1);
DigitalInOut d1(PE10);
DigitalInOut d2(PC1);
#elif defined(TARGET_SAMR21G18A)
DigitalInOut d1(PA06);
DigitalInOut d2(PA07);
#else
DigitalInOut d1(p5);
DigitalInOut d2(p25);

View File

@ -6,6 +6,14 @@
#define FLOW_CONTROL_RTS p30
#define FLOW_CONTROL_CTS p29
#define RTS_CHECK_PIN p8
#elif defined(TARGET_SAMR21G18A)
#define UART_TX PA04
#define UART_RX PA05
#define FLOW_CONTROL_RTS PA06
#define FLOW_CONTROL_CTS PA07
#define RTS_CHECK_PIN PB03
#else
#error This test is not supported on this target
#endif

View File

@ -87,6 +87,10 @@ void in_handler() {
#define PIN_OUT PE10
#define PIN_IN PC1
#elif defined(TARGET_SAMR21G18A)
#define PIN_OUT PA06
#define PIN_IN PA07
#else
#define PIN_IN (p5)
#define PIN_OUT (p25)

View File

@ -28,6 +28,20 @@ InterruptIn button9(p15);
DigitalOut led(LED1);
DigitalOut flash(LED2);
#elif defined(TARGET_SAMR21G18A)
InterruptIn button (PA28); /*SW0*/
InterruptIn button1(PA06);
InterruptIn button2(PA07);
InterruptIn button3(PB03);
InterruptIn button4(PA16);
InterruptIn button5(PA17);
InterruptIn button6(PA05);
InterruptIn button7(PA04);
InterruptIn button8(PA14);
InterruptIn button9(PA15);
DigitalOut led(LED1);
DigitalOut flash(PA22); /*1 LED Available*/
#else
InterruptIn button(p30);
InterruptIn button1(p29);

View File

@ -1,6 +1,10 @@
#include "mbed.h"
#if defined(TARGET_SAMR21G18A)
DigitalOut out(PA06);
#else
DigitalOut out(p5);
#endif
int main() {
while (true) {

View File

@ -129,6 +129,15 @@
#define P2_2 (1 << 2) // PC2
#define PORT_2 PortC
#elif defined(TARGET_SAMR21G18A)
#define P1_1 (1 << 6) /*PA06*/
#define P1_2 (1 << 7) /*PA07*/
#define PORT_1 PortA
#define P2_1 (1 << 2) /*PA02*/
#define P2_2 (1 << 3) /*PA03*/
#define PORT_2 PortB
#endif
#define MASK_1 (P1_1 | P1_2)

View File

@ -24,6 +24,12 @@
# define LED2 (1 << 6) // P7.6
# define LED3 (1 << 4) // P7.4
# define LED4 0
# elif defined(TARGET_SAMR21G18A)
# define LED_PORT PortA
# define LED1 (1 << 19) /*PA19*/
# define LED2 0
# define LED3 0
# define LED4 0
# endif
#define LED_MASK (LED1|LED2|LED3|LED4)

View File

@ -129,6 +129,15 @@
#define P2_2 (1 << 2) // PC2
#define PORT_2 PortC
#elif defined(TARGET_SAMR21G18A)
#define P1_1 (1 << 6) /*PA06*/
#define P1_2 (1 << 7) /*PA07*/
#define PORT_1 PortA
#define P2_1 (1 << 2) /*PA02*/
#define P2_2 (1 << 3) /*PA03*/
#define PORT_2 PortB
#endif
#define MASK_1 (P1_1 | P1_2)

View File

@ -6,6 +6,8 @@ Serial pc(USBTX, USBRX);
Serial uart(P4_22, P4_23);
#elif defined(TARGET_MAXWSNENV)
Serial uart(P0_1, P0_0);
#elif defined(TARGET_SAMR21G18A)
Serial uart(PA16, PA17);
#else
Serial uart(p9, p10);
#endif

View File

@ -6,9 +6,16 @@
#include "cmsis_nvic.h"
#include <string.h>
#if defined(TARGET_SAMR21G18A)
#define PIN_IN (PA06)
#define PIN_OUT (PA07)
#define NUM_VECTORS (16+28)
#else
#define PIN_IN (p5)
#define PIN_OUT (p25)
#define NUM_VECTORS (16+33)
#endif
DigitalOut out(PIN_OUT);
DigitalOut myled(LED1);