BSPACM  20150113
Board Support Package for ARM Cortex-M Microcontrollers
Typedefs | Functions | Variables
led.h File Reference

Generic interface to LEDs. More...

#include <bspacm/core.h>
#include <bspacm/utility/led_.h>

Go to the source code of this file.

Typedefs

typedef void xBSPACMled
 

Functions

void vBSPACMledConfigure ()
 
static BSPACM_CORE_INLINE_FORCED void vBSPACMledSet (int idx, int mode)
 
static BSPACM_CORE_INLINE_FORCED void vBSPACMledSet_ (int idx, int mode)
 

Variables

const uint8_t nBSPACMleds
 
const xBSPACMled xBSPACMleds []
 

Detailed Description

Generic interface to LEDs.

Homepage
http://github.com/pabigot/bspacm

Typedef Documentation

typedef void xBSPACMled

The type for LED instances.

This is board-specific and non-public; you don't need to reference it.

Function Documentation

void vBSPACMledConfigure ( )

Configure the board LEDs.

This enables any necessary peripheral clocks and configures GPIOs for all LEDs supported by the board.

static BSPACM_CORE_INLINE_FORCED void vBSPACMledSet ( int  idx,
int  mode 
)
static

Set, clear, or toggle an LED identified by its index.

Note
This interface validates the LED index then delegates to vBSPACMledSet_() for the implementation.
Parameters
idxthe index of the LED, from zero to nBSPACMleds-1.
modehow the LED should change: negative values toggle the LED, zero turns it off, and positive values turn it on.
static BSPACM_CORE_INLINE_FORCED void vBSPACMledSet_ ( int  idx,
int  mode 
)
static

Implements the API of vBSPACMledSet() but bypassing the check for a valid idx.

Variable Documentation

const uint8_t nBSPACMleds

The number of LEDs supported on the board

const xBSPACMled xBSPACMleds[]

The array of LED instances.

This is non-public API; do not use this array except through vBSPACMledSet().