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
21c774fd
Commit
21c774fd
authored
9 years ago
by
Kaspar Schleiser
Browse files
Options
Downloads
Patches
Plain Diff
cpu: saml21: use periph_common SPI functions
parent
0a859b91
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
cpu/saml21/Makefile.include
+3
-0
3 additions, 0 deletions
cpu/saml21/Makefile.include
cpu/saml21/include/periph_cpu.h
+9
-0
9 additions, 0 deletions
cpu/saml21/include/periph_cpu.h
cpu/saml21/periph/spi.c
+0
-35
0 additions, 35 deletions
cpu/saml21/periph/spi.c
with
12 additions
and
35 deletions
cpu/saml21/Makefile.include
+
3
−
0
View file @
21c774fd
...
@@ -6,4 +6,7 @@ export CFLAGS += -DDONT_USE_CMSIS_INIT
...
@@ -6,4 +6,7 @@ export CFLAGS += -DDONT_USE_CMSIS_INIT
# use the hwtimer compatibility module
# use the hwtimer compatibility module
USEMODULE
+=
hwtimer_compat
USEMODULE
+=
hwtimer_compat
# use common periph functions
USEMODULE
+=
periph_common
include
$(RIOTCPU)/Makefile.include.cortexm_common
include
$(RIOTCPU)/Makefile.include.cortexm_common
This diff is collapsed.
Click to expand it.
cpu/saml21/include/periph_cpu.h
+
9
−
0
View file @
21c774fd
...
@@ -87,6 +87,15 @@ typedef enum {
...
@@ -87,6 +87,15 @@ typedef enum {
*/
*/
void
gpio_init_mux
(
gpio_t
dev
,
gpio_mux_t
mux
);
void
gpio_init_mux
(
gpio_t
dev
,
gpio_mux_t
mux
);
/**
* @brief declare needed generic SPI functions
* @{
*/
#define PERIPH_SPI_NEEDS_TRANSFER_BYTES
#define PERIPH_SPI_NEEDS_TRANSFER_REG
#define PERIPH_SPI_NEEDS_TRANSFER_REGS
/** @} */
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
...
...
This diff is collapsed.
Click to expand it.
cpu/saml21/periph/spi.c
+
0
−
35
View file @
21c774fd
...
@@ -219,41 +219,6 @@ int spi_transfer_byte(spi_t dev, char out, char *in)
...
@@ -219,41 +219,6 @@ int spi_transfer_byte(spi_t dev, char out, char *in)
return
1
;
return
1
;
}
}
int
spi_transfer_bytes
(
spi_t
dev
,
char
*
out
,
char
*
in
,
unsigned
int
length
)
{
int
transfered
=
0
;
int
ret
=
0
;
DEBUG
(
"out*: %p out: %x length: %x
\n
"
,
out
,
*
out
,
length
);
while
(
length
--
)
{
if
((
ret
=
spi_transfer_byte
(
dev
,
*
out
,
in
))
<
0
)
{
return
ret
;
}
transfered
+=
ret
;
if
(
out
)
{
out
++
;
}
if
(
in
)
{
in
++
;
}
}
return
transfered
;
}
int
spi_transfer_reg
(
spi_t
dev
,
uint8_t
reg
,
char
out
,
char
*
in
)
{
spi_transfer_byte
(
dev
,
reg
,
NULL
);
return
spi_transfer_byte
(
dev
,
out
,
in
);
}
int
spi_transfer_regs
(
spi_t
dev
,
uint8_t
reg
,
char
*
out
,
char
*
in
,
unsigned
int
length
)
{
spi_transfer_byte
(
dev
,
reg
,
NULL
);
return
spi_transfer_bytes
(
dev
,
out
,
in
,
length
);
}
void
spi_poweron
(
spi_t
dev
)
void
spi_poweron
(
spi_t
dev
)
{
{
SercomSpi
*
spi_dev
=
spi
[
dev
].
dev
;
SercomSpi
*
spi_dev
=
spi
[
dev
].
dev
;
...
...
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