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

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

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

555 Views
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.

Tags (3)
0 Kudos
1 Reply

478 Views
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 Kudos