/** * This file is part of license combination gpl version 3 license and eCos. * The corresponding license terms are below. * * gpl version 3 Licence: * * The file were developed during the student thesis "Datensammlung in Wireless * Sensor Networks fuer Autonomic Home NetworkingÒ of Thomas Kothmayr and is * included in the dissertation "Secure Data Transmission in Wireless * Sensor Networks" by Corinna Schmitt during employment at the Technische * UniversitŠt MŸnchen, Department Computer Science, Chair Network * Architectures and Services (Germany). * Copyright (C) 2013 * Authors: Thomas Kothmayr and Corinna Schmitt (schmitt[at]net.in.tum.de) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 3 of the License * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * * * eCos Licence: (http://ecos.sourceware.org) * * This file is part of eCos, the Embedded Configurable Operating System. * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, * 2007, 2008, 2009 Free Software Foundation, Inc. * * eCos is free software; you can redistribute it and/or modify it under * the terms of the GNU General Public License as published by the Free * Software Foundation; either version 3 any later version. * * eCos is distributed in the hope that it will be useful, but WITHOUT ANY * WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with eCos; if not, write to the Free Software Foundation, Inc., 51 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * * As a special exception, if other files instantiate templates or use * macros or inline functions from this file, or you compile this file and * link it with other works to produce a work based on this file, this file * does not by itself cause the resulting work to be covered by the GNU * General Public License. However the source code for this file must still * be made available in accordance with section (3) of the GNU General * Public License v2. * * This exception does not invalidate any other reasons why a work based on * this file might be covered by the GNU General Public License. * */ Interface: tos.interfaces.Leds

Interface: tos.interfaces.Leds

interface Leds

Constants for manipulating LEDs.

Author:
Philip Levis
Date:
March 21, 2005

Commands
command uint8_t get() Get the current LED settings as a bitmask.
command void led0Off() Turn off LED 0.
command void led0On() Turn on LED 0.
command void led0Toggle() Toggle LED 0; if it was off, turn it on, if was on, turn it off.
command void led1Off() Turn off LED 1.
command void led1On() Turn on LED 1.
command void led1Toggle() Toggle LED 1; if it was off, turn it on, if was on, turn it off.
command void led2Off() Turn off LED 2.
command void led2On() Turn on LED 2.
command void led2Toggle() Toggle LED 2; if it was off, turn it on, if was on, turn it off.
command void set(uint8_t val) Set the current LED configuration using a bitmask.

Commands - Details

get

command uint8_t get()

Get the current LED settings as a bitmask. Each bit corresponds to whether an LED is on; bit 0 is LED 0, bit 1 is LED 1, etc. You can also use the enums LEDS_LED0, LEDS_LED1. For example, this expression will determine whether LED 2 is on:
 (call Leds.get() & LEDS_LED2) 
This command supports up to 8 LEDs; if a platform has fewer, then those LEDs should always be off (their bit is zero). Also see set().

Returns:
a bitmask describing which LEDs are on and which are off

led0Off

command void led0Off()

Turn off LED 0. The color of this LED depends on the platform.

led0On

command void led0On()

Turn on LED 0. The color of this LED depends on the platform.

led0Toggle

command void led0Toggle()

Toggle LED 0; if it was off, turn it on, if was on, turn it off. The color of this LED depends on the platform.

led1Off

command void led1Off()

Turn off LED 1. The color of this LED depends on the platform.

led1On

command void led1On()

Turn on LED 1. The color of this LED depends on the platform.

led1Toggle

command void led1Toggle()

Toggle LED 1; if it was off, turn it on, if was on, turn it off. The color of this LED depends on the platform.

led2Off

command void led2Off()

Turn off LED 2. The color of this LED depends on the platform.

led2On

command void led2On()

Turn on LED 2. The color of this LED depends on the platform.

led2Toggle

command void led2Toggle()

Toggle LED 2; if it was off, turn it on, if was on, turn it off. The color of this LED depends on the platform.

set

command void set(uint8_t val)

Set the current LED configuration using a bitmask. Each bit corresponds to whether an LED is on; bit 0 is LED 0, bit 1 is LED 1, etc. You can also use the enums LEDS_LED0, LEDS_LED1. For example, this statement will configure the LEDs so LED 0 and LED 2 are on:
 call Leds.set(LEDS_LED0 | LEDS_LED2); 
This statement will turn LED 1 on if it was not already:
call Leds.set(call Leds.get() | LEDS_LED1);

Parameters:
val - a bitmask describing the on/off settings of the LEDs