### Copy Example Project (Linux/macOS) Source: https://docs.espressif.com/projects/esp-adf/en/latest/get-started/index.html Copy the 'play_mp3_control' example project from the ESP-ADF installation directory to your home directory on Linux and macOS. ```bash cd ~/ cp -r $ADF_PATH/examples/get-started/play_mp3_control . ``` -------------------------------- ### Copy Example Project (Windows) Source: https://docs.espressif.com/projects/esp-adf/en/latest/get-started/index.html Copy the 'play_mp3_control' example project from the ESP-ADF installation directory to your user's directory on Windows. ```batch cd %userprofile%\esp xcopy /e /i %ADF_PATH%\examples\get-started\play_mp3_control play_mp3_control ``` -------------------------------- ### Initialize and Start Audio Recorder Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/speech-recognition/audio_recorder.html Initializes and starts the audio recorder. Returns a handle on success or NULL on failure. ```c audio_rec_handle_t audio_recorder_create(audio_rec_cfg_t *cfg) ``` -------------------------------- ### Install ESP-IDF Environment (Windows Command Prompt) Source: https://docs.espressif.com/projects/esp-adf/en/latest/get-started/index.html Install the ESP-IDF compilation environment using the install.bat script in the command prompt. ```batch cd esp-adf .\install.bat ``` -------------------------------- ### Install ESP-IDF Environment (Windows PowerShell) Source: https://docs.espressif.com/projects/esp-adf/en/latest/get-started/index.html Install the ESP-IDF compilation environment using the install.ps1 script in PowerShell. ```powershell cd esp-adf .\install.ps1 ``` -------------------------------- ### esp_wifi_setting_start Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/services/wifi_service.html Executes the start function of the wifi setting instance. This function triggers the registered start routine for the wifi setting. ```APIDOC ## esp_wifi_setting_start ### Description Call this to execute `start` function of wifi setting instance. ### Parameters * **handle** (esp_wifi_setting_handle_t) - The wifi setting handle instance. ### Returns * ESP_OK * ESP_FAIL ``` -------------------------------- ### periph_wifi_config_start Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/peripherals/periph_wifi.html Initiates the Wi-Fi network setup process in the specified mode. ```APIDOC ## periph_wifi_config_start ### Description Starts Wi-Fi network setup in the specified mode. ### Parameters * **periph** (esp_periph_handle_t) - [in] The peripheral handle. * **mode** (periph_wifi_config_mode_t) - [in] The Wi-Fi setup mode. ### Returns * ESP_OK - If the setup process starts successfully. * ESP_FAIL - If starting the setup process fails. ``` -------------------------------- ### Application Specific Log Output Source: https://docs.espressif.com/projects/esp-adf/en/latest/get-started/index.html Example of the application-specific log messages you should see after flashing and resetting the device. This indicates the audio pipeline is starting. ```text ... I (397) PLAY_FLASH_MP3_CONTROL: [ 1 ] Start audio codec chip I (427) PLAY_FLASH_MP3_CONTROL: [ 2 ] Create audio pipeline, add all elements to pipeline, and subscribe pipeline event I (427) PLAY_FLASH_MP3_CONTROL: [2.1] Create mp3 decoder to decode mp3 file and set custom read callback I (437) PLAY_FLASH_MP3_CONTROL: [2.2] Create i2s stream to write data to codec chip I (467) PLAY_FLASH_MP3_CONTROL: [2.3] Register all elements to audio pipeline I (467) PLAY_FLASH_MP3_CONTROL: [2.4] Link it together [mp3_music_read_cb]-->mp3_decoder-->i2s_stream-->[codec_chip] I (477) PLAY_FLASH_MP3_CONTROL: [ 3 ] Set up event listener I (477) PLAY_FLASH_MP3_CONTROL: [3.1] Listening event from all elements of pipeline I (487) PLAY_FLASH_MP3_CONTROL: [ 4 ] Start audio_pipeline I (507) PLAY_FLASH_MP3_CONTROL: [ * ] Receive music info from mp3 decoder, sample_rates=44100, bits=16, ch=2 I (7277) PLAY_FLASH_MP3_CONTROL: [ 5 ] Stop audio_pipeline ... ``` -------------------------------- ### audio_service_start Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/services/index.html Starts the specified audio service. ```APIDOC ## audio_service_start ### Description Starts the specific audio service. ### Parameters * **handle** (audio_service_handle_t) - [in] The audio service instance to start. ### Returns * ESP_OK - Success * ESP_FAIL - Fail * ESP_ERR_INVALID_ARG - Invalid argument ``` -------------------------------- ### audio_element_run Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/framework/audio_element.html Starts the Audio Element. This function initiates the audio element, causing it to run as a freeRTOS task. The element is initially put into a 'PAUSED' state and does not start processing immediately upon function return. ```APIDOC ## audio_element_run ### Description Start Audio Element. With this function, audio_element will start as freeRTOS task, and put the task into ‘PAUSED’ state. Note: Element does not actually start when this function returns. ### Parameters * **el** - [in] The audio element handle ### Returns * ESP_OK * ESP_FAIL ``` -------------------------------- ### audio_recorder_create Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/speech-recognition/audio_recorder.html Initializes and starts the audio recorder. Returns a handle to the audio recorder or NULL on failure. ```APIDOC ## audio_recorder_create ### Description Initialize and start up audio recorder. ### Parameters * **cfg** (audio_rec_cfg_t *) - Configuration of audio recorder ### Returns * NULL on failure * Others: audio recorder handle ``` -------------------------------- ### Start Voltage Frequency Report Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/services/battery_service.html Starts reporting voltage at the configured frequency. Returns ESP_OK on success or an error code on failure. ```c esp_err_t vol_monitor_start_freq_report(vol_monitor_handle_t handle) ``` -------------------------------- ### Configure ESP-ADF Environment (Linux/macOS) Source: https://docs.espressif.com/projects/esp-adf/en/latest/get-started/index.html Set up the ESP-IDF and ESP-ADF compilation environment by running the install and export scripts. ```bash cd esp-adf ./install.sh . ./export.sh ``` -------------------------------- ### esp_fs_ota_begin Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/services/ota_service.html Starts the FS OTA Firmware upgrade process. This function initializes the ESP FS OTA context and opens the firmware file. It must be invoked first, followed by `esp_fs_ota_perform` and `esp_fs_ota_finish`. ```APIDOC ## esp_fs_ota_begin ### Description Starts the FS OTA Firmware upgrade process. This function initializes the ESP FS OTA context and opens the firmware file. It must be invoked first, followed by `esp_fs_ota_perform` and `esp_fs_ota_finish`. ### Parameters * **ota_config** (esp_fs_ota_config_t *) - [in] pointer to esp_fs_ota_config_t structure * **handle** (esp_fs_ota_handle_t *) - [out] pointer to an allocated data of type `esp_fs_ota_handle_t` which will be initialised in this function. ### Returns * ESP_OK: FS OTA Firmware upgrade context initialised and file opened successful * ESP_FAIL: For generic failure. * ESP_ERR_INVALID_ARG: Invalid argument (missing/incorrect config, etc.) * For other return codes, refer documentation in app_update component and esp_http_client component in esp-idf. ``` -------------------------------- ### esp_periph_start Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/peripherals/esp_peripherals.html Adds a peripheral to the peripheral list and starts its monitoring task. The peripheral must be created first using `esp_periph_create`. ```APIDOC ## esp_periph_start ### Description Adds a peripheral to the peripheral list and starts its monitoring task. The peripheral must be created first. ### Parameters * **periph_set_handle** (esp_periph_set_handle_t) - The handle of the peripheral set. * **periph** (esp_periph_handle_t) - The peripheral instance to start. ### Returns * ESP_OK on success. * ESP_FAIL on failure. ``` -------------------------------- ### Force Start Audio Recording Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/speech-recognition/audio_recorder.html Starts the recording process by force. Useful when wake word detection is disabled or when reading data without a wake word trigger. ```c esp_err_t audio_recorder_trigger_start(audio_rec_handle_t handle) ``` -------------------------------- ### audio_hal_init Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/abstraction/audio_hal.html Initializes the media codec driver for a specific audio board. If the codec is already installed, it returns the existing handle. ```APIDOC ## audio_hal_init ### Description Initializes media codec driver. ### Parameters * **audio_hal_conf** (audio_hal_codec_config_t *) - Configure structure audio_hal_config_t * **audio_hal_func** (audio_hal_func_t *) - Structure containing functions used to operate the audio codec chip ### Returns * int - 0 for success, other values indicate failure. ``` -------------------------------- ### input_key_service_create Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/services/input_key_service.html Initializes and starts the input key service. This function must be called before any other input key service functions. ```APIDOC ## input_key_service_create ### Description Initialize and start the input key service. ### Parameters * **input_key_config** (input_key_service_cfg_t *) - Configuration of input key service ### Returns * NULL on failure * A valid handle to the input key service on success ``` -------------------------------- ### ota_service_create Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/services/ota_service.html Create the OTA service instance. This function initializes and starts the OTA service. ```APIDOC ## ota_service_create ### Description Create the OTA service instance. ### Parameters * **config** (ota_service_config_t *) - Configuration of the OTA service. ### Returns * **periph_service_handle_t** - Returns a handle to the created OTA service instance on success, or NULL on failure. ``` -------------------------------- ### bluetooth_service_start Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/services/bluetooth_service.html Initializes and starts the Bluetooth service. This function should be called only once, and `bluetooth_service_destroy` must be called after use. ```APIDOC ## bluetooth_service_start ### Description Initializes and starts the Bluetooth service. This function can only be called for one time, and `bluetooth_service_destroy` must be called after use. ### Parameters #### Path Parameters - **config** (bluetooth_service_cfg_t *) - The configuration ### Returns - ESP_OK - ESP_FAIL ``` -------------------------------- ### esp_periph_start_timer Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/peripherals/esp_peripherals.html Initializes and starts a timer for a peripheral. The timer invokes a callback function at a specified interval. ```APIDOC ## esp_periph_start_timer ### Description Initializes and starts a timer for a peripheral, which invokes a callback function at a specified interval. ### Parameters * **periph** (esp_periph_handle_t) - The peripheral handle. * **interval_tick** (TickType_t) - The timer interval in FreeRTOS ticks. * **callback** (timer_callback) - The callback function to be invoked. ### Note * The timer is automatically stopped and destroyed when `esp_periph_destroy` is called. * This timer uses FreeRTOS Timer with autoreload = true. ``` -------------------------------- ### Initialize Input Key Service Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/services/input_key_service.html Initializes and starts the input key service. Requires a configuration structure containing peripheral service settings and a peripheral set handle. ```c periph_service_handle_t input_key_service_create(input_key_service_cfg_t *input_key_config) ``` -------------------------------- ### audio_pipeline_run Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/framework/audio_pipeline.html Starts the audio pipeline, creating tasks for all linked elements to begin processing audio data. ```APIDOC ## audio_pipeline_run ### Description Starts the audio pipeline. With this function, the audio pipeline will create tasks for all elements that have been linked using the linking functions, initiating audio data processing. ### Method `esp_err_t audio_pipeline_run(audio_pipeline_handle_t pipeline)` ### Parameters * **pipeline** (audio_pipeline_handle_t) - The Audio Pipeline Handle to run. ### Returns * `ESP_OK` on success * `ESP_FAIL` when any errors occur ``` -------------------------------- ### Get ESP-ADF Repository (Windows) Source: https://docs.espressif.com/projects/esp-adf/en/latest/get-started/index.html Clone the ESP-ADF repository into the specified user directory on Windows. ```batch cd %userprofile%\esp git clone --recursive https://github.com/espressif/esp-adf.git ``` -------------------------------- ### Run Audio Pipeline Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/framework/audio_pipeline.html Starts the audio pipeline by creating tasks for all linked elements. This function initiates the audio data processing flow. ```c esp_err_t audio_pipeline_run(audio_pipeline_handle_t pipeline); ``` -------------------------------- ### periph_bluetooth_discover Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/services/bluetooth_service.html Starts device discovery. Returns ESP_OK on success, or an error code if the Bluetooth stack is not enabled or invalid parameters are provided. ```APIDOC ## periph_bluetooth_discover ### Description Start device discovery. ### Parameters #### Path Parameters - **periph** (esp_periph_handle_t) - The periph ### Returns - ESP_OK : Succeed - ESP_ERR_INVALID_STATE: if bluetooth stack is not yet enabled - ESP_ERR_INVALID_ARG: if invalid parameters are provided - ESP_FAIL: others ``` -------------------------------- ### Default PWM Stream Configuration Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/streams/index.html Provides a default configuration for the PWM Stream, which can be used as a starting point for initialization. ```c #define PWM_STREAM_CFG_DEFAULT() { .type = AUDIO_STREAM_WRITER, .pwm_config = { .tg_num = TIMER_GROUP_0, .timer_num = TIMER_0, .gpio_num_left = PWM_STREAM_GPIO_NUM_LEFT, .gpio_num_right = PWM_STREAM_GPIO_NUM_RIGHT, .ledc_channel_left = LEDC_CHANNEL_0, .ledc_channel_right = LEDC_CHANNEL_1, .ledc_timer_sel = LEDC_TIMER_0, .duty_resolution = LEDC_TIMER_13_BIT, .data_len = 1024, }, .out_rb_size = 0, .task_stack = PWM_STREAM_TASK_STACK, .task_core = 0, .task_prio = PWM_STREAM_TASK_PRIO, .buffer_len = PWM_STREAM_BUF_SIZE, .ext_stack = false, } ``` -------------------------------- ### wifi_service_setting_start Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/services/wifi_service.html Starts a registered Wi-Fi setting operation using its index. This initiates the process defined by the setting handler. ```APIDOC ## wifi_service_setting_start ### Description Starts a registered Wi-Fi setting operation using its index. This initiates the process defined by the setting handler. ### Function Signature esp_err_t wifi_service_setting_start(periph_service_handle_t handle, int index) ### Parameters * **handle** (*periph_service_handle_t*): The handle of the Wi-Fi service. * **index** (int): The index of the Wi-Fi setting to start. ``` -------------------------------- ### audio_recorder_trigger_start Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/speech-recognition/audio_recorder.html Starts recording by force. Useful for reading audio without wake word detection or when wake word detection is disabled. ```APIDOC ## audio_recorder_trigger_start ### Description Start recording by force. If there is a need to read from the recorder without a wake word being detected or to read from the recorder while wake word detection is disabled, this interface can be used to force start the recorder process. ### Parameters * **handle** (audio_rec_handle_t) - Audio recorder handle ### Returns * ESP_OK on success * ESP_FAIL on failure ``` -------------------------------- ### amrnb_encoder_init Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/codecs/amr_codecs.html Creates an Audio Element handle to encode incoming AMRNB data. Requires a configuration structure for setup. ```APIDOC ## amrnb_encoder_init ### Description Creates an Audio Element handle to encode incoming AMRNB data. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body * **config** (amrnb_encoder_cfg_t *) - Required - The configuration for the AMRNB encoder. ### Request Example ```json { "config": { ... } } ``` ### Response #### Success Response (200) * **audio_element_handle_t** - The audio element handle for the AMRNB encoder. #### Response Example ```json { "handle": "" } ``` ``` -------------------------------- ### Build, Flash, and Monitor Sample Project (Linux/macOS) Source: https://docs.espressif.com/projects/esp-adf/en/latest/get-started/index.html Compile, flash, and monitor the play_mp3_control ADF sample project after configuring the environment. ```bash cd $ADF_PATH/examples/get-started/play_mp3_control idf.py build flash monitor ``` -------------------------------- ### Build, Flash, and Monitor Sample Project (Windows Command Prompt) Source: https://docs.espressif.com/projects/esp-adf/en/latest/get-started/index.html Compile, flash, and monitor the play_mp3_control ADF sample project using the configured ADF_PATH. ```batch cd %ADF_PATH%\examples\get-started\play_mp3_control idf.py build flash monitor ``` -------------------------------- ### periph_service_start Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/services/index.html Starts a specific peripheral service. It takes a handle to the instance and returns an error code indicating success or failure. ```APIDOC ## periph_service_start ### Description Start the specific peripheral service. ### Parameters #### Parameters - **handle** (periph_service_handle_t) - [in] The peripheral service instance ### Returns - ESP_OK - ESP_FAIL - ESP_ERR_INVALID_ARG ``` -------------------------------- ### esp_periph_set_init Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/peripherals/esp_peripherals.html Initializes an esp_peripheral set, creating an empty peripherals list. This function prepares the system for peripheral management but does not start the associated task. It can optionally take an event handle for receiving events. ```APIDOC ## esp_periph_set_init ### Description Initializes esp_peripheral sets, creating an empty peripherals list. Call this function before starting any peripherals (with `esp_periph_start`). This call will initialize the data needed for esp_peripherals to work, but does not actually create the task. The `event_handle` is optional if you want to receive events from this callback function. The esp_peripherals task will send all events out to event_iface, can be listen by event_iface by `esp_periph_get_event_iface`. The `user_context` will sent `esp_periph_event_handle_t` as *context parameter. ### Parameters #### Request Body - **config** (esp_periph_config_t *) - [in] The configurations ### Returns The peripheral sets instance ``` -------------------------------- ### Create Alias for Environment Setup (Linux/macOS) Source: https://docs.espressif.com/projects/esp-adf/en/latest/get-started/index.html Create a shell alias 'get_idf' to easily set up the ESP-IDF environment in new terminal sessions on Linux and macOS. It's recommended to add this to your .profile or .bash_profile. ```bash alias get_idf='. $HOME/esp/esp-adf/export.sh' ``` -------------------------------- ### Build, Flash, and Monitor Sample Project (Windows PowerShell) Source: https://docs.espressif.com/projects/esp-adf/en/latest/get-started/index.html Compile, flash, and monitor the play_mp3_control ADF sample project using the configured ADF_PATH. ```powershell cd $ADF_PATH\examples\get-started\play_mp3_control idf.py build flash monitor ``` -------------------------------- ### esp_audio_setup Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/framework/esp_audio.html Configures the esp_audio instance by selecting the input stream, codec, and output stream, and setting the URI. This function should be called before `esp_audio_play`. ```APIDOC ## esp_audio_setup ### Description Configures the esp_audio instance by selecting the input stream, codec, and output stream, and setting the URI. This function should be called before `esp_audio_play`. ### Parameters #### Path Parameters - **handle** (esp_audio_handle_t) - in - The esp_audio instance - **sets** (esp_audio_setup_t *) - in - A pointer to esp_audio_setup_t. ### Returns - ESP_ERR_AUDIO_NO_ERROR: on success - ESP_ERR_AUDIO_INVALID_PARAMETER: no esp_audio instance - ESP_ERR_AUDIO_MEMORY_LACK: allocate memory fail ``` -------------------------------- ### Configure Project Target and Settings (Windows) Source: https://docs.espressif.com/projects/esp-adf/en/latest/get-started/index.html Navigate to your project directory and set the target device to 'esp32' using idf.py, then open the configuration menu. ```batch cd %userprofile%\esp\play_mp3_control idf.py set-target esp32 idf.py menuconfig ``` -------------------------------- ### Setup Clock for PWM Stream Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/streams/index.html Sets up the clock for the PWM Stream. This function is specifically used with handles created by `pwm_stream_init` to configure the audio clock parameters. ```c esp_err_t pwm_stream_set_clk(audio_element_handle_t pwm_stream, int rate, int bits, int ch); ``` -------------------------------- ### Control Battery Voltage Reporting Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/services/battery_service.html Starts or stops the battery voltage reporting. Use 'true' to start and 'false' to stop. Returns ESP_OK on success or ESP_ERR_INVALID_ARG if the handle is NULL. ```c esp_err_t battery_service_vol_report_switch(periph_service_handle_t handle, bool on_off) ``` -------------------------------- ### Configure Project Target and Settings (Linux/macOS) Source: https://docs.espressif.com/projects/esp-adf/en/latest/get-started/index.html Navigate to your project directory and set the target device to 'esp32' using idf.py, then open the configuration menu. ```bash cd ~~/esp/play_mp3_control idf.py set-target esp32 idf.py menuconfig ``` -------------------------------- ### esp_audio_state_get Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/framework/esp_audio.html Gets the current status of the esp_audio instance. ```APIDOC ## esp_audio_state_get ### Description Gets the current status of the esp_audio instance. ### Parameters #### Path Parameters - **handle** (esp_audio_handle_t) - in - The esp_audio instance - **state** (esp_audio_state_t *) - out - A pointer to esp_audio_state_t that indicates esp_audio status. ### Returns - ESP_ERR_AUDIO_NO_ERROR: on success - ESP_ERR_AUDIO_INVALID_PARAMETER: no esp_audio instance or esp_audio does not playing ``` -------------------------------- ### es8374_start Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/abstraction/es8374.html Starts the ES8374 codec chip for ADC, DAC, or both. ```APIDOC ## es8374_start ### Description Start ES8374 codec chip. ### Parameters * **mode** (es_module_t) - Set ADC or DAC or both ### Returns * ESP_OK * ESP_FAIL ``` -------------------------------- ### audio_codec_get_volume Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/abstraction/audio_hal.html Gets the current volume level of the audio codec. ```APIDOC ## audio_codec_get_volume ### Description Gets the current volume level of the audio codec. ### Method (Function Signature) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **volume** (int *) - Required - Pointer to an integer where the current volume will be stored. ### Request Example ```c int current_volume; audio_codec_get_volume(¤t_volume); ``` ### Response #### Success Response (esp_err_t) - **ESP_OK**: Success - **ESP_FAIL**: Failure #### Response Example ```c // Returns esp_err_t ``` ``` -------------------------------- ### zl38063_codec_init Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/abstraction/zl38063.html Initializes the ZL38063 chip with the provided configuration. Returns ESP_OK on success or ESP_FAIL on error. ```APIDOC ## zl38063_codec_init ### Description Initializes the ZL38063 chip. ### Parameters * **cfg** (audio_hal_codec_config_t *) - Configuration of ZL38063. ### Returns * ESP_OK * ESP_FAIL ``` -------------------------------- ### es8388_get_voice_volume Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/abstraction/es8388.html Gets the current voice volume of the ES8388 codec. ```APIDOC ## es8388_get_voice_volume ### Description Get voice volume. ### Parameters #### Path Parameters - **volume** (int *) - [out] voice volume (0~100) ### Returns - ESP_OK - ESP_FAIL ``` -------------------------------- ### es8374_codec_get_voice_volume Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/abstraction/es8374.html Gets the current voice volume of the ES8374 codec. ```APIDOC ## es8374_codec_get_voice_volume ### Description Get voice volume. ### Parameters * **volume** (int *) - [out] Voice volume (0~100) ### Returns * ESP_OK * ESP_FAIL ``` -------------------------------- ### es8388_start Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/abstraction/es8388.html Starts the ES8388 codec chip for ADC or DAC operations. ```APIDOC ## es8388_start ### Description Start ES8388 codec chip. ### Parameters #### Path Parameters - **mode** (es_module_t) - set ADC or DAC or both ### Returns - ESP_OK - ESP_FAIL ``` -------------------------------- ### Build the Project Source: https://docs.espressif.com/projects/esp-adf/en/latest/get-started/index.html Compile the application and all its components using the idf.py build command. This generates the necessary binaries for deployment. ```bash idf.py build ``` -------------------------------- ### Set up Environment (Windows) Source: https://docs.espressif.com/projects/esp-adf/en/latest/get-started/index.html Run the export batch script to set up the necessary environment variables for ESP-IDF tools in your current Command Prompt session on Windows. ```batch %userprofile%\esp\esp-adf\export.bat ``` -------------------------------- ### playlist_get_current_list_url_num Source: https://docs.espressif.com/projects/esp-adf/en/latest/genindex.html Gets the URL number of the currently playing item in the playlist. ```APIDOC ## playlist_get_current_list_url_num ### Description Gets the URL number of the currently playing item in the playlist. ### Function Signature ```cpp int playlist_get_current_list_url_num(playlist_handle_t playlist); ``` ### Parameters - **playlist** (playlist_handle_t): Handle to the playlist. ``` -------------------------------- ### audio_element_init Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/framework/audio_element.html Initializes an audio element with the provided configuration. This function creates and configures the audio element object. ```APIDOC ## audio_element_init ### Description Initializes audio element with config. ### Parameters * **config** (audio_element_cfg_t *) - The configuration ### Returns * audio_elemenent handle object * NULL ``` -------------------------------- ### audio_hal_ctrl_codec Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/abstraction/audio_hal.html Controls the codec driver, allowing it to be started or stopped for encoding, decoding, or both. ```APIDOC ## audio_hal_ctrl_codec ### Description Starts or stops the codec driver. ### Parameters * **audio_hal** (audio_hal_handle_t) - Reference function pointer for the selected audio codec * **mode** (audio_hal_codec_mode_t) - Select media HAL codec mode (encode/decode/both) * **audio_hal_ctrl** (audio_hal_ctrl_t) - Select start or stop state for the specified mode ### Returns * int - 0 for success, other values indicate failure. ``` -------------------------------- ### Set up Environment (Linux/macOS) Source: https://docs.espressif.com/projects/esp-adf/en/latest/get-started/index.html Source the export script to set up the necessary environment variables for ESP-IDF tools in your current terminal session on Linux and macOS. ```bash . $HOME/esp/esp-adf/export.sh ``` -------------------------------- ### Get Wakeup State Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/speech-recognition/audio_recorder.html Retrieves the current wake-up state of the audio recorder. ```c bool audio_recorder_get_wakeup_state(audio_rec_handle_t handle) ``` -------------------------------- ### Get I2S Stream Volume Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/streams/index.html Retrieves the current volume setting of the I2S stream. ```c esp_err_t i2s_alc_volume_get(audio_element_handle_t i2s_stream, int *volume); ``` -------------------------------- ### esp_periph_create Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/peripherals/esp_peripherals.html Initializes a new peripheral. This function creates and prepares a peripheral instance for use. ```APIDOC ## esp_periph_create ### Description Initializes a new peripheral. ### Parameters * **periph_id** (int) - The identifier for the peripheral. * **tag** (const char *) - A tag name for easy identification in debug logs. ### Returns The handle of the created peripheral (esp_periph_handle_t). ``` -------------------------------- ### audio_pipeline_get_el_once Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/framework/audio_pipeline.html Finds an element within a registered pipeline by tag, starting the search from a specified element. ```APIDOC ## audio_pipeline_get_el_once ### Description Finds an element within a registered pipeline by tag, starting the search from a specified element. ### Parameters * **pipeline** (audio_pipeline_handle_t) - Input - The Audio Pipeline Handle * **start_el** (audio_element_handle_t) - Input - Specific beginning element * **tag** (const char *) - Input - A char pointer ### Returns * NULL when any errors * Others on success ``` -------------------------------- ### Create Core Dump Upload Service Instance Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/services/coredump_upload_service.html Creates an instance of the core dump upload service. Pass a pointer to the coredump_upload_service_config_t structure for configuration. Returns NULL on failure. ```c periph_service_handle_t coredump_upload_service_create(coredump_upload_service_config_t *config); ``` -------------------------------- ### audio_hal_ctrl_t Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/abstraction/audio_hal.html Controls the operating mode of the audio codec chip, specifically for starting or stopping its operation. ```APIDOC ## Enumeration: audio_hal_ctrl_t ### Description Select operating mode i.e. start or stop for audio codec chip. ### Values * `AUDIO_HAL_CTRL_STOP`: set stop mode * `AUDIO_HAL_CTRL_START`: set start mode ``` -------------------------------- ### led_indicator_init Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/services/display_service.html Initializes a general LED indicator instance. This function prepares an LED for use by the system. ```APIDOC ## led_indicator_init ### Description Initialize led_indicator_handle_t instance. ### Parameters #### Path Parameters - **num** (gpio_num_t) - Required - led gpio number ### Returns - NULL, Fail - Others, Success ``` -------------------------------- ### Create Voltage Monitor Instance Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/services/battery_service.html Creates an instance of the voltage monitor. Returns NULL on failure, otherwise a handle to the monitor. ```c vol_monitor_handle_t vol_monitor_create(vol_monitor_param_t *config) ``` -------------------------------- ### dram_list_get_url_id Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/playlist/index.html Gets the ID of the current URL in the DRAM playlist. This returns the index of the active URL. ```APIDOC ## dram_list_get_url_id ### Description Get current url id in the dram playlist. ### Parameters #### Path Parameters - **handle** (playlist_operator_handle_t) - Playlist handle ### Returns - Current url id in dram playlist - ESP_FAIL Fail to get url id ``` -------------------------------- ### es8388_init Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/abstraction/es8388.html Initializes the ES8388 codec chip with the provided configuration. ```APIDOC ## es8388_init ### Description Initialize ES8388 codec chip. ### Parameters #### Path Parameters - **cfg** (audio_hal_codec_config_t *) - configuration of ES8388 ### Returns - ESP_OK - ESP_FAIL ``` -------------------------------- ### Initialize Equalizer Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/audio-processing/equalizer.html Creates an Audio Element handle for the equalizer. Requires an equalizer configuration structure. ```c audio_element_handle_t equalizer_init(equalizer_cfg_t *config); ``` -------------------------------- ### battery_service_vol_report_switch Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/services/battery_service.html Controls the reporting of battery voltage. This function can be used to start or stop the battery voltage report. ```APIDOC ## battery_service_vol_report_switch ### Description Start or stop the battery voltage report. ### Parameters * **handle** – **[in]** pointer to ‘periph_service_handle_t’ structure * **on_off** – **[in]** ‘true’ to start, ‘false’ to stop ### Returns * ESP_OK: Success * ESP_ERR_INVALID_ARG: handle is NULL ``` -------------------------------- ### raw_stream_read Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/streams/index.html Reads data from the RAW stream. This function is used to get data from the previous element in the pipeline. ```APIDOC ## raw_stream_read ### Description Read data from Stream. ### Parameters * **pipeline** (audio_element_handle_t) - The audio pipeline handle * **buffer** (char *) - The buffer * **buf_size** (int) - Maximum number of bytes to be read. ### Returns int - Number of bytes actually read. ``` -------------------------------- ### audio_codec_initialize Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/abstraction/audio_hal.html Initializes the audio codec chip with the provided configuration. ```APIDOC ## audio_codec_initialize ### Description Initializes the audio codec chip with the provided configuration. ### Method (Function Signature) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **codec_cfg** (audio_hal_codec_config_t *) - Required - Pointer to the structure containing the codec configuration. ### Request Example ```c audio_hal_codec_config_t config; // ... populate config ... audio_codec_initialize(&config); ``` ### Response #### Success Response (esp_err_t) - **ESP_OK**: Success - **ESP_FAIL**: Failure #### Response Example ```c // Returns esp_err_t ``` ``` -------------------------------- ### dram_list_get_url_num Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/playlist/index.html Gets the total number of URLs currently stored in the DRAM playlist. This provides a count of all entries. ```APIDOC ## dram_list_get_url_num ### Description Get URLs number in the dram playlist. ### Parameters #### Path Parameters - **handle** (playlist_operator_handle_t) - Playlist handle ### Returns - URLs number in dram playlist - ESP_FAIL Fail to get number of urls ``` -------------------------------- ### audio_element_get_uri Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/framework/audio_element.html Gets the audio element URI. This function returns a pointer to the URI associated with the audio element. ```APIDOC ## audio_element_get_uri ### Description Get audio element URI. ### Parameters * **el** - [in] The audio element handle ### Returns URI pointer ``` -------------------------------- ### Initialize IS31x LED Bar Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/services/display_service.html Initializes an instance of the IS31x LED bar peripheral. Returns a handle on success or NULL on failure. ```c esp_periph_handle_t led_bar_is31x_init() ``` -------------------------------- ### audio_element_getinfo Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/framework/audio_element.html Gets audio element information. This function retrieves the current information associated with an audio element. ```APIDOC ## audio_element_getinfo ### Description Get audio element infomation. ### Parameters * **el** - [in] The audio element handle * **info** - The information pointer ### Returns * ESP_OK * ESP_FAIL ``` -------------------------------- ### Initialize OGG Decoder Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/codecs/ogg_decoder.html Creates an Audio Element handle for decoding OGG data. Requires a configuration structure. ```c audio_element_handle_t ogg_decoder_init(ogg_decoder_cfg_t *config) ``` -------------------------------- ### esp_audio_duration_get Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/framework/esp_audio.html Gets the total duration in microseconds of the currently playing music. This function is applicable only for decoded music. ```APIDOC ## esp_audio_duration_get ### Description Gets the total duration in microseconds of the currently playing music. This function is applicable only for decoded music. ### Parameters #### Path Parameters - **handle** (esp_audio_handle_t) - in - The esp_audio instance - **duration** (int *) - out - A pointer to int that indicates decoding total time. ### Returns - ESP_ERR_AUDIO_NO_ERROR: on success - ESP_ERR_AUDIO_INVALID_PARAMETER: no esp_audio instance - ESP_ERR_AUDIO_NOT_READY: no codec element or no in element ``` -------------------------------- ### esp_periph_init Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/peripherals/esp_peripherals.html Initializes a peripheral instance by executing its specific initialization function. This is a prerequisite for using the peripheral. ```APIDOC ## esp_periph_init ### Description Call this to execute `init` function of peripheral instance. ### Method ESP_APICALL ### Parameters #### Path Parameters - **periph** (esp_periph_handle_t) - Required - The peripheral handle. ### Returns - ESP_OK on success - ESP_FAIL on error ``` -------------------------------- ### periph_led_init Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/peripherals/periph_led.html Initializes the LED peripheral and creates a handle for managing LED operations. The handle is automatically destroyed when `esp_periph_destroy` is called. ```APIDOC ## periph_led_init ### Description Create the LED peripheral handle for esp_peripherals. Note: The handle was created by this function automatically destroy when `esp_periph_destroy` is called. ### Parameters * **config** (periph_led_cfg_t *) - The configuration ### Returns * The esp peripheral handle (esp_periph_handle_t) ``` -------------------------------- ### esp_periph_get_state Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/peripherals/esp_peripherals.html Gets the current operational state of a peripheral. This is useful for monitoring and controlling the peripheral's lifecycle. ```APIDOC ## esp_periph_get_state ### Description Get the current state of peripheral. ### Method ESP_APICALL ### Parameters #### Path Parameters - **periph** (esp_periph_handle_t) - Required - The handle of peripheral. ### Returns - The peripheral working state (esp_periph_state_t) ``` -------------------------------- ### Flash Project using idf.py Source: https://docs.espressif.com/projects/esp-adf/en/latest/get-started/index.html A simpler command to build and flash your project. Replace PORT with your board's serial port and optionally specify the baud rate. ```bash idf.py -p PORT [-b BAUD] flash monitor ``` -------------------------------- ### ESP32-C3-Lyra Flash Test Log Source: https://docs.espressif.com/projects/esp-adf/en/latest/design-guide/dev-boards/user-guide-esp32-c3-lyra.html This log indicates the start and successful completion of the flash test on the ESP32-C3-Lyra board. ```text Step1 Flash Test Start Step1 Flash Test OK ``` -------------------------------- ### display_service_create Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/services/display_service.html Creates a display service instance with the provided configuration. This function initializes the display service and returns a handle for further operations. ```APIDOC ## display_service_create ### Description Creates a display service instance with the provided configuration. ### Signature ```c display_service_handle_t display_service_create(display_service_config_t *cfg) ``` ### Parameters * **cfg** (*display_service_config_t* *) - Pointer to the display service configuration structure. ``` -------------------------------- ### audio_event_iface_init Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/framework/audio_event_iface.html Initializes the audio event interface with the provided configuration. This function sets up the necessary structures for event handling. ```APIDOC ## audio_event_iface_init ### Description Initializes audio event. ### Parameters * **config** (audio_event_iface_cfg_t *) - The configurations ### Returns * ESP_OK * ESP_FAIL ``` -------------------------------- ### esp_audio_time_get Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/framework/esp_audio.html Gets the current playback position in microseconds for the currently playing music. This function is applicable only for decoded music. ```APIDOC ## esp_audio_time_get ### Description Gets the current playback position in microseconds for the currently playing music. This function is applicable only for decoded music. ### Parameters #### Path Parameters - **handle** (esp_audio_handle_t) - in - The esp_audio instance - **time** (int *) - out - A pointer to int that indicates esp_audio decoding position. ### Returns - ESP_ERR_AUDIO_NO_ERROR: on success - ESP_ERR_AUDIO_INVALID_PARAMETER: no esp_audio instance - ESP_ERR_AUDIO_NOT_READY: no out stream ``` -------------------------------- ### partition_list_create Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/playlist/index.html Creates a playlist in a flash partition. Requires two partitions with subtypes 0x06 and 0x07 to be pre-configured. ```APIDOC ## partition_list_create ### Description Create a playlist in flash partition by list id. ### Note Please add 2 partitions to partition table whose subtype are 0x06 and 0x07 first. ### Parameters #### Out Parameters - **handle** (playlist_operator_handle_t) - The playlist handle from application layer ### Returns - ESP_OK success - ESP_FAIL failed ``` -------------------------------- ### esp_audio_pos_get Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/framework/esp_audio.html Gets the current playback position in bytes for the currently playing music. This function is applicable only for decoded music. ```APIDOC ## esp_audio_pos_get ### Description Gets the current playback position in bytes for the currently playing music. This function is applicable only for decoded music. ### Parameters #### Path Parameters - **handle** (esp_audio_handle_t) - in - The esp_audio instance - **pos** (int *) - out - A pointer to int that indicates esp_audio decoding position. ### Returns - ESP_ERR_AUDIO_NO_ERROR: on success - ESP_ERR_AUDIO_INVALID_PARAMETER: no esp_audio instance - ESP_ERR_AUDIO_NOT_READY: no codec element ``` -------------------------------- ### esp_audio_speed_get Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/framework/esp_audio.html Gets the current playback speed index of the esp_audio. The index corresponds to values defined in the `esp_audio_play_speed_t` enum. ```APIDOC ## esp_audio_speed_get ### Description Getting esp_audio play speed index, index value is from “esp_audio_speed_t” enum. ### Parameters * **handle** – [in] The esp_audio instance * **speed_index** – [out] Current audio play speed index. ### Returns * ESP_ERR_AUDIO_NO_ERROR: on success * ESP_ERR_AUDIO_INVALID_PARAMETER: invalid arguments ``` -------------------------------- ### led_bar_ws2812_init Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/services/display_service.html Initializes a WS2812 LED bar instance. This function sets up the necessary resources for controlling a WS2812 LED strip. ```APIDOC ## led_bar_ws2812_init ### Description Initialize led_bar_ws2812_handle_t instance. ### Parameters #### Path Parameters - **gpio_num** (gpio_num_t) - Required - The GPIO number of ws2812 - **led_num** (int) - Required - The number of all ws2812 ### Returns - led_bar_ws2812_handle_t - A handle to the initialized WS2812 LED bar instance. ``` -------------------------------- ### I2S Stream Macros Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/streams/index.html Helper macros for I2S stream configuration, providing default values and convenient setup. ```APIDOC ## Macros - **I2S_STREAM_TASK_STACK** - **I2S_STREAM_BUF_SIZE** - **I2S_STREAM_TASK_PRIO** - **I2S_STREAM_TASK_CORE** - **I2S_STREAM_RINGBUFFER_SIZE** - **I2S_STREAM_CFG_DEFAULT()** - Description: Provides a default configuration for the I2S stream. - **I2S_STREAM_CFG_DEFAULT_WITH_PARA(port, rate, bits, stream_type)** - Description: Provides a default configuration with specified parameters for port, rate, bits, and stream type. - **I2S_STD_PHILIPS_SLOT_DEFAULT_ADF_CONFIG(bits_per_sample, mono_or_stereo)** - Description: Provides a default configuration for the I2S standard Philips slot, with options for bits per sample and mono/stereo. - **I2S_STREAM_CFG_DEFAULT_WITH_TYLE_AND_CH(port, rate, bits, stream_type, channel)** - Description: Provides a default configuration with specified parameters for port, rate, bits, stream type, and channel. ``` -------------------------------- ### periph_wifi_config_wait_done Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/peripherals/periph_wifi.html Waits for the Wi-Fi network setup process to complete. This function blocks the current thread for a specified duration. ```APIDOC ## periph_wifi_config_wait_done ### Description Waits for Wi-Fi setup to complete. ### Parameters * **periph** (esp_periph_handle_t) - [in] The peripheral handle. * **tick_to_wait** (TickType_t) - [in] The number of ticks to wait. ### Returns * ESP_OK - If the setup completes successfully. * ESP_FAIL - If the setup fails or times out. ``` -------------------------------- ### sonic_init Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/audio-processing/audio_sonic.html Creates an Audio Element handle for the sonic component, initializing it with the provided configuration. ```APIDOC ## sonic_init ### Description Creates an Audio Element handle for sonic. ### Parameters #### Path Parameters * **config** (sonic_cfg_t *) - Required - The sonic configuration ### Returns * The audio element handler ``` -------------------------------- ### amr_decoder_init Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/codecs/amr_codecs.html Creates an Audio Element handle to decode incoming AMR data. Requires a configuration structure for setup. ```APIDOC ## amr_decoder_init ### Description Creates an Audio Element handle to decode incoming AMR data. ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body * **config** (amr_decoder_cfg_t *) - Required - The configuration for the AMR decoder. ### Request Example ```json { "config": { ... } } ``` ### Response #### Success Response (200) * **audio_element_handle_t** - The audio element handle for the AMR decoder. #### Response Example ```json { "handle": "" } ``` ``` -------------------------------- ### Flash Project using esptool.py Source: https://docs.espressif.com/projects/esp-adf/en/latest/get-started/index.html Use this command to flash your completed project onto the ESP32 device. Replace (PORT) with your board's serial port. ```bash /path/to/.espressif/python_env/idf4.2_py2.7_env/bin/python ../esp-idf/components/esptool_py/esptool/esptool.py -p (PORT) -b 460800 --before default_reset --after hard_reset --chip esp32 write_flash --flash_mode dio --flash_size detect --flash_freq 40m 0x1000 build/bootloader/bootloader.bin 0x8000 build/partition_table/partition-table.bin 0x10000 build/play_mp3_control.bin ``` -------------------------------- ### audio_element_process_init Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/framework/audio_element.html Initializes the audio element's processing capabilities, equivalent to calling the element's `open` function. ```APIDOC ## audio_element_process_init ### Description Provides a way to call element’s `open`. ### Parameters * **el** (audio_element_handle_t) - The audio element handle. ### Returns * ESP_OK - If initialization is successful. * ESP_FAIL - If initialization fails. ``` -------------------------------- ### dueros_start_wifi_cfg Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/services/dueros_service.html Initiates the Wi-Fi configuration process for DuerOS. This allows the device to connect to a network. ```APIDOC ## dueros_start_wifi_cfg ### Description Start the wifi configure process. ### Parameters #### Path Parameters * **handle** (audio_service_handle_t) - Required - Dueros service handle * **cfg** (duer_wifi_cfg_t *) - Required - Configuration ### Returns ESP_OK ESP_FAIL ``` -------------------------------- ### esp_periph_run Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/peripherals/esp_peripherals.html Executes the main run function of a peripheral instance. This typically starts the peripheral's operational loop or task. ```APIDOC ## esp_periph_run ### Description Call this to execute `run` function of peripheral instance. ### Method ESP_APICALL ### Parameters #### Path Parameters - **periph** (esp_periph_handle_t) - Required - The peripheral handle. ### Returns - ESP_OK on success - ESP_FAIL on error ``` -------------------------------- ### led_bar_aw2013_init Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/services/display_service.html Initializes the AW2013 LED bar driver. This function sets up the necessary configurations for the AW2013 LED bar. ```APIDOC ## led_bar_aw2013_init ### Description Initializes the AW2013 LED bar driver. ### Signature ```c esp_periph_handle_t led_bar_aw2013_init(void) ``` ### Returns * **NULL** - If initialization fails. * **others** - A handle to the initialized LED bar instance on success. ``` -------------------------------- ### periph_wifi_init Source: https://docs.espressif.com/projects/esp-adf/en/latest/api-reference/peripherals/periph_wifi.html Initializes the Wi-Fi peripheral and creates a handle for managing Wi-Fi connections. The handle is automatically destroyed when `esp_periph_destroy` is called. ```APIDOC ## periph_wifi_init ### Description Creates the Wi-Fi peripheral handle for esp_peripherals. The handle is automatically destroyed when `esp_periph_destroy` is called. ### Parameters * **config** (periph_wifi_cfg_t *) - The configuration for the Wi-Fi peripheral. ### Returns * esp_periph_handle_t - The handle for the Wi-Fi peripheral. ```