MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
IOCON: I/O pin configuration

Overview

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)
{
/* enable clock for IOCON */
CLOCK_EnableClock(kCLOCK_Iocon);
/* Set pin mux for single pin */
IOCON_PinMuxSet(IOCON, 0, 29, IOCON_FUNC0 | IOCON_GPIO_MODE | IOCON_DIGITAL_EN | IOCON_INPFILT_OFF);
/* Set pin mux for group of pins */
const iocon_group_t gpio_pins[] = {
{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]));
}

Files

file  fsl_iocon.h
 

Data Structures

struct  iocon_group_t
 Array of IOCON pin definitions passed to IOCON_SetPinMuxing() must be in this format. More...
 

Macros

#define IOCON_FUNC0   0x0U
 IOCON function, mode and drive selection definitions. More...
 
#define IOCON_FUNC1   0x1U
 Selects pin function 1.
 
#define IOCON_FUNC2   0x2U
 Selects pin function 2.
 
#define IOCON_FUNC3   0x3U
 Selects pin function 3.
 
#define IOCON_FUNC4   0x4U
 Selects pin function 4.
 
#define IOCON_FUNC5   0x5U
 Selects pin function 5.
 
#define IOCON_FUNC6   0x6U
 Selects pin function 6.
 
#define IOCON_FUNC7   0x7U
 Selects pin function 7.
 
#define IOCON_MODE_HIGHZ   (0x0U << 4U)
 Selects High-Z function.
 
#define IOCON_MODE_PULLDOWN   (0x1U << 4U)
 Selects pull-down function.
 
#define IOCON_MODE_PULLUP   (0x2U << 4U)
 Selects pull-up function.
 
#define IOCON_DRIVE_LOW   (0x0U << 6U)
 Enable low drive strength.
 
#define IOCON_DRIVE_HIGH   (0x1U << 6U)
 Enable high drive strength.
 
#define IOCON_DRIVE_EXTRA   (0x1U << 7U)
 Enable extra drive, only valid for PA06/PA11/PA19/PA26/PA27.
 

Enumerations

enum  iocon_pull_mode_t {
  kIOCON_HighZ = 0U,
  kIOCON_PullDown,
  kIOCON_PullUp
}
 Pull mode. More...
 
enum  iocon_drive_strength_t {
  kIOCON_LowDriveStrength = 0U,
  kIOCON_HighDriveStrength,
  kIOCON_LowDriveWithExtraStrength,
  kIOCON_HighDriveWithExtraStrength
}
 Drive strength. More...
 

Functions

__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...
 

Driver version

#define LPC_IOCON_DRIVER_VERSION   (MAKE_VERSION(2, 0, 0))
 IOCON driver version 2.0.0. More...
 

Data Structure Documentation

struct iocon_group_t

Macro Definition Documentation

#define LPC_IOCON_DRIVER_VERSION   (MAKE_VERSION(2, 0, 0))
#define IOCON_FUNC0   0x0U
Note
See the User Manual for specific drive levels, modes and functions supported by the various pins.Selects pin function 0

Enumeration Type Documentation

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.

Function Documentation

__STATIC_INLINE void IOCON_PinMuxSet ( SYSCON_Type *  base,
uint8_t  port,
uint8_t  pin,
uint32_t  modeFunc 
)
Parameters
baseThe base of SYSCON peripheral on the chip
portGPIO port to mux (value from 0 ~ 1)
pinGPIO pin to mux (value from 0 ~ 31)
modeFuncOR'ed values of type IOCON_*
Returns
Nothing
__STATIC_INLINE void IOCON_SetPinMuxing ( SYSCON_Type *  base,
const iocon_group_t pinArray,
uint32_t  arrayLength 
)
Parameters
baseThe base of SYSCON peripheral on the chip
pinArrayPointer to array of pin mux selections
arrayLengthNumber of entries in pinArray
Returns
Nothing
__STATIC_INLINE void IOCON_FuncSet ( SYSCON_Type *  base,
uint8_t  port,
uint8_t  pin,
uint8_t  func 
)
Parameters
baseThe base of SYSCON peripheral on the chip
portGPIO port (value from 0 ~ 1)
pinGPIO pin (value from 0 ~ 31)
funcPin 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
baseThe base of SYSCON peripheral on the chip
portGPIO port (value from 0 ~ 1)
pinGPIO pin (value from 0 ~ 31)
strengthDrive 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
baseThe base of SYSCON peripheral on the chip
portGPIO port (value from 0 ~ 1)
pinGPIO pin (value from 0 ~ 31)
pullModePull mode
  • kIOCON_HighZ = 0U - High Z is configured.
  • kIOCON_PullDown = 1U - Pull-down is configured
  • kIOCON_PullUp = 2U - Pull-up is configured
Returns
Nothing