File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 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)
338338
339339 return 1 ;
340340}
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
119119 using Print::write; // pull in write(str) and write(buf, size) from Print
120120 operator bool () { return true ; }
121121
122+ void setRx (uint32_t _rx);
123+ void setTx (uint32_t _tx);
124+ void setRx (PinName _rx);
125+ void setTx (PinName _tx);
126+
122127 // Interrupt handlers
123128 static void _rx_complete_irq (serial_t * obj);
124129 static int _tx_complete_irq (serial_t * obj);
You can’t perform that action at this time.
0 commit comments