Skip to content

Commit 7a7c14e

Browse files
author
Bogdan Marinescu
committed
[NUCLEO_F103RB] Test porting
Ported GPIO and UART tests, verified as working.
1 parent faee2bf commit 7a7c14e

File tree

6 files changed

+33
-2
lines changed

6 files changed

+33
-2
lines changed

libraries/tests/mbed/digitalin_digitalout/main.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "test_env.h"
22

3-
43
#if defined(TARGET_KL25Z)
54
DigitalOut out(PTA5);
65
DigitalIn in(PTC6);
@@ -13,6 +12,10 @@ DigitalIn in(PTB1);
1312
DigitalOut out(dp1);
1413
DigitalIn in(dp2);
1514

15+
#elif defined(TARGET_NUCLEO_F103RB)
16+
DigitalOut out(PC_6);
17+
DigitalIn in(PB_8);
18+
1619
#else
1720
DigitalOut out(p5);
1821
DigitalIn in(p25);

libraries/tests/mbed/digitalinout/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ DigitalInOut d2(PTB1);
1212
DigitalInOut d1(dp1);
1313
DigitalInOut d2(dp2);
1414

15+
#elif defined(TARGET_NUCLEO_F103RB)
16+
DigitalInOut d1(PC_6);
17+
DigitalInOut d2(PB_8);
18+
1519
#else
1620
DigitalInOut d1(p5);
1721
DigitalInOut d2(p25);

libraries/tests/mbed/portinout/main.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,15 @@
4444
#define P2_1 (1 << 5) // PTC5
4545
#define P2_2 (1 << 6) // PTC6
4646
#define PORT_2 PortC
47+
48+
#elif defined(TARGET_NUCLEO_F103RB)
49+
#define P1_1 (1 << 6) // PC_6
50+
#define P1_2 (1 << 5) // PC_5
51+
#define PORT_1 PortC
52+
53+
#define P2_1 (1 << 8) // PB_8
54+
#define P2_2 (1 << 9) // PB_9
55+
#define PORT_2 PortB
4756
#endif
4857

4958
#define MASK_1 (P1_1 | P1_2)

libraries/tests/mbed/portout_portin/main.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,15 @@
4444
#define P2_1 (1 << 5) // PTC5
4545
#define P2_2 (1 << 6) // PTC6
4646
#define PORT_2 PortC
47+
48+
#elif defined(TARGET_NUCLEO_F103RB)
49+
#define P1_1 (1 << 6) // PC_6
50+
#define P1_2 (1 << 5) // PC_5
51+
#define PORT_1 PortC
52+
53+
#define P2_1 (1 << 8) // PB_8
54+
#define P2_2 (1 << 9) // PB_9
55+
#define PORT_2 PortB
4756
#endif
4857

4958
#define MASK_1 (P1_1 | P1_2)

libraries/tests/mbed/serial_interrupt/main.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@
33
DigitalOut led1(LED1);
44
DigitalOut led2(LED2);
55

6+
#ifndef TARGET_NUCLEO_F103RB
67
Serial computer(USBTX, USBRX);
7-
8+
#else
9+
Serial computer(UART_TX, UART_RX);
10+
#endif
11+
812
// This function is called when a character goes into the TX buffer.
913
void txCallback() {
1014
led1 = !led1;

workspace_tools/tests.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,12 @@
4141
* digital_loop (Digital(In|Out|InOut), InterruptIn):
4242
* LPC1*: (p5 <-> p25 )
4343
* KL25Z: (PTA5<-> PTC6)
44+
* NUCLEO_F103RB: (PC_6 <-> PB_8)
4445
4546
* port_loop (Port(In|Out|InOut)):
4647
* LPC1*: (p5 <-> p25 ), (p6 <-> p26 )
4748
* KL25Z: (PTA5 <-> PTC6), (PTA4 <-> PTC5)
49+
* NUCLEO_F103RB: (PC_6 <-> PB_8), (PC_5 <-> PB_9)
4850
4951
* analog_loop (AnalogIn, AnalogOut):
5052
* LPC1*: (p17 <-> p18 )

0 commit comments

Comments
 (0)