spi_slave: keep consistent with the parameter of the spi_slave_receive function declaration

Signed-off-by: liaoao <liaoao@xiaomi.com>
This commit is contained in:
liaoao 2024-02-28 19:13:49 +08:00 committed by Xiang Xiao
parent 4a147fc86b
commit 40e34b5b58
2 changed files with 13 additions and 13 deletions

View File

@ -669,11 +669,11 @@ static size_t spi_slave_getdata(FAR struct spi_slave_dev_s *dev,
* synchronization by several words. * synchronization by several words.
* *
* Input Parameters: * Input Parameters:
* dev - SPI Slave device interface instance * dev - SPI Slave device interface instance
* data - Pointer to the new data that has been shifted in * data - Pointer to the new data that has been shifted in
* len - Length of the new data in units of nbits wide, * nwords - Length of the new data in units of nbits wide,
* nbits being the data width previously provided to the bind() * nbits being the data width previously provided to the bind()
* method. * method.
* *
* Returned Value: * Returned Value:
* Number of units accepted by the device. In other words, * Number of units accepted by the device. In other words,
@ -688,10 +688,10 @@ static size_t spi_slave_getdata(FAR struct spi_slave_dev_s *dev,
****************************************************************************/ ****************************************************************************/
static size_t spi_slave_receive(FAR struct spi_slave_dev_s *dev, static size_t spi_slave_receive(FAR struct spi_slave_dev_s *dev,
FAR const void *data, size_t len) FAR const void *data, size_t nwords)
{ {
FAR struct spi_slave_driver_s *priv = (FAR struct spi_slave_driver_s *)dev; FAR struct spi_slave_driver_s *priv = (FAR struct spi_slave_driver_s *)dev;
size_t recv_bytes = MIN(len, sizeof(priv->rx_buffer)); size_t recv_bytes = MIN(WORDS2BYTES(nwords), sizeof(priv->rx_buffer));
memcpy(priv->rx_buffer, data, recv_bytes); memcpy(priv->rx_buffer, data, recv_bytes);

View File

@ -273,11 +273,11 @@
* synchronization by several words. * synchronization by several words.
* *
* Input Parameters: * Input Parameters:
* dev - SPI Slave device interface instance * dev - SPI Slave device interface instance
* data - Pointer to the new data that has been shifted in * data - Pointer to the new data that has been shifted in
* len - Length of the new data in units of nbits wide, * nwords - Length of the new data in units of nbits wide,
* nbits being the data width previously provided to the bind() * nbits being the data width previously provided to the bind()
* method. * method.
* *
* Returned Value: * Returned Value:
* Number of units accepted by the device. In other words, * Number of units accepted by the device. In other words,
@ -291,7 +291,7 @@
* *
****************************************************************************/ ****************************************************************************/
#define SPIS_DEV_RECEIVE(d,v,l) ((d)->ops->receive(d,v,l)) #define SPIS_DEV_RECEIVE(d,v,n) ((d)->ops->receive(d,v,n))
/**************************************************************************** /****************************************************************************
* Name: SPIS_DEV_NOTIFY * Name: SPIS_DEV_NOTIFY