How to read gpio value in s32v234 uboot

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

How to read gpio value in s32v234 uboot

4,813 Views
zhaocq
Contributor II

hi NXP,

          s32v234 uboot  stage, we want to use Port PB5 and PB6 as GPIO function, we want to simulate i2c. Now we can set PB5 and PB6 to output high and low, set as below:

writel(config , SIUL2_MSCRn(19));
writel(value_off, SIUL2_GPDOn(SIUL2_GPDO_for_GPIO(19)));

writel(config , SIUL2_MSCRn(20));
writel(value_off, SIUL2_GPDOn(SIUL2_GPDO_for_GPIO(20)));

through the wavelet, we can get high and low. 

Also we need to read the data input, I set below codes, but still can not read  correct value.

u32 config1 = (0<<0 | 1<<19);

writel(config1 , SIUL2_IMCRn(273));
get_value = readl(SIUL2_IMCRn(273));
printf("Board: test_gpio_i2c get_value=%x\n",get_value);

Could you tell me how to set the input and read the input value? Thanks in advances!

Labels (1)
Tags (3)
0 Kudos
Reply
1 Reply

4,434 Views
KushalShahNXP
NXP Employee
NXP Employee

Hi,

 

We have stopped supporting this community page. But we still support S32V2 questions using our ticketing system.

Please create the request at www.nxp.com/support using Support Requests option. Our experts will help you.

 

Thank you for understanding.

 

Regards,

Kushal

0 Kudos
Reply