1    import ti.catalog.msp430.peripherals.adc.ADC10 as ADC10;
     2    
     3    /*!
     4     *  ======== GPIO for MSP430x22xx ========
     5     *  MSP430 General Purpose Input Output Ports
     6     */
     7    metaonly module GPIO_MSP430x22xx inherits IGPIO {
     8        /*!
     9         *  ======== create ========
    10         *  Create an instance of this peripheral
    11         */
    12            create(ADC10.Instance adc10);
    13            
    14    instance:
    15        /*! @_nodoc */
    16        config ADC10.Instance adc10;
    17    
    18       /*! Define an array to describe all device pins. The 1st dimension
    19        *  denotes the port, the second the pin on that port. On an
    20        *  MSP430F22xx device, there are 4 x 8 = 32 pins total.
    21        */
    22            
    23            /* AD: This here should really be a module-wide feature, rather than an instance feature,
    24             * however due to limitations in the current XDCtools 3.21.0.0 the data is located here */
    25        metaonly readonly config DevicePin_t devicePins[4][8] =
    26        [
    27            [
    28                {
    29                    pinName : "P1.0",
    30                    pinFunction : {
    31                        functionName : [
    32                            "GPIO Input",
    33                            "GPIO Output",
    34                            "Timer_A3.TACLK",
    35                            "ADC10CLK"
    36                        ],
    37                        functionConfig : [
    38                            [
    39                                { register : "P1DIR", bitSetMask : 0x00, bitClearMask : 0x01 },
    40                                { register : "P1SEL", bitSetMask : 0x00, bitClearMask : 0x01 }
    41                            ],
    42                            [
    43                                { register : "P1DIR", bitSetMask : 0x01, bitClearMask : 0x00 },
    44                                { register : "P1SEL", bitSetMask : 0x00, bitClearMask : 0x01 }
    45                            ],
    46                            [
    47                                { register : "P1DIR", bitSetMask : 0x00, bitClearMask : 0x01 },
    48                                { register : "P1SEL", bitSetMask : 0x01, bitClearMask : 0x00 }
    49                            ],
    50                            [
    51                                { register : "P1DIR", bitSetMask : 0x01, bitClearMask : 0x00 },
    52                                { register : "P1SEL", bitSetMask : 0x01, bitClearMask : 0x00 }
    53                            ]
    54                        ]
    55                    }
    56                },
    57                {
    58                    pinName : "P1.1",
    59                    pinFunction : {
    60                        functionName : [
    61                            "GPIO Input",
    62                            "GPIO Output",
    63                            "Timer_A3.CCI0A",
    64                            "Timer_A3.TA0"
    65                        ],
    66                        functionConfig : [
    67                            [
    68                                { register : "P1DIR", bitSetMask : 0x00, bitClearMask : 0x02 },
    69                                { register : "P1SEL", bitSetMask : 0x00, bitClearMask : 0x02 }
    70                            ],
    71                            [
    72                                { register : "P1DIR", bitSetMask : 0x02, bitClearMask : 0x00 },
    73                                { register : "P1SEL", bitSetMask : 0x00, bitClearMask : 0x02 }
    74                            ],
    75                            [
    76                                { register : "P1DIR", bitSetMask : 0x00, bitClearMask : 0x02 },
    77                                { register : "P1SEL", bitSetMask : 0x02, bitClearMask : 0x00 }
    78                            ],
    79                            [
    80                                { register : "P1DIR", bitSetMask : 0x02, bitClearMask : 0x00 },
    81                                { register : "P1SEL", bitSetMask : 0x02, bitClearMask : 0x00 }
    82                            ]
    83                        ]
    84                    }
    85                },
    86                {
    87                    pinName : "P1.2",
    88                    pinFunction : {
    89                        functionName : [
    90                            "GPIO Input",
    91                            "GPIO Output",
    92                            "Timer_A3.CCI1A",
    93                            "Timer_A3.TA1"
    94                        ],
    95                        functionConfig : [
    96                            [
    97                                { register : "P1DIR", bitSetMask : 0x00, bitClearMask : 0x04 },
    98                                { register : "P1SEL", bitSetMask : 0x00, bitClearMask : 0x04 }
    99                            ],
   100                            [
   101                                { register : "P1DIR", bitSetMask : 0x04, bitClearMask : 0x00 },
   102                                { register : "P1SEL", bitSetMask : 0x00, bitClearMask : 0x04 }
   103                            ],
   104                            [
   105                                { register : "P1DIR", bitSetMask : 0x00, bitClearMask : 0x04 },
   106                                { register : "P1SEL", bitSetMask : 0x04, bitClearMask : 0x00 }
   107                            ],
   108                            [
   109                                { register : "P1DIR", bitSetMask : 0x04, bitClearMask : 0x00 },
   110                                { register : "P1SEL", bitSetMask : 0x04, bitClearMask : 0x00 }
   111                            ]
   112                        ]
   113                    }
   114                },
   115                {
   116                    pinName : "P1.3",
   117                    pinFunction : {
   118                        functionName : [
   119                            "GPIO Input",
   120                            "GPIO Output",
   121                            "Timer_A3.CCI2A",
   122                            "Timer_A3.TA2"
   123                        ],
   124                        functionConfig : [
   125                            [
   126                                { register : "P1DIR", bitSetMask : 0x00, bitClearMask : 0x08 },
   127                                { register : "P1SEL", bitSetMask : 0x00, bitClearMask : 0x08 }
   128                            ],
   129                            [
   130                                { register : "P1DIR", bitSetMask : 0x08, bitClearMask : 0x00 },
   131                                { register : "P1SEL", bitSetMask : 0x00, bitClearMask : 0x08 }
   132                            ],
   133                            [
   134                                { register : "P1DIR", bitSetMask : 0x00, bitClearMask : 0x08 },
   135                                { register : "P1SEL", bitSetMask : 0x08, bitClearMask : 0x00 }
   136                            ],
   137                            [
   138                                { register : "P1DIR", bitSetMask : 0x08, bitClearMask : 0x00 },
   139                                { register : "P1SEL", bitSetMask : 0x08, bitClearMask : 0x00 }
   140                            ]
   141                        ]
   142                    }
   143                },
   144                {
   145                    pinName : "P1.4",
   146                    pinFunction : {
   147                        functionName : [
   148                            "GPIO Input",
   149                            "GPIO Output",
   150                            "SMCLK"
   151                        ],
   152                        functionConfig : [
   153                            [
   154                                { register : "P1DIR", bitSetMask : 0x00, bitClearMask : 0x10 },
   155                                { register : "P1SEL", bitSetMask : 0x00, bitClearMask : 0x10 }
   156                            ],
   157                            [
   158                                { register : "P1DIR", bitSetMask : 0x10, bitClearMask : 0x00 },
   159                                { register : "P1SEL", bitSetMask : 0x00, bitClearMask : 0x10 }
   160                            ],
   161                            [
   162                                { register : "P1DIR", bitSetMask : 0x10, bitClearMask : 0x00 },
   163                                { register : "P1SEL", bitSetMask : 0x10, bitClearMask : 0x00 }
   164                            ]
   165                        ]
   166                    }
   167                },
   168                {
   169                    pinName : "P1.5",
   170                    pinFunction : {
   171                        functionName : [
   172                            "GPIO Input",
   173                            "GPIO Output",
   174                            "Timer_A3.TA0"
   175                        ],
   176                        functionConfig : [
   177                            [
   178                                { register : "P1DIR", bitSetMask : 0x00, bitClearMask : 0x20 },
   179                                { register : "P1SEL", bitSetMask : 0x00, bitClearMask : 0x20 }
   180                            ],
   181                            [
   182                                { register : "P1DIR", bitSetMask : 0x20, bitClearMask : 0x00 },
   183                                { register : "P1SEL", bitSetMask : 0x00, bitClearMask : 0x20 }
   184                            ],
   185                            [
   186                                { register : "P1DIR", bitSetMask : 0x20, bitClearMask : 0x00 },
   187                                { register : "P1SEL", bitSetMask : 0x20, bitClearMask : 0x00 }
   188                            ]
   189                        ]
   190                    }
   191                },
   192                {
   193                    pinName : "P1.6",
   194                    pinFunction : {
   195                        functionName : [
   196                            "GPIO Input",
   197                            "GPIO Output",
   198                            "Timer_A3.TA1"
   199                        ],
   200                        functionConfig : [
   201                            [
   202                                { register : "P1DIR", bitSetMask : 0x00, bitClearMask : 0x40 },
   203                                { register : "P1SEL", bitSetMask : 0x00, bitClearMask : 0x40 }
   204                            ],
   205                            [
   206                                { register : "P1DIR", bitSetMask : 0x40, bitClearMask : 0x00 },
   207                                { register : "P1SEL", bitSetMask : 0x00, bitClearMask : 0x40 }
   208                            ],
   209                            [
   210                                { register : "P1DIR", bitSetMask : 0x40, bitClearMask : 0x00 },
   211                                { register : "P1SEL", bitSetMask : 0x40, bitClearMask : 0x00 }
   212                            ]
   213                        ]
   214                    }
   215                },
   216                {
   217                    pinName : "P1.7",
   218                    pinFunction : {
   219                        functionName : [
   220                            "GPIO Input",
   221                            "GPIO Output",
   222                            "Timer_A3.TA2"
   223                        ],
   224                        functionConfig : [
   225                            [
   226                                { register : "P1DIR", bitSetMask : 0x00, bitClearMask : 0x80 },
   227                                { register : "P1SEL", bitSetMask : 0x00, bitClearMask : 0x80 }
   228                            ],
   229                            [
   230                                { register : "P1DIR", bitSetMask : 0x80, bitClearMask : 0x00 },
   231                                { register : "P1SEL", bitSetMask : 0x00, bitClearMask : 0x80 }
   232                            ],
   233                            [
   234                                { register : "P1DIR", bitSetMask : 0x80, bitClearMask : 0x00 },
   235                                { register : "P1SEL", bitSetMask : 0x80, bitClearMask : 0x00 }
   236                            ]
   237                        ]
   238                    }
   239                }
   240            ],
   241            [
   242                {
   243                    pinName : "P2.0",
   244                    pinFunction : {
   245                        functionName : [
   246                            "GPIO Input",
   247                            "GPIO Output",
   248                            "ACLK",
   249                            "A0/OA0I0"
   250                        ],
   251                        functionConfig : [
   252                            [
   253                                { register : "P2DIR", bitSetMask : 0x00, bitClearMask : 0x01 },
   254                                { register : "P2SEL", bitSetMask : 0x00, bitClearMask : 0x01 }
   255                            ],
   256                            [
   257                                { register : "P2DIR", bitSetMask : 0x01, bitClearMask : 0x00 },
   258                                { register : "P2SEL", bitSetMask : 0x00, bitClearMask : 0x01 }
   259                            ],
   260                            [
   261                                { register : "P2DIR", bitSetMask : 0x01, bitClearMask : 0x00 },
   262                                { register : "P2SEL", bitSetMask : 0x01, bitClearMask : 0x00 }
   263                            ],
   264                            [
   265                                { register : "ADC10AE0", bitSetMask : 0x01, bitClearMask : 0x00 }
   266                            ]
   267                        ]
   268                    }
   269                },
   270                {
   271                    pinName : "P2.1",
   272                    pinFunction : {
   273                        functionName : [
   274                            "GPIO Input",
   275                            "GPIO Output",
   276                            "Timer_A3.INCLK",
   277                            "SMCLK",
   278                            "A1/OA0O"
   279                        ],
   280                        functionConfig : [
   281                            [
   282                                { register : "P2DIR", bitSetMask : 0x00, bitClearMask : 0x02 },
   283                                { register : "P2SEL", bitSetMask : 0x00, bitClearMask : 0x02 }
   284                            ],
   285                            [
   286                                { register : "P2DIR", bitSetMask : 0x02, bitClearMask : 0x00 },
   287                                { register : "P2SEL", bitSetMask : 0x00, bitClearMask : 0x02 }
   288                            ],
   289                            [
   290                                { register : "P2DIR", bitSetMask : 0x00, bitClearMask : 0x02 },
   291                                { register : "P2SEL", bitSetMask : 0x02, bitClearMask : 0x00 }
   292                            ],
   293                            [
   294                                { register : "P2DIR", bitSetMask : 0x02, bitClearMask : 0x00 },
   295                                { register : "P2SEL", bitSetMask : 0x02, bitClearMask : 0x00 }
   296                            ],
   297                            [
   298                                { register : "ADC10AE0", bitSetMask : 0x02, bitClearMask : 0x00 }
   299                            ]
   300                        ]
   301                    }
   302                },
   303                {
   304                    pinName : "P2.2",
   305                    pinFunction : {
   306                        functionName : [
   307                            "GPIO Input",
   308                            "GPIO Output",
   309                            "Timer_A3.CCI0B",
   310                            "Timer_A3.TA0",
   311                            "A2/OA0I1"
   312                        ],
   313                        functionConfig : [
   314                            [
   315                                { register : "P2DIR", bitSetMask : 0x00, bitClearMask : 0x04 },
   316                                { register : "P2SEL", bitSetMask : 0x00, bitClearMask : 0x04 }
   317                            ],
   318                            [
   319                                { register : "P2DIR", bitSetMask : 0x04, bitClearMask : 0x00 },
   320                                { register : "P2SEL", bitSetMask : 0x00, bitClearMask : 0x04 }
   321                            ],
   322                            [
   323                                { register : "P2DIR", bitSetMask : 0x00, bitClearMask : 0x04 },
   324                                { register : "P2SEL", bitSetMask : 0x04, bitClearMask : 0x00 }
   325                            ],
   326                            [
   327                                { register : "P2DIR", bitSetMask : 0x04, bitClearMask : 0x00 },
   328                                { register : "P2SEL", bitSetMask : 0x04, bitClearMask : 0x00 }
   329                            ],
   330                            [
   331                                { register : "ADC10AE0", bitSetMask : 0x04, bitClearMask : 0x00 }
   332                            ]
   333                        ]
   334                    }
   335                },
   336                {
   337                    pinName : "P2.3",
   338                    pinFunction : {
   339                        functionName : [
   340                            "GPIO Input",
   341                            "GPIO Output",
   342                            "Timer_A3.TACLK",
   343                            "ADC10CLK",
   344                            "A3/VREF--/VeREF--/OA1I1/OA1O"
   345                        ],
   346                        functionConfig : [
   347                            [
   348                                { register : "P2DIR", bitSetMask : 0x00, bitClearMask : 0x08 },
   349                                { register : "P2SEL", bitSetMask : 0x00, bitClearMask : 0x08 }
   350                            ],
   351                            [
   352                                { register : "P2DIR", bitSetMask : 0x08, bitClearMask : 0x00 },
   353                                { register : "P2SEL", bitSetMask : 0x00, bitClearMask : 0x08 }
   354                            ],
   355                            [
   356                                { register : "P2DIR", bitSetMask : 0x00, bitClearMask : 0x08 },
   357                                { register : "P2SEL", bitSetMask : 0x08, bitClearMask : 0x00 }
   358                            ],
   359                            [
   360                                { register : "P2DIR", bitSetMask : 0x08, bitClearMask : 0x00 },
   361                                { register : "P2SEL", bitSetMask : 0x08, bitClearMask : 0x00 }
   362                            ],
   363                            [
   364                                { register : "ADC10AE0", bitSetMask : 0x08, bitClearMask : 0x00 }
   365                            ]
   366                        ]
   367                    }
   368                },
   369                {
   370                    pinName : "P2.4",
   371                    pinFunction : {
   372                        functionName : [
   373                            "GPIO Input",
   374                            "GPIO Output",
   375                            "Timer_A3.TA2",
   376                            "A4/VREF+/VeREF+/OA1I0"
   377                        ],
   378                        functionConfig : [
   379                            [
   380                                { register : "P2DIR", bitSetMask : 0x00, bitClearMask : 0x10 },
   381                                { register : "P2SEL", bitSetMask : 0x00, bitClearMask : 0x10 }
   382                            ],
   383                            [
   384                                { register : "P2DIR", bitSetMask : 0x10, bitClearMask : 0x00 },
   385                                { register : "P2SEL", bitSetMask : 0x00, bitClearMask : 0x10 }
   386                            ],
   387                            [
   388                                { register : "P2DIR", bitSetMask : 0x10, bitClearMask : 0x00 },
   389                                { register : "P2SEL", bitSetMask : 0x10, bitClearMask : 0x00 }
   390                            ],
   391                            [
   392                                { register : "ADC10AE0", bitSetMask : 0x10, bitClearMask : 0x00 }
   393                            ]
   394                        ]
   395                    }
   396                },
   397                {
   398                    pinName : "P2.5",
   399                    pinFunction : {
   400                        functionName : [
   401                            "GPIO Input",
   402                            "GPIO Output",
   403                            "DVSS",
   404                            "ROSC"
   405                        ],
   406                        functionConfig : [
   407                            [
   408                                { register : "P2DIR", bitSetMask : 0x00, bitClearMask : 0x20 },
   409                                { register : "P2SEL", bitSetMask : 0x00, bitClearMask : 0x20 }
   410                            ],
   411                            [
   412                                { register : "P2DIR", bitSetMask : 0x20, bitClearMask : 0x00 },
   413                                { register : "P2SEL", bitSetMask : 0x00, bitClearMask : 0x20 }
   414                            ],
   415                            [
   416                                { register : "P2DIR", bitSetMask : 0x20, bitClearMask : 0x00 },
   417                                { register : "P2SEL", bitSetMask : 0x20, bitClearMask : 0x00 }
   418                            ],
   419                            [
   420    
   421                            ]
   422                        ]
   423                    }
   424                },
   425                {
   426                    pinName : "P2.6",
   427                    pinFunction : {
   428                        functionName : [
   429                            "GPIO Input",
   430                            "GPIO Output",
   431                            "XIN"
   432                        ],
   433                        functionConfig : [
   434                            [
   435                                { register : "P2DIR", bitSetMask : 0x00, bitClearMask : 0x40 },
   436                                { register : "P2SEL", bitSetMask : 0x00, bitClearMask : 0x40 }
   437                            ],
   438                            [
   439                                { register : "P2DIR", bitSetMask : 0x40, bitClearMask : 0x00 },
   440                                { register : "P2SEL", bitSetMask : 0x00, bitClearMask : 0x40 }
   441                            ],
   442                            [
   443                                { register : "P2SEL", bitSetMask : 0x40, bitClearMask : 0x00 }
   444                            ]
   445                        ]
   446                    }
   447                },
   448                {
   449                    pinName : "P2.7",
   450                    pinFunction : {
   451                        functionName : [
   452                            "GPIO Input",
   453                            "GPIO Output",
   454                            "XOUT"
   455                        ],
   456                        functionConfig : [
   457                            [
   458                                { register : "P2DIR", bitSetMask : 0x00, bitClearMask : 0x80 },
   459                                { register : "P2SEL", bitSetMask : 0x00, bitClearMask : 0x80 }
   460                            ],
   461                            [
   462                                { register : "P2DIR", bitSetMask : 0x80, bitClearMask : 0x00 },
   463                                { register : "P2SEL", bitSetMask : 0x00, bitClearMask : 0x80 }
   464                            ],
   465                            [
   466                                { register : "P2SEL", bitSetMask : 0x80, bitClearMask : 0x00 }
   467                            ]
   468                        ]
   469                    }
   470                }
   471            ],
   472            [
   473                {
   474                    pinName : "P3.0",
   475                    pinFunction : {
   476                        functionName : [
   477                            "GPIO Input",
   478                            "GPIO Output",
   479                            "UCB0STE/UCA0CLK",
   480                            "A5"
   481                        ],
   482                        functionConfig : [
   483                            [
   484                                { register : "P3DIR", bitSetMask : 0x00, bitClearMask : 0x01 },
   485                                { register : "P3SEL", bitSetMask : 0x00, bitClearMask : 0x01 }
   486                            ],
   487                            [
   488                                { register : "P3DIR", bitSetMask : 0x01, bitClearMask : 0x00 },
   489                                { register : "P3SEL", bitSetMask : 0x00, bitClearMask : 0x01 }
   490                            ],
   491                            [
   492                                { register : "P3SEL", bitSetMask : 0x01, bitClearMask : 0x00 }
   493                            ],
   494                            [
   495                                { register : "ADC10AE0", bitSetMask : 0x01, bitClearMask : 0x00 }
   496                            ]
   497                        ]
   498                    }
   499                },
   500                {
   501                    pinName : "P3.1",
   502                    pinFunction : {
   503                        functionName : [
   504                            "GPIO Input",
   505                            "GPIO Output",
   506                            "UCB0SIMO/UCB0SDA"
   507                        ],
   508                        functionConfig : [
   509                            [
   510                                { register : "P3DIR", bitSetMask : 0x00, bitClearMask : 0x02 },
   511                                { register : "P3SEL", bitSetMask : 0x00, bitClearMask : 0x02 }
   512                            ],
   513                            [
   514                                { register : "P3DIR", bitSetMask : 0x02, bitClearMask : 0x00 },
   515                                { register : "P3SEL", bitSetMask : 0x00, bitClearMask : 0x02 }
   516                            ],
   517                            [
   518                                { register : "P3SEL", bitSetMask : 0x02, bitClearMask : 0x00 }
   519                            ]
   520                        ]
   521                    }
   522                },
   523                {
   524                    pinName : "P3.2",
   525                    pinFunction : {
   526                        functionName : [
   527                            "GPIO Input",
   528                            "GPIO Output",
   529                            "UCB0SOMI/UCB0SCL"
   530                        ],
   531                        functionConfig : [
   532                            [
   533                                { register : "P3DIR", bitSetMask : 0x00, bitClearMask : 0x04 },
   534                                { register : "P3SEL", bitSetMask : 0x00, bitClearMask : 0x04 }
   535                            ],
   536                            [
   537                                { register : "P3DIR", bitSetMask : 0x04, bitClearMask : 0x00 },
   538                                { register : "P3SEL", bitSetMask : 0x00, bitClearMask : 0x04 }
   539                            ],
   540                            [
   541                                { register : "P3SEL", bitSetMask : 0x04, bitClearMask : 0x00 }
   542                            ]
   543                        ]
   544                    }
   545                },
   546                {
   547                    pinName : "P3.3",
   548                    pinFunction : {
   549                        functionName : [
   550                            "GPIO Input",
   551                            "GPIO Output",
   552                            "UCB0CLK/UCA0STE"
   553                        ],
   554                        functionConfig : [
   555                            [
   556                                { register : "P3DIR", bitSetMask : 0x00, bitClearMask : 0x08 },
   557                                { register : "P3SEL", bitSetMask : 0x00, bitClearMask : 0x08 }
   558                            ],
   559                            [
   560                                { register : "P3DIR", bitSetMask : 0x08, bitClearMask : 0x00 },
   561                                { register : "P3SEL", bitSetMask : 0x00, bitClearMask : 0x08 }
   562                            ],
   563                            [
   564                                { register : "P3SEL", bitSetMask : 0x08, bitClearMask : 0x00 }
   565                            ]
   566                        ]
   567                    }
   568                },
   569                {
   570                    pinName : "P3.4",
   571                    pinFunction : {
   572                        functionName : [
   573                            "GPIO Input",
   574                            "GPIO Output",
   575                            "UCA0TXD/UCA0SIMO"
   576                        ],
   577                        functionConfig : [
   578                            [
   579                                { register : "P3DIR", bitSetMask : 0x00, bitClearMask : 0x10 },
   580                                { register : "P3SEL", bitSetMask : 0x00, bitClearMask : 0x10 }
   581                            ],
   582                            [
   583                                { register : "P3DIR", bitSetMask : 0x10, bitClearMask : 0x00 },
   584                                { register : "P3SEL", bitSetMask : 0x00, bitClearMask : 0x10 }
   585                            ],
   586                            [
   587                                { register : "P3SEL", bitSetMask : 0x10, bitClearMask : 0x00 }
   588                            ]
   589                        ]
   590                    }
   591                },
   592                {
   593                    pinName : "P3.5",
   594                    pinFunction : {
   595                        functionName : [
   596                            "GPIO Input",
   597                            "GPIO Output",
   598                            "UCA0RXD/UCA0SOMI"
   599                        ],
   600                        functionConfig : [
   601                            [
   602                                { register : "P3DIR", bitSetMask : 0x00, bitClearMask : 0x20 },
   603                                { register : "P3SEL", bitSetMask : 0x00, bitClearMask : 0x20 }
   604                            ],
   605                            [
   606                                { register : "P3DIR", bitSetMask : 0x20, bitClearMask : 0x00 },
   607                                { register : "P3SEL", bitSetMask : 0x00, bitClearMask : 0x20 }
   608                            ],
   609                            [
   610                                { register : "P3SEL", bitSetMask : 0x20, bitClearMask : 0x00 }
   611                            ]
   612                        ]
   613                    }
   614                },
   615                {
   616                    pinName : "P3.6",
   617                    pinFunction : {
   618                        functionName : [
   619                            "GPIO Input",
   620                            "GPIO Output",
   621                            "A6/OA0I2"
   622                        ],
   623                        functionConfig : [
   624                            [
   625                                { register : "P3DIR", bitSetMask : 0x00, bitClearMask : 0x40 },
   626                                { register : "P3SEL", bitSetMask : 0x00, bitClearMask : 0x40 }
   627                            ],
   628                            [
   629                                { register : "P3DIR", bitSetMask : 0x40, bitClearMask : 0x00 },
   630                                { register : "P3SEL", bitSetMask : 0x00, bitClearMask : 0x40 }
   631                            ],
   632                            [
   633                                { register : "ADC10AE0", bitSetMask : 0x40, bitClearMask : 0x00 }
   634                            ]
   635                        ]
   636                    }
   637                },
   638                {
   639                    pinName : "P3.7",
   640                    pinFunction : {
   641                        functionName : [
   642                            "GPIO Input",
   643                            "GPIO Output",
   644                            "A7/OA1I2"
   645                        ],
   646                        functionConfig : [
   647                            [
   648                                { register : "P3DIR", bitSetMask : 0x00, bitClearMask : 0x80 },
   649                                { register : "P3SEL", bitSetMask : 0x00, bitClearMask : 0x80 }
   650                            ],
   651                            [
   652                                { register : "P3DIR", bitSetMask : 0x80, bitClearMask : 0x00 },
   653                                { register : "P3SEL", bitSetMask : 0x00, bitClearMask : 0x80 }
   654                            ],
   655                            [
   656                                { register : "ADC10AE0", bitSetMask : 0x80, bitClearMask : 0x00 }
   657                            ]
   658                        ]
   659                    }
   660                }
   661            ],
   662            [
   663                {
   664                    pinName : "P4.0",
   665                    pinFunction : {
   666                        functionName : [
   667                            "GPIO Input",
   668                            "GPIO Output",
   669                            "Timer_B3.CCI0A",
   670                            "Timer_B3.TB0"
   671                        ],
   672                        functionConfig : [
   673                            [
   674                                { register : "P4DIR", bitSetMask : 0x00, bitClearMask : 0x01 },
   675                                { register : "P4SEL", bitSetMask : 0x00, bitClearMask : 0x01 }
   676                            ],
   677                            [
   678                                { register : "P4DIR", bitSetMask : 0x01, bitClearMask : 0x00 },
   679                                { register : "P4SEL", bitSetMask : 0x00, bitClearMask : 0x01 }
   680                            ],
   681                            [
   682                                { register : "P4DIR", bitSetMask : 0x00, bitClearMask : 0x01 },
   683                                { register : "P4SEL", bitSetMask : 0x01, bitClearMask : 0x00 }
   684                            ],
   685                            [
   686                                { register : "P4DIR", bitSetMask : 0x01, bitClearMask : 0x00 },
   687                                { register : "P4SEL", bitSetMask : 0x01, bitClearMask : 0x00 }
   688                            ]
   689                        ]
   690                    }
   691                },
   692                {
   693                    pinName : "P4.1",
   694                    pinFunction : {
   695                        functionName : [
   696                            "GPIO Input",
   697                            "GPIO Output",
   698                            "Timer_B3.CCI1A",
   699                            "Timer_B3.TB1"
   700                        ],
   701                        functionConfig : [
   702                            [
   703                                { register : "P4DIR", bitSetMask : 0x00, bitClearMask : 0x02 },
   704                                { register : "P4SEL", bitSetMask : 0x00, bitClearMask : 0x02 }
   705                            ],
   706                            [
   707                                { register : "P4DIR", bitSetMask : 0x02, bitClearMask : 0x00 },
   708                                { register : "P4SEL", bitSetMask : 0x00, bitClearMask : 0x02 }
   709                            ],
   710                            [
   711                                { register : "P4DIR", bitSetMask : 0x00, bitClearMask : 0x02 },
   712                                { register : "P4SEL", bitSetMask : 0x02, bitClearMask : 0x00 }
   713                            ],
   714                            [
   715                                { register : "P4DIR", bitSetMask : 0x02, bitClearMask : 0x00 },
   716                                { register : "P4SEL", bitSetMask : 0x02, bitClearMask : 0x00 }
   717                            ]
   718                        ]
   719                    }
   720                },
   721                {
   722                    pinName : "P4.2",
   723                    pinFunction : {
   724                        functionName : [
   725                            "GPIO Input",
   726                            "GPIO Output",
   727                            "Timer_B3.CCI2A",
   728                            "Timer_B3.TB2"
   729                        ],
   730                        functionConfig : [
   731                            [
   732                                { register : "P4DIR", bitSetMask : 0x00, bitClearMask : 0x04 },
   733                                { register : "P4SEL", bitSetMask : 0x00, bitClearMask : 0x04 }
   734                            ],
   735                            [
   736                                { register : "P4DIR", bitSetMask : 0x04, bitClearMask : 0x00 },
   737                                { register : "P4SEL", bitSetMask : 0x00, bitClearMask : 0x04 }
   738                            ],
   739                            [
   740                                { register : "P4DIR", bitSetMask : 0x00, bitClearMask : 0x04 },
   741                                { register : "P4SEL", bitSetMask : 0x04, bitClearMask : 0x00 }
   742                            ],
   743                            [
   744                                { register : "P4DIR", bitSetMask : 0x04, bitClearMask : 0x00 },
   745                                { register : "P4SEL", bitSetMask : 0x04, bitClearMask : 0x00 }
   746                            ]
   747                        ]
   748                    }
   749                },
   750                {
   751                    pinName : "P4.3",
   752                    pinFunction : {
   753                        functionName : [
   754                            "GPIO Input",
   755                            "GPIO Output",
   756                            "Timer_B3.CCI0B",
   757                            "Timer_B3.TB0",
   758                            "A12/OA0O"
   759                        ],
   760                        functionConfig : [
   761                            [
   762                                { register : "P4DIR", bitSetMask : 0x00, bitClearMask : 0x08 },
   763                                { register : "P4SEL", bitSetMask : 0x00, bitClearMask : 0x08 }
   764                            ],
   765                            [
   766                                { register : "P4DIR", bitSetMask : 0x08, bitClearMask : 0x00 },
   767                                { register : "P4SEL", bitSetMask : 0x00, bitClearMask : 0x08 }
   768                            ],
   769                            [
   770                                { register : "P4DIR", bitSetMask : 0x00, bitClearMask : 0x08 },
   771                                { register : "P4SEL", bitSetMask : 0x08, bitClearMask : 0x00 }
   772                            ],
   773                            [
   774                                { register : "P4DIR", bitSetMask : 0x08, bitClearMask : 0x00 },
   775                                { register : "P4SEL", bitSetMask : 0x08, bitClearMask : 0x00 }
   776                            ],
   777                            [
   778                                { register : "ADC10AE1", bitSetMask : 0x08, bitClearMask : 0x00 }
   779                            ]
   780                        ]
   781                    }
   782                },
   783                {
   784                    pinName : "P4.4",
   785                    pinFunction : {
   786                        functionName : [
   787                            "GPIO Input",
   788                            "GPIO Output",
   789                            "Timer_B3.CCI1B",
   790                            "Timer_B3.TB1",
   791                            "A13/OA1O"
   792                        ],
   793                        functionConfig : [
   794                            [
   795                                { register : "P4DIR", bitSetMask : 0x00, bitClearMask : 0x10 },
   796                                { register : "P4SEL", bitSetMask : 0x00, bitClearMask : 0x10 }
   797                            ],
   798                            [
   799                                { register : "P4DIR", bitSetMask : 0x10, bitClearMask : 0x00 },
   800                                { register : "P4SEL", bitSetMask : 0x00, bitClearMask : 0x10 }
   801                            ],
   802                            [
   803                                { register : "P4DIR", bitSetMask : 0x00, bitClearMask : 0x10 },
   804                                { register : "P4SEL", bitSetMask : 0x10, bitClearMask : 0x00 }
   805                            ],
   806                            [
   807                                { register : "P4DIR", bitSetMask : 0x10, bitClearMask : 0x00 },
   808                                { register : "P4SEL", bitSetMask : 0x10, bitClearMask : 0x00 }
   809                            ],
   810                            [
   811                                { register : "ADC10AE1", bitSetMask : 0x10, bitClearMask : 0x00 }
   812                            ]
   813                        ]
   814                    }
   815                },
   816                {
   817                    pinName : "P4.5",
   818                    pinFunction : {
   819                        functionName : [
   820                            "GPIO Input",
   821                            "GPIO Output",
   822                            "Timer_B3.TB2",
   823                            "A14/OA0I3"
   824                        ],
   825                        functionConfig : [
   826                            [
   827                                { register : "P4DIR", bitSetMask : 0x00, bitClearMask : 0x20 },
   828                                { register : "P4SEL", bitSetMask : 0x00, bitClearMask : 0x20 }
   829                            ],
   830                            [
   831                                { register : "P4DIR", bitSetMask : 0x20, bitClearMask : 0x00 },
   832                                { register : "P4SEL", bitSetMask : 0x00, bitClearMask : 0x20 }
   833                            ],
   834                            [
   835                                { register : "P4DIR", bitSetMask : 0x20, bitClearMask : 0x00 },
   836                                { register : "P4SEL", bitSetMask : 0x20, bitClearMask : 0x00 }
   837                            ],
   838                            [
   839                                { register : "ADC10AE1", bitSetMask : 0x20, bitClearMask : 0x00 }
   840                            ]
   841                        ]
   842                    }
   843                },
   844                {
   845                    pinName : "P4.6",
   846                    pinFunction : {
   847                        functionName : [
   848                            "GPIO Input",
   849                            "GPIO Output",
   850                            "TBOUTH",
   851                            "DVSS",
   852                            "A15/OA1I3"
   853                        ],
   854                        functionConfig : [
   855                            [
   856                                { register : "P4DIR", bitSetMask : 0x00, bitClearMask : 0x40 },
   857                                { register : "P4SEL", bitSetMask : 0x00, bitClearMask : 0x40 }
   858                            ],
   859                            [
   860                                { register : "P4DIR", bitSetMask : 0x40, bitClearMask : 0x00 },
   861                                { register : "P4SEL", bitSetMask : 0x00, bitClearMask : 0x40 }
   862                            ],
   863                            [
   864                                { register : "P4DIR", bitSetMask : 0x00, bitClearMask : 0x40 },
   865                                { register : "P4SEL", bitSetMask : 0x40, bitClearMask : 0x00 }
   866                            ],
   867                            [
   868                                { register : "P4DIR", bitSetMask : 0x40, bitClearMask : 0x00 },
   869                                { register : "P4SEL", bitSetMask : 0x40, bitClearMask : 0x00 }
   870                            ],
   871                            [
   872                                { register : "ADC10AE1", bitSetMask : 0x40, bitClearMask : 0x00 }
   873                            ]
   874                        ]
   875                    }
   876                },
   877                {
   878                    pinName : "P4.7",
   879                    pinFunction : {
   880                        functionName : [
   881                            "GPIO Input",
   882                            "GPIO Output",
   883                            "Timer_B3.TBCLK",
   884                            "DVSS"
   885                        ],
   886                        functionConfig : [
   887                            [
   888                                { register : "P4DIR", bitSetMask : 0x00, bitClearMask : 0x80 },
   889                                { register : "P4SEL", bitSetMask : 0x00, bitClearMask : 0x80 }
   890                            ],
   891                            [
   892                                { register : "P4DIR", bitSetMask : 0x80, bitClearMask : 0x00 },
   893                                { register : "P4SEL", bitSetMask : 0x00, bitClearMask : 0x80 }
   894                            ],
   895                            [
   896                                { register : "P4DIR", bitSetMask : 0x00, bitClearMask : 0x80 },
   897                                { register : "P4SEL", bitSetMask : 0x80, bitClearMask : 0x00 }
   898                            ],
   899                            [
   900                                { register : "P4DIR", bitSetMask : 0x80, bitClearMask : 0x00 },
   901                                { register : "P4SEL", bitSetMask : 0x80, bitClearMask : 0x00 }
   902                            ]
   903                        ]
   904                    }
   905                }
   906            ]
   907        ];
   908    
   909            /*! Device Pin Functional Configuration */
   910            metaonly config DevicePinSetting_t devicePinSetting[4][8];
   911    
   912        /*
   913         *  GPIO Digital I/O Registers
   914         *
   915         *  One GIPO instance defines the configuration of an entire,
   916         *  8-bit wide digital I/O port.
   917         */
   918         
   919        /*! Port 1 Output Register */ 
   920        config GpioBits8PxOut_t P1OUT = {
   921            Bit0        : BIT0_OFF,
   922            Bit1        : BIT1_OFF,
   923            Bit2        : BIT2_OFF,
   924            Bit3        : BIT3_OFF,
   925            Bit4        : BIT4_OFF,
   926            Bit5        : BIT5_OFF,
   927            Bit6        : BIT6_OFF,
   928            Bit7        : BIT7_OFF
   929        };
   930    
   931        /*! Port 1 Port Select Register */
   932        config GpioBits8PxSel_t P1SEL = {
   933            Bit0        : BIT0_OFF,
   934            Bit1        : BIT1_OFF,
   935            Bit2        : BIT2_OFF,
   936            Bit3        : BIT3_OFF,
   937            Bit4        : BIT4_OFF,
   938            Bit5        : BIT5_OFF,
   939            Bit6        : BIT6_OFF,
   940            Bit7        : BIT7_OFF
   941        };
   942        
   943        /*! Port 1 Direction Register */
   944        config GpioBits8PxDir_t P1DIR = {
   945            Bit0        : BIT0_OFF,
   946            Bit1        : BIT1_OFF,
   947            Bit2        : BIT2_OFF,
   948            Bit3        : BIT3_OFF,
   949            Bit4        : BIT4_OFF,
   950            Bit5        : BIT5_OFF,
   951            Bit6        : BIT6_OFF,
   952            Bit7        : BIT7_OFF
   953        };
   954        
   955        /*! Port 1 Resistor Enable Register */
   956        config GpioBits8PxRen_t P1REN = {
   957            Bit0        : BIT0_OFF,
   958            Bit1        : BIT1_OFF,
   959            Bit2        : BIT2_OFF,
   960            Bit3        : BIT3_OFF,
   961            Bit4        : BIT4_OFF,
   962            Bit5        : BIT5_OFF,
   963            Bit6        : BIT6_OFF,
   964            Bit7        : BIT7_OFF
   965        };
   966        
   967        /*! Port 1 Interrupt Edge Select Register */
   968        config GpioBits8PxIes_t P1IES = {
   969            Bit0        : BIT0_OFF,
   970            Bit1        : BIT1_OFF,
   971            Bit2        : BIT2_OFF,
   972            Bit3        : BIT3_OFF,
   973            Bit4        : BIT4_OFF,
   974            Bit5        : BIT5_OFF,
   975            Bit6        : BIT6_OFF,
   976            Bit7        : BIT7_OFF
   977        };
   978        
   979        /*! Port 1 Interrupt Flag Register */
   980        config GpioBits8PxIfg_t P1IFG = {
   981            Bit0        : BIT0_OFF,
   982            Bit1        : BIT1_OFF,
   983            Bit2        : BIT2_OFF,
   984            Bit3        : BIT3_OFF,
   985            Bit4        : BIT4_OFF,
   986            Bit5        : BIT5_OFF,
   987            Bit6        : BIT6_OFF,
   988            Bit7        : BIT7_OFF
   989        };
   990        
   991        /*! Port 1 Interrupt Enable Register */
   992        config GpioBits8PxIe_t P1IE = {
   993            Bit0        : BIT0_OFF,
   994            Bit1        : BIT1_OFF,
   995            Bit2        : BIT2_OFF,
   996            Bit3        : BIT3_OFF,
   997            Bit4        : BIT4_OFF,
   998            Bit5        : BIT5_OFF,
   999            Bit6        : BIT6_OFF,
  1000            Bit7        : BIT7_OFF
  1001        };
  1002    
  1003        /*! Port 2 Output Register */ 
  1004        config GpioBits8PxOut_t P2OUT = {
  1005            Bit0        : BIT0_OFF,
  1006            Bit1        : BIT1_OFF,
  1007            Bit2        : BIT2_OFF,
  1008            Bit3        : BIT3_OFF,
  1009            Bit4        : BIT4_OFF,
  1010            Bit5        : BIT5_OFF,
  1011            Bit6        : BIT6_OFF,
  1012            Bit7        : BIT7_OFF
  1013        };
  1014    
  1015        /*! Port 2 Port Select Register */
  1016        config GpioBits8PxSel_t P2SEL = {
  1017            Bit0        : BIT0_OFF,
  1018            Bit1        : BIT1_OFF,
  1019            Bit2        : BIT2_OFF,
  1020            Bit3        : BIT3_OFF,
  1021            Bit4        : BIT4_OFF,
  1022            Bit5        : BIT5_OFF,
  1023            Bit6        : BIT6,         /* POR default for all 2xx devices */
  1024            Bit7        : BIT7          /* POR default for all 2xx devices */
  1025        };
  1026        
  1027        /*! Port 2 Direction Register */
  1028        config GpioBits8PxDir_t P2DIR = {
  1029            Bit0        : BIT0_OFF,
  1030            Bit1        : BIT1_OFF,
  1031            Bit2        : BIT2_OFF,
  1032            Bit3        : BIT3_OFF,
  1033            Bit4        : BIT4_OFF,
  1034            Bit5        : BIT5_OFF,
  1035            Bit6        : BIT6_OFF,
  1036            Bit7        : BIT7_OFF
  1037        };
  1038        
  1039        /*! Port 2 Resistor Enable Register */
  1040        config GpioBits8PxRen_t P2REN = {
  1041            Bit0        : BIT0_OFF,
  1042            Bit1        : BIT1_OFF,
  1043            Bit2        : BIT2_OFF,
  1044            Bit3        : BIT3_OFF,
  1045            Bit4        : BIT4_OFF,
  1046            Bit5        : BIT5_OFF,
  1047            Bit6        : BIT6_OFF,
  1048            Bit7        : BIT7_OFF
  1049        };
  1050        
  1051        /*! Port 2 Interrupt Edge Select Register */
  1052        config GpioBits8PxIes_t P2IES = {
  1053            Bit0        : BIT0_OFF,
  1054            Bit1        : BIT1_OFF,
  1055            Bit2        : BIT2_OFF,
  1056            Bit3        : BIT3_OFF,
  1057            Bit4        : BIT4_OFF,
  1058            Bit5        : BIT5_OFF,
  1059            Bit6        : BIT6_OFF,
  1060            Bit7        : BIT7_OFF
  1061        };
  1062        
  1063        /*! Port 2 Interrupt Flag Register */
  1064        config GpioBits8PxIfg_t P2IFG = {
  1065            Bit0        : BIT0_OFF,
  1066            Bit1        : BIT1_OFF,
  1067            Bit2        : BIT2_OFF,
  1068            Bit3        : BIT3_OFF,
  1069            Bit4        : BIT4_OFF,
  1070            Bit5        : BIT5_OFF,
  1071            Bit6        : BIT6_OFF,
  1072            Bit7        : BIT7_OFF
  1073        };
  1074        
  1075        /*! Port 2 Interrupt Enable Register */
  1076        config GpioBits8PxIe_t P2IE = {
  1077            Bit0        : BIT0_OFF,
  1078            Bit1        : BIT1_OFF,
  1079            Bit2        : BIT2_OFF,
  1080            Bit3        : BIT3_OFF,
  1081            Bit4        : BIT4_OFF,
  1082            Bit5        : BIT5_OFF,
  1083            Bit6        : BIT6_OFF,
  1084            Bit7        : BIT7_OFF
  1085        };
  1086    
  1087        /*! Port 3 Output Register */ 
  1088        config GpioBits8PxOut_t P3OUT = {
  1089            Bit0        : BIT0_OFF,
  1090            Bit1        : BIT1_OFF,
  1091            Bit2        : BIT2_OFF,
  1092            Bit3        : BIT3_OFF,
  1093            Bit4        : BIT4_OFF,
  1094            Bit5        : BIT5_OFF,
  1095            Bit6        : BIT6_OFF,
  1096            Bit7        : BIT7_OFF
  1097        };
  1098    
  1099        /*! Port 3 Port Select Register */
  1100        config GpioBits8PxSel_t P3SEL = {
  1101            Bit0        : BIT0_OFF,
  1102            Bit1        : BIT1_OFF,
  1103            Bit2        : BIT2_OFF,
  1104            Bit3        : BIT3_OFF,
  1105            Bit4        : BIT4_OFF,
  1106            Bit5        : BIT5_OFF,
  1107            Bit6        : BIT6_OFF,
  1108            Bit7        : BIT7_OFF
  1109        };
  1110        
  1111        /*! Port 3 Direction Register */
  1112        config GpioBits8PxDir_t P3DIR = {
  1113            Bit0        : BIT0_OFF,
  1114            Bit1        : BIT1_OFF,
  1115            Bit2        : BIT2_OFF,
  1116            Bit3        : BIT3_OFF,
  1117            Bit4        : BIT4_OFF,
  1118            Bit5        : BIT5_OFF,
  1119            Bit6        : BIT6_OFF,
  1120            Bit7        : BIT7_OFF
  1121        };
  1122        
  1123        /*! Port 3 Resistor Enable Register */
  1124        config GpioBits8PxRen_t P3REN = {
  1125            Bit0        : BIT0_OFF,
  1126            Bit1        : BIT1_OFF,
  1127            Bit2        : BIT2_OFF,
  1128            Bit3        : BIT3_OFF,
  1129            Bit4        : BIT4_OFF,
  1130            Bit5        : BIT5_OFF,
  1131            Bit6        : BIT6_OFF,
  1132            Bit7        : BIT7_OFF
  1133        };
  1134    
  1135        /*! Port 4 Output Register */ 
  1136        config GpioBits8PxOut_t P4OUT = {
  1137            Bit0        : BIT0_OFF,
  1138            Bit1        : BIT1_OFF,
  1139            Bit2        : BIT2_OFF,
  1140            Bit3        : BIT3_OFF,
  1141            Bit4        : BIT4_OFF,
  1142            Bit5        : BIT5_OFF,
  1143            Bit6        : BIT6_OFF,
  1144            Bit7        : BIT7_OFF
  1145        };
  1146    
  1147        /*! Port 4 Port Select Register */
  1148        config GpioBits8PxSel_t P4SEL = {
  1149            Bit0        : BIT0_OFF,
  1150            Bit1        : BIT1_OFF,
  1151            Bit2        : BIT2_OFF,
  1152            Bit3        : BIT3_OFF,
  1153            Bit4        : BIT4_OFF,
  1154            Bit5        : BIT5_OFF,
  1155            Bit6        : BIT6_OFF,
  1156            Bit7        : BIT7_OFF
  1157        };
  1158        
  1159        /*! Port 4 Direction Register */
  1160        config GpioBits8PxDir_t P4DIR = {
  1161            Bit0        : BIT0_OFF,
  1162            Bit1        : BIT1_OFF,
  1163            Bit2        : BIT2_OFF,
  1164            Bit3        : BIT3_OFF,
  1165            Bit4        : BIT4_OFF,
  1166            Bit5        : BIT5_OFF,
  1167            Bit6        : BIT6_OFF,
  1168            Bit7        : BIT7_OFF
  1169        };
  1170        
  1171        /*! Port 4 Resistor Enable Register */
  1172        config GpioBits8PxRen_t P4REN = {
  1173            Bit0        : BIT0_OFF,
  1174            Bit1        : BIT1_OFF,
  1175            Bit2        : BIT2_OFF,
  1176            Bit3        : BIT3_OFF,
  1177            Bit4        : BIT4_OFF,
  1178            Bit5        : BIT5_OFF,
  1179            Bit6        : BIT6_OFF,
  1180            Bit7        : BIT7_OFF
  1181        };
  1182    }