32521| 22
|
[S32] 求一个S32K144芯片SPI的例程(易懂的) |
10NXP金币
最佳答案uint8_t init_lpspi0()
{
ENABLE_GPIO_CLOCK(PORTB); //Enable GPIO clock at gpio_init() function in gpio.c
PCC->PCCn = PCC_PCCn_PCS(1); //select spi clock source
PCC->PCCn |= PCC_PCCn_CGC_MASK; //enable SPI clock
PORTB->PCR[2] |= 0x00000300; //port configure as chip-specific
PORTB->PCR[3] |= 0x00000300;
PORTB->PCR[4] |= 0x00000300;
PORTB->PCR[5] |= 0x00000300; //use as GPI ...
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
GMT+8, 2025-7-24 06:37 , Processed in 0.097279 second(s), 27 queries , MemCache On.
Powered by Discuz! X3.4
Copyright © 2001-2024, Tencent Cloud.