diff --git a/components/soc/esp32/include/hal/spi_ll.h b/components/soc/esp32/include/hal/spi_ll.h index b66bc1baaf..aaa4fa7aba 100644 --- a/components/soc/esp32/include/hal/spi_ll.h +++ b/components/soc/esp32/include/hal/spi_ll.h @@ -36,6 +36,8 @@ /// Swap the bit order to its correct place to send #define HAL_SPI_SWAP_DATA_TX(data, len) HAL_SWAP32((uint32_t)data<<(32-len)) +#define SPI_LL_GET_HW(ID) ((ID)==0? &SPI1:((ID)==1? &SPI2 : &SPI3)) + /** * The data structure holding calculated clock configuration. Since the * calculation needs long time, it should be calculated during initialization and diff --git a/components/soc/esp32s2beta/include/hal/spi_ll.h b/components/soc/esp32s2beta/include/hal/spi_ll.h index c6c11e215e..70b0c170ad 100644 --- a/components/soc/esp32s2beta/include/hal/spi_ll.h +++ b/components/soc/esp32s2beta/include/hal/spi_ll.h @@ -36,6 +36,8 @@ /// Swap the bit order to its correct place to send #define HAL_SPI_SWAP_DATA_TX(data, len) HAL_SWAP32((uint32_t)data<<(32-len)) +#define SPI_LL_GET_HW(ID) ((ID)==0? ({abort();NULL;}):((ID)==1? &GPSPI2 : ((ID)==2? &GPSPI3: &GPSPI4))) + /** * The data structure holding calculated clock configuration. Since the * calculation needs long time, it should be calculated during initialization and