MCUXpresso SDK API Reference Manual
Rev. 0
NXP Semiconductors
|
The MCUXpresso SDK provides Peripheral driver for the I/O pin configuration (IOCON) module of MCUXpresso SDK devices.
The function IOCONPinMuxSet() set pinmux for single pin according to selected configuration.
The function IOCON_SetPinMuxing() set pinmux for group of pins according to selected configuration.
Example use of IOCON API to selection of GPIO mode. Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/iocon
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 0x0 |
IOCON function and mode selection definitions. More... | |
#define | IOCON_FUNC1 0x1 |
Selects pin function 1. | |
#define | IOCON_FUNC2 0x2 |
Selects pin function 2. | |
#define | IOCON_FUNC3 0x3 |
Selects pin function 3. | |
#define | IOCON_FUNC4 0x4 |
Selects pin function 4. | |
#define | IOCON_FUNC5 0x5 |
Selects pin function 5. | |
#define | IOCON_FUNC6 0x6 |
Selects pin function 6. | |
#define | IOCON_FUNC7 0x7 |
Selects pin function 7. | |
#define | IOCON_MODE_INACT (0x0 << 3) |
No addition pin function. | |
#define | IOCON_MODE_PULLDOWN (0x1 << 3) |
Selects pull-down function. | |
#define | IOCON_MODE_PULLUP (0x2 << 3) |
Selects pull-up function. | |
#define | IOCON_MODE_REPEATER (0x3 << 3) |
Selects pin repeater function. | |
#define | IOCON_HYS_EN (0x1 << 5) |
Enables hysteresis. | |
#define | IOCON_GPIO_MODE (0x1 << 5) |
GPIO Mode. | |
#define | IOCON_I2C_SLEW (0x0 << 5) |
I2C Slew Rate Control. | |
#define | IOCON_INV_EN (0x1 << 6) |
Enables invert function on input. | |
#define | IOCON_ANALOG_EN (0x0 << 7) |
Enables analog function by setting 0 to bit 7. | |
#define | IOCON_DIGITAL_EN (0x1 << 7) |
Enables digital function by setting 1 to bit 7(default) | |
#define | IOCON_STDI2C_EN (0x1 << 8) |
I2C standard mode/fast-mode. | |
#define | IOCON_FASTI2C_EN (0x3 << 8) |
I2C Fast-mode Plus and high-speed slave. | |
#define | IOCON_INPFILT_OFF (0x1 << 8) |
Input filter Off for GPIO pins. | |
#define | IOCON_INPFILT_ON (0x0 << 8) |
Input filter On for GPIO pins. | |
#define | IOCON_OPENDRAIN_EN (0x1 << 10) |
Enables open-drain function. | |
#define | IOCON_S_MODE_0CLK (0x0 << 11) |
Bypass input filter. | |
#define | IOCON_S_MODE_1CLK (0x1 << 11) |
Input pulses shorter than 1 filter clock are rejected. | |
#define | IOCON_S_MODE_2CLK (0x2 << 11) |
Input pulses shorter than 2 filter clock2 are rejected. | |
#define | IOCON_S_MODE_3CLK (0x3 << 11) |
Input pulses shorter than 3 filter clock2 are rejected. | |
#define | IOCON_S_MODE(clks) ((clks) << 11) |
Select clocks for digital input filter mode. | |
#define | IOCON_CLKDIV(div) ((div) << 13) |
Select peripheral clock divider for input filter sampling clock, 2^n, n=0-6. | |
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... | |
Driver version | |
#define | LPC_IOCON_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) |
IOCON driver version 2.0.0. More... | |
struct iocon_group_t |
#define LPC_IOCON_DRIVER_VERSION (MAKE_VERSION(2, 0, 0)) |
#define IOCON_FUNC0 0x0 |
__STATIC_INLINE void IOCON_PinMuxSet | ( | IOCON_Type * | base, |
uint8_t | port, | ||
uint8_t | pin, | ||
uint32_t | modefunc | ||
) |
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_* |
__STATIC_INLINE void IOCON_SetPinMuxing | ( | IOCON_Type * | base, |
const iocon_group_t * | pinArray, | ||
uint32_t | arrayLength | ||
) |
base | : The base of IOCON peripheral on the chip |
pinArray | : Pointer to array of pin mux selections |
arrayLength | : Number of entries in pinArray |