Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spi_bus 如何完成先发后读 #177

Closed
ghost opened this issue Apr 7, 2022 · 1 comment
Closed

spi_bus 如何完成先发后读 #177

ghost opened this issue Apr 7, 2022 · 1 comment
Labels

Comments

@ghost
Copy link

ghost commented Apr 7, 2022

目前好像完成不了类似rt_err_t rt_spi_send_then_recv的功能

先发送后接收数据

本函数适合从SPI外设中读取一块数据,本函数中会先发送一些数据(如命令和地址),然后再接收指定长度的数据。此函数等同于调用rt_spi_transfer_message()传输2条消息。

参数
device SPI 从设备句柄
send_buf 发送缓冲区数据指针
send_length 发送缓冲区数据字节数
recv_buf 接收缓冲区数据指针,spi 是全双工的,支持同时收发
recv_length 接收缓冲区数据字节数
返回
RT_EOK 成功,-RT_EIO 失败。

@ghost ghost changed the title spi_bus 如何完成先发后度 spi_bus 如何完成先发后读 Apr 7, 2022
@TDA-2030
Copy link
Contributor

你需要的先发送后接收数据应该启动两次SPI传输就可以完成了

@leeebo leeebo closed this as completed Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants