summaryrefslogtreecommitdiff
path: root/components/drivers/include
diff options
context:
space:
mode:
authorliYangYang <[email protected]>2023-02-27 10:09:07 +0800
committerGitHub <[email protected]>2023-02-26 21:09:07 -0500
commit93d572dee6dadae93f9e5a4781a765cb4d198bad (patch)
treeff7c4d655aa37b97f6a65884375e6704ffd31513 /components/drivers/include
parentf295d3df7880f37eb7a7cd0fc18c2827e40420e6 (diff)
[spi][5.0.0] 修正SPI设备框架中,对函数返回值类型使用不恰当的情况 (#6937)
Diffstat (limited to 'components/drivers/include')
-rw-r--r--components/drivers/include/drivers/spi.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/components/drivers/include/drivers/spi.h b/components/drivers/include/drivers/spi.h
index 7e3842d76e..7f7c2cedcc 100644
--- a/components/drivers/include/drivers/spi.h
+++ b/components/drivers/include/drivers/spi.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006-2022, RT-Thread Development Team
+ * Copyright (c) 2006-2023, RT-Thread Development Team
*
* SPDX-License-Identifier: Apache-2.0
*
@@ -100,7 +100,7 @@ struct rt_spi_bus
struct rt_spi_ops
{
rt_err_t (*configure)(struct rt_spi_device *device, struct rt_spi_configuration *configuration);
- rt_uint32_t (*xfer)(struct rt_spi_device *device, struct rt_spi_message *message);
+ rt_ssize_t (*xfer)(struct rt_spi_device *device, struct rt_spi_message *message);
};
/**
@@ -237,8 +237,9 @@ rt_err_t rt_spi_send_then_send(struct rt_spi_device *device,
const void *send_buf2,
rt_size_t send_length2);
-rt_uint16_t rt_spi_sendrecv16(struct rt_spi_device *device,
- rt_uint16_t data);
+rt_err_t rt_spi_sendrecv16(struct rt_spi_device *device,
+ rt_uint16_t senddata,
+ rt_uint16_t *recvdata);
/**
* This function transmits data to SPI device.
@@ -250,10 +251,10 @@ rt_uint16_t rt_spi_sendrecv16(struct rt_spi_device *device,
*
* @return the actual length of transmitted.
*/
-rt_size_t rt_spi_transfer(struct rt_spi_device *device,
- const void *send_buf,
- void *recv_buf,
- rt_size_t length);
+rt_ssize_t rt_spi_transfer(struct rt_spi_device *device,
+ const void *send_buf,
+ void *recv_buf,
+ rt_size_t length);
/**
* This function transfers a message list to the SPI device.