SAMV71 Xplained Ultra Software Package 1.4

led.h File Reference

#include <stdint.h>

Go to the source code of this file.

Functions

uint32_t LED_Configure (uint32_t dwLed)
uint32_t LED_Set (uint32_t dwLed)
uint32_t LED_Clear (uint32_t dwLed)
uint32_t LED_Toggle (uint32_t dwLed)

Detailed Description

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.

Definition in file led.h.


Function Documentation

uint32_t LED_Clear ( uint32_t  dwLed  ) 

Turns a LED off.

Parameters:
led Number of the LED to turn off.
Returns:
1 if the LED has been turned off; 0 otherwise.

Definition at line 106 of file led.c.

Here is the call graph for this function:

uint32_t LED_Configure ( uint32_t  dwLed  ) 

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

Parameters:
led Number of the LED to configure.
Returns:
1 if the LED exists and has been configured; otherwise 0.

Definition at line 59 of file led.c.

Here is the call graph for this function:

uint32_t LED_Set ( uint32_t  dwLed  ) 

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

Parameters:
led Number of the LED to turn on.
Returns:
1 if the LED has been turned on; 0 otherwise.

Definition at line 79 of file led.c.

Here is the call graph for this function:

uint32_t LED_Toggle ( uint32_t  dwLed  ) 

Toggles the current state of a LED.

Parameters:
led Number of the LED to toggle.
Returns:
1 if the LED has been toggled; otherwise 0.

Definition at line 133 of file led.c.

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines