├── .gitignore ├── LICENSE ├── README.md └── esp32 └── examples ├── .gitignore └── color_code ├── .gitignore ├── CMakeLists.txt ├── README.md ├── components ├── esp32-camera │ ├── .gitignore │ ├── CMakeLists.txt │ ├── Kconfig │ ├── LICENSE │ ├── README.md │ ├── component.mk │ ├── conversions │ │ ├── esp_jpg_decode.c │ │ ├── include │ │ │ ├── esp_jpg_decode.h │ │ │ └── img_converters.h │ │ ├── jpge.cpp │ │ ├── private_include │ │ │ ├── jpge.h │ │ │ └── yuv.h │ │ ├── to_bmp.c │ │ ├── to_jpg.cpp │ │ └── yuv.c │ ├── driver │ │ ├── camera.c │ │ ├── include │ │ │ ├── esp_camera.h │ │ │ └── sensor.h │ │ ├── private_include │ │ │ ├── camera_common.h │ │ │ ├── sccb.h │ │ │ ├── twi.h │ │ │ └── xclk.h │ │ ├── sccb.c │ │ ├── sensor.c │ │ ├── twi.c │ │ └── xclk.c │ ├── examples │ │ └── take_picture.c │ ├── library.json │ └── sensors │ │ ├── ov2640.c │ │ ├── ov3660.c │ │ ├── ov5640.c │ │ ├── ov7725.c │ │ └── private_include │ │ ├── ov2640.h │ │ ├── ov2640_regs.h │ │ ├── ov2640_settings.h │ │ ├── ov3660.h │ │ ├── ov3660_regs.h │ │ ├── ov3660_settings.h │ │ ├── ov5640.h │ │ ├── ov5640_regs.h │ │ ├── ov5640_settings.h │ │ ├── ov7725.h │ │ └── ov7725_regs.h ├── lcd │ ├── Adafruit-GFX-Library │ │ ├── .gitignore │ │ ├── Adafruit_GFX.cpp │ │ ├── Adafruit_GFX.h │ │ ├── Adafruit_SPITFT.cpp │ │ ├── Adafruit_SPITFT.h │ │ ├── Adafruit_SPITFT_Macros.h │ │ ├── Fonts │ │ │ ├── FreeMono12pt7b.h │ │ │ ├── FreeMono18pt7b.h │ │ │ ├── FreeMono24pt7b.h │ │ │ ├── FreeMono9pt7b.h │ │ │ ├── FreeMonoBold12pt7b.h │ │ │ ├── FreeMonoBold18pt7b.h │ │ │ ├── FreeMonoBold24pt7b.h │ │ │ ├── FreeMonoBold9pt7b.h │ │ │ ├── FreeMonoBoldOblique12pt7b.h │ │ │ ├── FreeMonoBoldOblique18pt7b.h │ │ │ ├── FreeMonoBoldOblique24pt7b.h │ │ │ ├── FreeMonoBoldOblique9pt7b.h │ │ │ ├── FreeMonoOblique12pt7b.h │ │ │ ├── FreeMonoOblique18pt7b.h │ │ │ ├── FreeMonoOblique24pt7b.h │ │ │ ├── FreeMonoOblique9pt7b.h │ │ │ ├── FreeSans12pt7b.h │ │ │ ├── FreeSans18pt7b.h │ │ │ ├── FreeSans24pt7b.h │ │ │ ├── FreeSans9pt7b.h │ │ │ ├── FreeSansBold12pt7b.h │ │ │ ├── FreeSansBold18pt7b.h │ │ │ ├── FreeSansBold24pt7b.h │ │ │ ├── FreeSansBold9pt7b.h │ │ │ ├── FreeSansBoldOblique12pt7b.h │ │ │ ├── FreeSansBoldOblique18pt7b.h │ │ │ ├── FreeSansBoldOblique24pt7b.h │ │ │ ├── FreeSansBoldOblique9pt7b.h │ │ │ ├── FreeSansOblique12pt7b.h │ │ │ ├── FreeSansOblique18pt7b.h │ │ │ ├── FreeSansOblique24pt7b.h │ │ │ ├── FreeSansOblique9pt7b.h │ │ │ ├── FreeSerif12pt7b.h │ │ │ ├── FreeSerif18pt7b.h │ │ │ ├── FreeSerif24pt7b.h │ │ │ ├── FreeSerif9pt7b.h │ │ │ ├── FreeSerifBold12pt7b.h │ │ │ ├── FreeSerifBold18pt7b.h │ │ │ ├── FreeSerifBold24pt7b.h │ │ │ ├── FreeSerifBold9pt7b.h │ │ │ ├── FreeSerifBoldItalic12pt7b.h │ │ │ ├── FreeSerifBoldItalic18pt7b.h │ │ │ ├── FreeSerifBoldItalic24pt7b.h │ │ │ ├── FreeSerifBoldItalic9pt7b.h │ │ │ ├── FreeSerifItalic12pt7b.h │ │ │ ├── FreeSerifItalic18pt7b.h │ │ │ ├── FreeSerifItalic24pt7b.h │ │ │ ├── FreeSerifItalic9pt7b.h │ │ │ ├── Org_01.h │ │ │ ├── Picopixel.h │ │ │ ├── Tiny3x3a2pt7b │ │ │ └── TomThumb.h │ │ ├── README.md │ │ ├── fontconvert │ │ │ ├── Makefile │ │ │ ├── fontconvert.c │ │ │ ├── fontconvert_win.md │ │ │ └── makefonts.sh │ │ ├── gfxfont.h │ │ ├── glcdfont.h │ │ ├── library.properties │ │ └── license.txt │ ├── CMakeLists.txt │ ├── README.md │ ├── adaptation.cpp │ ├── component.mk.old │ ├── font7s.c │ ├── include │ │ ├── WProgram.h │ │ ├── font7s.h │ │ ├── gfxfont.h │ │ ├── glcdfont.h │ │ ├── image.h │ │ ├── iot_lcd.h │ │ ├── lcd_image.h │ │ └── spi_lcd.h │ ├── iot_lcd.cpp │ ├── spi_lcd.c │ └── test │ │ ├── component.mk │ │ ├── image.h │ │ ├── lcd_example.cpp │ │ ├── lcd_image.h │ │ ├── lcd_refresh.cpp │ │ └── lcd_thermostat.cpp └── lvgl_gui │ ├── CMakeLists.txt │ ├── README.md │ ├── component.mk.old │ ├── include │ ├── iot_lvgl.h │ └── lv_calibration.h │ ├── lv_conf.h │ ├── lvgl.c │ └── lvgl │ ├── CHANGELOG.md │ ├── LICENCE.txt │ ├── README.md │ ├── docs │ ├── CODE_OF_CONDUCT.md │ ├── CODING_STYLE.md │ ├── CONTRIBUTING.md │ └── ROADMAP.md │ ├── examples │ ├── arduino │ │ ├── ESP32_TFT_eSPI │ │ │ ├── ESP32_TFT_eSPI.ino │ │ │ └── README.md │ │ └── README.md │ └── porting │ │ ├── lv_port_disp_template.c │ │ ├── lv_port_disp_template.h │ │ ├── lv_port_fs_template.c │ │ ├── lv_port_fs_template.h │ │ ├── lv_port_indev_template.c │ │ └── lv_port_indev_template.h │ ├── library.json │ ├── library.properties │ ├── lv_conf_template.h │ ├── lvgl.h │ ├── lvgl.mk │ ├── scripts │ ├── Doxyfile │ ├── built_in_font │ │ ├── DejaVuSans.ttf │ │ ├── FontAwesome5-Solid+Brands+Regular.woff │ │ ├── Montserrat-Medium.ttf │ │ ├── SimSun.woff │ │ ├── built_in_font_gen.py │ │ └── generate_all.py │ ├── code-format.cfg │ ├── code-format.sh │ ├── cppcheck_run.sh │ ├── infer_run.sh │ ├── lv_conf_checker.py │ └── release.py │ ├── src │ ├── lv_api_map.h │ ├── lv_conf_internal.h │ ├── lv_core │ │ ├── lv_core.mk │ │ ├── lv_disp.c │ │ ├── lv_disp.h │ │ ├── lv_group.c │ │ ├── lv_group.h │ │ ├── lv_indev.c │ │ ├── lv_indev.h │ │ ├── lv_obj.c │ │ ├── lv_obj.h │ │ ├── lv_obj_style_dec.h │ │ ├── lv_refr.c │ │ ├── lv_refr.h │ │ ├── lv_style.c │ │ └── lv_style.h │ ├── lv_draw │ │ ├── lv_draw.h │ │ ├── lv_draw.mk │ │ ├── lv_draw_arc.c │ │ ├── lv_draw_arc.h │ │ ├── lv_draw_blend.c │ │ ├── lv_draw_blend.h │ │ ├── lv_draw_img.c │ │ ├── lv_draw_img.h │ │ ├── lv_draw_label.c │ │ ├── lv_draw_label.h │ │ ├── lv_draw_line.c │ │ ├── lv_draw_line.h │ │ ├── lv_draw_mask.c │ │ ├── lv_draw_mask.h │ │ ├── lv_draw_rect.c │ │ ├── lv_draw_rect.h │ │ ├── lv_draw_triangle.c │ │ ├── lv_draw_triangle.h │ │ ├── lv_img_buf.c │ │ ├── lv_img_buf.h │ │ ├── lv_img_cache.c │ │ ├── lv_img_cache.h │ │ ├── lv_img_decoder.c │ │ └── lv_img_decoder.h │ ├── lv_font │ │ ├── lv_font.c │ │ ├── lv_font.h │ │ ├── lv_font.mk │ │ ├── lv_font_dejavu_16_persian_hebrew.c │ │ ├── lv_font_fmt_txt.c │ │ ├── lv_font_fmt_txt.h │ │ ├── lv_font_montserrat_12.c │ │ ├── lv_font_montserrat_12_subpx.c │ │ ├── lv_font_montserrat_14.c │ │ ├── lv_font_montserrat_16.c │ │ ├── lv_font_montserrat_18.c │ │ ├── lv_font_montserrat_20.c │ │ ├── lv_font_montserrat_22.c │ │ ├── lv_font_montserrat_24.c │ │ ├── lv_font_montserrat_26.c │ │ ├── lv_font_montserrat_28.c │ │ ├── lv_font_montserrat_28_compressed.c │ │ ├── lv_font_montserrat_30.c │ │ ├── lv_font_montserrat_32.c │ │ ├── lv_font_montserrat_34.c │ │ ├── lv_font_montserrat_36.c │ │ ├── lv_font_montserrat_38.c │ │ ├── lv_font_montserrat_40.c │ │ ├── lv_font_montserrat_42.c │ │ ├── lv_font_montserrat_44.c │ │ ├── lv_font_montserrat_46.c │ │ ├── lv_font_montserrat_48.c │ │ ├── lv_font_simsun_16_cjk.c │ │ ├── lv_font_unscii_8.c │ │ └── lv_symbol_def.h │ ├── lv_gpu │ │ ├── lv_gpu.mk │ │ ├── lv_gpu_stm32_dma2d.c │ │ └── lv_gpu_stm32_dma2d.h │ ├── lv_hal │ │ ├── lv_hal.h │ │ ├── lv_hal.mk │ │ ├── lv_hal_disp.c │ │ ├── lv_hal_disp.h │ │ ├── lv_hal_indev.c │ │ ├── lv_hal_indev.h │ │ ├── lv_hal_tick.c │ │ └── lv_hal_tick.h │ ├── lv_misc │ │ ├── lv_anim.c │ │ ├── lv_anim.h │ │ ├── lv_area.c │ │ ├── lv_area.h │ │ ├── lv_async.c │ │ ├── lv_async.h │ │ ├── lv_bidi.c │ │ ├── lv_bidi.h │ │ ├── lv_color.c │ │ ├── lv_color.h │ │ ├── lv_debug.c │ │ ├── lv_debug.h │ │ ├── lv_fs.c │ │ ├── lv_fs.h │ │ ├── lv_gc.c │ │ ├── lv_gc.h │ │ ├── lv_ll.c │ │ ├── lv_ll.h │ │ ├── lv_log.c │ │ ├── lv_log.h │ │ ├── lv_math.c │ │ ├── lv_math.h │ │ ├── lv_mem.c │ │ ├── lv_mem.h │ │ ├── lv_misc.mk │ │ ├── lv_printf.c │ │ ├── lv_printf.h │ │ ├── lv_task.c │ │ ├── lv_task.h │ │ ├── lv_templ.c │ │ ├── lv_templ.h │ │ ├── lv_txt.c │ │ ├── lv_txt.h │ │ ├── lv_txt_ap.c │ │ ├── lv_txt_ap.h │ │ ├── lv_types.h │ │ ├── lv_utils.c │ │ └── lv_utils.h │ ├── lv_themes │ │ ├── lv_theme.c │ │ ├── lv_theme.h │ │ ├── lv_theme_empty.c │ │ ├── lv_theme_empty.h │ │ ├── lv_theme_material.c │ │ ├── lv_theme_material.h │ │ ├── lv_theme_mono.c │ │ ├── lv_theme_mono.h │ │ ├── lv_theme_template.c │ │ ├── lv_theme_template.h │ │ └── lv_themes.mk │ ├── lv_widgets │ │ ├── lv_arc.c │ │ ├── lv_arc.h │ │ ├── lv_bar.c │ │ ├── lv_bar.h │ │ ├── lv_btn.c │ │ ├── lv_btn.h │ │ ├── lv_btnmatrix.c │ │ ├── lv_btnmatrix.h │ │ ├── lv_calendar.c │ │ ├── lv_calendar.h │ │ ├── lv_canvas.c │ │ ├── lv_canvas.h │ │ ├── lv_chart.c │ │ ├── lv_chart.h │ │ ├── lv_checkbox.c │ │ ├── lv_checkbox.h │ │ ├── lv_cont.c │ │ ├── lv_cont.h │ │ ├── lv_cpicker.c │ │ ├── lv_cpicker.h │ │ ├── lv_dropdown.c │ │ ├── lv_dropdown.h │ │ ├── lv_gauge.c │ │ ├── lv_gauge.h │ │ ├── lv_img.c │ │ ├── lv_img.h │ │ ├── lv_imgbtn.c │ │ ├── lv_imgbtn.h │ │ ├── lv_keyboard.c │ │ ├── lv_keyboard.h │ │ ├── lv_label.c │ │ ├── lv_label.h │ │ ├── lv_led.c │ │ ├── lv_led.h │ │ ├── lv_line.c │ │ ├── lv_line.h │ │ ├── lv_linemeter.c │ │ ├── lv_linemeter.h │ │ ├── lv_list.c │ │ ├── lv_list.h │ │ ├── lv_msgbox.c │ │ ├── lv_msgbox.h │ │ ├── lv_objmask.c │ │ ├── lv_objmask.h │ │ ├── lv_objx_templ.c │ │ ├── lv_objx_templ.h │ │ ├── lv_page.c │ │ ├── lv_page.h │ │ ├── lv_roller.c │ │ ├── lv_roller.h │ │ ├── lv_slider.c │ │ ├── lv_slider.h │ │ ├── lv_spinbox.c │ │ ├── lv_spinbox.h │ │ ├── lv_spinner.c │ │ ├── lv_spinner.h │ │ ├── lv_switch.c │ │ ├── lv_switch.h │ │ ├── lv_table.c │ │ ├── lv_table.h │ │ ├── lv_tabview.c │ │ ├── lv_tabview.h │ │ ├── lv_textarea.c │ │ ├── lv_textarea.h │ │ ├── lv_tileview.c │ │ ├── lv_tileview.h │ │ ├── lv_widgets.mk │ │ ├── lv_win.c │ │ └── lv_win.h │ └── lvgl.h │ └── tests │ ├── Makefile │ ├── build.py │ ├── icon.png │ ├── icon2.png │ ├── lv_test_assert.c │ ├── lv_test_assert.h │ ├── lv_test_conf.h │ ├── lv_test_core │ ├── lv_test_core.c │ ├── lv_test_core.h │ ├── lv_test_obj.c │ ├── lv_test_obj.h │ ├── lv_test_style.c │ └── lv_test_style.h │ ├── lv_test_main.c │ ├── lv_test_objx │ ├── lv_test_cont.c │ └── lv_test_cont.h │ └── lv_test_ref_imgs │ └── lv_test_obj_1_1.png ├── demo └── demo.gif ├── main ├── CMakeLists.txt ├── app_camera.c ├── app_screen.cpp ├── component.mk ├── include │ ├── app_camera.h │ ├── app_screen.h │ ├── board_def.h │ └── system.h ├── main.cpp ├── memory_organization.lf ├── opencv │ ├── 3rdparty │ │ ├── liblibpng.a │ │ └── libzlib.a │ ├── libade.a │ ├── libopencv_core.a │ ├── libopencv_imgcodecs.a │ ├── libopencv_imgproc.a │ └── opencv2 │ │ ├── core.hpp │ │ ├── core │ │ ├── affine.hpp │ │ ├── async.hpp │ │ ├── base.hpp │ │ ├── bindings_utils.hpp │ │ ├── bufferpool.hpp │ │ ├── check.hpp │ │ ├── core.hpp │ │ ├── core_c.h │ │ ├── cuda.hpp │ │ ├── cuda.inl.hpp │ │ ├── cuda │ │ │ ├── block.hpp │ │ │ ├── border_interpolate.hpp │ │ │ ├── color.hpp │ │ │ ├── common.hpp │ │ │ ├── datamov_utils.hpp │ │ │ ├── detail │ │ │ │ ├── color_detail.hpp │ │ │ │ ├── reduce.hpp │ │ │ │ ├── reduce_key_val.hpp │ │ │ │ ├── transform_detail.hpp │ │ │ │ ├── type_traits_detail.hpp │ │ │ │ └── vec_distance_detail.hpp │ │ │ ├── dynamic_smem.hpp │ │ │ ├── emulation.hpp │ │ │ ├── filters.hpp │ │ │ ├── funcattrib.hpp │ │ │ ├── functional.hpp │ │ │ ├── limits.hpp │ │ │ ├── reduce.hpp │ │ │ ├── saturate_cast.hpp │ │ │ ├── scan.hpp │ │ │ ├── simd_functions.hpp │ │ │ ├── transform.hpp │ │ │ ├── type_traits.hpp │ │ │ ├── utility.hpp │ │ │ ├── vec_distance.hpp │ │ │ ├── vec_math.hpp │ │ │ ├── vec_traits.hpp │ │ │ ├── warp.hpp │ │ │ ├── warp_reduce.hpp │ │ │ └── warp_shuffle.hpp │ │ ├── cuda_stream_accessor.hpp │ │ ├── cuda_types.hpp │ │ ├── cv_cpu_dispatch.h │ │ ├── cv_cpu_helper.h │ │ ├── cvdef.h │ │ ├── cvstd.hpp │ │ ├── cvstd.inl.hpp │ │ ├── cvstd_wrapper.hpp │ │ ├── detail │ │ │ ├── async_promise.hpp │ │ │ └── exception_ptr.hpp │ │ ├── directx.hpp │ │ ├── eigen.hpp │ │ ├── fast_math.hpp │ │ ├── hal │ │ │ ├── hal.hpp │ │ │ ├── interface.h │ │ │ ├── intrin.hpp │ │ │ ├── intrin_avx.hpp │ │ │ ├── intrin_avx512.hpp │ │ │ ├── intrin_cpp.hpp │ │ │ ├── intrin_forward.hpp │ │ │ ├── intrin_msa.hpp │ │ │ ├── intrin_neon.hpp │ │ │ ├── intrin_sse.hpp │ │ │ ├── intrin_sse_em.hpp │ │ │ ├── intrin_vsx.hpp │ │ │ ├── intrin_wasm.hpp │ │ │ ├── msa_macros.h │ │ │ └── simd_utils.impl.hpp │ │ ├── llapi │ │ │ └── llapi.h │ │ ├── mat.hpp │ │ ├── mat.inl.hpp │ │ ├── matx.hpp │ │ ├── neon_utils.hpp │ │ ├── ocl.hpp │ │ ├── ocl_genbase.hpp │ │ ├── opencl │ │ │ ├── ocl_defs.hpp │ │ │ ├── opencl_info.hpp │ │ │ ├── opencl_svm.hpp │ │ │ └── runtime │ │ │ │ ├── autogenerated │ │ │ │ ├── opencl_clamdblas.hpp │ │ │ │ ├── opencl_clamdfft.hpp │ │ │ │ ├── opencl_core.hpp │ │ │ │ ├── opencl_core_wrappers.hpp │ │ │ │ ├── opencl_gl.hpp │ │ │ │ └── opencl_gl_wrappers.hpp │ │ │ │ ├── opencl_clamdblas.hpp │ │ │ │ ├── opencl_clamdfft.hpp │ │ │ │ ├── opencl_core.hpp │ │ │ │ ├── opencl_core_wrappers.hpp │ │ │ │ ├── opencl_gl.hpp │ │ │ │ ├── opencl_gl_wrappers.hpp │ │ │ │ ├── opencl_svm_20.hpp │ │ │ │ ├── opencl_svm_definitions.hpp │ │ │ │ └── opencl_svm_hsa_extension.hpp │ │ ├── opengl.hpp │ │ ├── openvx │ │ │ └── ovx_defs.hpp │ │ ├── operations.hpp │ │ ├── optim.hpp │ │ ├── ovx.hpp │ │ ├── persistence.hpp │ │ ├── private.cuda.hpp │ │ ├── private.hpp │ │ ├── saturate.hpp │ │ ├── simd_intrinsics.hpp │ │ ├── softfloat.hpp │ │ ├── sse_utils.hpp │ │ ├── traits.hpp │ │ ├── types.hpp │ │ ├── types_c.h │ │ ├── utility.hpp │ │ ├── utils │ │ │ ├── allocator_stats.hpp │ │ │ ├── allocator_stats.impl.hpp │ │ │ ├── buffer_area.private.hpp │ │ │ ├── configuration.private.hpp │ │ │ ├── filesystem.hpp │ │ │ ├── filesystem.private.hpp │ │ │ ├── instrumentation.hpp │ │ │ ├── lock.private.hpp │ │ │ ├── logger.defines.hpp │ │ │ ├── logger.hpp │ │ │ ├── logtag.hpp │ │ │ ├── tls.hpp │ │ │ ├── trace.hpp │ │ │ └── trace.private.hpp │ │ ├── va_intel.hpp │ │ ├── version.hpp │ │ └── vsx_utils.hpp │ │ ├── cvconfig.h │ │ ├── imgcodecs.hpp │ │ ├── imgcodecs │ │ ├── imgcodecs.hpp │ │ ├── imgcodecs_c.h │ │ ├── ios.h │ │ └── legacy │ │ │ └── constants_c.h │ │ ├── imgproc.hpp │ │ ├── imgproc │ │ ├── detail │ │ │ └── gcgraph.hpp │ │ ├── hal │ │ │ ├── hal.hpp │ │ │ └── interface.h │ │ ├── imgproc.hpp │ │ ├── imgproc_c.h │ │ └── types_c.h │ │ ├── opencv.hpp │ │ └── opencv_modules.hpp └── system.cpp ├── partitions.csv ├── sdkconfig ├── sdkconfig.defaults └── sdkconfig.old /.gitignore: -------------------------------------------------------------------------------- 1 | # ignore dot files/directories 2 | .* 3 | !.gitignore 4 | 5 | *.autosave 6 | *.pyc 7 | *.user 8 | *~ 9 | Thumbs.db 10 | tags 11 | tegra/ 12 | bin/ 13 | *.sdf 14 | *.opensdf 15 | *.obj 16 | *.stamp 17 | *.depend 18 | *.rule 19 | *.tmp 20 | */debug 21 | *.suo 22 | *.log 23 | *.tlog 24 | build 25 | node_modules 26 | cmake-build-*/ 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Eric 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ESP32 OpenCV Projects 2 | 3 | Running OpenCV on ESP32 as a standalone 4 | 5 | ## Introduction 6 | 7 | This project is based on joachimBurket/esp32-opencv(https://github.com/joachimBurket/esp32-opencv) 8 | Based on what he worked on, I try to not only upgrade all components but also make an OpenCV application for ESP32. 9 | 10 | ## How to make a build environment 11 | 12 | First of all, the ESP-IDF development environment should be ready in advance. 13 | [Tutorials for the ESP-IDF Visual Studio Code Extension](https://github.com/espressif/vscode-esp-idf-extension/blob/master/docs/tutorial/toc.md) 14 | 15 | [Running OpenCV on ESP32 (The first thing to be done)](https://youtu.be/7qPIRBY6C8c) 16 | [![Foo](https://i.ytimg.com/vi/7qPIRBY6C8c/hqdefault.jpg)](https://youtu.be/7qPIRBY6C8c) 17 | 18 | ## OpenCV Applications for ESP32 19 | 20 | It's RGB Pixel Detector & drawing Histogram. In the image obtained from the camera, the center RGB pixel information is displayed, and the histogram of the entire image is displayed. 21 | 22 | [RGB Pixel Detector & Histogram](https://youtu.be/DNQuCkPtzYA) 23 | [![Foo](https://github.com/0015/ESP32-OpenCV-Projects/blob/main/esp32/examples/color_code/demo/demo.gif)](https://youtu.be/DNQuCkPtzYA) 24 | 25 | 26 | ### Created & Maintained By 27 | 28 | [Eric Nam](https://github.com/0015) 29 | ([Youtube](https://youtube.com/ThatProject)) 30 | ([Facebook](https://www.facebook.com/groups/138965931539175))] 31 | 32 | 33 | ### MIT License 34 | 35 | Copyright (c) 2022 Eric 36 | 37 | Permission is hereby granted, free of charge, to any person obtaining a copy 38 | of this software and associated documentation files (the "Software"), to deal 39 | in the Software without restriction, including without limitation the rights 40 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 41 | copies of the Software, and to permit persons to whom the Software is 42 | furnished to do so, subject to the following conditions: 43 | 44 | The above copyright notice and this permission notice shall be included in all 45 | copies or substantial portions of the Software. 46 | 47 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 48 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 49 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 50 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 51 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 52 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 53 | SOFTWARE. -------------------------------------------------------------------------------- /esp32/examples/.gitignore: -------------------------------------------------------------------------------- 1 | private/ -------------------------------------------------------------------------------- /esp32/examples/color_code/.gitignore: -------------------------------------------------------------------------------- 1 | build/ 2 | scripts/__pycache__ -------------------------------------------------------------------------------- /esp32/examples/color_code/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 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 5 | project(color_code) 6 | -------------------------------------------------------------------------------- /esp32/examples/color_code/README.md: -------------------------------------------------------------------------------- 1 | # TTGO demo 2 | 3 | This demo purpose is to see the cross-compiled OpenCV library working on the TTGO module (see https://github.com/Xinyuan-LilyGo/esp32-camera-screen), using an OV2640 camera and an LCD. 4 | 5 | The demo gets an image from the camera, then depending on the DisplayMode (changing at regular interval), applies a Grayscale, Binary or Canny filter on it and finally displays it on the LCD. 6 | 7 | ![ttgo_demo](demo/ttgo_demo.gif) 8 | 9 | 10 | 11 | The performances of the processing are approximately: 12 | 13 | * 6 fps with RGB565 image 14 | * 6 fps with Grayscale image 15 | * 6 fps with Threshold transformation 16 | * 3 fps with Canny detection 17 | 18 | 19 | 20 | The size taken by the application is the following: 21 | 22 | ```bash 23 | Total sizes: 24 | DRAM .data size: 33536 bytes 25 | DRAM .bss size: 74424 bytes 26 | Used static DRAM: 107960 bytes ( 72776 available, 59.7% used) 27 | Used static IRAM: 79695 bytes ( 51377 available, 60.8% used) 28 | Flash code: 1 096 883 bytes 29 | Flash rodata: 356 144 bytes 30 | Total image size:~1 640 682 bytes (.bin may be padded larger) 31 | ``` 32 | 33 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/esp32-camera/.gitignore: -------------------------------------------------------------------------------- 1 | *.DS_Store 2 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/esp32-camera/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | set(COMPONENT_SRCS 2 | driver/camera.c 3 | driver/sccb.c 4 | driver/sensor.c 5 | driver/twi.c 6 | driver/xclk.c 7 | sensors/ov2640.c 8 | sensors/ov3660.c 9 | sensors/ov5640.c 10 | sensors/ov7725.c 11 | conversions/yuv.c 12 | conversions/to_jpg.cpp 13 | conversions/to_bmp.c 14 | conversions/jpge.cpp 15 | conversions/esp_jpg_decode.c 16 | ) 17 | 18 | set(COMPONENT_ADD_INCLUDEDIRS 19 | driver/include 20 | conversions/include 21 | ) 22 | 23 | set(COMPONENT_PRIV_INCLUDEDIRS 24 | driver/private_include 25 | sensors/private_include 26 | conversions/private_include 27 | ) 28 | 29 | set(COMPONENT_REQUIRES driver) 30 | set(COMPONENT_PRIV_REQUIRES freertos nvs_flash) 31 | 32 | register_component() 33 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/esp32-camera/Kconfig: -------------------------------------------------------------------------------- 1 | menu "Camera configuration" 2 | 3 | config OV2640_SUPPORT 4 | bool "OV2640 Support" 5 | default y 6 | help 7 | Enable this option if you want to use the OV2640. 8 | Disable this option to save memory. 9 | 10 | config OV7725_SUPPORT 11 | bool "OV7725 Support" 12 | default n 13 | help 14 | Enable this option if you want to use the OV7725. 15 | Disable this option to save memory. 16 | 17 | config OV3660_SUPPORT 18 | bool "OV3660 Support" 19 | default y 20 | help 21 | Enable this option if you want to use the OV3360. 22 | Disable this option to save memory. 23 | 24 | config OV5640_SUPPORT 25 | bool "OV5640 Support" 26 | default y 27 | help 28 | Enable this option if you want to use the OV5640. 29 | Disable this option to save memory. 30 | 31 | config SCCB_HARDWARE_I2C 32 | bool "Use hardware I2C for SCCB" 33 | default y 34 | help 35 | Enable this option if you want to use hardware I2C to control the camera. 36 | Disable this option to use software I2C. 37 | 38 | choice SCCB_HARDWARE_I2C_PORT 39 | bool "I2C peripheral to use for SCCB" 40 | depends on SCCB_HARDWARE_I2C 41 | default SCCB_HARDWARE_I2C_PORT1 42 | 43 | config SCCB_HARDWARE_I2C_PORT0 44 | bool "I2C0" 45 | config SCCB_HARDWARE_I2C_PORT1 46 | bool "I2C1" 47 | 48 | endchoice 49 | 50 | choice CAMERA_TASK_PINNED_TO_CORE 51 | bool "Camera task pinned to core" 52 | default CAMERA_CORE0 53 | help 54 | Pin the camera handle task to a certain core(0/1). It can also be done automatically choosing NO_AFFINITY. 55 | 56 | config CAMERA_CORE0 57 | bool "CORE0" 58 | config CAMERA_CORE1 59 | bool "CORE1" 60 | config CAMERA_NO_AFFINITY 61 | bool "NO_AFFINITY" 62 | 63 | endchoice 64 | 65 | endmenu 66 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/esp32-camera/component.mk: -------------------------------------------------------------------------------- 1 | COMPONENT_ADD_INCLUDEDIRS := driver/include conversions/include 2 | COMPONENT_PRIV_INCLUDEDIRS := driver/private_include conversions/private_include sensors/private_include 3 | COMPONENT_SRCDIRS := driver conversions sensors 4 | CXXFLAGS += -fno-rtti 5 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/esp32-camera/conversions/include/esp_jpg_decode.h: -------------------------------------------------------------------------------- 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 | #ifndef _ESP_JPG_DECODE_H_ 15 | #define _ESP_JPG_DECODE_H_ 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | #include 22 | #include 23 | #include 24 | #include "esp_err.h" 25 | 26 | typedef enum { 27 | JPG_SCALE_NONE, 28 | JPG_SCALE_2X, 29 | JPG_SCALE_4X, 30 | JPG_SCALE_8X, 31 | JPG_SCALE_MAX = JPG_SCALE_8X 32 | } jpg_scale_t; 33 | 34 | typedef size_t (* jpg_reader_cb)(void * arg, size_t index, uint8_t *buf, size_t len); 35 | typedef bool (* jpg_writer_cb)(void * arg, uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint8_t *data); 36 | 37 | esp_err_t esp_jpg_decode(size_t len, jpg_scale_t scale, jpg_reader_cb reader, jpg_writer_cb writer, void * arg); 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | #endif /* _ESP_JPG_DECODE_H_ */ 44 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/esp32-camera/conversions/private_include/yuv.h: -------------------------------------------------------------------------------- 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 | #ifndef _CONVERSIONS_YUV_H_ 15 | #define _CONVERSIONS_YUV_H_ 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | #include 22 | 23 | void yuv2rgb(uint8_t y, uint8_t u, uint8_t v, uint8_t *r, uint8_t *g, uint8_t *b); 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | 29 | #endif /* _CONVERSIONS_YUV_H_ */ 30 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/esp32-camera/driver/private_include/camera_common.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include "esp_err.h" 7 | #include "esp_intr_alloc.h" 8 | #include "freertos/FreeRTOS.h" 9 | #include "freertos/semphr.h" 10 | #include "freertos/task.h" 11 | #include "esp_camera.h" 12 | #include "sensor.h" 13 | 14 | #include "esp_system.h" 15 | #if ESP_IDF_VERSION_MAJOR >= 4 // IDF 4+ 16 | #if CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4 17 | #include "esp32/rom/lldesc.h" 18 | #else 19 | #error Target CONFIG_IDF_TARGET is not supported 20 | #endif 21 | #else // ESP32 Before IDF 4.0 22 | #include "rom/lldesc.h" 23 | #endif 24 | 25 | typedef union { 26 | struct { 27 | uint8_t sample2; 28 | uint8_t unused2; 29 | uint8_t sample1; 30 | uint8_t unused1; 31 | }; 32 | uint32_t val; 33 | } dma_elem_t; 34 | 35 | typedef enum { 36 | /* camera sends byte sequence: s1, s2, s3, s4, ... 37 | * fifo receives: 00 s1 00 s2, 00 s2 00 s3, 00 s3 00 s4, ... 38 | */ 39 | SM_0A0B_0B0C = 0, 40 | /* camera sends byte sequence: s1, s2, s3, s4, ... 41 | * fifo receives: 00 s1 00 s2, 00 s3 00 s4, ... 42 | */ 43 | SM_0A0B_0C0D = 1, 44 | /* camera sends byte sequence: s1, s2, s3, s4, ... 45 | * fifo receives: 00 s1 00 00, 00 s2 00 00, 00 s3 00 00, ... 46 | */ 47 | SM_0A00_0B00 = 3, 48 | } i2s_sampling_mode_t; 49 | 50 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/esp32-camera/driver/private_include/sccb.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenMV project. 3 | * Copyright (c) 2013/2014 Ibrahim Abdelkader 4 | * This work is licensed under the MIT license, see the file LICENSE for details. 5 | * 6 | * SCCB (I2C like) driver. 7 | * 8 | */ 9 | #ifndef __SCCB_H__ 10 | #define __SCCB_H__ 11 | #include 12 | int SCCB_Init(int pin_sda, int pin_scl); 13 | uint8_t SCCB_Probe(); 14 | uint8_t SCCB_Read(uint8_t slv_addr, uint8_t reg); 15 | uint8_t SCCB_Write(uint8_t slv_addr, uint8_t reg, uint8_t data); 16 | uint8_t SCCB_Read16(uint8_t slv_addr, uint16_t reg); 17 | uint8_t SCCB_Write16(uint8_t slv_addr, uint16_t reg, uint8_t data); 18 | #endif // __SCCB_H__ 19 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/esp32-camera/driver/private_include/twi.h: -------------------------------------------------------------------------------- 1 | /* 2 | twi.h - Software I2C library for ESP31B 3 | 4 | Copyright (c) 2015 Hristo Gochkov. All rights reserved. 5 | This file is part of the ESP31B core for Arduino environment. 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General Public 18 | License along with this library; if not, write to the Free Software 19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 20 | */ 21 | #ifndef SI2C_h 22 | #define SI2C_h 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | void twi_init(unsigned char sda, unsigned char scl); 29 | void twi_stop(void); 30 | void twi_setClock(unsigned int freq); 31 | uint8_t twi_writeTo(unsigned char address, unsigned char * buf, unsigned int len, unsigned char sendStop); 32 | uint8_t twi_readFrom(unsigned char address, unsigned char * buf, unsigned int len, unsigned char sendStop); 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif -------------------------------------------------------------------------------- /esp32/examples/color_code/components/esp32-camera/driver/private_include/xclk.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "camera_common.h" 4 | 5 | esp_err_t camera_enable_out_clock(); 6 | 7 | void camera_disable_out_clock(); 8 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/esp32-camera/driver/sensor.c: -------------------------------------------------------------------------------- 1 | #include "sensor.h" 2 | 3 | const resolution_info_t resolution[FRAMESIZE_INVALID] = { 4 | { 96, 96, ASPECT_RATIO_1X1 }, /* 96x96 */ 5 | { 160, 120, ASPECT_RATIO_4X3 }, /* QQVGA */ 6 | { 176, 144, ASPECT_RATIO_5X4 }, /* QCIF */ 7 | { 240, 176, ASPECT_RATIO_4X3 }, /* HQVGA */ 8 | { 240, 240, ASPECT_RATIO_1X1 }, /* 240x240 */ 9 | { 320, 240, ASPECT_RATIO_4X3 }, /* QVGA */ 10 | { 400, 296, ASPECT_RATIO_4X3 }, /* CIF */ 11 | { 480, 320, ASPECT_RATIO_3X2 }, /* HVGA */ 12 | { 640, 480, ASPECT_RATIO_4X3 }, /* VGA */ 13 | { 800, 600, ASPECT_RATIO_4X3 }, /* SVGA */ 14 | { 1024, 768, ASPECT_RATIO_4X3 }, /* XGA */ 15 | { 1280, 720, ASPECT_RATIO_16X9 }, /* HD */ 16 | { 1280, 1024, ASPECT_RATIO_5X4 }, /* SXGA */ 17 | { 1600, 1200, ASPECT_RATIO_4X3 }, /* UXGA */ 18 | // 3MP Sensors 19 | { 1920, 1080, ASPECT_RATIO_16X9 }, /* FHD */ 20 | { 720, 1280, ASPECT_RATIO_9X16 }, /* Portrait HD */ 21 | { 864, 1536, ASPECT_RATIO_9X16 }, /* Portrait 3MP */ 22 | { 2048, 1536, ASPECT_RATIO_4X3 }, /* QXGA */ 23 | // 5MP Sensors 24 | { 2560, 1440, ASPECT_RATIO_16X9 }, /* QHD */ 25 | { 2560, 1600, ASPECT_RATIO_16X10 }, /* WQXGA */ 26 | { 1088, 1920, ASPECT_RATIO_9X16 }, /* Portrait FHD */ 27 | { 2560, 1920, ASPECT_RATIO_4X3 }, /* QSXGA */ 28 | }; 29 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/esp32-camera/driver/xclk.c: -------------------------------------------------------------------------------- 1 | #include "driver/gpio.h" 2 | #include "driver/ledc.h" 3 | #include "esp_err.h" 4 | #include "esp_log.h" 5 | #include "esp_system.h" 6 | #include "xclk.h" 7 | 8 | #if defined(ARDUINO_ARCH_ESP32) && defined(CONFIG_ARDUHAL_ESP_LOG) 9 | #include "esp32-hal-log.h" 10 | #else 11 | #include "esp_log.h" 12 | static const char* TAG = "camera_xclk"; 13 | #endif 14 | 15 | esp_err_t xclk_timer_conf(int ledc_timer, int xclk_freq_hz) 16 | { 17 | ledc_timer_config_t timer_conf; 18 | timer_conf.duty_resolution = 2; 19 | timer_conf.freq_hz = xclk_freq_hz; 20 | timer_conf.speed_mode = LEDC_HIGH_SPEED_MODE; 21 | #if ESP_IDF_VERSION_MAJOR >= 4 22 | timer_conf.clk_cfg = LEDC_AUTO_CLK; 23 | #endif 24 | timer_conf.timer_num = (ledc_timer_t)ledc_timer; 25 | esp_err_t err = ledc_timer_config(&timer_conf); 26 | if (err != ESP_OK) { 27 | ESP_LOGE(TAG, "ledc_timer_config failed for freq %d, rc=%x", xclk_freq_hz, err); 28 | } 29 | return err; 30 | } 31 | 32 | esp_err_t camera_enable_out_clock(camera_config_t* config) 33 | { 34 | periph_module_enable(PERIPH_LEDC_MODULE); 35 | 36 | esp_err_t err = xclk_timer_conf(config->ledc_timer, config->xclk_freq_hz); 37 | if (err != ESP_OK) { 38 | ESP_LOGE(TAG, "ledc_timer_config failed, rc=%x", err); 39 | return err; 40 | } 41 | 42 | ledc_channel_config_t ch_conf; 43 | ch_conf.gpio_num = config->pin_xclk; 44 | ch_conf.speed_mode = LEDC_HIGH_SPEED_MODE; 45 | ch_conf.channel = config->ledc_channel; 46 | ch_conf.intr_type = LEDC_INTR_DISABLE; 47 | ch_conf.timer_sel = config->ledc_timer; 48 | ch_conf.duty = 2; 49 | ch_conf.hpoint = 0; 50 | err = ledc_channel_config(&ch_conf); 51 | if (err != ESP_OK) { 52 | ESP_LOGE(TAG, "ledc_channel_config failed, rc=%x", err); 53 | return err; 54 | } 55 | return ESP_OK; 56 | } 57 | 58 | void camera_disable_out_clock() 59 | { 60 | periph_module_disable(PERIPH_LEDC_MODULE); 61 | } 62 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/esp32-camera/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "esp32-camera", 3 | "version": "1.0.0", 4 | "keywords": "esp32, camera, espressif, esp32-cam", 5 | "description": "ESP32 compatible driver for OV2640, OV3660, OV5640 and OV7725 image sensors.", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/espressif/esp32-camera" 9 | }, 10 | "frameworks": "espidf", 11 | "platforms": "*", 12 | "build": { 13 | "flags": [ 14 | "-Idriver/include", 15 | "-Iconversions/include", 16 | "-Idriver/private_include", 17 | "-Iconversions/private_include", 18 | "-Isensors/private_include", 19 | "-fno-rtti" 20 | ], 21 | "includeDir": ".", 22 | "srcDir": ".", 23 | "srcFilter": ["-<*>", "+", "+", "+"] 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/esp32-camera/sensors/private_include/ov2640.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenMV project. 3 | * Copyright (c) 2013/2014 Ibrahim Abdelkader 4 | * This work is licensed under the MIT license, see the file LICENSE for details. 5 | * 6 | * OV2640 driver. 7 | * 8 | */ 9 | #ifndef __OV2640_H__ 10 | #define __OV2640_H__ 11 | #include "sensor.h" 12 | int ov2640_init(sensor_t *sensor); 13 | #endif // __OV2640_H__ 14 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/esp32-camera/sensors/private_include/ov3660.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenMV project. 3 | * Copyright (c) 2013/2014 Ibrahim Abdelkader 4 | * This work is licensed under the MIT license, see the file LICENSE for details. 5 | * 6 | * OV3660 driver. 7 | * 8 | */ 9 | #ifndef __OV3660_H__ 10 | #define __OV3660_H__ 11 | 12 | #include "sensor.h" 13 | 14 | int ov3660_init(sensor_t *sensor); 15 | 16 | #endif // __OV3660_H__ 17 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/esp32-camera/sensors/private_include/ov5640.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __OV5640_H__ 3 | #define __OV5640_H__ 4 | 5 | #include "sensor.h" 6 | 7 | int ov5640_init(sensor_t *sensor); 8 | 9 | #endif // __OV5640_H__ 10 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/esp32-camera/sensors/private_include/ov7725.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the OpenMV project. 3 | * Copyright (c) 2013/2014 Ibrahim Abdelkader 4 | * This work is licensed under the MIT license, see the file LICENSE for details. 5 | * 6 | * OV7725 driver. 7 | * 8 | */ 9 | #ifndef __OV7725_H__ 10 | #define __OV7725_H__ 11 | #include "sensor.h" 12 | 13 | int ov7725_init(sensor_t *sensor); 14 | #endif // __OV7725_H__ 15 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lcd/Adafruit-GFX-Library/.gitignore: -------------------------------------------------------------------------------- 1 | default.vim 2 | fontconvert/fontconvert 3 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lcd/Adafruit-GFX-Library/Adafruit_SPITFT.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _ADAFRUIT_SPITFT_ 3 | #define _ADAFRUIT_SPITFT_ 4 | 5 | 6 | #if ARDUINO >= 100 7 | #include "Arduino.h" 8 | #include "Print.h" 9 | #else 10 | #include "WProgram.h" 11 | #endif 12 | #include 13 | #include "Adafruit_GFX.h" 14 | 15 | 16 | #if defined(ARDUINO_STM32_FEATHER) 17 | typedef volatile uint32 RwReg; 18 | #endif 19 | #if defined(ARDUINO_FEATHER52) 20 | typedef volatile uint32_t RwReg; 21 | #endif 22 | 23 | class Adafruit_SPITFT : public Adafruit_GFX { 24 | protected: 25 | 26 | public: 27 | Adafruit_SPITFT(uint16_t w, uint16_t h, int8_t _CS, int8_t _DC, int8_t _MOSI, int8_t _SCLK, int8_t _RST = -1, int8_t _MISO = -1); 28 | Adafruit_SPITFT(uint16_t w, uint16_t h, int8_t _CS, int8_t _DC, int8_t _RST = -1); 29 | 30 | virtual void begin(uint32_t freq) = 0; 31 | void initSPI(uint32_t freq); 32 | 33 | // Required Non-Transaction 34 | void drawPixel(int16_t x, int16_t y, uint16_t color); 35 | 36 | // Transaction API 37 | void startWrite(void); 38 | void endWrite(void); 39 | void writePixel(int16_t x, int16_t y, uint16_t color); 40 | void writeFillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color); 41 | void writeFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color); 42 | void writeFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color); 43 | 44 | // Transaction API not used by GFX 45 | virtual void setAddrWindow(uint16_t x, uint16_t y, uint16_t w, uint16_t h) = 0; 46 | void writePixel(uint16_t color); 47 | void writePixels(uint16_t * colors, uint32_t len); 48 | void writeColor(uint16_t color, uint32_t len); 49 | void pushColor(uint16_t color); 50 | 51 | // Recommended Non-Transaction 52 | void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color); 53 | void drawFastHLine(int16_t x, int16_t y, int16_t w, uint16_t color); 54 | void fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color); 55 | 56 | using Adafruit_GFX::drawRGBBitmap; // Check base class first 57 | void drawRGBBitmap(int16_t x, int16_t y, 58 | uint16_t *pcolors, int16_t w, int16_t h); 59 | 60 | uint16_t color565(uint8_t r, uint8_t g, uint8_t b); 61 | 62 | protected: 63 | uint32_t _freq; 64 | #if defined (__AVR__) || defined(TEENSYDUINO) || defined (ESP8266) || defined (ESP32) 65 | int8_t _cs, _dc, _rst, _sclk, _mosi, _miso; 66 | #else 67 | int32_t _cs, _dc, _rst, _sclk, _mosi, _miso; 68 | #endif 69 | 70 | #ifdef USE_FAST_PINIO 71 | volatile RwReg *mosiport, *misoport, *clkport, *dcport, *csport; 72 | RwReg mosipinmask, misopinmask, clkpinmask, cspinmask, dcpinmask; 73 | #endif 74 | 75 | void writeCommand(uint8_t cmd); 76 | void spiWrite(uint8_t v); 77 | uint8_t spiRead(void); 78 | }; 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lcd/Adafruit-GFX-Library/fontconvert/Makefile: -------------------------------------------------------------------------------- 1 | all: fontconvert 2 | 3 | CC = gcc 4 | CFLAGS = -Wall -I/usr/local/include/freetype2 -I/usr/include/freetype2 -I/usr/include 5 | LIBS = -lfreetype 6 | 7 | fontconvert: fontconvert.c 8 | $(CC) $(CFLAGS) $< $(LIBS) -o $@ 9 | strip $@ 10 | 11 | clean: 12 | rm -f fontconvert 13 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lcd/Adafruit-GFX-Library/fontconvert/makefonts.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Ugly little Bash script, generates a set of .h files for GFX using 4 | # GNU FreeFont sources. There are three fonts: 'Mono' (Courier-like), 5 | # 'Sans' (Helvetica-like) and 'Serif' (Times-like); four styles: regular, 6 | # bold, oblique or italic, and bold+oblique or bold+italic; and four 7 | # sizes: 9, 12, 18 and 24 point. No real error checking or anything, 8 | # this just powers through all the combinations, calling the fontconvert 9 | # utility and redirecting the output to a .h file for each combo. 10 | 11 | # Adafruit_GFX repository does not include the source outline fonts 12 | # (huge zipfile, different license) but they're easily acquired: 13 | # http://savannah.gnu.org/projects/freefont/ 14 | 15 | convert=./fontconvert 16 | inpath=~/Desktop/freefont/ 17 | outpath=../Fonts/ 18 | fonts=(FreeMono FreeSans FreeSerif) 19 | styles=("" Bold Italic BoldItalic Oblique BoldOblique) 20 | sizes=(9 12 18 24) 21 | 22 | for f in ${fonts[*]} 23 | do 24 | for index in ${!styles[*]} 25 | do 26 | st=${styles[$index]} 27 | for si in ${sizes[*]} 28 | do 29 | infile=$inpath$f$st".ttf" 30 | if [ -f $infile ] # Does source combination exist? 31 | then 32 | outfile=$outpath$f$st$si"pt7b.h" 33 | # printf "%s %s %s > %s\n" $convert $infile $si $outfile 34 | $convert $infile $si > $outfile 35 | fi 36 | done 37 | done 38 | done 39 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lcd/Adafruit-GFX-Library/gfxfont.h: -------------------------------------------------------------------------------- 1 | // Font structures for newer Adafruit_GFX (1.1 and later). 2 | // Example fonts are included in 'Fonts' directory. 3 | // To use a font in your Arduino sketch, #include the corresponding .h 4 | // file and pass address of GFXfont struct to setFont(). Pass NULL to 5 | // revert to 'classic' fixed-space bitmap font. 6 | 7 | #ifndef _GFXFONT_H_ 8 | #define _GFXFONT_H_ 9 | 10 | typedef struct { // Data stored PER GLYPH 11 | uint16_t bitmapOffset; // Pointer into GFXfont->bitmap 12 | uint8_t width, height; // Bitmap dimensions in pixels 13 | uint8_t xAdvance; // Distance to advance cursor (x axis) 14 | int8_t xOffset, yOffset; // Dist from cursor pos to UL corner 15 | } GFXglyph; 16 | 17 | typedef struct { // Data stored for FONT AS A WHOLE: 18 | uint8_t *bitmap; // Glyph bitmaps, concatenated 19 | GFXglyph *glyph; // Glyph array 20 | uint8_t first, last; // ASCII extents 21 | uint8_t yAdvance; // Newline distance (y axis) 22 | } GFXfont; 23 | 24 | #endif // _GFXFONT_H_ 25 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lcd/Adafruit-GFX-Library/library.properties: -------------------------------------------------------------------------------- 1 | name=Adafruit GFX Library 2 | version=1.2.3 3 | author=Adafruit 4 | maintainer=Adafruit 5 | sentence=Adafruit GFX graphics core library, this is the 'core' class that all our other graphics libraries derive from. 6 | paragraph=Install this library in addition to the display library for your hardware. 7 | category=Display 8 | url=https://github.com/adafruit/Adafruit-GFX-Library 9 | architectures=* 10 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lcd/Adafruit-GFX-Library/license.txt: -------------------------------------------------------------------------------- 1 | Software License Agreement (BSD License) 2 | 3 | Copyright (c) 2012 Adafruit Industries. All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | - Redistributions of source code must retain the above copyright notice, 9 | this list of conditions and the following disclaimer. 10 | - Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 15 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 18 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 19 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 20 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 24 | POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lcd/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register( 2 | SRC_DIRS 3 | . 4 | Adafruit-GFX-Library 5 | 6 | INCLUDE_DIRS 7 | include 8 | Adafruit-GFX-Library/Fonts 9 | Adafruit-GFX-Library 10 | 11 | PRIV_REQUIRES 12 | spi_flash 13 | ) 14 | 15 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D__AVR_ATtiny85__") -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lcd/README.md: -------------------------------------------------------------------------------- 1 | ##TFT LCD Example Code for ESP32## 2 | 3 | This example is based on [Adafruit’s Library](https://github.com/adafruit/Adafruit-GFX-Library.git) for ILI9341. This component can display
4 | 1. Text
5 | 2. Bitmap Images
6 | 3. Shapes
7 | on the 320*240 TFT LCD
8 | Users can refer `ui_example.jpg` in the root folder of this example to learn more about the APIs & what they do. 9 | 10 | LCD has Serial & Parallel Interfaces, esp-wrover-kit is designed for Serial SPI interfacing. However, LCD requires some additional pins except the normal SPI pins. 11 | 12 | 13 | > Tip: TFT LCDs work on a basic bitmap, where you should tell each pixel what to do. The library is able to display data by a concept of foreground and background.
For eg: If white text is required on a black background, screen is filled with black, the foreground color is set to white. Only the bitmap pixels which define the font are cleared, and the rest are kept as they are. This is how bitmaps, fonts and shapes are printed on the screen. 14 | 15 | 16 | **Additional files required for the GUI** 17 | 18 | `components\lcd` folder
19 | 1. `Adafruit-GFX-Library`: Adafruit-GFX-Library
20 | 2. `Adafruit_lcd_fast_as.cpp`: Used for drawing pixels and some lines on the screen, and this subclass overrides most of the superclass methods in `Adafruit_GFX.cpp`
21 | 3. `Adafruit-GFX-Library/Font files`: It is the bitmap for various sizes of fonts (Prefer to only #include your desired fonts to save space)
22 | 4. `spi_lcd.c` : It has some SPI structures & functions which use the spi_master driver for sending out the data as required by Adafruit Libraries. 23 | 24 | > Note: To reduce the number of pins between the LCD & ESP32
25 | > - It is okay to leave out the MISO pin
26 | > - Short the backlight pin to always ON
27 | > - Reset pin can be shorted with the ESP32’s reset pin, but it might lead to unexpected behavior depending on the code. 28 | 29 | 30 | There have been multiple additions to the [Adafruit repository](https://github.com/adafruit/Adafruit_ILI9341) for the LCD, users can replace these files by new library if needed. Adafruit has made a good [documentation](https://cdn-learn.adafruit.com/downloads/pdf/adafruit-2-8-tft-touch-shield-v2.pdf) on TFT LCDs. 31 | 32 | If you are willing to share your User Interface for ESP32, you can do so by posting on the forum [here](http://bbs.esp32.com/). -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lcd/adaptation.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | This is the subclass graphics library for all our displays, providing a common 3 | set of graphics primitives (points, lines, circles, etc.) 4 | 5 | Adafruit invests time and resources providing this open source code, please 6 | support Adafruit & open-source hardware by purchasing products from Adafruit! 7 | 8 | Based on ESP8266 library https://github.com/Sermus/ESP8266_Adafruit_lcd 9 | 10 | Copyright (c) 2015-2016 Andrey Filimonov. All rights reserved. 11 | 12 | Additions for ESP32 Copyright (c) 2016-2017 Espressif Systems (Shanghai) PTE LTD 13 | 14 | Copyright (c) 2013 Adafruit Industries. All rights reserved. 15 | 16 | Redistribution and use in source and binary forms, with or without 17 | modification, are permitted provided that the following conditions are met: 18 | 19 | - Redistributions of source code must retain the above copyright notice, 20 | this list of conditions and the following disclaimer. 21 | - Redistributions in binary form must reproduce the above copyright notice, 22 | this list of conditions and the following disclaimer in the documentation 23 | and/or other materials provided with the distribution. 24 | 25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 28 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 29 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 30 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 31 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 32 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 33 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 34 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 35 | POSSIBILITY OF SUCH DAMAGE. 36 | */ 37 | 38 | #include "WProgram.h" 39 | // Do nothing here 40 | void Print::print(char* s){ 41 | 42 | } -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lcd/component.mk.old: -------------------------------------------------------------------------------- 1 | # 2 | # "main" pseudo-component makefile. 3 | # 4 | # (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.) 5 | CXXFLAGS += -D__AVR_ATtiny85__ 6 | 7 | # ifdef CONFIG_IOT_EINK_ENABLE 8 | COMPONENT_ADD_INCLUDEDIRS := include Adafruit-GFX-Library/Fonts Adafruit-GFX-Library 9 | COMPONENT_SRCDIRS := . Adafruit-GFX-Library 10 | 11 | # else 12 | # # Disable component 13 | # COMPONENT_ADD_INCLUDEDIRS := 14 | # COMPONENT_ADD_LDFLAGS := 15 | # COMPONENT_SRCDIRS := 16 | # endif -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lcd/include/WProgram.h: -------------------------------------------------------------------------------- 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 | #ifndef _WPROGRAM_H_ 15 | #define _WPROGRAM_H_ 16 | 17 | #include "string.h" 18 | #include "esp_types.h" 19 | #include "freertos/FreeRTOS.h" 20 | 21 | #define abs(x) ((x)<0 ? -(x) : (x)) 22 | #define swap(x, y) do { typeof(x) temp##x##y = x; x = y; y = temp##x##y; } while (0) 23 | 24 | typedef bool boolean; 25 | typedef char __FlashStringHelper; 26 | 27 | class Print{ 28 | public: 29 | void print(char* s); 30 | }; 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lcd/include/font7s.h: -------------------------------------------------------------------------------- 1 | #ifndef _FONT_H_ 2 | #define _FONT_H_ 3 | 4 | #define NR_CHRS_F7S 96 5 | #define CHR_HGT_F7S 48 6 | #define DATA_SIZE_F7S 8 7 | #define FIRSTCHR_F7S 32 8 | 9 | extern const unsigned char widtbl_f7s[96]; 10 | extern const unsigned char *chrtbl_f7s[96]; 11 | 12 | #endif -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lcd/include/gfxfont.h: -------------------------------------------------------------------------------- 1 | // Font structures for newer Adafruit_GFX (1.1 and later). 2 | // Example fonts are included in 'Fonts' directory. 3 | // To use a font in your Arduino sketch, #include the corresponding .h 4 | // file and pass address of GFXfont struct to setFont(). Pass NULL to 5 | // revert to 'classic' fixed-space bitmap font. 6 | 7 | #ifndef _GFXFONT_H_ 8 | #define _GFXFONT_H_ 9 | 10 | typedef struct { // Data stored PER GLYPH 11 | uint16_t bitmapOffset; // Pointer into GFXfont->bitmap 12 | uint8_t width, height; // Bitmap dimensions in pixels 13 | uint8_t xAdvance; // Distance to advance cursor (x axis) 14 | int8_t xOffset, yOffset; // Dist from cursor pos to UL corner 15 | } GFXglyph; 16 | 17 | typedef struct { // Data stored for FONT AS A WHOLE: 18 | uint8_t *bitmap; // Glyph bitmaps, concatenated 19 | GFXglyph *glyph; // Glyph array 20 | uint8_t first, last; // ASCII extents 21 | uint8_t yAdvance; // Newline distance (y axis) 22 | } GFXfont; 23 | 24 | #endif // _GFXFONT_H_ 25 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lcd/include/glcdfont.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | extern const unsigned char font[]; 4 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lcd/include/spi_lcd.h: -------------------------------------------------------------------------------- 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 | #ifndef _IOT_SPI_LCD_H_ 15 | #define _IOT_SPI_LCD_H_ 16 | 17 | #include "driver/spi_master.h" 18 | #include "iot_lcd.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | /** @brief Initialize the LCD by putting some data in the graphics registers 25 | * 26 | * @param pin_conf Pointer to the struct with mandatory pins required for the LCD 27 | * @param spi_wr_dev Pointer to the SPI handler for sending the data 28 | * @return lcd id 29 | */ 30 | uint32_t lcd_init(lcd_conf_t* lcd_conf, spi_device_handle_t *spi_wr_dev, lcd_dc_t *dc, int dma_chan); 31 | 32 | /*Used by adafruit functions to send data*/ 33 | void lcd_send_uint16_r(spi_device_handle_t spi, const uint16_t data, int32_t repeats, lcd_dc_t *dc); 34 | 35 | /*Send a command to the ILI9341. Uses spi_device_transmit, 36 | which waits until the transfer is complete */ 37 | void lcd_cmd(spi_device_handle_t spi, const uint8_t cmd, lcd_dc_t *dc); 38 | 39 | /*Send data to the ILI9341. Uses spi_device_transmit, 40 | which waits until the transfer is complete */ 41 | void lcd_data(spi_device_handle_t spi, const uint8_t *data, int len, lcd_dc_t *dc); 42 | 43 | /** @brief Read LCD IDs using SPI, not working yet 44 | * The 1st parameter is dummy data. 45 | * The 2nd parameter (ID1 [7:0]): LCD module's manufacturer ID. 46 | * The 3rd parameter (ID2 [7:0]): LCD module/driver version ID. 47 | * The 4th parameter (ID3 [7:0]): LCD module/driver ID. 48 | * @param spi spi handler 49 | * @param lcd_id pointer to struct for reading IDs 50 | */ 51 | void lcd_read_id(spi_device_handle_t spi, lcd_id_t *lcd_id, lcd_dc_t *dc); 52 | 53 | /** 54 | * @brief get LCD ID 55 | */ 56 | uint32_t lcd_get_id(spi_device_handle_t spi, lcd_dc_t *dc); 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lcd/test/component.mk: -------------------------------------------------------------------------------- 1 | # 2 | #Component Makefile 3 | # 4 | 5 | COMPONENT_ADD_LDFLAGS = -Wl,--whole-archive -l$(COMPONENT_NAME) -Wl,--no-whole-archive 6 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register( 2 | SRC_DIRS 3 | . 4 | lvgl/src/lv_core 5 | lvgl/src/lv_draw 6 | lvgl/src/lv_font 7 | lvgl/src/lv_hal 8 | lvgl/src/lv_misc 9 | lvgl/src/lv_widgets 10 | lvgl/src/lv_themes 11 | 12 | INCLUDE_DIRS 13 | . 14 | include 15 | lvgl 16 | lvgl/src/lv_core 17 | lvgl/src/lv_draw 18 | lvgl/src/lv_font 19 | lvgl/src/lv_hal 20 | lvgl/src/lv_misc 21 | lvgl/src/lv_widgets 22 | lvgl/src/lv_themes 23 | 24 | PRIV_INCLUDE_DIRS 25 | . 26 | include 27 | lvgl 28 | lvgl/src/lv_core 29 | lvgl/src/lv_draw 30 | lvgl/src/lv_font 31 | lvgl/src/lv_hal 32 | lvgl/src/lv_misc 33 | lvgl/src/lv_widgets 34 | lvgl/src/lv_themes 35 | 36 | PRIV_REQUIRES 37 | main 38 | ) -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/README.md: -------------------------------------------------------------------------------- 1 | [[中文]](../../../documents/hmi_solution/littlevgl/littlevgl_guide_cn.md)/[[EN]]((../../../documents/hmi_solution/littlevgl/littlevgl_guide_en.md)) 2 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/component.mk.old: -------------------------------------------------------------------------------- 1 | # 2 | # "main" pseudo-component makefile. 3 | # 4 | # (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.) 5 | 6 | LVGLLIB = lvgl 7 | 8 | COMPONENT_SRCDIRS := . \ 9 | ./include \ 10 | $(LVGLLIB) \ 11 | $(LVGLLIB)/lv_core \ 12 | $(LVGLLIB)/lv_draw \ 13 | $(LVGLLIB)/lv_hal \ 14 | $(LVGLLIB)/lv_misc \ 15 | $(LVGLLIB)/lv_fonts \ 16 | $(LVGLLIB)/lv_objx \ 17 | $(LVGLLIB)/lv_themes \ 18 | 19 | COMPONENT_ADD_INCLUDEDIRS := . \ 20 | ./include \ 21 | $(LVGLLIB) \ 22 | $(LVGLLIB)/lv_core \ 23 | $(LVGLLIB)/lv_draw \ 24 | $(LVGLLIB)/lv_hal \ 25 | $(LVGLLIB)/lv_misc \ 26 | $(LVGLLIB)/lv_fonts \ 27 | $(LVGLLIB)/lv_objx \ 28 | $(LVGLLIB)/lv_themes \ 29 | 30 | COMPONENT_PRIV_INCLUDEDIRS += . \ 31 | ./include \ 32 | $(LVGLLIB) \ 33 | $(LVGLLIB)/lv_core \ 34 | $(LVGLLIB)/lv_draw \ 35 | $(LVGLLIB)/lv_hal \ 36 | $(LVGLLIB)/lv_misc \ 37 | $(LVGLLIB)/lv_fonts \ 38 | $(LVGLLIB)/lv_objx \ 39 | $(LVGLLIB)/lv_themes \ 40 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/include/iot_lvgl.h: -------------------------------------------------------------------------------- 1 | #ifndef _COM_GUI_LVGL_H 2 | #define _COM_GUI_LVGL_H 3 | 4 | 5 | #ifdef __cplusplus 6 | extern "C" 7 | { 8 | #endif 9 | 10 | #include "sdkconfig.h" 11 | 12 | #include "lv_conf.h" 13 | #include "lvgl.h" 14 | 15 | 16 | /********************** 17 | * GLOBAL PROTOTYPES 18 | **********************/ 19 | 20 | /** 21 | * @brief Initialize LittlevGL GUI 22 | */ 23 | void lvgl_init(); 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | 29 | 30 | #endif /* _COM_GUI_LVGL_H */ -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/include/lv_calibration.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_calibration.h 3 | * 4 | */ 5 | 6 | #ifndef LV_CALIBRATION_H 7 | #define LV_CALIBRATION_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "iot_lvgl.h" 17 | 18 | /********************* 19 | * DEFINES 20 | *********************/ 21 | 22 | /********************** 23 | * TYPEDEFS 24 | **********************/ 25 | 26 | /********************** 27 | * GLOBAL PROTOTYPES 28 | **********************/ 29 | 30 | /** 31 | * @brief Calibration Mouse 32 | * 33 | * @param indev_drv pointer to a lv_indev_drv_t 34 | * @param recalibrate Whether to recalibrate, true: recalibrate,false not 35 | * 36 | * @return Whether the calibration is successful 37 | */ 38 | bool lvgl_calibrate_mouse(lv_indev_drv_t indev_drv, bool recalibrate); 39 | 40 | /** 41 | * @brief Transform Mouse data 42 | * 43 | * @param data pointer to a lv_point_t 44 | * 45 | * @return Whether the transform is successful 46 | */ 47 | bool lvgl_calibration_transform(lv_point_t *data); 48 | 49 | #ifdef __cplusplus 50 | } /* extern "C" */ 51 | #endif 52 | 53 | #endif /* LV_CALIBRATION_H */ -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl.c: -------------------------------------------------------------------------------- 1 | // Copyright 2015-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 | /* FreeRTOS includes */ 16 | #include "freertos/FreeRTOS.h" 17 | #include "freertos/timers.h" 18 | 19 | /* LVGL includes */ 20 | #include "iot_lvgl.h" 21 | #include "app_screen.h" 22 | 23 | // wait for execute lv_task_handler and lv_tick_inc to avoid some widget don't refresh. 24 | #define LVGL_INIT_DELAY 100 // unit ms 25 | 26 | static void lv_tick_timercb(void *timer) 27 | { 28 | /* Initialize a Timer for 1 ms period and 29 | * in its interrupt call 30 | * lv_tick_inc(1); */ 31 | lv_tick_inc(1); 32 | } 33 | 34 | static void lv_task_timercb(void *timer) 35 | { 36 | /* Periodically call this function. 37 | * The timing is not critical but should be between 1..10 ms */ 38 | lv_task_handler(); 39 | } 40 | 41 | void lvgl_init() 42 | { 43 | /* LittlevGL work fine only when CONFIG_FREERTOS_HZ is 1000HZ */ 44 | assert(CONFIG_FREERTOS_HZ == 1000); 45 | 46 | /* Initialize LittlevGL */ 47 | lv_init(); 48 | 49 | esp_timer_create_args_t timer_conf = { 50 | .callback = lv_tick_timercb, 51 | .name = "lv_tick_timer" 52 | }; 53 | 54 | esp_timer_handle_t g_wifi_connect_timer = NULL; 55 | esp_timer_create(&timer_conf, &g_wifi_connect_timer); 56 | 57 | esp_timer_start_periodic(g_wifi_connect_timer, 1 * 1000U); // lv_tick_inc() called each 1 ms 58 | 59 | /* Display interface */ 60 | lvgl_lcd_hal_init(); 61 | 62 | esp_timer_create_args_t lv_task_timer_conf = { 63 | .callback = lv_task_timercb, 64 | .name = "lv_task_timer" 65 | }; 66 | 67 | esp_timer_handle_t lv_task_timer = NULL; 68 | esp_timer_create(&lv_task_timer_conf, &lv_task_timer); 69 | 70 | esp_timer_start_periodic(lv_task_timer, 5 * 1000U); // lv_task_handler() called each 5 ms 71 | 72 | vTaskDelay(LVGL_INIT_DELAY / portTICK_PERIOD_MS); // wait for execute lv_task_handler and lv_tick_inc to avoid some widget don't refresh. 73 | 74 | } -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/LICENCE.txt: -------------------------------------------------------------------------------- 1 | MIT licence 2 | Copyright (c) 2020 LVGL LLC 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/docs/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to LVGL 2 | 3 | Thank you for considering contributing to LVGL. 4 | 5 | For a detailed description of contribution opportunities, please visit the [Contributing](https://docs.lvgl.io/latest/en/html/contributing/index.html) section of the documentation. 6 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/docs/ROADMAP.md: -------------------------------------------------------------------------------- 1 | # Roadmap 2 | 3 | This is a summary for thenew fatures of the major releases and a collection of ideas. 4 | 5 | This list indicates only the current intention and can be changed. 6 | 7 | ## v8 8 | Planned to September/October 2020 9 | - New scrolling: 10 | - See [feat/new-scroll](https://github.com/lvgl/lvgl/tree/feat/new-scroll) branch and [#1614](https://github.com/lvgl/lvgl/issues/1614)) issue. 11 | - Remove `lv_page` and support scrolling on `lv_obj` 12 | - Support "elastic" scrolling when scrolled in 13 | - Support scroll chaining among any objects types (not only `lv_pages`s) 14 | - Remove `lv_drag`. Similar effect can be achieved by setting the position in `LV_EVENT_PRESSING` 15 | - Add snapping? 16 | - Already working 17 | - New layouts: 18 | - See [#1615](https://github.com/lvgl/lvgl/issues/1615) issue 19 | - [CSS Flexbox](https://css-tricks.com/snippets/css/a-guide-to-flexbox/)-like layout support 20 | - Besides setting width/height in `px` add support to `partent percentage` and `screen percentage`. 21 | - Work in progress 22 | - Simplified File system interface ([feat/new_fs_api](https://github.com/lvgl/lvgl/tree/feat/new-fs-api) branch) to make porting easier 23 | - Work in progress 24 | - Add new label alignment modes 25 | - See [#1656](https://github.com/lvgl/lvgl/issues/1656) 26 | - Remove the align parameter from `lv_canvas_draw_text` 27 | 28 | ## v9 29 | - Simplify `group`s. Discussion is [here](https://forum.lvgl.io/t/lv-group-tabindex/2927/3). 30 | 31 | ## Ideas 32 | - Unit testing (gtest?). See [#1658](https://github.com/lvgl/lvgl/issues/1658) 33 | - Benchmarking (gem5?). See [#1660](https://github.com/lvgl/lvgl/issues/1660) 34 | - CPP binding. See [Forum](https://forum.lvgl.io/t/is-it-possible-to-officially-support-optional-cpp-api/2736) 35 | - Optmize font decompression 36 | - Switch to RGBA colors in styles 37 | - Need coverage report for tests 38 | - Need static analize (via coverity.io or somehing else) 39 | - Support dot_begin and dot_middle long modes for labels 40 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/examples/arduino/ESP32_TFT_eSPI/README.md: -------------------------------------------------------------------------------- 1 | # Example for lv_arduino using a slider 2 | 3 | This example has the screen set to 320x480 (ILI9488), change this by altering the following lines in the main ino file: 4 | 5 | ```C 6 | int screenWidth = 480; 7 | int screenHeight = 320; 8 | ``` 9 | 10 | ## Backlight 11 | 12 | Change pin 32 to your preferred backlight pin using a PNP transistor (2N3906) or remove the following code and connect directly to +ve: 13 | 14 | ```C 15 | ledcSetup(10, 5000/*freq*/, 10 /*resolution*/); 16 | ledcAttachPin(32, 10); 17 | analogReadResolution(10); 18 | ledcWrite(10,768); 19 | ``` 20 | 21 | ## Theme selection 22 | 23 | Change the following to change the theme: 24 | 25 | ```C 26 | lv_theme_t * th = lv_theme_night_init(210, NULL); //Set a HUE value and a Font for the Night Theme 27 | lv_theme_set_current(th); 28 | ``` 29 | 30 | ## Calibration 31 | 32 | This is using the bodmer tft_espi driver for touch. To correctly set the calibration load the calibration sketch and replace the following with your values: 33 | 34 | ```C 35 | uint16_t calData[5] = { 275, 3620, 264, 3532, 1 }; 36 | ``` 37 | 38 | ## Screen rotation 39 | 40 | Check the following if you need to alter your screen rotation: 41 | 42 | ```C 43 | tft.setRotation(3); 44 | ``` 45 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/examples/arduino/README.md: -------------------------------------------------------------------------------- 1 | # LVGL Arduino examples 2 | 3 | LVGL can be installed via Arduino IDE Library Manager or as an .ZIP library. 4 | It will install [lv_exmaples](https://github.com/lvgl/lv_examples) which contains a lot of examples and demos to try LVGL. 5 | 6 | ## Example 7 | 8 | There are simple examples which use the [TFT_eSPI](https://github.com/Bodmer/TFT_eSPI) library as a TFT driver to simplify testing. 9 | To get all this to work you have to setup TFT_eSPI to work with your TFT display type via editing the `User_Setup.h` file in TFT_eSPI library folder, or by selecting your own configurtion in the `User_Setup_Select.h` file in TFT_eSPI library folder. 10 | 11 | LVGL library has its own configuration file called `lv_conf.h`. When LVGL is installed to followings needs to be done to configure it: 12 | 1. Go to directory of the installed Arduno libraries 13 | 2. Go to `lvgl` and copy `lv_conf_template.h` as `lv_conf.h` next to the `src` folder. 14 | 3. Open `lv_conf.h` and change the first `#if 0` to `#if 1` 15 | 4. Set the resolution of your display in `LV_HOR_RES_MAX` and `LV_VER_RES_MAX` 16 | 5. Set the color depth of you display in `LV_COLOR_DEPTH` 17 | 6. Set `LV_TICK_CUSTOM 1` 18 | 19 | ## Debugging 20 | 21 | In case of trouble there are debug informations inside LVGL. In the `ESP32_TFT_eSPI` example there is `my_print` method, which allow to send this debug informations to the serial interface. To enable this feature you have to edit `lv_conf.h` file and enable logging in section `log settings`: 22 | 23 | ```c 24 | /*Log settings*/ 25 | #define USE_LV_LOG 1 /*Enable/disable the log module*/ 26 | #if LV_USE_LOG 27 | /* How important log should be added: 28 | * LV_LOG_LEVEL_TRACE A lot of logs to give detailed information 29 | * LV_LOG_LEVEL_INFO Log important events 30 | * LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem 31 | * LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail 32 | * LV_LOG_LEVEL_NONE Do not log anything 33 | */ 34 | # define LV_LOG_LEVEL LV_LOG_LEVEL_WARN 35 | ``` 36 | 37 | After enabling log module and setting LV_LOG_LEVEL accordingly the output log is sent to the `Serial` port @ 115200 Bd. 38 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/examples/porting/lv_port_disp_template.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_port_disp_templ.h 3 | * 4 | */ 5 | 6 | /*Copy this file as "lv_port_disp.h" and set this value to "1" to enable content*/ 7 | #if 0 8 | 9 | #ifndef LV_PORT_DISP_TEMPL_H 10 | #define LV_PORT_DISP_TEMPL_H 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | /********************* 17 | * INCLUDES 18 | *********************/ 19 | #include "lvgl/lvgl.h" 20 | 21 | /********************* 22 | * DEFINES 23 | *********************/ 24 | 25 | /********************** 26 | * TYPEDEFS 27 | **********************/ 28 | 29 | /********************** 30 | * GLOBAL PROTOTYPES 31 | **********************/ 32 | 33 | /********************** 34 | * MACROS 35 | **********************/ 36 | 37 | 38 | #ifdef __cplusplus 39 | } /* extern "C" */ 40 | #endif 41 | 42 | #endif /*LV_PORT_DISP_TEMPL_H*/ 43 | 44 | #endif /*Disable/Enable content*/ 45 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/examples/porting/lv_port_fs_template.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_port_fs_templ.h 3 | * 4 | */ 5 | 6 | /*Copy this file as "lv_port_fs.h" and set this value to "1" to enable content*/ 7 | #if 0 8 | 9 | #ifndef LV_PORT_FS_TEMPL_H 10 | #define LV_PORT_FS_TEMPL_H 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | /********************* 17 | * INCLUDES 18 | *********************/ 19 | #include "lvgl/lvgl.h" 20 | 21 | /********************* 22 | * DEFINES 23 | *********************/ 24 | 25 | /********************** 26 | * TYPEDEFS 27 | **********************/ 28 | 29 | /********************** 30 | * GLOBAL PROTOTYPES 31 | **********************/ 32 | 33 | /********************** 34 | * MACROS 35 | **********************/ 36 | 37 | 38 | #ifdef __cplusplus 39 | } /* extern "C" */ 40 | #endif 41 | 42 | #endif /*LV_PORT_FS_TEMPL_H*/ 43 | 44 | #endif /*Disable/Enable content*/ 45 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/examples/porting/lv_port_indev_template.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * @file lv_port_indev_templ.h 4 | * 5 | */ 6 | 7 | /*Copy this file as "lv_port_indev.h" and set this value to "1" to enable content*/ 8 | #if 0 9 | 10 | #ifndef LV_PORT_INDEV_TEMPL_H 11 | #define LV_PORT_INDEV_TEMPL_H 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | /********************* 18 | * INCLUDES 19 | *********************/ 20 | #include "lvgl/lvgl.h" 21 | 22 | /********************* 23 | * DEFINES 24 | *********************/ 25 | 26 | /********************** 27 | * TYPEDEFS 28 | **********************/ 29 | 30 | /********************** 31 | * GLOBAL PROTOTYPES 32 | **********************/ 33 | 34 | /********************** 35 | * MACROS 36 | **********************/ 37 | 38 | 39 | #ifdef __cplusplus 40 | } /* extern "C" */ 41 | #endif 42 | 43 | #endif /*LV_PORT_INDEV_TEMPL_H*/ 44 | 45 | #endif /*Disable/Enable content*/ 46 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lvgl", 3 | "version": "7.3.1", 4 | "keywords": "graphics, gui, embedded, tft, lvgl", 5 | "description": "Graphics library to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low memory footprint. It offers anti-aliasing, opacity, and animations using only one frame buffer.", 6 | "repository": { 7 | "type": "git", 8 | "url": "https://github.com/lvgl/lvgl.git" 9 | }, 10 | "build": { 11 | "includeDir": "." 12 | }, 13 | "license": "MIT", 14 | "homepage": "https://lvgl.io", 15 | "frameworks": "*", 16 | "platforms": "*" 17 | } 18 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/library.properties: -------------------------------------------------------------------------------- 1 | name=lvgl 2 | version=7.3.1 3 | author=kisvegabor 4 | maintainer=kisvegabor,embeddedt,pete-pjb 5 | sentence=Full-featured Graphics Library for Embedded Systems 6 | paragraph=Powerful and easy-to-use embedded GUI with many widgets, advanced visual effects (opacity, antialiasing, animations) and low memory requirements (16K RAM, 64K Flash). 7 | category=Display 8 | url=https://lvgl.io 9 | architectures=* 10 | includes=lvgl.h 11 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/lvgl.mk: -------------------------------------------------------------------------------- 1 | include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_core/lv_core.mk 2 | include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_hal/lv_hal.mk 3 | include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_widgets/lv_widgets.mk 4 | include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_font/lv_font.mk 5 | include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_misc/lv_misc.mk 6 | include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_themes/lv_themes.mk 7 | include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_draw/lv_draw.mk 8 | include $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_gpu/lv_gpu.mk 9 | 10 | 11 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/scripts/built_in_font/DejaVuSans.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0015/ESP32-OpenCV-Projects/f1376ca40d2785021f3a318413aedff790a53048/esp32/examples/color_code/components/lvgl_gui/lvgl/scripts/built_in_font/DejaVuSans.ttf -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/scripts/built_in_font/FontAwesome5-Solid+Brands+Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0015/ESP32-OpenCV-Projects/f1376ca40d2785021f3a318413aedff790a53048/esp32/examples/color_code/components/lvgl_gui/lvgl/scripts/built_in_font/FontAwesome5-Solid+Brands+Regular.woff -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/scripts/built_in_font/Montserrat-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0015/ESP32-OpenCV-Projects/f1376ca40d2785021f3a318413aedff790a53048/esp32/examples/color_code/components/lvgl_gui/lvgl/scripts/built_in_font/Montserrat-Medium.ttf -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/scripts/built_in_font/SimSun.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0015/ESP32-OpenCV-Projects/f1376ca40d2785021f3a318413aedff790a53048/esp32/examples/color_code/components/lvgl_gui/lvgl/scripts/built_in_font/SimSun.woff -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/scripts/built_in_font/built_in_font_gen.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3.6 2 | 3 | import argparse 4 | from argparse import RawTextHelpFormatter 5 | import os 6 | import sys 7 | 8 | parser = argparse.ArgumentParser(description="""Create fonts for LittelvGL including the built-in symbols. lv_font_conv needs to be installed. See https://github.com/littlevgl/lv_font_conv 9 | Example: python built_in_font_gen.py --size 16 -o lv_font_roboto_16.c --bpp 4 -r 0x20-0x7F""", formatter_class=RawTextHelpFormatter) 10 | parser.add_argument('-s', '--size', 11 | type=int, 12 | metavar = 'px', 13 | nargs='?', 14 | help='Size of the font in px') 15 | parser.add_argument('--bpp', 16 | type=int, 17 | metavar = '1,2,4', 18 | nargs='?', 19 | help='Bit per pixel') 20 | parser.add_argument('-r', '--range', 21 | nargs='+', 22 | metavar = 'start-end', 23 | default=['0x20-0x7F,0xB0,0x2022'], 24 | help='Ranges and/or characters to include. Default is 0x20-7F (ASCII). E.g. -r 0x20-0x7F, 0x200, 324') 25 | parser.add_argument('--symbols', 26 | nargs='+', 27 | metavar = 'sym', 28 | default=[''], 29 | help=u'Symbols to include. E.g. -s ÁÉŐ'.encode('utf-8')) 30 | parser.add_argument('--font', 31 | metavar = 'file', 32 | nargs='?', 33 | default='Montserrat-Medium.ttf', 34 | help='A TTF or WOFF file') 35 | parser.add_argument('-o', '--output', 36 | nargs='?', 37 | metavar='file', 38 | help='Output file name. E.g. my_font_20.c') 39 | parser.add_argument('--compressed', action='store_true', 40 | help='Compress the bitmaps') 41 | parser.add_argument('--subpx', action='store_true', 42 | help='3 times wider letters for sub pixel rendering') 43 | 44 | args = parser.parse_args() 45 | 46 | if args.compressed == False: 47 | compr = "--no-compress --no-prefilter" 48 | else: 49 | compr = "" 50 | 51 | if len(args.symbols[0]) != 0: 52 | args.symbols[0] = "--symbols " + args.symbols[0] 53 | 54 | #Built in symbols 55 | syms = "61441,61448,61451,61452,61452,61453,61457,61459,61461,61465,61468,61473,61478,61479,61480,61502,61512,61515,61516,61517,61521,61522,61523,61524,61543,61544,61550,61552,61553,61556,61559,61560,61561,61563,61587,61589,61636,61637,61639,61671,61674,61683,61724,61732,61787,61931,62016,62017,62018,62019,62020,62087,62099,62212,62189,62810,63426,63650" 56 | 57 | #Run the command (Add degree and bbullet symbol) 58 | cmd = "lv_font_conv {} --bpp {} --size {} --font {} -r {} {} --font FontAwesome5-Solid+Brands+Regular.woff -r {} --format lvgl -o {} --force-fast-kern-format".format(compr, args.bpp, args.size, args.font, args.range[0], args.symbols[0], syms, args.output) 59 | os.system(cmd) 60 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/scripts/code-format.cfg: -------------------------------------------------------------------------------- 1 | --style=kr 2 | --indent=spaces=4 3 | --indent-classes 4 | --indent-switches 5 | --indent-cases 6 | --indent-preproc-block 7 | --indent-preproc-define 8 | --indent-col1-comments 9 | --pad-oper 10 | --unpad-paren 11 | --align-pointer=middle 12 | --align-reference=middle 13 | --convert-tabs 14 | --max-code-length=120 15 | --break-after-logical 16 | --break-closing-braces 17 | --attach-closing-while 18 | --min-conditional-indent=0 19 | --max-continuation-indent=120 20 | --mode=c 21 | --lineend=linux 22 | --recursive 23 | --suffix=none 24 | --preserve-date 25 | --formatted 26 | --exclude=lv_conf_internal.h 27 | --exclude=../src/lv_font/lv_font_montserrat_12.c 28 | --exclude=../src/lv_font/lv_font_montserrat_14.c 29 | --exclude=../src/lv_font/lv_font_montserrat_16.c 30 | --exclude=../src/lv_font/lv_font_montserrat_18.c 31 | --exclude=../src/lv_font/lv_font_montserrat_20.c 32 | --exclude=../src/lv_font/lv_font_montserrat_22.c 33 | --exclude=../src/lv_font/lv_font_montserrat_24.c 34 | --exclude=../src/lv_font/lv_font_montserrat_26.c 35 | --exclude=../src/lv_font/lv_font_montserrat_28.c 36 | --exclude=../src/lv_font/lv_font_montserrat_30.c 37 | --exclude=../src/lv_font/lv_font_montserrat_32.c 38 | --exclude=../src/lv_font/lv_font_montserrat_34.c 39 | --exclude=../src/lv_font/lv_font_montserrat_36.c 40 | --exclude=../src/lv_font/lv_font_montserrat_38.c 41 | --exclude=../src/lv_font/lv_font_montserrat_40.c 42 | --exclude=../src/lv_font/lv_font_montserrat_42.c 43 | --exclude=../src/lv_font/lv_font_montserrat_44.c 44 | --exclude=../src/lv_font/lv_font_montserrat_46.c 45 | --exclude=../src/lv_font/lv_font_montserrat_48.c 46 | --exclude=../src/lv_font/lv_font_montserrat_12_subpx.c 47 | --exclude=../src/lv_font/lv_font_montserrat_28_compressed.c 48 | --exclude=../src/lv_font/lv_font_simsun_16_cjk.c 49 | --exclude=../src/lv_font/lv_font_dejavu_16_persian_hebrew.c 50 | 51 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/scripts/code-format.sh: -------------------------------------------------------------------------------- 1 | astyle --options=code-format.cfg "../src/*.c,*.h" 2 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/scripts/cppcheck_run.sh: -------------------------------------------------------------------------------- 1 | cppcheck -j8 --template="{severity}\t{file}:{line}\t{id}: {message}" --enable=all ../src/ --output-file=cppcheck_res.txt --suppress=unusedFunction --suppress=preprocessorErrorDirective --force 2 | 3 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/scripts/infer_run.sh: -------------------------------------------------------------------------------- 1 | # https://github.com/facebook/infer 2 | # 3 | # Install: 4 | # VERSION=0.17.0; \ 5 | # curl -sSL "https://github.com/facebook/infer/releases/download/v$VERSION/infer-linux64-v$VERSION.tar.xz" \ 6 | # | sudo tar -C /opt -xJ && \ 7 | # sudoln -s "/opt/infer-linux64-v$VERSION/bin/infer" /usr/local/bin/infer 8 | 9 | 10 | infer run -- make -j8 11 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/scripts/lv_conf_checker.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | ''' 4 | Generates a checker file for lv_conf.h from lv_conf_templ.h define all the not defined values 5 | ''' 6 | 7 | 8 | import sys 9 | import re 10 | 11 | if sys.version_info < (3,6,0): 12 | print("Python >=3.6 is required", file=sys.stderr) 13 | exit(1) 14 | 15 | fin = open("../lv_conf_template.h", "r") 16 | fout = open("../src/lv_conf_internal.h", "w") 17 | 18 | 19 | fout.write( 20 | '''/** 21 | * GENERATED FILE, DO NOT EDIT IT! 22 | * @file lv_conf_internal.h 23 | * Make sure all the defines of lv_conf.h have a default value 24 | **/ 25 | 26 | #ifndef LV_CONF_INTERNAL_H 27 | #define LV_CONF_INTERNAL_H 28 | /* clang-format off */ 29 | 30 | #include 31 | 32 | #if defined(LV_CONF_PATH) 33 | #define __LV_TO_STR_AUX(x) #x 34 | #define __LV_TO_STR(x) __LV_TO_STR_AUX(x) 35 | #include __LV_TO_STR(LV_CONF_PATH) 36 | #undef __LV_TO_STR_AUX 37 | #undef __LV_TO_STR 38 | #elif defined(LV_CONF_INCLUDE_SIMPLE) 39 | #include "lv_conf.h" 40 | #else 41 | #include "../../lv_conf.h" 42 | #endif 43 | 44 | ''' 45 | ) 46 | 47 | started = 0 48 | 49 | for i in fin.read().splitlines(): 50 | if not started: 51 | if '#define LV_CONF_H' in i: 52 | started = 1 53 | continue 54 | else: 55 | continue 56 | 57 | if '/*--END OF LV_CONF_H--*/' in i: break 58 | 59 | r = re.search(r'^ *# *define ([^\s]+).*$', i) 60 | 61 | if r: 62 | line = re.sub('\(.*?\)', '', r[1], 1) #remove parentheses from macros 63 | fout.write( 64 | f'#ifndef {line}\n' 65 | f'{i}\n' 66 | '#endif\n' 67 | ) 68 | elif re.search('^ *typedef .*;.*$', i): 69 | continue #ignore typedefs to avoide redeclaration 70 | else: 71 | fout.write(f'{i}\n') 72 | 73 | 74 | fout.write( 75 | ''' 76 | #endif /*LV_CONF_CHECKER_H*/ 77 | ''' 78 | ) 79 | 80 | fin.close() 81 | fout.close() 82 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_core/lv_core.mk: -------------------------------------------------------------------------------- 1 | CSRCS += lv_group.c 2 | CSRCS += lv_indev.c 3 | CSRCS += lv_disp.c 4 | CSRCS += lv_obj.c 5 | CSRCS += lv_refr.c 6 | CSRCS += lv_style.c 7 | 8 | DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_core 9 | VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_core 10 | 11 | CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_core" 12 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_core/lv_refr.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_refr.h 3 | * 4 | */ 5 | 6 | #ifndef LV_REFR_H 7 | #define LV_REFR_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "lv_obj.h" 17 | #include 18 | 19 | /********************* 20 | * DEFINES 21 | *********************/ 22 | 23 | #define LV_REFR_TASK_PRIO LV_TASK_PRIO_MID 24 | 25 | /********************** 26 | * TYPEDEFS 27 | **********************/ 28 | 29 | /********************** 30 | * STATIC PROTOTYPES 31 | **********************/ 32 | 33 | /********************** 34 | * STATIC VARIABLES 35 | **********************/ 36 | 37 | /********************** 38 | * MACROS 39 | **********************/ 40 | 41 | /********************** 42 | * GLOBAL FUNCTIONS 43 | **********************/ 44 | 45 | /** 46 | * Initialize the screen refresh subsystem 47 | */ 48 | void _lv_refr_init(void); 49 | 50 | /** 51 | * Redraw the invalidated areas now. 52 | * Normally the redrawing is periodically executed in `lv_task_handler` but a long blocking process 53 | * can prevent the call of `lv_task_handler`. In this case if the the GUI is updated in the process 54 | * (e.g. progress bar) this function can be called when the screen should be updated. 55 | * @param disp pointer to display to refresh. NULL to refresh all displays. 56 | */ 57 | void lv_refr_now(lv_disp_t * disp); 58 | 59 | /** 60 | * Invalidate an area on display to redraw it 61 | * @param area_p pointer to area which should be invalidated (NULL: delete the invalidated areas) 62 | * @param disp pointer to display where the area should be invalidated (NULL can be used if there is 63 | * only one display) 64 | */ 65 | void _lv_inv_area(lv_disp_t * disp, const lv_area_t * area_p); 66 | 67 | /** 68 | * Get the display which is being refreshed 69 | * @return the display being refreshed 70 | */ 71 | lv_disp_t * _lv_refr_get_disp_refreshing(void); 72 | 73 | /** 74 | * Set the display which is being refreshed. 75 | * It shouldn't be used directly by the user. 76 | * It can be used to trick the drawing functions about there is an active display. 77 | * @param the display being refreshed 78 | */ 79 | void _lv_refr_set_disp_refreshing(lv_disp_t * disp); 80 | 81 | /** 82 | * Called periodically to handle the refreshing 83 | * @param task pointer to the task itself 84 | */ 85 | void _lv_disp_refr_task(lv_task_t * task); 86 | 87 | /********************** 88 | * STATIC FUNCTIONS 89 | **********************/ 90 | 91 | #ifdef __cplusplus 92 | } /* extern "C" */ 93 | #endif 94 | 95 | #endif /*LV_REFR_H*/ 96 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_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 "../lv_core/lv_style.h" 19 | #include "../lv_misc/lv_txt.h" 20 | #include "lv_img_decoder.h" 21 | 22 | #include "lv_draw_rect.h" 23 | #include "lv_draw_label.h" 24 | #include "lv_draw_img.h" 25 | #include "lv_draw_line.h" 26 | #include "lv_draw_triangle.h" 27 | #include "lv_draw_arc.h" 28 | #include "lv_draw_blend.h" 29 | #include "lv_draw_mask.h" 30 | 31 | /********************* 32 | * DEFINES 33 | *********************/ 34 | 35 | /********************** 36 | * TYPEDEFS 37 | **********************/ 38 | 39 | /********************** 40 | * GLOBAL PROTOTYPES 41 | **********************/ 42 | 43 | /********************** 44 | * GLOBAL VARIABLES 45 | **********************/ 46 | 47 | /********************** 48 | * MACROS 49 | **********************/ 50 | 51 | /********************** 52 | * POST INCLUDES 53 | *********************/ 54 | 55 | #ifdef __cplusplus 56 | } /* extern "C" */ 57 | #endif 58 | 59 | #endif /*LV_DRAW_H*/ 60 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_draw/lv_draw.mk: -------------------------------------------------------------------------------- 1 | CSRCS += lv_draw_mask.c 2 | CSRCS += lv_draw_blend.c 3 | CSRCS += lv_draw_rect.c 4 | CSRCS += lv_draw_label.c 5 | CSRCS += lv_draw_line.c 6 | CSRCS += lv_draw_img.c 7 | CSRCS += lv_draw_arc.c 8 | CSRCS += lv_draw_triangle.c 9 | CSRCS += lv_img_decoder.c 10 | CSRCS += lv_img_cache.c 11 | CSRCS += lv_img_buf.c 12 | 13 | DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_draw 14 | VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_draw 15 | 16 | CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_draw" 17 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_draw/lv_draw_arc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_draw_arc.h 3 | * 4 | */ 5 | 6 | #ifndef LV_DRAW_ARC_H 7 | #define LV_DRAW_ARC_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "lv_draw_line.h" 17 | 18 | /********************* 19 | * DEFINES 20 | *********************/ 21 | 22 | /********************** 23 | * TYPEDEFS 24 | **********************/ 25 | 26 | /********************** 27 | * GLOBAL PROTOTYPES 28 | **********************/ 29 | 30 | /** 31 | * Draw an arc. (Can draw pie too with great thickness.) 32 | * @param center_x the x coordinate of the center of the arc 33 | * @param center_y the y coordinate of the center of the arc 34 | * @param radius the radius of the arc 35 | * @param mask the arc will be drawn only in this mask 36 | * @param start_angle the start angle of the arc (0 deg on the bottom, 90 deg on the right) 37 | * @param end_angle the end angle of the arc 38 | * @param clip_area the arc will be drawn only in this area 39 | * @param dsc pointer to an initialized `lv_draw_line_dsc_t` variable 40 | */ 41 | void lv_draw_arc(lv_coord_t center_x, lv_coord_t center_y, uint16_t radius, uint16_t start_angle, uint16_t end_angle, 42 | const lv_area_t * clip_area, const lv_draw_line_dsc_t * dsc); 43 | 44 | /********************** 45 | * MACROS 46 | **********************/ 47 | 48 | #ifdef __cplusplus 49 | } /* extern "C" */ 50 | #endif 51 | 52 | #endif /*LV_DRAW_ARC*/ 53 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_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 "../lv_misc/lv_color.h" 17 | #include "../lv_misc/lv_area.h" 18 | #include "lv_draw_mask.h" 19 | 20 | /********************* 21 | * DEFINES 22 | *********************/ 23 | 24 | /********************** 25 | * TYPEDEFS 26 | **********************/ 27 | enum { 28 | LV_BLEND_MODE_NORMAL, 29 | #if LV_USE_BLEND_MODES 30 | LV_BLEND_MODE_ADDITIVE, 31 | LV_BLEND_MODE_SUBTRACTIVE, 32 | #endif 33 | }; 34 | 35 | typedef uint8_t lv_blend_mode_t; 36 | 37 | /********************** 38 | * GLOBAL PROTOTYPES 39 | **********************/ 40 | 41 | //! @cond Doxygen_Suppress 42 | LV_ATTRIBUTE_FAST_MEM void _lv_blend_fill(const lv_area_t * clip_area, const lv_area_t * fill_area, lv_color_t color, 43 | lv_opa_t * mask, lv_draw_mask_res_t mask_res, lv_opa_t opa, lv_blend_mode_t mode); 44 | 45 | 46 | LV_ATTRIBUTE_FAST_MEM void _lv_blend_map(const lv_area_t * clip_area, const lv_area_t * map_area, 47 | const lv_color_t * map_buf, 48 | lv_opa_t * mask, lv_draw_mask_res_t mask_res, lv_opa_t opa, lv_blend_mode_t mode); 49 | 50 | //! @endcond 51 | /********************** 52 | * MACROS 53 | **********************/ 54 | 55 | #ifdef __cplusplus 56 | } /* extern "C" */ 57 | #endif 58 | 59 | #endif /*LV_DRAW_BLEND_H*/ 60 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_draw/lv_draw_img.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_draw_img.h 3 | * 4 | */ 5 | 6 | #ifndef LV_DRAW_IMG_H 7 | #define LV_DRAW_IMG_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "lv_img_decoder.h" 17 | #include "lv_img_buf.h" 18 | 19 | /********************* 20 | * DEFINES 21 | *********************/ 22 | 23 | /********************** 24 | * MACROS 25 | **********************/ 26 | 27 | /********************** 28 | * TYPEDEFS 29 | **********************/ 30 | 31 | typedef struct { 32 | lv_opa_t opa; 33 | 34 | uint16_t angle; 35 | lv_point_t pivot; 36 | uint16_t zoom; 37 | 38 | lv_opa_t recolor_opa; 39 | lv_color_t recolor; 40 | 41 | lv_blend_mode_t blend_mode; 42 | 43 | uint8_t antialias : 1; 44 | } lv_draw_img_dsc_t; 45 | 46 | /********************** 47 | * GLOBAL PROTOTYPES 48 | **********************/ 49 | 50 | void lv_draw_img_dsc_init(lv_draw_img_dsc_t * dsc); 51 | /** 52 | * Draw an image 53 | * @param coords the coordinates of the image 54 | * @param mask the image will be drawn only in this area 55 | * @param src pointer to a lv_color_t array which contains the pixels of the image 56 | * @param dsc pointer to an initialized `lv_draw_img_dsc_t` variable 57 | */ 58 | void lv_draw_img(const lv_area_t * coords, const lv_area_t * mask, const void * src, const lv_draw_img_dsc_t * dsc); 59 | 60 | /** 61 | * Get the type of an image source 62 | * @param src pointer to an image source: 63 | * - pointer to an 'lv_img_t' variable (image stored internally and compiled into the code) 64 | * - a path to a file (e.g. "S:/folder/image.bin") 65 | * - or a symbol (e.g. LV_SYMBOL_CLOSE) 66 | * @return type of the image source LV_IMG_SRC_VARIABLE/FILE/SYMBOL/UNKNOWN 67 | */ 68 | lv_img_src_t lv_img_src_get_type(const void * src); 69 | 70 | /** 71 | * Get the pixel size of a color format in bits 72 | * @param cf a color format (`LV_IMG_CF_...`) 73 | * @return the pixel size in bits 74 | */ 75 | uint8_t lv_img_cf_get_px_size(lv_img_cf_t cf); 76 | 77 | /** 78 | * Check if a color format is chroma keyed or not 79 | * @param cf a color format (`LV_IMG_CF_...`) 80 | * @return true: chroma keyed; false: not chroma keyed 81 | */ 82 | bool lv_img_cf_is_chroma_keyed(lv_img_cf_t cf); 83 | 84 | /** 85 | * Check if a color format has alpha channel or not 86 | * @param cf a color format (`LV_IMG_CF_...`) 87 | * @return true: has alpha channel; false: doesn't have alpha channel 88 | */ 89 | bool lv_img_cf_has_alpha(lv_img_cf_t cf); 90 | 91 | 92 | #ifdef __cplusplus 93 | } /* extern "C" */ 94 | #endif 95 | 96 | #endif /*LV_TEMPL_H*/ 97 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_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_core/lv_style.h" 17 | 18 | /********************* 19 | * DEFINES 20 | *********************/ 21 | 22 | /********************** 23 | * TYPEDEFS 24 | **********************/ 25 | typedef struct { 26 | lv_color_t color; 27 | lv_style_int_t width; 28 | lv_style_int_t dash_width; 29 | lv_style_int_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 is 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 | 55 | //! @endcond 56 | 57 | /********************** 58 | * MACROS 59 | **********************/ 60 | 61 | #ifdef __cplusplus 62 | } /* extern "C" */ 63 | #endif 64 | 65 | #endif /*LV_DRAW_LINE_H*/ 66 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_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 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_draw/lv_img_cache.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_img_cache.h 3 | * 4 | */ 5 | 6 | #ifndef LV_IMG_CACHE_H 7 | #define LV_IMG_CACHE_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include "lv_img_decoder.h" 17 | 18 | /********************* 19 | * DEFINES 20 | *********************/ 21 | 22 | /********************** 23 | * TYPEDEFS 24 | **********************/ 25 | 26 | /** 27 | * When loading images from the network it can take a long time to download and decode the image. 28 | * 29 | * To avoid repeating this heavy load images can be cached. 30 | */ 31 | typedef struct { 32 | lv_img_decoder_dsc_t dec_dsc; /**< Image information */ 33 | 34 | /** Count the cache entries's life. Add `time_tio_open` to `life` when the entry is used. 35 | * Decrement all lifes by one every in every ::lv_img_cache_open. 36 | * If life == 0 the entry can be reused */ 37 | int32_t life; 38 | } lv_img_cache_entry_t; 39 | 40 | /********************** 41 | * GLOBAL PROTOTYPES 42 | **********************/ 43 | 44 | /** 45 | * Open an image using the image decoder interface and cache it. 46 | * The image will be left open meaning if the image decoder open callback allocated memory then it will remain. 47 | * The image is closed if a new image is opened and the new image takes its place in the cache. 48 | * @param src source of the image. Path to file or pointer to an `lv_img_dsc_t` variable 49 | * @param color The color of the image with `LV_IMG_CF_ALPHA_...` 50 | * @return pointer to the cache entry or NULL if can open the image 51 | */ 52 | lv_img_cache_entry_t * _lv_img_cache_open(const void * src, lv_color_t color); 53 | 54 | /** 55 | * Set the number of images to be cached. 56 | * More cached images mean more opened image at same time which might mean more memory usage. 57 | * E.g. if 20 PNG or JPG images are open in the RAM they consume memory while opened in the cache. 58 | * @param new_entry_cnt number of image to cache 59 | */ 60 | void lv_img_cache_set_size(uint16_t new_slot_num); 61 | 62 | /** 63 | * Invalidate an image source in the cache. 64 | * Useful if the image source is updated therefore it needs to be cached again. 65 | * @param src an image source path to a file or pointer to an `lv_img_dsc_t` variable. 66 | */ 67 | void lv_img_cache_invalidate_src(const void * src); 68 | 69 | /********************** 70 | * MACROS 71 | **********************/ 72 | 73 | #ifdef __cplusplus 74 | } /* extern "C" */ 75 | #endif 76 | 77 | #endif /*LV_IMG_CACHE_H*/ 78 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_font/lv_font.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_font.c 3 | * 4 | */ 5 | 6 | /********************* 7 | * INCLUDES 8 | *********************/ 9 | 10 | #include "lv_font.h" 11 | #include "../lv_misc/lv_utils.h" 12 | #include "../lv_misc/lv_log.h" 13 | 14 | /********************* 15 | * DEFINES 16 | *********************/ 17 | 18 | /********************** 19 | * TYPEDEFS 20 | **********************/ 21 | 22 | /********************** 23 | * STATIC PROTOTYPES 24 | **********************/ 25 | 26 | /********************** 27 | * STATIC VARIABLES 28 | **********************/ 29 | 30 | /********************** 31 | * GLOBAL PROTOTYPES 32 | **********************/ 33 | 34 | /********************** 35 | * MACROS 36 | **********************/ 37 | 38 | /********************** 39 | * GLOBAL FUNCTIONS 40 | **********************/ 41 | 42 | /** 43 | * Return with the bitmap of a font. 44 | * @param font_p pointer to a font 45 | * @param letter an UNICODE character code 46 | * @return pointer to the bitmap of the letter 47 | */ 48 | const uint8_t * lv_font_get_glyph_bitmap(const lv_font_t * font_p, uint32_t letter) 49 | { 50 | return font_p->get_glyph_bitmap(font_p, letter); 51 | } 52 | 53 | /** 54 | * Get the descriptor of a glyph 55 | * @param font_p pointer to font 56 | * @param dsc_out store the result descriptor here 57 | * @param letter an UNICODE letter code 58 | * @return true: descriptor is successfully loaded into `dsc_out`. 59 | * false: the letter was not found, no data is loaded to `dsc_out` 60 | */ 61 | bool lv_font_get_glyph_dsc(const lv_font_t * font_p, lv_font_glyph_dsc_t * dsc_out, uint32_t letter, 62 | uint32_t letter_next) 63 | { 64 | return font_p->get_glyph_dsc(font_p, dsc_out, letter, letter_next); 65 | } 66 | 67 | /** 68 | * Get the width of a glyph with kerning 69 | * @param font pointer to a font 70 | * @param letter an UNICODE letter 71 | * @param letter_next the next letter after `letter`. Used for kerning 72 | * @return the width of the glyph 73 | */ 74 | uint16_t lv_font_get_glyph_width(const lv_font_t * font, uint32_t letter, uint32_t letter_next) 75 | { 76 | lv_font_glyph_dsc_t g; 77 | bool ret; 78 | ret = lv_font_get_glyph_dsc(font, &g, letter, letter_next); 79 | if(ret) return g.adv_w; 80 | else return 0; 81 | } 82 | 83 | /********************** 84 | * STATIC FUNCTIONS 85 | **********************/ 86 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_font/lv_font.mk: -------------------------------------------------------------------------------- 1 | CSRCS += lv_font.c 2 | CSRCS += lv_font_fmt_txt.c 3 | CSRCS += lv_font_montserrat_12.c 4 | CSRCS += lv_font_montserrat_14.c 5 | CSRCS += lv_font_montserrat_16.c 6 | CSRCS += lv_font_montserrat_18.c 7 | CSRCS += lv_font_montserrat_20.c 8 | CSRCS += lv_font_montserrat_22.c 9 | CSRCS += lv_font_montserrat_24.c 10 | CSRCS += lv_font_montserrat_26.c 11 | CSRCS += lv_font_montserrat_28.c 12 | CSRCS += lv_font_montserrat_30.c 13 | CSRCS += lv_font_montserrat_32.c 14 | CSRCS += lv_font_montserrat_34.c 15 | CSRCS += lv_font_montserrat_36.c 16 | CSRCS += lv_font_montserrat_38.c 17 | CSRCS += lv_font_montserrat_40.c 18 | CSRCS += lv_font_montserrat_42.c 19 | CSRCS += lv_font_montserrat_44.c 20 | CSRCS += lv_font_montserrat_46.c 21 | CSRCS += lv_font_montserrat_48.c 22 | CSRCS += lv_font_montserrat_12_subpx.c 23 | CSRCS += lv_font_montserrat_28_compressed.c 24 | CSRCS += lv_font_unscii_8.c 25 | CSRCS += lv_font_dejavu_16_persian_hebrew.c 26 | 27 | DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_font 28 | VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_font 29 | 30 | CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_font" 31 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_gpu/lv_gpu.mk: -------------------------------------------------------------------------------- 1 | CSRCS += lv_gpu_stm32_dma2d.c 2 | 3 | DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_gpu 4 | VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_gpu 5 | 6 | CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_gpu" 7 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_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 | /********************** 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 41 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_hal/lv_hal.mk: -------------------------------------------------------------------------------- 1 | CSRCS += lv_hal_disp.c 2 | CSRCS += lv_hal_indev.c 3 | CSRCS += lv_hal_tick.c 4 | 5 | DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_hal 6 | VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_hal 7 | 8 | CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_hal" 9 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_hal/lv_hal_tick.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file systick.c 3 | * Provide access to the system tick with 1 millisecond resolution 4 | */ 5 | 6 | /********************* 7 | * INCLUDES 8 | *********************/ 9 | #include "lv_hal_tick.h" 10 | #include 11 | 12 | #if LV_TICK_CUSTOM == 1 13 | #include LV_TICK_CUSTOM_INCLUDE 14 | #endif 15 | 16 | /********************* 17 | * DEFINES 18 | *********************/ 19 | 20 | /********************** 21 | * TYPEDEFS 22 | **********************/ 23 | 24 | /********************** 25 | * STATIC PROTOTYPES 26 | **********************/ 27 | 28 | /********************** 29 | * STATIC VARIABLES 30 | **********************/ 31 | static uint32_t sys_time = 0; 32 | static volatile uint8_t tick_irq_flag; 33 | 34 | /********************** 35 | * MACROS 36 | **********************/ 37 | 38 | /********************** 39 | * GLOBAL FUNCTIONS 40 | **********************/ 41 | 42 | /** 43 | * You have to call this function periodically 44 | * @param tick_period the call period of this function in milliseconds 45 | */ 46 | LV_ATTRIBUTE_TICK_INC void lv_tick_inc(uint32_t tick_period) 47 | { 48 | tick_irq_flag = 0; 49 | sys_time += tick_period; 50 | } 51 | 52 | /** 53 | * Get the elapsed milliseconds since start up 54 | * @return the elapsed milliseconds 55 | */ 56 | uint32_t lv_tick_get(void) 57 | { 58 | #if LV_TICK_CUSTOM == 0 59 | 60 | /* If `lv_tick_inc` is called from an interrupt while `sys_time` is read 61 | * the result might be corrupted. 62 | * This loop detects if `lv_tick_inc` was called while reading `sys_time`. 63 | * If `tick_irq_flag` was cleared in `lv_tick_inc` try to read again 64 | * until `tick_irq_flag` remains `1`. */ 65 | uint32_t result; 66 | do { 67 | tick_irq_flag = 1; 68 | result = sys_time; 69 | } while(!tick_irq_flag); /*Continue until see a non interrupted cycle */ 70 | 71 | return result; 72 | #else 73 | return LV_TICK_CUSTOM_SYS_TIME_EXPR; 74 | #endif 75 | } 76 | 77 | /** 78 | * Get the elapsed milliseconds since a previous time stamp 79 | * @param prev_tick a previous time stamp (return value of systick_get() ) 80 | * @return the elapsed milliseconds since 'prev_tick' 81 | */ 82 | uint32_t lv_tick_elaps(uint32_t prev_tick) 83 | { 84 | uint32_t act_time = lv_tick_get(); 85 | 86 | /*If there is no overflow in sys_time simple subtract*/ 87 | if(act_time >= prev_tick) { 88 | prev_tick = act_time - prev_tick; 89 | } 90 | else { 91 | prev_tick = UINT32_MAX - prev_tick + 1; 92 | prev_tick += act_time; 93 | } 94 | 95 | return prev_tick; 96 | } 97 | 98 | /********************** 99 | * STATIC FUNCTIONS 100 | **********************/ 101 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_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 | /** 39 | * You have to call this function periodically 40 | * @param tick_period the call period of this function in milliseconds 41 | */ 42 | LV_ATTRIBUTE_TICK_INC void lv_tick_inc(uint32_t tick_period); 43 | 44 | //! @endcond 45 | 46 | /** 47 | * Get the elapsed milliseconds since start up 48 | * @return the elapsed milliseconds 49 | */ 50 | uint32_t lv_tick_get(void); 51 | 52 | /** 53 | * Get the elapsed milliseconds since a previous time stamp 54 | * @param prev_tick a previous time stamp (return value of systick_get() ) 55 | * @return the elapsed milliseconds since 'prev_tick' 56 | */ 57 | uint32_t lv_tick_elaps(uint32_t prev_tick); 58 | 59 | /********************** 60 | * MACROS 61 | **********************/ 62 | 63 | #ifdef __cplusplus 64 | } /* extern "C" */ 65 | #endif 66 | 67 | #endif /*LV_HAL_TICK_H*/ 68 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_misc/lv_async.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_async.c 3 | * 4 | */ 5 | 6 | /********************* 7 | * INCLUDES 8 | *********************/ 9 | 10 | #include "lv_async.h" 11 | 12 | /********************* 13 | * DEFINES 14 | *********************/ 15 | 16 | /********************** 17 | * TYPEDEFS 18 | **********************/ 19 | 20 | /********************** 21 | * STATIC PROTOTYPES 22 | **********************/ 23 | 24 | static void lv_async_task_cb(lv_task_t * task); 25 | 26 | /********************** 27 | * STATIC VARIABLES 28 | **********************/ 29 | 30 | /********************** 31 | * MACROS 32 | **********************/ 33 | 34 | /********************** 35 | * GLOBAL FUNCTIONS 36 | **********************/ 37 | 38 | lv_res_t lv_async_call(lv_async_cb_t async_xcb, void * user_data) 39 | { 40 | /*Allocate an info structure */ 41 | lv_async_info_t * info = lv_mem_alloc(sizeof(lv_async_info_t)); 42 | 43 | if(info == NULL) 44 | return LV_RES_INV; 45 | 46 | /* Create a new task */ 47 | /* Use highest priority so that it will run before a refresh */ 48 | lv_task_t * task = lv_task_create(lv_async_task_cb, 0, LV_TASK_PRIO_HIGHEST, info); 49 | 50 | if(task == NULL) { 51 | lv_mem_free(info); 52 | return LV_RES_INV; 53 | } 54 | 55 | info->cb = async_xcb; 56 | info->user_data = user_data; 57 | 58 | /* Set the task's user data */ 59 | task->user_data = info; 60 | lv_task_set_repeat_count(task, 1); 61 | return LV_RES_OK; 62 | } 63 | 64 | /********************** 65 | * STATIC FUNCTIONS 66 | **********************/ 67 | 68 | static void lv_async_task_cb(lv_task_t * task) 69 | { 70 | lv_async_info_t * info = (lv_async_info_t *)task->user_data; 71 | 72 | info->cb(info->user_data); 73 | 74 | lv_mem_free(info); 75 | } 76 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_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_task.h" 18 | #include "lv_types.h" 19 | 20 | /********************* 21 | * DEFINES 22 | *********************/ 23 | 24 | /********************** 25 | * TYPEDEFS 26 | **********************/ 27 | 28 | /** 29 | * Type for async callback. 30 | */ 31 | typedef void (*lv_async_cb_t)(void *); 32 | 33 | typedef struct _lv_async_info_t { 34 | lv_async_cb_t cb; 35 | void * user_data; 36 | } lv_async_info_t; 37 | 38 | struct _lv_obj_t; 39 | 40 | /********************** 41 | * GLOBAL PROTOTYPES 42 | **********************/ 43 | 44 | /** 45 | * Call an asynchronous function the next time lv_task_handler() is run. This function is likely to return 46 | * **before** the call actually happens! 47 | * @param async_xcb a callback which is the task itself. 48 | * (the 'x' in the argument name indicates that its not a fully generic function because it not follows 49 | * the `func_name(object, callback, ...)` convention) 50 | * @param user_data custom parameter 51 | */ 52 | lv_res_t lv_async_call(lv_async_cb_t async_xcb, void * user_data); 53 | 54 | /********************** 55 | * MACROS 56 | **********************/ 57 | 58 | #ifdef __cplusplus 59 | } /* extern "C" */ 60 | #endif 61 | 62 | #endif /*LV_TEMPL_H*/ 63 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_misc/lv_gc.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_gc.c 3 | * 4 | */ 5 | 6 | /********************* 7 | * INCLUDES 8 | *********************/ 9 | 10 | #include "lv_gc.h" 11 | #include "string.h" 12 | 13 | #if defined(LV_GC_INCLUDE) 14 | #include LV_GC_INCLUDE 15 | #endif /* LV_ENABLE_GC */ 16 | 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | /********************** 22 | * TYPEDEFS 23 | **********************/ 24 | 25 | /********************** 26 | * STATIC PROTOTYPES 27 | **********************/ 28 | 29 | /********************** 30 | * STATIC VARIABLES 31 | **********************/ 32 | 33 | #if(!defined(LV_ENABLE_GC)) || LV_ENABLE_GC == 0 34 | LV_ROOTS 35 | #endif /* LV_ENABLE_GC */ 36 | 37 | /********************** 38 | * MACROS 39 | **********************/ 40 | 41 | /********************** 42 | * GLOBAL FUNCTIONS 43 | **********************/ 44 | 45 | void _lv_gc_clear_roots(void) 46 | { 47 | #define LV_CLEAR_ROOT(root_type, root_name) _lv_memset_00(&LV_GC_ROOT(root_name), sizeof(LV_GC_ROOT(root_name))); 48 | LV_ITERATE_ROOTS(LV_CLEAR_ROOT) 49 | } 50 | 51 | /********************** 52 | * STATIC FUNCTIONS 53 | **********************/ 54 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_misc/lv_gc.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_gc.h 3 | * 4 | */ 5 | 6 | #ifndef LV_GC_H 7 | #define LV_GC_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include 17 | #include 18 | #include "lv_mem.h" 19 | #include "lv_ll.h" 20 | #include "lv_task.h" 21 | #include "../lv_draw/lv_img_cache.h" 22 | #include "../lv_draw/lv_draw_mask.h" 23 | 24 | /********************* 25 | * DEFINES 26 | *********************/ 27 | 28 | #define LV_ITERATE_ROOTS(f) \ 29 | f(lv_ll_t, _lv_task_ll) /*Linked list to store the lv_tasks*/ \ 30 | f(lv_ll_t, _lv_disp_ll) /*Linked list of screens*/ \ 31 | f(lv_ll_t, _lv_indev_ll) /*Linked list of screens*/ \ 32 | f(lv_ll_t, _lv_drv_ll) \ 33 | f(lv_ll_t, _lv_file_ll) \ 34 | f(lv_ll_t, _lv_anim_ll) \ 35 | f(lv_ll_t, _lv_group_ll) \ 36 | f(lv_ll_t, _lv_img_defoder_ll) \ 37 | f(lv_ll_t, _lv_obj_style_trans_ll) \ 38 | f(lv_img_cache_entry_t*, _lv_img_cache_array) \ 39 | f(lv_task_t*, _lv_task_act) \ 40 | f(lv_mem_buf_arr_t , _lv_mem_buf) \ 41 | f(_lv_draw_mask_saved_arr_t , _lv_draw_mask_list) \ 42 | f(void * , _lv_theme_material_styles) \ 43 | f(void * , _lv_theme_template_styles) \ 44 | f(void * , _lv_theme_mono_styles) \ 45 | f(void * , _lv_theme_empty_styles) \ 46 | 47 | #define LV_DEFINE_ROOT(root_type, root_name) root_type root_name; 48 | #define LV_ROOTS LV_ITERATE_ROOTS(LV_DEFINE_ROOT) 49 | 50 | #if LV_ENABLE_GC == 1 51 | #if LV_MEM_CUSTOM != 1 52 | #error "GC requires CUSTOM_MEM" 53 | #endif /* LV_MEM_CUSTOM */ 54 | #else /* LV_ENABLE_GC */ 55 | #define LV_GC_ROOT(x) x 56 | #define LV_EXTERN_ROOT(root_type, root_name) extern root_type root_name; 57 | LV_ITERATE_ROOTS(LV_EXTERN_ROOT) 58 | #endif /* LV_ENABLE_GC */ 59 | 60 | /********************** 61 | * TYPEDEFS 62 | **********************/ 63 | 64 | /********************** 65 | * GLOBAL PROTOTYPES 66 | **********************/ 67 | 68 | void _lv_gc_clear_roots(void); 69 | 70 | /********************** 71 | * MACROS 72 | **********************/ 73 | 74 | #ifdef __cplusplus 75 | } /* extern "C" */ 76 | #endif 77 | 78 | #endif /*LV_GC_H*/ 79 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_misc/lv_log.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_log.c 3 | * 4 | */ 5 | 6 | /********************* 7 | * INCLUDES 8 | *********************/ 9 | #include "lv_log.h" 10 | #if LV_USE_LOG 11 | 12 | #include 13 | #include 14 | #include "lv_printf.h" 15 | 16 | #if LV_LOG_PRINTF 17 | #include 18 | #endif 19 | 20 | /********************* 21 | * DEFINES 22 | *********************/ 23 | 24 | /********************** 25 | * TYPEDEFS 26 | **********************/ 27 | 28 | /********************** 29 | * STATIC PROTOTYPES 30 | **********************/ 31 | 32 | /********************** 33 | * STATIC VARIABLES 34 | **********************/ 35 | static lv_log_print_g_cb_t custom_print_cb; 36 | 37 | /********************** 38 | * MACROS 39 | **********************/ 40 | 41 | /********************** 42 | * GLOBAL FUNCTIONS 43 | **********************/ 44 | 45 | /** 46 | * Register custom print/write function to call when a log is added. 47 | * It can format its "File path", "Line number" and "Description" as required 48 | * and send the formatted log message to a console or serial port. 49 | * @param print_cb a function pointer to print a log 50 | */ 51 | void lv_log_register_print_cb(lv_log_print_g_cb_t print_cb) 52 | { 53 | custom_print_cb = print_cb; 54 | } 55 | 56 | 57 | /** 58 | * Add a log 59 | * @param level the level of log. (From `lv_log_level_t` enum) 60 | * @param file name of the file when the log added 61 | * @param line line number in the source code where the log added 62 | * @param func name of the function when the log added 63 | * @param format printf-like format string 64 | * @param ... parameters for `format` 65 | */ 66 | void _lv_log_add(lv_log_level_t level, const char * file, int line, const char * func, const char * format, ...) 67 | { 68 | if(level >= _LV_LOG_LEVEL_NUM) return; /*Invalid level*/ 69 | 70 | if(level >= LV_LOG_LEVEL) { 71 | va_list args; 72 | va_start(args, format); 73 | char buf[256]; 74 | lv_vsnprintf(buf, sizeof(buf), format, args); 75 | va_end(args); 76 | 77 | #if LV_LOG_PRINTF 78 | /*Use only the file name not the path*/ 79 | size_t p; 80 | for(p = strlen(file); p > 0; p--) { 81 | if(file[p] == '/' || file[p] == '\\') { 82 | p++; /*Skip the slash*/ 83 | break; 84 | } 85 | } 86 | 87 | static const char * lvl_prefix[] = {"Trace", "Info", "Warn", "Error", "User"}; 88 | printf("%s: %s \t(%s #%d %s())\n", lvl_prefix[level], buf, &file[p], line, func); 89 | #else 90 | if(custom_print_cb) custom_print_cb(level, file, line, func, buf); 91 | #endif 92 | } 93 | } 94 | 95 | /********************** 96 | * STATIC FUNCTIONS 97 | **********************/ 98 | 99 | #endif /*LV_USE_LOG*/ 100 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_misc/lv_misc.mk: -------------------------------------------------------------------------------- 1 | CSRCS += lv_area.c 2 | CSRCS += lv_task.c 3 | CSRCS += lv_fs.c 4 | CSRCS += lv_anim.c 5 | CSRCS += lv_mem.c 6 | CSRCS += lv_ll.c 7 | CSRCS += lv_color.c 8 | CSRCS += lv_txt.c 9 | CSRCS += lv_txt_ap.c 10 | CSRCS += lv_math.c 11 | CSRCS += lv_log.c 12 | CSRCS += lv_gc.c 13 | CSRCS += lv_utils.c 14 | CSRCS += lv_async.c 15 | CSRCS += lv_printf.c 16 | CSRCS += lv_bidi.c 17 | CSRCS += lv_debug.c 18 | 19 | DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_misc 20 | VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_misc 21 | 22 | CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_misc" 23 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_misc/lv_printf.h: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////// 2 | // \author (c) Marco Paland (info@paland.com) 3 | // 2014-2019, PALANDesign Hannover, Germany 4 | // 5 | // \license The MIT License (MIT) 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in 15 | // all copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | // THE SOFTWARE. 24 | // 25 | // \brief Tiny printf, sprintf and snprintf implementation, optimized for speed on 26 | // embedded systems with a very limited resources. 27 | // Use this instead of bloated standard/newlib printf. 28 | // These routines are thread safe and reentrant. 29 | // 30 | /////////////////////////////////////////////////////////////////////////////// 31 | 32 | #ifndef _LV_PRINTF_H_ 33 | #define _LV_PRINTF_H_ 34 | 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | #include "../lv_conf_internal.h" 41 | 42 | #if LV_SPRINTF_CUSTOM == 0 43 | 44 | #include 45 | #include 46 | 47 | /** 48 | * Tiny snprintf/vsnprintf implementation 49 | * \param buffer A pointer to the buffer where to store the formatted string 50 | * \param count The maximum number of characters to store in the buffer, including a terminating null character 51 | * \param format A string that specifies the format of the output 52 | * \param va A value identifying a variable arguments list 53 | * \return The number of characters that COULD have been written into the buffer, not counting the terminating 54 | * null character. A value equal or larger than count indicates truncation. Only when the returned value 55 | * is non-negative and less than count, the string has been completely written. 56 | */ 57 | int lv_snprintf(char * buffer, size_t count, const char * format, ...); 58 | int lv_vsnprintf(char * buffer, size_t count, const char * format, va_list va); 59 | 60 | #else 61 | #include LV_SPRINTF_INCLUDE 62 | #endif 63 | 64 | 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | 69 | 70 | #endif // _PRINTF_H_ 71 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_misc/lv_templ.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_templ.c 3 | * 4 | */ 5 | 6 | /********************* 7 | * INCLUDES 8 | *********************/ 9 | 10 | /********************* 11 | * DEFINES 12 | *********************/ 13 | 14 | /********************** 15 | * TYPEDEFS 16 | **********************/ 17 | 18 | /* This typedef exists purely to keep -Wpedantic happy when the file is empty. */ 19 | /* It can be removed. */ 20 | typedef int _keep_pedantic_happy; 21 | 22 | /********************** 23 | * STATIC PROTOTYPES 24 | **********************/ 25 | 26 | /********************** 27 | * STATIC VARIABLES 28 | **********************/ 29 | 30 | /********************** 31 | * MACROS 32 | **********************/ 33 | 34 | /********************** 35 | * GLOBAL FUNCTIONS 36 | **********************/ 37 | 38 | /********************** 39 | * STATIC FUNCTIONS 40 | **********************/ 41 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_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 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_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 "../lv_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 | typedef struct { 33 | uint8_t char_offset; 34 | uint16_t char_end_form; 35 | int8_t char_begining_form_offset; 36 | int8_t char_middle_form_offset; 37 | int8_t char_isolated_form_offset; 38 | struct { 39 | uint8_t conj_to_previous; 40 | uint8_t conj_to_next; 41 | } ap_chars_conjunction; 42 | } ap_chars_map_t; 43 | 44 | /********************** 45 | * GLOBAL PROTOTYPES 46 | **********************/ 47 | uint32_t _lv_txt_ap_calc_bytes_cnt(const char * txt); 48 | void _lv_txt_ap_proc(const char * txt, char * txt_out); 49 | 50 | /********************** 51 | * MACROS 52 | **********************/ 53 | 54 | #endif // LV_USE_ARABIC_PERSIAN_CHARS 55 | 56 | #ifdef __cplusplus 57 | } /* extern "C" */ 58 | #endif 59 | 60 | #endif /*LV_TXT_AP_H*/ 61 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_misc/lv_types.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_types.h 3 | * 4 | */ 5 | 6 | #ifndef LV_TYPES_H 7 | #define LV_TYPES_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | 17 | /********************* 18 | * DEFINES 19 | *********************/ 20 | 21 | #if __STDC_VERSION__ >= 199901L // If c99 or newer, use stdint.h to determine arch size 22 | #include 23 | #endif 24 | 25 | 26 | // If __UINTPTR_MAX__ or UINTPTR_MAX are available, use them to determine arch size 27 | #if defined(__UINTPTR_MAX__) && __UINTPTR_MAX__ > 0xFFFFFFFF 28 | #define LV_ARCH_64 29 | 30 | #elif defined(UINTPTR_MAX) && UINTPTR_MAX > 0xFFFFFFFF 31 | #define LV_ARCH_64 32 | 33 | // Otherwise use compiler-dependent means to determine arch size 34 | #elif defined(_WIN64) || defined(__x86_64__) || defined(__ppc64__) || defined (__aarch64__) 35 | #define LV_ARCH_64 36 | 37 | #endif 38 | 39 | 40 | /********************** 41 | * TYPEDEFS 42 | **********************/ 43 | 44 | /** 45 | * LVGL error codes. 46 | */ 47 | enum { 48 | LV_RES_INV = 0, /*Typically indicates that the object is deleted (become invalid) in the action 49 | function or an operation was failed*/ 50 | LV_RES_OK, /*The object is valid (no deleted) after the action*/ 51 | }; 52 | typedef uint8_t lv_res_t; 53 | 54 | 55 | 56 | #if __STDC_VERSION__ >= 199901L 57 | // If c99 or newer, use the definition of uintptr_t directly from 58 | typedef uintptr_t lv_uintptr_t; 59 | 60 | #else 61 | 62 | // Otherwise, use the arch size determination 63 | #ifdef LV_ARCH_64 64 | typedef uint64_t lv_uintptr_t; 65 | #else 66 | typedef uint32_t lv_uintptr_t; 67 | #endif 68 | 69 | #endif 70 | 71 | 72 | /********************** 73 | * GLOBAL PROTOTYPES 74 | **********************/ 75 | 76 | /********************** 77 | * MACROS 78 | **********************/ 79 | 80 | #define LV_UNUSED(x) ((void) x) 81 | 82 | #ifdef __cplusplus 83 | } /* extern "C" */ 84 | #endif 85 | 86 | #endif /*LV_TYPES_H*/ 87 | 88 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_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 | #include 18 | 19 | /********************* 20 | * DEFINES 21 | *********************/ 22 | 23 | /********************** 24 | * TYPEDEFS 25 | **********************/ 26 | 27 | /********************** 28 | * GLOBAL PROTOTYPES 29 | **********************/ 30 | /** 31 | * Convert a number to string 32 | * @param num a number 33 | * @param buf pointer to a `char` buffer. The result will be stored here (max 10 elements) 34 | * @return same as `buf` (just for convenience) 35 | */ 36 | char * _lv_utils_num_to_str(int32_t num, char * buf); 37 | 38 | /** Searches base[0] to base[n - 1] for an item that matches *key. 39 | * 40 | * @note The function cmp must return negative if its first 41 | * argument (the search key) is less that its second (a table entry), 42 | * zero if equal, and positive if greater. 43 | * 44 | * @note Items in the array must be in ascending order. 45 | * 46 | * @param key Pointer to item being searched for 47 | * @param base Pointer to first element to search 48 | * @param n Number of elements 49 | * @param size Size of each element 50 | * @param cmp Pointer to comparison function (see #lv_font_codeCompare as a comparison function 51 | * example) 52 | * 53 | * @return a pointer to a matching item, or NULL if none exists. 54 | */ 55 | void * _lv_utils_bsearch(const void * key, const void * base, uint32_t n, uint32_t size, 56 | int32_t (*cmp)(const void * pRef, const void * pElement)); 57 | 58 | /********************** 59 | * MACROS 60 | **********************/ 61 | 62 | #ifdef __cplusplus 63 | } /* extern "C" */ 64 | #endif 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_themes/lv_theme_empty.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_theme_material.h 3 | * 4 | */ 5 | 6 | #ifndef LV_THEME_EMPTY_H 7 | #define LV_THEME_EMPTY_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_THEME_EMPTY 19 | 20 | /********************* 21 | * DEFINES 22 | *********************/ 23 | 24 | /********************** 25 | * TYPEDEFS 26 | **********************/ 27 | 28 | /********************** 29 | * GLOBAL PROTOTYPES 30 | **********************/ 31 | 32 | 33 | /** 34 | * Initialize the default 35 | * @param color_primary the primary color of the theme 36 | * @param color_secondary the secondary color for the theme 37 | * @param flags ORed flags starting with `LV_THEME_DEF_FLAG_...` 38 | * @param font_small pointer to a small font 39 | * @param font_normal pointer to a normal font 40 | * @param font_subtitle pointer to a large font 41 | * @param font_title pointer to a extra large font 42 | * @return a pointer to reference this theme later 43 | */ 44 | lv_theme_t * lv_theme_empty_init(lv_color_t color_primary, lv_color_t color_secondary, uint32_t flags, 45 | const lv_font_t * font_small, const lv_font_t * font_normal, const lv_font_t * font_subtitle, 46 | const lv_font_t * font_title); 47 | /********************** 48 | * MACROS 49 | **********************/ 50 | 51 | #endif 52 | 53 | #ifdef __cplusplus 54 | } /* extern "C" */ 55 | #endif 56 | 57 | #endif /*LV_THEME_ALIEN_H*/ 58 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_themes/lv_theme_material.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_theme_material.h 3 | * 4 | */ 5 | 6 | #ifndef LV_THEME_MATERIAL_H 7 | #define LV_THEME_MATERIAL_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_THEME_MATERIAL 19 | 20 | /********************* 21 | * DEFINES 22 | *********************/ 23 | typedef enum { 24 | LV_THEME_MATERIAL_FLAG_DARK = 0x01, 25 | LV_THEME_MATERIAL_FLAG_LIGHT = 0x02, 26 | LV_THEME_MATERIAL_FLAG_NO_TRANSITION = 0x10, 27 | LV_THEME_MATERIAL_FLAG_NO_FOCUS = 0x20, 28 | } lv_theme_material_flag_t; 29 | 30 | /********************** 31 | * TYPEDEFS 32 | **********************/ 33 | 34 | /********************** 35 | * GLOBAL PROTOTYPES 36 | **********************/ 37 | 38 | /** 39 | * Initialize the default 40 | * @param color_primary the primary color of the theme 41 | * @param color_secondary the secondary color for the theme 42 | * @param flags ORed flags starting with `LV_THEME_DEF_FLAG_...` 43 | * @param font_small pointer to a small font 44 | * @param font_normal pointer to a normal font 45 | * @param font_subtitle pointer to a large font 46 | * @param font_title pointer to a extra large font 47 | * @return a pointer to reference this theme later 48 | */ 49 | lv_theme_t * lv_theme_material_init(lv_color_t color_primary, lv_color_t color_secondary, uint32_t flags, 50 | const lv_font_t * font_small, const lv_font_t * font_normal, const lv_font_t * font_subtitle, 51 | const lv_font_t * font_title); 52 | /********************** 53 | * MACROS 54 | **********************/ 55 | 56 | #endif 57 | 58 | #ifdef __cplusplus 59 | } /* extern "C" */ 60 | #endif 61 | 62 | #endif /*LV_THEME_MATERIAL_H*/ 63 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_themes/lv_theme_mono.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_theme_mono.h 3 | * 4 | */ 5 | 6 | #ifndef LV_THEME_MONO_H 7 | #define LV_THEME_MONO_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_THEME_MONO 19 | 20 | /********************* 21 | * DEFINES 22 | *********************/ 23 | 24 | /********************** 25 | * TYPEDEFS 26 | **********************/ 27 | 28 | /********************** 29 | * GLOBAL PROTOTYPES 30 | **********************/ 31 | 32 | 33 | /** 34 | * Initialize the mono theme. 35 | * @param color_primary the primary color of the theme 36 | * @param color_secondary the secondary color for the theme 37 | * @param flags ORed flags starting with `LV_THEME_DEF_FLAG_...` 38 | * @param font_small pointer to a small font 39 | * @param font_normal pointer to a normal font 40 | * @param font_subtitle pointer to a large font 41 | * @param font_title pointer to a extra large font 42 | * @return a pointer to reference this theme later 43 | */ 44 | lv_theme_t * lv_theme_mono_init(lv_color_t color_primary, lv_color_t color_secondary, uint32_t flags, 45 | const lv_font_t * font_small, const lv_font_t * font_normal, const lv_font_t * font_subtitle, 46 | const lv_font_t * font_title); 47 | /********************** 48 | * MACROS 49 | **********************/ 50 | 51 | #endif 52 | 53 | #ifdef __cplusplus 54 | } /* extern "C" */ 55 | #endif 56 | 57 | #endif /*LV_THEME_TEMPLATE_H*/ 58 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_themes/lv_theme_template.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_theme_template.h 3 | * 4 | */ 5 | 6 | #ifndef LV_THEME_TEMPLATE_H 7 | #define LV_THEME_TEMPLATE_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_THEME_TEMPLATE 19 | 20 | /********************* 21 | * DEFINES 22 | *********************/ 23 | 24 | /********************** 25 | * TYPEDEFS 26 | **********************/ 27 | 28 | /********************** 29 | * GLOBAL PROTOTYPES 30 | **********************/ 31 | 32 | 33 | /** 34 | * Initialize the default 35 | * @param color_primary the primary color of the theme 36 | * @param color_secondary the secondary color for the theme 37 | * @param flags ORed flags starting with `LV_THEME_DEF_FLAG_...` 38 | * @param font_small pointer to a small font 39 | * @param font_normal pointer to a normal font 40 | * @param font_subtitle pointer to a large font 41 | * @param font_title pointer to a extra large font 42 | * @return a pointer to reference this theme later 43 | */ 44 | lv_theme_t * lv_theme_template_init(lv_color_t color_primary, lv_color_t color_secondary, uint32_t flags, 45 | const lv_font_t * font_small, const lv_font_t * font_normal, const lv_font_t * font_subtitle, 46 | const lv_font_t * font_title); 47 | /********************** 48 | * MACROS 49 | **********************/ 50 | 51 | #endif 52 | 53 | #ifdef __cplusplus 54 | } /* extern "C" */ 55 | #endif 56 | 57 | #endif /*LV_THEME_TEMPLATE_H*/ 58 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_themes/lv_themes.mk: -------------------------------------------------------------------------------- 1 | CSRCS += lv_theme.c 2 | CSRCS += lv_theme_material.c 3 | CSRCS += lv_theme_mono.c 4 | CSRCS += lv_theme_empty.c 5 | CSRCS += lv_theme_template.c 6 | 7 | DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_themes 8 | VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_themes 9 | 10 | CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_themes" 11 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_widgets/lv_led.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_led.h 3 | * 4 | */ 5 | 6 | #ifndef LV_LED_H 7 | #define LV_LED_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_LED != 0 19 | 20 | #include "../lv_core/lv_obj.h" 21 | 22 | /********************* 23 | * DEFINES 24 | *********************/ 25 | 26 | /********************** 27 | * TYPEDEFS 28 | **********************/ 29 | 30 | /*Data of led*/ 31 | typedef struct { 32 | /*No inherited ext.*/ 33 | /*New data for this type */ 34 | uint8_t bright; /*Current brightness of the LED (0..255)*/ 35 | } lv_led_ext_t; 36 | 37 | /*Parts of LED*/ 38 | enum { 39 | LV_LED_PART_MAIN = LV_OBJ_PART_MAIN, 40 | }; 41 | typedef uint8_t lv_led_part_t; 42 | 43 | /********************** 44 | * GLOBAL PROTOTYPES 45 | **********************/ 46 | 47 | /** 48 | * Create a led objects 49 | * @param par pointer to an object, it will be the parent of the new led 50 | * @param copy pointer to a led object, if not NULL then the new object will be copied from it 51 | * @return pointer to the created led 52 | */ 53 | lv_obj_t * lv_led_create(lv_obj_t * par, const lv_obj_t * copy); 54 | 55 | /** 56 | * Set the brightness of a LED object 57 | * @param led pointer to a LED object 58 | * @param bright LV_LED_BRIGHT_MIN (max. dark) ... LV_LED_BRIGHT_MAX (max. light) 59 | */ 60 | void lv_led_set_bright(lv_obj_t * led, uint8_t bright); 61 | 62 | /** 63 | * Light on a LED 64 | * @param led pointer to a LED object 65 | */ 66 | void lv_led_on(lv_obj_t * led); 67 | 68 | /** 69 | * Light off a LED 70 | * @param led pointer to a LED object 71 | */ 72 | void lv_led_off(lv_obj_t * led); 73 | 74 | /** 75 | * Toggle the state of a LED 76 | * @param led pointer to a LED object 77 | */ 78 | void lv_led_toggle(lv_obj_t * led); 79 | 80 | /** 81 | * Get the brightness of a LEd object 82 | * @param led pointer to LED object 83 | * @return bright 0 (max. dark) ... 255 (max. light) 84 | */ 85 | uint8_t lv_led_get_bright(const lv_obj_t * led); 86 | 87 | /********************** 88 | * MACROS 89 | **********************/ 90 | 91 | #endif /*LV_USE_LED*/ 92 | 93 | #ifdef __cplusplus 94 | } /* extern "C" */ 95 | #endif 96 | 97 | #endif /*LV_LED_H*/ 98 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_widgets/lv_objx_templ.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_templ.h 3 | * 4 | */ 5 | 6 | /* TODO Remove these instructions 7 | * Search an replace: template -> object normal name with lower case (e.g. button, label etc.) 8 | * 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 "../lv_core/lv_obj.h" 28 | 29 | /********************* 30 | * DEFINES 31 | *********************/ 32 | 33 | /********************** 34 | * TYPEDEFS 35 | **********************/ 36 | /*Data of template*/ 37 | typedef struct { 38 | lv_ANCESTOR_ext_t ANCESTOR; /*Ext. of ancestor*/ 39 | /*New data for this type */ 40 | } lv_templ_ext_t; 41 | 42 | /*Styles*/ 43 | enum { 44 | LV_TEMPL_STYLE_X, 45 | LV_TEMPL_STYLE_Y, 46 | }; 47 | typedef uint8_t lv_templ_style_t; 48 | 49 | /********************** 50 | * GLOBAL PROTOTYPES 51 | **********************/ 52 | 53 | /** 54 | * Create a template objects 55 | * @param par pointer to an object, it will be the parent of the new template 56 | * @param copy pointer to a template object, if not NULL then the new object will be copied from it 57 | * @return pointer to the created template 58 | */ 59 | lv_obj_t * lv_templ_create(lv_obj_t * par, const lv_obj_t * copy); 60 | 61 | /*====================== 62 | * Add/remove functions 63 | *=====================*/ 64 | 65 | /*===================== 66 | * Setter functions 67 | *====================*/ 68 | 69 | /** 70 | * Set a style of a template. 71 | * @param templ pointer to template object 72 | * @param type which style should be set 73 | * @param style pointer to a style 74 | */ 75 | void lv_templ_set_style(lv_obj_t * templ, lv_templ_style_t type, const lv_style_t * style); 76 | 77 | /*===================== 78 | * Getter functions 79 | *====================*/ 80 | 81 | /** 82 | * Get style of a template. 83 | * @param templ pointer to template object 84 | * @param type which style should be get 85 | * @return style pointer to the style 86 | */ 87 | lv_style_t * lv_templ_get_style(const lv_obj_t * templ, lv_templ_style_t type); 88 | 89 | /*===================== 90 | * Other functions 91 | *====================*/ 92 | 93 | /********************** 94 | * MACROS 95 | **********************/ 96 | 97 | #endif /*LV_USE_TEMPL*/ 98 | 99 | #ifdef __cplusplus 100 | } /* extern "C" */ 101 | #endif 102 | 103 | #endif /*LV_TEMPL_H*/ 104 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/src/lv_widgets/lv_widgets.mk: -------------------------------------------------------------------------------- 1 | CSRCS += lv_arc.c 2 | CSRCS += lv_bar.c 3 | CSRCS += lv_checkbox.c 4 | CSRCS += lv_cpicker.c 5 | CSRCS += lv_dropdown.c 6 | CSRCS += lv_keyboard.c 7 | CSRCS += lv_line.c 8 | CSRCS += lv_msgbox.c 9 | CSRCS += lv_spinner.c 10 | CSRCS += lv_roller.c 11 | CSRCS += lv_table.c 12 | CSRCS += lv_tabview.c 13 | CSRCS += lv_tileview.c 14 | CSRCS += lv_btn.c 15 | CSRCS += lv_calendar.c 16 | CSRCS += lv_chart.c 17 | CSRCS += lv_canvas.c 18 | CSRCS += lv_gauge.c 19 | CSRCS += lv_label.c 20 | CSRCS += lv_list.c 21 | CSRCS += lv_slider.c 22 | CSRCS += lv_textarea.c 23 | CSRCS += lv_spinbox.c 24 | CSRCS += lv_btnmatrix.c 25 | CSRCS += lv_cont.c 26 | CSRCS += lv_img.c 27 | CSRCS += lv_imgbtn.c 28 | CSRCS += lv_led.c 29 | CSRCS += lv_linemeter.c 30 | CSRCS += lv_page.c 31 | CSRCS += lv_switch.c 32 | CSRCS += lv_win.c 33 | CSRCS += lv_objmask.c 34 | 35 | DEPPATH += --dep-path $(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_widgets 36 | VPATH += :$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_widgets 37 | 38 | CFLAGS += "-I$(LVGL_DIR)/$(LVGL_DIR_NAME)/src/lv_widgets" 39 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/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 | } 37 | #endif 38 | 39 | #endif /*LVGL_SRC_H*/ 40 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/tests/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile 3 | # 4 | CC ?= gcc 5 | LVGL_DIR ?= ${shell pwd}/../.. 6 | LVGL_DIR_NAME ?= lvgl 7 | 8 | WARNINGS = -Werror -Wall -Wextra \ 9 | -Wshadow -Wundef -Wmaybe-uninitialized -Wmissing-prototypes -Wpointer-arith -Wuninitialized \ 10 | -Wunreachable-code -Wreturn-type -Wmultichar -Wformat-security -Wdouble-promotion -Wclobbered -Wdeprecated \ 11 | -Wempty-body -Wshift-negative-value -Wstack-usage=2048 \ 12 | -Wtype-limits -Wsizeof-pointer-memaccess 13 | 14 | #-Wno-unused-value -Wno-unused-parameter 15 | OPTIMIZATION ?= -O3 -g0 16 | 17 | 18 | CFLAGS ?= -I$(LVGL_DIR)/ $(DEFINES) $(WARNINGS) $(OPTIMIZATION) -I$(LVGL_DIR) -I. 19 | 20 | LDFLAGS ?= -lpng 21 | BIN ?= demo 22 | 23 | 24 | #Collect the files to compile 25 | MAINSRC = ./lv_test_main.c 26 | 27 | include ../lvgl.mk 28 | 29 | CSRCS += lv_test_assert.c 30 | CSRCS += lv_test_core/lv_test_core.c 31 | CSRCS += lv_test_core/lv_test_obj.c 32 | CSRCS += lv_test_core/lv_test_style.c 33 | 34 | OBJEXT ?= .o 35 | 36 | AOBJS = $(ASRCS:.S=$(OBJEXT)) 37 | COBJS = $(CSRCS:.c=$(OBJEXT)) 38 | 39 | MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) 40 | 41 | SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) 42 | OBJS = $(AOBJS) $(COBJS) 43 | 44 | ## MAINOBJ -> OBJFILES 45 | 46 | all: default 47 | 48 | %.o: %.c 49 | @$(CC) $(CFLAGS) -c $< -o $@ 50 | @echo "CC $<" 51 | 52 | default: $(AOBJS) $(COBJS) $(MAINOBJ) 53 | $(CC) -o $(BIN) $(MAINOBJ) $(AOBJS) $(COBJS) $(LDFLAGS) 54 | 55 | clean: 56 | rm -f $(BIN) $(AOBJS) $(COBJS) $(MAINOBJ) 57 | 58 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/tests/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0015/ESP32-OpenCV-Projects/f1376ca40d2785021f3a318413aedff790a53048/esp32/examples/color_code/components/lvgl_gui/lvgl/tests/icon.png -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/tests/icon2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0015/ESP32-OpenCV-Projects/f1376ca40d2785021f3a318413aedff790a53048/esp32/examples/color_code/components/lvgl_gui/lvgl/tests/icon2.png -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/tests/lv_test_assert.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_test_assert.h 3 | * 4 | */ 5 | 6 | #ifndef LV_TEST_ASSERT_H 7 | #define LV_TEST_ASSERT_H 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | /********************* 14 | * INCLUDES 15 | *********************/ 16 | #include 17 | #include 18 | #include "../lvgl.h" 19 | 20 | /********************* 21 | * DEFINES 22 | *********************/ 23 | 24 | /********************** 25 | * TYPEDEFS 26 | **********************/ 27 | 28 | /********************** 29 | * GLOBAL PROTOTYPES 30 | **********************/ 31 | 32 | void lv_test_print(const char * s, ...); 33 | void lv_test_exit(const char * s, ...); 34 | void lv_test_error(const char * s, ...); 35 | void lv_test_assert_int_eq(int32_t n1, int32_t n2, const char * s); 36 | void lv_test_assert_int_gt(int32_t n_ref, int32_t n_act, const char * s); 37 | void lv_test_assert_int_lt(int32_t n_ref, int32_t n_act, const char * s); 38 | void lv_test_assert_str_eq(const char * str1, const char * str2, const char * s); 39 | void lv_test_assert_ptr_eq(const void * p_ref, const void * p_act, const char * s); 40 | void lv_test_assert_color_eq(lv_color_t c_ref, lv_color_t c_act, const char * s); 41 | void lv_test_assert_img_eq(const char * ref_img_fn, const char * s); 42 | 43 | /********************** 44 | * MACROS 45 | **********************/ 46 | 47 | #ifdef __cplusplus 48 | } /* extern "C" */ 49 | #endif 50 | 51 | #endif /*LV_TEST_ASSERT_H*/ 52 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/tests/lv_test_conf.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_test_conf.h 3 | * 4 | */ 5 | 6 | #ifndef LV_TEST_CONF_H 7 | #define LV_TEST_CONF_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 | uint32_t custom_tick_get(void); 26 | #define LV_TICK_CUSTOM_SYS_TIME_EXPR custom_tick_get() 27 | 28 | typedef int16_t lv_coord_t; 29 | typedef void * lv_disp_drv_user_data_t; /*Type of user data in the display driver*/ 30 | typedef void * lv_indev_drv_user_data_t; /*Type of user data in the input device driver*/ 31 | typedef void * lv_font_user_data_t; 32 | typedef void * lv_obj_user_data_t; 33 | typedef void * lv_anim_user_data_t; 34 | typedef void * lv_group_user_data_t; 35 | typedef void * lv_fs_drv_user_data_t; 36 | typedef void * lv_img_decoder_user_data_t; 37 | 38 | /********************** 39 | * GLOBAL PROTOTYPES 40 | **********************/ 41 | 42 | /********************** 43 | * MACROS 44 | **********************/ 45 | 46 | #ifdef __cplusplus 47 | } /* extern "C" */ 48 | #endif 49 | 50 | #endif /*LV_TEST_CONF_H*/ 51 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/tests/lv_test_core/lv_test_core.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_test_core.c 3 | * 4 | */ 5 | 6 | /********************* 7 | * INCLUDES 8 | *********************/ 9 | #include "../lv_test_assert.h" 10 | 11 | #if LV_BUILD_TEST 12 | #include "lv_test_core.h" 13 | #include "lv_test_obj.h" 14 | #include "lv_test_style.h" 15 | 16 | /********************* 17 | * DEFINES 18 | *********************/ 19 | 20 | /********************** 21 | * TYPEDEFS 22 | **********************/ 23 | 24 | /********************** 25 | * STATIC PROTOTYPES 26 | **********************/ 27 | 28 | /********************** 29 | * STATIC VARIABLES 30 | **********************/ 31 | 32 | /********************** 33 | * MACROS 34 | **********************/ 35 | 36 | /********************** 37 | * GLOBAL FUNCTIONS 38 | **********************/ 39 | 40 | void lv_test_core(void) 41 | { 42 | lv_test_print(""); 43 | lv_test_print("*******************"); 44 | lv_test_print("Start lv_core tests"); 45 | lv_test_print("*******************"); 46 | 47 | lv_test_obj(); 48 | lv_test_style(); 49 | } 50 | 51 | 52 | /********************** 53 | * STATIC FUNCTIONS 54 | **********************/ 55 | #endif 56 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/tests/lv_test_core/lv_test_core.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_test_core.h 3 | * 4 | */ 5 | 6 | #ifndef LV_TEST_CORE_H 7 | #define LV_TEST_CORE_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_test_core(void); 29 | 30 | /********************** 31 | * MACROS 32 | **********************/ 33 | 34 | #ifdef __cplusplus 35 | } /* extern "C" */ 36 | #endif 37 | 38 | #endif /*LV_TEST_CORE_H*/ 39 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/tests/lv_test_core/lv_test_obj.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_test_obj.h 3 | * 4 | */ 5 | 6 | #ifndef LV_TEST_OBJ_H 7 | #define LV_TEST_OBJ_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_test_obj(void); 29 | 30 | /********************** 31 | * MACROS 32 | **********************/ 33 | 34 | #ifdef __cplusplus 35 | } /* extern "C" */ 36 | #endif 37 | 38 | #endif /*LV_TEST_OBJ_H*/ 39 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/tests/lv_test_core/lv_test_style.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_test_style.h 3 | * 4 | */ 5 | 6 | #ifndef LV_TEST_STYLE_H 7 | #define LV_TEST_STYLE_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_test_style(void); 29 | 30 | /********************** 31 | * MACROS 32 | **********************/ 33 | 34 | #ifdef __cplusplus 35 | } /* extern "C" */ 36 | #endif 37 | 38 | #endif /*LV_TEST_STYLE_H*/ 39 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/tests/lv_test_main.c: -------------------------------------------------------------------------------- 1 | #include "../lvgl.h" 2 | #include 3 | #include 4 | #include 5 | #include "lv_test_core/lv_test_core.h" 6 | 7 | #if LV_BUILD_TEST 8 | 9 | static void hal_init(void); 10 | static void dummy_flush_cb(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p); 11 | 12 | int main(void) 13 | { 14 | printf("Call lv_init...\n"); 15 | lv_init(); 16 | 17 | hal_init(); 18 | 19 | lv_test_core(); 20 | 21 | printf("Exit with success!\n"); 22 | return 0; 23 | } 24 | 25 | 26 | static void hal_init(void) 27 | { 28 | static lv_disp_buf_t disp_buf; 29 | lv_color_t * disp_buf1 = (lv_color_t *)malloc(LV_HOR_RES * LV_VER_RES * sizeof(lv_color_t)); 30 | 31 | lv_disp_buf_init(&disp_buf, disp_buf1, NULL, LV_HOR_RES* LV_VER_RES); 32 | 33 | lv_disp_drv_t disp_drv; 34 | lv_disp_drv_init(&disp_drv); 35 | disp_drv.buffer = &disp_buf; 36 | disp_drv.flush_cb = dummy_flush_cb; 37 | lv_disp_drv_register(&disp_drv); 38 | } 39 | 40 | 41 | static void dummy_flush_cb(lv_disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p) 42 | { 43 | LV_UNUSED(area); 44 | LV_UNUSED(color_p); 45 | lv_disp_flush_ready(disp_drv); 46 | } 47 | 48 | uint32_t custom_tick_get(void) 49 | { 50 | static uint64_t start_ms = 0; 51 | if(start_ms == 0) { 52 | struct timeval tv_start; 53 | gettimeofday(&tv_start, NULL); 54 | start_ms = (tv_start.tv_sec * 1000000 + tv_start.tv_usec) / 1000; 55 | } 56 | 57 | struct timeval tv_now; 58 | gettimeofday(&tv_now, NULL); 59 | uint64_t now_ms; 60 | now_ms = (tv_now.tv_sec * 1000000 + tv_now.tv_usec) / 1000; 61 | 62 | uint32_t time_ms = now_ms - start_ms; 63 | return time_ms; 64 | } 65 | 66 | #endif 67 | 68 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/tests/lv_test_objx/lv_test_cont.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_test_cont.c 3 | * 4 | */ 5 | 6 | /********************* 7 | * INCLUDES 8 | *********************/ 9 | #include "../../lvgl.h" 10 | #include "../lv_test_assert.h" 11 | 12 | #if LV_BUILD_TEST 13 | 14 | 15 | /********************* 16 | * DEFINES 17 | *********************/ 18 | 19 | /********************** 20 | * TYPEDEFS 21 | **********************/ 22 | 23 | /********************** 24 | * STATIC PROTOTYPES 25 | **********************/ 26 | static void create_copy(void); 27 | 28 | /********************** 29 | * STATIC VARIABLES 30 | **********************/ 31 | 32 | /********************** 33 | * MACROS 34 | **********************/ 35 | 36 | /********************** 37 | * GLOBAL FUNCTIONS 38 | **********************/ 39 | 40 | void lv_test_cont(void) 41 | { 42 | lv_test_print(""); 43 | lv_test_print("==================="); 44 | lv_test_print("Start lv_cont tests"); 45 | lv_test_print("==================="); 46 | 47 | create_copy(); 48 | } 49 | 50 | 51 | /********************** 52 | * STATIC FUNCTIONS 53 | **********************/ 54 | 55 | static void create_copy(void) 56 | { 57 | lv_test_print(""); 58 | lv_test_print("Create and copy a container"); 59 | lv_test_print("---------------------------"); 60 | 61 | lv_test_print("Create a container"); 62 | lv_test_assert_int_eq(0, lv_obj_count_children(lv_scr_act()), "Screen's children count before creation"); 63 | 64 | lv_obj_t * obj = lv_cont_create(lv_scr_act(), NULL); 65 | lv_test_assert_int_eq(1, lv_obj_count_children(lv_scr_act()), "Screen's children count after creation"); 66 | 67 | lv_test_print("Test the default values"); 68 | lv_test_assert_int_eq(LV_FIT_NONE, lv_cont_get_fit_left(obj), "Default left fit"); 69 | lv_test_assert_int_eq(LV_FIT_NONE, lv_cont_get_fit_right(obj), "Default right fit"); 70 | lv_test_assert_int_eq(LV_FIT_NONE, lv_cont_get_fit_top(obj), "Default top fit"); 71 | lv_test_assert_int_eq(LV_FIT_NONE, lv_cont_get_fit_bottom(obj), "Default bottom fit"); 72 | lv_test_assert_int_eq(LV_LAYOUT_OFF, lv_cont_get_layout(obj), "Default layout"); 73 | 74 | lv_test_print("Delete the container"); 75 | lv_obj_del(obj); 76 | obj = NULL; 77 | lv_test_assert_int_eq(0, lv_obj_count_children(lv_scr_act()), "Screen's children count after delete"); 78 | 79 | } 80 | #endif 81 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/tests/lv_test_objx/lv_test_cont.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_test_obj.h 3 | * 4 | */ 5 | 6 | #ifndef LV_TEST_CONT_H 7 | #define LV_TEST_CONT_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_test_cont(void); 29 | 30 | /********************** 31 | * MACROS 32 | **********************/ 33 | 34 | #ifdef __cplusplus 35 | } /* extern "C" */ 36 | #endif 37 | 38 | #endif /*LV_TEST_CONT_H*/ 39 | -------------------------------------------------------------------------------- /esp32/examples/color_code/components/lvgl_gui/lvgl/tests/lv_test_ref_imgs/lv_test_obj_1_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0015/ESP32-OpenCV-Projects/f1376ca40d2785021f3a318413aedff790a53048/esp32/examples/color_code/components/lvgl_gui/lvgl/tests/lv_test_ref_imgs/lv_test_obj_1_1.png -------------------------------------------------------------------------------- /esp32/examples/color_code/demo/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0015/ESP32-OpenCV-Projects/f1376ca40d2785021f3a318413aedff790a53048/esp32/examples/color_code/demo/demo.gif -------------------------------------------------------------------------------- /esp32/examples/color_code/main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register( 2 | SRCS 3 | main.cpp 4 | app_screen.cpp 5 | app_camera.c 6 | 7 | system.cpp 8 | 9 | INCLUDE_DIRS 10 | . 11 | include 12 | opencv 13 | ) 14 | 15 | # Be aware that the order of the librairies is important 16 | add_prebuilt_library(opencv_imgcodecs "opencv/libopencv_imgcodecs.a") 17 | add_prebuilt_library(libpng "opencv/3rdparty/liblibpng.a") 18 | add_prebuilt_library(libzlib "opencv/3rdparty/libzlib.a") 19 | add_prebuilt_library(opencv_imgproc "opencv/libopencv_imgproc.a") 20 | add_prebuilt_library(opencv_core "opencv/libopencv_core.a") 21 | add_prebuilt_library(ade "opencv/libade.a") 22 | 23 | target_link_libraries(${COMPONENT_LIB} PRIVATE opencv_imgcodecs) 24 | target_link_libraries(${COMPONENT_LIB} PRIVATE libpng) 25 | target_link_libraries(${COMPONENT_LIB} PRIVATE libzlib) 26 | target_link_libraries(${COMPONENT_LIB} PRIVATE opencv_imgproc) 27 | target_link_libraries(${COMPONENT_LIB} PRIVATE opencv_core) 28 | target_link_libraries(${COMPONENT_LIB} PRIVATE ade) 29 | 30 | # create spiffs partition (named 'storage') from the ../spiffs_image directory 31 | #spiffs_create_partition_image(storage ../spiffs_image FLASH_IN_PROJECT) 32 | -------------------------------------------------------------------------------- /esp32/examples/color_code/main/component.mk: -------------------------------------------------------------------------------- 1 | # 2 | # "main" pseudo-component makefile. 3 | # 4 | # (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.) 5 | -------------------------------------------------------------------------------- /esp32/examples/color_code/main/include/app_camera.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ESPRESSIF MIT License 3 | * 4 | * Copyright (c) 2017 5 | * 6 | * Permission is hereby granted for use on ESPRESSIF SYSTEMS products only, in which case, 7 | * it is free of charge, to any person obtaining a copy of this software and associated 8 | * documentation files (the "Software"), to deal in the Software without restriction, including 9 | * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, 10 | * and/or sell copies of the Software, and to permit persons to whom the Software is furnished 11 | * to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all copies or 14 | * substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 18 | * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 19 | * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 20 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 21 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | * 23 | */ 24 | #ifndef _APP_CAMERA_H_ 25 | #define _APP_CAMERA_H_ 26 | 27 | #include "esp_log.h" 28 | #include "esp_system.h" 29 | #include "esp_camera.h" 30 | #include "board_def.h" 31 | 32 | /** 33 | * PIXFORMAT_RGB565, // 2BPP/RGB565 34 | * PIXFORMAT_YUV422, // 2BPP/YUV422 35 | * PIXFORMAT_GRAYSCALE, // 1BPP/GRAYSCALE 36 | * PIXFORMAT_JPEG, // JPEG/COMPRESSED 37 | * PIXFORMAT_RGB888, // 3BPP/RGB888 38 | */ 39 | #define CAMERA_PIXEL_FORMAT PIXFORMAT_RGB565 40 | 41 | /* 42 | * FRAMESIZE_QQVGA, // 160x120 43 | * FRAMESIZE_QQVGA2, // 128x160 44 | * FRAMESIZE_QCIF, // 176x144 45 | * FRAMESIZE_240X240, // 240x240 46 | * FRAMESIZE_HQVGA, // 240x176 47 | * FRAMESIZE_QVGA, // 320x240 48 | * FRAMESIZE_CIF, // 400x296 49 | * FRAMESIZE_VGA, // 640x480 50 | * FRAMESIZE_SVGA, // 800x600 51 | * FRAMESIZE_XGA, // 1024x768 52 | * FRAMESIZE_SXGA, // 1280x1024 53 | * FRAMESIZE_UXGA, // 1600x1200 54 | */ 55 | //#define CAMERA_FRAME_SIZE FRAMESIZE_QVGA 56 | #define CAMERA_FRAME_SIZE FRAMESIZE_240X240 57 | 58 | #ifdef __cplusplus 59 | extern "C" 60 | { 61 | #endif 62 | 63 | void app_camera_init(); 64 | 65 | #if __cplusplus 66 | } 67 | #endif 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /esp32/examples/color_code/main/include/app_screen.h: -------------------------------------------------------------------------------- 1 | #ifndef _APP_SCREEN_H_ 2 | #define _APP_SCREEN_H_ 3 | 4 | #include "iot_lcd.h" 5 | 6 | #if __cplusplus 7 | extern "C" { 8 | #endif 9 | 10 | #define JPG_IMAGE_LINE_BUF_SIZE 512 11 | 12 | #define CENTER -9003 13 | #define RIGHT -9004 14 | #define BOTTOM -9004 15 | 16 | 17 | void lvgl_lcd_hal_init(); 18 | 19 | int TFT_bmp_image(int x, int y, uint8_t scale, char *fname, uint8_t *imgbuf, int size); 20 | 21 | void TFT_jpg_image(int x, 22 | int y, 23 | uint8_t scale, 24 | int s, 25 | char *filename, 26 | uint8_t *buf, 27 | int size); 28 | 29 | #if __cplusplus 30 | } 31 | #endif 32 | #endif /*_APP_SCREEN_H_*/ -------------------------------------------------------------------------------- /esp32/examples/color_code/main/include/board_def.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #define SPI_MISO 22 4 | #define SPI_MOSI 19 5 | #define SPI_SCLK 21 6 | 7 | #define SD_CS 0 8 | #define SD_MOSI SPI_MOSI 9 | #define SD_MISO SPI_MISO 10 | #define SD_CLK SPI_SCLK 11 | 12 | #define TFT_MISO SPI_MISO 13 | #define TFT_MOSI SPI_MOSI 14 | #define TFT_SCLK SPI_SCLK 15 | #define TFT_CS 12 // Chip select control pin 16 | #define TFT_DC 15 // Data Command control pin 17 | #define TFT_BK 2 // TFT backlight pin 18 | #define TFT_RST GPIO_NUM_MAX //No use 19 | 20 | #define TFT_WITDH 240 21 | #define TFT_HEIGHT 240 22 | 23 | #define I2C_SDA 18 24 | #define I2C_SCL 23 25 | 26 | #define IIS_SCLK 14 27 | #define IIS_LCLK 32 28 | #define IIS_DSIN -1 29 | #define IIS_DOUT 33 30 | 31 | #define PWDN_GPIO_NUM -1 32 | #define RESET_GPIO_NUM -1 33 | #define XCLK_GPIO_NUM 4 34 | #define SIOD_GPIO_NUM 18 35 | #define SIOC_GPIO_NUM 23 36 | 37 | #define Y9_GPIO_NUM 36 38 | #define Y8_GPIO_NUM 37 39 | #define Y7_GPIO_NUM 38 40 | #define Y6_GPIO_NUM 39 41 | #define Y5_GPIO_NUM 35 42 | #define Y4_GPIO_NUM 26 43 | #define Y3_GPIO_NUM 13 44 | #define Y2_GPIO_NUM 34 45 | #define VSYNC_GPIO_NUM 5 46 | #define HREF_GPIO_NUM 27 47 | #define PCLK_GPIO_NUM 25 48 | #define XCLK_FREQ 20000000 49 | -------------------------------------------------------------------------------- /esp32/examples/color_code/main/include/system.h: -------------------------------------------------------------------------------- 1 | #ifndef __SYSTEM_H 2 | #define __SYSTEM_H 3 | 4 | 5 | // Display memory info 6 | void disp_infos(); 7 | 8 | // Holds the task for a given amount of msec 9 | void wait_msec(uint16_t v); 10 | 11 | // Holds the task for a full second 12 | void wait_sec(uint16_t v); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /esp32/examples/color_code/main/memory_organization.lf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0015/ESP32-OpenCV-Projects/f1376ca40d2785021f3a318413aedff790a53048/esp32/examples/color_code/main/memory_organization.lf -------------------------------------------------------------------------------- /esp32/examples/color_code/main/opencv/3rdparty/liblibpng.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0015/ESP32-OpenCV-Projects/f1376ca40d2785021f3a318413aedff790a53048/esp32/examples/color_code/main/opencv/3rdparty/liblibpng.a -------------------------------------------------------------------------------- /esp32/examples/color_code/main/opencv/3rdparty/libzlib.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0015/ESP32-OpenCV-Projects/f1376ca40d2785021f3a318413aedff790a53048/esp32/examples/color_code/main/opencv/3rdparty/libzlib.a -------------------------------------------------------------------------------- /esp32/examples/color_code/main/opencv/libade.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0015/ESP32-OpenCV-Projects/f1376ca40d2785021f3a318413aedff790a53048/esp32/examples/color_code/main/opencv/libade.a -------------------------------------------------------------------------------- /esp32/examples/color_code/main/opencv/libopencv_core.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0015/ESP32-OpenCV-Projects/f1376ca40d2785021f3a318413aedff790a53048/esp32/examples/color_code/main/opencv/libopencv_core.a -------------------------------------------------------------------------------- /esp32/examples/color_code/main/opencv/libopencv_imgcodecs.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0015/ESP32-OpenCV-Projects/f1376ca40d2785021f3a318413aedff790a53048/esp32/examples/color_code/main/opencv/libopencv_imgcodecs.a -------------------------------------------------------------------------------- /esp32/examples/color_code/main/opencv/libopencv_imgproc.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/0015/ESP32-OpenCV-Projects/f1376ca40d2785021f3a318413aedff790a53048/esp32/examples/color_code/main/opencv/libopencv_imgproc.a -------------------------------------------------------------------------------- /esp32/examples/color_code/main/opencv/opencv2/core/bindings_utils.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_CORE_BINDINGS_UTILS_HPP 6 | #define OPENCV_CORE_BINDINGS_UTILS_HPP 7 | 8 | #include 9 | #include 10 | 11 | namespace cv { namespace utils { 12 | //! @addtogroup core_utils 13 | //! @{ 14 | 15 | CV_EXPORTS_W String dumpInputArray(InputArray argument); 16 | 17 | CV_EXPORTS_W String dumpInputArrayOfArrays(InputArrayOfArrays argument); 18 | 19 | CV_EXPORTS_W String dumpInputOutputArray(InputOutputArray argument); 20 | 21 | CV_EXPORTS_W String dumpInputOutputArrayOfArrays(InputOutputArrayOfArrays argument); 22 | 23 | CV_WRAP static inline 24 | String dumpBool(bool argument) 25 | { 26 | return (argument) ? String("Bool: True") : String("Bool: False"); 27 | } 28 | 29 | CV_WRAP static inline 30 | String dumpInt(int argument) 31 | { 32 | return cv::format("Int: %d", argument); 33 | } 34 | 35 | CV_WRAP static inline 36 | String dumpSizeT(size_t argument) 37 | { 38 | std::ostringstream oss("size_t: ", std::ios::ate); 39 | oss << argument; 40 | return oss.str(); 41 | } 42 | 43 | CV_WRAP static inline 44 | String dumpFloat(float argument) 45 | { 46 | return cv::format("Float: %.2f", argument); 47 | } 48 | 49 | CV_WRAP static inline 50 | String dumpDouble(double argument) 51 | { 52 | return cv::format("Double: %.2f", argument); 53 | } 54 | 55 | CV_WRAP static inline 56 | String dumpCString(const char* argument) 57 | { 58 | return cv::format("String: %s", argument); 59 | } 60 | 61 | CV_WRAP static inline 62 | AsyncArray testAsyncArray(InputArray argument) 63 | { 64 | AsyncPromise p; 65 | p.setValue(argument); 66 | return p.getArrayResult(); 67 | } 68 | 69 | CV_WRAP static inline 70 | AsyncArray testAsyncException() 71 | { 72 | AsyncPromise p; 73 | try 74 | { 75 | CV_Error(Error::StsOk, "Test: Generated async error"); 76 | } 77 | catch (const cv::Exception& e) 78 | { 79 | p.setException(e); 80 | } 81 | return p.getArrayResult(); 82 | } 83 | 84 | //! @} 85 | }} // namespace 86 | 87 | #endif // OPENCV_CORE_BINDINGS_UTILS_HPP 88 | -------------------------------------------------------------------------------- /esp32/examples/color_code/main/opencv/opencv2/core/bufferpool.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | // 5 | // Copyright (C) 2014, Advanced Micro Devices, Inc., all rights reserved. 6 | 7 | #ifndef OPENCV_CORE_BUFFER_POOL_HPP 8 | #define OPENCV_CORE_BUFFER_POOL_HPP 9 | 10 | #ifdef _MSC_VER 11 | #pragma warning(push) 12 | #pragma warning(disable: 4265) 13 | #endif 14 | 15 | namespace cv 16 | { 17 | 18 | //! @addtogroup core 19 | //! @{ 20 | 21 | class BufferPoolController 22 | { 23 | protected: 24 | ~BufferPoolController() { } 25 | public: 26 | virtual size_t getReservedSize() const = 0; 27 | virtual size_t getMaxReservedSize() const = 0; 28 | virtual void setMaxReservedSize(size_t size) = 0; 29 | virtual void freeAllReservedBuffers() = 0; 30 | }; 31 | 32 | //! @} 33 | 34 | } 35 | 36 | #ifdef _MSC_VER 37 | #pragma warning(pop) 38 | #endif 39 | 40 | #endif // OPENCV_CORE_BUFFER_POOL_HPP 41 | -------------------------------------------------------------------------------- /esp32/examples/color_code/main/opencv/opencv2/core/core.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/core.hpp" 49 | -------------------------------------------------------------------------------- /esp32/examples/color_code/main/opencv/opencv2/core/detail/async_promise.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_CORE_ASYNC_PROMISE_HPP 6 | #define OPENCV_CORE_ASYNC_PROMISE_HPP 7 | 8 | #include "../async.hpp" 9 | 10 | #include "exception_ptr.hpp" 11 | 12 | namespace cv { 13 | 14 | /** @addtogroup core_async 15 | @{ 16 | */ 17 | 18 | 19 | /** @brief Provides result of asynchronous operations 20 | 21 | */ 22 | class CV_EXPORTS AsyncPromise 23 | { 24 | public: 25 | ~AsyncPromise() CV_NOEXCEPT; 26 | AsyncPromise() CV_NOEXCEPT; 27 | explicit AsyncPromise(const AsyncPromise& o) CV_NOEXCEPT; 28 | AsyncPromise& operator=(const AsyncPromise& o) CV_NOEXCEPT; 29 | void release() CV_NOEXCEPT; 30 | 31 | /** Returns associated AsyncArray 32 | @note Can be called once 33 | */ 34 | AsyncArray getArrayResult(); 35 | 36 | /** Stores asynchronous result. 37 | @param[in] value result 38 | */ 39 | void setValue(InputArray value); 40 | 41 | // TODO "move" setters 42 | 43 | #if CV__EXCEPTION_PTR 44 | /** Stores exception. 45 | @param[in] exception exception to be raised in AsyncArray 46 | */ 47 | void setException(std::exception_ptr exception); 48 | #endif 49 | 50 | /** Stores exception. 51 | @param[in] exception exception to be raised in AsyncArray 52 | */ 53 | void setException(const cv::Exception& exception); 54 | 55 | #ifdef CV_CXX11 56 | explicit AsyncPromise(AsyncPromise&& o) { p = o.p; o.p = NULL; } 57 | AsyncPromise& operator=(AsyncPromise&& o) CV_NOEXCEPT { std::swap(p, o.p); return *this; } 58 | #endif 59 | 60 | 61 | // PImpl 62 | typedef struct AsyncArray::Impl Impl; friend struct AsyncArray::Impl; 63 | inline void* _getImpl() const CV_NOEXCEPT { return p; } 64 | protected: 65 | Impl* p; 66 | }; 67 | 68 | 69 | //! @} 70 | } // namespace 71 | #endif // OPENCV_CORE_ASYNC_PROMISE_HPP 72 | -------------------------------------------------------------------------------- /esp32/examples/color_code/main/opencv/opencv2/core/detail/exception_ptr.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_CORE_DETAILS_EXCEPTION_PTR_H 6 | #define OPENCV_CORE_DETAILS_EXCEPTION_PTR_H 7 | 8 | #ifndef CV__EXCEPTION_PTR 9 | # if defined(__ANDROID__) && defined(ATOMIC_INT_LOCK_FREE) && ATOMIC_INT_LOCK_FREE < 2 10 | # define CV__EXCEPTION_PTR 0 // Not supported, details: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58938 11 | # elif defined(CV_CXX11) 12 | # define CV__EXCEPTION_PTR 1 13 | # elif defined(_MSC_VER) 14 | # define CV__EXCEPTION_PTR (_MSC_VER >= 1600) 15 | # elif defined(__clang__) 16 | # define CV__EXCEPTION_PTR 0 // C++11 only (see above) 17 | # elif defined(__GNUC__) && defined(__GXX_EXPERIMENTAL_CXX0X__) 18 | # define CV__EXCEPTION_PTR (__GXX_EXPERIMENTAL_CXX0X__ > 0) 19 | # endif 20 | #endif 21 | #ifndef CV__EXCEPTION_PTR 22 | # define CV__EXCEPTION_PTR 0 23 | #elif CV__EXCEPTION_PTR 24 | # include // std::exception_ptr 25 | #endif 26 | 27 | #endif // OPENCV_CORE_DETAILS_EXCEPTION_PTR_H 28 | -------------------------------------------------------------------------------- /esp32/examples/color_code/main/opencv/opencv2/core/ocl_genbase.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of the copyright holders may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the OpenCV Foundation or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | #ifndef OPENCV_OPENCL_GENBASE_HPP 43 | #define OPENCV_OPENCL_GENBASE_HPP 44 | 45 | //! @cond IGNORED 46 | 47 | namespace cv { 48 | namespace ocl { 49 | 50 | class ProgramSource; 51 | 52 | namespace internal { 53 | 54 | struct CV_EXPORTS ProgramEntry 55 | { 56 | const char* module; 57 | const char* name; 58 | const char* programCode; 59 | const char* programHash; 60 | ProgramSource* pProgramSource; 61 | 62 | operator ProgramSource& () const; 63 | }; 64 | 65 | } } } // namespace 66 | 67 | //! @endcond 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /esp32/examples/color_code/main/opencv/opencv2/core/opencl/runtime/autogenerated/opencl_gl_wrappers.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // AUTOGENERATED, DO NOT EDIT 3 | // 4 | #ifndef OPENCV_CORE_OCL_RUNTIME_OPENCL_GL_WRAPPERS_HPP 5 | #error "Invalid usage" 6 | #endif 7 | 8 | #ifdef cl_khr_gl_sharing 9 | 10 | // generated by parser_cl.py 11 | #undef clCreateFromGLBuffer 12 | #define clCreateFromGLBuffer clCreateFromGLBuffer_fn 13 | inline cl_mem clCreateFromGLBuffer(cl_context p0, cl_mem_flags p1, cl_GLuint p2, int* p3) { return clCreateFromGLBuffer_pfn(p0, p1, p2, p3); } 14 | #undef clCreateFromGLRenderbuffer 15 | #define clCreateFromGLRenderbuffer clCreateFromGLRenderbuffer_fn 16 | inline cl_mem clCreateFromGLRenderbuffer(cl_context p0, cl_mem_flags p1, cl_GLuint p2, cl_int* p3) { return clCreateFromGLRenderbuffer_pfn(p0, p1, p2, p3); } 17 | #undef clCreateFromGLTexture 18 | #define clCreateFromGLTexture clCreateFromGLTexture_fn 19 | inline cl_mem clCreateFromGLTexture(cl_context p0, cl_mem_flags p1, cl_GLenum p2, cl_GLint p3, cl_GLuint p4, cl_int* p5) { return clCreateFromGLTexture_pfn(p0, p1, p2, p3, p4, p5); } 20 | #undef clCreateFromGLTexture2D 21 | #define clCreateFromGLTexture2D clCreateFromGLTexture2D_fn 22 | inline cl_mem clCreateFromGLTexture2D(cl_context p0, cl_mem_flags p1, cl_GLenum p2, cl_GLint p3, cl_GLuint p4, cl_int* p5) { return clCreateFromGLTexture2D_pfn(p0, p1, p2, p3, p4, p5); } 23 | #undef clCreateFromGLTexture3D 24 | #define clCreateFromGLTexture3D clCreateFromGLTexture3D_fn 25 | inline cl_mem clCreateFromGLTexture3D(cl_context p0, cl_mem_flags p1, cl_GLenum p2, cl_GLint p3, cl_GLuint p4, cl_int* p5) { return clCreateFromGLTexture3D_pfn(p0, p1, p2, p3, p4, p5); } 26 | #undef clEnqueueAcquireGLObjects 27 | #define clEnqueueAcquireGLObjects clEnqueueAcquireGLObjects_fn 28 | inline cl_int clEnqueueAcquireGLObjects(cl_command_queue p0, cl_uint p1, const cl_mem* p2, cl_uint p3, const cl_event* p4, cl_event* p5) { return clEnqueueAcquireGLObjects_pfn(p0, p1, p2, p3, p4, p5); } 29 | #undef clEnqueueReleaseGLObjects 30 | #define clEnqueueReleaseGLObjects clEnqueueReleaseGLObjects_fn 31 | inline cl_int clEnqueueReleaseGLObjects(cl_command_queue p0, cl_uint p1, const cl_mem* p2, cl_uint p3, const cl_event* p4, cl_event* p5) { return clEnqueueReleaseGLObjects_pfn(p0, p1, p2, p3, p4, p5); } 32 | #undef clGetGLContextInfoKHR 33 | #define clGetGLContextInfoKHR clGetGLContextInfoKHR_fn 34 | inline cl_int clGetGLContextInfoKHR(const cl_context_properties* p0, cl_gl_context_info p1, size_t p2, void* p3, size_t* p4) { return clGetGLContextInfoKHR_pfn(p0, p1, p2, p3, p4); } 35 | #undef clGetGLObjectInfo 36 | #define clGetGLObjectInfo clGetGLObjectInfo_fn 37 | inline cl_int clGetGLObjectInfo(cl_mem p0, cl_gl_object_type* p1, cl_GLuint* p2) { return clGetGLObjectInfo_pfn(p0, p1, p2); } 38 | #undef clGetGLTextureInfo 39 | #define clGetGLTextureInfo clGetGLTextureInfo_fn 40 | inline cl_int clGetGLTextureInfo(cl_mem p0, cl_gl_texture_info p1, size_t p2, void* p3, size_t* p4) { return clGetGLTextureInfo_pfn(p0, p1, p2, p3, p4); } 41 | 42 | #endif // cl_khr_gl_sharing 43 | -------------------------------------------------------------------------------- /esp32/examples/color_code/main/opencv/opencv2/core/opencl/runtime/opencl_clamdblas.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of the copyright holders may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the OpenCV Foundation or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | #ifndef OPENCV_CORE_OCL_RUNTIME_CLAMDBLAS_HPP 43 | #define OPENCV_CORE_OCL_RUNTIME_CLAMDBLAS_HPP 44 | 45 | #ifdef HAVE_CLAMDBLAS 46 | 47 | #include "opencl_core.hpp" 48 | 49 | #include "autogenerated/opencl_clamdblas.hpp" 50 | 51 | #endif // HAVE_CLAMDBLAS 52 | 53 | #endif // OPENCV_CORE_OCL_RUNTIME_CLAMDBLAS_HPP 54 | -------------------------------------------------------------------------------- /esp32/examples/color_code/main/opencv/opencv2/core/opencl/runtime/opencl_clamdfft.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of the copyright holders may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the OpenCV Foundation or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | #ifndef OPENCV_CORE_OCL_RUNTIME_CLAMDFFT_HPP 43 | #define OPENCV_CORE_OCL_RUNTIME_CLAMDFFT_HPP 44 | 45 | #ifdef HAVE_CLAMDFFT 46 | 47 | #include "opencl_core.hpp" 48 | 49 | #include "autogenerated/opencl_clamdfft.hpp" 50 | 51 | #endif // HAVE_CLAMDFFT 52 | 53 | #endif // OPENCV_CORE_OCL_RUNTIME_CLAMDFFT_HPP 54 | -------------------------------------------------------------------------------- /esp32/examples/color_code/main/opencv/opencv2/core/opencl/runtime/opencl_core_wrappers.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of the copyright holders may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the OpenCV Foundation or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | #ifndef OPENCV_CORE_OCL_RUNTIME_OPENCL_WRAPPERS_HPP 43 | #define OPENCV_CORE_OCL_RUNTIME_OPENCL_WRAPPERS_HPP 44 | 45 | #include "autogenerated/opencl_core_wrappers.hpp" 46 | 47 | #endif // OPENCV_CORE_OCL_RUNTIME_OPENCL_WRAPPERS_HPP 48 | -------------------------------------------------------------------------------- /esp32/examples/color_code/main/opencv/opencv2/core/opencl/runtime/opencl_gl.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of the copyright holders may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the OpenCV Foundation or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | #ifndef OPENCV_CORE_OCL_RUNTIME_OPENCL_GL_HPP 43 | #define OPENCV_CORE_OCL_RUNTIME_OPENCL_GL_HPP 44 | 45 | #if defined HAVE_OPENCL && defined HAVE_OPENGL 46 | 47 | #include "opencl_core.hpp" 48 | 49 | #include "autogenerated/opencl_gl.hpp" 50 | 51 | #endif // defined HAVE_OPENCL && defined HAVE_OPENGL 52 | 53 | #endif // OPENCV_CORE_OCL_RUNTIME_OPENCL_GL_HPP 54 | -------------------------------------------------------------------------------- /esp32/examples/color_code/main/opencv/opencv2/core/opencl/runtime/opencl_gl_wrappers.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved. 14 | // Third party copyrights are property of their respective owners. 15 | // 16 | // Redistribution and use in source and binary forms, with or without modification, 17 | // are permitted provided that the following conditions are met: 18 | // 19 | // * Redistribution's of source code must retain the above copyright notice, 20 | // this list of conditions and the following disclaimer. 21 | // 22 | // * Redistribution's in binary form must reproduce the above copyright notice, 23 | // this list of conditions and the following disclaimer in the documentation 24 | // and/or other materials provided with the distribution. 25 | // 26 | // * The name of the copyright holders may not be used to endorse or promote products 27 | // derived from this software without specific prior written permission. 28 | // 29 | // This software is provided by the copyright holders and contributors "as is" and 30 | // any express or implied warranties, including, but not limited to, the implied 31 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 32 | // In no event shall the OpenCV Foundation or contributors be liable for any direct, 33 | // indirect, incidental, special, exemplary, or consequential damages 34 | // (including, but not limited to, procurement of substitute goods or services; 35 | // loss of use, data, or profits; or business interruption) however caused 36 | // and on any theory of liability, whether in contract, strict liability, 37 | // or tort (including negligence or otherwise) arising in any way out of 38 | // the use of this software, even if advised of the possibility of such damage. 39 | // 40 | //M*/ 41 | 42 | #ifndef OPENCV_CORE_OCL_RUNTIME_OPENCL_GL_WRAPPERS_HPP 43 | #define OPENCV_CORE_OCL_RUNTIME_OPENCL_GL_WRAPPERS_HPP 44 | 45 | #include "autogenerated/opencl_gl_wrappers.hpp" 46 | 47 | #endif // OPENCV_CORE_OCL_RUNTIME_OPENCL_GL_WRAPPERS_HPP 48 | -------------------------------------------------------------------------------- /esp32/examples/color_code/main/opencv/opencv2/core/opencl/runtime/opencl_svm_definitions.hpp: -------------------------------------------------------------------------------- 1 | /* See LICENSE file in the root OpenCV directory */ 2 | 3 | #ifndef OPENCV_CORE_OCL_RUNTIME_OPENCL_SVM_DEFINITIONS_HPP 4 | #define OPENCV_CORE_OCL_RUNTIME_OPENCL_SVM_DEFINITIONS_HPP 5 | 6 | #if defined(HAVE_OPENCL_SVM) 7 | #if defined(CL_VERSION_2_0) 8 | 9 | // OpenCL 2.0 contains SVM definitions 10 | 11 | #else 12 | 13 | typedef cl_bitfield cl_device_svm_capabilities; 14 | typedef cl_bitfield cl_svm_mem_flags; 15 | typedef cl_uint cl_kernel_exec_info; 16 | 17 | // 18 | // TODO Add real values after OpenCL 2.0 release 19 | // 20 | 21 | #ifndef CL_DEVICE_SVM_CAPABILITIES 22 | #define CL_DEVICE_SVM_CAPABILITIES 0x1053 23 | 24 | #define CL_DEVICE_SVM_COARSE_GRAIN_BUFFER (1 << 0) 25 | #define CL_DEVICE_SVM_FINE_GRAIN_BUFFER (1 << 1) 26 | #define CL_DEVICE_SVM_FINE_GRAIN_SYSTEM (1 << 2) 27 | #define CL_DEVICE_SVM_ATOMICS (1 << 3) 28 | #endif 29 | 30 | #ifndef CL_MEM_SVM_FINE_GRAIN_BUFFER 31 | #define CL_MEM_SVM_FINE_GRAIN_BUFFER (1 << 10) 32 | #endif 33 | 34 | #ifndef CL_MEM_SVM_ATOMICS 35 | #define CL_MEM_SVM_ATOMICS (1 << 11) 36 | #endif 37 | 38 | 39 | #endif // CL_VERSION_2_0 40 | #endif // HAVE_OPENCL_SVM 41 | 42 | #endif // OPENCV_CORE_OCL_RUNTIME_OPENCL_SVM_DEFINITIONS_HPP 43 | -------------------------------------------------------------------------------- /esp32/examples/color_code/main/opencv/opencv2/core/openvx/ovx_defs.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | // Copyright (C) 2016, Intel Corporation, all rights reserved. 6 | // Third party copyrights are property of their respective owners. 7 | 8 | // OpenVX related definitions and declarations 9 | 10 | #pragma once 11 | #ifndef OPENCV_OVX_DEFS_HPP 12 | #define OPENCV_OVX_DEFS_HPP 13 | 14 | #include "cvconfig.h" 15 | 16 | // utility macro for running OpenVX-based implementations 17 | #ifdef HAVE_OPENVX 18 | 19 | #define IVX_HIDE_INFO_WARNINGS 20 | #define IVX_USE_OPENCV 21 | #include "ivx.hpp" 22 | 23 | namespace cv{ 24 | namespace ovx{ 25 | // Get common thread local OpenVX context 26 | CV_EXPORTS_W ivx::Context& getOpenVXContext(); 27 | 28 | template inline bool skipSmallImages(int w, int h) { return w*h < 3840 * 2160; } 29 | }} 30 | 31 | #define CV_OVX_RUN(condition, func, ...) \ 32 | if (cv::useOpenVX() && (condition) && func) \ 33 | { \ 34 | return __VA_ARGS__; \ 35 | } 36 | 37 | #else 38 | #define CV_OVX_RUN(condition, func, ...) 39 | #endif // HAVE_OPENVX 40 | 41 | // Throw an error in debug mode or try another implementation in release 42 | #ifdef _DEBUG 43 | #define VX_DbgThrow(s) CV_Error(cv::Error::StsInternal, (s)) 44 | #else 45 | #define VX_DbgThrow(s) return false 46 | #endif 47 | 48 | #endif // OPENCV_OVX_DEFS_HPP 49 | -------------------------------------------------------------------------------- /esp32/examples/color_code/main/opencv/opencv2/core/ovx.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | // Copyright (C) 2016, Intel Corporation, all rights reserved. 6 | // Third party copyrights are property of their respective owners. 7 | 8 | // OpenVX related definitions and declarations 9 | 10 | #pragma once 11 | #ifndef OPENCV_OVX_HPP 12 | #define OPENCV_OVX_HPP 13 | 14 | #include "cvdef.h" 15 | 16 | namespace cv 17 | { 18 | /// Check if use of OpenVX is possible 19 | CV_EXPORTS_W bool haveOpenVX(); 20 | 21 | /// Check if use of OpenVX is enabled 22 | CV_EXPORTS_W bool useOpenVX(); 23 | 24 | /// Enable/disable use of OpenVX 25 | CV_EXPORTS_W void setUseOpenVX(bool flag); 26 | } // namespace cv 27 | 28 | #endif // OPENCV_OVX_HPP 29 | -------------------------------------------------------------------------------- /esp32/examples/color_code/main/opencv/opencv2/core/utils/allocator_stats.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_CORE_ALLOCATOR_STATS_HPP 6 | #define OPENCV_CORE_ALLOCATOR_STATS_HPP 7 | 8 | #include "../cvdef.h" 9 | 10 | namespace cv { namespace utils { 11 | 12 | class AllocatorStatisticsInterface 13 | { 14 | protected: 15 | AllocatorStatisticsInterface() {} 16 | virtual ~AllocatorStatisticsInterface() {} 17 | public: 18 | virtual uint64_t getCurrentUsage() const = 0; 19 | virtual uint64_t getTotalUsage() const = 0; 20 | virtual uint64_t getNumberOfAllocations() const = 0; 21 | virtual uint64_t getPeakUsage() const = 0; 22 | 23 | /** set peak usage = current usage */ 24 | virtual void resetPeakUsage() = 0; 25 | }; 26 | 27 | }} // namespace 28 | 29 | #endif // OPENCV_CORE_ALLOCATOR_STATS_HPP 30 | -------------------------------------------------------------------------------- /esp32/examples/color_code/main/opencv/opencv2/core/utils/configuration.private.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_CONFIGURATION_PRIVATE_HPP 6 | #define OPENCV_CONFIGURATION_PRIVATE_HPP 7 | 8 | #include "opencv2/core/cvstd.hpp" 9 | #include 10 | #include 11 | 12 | namespace cv { namespace utils { 13 | 14 | typedef std::vector Paths; 15 | CV_EXPORTS bool getConfigurationParameterBool(const char* name, bool defaultValue); 16 | CV_EXPORTS size_t getConfigurationParameterSizeT(const char* name, size_t defaultValue); 17 | CV_EXPORTS cv::String getConfigurationParameterString(const char* name, const char* defaultValue); 18 | CV_EXPORTS Paths getConfigurationParameterPaths(const char* name, const Paths &defaultValue = Paths()); 19 | 20 | }} // namespace 21 | 22 | #endif // OPENCV_CONFIGURATION_PRIVATE_HPP 23 | -------------------------------------------------------------------------------- /esp32/examples/color_code/main/opencv/opencv2/core/utils/filesystem.private.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_UTILS_FILESYSTEM_PRIVATE_HPP 6 | #define OPENCV_UTILS_FILESYSTEM_PRIVATE_HPP 7 | 8 | // TODO Move to CMake? 9 | #ifndef OPENCV_HAVE_FILESYSTEM_SUPPORT 10 | # if defined(__EMSCRIPTEN__) || defined(__native_client__) 11 | /* no support */ 12 | # elif defined WINRT || defined _WIN32_WCE 13 | /* not supported */ 14 | # elif defined __ANDROID__ || defined __linux__ || defined _WIN32 || \ 15 | defined __FreeBSD__ || defined __bsdi__ || defined __HAIKU__ 16 | # define OPENCV_HAVE_FILESYSTEM_SUPPORT 1 17 | # elif defined(__APPLE__) 18 | # include 19 | # if (defined(TARGET_OS_OSX) && TARGET_OS_OSX) || (!defined(TARGET_OS_OSX) && !TARGET_OS_IPHONE) 20 | # define OPENCV_HAVE_FILESYSTEM_SUPPORT 1 // OSX only 21 | # endif 22 | # else 23 | /* unknown */ 24 | # endif 25 | # ifndef OPENCV_HAVE_FILESYSTEM_SUPPORT 26 | # define OPENCV_HAVE_FILESYSTEM_SUPPORT 0 27 | # endif 28 | #endif 29 | 30 | #if OPENCV_HAVE_FILESYSTEM_SUPPORT 31 | namespace cv { namespace utils { namespace fs { 32 | 33 | /** 34 | * File-based lock object. 35 | * 36 | * Provides interprocess synchronization mechanism. 37 | * Platform dependent. 38 | * 39 | * Supports multiple readers / single writer access pattern (RW / readers–writer / shared-exclusive lock). 40 | * 41 | * File must exist. 42 | * File can't be re-used (for example, I/O operations via std::fstream is not safe) 43 | */ 44 | class CV_EXPORTS FileLock { 45 | public: 46 | explicit FileLock(const char* fname); 47 | ~FileLock(); 48 | 49 | void lock(); //< acquire exclusive (writer) lock 50 | void unlock(); //< release exclusive (writer) lock 51 | 52 | void lock_shared(); //< acquire shareable (reader) lock 53 | void unlock_shared(); //< release shareable (reader) lock 54 | 55 | struct Impl; 56 | protected: 57 | Impl* pImpl; 58 | 59 | private: 60 | FileLock(const FileLock&); // disabled 61 | FileLock& operator=(const FileLock&); // disabled 62 | }; 63 | 64 | }}} // namespace 65 | #endif 66 | #endif // OPENCV_UTILS_FILESYSTEM_PRIVATE_HPP 67 | -------------------------------------------------------------------------------- /esp32/examples/color_code/main/opencv/opencv2/core/utils/logger.defines.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_LOGGER_DEFINES_HPP 6 | #define OPENCV_LOGGER_DEFINES_HPP 7 | 8 | //! @addtogroup core_logging 9 | //! @{ 10 | 11 | // Supported logging levels and their semantic 12 | #define CV_LOG_LEVEL_SILENT 0 //!< for using in setLogLevel() call 13 | #define CV_LOG_LEVEL_FATAL 1 //!< Fatal (critical) error (unrecoverable internal error) 14 | #define CV_LOG_LEVEL_ERROR 2 //!< Error message 15 | #define CV_LOG_LEVEL_WARN 3 //!< Warning message 16 | #define CV_LOG_LEVEL_INFO 4 //!< Info message 17 | #define CV_LOG_LEVEL_DEBUG 5 //!< Debug message. Disabled in the "Release" build. 18 | #define CV_LOG_LEVEL_VERBOSE 6 //!< Verbose (trace) messages. Requires verbosity level. Disabled in the "Release" build. 19 | 20 | namespace cv { 21 | namespace utils { 22 | namespace logging { 23 | 24 | //! Supported logging levels and their semantic 25 | enum LogLevel { 26 | LOG_LEVEL_SILENT = 0, //!< for using in setLogVevel() call 27 | LOG_LEVEL_FATAL = 1, //!< Fatal (critical) error (unrecoverable internal error) 28 | LOG_LEVEL_ERROR = 2, //!< Error message 29 | LOG_LEVEL_WARNING = 3, //!< Warning message 30 | LOG_LEVEL_INFO = 4, //!< Info message 31 | LOG_LEVEL_DEBUG = 5, //!< Debug message. Disabled in the "Release" build. 32 | LOG_LEVEL_VERBOSE = 6, //!< Verbose (trace) messages. Requires verbosity level. Disabled in the "Release" build. 33 | #ifndef CV_DOXYGEN 34 | ENUM_LOG_LEVEL_FORCE_INT = INT_MAX 35 | #endif 36 | }; 37 | 38 | }}} // namespace 39 | 40 | //! @} 41 | 42 | #endif // OPENCV_LOGGER_DEFINES_HPP 43 | -------------------------------------------------------------------------------- /esp32/examples/color_code/main/opencv/opencv2/core/utils/logtag.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_CORE_LOGTAG_HPP 6 | #define OPENCV_CORE_LOGTAG_HPP 7 | 8 | #include "opencv2/core/cvstd.hpp" 9 | #include "logger.defines.hpp" 10 | 11 | namespace cv { 12 | namespace utils { 13 | namespace logging { 14 | 15 | struct LogTag 16 | { 17 | const char* name; 18 | LogLevel level; 19 | 20 | inline LogTag(const char* _name, LogLevel _level) 21 | : name(_name) 22 | , level(_level) 23 | {} 24 | }; 25 | 26 | }}} 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /esp32/examples/color_code/main/opencv/opencv2/core/va_intel.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | // Copyright (C) 2015, Itseez, Inc., all rights reserved. 6 | // Third party copyrights are property of their respective owners. 7 | 8 | #ifndef OPENCV_CORE_VA_INTEL_HPP 9 | #define OPENCV_CORE_VA_INTEL_HPP 10 | 11 | #ifndef __cplusplus 12 | # error va_intel.hpp header must be compiled as C++ 13 | #endif 14 | 15 | #include "opencv2/core.hpp" 16 | #include "ocl.hpp" 17 | 18 | #if defined(HAVE_VA) 19 | # include "va/va.h" 20 | #else // HAVE_VA 21 | # if !defined(_VA_H_) 22 | typedef void* VADisplay; 23 | typedef unsigned int VASurfaceID; 24 | # endif // !_VA_H_ 25 | #endif // HAVE_VA 26 | 27 | namespace cv { namespace va_intel { 28 | 29 | /** @addtogroup core_va_intel 30 | This section describes Intel VA-API/OpenCL (CL-VA) interoperability. 31 | 32 | To enable CL-VA interoperability support, configure OpenCV using CMake with WITH_VA_INTEL=ON . Currently VA-API is 33 | supported on Linux only. You should also install Intel Media Server Studio (MSS) to use this feature. You may 34 | have to specify the path(s) to MSS components for cmake in environment variables: 35 | 36 | - VA_INTEL_IOCL_ROOT for Intel OpenCL (default is "/opt/intel/opencl"). 37 | 38 | To use CL-VA interoperability you should first create VADisplay (libva), and then call initializeContextFromVA() 39 | function to create OpenCL context and set up interoperability. 40 | */ 41 | //! @{ 42 | 43 | /////////////////// CL-VA Interoperability Functions /////////////////// 44 | 45 | namespace ocl { 46 | using namespace cv::ocl; 47 | 48 | // TODO static functions in the Context class 49 | /** @brief Creates OpenCL context from VA. 50 | @param display - VADisplay for which CL interop should be established. 51 | @param tryInterop - try to set up for interoperability, if true; set up for use slow copy if false. 52 | @return Returns reference to OpenCL Context 53 | */ 54 | CV_EXPORTS Context& initializeContextFromVA(VADisplay display, bool tryInterop = true); 55 | 56 | } // namespace cv::va_intel::ocl 57 | 58 | /** @brief Converts InputArray to VASurfaceID object. 59 | @param display - VADisplay object. 60 | @param src - source InputArray. 61 | @param surface - destination VASurfaceID object. 62 | @param size - size of image represented by VASurfaceID object. 63 | */ 64 | CV_EXPORTS void convertToVASurface(VADisplay display, InputArray src, VASurfaceID surface, Size size); 65 | 66 | /** @brief Converts VASurfaceID object to OutputArray. 67 | @param display - VADisplay object. 68 | @param surface - source VASurfaceID object. 69 | @param size - size of image represented by VASurfaceID object. 70 | @param dst - destination OutputArray. 71 | */ 72 | CV_EXPORTS void convertFromVASurface(VADisplay display, VASurfaceID surface, Size size, OutputArray dst); 73 | 74 | //! @} 75 | 76 | }} // namespace cv::va_intel 77 | 78 | #endif /* OPENCV_CORE_VA_INTEL_HPP */ 79 | -------------------------------------------------------------------------------- /esp32/examples/color_code/main/opencv/opencv2/core/version.hpp: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_VERSION_HPP 6 | #define OPENCV_VERSION_HPP 7 | 8 | #define CV_VERSION_MAJOR 4 9 | #define CV_VERSION_MINOR 2 10 | #define CV_VERSION_REVISION 0 11 | #define CV_VERSION_STATUS "-dev" 12 | 13 | #define CVAUX_STR_EXP(__A) #__A 14 | #define CVAUX_STR(__A) CVAUX_STR_EXP(__A) 15 | 16 | #define CVAUX_STRW_EXP(__A) L ## #__A 17 | #define CVAUX_STRW(__A) CVAUX_STRW_EXP(__A) 18 | 19 | #define CV_VERSION CVAUX_STR(CV_VERSION_MAJOR) "." CVAUX_STR(CV_VERSION_MINOR) "." CVAUX_STR(CV_VERSION_REVISION) CV_VERSION_STATUS 20 | 21 | /* old style version constants*/ 22 | #define CV_MAJOR_VERSION CV_VERSION_MAJOR 23 | #define CV_MINOR_VERSION CV_VERSION_MINOR 24 | #define CV_SUBMINOR_VERSION CV_VERSION_REVISION 25 | 26 | #endif // OPENCV_VERSION_HPP 27 | -------------------------------------------------------------------------------- /esp32/examples/color_code/main/opencv/opencv2/imgcodecs/imgcodecs.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/imgcodecs.hpp" 49 | -------------------------------------------------------------------------------- /esp32/examples/color_code/main/opencv/opencv2/imgcodecs/imgcodecs_c.h: -------------------------------------------------------------------------------- 1 | #error "This header with legacy C API declarations has been removed from OpenCV. Legacy constants are available from legacy/constants_c.h file." 2 | -------------------------------------------------------------------------------- /esp32/examples/color_code/main/opencv/opencv2/imgcodecs/ios.h: -------------------------------------------------------------------------------- 1 | 2 | /*M/////////////////////////////////////////////////////////////////////////////////////// 3 | // 4 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 5 | // 6 | // By downloading, copying, installing or using the software you agree to this license. 7 | // If you do not agree to this license, do not download, install, 8 | // copy or use the software. 9 | // 10 | // 11 | // License Agreement 12 | // For Open Source Computer Vision Library 13 | // 14 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 15 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #import 45 | #import 46 | #import 47 | #import 48 | #include "opencv2/core/core.hpp" 49 | 50 | //! @addtogroup imgcodecs_ios 51 | //! @{ 52 | 53 | CV_EXPORTS UIImage* MatToUIImage(const cv::Mat& image); 54 | CV_EXPORTS void UIImageToMat(const UIImage* image, 55 | cv::Mat& m, bool alphaExist = false); 56 | 57 | //! @} 58 | -------------------------------------------------------------------------------- /esp32/examples/color_code/main/opencv/opencv2/imgcodecs/legacy/constants_c.h: -------------------------------------------------------------------------------- 1 | // This file is part of OpenCV project. 2 | // It is subject to the license terms in the LICENSE file found in the top-level directory 3 | // of this distribution and at http://opencv.org/license.html. 4 | 5 | #ifndef OPENCV_IMGCODECS_LEGACY_CONSTANTS_H 6 | #define OPENCV_IMGCODECS_LEGACY_CONSTANTS_H 7 | 8 | /* duplicate of "ImreadModes" enumeration for better compatibility with OpenCV 3.x */ 9 | enum 10 | { 11 | /* 8bit, color or not */ 12 | CV_LOAD_IMAGE_UNCHANGED =-1, 13 | /* 8bit, gray */ 14 | CV_LOAD_IMAGE_GRAYSCALE =0, 15 | /* ?, color */ 16 | CV_LOAD_IMAGE_COLOR =1, 17 | /* any depth, ? */ 18 | CV_LOAD_IMAGE_ANYDEPTH =2, 19 | /* ?, any color */ 20 | CV_LOAD_IMAGE_ANYCOLOR =4, 21 | /* ?, no rotate */ 22 | CV_LOAD_IMAGE_IGNORE_ORIENTATION =128 23 | }; 24 | 25 | /* duplicate of "ImwriteFlags" enumeration for better compatibility with OpenCV 3.x */ 26 | enum 27 | { 28 | CV_IMWRITE_JPEG_QUALITY =1, 29 | CV_IMWRITE_JPEG_PROGRESSIVE =2, 30 | CV_IMWRITE_JPEG_OPTIMIZE =3, 31 | CV_IMWRITE_JPEG_RST_INTERVAL =4, 32 | CV_IMWRITE_JPEG_LUMA_QUALITY =5, 33 | CV_IMWRITE_JPEG_CHROMA_QUALITY =6, 34 | CV_IMWRITE_PNG_COMPRESSION =16, 35 | CV_IMWRITE_PNG_STRATEGY =17, 36 | CV_IMWRITE_PNG_BILEVEL =18, 37 | CV_IMWRITE_PNG_STRATEGY_DEFAULT =0, 38 | CV_IMWRITE_PNG_STRATEGY_FILTERED =1, 39 | CV_IMWRITE_PNG_STRATEGY_HUFFMAN_ONLY =2, 40 | CV_IMWRITE_PNG_STRATEGY_RLE =3, 41 | CV_IMWRITE_PNG_STRATEGY_FIXED =4, 42 | CV_IMWRITE_PXM_BINARY =32, 43 | CV_IMWRITE_EXR_TYPE = 48, 44 | CV_IMWRITE_WEBP_QUALITY =64, 45 | CV_IMWRITE_PAM_TUPLETYPE = 128, 46 | CV_IMWRITE_PAM_FORMAT_NULL = 0, 47 | CV_IMWRITE_PAM_FORMAT_BLACKANDWHITE = 1, 48 | CV_IMWRITE_PAM_FORMAT_GRAYSCALE = 2, 49 | CV_IMWRITE_PAM_FORMAT_GRAYSCALE_ALPHA = 3, 50 | CV_IMWRITE_PAM_FORMAT_RGB = 4, 51 | CV_IMWRITE_PAM_FORMAT_RGB_ALPHA = 5, 52 | }; 53 | 54 | #endif // OPENCV_IMGCODECS_LEGACY_CONSTANTS_H 55 | -------------------------------------------------------------------------------- /esp32/examples/color_code/main/opencv/opencv2/imgproc/hal/interface.h: -------------------------------------------------------------------------------- 1 | #ifndef OPENCV_IMGPROC_HAL_INTERFACE_H 2 | #define OPENCV_IMGPROC_HAL_INTERFACE_H 3 | 4 | //! @addtogroup imgproc_hal_interface 5 | //! @{ 6 | 7 | //! @name Interpolation modes 8 | //! @sa cv::InterpolationFlags 9 | //! @{ 10 | #define CV_HAL_INTER_NEAREST 0 11 | #define CV_HAL_INTER_LINEAR 1 12 | #define CV_HAL_INTER_CUBIC 2 13 | #define CV_HAL_INTER_AREA 3 14 | #define CV_HAL_INTER_LANCZOS4 4 15 | //! @} 16 | 17 | //! @name Morphology operations 18 | //! @sa cv::MorphTypes 19 | //! @{ 20 | #define CV_HAL_MORPH_ERODE 0 21 | #define CV_HAL_MORPH_DILATE 1 22 | //! @} 23 | 24 | //! @name Threshold types 25 | //! @sa cv::ThresholdTypes 26 | //! @{ 27 | #define CV_HAL_THRESH_BINARY 0 28 | #define CV_HAL_THRESH_BINARY_INV 1 29 | #define CV_HAL_THRESH_TRUNC 2 30 | #define CV_HAL_THRESH_TOZERO 3 31 | #define CV_HAL_THRESH_TOZERO_INV 4 32 | #define CV_HAL_THRESH_MASK 7 33 | #define CV_HAL_THRESH_OTSU 8 34 | #define CV_HAL_THRESH_TRIANGLE 16 35 | //! @} 36 | 37 | //! @name Adaptive threshold algorithm 38 | //! @sa cv::AdaptiveThresholdTypes 39 | //! @{ 40 | #define CV_HAL_ADAPTIVE_THRESH_MEAN_C 0 41 | #define CV_HAL_ADAPTIVE_THRESH_GAUSSIAN_C 1 42 | //! @} 43 | 44 | //! @} 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /esp32/examples/color_code/main/opencv/opencv2/imgproc/imgproc.hpp: -------------------------------------------------------------------------------- 1 | /*M/////////////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING. 4 | // 5 | // By downloading, copying, installing or using the software you agree to this license. 6 | // If you do not agree to this license, do not download, install, 7 | // copy or use the software. 8 | // 9 | // 10 | // License Agreement 11 | // For Open Source Computer Vision Library 12 | // 13 | // Copyright (C) 2000-2008, Intel Corporation, all rights reserved. 14 | // Copyright (C) 2009, Willow Garage Inc., all rights reserved. 15 | // Copyright (C) 2013, OpenCV Foundation, all rights reserved. 16 | // Third party copyrights are property of their respective owners. 17 | // 18 | // Redistribution and use in source and binary forms, with or without modification, 19 | // are permitted provided that the following conditions are met: 20 | // 21 | // * Redistribution's of source code must retain the above copyright notice, 22 | // this list of conditions and the following disclaimer. 23 | // 24 | // * Redistribution's in binary form must reproduce the above copyright notice, 25 | // this list of conditions and the following disclaimer in the documentation 26 | // and/or other materials provided with the distribution. 27 | // 28 | // * The name of the copyright holders may not be used to endorse or promote products 29 | // derived from this software without specific prior written permission. 30 | // 31 | // This software is provided by the copyright holders and contributors "as is" and 32 | // any express or implied warranties, including, but not limited to, the implied 33 | // warranties of merchantability and fitness for a particular purpose are disclaimed. 34 | // In no event shall the Intel Corporation or contributors be liable for any direct, 35 | // indirect, incidental, special, exemplary, or consequential damages 36 | // (including, but not limited to, procurement of substitute goods or services; 37 | // loss of use, data, or profits; or business interruption) however caused 38 | // and on any theory of liability, whether in contract, strict liability, 39 | // or tort (including negligence or otherwise) arising in any way out of 40 | // the use of this software, even if advised of the possibility of such damage. 41 | // 42 | //M*/ 43 | 44 | #ifdef __OPENCV_BUILD 45 | #error this is a compatibility header which should not be used inside the OpenCV library 46 | #endif 47 | 48 | #include "opencv2/imgproc.hpp" 49 | -------------------------------------------------------------------------------- /esp32/examples/color_code/main/opencv/opencv2/opencv_modules.hpp: -------------------------------------------------------------------------------- 1 | /* 2 | * ** File generated automatically, do not modify ** 3 | * 4 | * This file defines the list of modules available in current build configuration 5 | * 6 | * 7 | */ 8 | 9 | // This definition means that OpenCV is built with enabled non-free code. 10 | // For example, patented algorithms for non-profit/non-commercial use only. 11 | /* #undef OPENCV_ENABLE_NONFREE */ 12 | 13 | #define HAVE_OPENCV_CORE 14 | #define HAVE_OPENCV_IMGCODECS 15 | #define HAVE_OPENCV_IMGPROC 16 | 17 | 18 | -------------------------------------------------------------------------------- /esp32/examples/color_code/main/system.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include "system.h" 12 | 13 | #define TAG "SYSTEM" 14 | 15 | void wait_msec(uint16_t v) { 16 | vTaskDelay(v / portTICK_PERIOD_MS); 17 | } 18 | 19 | void wait_sec(uint16_t v) { 20 | vTaskDelay(v * 1000 / portTICK_PERIOD_MS); 21 | } 22 | 23 | void disp_infos() { 24 | /* Print memory information */ 25 | ESP_LOGI(TAG, "task %s stack high watermark: %d Bytes", pcTaskGetTaskName(NULL), uxTaskGetStackHighWaterMark(NULL)); 26 | ESP_LOGI(TAG, "heap left: %d Bytes", esp_get_free_heap_size()); 27 | } 28 | -------------------------------------------------------------------------------- /esp32/examples/color_code/partitions.csv: -------------------------------------------------------------------------------- 1 | # Espressif ESP32 Partition Table 2 | # Name, Type, SubType, Offset, Size, Flags 3 | nvs, data, nvs, 0x9000, 0x6000, 4 | phy_init, data, phy, 0xf000, 0x1000, 5 | factory, app, factory, 0x10000, 3M, 6 | storage, data, spiffs, , 600K, 7 | -------------------------------------------------------------------------------- /esp32/examples/color_code/sdkconfig.defaults: -------------------------------------------------------------------------------- 1 | 2 | CONFIG_ESPTOOLPY_PORT="/dev/ttyUSB0" 3 | CONFIG_ESPTOOLPY_BAUD_115200B= 4 | CONFIG_ESPTOOLPY_BAUD_230400B= 5 | CONFIG_ESPTOOLPY_BAUD_921600B=y 6 | CONFIG_ESPTOOLPY_BAUD_2MB= 7 | CONFIG_ESPTOOLPY_BAUD_OTHER= 8 | CONFIG_ESPTOOLPY_BAUD_OTHER_VAL=115200 9 | CONFIG_ESPTOOLPY_BAUD=921600 10 | CONFIG_ESPTOOLPY_COMPRESSED=y 11 | CONFIG_FLASHMODE_QIO=y 12 | CONFIG_FLASHMODE_QOUT= 13 | CONFIG_FLASHMODE_DIO= 14 | CONFIG_FLASHMODE_DOUT= 15 | CONFIG_ESPTOOLPY_FLASHMODE="dio" 16 | CONFIG_ESPTOOLPY_FLASHFREQ_80M=y 17 | CONFIG_ESPTOOLPY_FLASHFREQ_40M= 18 | CONFIG_ESPTOOLPY_FLASHFREQ_26M= 19 | CONFIG_ESPTOOLPY_FLASHFREQ_20M= 20 | CONFIG_ESPTOOLPY_FLASHFREQ="80m" 21 | CONFIG_ESPTOOLPY_FLASHSIZE_1MB= 22 | CONFIG_ESPTOOLPY_FLASHSIZE_2MB= 23 | CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y 24 | CONFIG_ESPTOOLPY_FLASHSIZE_8MB= 25 | CONFIG_ESPTOOLPY_FLASHSIZE_16MB= 26 | CONFIG_ESPTOOLPY_FLASHSIZE="4MB" 27 | CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y 28 | CONFIG_ESPTOOLPY_BEFORE_RESET=y 29 | CONFIG_ESPTOOLPY_BEFORE_NORESET= 30 | CONFIG_ESPTOOLPY_BEFORE="default_reset" 31 | CONFIG_ESPTOOLPY_AFTER_RESET=y 32 | CONFIG_ESPTOOLPY_AFTER_NORESET= 33 | CONFIG_ESPTOOLPY_AFTER="hard_reset" 34 | CONFIG_MONITOR_BAUD_9600B= 35 | CONFIG_MONITOR_BAUD_57600B= 36 | CONFIG_MONITOR_BAUD_115200B=y 37 | CONFIG_MONITOR_BAUD_230400B= 38 | CONFIG_MONITOR_BAUD_921600B= 39 | CONFIG_MONITOR_BAUD_2MB= 40 | CONFIG_MONITOR_BAUD_OTHER= 41 | CONFIG_MONITOR_BAUD_OTHER_VAL=115200 42 | CONFIG_MONITOR_BAUD=115200 43 | 44 | # 45 | # Partition Table 46 | # 47 | CONFIG_PARTITION_TABLE_SINGLE_APP= 48 | CONFIG_PARTITION_TABLE_TWO_OTA= 49 | CONFIG_PARTITION_TABLE_CUSTOM=y 50 | CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" 51 | CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" 52 | CONFIG_PARTITION_TABLE_OFFSET=0x8000 53 | CONFIG_PARTITION_TABLE_MD5=y 54 | # 55 | # Camera configuration 56 | # 57 | CONFIG_ENABLE_TEST_PATTERN= 58 | CONFIG_OV2640_SUPPORT=y 59 | CONFIG_OV7725_SUPPORT= 60 | 61 | # 62 | # ESP32-specific 63 | # 64 | CONFIG_ESP32_DEFAULT_CPU_FREQ_80= 65 | CONFIG_ESP32_DEFAULT_CPU_FREQ_160= 66 | CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y 67 | CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240 68 | CONFIG_SPIRAM_SUPPORT=y 69 | 70 | # 71 | # SPI RAM config 72 | # 73 | CONFIG_SPIRAM_BOOT_INIT=y 74 | CONFIG_SPIRAM_IGNORE_NOTFOUND= 75 | CONFIG_SPIRAM_USE_MEMMAP= 76 | CONFIG_SPIRAM_USE_CAPS_ALLOC=y 77 | CONFIG_SPIRAM_USE_MALLOC= 78 | CONFIG_SPIRAM_TYPE_AUTO=y 79 | CONFIG_SPIRAM_TYPE_ESPPSRAM32= 80 | CONFIG_SPIRAM_TYPE_ESPPSRAM64= 81 | CONFIG_SPIRAM_SIZE=-1 82 | CONFIG_SPIRAM_SPEED_40M= 83 | CONFIG_SPIRAM_SPEED_80M=y 84 | CONFIG_SPIRAM_MEMTEST=y 85 | CONFIG_SPIRAM_CACHE_WORKAROUND=y 86 | CONFIG_SPIRAM_BANKSWITCH_ENABLE=y 87 | CONFIG_SPIRAM_BANKSWITCH_RESERVE=8 88 | CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST= 89 | CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY= 90 | 91 | CONFIG_TASK_WDT= 92 | 93 | # 94 | # FreeRTOS 95 | # 96 | CONFIG_FREERTOS_HZ=1000 --------------------------------------------------------------------------------