File tree 2 files changed +21
-0
lines changed
2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -338,3 +338,19 @@ size_t HardwareSerial::write(uint8_t c)
338
338
339
339
return 1 ;
340
340
}
341
+
342
+ void HardwareSerial::setRx (uint32_t _rx) {
343
+ _serial.pin_rx = digitalPinToPinName (_rx);
344
+ }
345
+
346
+ void HardwareSerial::setTx (uint32_t _tx) {
347
+ _serial.pin_tx = digitalPinToPinName (_tx);
348
+ }
349
+
350
+ void HardwareSerial::setRx (PinName _rx) {
351
+ _serial.pin_rx = _rx;
352
+ }
353
+
354
+ void HardwareSerial::setTx (PinName _tx){
355
+ _serial.pin_tx = _tx;
356
+ }
Original file line number Diff line number Diff line change @@ -119,6 +119,11 @@ class HardwareSerial : public Stream
119
119
using Print::write; // pull in write(str) and write(buf, size) from Print
120
120
operator bool () { return true ; }
121
121
122
+ void setRx (uint32_t _rx);
123
+ void setTx (uint32_t _tx);
124
+ void setRx (PinName _rx);
125
+ void setTx (PinName _tx);
126
+
122
127
// Interrupt handlers
123
128
static void _rx_complete_irq (serial_t * obj);
124
129
static int _tx_complete_irq (serial_t * obj);
You can’t perform that action at this time.
0 commit comments