S32K118 EVB SDK 4.0.2 Change pin function during runtime

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

S32K118 EVB SDK 4.0.2 Change pin function during runtime

616 Views
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

Labels (1)
0 Kudos
Reply
3 Replies

599 Views
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 Kudos
Reply

593 Views
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 Kudos
Reply

566 Views
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 Kudos
Reply