Hi
Here is how it is done in the uTasker project, which makes it easier and fool-proof (can't forget to enable clocks to the port in question and can't set the wrong MUX value). Example of K64 UART0 Tx options set with different drive characteristics:
_CONFIG_PERIPHERAL(A, 2, (PA_2_UART0_TX | PORT_SRE_SLOW)); // UART0_TX on PA2 (alt. function 2) slow slew rate
_CONFIG_PERIPHERAL(B, 17, (PB_17_UART0_TX | PORT_SRE_FAST)); // UART0_TX on PB17 (alt. function 3) fast slew rate
_CONFIG_PERIPHERAL(D, 7, (PD_7_UART0_TX | PORT_ODE | PORT_DSE_HIGH)); // UART0_TX on PD7 (alt. function 3) open drain and high drive strength
_CONFIG_PERIPHERAL(A, 14, (PA_14_UART0_TX)); // UART0_TX on PA14 (alt. function 3) default characteristics
A simple macro is needed:
#define _CONFIG_PERIPHERAL(port, pin, function) POWER_UP_ATOMIC(5, PORT##port); PORT##port##_PCR##pin = function
which also generates minimum instructions.
A bit-banding power up macro is also used to apply the power in the most efficient manner (this video discusses bit-banding: https://www.youtube.com/watch?v=FZnkZ1h_EAQ)
Regards
Mark