最近在用AM335X spi 进行通信,发现需要设置SPI时序,后面看了datesheet SPI register 这一章,但就是不知道内核源码中在哪里设置了这些寄存器,我用的linux内核是Linux.3.2,忘指点。主要是配置McSPI_CH(i)CONF寄存器。
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
参考文件: EZSDK_06_00_00_00/board-support/linux-3.2.0-psp04.06.00.11/drivers/spi/spi-omap2-mcspi.c
比如其中类似于
__raw_writel(cs->chconf0, cs->base + OMAP2_MCSPI_CHCONF0);
这种语句就是寄存器级的设置。
你说的TCS注意看TRM手册的24.3.2.8 Chip-Select Timing Control章节的Figure 24-12. Chip-Select SPIEN Timing Controls。TCS不是指读写之间的时间间隔(而读写的间隔不是你能设置的),这个TCS只是说在片选有效到第一次数据读写进行的是时钟周期设置长度,图上标的比较清楚了。