Skip to content

New SPI invert hardware SS function in hall-spi and SPI library #11297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Apr 28, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update esp32-hal-spi.c
renamed invert_out to ss_invert to be more intuitive
  • Loading branch information
SimGearEvolution authored Apr 25, 2025
commit 9d859c8c1858d8ab482ed814adc7ee3a9cc7200a
6 changes: 3 additions & 3 deletions cores/esp32/esp32-hal-spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ struct spi_struct_t {
int8_t miso;
int8_t mosi;
int8_t ss;
bool invert_out;
bool ss_invert;
};

#if CONFIG_IDF_TARGET_ESP32S2
Expand Down Expand Up @@ -368,7 +368,7 @@ bool spiAttachSS(spi_t *spi, uint8_t ss_num, int8_t ss) {
return false;
}
pinMode(ss, OUTPUT);
pinMatrixOutAttach(ss, SPI_SS_IDX(spi->num, ss_num), spi->invert_out, false);
pinMatrixOutAttach(ss, SPI_SS_IDX(spi->num, ss_num), spi->ss_invert, false);
spiEnableSSPins(spi, (1 << ss_num));
spi->ss = ss;
if (!perimanSetPinBus(ss, ESP32_BUS_TYPE_SPI_MASTER_SS, (void *)(spi->num + 1), spi->num, -1)) {
Expand Down Expand Up @@ -440,7 +440,7 @@ void spiSSDisable(spi_t *spi) {

void spiSSInvertout(spi_t *spi, bool invert) {
if (spi) {
spi->invert_out = invert;
spi->ss_invert = invert;
}
}

Expand Down