Llosa de Viango Tollos – mbedLED.c

Introduction

Features

Getting started

Download


Libraries

  Tollos libraries

  Device libraries

    boards

    microcontrollers

    peripherals


Background

  Sample application

  Troubleshooting

mbedLED.c – LED device I/O functions

A function to effect an action on, or query, an LED (assumed to be board-mounted).

LED numbering is arbitrary, but if there is one or more board LEDs then one should be accessible as ‘LED 1’.

If there is only the one LED on the board and documentation suggests that it be called ‘LED 0’ then it is recommended that both num=0 and num=1 map to the same LED.
One function
 ledIO   effect an I/O action on a LED

ledIO – effect an I/O action on a LED

int ledIO(int num, uint action);

num – number of the LED (board-defined)

action – one of LED_ON, LED_OFF, LED_INVERT, or LED_QUERY

returns the previous value of the LED (0 or 1), or −1 if num or action is invalid

This maps the board LEDs as follows:

num=1: LED1

num=2: LED2

num=3: LED3

num=4: LED4

Tollos and these web pages were written by Mike Cowlishaw; Please send me any corrections, suggestions, etc.
All content © Mike Cowlishaw, 2010–2012, except where marked otherwise. All rights reserved. The pages here are for non-commercial use only (see the separate licence for Tollos source code). Privacy policy: the Speleotrove website records no personal information and sets no ‘cookies’. However, statistics, etc. might be recorded by the web hosting service.

This page was last updated on 2010-12-12 by c2wiki.