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
f33df254
Unverified
Commit
f33df254
authored
May 20, 2024
by
Earle F. Philhower, III
Committed by
GitHub
May 20, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add SPI::setMOSI/setMISO, better match pin names (#2166)
parent
83a6aaca
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
docs/spi.rst
docs/spi.rst
+2
-2
libraries/SPI/src/SPI.h
libraries/SPI/src/SPI.h
+6
-0
No files found.
docs/spi.rst
View file @
f33df254
...
...
@@ -8,10 +8,10 @@ SPI pinouts can be set **before SPI.begin()** using the following calls:
.. code:: cpp
bool setRX(pin_size_t pin);
bool setRX(pin_size_t pin);
// or setMISO()
bool setCS(pin_size_t pin);
bool setSCK(pin_size_t pin);
bool setTX(pin_size_t pin);
bool setTX(pin_size_t pin);
// or setMOSI()
Note that the ``CS`` pin can be hardware or software controlled by the sketch.
When software controlled, the ``setCS()`` call is ignored.
...
...
libraries/SPI/src/SPI.h
View file @
f33df254
...
...
@@ -45,9 +45,15 @@ public:
// Assign pins, call before begin()
bool
setRX
(
pin_size_t
pin
);
inline
bool
setMISO
(
pin_size_t
pin
)
{
return
setRX
(
pin
);
}
bool
setCS
(
pin_size_t
pin
);
bool
setSCK
(
pin_size_t
pin
);
bool
setTX
(
pin_size_t
pin
);
bool
setMOSI
(
pin_size_t
pin
)
{
return
setTX
(
pin
);
}
// Call once to init/deinit SPI class, select pins, etc.
virtual
void
begin
()
override
{
...
...
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