mirror of https://github.com/ARMmbed/mbed-os.git
Adding device specific support for SAMR21G18A in SDK tests.
parent
bbf884c56e
commit
52d4ac3ce1
|
@ -22,6 +22,10 @@ I2C i2c(TEST_SDA_PIN, TEST_SCL_PIN);
|
|||
#define TEST_SDA_PIN PD6
|
||||
#define TEST_SCL_PIN PD7
|
||||
I2C i2c(TEST_SDA_PIN, TEST_SCL_PIN);
|
||||
#elif defined(TARGET_SAMR21G18A)
|
||||
#define TEST_SDA_PIN PA16
|
||||
#define TEST_SCL_PIN PA17
|
||||
I2C i2c(TEST_SDA_PIN, TEST_SCL_PIN);
|
||||
#else
|
||||
I2C i2c(p28, p27);
|
||||
#endif
|
||||
|
|
|
@ -8,6 +8,8 @@
|
|||
I2CSlave slave(PTE0, PTE1);
|
||||
#elif defined(TARGET_LPC4088)
|
||||
I2CSlave slave(p9, p10);
|
||||
#elif defined(TARGET_SAMR21G18A)
|
||||
I2CSlave slave(PA16, PA17);
|
||||
#else
|
||||
I2CSlave slave(p28, p27);
|
||||
#endif
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
#define TIMER_IRQ LPTimer_IRQn
|
||||
#elif defined(TARGET_LPC2368) || defined(TARGET_LPC2460)
|
||||
#define TIMER_IRQ TIMER3_IRQn
|
||||
#elif defined(TARGET_SAMR21G18A)
|
||||
#define TIMER_IRQ TC4_IRQn
|
||||
#else
|
||||
#error This test can't run on this target.
|
||||
#endif
|
||||
|
|
|
@ -166,6 +166,16 @@ int main() {
|
|||
|
||||
printf("Initialize PWM on pin P1.2 with duty cycle: %.2f\n", pwm_1.read());
|
||||
printf("Initialize PWM on pin P1.3 with duty cycle: %.2f\n", pwm_2.read());
|
||||
#elif defined(TARGET_SAMR21G18A)
|
||||
PwmOut pwm(PA19);
|
||||
|
||||
pwm.period_ms(1000);
|
||||
pwm.write(value);
|
||||
|
||||
float result = floor(pwm.read() * 100 + 0.5) / 100; // round it to 0.xx
|
||||
printf("Initialize PWM on pin LED0 with duty cycle: %.2f\n", result);
|
||||
|
||||
notify_completion(result == value ? true : false);
|
||||
#else
|
||||
#error This test is not supported on this target.
|
||||
#endif
|
||||
|
|
|
@ -28,6 +28,9 @@
|
|||
#elif defined (TARGET_DISCO_F407VG)
|
||||
#define TEST_LED LED1
|
||||
|
||||
#elif defined(TARGET_SAMR21G18A)
|
||||
#define TEST_LED LED1
|
||||
|
||||
#else
|
||||
#error This test is not supported on this target.
|
||||
#endif
|
||||
|
|
|
@ -6,6 +6,8 @@ InterruptIn wkp(P2_10);
|
|||
InterruptIn wkp(D0);
|
||||
#elif defined(TARGET_LPC11U68)
|
||||
InterruptIn wkp(P0_16);
|
||||
#elif defined(TARGET_SAMR21G18A)
|
||||
InterruptIn wkp(PA28);
|
||||
#else
|
||||
InterruptIn wkp(p14);
|
||||
#endif
|
||||
|
|
|
@ -1,7 +1,12 @@
|
|||
#include "mbed.h"
|
||||
|
||||
#if defined(TARGET_SAMR21G18A)
|
||||
SPI spi(PB22, PB02, PB23); // mosi, miso, sclk
|
||||
DigitalOut latchpin(PB03);
|
||||
#else
|
||||
SPI spi(p11, p12, p13);
|
||||
DigitalOut latchpin(p10);
|
||||
#endif
|
||||
|
||||
int main() {
|
||||
spi.format(8, 0);
|
||||
|
|
|
@ -22,6 +22,9 @@ DigitalOut cs(PC14);
|
|||
#elif defined(TARGET_EFM32HG_STK3400)
|
||||
SPI spi(PE10, PE11, PE12); // mosi, miso, sclk
|
||||
DigitalOut cs(PE13);
|
||||
#elif defined(TARGET_SAMR21G18A)
|
||||
SPI spi(PB22, PB02, PB23); // mosi, miso, sclk
|
||||
DigitalOut cs(PB03);
|
||||
#else
|
||||
SPI spi(p5, p6, p7); // mosi, miso, sclk
|
||||
DigitalOut cs(p8);
|
||||
|
|
|
@ -10,6 +10,8 @@ SPISlave device(P0_14, P0_15, P0_12, P0_13); // mosi, miso, sclk, ssel
|
|||
SPISlave device(D11, D12, D13, D10); // mosi, miso, sclk, ssel
|
||||
#elif defined(TARGET_LPC1114)
|
||||
SPISlave device(dp2, dp1, dp6, dp25); // mosi, miso, sclk, ssel
|
||||
#elif defined(TARGET_SAMR21G18A)
|
||||
SPISlave device(PB22, PB02, PB23, PB03); // mosi, miso, sclk, ssel
|
||||
#else
|
||||
SPISlave device(p5, p6, p7, p8); // mosi, miso, sclk, ssel
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue