mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
boards/nrf6310: cleaned up LED handling
This commit is contained in:
parent
10d68c4855
commit
bda005e1d3
@ -26,7 +26,7 @@
|
||||
void board_init(void)
|
||||
{
|
||||
/* setup led(s) for debugging */
|
||||
NRF_GPIO->PIN_CNF[LED_RED_PIN] = GPIO_PIN_CNF_DIR_Output;
|
||||
NRF_GPIO->DIRSET = (LED_RED_MASK | LED_GREEN_MASK | LED_BLUE_MASK);
|
||||
|
||||
/* initialize the CPU */
|
||||
cpu_init();
|
||||
|
@ -33,25 +33,27 @@ extern "C" {
|
||||
* @name LED pin definitions
|
||||
* @{
|
||||
*/
|
||||
#define ONBOARD_LED 1
|
||||
#define LED_RED_PIN (1 << 8)
|
||||
#define LED_GREEN_PIN (1 << 9)
|
||||
#define LED_BLUE_PIN (1 << 10)
|
||||
#define LED_RED_PIN (GPIO_PIN(0, 8))
|
||||
#define LED_GREEN_PIN (GPIO_PIN(0, 9))
|
||||
#define LED_BLUE_PIN (GPIO_PIN(0, 10))
|
||||
#define LED_RED_MASK (1 << 8)
|
||||
#define LED_GREEN_MASK (1 << 9)
|
||||
#define LED_BLUE_MASK (1 << 10)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @name Macros for controlling the on-board LEDs.
|
||||
* @{
|
||||
*/
|
||||
#define LED_RED_ON (NRF_GPIO->OUTCLR = LED_RED_PIN)
|
||||
#define LED_RED_OFF (NRF_GPIO->OUTSET = LED_RED_PIN)
|
||||
#define LED_RED_TOGGLE (NRF_GPIO->OUT ^= LED_RED_PIN)
|
||||
#define LED_GREEN_ON (NRF_GPIO->OUTCLR = LED_GREEN_PIN)
|
||||
#define LED_GREEN_OFF (NRF_GPIO->OUTSET = LED_GREEN_PIN)
|
||||
#define LED_GREEN_TOGGLE (NRF_GPIO->OUT ^= LED_GREEN_PIN)
|
||||
#define LED_BLUE_ON (NRF_GPIO->OUTCLR = LED_BLUE_PIN)
|
||||
#define LED_BLUE_OFF (NRF_GPIO->OUTSET = LED_BLUE_PIN)
|
||||
#define LED_BLUE_TOGGLE (NRF_GPIO->OUT ^= LED_BLUE_PIN)
|
||||
#define LED_RED_ON (NRF_GPIO->OUTCLR = LED_RED_MASK)
|
||||
#define LED_RED_OFF (NRF_GPIO->OUTSET = LED_RED_MASK)
|
||||
#define LED_RED_TOGGLE (NRF_GPIO->OUT ^= LED_RED_MASK)
|
||||
#define LED_GREEN_ON (NRF_GPIO->OUTCLR = LED_GREEN_MASK)
|
||||
#define LED_GREEN_OFF (NRF_GPIO->OUTSET = LED_GREEN_MASK)
|
||||
#define LED_GREEN_TOGGLE (NRF_GPIO->OUT ^= LED_GREEN_MASK)
|
||||
#define LED_BLUE_ON (NRF_GPIO->OUTCLR = LED_BLUE_MASK)
|
||||
#define LED_BLUE_OFF (NRF_GPIO->OUTSET = LED_BLUE_MASK)
|
||||
#define LED_BLUE_TOGGLE (NRF_GPIO->OUT ^= LED_BLUE_MASK)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user