From the docs: http://esp-idf.readthedocs.io/en/latest/api-reference/system/sleep_modes.html
WiFi/BT and sleep modes
In deep sleep mode, wireless peripherals are powered down. Before
entering sleep mode, applications must
disable WiFi and BT using appropriate calls ( esp_bluedroid_disable
,
esp_bt_controller_disable
, esp_wifi_stop
).
WiFi can coexist with light sleep mode, allowing the chip to go into
light sleep mode when there is no network activity, and waking up the
chip from light sleep mode when required. However APIs described in
this section can not be used for that purpose. esp_light_sleep_start
forces the chip to enter light sleep mode, regardless of whether WiFi
is active or not. Automatic entry into light sleep mode, coordinated
with WiFi driver, will be supported using a separate set of APIs.
There's a list of all the parameters you can configure with esp_deep_sleep_pd_config
prior to entering deep sleep, along with rich information about lots of other deep sleep topics.
For example you can do this sort of thing, exercising a fine degree of control over how your device deep sleeps:
esp_deep_sleep_pd_config(ESP_PD_DOMAIN_RTC_PERIPH, ESP_PD_OPTION_OFF);
esp_deep_sleep_pd_config(ESP_PD_DOMAIN_RTC_SLOW_MEM, ESP_PD_OPTION_OFF);
esp_deep_sleep_pd_config(ESP_PD_DOMAIN_RTC_FAST_MEM, ESP_PD_OPTION_OFF);
esp_deep_sleep_enable_timer_wakeup(((uint64_t) sec) * 60);
esp_deep_sleep_start();