S32K312 - Can I change PIN mode at runtime?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

S32K312 - Can I change PIN mode at runtime?

跳至解决方案
1,571 次查看
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
                                       },
    },
};
标记 (1)
0 项奖励
回复
1 解答
1,556 次查看
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 项奖励
回复
2 回复数
1,557 次查看
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 项奖励
回复
1,533 次查看
ssean
Contributor IV

@PetrS It works! Thank you

0 项奖励
回复