mirror of https://github.com/ARMmbed/mbed-os.git
[LPC1549] Fix pin assignment for simple io tests.
parent
f5d3245fe9
commit
d27129351c
|
@ -4,6 +4,12 @@
|
|||
DigitalOut out(dp1);
|
||||
DigitalIn in(dp2);
|
||||
|
||||
#elif defined(TARGET_LPC1549)
|
||||
// TARGET_FF_ARDUINO cannot be used, because D0 is used as USBRX (USB serial
|
||||
// port pin), D1 is used as USBTX
|
||||
DigitalOut out(D7);
|
||||
DigitalIn in(D2);
|
||||
|
||||
#elif defined(TARGET_NUCLEO_F103RB)
|
||||
DigitalOut out(PC_6);
|
||||
DigitalIn in(PB_8);
|
||||
|
|
|
@ -4,6 +4,12 @@
|
|||
DigitalInOut d1(dp1);
|
||||
DigitalInOut d2(dp2);
|
||||
|
||||
#elif defined(TARGET_LPC1549)
|
||||
// TARGET_FF_ARDUINO cannot be used, because D0 is used as USBRX (USB serial
|
||||
// port pin), D1 is used as USBTX
|
||||
DigitalInOut d1(D2);
|
||||
DigitalInOut d2(D7);
|
||||
|
||||
#elif defined(TARGET_NUCLEO_F103RB)
|
||||
DigitalInOut d1(PC_6);
|
||||
DigitalInOut d2(PB_8);
|
||||
|
@ -25,13 +31,33 @@ int main() {
|
|||
|
||||
d1.output();
|
||||
d2.input();
|
||||
d1 = 1; wait(0.1); if (d2 != 1) check = false;
|
||||
d1 = 0; wait(0.1); if (d2 != 0) check = false;
|
||||
d1 = 1;
|
||||
wait(0.1);
|
||||
if (d2 != 1) {
|
||||
printf("First check failed! d2 is %d\n", (int) d2);
|
||||
check = false;
|
||||
}
|
||||
d1 = 0;
|
||||
wait(0.1);
|
||||
if (d2 != 0) {
|
||||
printf("Second check failed! d2 is %d\n", (int) d2);
|
||||
check = false;
|
||||
}
|
||||
|
||||
d1.input();
|
||||
d2.output();
|
||||
d2 = 1; wait(0.1); if (d1 != 1) check = false;
|
||||
d2 = 0; wait(0.1); if (d1 != 0) check = false;
|
||||
d2 = 1;
|
||||
wait(0.1);
|
||||
if (d1 != 1) {
|
||||
printf("Third check failed! d1 is %d\n", (int) d1);
|
||||
check = false;
|
||||
}
|
||||
d2 = 0;
|
||||
wait(0.1);
|
||||
if (d1 != 0) {
|
||||
printf("Fourth check failed! d1 is %d\n", (int) d1);
|
||||
check = false;
|
||||
}
|
||||
|
||||
notify_completion(check);
|
||||
}
|
||||
|
|
|
@ -25,6 +25,12 @@ void in_handler() {
|
|||
#define PIN_OUT dp1
|
||||
#define PIN_IN dp2
|
||||
|
||||
#elif defined(TARGET_LPC1549)
|
||||
// TARGET_FF_ARDUINO cannot be used, because D0 is used as USBRX (USB serial
|
||||
// port pin), D1 is used as USBTX
|
||||
#define PIN_OUT D2
|
||||
#define PIN_IN D7
|
||||
|
||||
#elif defined(TARGET_LPC4088)
|
||||
#define PIN_IN (p11)
|
||||
#define PIN_OUT (p12)
|
||||
|
|
|
@ -42,6 +42,7 @@ Wiring:
|
|||
|
||||
* digital_loop (Digital(In|Out|InOut), InterruptIn):
|
||||
* Arduino headers: (D0 <-> D7)
|
||||
* LPC1549: (D2 <-> D7)
|
||||
* LPC1*: (p5 <-> p25 )
|
||||
* KL25Z: (PTA5<-> PTC6)
|
||||
* NUCLEO_F103RB: (PC_6 <-> PB_8)
|
||||
|
|
Loading…
Reference in New Issue