Committer:
jp
Date:
Sun Feb 13 01:18:38 2011 +0000
Revision:
0:cf255d2aa92f
Child:
1:be3a691c4a56

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jp 0:cf255d2aa92f 1 /*
jp 0:cf255d2aa92f 2 * Copyright or © or Copr. 2010, Thomas SOETE
jp 0:cf255d2aa92f 3 *
jp 0:cf255d2aa92f 4 * MODIFIED BY J.P. ARMSTRONG FROM WWW.MBEDGC.COM
jp 0:cf255d2aa92f 5 *
jp 0:cf255d2aa92f 6 * Author e-mail: thomas@soete.org
jp 0:cf255d2aa92f 7 * Library website : http://mbed.org/users/Alkorin/libraries/SimpleLib/
jp 0:cf255d2aa92f 8 *
jp 0:cf255d2aa92f 9 * This software is governed by the CeCILL license under French law and
jp 0:cf255d2aa92f 10 * abiding by the rules of distribution of free software. You can use,
jp 0:cf255d2aa92f 11 * modify and/ or redistribute the software under the terms of the CeCILL
jp 0:cf255d2aa92f 12 * license as circulated by CEA, CNRS and INRIA at the following URL
jp 0:cf255d2aa92f 13 * "http://www.cecill.info".
jp 0:cf255d2aa92f 14 *
jp 0:cf255d2aa92f 15 * As a counterpart to the access to the source code and rights to copy,
jp 0:cf255d2aa92f 16 * modify and redistribute granted by the license, users are provided only
jp 0:cf255d2aa92f 17 * with a limited warranty and the software's author, the holder of the
jp 0:cf255d2aa92f 18 * economic rights, and the successive licensors have only limited
jp 0:cf255d2aa92f 19 * liability.
jp 0:cf255d2aa92f 20 *
jp 0:cf255d2aa92f 21 * In this respect, the user's attention is drawn to the risks associated
jp 0:cf255d2aa92f 22 * with loading, using, modifying and/or developing or reproducing the
jp 0:cf255d2aa92f 23 * software by the user in light of its specific status of free software,
jp 0:cf255d2aa92f 24 * that may mean that it is complicated to manipulate, and that also
jp 0:cf255d2aa92f 25 * therefore means that it is reserved for developers and experienced
jp 0:cf255d2aa92f 26 * professionals having in-depth computer knowledge. Users are therefore
jp 0:cf255d2aa92f 27 * encouraged to load and test the software's suitability as regards their
jp 0:cf255d2aa92f 28 * requirements in conditions enabling the security of their systems and/or
jp 0:cf255d2aa92f 29 * data to be ensured and, more generally, to use and operate it in the
jp 0:cf255d2aa92f 30 * same conditions as regards security.
jp 0:cf255d2aa92f 31 *
jp 0:cf255d2aa92f 32 * The fact that you are presently reading this means that you have had
jp 0:cf255d2aa92f 33 * knowledge of the CeCILL license and that you accept its terms.
jp 0:cf255d2aa92f 34 */
jp 0:cf255d2aa92f 35
jp 0:cf255d2aa92f 36 #ifndef __SIMPLELIB_LEDS_H__
jp 0:cf255d2aa92f 37 #define __SIMPLELIB_LEDS_H__
jp 0:cf255d2aa92f 38
jp 0:cf255d2aa92f 39 #include "mbed_globals.h"
jp 0:cf255d2aa92f 40
jp 0:cf255d2aa92f 41 /** Bits **/
jp 0:cf255d2aa92f 42 #define COLOR_OFF 0
jp 0:cf255d2aa92f 43 #define RED1 (1 << 16)
jp 0:cf255d2aa92f 44 #define RED2 (1 << 23)
jp 0:cf255d2aa92f 45 #define RED3 (1 << 24)
jp 0:cf255d2aa92f 46 #define GRN1 (1 << 25)
jp 0:cf255d2aa92f 47 #define GRN2 (1 << 9)
jp 0:cf255d2aa92f 48 #define GRN3 (1 << 8)
jp 0:cf255d2aa92f 49
jp 0:cf255d2aa92f 50 #define BLU1 (1 << 7)
jp 0:cf255d2aa92f 51 #define BLU2 (1 << 6)
jp 0:cf255d2aa92f 52
jp 0:cf255d2aa92f 53 #define COLOR_MASK ( RED1 | RED2 | RED3 | GRN1 | GRN2 | GRN3 | BLU1 | BLU2 )
jp 0:cf255d2aa92f 54
jp 0:cf255d2aa92f 55 /** Macros **/
jp 0:cf255d2aa92f 56 #define COLOR_INIT() LPC_GPIO1->FIODIR |= COLOR_MASK;
jp 0:cf255d2aa92f 57
jp 0:cf255d2aa92f 58 #define COLOR_SET(value) do { \
jp 0:cf255d2aa92f 59 LPC_GPIO1->FIOMASK = ~COLOR_MASK; \
jp 0:cf255d2aa92f 60 LPC_GPIO1->FIOPIN = (value); \
jp 0:cf255d2aa92f 61 } while(0)
jp 0:cf255d2aa92f 62
jp 0:cf255d2aa92f 63 #endif