]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/MSP430FR5969_LaunchPad/driverlib/MSP430FR5xx_6xx/gpio.h
0f612ba45c38312e5b4caa087f003a784be90f29
[freertos] / FreeRTOS / Demo / MSP430FR5969_LaunchPad / driverlib / MSP430FR5xx_6xx / gpio.h
1 /* --COPYRIGHT--,BSD\r
2  * Copyright (c) 2014, Texas Instruments Incorporated\r
3  * All rights reserved.\r
4  *\r
5  * Redistribution and use in source and binary forms, with or without\r
6  * modification, are permitted provided that the following conditions\r
7  * are met:\r
8  *\r
9  * *  Redistributions of source code must retain the above copyright\r
10  *    notice, this list of conditions and the following disclaimer.\r
11  *\r
12  * *  Redistributions in binary form must reproduce the above copyright\r
13  *    notice, this list of conditions and the following disclaimer in the\r
14  *    documentation and/or other materials provided with the distribution.\r
15  *\r
16  * *  Neither the name of Texas Instruments Incorporated nor the names of\r
17  *    its contributors may be used to endorse or promote products derived\r
18  *    from this software without specific prior written permission.\r
19  *\r
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,\r
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\r
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\r
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;\r
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\r
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\r
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\r
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
31  * --/COPYRIGHT--*/\r
32 //*****************************************************************************\r
33 //\r
34 // gpio.h - Driver for the GPIO Module.\r
35 //\r
36 //*****************************************************************************\r
37 \r
38 #ifndef __MSP430WARE_GPIO_H__\r
39 #define __MSP430WARE_GPIO_H__\r
40 \r
41 #include "inc/hw_memmap.h"\r
42 \r
43 #if defined(__MSP430_HAS_PORT1_R__) || defined(__MSP430_HAS_PORT2_R__) || \\r
44     defined(__MSP430_HAS_PORTA_R__)\r
45 \r
46 //*****************************************************************************\r
47 //\r
48 // If building with a C++ compiler, make all of the definitions in this header\r
49 // have a C binding.\r
50 //\r
51 //*****************************************************************************\r
52 #ifdef __cplusplus\r
53 extern "C"\r
54 {\r
55 #endif\r
56 \r
57 //*****************************************************************************\r
58 //\r
59 // The following are values that can be passed to the selectedPort parameter\r
60 // for functions: GPIO_setAsOutputPin(), GPIO_setAsInputPin(),\r
61 // GPIO_setAsPeripheralModuleFunctionOutputPin(),\r
62 // GPIO_setAsPeripheralModuleFunctionInputPin(), GPIO_setOutputHighOnPin(),\r
63 // GPIO_setOutputLowOnPin(), GPIO_toggleOutputOnPin(),\r
64 // GPIO_setAsInputPinWithPullDownResistor(),\r
65 // GPIO_setAsInputPinWithPullUpResistor(), GPIO_getInputPinValue(),\r
66 // GPIO_selectInterruptEdge(), GPIO_enableInterrupt(), GPIO_disableInterrupt(),\r
67 // GPIO_getInterruptStatus(), and GPIO_clearInterrupt().\r
68 //\r
69 //*****************************************************************************\r
70 #define GPIO_PORT_P1                                                          1\r
71 #define GPIO_PORT_P2                                                          2\r
72 #define GPIO_PORT_P3                                                          3\r
73 #define GPIO_PORT_P4                                                          4\r
74 #define GPIO_PORT_P5                                                          5\r
75 #define GPIO_PORT_P6                                                          6\r
76 #define GPIO_PORT_P7                                                          7\r
77 #define GPIO_PORT_P8                                                          8\r
78 #define GPIO_PORT_P9                                                          9\r
79 #define GPIO_PORT_P10                                                        10\r
80 #define GPIO_PORT_P11                                                        11\r
81 #define GPIO_PORT_PA                                                          1\r
82 #define GPIO_PORT_PB                                                          3\r
83 #define GPIO_PORT_PC                                                          5\r
84 #define GPIO_PORT_PD                                                          7\r
85 #define GPIO_PORT_PE                                                          9\r
86 #define GPIO_PORT_PF                                                         11\r
87 #define GPIO_PORT_PJ                                                         13\r
88 \r
89 //*****************************************************************************\r
90 //\r
91 // The following are values that can be passed to the selectedPins parameter\r
92 // for functions: GPIO_setAsOutputPin(), GPIO_setAsInputPin(),\r
93 // GPIO_setAsPeripheralModuleFunctionOutputPin(),\r
94 // GPIO_setAsPeripheralModuleFunctionInputPin(), GPIO_setOutputHighOnPin(),\r
95 // GPIO_setOutputLowOnPin(), GPIO_toggleOutputOnPin(),\r
96 // GPIO_setAsInputPinWithPullDownResistor(),\r
97 // GPIO_setAsInputPinWithPullUpResistor(), GPIO_getInputPinValue(),\r
98 // GPIO_enableInterrupt(), GPIO_disableInterrupt(), GPIO_getInterruptStatus(),\r
99 // GPIO_clearInterrupt(), and GPIO_selectInterruptEdge() as well as returned by\r
100 // the GPIO_getInterruptStatus() function.\r
101 //\r
102 //*****************************************************************************\r
103 #define GPIO_PIN0                                                      (0x0001)\r
104 #define GPIO_PIN1                                                      (0x0002)\r
105 #define GPIO_PIN2                                                      (0x0004)\r
106 #define GPIO_PIN3                                                      (0x0008)\r
107 #define GPIO_PIN4                                                      (0x0010)\r
108 #define GPIO_PIN5                                                      (0x0020)\r
109 #define GPIO_PIN6                                                      (0x0040)\r
110 #define GPIO_PIN7                                                      (0x0080)\r
111 #define GPIO_PIN8                                                      (0x0100)\r
112 #define GPIO_PIN9                                                      (0x0200)\r
113 #define GPIO_PIN10                                                     (0x0400)\r
114 #define GPIO_PIN11                                                     (0x0800)\r
115 #define GPIO_PIN12                                                     (0x1000)\r
116 #define GPIO_PIN13                                                     (0x2000)\r
117 #define GPIO_PIN14                                                     (0x4000)\r
118 #define GPIO_PIN15                                                     (0x8000)\r
119 \r
120 //*****************************************************************************\r
121 //\r
122 // The following are values that can be passed to the mode parameter for\r
123 // functions: GPIO_setAsPeripheralModuleFunctionOutputPin(), and\r
124 // GPIO_setAsPeripheralModuleFunctionInputPin().\r
125 //\r
126 //*****************************************************************************\r
127 #define GPIO_PRIMARY_MODULE_FUNCTION                                     (0x01)\r
128 #define GPIO_SECONDARY_MODULE_FUNCTION                                   (0x02)\r
129 #define GPIO_TERNARY_MODULE_FUNCTION                                     (0x03)\r
130 \r
131 //*****************************************************************************\r
132 //\r
133 // The following are values that can be passed to the edgeSelect parameter for\r
134 // functions: GPIO_selectInterruptEdge().\r
135 //\r
136 //*****************************************************************************\r
137 #define GPIO_HIGH_TO_LOW_TRANSITION                                      (0x01)\r
138 #define GPIO_LOW_TO_HIGH_TRANSITION                                      (0x00)\r
139 \r
140 //*****************************************************************************\r
141 //\r
142 // The following are values that can be passed toThe following are values that\r
143 // can be returned by the GPIO_getInputPinValue() function.\r
144 //\r
145 //*****************************************************************************\r
146 #define GPIO_INPUT_PIN_HIGH                                              (0x01)\r
147 #define GPIO_INPUT_PIN_LOW                                               (0x00)\r
148 \r
149 //*****************************************************************************\r
150 //\r
151 // Prototypes for the APIs.\r
152 //\r
153 //*****************************************************************************\r
154 \r
155 //*****************************************************************************\r
156 //\r
157 //! \brief This function configures the selected Pin as output pin\r
158 //!\r
159 //! This function selected pins on a selected port as output pins.\r
160 //!\r
161 //! \param selectedPort is the selected port.\r
162 //!        Valid values are:\r
163 //!        - \b GPIO_PORT_P1\r
164 //!        - \b GPIO_PORT_P2\r
165 //!        - \b GPIO_PORT_P3\r
166 //!        - \b GPIO_PORT_P4\r
167 //!        - \b GPIO_PORT_P5\r
168 //!        - \b GPIO_PORT_P6\r
169 //!        - \b GPIO_PORT_P7\r
170 //!        - \b GPIO_PORT_P8\r
171 //!        - \b GPIO_PORT_P9\r
172 //!        - \b GPIO_PORT_P10\r
173 //!        - \b GPIO_PORT_P11\r
174 //!        - \b GPIO_PORT_PA\r
175 //!        - \b GPIO_PORT_PB\r
176 //!        - \b GPIO_PORT_PC\r
177 //!        - \b GPIO_PORT_PD\r
178 //!        - \b GPIO_PORT_PE\r
179 //!        - \b GPIO_PORT_PF\r
180 //!        - \b GPIO_PORT_PJ\r
181 //! \param selectedPins is the specified pin in the selected port.\r
182 //!        Mask value is the logical OR of any of the following:\r
183 //!        - \b GPIO_PIN0\r
184 //!        - \b GPIO_PIN1\r
185 //!        - \b GPIO_PIN2\r
186 //!        - \b GPIO_PIN3\r
187 //!        - \b GPIO_PIN4\r
188 //!        - \b GPIO_PIN5\r
189 //!        - \b GPIO_PIN6\r
190 //!        - \b GPIO_PIN7\r
191 //!        - \b GPIO_PIN8\r
192 //!        - \b GPIO_PIN9\r
193 //!        - \b GPIO_PIN10\r
194 //!        - \b GPIO_PIN11\r
195 //!        - \b GPIO_PIN12\r
196 //!        - \b GPIO_PIN13\r
197 //!        - \b GPIO_PIN14\r
198 //!        - \b GPIO_PIN15\r
199 //!\r
200 //! Modified bits of \b PxDIR register and bits of \b PxSEL register.\r
201 //!\r
202 //! \return None\r
203 //\r
204 //*****************************************************************************\r
205 extern void GPIO_setAsOutputPin(uint8_t selectedPort,\r
206                                 uint16_t selectedPins);\r
207 \r
208 //*****************************************************************************\r
209 //\r
210 //! \brief This function configures the selected Pin as input pin\r
211 //!\r
212 //! This function selected pins on a selected port as input pins.\r
213 //!\r
214 //! \param selectedPort is the selected port.\r
215 //!        Valid values are:\r
216 //!        - \b GPIO_PORT_P1\r
217 //!        - \b GPIO_PORT_P2\r
218 //!        - \b GPIO_PORT_P3\r
219 //!        - \b GPIO_PORT_P4\r
220 //!        - \b GPIO_PORT_P5\r
221 //!        - \b GPIO_PORT_P6\r
222 //!        - \b GPIO_PORT_P7\r
223 //!        - \b GPIO_PORT_P8\r
224 //!        - \b GPIO_PORT_P9\r
225 //!        - \b GPIO_PORT_P10\r
226 //!        - \b GPIO_PORT_P11\r
227 //!        - \b GPIO_PORT_PA\r
228 //!        - \b GPIO_PORT_PB\r
229 //!        - \b GPIO_PORT_PC\r
230 //!        - \b GPIO_PORT_PD\r
231 //!        - \b GPIO_PORT_PE\r
232 //!        - \b GPIO_PORT_PF\r
233 //!        - \b GPIO_PORT_PJ\r
234 //! \param selectedPins is the specified pin in the selected port.\r
235 //!        Mask value is the logical OR of any of the following:\r
236 //!        - \b GPIO_PIN0\r
237 //!        - \b GPIO_PIN1\r
238 //!        - \b GPIO_PIN2\r
239 //!        - \b GPIO_PIN3\r
240 //!        - \b GPIO_PIN4\r
241 //!        - \b GPIO_PIN5\r
242 //!        - \b GPIO_PIN6\r
243 //!        - \b GPIO_PIN7\r
244 //!        - \b GPIO_PIN8\r
245 //!        - \b GPIO_PIN9\r
246 //!        - \b GPIO_PIN10\r
247 //!        - \b GPIO_PIN11\r
248 //!        - \b GPIO_PIN12\r
249 //!        - \b GPIO_PIN13\r
250 //!        - \b GPIO_PIN14\r
251 //!        - \b GPIO_PIN15\r
252 //!\r
253 //! Modified bits of \b PxDIR register, bits of \b PxREN register and bits of\r
254 //! \b PxSEL register.\r
255 //!\r
256 //! \return None\r
257 //\r
258 //*****************************************************************************\r
259 extern void GPIO_setAsInputPin(uint8_t selectedPort,\r
260                                uint16_t selectedPins);\r
261 \r
262 //*****************************************************************************\r
263 //\r
264 //! \brief This function configures the peripheral module function in the\r
265 //! output direction for the selected pin.\r
266 //!\r
267 //! This function configures the peripheral module function in the output\r
268 //! direction for the selected pin for either primary, secondary or ternary\r
269 //! module function modes. Note that MSP430F5xx/6xx family doesn't support\r
270 //! these function modes.\r
271 //!\r
272 //! \param selectedPort is the selected port.\r
273 //!        Valid values are:\r
274 //!        - \b GPIO_PORT_P1\r
275 //!        - \b GPIO_PORT_P2\r
276 //!        - \b GPIO_PORT_P3\r
277 //!        - \b GPIO_PORT_P4\r
278 //!        - \b GPIO_PORT_P5\r
279 //!        - \b GPIO_PORT_P6\r
280 //!        - \b GPIO_PORT_P7\r
281 //!        - \b GPIO_PORT_P8\r
282 //!        - \b GPIO_PORT_P9\r
283 //!        - \b GPIO_PORT_P10\r
284 //!        - \b GPIO_PORT_P11\r
285 //!        - \b GPIO_PORT_PA\r
286 //!        - \b GPIO_PORT_PB\r
287 //!        - \b GPIO_PORT_PC\r
288 //!        - \b GPIO_PORT_PD\r
289 //!        - \b GPIO_PORT_PE\r
290 //!        - \b GPIO_PORT_PF\r
291 //!        - \b GPIO_PORT_PJ\r
292 //! \param selectedPins is the specified pin in the selected port.\r
293 //!        Mask value is the logical OR of any of the following:\r
294 //!        - \b GPIO_PIN0\r
295 //!        - \b GPIO_PIN1\r
296 //!        - \b GPIO_PIN2\r
297 //!        - \b GPIO_PIN3\r
298 //!        - \b GPIO_PIN4\r
299 //!        - \b GPIO_PIN5\r
300 //!        - \b GPIO_PIN6\r
301 //!        - \b GPIO_PIN7\r
302 //!        - \b GPIO_PIN8\r
303 //!        - \b GPIO_PIN9\r
304 //!        - \b GPIO_PIN10\r
305 //!        - \b GPIO_PIN11\r
306 //!        - \b GPIO_PIN12\r
307 //!        - \b GPIO_PIN13\r
308 //!        - \b GPIO_PIN14\r
309 //!        - \b GPIO_PIN15\r
310 //! \param mode is the specified mode that the pin should be configured for the\r
311 //!        module function.\r
312 //!        Valid values are:\r
313 //!        - \b GPIO_PRIMARY_MODULE_FUNCTION\r
314 //!        - \b GPIO_SECONDARY_MODULE_FUNCTION\r
315 //!        - \b GPIO_TERNARY_MODULE_FUNCTION\r
316 //!\r
317 //! Modified bits of \b PxDIR register and bits of \b PxSEL register.\r
318 //!\r
319 //! \return None\r
320 //\r
321 //*****************************************************************************\r
322 extern void GPIO_setAsPeripheralModuleFunctionOutputPin(uint8_t selectedPort,\r
323                                                         uint16_t selectedPins,\r
324                                                         uint8_t mode);\r
325 \r
326 //*****************************************************************************\r
327 //\r
328 //! \brief This function configures the peripheral module function in the input\r
329 //! direction for the selected pin.\r
330 //!\r
331 //! This function configures the peripheral module function in the input\r
332 //! direction for the selected pin for either primary, secondary or ternary\r
333 //! module function modes. Note that MSP430F5xx/6xx family doesn't support\r
334 //! these function modes.\r
335 //!\r
336 //! \param selectedPort is the selected port.\r
337 //!        Valid values are:\r
338 //!        - \b GPIO_PORT_P1\r
339 //!        - \b GPIO_PORT_P2\r
340 //!        - \b GPIO_PORT_P3\r
341 //!        - \b GPIO_PORT_P4\r
342 //!        - \b GPIO_PORT_P5\r
343 //!        - \b GPIO_PORT_P6\r
344 //!        - \b GPIO_PORT_P7\r
345 //!        - \b GPIO_PORT_P8\r
346 //!        - \b GPIO_PORT_P9\r
347 //!        - \b GPIO_PORT_P10\r
348 //!        - \b GPIO_PORT_P11\r
349 //!        - \b GPIO_PORT_PA\r
350 //!        - \b GPIO_PORT_PB\r
351 //!        - \b GPIO_PORT_PC\r
352 //!        - \b GPIO_PORT_PD\r
353 //!        - \b GPIO_PORT_PE\r
354 //!        - \b GPIO_PORT_PF\r
355 //!        - \b GPIO_PORT_PJ\r
356 //! \param selectedPins is the specified pin in the selected port.\r
357 //!        Mask value is the logical OR of any of the following:\r
358 //!        - \b GPIO_PIN0\r
359 //!        - \b GPIO_PIN1\r
360 //!        - \b GPIO_PIN2\r
361 //!        - \b GPIO_PIN3\r
362 //!        - \b GPIO_PIN4\r
363 //!        - \b GPIO_PIN5\r
364 //!        - \b GPIO_PIN6\r
365 //!        - \b GPIO_PIN7\r
366 //!        - \b GPIO_PIN8\r
367 //!        - \b GPIO_PIN9\r
368 //!        - \b GPIO_PIN10\r
369 //!        - \b GPIO_PIN11\r
370 //!        - \b GPIO_PIN12\r
371 //!        - \b GPIO_PIN13\r
372 //!        - \b GPIO_PIN14\r
373 //!        - \b GPIO_PIN15\r
374 //! \param mode is the specified mode that the pin should be configured for the\r
375 //!        module function.\r
376 //!        Valid values are:\r
377 //!        - \b GPIO_PRIMARY_MODULE_FUNCTION\r
378 //!        - \b GPIO_SECONDARY_MODULE_FUNCTION\r
379 //!        - \b GPIO_TERNARY_MODULE_FUNCTION\r
380 //!\r
381 //! Modified bits of \b PxDIR register and bits of \b PxSEL register.\r
382 //!\r
383 //! \return None\r
384 //\r
385 //*****************************************************************************\r
386 extern void GPIO_setAsPeripheralModuleFunctionInputPin(uint8_t selectedPort,\r
387                                                        uint16_t selectedPins,\r
388                                                        uint8_t mode);\r
389 \r
390 //*****************************************************************************\r
391 //\r
392 //! \brief This function sets output HIGH on the selected Pin\r
393 //!\r
394 //! This function sets output HIGH on the selected port's pin.\r
395 //!\r
396 //! \param selectedPort is the selected port.\r
397 //!        Valid values are:\r
398 //!        - \b GPIO_PORT_P1\r
399 //!        - \b GPIO_PORT_P2\r
400 //!        - \b GPIO_PORT_P3\r
401 //!        - \b GPIO_PORT_P4\r
402 //!        - \b GPIO_PORT_P5\r
403 //!        - \b GPIO_PORT_P6\r
404 //!        - \b GPIO_PORT_P7\r
405 //!        - \b GPIO_PORT_P8\r
406 //!        - \b GPIO_PORT_P9\r
407 //!        - \b GPIO_PORT_P10\r
408 //!        - \b GPIO_PORT_P11\r
409 //!        - \b GPIO_PORT_PA\r
410 //!        - \b GPIO_PORT_PB\r
411 //!        - \b GPIO_PORT_PC\r
412 //!        - \b GPIO_PORT_PD\r
413 //!        - \b GPIO_PORT_PE\r
414 //!        - \b GPIO_PORT_PF\r
415 //!        - \b GPIO_PORT_PJ\r
416 //! \param selectedPins is the specified pin in the selected port.\r
417 //!        Mask value is the logical OR of any of the following:\r
418 //!        - \b GPIO_PIN0\r
419 //!        - \b GPIO_PIN1\r
420 //!        - \b GPIO_PIN2\r
421 //!        - \b GPIO_PIN3\r
422 //!        - \b GPIO_PIN4\r
423 //!        - \b GPIO_PIN5\r
424 //!        - \b GPIO_PIN6\r
425 //!        - \b GPIO_PIN7\r
426 //!        - \b GPIO_PIN8\r
427 //!        - \b GPIO_PIN9\r
428 //!        - \b GPIO_PIN10\r
429 //!        - \b GPIO_PIN11\r
430 //!        - \b GPIO_PIN12\r
431 //!        - \b GPIO_PIN13\r
432 //!        - \b GPIO_PIN14\r
433 //!        - \b GPIO_PIN15\r
434 //!\r
435 //! Modified bits of \b PxOUT register.\r
436 //!\r
437 //! \return None\r
438 //\r
439 //*****************************************************************************\r
440 extern void GPIO_setOutputHighOnPin(uint8_t selectedPort,\r
441                                     uint16_t selectedPins);\r
442 \r
443 //*****************************************************************************\r
444 //\r
445 //! \brief This function sets output LOW on the selected Pin\r
446 //!\r
447 //! This function sets output LOW on the selected port's pin.\r
448 //!\r
449 //! \param selectedPort is the selected port.\r
450 //!        Valid values are:\r
451 //!        - \b GPIO_PORT_P1\r
452 //!        - \b GPIO_PORT_P2\r
453 //!        - \b GPIO_PORT_P3\r
454 //!        - \b GPIO_PORT_P4\r
455 //!        - \b GPIO_PORT_P5\r
456 //!        - \b GPIO_PORT_P6\r
457 //!        - \b GPIO_PORT_P7\r
458 //!        - \b GPIO_PORT_P8\r
459 //!        - \b GPIO_PORT_P9\r
460 //!        - \b GPIO_PORT_P10\r
461 //!        - \b GPIO_PORT_P11\r
462 //!        - \b GPIO_PORT_PA\r
463 //!        - \b GPIO_PORT_PB\r
464 //!        - \b GPIO_PORT_PC\r
465 //!        - \b GPIO_PORT_PD\r
466 //!        - \b GPIO_PORT_PE\r
467 //!        - \b GPIO_PORT_PF\r
468 //!        - \b GPIO_PORT_PJ\r
469 //! \param selectedPins is the specified pin in the selected port.\r
470 //!        Mask value is the logical OR of any of the following:\r
471 //!        - \b GPIO_PIN0\r
472 //!        - \b GPIO_PIN1\r
473 //!        - \b GPIO_PIN2\r
474 //!        - \b GPIO_PIN3\r
475 //!        - \b GPIO_PIN4\r
476 //!        - \b GPIO_PIN5\r
477 //!        - \b GPIO_PIN6\r
478 //!        - \b GPIO_PIN7\r
479 //!        - \b GPIO_PIN8\r
480 //!        - \b GPIO_PIN9\r
481 //!        - \b GPIO_PIN10\r
482 //!        - \b GPIO_PIN11\r
483 //!        - \b GPIO_PIN12\r
484 //!        - \b GPIO_PIN13\r
485 //!        - \b GPIO_PIN14\r
486 //!        - \b GPIO_PIN15\r
487 //!\r
488 //! Modified bits of \b PxOUT register.\r
489 //!\r
490 //! \return None\r
491 //\r
492 //*****************************************************************************\r
493 extern void GPIO_setOutputLowOnPin(uint8_t selectedPort,\r
494                                    uint16_t selectedPins);\r
495 \r
496 //*****************************************************************************\r
497 //\r
498 //! \brief This function toggles the output on the selected Pin\r
499 //!\r
500 //! This function toggles the output on the selected port's pin.\r
501 //!\r
502 //! \param selectedPort is the selected port.\r
503 //!        Valid values are:\r
504 //!        - \b GPIO_PORT_P1\r
505 //!        - \b GPIO_PORT_P2\r
506 //!        - \b GPIO_PORT_P3\r
507 //!        - \b GPIO_PORT_P4\r
508 //!        - \b GPIO_PORT_P5\r
509 //!        - \b GPIO_PORT_P6\r
510 //!        - \b GPIO_PORT_P7\r
511 //!        - \b GPIO_PORT_P8\r
512 //!        - \b GPIO_PORT_P9\r
513 //!        - \b GPIO_PORT_P10\r
514 //!        - \b GPIO_PORT_P11\r
515 //!        - \b GPIO_PORT_PA\r
516 //!        - \b GPIO_PORT_PB\r
517 //!        - \b GPIO_PORT_PC\r
518 //!        - \b GPIO_PORT_PD\r
519 //!        - \b GPIO_PORT_PE\r
520 //!        - \b GPIO_PORT_PF\r
521 //!        - \b GPIO_PORT_PJ\r
522 //! \param selectedPins is the specified pin in the selected port.\r
523 //!        Mask value is the logical OR of any of the following:\r
524 //!        - \b GPIO_PIN0\r
525 //!        - \b GPIO_PIN1\r
526 //!        - \b GPIO_PIN2\r
527 //!        - \b GPIO_PIN3\r
528 //!        - \b GPIO_PIN4\r
529 //!        - \b GPIO_PIN5\r
530 //!        - \b GPIO_PIN6\r
531 //!        - \b GPIO_PIN7\r
532 //!        - \b GPIO_PIN8\r
533 //!        - \b GPIO_PIN9\r
534 //!        - \b GPIO_PIN10\r
535 //!        - \b GPIO_PIN11\r
536 //!        - \b GPIO_PIN12\r
537 //!        - \b GPIO_PIN13\r
538 //!        - \b GPIO_PIN14\r
539 //!        - \b GPIO_PIN15\r
540 //!\r
541 //! Modified bits of \b PxOUT register.\r
542 //!\r
543 //! \return None\r
544 //\r
545 //*****************************************************************************\r
546 extern void GPIO_toggleOutputOnPin(uint8_t selectedPort,\r
547                                    uint16_t selectedPins);\r
548 \r
549 //*****************************************************************************\r
550 //\r
551 //! \brief This function sets the selected Pin in input Mode with Pull Down\r
552 //! resistor\r
553 //!\r
554 //! This function sets the selected Pin in input Mode with Pull Down resistor.\r
555 //!\r
556 //! \param selectedPort is the selected port.\r
557 //!        Valid values are:\r
558 //!        - \b GPIO_PORT_P1\r
559 //!        - \b GPIO_PORT_P2\r
560 //!        - \b GPIO_PORT_P3\r
561 //!        - \b GPIO_PORT_P4\r
562 //!        - \b GPIO_PORT_P5\r
563 //!        - \b GPIO_PORT_P6\r
564 //!        - \b GPIO_PORT_P7\r
565 //!        - \b GPIO_PORT_P8\r
566 //!        - \b GPIO_PORT_P9\r
567 //!        - \b GPIO_PORT_P10\r
568 //!        - \b GPIO_PORT_P11\r
569 //!        - \b GPIO_PORT_PA\r
570 //!        - \b GPIO_PORT_PB\r
571 //!        - \b GPIO_PORT_PC\r
572 //!        - \b GPIO_PORT_PD\r
573 //!        - \b GPIO_PORT_PE\r
574 //!        - \b GPIO_PORT_PF\r
575 //!        - \b GPIO_PORT_PJ\r
576 //! \param selectedPins is the specified pin in the selected port.\r
577 //!        Mask value is the logical OR of any of the following:\r
578 //!        - \b GPIO_PIN0\r
579 //!        - \b GPIO_PIN1\r
580 //!        - \b GPIO_PIN2\r
581 //!        - \b GPIO_PIN3\r
582 //!        - \b GPIO_PIN4\r
583 //!        - \b GPIO_PIN5\r
584 //!        - \b GPIO_PIN6\r
585 //!        - \b GPIO_PIN7\r
586 //!        - \b GPIO_PIN8\r
587 //!        - \b GPIO_PIN9\r
588 //!        - \b GPIO_PIN10\r
589 //!        - \b GPIO_PIN11\r
590 //!        - \b GPIO_PIN12\r
591 //!        - \b GPIO_PIN13\r
592 //!        - \b GPIO_PIN14\r
593 //!        - \b GPIO_PIN15\r
594 //!\r
595 //! Modified bits of \b PxDIR register, bits of \b PxOUT register and bits of\r
596 //! \b PxREN register.\r
597 //!\r
598 //! \return None\r
599 //\r
600 //*****************************************************************************\r
601 extern void GPIO_setAsInputPinWithPullDownResistor(uint8_t selectedPort,\r
602                                                    uint16_t selectedPins);\r
603 \r
604 //*****************************************************************************\r
605 //\r
606 //! \brief This function sets the selected Pin in input Mode with Pull Up\r
607 //! resistor\r
608 //!\r
609 //! This function sets the selected Pin in input Mode with Pull Up resistor.\r
610 //!\r
611 //! \param selectedPort is the selected port.\r
612 //!        Valid values are:\r
613 //!        - \b GPIO_PORT_P1\r
614 //!        - \b GPIO_PORT_P2\r
615 //!        - \b GPIO_PORT_P3\r
616 //!        - \b GPIO_PORT_P4\r
617 //!        - \b GPIO_PORT_P5\r
618 //!        - \b GPIO_PORT_P6\r
619 //!        - \b GPIO_PORT_P7\r
620 //!        - \b GPIO_PORT_P8\r
621 //!        - \b GPIO_PORT_P9\r
622 //!        - \b GPIO_PORT_P10\r
623 //!        - \b GPIO_PORT_P11\r
624 //!        - \b GPIO_PORT_PA\r
625 //!        - \b GPIO_PORT_PB\r
626 //!        - \b GPIO_PORT_PC\r
627 //!        - \b GPIO_PORT_PD\r
628 //!        - \b GPIO_PORT_PE\r
629 //!        - \b GPIO_PORT_PF\r
630 //!        - \b GPIO_PORT_PJ\r
631 //! \param selectedPins is the specified pin in the selected port.\r
632 //!        Mask value is the logical OR of any of the following:\r
633 //!        - \b GPIO_PIN0\r
634 //!        - \b GPIO_PIN1\r
635 //!        - \b GPIO_PIN2\r
636 //!        - \b GPIO_PIN3\r
637 //!        - \b GPIO_PIN4\r
638 //!        - \b GPIO_PIN5\r
639 //!        - \b GPIO_PIN6\r
640 //!        - \b GPIO_PIN7\r
641 //!        - \b GPIO_PIN8\r
642 //!        - \b GPIO_PIN9\r
643 //!        - \b GPIO_PIN10\r
644 //!        - \b GPIO_PIN11\r
645 //!        - \b GPIO_PIN12\r
646 //!        - \b GPIO_PIN13\r
647 //!        - \b GPIO_PIN14\r
648 //!        - \b GPIO_PIN15\r
649 //!\r
650 //! Modified bits of \b PxDIR register, bits of \b PxOUT register and bits of\r
651 //! \b PxREN register.\r
652 //!\r
653 //! \return None\r
654 //\r
655 //*****************************************************************************\r
656 extern void GPIO_setAsInputPinWithPullUpResistor(uint8_t selectedPort,\r
657                                                  uint16_t selectedPins);\r
658 \r
659 //*****************************************************************************\r
660 //\r
661 //! \brief This function gets the input value on the selected pin\r
662 //!\r
663 //! This function gets the input value on the selected pin.\r
664 //!\r
665 //! \param selectedPort is the selected port.\r
666 //!        Valid values are:\r
667 //!        - \b GPIO_PORT_P1\r
668 //!        - \b GPIO_PORT_P2\r
669 //!        - \b GPIO_PORT_P3\r
670 //!        - \b GPIO_PORT_P4\r
671 //!        - \b GPIO_PORT_P5\r
672 //!        - \b GPIO_PORT_P6\r
673 //!        - \b GPIO_PORT_P7\r
674 //!        - \b GPIO_PORT_P8\r
675 //!        - \b GPIO_PORT_P9\r
676 //!        - \b GPIO_PORT_P10\r
677 //!        - \b GPIO_PORT_P11\r
678 //!        - \b GPIO_PORT_PA\r
679 //!        - \b GPIO_PORT_PB\r
680 //!        - \b GPIO_PORT_PC\r
681 //!        - \b GPIO_PORT_PD\r
682 //!        - \b GPIO_PORT_PE\r
683 //!        - \b GPIO_PORT_PF\r
684 //!        - \b GPIO_PORT_PJ\r
685 //! \param selectedPins is the specified pin in the selected port.\r
686 //!        Valid values are:\r
687 //!        - \b GPIO_PIN0\r
688 //!        - \b GPIO_PIN1\r
689 //!        - \b GPIO_PIN2\r
690 //!        - \b GPIO_PIN3\r
691 //!        - \b GPIO_PIN4\r
692 //!        - \b GPIO_PIN5\r
693 //!        - \b GPIO_PIN6\r
694 //!        - \b GPIO_PIN7\r
695 //!        - \b GPIO_PIN8\r
696 //!        - \b GPIO_PIN9\r
697 //!        - \b GPIO_PIN10\r
698 //!        - \b GPIO_PIN11\r
699 //!        - \b GPIO_PIN12\r
700 //!        - \b GPIO_PIN13\r
701 //!        - \b GPIO_PIN14\r
702 //!        - \b GPIO_PIN15\r
703 //!\r
704 //! \return One of the following:\r
705 //!         - \b GPIO_INPUT_PIN_HIGH\r
706 //!         - \b GPIO_INPUT_PIN_LOW\r
707 //!         \n indicating the status of the pin\r
708 //\r
709 //*****************************************************************************\r
710 extern uint8_t GPIO_getInputPinValue(uint8_t selectedPort,\r
711                                      uint16_t selectedPins);\r
712 \r
713 //*****************************************************************************\r
714 //\r
715 //! \brief This function enables the port interrupt on the selected pin\r
716 //!\r
717 //! This function enables the port interrupt on the selected pin. Please refer\r
718 //! to family user's guide for available ports with interrupt capability.\r
719 //!\r
720 //! \param selectedPort is the selected port.\r
721 //!        Valid values are:\r
722 //!        - \b GPIO_PORT_P1\r
723 //!        - \b GPIO_PORT_P2\r
724 //!        - \b GPIO_PORT_P3\r
725 //!        - \b GPIO_PORT_P4\r
726 //!        - \b GPIO_PORT_P5\r
727 //!        - \b GPIO_PORT_P6\r
728 //!        - \b GPIO_PORT_P7\r
729 //!        - \b GPIO_PORT_P8\r
730 //!        - \b GPIO_PORT_P9\r
731 //!        - \b GPIO_PORT_P10\r
732 //!        - \b GPIO_PORT_P11\r
733 //!        - \b GPIO_PORT_PA\r
734 //!        - \b GPIO_PORT_PB\r
735 //!        - \b GPIO_PORT_PC\r
736 //!        - \b GPIO_PORT_PD\r
737 //!        - \b GPIO_PORT_PE\r
738 //!        - \b GPIO_PORT_PF\r
739 //!        - \b GPIO_PORT_PJ\r
740 //! \param selectedPins is the specified pin in the selected port.\r
741 //!        Mask value is the logical OR of any of the following:\r
742 //!        - \b GPIO_PIN0\r
743 //!        - \b GPIO_PIN1\r
744 //!        - \b GPIO_PIN2\r
745 //!        - \b GPIO_PIN3\r
746 //!        - \b GPIO_PIN4\r
747 //!        - \b GPIO_PIN5\r
748 //!        - \b GPIO_PIN6\r
749 //!        - \b GPIO_PIN7\r
750 //!        - \b GPIO_PIN8\r
751 //!        - \b GPIO_PIN9\r
752 //!        - \b GPIO_PIN10\r
753 //!        - \b GPIO_PIN11\r
754 //!        - \b GPIO_PIN12\r
755 //!        - \b GPIO_PIN13\r
756 //!        - \b GPIO_PIN14\r
757 //!        - \b GPIO_PIN15\r
758 //!\r
759 //! Modified bits of \b PxIE register.\r
760 //!\r
761 //! \return None\r
762 //\r
763 //*****************************************************************************\r
764 extern void GPIO_enableInterrupt(uint8_t selectedPort,\r
765                                  uint16_t selectedPins);\r
766 \r
767 //*****************************************************************************\r
768 //\r
769 //! \brief This function disables the port interrupt on the selected pin\r
770 //!\r
771 //! This function disables the port interrupt on the selected pin. Please refer\r
772 //! to family user's guide for available ports with interrupt capability.\r
773 //!\r
774 //! \param selectedPort is the selected port.\r
775 //!        Valid values are:\r
776 //!        - \b GPIO_PORT_P1\r
777 //!        - \b GPIO_PORT_P2\r
778 //!        - \b GPIO_PORT_P3\r
779 //!        - \b GPIO_PORT_P4\r
780 //!        - \b GPIO_PORT_P5\r
781 //!        - \b GPIO_PORT_P6\r
782 //!        - \b GPIO_PORT_P7\r
783 //!        - \b GPIO_PORT_P8\r
784 //!        - \b GPIO_PORT_P9\r
785 //!        - \b GPIO_PORT_P10\r
786 //!        - \b GPIO_PORT_P11\r
787 //!        - \b GPIO_PORT_PA\r
788 //!        - \b GPIO_PORT_PB\r
789 //!        - \b GPIO_PORT_PC\r
790 //!        - \b GPIO_PORT_PD\r
791 //!        - \b GPIO_PORT_PE\r
792 //!        - \b GPIO_PORT_PF\r
793 //!        - \b GPIO_PORT_PJ\r
794 //! \param selectedPins is the specified pin in the selected port.\r
795 //!        Mask value is the logical OR of any of the following:\r
796 //!        - \b GPIO_PIN0\r
797 //!        - \b GPIO_PIN1\r
798 //!        - \b GPIO_PIN2\r
799 //!        - \b GPIO_PIN3\r
800 //!        - \b GPIO_PIN4\r
801 //!        - \b GPIO_PIN5\r
802 //!        - \b GPIO_PIN6\r
803 //!        - \b GPIO_PIN7\r
804 //!        - \b GPIO_PIN8\r
805 //!        - \b GPIO_PIN9\r
806 //!        - \b GPIO_PIN10\r
807 //!        - \b GPIO_PIN11\r
808 //!        - \b GPIO_PIN12\r
809 //!        - \b GPIO_PIN13\r
810 //!        - \b GPIO_PIN14\r
811 //!        - \b GPIO_PIN15\r
812 //!\r
813 //! Modified bits of \b PxIE register.\r
814 //!\r
815 //! \return None\r
816 //\r
817 //*****************************************************************************\r
818 extern void GPIO_disableInterrupt(uint8_t selectedPort,\r
819                                   uint16_t selectedPins);\r
820 \r
821 //*****************************************************************************\r
822 //\r
823 //! \brief This function gets the interrupt status of the selected pin\r
824 //!\r
825 //! This function gets the interrupt status of the selected pin. Please refer\r
826 //! to family user's guide for available ports with interrupt capability.\r
827 //!\r
828 //! \param selectedPort is the selected port.\r
829 //!        Valid values are:\r
830 //!        - \b GPIO_PORT_P1\r
831 //!        - \b GPIO_PORT_P2\r
832 //!        - \b GPIO_PORT_P3\r
833 //!        - \b GPIO_PORT_P4\r
834 //!        - \b GPIO_PORT_P5\r
835 //!        - \b GPIO_PORT_P6\r
836 //!        - \b GPIO_PORT_P7\r
837 //!        - \b GPIO_PORT_P8\r
838 //!        - \b GPIO_PORT_P9\r
839 //!        - \b GPIO_PORT_P10\r
840 //!        - \b GPIO_PORT_P11\r
841 //!        - \b GPIO_PORT_PA\r
842 //!        - \b GPIO_PORT_PB\r
843 //!        - \b GPIO_PORT_PC\r
844 //!        - \b GPIO_PORT_PD\r
845 //!        - \b GPIO_PORT_PE\r
846 //!        - \b GPIO_PORT_PF\r
847 //!        - \b GPIO_PORT_PJ\r
848 //! \param selectedPins is the specified pin in the selected port.\r
849 //!        Mask value is the logical OR of any of the following:\r
850 //!        - \b GPIO_PIN0\r
851 //!        - \b GPIO_PIN1\r
852 //!        - \b GPIO_PIN2\r
853 //!        - \b GPIO_PIN3\r
854 //!        - \b GPIO_PIN4\r
855 //!        - \b GPIO_PIN5\r
856 //!        - \b GPIO_PIN6\r
857 //!        - \b GPIO_PIN7\r
858 //!        - \b GPIO_PIN8\r
859 //!        - \b GPIO_PIN9\r
860 //!        - \b GPIO_PIN10\r
861 //!        - \b GPIO_PIN11\r
862 //!        - \b GPIO_PIN12\r
863 //!        - \b GPIO_PIN13\r
864 //!        - \b GPIO_PIN14\r
865 //!        - \b GPIO_PIN15\r
866 //!\r
867 //! \return Logical OR of any of the following:\r
868 //!         - \b GPIO_PIN0\r
869 //!         - \b GPIO_PIN1\r
870 //!         - \b GPIO_PIN2\r
871 //!         - \b GPIO_PIN3\r
872 //!         - \b GPIO_PIN4\r
873 //!         - \b GPIO_PIN5\r
874 //!         - \b GPIO_PIN6\r
875 //!         - \b GPIO_PIN7\r
876 //!         - \b GPIO_PIN8\r
877 //!         - \b GPIO_PIN9\r
878 //!         - \b GPIO_PIN10\r
879 //!         - \b GPIO_PIN11\r
880 //!         - \b GPIO_PIN12\r
881 //!         - \b GPIO_PIN13\r
882 //!         - \b GPIO_PIN14\r
883 //!         - \b GPIO_PIN15\r
884 //!         \n indicating the interrupt status of the selected pins [Default:\r
885 //!         0]\r
886 //\r
887 //*****************************************************************************\r
888 extern uint16_t GPIO_getInterruptStatus(uint8_t selectedPort,\r
889                                         uint16_t selectedPins);\r
890 \r
891 //*****************************************************************************\r
892 //\r
893 //! \brief This function clears the interrupt flag on the selected pin\r
894 //!\r
895 //! This function clears the interrupt flag on the selected pin. Please refer\r
896 //! to family user's guide for available ports with interrupt capability.\r
897 //!\r
898 //! \param selectedPort is the selected port.\r
899 //!        Valid values are:\r
900 //!        - \b GPIO_PORT_P1\r
901 //!        - \b GPIO_PORT_P2\r
902 //!        - \b GPIO_PORT_P3\r
903 //!        - \b GPIO_PORT_P4\r
904 //!        - \b GPIO_PORT_P5\r
905 //!        - \b GPIO_PORT_P6\r
906 //!        - \b GPIO_PORT_P7\r
907 //!        - \b GPIO_PORT_P8\r
908 //!        - \b GPIO_PORT_P9\r
909 //!        - \b GPIO_PORT_P10\r
910 //!        - \b GPIO_PORT_P11\r
911 //!        - \b GPIO_PORT_PA\r
912 //!        - \b GPIO_PORT_PB\r
913 //!        - \b GPIO_PORT_PC\r
914 //!        - \b GPIO_PORT_PD\r
915 //!        - \b GPIO_PORT_PE\r
916 //!        - \b GPIO_PORT_PF\r
917 //!        - \b GPIO_PORT_PJ\r
918 //! \param selectedPins is the specified pin in the selected port.\r
919 //!        Mask value is the logical OR of any of the following:\r
920 //!        - \b GPIO_PIN0\r
921 //!        - \b GPIO_PIN1\r
922 //!        - \b GPIO_PIN2\r
923 //!        - \b GPIO_PIN3\r
924 //!        - \b GPIO_PIN4\r
925 //!        - \b GPIO_PIN5\r
926 //!        - \b GPIO_PIN6\r
927 //!        - \b GPIO_PIN7\r
928 //!        - \b GPIO_PIN8\r
929 //!        - \b GPIO_PIN9\r
930 //!        - \b GPIO_PIN10\r
931 //!        - \b GPIO_PIN11\r
932 //!        - \b GPIO_PIN12\r
933 //!        - \b GPIO_PIN13\r
934 //!        - \b GPIO_PIN14\r
935 //!        - \b GPIO_PIN15\r
936 //!\r
937 //! Modified bits of \b PxIFG register.\r
938 //!\r
939 //! \return None\r
940 //\r
941 //*****************************************************************************\r
942 extern void GPIO_clearInterrupt(uint8_t selectedPort,\r
943                                 uint16_t selectedPins);\r
944 \r
945 //*****************************************************************************\r
946 //\r
947 //! \brief This function selects on what edge the port interrupt flag should be\r
948 //! set for a transition\r
949 //!\r
950 //! This function selects on what edge the port interrupt flag should be set\r
951 //! for a transition. Values for edgeSelect should be\r
952 //! GPIO_LOW_TO_HIGH_TRANSITION or GPIO_HIGH_TO_LOW_TRANSITION. Please refer to\r
953 //! family user's guide for available ports with interrupt capability.\r
954 //!\r
955 //! \param selectedPort is the selected port.\r
956 //!        Valid values are:\r
957 //!        - \b GPIO_PORT_P1\r
958 //!        - \b GPIO_PORT_P2\r
959 //!        - \b GPIO_PORT_P3\r
960 //!        - \b GPIO_PORT_P4\r
961 //!        - \b GPIO_PORT_P5\r
962 //!        - \b GPIO_PORT_P6\r
963 //!        - \b GPIO_PORT_P7\r
964 //!        - \b GPIO_PORT_P8\r
965 //!        - \b GPIO_PORT_P9\r
966 //!        - \b GPIO_PORT_P10\r
967 //!        - \b GPIO_PORT_P11\r
968 //!        - \b GPIO_PORT_PA\r
969 //!        - \b GPIO_PORT_PB\r
970 //!        - \b GPIO_PORT_PC\r
971 //!        - \b GPIO_PORT_PD\r
972 //!        - \b GPIO_PORT_PE\r
973 //!        - \b GPIO_PORT_PF\r
974 //!        - \b GPIO_PORT_PJ\r
975 //! \param selectedPins is the specified pin in the selected port.\r
976 //!        Mask value is the logical OR of any of the following:\r
977 //!        - \b GPIO_PIN0\r
978 //!        - \b GPIO_PIN1\r
979 //!        - \b GPIO_PIN2\r
980 //!        - \b GPIO_PIN3\r
981 //!        - \b GPIO_PIN4\r
982 //!        - \b GPIO_PIN5\r
983 //!        - \b GPIO_PIN6\r
984 //!        - \b GPIO_PIN7\r
985 //!        - \b GPIO_PIN8\r
986 //!        - \b GPIO_PIN9\r
987 //!        - \b GPIO_PIN10\r
988 //!        - \b GPIO_PIN11\r
989 //!        - \b GPIO_PIN12\r
990 //!        - \b GPIO_PIN13\r
991 //!        - \b GPIO_PIN14\r
992 //!        - \b GPIO_PIN15\r
993 //! \param edgeSelect specifies what transition sets the interrupt flag\r
994 //!        Valid values are:\r
995 //!        - \b GPIO_HIGH_TO_LOW_TRANSITION\r
996 //!        - \b GPIO_LOW_TO_HIGH_TRANSITION\r
997 //!\r
998 //! Modified bits of \b PxIES register.\r
999 //!\r
1000 //! \return None\r
1001 //\r
1002 //*****************************************************************************\r
1003 extern void GPIO_selectInterruptEdge(uint8_t selectedPort,\r
1004                                      uint16_t selectedPins,\r
1005                                      uint8_t edgeSelect);\r
1006 \r
1007 //*****************************************************************************\r
1008 //\r
1009 // Mark the end of the C bindings section for C++ compilers.\r
1010 //\r
1011 //*****************************************************************************\r
1012 #ifdef __cplusplus\r
1013 }\r
1014 #endif\r
1015 \r
1016 #endif\r
1017 #endif // __MSP430WARE_GPIO_H__\r