How to read gpio value in s32v234 uboot

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

How to read gpio value in s32v234 uboot

3,960 次查看
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!

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

3,581 次查看
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 项奖励
回复