yangwc 发表于 2022-6-2 20:48

ESP32S3 SPI 双工模式无法读取数据

    驱动 RC522 NFC 芯片,当目标芯片设置为 ESP32 时,SPI 可正常通信(可读写 RC522 寄存器)。
    相同的代码,将目标芯片设置为 ESP32S3 后,编译出错,报如下错误:
    SPI half duplex mode is not supported when both MOSI and MISO phases are enabled

    在 ESP32-S3 的编程指南中找到:
    Half-duplex transactions with both read and write phases are not supported. Please use full duplex mode.   
   
    于是屏蔽掉 .flags = SPI_DEVICE_HALFDUPLEX

    编译通过,通过 SPI 发送数据正常,但读取数据时,发送完所要读取的寄存器地址后,SPI 总线就挂起了,表现为:CS 拉高了,无时钟信号输出。

    请教是什么原因。

yangwc 发表于 2022-6-7 09:45

ESP32 论坛里面有人回复说收发数据时采用配置 .addr = xx 取代 tx_buffer 里面的地址,我试过了,确实可以解决这个问题。
页: [1]
查看完整版本: ESP32S3 SPI 双工模式无法读取数据