82int luat_spi_transfer(
int spi_id,
const char* send_buf,
size_t send_length,
char* recv_buf,
size_t recv_length);
int luat_spi_bus_setup(luat_spi_device_t *spi_dev)
spi总线初始化
int luat_spi_device_setup(luat_spi_device_t *spi_dev)
spi设备初始化
int luat_spi_recv(int spi_id, char *recv_buf, size_t length)
收SPI数据
int luat_spi_device_transfer(luat_spi_device_t *spi_dev, const char *send_buf, size_t send_length, char *recv_buf, size_t recv_length)
spi设备收发数据,返回接收字节数
int luat_spi_device_send(luat_spi_device_t *spi_dev, const char *send_buf, size_t length)
spi设备发送数据,返回接收字节数
struct luat_fatfs_spi luat_fatfs_spi_t
int luat_spi_close(int spi_id)
关闭SPI
int luat_spi_device_recv(luat_spi_device_t *spi_dev, char *recv_buf, size_t length)
spi设备接收数据,返回接收字节数
int luat_spi_device_config(luat_spi_device_t *spi_dev)
spi设备配置
struct luat_spi luat_spi_t
int luat_spi_get_mode(int spi_id)
SPI模式获取
int luat_spi_config_dma(int spi_id, uint32_t tx_channel, uint32_t rx_channel)
SPI收发数据尝试启动DMA模式
int luat_spi_change_speed(int spi_id, uint32_t speed)
SPI速率修改
int luat_spi_no_block_transfer(int spi_id, uint8_t *tx_buff, uint8_t *rx_buff, size_t len, void *CB, void *pParam)
SPI收发数据(异步)
int luat_spi_setup(luat_spi_t *spi)
初始化配置SPI各项参数,并打开SPI luat_spi_t 结构体参数 spiId,–串口id cs, 0,–CPHA 0,–CPOL 8,–数据宽度 20000000,...
struct luat_spi_device luat_spi_device_t
int luat_spi_device_close(luat_spi_device_t *spi_dev)
spi设备关闭
int luat_spi_set_mode(int spi_id, uint8_t mode)
SPI模式修改
int luat_spi_transfer(int spi_id, const char *send_buf, size_t send_length, char *recv_buf, size_t recv_length)
收发SPI数据
int luat_spi_send(int spi_id, const char *send_buf, size_t length)
发SPI数据
luat_spi_device_t * spi_device