Nut/OS  5.0.5
API Reference
LED Control Macros

Functions to drive the XNUT status LED S1 (LED3) and S2 (LED4). More...

Collaboration diagram for LED Control Macros:

Defines

#define LED_S1_OFF()   do {PORTF &= ~_BV(2); PORTF &= ~_BV(3);} while(0)
#define LED_S1_RED()   do {PORTF &= ~_BV(2); PORTF |= _BV(3);} while(0)
#define LED_S1_RED_TOGGLE()   do {PORTF &= ~_BV(2); PORTF ^= _BV(3);} while(0)
#define LED_S1_GREEN()   do {PORTF |= _BV(2); PORTF &= ~_BV(3);} while(0)
#define LED_S1_GREEN_TOGGLE()   do {PORTF ^= _BV(2); PORTF &= ~_BV(3);} while(0)
#define LED_S1_RED_GREEN_TOGGLE()
#define LED_S2_OFF()   do {PORTF &= ~_BV(0); PORTF &= ~_BV(1);} while(0)
#define LED_S2_RED()   do {PORTF &= ~_BV(0); PORTF |= _BV(1);} while(0)
#define LED_S2_RED_TOGGLE()   do {PORTF &= ~_BV(0); PORTF ^= _BV(1);} while(0)
#define LED_S2_GREEN()   do {PORTF |= _BV(0); PORTF &= ~_BV(1);} while(0)
#define LED_S2_GREEN_TOGGLE()   do {PORTF ^= _BV(0); PORTF &= ~_BV(1);} while(0)
#define LED_S2_RED_GREEN_TOGGLE()

Detailed Description

Functions to drive the XNUT status LED S1 (LED3) and S2 (LED4).


Define Documentation

#define LED_S1_OFF ( )    do {PORTF &= ~_BV(2); PORTF &= ~_BV(3);} while(0)

Switch LED S1 off

#define LED_S1_RED ( )    do {PORTF &= ~_BV(2); PORTF |= _BV(3);} while(0)

Switch LED S1 red

#define LED_S1_RED_TOGGLE ( )    do {PORTF &= ~_BV(2); PORTF ^= _BV(3);} while(0)

Toggle LED S1 between red and off

#define LED_S1_GREEN ( )    do {PORTF |= _BV(2); PORTF &= ~_BV(3);} while(0)

Switch LED S1 green

#define LED_S1_GREEN_TOGGLE ( )    do {PORTF ^= _BV(2); PORTF &= ~_BV(3);} while(0)

Toggle LED S1 between green and off

#define LED_S1_RED_GREEN_TOGGLE ( )
Value:
do {PORTF ^= _BV(2); if (bit_is_set(PORTF, 2)) \
   PORTF &= ~_BV(3); else PORTF |= _BV(3);} while(0)
#define LED_S2_OFF ( )    do {PORTF &= ~_BV(0); PORTF &= ~_BV(1);} while(0)

Switch LED S2 off

#define LED_S2_RED ( )    do {PORTF &= ~_BV(0); PORTF |= _BV(1);} while(0)

Switch LED S2 red

#define LED_S2_RED_TOGGLE ( )    do {PORTF &= ~_BV(0); PORTF ^= _BV(1);} while(0)

Toggle LED S2 between red and off

#define LED_S2_GREEN ( )    do {PORTF |= _BV(0); PORTF &= ~_BV(1);} while(0)

Switch LED S2 green

#define LED_S2_GREEN_TOGGLE ( )    do {PORTF ^= _BV(0); PORTF &= ~_BV(1);} while(0)

Toggle LED S2 between green and off

#define LED_S2_RED_GREEN_TOGGLE ( )
Value:
do {PORTF ^= _BV(0); if (bit_is_set(PORTF, 0)) \
   PORTF &= ~_BV(1); else PORTF |= _BV(1);} while(0)