Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
arduino-pico
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
arduino-pico
Commits
061b38f0
Unverified
Commit
061b38f0
authored
Mar 30, 2022
by
Earle F. Philhower, III
Committed by
GitHub
Mar 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add RTS/CTS to Arduino Nano Connect Serial2(NINA) (#525)
Fixes #524
parent
9971bda9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
7 deletions
+18
-7
README.md
README.md
+1
-1
cores/rp2040/SerialUART.cpp
cores/rp2040/SerialUART.cpp
+12
-3
cores/rp2040/SerialUART.h
cores/rp2040/SerialUART.h
+1
-1
variants/arduino_nano_connect/pins_arduino.h
variants/arduino_nano_connect/pins_arduino.h
+4
-2
No files found.
README.md
View file @
061b38f0
...
...
@@ -18,7 +18,7 @@ See https://arduino-pico.readthedocs.io/en/latest/ along with the examples for m
*
Adafruit QTPy RP2040
*
Adafruit STEMMA Friend RP2040
*
Adafruit Trinkey RP2040 QT
*
Arduino Nano RP2040 Connect
(preliminary)
*
Arduino Nano RP2040 Connect
*
Cytron Maker Pi RP2040
*
Cytron Maker Nano RP2040
*
DeRuiLab FlyBoard2040 Core
...
...
cores/rp2040/SerialUART.cpp
View file @
061b38f0
...
...
@@ -114,12 +114,12 @@ bool SerialUART::setFIFOSize(size_t size) {
return
true
;
}
SerialUART
::
SerialUART
(
uart_inst_t
*
uart
,
pin_size_t
tx
,
pin_size_t
rx
)
{
SerialUART
::
SerialUART
(
uart_inst_t
*
uart
,
pin_size_t
tx
,
pin_size_t
rx
,
pin_size_t
rts
,
pin_size_t
cts
)
{
_uart
=
uart
;
_tx
=
tx
;
_rx
=
rx
;
_rts
=
UART_PIN_NOT_DEFINED
;
_cts
=
UART_PIN_NOT_DEFINED
;
_rts
=
rts
;
_cts
=
cts
;
mutex_init
(
&
_mutex
);
mutex_init
(
&
_fifoMutex
);
}
...
...
@@ -339,8 +339,17 @@ SerialUART::operator bool() {
return
_running
;
}
#if defined(PIN_SERIAL1_RTS)
SerialUART
Serial1
(
uart0
,
PIN_SERIAL1_TX
,
PIN_SERIAL1_RX
,
PIN_SERIAL1_RTS
,
PIN_SERIAL1_CTS
);
#else
SerialUART
Serial1
(
uart0
,
PIN_SERIAL1_TX
,
PIN_SERIAL1_RX
);
#endif
#if defined(PIN_SERIAL2_RTS)
SerialUART
Serial2
(
uart1
,
PIN_SERIAL2_TX
,
PIN_SERIAL2_RX
,
PIN_SERIAL2_RTS
,
PIN_SERIAL2_CTS
);
#else
SerialUART
Serial2
(
uart1
,
PIN_SERIAL2_TX
,
PIN_SERIAL2_RX
);
#endif
void
arduino
::
serialEvent1Run
(
void
)
{
if
(
serialEvent1
&&
Serial1
.
available
())
{
...
...
cores/rp2040/SerialUART.h
View file @
061b38f0
...
...
@@ -31,7 +31,7 @@ extern "C" typedef struct uart_inst uart_inst_t;
#define UART_PIN_NOT_DEFINED (255u)
class
SerialUART
:
public
HardwareSerial
{
public:
SerialUART
(
uart_inst_t
*
uart
,
pin_size_t
tx
,
pin_size_t
rx
);
SerialUART
(
uart_inst_t
*
uart
,
pin_size_t
tx
,
pin_size_t
rx
,
pin_size_t
rts
=
UART_PIN_NOT_DEFINED
,
pin_size_t
cts
=
UART_PIN_NOT_DEFINED
);
// Select the pinout. Call before .begin()
bool
setRX
(
pin_size_t
pin
);
...
...
variants/arduino_nano_connect/pins_arduino.h
View file @
061b38f0
...
...
@@ -47,8 +47,10 @@ static const uint8_t A3 = (29u);
#define PIN_SERIAL1_TX (D1)
#define PIN_SERIAL1_RX (D0)
#define PIN_SERIAL2_TX (D25)
#define PIN_SERIAL2_RX (D26)
#define PIN_SERIAL2_TX (D25)
#define PIN_SERIAL2_RX (D26)
#define PIN_SERIAL2_CTS (D27)
#define PIN_SERIAL2_RTS (D28)
// SPI
#define PIN_SPI0_MISO (D12)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment