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 the selected configuration.

Pin mux set

The function IOCON_SetPinMuxing() sets a pinmux for group of pins according to the selected configuration.

Typical use case

Example use of IOCON API to selection of GPIO mode.

int main(void)
{
/* enable clock for IOCON */
/* Set pin mux for single pin */
/* Set pin mux for group of pins */
const iocon_group_t gpio_pins[] = {
};
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   IOCON_PIO_FUNC(0)
 IOCON function and mode selection definitions. More...
 
#define IOCON_FUNC1   IOCON_PIO_FUNC(1)
 Selects pin function 1.
 
#define IOCON_FUNC2   IOCON_PIO_FUNC(2)
 Selects pin function 2.
 
#define IOCON_FUNC3   IOCON_PIO_FUNC(3)
 Selects pin function 3.
 
#define IOCON_FUNC4   IOCON_PIO_FUNC(4)
 Selects pin function 4.
 
#define IOCON_FUNC5   IOCON_PIO_FUNC(5)
 Selects pin function 5.
 
#define IOCON_FUNC6   IOCON_PIO_FUNC(6)
 Selects pin function 6.
 
#define IOCON_FUNC7   IOCON_PIO_FUNC(7)
 Selects pin function 7.
 
#define IOCON_MODE_PULLUP   IOCON_PIO_MODE(0)
 Selects pull-up function.
 
#define IOCON_MODE_REPEATER   IOCON_PIO_MODE(1)
 Selects pin repeater function.
 
#define IOCON_MODE_INACT   IOCON_PIO_MODE(2)
 No addition pin function.
 
#define IOCON_MODE_PULLDOWN   IOCON_PIO_MODE(3)
 Selects pull-down function.
 
#define IOCON_HYS_EN   (0x1 << 5)
 Enables hysteresis ??
 
#define IOCON_GPIO_MODE   IOCON_PIO_SLEW0(1)
 GPIO Mode.
 
#define IOCON_I2C_SLEW   IOCON_PIO_SLEW0(1)
 I2C Slew Rate Control.
 
#define IOCON_INV_EN   IOCON_PIO_INVERT(1)
 Enables invert function on input.
 
#define IOCON_ANALOG_EN   IOCON_PIO_DIGIMODE(0)
 Enables analog function by setting 0 to bit 7.
 
#define IOCON_DIGITAL_EN   IOCON_PIO_DIGIMODE(1)
 Enables digital function by setting 1 to bit 7(default)
 
#define IOCON_STDI2C_EN   IOCON_PIO_FILTEROFF(1)
 I2C standard mode/fast-mode.
 
#define IOCON_INPFILT_OFF   IOCON_PIO_FILTEROFF(1)
 Input filter Off for GPIO pins.
 
#define IOCON_INPFILT_ON   IOCON_PIO_FILTEROFF(0)
 Input filter On for GPIO pins.
 
#define IOCON_SLEW1_OFF   IOCON_PIO_SLEW1(0)
 Driver Slew Rate Control.
 
#define IOCON_SLEW1_ON   IOCON_PIO_SLEW1(1)
 Driver Slew Rate Control.
 
#define IOCON_FASTI2C_EN   (IOCON_INPFILT_ON | IOCON_SLEW1_ON)
 I2C Fast-mode Plus and high-speed slave.
 
#define IOCON_OPENDRAIN_EN   IOCON_PIO_OD(1)
 Enables open-drain function.
 
#define IOCON_S_MODE_0CLK   IOCON_PIO_SSEL(0)
 Bypass input filter.
 
#define IOCON_S_MODE_1CLK   IOCON_PIO_SSEL(1)
 Input pulses shorter than 1 filter clock are rejected.
 
#define IOCON_S_MODE_2CLK   IOCON_PIO_SSEL(2)
 Input pulses shorter than 2 filter clock2 are rejected.
 
#define IOCON_S_MODE_3CLK   IOCON_PIO_SSEL(3)
 Input pulses shorter than 3 filter clock2 are rejected.
 

Functions

__STATIC_INLINE void IOCON_PinMuxSet (IOCON_Type *base, uint8_t port, uint8_t pin, uint32_t modefunc)
 Sets I/O Control pin mux. More...
 
__STATIC_INLINE void IOCON_SetPinMuxing (IOCON_Type *base, const iocon_group_t *pinArray, uint32_t arrayLength)
 Set all I/O Control pin muxing. More...
 
__STATIC_INLINE void IOCON_PullSet (IOCON_Type *base, uint8_t port, uint8_t pin, uint8_t pull_select)
 Sets I/O Control pin mux pull select. More...
 
__STATIC_INLINE void IOCON_FuncSet (IOCON_Type *base, uint8_t port, uint8_t pin, uint8_t func)
 Sets I/O Control pin mux pull select. 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   IOCON_PIO_FUNC(0)
Note
See the User Manual for specific modes and functions supported by the various pins.Selects pin function 0

Function Documentation

__STATIC_INLINE void IOCON_PinMuxSet ( IOCON_Type *  base,
uint8_t  port,
uint8_t  pin,
uint32_t  modefunc 
)
Parameters
base: The base of IOCON peripheral on the chip
port: GPIO port to mux
pin: GPIO pin to mux
modefunc: OR'ed values of type IOCON_*
Returns
Nothing
__STATIC_INLINE void IOCON_SetPinMuxing ( IOCON_Type *  base,
const iocon_group_t pinArray,
uint32_t  arrayLength 
)
Parameters
base: The base of IOCON peripheral on the chip
pinArray: Pointer to array of pin mux selections
arrayLength: Number of entries in pinArray
Returns
Nothing
__STATIC_INLINE void IOCON_PullSet ( IOCON_Type *  base,
uint8_t  port,
uint8_t  pin,
uint8_t  pull_select 
)
Parameters
base: The base of IOCON peripheral on the chip
port: GPIO port to mux
pin: GPIO pin to mux
pull_select: OR'ed values of type IOCON_*
Returns
Nothing
__STATIC_INLINE void IOCON_FuncSet ( IOCON_Type *  base,
uint8_t  port,
uint8_t  pin,
uint8_t  func 
)
Parameters
base: The base of IOCON peripheral on the chip
port: GPIO port to mux
pin: GPIO pin to mux
func: Pinmux function
Returns
Nothing