S32K118 EVB SDK 4.0.2 Change pin function during runtime

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

S32K118 EVB SDK 4.0.2 Change pin function during runtime

1,206 次查看
JakubPyznar
Contributor I

Hi,

I am currently working on a S32DS project for S32K118 EVB with SDK 4.0.2 included. I cannot find in mex configuration or in drivers files how to change pin mode in runtime. I need to change pin mode from default GPIO output to ADC input and back.

Best regards

标签 (1)
0 项奖励
回复
3 回复数

1,189 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

Hi 

Have a look at the PINS_DRV_SetMuxModeSel (hello_world_s32k118_SDK402/SDK/platform/drivers/src/pins/pins_driver.c)


Best Regards,
Robin
-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 项奖励
回复

1,183 次查看
JakubPyznar
Contributor I
So I have to initialize ADC pheriperal and desired pin as an GPIO output, and then I can change its function at any time?
Now I see that in S32K118_features.h there is a macro FEATURE_PINS_HAS_ADC_INTERLEAVE_EN which is defined as (0), so I am not sure it would work. It seems like it is not available on this chip. Any other ideas?
0 项奖励
回复

1,156 次查看
Robin_Shen
NXP TechSupport
NXP TechSupport

You need to initialize ADC peripheral and GPIO output. But before ADC sample that channel, please change the pin from GPIO output to ADC input.
Since S32K11x does not support ADC interleave channel, the macro FEATURE_PINS_HAS_ADC_INTERLEAVE_EN defined as (0).

ADC_INTERLEAVE_EN.png

 

0 项奖励
回复