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
7d38a180
Commit
7d38a180
authored
9 years ago
by
Hauke Petersen
Browse files
Options
Downloads
Plain Diff
Merge pull request #3946 from kaspar030/add_lpc3287_spi_conf_pins
cpu: lpc2387: add spi_conf_pins()
parents
5df45329
d0ff4946
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/lpc2387/periph/spi.c
+14
-3
14 additions, 3 deletions
cpu/lpc2387/periph/spi.c
with
14 additions
and
3 deletions
cpu/lpc2387/periph/spi.c
+
14
−
3
View file @
7d38a180
...
@@ -105,9 +105,7 @@ int spi_init_master(spi_t dev, spi_conf_t conf, spi_speed_t speed)
...
@@ -105,9 +105,7 @@ int spi_init_master(spi_t dev, spi_conf_t conf, spi_speed_t speed)
PCONP
|=
PCSSP0
;
/* Enable power for SSP0 (default is on)*/
PCONP
|=
PCSSP0
;
/* Enable power for SSP0 (default is on)*/
/* PIN Setup*/
/* PIN Setup*/
PINSEL3
|=
BIT8
+
BIT9
;
/* Set CLK function to SPI*/
spi_conf_pins
(
dev
);
PINSEL3
|=
BIT14
+
BIT15
;
/* Set MISO function to SPI*/
PINSEL3
|=
BIT16
+
BIT17
;
/* Set MOSI function to SPI*/
/* Interface Setup*/
/* Interface Setup*/
SSP0CR0
=
7
;
SSP0CR0
=
7
;
...
@@ -194,4 +192,17 @@ void spi_poweroff(spi_t dev)
...
@@ -194,4 +192,17 @@ void spi_poweroff(spi_t dev)
{
{
}
}
int
spi_conf_pins
(
spi_t
dev
)
{
switch
(
dev
)
{
case
0
:
PINSEL3
|=
BIT8
+
BIT9
;
/* SCLK */
PINSEL3
|=
BIT14
+
BIT15
;
/* MISO */
PINSEL3
|=
BIT16
+
BIT17
;
/* MOSI */
return
0
;
default:
return
-
1
;
}
}
#endif
/* SPI_0_EN */
#endif
/* SPI_0_EN */
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