mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
boards/nrf6310: unified LED defines
This commit is contained in:
parent
bedf98984e
commit
355ba3e046
@ -25,8 +25,9 @@
|
||||
|
||||
void board_init(void)
|
||||
{
|
||||
/* setup led(s) for debugging */
|
||||
NRF_GPIO->DIRSET = (LED_RED_MASK | LED_GREEN_MASK | LED_BLUE_MASK);
|
||||
/* initialize and turn off on-board LEDs */
|
||||
NRF_GPIO->DIRSET = (LED0_MASK | LED1_MASK | LED2_MASK);
|
||||
NRF_GPIO->OUTSET = (LED0_MASK | LED1_MASK | LED2_MASK);
|
||||
|
||||
/* initialize the CPU */
|
||||
cpu_init();
|
||||
|
@ -30,30 +30,28 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @name LED pin definitions
|
||||
* @brief LED pin definitions and handlers
|
||||
* @{
|
||||
*/
|
||||
#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)
|
||||
/** @} */
|
||||
#define LED0_PIN GPIO_PIN(0, 8)
|
||||
#define LED1_PIN GPIO_PIN(0, 9)
|
||||
#define LED2_PIN GPIO_PIN(0, 10)
|
||||
|
||||
/**
|
||||
* @name Macros for controlling the on-board LEDs.
|
||||
* @{
|
||||
*/
|
||||
#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)
|
||||
#define LED0_MASK (1 << 8)
|
||||
#define LED1_MASK (1 << 9)
|
||||
#define LED2_MASK (1 << 10)
|
||||
|
||||
#define LED0_ON (NRF_GPIO->OUTCLR = LED0_MASK)
|
||||
#define LED0_OFF (NRF_GPIO->OUTSET = LED0_MASK)
|
||||
#define LED0_TOGGLE (NRF_GPIO->OUT ^= LED0_MASK)
|
||||
|
||||
#define LED1_ON (NRF_GPIO->OUTCLR = LED1_MASK)
|
||||
#define LED1_OFF (NRF_GPIO->OUTSET = LED1_MASK)
|
||||
#define LED1_TOGGLE (NRF_GPIO->OUT ^= LED1_MASK)
|
||||
|
||||
#define LED2_ON (NRF_GPIO->OUTCLR = LED2_MASK)
|
||||
#define LED2_OFF (NRF_GPIO->OUTSET = LED2_MASK)
|
||||
#define LED2_TOGGLE (NRF_GPIO->OUT ^= LED2_MASK)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user