S32K312 Port 模式修改

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

S32K312 Port 模式修改

1,336 Views
yexiaoer
Contributor II

Port 配置如下:默认SPI PCS3 引脚,此模式下无法使用  Dio_WriteChannel ()控制输出,调用 Port_SetPinMode(19,SIUL2_0_PORT49_GPIO); 后,仍然无法用  Dio_WriteChannel ()控制输出,问题在哪?

 

yexiaoer_0-1755593178409.png

Tags (1)
0 Kudos
Reply
4 Replies

1,290 Views
VaneB
NXP TechSupport
NXP TechSupport

Hi @yexiaoer 

Since the pin has been configured as SPI PCS, its control is handled through the SPI driver. The DIO driver can only modify the state of pins that are configured as GPIO.

If you need to manually control the PCS signal, the best approach is to reconfigure the desired pin as a GPIO, and in the SPI driver settings, change the SpiCsSelection parameter from CS_VIA_PERIPHERAL_ENGINE to CS_VIA_GPIO.

 

BR, VaneB

1,047 Views
Djuric
Contributor III

Hello @VaneB,
Can you send me S32DS screenshots of how to do this with Lpspi RTD drivers that are not in the AUTOSAR environment?
So, I'm interested in controlling the CS pin independently, like a GPIO pin.

Thank you.

0 Kudos
Reply

1,023 Views
yexiaoer
Contributor II
try to use Port_SetPinMode(19-1,SIUL2_0_PORT49_GPIO) set the pin as the GPIO mode, but you note the pin number as (19-1) not (19)

990 Views
Djuric
Contributor III

Thank you

0 Kudos
Reply