Function gx_spi_master_tx_and_rx


int gx_spi_master_tx_and_rx(struct spi_device *spi, uint8_t *rx_buf, uint32_t rx_len, uint8_t *tx_buf, uint32_t tx_len)

SPI 单线模式下,同步发送和接收数据

参数
  • spi -- 从机设备

  • rx_buf -- 接收数据内存地址

  • rx_len -- 接收数据长度

  • tx_buf -- 发送数据内存地址

  • tx_len -- 发送数据长度

Returns 0

执行成功

Returns -22

参数无效

返回

int