├── .gitignore ├── .gitlab-ci.yml ├── CMakeLists.txt ├── Kconfig ├── README.md ├── README_CN.md ├── components ├── data_sequence │ ├── CMakeLists.txt │ ├── include │ │ └── data_seq.h │ ├── src │ │ └── data_seq.c │ └── test │ │ ├── CMakeLists.txt │ │ └── test_data_seq.c ├── esp_common │ ├── CMakeLists.txt │ ├── include │ │ ├── esp_attr.h │ │ ├── esp_compiler.h │ │ ├── esp_err.h │ │ ├── esp_transport.h │ │ └── esp_wdf_version.h │ └── src │ │ └── esp_err_to_name.c ├── esp_event │ ├── CMakeLists.txt │ └── include │ │ ├── esp_event.h │ │ └── esp_event_base.h ├── esp_system │ ├── CMakeLists.txt │ ├── abort.c │ └── esp_err.c ├── extended_wasm_app │ ├── CMakeLists.txt │ ├── Kconfig │ ├── esp-rainmaker │ │ ├── include │ │ │ ├── esp_rainmaker │ │ │ │ ├── esp_rmaker_console.h │ │ │ │ ├── esp_rmaker_core.h │ │ │ │ ├── esp_rmaker_mqtt.h │ │ │ │ ├── esp_rmaker_ota.h │ │ │ │ ├── esp_rmaker_scenes.h │ │ │ │ ├── esp_rmaker_schedule.h │ │ │ │ ├── esp_rmaker_standard_devices.h │ │ │ │ ├── esp_rmaker_standard_params.h │ │ │ │ ├── esp_rmaker_standard_services.h │ │ │ │ ├── esp_rmaker_standard_types.h │ │ │ │ └── esp_rmaker_user_mapping.h │ │ │ ├── esp_schedule │ │ │ │ └── esp_schedule.h │ │ │ └── rmaker_common │ │ │ │ ├── esp_rmaker_common_events.h │ │ │ │ ├── esp_rmaker_factory.h │ │ │ │ ├── esp_rmaker_mqtt_glue.h │ │ │ │ ├── esp_rmaker_utils.h │ │ │ │ └── esp_rmaker_work_queue.h │ │ ├── private_include │ │ │ └── rmaker_wasm_api.h │ │ └── src │ │ │ ├── standard_types │ │ │ ├── esp_rmaker_standard_devices.c │ │ │ ├── esp_rmaker_standard_params.c │ │ │ └── esp_rmaker_standard_services.c │ │ │ └── wm_ext_wasm_app_rmaker.c │ ├── esp_http_client │ │ ├── include │ │ │ └── esp_http_client.h │ │ ├── private_include │ │ │ └── http_client_wasm_api.h │ │ └── src │ │ │ └── wm_ext_wasm_app_http_client.c │ ├── esp_lvgl │ │ ├── include │ │ │ ├── config │ │ │ │ └── lv_conf.h │ │ │ ├── esp_lvgl.h │ │ │ └── lvgl │ │ │ │ ├── lv_conf_template.h │ │ │ │ ├── lvgl.h │ │ │ │ └── src │ │ │ │ ├── core │ │ │ │ ├── lv_disp.h │ │ │ │ ├── lv_event.h │ │ │ │ ├── lv_group.h │ │ │ │ ├── lv_indev.h │ │ │ │ ├── lv_indev_scroll.h │ │ │ │ ├── lv_obj.h │ │ │ │ ├── lv_obj_class.h │ │ │ │ ├── lv_obj_draw.h │ │ │ │ ├── lv_obj_pos.h │ │ │ │ ├── lv_obj_scroll.h │ │ │ │ ├── lv_obj_style.h │ │ │ │ ├── lv_obj_style_gen.h │ │ │ │ ├── lv_obj_tree.h │ │ │ │ ├── lv_refr.h │ │ │ │ └── lv_theme.h │ │ │ │ ├── draw │ │ │ │ ├── lv_draw.h │ │ │ │ ├── lv_draw_arc.h │ │ │ │ ├── lv_draw_blend.h │ │ │ │ ├── lv_draw_img.h │ │ │ │ ├── lv_draw_label.h │ │ │ │ ├── lv_draw_line.h │ │ │ │ ├── lv_draw_mask.h │ │ │ │ ├── lv_draw_rect.h │ │ │ │ ├── lv_draw_triangle.h │ │ │ │ ├── lv_img_buf.h │ │ │ │ ├── lv_img_cache.h │ │ │ │ └── lv_img_decoder.h │ │ │ │ ├── extra │ │ │ │ ├── layouts │ │ │ │ │ ├── flex │ │ │ │ │ │ └── lv_flex.h │ │ │ │ │ ├── grid │ │ │ │ │ │ └── lv_grid.h │ │ │ │ │ └── lv_layouts.h │ │ │ │ ├── libs │ │ │ │ │ ├── bmp │ │ │ │ │ │ └── lv_bmp.h │ │ │ │ │ ├── freetype │ │ │ │ │ │ └── lv_freetype.h │ │ │ │ │ ├── fsdrv │ │ │ │ │ │ └── lv_fsdrv.h │ │ │ │ │ ├── gif │ │ │ │ │ │ ├── gifdec.h │ │ │ │ │ │ └── lv_gif.h │ │ │ │ │ ├── lv_libs.h │ │ │ │ │ ├── png │ │ │ │ │ │ ├── lodepng.h │ │ │ │ │ │ └── lv_png.h │ │ │ │ │ ├── qrcode │ │ │ │ │ │ ├── lv_qrcode.h │ │ │ │ │ │ └── qrcodegen.h │ │ │ │ │ ├── rlottie │ │ │ │ │ │ └── lv_rlottie.h │ │ │ │ │ └── sjpg │ │ │ │ │ │ ├── lv_sjpg.h │ │ │ │ │ │ ├── tjpgd.h │ │ │ │ │ │ └── tjpgdcnf.h │ │ │ │ ├── lv_extra.h │ │ │ │ ├── others │ │ │ │ │ ├── lv_others.h │ │ │ │ │ └── snapshot │ │ │ │ │ │ └── lv_snapshot.h │ │ │ │ ├── themes │ │ │ │ │ ├── basic │ │ │ │ │ │ └── lv_theme_basic.h │ │ │ │ │ ├── default │ │ │ │ │ │ └── lv_theme_default.h │ │ │ │ │ ├── lv_themes.h │ │ │ │ │ └── mono │ │ │ │ │ │ └── lv_theme_mono.h │ │ │ │ └── widgets │ │ │ │ │ ├── animimg │ │ │ │ │ └── lv_animimg.h │ │ │ │ │ ├── calendar │ │ │ │ │ ├── lv_calendar.h │ │ │ │ │ ├── lv_calendar_header_arrow.h │ │ │ │ │ └── lv_calendar_header_dropdown.h │ │ │ │ │ ├── chart │ │ │ │ │ └── lv_chart.h │ │ │ │ │ ├── colorwheel │ │ │ │ │ └── lv_colorwheel.h │ │ │ │ │ ├── imgbtn │ │ │ │ │ └── lv_imgbtn.h │ │ │ │ │ ├── keyboard │ │ │ │ │ └── lv_keyboard.h │ │ │ │ │ ├── led │ │ │ │ │ └── lv_led.h │ │ │ │ │ ├── list │ │ │ │ │ └── lv_list.h │ │ │ │ │ ├── lv_widgets.h │ │ │ │ │ ├── meter │ │ │ │ │ └── lv_meter.h │ │ │ │ │ ├── msgbox │ │ │ │ │ └── lv_msgbox.h │ │ │ │ │ ├── span │ │ │ │ │ └── lv_span.h │ │ │ │ │ ├── spinbox │ │ │ │ │ └── lv_spinbox.h │ │ │ │ │ ├── spinner │ │ │ │ │ └── lv_spinner.h │ │ │ │ │ ├── tabview │ │ │ │ │ └── lv_tabview.h │ │ │ │ │ ├── tileview │ │ │ │ │ └── lv_tileview.h │ │ │ │ │ └── win │ │ │ │ │ └── lv_win.h │ │ │ │ ├── font │ │ │ │ ├── lv_font.h │ │ │ │ ├── lv_font_fmt_txt.h │ │ │ │ ├── lv_font_loader.h │ │ │ │ └── lv_symbol_def.h │ │ │ │ ├── gpu │ │ │ │ ├── lv_gpu_nxp_pxp.h │ │ │ │ ├── lv_gpu_nxp_pxp_osa.h │ │ │ │ ├── lv_gpu_nxp_vglite.h │ │ │ │ ├── lv_gpu_sdl.h │ │ │ │ ├── lv_gpu_stm32_dma2d.h │ │ │ │ └── sdl │ │ │ │ │ ├── lv_gpu_sdl_lru.h │ │ │ │ │ ├── lv_gpu_sdl_mask.h │ │ │ │ │ ├── lv_gpu_sdl_stack_blur.h │ │ │ │ │ ├── lv_gpu_sdl_texture_cache.h │ │ │ │ │ └── lv_gpu_sdl_utils.h │ │ │ │ ├── hal │ │ │ │ ├── lv_hal.h │ │ │ │ ├── lv_hal_disp.h │ │ │ │ ├── lv_hal_indev.h │ │ │ │ └── lv_hal_tick.h │ │ │ │ ├── lv_api_map.h │ │ │ │ ├── lv_conf_internal.h │ │ │ │ ├── lv_conf_kconfig.h │ │ │ │ ├── lvgl.h │ │ │ │ ├── misc │ │ │ │ ├── lv_anim.h │ │ │ │ ├── lv_anim_timeline.h │ │ │ │ ├── lv_area.h │ │ │ │ ├── lv_assert.h │ │ │ │ ├── lv_async.h │ │ │ │ ├── lv_bidi.h │ │ │ │ ├── lv_color.h │ │ │ │ ├── lv_fs.h │ │ │ │ ├── lv_gc.h │ │ │ │ ├── lv_ll.h │ │ │ │ ├── lv_log.h │ │ │ │ ├── lv_math.h │ │ │ │ ├── lv_mem.h │ │ │ │ ├── lv_printf.h │ │ │ │ ├── lv_style.h │ │ │ │ ├── lv_style_gen.h │ │ │ │ ├── lv_templ.h │ │ │ │ ├── lv_timer.h │ │ │ │ ├── lv_tlsf.h │ │ │ │ ├── lv_txt.h │ │ │ │ ├── lv_txt_ap.h │ │ │ │ ├── lv_types.h │ │ │ │ └── lv_utils.h │ │ │ │ └── widgets │ │ │ │ ├── lv_arc.h │ │ │ │ ├── lv_bar.h │ │ │ │ ├── lv_btn.h │ │ │ │ ├── lv_btnmatrix.h │ │ │ │ ├── lv_canvas.h │ │ │ │ ├── lv_checkbox.h │ │ │ │ ├── lv_dropdown.h │ │ │ │ ├── lv_img.h │ │ │ │ ├── lv_label.h │ │ │ │ ├── lv_line.h │ │ │ │ ├── lv_objx_templ.h │ │ │ │ ├── lv_roller.h │ │ │ │ ├── lv_slider.h │ │ │ │ ├── lv_switch.h │ │ │ │ ├── lv_table.h │ │ │ │ └── lv_textarea.h │ │ ├── private_include │ │ │ └── wm_ext_wasm_app_lvgl_func_id.h │ │ └── src │ │ │ └── wm_ext_wasm_app_lvgl.c │ ├── esp_mqtt │ │ ├── include │ │ │ └── mqtt_client.h │ │ ├── private_include │ │ │ └── mqtt_wasm_api.h │ │ └── src │ │ │ └── wm_ext_wasm_app_mqtt.c │ ├── esp_wifi │ │ └── include │ │ │ └── esp_wifi.h │ └── wifi_provisioning │ │ ├── include │ │ └── wifi_provisioning │ │ │ ├── manager.h │ │ │ ├── scheme_ble.h │ │ │ └── scheme_softap.h │ │ ├── private_include │ │ └── wifi_prov_wasm_api.h │ │ └── src │ │ └── wm_ext_wasm_app_wifi_provisioning.c ├── log │ ├── CMakeLists.txt │ └── include │ │ └── esp_log.h ├── qrcode │ ├── CMakeLists.txt │ ├── README.md │ ├── include │ │ └── qrcode.h │ ├── private_include │ │ └── qrcodegen.h │ └── src │ │ ├── esp_qrcode_main.c │ │ ├── esp_qrcode_wrapper.c │ │ └── qrcodegen.c └── wamr │ ├── CMakeLists.txt │ ├── Kconfig │ ├── app-framework │ ├── app-native-shared │ │ ├── README.md │ │ ├── attr_container.c │ │ └── restful_utils.c │ ├── base │ │ └── app │ │ │ ├── bh_platform.c │ │ │ ├── req_resp_api.h │ │ │ ├── request.c │ │ │ ├── timer.c │ │ │ └── timer_api.h │ └── include │ │ ├── bh_platform.h │ │ ├── bi-inc │ │ ├── attr_container.h │ │ └── shared_utils.h │ │ ├── wa-inc │ │ ├── request.h │ │ └── timer_wasm_app.h │ │ └── wasm_app.h │ ├── lib-socket │ ├── inc │ │ └── wasi_socket_ext.h │ └── src │ │ └── wasi │ │ └── wasi_socket_ext.c │ ├── libc-builtin-extended │ ├── include │ │ └── ioctl │ │ │ ├── esp_gpio_ioctl.h │ │ │ ├── esp_i2c_ioctl.h │ │ │ ├── esp_ledc_ioctl.h │ │ │ └── esp_spi_ioctl.h │ ├── private_include │ │ └── libc_builtin_ext_data_seq.h │ └── src │ │ └── libc_ioctl.c │ └── libc-wasi │ └── include │ └── pthread.h ├── docs └── _static │ └── esp-wdf_block_diagram.png ├── examples ├── coremark │ ├── CMakeLists.txt │ ├── main │ │ ├── CMakeLists.txt │ │ ├── core_list_join.c │ │ ├── core_main.c │ │ ├── core_matrix.c │ │ ├── core_portme.c │ │ ├── core_portme.h │ │ ├── core_portme_posix_overrides.h │ │ ├── core_state.c │ │ ├── core_util.c │ │ └── coremark.h │ └── sdkconfig.defaults ├── file_system │ ├── CMakeLists.txt │ └── main │ │ ├── CMakeLists.txt │ │ └── file_system_main.c ├── gui │ └── lv_demos │ │ ├── lv_demo_benchmark │ │ ├── CMakeLists.txt │ │ ├── main │ │ │ ├── CMakeLists.txt │ │ │ ├── assets │ │ │ │ ├── img_benchmark_cogwheel_alpha16.c │ │ │ │ ├── img_benchmark_cogwheel_argb.c │ │ │ │ ├── img_benchmark_cogwheel_chroma_keyed.c │ │ │ │ ├── img_benchmark_cogwheel_indexed16.c │ │ │ │ ├── img_benchmark_cogwheel_rgb.c │ │ │ │ ├── lv_font_montserrat_12_compr_az.c │ │ │ │ ├── lv_font_montserrat_16_compr_az.c │ │ │ │ └── lv_font_montserrat_28_compr_az.c │ │ │ ├── lv_demo_benchmark.c │ │ │ ├── lv_demo_benchmark.h │ │ │ └── lv_demo_benchmark_main.c │ │ └── sdkconfig.defaults │ │ ├── lv_demo_music │ │ ├── CMakeLists.txt │ │ ├── main │ │ │ ├── CMakeLists.txt │ │ │ ├── assets │ │ │ │ ├── img_lv_demo_music_btn_list_pause.c │ │ │ │ ├── img_lv_demo_music_btn_list_play.c │ │ │ │ ├── img_lv_demo_music_btn_loop.c │ │ │ │ ├── img_lv_demo_music_btn_next.c │ │ │ │ ├── img_lv_demo_music_btn_pause.c │ │ │ │ ├── img_lv_demo_music_btn_play.c │ │ │ │ ├── img_lv_demo_music_btn_prev.c │ │ │ │ ├── img_lv_demo_music_btn_rnd.c │ │ │ │ ├── img_lv_demo_music_corner_left.c │ │ │ │ ├── img_lv_demo_music_corner_right.c │ │ │ │ ├── img_lv_demo_music_cover_1.c │ │ │ │ ├── img_lv_demo_music_cover_2.c │ │ │ │ ├── img_lv_demo_music_cover_3.c │ │ │ │ ├── img_lv_demo_music_icon_1.c │ │ │ │ ├── img_lv_demo_music_icon_2.c │ │ │ │ ├── img_lv_demo_music_icon_3.c │ │ │ │ ├── img_lv_demo_music_icon_4.c │ │ │ │ ├── img_lv_demo_music_list_border.c │ │ │ │ ├── img_lv_demo_music_logo.c │ │ │ │ ├── img_lv_demo_music_slider_knob.c │ │ │ │ ├── img_lv_demo_music_wave_bottom.c │ │ │ │ ├── img_lv_demo_music_wave_top.c │ │ │ │ ├── spectrum_1.h │ │ │ │ ├── spectrum_2.h │ │ │ │ └── spectrum_3.h │ │ │ ├── lv_demo_music.c │ │ │ ├── lv_demo_music.h │ │ │ ├── lv_demo_music_list.c │ │ │ ├── lv_demo_music_list.h │ │ │ ├── lv_demo_music_main.c │ │ │ ├── lv_demo_music_main.h │ │ │ └── lv_demo_music_run_main.c │ │ └── sdkconfig.defaults │ │ ├── lv_demo_stress │ │ ├── CMakeLists.txt │ │ └── main │ │ │ ├── CMakeLists.txt │ │ │ ├── assets │ │ │ ├── lv_font_montserrat_12_compr_az.c │ │ │ ├── lv_font_montserrat_16_compr_az.c │ │ │ └── lv_font_montserrat_28_compr_az.c │ │ │ ├── lv_demo_stress.c │ │ │ ├── lv_demo_stress.h │ │ │ └── lv_demo_stress_main.c │ │ └── lv_demo_widgets │ │ ├── CMakeLists.txt │ │ ├── main │ │ ├── CMakeLists.txt │ │ ├── assets │ │ │ ├── img_clothes.c │ │ │ ├── img_demo_widgets_avatar.c │ │ │ └── img_lvgl_logo.c │ │ ├── lv_demo_widgets.c │ │ ├── lv_demo_widgets.h │ │ └── lv_demo_widgets_main.c │ │ └── sdkconfig.defaults ├── hello_world │ ├── CMakeLists.txt │ └── main │ │ ├── CMakeLists.txt │ │ └── hello_world.c ├── multi_thread │ ├── CMakeLists.txt │ ├── main │ │ ├── CMakeLists.txt │ │ └── multi_thread.c │ └── sdkconfig.defaults ├── peripherals │ ├── gpio │ │ └── gpio_simple │ │ │ ├── CMakeLists.txt │ │ │ └── main │ │ │ ├── CMakeLists.txt │ │ │ ├── Kconfig.projbuild │ │ │ └── gpio_simple_main.c │ ├── i2c │ │ ├── i2c_bh1750 │ │ │ ├── CMakeLists.txt │ │ │ └── main │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── Kconfig.projbuild │ │ │ │ └── i2c_bh1750_main.c │ │ └── i2c_tt21100 │ │ │ ├── CMakeLists.txt │ │ │ └── main │ │ │ ├── CMakeLists.txt │ │ │ ├── Kconfig.projbuild │ │ │ └── i2c_tt21100_main.c │ ├── ledc │ │ └── ledc_simple │ │ │ ├── CMakeLists.txt │ │ │ └── main │ │ │ ├── CMakeLists.txt │ │ │ ├── Kconfig.projbuild │ │ │ └── ledc_simple_main.c │ ├── spi │ │ ├── spi_master_simple │ │ │ ├── CMakeLists.txt │ │ │ └── main │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── Kconfig.projbuild │ │ │ │ └── spi_master_simple_main.c │ │ └── spi_slave_simple │ │ │ ├── CMakeLists.txt │ │ │ └── main │ │ │ ├── CMakeLists.txt │ │ │ ├── Kconfig.projbuild │ │ │ └── spi_slave_simple_main.c │ └── uart │ │ └── uart_simple │ │ ├── CMakeLists.txt │ │ └── main │ │ ├── CMakeLists.txt │ │ ├── Kconfig.projbuild │ │ └── uart_simple_main.c ├── protocols │ ├── esp_http_client │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── main │ │ │ ├── CMakeLists.txt │ │ │ ├── Kconfig.projbuild │ │ │ ├── esp_http_client_example.c │ │ │ ├── howsmyssl_com_root_cert.pem │ │ │ └── postman_root_cert.pem │ │ └── sdkconfig.defaults │ ├── mqtt │ │ └── generic │ │ │ ├── CMakeLists.txt │ │ │ ├── README.md │ │ │ ├── main │ │ │ ├── CMakeLists.txt │ │ │ ├── Kconfig.projbuild │ │ │ ├── app_main.c │ │ │ └── mqtt_eclipseprojects_io.pem │ │ │ └── sdkconfig.defaults │ └── sockets │ │ ├── README.md │ │ ├── socket-api │ │ ├── README.md │ │ ├── send_recv │ │ │ ├── CMakeLists.txt │ │ │ ├── main │ │ │ │ ├── CMakeLists.txt │ │ │ │ └── send_recv.c │ │ │ └── sdkconfig.defaults │ │ ├── tcp_client │ │ │ ├── CMakeLists.txt │ │ │ ├── main │ │ │ │ ├── CMakeLists.txt │ │ │ │ ├── socket_utils.h │ │ │ │ └── tcp_client.c │ │ │ └── sdkconfig.defaults │ │ └── tcp_server │ │ │ ├── CMakeLists.txt │ │ │ ├── main │ │ │ ├── CMakeLists.txt │ │ │ ├── socket_utils.h │ │ │ └── tcp_server.c │ │ │ └── sdkconfig.defaults │ │ ├── tcp_client │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── main │ │ │ ├── CMakeLists.txt │ │ │ ├── Kconfig.projbuild │ │ │ └── tcp_client.c │ │ └── sdkconfig.defaults │ │ └── tcp_server │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── main │ │ ├── CMakeLists.txt │ │ ├── Kconfig.projbuild │ │ └── tcp_server.c │ │ └── sdkconfig.defaults ├── provisioning │ ├── README.md │ └── wifi_prov_mgr │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── main │ │ ├── CMakeLists.txt │ │ ├── Kconfig.projbuild │ │ └── wifi_prov_mgr.c │ │ └── sdkconfig.defaults ├── rainmaker │ ├── common │ │ └── app_wifi │ │ │ ├── CMakeLists.txt │ │ │ ├── Kconfig.projbuild │ │ │ ├── app_wifi.c │ │ │ └── app_wifi.h │ └── switch │ │ ├── CMakeLists.txt │ │ ├── README.md │ │ ├── main │ │ ├── CMakeLists.txt │ │ └── switch.c │ │ └── sdkconfig.defaults └── simple │ ├── event_publisher │ ├── CMakeLists.txt │ ├── main │ │ ├── CMakeLists.txt │ │ └── event_publisher.c │ └── sdkconfig.defaults │ ├── event_subscriber │ ├── CMakeLists.txt │ ├── main │ │ ├── CMakeLists.txt │ │ └── event_subscriber.c │ └── sdkconfig.defaults │ ├── request_handler │ ├── CMakeLists.txt │ ├── main │ │ ├── CMakeLists.txt │ │ └── request_handler.c │ └── sdkconfig.defaults │ ├── request_sender │ ├── CMakeLists.txt │ ├── main │ │ ├── CMakeLists.txt │ │ └── request_sender.c │ └── sdkconfig.defaults │ └── timer │ ├── CMakeLists.txt │ ├── main │ ├── CMakeLists.txt │ └── timer.c │ └── sdkconfig.defaults ├── export.bat ├── export.fish ├── export.ps1 ├── export.sh ├── install.bat ├── install.fish ├── install.ps1 ├── install.sh ├── requirements.ci.txt ├── requirements.txt ├── sdkconfig.rename └── tools ├── check_python_dependencies.py ├── check_term.py ├── ci └── build_examples_cmake.sh ├── cmake ├── build.cmake ├── component.cmake ├── git_submodules.cmake ├── idf.cmake ├── kconfig.cmake ├── project.cmake ├── project_description.json.in ├── scripts │ ├── component_get_requirements.cmake │ ├── data_file_embed_asm.cmake │ └── fail.cmake ├── targets.cmake ├── third_party │ ├── GetGitRevisionDescription.cmake │ └── GetGitRevisionDescription.cmake.in ├── toolchain-wasi.cmake ├── utilities.cmake └── version.cmake ├── detect_python.fish ├── detect_python.sh ├── host_tool.py ├── idf.py ├── idf_py_actions ├── README.md ├── __init__.py ├── constants.py ├── core_ext.py ├── errors.py ├── global_options.py └── tools.py ├── idf_tools.py ├── kconfig_new ├── README.md ├── confgen.py ├── config.env.in ├── confserver.py ├── esp-windows-curses │ └── setup.py ├── gen_kconfig_doc.py ├── prepare_kconfig_files.py └── test │ ├── confgen │ └── test_confgen.py │ ├── confserver │ ├── Kconfig │ ├── README.md │ ├── sdkconfig │ ├── test_confserver.py │ ├── testcases_v1.txt │ └── testcases_v2.txt │ └── gen_kconfig_doc │ ├── Kconfig │ ├── Kconfig.chipa │ ├── Kconfig.chipb │ ├── test_kconfig_out.py │ └── test_target_visibility.py ├── python_version_checker.py ├── tools.json └── tools_schema.json /.gitignore: -------------------------------------------------------------------------------- 1 | .config 2 | *.o 3 | *.pyc 4 | *.egg-info 5 | 6 | # emacs 7 | .dir-locals.el 8 | 9 | # emacs temp file suffixes 10 | *~ 11 | .#* 12 | \#*# 13 | 14 | # eclipse setting 15 | .settings 16 | 17 | # MacOS directory files 18 | .DS_Store 19 | 20 | # Example project files 21 | examples/**/sdkconfig 22 | examples/**/sdkconfig.old 23 | examples/**/build 24 | 25 | # VS Code Settings 26 | .vscode/ 27 | 28 | # VIM files 29 | *.swp 30 | *.swo 31 | 32 | # Clion IDE CMake build & config 33 | .idea/ 34 | cmake-build-*/ 35 | 36 | # ESP-WDF default build directory name 37 | build -------------------------------------------------------------------------------- /.gitlab-ci.yml: -------------------------------------------------------------------------------- 1 | stages: 2 | - build 3 | 4 | variables: 5 | LOG_PATH: "$CI_PROJECT_DIR/examples_log" 6 | BIN_PATH: "$CI_PROJECT_DIR/examples_bin" 7 | 8 | workflow: 9 | rules: 10 | # Disable those non-protected push triggered pipelines 11 | - if: '$CI_COMMIT_REF_NAME != "main" && $CI_COMMIT_BRANCH !~ /^release\/v/ && $CI_COMMIT_TAG !~ /^v\d+\.\d+(\.\d+)?($|-)/ && $CI_PIPELINE_SOURCE == "push"' 12 | when: never 13 | # when running merged result pipelines, CI_COMMIT_SHA represents the temp commit it created. 14 | # Please use PIPELINE_COMMIT_SHA at all places that require a commit sha of the original commit. 15 | - if: $CI_OPEN_MERGE_REQUESTS != null 16 | variables: 17 | PIPELINE_COMMIT_SHA: $CI_MERGE_REQUEST_SOURCE_BRANCH_SHA 18 | IS_MR_PIPELINE: 1 19 | - if: $CI_OPEN_MERGE_REQUESTS == null 20 | variables: 21 | PIPELINE_COMMIT_SHA: $CI_COMMIT_SHA 22 | IS_MR_PIPELINE: 0 23 | - when: always 24 | 25 | .setup_tools_and_idf_python_venv: &setup_tools_and_idf_python_venv | 26 | tools/idf_tools.py --non-interactive install && \ 27 | python -m pip install -r $CI_PROJECT_DIR/requirements.ci.txt && \ 28 | . ./export.sh || exit 1 29 | 30 | build_examples: 31 | stage: build 32 | tags: 33 | - build 34 | image: "${CI_DOCKER_REGISTRY}/esp-env-v5.0:1" 35 | artifacts: 36 | expire_in: 1 week 37 | when: on_success 38 | paths: 39 | - ${LOG_PATH} 40 | - ${BIN_PATH} 41 | script: 42 | - *setup_tools_and_idf_python_venv 43 | - cd tools/ci && ./build_examples_cmake.sh 44 | -------------------------------------------------------------------------------- /components/data_sequence/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(srcs "src/data_seq.c") 2 | set(include_dir "include") 3 | 4 | idf_component_register(SRCS ${srcs} 5 | INCLUDE_DIRS ${include_dir}) -------------------------------------------------------------------------------- /components/data_sequence/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRC_DIRS "." 2 | PRIV_REQUIRES cmock test_utils data_sequence) 3 | -------------------------------------------------------------------------------- /components/esp_common/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRCS "src/esp_err_to_name.c" 2 | INCLUDE_DIRS include) -------------------------------------------------------------------------------- /components/esp_common/include/esp_compiler.h: -------------------------------------------------------------------------------- 1 | // Copyright 2016-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 | #ifndef __ESP_COMPILER_H 15 | #define __ESP_COMPILER_H 16 | 17 | /* 18 | * The likely and unlikely macro pairs: 19 | * These macros are useful to place when application 20 | * knows the majority ocurrence of a decision paths, 21 | * placing one of these macros can hint the compiler 22 | * to reorder instructions producing more optimized 23 | * code. 24 | */ 25 | #if (CONFIG_COMPILER_OPTIMIZATION_PERF) 26 | #ifndef likely 27 | #define likely(x) __builtin_expect(!!(x), 1) 28 | #endif 29 | #ifndef unlikely 30 | #define unlikely(x) __builtin_expect(!!(x), 0) 31 | #endif 32 | #else 33 | #ifndef likely 34 | #define likely(x) (x) 35 | #endif 36 | #ifndef unlikely 37 | #define unlikely(x) (x) 38 | #endif 39 | #endif 40 | 41 | /* 42 | * Utility macros used for designated initializers, which work differently 43 | * in C99 and C++ standards mainly for aggregate types. 44 | * The member separator, comma, is already part of the macro, please omit the trailing comma. 45 | * Usage example: 46 | * struct config_t { char* pchr; char arr[SIZE]; } config = { 47 | * ESP_COMPILER_DESIGNATED_INIT_AGGREGATE_TYPE_EMPTY(pchr) 48 | * ESP_COMPILER_DESIGNATED_INIT_AGGREGATE_TYPE_STR(arr, "Value") 49 | * }; 50 | */ 51 | #ifdef __cplusplus 52 | #define ESP_COMPILER_DESIGNATED_INIT_AGGREGATE_TYPE_STR(member, value) { .member = value }, 53 | #define ESP_COMPILER_DESIGNATED_INIT_AGGREGATE_TYPE_EMPTY(member) .member = { }, 54 | #else 55 | #define ESP_COMPILER_DESIGNATED_INIT_AGGREGATE_TYPE_STR(member, value) .member = value, 56 | #define ESP_COMPILER_DESIGNATED_INIT_AGGREGATE_TYPE_EMPTY(member) 57 | #endif 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /components/esp_common/include/esp_wdf_version.h: -------------------------------------------------------------------------------- 1 | // Copyright 2022 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 | #pragma once 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /** Major version number (X.x.x) */ 22 | #define ESP_WDF_VERSION_MAJOR 1 23 | /** Minor version number (x.X.x) */ 24 | #define ESP_WDF_VERSION_MINOR 0 25 | /** Patch version number (x.x.X) */ 26 | #define ESP_WDF_VERSION_PATCH 0 27 | 28 | /** 29 | * Macro to convert WDF version number into an integer 30 | * 31 | * To be used in comparisons, such as ESP_WDF_VERSION >= ESP_WDF_VERSION_VAL(4, 0, 0) 32 | */ 33 | #define ESP_WDF_VERSION_VAL(major, minor, patch) ((major << 16) | (minor << 8) | (patch)) 34 | 35 | /** 36 | * Current WDF version, as an integer 37 | * 38 | * To be used in comparisons, such as ESP_WDF_VERSION >= ESP_WDF_VERSION_VAL(4, 0, 0) 39 | */ 40 | #define ESP_WDF_VERSION ESP_WDF_VERSION_VAL(ESP_WDF_VERSION_MAJOR, \ 41 | ESP_WDF_VERSION_MINOR, \ 42 | ESP_WDF_VERSION_PATCH) 43 | 44 | #ifndef __ASSEMBLER__ 45 | 46 | /** 47 | * Return full WDF version string, same as 'git describe' output. 48 | * 49 | * @note If you are printing the ESP-WDF version in a log file or other information, 50 | * this function provides more information than using the numerical version macros. 51 | * For example, numerical version macros don't differentiate between development, 52 | * pre-release and release versions, but the output of this function does. 53 | * 54 | * @return constant string from WDF_VER 55 | */ 56 | const char* esp_get_wdf_version(void); 57 | 58 | #endif 59 | 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | -------------------------------------------------------------------------------- /components/esp_event/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRCS "" 2 | INCLUDE_DIRS include) -------------------------------------------------------------------------------- /components/esp_event/include/esp_event.h: -------------------------------------------------------------------------------- 1 | // Copyright 2018 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 | #ifndef ESP_EVENT_H_ 16 | #define ESP_EVENT_H_ 17 | 18 | #include "esp_err.h" 19 | 20 | #include "esp_event_base.h" 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | 30 | #endif // #ifndef ESP_EVENT_H_ 31 | -------------------------------------------------------------------------------- /components/esp_event/include/esp_event_base.h: -------------------------------------------------------------------------------- 1 | // Copyright 2018 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 | #ifndef ESP_EVENT_BASE_H_ 16 | #define ESP_EVENT_BASE_H_ 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | // Defines for declaring and defining event base 23 | #define ESP_EVENT_DECLARE_BASE(id) extern esp_event_base_t id 24 | #define ESP_EVENT_DEFINE_BASE(id) esp_event_base_t id = #id 25 | 26 | // Event loop library types 27 | typedef const char* esp_event_base_t; /**< unique pointer to a subsystem that exposes events */ 28 | typedef void* esp_event_loop_handle_t; /**< a number that identifies an event with respect to a base */ 29 | typedef void (*esp_event_handler_t)(void* event_handler_arg, 30 | esp_event_base_t event_base, 31 | int32_t event_id, 32 | void* event_data); /**< function called when an event is posted to the queue */ 33 | typedef void* esp_event_handler_instance_t; /**< context identifying an instance of a registered event handler */ 34 | 35 | // Defines for registering/unregistering event handlers 36 | #define ESP_EVENT_ANY_BASE NULL /**< register handler for any event base */ 37 | #define ESP_EVENT_ANY_ID -1 /**< register handler for any event id */ 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | #endif // #ifndef ESP_EVENT_BASE_H_ 44 | -------------------------------------------------------------------------------- /components/esp_system/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRCS "esp_err.c" "abort.c" 2 | REQUIRES "esp_common") -------------------------------------------------------------------------------- /components/esp_system/abort.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void abort(void) { 4 | // wasm doesn't support signals, so just trap to halt the program. 5 | __builtin_trap(); 6 | } 7 | -------------------------------------------------------------------------------- /components/esp_system/esp_err.c: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2016 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 | #include 15 | #include 16 | #include 17 | 18 | #include "esp_err.h" 19 | 20 | static void esp_error_check_failed_print(const char *msg, esp_err_t rc, const char *file, int line, const char *function, const char *expression) 21 | { 22 | printf("%s failed: esp_err_t 0x%x", msg, rc); 23 | #ifdef CONFIG_ESP_ERR_TO_NAME_LOOKUP 24 | printf(" (%s)", esp_err_to_name(rc)); 25 | #endif //CONFIG_ESP_ERR_TO_NAME_LOOKUP 26 | //TODO: strings may be in flash cache 27 | } 28 | 29 | void _esp_error_check_failed_without_abort(esp_err_t rc, const char *file, int line, const char *function, const char *expression) 30 | { 31 | esp_error_check_failed_print("ESP_ERROR_CHECK_WITHOUT_ABORT", rc, file, line, function, expression); 32 | } 33 | 34 | void _esp_error_check_failed(esp_err_t rc, const char *file, int line, const char *function, const char *expression) 35 | { 36 | esp_error_check_failed_print("ESP_ERROR_CHECK", rc, file, line, function, expression); 37 | abort(); 38 | } 39 | -------------------------------------------------------------------------------- /components/extended_wasm_app/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(srcs "") 2 | set(include_dir "") 3 | set(priv_include_dir "") 4 | 5 | if(CONFIG_WDF_EXT_WASM_APP_MQTT) 6 | list(APPEND include_dir "esp_mqtt/include") 7 | list(APPEND priv_include_dir "esp_mqtt/private_include") 8 | list(APPEND srcs "esp_mqtt/src/wm_ext_wasm_app_mqtt.c") 9 | endif() 10 | 11 | if(CONFIG_WDF_EXT_WASM_APP_LVGL) 12 | list(APPEND include_dir "esp_lvgl/include" "esp_lvgl/include/lvgl/src" "esp_lvgl/include/lvgl/src/core") 13 | list(APPEND priv_include_dir "esp_lvgl/private_include") 14 | list(APPEND srcs "esp_lvgl/src/wm_ext_wasm_app_lvgl.c") 15 | 16 | if(NOT CONFIG_USING_CUSTOMER_LV_CONF_H) 17 | list(APPEND include_dir "esp_lvgl/include/config") 18 | endif() 19 | endif() 20 | 21 | if(CONFIG_WDF_EXT_WASM_APP_HTTP_CLIENT) 22 | list(APPEND include_dir "esp_http_client/include") 23 | list(APPEND priv_include_dir "esp_http_client/private_include") 24 | list(APPEND srcs "esp_http_client/src/wm_ext_wasm_app_http_client.c") 25 | endif() 26 | 27 | if(CONFIG_WDF_EXT_WASM_APP_WIFI_PROVISIONING) 28 | list(APPEND include_dir "esp_wifi/include") 29 | list(APPEND include_dir "wifi_provisioning/include") 30 | list(APPEND priv_include_dir "wifi_provisioning/private_include") 31 | list(APPEND srcs "wifi_provisioning/src/wm_ext_wasm_app_wifi_provisioning.c") 32 | endif() 33 | 34 | if(CONFIG_WDF_EXT_WASM_APP_RMAKER) 35 | list(APPEND include_dir "esp-rainmaker/include/esp_rainmaker") 36 | list(APPEND include_dir "esp-rainmaker/include/esp_schedule") 37 | list(APPEND include_dir "esp-rainmaker/include/rmaker_common") 38 | list(APPEND priv_include_dir "esp-rainmaker/private_include") 39 | list(APPEND srcs "esp-rainmaker/src/wm_ext_wasm_app_rmaker.c") 40 | list(APPEND srcs "esp-rainmaker/src/standard_types/esp_rmaker_standard_devices.c") 41 | list(APPEND srcs "esp-rainmaker/src/standard_types/esp_rmaker_standard_params.c") 42 | list(APPEND srcs "esp-rainmaker/src/standard_types/esp_rmaker_standard_services.c") 43 | endif() 44 | 45 | idf_component_register(SRCS ${srcs} 46 | INCLUDE_DIRS ${include_dir} 47 | PRIV_INCLUDE_DIRS ${priv_include_dir} 48 | REQUIRES "wamr" "esp_common" "esp_event") 49 | 50 | if(CONFIG_WDF_EXT_WASM_APP_MQTT) 51 | target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--export=on_mqtt_dispatch_event") 52 | endif() -------------------------------------------------------------------------------- /components/extended_wasm_app/Kconfig: -------------------------------------------------------------------------------- 1 | menu "Extended WASM Applications" 2 | config WDF_EXT_WASM_APP_MQTT 3 | bool "Enable ESP-MQTT" 4 | default y 5 | 6 | config WDF_EXT_WASM_APP_LVGL 7 | bool "Enable LVGL" 8 | default y 9 | 10 | if WDF_EXT_WASM_APP_LVGL 11 | menu "LVGL" 12 | config USING_CUSTOMER_LV_CONF_H 13 | bool "Using Customer \"lv_conf.h\"" 14 | default n 15 | help 16 | Users just keep this option disable if not modify options of LVGL 17 | in esp-wasmachine. Otherwise select this option, then lvgl will not use 18 | "lv_conf.h" in directory of "components/extended_wasm_app/esp_lvgl/include/config", 19 | and users can add customized "lv_conf.h". 20 | endmenu 21 | endif 22 | 23 | config WDF_EXT_WASM_APP_HTTP_CLIENT 24 | bool "Enable ESP HTTP client" 25 | default y 26 | 27 | config WDF_EXT_WASM_APP_WIFI_PROVISIONING 28 | bool "Enable wifi provisioning" 29 | default y 30 | 31 | config WDF_EXT_WASM_APP_RMAKER 32 | bool "Enable ESP RainMaker" 33 | default y 34 | 35 | endmenu -------------------------------------------------------------------------------- /components/extended_wasm_app/esp-rainmaker/include/esp_rainmaker/esp_rmaker_console.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020 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 | #pragma once 16 | 17 | #ifdef __cplusplus 18 | extern "C" 19 | { 20 | #endif 21 | 22 | /** Initialize console 23 | * 24 | * Initializes serial console and adds basic commands. 25 | * 26 | * @return ESP_OK on success. 27 | * @return error in case of failures. 28 | */ 29 | esp_err_t esp_rmaker_console_init(void); 30 | 31 | /* Reference for adding custom console commands: 32 | #include 33 | 34 | static int command_console_handler(int argc, char *argv[]) 35 | { 36 | // Command code here 37 | } 38 | 39 | static void register_console_command() 40 | { 41 | const esp_console_cmd_t cmd = { 42 | .command = "", 43 | .help = "", 44 | .func = &command_console_handler, 45 | }; 46 | ESP_ERROR_CHECK(esp_console_cmd_register(&cmd)); 47 | } 48 | */ 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp-rainmaker/include/esp_rainmaker/esp_rmaker_scenes.h: -------------------------------------------------------------------------------- 1 | // Copyright 2022 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 | #pragma once 16 | 17 | #ifdef __cplusplus 18 | extern "C" 19 | { 20 | #endif 21 | 22 | #include 23 | 24 | /** Enable Scenes 25 | * 26 | * This API enables the scenes service for the node. For more information, 27 | * check [here](https://rainmaker.espressif.com/docs/scenes.html) 28 | * 29 | * @note This API should be called after esp_rmaker_node_init() but before esp_rmaker_start(). 30 | * 31 | * @return ESP_OK on success. 32 | * @return error in case of failure. 33 | */ 34 | esp_err_t esp_rmaker_scenes_enable(void); 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp-rainmaker/include/esp_rainmaker/esp_rmaker_schedule.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020 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 | #pragma once 16 | 17 | #ifdef __cplusplus 18 | extern "C" 19 | { 20 | #endif 21 | 22 | /** Enable Schedules 23 | * 24 | * This API enables the scheduling service for the node. For more information, 25 | * check [here](https://rainmaker.espressif.com/docs/scheduling.html) 26 | * 27 | * It is recommended to set the timezone while using schedules. Check [here](https://rainmaker.espressif.com/docs/time-service.html#time-zone) for more information on timezones 28 | * 29 | * @note This API should be called after esp_rmaker_node_init() but before esp_rmaker_start(). 30 | * 31 | * @return ESP_OK on success. 32 | * @return error in case of failure. 33 | */ 34 | esp_err_t esp_rmaker_schedule_enable(void); 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/core/lv_indev_scroll.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_indev_scroll.h 3 | * 4 | */ 5 | 6 | #ifndef LV_INDEV_SCROLL_H 7 | #define LV_INDEV_SCROLL_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "lv_obj.h" 17 | 18 | /********************* 19 | * DEFINES 20 | *********************/ 21 | 22 | /********************** 23 | * TYPEDEFS 24 | **********************/ 25 | 26 | /********************** 27 | * GLOBAL PROTOTYPES 28 | **********************/ 29 | 30 | /** 31 | * Handle scrolling. Called by LVGL during input device processing 32 | * @param proc pointer to an input device's proc field 33 | */ 34 | void _lv_indev_scroll_handler(_lv_indev_proc_t * proc); 35 | 36 | /** 37 | * Handle throwing after scrolling. Called by LVGL during input device processing 38 | * @param proc pointer to an input device's proc field 39 | */ 40 | void _lv_indev_scroll_throw_handler(_lv_indev_proc_t * proc); 41 | 42 | /** 43 | * Predict where would a scroll throw end 44 | * @param indev pointer to an input device 45 | * @param dir ` LV_DIR_VER` or `LV_DIR_HOR` 46 | * @return the difference compared to the current position when the throw would be finished 47 | */ 48 | lv_coord_t lv_indev_scroll_throw_predict(lv_indev_t * indev, lv_dir_t dir); 49 | 50 | /** 51 | * Get the distance of the nearest snap point 52 | * @param obj the object on which snap points should be found 53 | * @param p save the distance of the found snap point there 54 | */ 55 | void lv_indev_scroll_get_snap_dist(lv_obj_t * obj, lv_point_t * p); 56 | 57 | /********************** 58 | * MACROS 59 | **********************/ 60 | 61 | #ifdef __cplusplus 62 | } /*extern "C"*/ 63 | #endif 64 | 65 | #endif /*LV_INDEV_SCROLL_H*/ 66 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/draw/lv_draw.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_draw.h 3 | * 4 | */ 5 | 6 | #ifndef LV_DRAW_H 7 | #define LV_DRAW_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../lv_conf_internal.h" 17 | 18 | #include "../misc/lv_style.h" 19 | #include "../misc/lv_txt.h" 20 | #include "lv_img_decoder.h" 21 | #include "lv_img_cache.h" 22 | 23 | #include "lv_draw_rect.h" 24 | #include "lv_draw_label.h" 25 | #include "lv_draw_img.h" 26 | #include "lv_draw_line.h" 27 | #include "lv_draw_triangle.h" 28 | #include "lv_draw_arc.h" 29 | #include "lv_draw_blend.h" 30 | #include "lv_draw_mask.h" 31 | 32 | /********************* 33 | * DEFINES 34 | *********************/ 35 | 36 | /********************** 37 | * TYPEDEFS 38 | **********************/ 39 | 40 | /********************** 41 | * GLOBAL PROTOTYPES 42 | **********************/ 43 | 44 | /********************** 45 | * GLOBAL VARIABLES 46 | **********************/ 47 | 48 | /********************** 49 | * MACROS 50 | **********************/ 51 | 52 | /********************** 53 | * POST INCLUDES 54 | *********************/ 55 | 56 | #ifdef __cplusplus 57 | } /*extern "C"*/ 58 | #endif 59 | 60 | #endif /*LV_DRAW_H*/ 61 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/draw/lv_draw_blend.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_draw_blend.h 3 | * 4 | */ 5 | 6 | #ifndef LV_DRAW_BLEND_H 7 | #define LV_DRAW_BLEND_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../misc/lv_color.h" 17 | #include "../misc/lv_area.h" 18 | #include "../misc/lv_style.h" 19 | #include "lv_draw_mask.h" 20 | 21 | /********************* 22 | * DEFINES 23 | *********************/ 24 | 25 | /********************** 26 | * TYPEDEFS 27 | **********************/ 28 | 29 | /********************** 30 | * GLOBAL PROTOTYPES 31 | **********************/ 32 | 33 | //! @cond Doxygen_Suppress 34 | LV_ATTRIBUTE_FAST_MEM void _lv_blend_fill(const lv_area_t * clip_area, const lv_area_t * fill_area, lv_color_t color, 35 | lv_opa_t * mask, lv_draw_mask_res_t mask_res, lv_opa_t opa, lv_blend_mode_t mode); 36 | 37 | LV_ATTRIBUTE_FAST_MEM void _lv_blend_map(const lv_area_t * clip_area, const lv_area_t * map_area, 38 | const lv_color_t * map_buf, 39 | lv_opa_t * mask, lv_draw_mask_res_t mask_res, lv_opa_t opa, lv_blend_mode_t mode); 40 | 41 | //! @endcond 42 | /********************** 43 | * MACROS 44 | **********************/ 45 | 46 | #ifdef __cplusplus 47 | } /*extern "C"*/ 48 | #endif 49 | 50 | #endif /*LV_DRAW_BLEND_H*/ 51 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/draw/lv_draw_line.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_draw_line.h 3 | * 4 | */ 5 | 6 | #ifndef LV_DRAW_LINE_H 7 | #define LV_DRAW_LINE_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "lv_draw_blend.h" 17 | 18 | /********************* 19 | * DEFINES 20 | *********************/ 21 | 22 | /********************** 23 | * TYPEDEFS 24 | **********************/ 25 | typedef struct { 26 | lv_color_t color; 27 | lv_coord_t width; 28 | lv_coord_t dash_width; 29 | lv_coord_t dash_gap; 30 | lv_opa_t opa; 31 | lv_blend_mode_t blend_mode : 2; 32 | uint8_t round_start : 1; 33 | uint8_t round_end : 1; 34 | uint8_t raw_end : 1; /*Do not bother with perpendicular line ending if it's not visible for any reason*/ 35 | } lv_draw_line_dsc_t; 36 | 37 | /********************** 38 | * GLOBAL PROTOTYPES 39 | **********************/ 40 | 41 | //! @cond Doxygen_Suppress 42 | /** 43 | * Draw a line 44 | * @param point1 first point of the line 45 | * @param point2 second point of the line 46 | * @param clip the line will be drawn only in this area 47 | * @param dsc pointer to an initialized `lv_draw_line_dsc_t` variable 48 | */ 49 | LV_ATTRIBUTE_FAST_MEM void lv_draw_line(const lv_point_t * point1, const lv_point_t * point2, const lv_area_t * clip, 50 | const lv_draw_line_dsc_t * dsc); 51 | 52 | LV_ATTRIBUTE_FAST_MEM void lv_draw_line_dsc_init(lv_draw_line_dsc_t * dsc); 53 | 54 | //! @endcond 55 | 56 | /********************** 57 | * MACROS 58 | **********************/ 59 | 60 | #ifdef __cplusplus 61 | } /*extern "C"*/ 62 | #endif 63 | 64 | #endif /*LV_DRAW_LINE_H*/ 65 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/draw/lv_draw_triangle.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_draw_triangle.h 3 | * 4 | */ 5 | 6 | #ifndef LV_DRAW_TRIANGLE_H 7 | #define LV_DRAW_TRIANGLE_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "lv_draw_rect.h" 17 | 18 | /********************* 19 | * DEFINES 20 | *********************/ 21 | 22 | /********************** 23 | * TYPEDEFS 24 | **********************/ 25 | 26 | /********************** 27 | * GLOBAL PROTOTYPES 28 | **********************/ 29 | 30 | /** 31 | * Draw a triangle 32 | * @param points pointer to an array with 3 points 33 | * @param clip_area the triangle will be drawn only in this area 34 | * @param draw_dsc pointer to an initialized `lv_draw_rect_dsc_t` variable 35 | */ 36 | void lv_draw_triangle(const lv_point_t points[], const lv_area_t * clip, const lv_draw_rect_dsc_t * draw_dsc); 37 | 38 | /** 39 | * Draw a polygon. Only convex polygons are supported. 40 | * @param points an array of points 41 | * @param point_cnt number of points 42 | * @param clip_area polygon will be drawn only in this area 43 | * @param draw_dsc pointer to an initialized `lv_draw_rect_dsc_t` variable 44 | */ 45 | void lv_draw_polygon(const lv_point_t points[], uint16_t point_cnt, const lv_area_t * mask, 46 | const lv_draw_rect_dsc_t * draw_dsc); 47 | 48 | /********************** 49 | * MACROS 50 | **********************/ 51 | 52 | #ifdef __cplusplus 53 | } /*extern "C"*/ 54 | #endif 55 | 56 | #endif /*LV_DRAW_TRIANGLE_H*/ 57 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/extra/layouts/lv_layouts.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_layouts.h 3 | * 4 | */ 5 | 6 | #ifndef LV_LAYOUTS_H 7 | #define LV_LAYOUTS_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "flex/lv_flex.h" 17 | #include "grid/lv_grid.h" 18 | 19 | /********************* 20 | * DEFINES 21 | *********************/ 22 | 23 | /********************** 24 | * TYPEDEFS 25 | **********************/ 26 | 27 | /********************** 28 | * GLOBAL PROTOTYPES 29 | **********************/ 30 | 31 | /********************** 32 | * MACROS 33 | **********************/ 34 | #if LV_USE_LOG && LV_LOG_TRACE_LAYOUT 35 | # define LV_TRACE_LAYOUT(...) LV_LOG_TRACE(__VA_ARGS__) 36 | #else 37 | # define LV_TRACE_LAYOUT(...) 38 | #endif 39 | 40 | #ifdef __cplusplus 41 | } /*extern "C"*/ 42 | #endif 43 | 44 | #endif /*LV_LAYOUTS_H*/ 45 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/extra/libs/bmp/lv_bmp.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_templ.h 3 | * 4 | */ 5 | 6 | #ifndef LV_BMP_H 7 | #define LV_BMP_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../../../lv_conf_internal.h" 17 | #if LV_USE_BMP 18 | 19 | /********************* 20 | * DEFINES 21 | *********************/ 22 | 23 | /********************** 24 | * TYPEDEFS 25 | **********************/ 26 | 27 | /********************** 28 | * GLOBAL PROTOTYPES 29 | **********************/ 30 | void lv_bmp_init(void); 31 | 32 | /********************** 33 | * MACROS 34 | **********************/ 35 | 36 | #endif /*LV_USE_BMP*/ 37 | 38 | #ifdef __cplusplus 39 | } /* extern "C" */ 40 | #endif 41 | 42 | #endif /*LV_BMP_H*/ 43 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/extra/libs/freetype/lv_freetype.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_freetype.h 3 | * 4 | */ 5 | #ifndef LV_FREETYPE_H 6 | #define LV_FREETYPE_H 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | /********************* 13 | * INCLUDES 14 | *********************/ 15 | #include "../../../lvgl.h" 16 | #if LV_USE_FREETYPE 17 | 18 | /********************* 19 | * DEFINES 20 | *********************/ 21 | 22 | /********************** 23 | * TYPEDEFS 24 | **********************/ 25 | typedef enum { 26 | FT_FONT_STYLE_NORMAL = 0, 27 | FT_FONT_STYLE_ITALIC = 1 << 0, 28 | FT_FONT_STYLE_BOLD = 1 << 1 29 | } LV_FT_FONT_STYLE; 30 | 31 | typedef struct { 32 | const char * name; /* The name of the font file */ 33 | lv_font_t * font; /* point to lvgl font */ 34 | uint16_t weight; /* font size */ 35 | uint16_t style; /* font style */ 36 | } lv_ft_info_t; 37 | 38 | /********************** 39 | * GLOBAL PROTOTYPES 40 | **********************/ 41 | 42 | /** 43 | * init freetype library 44 | * @param max_faces Maximum number of opened FT_Face objects managed by this cache instance. Use 0 for defaults. 45 | * @param max_sizes Maximum number of opened FT_Size objects managed by this cache instance. Use 0 for defaults. 46 | * @param max_bytes Maximum number of bytes to use for cached data nodes. Use 0 for defaults. 47 | * Note that this value does not account for managed FT_Face and FT_Size objects. 48 | * @return true on success, otherwise false. 49 | */ 50 | bool lv_freetype_init(uint16_t max_faces, uint16_t max_sizes, uint32_t max_bytes); 51 | 52 | /** 53 | * Destroy freetype library 54 | */ 55 | void lv_freetype_destroy(void); 56 | 57 | /** 58 | * Creates a font with info parameter specified. 59 | * @param info See lv_ft_info_t for details. 60 | * when success, lv_ft_info_t->font point to the font you created. 61 | * @return true on success, otherwise false. 62 | */ 63 | bool lv_ft_font_init(lv_ft_info_t * info); 64 | 65 | /** 66 | * Destroy a font that has been created. 67 | * @param font pointer to font. 68 | */ 69 | void lv_ft_font_destroy(lv_font_t * font); 70 | 71 | /********************** 72 | * MACROS 73 | **********************/ 74 | 75 | #endif /*LV_USE_FREETYPE*/ 76 | 77 | #ifdef __cplusplus 78 | } /* extern "C" */ 79 | #endif 80 | 81 | #endif /* LV_FREETYPE_H */ 82 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/extra/libs/fsdrv/lv_fsdrv.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_fsdrv.h 3 | * 4 | */ 5 | 6 | #ifndef LV_FSDRV_H 7 | #define LV_FSDRV_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../../../lv_conf_internal.h" 17 | 18 | /********************* 19 | * DEFINES 20 | *********************/ 21 | 22 | /********************** 23 | * TYPEDEFS 24 | **********************/ 25 | 26 | /********************** 27 | * GLOBAL PROTOTYPES 28 | **********************/ 29 | 30 | #if LV_USE_FS_FATFS != '\0' 31 | void lv_fs_fatfs_init(void); 32 | #endif 33 | 34 | #if LV_USE_FS_STDIO != '\0' 35 | void lv_fs_stdio_init(void); 36 | #endif 37 | 38 | #if LV_USE_FS_POSIX != '\0' 39 | void lv_fs_posix_init(void); 40 | #endif 41 | 42 | #if LV_USE_FS_WIN32 != '\0' 43 | void lv_fs_win32_init(void); 44 | #endif 45 | 46 | /********************** 47 | * MACROS 48 | **********************/ 49 | 50 | #ifdef __cplusplus 51 | } /* extern "C" */ 52 | #endif 53 | 54 | #endif /*LV_FSDRV_H*/ 55 | 56 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/extra/libs/gif/gifdec.h: -------------------------------------------------------------------------------- 1 | #ifndef GIFDEC_H 2 | #define GIFDEC_H 3 | 4 | #include 5 | #include "../../../misc/lv_fs.h" 6 | 7 | #if LV_USE_GIF 8 | 9 | typedef struct gd_Palette { 10 | int size; 11 | uint8_t colors[0x100 * 3]; 12 | } gd_Palette; 13 | 14 | typedef struct gd_GCE { 15 | uint16_t delay; 16 | uint8_t tindex; 17 | uint8_t disposal; 18 | int input; 19 | int transparency; 20 | } gd_GCE; 21 | 22 | 23 | 24 | typedef struct gd_GIF { 25 | lv_fs_file_t fd; 26 | const char * data; 27 | uint8_t is_file; 28 | uint32_t f_rw_p; 29 | int32_t anim_start; 30 | uint16_t width, height; 31 | uint16_t depth; 32 | uint16_t loop_count; 33 | gd_GCE gce; 34 | gd_Palette *palette; 35 | gd_Palette lct, gct; 36 | void (*plain_text)( 37 | struct gd_GIF *gif, uint16_t tx, uint16_t ty, 38 | uint16_t tw, uint16_t th, uint8_t cw, uint8_t ch, 39 | uint8_t fg, uint8_t bg 40 | ); 41 | void (*comment)(struct gd_GIF *gif); 42 | void (*application)(struct gd_GIF *gif, char id[8], char auth[3]); 43 | uint16_t fx, fy, fw, fh; 44 | uint8_t bgindex; 45 | uint8_t *canvas, *frame; 46 | } gd_GIF; 47 | 48 | gd_GIF * gd_open_gif_file(const char *fname); 49 | 50 | gd_GIF * gd_open_gif_data(const void *data); 51 | 52 | void gd_render_frame(gd_GIF *gif, uint8_t *buffer); 53 | 54 | int gd_get_frame(gd_GIF *gif); 55 | void gd_rewind(gd_GIF *gif); 56 | void gd_close_gif(gd_GIF *gif); 57 | 58 | #endif /*LV_USE_GIF*/ 59 | 60 | #endif /* GIFDEC_H */ 61 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/extra/libs/gif/lv_gif.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_gif.h 3 | * 4 | */ 5 | 6 | #ifndef LV_GIF_H 7 | #define LV_GIF_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | #include "../../../lvgl.h" 18 | #if LV_USE_GIF 19 | 20 | #include "gifdec.h" 21 | 22 | /********************* 23 | * DEFINES 24 | *********************/ 25 | 26 | /********************** 27 | * TYPEDEFS 28 | **********************/ 29 | 30 | typedef struct { 31 | lv_img_t img; 32 | gd_GIF *gif; 33 | lv_timer_t * timer; 34 | lv_img_dsc_t imgdsc; 35 | uint32_t last_call; 36 | }lv_gif_t; 37 | 38 | extern const lv_obj_class_t lv_gif_class; 39 | 40 | /********************** 41 | * GLOBAL PROTOTYPES 42 | **********************/ 43 | 44 | lv_obj_t * lv_gif_create(lv_obj_t * parent); 45 | void lv_gif_set_src(lv_obj_t * obj, const void * src); 46 | void lv_gif_restart(lv_obj_t * gif); 47 | 48 | /********************** 49 | * MACROS 50 | **********************/ 51 | 52 | #endif /*LV_USE_GIF*/ 53 | 54 | #ifdef __cplusplus 55 | } /* extern "C" */ 56 | #endif 57 | 58 | #endif /*LV_GIF_H*/ 59 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/extra/libs/lv_libs.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_libs.h 3 | * 4 | */ 5 | 6 | #ifndef LV_LIBS_H 7 | #define LV_LIBS_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "bmp/lv_bmp.h" 17 | #include "fsdrv/lv_fsdrv.h" 18 | #include "png/lv_png.h" 19 | #include "gif/lv_gif.h" 20 | #include "qrcode/lv_qrcode.h" 21 | #include "sjpg/lv_sjpg.h" 22 | #include "freetype/lv_freetype.h" 23 | #include "rlottie/lv_rlottie.h" 24 | 25 | /********************* 26 | * DEFINES 27 | *********************/ 28 | 29 | /********************** 30 | * TYPEDEFS 31 | **********************/ 32 | 33 | /********************** 34 | * GLOBAL PROTOTYPES 35 | **********************/ 36 | 37 | /********************** 38 | * MACROS 39 | **********************/ 40 | 41 | #ifdef __cplusplus 42 | } /*extern "C"*/ 43 | #endif 44 | 45 | #endif /*LV_LAYOUTS_H*/ 46 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/extra/libs/png/lv_png.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_png.h 3 | * 4 | */ 5 | 6 | #ifndef LV_PNG_H 7 | #define LV_PNG_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../../../lv_conf_internal.h" 17 | #if LV_USE_PNG 18 | 19 | /********************* 20 | * DEFINES 21 | *********************/ 22 | 23 | /********************** 24 | * TYPEDEFS 25 | **********************/ 26 | 27 | /********************** 28 | * GLOBAL PROTOTYPES 29 | **********************/ 30 | 31 | /** 32 | * Register the PNG decoder functions in LittlevGL 33 | */ 34 | void lv_png_init(void); 35 | 36 | /********************** 37 | * MACROS 38 | **********************/ 39 | 40 | #endif /*LV_USE_PNG*/ 41 | 42 | #ifdef __cplusplus 43 | } /* extern "C" */ 44 | #endif 45 | 46 | #endif /*LV_PNG_H*/ 47 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/extra/libs/qrcode/lv_qrcode.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_qrcode 3 | * 4 | */ 5 | 6 | #ifndef LV_QRCODE_H 7 | #define LV_QRCODE_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../../../lvgl.h" 17 | #if LV_USE_QRCODE 18 | 19 | /********************* 20 | * DEFINES 21 | *********************/ 22 | 23 | extern const lv_obj_class_t lv_qrcode_class; 24 | 25 | /********************** 26 | * TYPEDEFS 27 | **********************/ 28 | 29 | /********************** 30 | * GLOBAL PROTOTYPES 31 | **********************/ 32 | 33 | /** 34 | * Create an empty QR code (an `lv_canvas`) object. 35 | * @param parent point to an object where to create the QR code 36 | * @param size width and height of the QR code 37 | * @param dark_color dark color of the QR code 38 | * @param light_color light color of the QR code 39 | * @return pointer to the created QR code object 40 | */ 41 | lv_obj_t * lv_qrcode_create(lv_obj_t * parent, lv_coord_t size, lv_color_t dark_color, lv_color_t light_color); 42 | 43 | /** 44 | * Set the data of a QR code object 45 | * @param qrcode pointer to aQ code object 46 | * @param data data to display 47 | * @param data_len length of data in bytes 48 | * @return LV_RES_OK: if no error; LV_RES_INV: on error 49 | */ 50 | lv_res_t lv_qrcode_update(lv_obj_t * qrcode, const void * data, uint32_t data_len); 51 | 52 | /** 53 | * Delete a QR code object 54 | * @param qrcode pointer to a QR code object 55 | */ 56 | void lv_qrcode_delete(lv_obj_t * qrcode); 57 | 58 | /********************** 59 | * MACROS 60 | **********************/ 61 | 62 | #endif /*LV_USE_QRCODE*/ 63 | 64 | #ifdef __cplusplus 65 | } /* extern "C" */ 66 | #endif 67 | 68 | #endif /*LV_QRCODE_H*/ 69 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/extra/libs/rlottie/lv_rlottie.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_rlottie.h 3 | * 4 | */ 5 | 6 | #ifndef LV_RLOTTIE_H 7 | #define LV_RLOTTIE_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../../../lvgl.h" 17 | #if LV_USE_RLOTTIE 18 | 19 | #include 20 | 21 | /********************* 22 | * DEFINES 23 | *********************/ 24 | 25 | /********************** 26 | * TYPEDEFS 27 | **********************/ 28 | typedef struct { 29 | lv_img_t img_ext; 30 | Lottie_Animation* animation; 31 | lv_timer_t* task; 32 | lv_img_dsc_t imgdsc; 33 | size_t total_frames; 34 | size_t current_frame; 35 | size_t framerate; 36 | uint32_t* allocated_buf; 37 | size_t allocated_buffer_size; 38 | size_t scanline_width; 39 | }lv_rlottie_t; 40 | 41 | extern const lv_obj_class_t lv_rlottie_class; 42 | 43 | /********************** 44 | * GLOBAL PROTOTYPES 45 | **********************/ 46 | 47 | lv_obj_t * lv_rlottie_create_from_file(lv_obj_t * parent,lv_coord_t width, lv_coord_t height, const char * path); 48 | 49 | lv_obj_t* lv_rlottie_create_from_raw(lv_obj_t* parent, lv_coord_t width, lv_coord_t height, const char* rlottie_desc); 50 | 51 | /********************** 52 | * MACROS 53 | **********************/ 54 | 55 | #endif /*LV_USE_RLOTTIE*/ 56 | 57 | #ifdef __cplusplus 58 | } /* extern "C" */ 59 | #endif 60 | 61 | #endif /*LV_RLOTTIE_H*/ 62 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/extra/libs/sjpg/lv_sjpg.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_sjpg.h 3 | * 4 | */ 5 | 6 | #ifndef LV_SJPEG_H 7 | #define LV_SJPEG_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | #if LV_USE_SJPG 18 | 19 | /********************* 20 | * DEFINES 21 | *********************/ 22 | 23 | /********************** 24 | * TYPEDEFS 25 | **********************/ 26 | 27 | /********************** 28 | * GLOBAL PROTOTYPES 29 | **********************/ 30 | 31 | void lv_split_jpeg_init(void); 32 | 33 | /********************** 34 | * MACROS 35 | **********************/ 36 | 37 | #endif /*LV_USE_SJPG*/ 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | #endif /* LV_SJPEG_H */ 44 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/extra/libs/sjpg/tjpgdcnf.h: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------*/ 2 | /* TJpgDec System Configurations R0.03 */ 3 | /*----------------------------------------------*/ 4 | 5 | #define JD_SZBUF 512 6 | /* Specifies size of stream input buffer */ 7 | 8 | #define JD_FORMAT 0 9 | /* Specifies output pixel format. 10 | / 0: RGB888 (24-bit/pix) 11 | / 1: RGB565 (16-bit/pix) 12 | / 2: Grayscale (8-bit/pix) 13 | */ 14 | 15 | #define JD_USE_SCALE 1 16 | /* Switches output descaling feature. 17 | / 0: Disable 18 | / 1: Enable 19 | */ 20 | 21 | #define JD_TBLCLIP 1 22 | /* Use table conversion for saturation arithmetic. A bit faster, but increases 1 KB of code size. 23 | / 0: Disable 24 | / 1: Enable 25 | */ 26 | 27 | #define JD_FASTDECODE 0 28 | /* Optimization level 29 | / 0: Basic optimization. Suitable for 8/16-bit MCUs. 30 | / 1: + 32-bit barrel shifter. Suitable for 32-bit MCUs. 31 | / 2: + Table conversion for huffman decoding (wants 6 << HUFF_BIT bytes of RAM) 32 | */ 33 | 34 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/extra/lv_extra.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_extra.h 3 | * 4 | */ 5 | 6 | #ifndef LV_EXTRA_H 7 | #define LV_EXTRA_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | /********************** 22 | * TYPEDEFS 23 | **********************/ 24 | 25 | /********************** 26 | * GLOBAL PROTOTYPES 27 | **********************/ 28 | 29 | /** 30 | * Initialize the extra components 31 | */ 32 | void lv_extra_init(void); 33 | 34 | /********************** 35 | * MACROS 36 | **********************/ 37 | 38 | #ifdef __cplusplus 39 | } /*extern "C"*/ 40 | #endif 41 | 42 | #endif /*LV_EXTRA_H*/ 43 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/extra/others/lv_others.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_others.h 3 | * 4 | */ 5 | 6 | #ifndef LV_OTHERS_H 7 | #define LV_OTHERS_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "snapshot/lv_snapshot.h" 17 | 18 | /********************* 19 | * DEFINES 20 | *********************/ 21 | 22 | /********************** 23 | * TYPEDEFS 24 | **********************/ 25 | 26 | /********************** 27 | * GLOBAL PROTOTYPES 28 | **********************/ 29 | 30 | /********************** 31 | * MACROS 32 | **********************/ 33 | 34 | #ifdef __cplusplus 35 | } /*extern "C"*/ 36 | #endif 37 | 38 | #endif /*LV_OTHERS_H*/ 39 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/extra/others/snapshot/lv_snapshot.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_snapshot.h 3 | * 4 | */ 5 | 6 | #ifndef LV_SNAPSHOT_H 7 | #define LV_SNAPSHOT_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include 17 | #include 18 | 19 | #include "../../../lv_conf_internal.h" 20 | #include "../../../core/lv_obj.h" 21 | 22 | /********************* 23 | * DEFINES 24 | *********************/ 25 | 26 | #if LV_USE_SNAPSHOT 27 | /********************** 28 | * TYPEDEFS 29 | **********************/ 30 | 31 | /********************** 32 | * GLOBAL PROTOTYPES 33 | **********************/ 34 | 35 | /** Take snapshot for object with its children. 36 | * 37 | * @param obj The object to generate snapshot. 38 | * @param cf color format for generated image. 39 | * 40 | * @return a pointer to a image descriptor, or NULL if failed. 41 | */ 42 | lv_img_dsc_t * lv_snapshot_take(lv_obj_t * obj, lv_img_cf_t cf); 43 | 44 | /** Free the snapshot image returned by @ref lv_snapshot_take 45 | * 46 | * It will firstly free the data image takes, then the image descriptor. 47 | * 48 | * @param dsc The image descriptor generated by lv_snapshot_take. 49 | * 50 | */ 51 | void lv_snapshot_free(lv_img_dsc_t * dsc); 52 | 53 | /** Get the buffer needed for object snapshot image. 54 | * 55 | * @param obj The object to generate snapshot. 56 | * @param cf color format for generated image. 57 | * 58 | * @return the buffer size needed in bytes 59 | */ 60 | uint32_t lv_snapshot_buf_size_needed(lv_obj_t * obj, lv_img_cf_t cf); 61 | 62 | /** Take snapshot for object with its children, save image info to provided buffer. 63 | * 64 | * @param obj The object to generate snapshot. 65 | * @param cf color format for generated image. 66 | * @param dsc image descriptor to store the image result. 67 | * @param buff the buffer to store image data. 68 | * @param buff_size provided buffer size in bytes. 69 | * 70 | * @return LV_RES_OK on success, LV_RES_INV on error. 71 | */ 72 | lv_res_t lv_snapshot_take_to_buf(lv_obj_t * obj, lv_img_cf_t cf, lv_img_dsc_t * dsc, void * buf, uint32_t buff_size); 73 | 74 | 75 | /********************** 76 | * MACROS 77 | **********************/ 78 | #endif /*LV_USE_SNAPSHOT*/ 79 | 80 | #ifdef __cplusplus 81 | } /*extern "C"*/ 82 | #endif 83 | 84 | #endif 85 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/extra/themes/basic/lv_theme_basic.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_theme_basic.h 3 | * 4 | */ 5 | 6 | #ifndef LV_THEME_BASIC_H 7 | #define LV_THEME_BASIC_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../../../core/lv_obj.h" 17 | 18 | #if LV_USE_THEME_BASIC 19 | 20 | /********************* 21 | * DEFINES 22 | *********************/ 23 | 24 | /********************** 25 | * TYPEDEFS 26 | **********************/ 27 | 28 | /********************** 29 | * GLOBAL PROTOTYPES 30 | **********************/ 31 | 32 | /** 33 | * Initialize the theme 34 | * @param disp pointer to display to attach the theme 35 | * @return a pointer to reference this theme later 36 | */ 37 | lv_theme_t * lv_theme_basic_init(lv_disp_t * disp); 38 | 39 | /********************** 40 | * MACROS 41 | **********************/ 42 | 43 | #endif 44 | 45 | #ifdef __cplusplus 46 | } /*extern "C"*/ 47 | #endif 48 | 49 | #endif /*LV_THEME_BASIC_H*/ 50 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/extra/themes/default/lv_theme_default.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_theme_default.h 3 | * 4 | */ 5 | 6 | #ifndef LV_THEME_DEFAULT_H 7 | #define LV_THEME_DEFAULT_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../../../core/lv_obj.h" 17 | 18 | #if LV_USE_THEME_DEFAULT 19 | 20 | /********************* 21 | * DEFINES 22 | *********************/ 23 | 24 | /********************** 25 | * TYPEDEFS 26 | **********************/ 27 | 28 | /********************** 29 | * GLOBAL PROTOTYPES 30 | **********************/ 31 | 32 | /** 33 | * Initialize the theme 34 | * @param color_primary the primary color of the theme 35 | * @param color_secondary the secondary color for the theme 36 | * @param font pointer to a font to use. 37 | * @return a pointer to reference this theme later 38 | */ 39 | lv_theme_t * lv_theme_default_init(lv_disp_t * disp, lv_color_t color_primary, lv_color_t color_secondary, bool dark, 40 | const lv_font_t * font); 41 | 42 | /** 43 | * Get default theme 44 | * @return a pointer to default theme, or NULL if this is not initialized 45 | */ 46 | lv_theme_t * lv_theme_default_get(void); 47 | 48 | /** 49 | * Check if default theme is initialized 50 | * @return true if default theme is initialized, false otherwise 51 | */ 52 | bool lv_theme_default_is_inited(void); 53 | 54 | /********************** 55 | * MACROS 56 | **********************/ 57 | 58 | #endif 59 | 60 | #ifdef __cplusplus 61 | } /*extern "C"*/ 62 | #endif 63 | 64 | #endif /*LV_THEME_DEFAULT_H*/ 65 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/extra/themes/lv_themes.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_themes.h 3 | * 4 | */ 5 | 6 | #ifndef LV_THEMES_H 7 | #define LV_THEMES_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "default/lv_theme_default.h" 17 | #include "mono/lv_theme_mono.h" 18 | #include "basic/lv_theme_basic.h" 19 | 20 | /********************* 21 | * DEFINES 22 | *********************/ 23 | 24 | /********************** 25 | * TYPEDEFS 26 | **********************/ 27 | 28 | /********************** 29 | * GLOBAL PROTOTYPES 30 | **********************/ 31 | 32 | /********************** 33 | * MACROS 34 | **********************/ 35 | 36 | #ifdef __cplusplus 37 | } /*extern "C"*/ 38 | #endif 39 | 40 | #endif /*LV_THEMES_H*/ 41 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/extra/themes/mono/lv_theme_mono.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_theme_mono.h 3 | * 4 | */ 5 | 6 | #ifndef LV_USE_THEME_MONO_H 7 | #define LV_USE_THEME_MONO_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../../../core/lv_obj.h" 17 | 18 | #if LV_USE_THEME_MONO 19 | 20 | /********************* 21 | * DEFINES 22 | *********************/ 23 | 24 | /********************** 25 | * TYPEDEFS 26 | **********************/ 27 | 28 | /********************** 29 | * GLOBAL PROTOTYPES 30 | **********************/ 31 | 32 | /** 33 | * Initialize the theme 34 | * @param color_primary the primary color of the theme 35 | * @param color_secondary the secondary color for the theme 36 | * @param font pointer to a font to use. 37 | * @return a pointer to reference this theme later 38 | */ 39 | lv_theme_t * lv_theme_mono_init(lv_disp_t * disp, bool dark_bg, const lv_font_t * font); 40 | 41 | /********************** 42 | * MACROS 43 | **********************/ 44 | 45 | #endif 46 | 47 | #ifdef __cplusplus 48 | } /*extern "C"*/ 49 | #endif 50 | 51 | #endif /*LV_THEME_DEFAULT_H*/ 52 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/extra/widgets/calendar/lv_calendar_header_arrow.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_calendar_header_arrow.h 3 | * 4 | */ 5 | 6 | #ifndef LV_CALENDAR_HEADER_ARROW_H 7 | #define LV_CALENDAR_HEADER_ARROW_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../../../core/lv_obj.h" 17 | #if LV_USE_CALENDAR_HEADER_ARROW 18 | 19 | /********************* 20 | * DEFINES 21 | *********************/ 22 | 23 | /********************** 24 | * TYPEDEFS 25 | **********************/ 26 | extern const lv_obj_class_t lv_calendar_header_arrow_class; 27 | 28 | /********************** 29 | * GLOBAL PROTOTYPES 30 | **********************/ 31 | 32 | /** 33 | * Create a calendar header with drop-drowns to select the year and month 34 | * @param parent pointer to a calendar object. 35 | * @return the created header 36 | */ 37 | lv_obj_t * lv_calendar_header_arrow_create(lv_obj_t * parent); 38 | 39 | /********************** 40 | * MACROS 41 | **********************/ 42 | 43 | #endif /*LV_USE_CALENDAR_HEADER_ARROW*/ 44 | 45 | #ifdef __cplusplus 46 | } /*extern "C"*/ 47 | #endif 48 | 49 | #endif /*LV_CALENDAR_H*/ 50 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/extra/widgets/calendar/lv_calendar_header_dropdown.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_calendar_header_dropdown.h 3 | * 4 | */ 5 | 6 | #ifndef LV_CALENDAR_HEADER_DROPDOWN_H 7 | #define LV_CALENDAR_HEADER_DROPDOWN_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../../../core/lv_obj.h" 17 | #if LV_USE_CALENDAR_HEADER_DROPDOWN 18 | 19 | /********************* 20 | * DEFINES 21 | *********************/ 22 | 23 | /********************** 24 | * TYPEDEFS 25 | **********************/ 26 | extern const lv_obj_class_t lv_calendar_header_dropdown_class; 27 | 28 | /********************** 29 | * GLOBAL PROTOTYPES 30 | **********************/ 31 | 32 | /** 33 | * Create a calendar header with drop-drowns to select the year and month 34 | * @param parent pointer to a calendar object. 35 | * @return the created header 36 | */ 37 | lv_obj_t * lv_calendar_header_dropdown_create(lv_obj_t * parent); 38 | 39 | /********************** 40 | * MACROS 41 | **********************/ 42 | 43 | #endif /*LV_USE_CALENDAR_HEADER_ARROW*/ 44 | 45 | #ifdef __cplusplus 46 | } /*extern "C"*/ 47 | #endif 48 | 49 | #endif /*LV_CALENDAR_H*/ 50 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/extra/widgets/list/lv_list.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_win.h 3 | * 4 | */ 5 | 6 | #ifndef LV_LIST_H 7 | #define LV_LIST_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../../../core/lv_obj.h" 17 | #include "../../layouts/flex/lv_flex.h" 18 | 19 | #if LV_USE_LIST 20 | 21 | /********************* 22 | * DEFINES 23 | *********************/ 24 | 25 | /********************** 26 | * TYPEDEFS 27 | **********************/ 28 | 29 | extern const lv_obj_class_t lv_list_class; 30 | extern const lv_obj_class_t lv_list_text_class; 31 | extern const lv_obj_class_t lv_list_btn_class; 32 | /********************** 33 | * GLOBAL PROTOTYPES 34 | **********************/ 35 | 36 | lv_obj_t * lv_list_create(lv_obj_t * parent); 37 | 38 | lv_obj_t * lv_list_add_text(lv_obj_t * list, const char * txt); 39 | 40 | lv_obj_t * lv_list_add_btn(lv_obj_t * list, const char * icon, const char * txt); 41 | 42 | const char * lv_list_get_btn_text(lv_obj_t * list, lv_obj_t * btn); 43 | 44 | /********************** 45 | * MACROS 46 | **********************/ 47 | 48 | #endif /*LV_USE_LIST*/ 49 | 50 | #ifdef __cplusplus 51 | } /*extern "C"*/ 52 | #endif 53 | 54 | #endif /*LV_LIST_H*/ 55 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/extra/widgets/lv_widgets.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_widgets.h 3 | * 4 | */ 5 | 6 | #ifndef LV_WIDGETS_H 7 | #define LV_WIDGETS_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "animimg/lv_animimg.h" 17 | #include "calendar/lv_calendar.h" 18 | #include "calendar/lv_calendar_header_arrow.h" 19 | #include "calendar/lv_calendar_header_dropdown.h" 20 | #include "chart/lv_chart.h" 21 | #include "keyboard/lv_keyboard.h" 22 | #include "list/lv_list.h" 23 | #include "msgbox/lv_msgbox.h" 24 | #include "meter/lv_meter.h" 25 | #include "spinbox/lv_spinbox.h" 26 | #include "spinner/lv_spinner.h" 27 | #include "tabview/lv_tabview.h" 28 | #include "tileview/lv_tileview.h" 29 | #include "win/lv_win.h" 30 | #include "colorwheel/lv_colorwheel.h" 31 | #include "led/lv_led.h" 32 | #include "imgbtn/lv_imgbtn.h" 33 | #include "span/lv_span.h" 34 | 35 | /********************* 36 | * DEFINES 37 | *********************/ 38 | 39 | /********************** 40 | * TYPEDEFS 41 | **********************/ 42 | 43 | /********************** 44 | * GLOBAL PROTOTYPES 45 | **********************/ 46 | 47 | /********************** 48 | * MACROS 49 | **********************/ 50 | 51 | #ifdef __cplusplus 52 | } /*extern "C"*/ 53 | #endif 54 | 55 | #endif /*LV_WIDGETS_H*/ 56 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/extra/widgets/spinner/lv_spinner.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_spinner.h 3 | * 4 | */ 5 | 6 | #ifndef LV_SPINNER_H 7 | #define LV_SPINNER_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../../../lvgl.h" 17 | 18 | #if LV_USE_SPINNER 19 | 20 | /*Testing of dependencies*/ 21 | #if LV_USE_ARC == 0 22 | #error "lv_spinner: lv_arc is required. Enable it in lv_conf.h (LV_USE_ARC 1) " 23 | #endif 24 | 25 | /********************* 26 | * DEFINES 27 | *********************/ 28 | 29 | /********************** 30 | * TYPEDEFS 31 | **********************/ 32 | extern const lv_obj_class_t lv_spinner_class; 33 | 34 | /********************** 35 | * GLOBAL PROTOTYPES 36 | **********************/ 37 | 38 | lv_obj_t * lv_spinner_create(lv_obj_t * parent, uint32_t time, uint32_t arc_length); 39 | 40 | /********************** 41 | * MACROS 42 | **********************/ 43 | 44 | #endif /*LV_USE_SPINNER*/ 45 | 46 | #ifdef __cplusplus 47 | } /*extern "C"*/ 48 | #endif 49 | 50 | #endif /*LV_SPINNER_H*/ 51 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/extra/widgets/tabview/lv_tabview.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_templ.h 3 | * 4 | */ 5 | 6 | #ifndef LV_TABVIEW_H 7 | #define LV_TABVIEW_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../../../lvgl.h" 17 | 18 | #if LV_USE_TABVIEW 19 | 20 | /********************* 21 | * DEFINES 22 | *********************/ 23 | 24 | /********************** 25 | * TYPEDEFS 26 | **********************/ 27 | 28 | typedef struct { 29 | lv_obj_t obj; 30 | char ** map; 31 | uint16_t tab_cnt; 32 | uint16_t tab_cur; 33 | lv_dir_t tab_pos; 34 | } lv_tabview_t; 35 | 36 | extern const lv_obj_class_t lv_tabview_class; 37 | 38 | /********************** 39 | * GLOBAL PROTOTYPES 40 | **********************/ 41 | lv_obj_t * lv_tabview_create(lv_obj_t * parent, lv_dir_t tab_pos, lv_coord_t tab_size); 42 | 43 | lv_obj_t * lv_tabview_add_tab(lv_obj_t * tv, const char * name); 44 | 45 | lv_obj_t * lv_tabview_get_content(lv_obj_t * tv); 46 | 47 | lv_obj_t * lv_tabview_get_tab_btns(lv_obj_t * tv); 48 | 49 | void lv_tabview_set_act(lv_obj_t * obj, uint32_t id, lv_anim_enable_t anim_en); 50 | 51 | uint16_t lv_tabview_get_tab_act(lv_obj_t * tv); 52 | 53 | /********************** 54 | * MACROS 55 | **********************/ 56 | 57 | #endif /*LV_USE_TABVIEW*/ 58 | 59 | #ifdef __cplusplus 60 | } /*extern "C"*/ 61 | #endif 62 | 63 | #endif /*LV_TABVIEW_H*/ 64 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/extra/widgets/tileview/lv_tileview.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_tileview.h 3 | * 4 | */ 5 | 6 | #ifndef LV_TILEVIEW_H 7 | #define LV_TILEVIEW_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../../../core/lv_obj.h" 17 | 18 | #if LV_USE_TILEVIEW 19 | 20 | /********************* 21 | * DEFINES 22 | *********************/ 23 | 24 | /********************** 25 | * TYPEDEFS 26 | **********************/ 27 | typedef struct { 28 | lv_obj_t obj; 29 | lv_obj_t * tile_act; 30 | } lv_tileview_t; 31 | 32 | typedef struct { 33 | lv_obj_t obj; 34 | lv_dir_t dir; 35 | } lv_tileview_tile_t; 36 | 37 | extern const lv_obj_class_t lv_tileview_class; 38 | extern const lv_obj_class_t lv_tileview_tile_class; 39 | 40 | /********************** 41 | * GLOBAL PROTOTYPES 42 | **********************/ 43 | 44 | /** 45 | * Create a tileview objects 46 | * @param par pointer to an object, it will be the parent of the new tileview 47 | * @return pointer to the created tileview 48 | */ 49 | lv_obj_t * lv_tileview_create(lv_obj_t * parent); 50 | 51 | lv_obj_t * lv_tileview_add_tile(lv_obj_t * tv, uint8_t row_id, uint8_t col_id, lv_dir_t dir); 52 | 53 | void lv_obj_set_tile(lv_obj_t * tv, lv_obj_t * tile_obj, lv_anim_enable_t anim_en); 54 | void lv_obj_set_tile_id(lv_obj_t * tv, uint32_t col_id, uint32_t row_id, lv_anim_enable_t anim_en); 55 | 56 | lv_obj_t * lv_tileview_get_tile_act(lv_obj_t * obj); 57 | 58 | /*===================== 59 | * Other functions 60 | *====================*/ 61 | 62 | /********************** 63 | * MACROS 64 | **********************/ 65 | 66 | #endif /*LV_USE_TILEVIEW*/ 67 | 68 | #ifdef __cplusplus 69 | } /*extern "C"*/ 70 | #endif 71 | 72 | #endif /*LV_TILEVIEW_H*/ 73 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/extra/widgets/win/lv_win.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_win.h 3 | * 4 | */ 5 | 6 | #ifndef LV_WIN_H 7 | #define LV_WIN_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../../../lvgl.h" 17 | 18 | /********************* 19 | * DEFINES 20 | *********************/ 21 | 22 | /********************** 23 | * TYPEDEFS 24 | **********************/ 25 | typedef struct { 26 | lv_obj_t obj; 27 | } lv_win_t; 28 | 29 | extern const lv_obj_class_t lv_win_class; 30 | 31 | /********************** 32 | * GLOBAL PROTOTYPES 33 | **********************/ 34 | 35 | lv_obj_t * lv_win_create(lv_obj_t * parent, lv_coord_t header_height); 36 | 37 | 38 | lv_obj_t * lv_win_add_title(lv_obj_t * win, const char * txt); 39 | lv_obj_t * lv_win_add_btn(lv_obj_t * win, const void * icon, lv_coord_t btn_w); 40 | 41 | lv_obj_t * lv_win_get_header(lv_obj_t * win); 42 | lv_obj_t * lv_win_get_content(lv_obj_t * win); 43 | /********************** 44 | * MACROS 45 | **********************/ 46 | 47 | #ifdef __cplusplus 48 | } /*extern "C"*/ 49 | #endif 50 | 51 | #endif /*LV_WIN_H*/ 52 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/font/lv_font_loader.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_font_loader.h 3 | * 4 | */ 5 | 6 | #ifndef LV_FONT_LOADER_H 7 | #define LV_FONT_LOADER_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | /********************** 22 | * TYPEDEFS 23 | **********************/ 24 | 25 | /********************** 26 | * GLOBAL PROTOTYPES 27 | **********************/ 28 | 29 | lv_font_t * lv_font_load(const char * fontName); 30 | void lv_font_free(lv_font_t * font); 31 | 32 | /********************** 33 | * MACROS 34 | **********************/ 35 | 36 | #ifdef __cplusplus 37 | } /*extern "C"*/ 38 | #endif 39 | 40 | #endif /*LV_FONT_LOADER_H*/ 41 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/gpu/lv_gpu_nxp_pxp_osa.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_gpu_nxp_pxp_osa.h 3 | * 4 | */ 5 | 6 | /** 7 | * MIT License 8 | * 9 | * Copyright (c) 2020 NXP 10 | * 11 | * Permission is hereby granted, free of charge, to any person obtaining a copy 12 | * of this software and associated documentation files (the "Software"), to deal 13 | * in the Software without restriction, including without limitation the rights to 14 | * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 15 | * the Software, and to permit persons to whom the Software is furnished to do so, 16 | * subject to the following conditions: 17 | * 18 | * The above copyright notice and this permission notice (including the next paragraph) 19 | * shall be included in all copies or substantial portions of the Software. 20 | * 21 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, 22 | * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A 23 | * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 24 | * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 25 | * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 26 | * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | * 28 | */ 29 | 30 | #ifndef LV_SRC_LV_GPU_LV_GPU_NXP_PXP_OSA_H_ 31 | #define LV_SRC_LV_GPU_LV_GPU_NXP_PXP_OSA_H_ 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | #include "../lv_conf_internal.h" 38 | 39 | #if LV_USE_GPU_NXP_PXP && LV_USE_GPU_NXP_PXP_AUTO_INIT 40 | extern lv_nxp_pxp_cfg_t pxp_default_cfg; 41 | #endif 42 | 43 | #ifdef __cplusplus 44 | } /*extern "C"*/ 45 | #endif 46 | 47 | #endif /*LV_SRC_LV_GPU_LV_GPU_NXP_PXP_OSA_H_*/ 48 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/gpu/lv_gpu_sdl.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_gpu_sdl.h 3 | * 4 | */ 5 | 6 | #ifndef LV_GPU_SDL_H 7 | #define LV_GPU_SDL_H 8 | 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | /********************* 15 | * INCLUDES 16 | *********************/ 17 | #include "../lv_conf_internal.h" 18 | 19 | #if LV_USE_GPU_SDL 20 | 21 | #if LV_USE_EXTERNAL_RENDERER == 0 22 | #error "SDL GPU requires LV_USE_EXTERNAL_RENDERER 1. Enable it in lv_conf.h" 23 | #endif 24 | 25 | #include LV_GPU_SDL_INCLUDE_PATH 26 | 27 | /********************* 28 | * DEFINES 29 | *********************/ 30 | 31 | /********************** 32 | * TYPEDEFS 33 | **********************/ 34 | 35 | /********************** 36 | * GLOBAL PROTOTYPES 37 | **********************/ 38 | 39 | void lv_gpu_sdl_init(); 40 | 41 | /** 42 | * @brief Free caches 43 | * 44 | */ 45 | void lv_gpu_sdl_deinit(); 46 | 47 | /*====================== 48 | * Add/remove functions 49 | *=====================*/ 50 | 51 | /*===================== 52 | * Setter functions 53 | *====================*/ 54 | 55 | /*===================== 56 | * Getter functions 57 | *====================*/ 58 | 59 | /*===================== 60 | * Other functions 61 | *====================*/ 62 | 63 | /********************** 64 | * MACROS 65 | **********************/ 66 | 67 | #endif /*LV_USE_GPU_SDL*/ 68 | 69 | #ifdef __cplusplus 70 | } /*extern "C"*/ 71 | #endif 72 | 73 | #endif /*LV_GPU_SDL_H*/ 74 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/gpu/sdl/lv_gpu_sdl_lru.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_gpu_sdl_lru.h 3 | * 4 | */ 5 | 6 | #ifndef LV_LRU_H 7 | #define LV_LRU_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | #include "../../lv_conf_internal.h" 18 | 19 | #include LV_GPU_SDL_INCLUDE_PATH 20 | 21 | #include 22 | #include 23 | 24 | 25 | /********************* 26 | * DEFINES 27 | *********************/ 28 | 29 | /********************** 30 | * TYPEDEFS 31 | **********************/ 32 | 33 | typedef enum { 34 | LV_LRU_NO_ERROR = 0, 35 | LV_LRU_MISSING_CACHE, 36 | LV_LRU_MISSING_KEY, 37 | LV_LRU_MISSING_VALUE, 38 | LV_LRU_LOCK_ERROR, 39 | LV_LRU_VALUE_TOO_LARGE 40 | } lruc_error; 41 | 42 | typedef void (lv_lru_free_t)(void * v); 43 | 44 | typedef struct lruc_item { 45 | void * value; 46 | void * key; 47 | size_t value_length; 48 | size_t key_length; 49 | uint64_t access_count; 50 | struct lruc_item * next; 51 | } lruc_item; 52 | 53 | typedef struct { 54 | lruc_item ** items; 55 | uint64_t access_count; 56 | uint64_t free_memory; 57 | uint64_t total_memory; 58 | uint64_t average_item_length; 59 | uint32_t hash_table_size; 60 | time_t seed; 61 | lv_lru_free_t * value_free; 62 | lv_lru_free_t * key_free; 63 | lruc_item * free_items; 64 | SDL_mutex * mutex; 65 | } lv_lru_t; 66 | 67 | 68 | /********************** 69 | * GLOBAL PROTOTYPES 70 | **********************/ 71 | 72 | lv_lru_t * lv_lru_new(uint64_t cache_size, uint32_t average_length, lv_lru_free_t * value_free, 73 | lv_lru_free_t * key_free); 74 | 75 | lruc_error lv_lru_free(lv_lru_t * cache); 76 | 77 | lruc_error lv_lru_set(lv_lru_t * cache, const void * key, size_t key_length, void * value, size_t value_length); 78 | 79 | lruc_error lv_lru_get(lv_lru_t * cache, const void * key, size_t key_size, void ** value); 80 | 81 | lruc_error lv_lru_delete(lv_lru_t * cache, const void * key, size_t key_size); 82 | 83 | /********************** 84 | * MACROS 85 | **********************/ 86 | #ifdef __cplusplus 87 | } /*extern "C"*/ 88 | #endif 89 | 90 | #endif /*LV_LRU_H*/ 91 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/gpu/sdl/lv_gpu_sdl_mask.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_gpu_sdl_mask.h 3 | * 4 | */ 5 | 6 | #ifndef LV_GPU_SDL_MASK_H 7 | #define LV_GPU_SDL_MASK_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | #include "../../lv_conf_internal.h" 18 | 19 | #include LV_GPU_SDL_INCLUDE_PATH 20 | 21 | #include "../../misc/lv_area.h" 22 | #include "../../misc/lv_color.h" 23 | 24 | /********************* 25 | * DEFINES 26 | *********************/ 27 | 28 | /********************** 29 | * TYPEDEFS 30 | **********************/ 31 | 32 | /********************** 33 | * GLOBAL PROTOTYPES 34 | **********************/ 35 | 36 | 37 | lv_opa_t * lv_draw_mask_dump(const lv_area_t * coords, const int16_t * ids, int16_t ids_count); 38 | 39 | SDL_Surface * lv_sdl_create_mask_surface(lv_opa_t * pixels, lv_coord_t width, lv_coord_t height, lv_coord_t stride); 40 | 41 | SDL_Texture * lv_sdl_create_mask_texture(SDL_Renderer * renderer, lv_opa_t * pixels, lv_coord_t width, 42 | lv_coord_t height, lv_coord_t stride); 43 | 44 | SDL_Surface * lv_sdl_apply_mask_surface(const lv_area_t * coords, const int16_t * ids, int16_t ids_count); 45 | 46 | SDL_Texture * 47 | lv_sdl_gen_mask_texture(SDL_Renderer * renderer, const lv_area_t * coords, const int16_t * ids, int16_t ids_count); 48 | 49 | /********************** 50 | * MACROS 51 | **********************/ 52 | 53 | #ifdef __cplusplus 54 | } /*extern "C"*/ 55 | #endif 56 | 57 | #endif /*LV_GPU_SDL_MASK_H*/ 58 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/gpu/sdl/lv_gpu_sdl_stack_blur.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_gpu_sdl_stack_blur.h 3 | * 4 | */ 5 | #ifndef LV_GPU_SDL_STACK_BLUR_H 6 | #define LV_GPU_SDL_STACK_BLUR_H 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | /********************* 13 | * INCLUDES 14 | *********************/ 15 | 16 | #include "../../lv_conf_internal.h" 17 | 18 | #include "../../misc/lv_color.h" 19 | 20 | /********************* 21 | * DEFINES 22 | *********************/ 23 | 24 | /********************** 25 | * TYPEDEFS 26 | **********************/ 27 | 28 | /********************** 29 | * GLOBAL PROTOTYPES 30 | **********************/ 31 | 32 | void lv_stack_blur_grayscale(lv_opa_t * buf, uint16_t w, uint16_t h, uint16_t r); 33 | 34 | /********************** 35 | * MACROS 36 | **********************/ 37 | 38 | #ifdef __cplusplus 39 | } /*extern "C"*/ 40 | #endif 41 | 42 | #endif /*LV_GPU_SDL_STACK_BLUR_H*/ 43 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/gpu/sdl/lv_gpu_sdl_utils.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_gpu_sdl_utils.h 3 | * 4 | */ 5 | #ifndef LV_GPU_SDL_UTILS_H 6 | #define LV_GPU_SDL_UTILS_H 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | /********************* 13 | * INCLUDES 14 | *********************/ 15 | 16 | #include "../../lv_conf_internal.h" 17 | 18 | #include "../../misc/lv_color.h" 19 | #include "../../misc/lv_area.h" 20 | 21 | #include LV_GPU_SDL_INCLUDE_PATH 22 | 23 | /********************* 24 | * DEFINES 25 | *********************/ 26 | 27 | /********************** 28 | * TYPEDEFS 29 | **********************/ 30 | 31 | /********************** 32 | * GLOBAL PROTOTYPES 33 | **********************/ 34 | 35 | void _lv_gpu_sdl_utils_init(); 36 | 37 | void _lv_gpu_sdl_utils_deinit(); 38 | 39 | void lv_area_to_sdl_rect(const lv_area_t * in, SDL_Rect * out); 40 | 41 | void lv_color_to_sdl_color(const lv_color_t * in, SDL_Color * out); 42 | 43 | void lv_area_zoom_to_sdl_rect(const lv_area_t * in, SDL_Rect * out, uint16_t zoom, const lv_point_t * pivot); 44 | 45 | double lv_sdl_round(double d); 46 | 47 | SDL_Palette * lv_sdl_alloc_palette_for_bpp(const uint8_t * mapping, uint8_t bpp); 48 | 49 | SDL_Palette * lv_sdl_get_grayscale_palette(uint8_t bpp); 50 | 51 | void lv_sdl_to_8bpp(uint8_t * dest, const uint8_t * src, int width, int height, int stride, uint8_t bpp); 52 | 53 | /********************** 54 | * MACROS 55 | **********************/ 56 | 57 | #ifdef __cplusplus 58 | } /*extern "C"*/ 59 | #endif 60 | 61 | #endif /*LV_GPU_SDL_UTILS_H*/ 62 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/hal/lv_hal.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_hal.h 3 | * 4 | */ 5 | 6 | #ifndef LV_HAL_H 7 | #define LV_HAL_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "lv_hal_disp.h" 17 | #include "lv_hal_indev.h" 18 | #include "lv_hal_tick.h" 19 | 20 | /********************* 21 | * DEFINES 22 | *********************/ 23 | /** 24 | * Same as Android's DIP. (Different name is chosen to avoid mistype between LV_DPI and LV_DIP) 25 | * 1 dip is 1 px on a 160 DPI screen 26 | * 1 dip is 2 px on a 320 DPI screen 27 | * https://stackoverflow.com/questions/2025282/what-is-the-difference-between-px-dip-dp-and-sp 28 | */ 29 | #define _LV_DPX_CALC(dpi, n) ((n) == 0 ? 0 :LV_MAX((( (dpi) * (n) + 80) / 160), 1)) /*+80 for rounding*/ 30 | #define LV_DPX(n) _LV_DPX_CALC(lv_disp_get_dpi(NULL), n) 31 | 32 | /********************** 33 | * TYPEDEFS 34 | **********************/ 35 | 36 | /********************** 37 | * GLOBAL PROTOTYPES 38 | **********************/ 39 | 40 | /********************** 41 | * MACROS 42 | **********************/ 43 | 44 | #ifdef __cplusplus 45 | } /*extern "C"*/ 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/hal/lv_hal_tick.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_hal_tick.h 3 | * Provide access to the system tick with 1 millisecond resolution 4 | */ 5 | 6 | #ifndef LV_HAL_TICK_H 7 | #define LV_HAL_TICK_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../lv_conf_internal.h" 17 | 18 | #include 19 | #include 20 | 21 | /********************* 22 | * DEFINES 23 | *********************/ 24 | #ifndef LV_ATTRIBUTE_TICK_INC 25 | #define LV_ATTRIBUTE_TICK_INC 26 | #endif 27 | 28 | /********************** 29 | * TYPEDEFS 30 | **********************/ 31 | 32 | /********************** 33 | * GLOBAL PROTOTYPES 34 | **********************/ 35 | 36 | //! @cond Doxygen_Suppress 37 | 38 | #if !LV_TICK_CUSTOM 39 | /** 40 | * You have to call this function periodically 41 | * @param tick_period the call period of this function in milliseconds 42 | */ 43 | LV_ATTRIBUTE_TICK_INC void lv_tick_inc(uint32_t tick_period); 44 | #endif 45 | 46 | //! @endcond 47 | 48 | /** 49 | * Get the elapsed milliseconds since start up 50 | * @return the elapsed milliseconds 51 | */ 52 | uint32_t lv_tick_get(void); 53 | 54 | /** 55 | * Get the elapsed milliseconds since a previous time stamp 56 | * @param prev_tick a previous time stamp (return value of lv_tick_get() ) 57 | * @return the elapsed milliseconds since 'prev_tick' 58 | */ 59 | uint32_t lv_tick_elaps(uint32_t prev_tick); 60 | 61 | /********************** 62 | * MACROS 63 | **********************/ 64 | 65 | #ifdef __cplusplus 66 | } /*extern "C"*/ 67 | #endif 68 | 69 | #endif /*LV_HAL_TICK_H*/ 70 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/lv_api_map.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_api_map.h 3 | * 4 | */ 5 | 6 | #ifndef LV_API_MAP_H 7 | #define LV_API_MAP_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../lvgl.h" 17 | 18 | /********************* 19 | * DEFINES 20 | *********************/ 21 | 22 | #define LV_NO_TASK_READY LV_NO_TIMER_READY 23 | #define LV_INDEV_STATE_REL LV_INDEV_STATE_RELEASED 24 | #define LV_INDEV_STATE_PR LV_INDEV_STATE_PRESSED 25 | #define LV_OBJ_FLAG_SNAPABLE LV_OBJ_FLAG_SNAPPABLE /*Fixed typo*/ 26 | 27 | /********************** 28 | * TYPEDEFS 29 | **********************/ 30 | 31 | /********************** 32 | * GLOBAL PROTOTYPES 33 | **********************/ 34 | 35 | static inline LV_ATTRIBUTE_TIMER_HANDLER uint32_t lv_task_handler(void) 36 | { 37 | return lv_timer_handler(); 38 | } 39 | 40 | /********************** 41 | * MACROS 42 | **********************/ 43 | 44 | 45 | /********************** 46 | * INLINE FUNCTIONS 47 | **********************/ 48 | 49 | /** 50 | * Move the object to the foreground. 51 | * It will look like if it was created as the last child of its parent. 52 | * It also means it can cover any of the siblings. 53 | * @param obj pointer to an object 54 | */ 55 | static inline void lv_obj_move_foreground(lv_obj_t * obj) 56 | { 57 | lv_obj_t * parent = lv_obj_get_parent(obj); 58 | lv_obj_move_to_index(obj, lv_obj_get_child_cnt(parent) - 1); 59 | } 60 | 61 | /** 62 | * Move the object to the background. 63 | * It will look like if it was created as the first child of its parent. 64 | * It also means any of the siblings can cover the object. 65 | * @param obj pointer to an object 66 | */ 67 | static inline void lv_obj_move_background(lv_obj_t * obj) 68 | { 69 | lv_obj_move_to_index(obj, 0); 70 | } 71 | 72 | 73 | 74 | /********************** 75 | * DEPRECATED FUNCTIONS 76 | **********************/ 77 | 78 | static inline uint32_t lv_obj_get_child_id(const struct _lv_obj_t * obj) 79 | { 80 | LV_LOG_WARN("lv_obj_get_child_id(obj) is deprecated, please use lv_obj_get_index(obj)."); 81 | return lv_obj_get_index(obj); 82 | } 83 | 84 | #ifdef __cplusplus 85 | } /*extern "C"*/ 86 | #endif 87 | 88 | #endif /*LV_API_MAP_H*/ 89 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/lvgl.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lvgl.h 3 | * This file exists only to be compatible with Arduino's library structure 4 | */ 5 | 6 | #ifndef LVGL_SRC_H 7 | #define LVGL_SRC_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | #include "../lvgl.h" 18 | 19 | /********************* 20 | * DEFINES 21 | *********************/ 22 | 23 | /********************** 24 | * TYPEDEFS 25 | **********************/ 26 | 27 | /********************** 28 | * GLOBAL PROTOTYPES 29 | **********************/ 30 | 31 | /********************** 32 | * MACROS 33 | **********************/ 34 | 35 | #ifdef __cplusplus 36 | } /*extern "C"*/ 37 | #endif 38 | 39 | #endif /*LVGL_SRC_H*/ 40 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/misc/lv_assert.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_assert.h 3 | * 4 | */ 5 | 6 | #ifndef LV_ASSERT_H 7 | #define LV_ASSERT_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../lv_conf_internal.h" 17 | #include "lv_log.h" 18 | #include "lv_mem.h" 19 | #include LV_ASSERT_HANDLER_INCLUDE 20 | 21 | /********************* 22 | * DEFINES 23 | *********************/ 24 | 25 | /********************** 26 | * TYPEDEFS 27 | **********************/ 28 | 29 | /********************** 30 | * GLOBAL PROTOTYPES 31 | **********************/ 32 | 33 | /********************** 34 | * MACROS 35 | **********************/ 36 | 37 | #define LV_ASSERT(expr) \ 38 | do { \ 39 | if(!(expr)) { \ 40 | LV_LOG_ERROR("Asserted at expression: %s", #expr); \ 41 | LV_ASSERT_HANDLER \ 42 | } \ 43 | } while(0) 44 | 45 | #define LV_ASSERT_MSG(expr, msg) \ 46 | do { \ 47 | if(!(expr)) { \ 48 | LV_LOG_ERROR("Asserted at expression: %s (%s)", #expr, msg); \ 49 | LV_ASSERT_HANDLER \ 50 | } \ 51 | } while(0) 52 | 53 | /*----------------- 54 | * ASSERTS 55 | *-----------------*/ 56 | 57 | #if LV_USE_ASSERT_NULL 58 | # define LV_ASSERT_NULL(p) LV_ASSERT_MSG(p != NULL, "NULL pointer"); 59 | #else 60 | # define LV_ASSERT_NULL(p) 61 | #endif 62 | 63 | #if LV_USE_ASSERT_MALLOC 64 | # define LV_ASSERT_MALLOC(p) LV_ASSERT_MSG(p != NULL, "Out of memory"); 65 | #else 66 | # define LV_ASSERT_MALLOC(p) 67 | #endif 68 | 69 | #if LV_USE_ASSERT_MEM_INTEGRITY 70 | # define LV_ASSERT_MEM_INTEGRITY() LV_ASSERT_MSG(lv_mem_test() == LV_RES_OK, "Memory integrity error"); 71 | #else 72 | # define LV_ASSERT_MEM_INTEGRITY() 73 | #endif 74 | 75 | #ifdef __cplusplus 76 | } /*extern "C"*/ 77 | #endif 78 | 79 | #endif /*LV_ASSERT_H*/ 80 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/misc/lv_async.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_async.h 3 | * 4 | */ 5 | 6 | #ifndef LV_ASYNC_H 7 | #define LV_ASYNC_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | #include "lv_types.h" 18 | 19 | /********************* 20 | * DEFINES 21 | *********************/ 22 | 23 | /********************** 24 | * TYPEDEFS 25 | **********************/ 26 | 27 | /** 28 | * Type for async callback. 29 | */ 30 | typedef void (*lv_async_cb_t)(void *); 31 | 32 | /********************** 33 | * GLOBAL PROTOTYPES 34 | **********************/ 35 | 36 | /** 37 | * Call an asynchronous function the next time lv_timer_handler() is run. This function is likely to return 38 | * **before** the call actually happens! 39 | * @param async_xcb a callback which is the task itself. 40 | * (the 'x' in the argument name indicates that it's not a fully generic function because it not follows 41 | * the `func_name(object, callback, ...)` convention) 42 | * @param user_data custom parameter 43 | */ 44 | lv_res_t lv_async_call(lv_async_cb_t async_xcb, void * user_data); 45 | 46 | /********************** 47 | * MACROS 48 | **********************/ 49 | 50 | #ifdef __cplusplus 51 | } /*extern "C"*/ 52 | #endif 53 | 54 | #endif /*LV_ASYNC_H*/ 55 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/misc/lv_templ.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_templ.h 3 | * 4 | */ 5 | 6 | #ifndef LV_TEMPL_H 7 | #define LV_TEMPL_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | /********************** 22 | * TYPEDEFS 23 | **********************/ 24 | 25 | /********************** 26 | * GLOBAL PROTOTYPES 27 | **********************/ 28 | 29 | /********************** 30 | * MACROS 31 | **********************/ 32 | 33 | #ifdef __cplusplus 34 | } /*extern "C"*/ 35 | #endif 36 | 37 | #endif /*LV_TEMPL_H*/ 38 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/misc/lv_txt_ap.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_txt_ap.h 3 | * 4 | */ 5 | 6 | #ifndef LV_TXT_AP_H 7 | #define LV_TXT_AP_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include 17 | #include "lv_txt.h" 18 | #include "../draw/lv_draw.h" 19 | 20 | #if LV_USE_ARABIC_PERSIAN_CHARS == 1 21 | 22 | /********************* 23 | * DEFINES 24 | *********************/ 25 | 26 | #define LV_UNDEF_ARABIC_PERSIAN_CHARS (UINT32_MAX) 27 | #define LV_AP_ALPHABET_BASE_CODE 0x0622 28 | #define LV_AP_END_CHARS_LIST {0,0,0,0,0,{0,0}} 29 | /********************** 30 | * TYPEDEFS 31 | **********************/ 32 | 33 | /********************** 34 | * GLOBAL PROTOTYPES 35 | **********************/ 36 | uint32_t _lv_txt_ap_calc_bytes_cnt(const char * txt); 37 | void _lv_txt_ap_proc(const char * txt, char * txt_out); 38 | 39 | /********************** 40 | * MACROS 41 | **********************/ 42 | 43 | #endif // LV_USE_ARABIC_PERSIAN_CHARS 44 | 45 | #ifdef __cplusplus 46 | } /*extern "C"*/ 47 | #endif 48 | 49 | #endif /*LV_TXT_AP_H*/ 50 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/misc/lv_utils.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_utils.h 3 | * 4 | */ 5 | 6 | #ifndef LV_UTILS_H 7 | #define LV_UTILS_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include 17 | 18 | /********************* 19 | * DEFINES 20 | *********************/ 21 | 22 | /********************** 23 | * TYPEDEFS 24 | **********************/ 25 | 26 | /********************** 27 | * GLOBAL PROTOTYPES 28 | **********************/ 29 | 30 | /** Searches base[0] to base[n - 1] for an item that matches *key. 31 | * 32 | * @note The function cmp must return negative if it's first 33 | * argument (the search key) is less that it's second (a table entry), 34 | * zero if equal, and positive if greater. 35 | * 36 | * @note Items in the array must be in ascending order. 37 | * 38 | * @param key Pointer to item being searched for 39 | * @param base Pointer to first element to search 40 | * @param n Number of elements 41 | * @param size Size of each element 42 | * @param cmp Pointer to comparison function (see #lv_font_codeCompare as a comparison function 43 | * example) 44 | * 45 | * @return a pointer to a matching item, or NULL if none exists. 46 | */ 47 | void * _lv_utils_bsearch(const void * key, const void * base, uint32_t n, uint32_t size, 48 | int32_t (*cmp)(const void * pRef, const void * pElement)); 49 | 50 | /********************** 51 | * MACROS 52 | **********************/ 53 | 54 | #ifdef __cplusplus 55 | } /*extern "C"*/ 56 | #endif 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/widgets/lv_btn.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_btn.h 3 | * 4 | */ 5 | 6 | #ifndef LV_BTN_H 7 | #define LV_BTN_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../lv_conf_internal.h" 17 | 18 | #if LV_USE_BTN != 0 19 | #include "../core/lv_obj.h" 20 | 21 | /********************* 22 | * DEFINES 23 | *********************/ 24 | 25 | /********************** 26 | * TYPEDEFS 27 | **********************/ 28 | 29 | typedef struct { 30 | lv_obj_t obj; 31 | } lv_btn_t; 32 | 33 | extern const lv_obj_class_t lv_btn_class; 34 | 35 | /********************** 36 | * GLOBAL PROTOTYPES 37 | **********************/ 38 | 39 | /** 40 | * Create a button object 41 | * @param parent pointer to an object, it will be the parent of the new button 42 | * @return pointer to the created button 43 | */ 44 | lv_obj_t * lv_btn_create(lv_obj_t * parent); 45 | 46 | /********************** 47 | * MACROS 48 | **********************/ 49 | 50 | #endif /*LV_USE_BTN*/ 51 | 52 | #ifdef __cplusplus 53 | } /*extern "C"*/ 54 | #endif 55 | 56 | #endif /*LV_BTN_H*/ 57 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/widgets/lv_objx_templ.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_templ.h 3 | * 4 | */ 5 | 6 | /** 7 | * TODO Remove these instructions 8 | * Search and replace: templ -> object short name with lower case(e.g. btn, label etc) 9 | * TEMPL -> object short name with upper case (e.g. BTN, LABEL etc.) 10 | * 11 | */ 12 | 13 | #ifndef LV_TEMPL_H 14 | #define LV_TEMPL_H 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | /********************* 21 | * INCLUDES 22 | *********************/ 23 | #include "../lv_conf_internal.h" 24 | 25 | #if LV_USE_TEMPL != 0 26 | 27 | #include "../core/lv_obj.h" 28 | 29 | /********************* 30 | * DEFINES 31 | *********************/ 32 | 33 | /********************** 34 | * TYPEDEFS 35 | **********************/ 36 | /*Data of template*/ 37 | typedef struct { 38 | lv_ANCESTOR_t ancestor; /*The ancestor widget, e.g. lv_slider_t slider*/ 39 | /*New data for this type*/ 40 | } lv_templ_t; 41 | 42 | extern const lv_obj_class_t lv_templ_class; 43 | 44 | /********************** 45 | * GLOBAL PROTOTYPES 46 | **********************/ 47 | 48 | /** 49 | * Create a templ objects 50 | * @param parent pointer to an object, it will be the parent of the new templ 51 | * @return pointer to the created bar 52 | */ 53 | lv_obj_t * lv_templ_create(lv_obj_t * parent); 54 | 55 | /*====================== 56 | * Add/remove functions 57 | *=====================*/ 58 | 59 | /*===================== 60 | * Setter functions 61 | *====================*/ 62 | 63 | /*===================== 64 | * Getter functions 65 | *====================*/ 66 | 67 | /*===================== 68 | * Other functions 69 | *====================*/ 70 | 71 | /********************** 72 | * MACROS 73 | **********************/ 74 | 75 | #endif /*LV_USE_TEMPL*/ 76 | 77 | #ifdef __cplusplus 78 | } /*extern "C"*/ 79 | #endif 80 | 81 | #endif /*LV_TEMPL_H*/ 82 | -------------------------------------------------------------------------------- /components/extended_wasm_app/esp_lvgl/include/lvgl/src/widgets/lv_switch.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_sw.h 3 | * 4 | */ 5 | 6 | #ifndef LV_SWITCH_H 7 | #define LV_SWITCH_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "../lv_conf_internal.h" 17 | 18 | #if LV_USE_SWITCH != 0 19 | 20 | #include "../core/lv_obj.h" 21 | 22 | /********************* 23 | * DEFINES 24 | *********************/ 25 | 26 | /********************** 27 | * TYPEDEFS 28 | **********************/ 29 | 30 | typedef struct { 31 | lv_obj_t obj; 32 | int32_t anim_state; 33 | } lv_switch_t; 34 | 35 | extern const lv_obj_class_t lv_switch_class; 36 | 37 | /********************** 38 | * GLOBAL PROTOTYPES 39 | **********************/ 40 | 41 | /** 42 | * Create a switch objects 43 | * @param parent pointer to an object, it will be the parent of the new switch 44 | * @return pointer to the created switch 45 | */ 46 | lv_obj_t * lv_switch_create(lv_obj_t * parent); 47 | 48 | /********************** 49 | * MACROS 50 | **********************/ 51 | 52 | #endif /*LV_USE_SWITCH*/ 53 | 54 | #ifdef __cplusplus 55 | } /*extern "C"*/ 56 | #endif 57 | 58 | #endif /*LV_SWITCH_H*/ 59 | -------------------------------------------------------------------------------- /components/extended_wasm_app/wifi_provisioning/include/wifi_provisioning/scheme_softap.h: -------------------------------------------------------------------------------- 1 | // Copyright 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 | #pragma once 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /** 22 | * 23 | * @brief Provide HTTPD Server handle externally. 24 | * 25 | * Useful in cases wherein applications need the webserver for some 26 | * different operations, and do not want the wifi provisioning component 27 | * to start/stop a new instance. 28 | * 29 | * @note This API should be called before wifi_prov_mgr_start_provisioning() 30 | * 31 | * @param[in] handle Handle to HTTPD server instance 32 | */ 33 | void wifi_prov_scheme_softap_set_httpd_handle(void *handle); 34 | 35 | #ifdef __cplusplus 36 | } 37 | #endif 38 | -------------------------------------------------------------------------------- /components/log/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRCS "" 2 | INCLUDE_DIRS include) -------------------------------------------------------------------------------- /components/log/include/esp_log.h: -------------------------------------------------------------------------------- 1 | /* 2 | * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD 3 | * 4 | * SPDX-License-Identifier: Apache-2.0 5 | */ 6 | 7 | #ifndef __ESP_LOG_H__ 8 | #define __ESP_LOG_H__ 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | #define ESP_LOGE(TAG, ...) printf(__VA_ARGS__); printf("\r\n"); 15 | #define ESP_LOGI(TAG, ...) printf(__VA_ARGS__); printf("\r\n"); 16 | #define ESP_LOGW(TAG, ...) printf(__VA_ARGS__); printf("\r\n"); 17 | 18 | #ifdef __cplusplus 19 | } 20 | #endif 21 | 22 | 23 | #endif /* __ESP_LOG_H__ */ -------------------------------------------------------------------------------- /components/qrcode/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRCS "src/esp_qrcode_main.c" "src/esp_qrcode_wrapper.c" "src/qrcodegen.c" 2 | INCLUDE_DIRS "include" 3 | PRIV_INCLUDE_DIRS "private_include" 4 | REQUIRES "esp_common" "log" 5 | ) 6 | -------------------------------------------------------------------------------- /components/qrcode/README.md: -------------------------------------------------------------------------------- 1 | # QR Code generator component 2 | 3 | This directory contains a QR code generator component written in C. This component is based on [QR-Code-generator](https://github.com/nayuki/QR-Code-generator). 4 | 5 | To learn more about how to use this component, please check API Documentation from header file [qrcode.h](./include/qrcode.h). 6 | 7 | Please note that this component is not considered to be a part of WDF stable API. It may change and may be removed in the future releases. 8 | -------------------------------------------------------------------------------- /components/qrcode/src/esp_qrcode_wrapper.c: -------------------------------------------------------------------------------- 1 | // Copyright 2020 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 | #include 16 | #include 17 | 18 | #include "qrcodegen.h" 19 | #include "qrcode.h" 20 | 21 | int esp_qrcode_get_size(esp_qrcode_handle_t qrcode) 22 | { 23 | return qrcodegen_getSize(qrcode); 24 | } 25 | 26 | bool esp_qrcode_get_module(esp_qrcode_handle_t qrcode, int x, int y) 27 | { 28 | return qrcodegen_getModule(qrcode, x, y); 29 | } 30 | -------------------------------------------------------------------------------- /components/wamr/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(srcs 2 | "app-framework/app-native-shared/attr_container.c" 3 | "app-framework/app-native-shared/restful_utils.c" 4 | "app-framework/base/app/bh_platform.c" 5 | "app-framework/base/app/request.c" 6 | "app-framework/base/app/timer.c" 7 | ) 8 | 9 | set(include_dirs 10 | "app-framework/include" 11 | "libc-wasi/include" 12 | ) 13 | 14 | if(CONFIG_WAMR_EXTENDED_LIBC_IOCTL) 15 | list(APPEND srcs "libc-builtin-extended/src/libc_ioctl.c") 16 | list(APPEND include_dirs "libc-builtin-extended/include") 17 | list(APPEND priv_include_dir "libc-builtin-extended/private_include") 18 | endif() 19 | 20 | if(CONFIG_WAMR_EXTENDED_SOCKET) 21 | list(APPEND srcs "lib-socket/src/wasi/wasi_socket_ext.c") 22 | list(APPEND include_dirs "lib-socket/inc") 23 | endif() 24 | 25 | idf_component_register(SRCS ${srcs} 26 | INCLUDE_DIRS ${include_dirs} 27 | PRIV_INCLUDE_DIRS ${priv_include_dir} 28 | REQUIRES "data_sequence") 29 | 30 | target_link_libraries(${COMPONENT_LIB} INTERFACE "-Wl,--wrap=ioctl") 31 | -------------------------------------------------------------------------------- /components/wamr/app-framework/app-native-shared/README.md: -------------------------------------------------------------------------------- 1 | Notes: 2 | ======= 3 | This folder is for the source files shared by both WASM APP and native runtime 4 | 5 | - The c files in this directory are compiled into both the WASM APP and runtime. 6 | - The header files for distributing to SDK are placed in the "bi-inc" folder. 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /components/wamr/app-framework/base/app/bh_platform.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Intel Corporation. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 4 | */ 5 | 6 | #include "bh_platform.h" 7 | #include 8 | #include 9 | #include 10 | 11 | /* 12 | * 13 | * 14 | */ 15 | 16 | static bool 17 | is_little_endian() 18 | { 19 | long i = 0x01020304; 20 | unsigned char *c = (unsigned char *)&i; 21 | return (*c == 0x04) ? true : false; 22 | } 23 | 24 | static void 25 | swap32(uint8 *pData) 26 | { 27 | uint8 value = *pData; 28 | *pData = *(pData + 3); 29 | *(pData + 3) = value; 30 | 31 | value = *(pData + 1); 32 | *(pData + 1) = *(pData + 2); 33 | *(pData + 2) = value; 34 | } 35 | 36 | static void 37 | swap16(uint8 *pData) 38 | { 39 | uint8 value = *pData; 40 | *(pData) = *(pData + 1); 41 | *(pData + 1) = value; 42 | } 43 | 44 | uint32 45 | htonl(uint32 value) 46 | { 47 | uint32 ret; 48 | if (is_little_endian()) { 49 | ret = value; 50 | swap32((uint8 *)&ret); 51 | return ret; 52 | } 53 | 54 | return value; 55 | } 56 | 57 | uint32 58 | ntohl(uint32 value) 59 | { 60 | return htonl(value); 61 | } 62 | 63 | uint16 64 | htons(uint16 value) 65 | { 66 | uint16 ret; 67 | if (is_little_endian()) { 68 | ret = value; 69 | swap16((uint8 *)&ret); 70 | return ret; 71 | } 72 | 73 | return value; 74 | } 75 | 76 | uint16 77 | ntohs(uint16 value) 78 | { 79 | return htons(value); 80 | } 81 | 82 | char * 83 | wa_strdup(const char *s) 84 | { 85 | char *s1 = NULL; 86 | if (s && (s1 = WA_MALLOC(strlen(s) + 1))) 87 | memcpy(s1, s, strlen(s) + 1); 88 | return s1; 89 | } 90 | -------------------------------------------------------------------------------- /components/wamr/app-framework/base/app/req_resp_api.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Intel Corporation. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 4 | */ 5 | 6 | #ifndef _REQ_RESP_API_H_ 7 | #define _REQ_RESP_API_H_ 8 | 9 | #include "bh_platform.h" 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | bool 16 | wasm_response_send(const char *buf, int size); 17 | 18 | void 19 | wasm_register_resource(const char *url); 20 | 21 | void 22 | wasm_post_request(const char *buf, int size); 23 | 24 | void 25 | wasm_sub_event(const char *url); 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | 31 | #endif /* end of _REQ_RESP_API_H_ */ 32 | -------------------------------------------------------------------------------- /components/wamr/app-framework/base/app/timer.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Intel Corporation. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | #include "wa-inc/timer_wasm_app.h" 10 | #include "timer_api.h" 11 | 12 | #if 1 13 | #include 14 | #else 15 | #define printf (...) 16 | #endif 17 | 18 | struct user_timer { 19 | struct user_timer *next; 20 | int timer_id; 21 | void (*user_timer_callback)(user_timer_t); 22 | }; 23 | 24 | struct user_timer *g_timers = NULL; 25 | 26 | user_timer_t 27 | api_timer_create(int interval, bool is_period, bool auto_start, 28 | on_user_timer_update_f on_timer_update) 29 | { 30 | 31 | int timer_id = wasm_create_timer(interval, is_period, auto_start); 32 | 33 | // TODO 34 | struct user_timer *timer = 35 | (struct user_timer *)malloc(sizeof(struct user_timer)); 36 | if (timer == NULL) { 37 | // TODO: remove the timer_id 38 | printf("### api_timer_create malloc faild!!! \n"); 39 | return NULL; 40 | } 41 | 42 | memset(timer, 0, sizeof(*timer)); 43 | timer->timer_id = timer_id; 44 | timer->user_timer_callback = on_timer_update; 45 | 46 | if (g_timers == NULL) 47 | g_timers = timer; 48 | else { 49 | timer->next = g_timers; 50 | g_timers = timer; 51 | } 52 | 53 | return timer; 54 | } 55 | 56 | void 57 | api_timer_cancel(user_timer_t timer) 58 | { 59 | user_timer_t t = g_timers, prev = NULL; 60 | 61 | wasm_timer_cancel(timer->timer_id); 62 | 63 | while (t) { 64 | if (t == timer) { 65 | if (prev == NULL) { 66 | g_timers = t->next; 67 | free(t); 68 | } 69 | else { 70 | prev->next = t->next; 71 | free(t); 72 | } 73 | return; 74 | } 75 | else { 76 | prev = t; 77 | t = t->next; 78 | } 79 | } 80 | } 81 | 82 | void 83 | api_timer_restart(user_timer_t timer, int interval) 84 | { 85 | wasm_timer_restart(timer->timer_id, interval); 86 | } 87 | 88 | void 89 | on_timer_callback(int timer_id) 90 | { 91 | struct user_timer *t = g_timers; 92 | 93 | while (t) { 94 | if (t->timer_id == timer_id) { 95 | t->user_timer_callback(t); 96 | break; 97 | } 98 | t = t->next; 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /components/wamr/app-framework/base/app/timer_api.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Intel Corporation. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 4 | */ 5 | 6 | #ifndef _TIMER_API_H_ 7 | #define _TIMER_API_H_ 8 | 9 | #include "bh_platform.h" 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | typedef unsigned int timer_id_t; 16 | 17 | timer_id_t 18 | wasm_create_timer(int interval, bool is_period, bool auto_start); 19 | 20 | void 21 | wasm_timer_destroy(timer_id_t timer_id); 22 | 23 | void 24 | wasm_timer_cancel(timer_id_t timer_id); 25 | 26 | void 27 | wasm_timer_restart(timer_id_t timer_id, int interval); 28 | 29 | uint32 30 | wasm_get_sys_tick_ms(void); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | #endif /* end of _TIMER_API_H_ */ 37 | -------------------------------------------------------------------------------- /components/wamr/app-framework/include/bh_platform.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Intel Corporation. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 4 | */ 5 | 6 | #ifndef DEPS_IWASM_APP_LIBS_BASE_BH_PLATFORM_H_ 7 | #define DEPS_IWASM_APP_LIBS_BASE_BH_PLATFORM_H_ 8 | 9 | #include 10 | 11 | typedef unsigned char uint8; 12 | typedef char int8; 13 | typedef unsigned short uint16; 14 | typedef short int16; 15 | typedef unsigned int uint32; 16 | typedef int int32; 17 | 18 | #ifndef NULL 19 | #define NULL ((void *)0) 20 | #endif 21 | 22 | #ifndef __cplusplus 23 | #define true 1 24 | #define false 0 25 | #define inline __inline 26 | #endif 27 | 28 | // all wasm-app<->native shared source files should use WA_MALLOC/WA_FREE. 29 | // they will be mapped to different implementations in each side 30 | #ifndef WA_MALLOC 31 | #define WA_MALLOC malloc 32 | #endif 33 | 34 | #ifndef WA_FREE 35 | #define WA_FREE free 36 | #endif 37 | 38 | uint32 39 | htonl(uint32 value); 40 | uint32 41 | ntohl(uint32 value); 42 | uint16 43 | htons(uint16 value); 44 | uint16 45 | ntohs(uint16 value); 46 | 47 | // We are not worried for the WASM world since the sandbox will catch it. 48 | #define bh_memcpy_s(dst, dst_len, src, src_len) memcpy(dst, src, src_len) 49 | 50 | #ifdef NDEBUG 51 | #define bh_assert(v) (void)0 52 | #else 53 | #define bh_assert(v) \ 54 | do { \ 55 | if (!(v)) { \ 56 | int _count; \ 57 | printf("ASSERTION FAILED: %s, at %s, line %d", #v, __FILE__, \ 58 | __LINE__); \ 59 | _count = printf("\n"); \ 60 | printf("%d\n", _count / (_count - 1)); \ 61 | } \ 62 | } while (0) 63 | #endif 64 | 65 | #endif /* DEPS_IWASM_APP_LIBS_BASE_BH_PLATFORM_H_ */ 66 | -------------------------------------------------------------------------------- /components/wamr/app-framework/include/wa-inc/timer_wasm_app.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Intel Corporation. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 4 | */ 5 | 6 | #ifndef _AEE_TIMER_H_ 7 | #define _AEE_TIMER_H_ 8 | 9 | #include "bh_platform.h" 10 | 11 | #ifdef __cplusplus 12 | extern "C" { 13 | #endif 14 | 15 | /* board producer define user_timer */ 16 | struct user_timer; 17 | typedef struct user_timer *user_timer_t; 18 | 19 | /** 20 | * @typedef on_user_timer_update_f 21 | * 22 | * @brief Define the signature of callback function for API api_timer_create(). 23 | * 24 | * @param timer the timer 25 | * 26 | * @see api_timer_create 27 | */ 28 | typedef void (*on_user_timer_update_f)(user_timer_t timer); 29 | 30 | /* 31 | ***************** 32 | * Timer APIs 33 | ***************** 34 | */ 35 | 36 | /** 37 | * @brief Create timer. 38 | * 39 | * @param interval timer interval 40 | * @param is_period whether the timer is periodic 41 | * @param auto_start whether start the timer immediately after created 42 | * @param on_timer_update callback function called when timer expired 43 | * 44 | * @return the timer created if success, NULL otherwise 45 | */ 46 | user_timer_t 47 | api_timer_create(int interval, bool is_period, bool auto_start, 48 | on_user_timer_update_f on_timer_update); 49 | 50 | /** 51 | * @brief Cancel timer. 52 | * 53 | * @param timer the timer to cancel 54 | */ 55 | void 56 | api_timer_cancel(user_timer_t timer); 57 | 58 | /** 59 | * @brief Restart timer. 60 | * 61 | * @param timer the timer to cancel 62 | * @param interval the timer interval 63 | */ 64 | void 65 | api_timer_restart(user_timer_t timer, int interval); 66 | 67 | #ifdef __cplusplus 68 | } 69 | #endif 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /components/wamr/app-framework/include/wasm_app.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Intel Corporation. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 4 | */ 5 | 6 | #ifndef _LIB_AEE_H_ 7 | #define _LIB_AEE_H_ 8 | 9 | #include "bi-inc/shared_utils.h" 10 | #include "bi-inc/attr_container.h" 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | #ifdef __cplusplus 17 | } 18 | #endif 19 | 20 | #endif /* end of _LIB_AEE_H_ */ 21 | -------------------------------------------------------------------------------- /components/wamr/libc-builtin-extended/include/ioctl/esp_gpio_ioctl.h: -------------------------------------------------------------------------------- 1 | // Copyright 2022 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 | #pragma once 16 | 17 | #include 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | #define _GPIOCBASE (0x8100) /*!< GPIO ioctl command basic value */ 24 | #define _GPIOC(nr) (_GPIOCBASE | (nr)) /*!< GPIO ioctl command macro */ 25 | 26 | /** 27 | * @brief GPIO ioctl commands. 28 | */ 29 | #define GPIOCSCFG _GPIOC(0x0001) /*!< Set GPIO configuration */ 30 | 31 | /** 32 | * @brief GPIO configuration flag 33 | */ 34 | #define GPIOC_PULLDOWN_EN (1 << 0) /*!< Enable GPIO pin pull-up */ 35 | #define GPIOC_PULLUP_EN (1 << 1) /*!< Enable GPIO pin pull-down */ 36 | #define GPIOC_OPENDRAIN_EN (1 << 2) /*!< Enable GPIO pin open-drain */ 37 | 38 | /** 39 | * @brief GPIO configuration. 40 | */ 41 | typedef struct gpioc_cfg { 42 | union { 43 | struct { 44 | uint32_t pulldown_en : 1; /*!< Enable GPIO pin pull-up */ 45 | uint32_t pullup_en : 1; /*!< Enable GPIO pin pull-down */ 46 | uint32_t opendrain_en : 1; /*!< Enable GPIO pin open-drain */ 47 | } flags_data; 48 | uint32_t flags; /*!< GPIO configuration flags */ 49 | }; 50 | } gpioc_cfg_t; 51 | 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | -------------------------------------------------------------------------------- /components/wamr/libc-builtin-extended/include/ioctl/esp_ledc_ioctl.h: -------------------------------------------------------------------------------- 1 | // Copyright 2023 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 | #pragma once 16 | 17 | #include 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | #define _LEDCCBASE (0x8400) /*!< LEDC ioctl command basic value */ 24 | #define _LEDCC(nr) (_LEDCCBASE | (nr)) /*!< LEDC ioctl command macro */ 25 | 26 | #define LEDCIOCSCFG _LEDCC(1) /*!< Set LEDC configuration */ 27 | #define LEDCIOCSSETFREQ _LEDCC(2) /*!< Set LEDC frequency */ 28 | #define LEDCIOCSSETDUTY _LEDCC(3) /*!< Set LEDC duty of target channel */ 29 | #define LEDCIOCSSETPHASE _LEDCC(4) /*!< Set LEDC phase of target channel */ 30 | #define LEDCIOCSPAUSE _LEDCC(5) /*!< Set LEDC to pause */ 31 | #define LEDCIOCSRESUME _LEDCC(6) /*!< Set LEDC yo resume from pausing */ 32 | 33 | /** 34 | * @brief LEDC channel configuration. 35 | */ 36 | typedef struct ledc_channel_cfg { 37 | uint8_t output_pin; /*!< LEDC channel signal output pin */ 38 | uint32_t duty; /*!< LEDC channel signal duty */ 39 | uint32_t phase; /*!< LEDC channel signal phase */ 40 | } ledc_channel_cfg_t; 41 | 42 | /** 43 | * @brief LEDC configuration. 44 | */ 45 | typedef struct ledc_cfg { 46 | uint32_t frequency; /*!< LEDC Frequency */ 47 | uint8_t channel_num; /*!< LEDC channel number */ 48 | const ledc_channel_cfg_t *channel_cfg; /*!< LEDC channels configuration */ 49 | } ledc_cfg_t; 50 | 51 | typedef struct ledc_duty_cfg { 52 | uint8_t channel; 53 | uint32_t duty; 54 | } ledc_duty_cfg_t; 55 | 56 | typedef struct ledc_phase_cfg { 57 | uint8_t channel; 58 | uint32_t phase; 59 | } ledc_phase_cfg_t; 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | -------------------------------------------------------------------------------- /components/wamr/libc-wasi/include/pthread.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Intel Corporation. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 4 | */ 5 | 6 | #ifndef _WAMR_LIB_PTHREAD_H 7 | #define _WAMR_LIB_PTHREAD_H 8 | 9 | #include 10 | 11 | /* Data type define of pthread, mutex, cond and key */ 12 | typedef unsigned int pthread_t; 13 | typedef unsigned int pthread_mutex_t; 14 | typedef unsigned int pthread_cond_t; 15 | typedef unsigned int pthread_key_t; 16 | 17 | /* Thread APIs */ 18 | int pthread_create(pthread_t *thread, const void *attr, 19 | void *(*start_routine) (void *), void *arg); 20 | 21 | int pthread_join(pthread_t thread, void **retval); 22 | 23 | int pthread_detach(pthread_t thread); 24 | 25 | int pthread_cancel(pthread_t thread); 26 | 27 | pthread_t pthread_self(void); 28 | 29 | void pthread_exit(void *retval); 30 | 31 | /* Mutex APIs */ 32 | int pthread_mutex_init(pthread_mutex_t *mutex, const void *attr); 33 | 34 | int pthread_mutex_lock(pthread_mutex_t *mutex); 35 | 36 | int pthread_mutex_unlock(pthread_mutex_t *mutex); 37 | 38 | int pthread_mutex_destroy(pthread_mutex_t *mutex); 39 | 40 | /* Cond APIs */ 41 | int pthread_cond_init(pthread_cond_t *cond, const void *attr); 42 | 43 | int pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex); 44 | 45 | int pthread_cond_timedwait(pthread_cond_t *cond, pthread_mutex_t *mutex, 46 | uint64_t useconds); 47 | 48 | int pthread_cond_signal(pthread_cond_t *cond); 49 | 50 | int pthread_cond_destroy(pthread_cond_t *cond); 51 | 52 | /* Pthread key APIs */ 53 | int pthread_key_create(pthread_key_t *key, void (*destructor)(void *)); 54 | 55 | int pthread_setspecific(pthread_key_t key, const void *value); 56 | 57 | void *pthread_getspecific(pthread_key_t key); 58 | 59 | int pthread_key_delete(pthread_key_t key); 60 | 61 | #endif /* end of _WAMR_LIB_PTHREAD_H */ 62 | -------------------------------------------------------------------------------- /docs/_static/esp-wdf_block_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-wdf/d8ac107ca182cf447613f2e61eb49b205216ff77/docs/_static/esp-wdf_block_diagram.png -------------------------------------------------------------------------------- /examples/coremark/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 4 | 5 | project(coremark) -------------------------------------------------------------------------------- /examples/coremark/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(srcs 2 | "core_list_join.c" 3 | "core_main.c" 4 | "core_matrix.c" 5 | "core_portme.c" 6 | "core_state.c" 7 | "core_util.c" 8 | ) 9 | 10 | idf_component_register(SRCS ${srcs}) -------------------------------------------------------------------------------- /examples/coremark/main/core_portme_posix_overrides.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 Embedded Microprocessor Benchmark Consortium (EEMBC) 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | Original Author: Shay Gal-on 17 | */ 18 | 19 | /* Topic: Description 20 | This file contains additional configuration constants required to execute on 21 | different platforms over and above the POSIX defaults 22 | */ 23 | #ifndef CORE_PORTME_POSIX_OVERRIDES_H 24 | #define CORE_PORTME_POSIX_OVERRIDES_H 25 | 26 | /* None by default */ 27 | 28 | #define COMPILER_FLAGS "" 29 | #define FLAGS_STR "" 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /examples/coremark/sdkconfig.defaults: -------------------------------------------------------------------------------- 1 | CONFIG_COMPILER_WASI_NO_USE_STDLIB=n 2 | CONFIG_COMPILER_WASI_STACK_SIZE=16384 3 | -------------------------------------------------------------------------------- /examples/file_system/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 4 | 5 | project(file_system) -------------------------------------------------------------------------------- /examples/file_system/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(srcs 2 | "file_system_main.c" 3 | ) 4 | 5 | idf_component_register(SRCS ${srcs}) -------------------------------------------------------------------------------- /examples/gui/lv_demos/lv_demo_benchmark/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The following lines of boilerplate have to be in your project's 2 | # CMakeLists in this exact order for cmake to work correctly 3 | cmake_minimum_required(VERSION 3.5) 4 | 5 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 6 | 7 | add_compile_options(-fdiagnostics-color=always) 8 | 9 | project(lv_demo_benchmark) 10 | -------------------------------------------------------------------------------- /examples/gui/lv_demos/lv_demo_benchmark/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRC_DIRS "assets" "." 2 | INCLUDE_DIRS .) 3 | 4 | target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_USE_DEMO_BENCHMARK") 5 | -------------------------------------------------------------------------------- /examples/gui/lv_demos/lv_demo_benchmark/main/lv_demo_benchmark.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_demo_benchmark.h 3 | * 4 | */ 5 | 6 | #ifndef LV_DEMO_BENCHMARK_H 7 | #define LV_DEMO_BENCHMARK_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | /********************** 22 | * TYPEDEFS 23 | **********************/ 24 | 25 | /********************** 26 | * GLOBAL PROTOTYPES 27 | **********************/ 28 | void lv_demo_benchmark(void); 29 | 30 | /********************** 31 | * MACROS 32 | **********************/ 33 | 34 | #ifdef __cplusplus 35 | } /* extern "C" */ 36 | #endif 37 | 38 | #endif /*LV_DEMO_BENCHMARK_H*/ 39 | -------------------------------------------------------------------------------- /examples/gui/lv_demos/lv_demo_benchmark/main/lv_demo_benchmark_main.c: -------------------------------------------------------------------------------- 1 | // Copyright 2022 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 | #include 16 | #include 17 | #include "lv_demo_benchmark.h" 18 | #include "esp_lvgl.h" 19 | 20 | int main(void) 21 | { 22 | int ret; 23 | 24 | ret = lvgl_init(); 25 | if (ret != 0) { 26 | printf("faield to lvgl_init ret=%d\n", ret); 27 | return -1; 28 | } 29 | 30 | lvgl_lock(); 31 | lv_demo_benchmark(); 32 | lvgl_unlock(); 33 | 34 | while (1) { 35 | sleep(3600); 36 | } 37 | 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /examples/gui/lv_demos/lv_demo_benchmark/sdkconfig.defaults: -------------------------------------------------------------------------------- 1 | CONFIG_COMPILER_WASI_INITIAL_MEMORY=131072 2 | CONFIG_COMPILER_WASI_MAX_MEMORY=131072 3 | -------------------------------------------------------------------------------- /examples/gui/lv_demos/lv_demo_music/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The following lines of boilerplate have to be in your project's 2 | # CMakeLists in this exact order for cmake to work correctly 3 | cmake_minimum_required(VERSION 3.5) 4 | 5 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 6 | 7 | add_compile_options(-fdiagnostics-color=always) 8 | 9 | project(lv_demo_music) 10 | -------------------------------------------------------------------------------- /examples/gui/lv_demos/lv_demo_music/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRC_DIRS "assets" "." 2 | INCLUDE_DIRS ".") 3 | 4 | target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_USE_DEMO_MUSIC" 5 | "-DLV_DEMO_MUSIC_SQUARE=0" 6 | "-DLV_DEMO_MUSIC_LANDSCAPE=0" 7 | "-DLV_DEMO_MUSIC_ROUND=0" 8 | "-DLV_DEMO_MUSIC_LARGE=0" 9 | "-DLV_DEMO_MUSIC_AUTO_PLAY=0") 10 | -------------------------------------------------------------------------------- /examples/gui/lv_demos/lv_demo_music/main/lv_demo_music.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_demo_music.h 3 | * 4 | */ 5 | 6 | #ifndef LV_DEMO_MUSIC_H 7 | #define LV_DEMO_MUSIC_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "lvgl.h" 17 | 18 | #if LV_USE_DEMO_MUSIC 19 | 20 | /********************* 21 | * DEFINES 22 | *********************/ 23 | 24 | #if LV_DEMO_MUSIC_LARGE 25 | # define LV_DEMO_MUSIC_HANDLE_SIZE 40 26 | #else 27 | # define LV_DEMO_MUSIC_HANDLE_SIZE 20 28 | #endif 29 | 30 | /********************** 31 | * TYPEDEFS 32 | **********************/ 33 | 34 | /********************** 35 | * GLOBAL PROTOTYPES 36 | **********************/ 37 | 38 | void lv_demo_music(void); 39 | const char * _lv_demo_music_get_title(uint32_t track_id); 40 | const char * _lv_demo_music_get_artist(uint32_t track_id); 41 | const char * _lv_demo_music_get_genre(uint32_t track_id); 42 | uint32_t _lv_demo_music_get_track_length(uint32_t track_id); 43 | 44 | /********************** 45 | * MACROS 46 | **********************/ 47 | 48 | #endif /*LV_USE_DEMO_MUSIC*/ 49 | 50 | #ifdef __cplusplus 51 | } /* extern "C" */ 52 | #endif 53 | 54 | #endif /*LV_DEMO_MUSIC_H*/ 55 | -------------------------------------------------------------------------------- /examples/gui/lv_demos/lv_demo_music/main/lv_demo_music_list.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_demo_music_list.h 3 | * 4 | */ 5 | 6 | #ifndef LV_DEMO_MUSIC_LIST_H 7 | #define LV_DEMO_MUSIC_LIST_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "lv_demo_music.h" 17 | #if LV_USE_DEMO_MUSIC 18 | 19 | /********************* 20 | * DEFINES 21 | *********************/ 22 | 23 | /********************** 24 | * TYPEDEFS 25 | **********************/ 26 | 27 | /********************** 28 | * GLOBAL PROTOTYPES 29 | **********************/ 30 | lv_obj_t * _lv_demo_music_list_create(lv_obj_t * parent); 31 | void _lv_demo_music_list_btn_check(uint32_t track_id, bool state); 32 | 33 | /********************** 34 | * MACROS 35 | **********************/ 36 | 37 | #endif /*LV_USE_DEMO_MUSIC*/ 38 | 39 | #ifdef __cplusplus 40 | } /* extern "C" */ 41 | #endif 42 | 43 | #endif /*LV_DEMO_MUSIC_LIST_H*/ 44 | -------------------------------------------------------------------------------- /examples/gui/lv_demos/lv_demo_music/main/lv_demo_music_main.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_demo_music_main.h 3 | * 4 | */ 5 | 6 | #ifndef LV_DEMO_MUSIC_MAIN_H 7 | #define LV_DEMO_MUSIC_MAIN_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "lv_demo_music.h" 17 | #if LV_USE_DEMO_MUSIC 18 | 19 | /********************* 20 | * DEFINES 21 | *********************/ 22 | 23 | /********************** 24 | * TYPEDEFS 25 | **********************/ 26 | 27 | /********************** 28 | * GLOBAL PROTOTYPES 29 | **********************/ 30 | lv_obj_t * _lv_demo_music_main_create(lv_obj_t * parent); 31 | void _lv_demo_music_play(uint32_t id); 32 | void _lv_demo_music_resume(void); 33 | void _lv_demo_music_pause(void); 34 | void _lv_demo_music_album_next(bool next); 35 | 36 | /********************** 37 | * MACROS 38 | **********************/ 39 | #endif /*LV_USE_DEMO_MUSIC*/ 40 | 41 | 42 | #ifdef __cplusplus 43 | } /* extern "C" */ 44 | #endif 45 | 46 | #endif /*LV_DEMO_MUSIC_MAIN_H*/ 47 | -------------------------------------------------------------------------------- /examples/gui/lv_demos/lv_demo_music/main/lv_demo_music_run_main.c: -------------------------------------------------------------------------------- 1 | // Copyright 2022 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 | #include 16 | #include 17 | #include "lv_demo_music.h" 18 | #include "esp_lvgl.h" 19 | 20 | int main(void) 21 | { 22 | int ret; 23 | 24 | ret = lvgl_init(); 25 | if (ret != 0) { 26 | printf("faield to lvgl_init ret=%d\n", ret); 27 | return -1; 28 | } 29 | 30 | lvgl_lock(); 31 | lv_demo_music(); 32 | lvgl_unlock(); 33 | 34 | while (1) { 35 | sleep(3600); 36 | } 37 | 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /examples/gui/lv_demos/lv_demo_music/sdkconfig.defaults: -------------------------------------------------------------------------------- 1 | CONFIG_COMPILER_WASI_INITIAL_MEMORY=393216 2 | CONFIG_COMPILER_WASI_MAX_MEMORY=393216 3 | -------------------------------------------------------------------------------- /examples/gui/lv_demos/lv_demo_stress/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The following lines of boilerplate have to be in your project's 2 | # CMakeLists in this exact order for cmake to work correctly 3 | cmake_minimum_required(VERSION 3.5) 4 | 5 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 6 | 7 | add_compile_options(-fdiagnostics-color=always) 8 | 9 | project(lv_demo_stress) 10 | -------------------------------------------------------------------------------- /examples/gui/lv_demos/lv_demo_stress/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRC_DIRS "assets" "." 2 | INCLUDE_DIRS .) 3 | 4 | target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_USE_DEMO_STRESS") 5 | -------------------------------------------------------------------------------- /examples/gui/lv_demos/lv_demo_stress/main/lv_demo_stress.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_demo_stress.h 3 | * 4 | */ 5 | 6 | #ifndef LV_DEMO_STRESS_H 7 | #define LV_DEMO_STRESS_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | /********************** 22 | * TYPEDEFS 23 | **********************/ 24 | 25 | /********************** 26 | * GLOBAL PROTOTYPES 27 | **********************/ 28 | void lv_demo_stress(void); 29 | 30 | /********************** 31 | * MACROS 32 | **********************/ 33 | 34 | #ifdef __cplusplus 35 | } /* extern "C" */ 36 | #endif 37 | 38 | #endif /*LV_DEMO_STRESS_H*/ 39 | -------------------------------------------------------------------------------- /examples/gui/lv_demos/lv_demo_stress/main/lv_demo_stress_main.c: -------------------------------------------------------------------------------- 1 | // Copyright 2022 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 | #include 16 | #include 17 | #include "lv_demo_stress.h" 18 | #include "esp_lvgl.h" 19 | 20 | int main(void) 21 | { 22 | int ret; 23 | 24 | ret = lvgl_init(); 25 | if (ret != 0) { 26 | printf("faield to lvgl_init ret=%d\n", ret); 27 | return -1; 28 | } 29 | 30 | lvgl_lock(); 31 | lv_demo_stress(); 32 | lvgl_unlock(); 33 | 34 | while (1) { 35 | sleep(3600); 36 | } 37 | 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /examples/gui/lv_demos/lv_demo_widgets/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The following lines of boilerplate have to be in your project's 2 | # CMakeLists in this exact order for cmake to work correctly 3 | cmake_minimum_required(VERSION 3.5) 4 | 5 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 6 | 7 | add_compile_options(-fdiagnostics-color=always) 8 | 9 | project(lv_demo_widgets) 10 | -------------------------------------------------------------------------------- /examples/gui/lv_demos/lv_demo_widgets/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRC_DIRS "assets" "." 2 | INCLUDE_DIRS .) 3 | 4 | target_compile_definitions(${COMPONENT_LIB} PUBLIC "-DLV_USE_DEMO_WIDGETS") 5 | -------------------------------------------------------------------------------- /examples/gui/lv_demos/lv_demo_widgets/main/lv_demo_widgets.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_demo_widgets.h 3 | * 4 | */ 5 | 6 | #ifndef LV_DEMO_WIDGETS_H 7 | #define LV_DEMO_WIDGETS_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | /********************** 22 | * TYPEDEFS 23 | **********************/ 24 | 25 | /********************** 26 | * GLOBAL PROTOTYPES 27 | **********************/ 28 | void lv_demo_widgets(void); 29 | 30 | /********************** 31 | * MACROS 32 | **********************/ 33 | 34 | #ifdef __cplusplus 35 | } /* extern "C" */ 36 | #endif 37 | 38 | #endif /*LV_DEMO_WIDGETS_H*/ 39 | -------------------------------------------------------------------------------- /examples/gui/lv_demos/lv_demo_widgets/main/lv_demo_widgets_main.c: -------------------------------------------------------------------------------- 1 | // Copyright 2022 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 | #include 16 | #include 17 | #include "lv_demo_widgets.h" 18 | #include "esp_lvgl.h" 19 | 20 | int main(void) 21 | { 22 | int ret; 23 | 24 | ret = lvgl_init(); 25 | if (ret != 0) { 26 | printf("faield to lvgl_init ret=%d\n", ret); 27 | return -1; 28 | } 29 | 30 | lvgl_lock(); 31 | lv_demo_widgets(); 32 | lvgl_unlock(); 33 | 34 | while (1) { 35 | sleep(3600); 36 | } 37 | 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /examples/gui/lv_demos/lv_demo_widgets/sdkconfig.defaults: -------------------------------------------------------------------------------- 1 | CONFIG_COMPILER_WASI_INITIAL_MEMORY=131072 2 | CONFIG_COMPILER_WASI_MAX_MEMORY=131072 3 | -------------------------------------------------------------------------------- /examples/hello_world/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 4 | 5 | project(hello_world) -------------------------------------------------------------------------------- /examples/hello_world/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(srcs 2 | "hello_world.c" 3 | ) 4 | 5 | idf_component_register(SRCS ${srcs}) -------------------------------------------------------------------------------- /examples/hello_world/main/hello_world.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(void) 4 | { 5 | printf("Hello World!\n"); 6 | 7 | return 0; 8 | } -------------------------------------------------------------------------------- /examples/multi_thread/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 4 | 5 | project(multi_thread) -------------------------------------------------------------------------------- /examples/multi_thread/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRCS multi_thread.c) -------------------------------------------------------------------------------- /examples/multi_thread/main/multi_thread.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Intel Corporation. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 4 | */ 5 | 6 | #include 7 | #include 8 | 9 | static pthread_mutex_t mutex; 10 | static pthread_cond_t cond; 11 | 12 | static void * 13 | thread(void *arg) 14 | { 15 | int *num = (int *)arg; 16 | 17 | pthread_mutex_lock(&mutex); 18 | printf("thread start \n"); 19 | 20 | for (int i = 0; i < 10; i++) { 21 | *num = *num + 1; 22 | printf("num: %d\n", *num); 23 | } 24 | 25 | pthread_cond_signal(&cond); 26 | pthread_mutex_unlock(&mutex); 27 | 28 | printf("thread exit \n"); 29 | 30 | return NULL; 31 | } 32 | 33 | int 34 | main(int argc, char *argv[]) 35 | { 36 | pthread_t tid; 37 | int num = 0, ret = -1; 38 | 39 | if (pthread_mutex_init(&mutex, NULL) != 0) { 40 | printf("Failed to init mutex.\n"); 41 | return -1; 42 | } 43 | if (pthread_cond_init(&cond, NULL) != 0) { 44 | printf("Failed to init cond.\n"); 45 | goto fail1; 46 | } 47 | 48 | pthread_mutex_lock(&mutex); 49 | if (pthread_create(&tid, NULL, thread, &num) != 0) { 50 | printf("Failed to create thread.\n"); 51 | goto fail2; 52 | } 53 | 54 | printf("cond wait start\n"); 55 | pthread_cond_wait(&cond, &mutex); 56 | pthread_mutex_unlock(&mutex); 57 | printf("cond wait success.\n"); 58 | 59 | if (pthread_join(tid, NULL) != 0) { 60 | printf("Failed to join thread.\n"); 61 | } 62 | 63 | ret = 0; 64 | 65 | fail2: 66 | pthread_cond_destroy(&cond); 67 | fail1: 68 | pthread_mutex_destroy(&mutex); 69 | 70 | return ret; 71 | } -------------------------------------------------------------------------------- /examples/multi_thread/sdkconfig.defaults: -------------------------------------------------------------------------------- 1 | CONFIG_COMPILER_WASI_USE_SHARED_MEMORY=y -------------------------------------------------------------------------------- /examples/peripherals/gpio/gpio_simple/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 4 | 5 | project(gpio_simple) -------------------------------------------------------------------------------- /examples/peripherals/gpio/gpio_simple/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(srcs 2 | "gpio_simple_main.c" 3 | ) 4 | 5 | idf_component_register(SRCS ${srcs}) -------------------------------------------------------------------------------- /examples/peripherals/gpio/gpio_simple/main/Kconfig.projbuild: -------------------------------------------------------------------------------- 1 | menu "Example Configuration" 2 | 3 | config GPIO_SIMPLE_GPIO_PIN_NUM 4 | int "GPIO Pin Number" 5 | default 9 6 | 7 | endmenu 8 | -------------------------------------------------------------------------------- /examples/peripherals/i2c/i2c_bh1750/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 4 | 5 | project(i2c_bh1750) -------------------------------------------------------------------------------- /examples/peripherals/i2c/i2c_bh1750/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(srcs 2 | "i2c_bh1750_main.c" 3 | ) 4 | 5 | idf_component_register(SRCS ${srcs}) -------------------------------------------------------------------------------- /examples/peripherals/i2c/i2c_tt21100/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 4 | 5 | project(i2c_tt21100) -------------------------------------------------------------------------------- /examples/peripherals/i2c/i2c_tt21100/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(srcs 2 | "i2c_tt21100_main.c" 3 | ) 4 | 5 | idf_component_register(SRCS ${srcs}) -------------------------------------------------------------------------------- /examples/peripherals/i2c/i2c_tt21100/main/Kconfig.projbuild: -------------------------------------------------------------------------------- 1 | menu "Example Configuration" 2 | 3 | config I2C_SDA_PIN_NUM 4 | int "I2C SDA Pin Number" 5 | default 8 6 | 7 | config I2C_SCL_PIN_NUM 8 | int "I2C SCL Pin Number" 9 | default 18 10 | 11 | config TT21100_READY_PIN_NUM 12 | int "TT21100 Ready Pin Number" 13 | default 3 14 | 15 | config I2C_TEST_COUNT 16 | int "I2C Testing Count of Reading Sensor's Data" 17 | default 100 18 | 19 | config I2C_SDA_SCL_PIN_PULLUP 20 | bool "Set I2C SDA & SCL Pin Pull-Up" 21 | default n 22 | endmenu 23 | -------------------------------------------------------------------------------- /examples/peripherals/ledc/ledc_simple/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 4 | 5 | project(ledc_simple) -------------------------------------------------------------------------------- /examples/peripherals/ledc/ledc_simple/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(srcs 2 | "ledc_simple_main.c" 3 | ) 4 | 5 | idf_component_register(SRCS ${srcs}) -------------------------------------------------------------------------------- /examples/peripherals/ledc/ledc_simple/main/Kconfig.projbuild: -------------------------------------------------------------------------------- 1 | menu "Example Configuration" 2 | 3 | choice LEDC_DEVICE 4 | prompt "Select LEDC Device" 5 | default LEDC_DEVICE_LEDC0 6 | help 7 | Select LEDC Device for exmaple. 8 | please note that not all developemnt boards support all following 9 | devices. 10 | 11 | config LEDC_DEVICE_LEDC0 12 | bool "LEDC0" 13 | config LEDC_DEVICE_LEDC1 14 | bool "LEDC1" 15 | config LEDC_DEVICE_LEDC2 16 | bool "LEDC2" 17 | endchoice 18 | 19 | config LEDC_FREQUENCY 20 | int "LEDC Frequency(Hz)" 21 | default 1000 22 | 23 | config LEDC_CHANNEL_OUPUT_PIN 24 | int "LEDC Output Pin" 25 | default 4 26 | endmenu 27 | -------------------------------------------------------------------------------- /examples/peripherals/spi/spi_master_simple/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 4 | 5 | project(spi_master_simple) -------------------------------------------------------------------------------- /examples/peripherals/spi/spi_master_simple/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(srcs 2 | "spi_master_simple_main.c" 3 | ) 4 | 5 | idf_component_register(SRCS ${srcs}) -------------------------------------------------------------------------------- /examples/peripherals/spi/spi_master_simple/main/Kconfig.projbuild: -------------------------------------------------------------------------------- 1 | menu "Example Configuration" 2 | 3 | choice SPI_DEVICE 4 | prompt "Select SPI Device" 5 | default SPI_DEVICE_SPI2 6 | help 7 | Select SPI Device for exmaple. 8 | please note that not all developemnt boards support all following 9 | devices. 10 | 11 | config SPI_DEVICE_SPI2 12 | bool "SPI2" 13 | 14 | config SPI_DEVICE_SPI3 15 | bool "SPI3" 16 | endchoice 17 | 18 | config SPI_CS_PIN_NUM 19 | int "SPI CS Pin Number" 20 | default 10 21 | 22 | config SPI_SCLK_PIN_NUM 23 | int "SPI SCLK Pin Number" 24 | default 12 25 | 26 | config SPI_MOSI_PIN_NUM 27 | int "SPI MOSI Pin Number" 28 | default 11 29 | 30 | config SPI_MISO_PIN_NUM 31 | int "SPI MISO Pin Number" 32 | default 13 33 | endmenu 34 | -------------------------------------------------------------------------------- /examples/peripherals/spi/spi_slave_simple/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 4 | 5 | project(spi_slave_simple) -------------------------------------------------------------------------------- /examples/peripherals/spi/spi_slave_simple/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(srcs 2 | "spi_slave_simple_main.c" 3 | ) 4 | 5 | idf_component_register(SRCS ${srcs}) -------------------------------------------------------------------------------- /examples/peripherals/spi/spi_slave_simple/main/Kconfig.projbuild: -------------------------------------------------------------------------------- 1 | menu "Example Configuration" 2 | 3 | choice SPI_DEVICE 4 | prompt "Select SPI Device" 5 | default SPI_DEVICE_SPI2 6 | help 7 | Select SPI Device for exmaple. 8 | please note that not all developemnt boards support all following 9 | devices. 10 | 11 | config SPI_DEVICE_SPI2 12 | bool "SPI2" 13 | 14 | config SPI_DEVICE_SPI3 15 | bool "SPI3" 16 | endchoice 17 | 18 | config SPI_CS_PIN_NUM 19 | int "SPI CS Pin Number" 20 | default 10 21 | 22 | config SPI_SCLK_PIN_NUM 23 | int "SPI SCLK Pin Number" 24 | default 12 25 | 26 | config SPI_MOSI_PIN_NUM 27 | int "SPI MOSI Pin Number" 28 | default 11 29 | 30 | config SPI_MISO_PIN_NUM 31 | int "SPI MISO Pin Number" 32 | default 13 33 | endmenu 34 | -------------------------------------------------------------------------------- /examples/peripherals/uart/uart_simple/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 4 | 5 | project(uart_simple) -------------------------------------------------------------------------------- /examples/peripherals/uart/uart_simple/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(srcs 2 | "uart_simple_main.c" 3 | ) 4 | 5 | idf_component_register(SRCS ${srcs}) -------------------------------------------------------------------------------- /examples/peripherals/uart/uart_simple/main/Kconfig.projbuild: -------------------------------------------------------------------------------- 1 | menu "Example Configuration" 2 | 3 | choice UART_DEVICE 4 | prompt "Select UART Device" 5 | default UART_DEVICE_USB_SERIAL_JTAG_CONTROLLER 6 | help 7 | Select UART Device for exmaple. 8 | please note that not all developemnt boards support all following 9 | devices, and even the boards support following devices, users 10 | should also initialize target VFS drivers in "Wasmachine". 11 | 12 | config UART_DEVICE_UART0 13 | bool "UART0" 14 | 15 | config UART_DEVICE_USB_SERIAL_JTAG_CONTROLLER 16 | bool "USB Serial/JTAG Controller" 17 | endchoice 18 | 19 | endmenu 20 | -------------------------------------------------------------------------------- /examples/peripherals/uart/uart_simple/main/uart_simple_main.c: -------------------------------------------------------------------------------- 1 | // Copyright 2022 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 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | #include "sdkconfig.h" 21 | 22 | #ifdef CONFIG_UART_DEVICE_UART0 23 | #define UART_DEVICE "/dev/uart/0" 24 | #elif defined(CONFIG_UART_DEVICE_USB_SERIAL_JTAG_CONTROLLER) 25 | #define UART_DEVICE "/dev/usbserjtag" 26 | #endif 27 | 28 | void on_init(void) 29 | { 30 | int fd; 31 | int ret; 32 | const char device[] = UART_DEVICE; 33 | const char text[] = "Hello World!\n"; 34 | int text_size = sizeof(text); 35 | 36 | printf("Opening device %s for writing", device); 37 | fd = open(device, O_RDWR); 38 | if (fd < 0) { 39 | printf(" failed, errno=%d.\n", errno); 40 | return; 41 | } else { 42 | printf(" OK, fd=%d.\n", fd); 43 | } 44 | 45 | printf("Write text total %d bytes into device", text_size); 46 | ret = write(fd, text, text_size); 47 | if (ret < 0) { 48 | printf(" failed errno=%d.\n", errno); 49 | close(fd); 50 | return; 51 | } else { 52 | printf(" OK.\n"); 53 | } 54 | 55 | printf("Close device"); 56 | ret = close(fd); 57 | if (ret < 0) { 58 | printf(" failed errno=%d.\n", errno); 59 | return; 60 | } else { 61 | printf(" OK.\n"); 62 | } 63 | } 64 | 65 | int main(int argc, char *argv[]) 66 | { 67 | on_init(); 68 | 69 | return 0; 70 | } 71 | -------------------------------------------------------------------------------- /examples/protocols/esp_http_client/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 4 | 5 | project(esp_http_client) 6 | 7 | target_add_binary_data(esp_http_client.wasm "main/howsmyssl_com_root_cert.pem" TEXT) 8 | target_add_binary_data(esp_http_client.wasm "main/postman_root_cert.pem" TEXT) -------------------------------------------------------------------------------- /examples/protocols/esp_http_client/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRCS esp_http_client_example.c) -------------------------------------------------------------------------------- /examples/protocols/esp_http_client/main/Kconfig.projbuild: -------------------------------------------------------------------------------- 1 | menu "Example Configuration" 2 | 3 | config ESP_HTTP_CLIENT_ENABLE_BASIC_AUTH 4 | bool "Enable HTTP Basic Authentication" 5 | default n 6 | help 7 | This option will enable HTTP Basic Authentication. It is disabled by default as Basic 8 | auth uses unencrypted encoding, so it introduces a vulnerability when not using TLS 9 | 10 | config ESP_HTTP_CLIENT_ENABLE_DIGEST_AUTH 11 | bool "Enable HTTP Digest Authentication" 12 | default y 13 | help 14 | This option will enable HTTP Digest Authentication. It is enabled by default, but use of this 15 | configuration is not recommended as the password can be derived from the exchange, so it introduces 16 | a vulnerability when not using TLS 17 | 18 | endmenu 19 | -------------------------------------------------------------------------------- /examples/protocols/esp_http_client/main/howsmyssl_com_root_cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAw 3 | TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh 4 | cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMTUwNjA0MTEwNDM4 5 | WhcNMzUwNjA0MTEwNDM4WjBPMQswCQYDVQQGEwJVUzEpMCcGA1UEChMgSW50ZXJu 6 | ZXQgU2VjdXJpdHkgUmVzZWFyY2ggR3JvdXAxFTATBgNVBAMTDElTUkcgUm9vdCBY 7 | MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK3oJHP0FDfzm54rVygc 8 | h77ct984kIxuPOZXoHj3dcKi/vVqbvYATyjb3miGbESTtrFj/RQSa78f0uoxmyF+ 9 | 0TM8ukj13Xnfs7j/EvEhmkvBioZxaUpmZmyPfjxwv60pIgbz5MDmgK7iS4+3mX6U 10 | A5/TR5d8mUgjU+g4rk8Kb4Mu0UlXjIB0ttov0DiNewNwIRt18jA8+o+u3dpjq+sW 11 | T8KOEUt+zwvo/7V3LvSye0rgTBIlDHCNAymg4VMk7BPZ7hm/ELNKjD+Jo2FR3qyH 12 | B5T0Y3HsLuJvW5iB4YlcNHlsdu87kGJ55tukmi8mxdAQ4Q7e2RCOFvu396j3x+UC 13 | B5iPNgiV5+I3lg02dZ77DnKxHZu8A/lJBdiB3QW0KtZB6awBdpUKD9jf1b0SHzUv 14 | KBds0pjBqAlkd25HN7rOrFleaJ1/ctaJxQZBKT5ZPt0m9STJEadao0xAH0ahmbWn 15 | OlFuhjuefXKnEgV4We0+UXgVCwOPjdAvBbI+e0ocS3MFEvzG6uBQE3xDk3SzynTn 16 | jh8BCNAw1FtxNrQHusEwMFxIt4I7mKZ9YIqioymCzLq9gwQbooMDQaHWBfEbwrbw 17 | qHyGO0aoSCqI3Haadr8faqU9GY/rOPNk3sgrDQoo//fb4hVC1CLQJ13hef4Y53CI 18 | rU7m2Ys6xt0nUW7/vGT1M0NPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV 19 | HRMBAf8EBTADAQH/MB0GA1UdDgQWBBR5tFnme7bl5AFzgAiIyBpY9umbbjANBgkq 20 | hkiG9w0BAQsFAAOCAgEAVR9YqbyyqFDQDLHYGmkgJykIrGF1XIpu+ILlaS/V9lZL 21 | ubhzEFnTIZd+50xx+7LSYK05qAvqFyFWhfFQDlnrzuBZ6brJFe+GnY+EgPbk6ZGQ 22 | 3BebYhtF8GaV0nxvwuo77x/Py9auJ/GpsMiu/X1+mvoiBOv/2X/qkSsisRcOj/KK 23 | NFtY2PwByVS5uCbMiogziUwthDyC3+6WVwW6LLv3xLfHTjuCvjHIInNzktHCgKQ5 24 | ORAzI4JMPJ+GslWYHb4phowim57iaztXOoJwTdwJx4nLCgdNbOhdjsnvzqvHu7Ur 25 | TkXWStAmzOVyyghqpZXjFaH3pO3JLF+l+/+sKAIuvtd7u+Nxe5AW0wdeRlN8NwdC 26 | jNPElpzVmbUq4JUagEiuTDkHzsxHpFKVK7q4+63SM1N95R1NbdWhscdCb+ZAJzVc 27 | oyi3B43njTOQ5yOf+1CceWxG1bQVs5ZufpsMljq4Ui0/1lvh+wjChP4kqKOJ2qxq 28 | 4RgqsahDYVvTH9w7jXbyLeiNdd8XM2w9U/t7y0Ff/9yi0GE44Za4rF2LN9d11TPA 29 | mRGunUHBcnWEvgJBQl9nJEiU0Zsnvgc/ubhPgXRR4Xq37Z0j4r7g1SgEEzwxA57d 30 | emyPxgcYxn/eR44/KJ4EBs+lVDR3veyJm+kXQ99b21/+jh5Xos1AnX5iItreGCc= 31 | -----END CERTIFICATE----- 32 | -------------------------------------------------------------------------------- /examples/protocols/esp_http_client/main/postman_root_cert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF 3 | ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6 4 | b24gUm9vdCBDQSAxMB4XDTE1MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTEL 5 | MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv 6 | b3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ4gHHKeNXj 7 | ca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgHFzZM 8 | 9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qw 9 | IFAGbHrQgLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6 10 | VOujw5H5SNz/0egwLX0tdHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L 11 | 93FcXmn/6pUCyziKrlA4b9v7LWIbxcceVOF34GfID5yHI9Y/QCB/IIDEgEw+OyQm 12 | jgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC 13 | AYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3DQEBCwUA 14 | A4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDI 15 | U5PMCCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUs 16 | N+gDS63pYaACbvXy8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vv 17 | o/ufQJVtMVT8QtPHRh8jrdkPSHCa2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU 18 | 5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy 19 | rqXRfboQnoZsG4q5WTP468SQvvG5 20 | -----END CERTIFICATE----- 21 | -------------------------------------------------------------------------------- /examples/protocols/esp_http_client/sdkconfig.defaults: -------------------------------------------------------------------------------- 1 | CONFIG_WAMR_APP_FRAMEWORK=y -------------------------------------------------------------------------------- /examples/protocols/mqtt/generic/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 4 | 5 | project(mqtt_generic) 6 | 7 | target_add_binary_data(mqtt_generic.wasm "main/mqtt_eclipseprojects_io.pem" TEXT) -------------------------------------------------------------------------------- /examples/protocols/mqtt/generic/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRCS app_main.c) -------------------------------------------------------------------------------- /examples/protocols/mqtt/generic/main/Kconfig.projbuild: -------------------------------------------------------------------------------- 1 | menu "Example Configuration" 2 | 3 | choice BROKER_URI 4 | prompt "Broker URL" 5 | default TCP_BROKER_URI 6 | help 7 | URL of an mqtt broker which this example connects to. 8 | 9 | config SSL_BROKER_URI 10 | bool "SSL" 11 | config TCP_BROKER_URI 12 | bool "TCP" 13 | config WS_BROKER_URI 14 | bool "WS" 15 | config WSS_BROKER_URI 16 | bool "WSS" 17 | endchoice 18 | 19 | config BROKER_URI 20 | string 21 | default "mqtts://mqtt.eclipseprojects.io:8883" if SSL_BROKER_URI 22 | default "mqtt://mqtt.eclipseprojects.io" if TCP_BROKER_URI 23 | default "ws://mqtt.eclipseprojects.io:80/mqtt" if WS_BROKER_URI 24 | default "wss://mqtt.eclipseprojects.io:443/mqtt" if WSS_BROKER_URI 25 | 26 | config BROKER_CERTIFICATE_OVERRIDE 27 | string "Broker certificate override" 28 | default "" 29 | help 30 | Please leave empty if broker certificate included from a textfile; otherwise fill in a base64 part of PEM 31 | format certificate 32 | 33 | config BROKER_CERTIFICATE_OVERRIDDEN 34 | bool 35 | default y if BROKER_CERTIFICATE_OVERRIDE != "" 36 | 37 | endmenu 38 | -------------------------------------------------------------------------------- /examples/protocols/mqtt/generic/main/mqtt_eclipseprojects_io.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIFFjCCAv6gAwIBAgIRAJErCErPDBinU/bWLiWnX1owDQYJKoZIhvcNAQELBQAw 3 | TzELMAkGA1UEBhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2Vh 4 | cmNoIEdyb3VwMRUwEwYDVQQDEwxJU1JHIFJvb3QgWDEwHhcNMjAwOTA0MDAwMDAw 5 | WhcNMjUwOTE1MTYwMDAwWjAyMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNTGV0J3Mg 6 | RW5jcnlwdDELMAkGA1UEAxMCUjMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK 7 | AoIBAQC7AhUozPaglNMPEuyNVZLD+ILxmaZ6QoinXSaqtSu5xUyxr45r+XXIo9cP 8 | R5QUVTVXjJ6oojkZ9YI8QqlObvU7wy7bjcCwXPNZOOftz2nwWgsbvsCUJCWH+jdx 9 | sxPnHKzhm+/b5DtFUkWWqcFTzjTIUu61ru2P3mBw4qVUq7ZtDpelQDRrK9O8Zutm 10 | NHz6a4uPVymZ+DAXXbpyb/uBxa3Shlg9F8fnCbvxK/eG3MHacV3URuPMrSXBiLxg 11 | Z3Vms/EY96Jc5lP/Ooi2R6X/ExjqmAl3P51T+c8B5fWmcBcUr2Ok/5mzk53cU6cG 12 | /kiFHaFpriV1uxPMUgP17VGhi9sVAgMBAAGjggEIMIIBBDAOBgNVHQ8BAf8EBAMC 13 | AYYwHQYDVR0lBBYwFAYIKwYBBQUHAwIGCCsGAQUFBwMBMBIGA1UdEwEB/wQIMAYB 14 | Af8CAQAwHQYDVR0OBBYEFBQusxe3WFbLrlAJQOYfr52LFMLGMB8GA1UdIwQYMBaA 15 | FHm0WeZ7tuXkAXOACIjIGlj26ZtuMDIGCCsGAQUFBwEBBCYwJDAiBggrBgEFBQcw 16 | AoYWaHR0cDovL3gxLmkubGVuY3Iub3JnLzAnBgNVHR8EIDAeMBygGqAYhhZodHRw 17 | Oi8veDEuYy5sZW5jci5vcmcvMCIGA1UdIAQbMBkwCAYGZ4EMAQIBMA0GCysGAQQB 18 | gt8TAQEBMA0GCSqGSIb3DQEBCwUAA4ICAQCFyk5HPqP3hUSFvNVneLKYY611TR6W 19 | PTNlclQtgaDqw+34IL9fzLdwALduO/ZelN7kIJ+m74uyA+eitRY8kc607TkC53wl 20 | ikfmZW4/RvTZ8M6UK+5UzhK8jCdLuMGYL6KvzXGRSgi3yLgjewQtCPkIVz6D2QQz 21 | CkcheAmCJ8MqyJu5zlzyZMjAvnnAT45tRAxekrsu94sQ4egdRCnbWSDtY7kh+BIm 22 | lJNXoB1lBMEKIq4QDUOXoRgffuDghje1WrG9ML+Hbisq/yFOGwXD9RiX8F6sw6W4 23 | avAuvDszue5L3sz85K+EC4Y/wFVDNvZo4TYXao6Z0f+lQKc0t8DQYzk1OXVu8rp2 24 | yJMC6alLbBfODALZvYH7n7do1AZls4I9d1P4jnkDrQoxB3UqQ9hVl3LEKQ73xF1O 25 | yK5GhDDX8oVfGKF5u+decIsH4YaTw7mP3GFxJSqv3+0lUFJoi5Lc5da149p90Ids 26 | hCExroL1+7mryIkXPeFM5TgO9r0rvZaBFOvV2z0gp35Z0+L4WPlbuEjN/lxPFin+ 27 | HlUjr8gRsI3qfJOQFy/9rKIJR0Y/8Omwt/8oTWgy1mdeHmmjk7j1nYsvC9JSQ6Zv 28 | MldlTTKB3zhThV1+XWYp6rjd5JW1zbVWEkLNxE7GJThEUG3szgBVGP7pSWTUTsqX 29 | nLRbwHOoq7hHwg== 30 | -----END CERTIFICATE----- 31 | -------------------------------------------------------------------------------- /examples/protocols/mqtt/generic/sdkconfig.defaults: -------------------------------------------------------------------------------- 1 | CONFIG_WAMR_APP_FRAMEWORK=y -------------------------------------------------------------------------------- /examples/protocols/sockets/socket-api/send_recv/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 4 | 5 | project(send_recv) -------------------------------------------------------------------------------- /examples/protocols/sockets/socket-api/send_recv/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRCS send_recv.c) -------------------------------------------------------------------------------- /examples/protocols/sockets/socket-api/send_recv/sdkconfig.defaults: -------------------------------------------------------------------------------- 1 | CONFIG_WAMR_APP_FRAMEWORK=y 2 | CONFIG_COMPILER_WASI_NO_USE_STDLIB=n 3 | CONFIG_COMPILER_WASI_USE_SHARED_MEMORY=y -------------------------------------------------------------------------------- /examples/protocols/sockets/socket-api/tcp_client/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 4 | 5 | project(tcp_client) -------------------------------------------------------------------------------- /examples/protocols/sockets/socket-api/tcp_client/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRCS tcp_client.c 2 | INCLUDE_DIRS .) -------------------------------------------------------------------------------- /examples/protocols/sockets/socket-api/tcp_client/main/socket_utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022 Amazon.com Inc. or its affiliates. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 4 | */ 5 | 6 | #ifndef TCP_UTILS_H 7 | #define TCP_UTILS_H 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | int 14 | sockaddr_to_string(struct sockaddr *addr, char *str, size_t len) 15 | { 16 | uint16_t port; 17 | char ip_string[64]; 18 | void *addr_buf; 19 | int ret; 20 | 21 | switch (addr->sa_family) { 22 | case AF_INET: 23 | { 24 | struct sockaddr_in *addr_in = (struct sockaddr_in *)addr; 25 | port = addr_in->sin_port; 26 | addr_buf = &addr_in->sin_addr; 27 | break; 28 | } 29 | case AF_INET6: 30 | { 31 | struct sockaddr_in6 *addr_in6 = (struct sockaddr_in6 *)addr; 32 | port = addr_in6->sin6_port; 33 | addr_buf = &addr_in6->sin6_addr; 34 | break; 35 | } 36 | default: 37 | return -1; 38 | } 39 | 40 | inet_ntop(addr->sa_family, addr_buf, ip_string, 41 | sizeof(ip_string) / sizeof(ip_string[0])); 42 | 43 | ret = snprintf(str, len, "%s:%d", ip_string, ntohs(port)); 44 | 45 | return ret > 0 && (size_t)ret < len ? 0 : -1; 46 | } 47 | 48 | #endif /* TCP_UTILS_H */ -------------------------------------------------------------------------------- /examples/protocols/sockets/socket-api/tcp_client/sdkconfig.defaults: -------------------------------------------------------------------------------- 1 | CONFIG_WAMR_APP_FRAMEWORK=y 2 | CONFIG_COMPILER_WASI_NO_USE_STDLIB=n -------------------------------------------------------------------------------- /examples/protocols/sockets/socket-api/tcp_server/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 4 | 5 | project(tcp_server) -------------------------------------------------------------------------------- /examples/protocols/sockets/socket-api/tcp_server/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRCS tcp_server.c 2 | INCLUDE_DIRS .) -------------------------------------------------------------------------------- /examples/protocols/sockets/socket-api/tcp_server/main/socket_utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2022 Amazon.com Inc. or its affiliates. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 4 | */ 5 | 6 | #ifndef TCP_UTILS_H 7 | #define TCP_UTILS_H 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | int 14 | sockaddr_to_string(struct sockaddr *addr, char *str, size_t len) 15 | { 16 | uint16_t port; 17 | char ip_string[64]; 18 | void *addr_buf; 19 | int ret; 20 | 21 | switch (addr->sa_family) { 22 | case AF_INET: 23 | { 24 | struct sockaddr_in *addr_in = (struct sockaddr_in *)addr; 25 | port = addr_in->sin_port; 26 | addr_buf = &addr_in->sin_addr; 27 | break; 28 | } 29 | case AF_INET6: 30 | { 31 | struct sockaddr_in6 *addr_in6 = (struct sockaddr_in6 *)addr; 32 | port = addr_in6->sin6_port; 33 | addr_buf = &addr_in6->sin6_addr; 34 | break; 35 | } 36 | default: 37 | return -1; 38 | } 39 | 40 | inet_ntop(addr->sa_family, addr_buf, ip_string, 41 | sizeof(ip_string) / sizeof(ip_string[0])); 42 | 43 | ret = snprintf(str, len, "%s:%d", ip_string, ntohs(port)); 44 | 45 | return ret > 0 && (size_t)ret < len ? 0 : -1; 46 | } 47 | 48 | #endif /* TCP_UTILS_H */ -------------------------------------------------------------------------------- /examples/protocols/sockets/socket-api/tcp_server/sdkconfig.defaults: -------------------------------------------------------------------------------- 1 | CONFIG_WAMR_APP_FRAMEWORK=y 2 | CONFIG_COMPILER_WASI_USE_SHARED_MEMORY=y -------------------------------------------------------------------------------- /examples/protocols/sockets/tcp_client/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The following five lines of boilerplate have to be in your project's 2 | # CMakeLists in this exact order for cmake to work correctly 3 | cmake_minimum_required(VERSION 3.5) 4 | 5 | # (Not part of the boilerplate) 6 | # This example uses an extra component for common functions such as Wi-Fi and Ethernet connection. 7 | set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/protocol_examples_common) 8 | 9 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 10 | project(tcp_client) 11 | -------------------------------------------------------------------------------- /examples/protocols/sockets/tcp_client/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRCS "tcp_client.c" 2 | INCLUDE_DIRS ".") 3 | -------------------------------------------------------------------------------- /examples/protocols/sockets/tcp_client/sdkconfig.defaults: -------------------------------------------------------------------------------- 1 | CONFIG_WAMR_APP_FRAMEWORK=y 2 | CONFIG_COMPILER_WASI_NO_USE_STDLIB=n 3 | CONFIG_COMPILER_WASI_USE_SHARED_MEMORY=y -------------------------------------------------------------------------------- /examples/protocols/sockets/tcp_server/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # The following five lines of boilerplate have to be in your project's 2 | # CMakeLists in this exact order for cmake to work correctly 3 | cmake_minimum_required(VERSION 3.5) 4 | 5 | # (Not part of the boilerplate) 6 | # This example uses an extra component for common functions such as Wi-Fi and Ethernet connection. 7 | set(EXTRA_COMPONENT_DIRS $ENV{IDF_PATH}/examples/common_components/protocol_examples_common) 8 | 9 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 10 | project(tcp_server) 11 | -------------------------------------------------------------------------------- /examples/protocols/sockets/tcp_server/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRCS "tcp_server.c" 2 | INCLUDE_DIRS ".") 3 | -------------------------------------------------------------------------------- /examples/protocols/sockets/tcp_server/main/Kconfig.projbuild: -------------------------------------------------------------------------------- 1 | menu "Example Configuration" 2 | 3 | config EXAMPLE_IPV4 4 | bool "IPV4" 5 | default y 6 | 7 | config EXAMPLE_IPV6 8 | bool "IPV6" 9 | default n 10 | select EXAMPLE_CONNECT_IPV6 11 | 12 | config EXAMPLE_PORT 13 | int "Port" 14 | range 0 65535 15 | default 3333 16 | help 17 | Local port the example server will listen on. 18 | 19 | config EXAMPLE_KEEPALIVE_IDLE 20 | int "TCP keep-alive idle time(s)" 21 | default 5 22 | help 23 | Keep-alive idle time. In idle time without receiving any data from peer, will send keep-alive probe packet 24 | 25 | config EXAMPLE_KEEPALIVE_INTERVAL 26 | int "TCP keep-alive interval time(s)" 27 | default 5 28 | help 29 | Keep-alive probe packet interval time. 30 | 31 | config EXAMPLE_KEEPALIVE_COUNT 32 | int "TCP keep-alive packet retry send counts" 33 | default 3 34 | help 35 | Keep-alive probe packet retry count. 36 | endmenu 37 | -------------------------------------------------------------------------------- /examples/protocols/sockets/tcp_server/sdkconfig.defaults: -------------------------------------------------------------------------------- 1 | CONFIG_WAMR_APP_FRAMEWORK=y 2 | CONFIG_COMPILER_WASI_NO_USE_STDLIB=n 3 | CONFIG_COMPILER_WASI_USE_SHARED_MEMORY=y -------------------------------------------------------------------------------- /examples/provisioning/README.md: -------------------------------------------------------------------------------- 1 | # Provisioning Application Examples 2 | 3 | This primarily consists of a single unified example wifi_prov_mgr 4 | 5 | * wifi_prov_mgr 6 | Abstracts out most of the complexity of Wi-Fi provisioning and allows easy switching between the SoftAP (using HTTP) and BLE transports. It also demonstrates how applications can register and use additional custom data endpoints. 7 | 8 | Provisioning applications are available for various platforms: 9 | 10 | * Android: 11 | - [BLE Provisioning app on Play Store](https://play.google.com/store/apps/details?id=com.espressif.provble). 12 | - [SoftAP Provisioning app on Play Store](https://play.google.com/store/apps/details?id=com.espressif.provsoftap). 13 | - Source code on GitHub: [esp-idf-provisioning-android](https://github.com/espressif/esp-idf-provisioning-android). 14 | * iOS: 15 | - [BLE Provisioning app on app store](https://apps.apple.com/in/app/esp-ble-provisioning/id1473590141) 16 | - [SoftAP Provisioning app on app Store](https://apps.apple.com/in/app/esp-softap-provisioning/id1474040630) 17 | - Source code on GitHub: [esp-idf-provisioning-ios](https://github.com/espressif/esp-idf-provisioning-ios) 18 | * For all other platforms a python based command line tool is provided under "$IDF_PATH/tools/esp_prov" 19 | 20 | The Android and iOS provisioning applications allow the user to configure the device manually or by scanning a QR code. QR codes can be generated by any online QR code generator. QR code payload is encoded with a JSON string containing the device name, proof-of-possession key (if used) and transport type (BLE or softAP), for example: 21 | 22 | ``` 23 | {"ver":"v1","name":"PROV_000318","pop":"a1000318","transport":"softap"} 24 | ``` 25 | 26 | The more details about QR code format, you can refer to [QR Code Scan](https://github.com/espressif/esp-idf-provisioning-android#qr-code-scan). 27 | 28 | Refer to the README.md files in each example directory for more information. 29 | -------------------------------------------------------------------------------- /examples/provisioning/wifi_prov_mgr/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 4 | 5 | project(wifi_prov_mgr) -------------------------------------------------------------------------------- /examples/provisioning/wifi_prov_mgr/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRCS "wifi_prov_mgr.c" 2 | INCLUDE_DIRS ".") 3 | -------------------------------------------------------------------------------- /examples/provisioning/wifi_prov_mgr/main/Kconfig.projbuild: -------------------------------------------------------------------------------- 1 | menu "Example Configuration" 2 | 3 | choice EXAMPLE_PROV_TRANSPORT 4 | bool "Provisioning Transport" 5 | default EXAMPLE_PROV_TRANSPORT_BLE 6 | help 7 | Wi-Fi provisioning component offers both, SoftAP and BLE transports. Choose any one. 8 | 9 | config EXAMPLE_PROV_TRANSPORT_BLE 10 | bool "BLE" 11 | config EXAMPLE_PROV_TRANSPORT_SOFTAP 12 | bool "Soft AP" 13 | endchoice 14 | 15 | config EXAMPLE_PROV_TRANSPORT 16 | int 17 | default 1 if EXAMPLE_PROV_TRANSPORT_BLE 18 | default 2 if EXAMPLE_PROV_TRANSPORT_SOFTAP 19 | 20 | config EXAMPLE_RESET_PROVISIONED 21 | bool 22 | default n 23 | prompt "Reset provisioned status of the device" 24 | help 25 | This erases the NVS to reset provisioned status of the device on every reboot. 26 | Provisioned status is determined by the Wi-Fi STA configuration, saved on the NVS. 27 | 28 | config EXAMPLE_PROV_SHOW_QR 29 | bool "Show provisioning QR code" 30 | default n 31 | help 32 | Show the QR code for provisioning. 33 | endmenu 34 | -------------------------------------------------------------------------------- /examples/provisioning/wifi_prov_mgr/sdkconfig.defaults: -------------------------------------------------------------------------------- 1 | CONFIG_WAMR_APP_FRAMEWORK=y -------------------------------------------------------------------------------- /examples/rainmaker/common/app_wifi/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRCS "app_wifi.c" 2 | INCLUDE_DIRS "." 3 | REQUIRES extended_wasm_app esp_common esp_event log qrcode) 4 | -------------------------------------------------------------------------------- /examples/rainmaker/common/app_wifi/Kconfig.projbuild: -------------------------------------------------------------------------------- 1 | menu "ESP RainMaker App Wi-Fi Provisioning" 2 | 3 | config APP_WIFI_PROV_SHOW_QR 4 | bool "Show provisioning QR code" 5 | default y 6 | help 7 | Show the QR code for provisioning. 8 | 9 | choice APP_WIFI_PROV_TRANSPORT 10 | bool "Provisioning Transport method" 11 | default APP_WIFI_PROV_TRANSPORT_BLE 12 | help 13 | Wi-Fi provisioning component offers both, SoftAP and BLE transports. Choose any one. 14 | 15 | config APP_WIFI_PROV_TRANSPORT_SOFTAP 16 | bool "Soft AP" 17 | config APP_WIFI_PROV_TRANSPORT_BLE 18 | bool "BLE" 19 | select BT_ENABLED 20 | depends on !IDF_TARGET_ESP32S2 21 | endchoice 22 | 23 | config APP_WIFI_PROV_TRANSPORT 24 | int 25 | default 1 if APP_WIFI_PROV_TRANSPORT_SOFTAP 26 | default 2 if APP_WIFI_PROV_TRANSPORT_BLE 27 | 28 | config APP_WIFI_SHOW_DEMO_INTRO_TEXT 29 | bool "Show intro text for demos" 30 | default n 31 | help 32 | Show some intro text for demos in order to help users understand more about ESP RainMaker. 33 | 34 | config APP_WIFI_PROV_NAME_PREFIX 35 | string "Provisioning Name Prefix" 36 | default "PROV" 37 | help 38 | Provisioning Name Prefix. 39 | 40 | endmenu 41 | -------------------------------------------------------------------------------- /examples/rainmaker/switch/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | set(EXTRA_COMPONENT_DIRS ${CMAKE_CURRENT_LIST_DIR}/../common) 4 | 5 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 6 | 7 | project(switch) -------------------------------------------------------------------------------- /examples/rainmaker/switch/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRCS switch.c) -------------------------------------------------------------------------------- /examples/rainmaker/switch/sdkconfig.defaults: -------------------------------------------------------------------------------- 1 | CONFIG_WAMR_APP_FRAMEWORK=y -------------------------------------------------------------------------------- /examples/simple/event_publisher/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 4 | 5 | project(event_publisher) -------------------------------------------------------------------------------- /examples/simple/event_publisher/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRCS event_publisher.c) -------------------------------------------------------------------------------- /examples/simple/event_publisher/main/event_publisher.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Intel Corporation. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 4 | */ 5 | 6 | #include "wasm_app.h" 7 | #include "wa-inc/request.h" 8 | #include "wa-inc/timer_wasm_app.h" 9 | 10 | int num = 0; 11 | 12 | void 13 | publish_overheat_event() 14 | { 15 | attr_container_t *event; 16 | 17 | event = attr_container_create("event"); 18 | attr_container_set_string(&event, "warning", "temperature is over high"); 19 | 20 | api_publish_event("alert/overheat", FMT_ATTR_CONTAINER, event, 21 | attr_container_get_serialize_length(event)); 22 | 23 | attr_container_destroy(event); 24 | } 25 | 26 | /* Timer callback */ 27 | void 28 | timer1_update(user_timer_t timer) 29 | { 30 | publish_overheat_event(); 31 | } 32 | 33 | void 34 | start_timer() 35 | { 36 | user_timer_t timer; 37 | 38 | /* set up a timer */ 39 | timer = api_timer_create(1000, true, false, timer1_update); 40 | api_timer_restart(timer, 1000); 41 | } 42 | 43 | void 44 | on_init() 45 | { 46 | start_timer(); 47 | } 48 | 49 | void 50 | on_destroy() 51 | { 52 | /* real destroy work including killing timer and closing sensor is 53 | accomplished in wasm app library version of on_destroy() */ 54 | } 55 | -------------------------------------------------------------------------------- /examples/simple/event_publisher/sdkconfig.defaults: -------------------------------------------------------------------------------- 1 | CONFIG_WAMR_APP_FRAMEWORK=y 2 | CONFIG_WAMR_APP_FRAMEWORK_EXPORT_TIMER=y -------------------------------------------------------------------------------- /examples/simple/event_subscriber/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 4 | 5 | project(event_subscriber) -------------------------------------------------------------------------------- /examples/simple/event_subscriber/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRCS event_subscriber.c) -------------------------------------------------------------------------------- /examples/simple/event_subscriber/main/event_subscriber.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Intel Corporation. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 4 | */ 5 | 6 | #include "wasm_app.h" 7 | #include "wa-inc/request.h" 8 | 9 | void 10 | over_heat_event_handler(request_t *request) 11 | { 12 | printf("### user over heat event handler called\n"); 13 | 14 | if (request->payload != NULL && request->fmt == FMT_ATTR_CONTAINER) 15 | attr_container_dump((attr_container_t *)request->payload); 16 | } 17 | 18 | void 19 | on_init() 20 | { 21 | api_subscribe_event("alert/overheat", over_heat_event_handler); 22 | } 23 | 24 | void 25 | on_destroy() 26 | { 27 | /* real destroy work including killing timer and closing sensor is 28 | accomplished in wasm app library version of on_destroy() */ 29 | } 30 | -------------------------------------------------------------------------------- /examples/simple/event_subscriber/sdkconfig.defaults: -------------------------------------------------------------------------------- 1 | CONFIG_WAMR_APP_FRAMEWORK=y 2 | CONFIG_WAMR_APP_FRAMEWORK_EXPORT_REQUEST_RESPONSE=y -------------------------------------------------------------------------------- /examples/simple/request_handler/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 4 | 5 | project(request_handler) -------------------------------------------------------------------------------- /examples/simple/request_handler/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRCS request_handler.c) -------------------------------------------------------------------------------- /examples/simple/request_handler/main/request_handler.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Intel Corporation. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 4 | */ 5 | 6 | #include "wasm_app.h" 7 | #include "wa-inc/request.h" 8 | 9 | static void 10 | url1_request_handler(request_t *request) 11 | { 12 | response_t response[1]; 13 | attr_container_t *payload; 14 | 15 | printf("[resp] ### user resource 1 handler called\n"); 16 | 17 | if (request->payload != NULL && request->fmt == FMT_ATTR_CONTAINER) 18 | attr_container_dump((attr_container_t *)request->payload); 19 | 20 | payload = attr_container_create("wasm app response payload"); 21 | if (payload == NULL) 22 | return; 23 | 24 | attr_container_set_string(&payload, "key1", "value1"); 25 | attr_container_set_string(&payload, "key2", "value2"); 26 | 27 | make_response_for_request(request, response); 28 | set_response(response, CONTENT_2_05, FMT_ATTR_CONTAINER, (void *)payload, 29 | attr_container_get_serialize_length(payload)); 30 | api_response_send(response); 31 | 32 | attr_container_destroy(payload); 33 | } 34 | 35 | static void 36 | url2_request_handler(request_t *request) 37 | { 38 | response_t response[1]; 39 | make_response_for_request(request, response); 40 | set_response(response, DELETED_2_02, 0, NULL, 0); 41 | api_response_send(response); 42 | 43 | printf("### user resource 2 handler called\n"); 44 | } 45 | 46 | void 47 | on_init() 48 | { 49 | /* register resource uri */ 50 | api_register_resource_handler("/url1", url1_request_handler); 51 | api_register_resource_handler("/url2", url2_request_handler); 52 | } 53 | 54 | void 55 | on_destroy() 56 | { 57 | /* real destroy work including killing timer and closing sensor is 58 | accomplished in wasm app library version of on_destroy() */ 59 | } 60 | -------------------------------------------------------------------------------- /examples/simple/request_handler/sdkconfig.defaults: -------------------------------------------------------------------------------- 1 | CONFIG_WAMR_APP_FRAMEWORK=y 2 | CONFIG_WAMR_APP_FRAMEWORK_EXPORT_REQUEST_RESPONSE=y -------------------------------------------------------------------------------- /examples/simple/request_sender/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 4 | 5 | project(request_sender) -------------------------------------------------------------------------------- /examples/simple/request_sender/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRCS request_sender.c) -------------------------------------------------------------------------------- /examples/simple/request_sender/main/request_sender.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Intel Corporation. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 4 | */ 5 | 6 | #include "wasm_app.h" 7 | #include "wa-inc/request.h" 8 | 9 | static void 10 | my_response_handler(response_t *response, void *user_data) 11 | { 12 | char *tag = (char *)user_data; 13 | 14 | if (response == NULL) { 15 | printf("[req] request timeout!\n"); 16 | return; 17 | } 18 | 19 | printf("[req] response handler called mid:%d, status:%d, fmt:%d, " 20 | "payload:%p, len:%d, tag:%s\n", 21 | response->mid, response->status, response->fmt, response->payload, 22 | response->payload_len, tag); 23 | 24 | if (response->payload != NULL && response->payload_len > 0 25 | && response->fmt == FMT_ATTR_CONTAINER) { 26 | printf("[req] dump the response payload:\n"); 27 | attr_container_dump((attr_container_t *)response->payload); 28 | } 29 | } 30 | 31 | static void 32 | test_send_request(char *url, char *tag) 33 | { 34 | request_t request[1]; 35 | 36 | init_request(request, url, COAP_PUT, 0, NULL, 0); 37 | api_send_request(request, my_response_handler, tag); 38 | } 39 | 40 | void 41 | on_init() 42 | { 43 | test_send_request("/app/request_handler/url1", "a request to target app"); 44 | test_send_request("url1", "a general request"); 45 | } 46 | 47 | void 48 | on_destroy() 49 | { 50 | /* real destroy work including killing timer and closing sensor is 51 | accomplished in wasm app library version of on_destroy() */ 52 | } 53 | -------------------------------------------------------------------------------- /examples/simple/request_sender/sdkconfig.defaults: -------------------------------------------------------------------------------- 1 | CONFIG_WAMR_APP_FRAMEWORK=y 2 | CONFIG_WAMR_APP_FRAMEWORK_EXPORT_REQUEST_RESPONSE=y -------------------------------------------------------------------------------- /examples/simple/timer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 4 | 5 | project(timer) -------------------------------------------------------------------------------- /examples/simple/timer/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRCS timer.c) -------------------------------------------------------------------------------- /examples/simple/timer/main/timer.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2019 Intel Corporation. All rights reserved. 3 | * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 4 | */ 5 | 6 | #include "wasm_app.h" 7 | #include "wa-inc/timer_wasm_app.h" 8 | 9 | /* User global variable */ 10 | static int num = 0; 11 | 12 | /* Timer callback */ 13 | void 14 | timer1_update(user_timer_t timer) 15 | { 16 | printf("Timer update %d\n", num++); 17 | } 18 | 19 | void 20 | on_init() 21 | { 22 | user_timer_t timer; 23 | 24 | /* set up a timer */ 25 | timer = api_timer_create(1000, true, false, timer1_update); 26 | api_timer_restart(timer, 1000); 27 | } 28 | 29 | void 30 | on_destroy() 31 | { 32 | /* real destroy work including killing timer and closing sensor is 33 | accomplished in wasm app library version of on_destroy() */ 34 | } 35 | -------------------------------------------------------------------------------- /examples/simple/timer/sdkconfig.defaults: -------------------------------------------------------------------------------- 1 | CONFIG_WAMR_APP_FRAMEWORK=y 2 | CONFIG_WAMR_APP_FRAMEWORK_EXPORT_TIMER=y -------------------------------------------------------------------------------- /export.fish: -------------------------------------------------------------------------------- 1 | # This script should be sourced, not executed. 2 | 3 | function __main 4 | set basedir (realpath (dirname (status -f))) 5 | 6 | set -x IDF_PATH $basedir 7 | 8 | set oldpath = $PATH 9 | 10 | echo "Detecting the Python interpreter" 11 | source "$IDF_PATH"/tools/detect_python.fish 12 | 13 | echo "Adding ESP-WDF tools to PATH..." 14 | # Call idf_tools.py to export tool paths 15 | set -x IDF_TOOLS_EXPORT_CMD "$IDF_PATH"/export.fish 16 | set -x IDF_TOOLS_INSTALL_CMD "$IDF_PATH"/install.fish 17 | set idf_exports ("$ESP_PYTHON" "$IDF_PATH"/tools/idf_tools.py export) || return 1 18 | eval "$idf_exports" 19 | 20 | echo "Checking if Python packages are up to date..." 21 | python "$IDF_PATH"/tools/check_python_dependencies.py || return 1 22 | 23 | set added_path_variables 24 | for entry in $PATH; 25 | if not contains $entry $oldpath 26 | set -a added_path_variables $entry 27 | end 28 | end 29 | if set -q added_path_variables[1] 30 | echo "Added the following directories to PATH:" 31 | for entry in $added_path_variables; 32 | echo $entry 33 | end 34 | else 35 | echo "All paths are already set." 36 | end 37 | 38 | # Clean up 39 | set -e added_path_variables 40 | set -e cmd 41 | set -e old_path 42 | set -e paths 43 | set -e path_prefix 44 | set -e path_entry 45 | set -e IDF_ADD_PATHS_EXTRAS 46 | set -e idf_exports 47 | set -e ESP_PYTHON 48 | 49 | # Not unsetting IDF_PYTHON_ENV_PATH, it can be used by IDF build system 50 | # to check whether we are using a private Python environment 51 | 52 | echo "" 53 | echo "Done! You can now compile ESP-WDF projects." 54 | echo "Go to the project directory and run:" 55 | echo "" 56 | echo " idf.py build" 57 | echo "" 58 | end 59 | 60 | __main 61 | 62 | set click_version (python -c 'import click; print(click.__version__.split(".")[0])') 63 | if test $click_version -lt 8 64 | eval (env _IDF.PY_COMPLETE=source_fish idf.py) 65 | else 66 | eval (env _IDF.PY_COMPLETE=fish_source idf.py) 67 | end 68 | 69 | 70 | set -e __main 71 | -------------------------------------------------------------------------------- /install.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | if defined MSYSTEM ( 3 | echo This .bat file is for Windows CMD.EXE shell only. When using MSYS, run: 4 | echo ./install.sh. 5 | goto end 6 | ) 7 | 8 | :: Missing requirements check 9 | set MISSING_REQUIREMENTS= 10 | python.exe --version >NUL 2>NUL 11 | if %errorlevel% neq 0 set "MISSING_REQUIREMENTS= python &echo\" 12 | git.exe --version >NUL 2>NUL 13 | if %errorlevel% neq 0 set "MISSING_REQUIREMENTS=%MISSING_REQUIREMENTS% git" 14 | 15 | if not "%MISSING_REQUIREMENTS%" == "" goto :error_missing_requirements 16 | 17 | :: Infer IDF_PATH from script location 18 | set IDF_PATH=%~dp0 19 | set IDF_PATH=%IDF_PATH:~0,-1% 20 | 21 | echo Installing ESP-WDF tools 22 | python.exe "%IDF_PATH%\tools\idf_tools.py" install 23 | if %errorlevel% neq 0 goto :end 24 | 25 | echo Setting up Python environment 26 | python.exe "%IDF_PATH%\tools\idf_tools.py" install-python-env 27 | if %errorlevel% neq 0 goto :end 28 | 29 | echo All done! You can now run: 30 | echo export.bat 31 | goto :end 32 | 33 | :error_missing_requirements 34 | echo. 35 | echo Error^: The following tools are not installed in your environment. 36 | echo. 37 | echo %MISSING_REQUIREMENTS% 38 | echo. 39 | echo Please install it, and make sure that it can be found in PATH. 40 | goto :end 41 | 42 | :end 43 | -------------------------------------------------------------------------------- /install.fish: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env fish 2 | 3 | set basedir (realpath (dirname (status -f))) 4 | 5 | set -x IDF_PATH $basedir 6 | 7 | echo "Detecting the Python interpreter" 8 | source "$IDF_PATH"/tools/detect_python.fish 9 | 10 | echo "Installing ESP-WDF tools" 11 | "$ESP_PYTHON" "$IDF_PATH"/tools/idf_tools.py install 12 | or exit 1 13 | 14 | echo "Installing Python environment and packages" 15 | "$ESP_PYTHON" "$IDF_PATH"/tools/idf_tools.py install-python-env 16 | 17 | echo "All done! You can now run:" 18 | echo "" 19 | echo " . "$basedir"/export.fish" 20 | echo "" 21 | -------------------------------------------------------------------------------- /install.ps1: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env pwsh 2 | $IDF_PATH = $PSScriptRoot 3 | 4 | Write-Output "Installing ESP-WDF tools" 5 | Start-Process -Wait -NoNewWindow -FilePath "python" -Args "$IDF_PATH/tools/idf_tools.py install" 6 | if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } # if error 7 | 8 | Write-Output "Setting up Python environment" 9 | Start-Process -Wait -NoNewWindow -FilePath "python" -Args "$IDF_PATH/tools/idf_tools.py install-python-env" 10 | if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE} # if error 11 | 12 | 13 | Write-Output " 14 | All done! You can now run: 15 | export.ps1 16 | " 17 | -------------------------------------------------------------------------------- /install.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | set -u 5 | 6 | basedir=$(dirname "$0") 7 | IDF_PATH=$(cd "${basedir}"; pwd) 8 | export IDF_PATH 9 | 10 | echo "Detecting the Python interpreter" 11 | . "${IDF_PATH}/tools/detect_python.sh" 12 | 13 | echo "Installing ESP-WDF tools" 14 | "${ESP_PYTHON}" "${IDF_PATH}/tools/idf_tools.py" install 15 | 16 | echo "Installing Python environment and packages" 17 | "${ESP_PYTHON}" "${IDF_PATH}/tools/idf_tools.py" install-python-env 18 | 19 | echo "All done! You can now run:" 20 | echo "" 21 | echo " . ${basedir}/export.sh" 22 | echo "" 23 | -------------------------------------------------------------------------------- /requirements.ci.txt: -------------------------------------------------------------------------------- 1 | kconfiglib==13.7.1 -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | click>=7.0 2 | 3 | future>=0.15.2 4 | kconfiglib==13.7.1 5 | 6 | # windows-curses are required in Windows command line but cannot be installed in MSYS2. A requirement like 7 | # "windows-curses; sys_platform == 'win32'" would want to install the package on both of them. There is no environment 8 | # marker for detecting MSYS2. So instead, a dummy custom package is used with "windows-curses" dependency for Windows 9 | # command line. 10 | file://${IDF_PATH}/tools/kconfig_new/esp-windows-curses; sys_platform == 'win32' -------------------------------------------------------------------------------- /sdkconfig.rename: -------------------------------------------------------------------------------- 1 | # sdkconfig replacement configurations for deprecated options formatted as 2 | # CONFIG_DEPRECATED_OPTION CONFIG_NEW_OPTION -------------------------------------------------------------------------------- /tools/check_term.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # 3 | # Copyright 2019 Espressif Systems (Shanghai) PTE LTD 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | 17 | from __future__ import print_function 18 | 19 | import os 20 | import sys 21 | 22 | if __name__ == '__main__': 23 | # Checks for the content of environment variable TERM to use with the Python- and curses-based menuconfig. It is 24 | # not implemented in shell so calling this script could not use some other shell environment where TERM is set 25 | # differently. Implemented here so it could be checked at one place for make and cmake as well. 26 | if sys.platform == 'win32' and 'MSYSTEM' not in os.environ: 27 | # no TERM is used in Windows command line 28 | exit(0) 29 | 30 | term = os.environ.get('TERM', None) 31 | 32 | if term is None: 33 | print('WARNING: The TERM environment variable is not defined. The curses-based menuconfig ' 34 | 'will probably fail to run. Please consult the documentation of your terminal to set it up.') 35 | else: 36 | if term.endswith('256color'): 37 | print('TERM environment variable is set to "{}"'.format(term)) 38 | else: 39 | print('WARNING: Menuconfig may fail because of the TERM environment variable is set ' 40 | 'to "{}". Please consult the documentation of your terminal to set it up. ' 41 | 'Some good, proved to been working setups include xterm-256color, screen-256color, ' 42 | 'rxvt-unicode-256color.'.format(term)) 43 | -------------------------------------------------------------------------------- /tools/cmake/idf.cmake: -------------------------------------------------------------------------------- 1 | get_property(__idf_env_set GLOBAL PROPERTY __IDF_ENV_SET) 2 | if(NOT __idf_env_set) 3 | # Infer an IDF_PATH relative to the tools/cmake directory 4 | get_filename_component(_idf_path "${CMAKE_CURRENT_LIST_DIR}/../.." REALPATH) 5 | file(TO_CMAKE_PATH "${_idf_path}" _idf_path) 6 | 7 | # Get the path set in environment 8 | set(idf_path $ENV{IDF_PATH}) 9 | 10 | # Environment IDF_PATH should match the inferred IDF_PATH. If not, warn the user. 11 | # (Note: REALPATH is needed in both above steps to account for case on case 12 | # insensitive filesystems, or relative paths) 13 | if(idf_path) 14 | get_filename_component(idf_path "${idf_path}" REALPATH) 15 | file(TO_CMAKE_PATH "${idf_path}" idf_path) 16 | 17 | if(NOT idf_path STREQUAL _idf_path) 18 | message(WARNING "IDF_PATH environment variable is different from inferred IDF_PATH. 19 | Check if your project's top-level CMakeLists.txt includes the right 20 | CMake files. Environment IDF_PATH will be used for the build: 21 | ${idf_path}") 22 | endif() 23 | else() 24 | message(WARNING "IDF_PATH environment variable not found. Setting IDF_PATH to '${_idf_path}'.") 25 | set(idf_path ${_idf_path}) 26 | set(ENV{IDF_PATH} ${_idf_path}) 27 | endif() 28 | 29 | # Include other CMake modules required 30 | set(CMAKE_MODULE_PATH 31 | "${idf_path}/tools/cmake" 32 | "${idf_path}/tools/cmake/third_party" 33 | ${CMAKE_MODULE_PATH}) 34 | include(build) 35 | 36 | set(IDF_PATH ${idf_path}) 37 | 38 | include(GetGitRevisionDescription) 39 | include(git_submodules) 40 | include(kconfig) 41 | include(component) 42 | include(utilities) 43 | 44 | __build_init("${idf_path}") 45 | 46 | set_property(GLOBAL PROPERTY __IDF_ENV_SET 1) 47 | endif() 48 | -------------------------------------------------------------------------------- /tools/cmake/project_description.json.in: -------------------------------------------------------------------------------- 1 | { 2 | "project_name": "${PROJECT_NAME}", 3 | "project_path": "${PROJECT_PATH}", 4 | "build_dir": "${BUILD_DIR}", 5 | "config_file": "${SDKCONFIG}", 6 | "config_defaults": "${SDKCONFIG_DEFAULTS}", 7 | "app_wasm": "${PROJECT_EXECUTABLE}", 8 | "git_revision": "${WDF_VER}", 9 | "config_environment" : { 10 | "COMPONENT_KCONFIGS" : "${COMPONENT_KCONFIGS}", 11 | "COMPONENT_KCONFIGS_PROJBUILD" : "${COMPONENT_KCONFIGS_PROJBUILD}" 12 | }, 13 | "build_components" : ${build_components_json}, 14 | "build_component_paths" : ${build_component_paths_json} 15 | } 16 | -------------------------------------------------------------------------------- /tools/cmake/scripts/fail.cmake: -------------------------------------------------------------------------------- 1 | # 'cmake -E' doesn't have a way to fail outright, so run this script 2 | # with 'cmake -P' to fail a build. 3 | message(FATAL_ERROR "$ENV{FAIL_MESSAGE}") 4 | -------------------------------------------------------------------------------- /tools/cmake/targets.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Set the target used for the standard project build. 3 | # 4 | macro(__target_init) 5 | endmacro() 6 | 7 | # 8 | # Used by the project CMake file to set the toolchain before project() call. 9 | # 10 | macro(__target_set_toolchain) 11 | idf_build_get_property(idf_path IDF_PATH) 12 | 13 | # First try to load the toolchain file from the tools/cmake/directory of IDF 14 | set(toolchain_file_global ${idf_path}/tools/cmake/toolchain-wasi.cmake) 15 | if(EXISTS ${toolchain_file_global}) 16 | set(CMAKE_TOOLCHAIN_FILE ${toolchain_file_global}) 17 | else() 18 | message(FATAL_ERROR "Toolchain file ${toolchain_file_global} not found") 19 | endif() 20 | endmacro() 21 | -------------------------------------------------------------------------------- /tools/cmake/third_party/GetGitRevisionDescription.cmake.in: -------------------------------------------------------------------------------- 1 | # 2 | # Internal file for GetGitRevisionDescription.cmake 3 | # 4 | # Requires CMake 2.6 or newer (uses the 'function' command) 5 | # 6 | # Original Author: 7 | # 2009-2010 Ryan Pavlik 8 | # http://academic.cleardefinition.com 9 | # Iowa State University HCI Graduate Program/VRAC 10 | # 11 | # Copyright Iowa State University 2009-2010. 12 | # Distributed under the Boost Software License, Version 1.0. 13 | # (See accompanying file LICENSE_1_0.txt or copy at 14 | # http://www.boost.org/LICENSE_1_0.txt) 15 | 16 | set(HEAD_HASH) 17 | 18 | file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024) 19 | 20 | string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS) 21 | set(GIT_DIR "@GIT_DIR@") 22 | # handle git-worktree 23 | if(EXISTS "${GIT_DIR}/commondir") 24 | file(READ "${GIT_DIR}/commondir" GIT_DIR_NEW LIMIT 1024) 25 | string(STRIP "${GIT_DIR_NEW}" GIT_DIR_NEW) 26 | if(NOT IS_ABSOLUTE "${GIT_DIR_NEW}") 27 | get_filename_component(GIT_DIR_NEW ${GIT_DIR}/${GIT_DIR_NEW} ABSOLUTE) 28 | endif() 29 | if(EXISTS "${GIT_DIR_NEW}") 30 | set(GIT_DIR "${GIT_DIR_NEW}") 31 | endif() 32 | endif() 33 | if(HEAD_CONTENTS MATCHES "ref") 34 | # named branch 35 | string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}") 36 | if(EXISTS "${GIT_DIR}/${HEAD_REF}") 37 | configure_file("${GIT_DIR}/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) 38 | elseif(EXISTS "${GIT_DIR}/logs/${HEAD_REF}") 39 | configure_file("${GIT_DIR}/logs/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) 40 | set(HEAD_HASH "${HEAD_REF}") 41 | endif() 42 | else() 43 | # detached HEAD 44 | configure_file("${GIT_DIR}/HEAD" "@GIT_DATA@/head-ref" COPYONLY) 45 | endif() 46 | 47 | if(NOT HEAD_HASH) 48 | file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024) 49 | string(STRIP "${HEAD_HASH}" HEAD_HASH) 50 | endif() 51 | -------------------------------------------------------------------------------- /tools/cmake/toolchain-wasi.cmake: -------------------------------------------------------------------------------- 1 | set(CMAKE_SYSTEM_NAME Generic) 2 | 3 | set(CMAKE_C_COMPILER clang) 4 | set(CMAKE_CXX_COMPILER clang++) 5 | set(CMAKE_ASM_COMPILER clang) 6 | -------------------------------------------------------------------------------- /tools/cmake/version.cmake: -------------------------------------------------------------------------------- 1 | set(WDF_VERSION_MAJOR 1) 2 | set(WDF_VERSION_MINOR 0) 3 | set(WDF_VERSION_PATCH 0) 4 | 5 | set(ENV{WDF_VERSION} "${WDF_VERSION_MAJOR}.${WDF_VERSION_MINOR}.${WDF_VERSION_PATCH}") 6 | -------------------------------------------------------------------------------- /tools/detect_python.fish: -------------------------------------------------------------------------------- 1 | # This file should be sourced, not executed! 2 | # 3 | # This is a port of detect_python.sh. More information are provided there. 4 | 5 | set -x ESP_PYTHON python 6 | 7 | for p_cmd in python python3; 8 | echo "Checking \"$p_cmd\" ..." 9 | 10 | set res ($p_cmd -c "import sys; print(sys.version_info.major)") 11 | if [ "$res" = "3" ] 12 | set -x ESP_PYTHON $p_cmd 13 | break 14 | end 15 | end 16 | 17 | $ESP_PYTHON --version 18 | if [ $status -ne 0 ] 19 | echo "\"$ESP_PYTHON\" is not installed! Please see the documentation for how to install it." 20 | # The following exit skips the rest of this file but won't exit fish where the script was sourced. This is not a 21 | # fatal issue. 22 | exit 1 23 | end 24 | 25 | echo "\"$ESP_PYTHON\" has been detected" 26 | -------------------------------------------------------------------------------- /tools/detect_python.sh: -------------------------------------------------------------------------------- 1 | # This file should be sourced, not executed! 2 | # 3 | # This is a helper script for detecting Python executables in the PATH. It is intended to be used for determining 4 | # which Python should be used with idf_tools.py for installing tools and exporting environment variables. 5 | # 6 | # 1. The script will set variable ESP_PYTHON to "python" if it is of version 3. 7 | # 2. Otherwise, "python3" will be exported if it exists. 8 | # 3. The script will fall-back to "python" as the last resort and fail if it doesn't exist. 9 | 10 | ESP_PYTHON=python 11 | 12 | for p_cmd in python python3 13 | do 14 | echo "Checking \"$p_cmd\" ..." 15 | 16 | if [ "$($p_cmd -c "import sys; print(sys.version_info.major)")" = 3 ]; then 17 | ESP_PYTHON=$p_cmd 18 | break 19 | fi 20 | done 21 | 22 | $ESP_PYTHON --version || { echo "\"$ESP_PYTHON\" is not installed! Please see the documentation for how to install it."; exit 1; } 23 | 24 | echo "\"$ESP_PYTHON\" has been detected" 25 | -------------------------------------------------------------------------------- /tools/idf_py_actions/README.md: -------------------------------------------------------------------------------- 1 | # idf.py extensions 2 | Python modules (subdirectories and files) in this directory named `[your_extension]_ext` will be loaded as idf.py extensions. 3 | If you want to provide extra extensions just provide `;` separated list of directories with extensions in `IDF_EXTRA_ACTIONS_PATH`. Extensions will be loaded in alphanumeric order. 4 | Command line arguments parsing and extension mechanism is implemented on top of [Click](https://click.palletsprojects.com/en/5.x/) (versions >=5.0 are supported). 5 | 6 | They should define a function `action_extensions(base_actions, project_path)` where: 7 | 8 | - base_actions - dictionary with actions that are already available for idf.py 9 | - project_path - working dir, may be defaulted to `os.getcwd()` 10 | 11 | This function have to return a dict with 3 possible keys: 12 | 13 | ```python 14 | { 15 | # Additional options that will be available from id 16 | "global_options": [{ 17 | "names": ["--option-name"], 18 | "help": "Help for option --option-name.", 19 | }], 20 | # List of functions that will have access to full app context, and can mangle with arguments 21 | "global_action_callbacks": [global_callback], 22 | # Additional subcommands for idf.py 23 | "actions": { 24 | "subcommand_name": { 25 | "callback": subcommand_callback, 26 | "help": "Help for subcommand.", 27 | }, 28 | }, 29 | } 30 | ``` 31 | 32 | Where function `global_callback(ctx, global_args, tasks)` accepts 3 arguments: 33 | 34 | - ctx - [Click context](https://click.palletsprojects.com/en/5.x/api/#context) 35 | - global_args - dictionary of all available global arguments 36 | - tasks - list of Task objects 37 | 38 | And `subcommand_callback(subcommand_name, ctx, args)` accepts 3 arguments: 39 | 40 | - subcommand_name - name of subcommand 41 | - ctx - [Click context](https://click.palletsprojects.com/en/5.x/api/#context) 42 | - args - list of command's arguments 43 | -------------------------------------------------------------------------------- /tools/idf_py_actions/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/espressif/esp-wdf/d8ac107ca182cf447613f2e61eb49b205216ff77/tools/idf_py_actions/__init__.py -------------------------------------------------------------------------------- /tools/idf_py_actions/constants.py: -------------------------------------------------------------------------------- 1 | import collections 2 | import multiprocessing 3 | import os 4 | import platform 5 | 6 | # Make flavors, across the various kinds of Windows environments & POSIX... 7 | if 'MSYSTEM' in os.environ: # MSYS 8 | MAKE_CMD = 'make' 9 | MAKE_GENERATOR = 'MSYS Makefiles' 10 | elif os.name == 'nt': # other Windows 11 | MAKE_CMD = 'mingw32-make' 12 | MAKE_GENERATOR = 'MinGW Makefiles' 13 | elif platform.system() == 'FreeBSD': 14 | MAKE_CMD = 'gmake' 15 | MAKE_GENERATOR = 'Unix Makefiles' 16 | else: 17 | MAKE_CMD = 'make' 18 | MAKE_GENERATOR = 'Unix Makefiles' 19 | 20 | GENERATORS = collections.OrderedDict([ 21 | # - command: build command line 22 | # - version: version command line 23 | # - dry_run: command to run in dry run mode 24 | # - verbose_flag: verbose flag 25 | ('Ninja', { 26 | 'command': ['ninja'], 27 | 'version': ['ninja', '--version'], 28 | 'dry_run': ['ninja', '-n'], 29 | 'verbose_flag': '-v' 30 | }), 31 | (MAKE_GENERATOR, { 32 | 'command': [MAKE_CMD, '-j', str(multiprocessing.cpu_count() + 2)], 33 | 'version': [MAKE_CMD, '--version'], 34 | 'dry_run': [MAKE_CMD, '-n'], 35 | 'verbose_flag': 'VERBOSE=1', 36 | }) 37 | ]) 38 | 39 | URL_TO_DOC = 'https://docs.espressif.com/projects/esp-idf' 40 | 41 | SUPPORTED_TARGETS = ['wasm'] 42 | PREVIEW_TARGETS = [] 43 | -------------------------------------------------------------------------------- /tools/idf_py_actions/errors.py: -------------------------------------------------------------------------------- 1 | class FatalError(RuntimeError): 2 | """ 3 | Wrapper class for runtime errors that aren't caused by bugs in idf.py or the build process. 4 | """ 5 | 6 | def __init__(self, message, ctx=None): 7 | super(RuntimeError, self).__init__(message) 8 | # if context is defined, check for the cleanup tasks 9 | if ctx is not None and 'cleanup' in ctx.meta: 10 | # cleans up the environment before failure 11 | ctx.meta['cleanup']() 12 | 13 | 14 | class NoSerialPortFoundError(FatalError): 15 | pass 16 | -------------------------------------------------------------------------------- /tools/idf_py_actions/global_options.py: -------------------------------------------------------------------------------- 1 | global_options = [{ 2 | 'names': ['-D', '--define-cache-entry'], 3 | 'help': 'Create a cmake cache entry.', 4 | 'scope': 'global', 5 | 'multiple': True, 6 | }] 7 | -------------------------------------------------------------------------------- /tools/kconfig_new/config.env.in: -------------------------------------------------------------------------------- 1 | { 2 | "COMPONENT_KCONFIGS": "${kconfigs}", 3 | "COMPONENT_KCONFIGS_PROJBUILD": "${kconfig_projbuilds}", 4 | "COMPONENT_SDKCONFIG_RENAMES": "${sdkconfig_renames}", 5 | "IDF_CMAKE": "y", 6 | "IDF_TARGET": "${idf_target}", 7 | "IDF_ENV_FPGA": "${idf_env_fpga}", 8 | "IDF_PATH": "${idf_path}", 9 | "COMPONENT_KCONFIGS_SOURCE_FILE": "${kconfigs_path}", 10 | "COMPONENT_KCONFIGS_PROJBUILD_SOURCE_FILE": "${kconfigs_projbuild_path}" 11 | } 12 | -------------------------------------------------------------------------------- /tools/kconfig_new/esp-windows-curses/setup.py: -------------------------------------------------------------------------------- 1 | # Copyright 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 | import os 16 | 17 | from setuptools import setup 18 | 19 | setup(name='esp-windows-curses', 20 | version='0.1', 21 | description='Wrapper for the windows-curses package', 22 | url='https://www.espressif.com', 23 | author='Espressif Systems', 24 | license='Apache License 2.0', 25 | author_email='donotreply@espressif.com', 26 | zip_safe=False, 27 | # This wrapper exists only because of the following install_requires statement which ensures that the package 28 | # dependency is not added for MSYS2 where it cannot be installed. There is no PEP 508 environment marker to 29 | # detect MSYS2. 30 | install_requires=('' if 'MSYSTEM' in os.environ else 'windows-curses; sys_platform == "win32"',) 31 | ) 32 | -------------------------------------------------------------------------------- /tools/kconfig_new/test/confserver/Kconfig: -------------------------------------------------------------------------------- 1 | menu "Test config" 2 | 3 | config TEST_BOOL 4 | bool "Test boolean" 5 | default n 6 | 7 | config TEST_CHILD_BOOL 8 | bool "Test boolean" 9 | depends on TEST_BOOL 10 | default y 11 | 12 | config TEST_CHILD_STR 13 | string "Test str" 14 | depends on TEST_BOOL 15 | default "OHAI!" 16 | 17 | choice TEST_CHOICE 18 | prompt "Some choice" 19 | default CHOICE_A 20 | 21 | config CHOICE_A 22 | bool "A" 23 | 24 | config CHOICE_B 25 | bool "B" 26 | 27 | endchoice 28 | 29 | config DEPENDS_ON_CHOICE 30 | string "Depends on choice" 31 | default "Depends on A" if CHOICE_A 32 | default "Depends on B" if CHOICE_B 33 | default "WAT" 34 | 35 | config SOME_UNRELATED_THING 36 | bool "Some unrelated thing" 37 | 38 | config TEST_CONDITIONAL_RANGES 39 | int "Something with a range" 40 | range 0 100 if TEST_BOOL 41 | range 0 10 42 | default 1 43 | 44 | config TEST_CONDITIONAL_HEX_RANGES 45 | hex "Something with a hex range" 46 | range 0x00 0xaf if TEST_BOOL 47 | range 0x10 0xaf 48 | default 0xa0 49 | 50 | config SUBMENU_TRIGGER 51 | bool "I enable/disable some submenu items" 52 | default y 53 | 54 | menu "Submenu" 55 | 56 | config SUBMENU_ITEM_A 57 | int "I am a submenu item" 58 | depends on SUBMENU_TRIGGER 59 | default 77 60 | 61 | config SUBMENU_ITEM_B 62 | bool "I am also submenu item" 63 | depends on SUBMENU_TRIGGER 64 | 65 | endmenu # Submenu 66 | 67 | menuconfig SUBMENU_CONFIG 68 | bool "Submenuconfig" 69 | default y 70 | help 71 | I am a submenu which is also a config item. 72 | 73 | config SUBMENU_CONFIG_ITEM 74 | bool "Depends on submenuconfig" 75 | depends on SUBMENU_CONFIG 76 | default y 77 | 78 | endmenu # Test config 79 | -------------------------------------------------------------------------------- /tools/kconfig_new/test/confserver/README.md: -------------------------------------------------------------------------------- 1 | # KConfig Tests 2 | 3 | ## confserver.py tests 4 | 5 | Install pexpect (`pip install pexpect`). 6 | 7 | Then run the tests manually like this: 8 | 9 | ``` 10 | ./test_confserver.py --logfile tests.log 11 | ``` 12 | 13 | If a weird error message comes up from the test, check the log file (`tests.log`) which has the full interaction session (input and output) from confserver.py - sometimes the test suite misinterprets some JSON-like content in a Python error message as JSON content. 14 | 15 | Note: confserver.py prints its error messages on stderr, to avoid overlap with JSON content on stdout. However pexpect uses a pty (virtual terminal) which can't distinguish stderr and stdout. 16 | 17 | Test cases apply to `KConfig` config schema. Cases are listed in `testcases.txt` and are each of this form: 18 | 19 | ``` 20 | * Set TEST_BOOL, showing child items 21 | > { "TEST_BOOL" : true } 22 | < { "values" : { "TEST_BOOL" : true, "TEST_CHILD_STR" : "OHAI!", "TEST_CHILD_BOOL" : true }, "ranges": {"TEST_CONDITIONAL_RANGES": [0, 100]}, "visible": {"TEST_CHILD_BOOL" : true, "TEST_CHILD_STR" : true} } 23 | 24 | ``` 25 | 26 | * First line (`*`) is description 27 | * Second line (`>`) is changes to send 28 | * Third line (`<`) is response to expect back 29 | * (Blank line between cases) 30 | 31 | Test cases are run in sequence, so any test case depends on the state changes caused by all items above it. 32 | 33 | -------------------------------------------------------------------------------- /tools/kconfig_new/test/confserver/sdkconfig: -------------------------------------------------------------------------------- 1 | CONFIG_SOME_UNRELATED_THING=y 2 | -------------------------------------------------------------------------------- /tools/kconfig_new/test/confserver/testcases_v1.txt: -------------------------------------------------------------------------------- 1 | * Set TEST_BOOL, showing child items 2 | > { "TEST_BOOL" : true } 3 | < { "values" : { "TEST_BOOL" : true, "TEST_CHILD_STR" : "OHAI!", "TEST_CHILD_BOOL" : true }, "ranges": {"TEST_CONDITIONAL_RANGES": [0, 100], "TEST_CONDITIONAL_HEX_RANGES": [0, 175]} } 4 | 5 | * Set TEST_CHILD_STR 6 | > { "TEST_CHILD_STR" : "Other value" } 7 | < { "values" : { "TEST_CHILD_STR" : "Other value" } } 8 | 9 | * Clear TEST_BOOL, hiding child items 10 | > { "TEST_BOOL" : false } 11 | < { "values" : { "TEST_BOOL" : false, "TEST_CHILD_STR" : null, "TEST_CHILD_BOOL" : null }, "ranges": {"TEST_CONDITIONAL_RANGES": [0, 10], "TEST_CONDITIONAL_HEX_RANGES": [16, 175]} } 12 | 13 | * Set TEST_CHILD_BOOL, invalid as parent is disabled 14 | > { "TEST_CHILD_BOOL" : false } 15 | < { "values" : { } } 16 | 17 | * Set TEST_BOOL & TEST_CHILD_STR together 18 | > { "TEST_BOOL" : true, "TEST_CHILD_STR" : "New value" } 19 | < { "values" : { "TEST_BOOL" : true, "TEST_CHILD_STR" : "New value", "TEST_CHILD_BOOL" : true } } 20 | 21 | * Set choice 22 | > { "CHOICE_B" : true } 23 | < { "values" : { "CHOICE_B" : true, "CHOICE_A" : false, "DEPENDS_ON_CHOICE" : "Depends on B" } } 24 | 25 | * Set string which depends on choice B 26 | > { "DEPENDS_ON_CHOICE" : "oh, really?" } 27 | < { "values" : { "DEPENDS_ON_CHOICE" : "oh, really?" } } 28 | 29 | * Try setting boolean values to invalid types 30 | > { "CHOICE_A" : 11, "TEST_BOOL" : "false" } 31 | < { "values" : { } } 32 | -------------------------------------------------------------------------------- /tools/kconfig_new/test/gen_kconfig_doc/Kconfig.chipa: -------------------------------------------------------------------------------- 1 | menu "Menu for CHIPA" 2 | visible if IDF_TARGET_CHIPA 3 | 4 | config EXT_CONFIG1_FOR_CHIPA_MENU 5 | bool "Config for chip A" 6 | depends on IDF_TARGET_CHIPA 7 | 8 | config EXT_CONFIG2_FOR_CHIPA_MENU 9 | bool "Config for chip A (depend on the visibility of the menu)" 10 | 11 | config EXT_CONFIG3_FOR_CHIPA_MENU 12 | int "integer" 13 | default 5 14 | endmenu 15 | 16 | config EXT_CONFIG3_FOR_CHIPA 17 | bool "Config for chip A" 18 | depends on IDF_TARGET_CHIPA 19 | 20 | config EXT_CONFIG4 21 | bool "Config for every chip (note that the config is defined at multiple places)" 22 | depends on IDF_TARGET_CHIPA 23 | -------------------------------------------------------------------------------- /tools/kconfig_new/test/gen_kconfig_doc/Kconfig.chipb: -------------------------------------------------------------------------------- 1 | menu "Menu for CHIPB" 2 | visible if IDF_TARGET_CHIPB 3 | 4 | config EXT_CONFIG1_FOR_CHIPB_MENU 5 | bool "Config for chip B" 6 | depends on IDF_TARGET_CHIPB 7 | 8 | config EXT_CONFIG2_FOR_CHIPB_MENU 9 | bool "Config for chip B (depend on the visibility of the menu)" 10 | 11 | endmenu 12 | 13 | config EXT_CONFIG3_FOR_CHIPB 14 | bool "Config for chip B" 15 | depends on IDF_TARGET_CHIPB 16 | 17 | config EXT_CONFIG4 18 | bool "Config for every chip (note that the config is defined at multiple places)" 19 | depends on IDF_TARGET_CHIPB 20 | -------------------------------------------------------------------------------- /tools/python_version_checker.py: -------------------------------------------------------------------------------- 1 | # SPDX-FileCopyrightText: 2021 Espressif Systems (Shanghai) CO LTD 2 | # 3 | # SPDX-License-Identifier: Apache-2.0 4 | # 5 | # Script for checking the compatibility of the Python interpreter with ESP-IDF. 6 | # 7 | # There are related tools/detect_python.{sh,fish} scripts which are called earlier when the paths are not properly 8 | # set-up and they only intend to prefer the use of Python 3 over Python 2. Why not more? All possible executables 9 | # (python3.6, python3.7, ...) cannot be hardcoded there and at the end, the user is responsible to set-up a system 10 | # where "python" or "python3" of compatible version is available. 11 | 12 | import sys 13 | 14 | try: 15 | # Python 2 is not supported anymore but still the old way of typing is used here in order to give a nice Python 16 | # version failure and not a typing exception. 17 | from typing import Iterable 18 | except ImportError: 19 | pass 20 | 21 | OLDEST_PYTHON_SUPPORTED = (3, 6) # keep it as tuple for comparison with sys.version_info 22 | 23 | 24 | def _ver_to_str(it): # type: (Iterable) -> str 25 | return '.'.join(str(x) for x in it) 26 | 27 | 28 | def is_supported(): # type: () -> bool 29 | return sys.version_info[:2] >= OLDEST_PYTHON_SUPPORTED[:2] 30 | 31 | 32 | def check(): # type: () -> None 33 | if not is_supported(): 34 | raise RuntimeError('ESP-IDF supports Python {} or newer but you are using Python {}. Please upgrade your ' 35 | 'installation as described in the documentation.'.format(_ver_to_str(OLDEST_PYTHON_SUPPORTED), 36 | _ver_to_str(sys.version_info[:3]))) 37 | --------------------------------------------------------------------------------