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
10d68c48
Commit
10d68c48
authored
9 years ago
by
Hauke Petersen
Browse files
Options
Downloads
Patches
Plain Diff
boards/nrf51dongle: cleaned up LED handling
parent
5ecb034f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
boards/nrf51dongle/board.c
+2
-2
2 additions, 2 deletions
boards/nrf51dongle/board.c
boards/nrf51dongle/include/board.h
+15
-12
15 additions, 12 deletions
boards/nrf51dongle/include/board.h
with
17 additions
and
14 deletions
boards/nrf51dongle/board.c
+
2
−
2
View file @
10d68c48
...
@@ -24,8 +24,8 @@
...
@@ -24,8 +24,8 @@
void
board_init
(
void
)
void
board_init
(
void
)
{
{
/* initialize the boards LEDs, set pins as output and turn LEDs off */
/* initialize the boards LEDs, set pins as output and turn LEDs off */
NRF_GPIO
->
DIRSET
=
(
LED_RED_
PIN
|
LED_GREEN_
PIN
|
LED_BLUE_
PIN
);
NRF_GPIO
->
DIRSET
=
(
LED_RED_
MASK
|
LED_GREEN_
MASK
|
LED_BLUE_
MASK
);
NRF_GPIO
->
OUTSET
=
(
LED_RED_
PIN
|
LED_GREEN_
PIN
|
LED_BLUE_
PIN
);
NRF_GPIO
->
OUTSET
=
(
LED_RED_
MASK
|
LED_GREEN_
MASK
|
LED_BLUE_
MASK
);
/* initialize the CPU */
/* initialize the CPU */
cpu_init
();
cpu_init
();
}
}
This diff is collapsed.
Click to expand it.
boards/nrf51dongle/include/board.h
+
15
−
12
View file @
10d68c48
...
@@ -32,24 +32,27 @@ extern "C" {
...
@@ -32,24 +32,27 @@ extern "C" {
* @name LED pin definitions
* @name LED pin definitions
* @{
* @{
*/
*/
#define LED_RED_PIN (1 << 21)
#define LED_RED_PIN (GPIO_PIN(0, 21))
#define LED_GREEN_PIN (1 << 22)
#define LED_GREEN_PIN (GPIO_PIN(0, 22))
#define LED_BLUE_PIN (1 << 23)
#define LED_BLUE_PIN (GPIO_PIN(0, 23))
#define LED_RED_MASK (1 << 21)
#define LED_GREEN_MASK (1 << 22)
#define LED_BLUE_MASK (1 << 23)
/** @} */
/** @} */
/**
/**
* @name Macros for controlling the on-board LEDs
* @name Macros for controlling the on-board LEDs
* @{
* @{
*/
*/
#define LED_RED_ON (NRF_GPIO->OUTCLR = LED_RED_
PIN
)
#define LED_RED_ON (NRF_GPIO->OUTCLR = LED_RED_
MASK
)
#define LED_RED_OFF (NRF_GPIO->OUTSET = LED_RED_
PIN
)
#define LED_RED_OFF (NRF_GPIO->OUTSET = LED_RED_
MASK
)
#define LED_RED_TOGGLE (NRF_GPIO->OUT ^= LED_RED_
PIN
)
#define LED_RED_TOGGLE (NRF_GPIO->OUT
^= LED_RED_
MASK
)
#define LED_GREEN_ON (NRF_GPIO->OUTCLR = LED_GREEN_
PIN
)
#define LED_GREEN_ON (NRF_GPIO->OUTCLR = LED_GREEN_
MASK
)
#define LED_GREEN_OFF (NRF_GPIO->OUTSET = LED_GREEN_
PIN
)
#define LED_GREEN_OFF (NRF_GPIO->OUTSET = LED_GREEN_
MASK
)
#define LED_GREEN_TOGGLE (NRF_GPIO->OUT ^= LED_GREEN_
PIN
)
#define LED_GREEN_TOGGLE (NRF_GPIO->OUT
^= LED_GREEN_
MASK
)
#define LED_BLUE_ON (NRF_GPIO->OUTCLR = LED_BLUE_
PIN
)
#define LED_BLUE_ON (NRF_GPIO->OUTCLR = LED_BLUE_
MASK
)
#define LED_BLUE_OFF (NRF_GPIO->OUTSET = LED_BLUE_
PIN
)
#define LED_BLUE_OFF (NRF_GPIO->OUTSET = LED_BLUE_
MASK
)
#define LED_BLUE_TOGGLE (NRF_GPIO->OUT ^= LED_BLUE_
PIN
)
#define LED_BLUE_TOGGLE (NRF_GPIO->OUT
^= LED_BLUE_
MASK
)
/** @} */
/** @} */
/**
/**
...
...
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