atlas200 spi使用 SPI_IOC_MESSAGE(2) 接收超时,是什么原因?
收藏回复举报
atlas200 spi使用 SPI_IOC_MESSAGE(2) 接收超时,是什么原因?
t('forum.solved') 已解决
新人帖
发表于2024-01-07 16:52:25
0 查看
static int w25_write_read(int fd , const char* wbuf,unsigned int wlen,

    const char* rbuf , unsigned int rlen){



    int ret = 0;

    struct spi_ioc_transfer tr[2] = {

        {

            .tx_buf = (unsigned long)wbuf,

            .rx_buf = 0,

            .len = wlen,

            .speed_hz = speed,

        },

        {

            .tx_buf = 0,

            .rx_buf = (unsigned long)rbuf,

            .len = rlen,

            .speed_hz = speed,

        },

    };



    ret = ioctl(fd , SPI_IOC_MESSAGE(2) , tr);



    return ret;

}

本帖最后由 匿名用户2024/06/27 16:35:59 编辑

我要发帖子