mirror of https://github.com/ARMmbed/mbed-os.git
* updated with test support for SAMD21G18A targets. Used pins commonly available in expansion headers of development boards.
* USBTX and USBRX pins updated.pull/1359/head
parent
c2fa32ca71
commit
77bf03b30b
|
|
@ -69,8 +69,8 @@ typedef enum {
|
|||
PB22 = 54,
|
||||
PB23 = 55,
|
||||
|
||||
USBTX = PA22,
|
||||
USBRX = PA23,
|
||||
USBTX = PB10,
|
||||
USBRX = PB11,
|
||||
|
||||
LED1 = PA23,
|
||||
LED2 = PA23,
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
BusOut bus1(PA06, PA07, PA13, PA28, PA18, PA19, PA22, PA23, PA16, PA17, PA05, PA04);
|
||||
BusOut bus2(PB03, PB22, PB02, PB23);
|
||||
|
||||
#elif defined(TARGET_SAMD21J18A)
|
||||
#elif defined(TARGET_SAMD21J18A) || defined(TARGET_SAMD21G18A)
|
||||
BusOut bus1(PA06, PA07, PA13, PA28, PA18, PA19, PA22, PA23, PA16, PA17, PA05, PA04);
|
||||
BusOut bus2(PB03, PB22, PB02, PB23);
|
||||
|
||||
|
|
|
|||
|
|
@ -62,9 +62,9 @@ DigitalIn in(PC1);
|
|||
DigitalOut out(PE10);
|
||||
DigitalIn in(PC1);
|
||||
|
||||
#elif defined(TARGET_SAMR21G18A) || defined(TARGET_SAMD21J18A)
|
||||
DigitalOut out(PA06);
|
||||
DigitalIn in(PA07);
|
||||
#elif defined(TARGET_SAMR21G18A) || defined(TARGET_SAMD21J18A) || defined(TARGET_SAMD21G18A)
|
||||
DigitalOut out(PB02);
|
||||
DigitalIn in(PB03);
|
||||
|
||||
#else
|
||||
DigitalOut out(p5);
|
||||
|
|
|
|||
|
|
@ -62,9 +62,9 @@ DigitalInOut d2(PC1);
|
|||
DigitalInOut d1(PE10);
|
||||
DigitalInOut d2(PC1);
|
||||
|
||||
#elif defined(TARGET_SAMR21G18A) || defined(TARGET_SAMD21J18A)
|
||||
DigitalInOut d1(PA06);
|
||||
DigitalInOut d2(PA07);
|
||||
#elif defined(TARGET_SAMR21G18A) || defined(TARGET_SAMD21J18A) || defined(TARGET_SAMD21G18A)
|
||||
DigitalInOut d1(PB02);
|
||||
DigitalInOut d2(PB03);
|
||||
|
||||
#else
|
||||
DigitalInOut d1(p5);
|
||||
|
|
|
|||
|
|
@ -14,13 +14,20 @@
|
|||
#define FLOW_CONTROL_CTS PA07
|
||||
#define RTS_CHECK_PIN PB03
|
||||
|
||||
#elif defined(TARGET_SAMD21J18A)
|
||||
#define UART_TX PA22
|
||||
#define UART_RX PA23
|
||||
#elif defined(TARGET_SAMD21J18A) /*USB debug port is not having RTS and CTS pins in expansion connectors in D21 Xplained Pro Board*/
|
||||
#define UART_TX PA22 /* Short this pin to PA04 */
|
||||
#define UART_RX PA23 /* Short this pin to PA05 */
|
||||
#define FLOW_CONTROL_RTS PA24
|
||||
#define FLOW_CONTROL_CTS PA25
|
||||
#define RTS_CHECK_PIN PB03
|
||||
|
||||
#elif defined(TARGET_SAMD21G18A) /*USB debug port is not having RTS and CTS pins in expansion connectors in W25 Xplained Pro Board*/
|
||||
#define UART_TX PA16 /* Short this pin to PB10 */
|
||||
#define UART_RX PA17 /* Short this pin to PB11 */
|
||||
#define FLOW_CONTROL_RTS PA18
|
||||
#define FLOW_CONTROL_CTS PA19
|
||||
#define RTS_CHECK_PIN PB03
|
||||
|
||||
#else
|
||||
#error This test is not supported on this target
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -91,9 +91,9 @@ void in_handler() {
|
|||
#define PIN_OUT PE10
|
||||
#define PIN_IN PC1
|
||||
|
||||
#elif defined(TARGET_SAMR21G18A) || defined(TARGET_SAMD21J18A)
|
||||
#define PIN_OUT PA06
|
||||
#define PIN_IN PA07
|
||||
#elif defined(TARGET_SAMR21G18A) || defined(TARGET_SAMD21J18A) || defined(TARGET_SAMD21G18A)
|
||||
#define PIN_OUT PB02
|
||||
#define PIN_IN PB03
|
||||
|
||||
#else
|
||||
#define PIN_IN (p5)
|
||||
|
|
|
|||
|
|
@ -56,6 +56,20 @@ InterruptIn button9(PA28);
|
|||
DigitalOut led(LED1);
|
||||
DigitalOut flash(PA27); /*1 LED Available*/
|
||||
|
||||
#elif defined(TARGET_SAMD21G18A)
|
||||
InterruptIn button (PB23); /*SW0*/
|
||||
InterruptIn button1(PA02);
|
||||
InterruptIn button2(PA03);
|
||||
InterruptIn button3(PA10);
|
||||
InterruptIn button4(PA11);
|
||||
InterruptIn button5(PA20);
|
||||
InterruptIn button6(PA21);
|
||||
InterruptIn button7(PA09);
|
||||
InterruptIn button8(PA16);
|
||||
InterruptIn button9(PA17);
|
||||
DigitalOut led(LED1);
|
||||
DigitalOut flash(PA19); /*1 LED Available*/
|
||||
|
||||
#else
|
||||
InterruptIn button(p30);
|
||||
InterruptIn button1(p29);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#include "mbed.h"
|
||||
|
||||
#if defined(TARGET_SAMR21G18A) || defined(TARGET_SAMD21J18A)
|
||||
DigitalOut out(PA06);
|
||||
#if defined(TARGET_SAMR21G18A) || defined(TARGET_SAMD21J18A) || defined(TARGET_SAMD21G18A)
|
||||
DigitalOut out(PB02);
|
||||
#else
|
||||
DigitalOut out(p5);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -138,6 +138,15 @@
|
|||
#define P2_2 (1 << 3) /*PB03*/
|
||||
#define PORT_2 PortB
|
||||
|
||||
#elif defined(TARGET_SAMD21G18A)
|
||||
#define P1_1 (1 << 2) /*PA02*/
|
||||
#define P1_2 (1 << 3) /*PA03*/
|
||||
#define PORT_1 PortA
|
||||
|
||||
#define P2_1 (1 << 2) /*PB02*/
|
||||
#define P2_2 (1 << 3) /*PB03*/
|
||||
#define PORT_2 PortB
|
||||
|
||||
#endif
|
||||
|
||||
#define MASK_1 (P1_1 | P1_2)
|
||||
|
|
|
|||
|
|
@ -36,8 +36,15 @@
|
|||
# define LED2 0
|
||||
# define LED3 0
|
||||
# define LED4 0
|
||||
# elif defined(TARGET_SAMD21G18A)
|
||||
# define LED_PORT PortA
|
||||
# define LED1 (1 << 23) /*PA23*/
|
||||
# define LED2 0
|
||||
# define LED3 0
|
||||
# define LED4 0
|
||||
# endif
|
||||
|
||||
|
||||
#define LED_MASK (LED1|LED2|LED3|LED4)
|
||||
|
||||
int mask[4] = {
|
||||
|
|
|
|||
|
|
@ -138,6 +138,15 @@
|
|||
#define P2_2 (1 << 3) /*PB03*/
|
||||
#define PORT_2 PortB
|
||||
|
||||
#elif defined(TARGET_SAMD21G18A)
|
||||
#define P1_1 (1 << 2) /*PA02*/
|
||||
#define P1_2 (1 << 3) /*PA03*/
|
||||
#define PORT_1 PortA
|
||||
|
||||
#define P2_1 (1 << 2) /*PB02*/
|
||||
#define P2_2 (1 << 3) /*PB03*/
|
||||
#define PORT_2 PortB
|
||||
|
||||
#endif
|
||||
|
||||
#define MASK_1 (P1_1 | P1_2)
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ Serial pc(USBTX, USBRX);
|
|||
Serial uart(P4_22, P4_23);
|
||||
#elif defined(TARGET_MAXWSNENV)
|
||||
Serial uart(P0_1, P0_0);
|
||||
#elif defined(TARGET_SAMR21G18A) || defined(TARGET_SAMD21J18A)
|
||||
#elif defined(TARGET_SAMR21G18A) || defined(TARGET_SAMD21J18A) || defined(TARGET_SAMD21G18A)
|
||||
Serial uart(PA16, PA17);
|
||||
#else
|
||||
Serial uart(p9, p10);
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@
|
|||
#include "cmsis_nvic.h"
|
||||
#include <string.h>
|
||||
|
||||
#if defined(TARGET_SAMR21G18A) || defined(TARGET_SAMD21J18A)
|
||||
#define PIN_IN (PA06)
|
||||
#define PIN_OUT (PA07)
|
||||
#if defined(TARGET_SAMR21G18A) || defined(TARGET_SAMD21J18A) || defined(TARGET_SAMD21G18A)
|
||||
#define PIN_IN (PB02)
|
||||
#define PIN_OUT (PB03)
|
||||
#define NUM_VECTORS (16+28)
|
||||
|
||||
#else
|
||||
|
|
|
|||
Loading…
Reference in New Issue