Merge pull request #7012 from francois-berder/wifire-led
boards: pic32-wifire: Add LEDs support
This commit is contained in:
commit
12a9c5e3b4
@ -47,6 +47,37 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
#define EIC_IRQ (1)
|
#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
|
* @brief Board level initialisation
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -10,6 +10,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"
|
||||||
@ -30,6 +31,16 @@ 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);
|
||||||
|
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 */
|
/* Stop the linker from throwing away the PIC32 config register settings */
|
||||||
dummy();
|
dummy();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user