The MCUXpresso SDK provides a driver for the Port Control and Interrupts (PORT) module of MCUXpresso SDK devices.
Typical configuration use case
Input PORT configuration
port_pin_config_t config = {
kPORT_PullUp,
kPORT_FastSlewRate,
kPORT_PassiveFilterDisable,
kPORT_OpenDrainDisable,
kPORT_LowDriveStrength,
kPORT_MuxAsGpio,
kPORT_UnLockRegister,
};
PORT_SetPinConfig(PORTA, 4, &config);
I2C PORT Configuration
port_pin_config_t config = {
kPORT_PullUp,
kPORT_FastSlewRate,
kPORT_PassiveFilterDisable,
kPORT_OpenDrainEnable,
kPORT_LowDriveStrength,
kPORT_MuxAlt5,
kPORT_UnLockRegister,
};
PORT_SetPinConfig(PORTE,24u,&config);
PORT_SetPinConfig(PORTE,25u,&config);
|
enum | port_interrupt_t {
kPORT_InterruptOrDMADisabled = 0x0U,
kPORT_DMARisingEdge = 0x1U,
kPORT_DMAFallingEdge = 0x2U,
kPORT_DMAEitherEdge = 0x3U,
kPORT_FlagRisingEdge = 0x05U,
kPORT_FlagFallingEdge = 0x06U,
kPORT_FlagEitherEdge = 0x07U,
kPORT_InterruptLogicZero = 0x8U,
kPORT_InterruptRisingEdge = 0x9U,
kPORT_InterruptFallingEdge = 0xAU,
kPORT_InterruptEitherEdge = 0xBU,
kPORT_InterruptLogicOne = 0xCU,
kPORT_ActiveHighTriggerOutputEnable = 0xDU,
kPORT_ActiveLowTriggerOutputEnable = 0xEU
} |
| Configures the interrupt generation condition. More...
|
|
#define FSL_PORT_DRIVER_VERSION (MAKE_VERSION(2, 0, 2)) |
Enumerator |
---|
kPORT_InterruptOrDMADisabled |
Interrupt/DMA request is disabled.
|
kPORT_DMARisingEdge |
DMA request on rising edge.
|
kPORT_DMAFallingEdge |
DMA request on falling edge.
|
kPORT_DMAEitherEdge |
DMA request on either edge.
|
kPORT_FlagRisingEdge |
Flag sets on rising edge.
|
kPORT_FlagFallingEdge |
Flag sets on falling edge.
|
kPORT_FlagEitherEdge |
Flag sets on either edge.
|
kPORT_InterruptLogicZero |
Interrupt when logic zero.
|
kPORT_InterruptRisingEdge |
Interrupt on rising edge.
|
kPORT_InterruptFallingEdge |
Interrupt on falling edge.
|
kPORT_InterruptEitherEdge |
Interrupt on either edge.
|
kPORT_InterruptLogicOne |
Interrupt when logic one.
|
kPORT_ActiveHighTriggerOutputEnable |
Enable active high-trigger output.
|
kPORT_ActiveLowTriggerOutputEnable |
Enable active low-trigger output.
|