The MCUXpresso SDK provides a peripheral driver for the I/O pin configuration (IOCON) module of MCUXpresso SDK devices.
Function groups
Pin mux set
The function IOCONPinMuxSet() sets a pinmux for a single pin according to selected configuration.
Pin mux set
The function IOCON_SetPinMuxing() sets a pinmux for a group of pins according to selected configuration.
Typical use case
Example use of IOCON API to selection of GPIO mode.
int main(void)
{
{0, 24, (
IOCON_FUNC0 | IOCON_GPIO_MODE | IOCON_DIGITAL_EN | IOCON_INPFILT_OFF)},
{0, 31, (
IOCON_FUNC0 | IOCON_GPIO_MODE | IOCON_DIGITAL_EN | IOCON_INPFILT_OFF)},
};
Chip_IOCON_SetPinMuxing(IOCON, gpio_pins, sizeof(gpio_pins)/sizeof(gpio_pins[0]));
}
|
__STATIC_INLINE void | IOCON_PinMuxSet (SYSCON_Type *base, uint8_t port, uint8_t pin, uint32_t modeFunc) |
| Sets I/O control pin mux. More...
|
|
__STATIC_INLINE void | IOCON_SetPinMuxing (SYSCON_Type *base, const iocon_group_t *pinArray, uint32_t arrayLength) |
| Set all I/O control pin muxing. More...
|
|
__STATIC_INLINE void | IOCON_FuncSet (SYSCON_Type *base, uint8_t port, uint8_t pin, uint8_t func) |
| Sets I/O control pin function. More...
|
|
__STATIC_INLINE void | IOCON_DriveSet (SYSCON_Type *base, uint8_t port, uint8_t pin, uint8_t strength) |
| Sets I/O control drive capability. More...
|
|
__STATIC_INLINE void | IOCON_PullSet (SYSCON_Type *base, uint8_t port, uint8_t pin, uint8_t pullMode) |
| Sets I/O control pull configuration. More...
|
|
- Note
- See the User Manual for specific drive levels, modes and functions supported by the various pins.Selects pin function 0
Enumerator |
---|
kIOCON_HighZ |
High Z.
|
kIOCON_PullDown |
Pull down.
|
kIOCON_PullUp |
Pull up.
|
Enumerator |
---|
kIOCON_LowDriveStrength |
Low-drive.
|
kIOCON_HighDriveStrength |
High-drive.
|
kIOCON_LowDriveWithExtraStrength |
Low-drive with extra.
|
kIOCON_HighDriveWithExtraStrength |
High-drive with extra.
|
__STATIC_INLINE void IOCON_PinMuxSet |
( |
SYSCON_Type * |
base, |
|
|
uint8_t |
port, |
|
|
uint8_t |
pin, |
|
|
uint32_t |
modeFunc |
|
) |
| |
- Parameters
-
base | The base of SYSCON peripheral on the chip |
port | GPIO port to mux (value from 0 ~ 1) |
pin | GPIO pin to mux (value from 0 ~ 31) |
modeFunc | OR'ed values of type IOCON_* |
- Returns
- Nothing
__STATIC_INLINE void IOCON_SetPinMuxing |
( |
SYSCON_Type * |
base, |
|
|
const iocon_group_t * |
pinArray, |
|
|
uint32_t |
arrayLength |
|
) |
| |
- Parameters
-
base | The base of SYSCON peripheral on the chip |
pinArray | Pointer to array of pin mux selections |
arrayLength | Number of entries in pinArray |
- Returns
- Nothing
__STATIC_INLINE void IOCON_FuncSet |
( |
SYSCON_Type * |
base, |
|
|
uint8_t |
port, |
|
|
uint8_t |
pin, |
|
|
uint8_t |
func |
|
) |
| |
- Parameters
-
base | The base of SYSCON peripheral on the chip |
port | GPIO port (value from 0 ~ 1) |
pin | GPIO pin (value from 0 ~ 31) |
func | Pin fucntion (value from 0 ~ 7) |
- Returns
- Nothing
__STATIC_INLINE void IOCON_DriveSet |
( |
SYSCON_Type * |
base, |
|
|
uint8_t |
port, |
|
|
uint8_t |
pin, |
|
|
uint8_t |
strength |
|
) |
| |
- Parameters
-
base | The base of SYSCON peripheral on the chip |
port | GPIO port (value from 0 ~ 1) |
pin | GPIO pin (value from 0 ~ 31) |
strength | Drive strength (Extra option is only valid for PA06/PA11/PA19/PA26/PA27)
- kIOCON_LowDriveStrength = 0U - Low-drive strength is configured.
- kIOCON_HighDriveStrength = 1U - High-drive strength is configured
- kIOCON_LowDriveWithExtraStrength = 2U - Low-drive with extra strength is configured
- kIOCON_HighDriveWithExtraStrength = 3U - High-drive with extra strength is configured
|
- Returns
- Nothing
__STATIC_INLINE void IOCON_PullSet |
( |
SYSCON_Type * |
base, |
|
|
uint8_t |
port, |
|
|
uint8_t |
pin, |
|
|
uint8_t |
pullMode |
|
) |
| |
- Parameters
-
base | The base of SYSCON peripheral on the chip |
port | GPIO port (value from 0 ~ 1) |
pin | GPIO pin (value from 0 ~ 31) |
pullMode | Pull mode
- kIOCON_HighZ = 0U - High Z is configured.
- kIOCON_PullDown = 1U - Pull-down is configured
- kIOCON_PullUp = 2U - Pull-up is configured
|
- Returns
- Nothing