mirror of
https://github.com/jomjol/AI-on-the-edge-device.git
synced 2025-12-06 03:26:53 +03:00
* Create dig-cont_0640_s3_q.tflite * Update edit_reference.html (#2924) Zoom-Einstellungen ausblenden, wenn zoom deaktiviert ist * Update edit_config_template.html (#2925) Zoom-Einstellungen ausblenden, wenn zoom deaktiviert ist + Kameraeinstellungen nicht nur in der config.ini speichern, sondern auch setzen * The parameter "negative" is processed on the MCU * Renamed menu entry Alignment -> References * renamed model file to make naming consistent * Fix test (#2933) * always reset change absolute (#2956) * Create dig-class11_1701_s2.tflite * Update tflite * Update tflite * Camera settings (#3029) * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Add files via upload * Fix minor typo and harmonize spaces (#3030) * Update edit_digits.html * Update edit_analog.html * Update overview.html * Update edit_reference.html --------- Co-authored-by: jomjol <30766535+jomjol@users.noreply.github.com> * Source code formatting, ClassFlowPostProcessing.cpp * fix edit_config_template.html Unfortunately, I didn't take out some entries from other experiments because I overlooked/forgot them^^ * fix readconfigparam.js Unfortunately, I didn't take out some entries from other experiments because I overlooked/forgot them^^ * fix edit_config_template.html TakeImage_CamZoomMode_value1 was replaced by TakeImage_CamZoomSize_value1, but not deleted. This caused problems when saving the camera settings. * Update info.html function loadWLANSSID() was present three times * Update overview.html CamFrameSize is no longer needed/used for zoom * Update reply-bot.yaml * homeassistant service discovery: derive node_id when using nested topics (#3088) * derive correct node_id for homeassistant service discovery in nested topics (fixes #1792) * explicit use of std::string * move nodeId creation to separate function add unit-tests * add documentation about node_id generation for Home Assistant MQTT Service Discovery * add Prometheus/OpenMetrics exporter (#3081) * add prometheus endpoint * refine metrics implementation * move metrics generator to ClassFlowControll * add more metrics align prefix * add more metrics clean up * refine documentation * revert dependencies change * sanitize labels * create separate module for openmetrics * move openmetrics to separate folder * clean up * add basic unit-tests * work with const numbers add replaceAll for string replacement avoid opening std namespace adapt unit-tests * Update code/main/server_main.cpp --------- Co-authored-by: CaCO3 <caco3@ruinelli.ch> * Typo * update platformIO to 6.7.0 (ESP IDF 5.2.1) (#3098) * update to platformio/espressif32 @ 6.7.0 * remove unused getReadout() as it throws errors (error: 'virtual std::string ClassFlow::getReadout()' was hidden). --------- Co-authored-by: CaCO3 <caco@ruinelli.ch> * Update reply-bot.yaml (#3107) * Fix actions-label-commenter * Update Helper.cpp * Update Helper.h * Update Helper.cpp * Update readconfigparam.js fix for: In the selected field the value '1' in the section 'TakeImage' in the field 'CamGainceiling' is invalid. PLEASE CHECK BEFORE SAVING! * proposal for renaming and documentation (#3115) * Update server_camera.cpp Fix building with -D DEBUG_DETAIL_ON better alternative to: https://github.com/jomjol/AI-on-the-edge-device/pull/3160 * Update ClassFlowPostProcessing.cpp * Update ClassFlowAlignment.cpp * Fix building with `-D DEBUG_DETAIL_ON` (#3160) Building with `-D DEBUG_DETAIL_ON` has been broken since #3029. Co-authored-by: CaCO3 <caco3@ruinelli.ch> * Handle empty prevalue.ini gracefully (#3162) Fixes #2149. * Bugfix for boot loop (#3175) * Add files via upload * Add files via upload * Add files via upload * Delete param-docs/parameter-pages/TakeImage/Aec2.md has been replaced by CamAec2.md * Delete param-docs/parameter-pages/TakeImage/AutoExposureLevel.md has been replaced by CamAeLevel.md * Delete param-docs/parameter-pages/TakeImage/Brightness.md has been replaced by CamBrightness.md * Delete param-docs/parameter-pages/TakeImage/Contrast.md has been replaced by CamContrast.md * Delete param-docs/parameter-pages/TakeImage/Grayscale.md has been replaced by CamSpecialEffect.md * Delete param-docs/parameter-pages/TakeImage/Negative.md has been replaced by CamSpecialEffect.md * Delete param-docs/parameter-pages/TakeImage/Saturation.md has been replaced by CamSaturation.md * Delete param-docs/parameter-pages/TakeImage/Sharpness.md has been replaced by CamSharpness.md * Delete param-docs/parameter-pages/TakeImage/ImageQuality.md has been replaced by CamQuality.md * Delete param-docs/parameter-pages/TakeImage/Zoom.md has been replaced by CamZoom.md * Delete param-docs/parameter-pages/TakeImage/ZoomMode.md has been replaced by CamZoomSize.md * Delete param-docs/parameter-pages/TakeImage/ZoomOffsetX.md has been replaced by CamZoomOffsetX.md * Delete param-docs/parameter-pages/TakeImage/ZoomOffsetY.md has been replaced by CamZoomOffsetY.md * Delete param-docs/parameter-pages/TakeImage/ImageSize.md has been replaced by CamZoomSize.md * Delete param-docs/parameter-pages/TakeImage/FixedExposure.md has been replaced by CamAec.md * Delete param-docs/parameter-pages/Alignment/FlipImageSize.md has been replaced by CamVflip.md * Delete param-docs/parameter-pages/Alignment/InitialMirror.md has been replaced by CamHmirror.md * CamParameter documentation update https://github.com/jomjol/AI-on-the-edge-device/issues/3185 * typo * add Webhook #3148 (#3163) * WIP add Webhook * fix config html for webhook add tooltips for webhook * webhook: fix not enabling webhook * send webhook as json * Update ApiKey.md * webhook: fix only sending last "Number" * webhook JSON is now closer to the data log in CSV format * webhook: drop timeStampTimeUTC and switch from timeStamp to lastvalue like lokal csv to fix no timestamp on error --------- Co-authored-by: CaCO3 <caco3@ruinelli.ch> * Bugfix for time stamp (#3180) * Update ClassFlowPostProcessing.cpp * Update ClassFlowDefineTypes.h * Update ClassFlowPostProcessing.cpp * Update ClassFlowPostProcessing.cpp * Update ClassFlowPostProcessing.cpp * Update ClassFlowPostProcessing.cpp * Update interface_webhook.cpp * Update readconfigcommon.js fix for: The same message("Image Contrast got enhanced") came up with "Update Marker" and "Enhance Image Contrast". * fix svg favicon The svg one got added in33893eb566but does not work on Firefox * Update platformIO to 6.8.1 (Contains ESP IDF 5.3) (#3196) * Update platformIO to 6.8.1 (ESP IDF 5.3) * removed now redundant typedef * updated IDF manifest hash * Add files via upload so it should work now * Update server_main.cpp --------- Co-authored-by: CaCO3 <caco@ruinelli.ch> Co-authored-by: michael <Heinrich-Tuning@web.de> * Update MainFlowControl.cpp * Add support for OV5640 camera (#3063) * Add support for OV5640 camera * clean up sharpness handling * limit sharpness range to -2 and +2 * refactor * Fix OV3660 sharpness handling * refactor sharpness handling * fix OV3660 zoom mode * reinstate aspect ratio via imageSize * Changed OV5640 full frame size to match datasheet * various fixes * add denoise config and general clean up * fix line endings to LF * Support enabling red blue swap via web interface * update jpeg quality limits * remove color swap config; color swap workaround dependent on vflip * fix missing commit * fix gain ceiling * Update cam vflip param page * fix typo: camdenoise, not camsdenoise * fix compile errors * Update MainFlowControl.cpp * Add rate threshold parameter (#3195) * still needs to be tested https://github.com/jomjol/AI-on-the-edge-device/issues/3143 * Update ClassFlowPostProcessing.cpp code formatting * Update ClassFlowDefineTypes.h code formatting * Update ClassFlowPostProcessing.h code formatting * Update edit_config_template.html * fix * Update config.ini * Update edit_config_template.html * Updated param doc * Rename parameters * Update edit_config_template.html * Update NUMBER.ChangeRateThreshold.md * Update NUMBER.ChangeRateThreshold.md --------- Co-authored-by: CaCO3 <caco3@ruinelli.ch> * Update main.cpp * Update config.ini Adjusted camera settings to make the image brighter. * Update readconfigparam.js Adjusted camera settings to make the image brighter. * add optional ImageUpload for Webhook (#3174) * WIP add Webhook * fix config html for webhook add tooltips for webhook * webhook: fix not enabling webhook * send webhook as json * Update ApiKey.md * webhook: fix only sending last "Number" * webhook JSON is now closer to the data log in CSV format * webhook: add img upload * webhoop added config for imgupload * webhook html fixes * webhook: drop timeStampTimeUTC and switch from timeStamp to lastvalue like lokal csv to fix no timestamp on error * add checkbox for Webhook_UploadImg * Update sd-card/html/edit_config_template.html * Update edit_config_template.html * Update edit_config_template.html * Update edit_config_template.html * added a long timestamp to both webhook requests --------- Co-authored-by: CaCO3 <caco3@ruinelli.ch> * Add files via upload (#3207) * Update ClassFlowPostProcessing.cpp deleted some unnecessary double entries RateType renamed to MaxRateType * Update ClassFlowDefineTypes.h RateType renamed to MaxRateType * Update text on recognition page * Update digital CNN * add a Delay between the WiFi reconnections (#3068) * add a Delay between the WiFi reconnections * log the delay between the WiFi reconnections move the delay after the log * cleanup * cleanup * cleanup * Update edit_alignment.html * cleanup * cleanup * Update platformIO to 6.9.0 (Contains ESP IDF 5.3.1) * Handle crash on corrupted model (#3220) * Upgrade esp-tflite-micro to 1.3.1 * Added log message to hint in case it crashes on loading a corrupted model --------- Co-authored-by: CaCO3 <caco@ruinelli.ch> * new dig-class100-173-s2-q on 23.800 images (#3257) * new dig-class100-173-s2-q on 23.800 images * platformio/espressif32 @ 6.8.1 for esp32cam-dev * Revert "platformio/espressif32 @ 6.8.1 for esp32cam-dev" This reverts commitcc9297d483. * not using platformio 6.1.16 * Revert "not using platformio 6.1.16" This reverts commitef18e4fae7. * moved number edit box styles into new file edit_style.css (#3262) changed input[type=number] from 60px to 3em, to show 3 digits with current font size. * added note about only TLS 1.2 is supported (#3213) * Renamed digital to digit (#3219) * renamed Digital to Digit * added param migration * Update .github/label-commenter-config.yaml * renamed AnalogDigitTransition* to AnalogToDigitTransition* --------- Co-authored-by: CaCO3 <caco@ruinelli.ch> * Update Changelog.md * Update Changelog.md --------- Co-authored-by: jomjol <30766535+jomjol@users.noreply.github.com> Co-authored-by: michael <Heinrich-Tuning@web.de> Co-authored-by: Frank Haverland <fspapaping@googlemail.com> Co-authored-by: kub3let <95883234+kub3let@users.noreply.github.com> Co-authored-by: Marco H <myxor@users.noreply.github.com> Co-authored-by: Henry Thasler <henrythasler@users.noreply.github.com> Co-authored-by: CaCO3 <caco@ruinelli.ch> Co-authored-by: Sebastian Lövdahl <slovdahl@hibox.fi> Co-authored-by: Raphael Hehl <raphael@rhehl.de> Co-authored-by: jasaw <jasaw@dius.com.au> Co-authored-by: Francesco Carnielli <hex7c0@gmail.com> Co-authored-by: kalwados <kalwados@gmx.de>
339 lines
12 KiB
C
339 lines
12 KiB
C
#pragma once
|
|
#ifndef defines_h
|
|
#define defines_h
|
|
|
|
/////////////////////////////////////////////
|
|
//// Global definitions ////
|
|
/////////////////////////////////////////////
|
|
|
|
//********* debug options : *************
|
|
|
|
//can be set in platformio with -D OPTION_TO_ACTIVATE
|
|
|
|
//#define DEBUG_DETAIL_ON
|
|
//#define DEBUG_DISABLE_BROWNOUT_DETECTOR
|
|
//#define DEBUG_ENABLE_SYSINFO
|
|
//#define DEBUG_ENABLE_PERFMON
|
|
//#define DEBUG_HIMEM_MEMORY_CHECK
|
|
// need [env:esp32cam-dev-himem]
|
|
//=> CONFIG_SPIRAM_BANKSWITCH_ENABLE=y
|
|
//=> CONFIG_SPIRAM_BANKSWITCH_RESERVE=4
|
|
|
|
|
|
// use himem //https://github.com/jomjol/AI-on-the-edge-device/issues/1842
|
|
#if (CONFIG_SPIRAM_BANKSWITCH_ENABLE)
|
|
#define USE_HIMEM_IF_AVAILABLE 1
|
|
#endif
|
|
|
|
/* Uncomment this to generate task list with stack sizes using the /heap handler
|
|
PLEASE BE AWARE: The following CONFIG parameters have to to be set in
|
|
sdkconfig.defaults before use of this function is possible!!
|
|
CONFIG_FREERTOS_USE_TRACE_FACILITY=1
|
|
CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS=y
|
|
CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID=y
|
|
*/
|
|
// server_tflite.cpp
|
|
//#define TASK_ANALYSIS_ON
|
|
|
|
|
|
//Memory leak tracing
|
|
//https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/heap_debug.html#heap-information
|
|
//need CONFIG_HEAP_TRACING_STANDALONE=y or #define CONFIG_HEAP_TRACING_STANDALONE
|
|
//all setup is predifined in [env:esp32cam-dev-task-analysis]
|
|
//#define HEAP_TRACING_MAIN_WIFI || HEAP_TRACING_MAIN_START //enable heap tracing per function in main.cpp
|
|
//all defines in [env:esp32cam-dev-task-analysis]
|
|
//#define HEAP_TRACING_MAIN_WIFI
|
|
//#define HEAP_TRACING_MAIN_START
|
|
//#define HEAP_TRACING_CLASS_FLOW_CNN_GENERAL_DO_ALING_AND_CUT
|
|
|
|
/* Uncomment this to keep the logfile open for appending.
|
|
* If commented out, the logfile gets opened/closed for each log measage (old behaviour) */
|
|
// ClassLogFile
|
|
//#define KEEP_LOGFILE_OPEN_FOR_APPENDING
|
|
|
|
//****************************************
|
|
|
|
//compiler optimization for esp-tflite-micro
|
|
#define XTENSA
|
|
//#define CONFIG_IDF_TARGET_ARCH_XTENSA //not needed with platformio/espressif32 @ 5.2.0
|
|
|
|
|
|
//ClassControllCamera
|
|
#define CAM_LIVESTREAM_REFRESHRATE 500 // Camera livestream feature: Waiting time in milliseconds to refresh image
|
|
// #define GRAYSCALE_AS_DEFAULT
|
|
|
|
|
|
//server_GPIO
|
|
#define __LEDGLOBAL
|
|
|
|
|
|
//server_GPIO + server_file + SoftAP
|
|
#define CONFIG_FILE "/sdcard/config/config.ini"
|
|
#define CONFIG_FILE_BACKUP "/sdcard/config/config.bak"
|
|
|
|
|
|
//interface_mqtt + read_wlanini
|
|
#define __HIDE_PASSWORD
|
|
|
|
|
|
//ClassFlowControll + Main + SoftAP
|
|
#define WLAN_CONFIG_FILE "/sdcard/wlan.ini"
|
|
|
|
|
|
//main
|
|
#define __SD_USE_ONE_LINE_MODE__
|
|
|
|
// server_file + Helper
|
|
#define FILE_PATH_MAX (255) //Max length a file path can have on storage
|
|
|
|
|
|
//server_file +(ota_page.html + upload_script.html)
|
|
#define MAX_FILE_SIZE (8000*1024) // 8 MB Max size of an individual file. Make sure this value is same as that set in upload_script.html and ota_page.html!
|
|
#define MAX_FILE_SIZE_STR "8MB"
|
|
|
|
#define LOGFILE_LAST_PART_BYTES 80 * 1024 // 80 kBytes // Size of partial log file to return
|
|
|
|
#define SERVER_FILER_SCRATCH_BUFSIZE 4096
|
|
#define SERVER_HELPER_SCRATCH_BUFSIZE 4096
|
|
#define SERVER_OTA_SCRATCH_BUFSIZE 1024
|
|
|
|
|
|
//server_file + server_help
|
|
#define IS_FILE_EXT(filename, ext) \
|
|
(strcasecmp(&filename[strlen(filename) - sizeof(ext) + 1], ext) == 0)
|
|
|
|
|
|
//server_ota
|
|
#define HASH_LEN 32 // SHA-256 digest length
|
|
#define OTA_URL_SIZE 256
|
|
|
|
|
|
//ClassFlow + ClassFlowImage + server_tflite
|
|
#define LOGFILE_TIME_FORMAT "%Y%m%d-%H%M%S"
|
|
#define LOGFILE_TIME_FORMAT_DATE_EXTR substr(0, 8)
|
|
#define LOGFILE_TIME_FORMAT_HOUR_EXTR substr(9, 2)
|
|
|
|
|
|
//ClassFlowControll
|
|
#define READOUT_TYPE_VALUE 0
|
|
#define READOUT_TYPE_PREVALUE 1
|
|
#define READOUT_TYPE_RAWVALUE 2
|
|
#define READOUT_TYPE_ERROR 3
|
|
|
|
|
|
//ClassFlowControll: Serve alg_roi.jpg from memory as JPG
|
|
#define ALGROI_LOAD_FROM_MEM_AS_JPG // Load ALG_ROI.JPG as rendered JPG from RAM
|
|
|
|
|
|
//ClassFlowMQTT
|
|
#define LWT_TOPIC "connection"
|
|
#define LWT_CONNECTED "connected"
|
|
#define LWT_DISCONNECTED "connection lost"
|
|
|
|
|
|
//ClassFlowPostProcessing
|
|
#define PREVALUE_TIME_FORMAT_OUTPUT "%Y-%m-%dT%H:%M:%S%z"
|
|
#define PREVALUE_TIME_FORMAT_INPUT "%d-%d-%dT%d:%d:%d"
|
|
|
|
|
|
//CImageBasis
|
|
#define HTTP_BUFFER_SENT 1024
|
|
#define MAX_JPG_SIZE 128000
|
|
|
|
//make_stb + stb_image_resize + stb_image_write + stb_image //do not work if not in make_stb.cpp
|
|
//#define STB_IMAGE_IMPLEMENTATION
|
|
//#define STB_IMAGE_WRITE_IMPLEMENTATION
|
|
//#define STB_IMAGE_RESIZE_IMPLEMENTATION
|
|
#define STBI_ONLY_JPEG // (save 2% of Flash, but breaks the alignment mark generation, see https://github.com/jomjol/AI-on-the-edge-device/issues/1721)
|
|
|
|
|
|
//interface_influxdb
|
|
#define MAX_HTTP_OUTPUT_BUFFER 2048
|
|
|
|
|
|
//server_mqtt
|
|
#define LWT_TOPIC "connection"
|
|
#define LWT_CONNECTED "connected"
|
|
#define LWT_DISCONNECTED "connection lost"
|
|
|
|
|
|
// connect_wlan.cpp
|
|
//******************************
|
|
/* WIFI roaming functionalities 802.11k+v (uses ca. 6kB - 8kB internal RAM; if SCAN CACHE activated: + 1kB / beacon)
|
|
PLEASE BE AWARE: The following CONFIG parameters have to to be set in
|
|
sdkconfig.defaults before use of this function is possible!!
|
|
CONFIG_WPA_11KV_SUPPORT=y
|
|
CONFIG_WPA_SCAN_CACHE=n
|
|
CONFIG_WPA_MBO_SUPPORT=n
|
|
CONFIG_WPA_11R_SUPPORT=n
|
|
*/
|
|
//#define WLAN_USE_MESH_ROAMING // 802.11v (BSS Transition Management) + 802.11k (Radio Resource Management) (ca. 6kB - 8kB internal RAM neccessary)
|
|
//#define WLAN_USE_MESH_ROAMING_ACTIVATE_CLIENT_TRIGGERED_QUERIES // Client can send query to AP requesting to roam (if RSSI lower than RSSI threshold)
|
|
|
|
/* WIFI roaming only client triggered by scanning the channels after each round (only if RSSI < RSSIThreshold) and trigger a disconnect to switch AP */
|
|
#define WLAN_USE_ROAMING_BY_SCANNING
|
|
|
|
|
|
//ClassFlowCNNGeneral
|
|
#define Analog_error 3
|
|
|
|
#define AnalogToDigtalFehler 0.8
|
|
#define Digit_Uncertainty 0.2
|
|
#define DigitBand 3
|
|
#define Digit_Transition_Range_Predecessor 2
|
|
#define Digit_Transition_Area_Predecessor 0.7 // 9.3 - 0.7
|
|
#define Digit_Transition_Area_Forward 9.7 // Pre-run zero crossing only happens from approx. 9.7 onwards
|
|
|
|
//#define DEBUG_DETAIL_ON
|
|
|
|
|
|
/////////////////////////////////////////////
|
|
//// PSRAM Allocations ////
|
|
/////////////////////////////////////////////
|
|
#define MAX_MODEL_SIZE (unsigned int)(1.3 * 1024 * 1024) // Space for the currently largest model (1.1 MB) + some spare
|
|
#define TENSOR_ARENA_SIZE 800 * 1024 // Space for the Tensor Arena, (819200 Bytes)
|
|
#define IMAGE_SIZE 640 * 480 * 3 // Space for a extracted image (921600 Bytes)
|
|
/////////////////////////////////////////////
|
|
//// Conditionnal definitions ////
|
|
/////////////////////////////////////////////
|
|
|
|
|
|
// ******* Board type
|
|
#if defined(BOARD_WROVER_KIT) // WROVER-KIT PIN Map
|
|
// SD card (operated with SDMMC peripheral)
|
|
//-------------------------------------------------
|
|
#define GPIO_SDCARD_CLK GPIO_NUM_14
|
|
#define GPIO_SDCARD_CMD GPIO_NUM_15
|
|
#define GPIO_SDCARD_D0 GPIO_NUM_2
|
|
#ifndef __SD_USE_ONE_LINE_MODE__
|
|
#define GPIO_SDCARD_D1 GPIO_NUM_4
|
|
#define GPIO_SDCARD_D2 GPIO_NUM_12
|
|
#define GPIO_SDCARD_D3 GPIO_NUM_13
|
|
#else
|
|
#define GPIO_SDCARD_D1 GPIO_NUM_NC
|
|
#define GPIO_SDCARD_D2 GPIO_NUM_NC
|
|
#define GPIO_SDCARD_D3 GPIO_NUM_13
|
|
#endif
|
|
|
|
#define CAM_PIN_PWDN GPIO_NUM_NC //power down is not used
|
|
#define CAM_PIN_RESET GPIO_NUM_NC //software reset will be performed
|
|
#define CAM_PIN_XCLK GPIO_NUM_21
|
|
#define CAM_PIN_SIOD GPIO_NUM_26
|
|
#define CAM_PIN_SIOC GPIO_NUM_27
|
|
|
|
#define CAM_PIN_D7 GPIO_NUM_35
|
|
#define CAM_PIN_D6 GPIO_NUM_34
|
|
#define CAM_PIN_D5 GPIO_NUM_39
|
|
#define CAM_PIN_D4 GPIO_NUM_36
|
|
#define CAM_PIN_D3 GPIO_NUM_19
|
|
#define CAM_PIN_D2 GPIO_NUM_18
|
|
#define CAM_PIN_D1 GPIO_NUM_5
|
|
#define CAM_PIN_D0 GPIO_NUM_4
|
|
#define CAM_PIN_VSYNC GPIO_NUM_25
|
|
#define CAM_PIN_HREF GPIO_NUM_23
|
|
#define CAM_PIN_PCLK GPIO_NUM_22
|
|
|
|
//Statusled + ClassControllCamera
|
|
#define BLINK_GPIO GPIO_NUM_33 // PIN for red board LED, On the board the LED is on the IO2, but it is used for the SD
|
|
|
|
//ClassControllCamera
|
|
#define FLASH_GPIO GPIO_NUM_12 // PIN for flashlight LED
|
|
#define USE_PWM_LEDFLASH // if __LEDGLOBAL is defined, a global variable is used for LED control, otherwise locally and each time a new
|
|
|
|
#elif defined(BOARD_M5STACK_PSRAM) // M5STACK PSRAM PIN Map
|
|
#define CAM_PIN_PWDN GPIO_NUM_NC
|
|
#define CAM_PIN_RESET GPIO_NUM_15
|
|
#define CAM_PIN_XCLK GPIO_NUM_27
|
|
#define CAM_PIN_SIOD GPIO_NUM_25
|
|
#define CAM_PIN_SIOC GPIO_NUM_23
|
|
|
|
#define CAM_PIN_D7 GPIO_NUM_19
|
|
#define CAM_PIN_D6 GPIO_NUM_36
|
|
#define CAM_PIN_D5 GPIO_NUM_18
|
|
#define CAM_PIN_D4 GPIO_NUM_39
|
|
#define CAM_PIN_D3 GPIO_NUM_5
|
|
#define CAM_PIN_D2 GPIO_NUM_34
|
|
#define CAM_PIN_D1 GPIO_NUM_35
|
|
#define CAM_PIN_D0 GPIO_NUM_32
|
|
#define CAM_PIN_VSYNC GPIO_NUM_22
|
|
#define CAM_PIN_HREF GPIO_NUM_26
|
|
#define CAM_PIN_PCLK GPIO_NUM_21
|
|
|
|
//Statusled + ClassControllCamera
|
|
#define BLINK_GPIO GPIO_NUM_33 // PIN for red board LED
|
|
|
|
//ClassControllCamera
|
|
#define FLASH_GPIO GPIO_NUM_4 // PIN for flashlight LED
|
|
#define USE_PWM_LEDFLASH // if __LEDGLOBAL is defined, a global variable is used for LED control, otherwise locally and each time a new
|
|
|
|
|
|
#elif defined(BOARD_ESP32CAM_AITHINKER) // ESP32Cam (AiThinker) PIN Map
|
|
// SD card (operated with SDMMC peripheral)
|
|
//-------------------------------------------------
|
|
#define GPIO_SDCARD_CLK GPIO_NUM_14
|
|
#define GPIO_SDCARD_CMD GPIO_NUM_15
|
|
#define GPIO_SDCARD_D0 GPIO_NUM_2
|
|
#ifndef __SD_USE_ONE_LINE_MODE__
|
|
#define GPIO_SDCARD_D1 GPIO_NUM_4
|
|
#define GPIO_SDCARD_D2 GPIO_NUM_12
|
|
#define GPIO_SDCARD_D3 GPIO_NUM_13
|
|
#else
|
|
#define GPIO_SDCARD_D1 GPIO_NUM_NC
|
|
#define GPIO_SDCARD_D2 GPIO_NUM_NC
|
|
#define GPIO_SDCARD_D3 GPIO_NUM_13
|
|
#endif
|
|
|
|
#define CAM_PIN_PWDN GPIO_NUM_32
|
|
#define CAM_PIN_RESET GPIO_NUM_NC //software reset will be performed
|
|
#define CAM_PIN_XCLK GPIO_NUM_0
|
|
#define CAM_PIN_SIOD GPIO_NUM_26
|
|
#define CAM_PIN_SIOC GPIO_NUM_27
|
|
|
|
#define CAM_PIN_D7 GPIO_NUM_35
|
|
#define CAM_PIN_D6 GPIO_NUM_34
|
|
#define CAM_PIN_D5 GPIO_NUM_39
|
|
#define CAM_PIN_D4 GPIO_NUM_36
|
|
#define CAM_PIN_D3 GPIO_NUM_21
|
|
#define CAM_PIN_D2 GPIO_NUM_19
|
|
#define CAM_PIN_D1 GPIO_NUM_18
|
|
#define CAM_PIN_D0 GPIO_NUM_5
|
|
#define CAM_PIN_VSYNC GPIO_NUM_25
|
|
#define CAM_PIN_HREF GPIO_NUM_23
|
|
#define CAM_PIN_PCLK GPIO_NUM_22
|
|
|
|
//Statusled + ClassControllCamera
|
|
#define BLINK_GPIO GPIO_NUM_33 // PIN for red board LED
|
|
|
|
//ClassControllCamera
|
|
#define FLASH_GPIO GPIO_NUM_4 // PIN for flashlight LED
|
|
#define USE_PWM_LEDFLASH // if __LEDGLOBAL is defined, a global variable is used for LED control, otherwise locally and each time a new
|
|
|
|
#else
|
|
#error "Board not selected"
|
|
#endif //Board PIN Map
|
|
|
|
|
|
// ******* LED definition
|
|
#ifdef USE_PWM_LEDFLASH
|
|
//// PWM für Flash-LED
|
|
#define LEDC_TIMER LEDC_TIMER_1 // LEDC_TIMER_0
|
|
#define LEDC_MODE LEDC_LOW_SPEED_MODE
|
|
#define LEDC_OUTPUT_IO FLASH_GPIO // Define the output GPIO
|
|
#define LEDC_CHANNEL LEDC_CHANNEL_1
|
|
#define LEDC_DUTY_RES LEDC_TIMER_13_BIT // Set duty resolution to 13 bits
|
|
//#define LEDC_DUTY (195) // Set duty to 50%. ((2 ** 13) - 1) * 50% = 4095
|
|
#define LEDC_FREQUENCY (5000) // Frequency in Hertz. Set frequency at 5 kHz
|
|
|
|
#endif //USE_PWM_LEDFLASH
|
|
|
|
|
|
//softAP
|
|
#ifdef ENABLE_SOFTAP
|
|
#define EXAMPLE_ESP_WIFI_SSID "AI-on-the-Edge"
|
|
#define EXAMPLE_ESP_WIFI_PASS ""
|
|
#define EXAMPLE_ESP_WIFI_CHANNEL 11
|
|
#define EXAMPLE_MAX_STA_CONN 1
|
|
#endif // ENABLE_SOFTAP
|
|
|
|
#endif // ifndef defines_h
|