Llosa de Viango Tollos – pri2LED.c

Introduction

Features

Getting started

Download


Libraries

  Tollos libraries

  Device libraries

    boards

    microcontrollers

    peripherals


Background

  Sample application

  Troubleshooting

pri2LED.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, _OFF, _INVERT, _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=0: LED0

num=1: LED1

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-08 by c2wiki.