Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Arduino Core for SAMD21 CPU
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
josc941e
Arduino Core for SAMD21 CPU
Commits
c7866bfc
Commit
c7866bfc
authored
10 years ago
by
Cristian Maglie
Committed by
Cristian Maglie
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Added SPI block-transfer method
parent
29bc12e7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/SPI/SPI.h
+9
-0
9 additions, 0 deletions
libraries/SPI/SPI.h
with
9 additions
and
0 deletions
libraries/SPI/SPI.h
+
9
−
0
View file @
c7866bfc
...
...
@@ -318,6 +318,7 @@ class SPIClass {
SPIClass
(
SERCOM
*
p_sercom
,
uint8_t
uc_pinMISO
,
uint8_t
uc_pinSCK
,
uint8_t
uc_pinMOSI
);
byte
transfer
(
uint8_t
data
);
inline
void
transfer
(
void
*
buf
,
size_t
count
);
// Transaction Functions
void
usingInterrupt
(
uint8_t
interruptNumber
);
...
...
@@ -342,6 +343,14 @@ class SPIClass {
uint8_t
_uc_pinSCK
;
};
void
SPIClass
::
transfer
(
void
*
buf
,
size_t
count
)
{
// TODO: Optimize for faster block-transfer
uint8_t
*
buffer
=
reinterpret_cast
<
uint8_t
*>
(
buf
);
for
(
size_t
i
=
0
;
i
<
count
;
i
++
)
buffer
[
i
]
=
transfer
(
buffer
[
i
]);
}
#if SPI_INTERFACES_COUNT > 0
extern
SPIClass
SPI
;
#endif
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment