File tree Expand file tree Collapse file tree 3 files changed +20
-4
lines changed Expand file tree Collapse file tree 3 files changed +20
-4
lines changed Original file line number Diff line number Diff line change 11
11
12
12
13
13
#if defined(__cplusplus)
14
+
15
+ using namespace arduino ;
16
+
14
17
#include " usb/SerialUSB.h"
15
18
#include " pwm.h"
16
19
#include " Serial.h"
17
20
#endif
18
21
19
-
20
22
#if defined(__cplusplus)
21
23
22
24
#undef F
@@ -171,6 +173,14 @@ extern sciTable_t SciTable[];
171
173
#define digitalPinToPwmPin (P ) (g_APinDescription[P].PWMChannel)
172
174
#define digitalPinToPwmObj (P ) (pwmTable[digitalPinToPwmPin(P)].pwm)
173
175
176
+ #define IOPORT_PRV_PORT_ADDRESS (port_number ) ((uint32_t ) (R_PORT1 - R_PORT0) * (port_number) + R_PORT0)
177
+
178
+ #define digitalPinToPort (P ) (digitalPinToBspPin(P) >> 8 )
179
+ #define digitalPinToBitMask (P ) (1 << (digitalPinToBspPin(P) & 0xFF ))
180
+ #define portOutputRegister (port ) &(((R_PORT0_Type *)IOPORT_PRV_PORT_ADDRESS(port))->PODR)
181
+ #define portInputRegister (port ) &(((R_PORT0_Type *)IOPORT_PRV_PORT_ADDRESS(port))->PIDR)
182
+ #define portModeRegister (port ) &(((R_PORT0_Type *)IOPORT_PRV_PORT_ADDRESS(port))->PDR)
183
+
174
184
void pinPeripheral (bsp_io_port_pin_t bspPin, uint32_t bspPeripheral);
175
185
#if defined(__cplusplus)
176
186
void pinPeripheral (uint32_t pinNumber, uint32_t bspPeripheral);
Original file line number Diff line number Diff line change 13
13
14
14
#include " SPI.h"
15
15
16
+ using namespace arduino ;
17
+
16
18
extern const spi_extended_cfg_t g_spi0_ext_cfg;
17
19
extern const spi_extended_cfg_t g_spi1_ext_cfg;
18
20
extern const sci_spi_extended_cfg_t g_spi2_cfg_extend;
Original file line number Diff line number Diff line change 23
23
// extern const spi_extended_cfg_t g_spi0_ext_cfg;
24
24
// extern const sci_spi_extended_cfg_t g_spi1_cfg_extend;
25
25
26
- class ArduinoSPI : public arduino ::SPIClass
26
+ namespace arduino {
27
+
28
+ class ArduinoSPI : public SPIClass
27
29
{
28
30
public:
29
31
ArduinoSPI (spi_ctrl_t *g_spi_ctrl
@@ -79,14 +81,16 @@ class ArduinoSPI : public arduino::SPIClass
79
81
bool _is_sci;
80
82
};
81
83
84
+ }
85
+
82
86
#if SPI_HOWMANY > 0
83
- extern ArduinoSPI SPI;
87
+ extern arduino:: ArduinoSPI SPI;
84
88
#endif
85
89
#if SPI_HOWMANY > 1
86
90
#ifdef SPI1
87
91
#undef SPI1
88
92
#endif
89
- extern ArduinoSPI SPI1;
93
+ extern arduino:: ArduinoSPI SPI1;
90
94
#endif
91
95
92
96
#endif
You can’t perform that action at this time.
0 commit comments