Led implementation. More...
Go to the source code of this file.
Macros | |
#define | LED_REDCTRLMASK 0x0F |
Mask to get bit's of red led control. | |
#define | LED_GREENCTRLMASK 0xF0 |
Mask to get bit's of green LED control. | |
#define | LED_REDGET P1OUT & BIT0 |
Read red LED status, 0x01: on; 0x00: off. | |
#define | LED_REDSET P1OUT |= BIT0 |
Turn red LED on. | |
#define | LED_REDCLR P1OUT &= ~BIT0 |
Turn red LED off. | |
#define | LED_GREENGET P1OUT & BIT1 |
Read green LED status, 0x02: on; 0x00: off. | |
#define | LED_GREENSET P1OUT |= BIT1 |
Turn green LED on. | |
#define | LED_GREENCLR P1OUT &= ~BIT1 |
Turn green LED off. | |
Typedefs | |
typedef enum led_state | led_state |
Led state. More... | |
Enumerations | |
enum | led_state { LED_S_IDLE, LED_S_RUNNING } |
Led state. More... | |
Functions | |
void | led_init () |
LED Initialization. More... | |
UInt16 | led_proccess () |
This function processes the tasks of the LED, it controls the red LED. More... | |
void | led_redConfigure (UInt8 n, UInt16 offDelay) |
Configures red led. More... | |
void | led_greenUp () |
Green led up. More... | |
void | led_greenDown () |
Green led down. More... | |
Variables | |
UInt8 | led_control |
led_control has different uses for red and green LEDs. More... | |
UInt16 | led_redCfg |
Configuration of the red LED. More... | |
led_state | led_currentState |
Current state of the LEDs control. | |
Led implementation.
Definition in file led.c.
UInt8 led_control |
led_control has different uses for red and green LEDs.
Red LED use this to determine his next state and delay, while green use to count how many requests it have to be on. Green LED is off only if there is zero requests.
Definition at line 111 of file led.c.
Referenced by led_greenDown(), led_greenUp(), led_init(), and led_proccess().
UInt16 led_redCfg |
Configuration of the red LED.
Last 4 bits (less significant) are the number of times the LED will blink, remaining 12 bits (more significant) are the time (ms) that LED will be off before blink again.
Definition at line 120 of file led.c.
Referenced by led_init(), led_proccess(), and led_redConfigure().