spi_flash_hal_gpspi.c 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /*
  2. * SPDX-FileCopyrightText: 2015-2023 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. // HAL for
  7. // - GPSPI (SP2, SPI3) on ESP32-S2 and later
  8. // The common part is in spi_flash_hal_common.inc
  9. #define GPSPI_BUILD
  10. #define spi_flash_hal_common_command spi_flash_hal_gpspi_common_command
  11. #define spi_flash_hal_poll_cmd_done spi_flash_hal_gpspi_poll_cmd_done
  12. #define spi_flash_hal_device_config spi_flash_hal_gpspi_device_config
  13. #define spi_flash_hal_configure_host_io_mode spi_flash_hal_gpspi_configure_host_io_mode
  14. #define spi_flash_hal_read spi_flash_hal_gpspi_read
  15. #include "spi_flash_hal_common.inc"
  16. bool spi_flash_hal_gpspi_supports_direct_write(spi_flash_host_inst_t *host, const void *p)
  17. {
  18. return true;
  19. }
  20. bool spi_flash_hal_gpspi_supports_direct_read(spi_flash_host_inst_t *host, const void *p)
  21. {
  22. return true;
  23. }
  24. uint32_t spi_flash_hal_gpspi_check_status(spi_flash_host_inst_t *host)
  25. {
  26. spi_dev_t *dev = get_spi_dev(host);
  27. return spi_flash_ll_host_idle(dev);
  28. }