00001 #ifndef _LED_H_ 00002 #define _LED_H_ 00003 00004 /* 00005 * Copyright (C) 2009 by Rittal GmbH & Co. KG, 00006 * Ulrich Prinz <prinz.u@rittal.de> All rights reserved. 00007 * 00008 * Redistribution and use in source and binary forms, with or without 00009 * modification, are permitted provided that the following conditions 00010 * are met: 00011 * 00012 * 1. Redistributions of source code must retain the above copyright 00013 * notice, this list of conditions and the following disclaimer. 00014 * 2. Redistributions in binary form must reproduce the above copyright 00015 * notice, this list of conditions and the following disclaimer in the 00016 * documentation and/or other materials provided with the distribution. 00017 * 3. Neither the name of the copyright holders nor the names of 00018 * contributors may be used to endorse or promote products derived 00019 * from this software without specific prior written permission. 00020 * 00021 * THIS SOFTWARE IS PROVIDED BY EMBEDDED IT AND CONTRIBUTORS 00022 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 00023 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 00024 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EMBEDDED IT 00025 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00026 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00027 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 00028 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 00029 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 00030 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 00031 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00032 * 00033 * For additional information see http://www.ethernut.de/ 00034 * 00035 */ 00036 00037 /* 00038 * $Log$ 00039 * 00040 * Revision 0.2 2009/04/13 ulrichprinz 00041 * First checkin, led driver with extra functionality and variable io-access 00042 * (currently SAM7X256 is tested only) 00043 * 00044 */ 00045 00055 00056 #include <stdint.h> 00057 00073 #define LED_OFF 0 00074 00082 #define LED_ON 1 00083 00090 #define LED_FLIP 2 00091 00102 #define LED_BLINK 4 00103 00106 __BEGIN_DECLS 00107 /* Function prototypes. */ 00108 00109 extern void NutSetLed( HANDLE ledh, uint_fast8_t fxin, uint32_t timOn, uint32_t timOff); 00110 extern void SetLedEvent( uint8_t led, uint32_t interval, uint32_t duration ); 00111 00112 extern int NutRegisterLed( HANDLE * ledh, int port, int pin); 00113 00114 __END_DECLS 00115 /* */ 00116 00117 #endif