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
12a9c5e3
Commit
12a9c5e3
authored
7 years ago
by
neiljay
Committed by
GitHub
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #7012 from francois-berder/wifire-led
boards: pic32-wifire: Add LEDs support
parents
7c3601ae
fbf369df
Branches
Branches containing commit
No related tags found
Loading
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
boards/pic32-wifire/include/board.h
+31
-0
31 additions, 0 deletions
boards/pic32-wifire/include/board.h
boards/pic32-wifire/wifire.c
+11
-0
11 additions, 0 deletions
boards/pic32-wifire/wifire.c
with
42 additions
and
0 deletions
boards/pic32-wifire/include/board.h
+
31
−
0
View file @
12a9c5e3
...
...
@@ -47,6 +47,37 @@ extern "C" {
*/
#define EIC_IRQ (1)
/**
* @brief LED pin configuration
* @{
*/
#define LED1_PIN GPIO_PIN(PORT_G, 6)
#define LED2_PIN GPIO_PIN(PORT_D, 4)
#define LED3_PIN GPIO_PIN(PORT_B, 11)
#define LED4_PIN GPIO_PIN(PORT_G, 15)
#define LED1_MASK (1 << 6)
#define LED2_MASK (1 << 4)
#define LED3_MASK (1 << 11)
#define LED4_MASK (1 << 15)
#define LED1_ON (LATGSET = LED1_MASK)
#define LED1_OFF (LATGCLR = LED1_MASK)
#define LED1_TOGGLE (LATGINV = LED1_MASK)
#define LED2_ON (LATDSET = LED2_MASK)
#define LED2_OFF (LATDCLR = LED2_MASK)
#define LED2_TOGGLE (LATDINV = LED2_MASK)
#define LED3_ON (LATBSET = LED3_MASK)
#define LED3_OFF (LATBCLR = LED3_MASK)
#define LED3_TOGGLE (LATBINV = LED3_MASK)
#define LED4_ON (LATGSET = LED4_MASK)
#define LED4_OFF (LATGCLR = LED4_MASK)
#define LED4_TOGGLE (LATGINV = LED4_MASK)
/** @} */
/**
* @brief Board level initialisation
*/
...
...
This diff is collapsed.
Click to expand it.
boards/pic32-wifire/wifire.c
+
11
−
0
View file @
12a9c5e3
...
...
@@ -10,6 +10,7 @@
#include
<stdio.h>
#include
<stdint.h>
#include
"periph/gpio.h"
#include
"periph/uart.h"
#include
"bitarithm.h"
#include
"board.h"
...
...
@@ -30,6 +31,16 @@ void board_init(void)
uart_init
(
DEBUG_VIA_UART
,
DEBUG_UART_BAUD
,
NULL
,
0
);
#endif
/* Turn off all LED's */
gpio_init
(
LED1_PIN
,
GPIO_OUT
);
gpio_init
(
LED2_PIN
,
GPIO_OUT
);
gpio_init
(
LED3_PIN
,
GPIO_OUT
);
gpio_init
(
LED4_PIN
,
GPIO_OUT
);
LED1_OFF
;
LED2_OFF
;
LED3_OFF
;
LED4_OFF
;
/* Stop the linker from throwing away the PIC32 config register settings */
dummy
();
}
...
...
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