May I ask a reference code to enable SPI#2 for S32K146 ?

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

May I ask a reference code to enable SPI#2 for S32K146 ?

582 次查看
yongho_shin
Contributor I

Dear NXP team,

Do you have a reference code to enable the SPI#2 for S32K146 ?

Or could you send me the pinmux table for it ?

I wonna know which configuration for pinmux makes it enable the SPI#2 (PTB25, 27, 28, 29)

Please reply it.

Best Regards,

Yongho Shin.

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

505 次查看
danielmartynek
NXP TechSupport
NXP TechSupport

Hello,

You can use the following code:

PCC->PCCn[PCC_PORTB_INDEX] |= PCC_PCCn_CGC_MASK; /* Enable clock for PORTB */
PORTB->PCR[25] |= PORT_PCR_MUX(5); /* Port B25: MUX = ALT5, LPSPI2_PSC0 */
PORTB->PCR[27] |= PORT_PCR_MUX(5); /* Port B27: MUX = ALT5, LPSPI2_SOUT */
PORTB->PCR[28] |= PORT_PCR_MUX(5); /* Port B28: MUX = ALT5, LPSPI2_SIN */
PORTB->PCR[29] |= PORT_PCR_MUX(5); /* Port B29: MUX = ALT5, LPSPI2_SCK */

Regards,
Daniel

0 项奖励