S32K312 - Can I change PIN mode at runtime?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K312 - Can I change PIN mode at runtime?

Jump to solution
1,545 Views
ssean
Contributor IV

Hello

I set PTC2 to CAN RX mode in pin init config.

Can I change PTC2 to EIRQ[2] during runtime ?

Without change pin init config.

And also, back to CAN RX mode during runtime ?

Thank you

 

const Siul2_Port_Ip_PinSettingsConfig g_pin_mux_InitConfigArr0[NUM_OF_CONFIGURED_PINS0] =
{
    {
        .base                        = IP_SIUL2,
        .pinPortIdx                  = 66u,
        .mux                         = PORT_MUX_AS_GPIO,
        .safeMode                    = PORT_SAFE_MODE_DISABLED,
        .inputFilter                 = PORT_INPUT_FILTER_DISABLED,
        .driveStrength               = PORT_DRIVE_STRENTGTH_DISABLED,
        .pullConfig                  = PORT_INTERNAL_PULL_NOT_ENABLED,
        .slewRateCtrlSel             = PORT_SLEW_RATE_SLOWEST,
        .pullKeep                    = PORT_PULL_KEEP_DISABLED,
        .invert                      = PORT_INVERT_DISABLED,
        .inputBuffer                 = PORT_INPUT_BUFFER_ENABLED,
        .outputBuffer                = PORT_OUTPUT_BUFFER_DISABLED,
        .adcInterleaves              = { MUX_MODE_NOT_AVAILABLE, MUX_MODE_NOT_AVAILABLE },
        .inputMuxReg                 = {
                                         0u
                                       },
        .inputMux                    = { 
                                         PORT_INPUT_MUX_ALT1,
                                         PORT_INPUT_MUX_NO_INIT,
                                         PORT_INPUT_MUX_NO_INIT,
                                         PORT_INPUT_MUX_NO_INIT,
                                         PORT_INPUT_MUX_NO_INIT,
                                         PORT_INPUT_MUX_NO_INIT,
                                         PORT_INPUT_MUX_NO_INIT,
                                         PORT_INPUT_MUX_NO_INIT
                                       },
    },
};
Tags (1)
0 Kudos
Reply
1 Solution
1,530 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

yes, you can change routing. Siul2_Port_Ip_SetInputBuffer function can be used for it. It just updates selected  MSCR.IBE and IMCR.SSS fields.

BR, Petr

View solution in original post

0 Kudos
Reply
2 Replies
1,531 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

yes, you can change routing. Siul2_Port_Ip_SetInputBuffer function can be used for it. It just updates selected  MSCR.IBE and IMCR.SSS fields.

BR, Petr

0 Kudos
Reply
1,507 Views
ssean
Contributor IV

@PetrS It works! Thank you

0 Kudos
Reply