# LED
[EXTINT]

Driver for LEDS connected to the reference platform used for demo purposes. More...

Collaboration diagram for LED:

## Enumerations
enum | led_name { LED_RED, LED_GREEN, LED_MAX }
| List of available leds. More...
## Functions
void | led_enable ()
| Enable the control of the LEDs.
void | led_disable ()
| Disable the control of the LEDs.
void | led_set (enum led_name led, int state)
| Set the state of a LED.
void | led_toggle (enum led_name led)
| Toggle the state of a LED.
void | led_blink (enum led_name led_idx, int period_ms)
| Set the state of the green LED.

## Detailed Description

Driver for LEDS connected to the reference platform used for demo purposes.

Two LEDS are available (red and green).

## Enumeration Type Documentation

enum led_name

List of available leds.

Enumerator:

  LED_RED | Red led.
  LED_GREEN | Green led.
  LED_MAX | Maximum number of leds.

Definition at line 27 of file led.h.

## Function Documentation

void led_blink | ( | enum led_name | led_idx,
|  | int | period_ms |
| ) |  |  |

Set the state of the green LED.

Blink a LED indefinitely until led_set or led_toggle is called. The led will be switched on for half the period and switched off for the rest. This used software timer, so period lower limit is 100ms.

Parameters:

  `[in]` | led_idx | Led id
  `[in]` | period_ms | Blink period in ms (minimum 100)

void led_disable | ( |  | ) |

Disable the control of the LEDs.

void led_enable | ( |  | ) |

Enable the control of the LEDs.

This function activates the GPIO outputs controlling the LEDs. This function shall be called prior to play with the red and green LED state

void led_set | ( | enum led_name | led,
|  | int | state |
| ) |  |  |

Set the state of a LED.

Parameters:

  `[in]` | led_idx | Led id
  `[in]` | state | Set to 1 to switch on LED, and to 0 to switch it off

void led_toggle | ( | enum led_name | led | ) |

Toggle the state of a LED.

Parameters:

  `[in]` | led_idx | Led id