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

Copyright 2020, Texas Instruments Incorporated