RT-Thread RTOS 1.2.0
An open source embedded real-time operating system
载入中...
搜索中...
未找到
dev_spi.h 文件参考
#include <stdlib.h>
#include <rtthread.h>
#include <drivers/dev_pin.h>
#include <drivers/core/driver.h>
+ dev_spi.h 的引用(Include)关系图:

浏览该文件的源代码.

结构体

struct  rt_spi_message
 
struct  rt_spi_configuration
 
struct  rt_spi_bus
 
struct  rt_spi_ops
 
struct  rt_spi_device
 
struct  rt_qspi_message
 
struct  rt_qspi_configuration
 
struct  rt_qspi_device
 

宏定义

#define RT_SPI_CPHA   (1<<0)
 
#define RT_SPI_CPOL   (1<<1)
 
#define RT_SPI_LSB   (0<<2)
 
#define RT_SPI_MSB   (1<<2)
 
#define RT_SPI_MASTER   (0<<3)
 
#define RT_SPI_SLAVE   (1<<3)
 
#define RT_SPI_CS_HIGH   (1<<4)
 
#define RT_SPI_NO_CS   (1<<5)
 
#define RT_SPI_3WIRE   (1<<6)
 
#define RT_SPI_READY   (1<<7)
 
#define RT_SPI_MODE_MASK   (RT_SPI_CPHA | RT_SPI_CPOL | RT_SPI_MSB | RT_SPI_SLAVE | RT_SPI_CS_HIGH | RT_SPI_NO_CS | RT_SPI_3WIRE | RT_SPI_READY)
 
#define RT_SPI_MODE_0   (0 | 0)
 
#define RT_SPI_MODE_1   (0 | RT_SPI_CPHA)
 
#define RT_SPI_MODE_2   (RT_SPI_CPOL | 0)
 
#define RT_SPI_MODE_3   (RT_SPI_CPOL | RT_SPI_CPHA)
 
#define RT_SPI_BUS_MODE_SPI   (1<<0)
 
#define RT_SPI_BUS_MODE_QSPI   (1<<1)
 
#define SPI_DEVICE(dev)
 

函数

rt_err_t rt_spi_bus_register (struct rt_spi_bus *bus, const char *name, const struct rt_spi_ops *ops)
 
rt_err_t rt_spi_bus_attach_device (struct rt_spi_device *device, const char *name, const char *bus_name, void *user_data)
 
rt_err_t rt_spi_bus_attach_device_cspin (struct rt_spi_device *device, const char *name, const char *bus_name, rt_base_t cs_pin, void *user_data)
 
rt_err_t rt_spi_bus_configure (struct rt_spi_device *device)
 
rt_err_t rt_spi_take_bus (struct rt_spi_device *device)
 
rt_err_t rt_spi_release_bus (struct rt_spi_device *device)
 
rt_err_t rt_spi_take (struct rt_spi_device *device)
 
rt_err_t rt_spi_release (struct rt_spi_device *device)
 
rt_err_t rt_spi_configure (struct rt_spi_device *device, struct rt_spi_configuration *cfg)
 
rt_err_t rt_spi_send_then_recv (struct rt_spi_device *device, const void *send_buf, rt_size_t send_length, void *recv_buf, rt_size_t recv_length)
 
rt_err_t rt_spi_send_then_send (struct rt_spi_device *device, const void *send_buf1, rt_size_t send_length1, const void *send_buf2, rt_size_t send_length2)
 
rt_ssize_t rt_spi_transfer (struct rt_spi_device *device, const void *send_buf, void *recv_buf, rt_size_t length)
 
rt_err_t rt_spi_sendrecv8 (struct rt_spi_device *device, rt_uint8_t senddata, rt_uint8_t *recvdata)
 
rt_err_t rt_spi_sendrecv16 (struct rt_spi_device *device, rt_uint16_t senddata, rt_uint16_t *recvdata)
 
struct rt_spi_messagert_spi_transfer_message (struct rt_spi_device *device, struct rt_spi_message *message)
 
rt_inline rt_size_t rt_spi_recv (struct rt_spi_device *device, void *recv_buf, rt_size_t length)
 
rt_inline rt_size_t rt_spi_send (struct rt_spi_device *device, const void *send_buf, rt_size_t length)
 
rt_inline void rt_spi_message_append (struct rt_spi_message *list, struct rt_spi_message *message)
 
rt_err_t rt_qspi_configure (struct rt_qspi_device *device, struct rt_qspi_configuration *cfg)
 
rt_err_t rt_qspi_bus_register (struct rt_spi_bus *bus, const char *name, const struct rt_spi_ops *ops)
 
rt_size_t rt_qspi_transfer_message (struct rt_qspi_device *device, struct rt_qspi_message *message)
 
rt_err_t rt_qspi_send_then_recv (struct rt_qspi_device *device, const void *send_buf, rt_size_t send_length, void *recv_buf, rt_size_t recv_length)
 
rt_err_t rt_qspi_send (struct rt_qspi_device *device, const void *send_buf, rt_size_t length)