I am using the MKL03z uC with Keil MDK for development.
I see the following comment for the function PORT_SetPinMux() in the SDK header file fsl_port.h:
* @Note : This function is NOT recommended to use together with the PORT_SetPinsConfig, because
* the PORT_SetPinsConfig need to configure the pin mux anyway (Otherwise the pin mux is
* reset to zero : kPORT_PinDisabledOrAnalog).
* This function is recommended to use to reset the pin mux
I don't interpret it too well. Could you review two versions of my pin_mux.c and tell me which one is right?
Original Attachment has been moved to: Ver_1.txt.zip
Original Attachment has been moved to: Ver_2.txt.zip
I cannot answer your question directly, but I'd recommend to use Pins tool to generate routing code for you. The Pins tool can be downloaded as desktop application from NXP web site or can be used online at http://mcuxpresso.nxp.com/. The tool generates complete code for pin routing.