Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
cm-projects
RIOT
Commits
d9c9c947
Commit
d9c9c947
authored
6 years ago
by
Sebastian Meiling
Browse files
Options
Downloads
Patches
Plain Diff
cpu/cc2538: add debug output in periph/spi
parent
e246c19f
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
cpu/cc2538/periph/spi.c
+10
-0
10 additions, 0 deletions
cpu/cc2538/periph/spi.c
with
10 additions
and
0 deletions
cpu/cc2538/periph/spi.c
+
10
−
0
View file @
d9c9c947
...
...
@@ -29,6 +29,9 @@
#include
"assert.h"
#include
"periph/spi.h"
#define ENABLE_DEBUG (0)
#include
"debug.h"
/**
* @brief Array holding one pre-initialized mutex for each SPI device
*/
...
...
@@ -56,6 +59,8 @@ static inline void poweroff(spi_t bus)
void
spi_init
(
spi_t
bus
)
{
DEBUG
(
"%s: bus=%u
\n
"
,
__FUNCTION__
,
bus
);
assert
(
bus
<
SPI_NUMOF
);
/* init mutex for given bus */
...
...
@@ -75,6 +80,7 @@ void spi_init(spi_t bus)
void
spi_init_pins
(
spi_t
bus
)
{
DEBUG
(
"%s: bus=%u
\n
"
,
__FUNCTION__
,
bus
);
/* select values according to SPI device */
cc2538_ioc_sel_t
txd
=
spi_config
[
bus
].
num
?
SSI1_TXD
:
SSI0_TXD
;
cc2538_ioc_sel_t
clk
=
spi_config
[
bus
].
num
?
SSI1_CLK_OUT
:
SSI0_CLK_OUT
;
...
...
@@ -89,6 +95,7 @@ void spi_init_pins(spi_t bus)
int
spi_acquire
(
spi_t
bus
,
spi_cs_t
cs
,
spi_mode_t
mode
,
spi_clk_t
clk
)
{
DEBUG
(
"%s: bus=%u
\n
"
,
__FUNCTION__
,
bus
);
(
void
)
cs
;
/* lock the bus */
mutex_lock
(
&
locks
[
bus
]);
...
...
@@ -106,6 +113,7 @@ int spi_acquire(spi_t bus, spi_cs_t cs, spi_mode_t mode, spi_clk_t clk)
void
spi_release
(
spi_t
bus
)
{
DEBUG
(
"%s: bus=%u
\n
"
,
__FUNCTION__
,
bus
);
/* disable and power off device */
dev
(
bus
)
->
CR1
=
0
;
poweroff
(
bus
);
...
...
@@ -116,6 +124,8 @@ void spi_release(spi_t bus)
void
spi_transfer_bytes
(
spi_t
bus
,
spi_cs_t
cs
,
bool
cont
,
const
void
*
out
,
void
*
in
,
size_t
len
)
{
DEBUG
(
"%s: bus=%u, len=%u
\n
"
,
__FUNCTION__
,
bus
,
(
unsigned
)
len
);
const
uint8_t
*
out_buf
=
out
;
uint8_t
*
in_buf
=
in
;
...
...
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