Merge branch 'bugfix/spi_master_multiple_dev_with_diff_cs_lvl_master' into 'master'

spi_master: correctly set cs polarity

See merge request espressif/esp-idf!10265
This commit is contained in:
Michael (XIAO Xufeng)
2020-09-21 10:17:38 +08:00
3 changed files with 4 additions and 4 deletions

View File

@@ -291,7 +291,7 @@ static inline void spi_ll_master_set_pos_cs(spi_dev_t *hw, int cs, uint32_t pos_
if (pos_cs) { if (pos_cs) {
hw->pin.master_cs_pol |= (1 << cs); hw->pin.master_cs_pol |= (1 << cs);
} else { } else {
hw->pin.master_cs_pol &= (1 << cs); hw->pin.master_cs_pol &= ~(1 << cs);
} }
} }
@@ -615,7 +615,7 @@ static inline void spi_ll_master_set_cksel(spi_dev_t *hw, int cs, uint32_t cksel
if (cksel) { if (cksel) {
hw->pin.master_ck_sel |= (1 << cs); hw->pin.master_ck_sel |= (1 << cs);
} else { } else {
hw->pin.master_ck_sel &= (1 << cs); hw->pin.master_ck_sel &= ~(1 << cs);
} }
} }

View File

@@ -415,7 +415,7 @@ static inline void spi_ll_master_set_pos_cs(spi_dev_t *hw, int cs, uint32_t pos_
if (pos_cs) { if (pos_cs) {
hw->misc.master_cs_pol |= (1 << cs); hw->misc.master_cs_pol |= (1 << cs);
} else { } else {
hw->misc.master_cs_pol &= (1 << cs); hw->misc.master_cs_pol &= ~(1 << cs);
} }
} }

View File

@@ -274,7 +274,7 @@ static inline void spi_ll_master_set_pos_cs(spi_dev_t *hw, int cs, uint32_t pos_
if (pos_cs) { if (pos_cs) {
hw->misc.master_cs_pol |= (1 << cs); hw->misc.master_cs_pol |= (1 << cs);
} else { } else {
hw->misc.master_cs_pol &= (1 << cs); hw->misc.master_cs_pol &= ~(1 << cs);
} }
} }