spi_master: correctly set cs polarity

All devices must be added to the same spi line before use.
This commit is contained in:
Wielebny666 2020-06-23 16:02:50 +02:00 committed by bot
parent 64adabfd3a
commit bca1beb3f0
1 changed files with 2 additions and 2 deletions

View File

@ -494,12 +494,12 @@ Specify ``SPI_DEVICE_NO_DUMMY`` to ignore this checking. Then you can output dat
if (dev_config->flags&SPI_DEVICE_CLK_AS_CS) {
spihost[host]->hw->pin.master_ck_sel |= (1<<freecs);
} else {
spihost[host]->hw->pin.master_ck_sel &= (1<<freecs);
spihost[host]->hw->pin.master_ck_sel &= ~(1<<freecs);
}
if (dev_config->flags&SPI_DEVICE_POSITIVE_CS) {
spihost[host]->hw->pin.master_cs_pol |= (1<<freecs);
} else {
spihost[host]->hw->pin.master_cs_pol &= (1<<freecs);
spihost[host]->hw->pin.master_cs_pol &= ~(1<<freecs);
}
spihost[host]->hw->ctrl2.mosi_delay_mode = 0;
spihost[host]->hw->ctrl2.mosi_delay_num = 0;