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

Copyright 2020, Texas Instruments Incorporated