请问一下SPI一包数据最多可以传多少个字节?

wenqiangzxy
Posts: 9
Joined: Tue Oct 08, 2019 11:11 am

请问一下SPI一包数据最多可以传多少个字节?

Postby wenqiangzxy » Thu Nov 28, 2019 2:19 pm

如题,在官方的SDK中,SPI是有十六个32位的寄存器,也就是说一包最多能够传64个字节。
#define SPI_W0(i) (REG_SPI_BASE(i) +0x40)
#define SPI_W1(i) (REG_SPI_BASE(i) +0x44)
#define SPI_W2(i) (REG_SPI_BASE(i) +0x48)
#define SPI_W3(i) (REG_SPI_BASE(i) +0x4C)
#define SPI_W4(i) (REG_SPI_BASE(i) +0x50)
#define SPI_W5(i) (REG_SPI_BASE(i) +0x54)
#define SPI_W6(i) (REG_SPI_BASE(i) +0x58)
#define SPI_W7(i) (REG_SPI_BASE(i) +0x5C)
#define SPI_W8(i) (REG_SPI_BASE(i) +0x60)
#define SPI_W9(i) (REG_SPI_BASE(i) +0x64)
#define SPI_W10(i) (REG_SPI_BASE(i) +0x68)
#define SPI_W11(i) (REG_SPI_BASE(i) +0x6C)
#define SPI_W12(i) (REG_SPI_BASE(i) +0x70)
#define SPI_W13(i) (REG_SPI_BASE(i) +0x74)
#define SPI_W14(i) (REG_SPI_BASE(i) +0x78)
#define SPI_W15(i) (REG_SPI_BASE(i) +0x7C)

#define SPI_EXT2(i) (REG_SPI_BASE(i) + 0xF8)

#define SPI_EXT3(i) (REG_SPI_BASE(i) + 0xFC)
#define SPI_INT_HOLD_ENA 0x00000003
#define SPI_INT_HOLD_ENA_S 0
#endif // SPI_REGISTER_H_INCLUDED
但是在spi寄存器和spi_ext之间的地址是否可以存放数据然后用SPI来进行传输?如果可以的话请问一下SPI一次最多能够传输多少个字节?


wenqiangzxy
Posts: 9
Joined: Tue Oct 08, 2019 11:11 am

Re: 请问一下SPI一包数据最多可以传多少个字节?

Postby wenqiangzxy » Fri Nov 29, 2019 2:57 pm

Her Mary wrote:https://github.com/espressif/ESP8266_RTOS_SDK/tree/master/examples/peripherals/spi

这个我看过,也是传输这么些字节,也是使用十六个寄存器,我在想的是能不能把那些SPI寄存器下面与中断之间多余的地址用来存放SPI的数据。因为目前来说十六个寄存器一包数据最多也就64个字节。

Who is online

Users browsing this forum: Bing [Bot] and 8 guests