diff --git a/include/platform/spi_if.h b/include/platform/spi_if.h index 10755960ee4eabbfb888ad70d281601c46f8addc..0a90d0321778fbdb111696f16c77af27299aa437 100644 --- a/include/platform/spi_if.h +++ b/include/platform/spi_if.h @@ -123,7 +123,7 @@ struct SpiDevInfo { * @brief Defines the custom SPI transfer message. * * @attention The specific SPI controller determines whether speed, delayUs, - * and csChange are supported. + * and keepCs are supported. * * @since 1.0 */ @@ -137,8 +137,8 @@ struct SpiMsg { uint16_t delayUs; /**< Delay (in microseconds) before starting the next transfer. * The value 0 indicates there is no delay between transfers. */ - uint8_t csChange; /**< Whether to switch off the CS before the next transfer when the current transfer has been - * completed. 1 indicates to switch off the CS; 0 indicates to switch on the CS. + uint8_t keepCs; /**< Whether to keep CS active after current transfer has been + * completed. 1 indicates to keeps CS; 0 indicates to switch off the CS. */ }; diff --git a/test/unittest/platform/common/spi_test.c b/test/unittest/platform/common/spi_test.c index 3ab52453fbc9a2784ba6709eb371e91d68066813..3ba875de34bf7cb011e891de27eb7f1665088216 100644 --- a/test/unittest/platform/common/spi_test.c +++ b/test/unittest/platform/common/spi_test.c @@ -243,7 +243,7 @@ static int32_t SpiTransferTest(struct SpiTester *tester) msg.rbuf = tester->config.rbuf; msg.wbuf = tester->config.wbuf; msg.len = tester->config.len; - msg.csChange = 1; // switch off the CS after transfer + msg.keepCs = 0; // switch off the CS after transfer msg.delayUs = 0; msg.speed = 0; // use default speed @@ -291,7 +291,7 @@ static int32_t SpiMultiTransferTest(struct SpiTester *tester) msgs[SPI_TEST_MSG_2].rbuf = tester->config.rbuf; msgs[SPI_TEST_MSG_2].len = tester->config.len; msgs[SPI_TEST_MSG_2].speed = 0; - msgs[SPI_TEST_MSG_2].csChange = 1; // switch off the CS after transfer + msgs[SPI_TEST_MSG_2].keepCs = 0; // switch off the CS after transfer ret = SpiSetCfg(tester->handle, &g_spiCfg); if (ret != HDF_SUCCESS) { @@ -339,8 +339,8 @@ static int32_t SpiSetDmaIntMsg(struct SpiMsg *msg, uint32_t len) msg->wbuf = wbuf; msg->rbuf = rbuf; msg->len = len; - msg->csChange = 1; - msg->delayUs = 0, // switch off the CS after transfer + msg->keepCs= 0, // switch off the CS after transfer + msg->delayUs = 0; msg->speed = 0; // using default speed return HDF_SUCCESS; }