Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Skyward Boardcore
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Emilio Corigliano
Skyward Boardcore
Commits
538bd52e
Commit
538bd52e
authored
2 years ago
by
Emilio Corigliano
Browse files
Options
Downloads
Patches
Plain Diff
[SPI] Fixed transmission at low baudrates for the f7 spi busses on APB1
parent
bb19aecc
Branches
tfmicro-dev
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#5725
passed
2 years ago
Stage: build
Stage: test
Stage: lint
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/shared/drivers/spi/SPIBus.h
+30
-0
30 additions, 0 deletions
src/shared/drivers/spi/SPIBus.h
with
30 additions
and
0 deletions
src/shared/drivers/spi/SPIBus.h
+
30
−
0
View file @
538bd52e
...
...
@@ -505,6 +505,12 @@ inline void SPIBus::read16(uint16_t* data, size_t nBytes)
// Write the data item to transmit
spi
->
DR
=
0
;
// Make sure transmission is complete
while
((
spi
->
SR
&
SPI_SR_TXE
)
==
0
)
;
while
((
spi
->
SR
&
SPI_SR_BSY
)
>
0
)
;
// Wait until data is received
while
((
spi
->
SR
&
SPI_SR_RXNE
)
==
0
)
;
...
...
@@ -548,6 +554,12 @@ inline void SPIBus::write16(const uint16_t* data, size_t nBytes)
// Write the data item to transmit
spi
->
DR
=
static_cast
<
uint16_t
>
(
data
[
i
]);
// Make sure transmission is complete
while
((
spi
->
SR
&
SPI_SR_TXE
)
==
0
)
;
while
((
spi
->
SR
&
SPI_SR_BSY
)
>
0
)
;
// Wait until data is received
while
((
spi
->
SR
&
SPI_SR_RXNE
)
==
0
)
;
...
...
@@ -572,6 +584,12 @@ inline uint8_t SPIBus::transfer(uint8_t data)
// Write the data item to transmit
*
(
volatile
uint8_t
*
)
&
spi
->
DR
=
static_cast
<
uint8_t
>
(
data
);
// Make sure transmission is complete
while
((
spi
->
SR
&
SPI_SR_TXE
)
==
0
)
;
while
((
spi
->
SR
&
SPI_SR_BSY
)
>
0
)
;
// Wait until data is received
while
((
spi
->
SR
&
SPI_SR_RXNE
)
==
0
)
;
...
...
@@ -595,6 +613,12 @@ inline uint16_t SPIBus::transfer16(uint16_t data)
// Write the data item to transmit
spi
->
DR
=
static_cast
<
uint16_t
>
(
data
);
// Make sure transmission is complete
while
((
spi
->
SR
&
SPI_SR_TXE
)
==
0
)
;
while
((
spi
->
SR
&
SPI_SR_BSY
)
>
0
)
;
// Wait until data is received
while
((
spi
->
SR
&
SPI_SR_RXNE
)
==
0
)
;
...
...
@@ -647,6 +671,12 @@ inline void SPIBus::transfer16(uint16_t* data, size_t nBytes)
// Write the data item to transmit
spi
->
DR
=
static_cast
<
uint16_t
>
(
data
[
i
]);
// Make sure transmission is complete
while
((
spi
->
SR
&
SPI_SR_TXE
)
==
0
)
;
while
((
spi
->
SR
&
SPI_SR_BSY
)
>
0
)
;
// Wait until data is received
while
((
spi
->
SR
&
SPI_SR_RXNE
)
==
0
)
;
...
...
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