mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-01 03:34:32 +02:00
spi_master: correctly set cs polarity
All devices must be added to the same spi line before use. Partly solve this problem: https://github.com/espressif/esp-idf/pull/5490
This commit is contained in:
@@ -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) {
|
||||
hw->pin.master_cs_pol |= (1 << cs);
|
||||
} 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) {
|
||||
hw->pin.master_ck_sel |= (1 << cs);
|
||||
} else {
|
||||
hw->pin.master_ck_sel &= (1 << cs);
|
||||
hw->pin.master_ck_sel &= ~(1 << cs);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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) {
|
||||
hw->misc.master_cs_pol |= (1 << cs);
|
||||
} else {
|
||||
hw->misc.master_cs_pol &= (1 << cs);
|
||||
hw->misc.master_cs_pol &= ~(1 << cs);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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) {
|
||||
hw->misc.master_cs_pol |= (1 << cs);
|
||||
} else {
|
||||
hw->misc.master_cs_pol &= (1 << cs);
|
||||
hw->misc.master_cs_pol &= ~(1 << cs);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user