BSP430  20141115
Board Support Package for MSP430 microcontrollers
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
led.h
Go to the documentation of this file.
1 /* Copyright 2012-2014, Peter A. Bigot
2  *
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * * Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  *
11  * * Redistributions in binary form must reproduce the above copyright notice,
12  * this list of conditions and the following disclaimer in the documentation
13  * and/or other materials provided with the distribution.
14  *
15  * * Neither the name of the software nor the names of its contributors may be
16  * used to endorse or promote products derived from this software without
17  * specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  */
31 
40 #ifndef BSP430_UTILITY_LED_H
41 #define BSP430_UTILITY_LED_H
42 
51 #ifndef configBSP430_LED
52 #define configBSP430_LED 1
53 #endif /* configBSP430_LED */
54 
64 #if defined(BSP430_DOXYGEN) || defined(configBSP430_LED)
65 #ifndef BSP430_LED
66 #if (configBSP430_LED - 0)
67 #define BSP430_LED 1
68 #else /* configBSP430_LED */
69 #define BSP430_LED 0
70 #endif /* configBSP430_LED */
71 #endif /* BSP430_LED */
72 #endif /* BSP430_DOXYGEN */
73 
80 #if defined(BSP430_DOXYGEN) || (configBSP430_LED - 0)
81 void vBSP430ledInitialize_ni (void);
82 #else /* BSP430_LED */
83 #define vBSP430ledInitialize_ni() do {} while (0)
84 #endif /* BSP430_LED */
85 
99 #if defined(BSP430_DOXYGEN) || (configBSP430_LED - 0)
100 void vBSP430ledSet (int led_idx,
101  int value);
102 #else /* BSP430_LED */
103 #define vBSP430ledSet(led_idx, value) do { (void)(led_idx); (void)(value); } while (0)
104 #endif /* BSP430_LED */
105 
111 #if defined(BSP430_DOXYGEN) || (configBSP430_LED - 0)
112 int vBSP430ledGet (int led_idx);
113 #else /* BSP430_LED */
114 #define vBSP430ledGet(led_idx) 0
115 #endif /* BSP430_LED */
116 
137 #if defined(BSP430_DOXYGEN)
138 #define BSP430_LED_GREEN include <bsp430/platform.h>
139 #endif /* BSP430_DOXYGEN */
140 
145 #if defined(BSP430_DOXYGEN)
146 #define BSP430_LED_RED include <bsp430/platform.h>
147 #endif /* BSP430_DOXYGEN */
148 
161 #ifndef configBSP430_LED_USE_COMMON
162 #define configBSP430_LED_USE_COMMON 1
163 #endif /* configBSP430_LED_USE_COMMON */
164 
172 typedef struct sBSP430halLED {
174  volatile unsigned char * const outp;
176  unsigned char const bit;
181  unsigned char const flags;
182 } sBSP430halLED;
183 
184 #if (configBSP430_LED_USE_COMMON - 0)
185 
188 extern const sBSP430halLED xBSP430halLED_[];
189 
190 #endif /* configBSP430_LED_USE_COMMON */
191 
197 extern const unsigned char nBSP430led;
198 
199 #endif /* BSP430_UTILITY_LED_H */
unsigned char const flags
Definition: led.h:181
void vBSP430ledSet(int led_idx, int value)
void vBSP430ledInitialize_ni(void)
Definition: led.h:172
struct sBSP430halLED sBSP430halLED
int vBSP430ledGet(int led_idx)
const unsigned char nBSP430led
const sBSP430halLED xBSP430halLED_[]
unsigned char const bit
Definition: led.h:176
volatile unsigned char *const outp
Definition: led.h:174