esp_flash_init_main_bus_lock() function
Initialize the bus lock on the SPI1 bus. Should be called if drivers (including esp_flash) wants to use SPI1 bus.
Syntax
esp_err_t esp_flash_init_main_bus_lock(void); Return value
esp_err_t always ESP_OK.
Notes
When using legacy spi flash API, the bus lock will not be available on SPI1 bus.
![]()
esp_err_t esp_flash_init_main_bus_lock(void);