Port mapper responsible for re-mapping functionalities of GPIO pins.
More...
|
void | PMAP_configurePorts (const uint8_t *portMapping, uint8_t pxMAPy, uint8_t numberOfPorts, uint8_t portMapReconfigure) |
|
Port mapper responsible for re-mapping functionalities of GPIO pins.
DriverLib PMAP (Port Mapper) Operation
The port mapping controller allows the flexible and reconfigurable mapping of digital functions to port pins.
The port mapping controller features are:
- Configuration protected by write access key.
- Default mapping provided for each port pin (device-dependent, the device pinout in the device-specific data sheet).
- Mapping can be reconfigured during runtime.
- Each output signal can be mapped to several output pins.
Programming Example
The DriverLib package contains a variety of different code examples that demonstrate the usage of the PMAP module. These code examples are accessible under the examples/ folder of the SDK release as well as through TI Resource Explorer if using Code Composer Studio. These code examples provide a comprehensive list of use cases as well as practical applications involving each module.
Below is a very brief code example showing how to use the PMAP module to redirect the output of a TimerA CCR register.
First is the array configuration to remap the port:
Next is the call to the actual PMAP API that persists the configuration:
#define PMAP_ENABLE_RECONFIGURATION PMAP_CTL_PRECFG |
#define PMAP_DISABLE_RECONFIGURATION 0x00 |
#define PMAP_P1MAP ((uint32_t)P1MAP - PMAP_BASE) |
#define PMAP_P2MAP ((uint32_t)P2MAP - PMAP_BASE) |
#define PMAP_P3MAP ((uint32_t)P3MAP - PMAP_BASE) |
#define PMAP_P4MAP ((uint32_t)P4MAP - PMAP_BASE) |
#define PMAP_P5MAP ((uint32_t)P5MAP - PMAP_BASE) |
#define PMAP_P6MAP ((uint32_t)P6MAP - PMAP_BASE) |
#define PMAP_P7MAP ((uint32_t)P7MAP - PMAP_BASE) |
void PMAP_configurePorts |
( |
const uint8_t * |
portMapping, |
|
|
uint8_t |
pxMAPy, |
|
|
uint8_t |
numberOfPorts, |
|
|
uint8_t |
portMapReconfigure |
|
) |
| |
This function configures the MSP432 Port Mapper
- Parameters
-
portMapping | is the pointer to init Data |
pxMAPy | is the Port Mapper to initialize |
numberOfPorts | is the number of Ports to initialize |
portMapReconfigure | is used to enable/disable reconfiguration Valid values are PMAP_ENABLE_RECONFIGURATION PMAP_DISABLE_RECONFIGURATION [Default value] Modified registers are PMAPKEYID, PMAPCTL |
- Returns
- None
References ASSERT, HWREG8, PMAP_DISABLE_RECONFIGURATION, and PMAP_ENABLE_RECONFIGURATION.