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
ce57a574
Unverified
Commit
ce57a574
authored
6 years ago
by
Marian Buschsieweke
Browse files
Options
Downloads
Patches
Plain Diff
boards/msbiot: Added support for on-board buttons
parent
d7585e37
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
boards/msbiot/board.c
+10
-6
10 additions, 6 deletions
boards/msbiot/board.c
boards/msbiot/include/board.h
+8
-0
8 additions, 0 deletions
boards/msbiot/include/board.h
with
18 additions
and
6 deletions
boards/msbiot/board.c
+
10
−
6
View file @
ce57a574
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
#include
"board.h"
#include
"board.h"
#include
"periph/gpio.h"
#include
"periph/gpio.h"
static
void
led
s_init
(
void
);
static
void
gpio
s_init
(
void
);
void
board_init
(
void
)
void
board_init
(
void
)
{
{
...
@@ -29,23 +29,27 @@ void board_init(void)
...
@@ -29,23 +29,27 @@ void board_init(void)
cpu_init
();
cpu_init
();
/* initialize the boards LEDs */
/* initialize the boards LEDs */
led
s_init
();
gpio
s_init
();
}
}
/**
/**
* @brief Initialize the board
s standard LEDs (R
ED,
YELLOW, GREEN
)
* @brief Initialize the
on
board
GPIO periphs (3 L
ED
s
,
2 buttons
)
*
*
* The LED initialization is hard-coded in this function. As the LEDs
are soldered
* The LED
and button
initialization is hard-coded in this function. As the LEDs
* onto the board they are fixed to their CPU pins.
*
and buttons are soldered
onto the board they are fixed to their CPU pins.
*
*
* The LEDs are connected to the following pins:
* The LEDs are connected to the following pins:
* - LED RED: PB8
* - LED RED: PB8
* - LED YELLOW: PB14
* - LED YELLOW: PB14
* - LED GREEN: PB15
* - LED GREEN: PB15
* - BUTTON T1: PB13
* - BUTTON T2: PA0
*/
*/
static
void
led
s_init
(
void
)
static
void
gpio
s_init
(
void
)
{
{
gpio_init
(
LED0_PIN
,
GPIO_OUT
);
gpio_init
(
LED0_PIN
,
GPIO_OUT
);
gpio_init
(
LED1_PIN
,
GPIO_OUT
);
gpio_init
(
LED1_PIN
,
GPIO_OUT
);
gpio_init
(
LED2_PIN
,
GPIO_OUT
);
gpio_init
(
LED2_PIN
,
GPIO_OUT
);
gpio_init
(
BUTTON0_PIN
,
GPIO_IN
);
gpio_init
(
BUTTON1_PIN
,
GPIO_IN
);
}
}
This diff is collapsed.
Click to expand it.
boards/msbiot/include/board.h
+
8
−
0
View file @
ce57a574
...
@@ -72,6 +72,14 @@ extern "C" {
...
@@ -72,6 +72,14 @@ extern "C" {
#define LED2_TOGGLE (LED_PORT->ODR ^= LED2_MASK)
#define LED2_TOGGLE (LED_PORT->ODR ^= LED2_MASK)
/** @} */
/** @} */
/**
* @name Button pin definitions
* @{
*/
#define BUTTON0_PIN GPIO_PIN(PORT_B, 13)
#define BUTTON1_PIN GPIO_PIN(PORT_A, 0)
/** @} */
/**
/**
* @brief Initialize board specific hardware, including clock, LEDs and std-IO
* @brief Initialize board specific hardware, including clock, LEDs and std-IO
*/
*/
...
...
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