File tree Expand file tree Collapse file tree 6 files changed +33
-2
lines changed Expand file tree Collapse file tree 6 files changed +33
-2
lines changed Original file line number Diff line number Diff line change 1
1
#include " test_env.h"
2
2
3
-
4
3
#if defined(TARGET_KL25Z)
5
4
DigitalOut out (PTA5);
6
5
DigitalIn in (PTC6);
@@ -13,6 +12,10 @@ DigitalIn in(PTB1);
13
12
DigitalOut out (dp1);
14
13
DigitalIn in (dp2);
15
14
15
+ #elif defined(TARGET_NUCLEO_F103RB)
16
+ DigitalOut out (PC_6);
17
+ DigitalIn in (PB_8);
18
+
16
19
#else
17
20
DigitalOut out (p5);
18
21
DigitalIn in (p25);
Original file line number Diff line number Diff line change @@ -12,6 +12,10 @@ DigitalInOut d2(PTB1);
12
12
DigitalInOut d1 (dp1);
13
13
DigitalInOut d2 (dp2);
14
14
15
+ #elif defined(TARGET_NUCLEO_F103RB)
16
+ DigitalInOut d1 (PC_6);
17
+ DigitalInOut d2 (PB_8);
18
+
15
19
#else
16
20
DigitalInOut d1 (p5);
17
21
DigitalInOut d2 (p25);
Original file line number Diff line number Diff line change 44
44
#define P2_1 (1 << 5 ) // PTC5
45
45
#define P2_2 (1 << 6 ) // PTC6
46
46
#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
47
56
#endif
48
57
49
58
#define MASK_1 (P1_1 | P1_2)
Original file line number Diff line number Diff line change 44
44
#define P2_1 (1 << 5 ) // PTC5
45
45
#define P2_2 (1 << 6 ) // PTC6
46
46
#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
47
56
#endif
48
57
49
58
#define MASK_1 (P1_1 | P1_2)
Original file line number Diff line number Diff line change 3
3
DigitalOut led1 (LED1);
4
4
DigitalOut led2 (LED2);
5
5
6
+ #ifndef TARGET_NUCLEO_F103RB
6
7
Serial computer (USBTX, USBRX);
7
-
8
+ #else
9
+ Serial computer (UART_TX, UART_RX);
10
+ #endif
11
+
8
12
// This function is called when a character goes into the TX buffer.
9
13
void txCallback () {
10
14
led1 = !led1;
Original file line number Diff line number Diff line change 41
41
* digital_loop (Digital(In|Out|InOut), InterruptIn):
42
42
* LPC1*: (p5 <-> p25 )
43
43
* KL25Z: (PTA5<-> PTC6)
44
+ * NUCLEO_F103RB: (PC_6 <-> PB_8)
44
45
45
46
* port_loop (Port(In|Out|InOut)):
46
47
* LPC1*: (p5 <-> p25 ), (p6 <-> p26 )
47
48
* KL25Z: (PTA5 <-> PTC6), (PTA4 <-> PTC5)
49
+ * NUCLEO_F103RB: (PC_6 <-> PB_8), (PC_5 <-> PB_9)
48
50
49
51
* analog_loop (AnalogIn, AnalogOut):
50
52
* LPC1*: (p17 <-> p18 )
You can’t perform that action at this time.
0 commit comments