2 * Copyright (c) 2014, Texas Instruments Incorporated
\r
3 * All rights reserved.
\r
5 * Redistribution and use in source and binary forms, with or without
\r
6 * modification, are permitted provided that the following conditions
\r
9 * * Redistributions of source code must retain the above copyright
\r
10 * notice, this list of conditions and the following disclaimer.
\r
12 * * Redistributions in binary form must reproduce the above copyright
\r
13 * notice, this list of conditions and the following disclaimer in the
\r
14 * documentation and/or other materials provided with the distribution.
\r
16 * * Neither the name of Texas Instruments Incorporated nor the names of
\r
17 * its contributors may be used to endorse or promote products derived
\r
18 * from this software without specific prior written permission.
\r
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
\r
21 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
\r
22 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
\r
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
\r
24 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
\r
25 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
\r
26 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
\r
27 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
\r
28 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
\r
29 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
\r
30 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\r
32 //*****************************************************************************
\r
34 // gpio.h - Driver for the GPIO Module.
\r
36 //*****************************************************************************
\r
38 #ifndef __MSP430WARE_GPIO_H__
\r
39 #define __MSP430WARE_GPIO_H__
\r
41 #include "inc/hw_memmap.h"
\r
43 #if defined(__MSP430_HAS_PORT1_R__) || defined(__MSP430_HAS_PORT2_R__) || \
\r
44 defined(__MSP430_HAS_PORTA_R__)
\r
46 //*****************************************************************************
\r
48 // If building with a C++ compiler, make all of the definitions in this header
\r
49 // have a C binding.
\r
51 //*****************************************************************************
\r
57 //*****************************************************************************
\r
59 // The following are values that can be passed to the selectedPort parameter
\r
60 // for functions: GPIO_setAsOutputPin(), GPIO_setAsInputPin(),
\r
61 // GPIO_setAsPeripheralModuleFunctionOutputPin(),
\r
62 // GPIO_setAsPeripheralModuleFunctionInputPin(), GPIO_setOutputHighOnPin(),
\r
63 // GPIO_setOutputLowOnPin(), GPIO_toggleOutputOnPin(),
\r
64 // GPIO_setAsInputPinWithPullDownResistor(),
\r
65 // GPIO_setAsInputPinWithPullUpResistor(), GPIO_getInputPinValue(),
\r
66 // GPIO_selectInterruptEdge(), GPIO_enableInterrupt(), GPIO_disableInterrupt(),
\r
67 // GPIO_getInterruptStatus(), and GPIO_clearInterrupt().
\r
69 //*****************************************************************************
\r
70 #define GPIO_PORT_P1 1
\r
71 #define GPIO_PORT_P2 2
\r
72 #define GPIO_PORT_P3 3
\r
73 #define GPIO_PORT_P4 4
\r
74 #define GPIO_PORT_P5 5
\r
75 #define GPIO_PORT_P6 6
\r
76 #define GPIO_PORT_P7 7
\r
77 #define GPIO_PORT_P8 8
\r
78 #define GPIO_PORT_P9 9
\r
79 #define GPIO_PORT_P10 10
\r
80 #define GPIO_PORT_P11 11
\r
81 #define GPIO_PORT_PA 1
\r
82 #define GPIO_PORT_PB 3
\r
83 #define GPIO_PORT_PC 5
\r
84 #define GPIO_PORT_PD 7
\r
85 #define GPIO_PORT_PE 9
\r
86 #define GPIO_PORT_PF 11
\r
87 #define GPIO_PORT_PJ 13
\r
89 //*****************************************************************************
\r
91 // The following are values that can be passed to the selectedPins parameter
\r
92 // for functions: GPIO_setAsOutputPin(), GPIO_setAsInputPin(),
\r
93 // GPIO_setAsPeripheralModuleFunctionOutputPin(),
\r
94 // GPIO_setAsPeripheralModuleFunctionInputPin(), GPIO_setOutputHighOnPin(),
\r
95 // GPIO_setOutputLowOnPin(), GPIO_toggleOutputOnPin(),
\r
96 // GPIO_setAsInputPinWithPullDownResistor(),
\r
97 // GPIO_setAsInputPinWithPullUpResistor(), GPIO_getInputPinValue(),
\r
98 // GPIO_enableInterrupt(), GPIO_disableInterrupt(), GPIO_getInterruptStatus(),
\r
99 // GPIO_clearInterrupt(), and GPIO_selectInterruptEdge() as well as returned by
\r
100 // the GPIO_getInterruptStatus() function.
\r
102 //*****************************************************************************
\r
103 #define GPIO_PIN0 (0x0001)
\r
104 #define GPIO_PIN1 (0x0002)
\r
105 #define GPIO_PIN2 (0x0004)
\r
106 #define GPIO_PIN3 (0x0008)
\r
107 #define GPIO_PIN4 (0x0010)
\r
108 #define GPIO_PIN5 (0x0020)
\r
109 #define GPIO_PIN6 (0x0040)
\r
110 #define GPIO_PIN7 (0x0080)
\r
111 #define GPIO_PIN8 (0x0100)
\r
112 #define GPIO_PIN9 (0x0200)
\r
113 #define GPIO_PIN10 (0x0400)
\r
114 #define GPIO_PIN11 (0x0800)
\r
115 #define GPIO_PIN12 (0x1000)
\r
116 #define GPIO_PIN13 (0x2000)
\r
117 #define GPIO_PIN14 (0x4000)
\r
118 #define GPIO_PIN15 (0x8000)
\r
120 //*****************************************************************************
\r
122 // The following are values that can be passed to the mode parameter for
\r
123 // functions: GPIO_setAsPeripheralModuleFunctionOutputPin(), and
\r
124 // GPIO_setAsPeripheralModuleFunctionInputPin().
\r
126 //*****************************************************************************
\r
127 #define GPIO_PRIMARY_MODULE_FUNCTION (0x01)
\r
128 #define GPIO_SECONDARY_MODULE_FUNCTION (0x02)
\r
129 #define GPIO_TERNARY_MODULE_FUNCTION (0x03)
\r
131 //*****************************************************************************
\r
133 // The following are values that can be passed to the edgeSelect parameter for
\r
134 // functions: GPIO_selectInterruptEdge().
\r
136 //*****************************************************************************
\r
137 #define GPIO_HIGH_TO_LOW_TRANSITION (0x01)
\r
138 #define GPIO_LOW_TO_HIGH_TRANSITION (0x00)
\r
140 //*****************************************************************************
\r
142 // The following are values that can be passed toThe following are values that
\r
143 // can be returned by the GPIO_getInputPinValue() function.
\r
145 //*****************************************************************************
\r
146 #define GPIO_INPUT_PIN_HIGH (0x01)
\r
147 #define GPIO_INPUT_PIN_LOW (0x00)
\r
149 //*****************************************************************************
\r
151 // Prototypes for the APIs.
\r
153 //*****************************************************************************
\r
155 //*****************************************************************************
\r
157 //! \brief This function configures the selected Pin as output pin
\r
159 //! This function selected pins on a selected port as output pins.
\r
161 //! \param selectedPort is the selected port.
\r
162 //! Valid values are:
\r
163 //! - \b GPIO_PORT_P1
\r
164 //! - \b GPIO_PORT_P2
\r
165 //! - \b GPIO_PORT_P3
\r
166 //! - \b GPIO_PORT_P4
\r
167 //! - \b GPIO_PORT_P5
\r
168 //! - \b GPIO_PORT_P6
\r
169 //! - \b GPIO_PORT_P7
\r
170 //! - \b GPIO_PORT_P8
\r
171 //! - \b GPIO_PORT_P9
\r
172 //! - \b GPIO_PORT_P10
\r
173 //! - \b GPIO_PORT_P11
\r
174 //! - \b GPIO_PORT_PA
\r
175 //! - \b GPIO_PORT_PB
\r
176 //! - \b GPIO_PORT_PC
\r
177 //! - \b GPIO_PORT_PD
\r
178 //! - \b GPIO_PORT_PE
\r
179 //! - \b GPIO_PORT_PF
\r
180 //! - \b GPIO_PORT_PJ
\r
181 //! \param selectedPins is the specified pin in the selected port.
\r
182 //! Mask value is the logical OR of any of the following:
\r
193 //! - \b GPIO_PIN10
\r
194 //! - \b GPIO_PIN11
\r
195 //! - \b GPIO_PIN12
\r
196 //! - \b GPIO_PIN13
\r
197 //! - \b GPIO_PIN14
\r
198 //! - \b GPIO_PIN15
\r
200 //! Modified bits of \b PxDIR register and bits of \b PxSEL register.
\r
204 //*****************************************************************************
\r
205 extern void GPIO_setAsOutputPin(uint8_t selectedPort,
\r
206 uint16_t selectedPins);
\r
208 //*****************************************************************************
\r
210 //! \brief This function configures the selected Pin as input pin
\r
212 //! This function selected pins on a selected port as input pins.
\r
214 //! \param selectedPort is the selected port.
\r
215 //! Valid values are:
\r
216 //! - \b GPIO_PORT_P1
\r
217 //! - \b GPIO_PORT_P2
\r
218 //! - \b GPIO_PORT_P3
\r
219 //! - \b GPIO_PORT_P4
\r
220 //! - \b GPIO_PORT_P5
\r
221 //! - \b GPIO_PORT_P6
\r
222 //! - \b GPIO_PORT_P7
\r
223 //! - \b GPIO_PORT_P8
\r
224 //! - \b GPIO_PORT_P9
\r
225 //! - \b GPIO_PORT_P10
\r
226 //! - \b GPIO_PORT_P11
\r
227 //! - \b GPIO_PORT_PA
\r
228 //! - \b GPIO_PORT_PB
\r
229 //! - \b GPIO_PORT_PC
\r
230 //! - \b GPIO_PORT_PD
\r
231 //! - \b GPIO_PORT_PE
\r
232 //! - \b GPIO_PORT_PF
\r
233 //! - \b GPIO_PORT_PJ
\r
234 //! \param selectedPins is the specified pin in the selected port.
\r
235 //! Mask value is the logical OR of any of the following:
\r
246 //! - \b GPIO_PIN10
\r
247 //! - \b GPIO_PIN11
\r
248 //! - \b GPIO_PIN12
\r
249 //! - \b GPIO_PIN13
\r
250 //! - \b GPIO_PIN14
\r
251 //! - \b GPIO_PIN15
\r
253 //! Modified bits of \b PxDIR register, bits of \b PxREN register and bits of
\r
254 //! \b PxSEL register.
\r
258 //*****************************************************************************
\r
259 extern void GPIO_setAsInputPin(uint8_t selectedPort,
\r
260 uint16_t selectedPins);
\r
262 //*****************************************************************************
\r
264 //! \brief This function configures the peripheral module function in the
\r
265 //! output direction for the selected pin.
\r
267 //! This function configures the peripheral module function in the output
\r
268 //! direction for the selected pin for either primary, secondary or ternary
\r
269 //! module function modes. Note that MSP430F5xx/6xx family doesn't support
\r
270 //! these function modes.
\r
272 //! \param selectedPort is the selected port.
\r
273 //! Valid values are:
\r
274 //! - \b GPIO_PORT_P1
\r
275 //! - \b GPIO_PORT_P2
\r
276 //! - \b GPIO_PORT_P3
\r
277 //! - \b GPIO_PORT_P4
\r
278 //! - \b GPIO_PORT_P5
\r
279 //! - \b GPIO_PORT_P6
\r
280 //! - \b GPIO_PORT_P7
\r
281 //! - \b GPIO_PORT_P8
\r
282 //! - \b GPIO_PORT_P9
\r
283 //! - \b GPIO_PORT_P10
\r
284 //! - \b GPIO_PORT_P11
\r
285 //! - \b GPIO_PORT_PA
\r
286 //! - \b GPIO_PORT_PB
\r
287 //! - \b GPIO_PORT_PC
\r
288 //! - \b GPIO_PORT_PD
\r
289 //! - \b GPIO_PORT_PE
\r
290 //! - \b GPIO_PORT_PF
\r
291 //! - \b GPIO_PORT_PJ
\r
292 //! \param selectedPins is the specified pin in the selected port.
\r
293 //! Mask value is the logical OR of any of the following:
\r
304 //! - \b GPIO_PIN10
\r
305 //! - \b GPIO_PIN11
\r
306 //! - \b GPIO_PIN12
\r
307 //! - \b GPIO_PIN13
\r
308 //! - \b GPIO_PIN14
\r
309 //! - \b GPIO_PIN15
\r
310 //! \param mode is the specified mode that the pin should be configured for the
\r
311 //! module function.
\r
312 //! Valid values are:
\r
313 //! - \b GPIO_PRIMARY_MODULE_FUNCTION
\r
314 //! - \b GPIO_SECONDARY_MODULE_FUNCTION
\r
315 //! - \b GPIO_TERNARY_MODULE_FUNCTION
\r
317 //! Modified bits of \b PxDIR register and bits of \b PxSEL register.
\r
321 //*****************************************************************************
\r
322 extern void GPIO_setAsPeripheralModuleFunctionOutputPin(uint8_t selectedPort,
\r
323 uint16_t selectedPins,
\r
326 //*****************************************************************************
\r
328 //! \brief This function configures the peripheral module function in the input
\r
329 //! direction for the selected pin.
\r
331 //! This function configures the peripheral module function in the input
\r
332 //! direction for the selected pin for either primary, secondary or ternary
\r
333 //! module function modes. Note that MSP430F5xx/6xx family doesn't support
\r
334 //! these function modes.
\r
336 //! \param selectedPort is the selected port.
\r
337 //! Valid values are:
\r
338 //! - \b GPIO_PORT_P1
\r
339 //! - \b GPIO_PORT_P2
\r
340 //! - \b GPIO_PORT_P3
\r
341 //! - \b GPIO_PORT_P4
\r
342 //! - \b GPIO_PORT_P5
\r
343 //! - \b GPIO_PORT_P6
\r
344 //! - \b GPIO_PORT_P7
\r
345 //! - \b GPIO_PORT_P8
\r
346 //! - \b GPIO_PORT_P9
\r
347 //! - \b GPIO_PORT_P10
\r
348 //! - \b GPIO_PORT_P11
\r
349 //! - \b GPIO_PORT_PA
\r
350 //! - \b GPIO_PORT_PB
\r
351 //! - \b GPIO_PORT_PC
\r
352 //! - \b GPIO_PORT_PD
\r
353 //! - \b GPIO_PORT_PE
\r
354 //! - \b GPIO_PORT_PF
\r
355 //! - \b GPIO_PORT_PJ
\r
356 //! \param selectedPins is the specified pin in the selected port.
\r
357 //! Mask value is the logical OR of any of the following:
\r
368 //! - \b GPIO_PIN10
\r
369 //! - \b GPIO_PIN11
\r
370 //! - \b GPIO_PIN12
\r
371 //! - \b GPIO_PIN13
\r
372 //! - \b GPIO_PIN14
\r
373 //! - \b GPIO_PIN15
\r
374 //! \param mode is the specified mode that the pin should be configured for the
\r
375 //! module function.
\r
376 //! Valid values are:
\r
377 //! - \b GPIO_PRIMARY_MODULE_FUNCTION
\r
378 //! - \b GPIO_SECONDARY_MODULE_FUNCTION
\r
379 //! - \b GPIO_TERNARY_MODULE_FUNCTION
\r
381 //! Modified bits of \b PxDIR register and bits of \b PxSEL register.
\r
385 //*****************************************************************************
\r
386 extern void GPIO_setAsPeripheralModuleFunctionInputPin(uint8_t selectedPort,
\r
387 uint16_t selectedPins,
\r
390 //*****************************************************************************
\r
392 //! \brief This function sets output HIGH on the selected Pin
\r
394 //! This function sets output HIGH on the selected port's pin.
\r
396 //! \param selectedPort is the selected port.
\r
397 //! Valid values are:
\r
398 //! - \b GPIO_PORT_P1
\r
399 //! - \b GPIO_PORT_P2
\r
400 //! - \b GPIO_PORT_P3
\r
401 //! - \b GPIO_PORT_P4
\r
402 //! - \b GPIO_PORT_P5
\r
403 //! - \b GPIO_PORT_P6
\r
404 //! - \b GPIO_PORT_P7
\r
405 //! - \b GPIO_PORT_P8
\r
406 //! - \b GPIO_PORT_P9
\r
407 //! - \b GPIO_PORT_P10
\r
408 //! - \b GPIO_PORT_P11
\r
409 //! - \b GPIO_PORT_PA
\r
410 //! - \b GPIO_PORT_PB
\r
411 //! - \b GPIO_PORT_PC
\r
412 //! - \b GPIO_PORT_PD
\r
413 //! - \b GPIO_PORT_PE
\r
414 //! - \b GPIO_PORT_PF
\r
415 //! - \b GPIO_PORT_PJ
\r
416 //! \param selectedPins is the specified pin in the selected port.
\r
417 //! Mask value is the logical OR of any of the following:
\r
428 //! - \b GPIO_PIN10
\r
429 //! - \b GPIO_PIN11
\r
430 //! - \b GPIO_PIN12
\r
431 //! - \b GPIO_PIN13
\r
432 //! - \b GPIO_PIN14
\r
433 //! - \b GPIO_PIN15
\r
435 //! Modified bits of \b PxOUT register.
\r
439 //*****************************************************************************
\r
440 extern void GPIO_setOutputHighOnPin(uint8_t selectedPort,
\r
441 uint16_t selectedPins);
\r
443 //*****************************************************************************
\r
445 //! \brief This function sets output LOW on the selected Pin
\r
447 //! This function sets output LOW on the selected port's pin.
\r
449 //! \param selectedPort is the selected port.
\r
450 //! Valid values are:
\r
451 //! - \b GPIO_PORT_P1
\r
452 //! - \b GPIO_PORT_P2
\r
453 //! - \b GPIO_PORT_P3
\r
454 //! - \b GPIO_PORT_P4
\r
455 //! - \b GPIO_PORT_P5
\r
456 //! - \b GPIO_PORT_P6
\r
457 //! - \b GPIO_PORT_P7
\r
458 //! - \b GPIO_PORT_P8
\r
459 //! - \b GPIO_PORT_P9
\r
460 //! - \b GPIO_PORT_P10
\r
461 //! - \b GPIO_PORT_P11
\r
462 //! - \b GPIO_PORT_PA
\r
463 //! - \b GPIO_PORT_PB
\r
464 //! - \b GPIO_PORT_PC
\r
465 //! - \b GPIO_PORT_PD
\r
466 //! - \b GPIO_PORT_PE
\r
467 //! - \b GPIO_PORT_PF
\r
468 //! - \b GPIO_PORT_PJ
\r
469 //! \param selectedPins is the specified pin in the selected port.
\r
470 //! Mask value is the logical OR of any of the following:
\r
481 //! - \b GPIO_PIN10
\r
482 //! - \b GPIO_PIN11
\r
483 //! - \b GPIO_PIN12
\r
484 //! - \b GPIO_PIN13
\r
485 //! - \b GPIO_PIN14
\r
486 //! - \b GPIO_PIN15
\r
488 //! Modified bits of \b PxOUT register.
\r
492 //*****************************************************************************
\r
493 extern void GPIO_setOutputLowOnPin(uint8_t selectedPort,
\r
494 uint16_t selectedPins);
\r
496 //*****************************************************************************
\r
498 //! \brief This function toggles the output on the selected Pin
\r
500 //! This function toggles the output on the selected port's pin.
\r
502 //! \param selectedPort is the selected port.
\r
503 //! Valid values are:
\r
504 //! - \b GPIO_PORT_P1
\r
505 //! - \b GPIO_PORT_P2
\r
506 //! - \b GPIO_PORT_P3
\r
507 //! - \b GPIO_PORT_P4
\r
508 //! - \b GPIO_PORT_P5
\r
509 //! - \b GPIO_PORT_P6
\r
510 //! - \b GPIO_PORT_P7
\r
511 //! - \b GPIO_PORT_P8
\r
512 //! - \b GPIO_PORT_P9
\r
513 //! - \b GPIO_PORT_P10
\r
514 //! - \b GPIO_PORT_P11
\r
515 //! - \b GPIO_PORT_PA
\r
516 //! - \b GPIO_PORT_PB
\r
517 //! - \b GPIO_PORT_PC
\r
518 //! - \b GPIO_PORT_PD
\r
519 //! - \b GPIO_PORT_PE
\r
520 //! - \b GPIO_PORT_PF
\r
521 //! - \b GPIO_PORT_PJ
\r
522 //! \param selectedPins is the specified pin in the selected port.
\r
523 //! Mask value is the logical OR of any of the following:
\r
534 //! - \b GPIO_PIN10
\r
535 //! - \b GPIO_PIN11
\r
536 //! - \b GPIO_PIN12
\r
537 //! - \b GPIO_PIN13
\r
538 //! - \b GPIO_PIN14
\r
539 //! - \b GPIO_PIN15
\r
541 //! Modified bits of \b PxOUT register.
\r
545 //*****************************************************************************
\r
546 extern void GPIO_toggleOutputOnPin(uint8_t selectedPort,
\r
547 uint16_t selectedPins);
\r
549 //*****************************************************************************
\r
551 //! \brief This function sets the selected Pin in input Mode with Pull Down
\r
554 //! This function sets the selected Pin in input Mode with Pull Down resistor.
\r
556 //! \param selectedPort is the selected port.
\r
557 //! Valid values are:
\r
558 //! - \b GPIO_PORT_P1
\r
559 //! - \b GPIO_PORT_P2
\r
560 //! - \b GPIO_PORT_P3
\r
561 //! - \b GPIO_PORT_P4
\r
562 //! - \b GPIO_PORT_P5
\r
563 //! - \b GPIO_PORT_P6
\r
564 //! - \b GPIO_PORT_P7
\r
565 //! - \b GPIO_PORT_P8
\r
566 //! - \b GPIO_PORT_P9
\r
567 //! - \b GPIO_PORT_P10
\r
568 //! - \b GPIO_PORT_P11
\r
569 //! - \b GPIO_PORT_PA
\r
570 //! - \b GPIO_PORT_PB
\r
571 //! - \b GPIO_PORT_PC
\r
572 //! - \b GPIO_PORT_PD
\r
573 //! - \b GPIO_PORT_PE
\r
574 //! - \b GPIO_PORT_PF
\r
575 //! - \b GPIO_PORT_PJ
\r
576 //! \param selectedPins is the specified pin in the selected port.
\r
577 //! Mask value is the logical OR of any of the following:
\r
588 //! - \b GPIO_PIN10
\r
589 //! - \b GPIO_PIN11
\r
590 //! - \b GPIO_PIN12
\r
591 //! - \b GPIO_PIN13
\r
592 //! - \b GPIO_PIN14
\r
593 //! - \b GPIO_PIN15
\r
595 //! Modified bits of \b PxDIR register, bits of \b PxOUT register and bits of
\r
596 //! \b PxREN register.
\r
600 //*****************************************************************************
\r
601 extern void GPIO_setAsInputPinWithPullDownResistor(uint8_t selectedPort,
\r
602 uint16_t selectedPins);
\r
604 //*****************************************************************************
\r
606 //! \brief This function sets the selected Pin in input Mode with Pull Up
\r
609 //! This function sets the selected Pin in input Mode with Pull Up resistor.
\r
611 //! \param selectedPort is the selected port.
\r
612 //! Valid values are:
\r
613 //! - \b GPIO_PORT_P1
\r
614 //! - \b GPIO_PORT_P2
\r
615 //! - \b GPIO_PORT_P3
\r
616 //! - \b GPIO_PORT_P4
\r
617 //! - \b GPIO_PORT_P5
\r
618 //! - \b GPIO_PORT_P6
\r
619 //! - \b GPIO_PORT_P7
\r
620 //! - \b GPIO_PORT_P8
\r
621 //! - \b GPIO_PORT_P9
\r
622 //! - \b GPIO_PORT_P10
\r
623 //! - \b GPIO_PORT_P11
\r
624 //! - \b GPIO_PORT_PA
\r
625 //! - \b GPIO_PORT_PB
\r
626 //! - \b GPIO_PORT_PC
\r
627 //! - \b GPIO_PORT_PD
\r
628 //! - \b GPIO_PORT_PE
\r
629 //! - \b GPIO_PORT_PF
\r
630 //! - \b GPIO_PORT_PJ
\r
631 //! \param selectedPins is the specified pin in the selected port.
\r
632 //! Mask value is the logical OR of any of the following:
\r
643 //! - \b GPIO_PIN10
\r
644 //! - \b GPIO_PIN11
\r
645 //! - \b GPIO_PIN12
\r
646 //! - \b GPIO_PIN13
\r
647 //! - \b GPIO_PIN14
\r
648 //! - \b GPIO_PIN15
\r
650 //! Modified bits of \b PxDIR register, bits of \b PxOUT register and bits of
\r
651 //! \b PxREN register.
\r
655 //*****************************************************************************
\r
656 extern void GPIO_setAsInputPinWithPullUpResistor(uint8_t selectedPort,
\r
657 uint16_t selectedPins);
\r
659 //*****************************************************************************
\r
661 //! \brief This function gets the input value on the selected pin
\r
663 //! This function gets the input value on the selected pin.
\r
665 //! \param selectedPort is the selected port.
\r
666 //! Valid values are:
\r
667 //! - \b GPIO_PORT_P1
\r
668 //! - \b GPIO_PORT_P2
\r
669 //! - \b GPIO_PORT_P3
\r
670 //! - \b GPIO_PORT_P4
\r
671 //! - \b GPIO_PORT_P5
\r
672 //! - \b GPIO_PORT_P6
\r
673 //! - \b GPIO_PORT_P7
\r
674 //! - \b GPIO_PORT_P8
\r
675 //! - \b GPIO_PORT_P9
\r
676 //! - \b GPIO_PORT_P10
\r
677 //! - \b GPIO_PORT_P11
\r
678 //! - \b GPIO_PORT_PA
\r
679 //! - \b GPIO_PORT_PB
\r
680 //! - \b GPIO_PORT_PC
\r
681 //! - \b GPIO_PORT_PD
\r
682 //! - \b GPIO_PORT_PE
\r
683 //! - \b GPIO_PORT_PF
\r
684 //! - \b GPIO_PORT_PJ
\r
685 //! \param selectedPins is the specified pin in the selected port.
\r
686 //! Valid values are:
\r
697 //! - \b GPIO_PIN10
\r
698 //! - \b GPIO_PIN11
\r
699 //! - \b GPIO_PIN12
\r
700 //! - \b GPIO_PIN13
\r
701 //! - \b GPIO_PIN14
\r
702 //! - \b GPIO_PIN15
\r
704 //! \return One of the following:
\r
705 //! - \b GPIO_INPUT_PIN_HIGH
\r
706 //! - \b GPIO_INPUT_PIN_LOW
\r
707 //! \n indicating the status of the pin
\r
709 //*****************************************************************************
\r
710 extern uint8_t GPIO_getInputPinValue(uint8_t selectedPort,
\r
711 uint16_t selectedPins);
\r
713 //*****************************************************************************
\r
715 //! \brief This function enables the port interrupt on the selected pin
\r
717 //! This function enables the port interrupt on the selected pin. Please refer
\r
718 //! to family user's guide for available ports with interrupt capability.
\r
720 //! \param selectedPort is the selected port.
\r
721 //! Valid values are:
\r
722 //! - \b GPIO_PORT_P1
\r
723 //! - \b GPIO_PORT_P2
\r
724 //! - \b GPIO_PORT_P3
\r
725 //! - \b GPIO_PORT_P4
\r
726 //! - \b GPIO_PORT_P5
\r
727 //! - \b GPIO_PORT_P6
\r
728 //! - \b GPIO_PORT_P7
\r
729 //! - \b GPIO_PORT_P8
\r
730 //! - \b GPIO_PORT_P9
\r
731 //! - \b GPIO_PORT_P10
\r
732 //! - \b GPIO_PORT_P11
\r
733 //! - \b GPIO_PORT_PA
\r
734 //! - \b GPIO_PORT_PB
\r
735 //! - \b GPIO_PORT_PC
\r
736 //! - \b GPIO_PORT_PD
\r
737 //! - \b GPIO_PORT_PE
\r
738 //! - \b GPIO_PORT_PF
\r
739 //! - \b GPIO_PORT_PJ
\r
740 //! \param selectedPins is the specified pin in the selected port.
\r
741 //! Mask value is the logical OR of any of the following:
\r
752 //! - \b GPIO_PIN10
\r
753 //! - \b GPIO_PIN11
\r
754 //! - \b GPIO_PIN12
\r
755 //! - \b GPIO_PIN13
\r
756 //! - \b GPIO_PIN14
\r
757 //! - \b GPIO_PIN15
\r
759 //! Modified bits of \b PxIE register.
\r
763 //*****************************************************************************
\r
764 extern void GPIO_enableInterrupt(uint8_t selectedPort,
\r
765 uint16_t selectedPins);
\r
767 //*****************************************************************************
\r
769 //! \brief This function disables the port interrupt on the selected pin
\r
771 //! This function disables the port interrupt on the selected pin. Please refer
\r
772 //! to family user's guide for available ports with interrupt capability.
\r
774 //! \param selectedPort is the selected port.
\r
775 //! Valid values are:
\r
776 //! - \b GPIO_PORT_P1
\r
777 //! - \b GPIO_PORT_P2
\r
778 //! - \b GPIO_PORT_P3
\r
779 //! - \b GPIO_PORT_P4
\r
780 //! - \b GPIO_PORT_P5
\r
781 //! - \b GPIO_PORT_P6
\r
782 //! - \b GPIO_PORT_P7
\r
783 //! - \b GPIO_PORT_P8
\r
784 //! - \b GPIO_PORT_P9
\r
785 //! - \b GPIO_PORT_P10
\r
786 //! - \b GPIO_PORT_P11
\r
787 //! - \b GPIO_PORT_PA
\r
788 //! - \b GPIO_PORT_PB
\r
789 //! - \b GPIO_PORT_PC
\r
790 //! - \b GPIO_PORT_PD
\r
791 //! - \b GPIO_PORT_PE
\r
792 //! - \b GPIO_PORT_PF
\r
793 //! - \b GPIO_PORT_PJ
\r
794 //! \param selectedPins is the specified pin in the selected port.
\r
795 //! Mask value is the logical OR of any of the following:
\r
806 //! - \b GPIO_PIN10
\r
807 //! - \b GPIO_PIN11
\r
808 //! - \b GPIO_PIN12
\r
809 //! - \b GPIO_PIN13
\r
810 //! - \b GPIO_PIN14
\r
811 //! - \b GPIO_PIN15
\r
813 //! Modified bits of \b PxIE register.
\r
817 //*****************************************************************************
\r
818 extern void GPIO_disableInterrupt(uint8_t selectedPort,
\r
819 uint16_t selectedPins);
\r
821 //*****************************************************************************
\r
823 //! \brief This function gets the interrupt status of the selected pin
\r
825 //! This function gets the interrupt status of the selected pin. Please refer
\r
826 //! to family user's guide for available ports with interrupt capability.
\r
828 //! \param selectedPort is the selected port.
\r
829 //! Valid values are:
\r
830 //! - \b GPIO_PORT_P1
\r
831 //! - \b GPIO_PORT_P2
\r
832 //! - \b GPIO_PORT_P3
\r
833 //! - \b GPIO_PORT_P4
\r
834 //! - \b GPIO_PORT_P5
\r
835 //! - \b GPIO_PORT_P6
\r
836 //! - \b GPIO_PORT_P7
\r
837 //! - \b GPIO_PORT_P8
\r
838 //! - \b GPIO_PORT_P9
\r
839 //! - \b GPIO_PORT_P10
\r
840 //! - \b GPIO_PORT_P11
\r
841 //! - \b GPIO_PORT_PA
\r
842 //! - \b GPIO_PORT_PB
\r
843 //! - \b GPIO_PORT_PC
\r
844 //! - \b GPIO_PORT_PD
\r
845 //! - \b GPIO_PORT_PE
\r
846 //! - \b GPIO_PORT_PF
\r
847 //! - \b GPIO_PORT_PJ
\r
848 //! \param selectedPins is the specified pin in the selected port.
\r
849 //! Mask value is the logical OR of any of the following:
\r
860 //! - \b GPIO_PIN10
\r
861 //! - \b GPIO_PIN11
\r
862 //! - \b GPIO_PIN12
\r
863 //! - \b GPIO_PIN13
\r
864 //! - \b GPIO_PIN14
\r
865 //! - \b GPIO_PIN15
\r
867 //! \return Logical OR of any of the following:
\r
878 //! - \b GPIO_PIN10
\r
879 //! - \b GPIO_PIN11
\r
880 //! - \b GPIO_PIN12
\r
881 //! - \b GPIO_PIN13
\r
882 //! - \b GPIO_PIN14
\r
883 //! - \b GPIO_PIN15
\r
884 //! \n indicating the interrupt status of the selected pins [Default:
\r
887 //*****************************************************************************
\r
888 extern uint16_t GPIO_getInterruptStatus(uint8_t selectedPort,
\r
889 uint16_t selectedPins);
\r
891 //*****************************************************************************
\r
893 //! \brief This function clears the interrupt flag on the selected pin
\r
895 //! This function clears the interrupt flag on the selected pin. Please refer
\r
896 //! to family user's guide for available ports with interrupt capability.
\r
898 //! \param selectedPort is the selected port.
\r
899 //! Valid values are:
\r
900 //! - \b GPIO_PORT_P1
\r
901 //! - \b GPIO_PORT_P2
\r
902 //! - \b GPIO_PORT_P3
\r
903 //! - \b GPIO_PORT_P4
\r
904 //! - \b GPIO_PORT_P5
\r
905 //! - \b GPIO_PORT_P6
\r
906 //! - \b GPIO_PORT_P7
\r
907 //! - \b GPIO_PORT_P8
\r
908 //! - \b GPIO_PORT_P9
\r
909 //! - \b GPIO_PORT_P10
\r
910 //! - \b GPIO_PORT_P11
\r
911 //! - \b GPIO_PORT_PA
\r
912 //! - \b GPIO_PORT_PB
\r
913 //! - \b GPIO_PORT_PC
\r
914 //! - \b GPIO_PORT_PD
\r
915 //! - \b GPIO_PORT_PE
\r
916 //! - \b GPIO_PORT_PF
\r
917 //! - \b GPIO_PORT_PJ
\r
918 //! \param selectedPins is the specified pin in the selected port.
\r
919 //! Mask value is the logical OR of any of the following:
\r
930 //! - \b GPIO_PIN10
\r
931 //! - \b GPIO_PIN11
\r
932 //! - \b GPIO_PIN12
\r
933 //! - \b GPIO_PIN13
\r
934 //! - \b GPIO_PIN14
\r
935 //! - \b GPIO_PIN15
\r
937 //! Modified bits of \b PxIFG register.
\r
941 //*****************************************************************************
\r
942 extern void GPIO_clearInterrupt(uint8_t selectedPort,
\r
943 uint16_t selectedPins);
\r
945 //*****************************************************************************
\r
947 //! \brief This function selects on what edge the port interrupt flag should be
\r
948 //! set for a transition
\r
950 //! This function selects on what edge the port interrupt flag should be set
\r
951 //! for a transition. Values for edgeSelect should be
\r
952 //! GPIO_LOW_TO_HIGH_TRANSITION or GPIO_HIGH_TO_LOW_TRANSITION. Please refer to
\r
953 //! family user's guide for available ports with interrupt capability.
\r
955 //! \param selectedPort is the selected port.
\r
956 //! Valid values are:
\r
957 //! - \b GPIO_PORT_P1
\r
958 //! - \b GPIO_PORT_P2
\r
959 //! - \b GPIO_PORT_P3
\r
960 //! - \b GPIO_PORT_P4
\r
961 //! - \b GPIO_PORT_P5
\r
962 //! - \b GPIO_PORT_P6
\r
963 //! - \b GPIO_PORT_P7
\r
964 //! - \b GPIO_PORT_P8
\r
965 //! - \b GPIO_PORT_P9
\r
966 //! - \b GPIO_PORT_P10
\r
967 //! - \b GPIO_PORT_P11
\r
968 //! - \b GPIO_PORT_PA
\r
969 //! - \b GPIO_PORT_PB
\r
970 //! - \b GPIO_PORT_PC
\r
971 //! - \b GPIO_PORT_PD
\r
972 //! - \b GPIO_PORT_PE
\r
973 //! - \b GPIO_PORT_PF
\r
974 //! - \b GPIO_PORT_PJ
\r
975 //! \param selectedPins is the specified pin in the selected port.
\r
976 //! Mask value is the logical OR of any of the following:
\r
987 //! - \b GPIO_PIN10
\r
988 //! - \b GPIO_PIN11
\r
989 //! - \b GPIO_PIN12
\r
990 //! - \b GPIO_PIN13
\r
991 //! - \b GPIO_PIN14
\r
992 //! - \b GPIO_PIN15
\r
993 //! \param edgeSelect specifies what transition sets the interrupt flag
\r
994 //! Valid values are:
\r
995 //! - \b GPIO_HIGH_TO_LOW_TRANSITION
\r
996 //! - \b GPIO_LOW_TO_HIGH_TRANSITION
\r
998 //! Modified bits of \b PxIES register.
\r
1002 //*****************************************************************************
\r
1003 extern void GPIO_selectInterruptEdge(uint8_t selectedPort,
\r
1004 uint16_t selectedPins,
\r
1005 uint8_t edgeSelect);
\r
1007 //*****************************************************************************
\r
1009 // Mark the end of the C bindings section for C++ compilers.
\r
1011 //*****************************************************************************
\r
1012 #ifdef __cplusplus
\r
1017 #endif // __MSP430WARE_GPIO_H__
\r