1 /* --COPYRIGHT--,BSD\r
2 * Copyright (c) 2014, Texas Instruments Incorporated\r
3 * All rights reserved.\r
4 *\r
5 * Redistribution and use in source and binary forms, with or without\r
6 * modification, are permitted provided that the following conditions\r
7 * are met:\r
8 *\r
9 * * Redistributions of source code must retain the above copyright\r
10 * notice, this list of conditions and the following disclaimer.\r
11 *\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
15 *\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
19 *\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
31 * --/COPYRIGHT--*/\r
32 //*****************************************************************************\r
33 //\r
34 // pmap.h - Driver for the PMAP Module.\r
35 //\r
36 //*****************************************************************************\r
37 \r
38 #ifndef __MSP430WARE_PMAP_H__\r
39 #define __MSP430WARE_PMAP_H__\r
40 \r
41 #include "inc/hw_memmap.h"\r
42 \r
43 #ifdef __MSP430_HAS_PORT_MAPPING__\r
44 \r
45 //*****************************************************************************\r
46 //\r
47 // If building with a C++ compiler, make all of the definitions in this header\r
48 // have a C binding.\r
49 //\r
50 //*****************************************************************************\r
51 #ifdef __cplusplus\r
52 extern "C"\r
53 {\r
54 #endif\r
55 \r
56 //******************************************************************************\r
57 //\r
58 // The following is a struct that is passed to PMAP_initPorts()\r
59 //\r
60 //******************************************************************************\r
61 typedef struct PMAP_initPortsParam {\r
62 const uint8_t *portMapping;\r
63 uint8_t *PxMAPy;\r
64 uint8_t numberOfPorts;\r
65 uint8_t portMapReconfigure;\r
66 } PMAP_initPortsParam;\r
67 \r
68 //*****************************************************************************\r
69 //\r
70 // The following are values that can be passed to the portMapReconfigure\r
71 // parameter for functions: PMAP_configurePorts().\r
72 //\r
73 //*****************************************************************************\r
74 #define PMAP_ENABLE_RECONFIGURATION PMAPRECFG\r
75 #define PMAP_DISABLE_RECONFIGURATION 0x00\r
76 \r
77 //*****************************************************************************\r
78 //\r
79 // Prototypes for the APIs.\r
80 //\r
81 //*****************************************************************************\r
82 extern void PMAP_initPorts(uint16_t baseAddress,\r
83 PMAP_initPortsParam *param);\r
84 \r
85 //*****************************************************************************\r
86 //\r
87 // The following are deprecated APIs.\r
88 //\r
89 //*****************************************************************************\r
90 extern void PMAP_configurePorts(uint16_t baseAddress,\r
91 const uint8_t *portMapping,\r
92 uint8_t *PxMAPy,\r
93 uint8_t numberOfPorts,\r
94 uint8_t portMapReconfigure);\r
95 \r
96 //*****************************************************************************\r
97 //\r
98 // Mark the end of the C bindings section for C++ compilers.\r
99 //\r
100 //*****************************************************************************\r
101 #ifdef __cplusplus\r
102 }\r
103 #endif\r
104 \r
105 #endif\r
106 #endif // __MSP430WARE_PMAP_H__\r