hdo  beta
Funkce
Dokumentace souboru /home/mrazik/Documents/web/old/hdo/at91lib/utility/led.h

Zobrazit zdrojový text tohoto souboru.

Funkce

unsigned char LED_Configure (unsigned int led)
unsigned char LED_Set (unsigned int led)
unsigned char LED_Clear (unsigned int led)
unsigned char LED_Toggle (unsigned int led)

Detailní popis

Purpose

Small set of functions for simple and portable LED usage.

Usage

  1. Configure one or more LEDs using LED_Configure and LED_ConfigureAll.
  2. Set, clear and toggle LEDs using LED_Set, LED_Clear and LED_Toggle.

LEDs are numbered starting from 0; the number of LEDs depend on the board being used. All the functions defined here will compile properly regardless of whether the LED is defined or not; they will simply return 0 when a LED which does not exist is given as an argument. Also, these functions take into account how each LED is connected on to board; thus, "LED_Set" might change the level on the corresponding pin to 0 or 1, but it will always light the LED on; same thing for the other methods.

Definice v souboru led.h.


Dokumentace funkcí

unsigned char LED_Clear ( unsigned int  led)

Turns a LED off.

Parametry:
ledNumber of the LED to turn off.
Návratová hodnota:
1 if the LED has been turned off; 0 otherwise.

Definice je uvedena na řádku 108 v souboru led.c.

Odkazuje se na PIO_OUTPUT_0.

unsigned char LED_Configure ( unsigned int  led)

Configures the pin associated with the given LED number. If the LED does not exist on the board, the function does nothing.

Parametry:
ledNumber of the LED to configure.
Návratová hodnota:
1 if the LED exists and has been configured; otherwise 0.

Definice je uvedena na řádku 57 v souboru led.c.

unsigned char LED_Set ( unsigned int  led)

Turns the given LED on if it exists; otherwise does nothing.

Parametry:
ledNumber of the LED to turn on.
Návratová hodnota:
1 if the LED has been turned on; 0 otherwise.

Definice je uvedena na řádku 78 v souboru led.c.

Odkazuje se na PIO_OUTPUT_0.

unsigned char LED_Toggle ( unsigned int  led)

Toggles the current state of a LED.

Parametry:
ledNumber of the LED to toggle.
Návratová hodnota:
1 if the LED has been toggled; otherwise 0.

Definice je uvedena na řádku 138 v souboru led.c.