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

Copyright 2020, Texas Instruments Incorporated