led.h File Reference

Go to the source code of this file.

Defines

#define LED_OFF   0
#define LED_ON   1
#define LED_FLIP   2
#define LED_ONESHOT   3
#define LED_BLINK   4

Functions

void NutSetLed (HANDLE ledh, uint8_t tim, uint8_t state)
 sets state of a LED
int NutRegisterLed (HANDLE *ledh, int port, int pin)
 register an LED for handling.
void SetLedEvent (uint8_t led, uint32_t interval, uint32_t duration)


Define Documentation

#define LED_OFF   0

Definition at line 50 of file led.h.

#define LED_ON   1

Definition at line 51 of file led.h.

#define LED_FLIP   2

Definition at line 52 of file led.h.

Referenced by NutSetLed().

#define LED_ONESHOT   3

Definition at line 53 of file led.h.

Referenced by NutSetLed(), and sys_led().

#define LED_BLINK   4

Definition at line 54 of file led.h.

Referenced by NutSetLed().


Function Documentation

void NutSetLed ( HANDLE  ledh,
uint8_t  tim,
uint8_t  fxin 
)

sets state of a LED

Parameters:
ledh the handle to the LED that should be controlled.
tim,: interval for blinking or time for oneshot.
fxin,: effect to set
LED_OFFswitch LED off
LED_ONswitch LED on
>LED_FLIPtoggle LED
>LED_BLINKlet LED blink
>LED_ONESHOTlet LED flash one time
Returns:
None.

Definition at line 153 of file led.c.

References GpioPinSet(), IOExpSetBit(), IOXP_PORT0, LED_BLINK, led_evt, LED_FLIP, LED_OFF, LED_ON, LED_ONESHOT, led_tmr, NutThreadCreate(), NutTimerStart(), sys_led(), and TimerCallback().

Referenced by sys_led().

int NutRegisterLed ( HANDLE ledh,
int  bank,
int  pin 
)

register an LED for handling.

Parameters:
ledh the led-handle for accessing the LED through NutSetLed().
bank,: Port of CPU or IO-Expander the LED is connected to.
pin,: Pin at the given port.
Returns:
-1 if registering failed, else 0.

Definition at line 199 of file led.c.

References first_led, InitLED(), malloc, and memset().

void SetLedEvent ( uint8_t  led,
uint32_t  interval,
uint32_t  duration 
)


© 2000-2007 by egnite Software GmbH - visit http://www.ethernut.de/