S32K118 EVB SDK 4.0.2 Change pin function during runtime

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

S32K118 EVB SDK 4.0.2 Change pin function during runtime

1,251件の閲覧回数
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,234件の閲覧回数
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,228件の閲覧回数
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,201件の閲覧回数
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 件の賞賛
返信