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

Copyright 2015, Texas Instruments Incorporated