1 // Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 // HAL for 16 // - GPSPI (SP2, SPI3) on ESP32-S2 and later 17 // The common part is in spi_flash_hal_common.inc 18 19 #define GPSPI_BUILD 20 21 #define spi_flash_hal_common_command spi_flash_hal_gpspi_common_command 22 #define spi_flash_hal_poll_cmd_done spi_flash_hal_gpspi_poll_cmd_done 23 #define spi_flash_hal_device_config spi_flash_hal_gpspi_device_config 24 #define spi_flash_hal_configure_host_io_mode spi_flash_hal_gpspi_configure_host_io_mode 25 #define spi_flash_hal_read spi_flash_hal_gpspi_read 26 27 #include "spi_flash_hal_common.inc" 28 spi_flash_hal_gpspi_supports_direct_write(spi_flash_host_inst_t * host,const void * p)29bool spi_flash_hal_gpspi_supports_direct_write(spi_flash_host_inst_t *host, const void *p) 30 { 31 return true; 32 } 33 spi_flash_hal_gpspi_supports_direct_read(spi_flash_host_inst_t * host,const void * p)34bool spi_flash_hal_gpspi_supports_direct_read(spi_flash_host_inst_t *host, const void *p) 35 { 36 return true; 37 } 38 spi_flash_hal_gpspi_check_status(spi_flash_host_inst_t * host)39uint32_t spi_flash_hal_gpspi_check_status(spi_flash_host_inst_t *host) 40 { 41 spi_dev_t *dev = get_spi_dev(host); 42 return spi_flash_ll_host_idle(dev); 43 } 44