mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-09-23 04:04:15 +08:00
[SPI]Update and fixup the SPI
* Make a priv data read API for probed SPI device * Fixup the SPI device pre-alloc
This commit is contained in:
@@ -313,6 +313,11 @@ rt_err_t rt_spi_driver_register(struct rt_spi_driver *driver);
|
||||
rt_err_t rt_spi_device_register(struct rt_spi_device *device);
|
||||
|
||||
#define RT_SPI_DRIVER_EXPORT(driver) RT_DRIVER_EXPORT(driver, spi, BUILIN)
|
||||
|
||||
rt_inline const void *rt_spi_device_id_data(struct rt_spi_device *device)
|
||||
{
|
||||
return device->id ? device->id->data : (device->ofw_id ? device->ofw_id->data : RT_NULL);
|
||||
}
|
||||
#endif /* RT_USING_DM */
|
||||
|
||||
/**
|
||||
@@ -598,7 +603,7 @@ rt_err_t rt_qspi_bus_register(struct rt_spi_bus *bus, const char *name, const st
|
||||
*
|
||||
* @return the actual length of transmitted.
|
||||
*/
|
||||
rt_size_t rt_qspi_transfer_message(struct rt_qspi_device *device, struct rt_qspi_message *message);
|
||||
rt_ssize_t rt_qspi_transfer_message(struct rt_qspi_device *device, struct rt_qspi_message *message);
|
||||
|
||||
/**
|
||||
* @brief This function can send data then receive data from QSPI device
|
||||
@@ -611,7 +616,7 @@ rt_size_t rt_qspi_transfer_message(struct rt_qspi_device *device, struct rt_qsp
|
||||
*
|
||||
* @return the status of transmit.
|
||||
*/
|
||||
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_ssize_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);
|
||||
|
||||
/**
|
||||
* @brief This function can send data to QSPI device
|
||||
@@ -622,7 +627,7 @@ rt_err_t rt_qspi_send_then_recv(struct rt_qspi_device *device, const void *send_
|
||||
*
|
||||
* @return the status of transmit.
|
||||
*/
|
||||
rt_err_t rt_qspi_send(struct rt_qspi_device *device, const void *send_buf, rt_size_t length);
|
||||
rt_ssize_t rt_qspi_send(struct rt_qspi_device *device, const void *send_buf, rt_size_t length);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user