I'm sorry but your answer is apparently not related to my point.
In the Pin Control Register (PORTn_PCR[m]), the difference between Pull Select (PS) and Pull Enable (PE) is clear for me. It is not the point here.
My question is related to coding consistancy in the pin_mux.c file. To isolate the proper bit field in PCR, macros have been defined in the file MK64F12.h and are usually used:
/*! @name PCR - Pin Control Register n */
#define PORT_PCR_PS_MASK (0x1U)
#define PORT_PCR_PS_SHIFT (0U)
#define PORT_PCR_PS(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_PS_SHIFT)) & PORT_PCR_PS_MASK)
#define PORT_PCR_PE_MASK (0x2U)
#define PORT_PCR_PE_SHIFT (1U)
#define PORT_PCR_PE(x) (((uint32_t)(((uint32_t)(x)) << PORT_PCR_PE_SHIFT)) & PORT_PCR_PE_MASK)
[...]
But for some reason, it is not always the case and it looks like a mistake in the code generation. See the difference between the two configs below. In my opinion "(uint32_t)(kPORT_PullDown)" should be replaced with "PORT_PCR_PS(kPORT_PullDown)".
PORTA->PCR[7] = ((PORTA->PCR[7] &
/* Mask bits to zero which are setting */
(~(PORT_PCR_PS_MASK | PORT_PCR_ISF_MASK)))
/* Pull Select: Internal pulldown resistor is enabled on the corresponding pin, if the
* corresponding PE field is set. */
| PORT_PCR_PS(kPORT_PullDown));
PORTE->PCR[26] = ((PORTE->PCR[26] &
/* Mask bits to zero which are setting */
(~(PORT_PCR_PS_MASK | PORT_PCR_PE_MASK | PORT_PCR_PFE_MASK | PORT_PCR_ISF_MASK)))
/* Pull Select: Internal pulldown resistor is enabled on the corresponding pin, if the
* corresponding PE field is set. */
| (uint32_t)(kPORT_PullDown)
/* Passive Filter Enable: Passive input filter is enabled on the corresponding pin, if the
* pin is configured as a digital input.
* Refer to the device data sheet for filter characteristics. */
| PORT_PCR_PFE(kPORT_PassiveFilterEnable));
Guillaume Audirac