The MCUXpresso config tool generates code that configures the pins of an MCU. For example, the following code was generated by the tool:
IOCON->PIO[0][22] = ((IOCON->PIO[0][22] &
/* Mask bits to zero which are setting */
(~(IOCON_PIO_FUNC_MASK | IOCON_PIO_DIGIMODE_MASK)))
/* Selects pin function.
* : PORT022 (pin B12) is configured as USB0_VBUS. */
| IOCON_PIO_FUNC(PIO022_FUNC_ALT7)
/* Select Analog/Digital mode.
* : Digital mode. */
| IOCON_PIO_DIGIMODE(PIO022_DIGIMODE_DIGITAL));
Compare this to code from standalone SDK examples:
const uint32_t port0_pin22_config = (/* Pin is configured as USB0_VBUS */
IOCON_PIO_FUNC7 |
/* No addition pin function */
IOCON_PIO_MODE_INACT |
/* Input function is not inverted */
IOCON_PIO_INV_DI |
/* Enables digital function */
IOCON_PIO_DIGITAL_EN |
/* Input filter disabled */
IOCON_PIO_INPFILT_OFF |
/* Standard mode, output slew rate control is enabled */
IOCON_PIO_SLEW_STANDARD |
/* Open drain is disabled */
IOCON_PIO_OPENDRAIN_DI);
/* PORT0 PIN22 (coords: B12) is configured as USB0_VBUS */
IOCON_PinMuxSet(IOCON, 0U, 22U, port0_pin22_config);
Why doesn't the config tool use IOCON_PinMuxSet? Is the config tool behaving correctly, and are there any plans to change the tool to generate consistent code with the standalone SDK examples?