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
4d2f64a1
Unverified
Commit
4d2f64a1
authored
Aug 31, 2022
by
Earle F. Philhower, III
Committed by
GitHub
Aug 31, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add bidirectional bulk SPI transfer, update SdFAT (#819)
Should speed up SD transfers significantly (2.5x+). See #801
parent
9997461e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
4 deletions
+17
-4
cores/rp2040/api/HardwareSPI.h
cores/rp2040/api/HardwareSPI.h
+13
-0
libraries/ESP8266SdFat
libraries/ESP8266SdFat
+1
-1
libraries/SPI/src/SPI.cpp
libraries/SPI/src/SPI.cpp
+2
-2
libraries/SPI/src/SPI.h
libraries/SPI/src/SPI.h
+1
-1
No files found.
cores/rp2040/api/HardwareSPI.h
View file @
4d2f64a1
...
...
@@ -110,6 +110,19 @@ class HardwareSPI
virtual
uint16_t
transfer16
(
uint16_t
data
)
=
0
;
virtual
void
transfer
(
void
*
buf
,
size_t
count
)
=
0
;
// New transfer API. If either send or recv == nullptr then ignore it
virtual
void
transfer
(
const
void
*
send
,
void
*
recv
,
size_t
count
)
{
const
uint8_t
*
out
=
(
const
uint8_t
*
)
send
;
uint8_t
*
in
=
(
uint8_t
*
)
recv
;
for
(
size_t
i
=
0
;
i
<
count
;
i
++
)
{
uint8_t
t
=
out
?
*
(
out
++
)
:
0xff
;
t
=
transfer
(
t
);
if
(
in
)
{
*
(
in
++
)
=
t
;
}
}
}
// Transaction Functions
virtual
void
usingInterrupt
(
int
interruptNumber
)
=
0
;
virtual
void
notUsingInterrupt
(
int
interruptNumber
)
=
0
;
...
...
ESP8266SdFat
@
255180be
Subproject commit
43a65b42d5a827092188cfe11fb27237da252692
Subproject commit
255180be140d252605f28667078201fba588b968
libraries/SPI/src/SPI.cpp
View file @
4d2f64a1
...
...
@@ -141,13 +141,13 @@ void SPIClassRP2040::transfer(void *buf, size_t count) {
DEBUGSPI
(
"SPI::transfer completed
\n
"
);
}
void
SPIClassRP2040
::
transfer
(
void
*
txbuf
,
void
*
rxbuf
,
size_t
count
)
{
void
SPIClassRP2040
::
transfer
(
const
void
*
txbuf
,
void
*
rxbuf
,
size_t
count
)
{
if
(
!
_initted
)
{
return
;
}
DEBUGSPI
(
"SPI::transfer(%p, %p, %d)
\n
"
,
txbuf
,
rxbuf
,
count
);
uint8_t
*
txbuff
=
reinterpret_cast
<
uint8_t
*>
(
txbuf
);
const
uint8_t
*
txbuff
=
reinterpret_cast
<
const
uint8_t
*>
(
txbuf
);
uint8_t
*
rxbuff
=
reinterpret_cast
<
uint8_t
*>
(
rxbuf
);
// MSB version is easy!
...
...
libraries/SPI/src/SPI.h
View file @
4d2f64a1
...
...
@@ -36,7 +36,7 @@ public:
void
transfer
(
void
*
buf
,
size_t
count
)
override
;
// Sends one buffer and receives into another, much faster! can set rx or txbuf to NULL
void
transfer
(
void
*
txbuf
,
void
*
rxbuf
,
size_t
count
)
;
void
transfer
(
const
void
*
txbuf
,
void
*
rxbuf
,
size_t
count
)
override
;
// Call before/after every complete transaction
void
beginTransaction
(
SPISettings
settings
)
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