-ne LED access
Friedrich-Alexander-Universität UnivisSuche FAU-Logo
Techn. Fakultät Willkommen am Department Informatik FAU-Logo
Logo I4
Lehrstuhl für Informatik 4
SPiC
 
  Vorlesung
  Folien
  Übungen
  Dokumentation
  SPiCboard
  Evaluation
  Prüfungsinformationen

  external link Forum
  protected area Intern
Übungen
  Folien
  Aufgaben
  FAQ
Department Informatik  >  Informatik 4  >  Lehre  >  SS 2015  >  SPiC  >  Übung  >  Doku  >  LED access

SPiCboard library (libspicboard, revision 10917) API documentation

Found a bug or something ambiguous? Mail us to get it fixed!

LED access

Interface to the board's 8 LEDs. More...

Files

file  led.h

Enumerations

enum  LED {
  RED0 = 0, YELLOW0 = 1, GREEN0 = 2, BLUE0 = 3,
  RED1 = 4, YELLOW1 = 5, GREEN1 = 6, BLUE1 = 7
}
 LED identifiers. More...

Functions

int8_t sb_led_on (LED led)
 Activates a specific LED.
int8_t sb_led_off (LED led)
 Deactivates a specific LED.
int8_t sb_led_toggle (LED led)
 Toggles a specific LED.
int8_t sb_led_show_level (uint8_t level, uint8_t max)
 Uses the LED array as a level indicator.
void sb_led_set_all_leds (uint8_t setting)
 Sets all LEDs according to a bitfield.

Detailed Description

Interface to the board's 8 LEDs.

Enumeration Type Documentation

enum LED

LED identifiers.

Enumerator:
RED0 
YELLOW0 
GREEN0 
BLUE0 
RED1 
YELLOW1 
GREEN1 
BLUE1 

Function Documentation

int8_t sb_led_off ( LED  led)

Deactivates a specific LED.

Parameters
ledLED ID
Returns
0 on success, negative value on error
Return values
0success
-1invalid LED ID
int8_t sb_led_on ( LED  led)

Activates a specific LED.

Parameters
ledLED ID
Returns
0 on success, negative value on error
Return values
0success
-1invalid LED ID
void sb_led_set_all_leds ( uint8_t  setting)

Sets all LEDs according to a bitfield.

The bitfield contains one bit for each LED. A set bit enables and a cleared bit disables the corresponding LED.

Parameters
setting8-bit bitfield describing the desired LED states
int8_t sb_led_show_level ( uint8_t  level,
uint8_t  max 
)

Uses the LED array as a level indicator.

Allows the array of LEDs to be used as a (fill) level, progress or similar indicator. The 8 LEDs are used to display a ratio of a max-value<=255 in 9 steps.

Parameters
levellevel value
maxmaximum possible value
Returns
the number of LEDs turned on on success, negative value on error
Return values
>=0success
-1level exceeds max
-2max is 0
int8_t sb_led_toggle ( LED  led)

Toggles a specific LED.

Parameters
ledLED ID
Returns
0 on success, negative value on error
Return values
0success
-1invalid LED ID
  Impressum   Datenschutz Stand: 2015-05-06 14:01   MS