[bsp][at32]disable spi to change transfer size (#7448)

This commit is contained in:
JonasWen 2023-05-06 10:49:39 +08:00 committed by GitHub
parent 3419e591da
commit 16472d03f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -232,6 +232,8 @@ static rt_err_t configure(struct rt_spi_device* device,
spi_init_struct.transmission_mode = SPI_TRANSMIT_FULL_DUPLEX; spi_init_struct.transmission_mode = SPI_TRANSMIT_FULL_DUPLEX;
spi_init_struct.master_slave_mode = SPI_MODE_MASTER; spi_init_struct.master_slave_mode = SPI_MODE_MASTER;
spi_init_struct.cs_mode_selection = SPI_CS_SOFTWARE_MODE; spi_init_struct.cs_mode_selection = SPI_CS_SOFTWARE_MODE;
/* disable spi to change transfer size */
spi_enable(instance->config->spi_x, FALSE);
/* init spi */ /* init spi */
spi_init(instance->config->spi_x, &spi_init_struct); spi_init(instance->config->spi_x, &spi_init_struct);