Skip to content
Snippets Groups Projects
Commit ed6dc701 authored by Francois Berder's avatar Francois Berder
Browse files

boards: pic32-clicker: Add LEDs support

parent 472eeb00
No related branches found
No related tags found
No related merge requests found
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
*/ */
#include <stdio.h> #include <stdio.h>
#include <stdint.h> #include <stdint.h>
#include "periph/gpio.h"
#include "periph/uart.h" #include "periph/uart.h"
#include "bitarithm.h" #include "bitarithm.h"
#include "board.h" #include "board.h"
...@@ -29,6 +30,12 @@ void board_init(void) ...@@ -29,6 +30,12 @@ void board_init(void)
uart_init(DEBUG_VIA_UART, DEBUG_UART_BAUD, NULL, 0); uart_init(DEBUG_VIA_UART, DEBUG_UART_BAUD, NULL, 0);
#endif #endif
/* Turn off all LED's */
gpio_init(LED1_PIN, GPIO_OUT);
gpio_init(LED2_PIN, GPIO_OUT);
LED1_OFF;
LED2_OFF;
/* Stop the linker from throwing away the PIC32 config register settings */ /* Stop the linker from throwing away the PIC32 config register settings */
dummy(); dummy();
} }
......
...@@ -47,6 +47,25 @@ extern "C" { ...@@ -47,6 +47,25 @@ extern "C" {
*/ */
#define EIC_IRQ (1) #define EIC_IRQ (1)
/**
* @brief LED pin configuration
* @{
*/
#define LED1_PIN GPIO_PIN(PORT_B, 1)
#define LED2_PIN GPIO_PIN(PORT_B, 2)
#define LED1_MASK (1 << 1)
#define LED2_MASK (1 << 2)
#define LED1_ON (LATBSET = LED1_MASK)
#define LED1_OFF (LATBCLR = LED1_MASK)
#define LED1_TOGGLE (LATBINV = LED1_MASK)
#define LED2_ON (LATBSET = LED2_MASK)
#define LED2_OFF (LATBCLR = LED2_MASK)
#define LED2_TOGGLE (LATBINV = LED2_MASK)
/** @} */
/** /**
* @brief Board level initialisation * @brief Board level initialisation
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment