├── examples ├── example.js └── stress.js ├── setup.png ├── .gitignore ├── components ├── esp32-js-log │ ├── CMakeLists.txt │ └── include │ │ └── esp32-js-log.h ├── spiffs-events │ └── CMakeLists.txt ├── arduino-esp32 │ ├── include │ │ ├── esp32 │ │ │ ├── soc │ │ │ │ ├── gdma_channel.h │ │ │ │ ├── wdev_reg.h │ │ │ │ ├── gpio_pins.h │ │ │ │ ├── dac_channel.h │ │ │ │ ├── can_struct.h │ │ │ │ ├── can_periph.h │ │ │ │ ├── soc_pins.h │ │ │ │ ├── clkout_channel.h │ │ │ │ ├── sdio_slave_pins.h │ │ │ │ ├── bb_reg.h │ │ │ │ ├── fe_reg.h │ │ │ │ ├── sdmmc_pins.h │ │ │ │ ├── gpio_sd_struct.h │ │ │ │ └── touch_sensor_channel.h │ │ │ └── hal │ │ │ │ ├── trace_ll.h │ │ │ │ ├── adc_hal_conf.h │ │ │ │ ├── mpu_ll.h │ │ │ │ └── rtc_cntl_ll.h │ │ ├── esp32s2 │ │ │ ├── soc │ │ │ │ ├── gdma_channel.h │ │ │ │ ├── wdev_reg.h │ │ │ │ ├── gpio_pins.h │ │ │ │ ├── dac_channel.h │ │ │ │ ├── usb_pins.h │ │ │ │ ├── soc_pins.h │ │ │ │ ├── clkout_channel.h │ │ │ │ ├── usb_periph.h │ │ │ │ ├── dport_reg.h │ │ │ │ ├── touch_sensor_pins.h │ │ │ │ ├── sdio_slave_pins.h │ │ │ │ ├── bb_reg.h │ │ │ │ ├── fe_reg.h │ │ │ │ ├── sdmmc_pins.h │ │ │ │ ├── spi_pins.h │ │ │ │ └── gpio_sd_struct.h │ │ │ └── hal │ │ │ │ ├── trace_ll.h │ │ │ │ ├── soc_ll.h │ │ │ │ ├── adc_hal_conf.h │ │ │ │ ├── usb_ll.h │ │ │ │ └── mpu_ll.h │ │ ├── variants │ │ │ ├── adafruit_feather_esp32s2 │ │ │ │ ├── tinyuf2.bin │ │ │ │ ├── bootloader.bin │ │ │ │ ├── partitions.csv │ │ │ │ └── pins_arduino.h │ │ │ ├── adafruit_metro_esp32s2 │ │ │ │ ├── tinyuf2.bin │ │ │ │ ├── bootloader.bin │ │ │ │ └── partitions.csv │ │ │ ├── adafruit_funhouse_esp32s2 │ │ │ │ ├── tinyuf2.bin │ │ │ │ ├── bootloader.bin │ │ │ │ └── partitions.csv │ │ │ ├── adafruit_magtag29_esp32s2 │ │ │ │ ├── tinyuf2.bin │ │ │ │ ├── bootloader.bin │ │ │ │ └── partitions.csv │ │ │ ├── d32 │ │ │ │ ├── pins_arduino.h │ │ │ │ └── d32_core.h │ │ │ ├── d32_pro │ │ │ │ └── pins_arduino.h │ │ │ ├── metro_esp-32 │ │ │ │ └── pins_arduino.h │ │ │ ├── esp32-evb │ │ │ │ └── pins_arduino.h │ │ │ ├── esp320 │ │ │ │ └── pins_arduino.h │ │ │ ├── xinabox │ │ │ │ └── pins_arduino.h │ │ │ ├── esp32c3 │ │ │ │ └── pins_arduino.h │ │ │ ├── esp32-poe │ │ │ │ └── pins_arduino.h │ │ │ ├── esp32-poe-iso │ │ │ │ └── pins_arduino.h │ │ │ ├── odroid_esp32 │ │ │ │ └── pins_arduino.h │ │ │ ├── d1_mini32 │ │ │ │ └── pins_arduino.h │ │ │ ├── m5stick_c │ │ │ │ └── pins_arduino.h │ │ │ ├── twatch │ │ │ │ └── pins_arduino.h │ │ │ ├── wesp32 │ │ │ │ └── pins_arduino.h │ │ │ ├── esp32-gateway │ │ │ │ └── pins_arduino.h │ │ │ ├── piranha_esp-32 │ │ │ │ └── pins_arduino.h │ │ │ ├── hornbill32minima │ │ │ │ └── pins_arduino.h │ │ │ ├── m5stack_atom │ │ │ │ └── pins_arduino.h │ │ │ ├── m5stack_coreink │ │ │ │ └── pins_arduino.h │ │ │ ├── esp32vn-iot-uno │ │ │ │ └── pins_arduino.h │ │ │ ├── m5stack_fire │ │ │ │ └── pins_arduino.h │ │ │ ├── m5stack_core_esp32 │ │ │ │ └── pins_arduino.h │ │ │ ├── esp32 │ │ │ │ └── pins_arduino.h │ │ │ ├── frog32 │ │ │ │ └── pins_arduino.h │ │ │ ├── pico32 │ │ │ │ └── pins_arduino.h │ │ │ ├── ET-Board │ │ │ │ └── pins_arduino.h │ │ │ ├── quantum │ │ │ │ └── pins_arduino.h │ │ │ ├── m5stack_timer_cam │ │ │ │ └── pins_arduino.h │ │ │ ├── m5stack_core2 │ │ │ │ └── pins_arduino.h │ │ │ ├── bpi-bit │ │ │ │ └── pins_arduino.h │ │ │ ├── lolin32-lite │ │ │ │ └── pins_arduino.h │ │ │ ├── fm-devkit │ │ │ │ └── pins_arduino.h │ │ │ ├── oroca_edubot │ │ │ │ └── pins_arduino.h │ │ │ ├── sparkfun_lora_gateway_1-channel │ │ │ │ └── pins_arduino.h │ │ │ ├── tinypico │ │ │ │ └── pins_arduino.h │ │ │ ├── ttgo-t7-v13-mini32 │ │ │ │ └── pins_arduino.h │ │ │ ├── ttgo-t7-v14-mini32 │ │ │ │ └── pins_arduino.h │ │ │ ├── mhetesp32devkit │ │ │ │ └── pins_arduino.h │ │ │ ├── mhetesp32minikit │ │ │ │ └── pins_arduino.h │ │ │ ├── onehorse32dev │ │ │ │ └── pins_arduino.h │ │ │ ├── widora-air │ │ │ │ └── pins_arduino.h │ │ │ ├── esp32-devkit-lipo │ │ │ │ └── pins_arduino.h │ │ │ ├── doitESP32devkitV1 │ │ │ │ └── pins_arduino.h │ │ │ ├── esp32thing_plus │ │ │ │ └── pins_arduino.h │ │ │ └── lolin32 │ │ │ │ └── pins_arduino.h │ │ ├── base64.h │ │ ├── FunctionalInterrupt.h │ │ ├── esp8266-compat.h │ │ ├── esp32-hal-bt.h │ │ ├── Server.h │ │ ├── esp32-hal-dac.h │ │ ├── esp32-hal-psram.h │ │ ├── esp32-hal-sigmadelta.h │ │ ├── esp32-hal-matrix.h │ │ ├── StreamString.h │ │ ├── wiring_private.h │ │ ├── Printable.h │ │ ├── stdlib_noniso.h │ │ ├── esp32-hal-cpu.h │ │ ├── esp32-hal-ledc.h │ │ ├── Client.h │ │ └── esp_arduino_version.h │ ├── libb64 │ │ ├── AUTHORS │ │ ├── cdecode.h │ │ ├── cencode.h │ │ └── LICENSE │ ├── CMakeLists.txt │ ├── FunctionalInterrupt.cpp │ └── main.cpp ├── rxi-map │ ├── CMakeLists.txt │ └── LICENSE ├── esp32-javascript │ ├── libb64 │ │ ├── AUTHORS │ │ ├── cdecode.h │ │ ├── cencode.h │ │ └── LICENSE │ ├── modules │ │ └── esp32-javascript │ │ │ ├── firmware-config.js │ │ │ ├── self-test-firmware-config.js │ │ │ ├── require.d.ts │ │ │ ├── global.js │ │ │ ├── global.ts │ │ │ ├── firmware-config.ts │ │ │ └── self-test-firmware-config.ts │ └── CMakeLists.txt ├── duktape │ └── CMakeLists.txt ├── wifi-events │ ├── CMakeLists.txt │ └── include │ │ └── wifi-events.h ├── arduino-spi │ └── CMakeLists.txt ├── duk-module-node │ ├── CMakeLists.txt │ ├── include │ │ └── duk_module_node.h │ └── loader.js └── socket-events │ ├── CMakeLists.txt │ ├── cacert.pem │ ├── include │ ├── socket-events.h │ └── tcp.h │ └── prvtkey.pem ├── babel.config.json ├── tools ├── install-node.sh ├── Dockerfile └── build.sh ├── scripts ├── copy-modules.sh └── cp2 │ └── package.json ├── docs ├── modules │ ├── _esp32_javascript_modules_esp32_javascript_index_.md │ ├── _esp32_javascript_modules_esp32_javascript_stringbuffer_.md │ ├── _esp32_javascript_modules_esp32_javascript_global_.md │ ├── _esp32_javascript_urlparse_.md │ ├── _esp32_javascript_modules_esp32_javascript_firmware_config_.md │ └── _esp32_javascript_modules_esp32_javascript_self_test_.md ├── interfaces │ ├── _wifi_events_modules_wifi_events_index_.esp32jswifievent.md │ ├── _wifi_events_modules_wifi_events_index_.esp32jswifi.md │ ├── _esp32_javascript_modules_esp32_javascript_config_.esp32jsconfig.md │ ├── _socket_events_modules_socket_events_index_.bufferentry.md │ └── _esp32_javascript_modules_esp32_javascript_http_.esp32jsrequest.md └── classes │ └── _socket_events_modules_socket_events_index_.numberset.md ├── .eslintrc.js ├── partitions2MB.csv ├── main ├── CMakeLists.txt └── main.c ├── partitions4MB.csv ├── .github └── stale.yml ├── CMakeLists.txt ├── package.json ├── LICENSE └── tsconfig.json /examples/example.js: -------------------------------------------------------------------------------- 1 | console.log("Hello World"); 2 | -------------------------------------------------------------------------------- /setup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcelkottmann/esp32-javascript/HEAD/setup.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | sdkconfig.old* 3 | main/project.cpp 4 | main/project.c 5 | node_modules 6 | sdkconfig 7 | -------------------------------------------------------------------------------- /components/esp32-js-log/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(INCLUDE_DIRS "../../components/arduino-esp32/include/$ENV{IDF_TARGET}/" "include") -------------------------------------------------------------------------------- /components/spiffs-events/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRC_DIRS "." 2 | REQUIRES "spiffs" "duktape" "esp32-javascript") -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32/soc/gdma_channel.h: -------------------------------------------------------------------------------- 1 | // ESP32 doesn't feature General DMA peripheral. 2 | // We keep this file here only for consistency's sake. 3 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32s2/soc/gdma_channel.h: -------------------------------------------------------------------------------- 1 | // ESP32-S2 doesn't feature General DMA peripheral. 2 | // We keep this file here only for consistency's sake. 3 | -------------------------------------------------------------------------------- /components/rxi-map/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRC_DIRS "." 2 | INCLUDE_DIRS "../../components/arduino-esp32/include/$ENV{IDF_TARGET}/" "include") -------------------------------------------------------------------------------- /babel.config.json: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | [ 4 | "minify", 5 | { 6 | "builtIns": false 7 | } 8 | ] 9 | ], 10 | "comments": false 11 | } 12 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/adafruit_feather_esp32s2/tinyuf2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcelkottmann/esp32-javascript/HEAD/components/arduino-esp32/include/variants/adafruit_feather_esp32s2/tinyuf2.bin -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/adafruit_metro_esp32s2/tinyuf2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcelkottmann/esp32-javascript/HEAD/components/arduino-esp32/include/variants/adafruit_metro_esp32s2/tinyuf2.bin -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/adafruit_funhouse_esp32s2/tinyuf2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcelkottmann/esp32-javascript/HEAD/components/arduino-esp32/include/variants/adafruit_funhouse_esp32s2/tinyuf2.bin -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/adafruit_magtag29_esp32s2/tinyuf2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcelkottmann/esp32-javascript/HEAD/components/arduino-esp32/include/variants/adafruit_magtag29_esp32s2/tinyuf2.bin -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/adafruit_metro_esp32s2/bootloader.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcelkottmann/esp32-javascript/HEAD/components/arduino-esp32/include/variants/adafruit_metro_esp32s2/bootloader.bin -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/adafruit_feather_esp32s2/bootloader.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcelkottmann/esp32-javascript/HEAD/components/arduino-esp32/include/variants/adafruit_feather_esp32s2/bootloader.bin -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/adafruit_funhouse_esp32s2/bootloader.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcelkottmann/esp32-javascript/HEAD/components/arduino-esp32/include/variants/adafruit_funhouse_esp32s2/bootloader.bin -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/adafruit_magtag29_esp32s2/bootloader.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcelkottmann/esp32-javascript/HEAD/components/arduino-esp32/include/variants/adafruit_magtag29_esp32s2/bootloader.bin -------------------------------------------------------------------------------- /components/arduino-esp32/libb64/AUTHORS: -------------------------------------------------------------------------------- 1 | libb64: Base64 Encoding/Decoding Routines 2 | ====================================== 3 | 4 | Authors: 5 | ------- 6 | 7 | Chris Venter chris.venter@gmail.com http://rocketpod.blogspot.com 8 | -------------------------------------------------------------------------------- /components/esp32-javascript/libb64/AUTHORS: -------------------------------------------------------------------------------- 1 | libb64: Base64 Encoding/Decoding Routines 2 | ====================================== 3 | 4 | Authors: 5 | ------- 6 | 7 | Chris Venter chris.venter@gmail.com http://rocketpod.blogspot.com 8 | -------------------------------------------------------------------------------- /components/duktape/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRC_DIRS "." 2 | INCLUDE_DIRS "include") 3 | 4 | set_source_files_properties(duktape.c 5 | PROPERTIES COMPILE_FLAGS 6 | -Wno-error=maybe-uninitialized 7 | ) -------------------------------------------------------------------------------- /components/wifi-events/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRC_DIRS "." 2 | INCLUDE_DIRS "../../components/arduino-esp32/include/$ENV{IDF_TARGET}/" "include" 3 | REQUIRES "duktape" "esp32-javascript") -------------------------------------------------------------------------------- /tools/install-node.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | wget https://nodejs.org/dist/${VERSION}/node-${VERSION}-${DISTRO}.tar.xz 6 | mkdir -p /usr/local/lib/nodejs 7 | tar -xJvf node-$VERSION-$DISTRO.tar.xz -C /usr/local/lib/nodejs 8 | -------------------------------------------------------------------------------- /components/arduino-spi/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRC_DIRS "." 2 | INCLUDE_DIRS "../../components/arduino-esp32/include/$ENV{IDF_TARGET}/" "include" "$ENV{BOARD_VARIANT}" 3 | REQUIRES "arduino-esp32") -------------------------------------------------------------------------------- /components/arduino-esp32/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRC_DIRS "." "./libb64" 2 | INCLUDE_DIRS "include" "include/$ENV{IDF_TARGET}" "$ENV{BOARD_VARIANT}" 3 | REQUIRES "nvs_flash" "app_update" "esp_adc_cal") -------------------------------------------------------------------------------- /scripts/copy-modules.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | npm install 5 | npx tsc 6 | rm -rf build/modules build/raw/modules 7 | npx cp2 --verbose 'components/**/modules/**/*.js' 'f=>f.replace(/components\/([^\/]+)/,"build/raw")' 8 | npx babel build/raw/modules -d build/modules -------------------------------------------------------------------------------- /docs/modules/_esp32_javascript_modules_esp32_javascript_index_.md: -------------------------------------------------------------------------------- 1 | [esp32-javascript](../README.md) › ["esp32-javascript/modules/esp32-javascript/index"](_esp32_javascript_modules_esp32_javascript_index_.md) 2 | 3 | # Module: "esp32-javascript/modules/esp32-javascript/index" 4 | 5 | 6 | -------------------------------------------------------------------------------- /tools/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM espressif/idf:release-v4.2 2 | 3 | ADD . /opt/esp32-javascript 4 | WORKDIR /opt/esp32-javascript 5 | 6 | ENV VERSION=v12.17.0 7 | ENV DISTRO=linux-x64 8 | RUN ./tools/install-node.sh 9 | ENV PATH="/usr/local/lib/nodejs/node-$VERSION-$DISTRO/bin:${PATH}" 10 | -------------------------------------------------------------------------------- /components/duk-module-node/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRC_DIRS "." 2 | INCLUDE_DIRS "../../components/arduino-esp32/include/$ENV{IDF_TARGET}/" "include" 3 | REQUIRES "duktape" "esp32-javascript" "main" 4 | EMBED_TXTFILES "loader.js") -------------------------------------------------------------------------------- /components/esp32-javascript/modules/esp32-javascript/firmware-config.js: -------------------------------------------------------------------------------- 1 | Object.defineProperty(exports, "__esModule", { value: true }); 2 | var firmwareConfig = { 3 | access: { 4 | username: "esp32", 5 | password: "esp32", 6 | }, 7 | }; 8 | exports.default = firmwareConfig; 9 | -------------------------------------------------------------------------------- /components/socket-events/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRC_DIRS "." 2 | INCLUDE_DIRS "../../components/arduino-esp32/include/$ENV{IDF_TARGET}/" "include" 3 | REQUIRES "esp32-javascript" "openssl" 4 | EMBED_TXTFILES "cacert.pem" "prvtkey.pem") -------------------------------------------------------------------------------- /components/arduino-esp32/include/base64.h: -------------------------------------------------------------------------------- 1 | #ifndef CORE_BASE64_H_ 2 | #define CORE_BASE64_H_ 3 | 4 | class base64 5 | { 6 | public: 7 | static String encode(const uint8_t * data, size_t length); 8 | static String encode(const String& text); 9 | private: 10 | }; 11 | 12 | 13 | #endif /* CORE_BASE64_H_ */ 14 | -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | parser: "@typescript-eslint/parser", 4 | plugins: ["@typescript-eslint", "inclusive-language"], 5 | extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"], 6 | rules: { 7 | "inclusive-language/use-inclusive-words": "error", 8 | }, 9 | }; 10 | -------------------------------------------------------------------------------- /components/esp32-javascript/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRC_DIRS "." 2 | INCLUDE_DIRS "../../components/arduino-esp32/include/$ENV{IDF_TARGET}/" "include" 3 | REQUIRES "duk-module-node" "nvs_flash" "arduino-esp32" "esp32-js-log" "main" 4 | EMBED_TXTFILES "urlparse.js") 5 | -------------------------------------------------------------------------------- /partitions2MB.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, 0x1B0000, 6 | modules, data, spiffs, , 0x20000, 7 | data, data, spiffs, , 0x20000, 8 | -------------------------------------------------------------------------------- /scripts/cp2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "cp2", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "cp2.js", 6 | "bin": "./cp2.js", 7 | "scripts": { 8 | "start": "node cp2.js" 9 | }, 10 | "author": "Marcel Kottmann", 11 | "license": "MIT", 12 | "dependencies": { 13 | "glob": "^7.1.6", 14 | "meow": "^7.0.1" 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/d32/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | #include 6 | 7 | static const uint8_t LED_BUILTIN = 5; 8 | #define BUILTIN_LED LED_BUILTIN // backward compatibility 9 | #define LED_BUILTIN LED_BUILTIN 10 | static const uint8_t _VBAT = 35; // battery voltage 11 | 12 | #endif /* Pins_Arduino_h */ 13 | -------------------------------------------------------------------------------- /tools/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | # standard build 6 | idf.py build 7 | tar cvzf build.tar.gz build/*.bin build/*/*.bin 8 | 9 | #self-test build 10 | #cp ./components/esp32-javascript/modules/esp32-javascript/self-test-firmware-config.ts ./components/esp32-javascript/modules/esp32-javascript/firmware-config.ts 11 | #idf.py build 12 | #tar cvzf self-test-build.tar.gz build/*.bin build/*/*.bin 13 | -------------------------------------------------------------------------------- /docs/modules/_esp32_javascript_modules_esp32_javascript_stringbuffer_.md: -------------------------------------------------------------------------------- 1 | [esp32-javascript](../README.md) › ["esp32-javascript/modules/esp32-javascript/stringbuffer"](_esp32_javascript_modules_esp32_javascript_stringbuffer_.md) 2 | 3 | # Module: "esp32-javascript/modules/esp32-javascript/stringbuffer" 4 | 5 | ## Index 6 | 7 | ### Classes 8 | 9 | * [StringBuffer](../classes/_esp32_javascript_modules_esp32_javascript_stringbuffer_.stringbuffer.md) 10 | -------------------------------------------------------------------------------- /main/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | idf_component_register(SRC_DIRS "." 2 | INCLUDE_DIRS "../components/arduino-esp32/include/$ENV{IDF_TARGET}" "include" 3 | REQUIRES 4 | "arduino-esp32" 5 | "duk-module-node" 6 | "spiffs-events" 7 | "socket-events" 8 | "wifi-events" 9 | "esp32-javascript" 10 | $ENV{ESP32_JS_PROJECT_NAME}) -------------------------------------------------------------------------------- /partitions4MB.csv: -------------------------------------------------------------------------------- 1 | # Espressif ESP32 Partition Table 2 | # Name, Type, SubType, Offset, Size, Flags 3 | nvs, data, nvs, 0x9000, 0x4000, 4 | otadata, data, ota, 0xd000, 0x2000, 5 | phy_init, data, phy, 0xf000, 0x1000, 6 | ota_0, app, ota_0, 0x10000, 0x1B0000, 7 | ota_1, app, ota_1, , 0x1B0000, 8 | modules, data, spiffs, , 0x30000, 9 | modules_1, data, spiffs, , 0x30000, 10 | data, data, spiffs, , 0x30000, 11 | -------------------------------------------------------------------------------- /components/duk-module-node/include/duk_module_node.h: -------------------------------------------------------------------------------- 1 | #if !defined(DUK_MODULE_NODE_H_INCLUDED) 2 | #define DUK_MODULE_NODE_H_INCLUDED 3 | 4 | #include "duktape.h" 5 | 6 | #if defined(__cplusplus) 7 | extern "C" { 8 | #endif 9 | 10 | extern duk_ret_t duk_module_node_peval_main(duk_context *ctx, const char *path); 11 | extern void duk_module_node_init(duk_context *ctx); 12 | 13 | #if defined(__cplusplus) 14 | } 15 | #endif /* end 'extern "C"' wrapper */ 16 | 17 | #endif /* DUK_MODULE_NODE_H_INCLUDED */ -------------------------------------------------------------------------------- /components/esp32-javascript/modules/esp32-javascript/self-test-firmware-config.js: -------------------------------------------------------------------------------- 1 | Object.defineProperty(exports, "__esModule", { value: true }); 2 | var firmwareConfig = { 3 | access: { 4 | username: "esp32", 5 | password: "esp32", 6 | }, 7 | wifi: { 8 | ssid: "e2e", 9 | password: "e2epassword", 10 | }, 11 | ota: { 12 | script: "require('./self-test').run();", 13 | offline: true, 14 | }, 15 | }; 16 | exports.default = firmwareConfig; 17 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/adafruit_metro_esp32s2/partitions.csv: -------------------------------------------------------------------------------- 1 | # ESP-IDF Partition Table 2 | # Name, Type, SubType, Offset, Size, Flags 3 | # bootloader.bin,, 0x1000, 32K 4 | # partition table, 0x8000, 4K 5 | 6 | nvs, data, nvs, 0x9000, 20K, 7 | otadata, data, ota, 0xe000, 8K, 8 | ota_0, 0, ota_0, 0x10000, 1408K, 9 | ota_1, 0, ota_1, 0x170000, 1408K, 10 | uf2, app, factory,0x2d0000, 256K, 11 | ffat, data, fat, 0x310000, 960K, 12 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/adafruit_feather_esp32s2/partitions.csv: -------------------------------------------------------------------------------- 1 | # ESP-IDF Partition Table 2 | # Name, Type, SubType, Offset, Size, Flags 3 | # bootloader.bin,, 0x1000, 32K 4 | # partition table, 0x8000, 4K 5 | 6 | nvs, data, nvs, 0x9000, 20K, 7 | otadata, data, ota, 0xe000, 8K, 8 | ota_0, 0, ota_0, 0x10000, 1408K, 9 | ota_1, 0, ota_1, 0x170000, 1408K, 10 | uf2, app, factory,0x2d0000, 256K, 11 | ffat, data, fat, 0x310000, 960K, 12 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/adafruit_funhouse_esp32s2/partitions.csv: -------------------------------------------------------------------------------- 1 | # ESP-IDF Partition Table 2 | # Name, Type, SubType, Offset, Size, Flags 3 | # bootloader.bin,, 0x1000, 32K 4 | # partition table, 0x8000, 4K 5 | 6 | nvs, data, nvs, 0x9000, 20K, 7 | otadata, data, ota, 0xe000, 8K, 8 | ota_0, 0, ota_0, 0x10000, 1408K, 9 | ota_1, 0, ota_1, 0x170000, 1408K, 10 | uf2, app, factory,0x2d0000, 256K, 11 | ffat, data, fat, 0x310000, 960K, 12 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/adafruit_magtag29_esp32s2/partitions.csv: -------------------------------------------------------------------------------- 1 | # ESP-IDF Partition Table 2 | # Name, Type, SubType, Offset, Size, Flags 3 | # bootloader.bin,, 0x1000, 32K 4 | # partition table, 0x8000, 4K 5 | 6 | nvs, data, nvs, 0x9000, 20K, 7 | otadata, data, ota, 0xe000, 8K, 8 | ota_0, 0, ota_0, 0x10000, 1408K, 9 | ota_1, 0, ota_1, 0x170000, 1408K, 10 | uf2, app, factory,0x2d0000, 256K, 11 | ffat, data, fat, 0x310000, 960K, 12 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/FunctionalInterrupt.h: -------------------------------------------------------------------------------- 1 | /* 2 | * FunctionalInterrupt.h 3 | * 4 | * Created on: 8 jul. 2018 5 | * Author: Herman 6 | */ 7 | 8 | #ifndef CORE_CORE_FUNCTIONALINTERRUPT_H_ 9 | #define CORE_CORE_FUNCTIONALINTERRUPT_H_ 10 | 11 | #include 12 | 13 | struct InterruptArgStructure { 14 | std::function interruptFunction; 15 | }; 16 | 17 | void attachInterrupt(uint8_t pin, std::function intRoutine, int mode); 18 | 19 | 20 | #endif /* CORE_CORE_FUNCTIONALINTERRUPT_H_ */ 21 | -------------------------------------------------------------------------------- /docs/modules/_esp32_javascript_modules_esp32_javascript_global_.md: -------------------------------------------------------------------------------- 1 | [esp32-javascript](../README.md) › ["esp32-javascript/modules/esp32-javascript/global"](_esp32_javascript_modules_esp32_javascript_global_.md) 2 | 3 | # Module: "esp32-javascript/modules/esp32-javascript/global" 4 | 5 | ## Index 6 | 7 | ### Variables 8 | 9 | * [global](_esp32_javascript_modules_esp32_javascript_global_.md#global) 10 | 11 | ## Variables 12 | 13 | ### global 14 | 15 | • **global**: *any* 16 | 17 | *Defined in [esp32-javascript/modules/esp32-javascript/global.ts:26](https://github.com/marcelkottmann/esp32-javascript/blob/22ffb3d/components/esp32-javascript/modules/esp32-javascript/global.ts#L26)* 18 | -------------------------------------------------------------------------------- /examples/stress.js: -------------------------------------------------------------------------------- 1 | (function () { 2 | var config = require("./config").config; 3 | 4 | var success = 0; 5 | var err = 0; 6 | 7 | function stress() { 8 | info(); 9 | fetch("http://localhost/setup", { 10 | headers: { 11 | authorization: 12 | "Basic " + 13 | btoa(config.access.username + ":" + config.access.password), 14 | }, 15 | }) 16 | .then(function () { 17 | console.log(++success); 18 | setTimeout(stress, 0); 19 | }) 20 | .catch(function (error) { 21 | console.error(++err); 22 | console.error(error); 23 | setTimeout(stress, 0); 24 | }); 25 | } 26 | 27 | stress(); 28 | })(); 29 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/d32_pro/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | #include <../d32/d32_core.h> 6 | 7 | static const uint8_t LED_BUILTIN = 5; 8 | #define BUILTIN_LED LED_BUILTIN // backward compatibility 9 | #define LED_BUILTIN LED_BUILTIN 10 | static const uint8_t _VBAT = 35; // battery voltage 11 | 12 | 13 | #define TF_CS 4 // TF (Micro SD Card) CS pin 14 | #define TS_CS 12 // Touch Screen CS pin 15 | #define TFT_CS 14 // TFT CS pin 16 | #define TFT_LED 32 // TFT backlight control pin 17 | #define TFT_RST 33 // TFT reset pin 18 | #define TFT_DC 27 // TFT DC pin 19 | 20 | #define SS TF_CS 21 | 22 | #endif /* Pins_Arduino_h */ 23 | -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Number of days of inactivity before an issue becomes stale 2 | daysUntilStale: 60 3 | # Number of days of inactivity before a stale issue is closed 4 | daysUntilClose: 7 5 | # Issues with these labels will never be considered stale 6 | exemptLabels: 7 | - pinned 8 | - security 9 | # Label to use when marking an issue as stale 10 | staleLabel: wontfix 11 | # Comment to post when marking an issue as stale. Set to `false` to disable 12 | markComment: > 13 | This issue has been automatically marked as stale because it has not had 14 | recent activity. It will be closed if no further activity occurs. Thank you 15 | for your contributions. 16 | # Comment to post when closing a stale issue. Set to `false` to disable 17 | closeComment: false 18 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/metro_esp-32/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | static const uint8_t LED_BUILTIN = 2; 15 | #define BUILTIN_LED LED_BUILTIN // backward compatibility 16 | #define LED_BUILTIN LED_BUILTIN 17 | 18 | static const uint8_t KEY_BUILTIN = 0; 19 | 20 | static const uint8_t SDA = 21; 21 | static const uint8_t SCL = 22; 22 | 23 | static const uint8_t ADR = 12; 24 | 25 | #endif /* Pins_Arduino_h */ 26 | -------------------------------------------------------------------------------- /docs/interfaces/_wifi_events_modules_wifi_events_index_.esp32jswifievent.md: -------------------------------------------------------------------------------- 1 | [esp32-javascript](../README.md) › ["wifi-events/modules/wifi-events/index"](../modules/_wifi_events_modules_wifi_events_index_.md) › [Esp32JsWifiEvent](_wifi_events_modules_wifi_events_index_.esp32jswifievent.md) 2 | 3 | # Interface: Esp32JsWifiEvent 4 | 5 | **`module`** wifi-events 6 | 7 | ## Hierarchy 8 | 9 | * **Esp32JsWifiEvent** 10 | 11 | ## Index 12 | 13 | ### Properties 14 | 15 | * [status](_wifi_events_modules_wifi_events_index_.esp32jswifievent.md#status) 16 | 17 | ## Properties 18 | 19 | ### status 20 | 21 | • **status**: *number* 22 | 23 | *Defined in [wifi-events/modules/wifi-events/index.ts:30](https://github.com/marcelkottmann/esp32-javascript/blob/22ffb3d/components/wifi-events/modules/wifi-events/index.ts#L30)* 24 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32/soc/wdev_reg.h: -------------------------------------------------------------------------------- 1 | // Copyright 2010-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 | 15 | #pragma once 16 | 17 | #include "soc.h" 18 | 19 | /* Hardware random number generator register */ 20 | #define WDEV_RND_REG 0x60035144 21 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32s2/soc/wdev_reg.h: -------------------------------------------------------------------------------- 1 | // Copyright 2010-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 | 15 | #pragma once 16 | 17 | #include "soc.h" 18 | 19 | /* Hardware random number generator register */ 20 | #define WDEV_RND_REG 0x60035110 21 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/esp32-evb/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | 15 | static const uint8_t KEY_BUILTIN = 34; 16 | 17 | static const uint8_t TX = 1; 18 | static const uint8_t RX = 3; 19 | 20 | #define TX1 4 21 | #define RX1 36 22 | 23 | static const uint8_t SDA = 13; 24 | static const uint8_t SCL = 16; 25 | 26 | static const uint8_t SS = 17; 27 | static const uint8_t MOSI = 2; 28 | static const uint8_t MISO = 15; 29 | static const uint8_t SCK = 14; 30 | 31 | #define BOARD_HAS_1BIT_SDMMC 32 | 33 | #endif /* Pins_Arduino_h */ 34 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/esp320/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 11 7 | #define NUM_DIGITAL_PINS 12 8 | #define NUM_ANALOG_INPUTS 5 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | static const uint8_t LED_BUILTIN = 5; 15 | #define BUILTIN_LED LED_BUILTIN // backward compatibility 16 | #define LED_BUILTIN LED_BUILTIN 17 | 18 | static const uint8_t TX = 1; 19 | static const uint8_t RX = 3; 20 | 21 | static const uint8_t SDA = 2; 22 | static const uint8_t SCL = 14; 23 | 24 | static const uint8_t SS = 15; 25 | static const uint8_t MOSI = 13; 26 | static const uint8_t MISO = 12; 27 | static const uint8_t SCK = 14; 28 | 29 | #endif /* Pins_Arduino_h */ 30 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/xinabox/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | static const uint8_t LED_BUILTIN = 27; 15 | #define BUILTIN_LED LED_BUILTIN // backward compatibility 16 | #define LED_BUILTIN LED_BUILTIN 17 | 18 | static const uint8_t TX = 1; 19 | static const uint8_t RX = 3; 20 | 21 | static const uint8_t SDA = 21; 22 | static const uint8_t SCL = 22; 23 | 24 | static const uint8_t SS = 5; 25 | static const uint8_t MOSI = 23; 26 | static const uint8_t MISO = 19; 27 | static const uint8_t SCK = 18; 28 | 29 | #endif /* Pins_Arduino_h */ 30 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32s2/hal/trace_ll.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Espressif Systems (Shanghai) PTE LTD 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #pragma once 16 | 17 | #include "esp_bit_defs.h" 18 | #include "soc/dport_reg.h" 19 | 20 | static inline void trace_ll_set_mem_block(int block) 21 | { 22 | DPORT_WRITE_PERI_REG(DPORT_PMS_OCCUPY_3_REG, BIT(block-4)); 23 | } 24 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32/soc/gpio_pins.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #pragma once 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | 22 | #define GPIO_MATRIX_CONST_ONE_INPUT (0x38) 23 | #define GPIO_MATRIX_CONST_ZERO_INPUT (0x30) 24 | 25 | #ifdef __cplusplus 26 | } 27 | #endif 28 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32s2/soc/gpio_pins.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #pragma once 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | #define GPIO_MATRIX_CONST_ONE_INPUT (0x38) 22 | #define GPIO_MATRIX_CONST_ZERO_INPUT (0x3C) 23 | 24 | #ifdef __cplusplus 25 | } 26 | #endif 27 | -------------------------------------------------------------------------------- /docs/modules/_esp32_javascript_urlparse_.md: -------------------------------------------------------------------------------- 1 | [esp32-javascript](../README.md) › ["esp32-javascript/urlparse"](_esp32_javascript_urlparse_.md) 2 | 3 | # Module: "esp32-javascript/urlparse" 4 | 5 | ## Index 6 | 7 | ### Interfaces 8 | 9 | * [AnchorElement](../interfaces/_esp32_javascript_urlparse_.anchorelement.md) 10 | 11 | ### Functions 12 | 13 | * [urlparse](_esp32_javascript_urlparse_.md#const-urlparse) 14 | 15 | ## Functions 16 | 17 | ### `Const` urlparse 18 | 19 | ▸ **urlparse**(`absoluteUrl`: string): *[AnchorElement](../interfaces/_esp32_javascript_urlparse_.anchorelement.md)* 20 | 21 | *Defined in [esp32-javascript/urlparse.ts:45](https://github.com/marcelkottmann/esp32-javascript/blob/22ffb3d/components/esp32-javascript/urlparse.ts#L45)* 22 | 23 | **Parameters:** 24 | 25 | Name | Type | 26 | ------ | ------ | 27 | `absoluteUrl` | string | 28 | 29 | **Returns:** *[AnchorElement](../interfaces/_esp32_javascript_urlparse_.anchorelement.md)* 30 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32/soc/dac_channel.h: -------------------------------------------------------------------------------- 1 | // Copyright 2010-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 | 15 | #ifndef _SOC_DAC_CHANNEL_H 16 | #define _SOC_DAC_CHANNEL_H 17 | 18 | #define DAC_GPIO25_CHANNEL DAC_CHANNEL_1 19 | #define DAC_CHANNEL_1_GPIO_NUM 25 20 | 21 | #define DAC_GPIO26_CHANNEL DAC_CHANNEL_2 22 | #define DAC_CHANNEL_2_GPIO_NUM 26 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32s2/soc/dac_channel.h: -------------------------------------------------------------------------------- 1 | // Copyright 2010-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 | 15 | #ifndef _SOC_DAC_CHANNEL_H 16 | #define _SOC_DAC_CHANNEL_H 17 | 18 | #define DAC_GPIO17_CHANNEL DAC_CHANNEL_1 19 | #define DAC_CHANNEL_1_GPIO_NUM 17 20 | 21 | #define DAC_GPIO18_CHANNEL DAC_CHANNEL_2 22 | #define DAC_CHANNEL_2_GPIO_NUM 18 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | 3 | ### CONFIGURATION OF ESP32 JAVASCRIPT PROJECT ### 4 | 5 | # set BOARD_VARIANT to define your ESP32 board. Valid values 6 | # are the directory names below ./components/arduino-esp32/include/variants/ 7 | # or esp32-javascript/include/variants/ 8 | set(ENV{BOARD_VARIANT} "../esp32-javascript/include/variants/my") 9 | 10 | # set ESP32_JS_PROJECT_NAME to define your project component name. 11 | # Place your component below ./components directory. Set to "" 12 | # if you don't have a project component yet. 13 | set(ENV{ESP32_JS_PROJECT_NAME} "") 14 | ################################################# 15 | 16 | include($ENV{IDF_PATH}/tools/cmake/project.cmake) 17 | add_compile_options(-Wp,-w) 18 | project(esp32-javascript) 19 | 20 | add_custom_target(cp_modules ALL 21 | COMMAND scripts/copy-modules.sh 22 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) 23 | 24 | spiffs_create_partition_image(modules build/modules FLASH_IN_PROJECT 25 | DEPENDS cp_modules) 26 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp8266-compat.h: -------------------------------------------------------------------------------- 1 | // esp8266-compat.h - Compatibility functions to help ESP8266 libraries and user code run on ESP32 2 | 3 | // Copyright (c) 2017 Evandro Luis Copercini. All rights reserved. 4 | // 5 | // Licensed under the Apache License, Version 2.0 (the "License"); 6 | // you may not use this file except in compliance with the License. 7 | // You may obtain a copy of the License at 8 | 9 | // http://www.apache.org/licenses/LICENSE-2.0 10 | // 11 | // Unless required by applicable law or agreed to in writing, software 12 | // distributed under the License is distributed on an "AS IS" BASIS, 13 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | // See the License for the specific language governing permissions and 15 | // limitations under the License. 16 | 17 | #ifndef _ESP8266_COMPAT_H_ 18 | #define _ESP8266_COMPAT_H_ 19 | 20 | #define ICACHE_FLASH_ATTR 21 | #define ICACHE_RAM_ATTR ARDUINO_ISR_ATTR 22 | 23 | 24 | #endif /* _ESP8266_COMPAT_H_ */ -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32-hal-bt.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 | 15 | #ifndef _ESP32_ESP32_HAL_BT_H_ 16 | #define _ESP32_ESP32_HAL_BT_H_ 17 | 18 | #include "esp32-hal.h" 19 | 20 | #ifdef __cplusplus 21 | extern "C" { 22 | #endif 23 | 24 | bool btStarted(); 25 | bool btStart(); 26 | bool btStop(); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #endif /* _ESP32_ESP32_HAL_BT_H_ */ 33 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32/soc/can_struct.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 | 15 | #pragma once 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | #warning soc/can_struct.h is deprecated, please use soc/twai_struct.h instead 22 | 23 | #include "soc/twai_struct.h" 24 | 25 | typedef twai_dev_t can_dev_t; 26 | extern can_dev_t CAN; 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/esp32c3/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 22 7 | #define NUM_DIGITAL_PINS 22 8 | #define NUM_ANALOG_INPUTS 6 9 | 10 | #define analogInputToDigitalPin(p) (((p) 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | #define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT 15 | #define ETH_PHY_POWER 12 16 | 17 | static const uint8_t KEY_BUILTIN = 34; 18 | 19 | static const uint8_t TX = 1; 20 | static const uint8_t RX = 3; 21 | 22 | #define TX1 4 23 | #define RX1 36 24 | 25 | #define TX2 33 // ext2 pin 5 26 | #define RX2 35 // ext2 pin 3 27 | 28 | static const uint8_t SDA = 13; 29 | static const uint8_t SCL = 16; 30 | 31 | static const uint8_t SS = 5; 32 | static const uint8_t MOSI = 2; 33 | static const uint8_t MISO = 15; 34 | static const uint8_t SCK = 14; 35 | 36 | #define BOARD_HAS_1BIT_SDMMC 37 | 38 | #endif /* Pins_Arduino_h */ 39 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/esp32-poe-iso/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | #define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT 15 | #define ETH_PHY_POWER 12 16 | 17 | static const uint8_t KEY_BUILTIN = 34; 18 | 19 | static const uint8_t TX = 1; 20 | static const uint8_t RX = 3; 21 | 22 | #define TX1 4 23 | #define RX1 36 24 | 25 | #define TX2 33 // ext2 pin 5 26 | #define RX2 35 // ext2 pin 3 27 | 28 | static const uint8_t SDA = 13; 29 | static const uint8_t SCL = 16; 30 | 31 | static const uint8_t SS = 5; 32 | static const uint8_t MOSI = 2; 33 | static const uint8_t MISO = 15; 34 | static const uint8_t SCK = 14; 35 | 36 | #define BOARD_HAS_1BIT_SDMMC 37 | 38 | #endif /* Pins_Arduino_h */ 39 | -------------------------------------------------------------------------------- /components/arduino-esp32/libb64/cdecode.h: -------------------------------------------------------------------------------- 1 | /* 2 | cdecode.h - c header for a base64 decoding algorithm 3 | 4 | This is part of the libb64 project, and has been placed in the public domain. 5 | For details, see http://sourceforge.net/projects/libb64 6 | */ 7 | 8 | #ifndef BASE64_CDECODE_H 9 | #define BASE64_CDECODE_H 10 | 11 | #define base64_decode_expected_len(n) ((n * 3) / 4) 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | typedef enum { 18 | step_a, step_b, step_c, step_d 19 | } base64_decodestep; 20 | 21 | typedef struct { 22 | base64_decodestep step; 23 | char plainchar; 24 | } base64_decodestate; 25 | 26 | void base64_init_decodestate(base64_decodestate* state_in); 27 | 28 | int base64_decode_value(char value_in); 29 | 30 | int base64_decode_block(const char* code_in, const int length_in, char* plaintext_out, base64_decodestate* state_in); 31 | 32 | int base64_decode_chars(const char* code_in, const int length_in, char* plaintext_out); 33 | 34 | #ifdef __cplusplus 35 | } // extern "C" 36 | #endif 37 | 38 | #endif /* BASE64_CDECODE_H */ 39 | -------------------------------------------------------------------------------- /components/esp32-javascript/libb64/cdecode.h: -------------------------------------------------------------------------------- 1 | /* 2 | cdecode.h - c header for a base64 decoding algorithm 3 | 4 | This is part of the libb64 project, and has been placed in the public domain. 5 | For details, see http://sourceforge.net/projects/libb64 6 | */ 7 | 8 | #ifndef BASE64_CDECODE_H 9 | #define BASE64_CDECODE_H 10 | 11 | #define base64_decode_expected_len(n) ((n * 3) / 4) 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | typedef enum { 18 | step_a, step_b, step_c, step_d 19 | } base64_decodestep; 20 | 21 | typedef struct { 22 | base64_decodestep step; 23 | char plainchar; 24 | } base64_decodestate; 25 | 26 | void base64_init_decodestate(base64_decodestate* state_in); 27 | 28 | int base64_decode_value(char value_in); 29 | 30 | int base64_decode_block(const char* code_in, const int length_in, char* plaintext_out, base64_decodestate* state_in); 31 | 32 | int base64_decode_chars(const char* code_in, const int length_in, char* plaintext_out); 33 | 34 | #ifdef __cplusplus 35 | } // extern "C" 36 | #endif 37 | 38 | #endif /* BASE64_CDECODE_H */ 39 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32s2/hal/soc_ll.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Espressif Systems (Shanghai) PTE LTD 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | #pragma once 15 | 16 | #include "soc/soc.h" 17 | #include "soc/rtc_cntl_reg.h" 18 | #include "soc/soc_caps.h" 19 | #include "soc/rtc.h" 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | static inline void soc_ll_reset_core(int core) 26 | { 27 | SET_PERI_REG_MASK(RTC_CNTL_OPTIONS0_REG, RTC_CNTL_SW_PROCPU_RST_M); 28 | } 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/odroid_esp32/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | static const uint8_t LED_BUILTIN = 2; 15 | #define BUILTIN_LED LED_BUILTIN // backward compatibility 16 | #define LED_BUILTIN LED_BUILTIN 17 | 18 | static const uint8_t TX = 1; 19 | static const uint8_t RX = 3; 20 | 21 | static const uint8_t SDA = 15; 22 | static const uint8_t SCL = 4; 23 | 24 | static const uint8_t SS = 22; 25 | static const uint8_t MOSI = 23; 26 | static const uint8_t MISO = 19; 27 | static const uint8_t SCK = 18; 28 | 29 | static const uint8_t DAC1 = 25; 30 | static const uint8_t DAC2 = 26; 31 | 32 | static const uint8_t ADC1 = 35; 33 | static const uint8_t ADC2 = 36; 34 | 35 | #endif /* Pins_Arduino_h */ 36 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32s2/soc/usb_pins.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Espressif Systems (Shanghai) PTE LTD 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #pragma once 16 | 17 | /* GPIOs used to connect an external USB PHY */ 18 | #define USBPHY_VP_NUM 33 19 | #define USBPHY_VM_NUM 34 20 | #define USBPHY_RCV_NUM 35 21 | #define USBPHY_OEN_NUM 36 22 | #define USBPHY_VPO_NUM 37 23 | #define USBPHY_VMO_NUM 38 24 | 25 | /* GPIOs corresponding to the pads of the internal USB PHY */ 26 | #define USBPHY_DP_NUM 20 27 | #define USBPHY_DM_NUM 19 28 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32/hal/trace_ll.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Espressif Systems (Shanghai) PTE LTD 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #pragma once 16 | 17 | #include "soc/dport_reg.h" 18 | 19 | static inline void trace_ll_mem_enable(int cpu, bool enable) 20 | { 21 | int reg[] = {DPORT_PRO_TRACEMEM_ENA_REG, DPORT_APP_TRACEMEM_ENA_REG}; 22 | DPORT_WRITE_PERI_REG(reg[cpu], enable); 23 | } 24 | 25 | static inline void trace_ll_set_mode(int mode) 26 | { 27 | DPORT_WRITE_PERI_REG(DPORT_TRACEMEM_MUX_MODE_REG, mode); 28 | } 29 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/Server.h: -------------------------------------------------------------------------------- 1 | /* 2 | Server.h - Base class that provides Server 3 | Copyright (c) 2011 Adrian McEwen. All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef server_h 21 | #define server_h 22 | 23 | #include "Print.h" 24 | 25 | class Server: public Print 26 | { 27 | public: 28 | virtual void begin(uint16_t port=0) =0; 29 | }; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "esp32-javascript", 3 | "version": "0.0.0", 4 | "description": "", 5 | "scripts": { 6 | "compile": "tsc", 7 | "doc": "typedoc --mode modules --plugin typedoc-plugin-markdown --readme none" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/marcelkottmann/esp32-javascript.git" 12 | }, 13 | "author": "", 14 | "license": "MIT", 15 | "bugs": { 16 | "url": "https://github.com/marcelkottmann/esp32-javascript/issues" 17 | }, 18 | "homepage": "https://github.com/marcelkottmann/esp32-javascript#readme", 19 | "devDependencies": { 20 | "@babel/cli": "^7.14.3", 21 | "@babel/core": "^7.14.3", 22 | "@typescript-eslint/eslint-plugin": "^3.10.1", 23 | "@typescript-eslint/parser": "^3.10.1", 24 | "babel-plugin-transform-remove-console": "^6.9.4", 25 | "babel-preset-minify": "^0.5.1", 26 | "cp2": "file:scripts/cp2", 27 | "eslint": "^7.26.0", 28 | "eslint-plugin-inclusive-language": "^1.2.1", 29 | "typedoc": "^0.17.8", 30 | "typedoc-plugin-markdown": "^2.4.2", 31 | "typescript": "4.3.5" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /components/rxi-map/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 rxi 2 | 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of 5 | this software and associated documentation files (the "Software"), to deal in 6 | the Software without restriction, including without limitation the rights to 7 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 8 | of the Software, and to permit persons to whom the Software is furnished to do 9 | so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 20 | SOFTWARE. -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Marcel Kottmann 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 | -------------------------------------------------------------------------------- /docs/modules/_esp32_javascript_modules_esp32_javascript_firmware_config_.md: -------------------------------------------------------------------------------- 1 | [esp32-javascript](../README.md) › ["esp32-javascript/modules/esp32-javascript/firmware-config"](_esp32_javascript_modules_esp32_javascript_firmware_config_.md) 2 | 3 | # Module: "esp32-javascript/modules/esp32-javascript/firmware-config" 4 | 5 | ## Index 6 | 7 | ### Object literals 8 | 9 | * [firmwareConfig](_esp32_javascript_modules_esp32_javascript_firmware_config_.md#const-firmwareconfig) 10 | 11 | ## Object literals 12 | 13 | ### `Const` firmwareConfig 14 | 15 | ### ▪ **firmwareConfig**: *object* 16 | 17 | *Defined in [esp32-javascript/modules/esp32-javascript/firmware-config.ts:26](https://github.com/marcelkottmann/esp32-javascript/blob/22ffb3d/components/esp32-javascript/modules/esp32-javascript/firmware-config.ts#L26)* 18 | 19 | ▪ **access**: *object* 20 | 21 | *Defined in [esp32-javascript/modules/esp32-javascript/firmware-config.ts:27](https://github.com/marcelkottmann/esp32-javascript/blob/22ffb3d/components/esp32-javascript/modules/esp32-javascript/firmware-config.ts#L27)* 22 | 23 | * **password**: *string* = "esp32" 24 | 25 | * **username**: *string* = "esp32" 26 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32/soc/soc_pins.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Espressif Systems (Shanghai) PTE LTD 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /* 16 | * Pin definition header file. The long term plan is to have a single soc_pins.h for all 17 | * peripherals. Now we temporarily separate these information into periph_pins/channels.h for each 18 | * peripheral and include them here to avoid developing conflicts in those header files. 19 | */ 20 | 21 | #pragma once 22 | 23 | #include "soc/gpio_pins.h" 24 | #include "soc/spi_pins.h" 25 | #include "soc/sdio_slave_pins.h" 26 | #include "soc/sdmmc_pins.h" 27 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32s2/soc/soc_pins.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Espressif Systems (Shanghai) PTE LTD 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | /* 16 | * Pin definition header file. The long term plan is to have a single soc_pins.h for all 17 | * peripherals. Now we temporarily separate these information into periph_pins/channels.h for each 18 | * peripheral and include them here to avoid developing conflicts in those header files. 19 | */ 20 | 21 | #pragma once 22 | 23 | #include "soc/usb_pins.h" 24 | #include "soc/gpio_pins.h" 25 | #include "soc/spi_pins.h" 26 | #include "soc/touch_sensor_pins.h" 27 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32/soc/clkout_channel.h: -------------------------------------------------------------------------------- 1 | // Copyright 2010-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 | 15 | #ifndef _SOC_CLKOUT_CHANNEL_H 16 | #define _SOC_CLKOUT_CHANNEL_H 17 | 18 | //CLKOUT channels 19 | #define CLKOUT_GPIO0_DIRECT_CHANNEL CLKOUT_CHANNEL_1 20 | #define CLKOUT_CHANNEL_1_DIRECT_GPIO_NUM 0 21 | #define CLKOUT_GPIO3_DIRECT_CHANNEL CLKOUT_CHANNEL_2 22 | #define CLKOUT_CHANNEL_2_DIRECT_GPIO_NUM 3 23 | #define CLKOUT_GPIO1_DIRECT_CHANNEL CLKOUT_CHANNEL_3 24 | #define CLKOUT_CHANNEL_3_DIRECT_GPIO_NUM 1 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /components/arduino-esp32/libb64/cencode.h: -------------------------------------------------------------------------------- 1 | /* 2 | cencode.h - c header for a base64 encoding algorithm 3 | 4 | This is part of the libb64 project, and has been placed in the public domain. 5 | For details, see http://sourceforge.net/projects/libb64 6 | */ 7 | 8 | #ifndef BASE64_CENCODE_H 9 | #define BASE64_CENCODE_H 10 | 11 | #define base64_encode_expected_len(n) ((((4 * n) / 3) + 3) & ~3) 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | typedef enum { 18 | step_A, step_B, step_C 19 | } base64_encodestep; 20 | 21 | typedef struct { 22 | base64_encodestep step; 23 | char result; 24 | int stepcount; 25 | } base64_encodestate; 26 | 27 | void base64_init_encodestate(base64_encodestate* state_in); 28 | 29 | char base64_encode_value(char value_in); 30 | 31 | int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, base64_encodestate* state_in); 32 | 33 | int base64_encode_blockend(char* code_out, base64_encodestate* state_in); 34 | 35 | int base64_encode_chars(const char* plaintext_in, int length_in, char* code_out); 36 | 37 | #ifdef __cplusplus 38 | } // extern "C" 39 | #endif 40 | 41 | #endif /* BASE64_CENCODE_H */ 42 | -------------------------------------------------------------------------------- /components/esp32-javascript/libb64/cencode.h: -------------------------------------------------------------------------------- 1 | /* 2 | cencode.h - c header for a base64 encoding algorithm 3 | 4 | This is part of the libb64 project, and has been placed in the public domain. 5 | For details, see http://sourceforge.net/projects/libb64 6 | */ 7 | 8 | #ifndef BASE64_CENCODE_H 9 | #define BASE64_CENCODE_H 10 | 11 | #define base64_encode_expected_len(n) ((((4 * n) / 3) + 3) & ~3) 12 | 13 | #ifdef __cplusplus 14 | extern "C" { 15 | #endif 16 | 17 | typedef enum { 18 | step_A, step_B, step_C 19 | } base64_encodestep; 20 | 21 | typedef struct { 22 | base64_encodestep step; 23 | char result; 24 | int stepcount; 25 | } base64_encodestate; 26 | 27 | void base64_init_encodestate(base64_encodestate* state_in); 28 | 29 | char base64_encode_value(char value_in); 30 | 31 | int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, base64_encodestate* state_in); 32 | 33 | int base64_encode_blockend(char* code_out, base64_encodestate* state_in); 34 | 35 | int base64_encode_chars(const char* plaintext_in, int length_in, char* code_out); 36 | 37 | #ifdef __cplusplus 38 | } // extern "C" 39 | #endif 40 | 41 | #endif /* BASE64_CENCODE_H */ 42 | -------------------------------------------------------------------------------- /components/arduino-esp32/FunctionalInterrupt.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * FunctionalInterrupt.cpp 3 | * 4 | * Created on: 8 jul. 2018 5 | * Author: Herman 6 | */ 7 | 8 | #include "FunctionalInterrupt.h" 9 | #include "Arduino.h" 10 | 11 | typedef void (*voidFuncPtr)(void); 12 | typedef void (*voidFuncPtrArg)(void*); 13 | 14 | extern "C" 15 | { 16 | extern void __attachInterruptFunctionalArg(uint8_t pin, voidFuncPtrArg userFunc, void * arg, int intr_type, bool functional); 17 | } 18 | 19 | void ARDUINO_ISR_ATTR interruptFunctional(void* arg) 20 | { 21 | InterruptArgStructure* localArg = (InterruptArgStructure*)arg; 22 | if (localArg->interruptFunction) 23 | { 24 | localArg->interruptFunction(); 25 | } 26 | } 27 | 28 | void attachInterrupt(uint8_t pin, std::function intRoutine, int mode) 29 | { 30 | // use the local interrupt routine which takes the ArgStructure as argument 31 | __attachInterruptFunctionalArg (pin, (voidFuncPtrArg)interruptFunctional, new InterruptArgStructure{intRoutine}, mode, true); 32 | } 33 | 34 | extern "C" 35 | { 36 | void cleanupFunctional(void* arg) 37 | { 38 | delete (InterruptArgStructure*)arg; 39 | } 40 | } 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32s2/soc/clkout_channel.h: -------------------------------------------------------------------------------- 1 | // Copyright 2010-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 | 15 | #ifndef _SOC_CLKOUT_CHANNEL_H 16 | #define _SOC_CLKOUT_CHANNEL_H 17 | 18 | //CLKOUT channels 19 | #define CLKOUT_GPIO20_DIRECT_CHANNEL CLKOUT_CHANNEL_1 20 | #define CLKOUT_CHANNEL_1_DIRECT_GPIO_NUM 20 21 | #define CLKOUT_GPIO19_DIRECT_CHANNEL CLKOUT_CHANNEL_2 22 | #define CLKOUT_CHANNEL_2_DIRECT_GPIO_NUM 19 23 | #define CLKOUT_GPIO18_DIRECT_CHANNEL CLKOUT_CHANNEL_3 24 | #define CLKOUT_CHANNEL_3_DIRECT_GPIO_NUM 18 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/d1_mini32/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | #include <../d32/d32_core.h> 6 | 7 | static const uint8_t LED_BUILTIN = 2; 8 | #define BUILTIN_LED LED_BUILTIN // backward compatibility 9 | #define LED_BUILTIN LED_BUILTIN 10 | static const uint8_t _VBAT = 35; // battery voltage 11 | 12 | #define PIN_WIRE_SDA SDA // backward compatibility 13 | #define PIN_WIRE_SCL SCL // backward compatibility 14 | 15 | static const uint8_t D0 = 26; 16 | static const uint8_t D1 = 22; 17 | static const uint8_t D2 = 21; 18 | static const uint8_t D3 = 17; 19 | static const uint8_t D4 = 16; 20 | static const uint8_t D5 = 18; 21 | static const uint8_t D6 = 19; 22 | static const uint8_t D7 = 23; 23 | static const uint8_t D8 = 5; 24 | static const uint8_t RXD = 3; 25 | static const uint8_t TXD = 1; 26 | 27 | #define PIN_SPI_SS SS // backward compatibility 28 | #define PIN_SPI_MOSI MOSI // backward compatibility 29 | #define PIN_SPI_MISO MISO // backward compatibility 30 | #define PIN_SPI_SCK SCK // backward compatibility 31 | 32 | #define PIN_A0 A0 // backward compatibility 33 | 34 | #endif /* Pins_Arduino_h */ 35 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/m5stick_c/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | static const uint8_t TX = 1; 15 | static const uint8_t RX = 3; 16 | 17 | static const uint8_t SDA = 32; 18 | static const uint8_t SCL = 33; 19 | 20 | static const uint8_t SS = 5; 21 | static const uint8_t MOSI = 15; 22 | static const uint8_t MISO = 36; 23 | static const uint8_t SCK = 13; 24 | 25 | static const uint8_t G9 = 9; 26 | static const uint8_t G10 = 10; 27 | static const uint8_t G37 = 37; 28 | static const uint8_t G39 = 39; 29 | static const uint8_t G32 = 32; 30 | static const uint8_t G33 = 33; 31 | static const uint8_t G26 = 26; 32 | static const uint8_t G36 = 36; 33 | static const uint8_t G0 = 0; 34 | 35 | static const uint8_t DAC1 = 25; 36 | static const uint8_t DAC2 = 26; 37 | 38 | static const uint8_t ADC1 = 35; 39 | static const uint8_t ADC2 = 36; 40 | 41 | #endif /* Pins_Arduino_h */ 42 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32-hal-dac.h: -------------------------------------------------------------------------------- 1 | /* 2 | Arduino.h - Main include file for the Arduino SDK 3 | Copyright (c) 2005-2013 Arduino Team. All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef MAIN_ESP32_HAL_DAC_H_ 21 | #define MAIN_ESP32_HAL_DAC_H_ 22 | 23 | #ifdef __cplusplus 24 | extern "C" { 25 | #endif 26 | 27 | #include "esp32-hal.h" 28 | #include "driver/gpio.h" 29 | 30 | void dacWrite(uint8_t pin, uint8_t value); 31 | 32 | #ifdef __cplusplus 33 | } 34 | #endif 35 | 36 | #endif /* MAIN_ESP32_HAL_DAC_H_ */ 37 | -------------------------------------------------------------------------------- /docs/modules/_esp32_javascript_modules_esp32_javascript_self_test_.md: -------------------------------------------------------------------------------- 1 | [esp32-javascript](../README.md) › ["esp32-javascript/modules/esp32-javascript/self-test"](_esp32_javascript_modules_esp32_javascript_self_test_.md) 2 | 3 | # Module: "esp32-javascript/modules/esp32-javascript/self-test" 4 | 5 | ## Index 6 | 7 | ### Functions 8 | 9 | * [run](_esp32_javascript_modules_esp32_javascript_self_test_.md#run) 10 | * [setPinValue](_esp32_javascript_modules_esp32_javascript_self_test_.md#setpinvalue) 11 | 12 | ## Functions 13 | 14 | ### run 15 | 16 | ▸ **run**(): *void* 17 | 18 | *Defined in [esp32-javascript/modules/esp32-javascript/self-test.ts:32](https://github.com/marcelkottmann/esp32-javascript/blob/22ffb3d/components/esp32-javascript/modules/esp32-javascript/self-test.ts#L32)* 19 | 20 | **Returns:** *void* 21 | 22 | ___ 23 | 24 | ### setPinValue 25 | 26 | ▸ **setPinValue**(`pin`: number, `val`: number): *void* 27 | 28 | *Defined in [esp32-javascript/modules/esp32-javascript/self-test.ts:26](https://github.com/marcelkottmann/esp32-javascript/blob/22ffb3d/components/esp32-javascript/modules/esp32-javascript/self-test.ts#L26)* 29 | 30 | **Parameters:** 31 | 32 | Name | Type | 33 | ------ | ------ | 34 | `pin` | number | 35 | `val` | number | 36 | 37 | **Returns:** *void* 38 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32s2/soc/usb_periph.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Espressif Systems (Shanghai) PTE LTD 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #pragma once 16 | 17 | #include 18 | #include 19 | #include "soc/soc_pins.h" 20 | #include "soc/gpio_sig_map.h" 21 | #include "soc/usb_reg.h" 22 | #include "soc/usb_types.h" 23 | #include "soc/usb_struct.h" 24 | #include "soc/usb_wrap_reg.h" 25 | #include "soc/usb_wrap_struct.h" 26 | 27 | /** 28 | * @brief A pin descriptor for init 29 | */ 30 | typedef struct { 31 | const int pin; 32 | const int func; 33 | const bool is_output; 34 | const int ext_phy_only; 35 | } usb_iopin_dsc_t; 36 | 37 | extern const usb_iopin_dsc_t usb_periph_iopins[]; 38 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32s2/hal/adc_hal_conf.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Espressif Systems (Shanghai) PTE LTD 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #pragma once 16 | 17 | #define SOC_ADC1_DATA_INVERT_DEFAULT (0) 18 | #define SOC_ADC2_DATA_INVERT_DEFAULT (0) 19 | 20 | #define SOC_ADC_DIGI_DATA_INVERT_DEFAULT(PERIPH_NUM) (0) 21 | 22 | #define SOC_ADC_FSM_RSTB_WAIT_DEFAULT (8) 23 | #define SOC_ADC_FSM_START_WAIT_DEFAULT (5) 24 | #define SOC_ADC_FSM_STANDBY_WAIT_DEFAULT (100) 25 | #define ADC_FSM_SAMPLE_CYCLE_DEFAULT (3) 26 | 27 | #define SOC_ADC_PWDET_CCT_DEFAULT (4) 28 | 29 | #define SOC_ADC_SAR_CLK_DIV_DEFAULT(PERIPH_NUM) ((PERIPH_NUM==0)? 2 : 1) 30 | 31 | #define SOC_ADC_DIGI_SAR_CLK_DIV_DEFAULT (2) 32 | -------------------------------------------------------------------------------- /components/esp32-javascript/modules/esp32-javascript/require.d.ts: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2021 Marcel Kottmann 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or 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, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | */ 24 | declare const module: { exports: any }; 25 | declare function require(moduleId: string): any; 26 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32-hal-psram.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 | 15 | #ifndef _ESP32_HAL_PSRAM_H_ 16 | #define _ESP32_HAL_PSRAM_H_ 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | #include "sdkconfig.h" 23 | 24 | #ifndef BOARD_HAS_PSRAM 25 | #ifdef CONFIG_SPIRAM_SUPPORT 26 | #undef CONFIG_SPIRAM_SUPPORT 27 | #endif 28 | #ifdef CONFIG_SPIRAM 29 | #undef CONFIG_SPIRAM 30 | #endif 31 | #endif 32 | 33 | bool psramInit(); 34 | bool psramFound(); 35 | 36 | void *ps_malloc(size_t size); 37 | void *ps_calloc(size_t n, size_t size); 38 | void *ps_realloc(void *ptr, size_t size); 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | 44 | #endif /* _ESP32_HAL_PSRAM_H_ */ 45 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32/hal/adc_hal_conf.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Espressif Systems (Shanghai) PTE LTD 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #pragma once 16 | 17 | #define SOC_ADC1_DATA_INVERT_DEFAULT (1) 18 | #define SOC_ADC2_DATA_INVERT_DEFAULT (1) 19 | 20 | #define SOC_ADC_DIGI_DATA_INVERT_DEFAULT(PERIPH_NUM) (1) 21 | 22 | #define SOC_ADC_FSM_RSTB_WAIT_DEFAULT (8) 23 | #define SOC_ADC_FSM_START_WAIT_DEFAULT (SOC_ADC_DIGI_SAR_CLK_DIV_DEFAULT) 24 | #define SOC_ADC_FSM_STANDBY_WAIT_DEFAULT (100) 25 | #define ADC_FSM_SAMPLE_CYCLE_DEFAULT (2) 26 | 27 | #define SOC_ADC_PWDET_CCT_DEFAULT (4) 28 | 29 | #define SOC_ADC_SAR_CLK_DIV_DEFAULT(PERIPH_NUM) (2) 30 | 31 | #define SOC_ADC_DIGI_SAR_CLK_DIV_DEFAULT (16) 32 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32-hal-sigmadelta.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 | 15 | #ifndef _ESP32_HAL_SD_H_ 16 | #define _ESP32_HAL_SD_H_ 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | #include 23 | #include 24 | 25 | //channel 0-7 freq 1220-312500 duty 0-255 26 | uint32_t sigmaDeltaSetup(uint8_t channel, uint32_t freq); 27 | void sigmaDeltaWrite(uint8_t channel, uint8_t duty); 28 | uint8_t sigmaDeltaRead(uint8_t channel); 29 | void sigmaDeltaAttachPin(uint8_t pin, uint8_t channel); 30 | void sigmaDeltaDetachPin(uint8_t pin); 31 | 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | 37 | #endif /* _ESP32_HAL_SD_H_ */ 38 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32-hal-matrix.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 | 15 | #ifndef _ESP32_HAL_MATRIX_H_ 16 | #define _ESP32_HAL_MATRIX_H_ 17 | 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | #include "esp32-hal.h" 24 | #include "soc/gpio_sig_map.h" 25 | 26 | void pinMatrixOutAttach(uint8_t pin, uint8_t function, bool invertOut, bool invertEnable); 27 | void pinMatrixOutDetach(uint8_t pin, bool invertOut, bool invertEnable); 28 | void pinMatrixInAttach(uint8_t pin, uint8_t signal, bool inverted); 29 | void pinMatrixInDetach(uint8_t signal, bool high, bool inverted); 30 | 31 | #ifdef __cplusplus 32 | } 33 | #endif 34 | 35 | #endif /* COMPONENTS_ARDUHAL_INCLUDE_ESP32_HAL_MATRIX_H_ */ 36 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/StreamString.h: -------------------------------------------------------------------------------- 1 | /** 2 | StreamString.h 3 | 4 | Copyright (c) 2015 Markus Sattler. All rights reserved. 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | 20 | */ 21 | 22 | #ifndef STREAMSTRING_H_ 23 | #define STREAMSTRING_H_ 24 | 25 | 26 | class StreamString: public Stream, public String 27 | { 28 | public: 29 | size_t write(const uint8_t *buffer, size_t size) override; 30 | size_t write(uint8_t data) override; 31 | 32 | int available() override; 33 | int read() override; 34 | int peek() override; 35 | void flush() override; 36 | }; 37 | 38 | 39 | #endif /* STREAMSTRING_H_ */ 40 | -------------------------------------------------------------------------------- /components/esp32-javascript/modules/esp32-javascript/global.js: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2021 Marcel Kottmann 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or 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, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | */ 24 | // make `global` available for compatibility reasons. For new features use globalThis instead. 25 | globalThis.global = globalThis; 26 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32s2/soc/dport_reg.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 _SOC_DPORT_REG_H_ 15 | #define _SOC_DPORT_REG_H_ 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | #include "interrupt_reg.h" 22 | #include "system_reg.h" 23 | #include "sensitive_reg.h" 24 | #include "soc.h" 25 | 26 | #define DPORT_DATE_REG SYSTEM_DATE_REG 27 | 28 | #define TRACEMEM_MUX_BLK0_NUM 19 29 | #define TRACEMEM_MUX_BLK1_NUM 20 30 | #define TRACEMEM_BLK_NUM2ADDR(_n_) (0x3FFB8000UL + 0x4000UL*((_n_)-4)) 31 | 32 | #ifndef __ASSEMBLER__ 33 | #include "dport_access.h" 34 | #endif 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif 39 | 40 | #endif /*_SOC_DPORT_REG_H_ */ 41 | -------------------------------------------------------------------------------- /components/socket-events/cacert.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIDezCCAmOgAwIBAgIJAPMMNobNczaUMA0GCSqGSIb3DQEBBAUAMHQxEzARBgNV 3 | BAMTCk15IFRlc3QgQ0ExCzAJBgNVBAgTAkhaMQswCQYDVQQGEwJDTjEcMBoGCSqG 4 | SIb3DQEJARYNdGVzdEBjZXJ0LmNvbTElMCMGA1UEChMcUm9vdCBDZXJ0aWZpY2F0 5 | aW9uIEF1dGhvcml0eTAeFw0xNjExMTUwNTA0MThaFw0xOTExMTUwNTA0MThaMHQx 6 | EzARBgNVBAMTCk15IFRlc3QgQ0ExCzAJBgNVBAgTAkhaMQswCQYDVQQGEwJDTjEc 7 | MBoGCSqGSIb3DQEJARYNdGVzdEBjZXJ0LmNvbTElMCMGA1UEChMcUm9vdCBDZXJ0 8 | aWZpY2F0aW9uIEF1dGhvcml0eTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC 9 | ggEBALDjSPDlomepHCzbw4MUrquQAU0xTV4/Npb27k9I5TRVTjIoOs/5hNI2LPFW 10 | e4CREx09ZrT8K3NFOBoSy7bhPAsjGaFxCYYWc9tiX1m5gq3ToVRSmbZ65fE3kvnI 11 | 8E/d5VyzA0OMmWbfaolBSTMoWgqRynEaT+z1Eh2yDTzVFy9eov1DdQFUqGDqbH5b 12 | QYvTY5Fyem7UcKWAe2yS0j3H4dVtVBKNY7qV3Px08yGAs5fQFgUwhyB5+qwhvkeL 13 | JdgapGaSTwLgoQKWHbe/lA3NiBIB9hznFUGKo3hmniAvYZbrQcn3tc0l/J4I39v2 14 | Pm29FAyjWvQyBkGktz2q4elOZYkCAwEAAaMQMA4wDAYDVR0TBAUwAwEB/zANBgkq 15 | hkiG9w0BAQQFAAOCAQEAJCJ+97oae/FcOLbPpjCpUQnWqYydgSChgalkZNvr4fVp 16 | TnuNg471l0Y2oTJLoWn2YcbPSFVOEeKkU47mpjMzucHHp0zGaW9SdzhZalWwmbgK 17 | q2ijecIbuFHFNedYTk/03K7eaAcjVhD8e0oOJImeLOL6DAFivA1LUnSgXsdGPDtD 18 | zhISsCPTu+cL1j0yP6HBvLeAyb8kaCWJ05RtiVLRANNHQn/keHajJYpMwnEEbJdG 19 | cqN3whfJoGVbZ6isEf2RQJ0pYRnP7uGLW3wGkLWxfdto8uER8HVDx7fZpevLIqGd 20 | 1OoSEi3cIJXWBAjx0TLzzhtb6aeIxBJWQqHThtkKdg== 21 | -----END CERTIFICATE----- 22 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32s2/soc/touch_sensor_pins.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Espressif Systems (Shanghai) PTE LTD 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #pragma once 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | #define SOC_TOUCH_SHIELD_CHANNEL (14) /*!< The waterproof function includes a shielded channel (TOUCH_PAD_NUM14) */ 22 | #define SOC_TOUCH_DENOISE_CHANNEL (0) /*!< T0 is an internal channel that does not have a corresponding external GPIO. 23 | T0 will work simultaneously with the measured channel Tn. Finally, the actual 24 | measured value of Tn is the value after subtracting lower bits of T0. */ 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/wiring_private.h: -------------------------------------------------------------------------------- 1 | /* 2 | wiring_private.h - Internal header file. 3 | Part of Arduino - http://www.arduino.cc/ 4 | 5 | Copyright (c) 2005-2006 David A. Mellis 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 18 | Public License along with this library; if not, write to the 19 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, 20 | Boston, MA 02111-1307 USA 21 | 22 | $Id: wiring.h 239 2007-01-12 17:58:39Z mellis $ 23 | */ 24 | 25 | #ifndef WiringPrivate_h 26 | #define WiringPrivate_h 27 | 28 | #include 29 | #include 30 | 31 | #include "Arduino.h" 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | typedef void (*voidFuncPtr)(void); 38 | 39 | void initPins(); 40 | 41 | #ifdef __cplusplus 42 | } // extern "C" 43 | #endif 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /components/esp32-javascript/modules/esp32-javascript/global.ts: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2021 Marcel Kottmann 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or 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, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | */ 24 | 25 | /* eslint-disable no-var */ 26 | declare var global: any; 27 | // make `global` available for compatibility reasons. For new features use globalThis instead. 28 | (globalThis as any).global = globalThis; -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/twatch/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 20 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | // touch screen 15 | #define TP_SDA 23 16 | #define TP_SCL 32 17 | #define TP_INT 38 18 | 19 | // Interrupt IO port 20 | #define RTC_INT 37 21 | #define APX20X_INT 35 22 | #define BMA42X_INT1 39 23 | 24 | static const uint8_t TX = 1; 25 | static const uint8_t RX = 3; 26 | 27 | //Serial1 Already assigned to GPS LORA 28 | #define TX1 33 29 | #define RX1 34 30 | 31 | // Already assigned to BMA423 PCF8563 and external extensions 32 | static const uint8_t SDA = 21; 33 | static const uint8_t SCL = 22; 34 | // SPI has been configured as an SD card slot and must be removed when downloading 35 | static const uint8_t SS = 13; 36 | static const uint8_t MOSI = 15; 37 | static const uint8_t MISO = 2; 38 | static const uint8_t SCK = 14; 39 | // Externally programmable IO 40 | static const uint8_t DAC1 = 25; 41 | static const uint8_t DAC2 = 26; 42 | 43 | #endif /* Pins_Arduino_h */ 44 | -------------------------------------------------------------------------------- /components/arduino-esp32/main.cpp: -------------------------------------------------------------------------------- 1 | #include "freertos/FreeRTOS.h" 2 | #include "freertos/task.h" 3 | #include "esp_task_wdt.h" 4 | #include "Arduino.h" 5 | #if ARDUINO_SERIAL_PORT //Serial used for USB CDC 6 | #include "USB.h" 7 | #endif 8 | 9 | #ifndef CONFIG_ARDUINO_LOOP_STACK_SIZE 10 | #define CONFIG_ARDUINO_LOOP_STACK_SIZE 8192 11 | #endif 12 | 13 | TaskHandle_t loopTaskHandle = NULL; 14 | 15 | #if CONFIG_AUTOSTART_ARDUINO 16 | #if CONFIG_FREERTOS_UNICORE 17 | void yieldIfNecessary(void){ 18 | static uint64_t lastYield = 0; 19 | uint64_t now = millis(); 20 | if((now - lastYield) > 2000) { 21 | lastYield = now; 22 | vTaskDelay(5); //delay 1 RTOS tick 23 | } 24 | } 25 | #endif 26 | 27 | bool loopTaskWDTEnabled; 28 | 29 | void loopTask(void *pvParameters) 30 | { 31 | setup(); 32 | for(;;) { 33 | #if CONFIG_FREERTOS_UNICORE 34 | yieldIfNecessary(); 35 | #endif 36 | if(loopTaskWDTEnabled){ 37 | esp_task_wdt_reset(); 38 | } 39 | loop(); 40 | if (serialEventRun) serialEventRun(); 41 | } 42 | } 43 | 44 | extern "C" void app_main() 45 | { 46 | #if ARDUINO_SERIAL_PORT //Serial used for USB CDC 47 | USB.begin(); 48 | #endif 49 | loopTaskWDTEnabled = false; 50 | initArduino(); 51 | xTaskCreateUniversal(loopTask, "loopTask", CONFIG_ARDUINO_LOOP_STACK_SIZE, NULL, 1, &loopTaskHandle, ARDUINO_RUNNING_CORE); 52 | } 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /main/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2021 Marcel Kottmann 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or 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, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | */ 24 | #include "esp32-javascript.h" 25 | 26 | int app_main() 27 | { 28 | return esp32_javascript_init(); 29 | } 30 | 31 | #if __has_include("project.c") 32 | #include "project.c" 33 | #else 34 | void esp32_javascript_main(duk_context *ctx) 35 | { 36 | } 37 | #endif 38 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/wesp32/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | #define TX1 12 15 | #define RX1 13 16 | #define TX2 33 17 | #define RX2 39 18 | 19 | static const uint8_t TX = 1; 20 | static const uint8_t RX = 3; 21 | 22 | static const uint8_t SCL = 4; 23 | static const uint8_t SDA = 15; 24 | 25 | static const uint8_t SS = 5; 26 | static const uint8_t MOSI = 23; 27 | static const uint8_t MISO = 32; 28 | static const uint8_t SCK = 18; 29 | 30 | static const uint8_t A0 = 36; 31 | static const uint8_t A3 = 39; 32 | static const uint8_t A4 = 32; 33 | static const uint8_t A5 = 33; 34 | static const uint8_t A6 = 34; 35 | static const uint8_t A7 = 35; 36 | 37 | static const uint8_t T0 = 4; 38 | static const uint8_t T2 = 2; 39 | static const uint8_t T8 = 33; 40 | static const uint8_t T9 = 32; 41 | 42 | #define ETH_PHY_ADDR 0 43 | #define ETH_PHY_POWER -1 44 | #define ETH_PHY_MDC 16 45 | #define ETH_PHY_MDIO 17 46 | #define ETH_PHY_TYPE ETH_PHY_LAN8720 47 | #define ETH_CLK_MODE ETH_CLOCK_GPIO0_IN 48 | 49 | #endif /* Pins_Arduino_h */ 50 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/esp32-gateway/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | #if ARDUINO_ESP32_GATEWAY >= 'D' 15 | #define ETH_CLK_MODE ETH_CLOCK_GPIO17_OUT 16 | #define ETH_PHY_POWER 5 17 | #endif 18 | 19 | static const uint8_t LED_BUILTIN = 33; 20 | #define BUILTIN_LED LED_BUILTIN // backward compatibility 21 | #define LED_BUILTIN LED_BUILTIN 22 | 23 | static const uint8_t KEY_BUILTIN = 34; 24 | 25 | static const uint8_t SCL = 16; // This is extention pin 11 26 | static const uint8_t SDA = 32; // This is extention pin 13 27 | 28 | static const uint8_t SS = 5; 29 | static const uint8_t MOSI = 23; 30 | static const uint8_t MISO = 19; 31 | static const uint8_t SCK = 18; 32 | 33 | static const uint8_t TX = 1; 34 | static const uint8_t RX = 3; 35 | 36 | static const uint8_t A0 = 36; 37 | static const uint8_t A3 = 39; 38 | static const uint8_t A4 = 32; 39 | static const uint8_t A7 = 35; 40 | 41 | static const uint8_t T9 = 32; 42 | 43 | #if ARDUINO_ESP32_GATEWAY >= 'F' 44 | #define BOARD_HAS_1BIT_SDMMC 45 | #endif 46 | 47 | #endif /* Pins_Arduino_h */ 48 | -------------------------------------------------------------------------------- /components/esp32-javascript/modules/esp32-javascript/firmware-config.ts: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2021 Marcel Kottmann 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or 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, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | */ 24 | import { Esp32JsConfig } from "./config"; 25 | 26 | const firmwareConfig: Esp32JsConfig = { 27 | access: { 28 | username: "esp32", 29 | password: "esp32", 30 | }, 31 | }; 32 | 33 | export default firmwareConfig; 34 | -------------------------------------------------------------------------------- /docs/interfaces/_wifi_events_modules_wifi_events_index_.esp32jswifi.md: -------------------------------------------------------------------------------- 1 | [esp32-javascript](../README.md) › ["wifi-events/modules/wifi-events/index"](../modules/_wifi_events_modules_wifi_events_index_.md) › [Esp32JsWifi](_wifi_events_modules_wifi_events_index_.esp32jswifi.md) 2 | 3 | # Interface: Esp32JsWifi 4 | 5 | ## Hierarchy 6 | 7 | * **Esp32JsWifi** 8 | 9 | ## Index 10 | 11 | ### Properties 12 | 13 | * [ip](_wifi_events_modules_wifi_events_index_.esp32jswifi.md#ip) 14 | * [status](_wifi_events_modules_wifi_events_index_.esp32jswifi.md#status) 15 | 16 | ## Properties 17 | 18 | ### ip 19 | 20 | • **ip**: *string | undefined* 21 | 22 | *Defined in [wifi-events/modules/wifi-events/index.ts:35](https://github.com/marcelkottmann/esp32-javascript/blob/22ffb3d/components/wifi-events/modules/wifi-events/index.ts#L35)* 23 | 24 | ___ 25 | 26 | ### status 27 | 28 | • **status**: *function* 29 | 30 | *Defined in [wifi-events/modules/wifi-events/index.ts:34](https://github.com/marcelkottmann/esp32-javascript/blob/22ffb3d/components/wifi-events/modules/wifi-events/index.ts#L34)* 31 | 32 | #### Type declaration: 33 | 34 | ▸ (`event`: [Esp32JsWifiEvent](_wifi_events_modules_wifi_events_index_.esp32jswifievent.md), `ip`: string | undefined): *void* 35 | 36 | **Parameters:** 37 | 38 | Name | Type | 39 | ------ | ------ | 40 | `event` | [Esp32JsWifiEvent](_wifi_events_modules_wifi_events_index_.esp32jswifievent.md) | 41 | `ip` | string | undefined | 42 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/piranha_esp-32/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | static const uint8_t LED_BUILTIN = 2; 15 | #define BUILTIN_LED LED_BUILTIN // backward compatibility 16 | #define LED_BUILTIN LED_BUILTIN 17 | 18 | static const uint8_t KEY_BUILTIN = 0; 19 | 20 | static const uint8_t TX = 1; 21 | static const uint8_t RX = 3; 22 | 23 | static const uint8_t SDA = 21; 24 | static const uint8_t SCL = 22; 25 | 26 | static const uint8_t SS = 5; 27 | static const uint8_t MOSI = 23; 28 | static const uint8_t MISO = 19; 29 | static const uint8_t SCK = 18; 30 | 31 | static const uint8_t A11 = 0; 32 | static const uint8_t A13 = 15; 33 | static const uint8_t A14 = 13; 34 | static const uint8_t A15 = 12; 35 | static const uint8_t A16 = 14; 36 | static const uint8_t A18 = 25; 37 | static const uint8_t A19 = 26; 38 | 39 | static const uint8_t T1 = 0; 40 | static const uint8_t T3 = 15; 41 | static const uint8_t T4 = 13; 42 | static const uint8_t T5 = 12; 43 | static const uint8_t T6 = 14; 44 | 45 | static const uint8_t DAC1 = 25; 46 | static const uint8_t DAC2 = 26; 47 | 48 | #endif /* Pins_Arduino_h */ 49 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32s2/hal/usb_ll.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Espressif Systems (Shanghai) PTE LTD 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | 16 | #include "soc/soc.h" 17 | #include "soc/system_reg.h" 18 | #include "soc/gpio_sig_map.h" 19 | #include "soc/usb_periph.h" 20 | 21 | static inline void usb_ll_int_phy_enable(void) 22 | { 23 | USB_WRAP.otg_conf.pad_enable = 1; 24 | USB_WRAP.otg_conf.phy_sel = 0; 25 | } 26 | 27 | static inline void usb_ll_ext_phy_enable(void) 28 | { 29 | USB_WRAP.otg_conf.pad_enable = 1; 30 | USB_WRAP.otg_conf.phy_sel = 1; 31 | } 32 | 33 | static inline void usb_ll_int_phy_pullup_conf(bool dp_pu, bool dp_pd, bool dm_pu, bool dm_pd) 34 | { 35 | usb_wrap_otg_conf_reg_t conf = USB_WRAP.otg_conf; 36 | conf.pad_pull_override = 1; 37 | conf.dp_pullup = dp_pu; 38 | conf.dp_pulldown = dp_pd; 39 | conf.dm_pullup = dm_pu; 40 | conf.dm_pulldown = dp_pd; 41 | USB_WRAP.otg_conf = conf; 42 | } 43 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/hornbill32minima/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | static const uint8_t TX = 1; //taken out on pgm header 15 | static const uint8_t RX = 3; //taken out on pgm header 16 | 17 | static const uint8_t SDA = 21; //1 18 | static const uint8_t SCL = 22; //2 19 | 20 | static const uint8_t SS = 2; //3 21 | static const uint8_t MOSI = 23; //4 22 | static const uint8_t MISO = 19; //5 23 | static const uint8_t SCK = 18; //6 24 | 25 | 26 | 27 | static const uint8_t A6 = 34; //7 28 | static const uint8_t A7 = 35; //8 29 | static const uint8_t A10 = 4; //9 30 | static const uint8_t A11 = 0; // taken out on pgm header 31 | static const uint8_t A12 = 2; // with SPI SS 32 | static const uint8_t A13 = 15; //10 33 | static const uint8_t A14 = 13; //11 34 | 35 | 36 | 37 | static const uint8_t DAC1 = 25; //12 38 | static const uint8_t DAC2 = 26; //13 39 | 40 | 41 | static const uint8_t T0 = 4; //used 42 | static const uint8_t T1 = 0; // taken out on pgm header 43 | static const uint8_t T2 = 2; //used 44 | static const uint8_t T3 = 15; //used 45 | 46 | 47 | 48 | 49 | #endif /* Pins_Arduino_h */ 50 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/m5stack_atom/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | static const uint8_t TX = 1; 15 | static const uint8_t RX = 3; 16 | 17 | static const uint8_t SDA = 26; 18 | static const uint8_t SCL = 32; 19 | 20 | 21 | static const uint8_t G12 = 12; 22 | static const uint8_t G19 = 19; 23 | static const uint8_t G21 = 21; 24 | static const uint8_t G22 = 22; 25 | static const uint8_t G23 = 23; 26 | static const uint8_t G25 = 25; 27 | static const uint8_t G26 = 26; 28 | static const uint8_t G27 = 27; 29 | static const uint8_t G32 = 32; 30 | static const uint8_t G33 = 33; 31 | static const uint8_t G39 = 39; 32 | 33 | static const uint8_t G9 = 9; 34 | static const uint8_t G10 = 10; 35 | static const uint8_t G37 = 37; 36 | static const uint8_t G36 = 36; 37 | static const uint8_t G0 = 0; 38 | 39 | static const uint8_t DAC1 = 25; 40 | static const uint8_t DAC2 = 26; 41 | 42 | static const uint8_t ADC1 = 35; 43 | static const uint8_t ADC2 = 36; 44 | 45 | static const uint8_t SS = 19; 46 | static const uint8_t MOSI = 33; 47 | static const uint8_t MISO = 23; 48 | static const uint8_t SCK = 22; 49 | 50 | #endif /* Pins_Arduino_h */ 51 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/Printable.h: -------------------------------------------------------------------------------- 1 | /* 2 | Printable.h - Interface class that allows printing of complex types 3 | Copyright (c) 2011 Adrian McEwen. All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef Printable_h 21 | #define Printable_h 22 | 23 | #include 24 | 25 | class Print; 26 | 27 | /** The Printable class provides a way for new classes to allow themselves to be printed. 28 | By deriving from Printable and implementing the printTo method, it will then be possible 29 | for users to print out instances of this class by passing them into the usual 30 | Print::print and Print::println methods. 31 | */ 32 | 33 | class Printable 34 | { 35 | public: 36 | virtual ~Printable() {} 37 | virtual size_t printTo(Print& p) const = 0; 38 | }; 39 | 40 | #endif 41 | 42 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32/soc/sdio_slave_pins.h: -------------------------------------------------------------------------------- 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 | #ifndef _SOC_SDIO_SLAVE_PINS_H_ 16 | #define _SOC_SDIO_SLAVE_PINS_H_ 17 | 18 | #define SDIO_SLAVE_SLOT0_IOMUX_PIN_NUM_CLK 6 19 | #define SDIO_SLAVE_SLOT0_IOMUX_PIN_NUM_CMD 11 20 | #define SDIO_SLAVE_SLOT0_IOMUX_PIN_NUM_D0 7 21 | #define SDIO_SLAVE_SLOT0_IOMUX_PIN_NUM_D1 8 22 | #define SDIO_SLAVE_SLOT0_IOMUX_PIN_NUM_D2 9 23 | #define SDIO_SLAVE_SLOT0_IOMUX_PIN_NUM_D3 10 24 | #define SDIO_SLAVE_SLOT0_FUNC 0 25 | 26 | #define SDIO_SLAVE_SLOT1_IOMUX_PIN_NUM_CLK 14 27 | #define SDIO_SLAVE_SLOT1_IOMUX_PIN_NUM_CMD 15 28 | #define SDIO_SLAVE_SLOT1_IOMUX_PIN_NUM_D0 2 29 | #define SDIO_SLAVE_SLOT1_IOMUX_PIN_NUM_D1 4 30 | #define SDIO_SLAVE_SLOT1_IOMUX_PIN_NUM_D2 12 31 | #define SDIO_SLAVE_SLOT1_IOMUX_PIN_NUM_D3 13 32 | #define SDIO_SLAVE_SLOT1_FUNC 4 33 | 34 | #endif /* _SOC_SDIO_SLAVE_PINS_H_ */ 35 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32s2/soc/sdio_slave_pins.h: -------------------------------------------------------------------------------- 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 | #ifndef _SOC_SDIO_SLAVE_PINS_H_ 16 | #define _SOC_SDIO_SLAVE_PINS_H_ 17 | 18 | #define SDIO_SLAVE_SLOT0_IOMUX_PIN_NUM_CLK 12 19 | #define SDIO_SLAVE_SLOT0_IOMUX_PIN_NUM_CMD 11 20 | #define SDIO_SLAVE_SLOT0_IOMUX_PIN_NUM_D0 13 21 | #define SDIO_SLAVE_SLOT0_IOMUX_PIN_NUM_D1 14 22 | #define SDIO_SLAVE_SLOT0_IOMUX_PIN_NUM_D2 9 23 | #define SDIO_SLAVE_SLOT0_IOMUX_PIN_NUM_D3 10 24 | #define SDIO_SLAVE_SLOT0_FUNC 0 25 | 26 | #define SDIO_SLAVE_SLOT1_IOMUX_PIN_NUM_CLK 36 27 | #define SDIO_SLAVE_SLOT1_IOMUX_PIN_NUM_CMD 35 28 | #define SDIO_SLAVE_SLOT1_IOMUX_PIN_NUM_D0 37 29 | #define SDIO_SLAVE_SLOT1_IOMUX_PIN_NUM_D1 38 30 | #define SDIO_SLAVE_SLOT1_IOMUX_PIN_NUM_D2 33 31 | #define SDIO_SLAVE_SLOT1_IOMUX_PIN_NUM_D3 34 32 | #define SDIO_SLAVE_SLOT1_FUNC 3 33 | 34 | #endif /* _SOC_SDIO_SLAVE_PINS_H_ */ 35 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32/soc/bb_reg.h: -------------------------------------------------------------------------------- 1 | // Copyright 2010-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 | 15 | #ifndef _SOC_BB_REG_H_ 16 | #define _SOC_BB_REG_H_ 17 | 18 | /* Some of the baseband control registers. 19 | * PU/PD fields defined here are used in sleep related functions. 20 | */ 21 | 22 | #define BBPD_CTRL (DR_REG_BB_BASE + 0x0054) 23 | #define BB_FFT_FORCE_PU (BIT(3)) 24 | #define BB_FFT_FORCE_PU_M (BIT(3)) 25 | #define BB_FFT_FORCE_PU_V 1 26 | #define BB_FFT_FORCE_PU_S 3 27 | #define BB_FFT_FORCE_PD (BIT(2)) 28 | #define BB_FFT_FORCE_PD_M (BIT(2)) 29 | #define BB_FFT_FORCE_PD_V 1 30 | #define BB_FFT_FORCE_PD_S 2 31 | #define BB_DC_EST_FORCE_PU (BIT(1)) 32 | #define BB_DC_EST_FORCE_PU_M (BIT(1)) 33 | #define BB_DC_EST_FORCE_PU_V 1 34 | #define BB_DC_EST_FORCE_PU_S 1 35 | #define BB_DC_EST_FORCE_PD (BIT(0)) 36 | #define BB_DC_EST_FORCE_PD_M (BIT(0)) 37 | #define BB_DC_EST_FORCE_PD_V 1 38 | #define BB_DC_EST_FORCE_PD_S 0 39 | 40 | 41 | #endif /* _SOC_BB_REG_H_ */ 42 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32s2/soc/bb_reg.h: -------------------------------------------------------------------------------- 1 | // Copyright 2010-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 | 15 | #ifndef _SOC_BB_REG_H_ 16 | #define _SOC_BB_REG_H_ 17 | 18 | /* Some of the baseband control registers. 19 | * PU/PD fields defined here are used in sleep related functions. 20 | */ 21 | 22 | #define BBPD_CTRL (DR_REG_BB_BASE + 0x0054) 23 | #define BB_FFT_FORCE_PU (BIT(3)) 24 | #define BB_FFT_FORCE_PU_M (BIT(3)) 25 | #define BB_FFT_FORCE_PU_V 1 26 | #define BB_FFT_FORCE_PU_S 3 27 | #define BB_FFT_FORCE_PD (BIT(2)) 28 | #define BB_FFT_FORCE_PD_M (BIT(2)) 29 | #define BB_FFT_FORCE_PD_V 1 30 | #define BB_FFT_FORCE_PD_S 2 31 | #define BB_DC_EST_FORCE_PU (BIT(1)) 32 | #define BB_DC_EST_FORCE_PU_M (BIT(1)) 33 | #define BB_DC_EST_FORCE_PU_V 1 34 | #define BB_DC_EST_FORCE_PU_S 1 35 | #define BB_DC_EST_FORCE_PD (BIT(0)) 36 | #define BB_DC_EST_FORCE_PD_M (BIT(0)) 37 | #define BB_DC_EST_FORCE_PD_V 1 38 | #define BB_DC_EST_FORCE_PD_S 0 39 | 40 | 41 | #endif /* _SOC_BB_REG_H_ */ 42 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/stdlib_noniso.h: -------------------------------------------------------------------------------- 1 | /* 2 | stdlib_noniso.h - nonstandard (but usefull) conversion functions 3 | 4 | Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. 5 | 6 | This library is free software; you can redistribute it and/or 7 | modify it under the terms of the GNU Lesser General Public 8 | License as published by the Free Software Foundation; either 9 | version 2.1 of the License, or (at your option) any later version. 10 | 11 | This library is distributed in the hope that it will be useful, 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 | Lesser General Public License for more details. 15 | 16 | You should have received a copy of the GNU Lesser General Public 17 | License along with this library; if not, write to the Free Software 18 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | */ 20 | 21 | #ifndef STDLIB_NONISO_H 22 | #define STDLIB_NONISO_H 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | int atoi(const char *s); 29 | 30 | long atol(const char* s); 31 | 32 | double atof(const char* s); 33 | 34 | char* itoa (int val, char *s, int radix); 35 | 36 | char* ltoa (long val, char *s, int radix); 37 | 38 | char* utoa (unsigned int val, char *s, int radix); 39 | 40 | char* ultoa (unsigned long val, char *s, int radix); 41 | 42 | char* dtostrf (double val, signed char width, unsigned char prec, char *s); 43 | 44 | #ifdef __cplusplus 45 | } // extern "C" 46 | #endif 47 | 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /components/wifi-events/include/wifi-events.h: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2021 Marcel Kottmann 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or 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, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | */ 24 | 25 | #if !defined(EL_WIFI_EVENTS_H_INCLUDED) 26 | #define EL_WIFI_EVENTS_H_INCLUDED 27 | 28 | #include 29 | 30 | #define EL_WIFI_STATUS_DISCONNECTED 0 31 | #define EL_WIFI_STATUS_CONNECTED 1 32 | #define EL_WIFI_STATUS_CONNECTING 2 33 | 34 | #ifdef __cplusplus 35 | extern "C" 36 | { 37 | #endif 38 | 39 | void loadWifiEvents(duk_context *ctx); 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #endif -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/m5stack_coreink/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | #define TX2 14 15 | #define RX2 13 16 | 17 | static const uint8_t TX = 1; 18 | static const uint8_t RX = 3; 19 | 20 | static const uint8_t SDA = 32; 21 | static const uint8_t SCL = 33; 22 | 23 | static const uint8_t SS = 9; 24 | static const uint8_t MOSI = 23; 25 | static const uint8_t MISO = 34; 26 | static const uint8_t SCK = 18; 27 | 28 | static const uint8_t G26 = 26; 29 | static const uint8_t G36 = 36; 30 | static const uint8_t G25 = 25; 31 | 32 | static const uint8_t G32 = 32; 33 | static const uint8_t G33 = 33; 34 | 35 | static const uint8_t G21 = 21; 36 | static const uint8_t G22 = 22; 37 | 38 | static const uint8_t G13 = 13; 39 | static const uint8_t G14 = 14; 40 | 41 | static const uint8_t G12 = 12; 42 | static const uint8_t G19 = 19; 43 | 44 | static const uint8_t G5 = 5; 45 | static const uint8_t G10 = 10; 46 | static const uint8_t G2 = 2; 47 | static const uint8_t G37 = 37; 48 | static const uint8_t G38 = 38; 49 | static const uint8_t G39 = 39; 50 | 51 | static const uint8_t DAC1 = 25; 52 | static const uint8_t DAC2 = 26; 53 | 54 | static const uint8_t ADC1 = 35; 55 | static const uint8_t ADC2 = 36; 56 | 57 | #endif /* Pins_Arduino_h */ 58 | -------------------------------------------------------------------------------- /components/socket-events/include/socket-events.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | MIT License 4 | 5 | Copyright (c) 2021 Marcel Kottmann 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 all 15 | 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 THE 23 | SOFTWARE. 24 | */ 25 | 26 | #if !defined(EL_SOCKET_EVENTS_H_INCLUDED) 27 | #define EL_SOCKET_EVENTS_H_INCLUDED 28 | 29 | #include 30 | 31 | #define EL_SOCKET_STATUS_WRITE 0 32 | #define EL_SOCKET_STATUS_READ 1 33 | #define EL_SOCKET_STATUS_ERROR 2 34 | 35 | #ifdef __cplusplus 36 | extern "C" 37 | { 38 | #endif 39 | 40 | void loadSocketEvents(duk_context *ctx); 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | #endif -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "declaration": false, 4 | "target": "es5" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', or 'ESNEXT'. */, 5 | "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */, 6 | "noImplicitAny": true /* Raise error on expressions and declarations with an implied 'any' type. */, 7 | "strictNullChecks": true /* Enable strict null checks. */, 8 | "strictFunctionTypes": true /* Enable strict checking of function types. */, 9 | "strictBindCallApply": true /* Enable strict 'bind', 'call', and 'apply' methods on functions. */, 10 | "strictPropertyInitialization": true /* Enable strict checking of property initialization in classes. */, 11 | "noImplicitThis": true /* Raise error on 'this' expressions with an implied 'any' type. */, 12 | "noImplicitUseStrict": true, 13 | "baseUrl": "./components/" /* Base directory to resolve non-relative module names. */, 14 | "paths": { 15 | "*": [ 16 | "esp32-javascript/modules/*", 17 | "wifi-events/modules/*", 18 | "socket-events/modules/*", 19 | ] 20 | }, 21 | "noEmitOnError": true, 22 | "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */, 23 | "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */ 24 | }, 25 | "exclude": ["build"] 26 | } 27 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32/soc/fe_reg.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 | 15 | #pragma once 16 | 17 | #include "soc/soc.h" 18 | 19 | /* Some of the RF frontend control registers. 20 | * PU/PD fields defined here are used in sleep related functions. 21 | */ 22 | 23 | #define FE_GEN_CTRL (DR_REG_FE_BASE + 0x0090) 24 | #define FE_IQ_EST_FORCE_PU (BIT(5)) 25 | #define FE_IQ_EST_FORCE_PU_M (BIT(5)) 26 | #define FE_IQ_EST_FORCE_PU_V 1 27 | #define FE_IQ_EST_FORCE_PU_S 5 28 | #define FE_IQ_EST_FORCE_PD (BIT(4)) 29 | #define FE_IQ_EST_FORCE_PD_M (BIT(4)) 30 | #define FE_IQ_EST_FORCE_PD_V 1 31 | #define FE_IQ_EST_FORCE_PD_S 4 32 | 33 | #define FE2_TX_INTERP_CTRL (DR_REG_FE2_BASE + 0x00f0) 34 | #define FE2_TX_INF_FORCE_PU (BIT(10)) 35 | #define FE2_TX_INF_FORCE_PU_M (BIT(10)) 36 | #define FE2_TX_INF_FORCE_PU_V 1 37 | #define FE2_TX_INF_FORCE_PU_S 10 38 | #define FE2_TX_INF_FORCE_PD (BIT(9)) 39 | #define FE2_TX_INF_FORCE_PD_M (BIT(9)) 40 | #define FE2_TX_INF_FORCE_PD_V 1 41 | #define FE2_TX_INF_FORCE_PD_S 9 42 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32s2/soc/fe_reg.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 | 15 | #pragma once 16 | 17 | #include "soc/soc.h" 18 | 19 | /* Some of the RF frontend control registers. 20 | * PU/PD fields defined here are used in sleep related functions. 21 | */ 22 | 23 | #define FE_GEN_CTRL (DR_REG_FE_BASE + 0x0090) 24 | #define FE_IQ_EST_FORCE_PU (BIT(5)) 25 | #define FE_IQ_EST_FORCE_PU_M (BIT(5)) 26 | #define FE_IQ_EST_FORCE_PU_V 1 27 | #define FE_IQ_EST_FORCE_PU_S 5 28 | #define FE_IQ_EST_FORCE_PD (BIT(4)) 29 | #define FE_IQ_EST_FORCE_PD_M (BIT(4)) 30 | #define FE_IQ_EST_FORCE_PD_V 1 31 | #define FE_IQ_EST_FORCE_PD_S 4 32 | 33 | #define FE2_TX_INTERP_CTRL (DR_REG_FE2_BASE + 0x00f0) 34 | #define FE2_TX_INF_FORCE_PU (BIT(10)) 35 | #define FE2_TX_INF_FORCE_PU_M (BIT(10)) 36 | #define FE2_TX_INF_FORCE_PU_V 1 37 | #define FE2_TX_INF_FORCE_PU_S 10 38 | #define FE2_TX_INF_FORCE_PD (BIT(9)) 39 | #define FE2_TX_INF_FORCE_PD_M (BIT(9)) 40 | #define FE2_TX_INF_FORCE_PD_V 1 41 | #define FE2_TX_INF_FORCE_PD_S 9 42 | -------------------------------------------------------------------------------- /components/esp32-javascript/modules/esp32-javascript/self-test-firmware-config.ts: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2021 Marcel Kottmann 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or 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, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | */ 24 | import { Esp32JsConfig } from "./config"; 25 | 26 | const firmwareConfig: Esp32JsConfig = { 27 | access: { 28 | username: "esp32", 29 | password: "esp32", 30 | }, 31 | wifi: { 32 | ssid: "e2e", 33 | password: "e2epassword", 34 | }, 35 | ota: { 36 | script: `require('./self-test').run();`, 37 | offline: true, 38 | }, 39 | }; 40 | 41 | export default firmwareConfig; 42 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/esp32vn-iot-uno/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | static const uint8_t TX = 1; 15 | static const uint8_t RX = 3; 16 | 17 | static const uint8_t SDA = 21; 18 | static const uint8_t SCL = 22; 19 | 20 | static const uint8_t SS = 5; 21 | static const uint8_t MOSI = 23; 22 | static const uint8_t MISO = 19; 23 | static const uint8_t SCK = 18; 24 | 25 | static const uint8_t A0 = 36; 26 | static const uint8_t A3 = 39; 27 | static const uint8_t A6 = 34; 28 | static const uint8_t A7 = 35; 29 | static const uint8_t A10 = 4; 30 | static const uint8_t A11 = 0; 31 | static const uint8_t A12 = 2; 32 | static const uint8_t A13 = 15; 33 | static const uint8_t A14 = 13; 34 | static const uint8_t A15 = 12; 35 | static const uint8_t A16 = 14; 36 | static const uint8_t A17 = 27; 37 | static const uint8_t A18 = 25; 38 | static const uint8_t A19 = 26; 39 | 40 | static const uint8_t T0 = 4; 41 | static const uint8_t T1 = 0; 42 | static const uint8_t T2 = 2; 43 | static const uint8_t T3 = 15; 44 | static const uint8_t T4 = 13; 45 | static const uint8_t T5 = 12; 46 | static const uint8_t T6 = 14; 47 | static const uint8_t T7 = 27; 48 | 49 | 50 | static const uint8_t DAC1 = 25; 51 | static const uint8_t DAC2 = 26; 52 | 53 | #endif /* Pins_Arduino_h */ 54 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32/soc/sdmmc_pins.h: -------------------------------------------------------------------------------- 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 | #ifndef _SOC_SDMMC_PINS_H_ 16 | #define _SOC_SDMMC_PINS_H_ 17 | 18 | #define SDMMC_SLOT0_IOMUX_PIN_NUM_CLK 6 19 | #define SDMMC_SLOT0_IOMUX_PIN_NUM_CMD 11 20 | #define SDMMC_SLOT0_IOMUX_PIN_NUM_D0 7 21 | #define SDMMC_SLOT0_IOMUX_PIN_NUM_D1 8 22 | #define SDMMC_SLOT0_IOMUX_PIN_NUM_D2 9 23 | #define SDMMC_SLOT0_IOMUX_PIN_NUM_D3 10 24 | #define SDMMC_SLOT0_IOMUX_PIN_NUM_D4 16 25 | #define SDMMC_SLOT0_IOMUX_PIN_NUM_D5 17 26 | #define SDMMC_SLOT0_IOMUX_PIN_NUM_D6 5 27 | #define SDMMC_SLOT0_IOMUX_PIN_NUM_D7 18 28 | #define SDMMC_SLOT0_FUNC 0 29 | 30 | #define SDMMC_SLOT1_IOMUX_PIN_NUM_CLK 14 31 | #define SDMMC_SLOT1_IOMUX_PIN_NUM_CMD 15 32 | #define SDMMC_SLOT1_IOMUX_PIN_NUM_D0 2 33 | #define SDMMC_SLOT1_IOMUX_PIN_NUM_D1 4 34 | #define SDMMC_SLOT1_IOMUX_PIN_NUM_D2 12 35 | #define SDMMC_SLOT1_IOMUX_PIN_NUM_D3 13 36 | #define SDMMC_SLOT1_FUNC 4 37 | 38 | #endif /* _SOC_SDMMC_PINS_H_ */ 39 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/m5stack_fire/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 20 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | static const uint8_t TX = 1; 15 | static const uint8_t RX = 3; 16 | 17 | static const uint8_t SDA = 21; 18 | static const uint8_t SCL = 22; 19 | 20 | static const uint8_t SS = 5; 21 | static const uint8_t MOSI = 23; 22 | static const uint8_t MISO = 19; 23 | static const uint8_t SCK = 18; 24 | 25 | static const uint8_t G23 = 23; 26 | static const uint8_t G19 = 19; 27 | static const uint8_t G18 = 18; 28 | static const uint8_t G3 = 3; 29 | static const uint8_t G16 = 16; 30 | static const uint8_t G21 = 21; 31 | static const uint8_t G2 = 2; 32 | static const uint8_t G12 = 12; 33 | static const uint8_t G15 = 15; 34 | static const uint8_t G35 = 35; 35 | static const uint8_t G36 = 36; 36 | static const uint8_t G25 = 25; 37 | static const uint8_t G26 = 26; 38 | static const uint8_t G1 = 1; 39 | static const uint8_t G17 = 17; 40 | static const uint8_t G22 = 22; 41 | static const uint8_t G5 = 5; 42 | static const uint8_t G13 = 13; 43 | static const uint8_t G0 = 0; 44 | static const uint8_t G34 = 34; 45 | 46 | static const uint8_t DAC1 = 25; 47 | static const uint8_t DAC2 = 26; 48 | 49 | static const uint8_t ADC1 = 35; 50 | static const uint8_t ADC2 = 36; 51 | 52 | #endif /* Pins_Arduino_h */ 53 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32s2/soc/sdmmc_pins.h: -------------------------------------------------------------------------------- 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 | #ifndef _SOC_SDMMC_PINS_H_ 16 | #define _SOC_SDMMC_PINS_H_ 17 | 18 | #define SDMMC_SLOT0_IOMUX_PIN_NUM_CLK 12 19 | #define SDMMC_SLOT0_IOMUX_PIN_NUM_CMD 11 20 | #define SDMMC_SLOT0_IOMUX_PIN_NUM_D0 13 21 | #define SDMMC_SLOT0_IOMUX_PIN_NUM_D1 14 22 | #define SDMMC_SLOT0_IOMUX_PIN_NUM_D2 9 23 | #define SDMMC_SLOT0_IOMUX_PIN_NUM_D3 10 24 | #define SDMMC_SLOT0_IOMUX_PIN_NUM_D4 16 25 | #define SDMMC_SLOT0_IOMUX_PIN_NUM_D5 17 26 | #define SDMMC_SLOT0_IOMUX_PIN_NUM_D6 5 27 | #define SDMMC_SLOT0_IOMUX_PIN_NUM_D7 18 28 | #define SDMMC_SLOT0_FUNC 0 29 | 30 | #define SDMMC_SLOT1_IOMUX_PIN_NUM_CLK 36 31 | #define SDMMC_SLOT1_IOMUX_PIN_NUM_CMD 35 32 | #define SDMMC_SLOT1_IOMUX_PIN_NUM_D0 37 33 | #define SDMMC_SLOT1_IOMUX_PIN_NUM_D1 38 34 | #define SDMMC_SLOT1_IOMUX_PIN_NUM_D2 33 35 | #define SDMMC_SLOT1_IOMUX_PIN_NUM_D3 34 36 | #define SDMMC_SLOT1_FUNC 3 37 | 38 | #endif /* _SOC_SDMMC_PINS_H_ */ 39 | -------------------------------------------------------------------------------- /components/esp32-js-log/include/esp32-js-log.h: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2021 Marcel Kottmann 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or 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, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | */ 24 | 25 | #if !defined(ESP32_JS_LOG_H_INCLUDED) 26 | #define ESP32_JS_LOG_H_INCLUDED 27 | 28 | #ifdef __cplusplus 29 | extern "C" 30 | { 31 | #endif 32 | typedef enum 33 | { 34 | TRACE = 0, 35 | DEBUG, 36 | INFO, 37 | WARN, 38 | ERROR, 39 | FATAL 40 | } log_level_t; 41 | 42 | extern void jslog(log_level_t level, const char *msg, ...); 43 | 44 | #ifdef __cplusplus 45 | } // extern "C" 46 | #endif 47 | 48 | #endif -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/d32/d32_core.h: -------------------------------------------------------------------------------- 1 | #ifndef _D32_CORE_H_ 2 | #define _D32_CORE_H_ 3 | 4 | #define EXTERNAL_NUM_INTERRUPTS 16 5 | #define NUM_DIGITAL_PINS 40 6 | #define NUM_ANALOG_INPUTS 16 7 | 8 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 9 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 10 | #define digitalPinHasPWM(p) (p < 34) 11 | 12 | static const uint8_t TX = 1; 13 | static const uint8_t RX = 3; 14 | 15 | static const uint8_t SDA = 21; 16 | static const uint8_t SCL = 22; 17 | 18 | static const uint8_t SS = 5; 19 | static const uint8_t MOSI = 23; 20 | static const uint8_t MISO = 19; 21 | static const uint8_t SCK = 18; 22 | 23 | static const uint8_t A0 = 36; 24 | static const uint8_t A3 = 39; 25 | static const uint8_t A4 = 32; 26 | static const uint8_t A5 = 33; 27 | static const uint8_t A6 = 34; 28 | static const uint8_t A7 = 35; 29 | static const uint8_t A10 = 4; 30 | static const uint8_t A11 = 0; 31 | static const uint8_t A12 = 2; 32 | static const uint8_t A13 = 15; 33 | static const uint8_t A14 = 13; 34 | static const uint8_t A15 = 12; 35 | static const uint8_t A16 = 14; 36 | static const uint8_t A17 = 27; 37 | static const uint8_t A18 = 25; 38 | static const uint8_t A19 = 26; 39 | 40 | static const uint8_t T0 = 4; 41 | static const uint8_t T1 = 0; 42 | static const uint8_t T2 = 2; 43 | static const uint8_t T3 = 15; 44 | static const uint8_t T4 = 13; 45 | static const uint8_t T5 = 12; 46 | static const uint8_t T6 = 14; 47 | static const uint8_t T7 = 27; 48 | static const uint8_t T8 = 33; 49 | static const uint8_t T9 = 32; 50 | 51 | static const uint8_t DAC1 = 25; 52 | static const uint8_t DAC2 = 26; 53 | 54 | #endif -------------------------------------------------------------------------------- /docs/interfaces/_esp32_javascript_modules_esp32_javascript_config_.esp32jsconfig.md: -------------------------------------------------------------------------------- 1 | [esp32-javascript](../README.md) › ["esp32-javascript/modules/esp32-javascript/config"](../modules/_esp32_javascript_modules_esp32_javascript_config_.md) › [Esp32JsConfig](_esp32_javascript_modules_esp32_javascript_config_.esp32jsconfig.md) 2 | 3 | # Interface: Esp32JsConfig 4 | 5 | ## Hierarchy 6 | 7 | * **Esp32JsConfig** 8 | 9 | ## Index 10 | 11 | ### Properties 12 | 13 | * [access](_esp32_javascript_modules_esp32_javascript_config_.esp32jsconfig.md#access) 14 | * [ota](_esp32_javascript_modules_esp32_javascript_config_.esp32jsconfig.md#optional-ota) 15 | * [wifi](_esp32_javascript_modules_esp32_javascript_config_.esp32jsconfig.md#optional-wifi) 16 | 17 | ## Properties 18 | 19 | ### access 20 | 21 | • **access**: *object* 22 | 23 | *Defined in [esp32-javascript/modules/esp32-javascript/config.ts:26](https://github.com/marcelkottmann/esp32-javascript/blob/22ffb3d/components/esp32-javascript/modules/esp32-javascript/config.ts#L26)* 24 | 25 | #### Type declaration: 26 | 27 | * **password**: *string* 28 | 29 | * **username**: *string* 30 | 31 | ___ 32 | 33 | ### `Optional` ota 34 | 35 | • **ota**? : *undefined | object* 36 | 37 | *Defined in [esp32-javascript/modules/esp32-javascript/config.ts:35](https://github.com/marcelkottmann/esp32-javascript/blob/22ffb3d/components/esp32-javascript/modules/esp32-javascript/config.ts#L35)* 38 | 39 | ___ 40 | 41 | ### `Optional` wifi 42 | 43 | • **wifi**? : *undefined | object* 44 | 45 | *Defined in [esp32-javascript/modules/esp32-javascript/config.ts:30](https://github.com/marcelkottmann/esp32-javascript/blob/22ffb3d/components/esp32-javascript/modules/esp32-javascript/config.ts#L30)* 46 | -------------------------------------------------------------------------------- /docs/classes/_socket_events_modules_socket_events_index_.numberset.md: -------------------------------------------------------------------------------- 1 | [esp32-javascript](../README.md) › ["socket-events/modules/socket-events/index"](../modules/_socket_events_modules_socket_events_index_.md) › [NumberSet](_socket_events_modules_socket_events_index_.numberset.md) 2 | 3 | # Class: NumberSet 4 | 5 | ## Hierarchy 6 | 7 | * **NumberSet** 8 | 9 | ## Index 10 | 11 | ### Properties 12 | 13 | * [set](_socket_events_modules_socket_events_index_.numberset.md#set) 14 | 15 | ### Methods 16 | 17 | * [add](_socket_events_modules_socket_events_index_.numberset.md#add) 18 | * [remove](_socket_events_modules_socket_events_index_.numberset.md#remove) 19 | 20 | ## Properties 21 | 22 | ### set 23 | 24 | • **set**: *number[]* = [] 25 | 26 | *Defined in [socket-events/modules/socket-events/index.ts:58](https://github.com/marcelkottmann/esp32-javascript/blob/22ffb3d/components/socket-events/modules/socket-events/index.ts#L58)* 27 | 28 | ## Methods 29 | 30 | ### add 31 | 32 | ▸ **add**(`n`: number): *void* 33 | 34 | *Defined in [socket-events/modules/socket-events/index.ts:59](https://github.com/marcelkottmann/esp32-javascript/blob/22ffb3d/components/socket-events/modules/socket-events/index.ts#L59)* 35 | 36 | **Parameters:** 37 | 38 | Name | Type | 39 | ------ | ------ | 40 | `n` | number | 41 | 42 | **Returns:** *void* 43 | 44 | ___ 45 | 46 | ### remove 47 | 48 | ▸ **remove**(`n`: number): *void* 49 | 50 | *Defined in [socket-events/modules/socket-events/index.ts:64](https://github.com/marcelkottmann/esp32-javascript/blob/22ffb3d/components/socket-events/modules/socket-events/index.ts#L64)* 51 | 52 | **Parameters:** 53 | 54 | Name | Type | 55 | ------ | ------ | 56 | `n` | number | 57 | 58 | **Returns:** *void* 59 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/m5stack_core_esp32/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 20 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | static const uint8_t TX = 1; 15 | static const uint8_t RX = 3; 16 | 17 | static const uint8_t TXD2 = 17; 18 | static const uint8_t RXD2 = 16; 19 | 20 | static const uint8_t SDA = 21; 21 | static const uint8_t SCL = 22; 22 | 23 | static const uint8_t SS = 5; 24 | static const uint8_t MOSI = 23; 25 | static const uint8_t MISO = 19; 26 | static const uint8_t SCK = 18; 27 | 28 | static const uint8_t G23 = 23; 29 | static const uint8_t G19 = 19; 30 | static const uint8_t G18 = 18; 31 | static const uint8_t G3 = 3; 32 | static const uint8_t G16 = 16; 33 | static const uint8_t G21 = 21; 34 | static const uint8_t G2 = 2; 35 | static const uint8_t G12 = 12; 36 | static const uint8_t G15 = 15; 37 | static const uint8_t G35 = 35; 38 | static const uint8_t G36 = 36; 39 | static const uint8_t G25 = 25; 40 | static const uint8_t G26 = 26; 41 | static const uint8_t G1 = 1; 42 | static const uint8_t G17 = 17; 43 | static const uint8_t G22 = 22; 44 | static const uint8_t G5 = 5; 45 | static const uint8_t G13 = 13; 46 | static const uint8_t G0 = 0; 47 | static const uint8_t G34 = 34; 48 | 49 | static const uint8_t DAC1 = 25; 50 | static const uint8_t DAC2 = 26; 51 | 52 | static const uint8_t ADC1 = 35; 53 | static const uint8_t ADC2 = 36; 54 | 55 | #endif /* Pins_Arduino_h */ 56 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32/hal/mpu_ll.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Espressif Systems (Shanghai) PTE LTD 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include 16 | 17 | #include "soc/soc_caps.h" 18 | 19 | #include "xt_instr_macros.h" 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | static inline uint32_t mpu_ll_id_to_addr(int id) 26 | { 27 | // vpn - id 28 | // 0x00000000 = 0 29 | // 0x20000000 = 1 30 | // 0x40000000 = 2 31 | // 0x60000000 = 3 32 | // 0x80000000 = 4 33 | // 0xa0000000 = 5 34 | // 0xc0000000 = 6 35 | // 0xe0000000 = 7 36 | return id * SOC_MPU_MIN_REGION_SIZE; 37 | } 38 | 39 | static inline void mpu_ll_set_region_rw(uint32_t addr) 40 | { 41 | WDTLB(0x0, addr); // cached, no allocate 42 | } 43 | 44 | static inline void mpu_ll_set_region_rwx(uint32_t addr) 45 | { 46 | WDTLB(0x2, addr); // bypass cache 47 | } 48 | 49 | static inline void mpu_ll_set_region_x(uint32_t addr) 50 | { 51 | WITLB(0x3, addr); // cached 52 | } 53 | 54 | static inline void mpu_ll_set_region_illegal(uint32_t addr) 55 | { 56 | WITLB(0xF, addr); 57 | WDTLB(0xF, addr); 58 | } 59 | 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32s2/hal/mpu_ll.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Espressif Systems (Shanghai) PTE LTD 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include 16 | 17 | #include "soc/soc_caps.h" 18 | 19 | #include "xt_instr_macros.h" 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | static inline uint32_t mpu_ll_id_to_addr(int id) 26 | { 27 | // vpn - id 28 | // 0x00000000 = 0 29 | // 0x20000000 = 1 30 | // 0x40000000 = 2 31 | // 0x60000000 = 3 32 | // 0x80000000 = 4 33 | // 0xa0000000 = 5 34 | // 0xc0000000 = 6 35 | // 0xe0000000 = 7 36 | return id * SOC_MPU_MIN_REGION_SIZE; 37 | } 38 | 39 | static inline void mpu_ll_set_region_rw(uint32_t addr) 40 | { 41 | WDTLB(0x0, addr); // cached, no allocate 42 | } 43 | 44 | static inline void mpu_ll_set_region_rwx(uint32_t addr) 45 | { 46 | WDTLB(0x2, addr); // bypass cache 47 | } 48 | 49 | static inline void mpu_ll_set_region_x(uint32_t addr) 50 | { 51 | WITLB(0x3, addr); // cached 52 | } 53 | 54 | static inline void mpu_ll_set_region_illegal(uint32_t addr) 55 | { 56 | WITLB(0xF, addr); 57 | WDTLB(0xF, addr); 58 | } 59 | 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32-hal-cpu.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 | 15 | #ifndef _ESP32_HAL_CPU_H_ 16 | #define _ESP32_HAL_CPU_H_ 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | typedef enum { APB_BEFORE_CHANGE, APB_AFTER_CHANGE } apb_change_ev_t; 27 | 28 | typedef void (* apb_change_cb_t)(void * arg, apb_change_ev_t ev_type, uint32_t old_apb, uint32_t new_apb); 29 | 30 | bool addApbChangeCallback(void * arg, apb_change_cb_t cb); 31 | bool removeApbChangeCallback(void * arg, apb_change_cb_t cb); 32 | 33 | //function takes the following frequencies as valid values: 34 | // 240, 160, 80 <<< For all XTAL types 35 | // 40, 20, 10 <<< For 40MHz XTAL 36 | // 26, 13 <<< For 26MHz XTAL 37 | // 24, 12 <<< For 24MHz XTAL 38 | bool setCpuFrequencyMhz(uint32_t cpu_freq_mhz); 39 | 40 | uint32_t getCpuFrequencyMhz(); // In MHz 41 | uint32_t getXtalFrequencyMhz(); // In MHz 42 | uint32_t getApbFrequency(); // In Hz 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | 48 | #endif /* _ESP32_HAL_CPU_H_ */ 49 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/esp32/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | static const uint8_t TX = 1; 15 | static const uint8_t RX = 3; 16 | 17 | static const uint8_t SDA = 21; 18 | static const uint8_t SCL = 22; 19 | 20 | static const uint8_t SS = 5; 21 | static const uint8_t MOSI = 23; 22 | static const uint8_t MISO = 19; 23 | static const uint8_t SCK = 18; 24 | 25 | static const uint8_t A0 = 36; 26 | static const uint8_t A3 = 39; 27 | static const uint8_t A4 = 32; 28 | static const uint8_t A5 = 33; 29 | static const uint8_t A6 = 34; 30 | static const uint8_t A7 = 35; 31 | static const uint8_t A10 = 4; 32 | static const uint8_t A11 = 0; 33 | static const uint8_t A12 = 2; 34 | static const uint8_t A13 = 15; 35 | static const uint8_t A14 = 13; 36 | static const uint8_t A15 = 12; 37 | static const uint8_t A16 = 14; 38 | static const uint8_t A17 = 27; 39 | static const uint8_t A18 = 25; 40 | static const uint8_t A19 = 26; 41 | 42 | static const uint8_t T0 = 4; 43 | static const uint8_t T1 = 0; 44 | static const uint8_t T2 = 2; 45 | static const uint8_t T3 = 15; 46 | static const uint8_t T4 = 13; 47 | static const uint8_t T5 = 12; 48 | static const uint8_t T6 = 14; 49 | static const uint8_t T7 = 27; 50 | static const uint8_t T8 = 33; 51 | static const uint8_t T9 = 32; 52 | 53 | static const uint8_t DAC1 = 25; 54 | static const uint8_t DAC2 = 26; 55 | 56 | #endif /* Pins_Arduino_h */ 57 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/frog32/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | static const uint8_t TX = 1; 15 | static const uint8_t RX = 3; 16 | 17 | static const uint8_t SDA = 21; 18 | static const uint8_t SCL = 22; 19 | 20 | static const uint8_t SS = 5; 21 | static const uint8_t MOSI = 23; 22 | static const uint8_t MISO = 19; 23 | static const uint8_t SCK = 18; 24 | 25 | static const uint8_t A0 = 36; 26 | static const uint8_t A3 = 39; 27 | static const uint8_t A4 = 32; 28 | static const uint8_t A5 = 33; 29 | static const uint8_t A6 = 34; 30 | static const uint8_t A7 = 35; 31 | static const uint8_t A10 = 4; 32 | static const uint8_t A11 = 0; 33 | static const uint8_t A12 = 2; 34 | static const uint8_t A13 = 15; 35 | static const uint8_t A14 = 13; 36 | static const uint8_t A15 = 12; 37 | static const uint8_t A16 = 14; 38 | static const uint8_t A17 = 27; 39 | static const uint8_t A18 = 25; 40 | static const uint8_t A19 = 26; 41 | 42 | static const uint8_t T0 = 4; 43 | static const uint8_t T1 = 0; 44 | static const uint8_t T2 = 2; 45 | static const uint8_t T3 = 15; 46 | static const uint8_t T4 = 13; 47 | static const uint8_t T5 = 12; 48 | static const uint8_t T6 = 14; 49 | static const uint8_t T7 = 27; 50 | static const uint8_t T8 = 33; 51 | static const uint8_t T9 = 32; 52 | 53 | static const uint8_t DAC1 = 25; 54 | static const uint8_t DAC2 = 26; 55 | 56 | #endif /* Pins_Arduino_h */ 57 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/pico32/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | static const uint8_t TX = 1; 15 | static const uint8_t RX = 3; 16 | 17 | static const uint8_t SDA = 21; 18 | static const uint8_t SCL = 22; 19 | 20 | static const uint8_t SS = 5; 21 | static const uint8_t MOSI = 23; 22 | static const uint8_t MISO = 19; 23 | static const uint8_t SCK = 18; 24 | 25 | static const uint8_t A0 = 36; 26 | static const uint8_t A3 = 39; 27 | static const uint8_t A4 = 32; 28 | static const uint8_t A5 = 33; 29 | static const uint8_t A6 = 34; 30 | static const uint8_t A7 = 35; 31 | static const uint8_t A10 = 4; 32 | static const uint8_t A11 = 0; 33 | static const uint8_t A12 = 2; 34 | static const uint8_t A13 = 15; 35 | static const uint8_t A14 = 13; 36 | static const uint8_t A15 = 12; 37 | static const uint8_t A16 = 14; 38 | static const uint8_t A17 = 27; 39 | static const uint8_t A18 = 25; 40 | static const uint8_t A19 = 26; 41 | 42 | static const uint8_t T0 = 4; 43 | static const uint8_t T1 = 0; 44 | static const uint8_t T2 = 2; 45 | static const uint8_t T3 = 15; 46 | static const uint8_t T4 = 13; 47 | static const uint8_t T5 = 12; 48 | static const uint8_t T6 = 14; 49 | static const uint8_t T7 = 27; 50 | static const uint8_t T8 = 33; 51 | static const uint8_t T9 = 32; 52 | 53 | static const uint8_t DAC1 = 25; 54 | static const uint8_t DAC2 = 26; 55 | 56 | #endif /* Pins_Arduino_h */ 57 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/ET-Board/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 7 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | static const uint8_t TX = 34; 15 | static const uint8_t RX = 35; 16 | 17 | static const uint8_t SDA = 21; 18 | static const uint8_t SCL = 22; 19 | 20 | static const uint8_t SS = 29; 21 | static const uint8_t MOSI = 37; 22 | static const uint8_t MISO = 31; 23 | static const uint8_t SCK = 30; 24 | 25 | static const uint8_t A0 = 36; // BUILTIN_Potentiometer 26 | static const uint8_t A1 = 39; // BUILTIN_CDS 27 | static const uint8_t A2 = 32; // BUILTIN_temperature 28 | static const uint8_t A3 = 33; // Analog Input 29 | static const uint8_t A4 = 34; // Analog Input 30 | static const uint8_t A5 = 35; // Analog Input 31 | static const uint8_t A6 = 25; // Analog Input 32 | static const uint8_t A7 = 26; // Analog Input 33 | 34 | 35 | static const uint8_t D2 = 27; // BUILTIN_LED_Red 36 | static const uint8_t D3 = 14; // BUILTIN_LED_Blue 37 | static const uint8_t D4 = 12; // BUILTIN_LED_Green 38 | static const uint8_t D5 = 13; // BUILTIN_LED_Yellow 39 | static const uint8_t D6 = 15; // BUILTIN_BUTTON_Red 40 | static const uint8_t D7 = 16; // BUILTIN_BUTTON_Blue 41 | static const uint8_t D8 = 17; // BUILTIN_BUTTON_Green 42 | static const uint8_t D9 = 4; // BUILTIN_BUTTON_Yellow 43 | 44 | static const uint8_t DAC1 = 25; 45 | static const uint8_t DAC2 = 26; 46 | 47 | #endif /* Pins_Arduino_h */ -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/quantum/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | static const uint8_t TX = 1; 15 | static const uint8_t RX = 3; 16 | 17 | static const uint8_t SDA = 21; 18 | static const uint8_t SCL = 22; 19 | 20 | static const uint8_t SS = 5; 21 | static const uint8_t MOSI = 23; 22 | static const uint8_t MISO = 19; 23 | static const uint8_t SCK = 18; 24 | 25 | static const uint8_t A0 = 36; 26 | static const uint8_t A3 = 39; 27 | static const uint8_t A4 = 32; 28 | static const uint8_t A5 = 33; 29 | static const uint8_t A6 = 34; 30 | static const uint8_t A7 = 35; 31 | static const uint8_t A10 = 4; 32 | static const uint8_t A11 = 0; 33 | static const uint8_t A12 = 2; 34 | static const uint8_t A13 = 15; 35 | static const uint8_t A14 = 13; 36 | static const uint8_t A15 = 12; 37 | static const uint8_t A16 = 14; 38 | static const uint8_t A17 = 27; 39 | static const uint8_t A18 = 25; 40 | static const uint8_t A19 = 26; 41 | 42 | static const uint8_t T0 = 4; 43 | static const uint8_t T1 = 0; 44 | static const uint8_t T2 = 2; 45 | static const uint8_t T3 = 15; 46 | static const uint8_t T4 = 13; 47 | static const uint8_t T5 = 12; 48 | static const uint8_t T6 = 14; 49 | static const uint8_t T7 = 27; 50 | static const uint8_t T8 = 33; 51 | static const uint8_t T9 = 32; 52 | 53 | static const uint8_t DAC1 = 25; 54 | static const uint8_t DAC2 = 26; 55 | 56 | #endif /* Pins_Arduino_h */ 57 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32-hal-ledc.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 | 15 | #ifndef _ESP32_HAL_LEDC_H_ 16 | #define _ESP32_HAL_LEDC_H_ 17 | 18 | #ifdef __cplusplus 19 | extern "C" { 20 | #endif 21 | 22 | #include 23 | #include 24 | 25 | typedef enum { 26 | NOTE_C, NOTE_Cs, NOTE_D, NOTE_Eb, NOTE_E, NOTE_F, NOTE_Fs, NOTE_G, NOTE_Gs, NOTE_A, NOTE_Bb, NOTE_B, NOTE_MAX 27 | } note_t; 28 | 29 | //channel 0-15 resolution 1-16bits freq limits depend on resolution 30 | double ledcSetup(uint8_t channel, double freq, uint8_t resolution_bits); 31 | void ledcWrite(uint8_t channel, uint32_t duty); 32 | double ledcWriteTone(uint8_t channel, double freq); 33 | double ledcWriteNote(uint8_t channel, note_t note, uint8_t octave); 34 | uint32_t ledcRead(uint8_t channel); 35 | double ledcReadFreq(uint8_t channel); 36 | void ledcAttachPin(uint8_t pin, uint8_t channel); 37 | void ledcDetachPin(uint8_t pin); 38 | double ledcChangeFrequency(uint8_t channel, double freq, uint8_t resolution_bits); 39 | 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #endif /* _ESP32_HAL_LEDC_H_ */ 46 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/m5stack_timer_cam/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | static const uint8_t LED_BUILTIN = 2; 15 | #define BUILTIN_LED LED_BUILTIN // backward compatibility 16 | 17 | static const uint8_t TX = 1; 18 | static const uint8_t RX = 3; 19 | 20 | static const uint8_t SDA = 4; 21 | static const uint8_t SCL = 13; 22 | 23 | static const uint8_t SS = 5; 24 | static const uint8_t MOSI = 23; 25 | static const uint8_t MISO = 19; 26 | static const uint8_t SCK = 18; 27 | 28 | static const uint8_t G23 = 23; 29 | static const uint8_t G25 = 25; 30 | static const uint8_t G27 = 27; 31 | static const uint8_t G22 = 22; 32 | static const uint8_t G26 = 26; 33 | static const uint8_t G21 = 21; 34 | static const uint8_t G32 = 32; 35 | static const uint8_t G35 = 35; 36 | static const uint8_t G34 = 34; 37 | static const uint8_t G5 = 5; 38 | static const uint8_t G39 = 39; 39 | static const uint8_t G18 = 18; 40 | static const uint8_t G36 = 36; 41 | static const uint8_t G19 = 19; 42 | static const uint8_t G15 = 15; 43 | 44 | static const uint8_t G2 = 2; 45 | static const uint8_t G33 = 33; 46 | 47 | static const uint8_t G13 = 13; 48 | static const uint8_t G4 = 4; 49 | 50 | static const uint8_t G0 = 0; 51 | 52 | static const uint8_t DAC1 = 25; 53 | static const uint8_t DAC2 = 26; 54 | 55 | static const uint8_t ADC1 = 35; 56 | static const uint8_t ADC2 = 36; 57 | 58 | #endif /* Pins_Arduino_h */ 59 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/Client.h: -------------------------------------------------------------------------------- 1 | /* 2 | Client.h - Base class that provides Client 3 | Copyright (c) 2011 Adrian McEwen. All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef client_h 21 | #define client_h 22 | #include "Print.h" 23 | #include "Stream.h" 24 | #include "IPAddress.h" 25 | 26 | class Client: public Stream 27 | { 28 | public: 29 | virtual int connect(IPAddress ip, uint16_t port) =0; 30 | virtual int connect(const char *host, uint16_t port) =0; 31 | virtual size_t write(uint8_t) =0; 32 | virtual size_t write(const uint8_t *buf, size_t size) =0; 33 | virtual int available() = 0; 34 | virtual int read() = 0; 35 | virtual int read(uint8_t *buf, size_t size) = 0; 36 | virtual int peek() = 0; 37 | virtual void flush() = 0; 38 | virtual void stop() = 0; 39 | virtual uint8_t connected() = 0; 40 | virtual operator bool() = 0; 41 | protected: 42 | uint8_t* rawIPAddress(IPAddress& addr) 43 | { 44 | return addr.raw_address(); 45 | } 46 | }; 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp_arduino_version.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Espressif Systems (Shanghai) PTE LTD 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #pragma once 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | /** Major version number (X.x.x) */ 22 | #define ESP_ARDUINO_VERSION_MAJOR 2 23 | /** Minor version number (x.X.x) */ 24 | #define ESP_ARDUINO_VERSION_MINOR 0 25 | /** Patch version number (x.x.X) */ 26 | #define ESP_ARDUINO_VERSION_PATCH 0 27 | 28 | /** 29 | * Macro to convert ARDUINO version number into an integer 30 | * 31 | * To be used in comparisons, such as ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(2, 0, 0) 32 | */ 33 | #define ESP_ARDUINO_VERSION_VAL(major, minor, patch) ((major << 16) | (minor << 8) | (patch)) 34 | 35 | /** 36 | * Current ARDUINO version, as an integer 37 | * 38 | * To be used in comparisons, such as ESP_ARDUINO_VERSION >= ESP_ARDUINO_VERSION_VAL(2, 0, 0) 39 | */ 40 | #define ESP_ARDUINO_VERSION ESP_ARDUINO_VERSION_VAL(ESP_ARDUINO_VERSION_MAJOR, \ 41 | ESP_ARDUINO_VERSION_MINOR, \ 42 | ESP_ARDUINO_VERSION_PATCH) 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32s2/soc/spi_pins.h: -------------------------------------------------------------------------------- 1 | // Copyright 2015-2019 Espressif Systems (Shanghai) PTE LTD 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #pragma once 16 | 17 | #define SPI_FUNC_NUM 0 18 | #define SPI_IOMUX_PIN_NUM_HD 27 19 | #define SPI_IOMUX_PIN_NUM_CS 29 20 | #define SPI_IOMUX_PIN_NUM_MOSI 32 21 | #define SPI_IOMUX_PIN_NUM_CLK 30 22 | #define SPI_IOMUX_PIN_NUM_MISO 31 23 | #define SPI_IOMUX_PIN_NUM_WP 28 24 | 25 | #define SPI2_FUNC_NUM FSPI_FUNC_NUM 26 | #define SPI2_IOMUX_PIN_NUM_HD FSPI_IOMUX_PIN_NUM_HD 27 | #define SPI2_IOMUX_PIN_NUM_CS FSPI_IOMUX_PIN_NUM_CS 28 | #define SPI2_IOMUX_PIN_NUM_MOSI FSPI_IOMUX_PIN_NUM_MOSI 29 | #define SPI2_IOMUX_PIN_NUM_CLK FSPI_IOMUX_PIN_NUM_CLK 30 | #define SPI2_IOMUX_PIN_NUM_MISO FSPI_IOMUX_PIN_NUM_MISO 31 | #define SPI2_IOMUX_PIN_NUM_WP FSPI_IOMUX_PIN_NUM_WP 32 | 33 | //SPI3 has no iomux pins 34 | 35 | //Following Macros are deprecated. Please use the Macros above 36 | #define FSPI_FUNC_NUM 4 37 | #define FSPI_IOMUX_PIN_NUM_HD 9 38 | #define FSPI_IOMUX_PIN_NUM_CS 10 39 | #define FSPI_IOMUX_PIN_NUM_MOSI 11 40 | #define FSPI_IOMUX_PIN_NUM_CLK 12 41 | #define FSPI_IOMUX_PIN_NUM_MISO 13 42 | #define FSPI_IOMUX_PIN_NUM_WP 14 43 | -------------------------------------------------------------------------------- /components/socket-events/prvtkey.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN RSA PRIVATE KEY----- 2 | MIIEpAIBAAKCAQEAsONI8OWiZ6kcLNvDgxSuq5ABTTFNXj82lvbuT0jlNFVOMig6 3 | z/mE0jYs8VZ7gJETHT1mtPwrc0U4GhLLtuE8CyMZoXEJhhZz22JfWbmCrdOhVFKZ 4 | tnrl8TeS+cjwT93lXLMDQ4yZZt9qiUFJMyhaCpHKcRpP7PUSHbINPNUXL16i/UN1 5 | AVSoYOpsfltBi9NjkXJ6btRwpYB7bJLSPcfh1W1UEo1jupXc/HTzIYCzl9AWBTCH 6 | IHn6rCG+R4sl2BqkZpJPAuChApYdt7+UDc2IEgH2HOcVQYqjeGaeIC9hlutByfe1 7 | zSX8ngjf2/Y+bb0UDKNa9DIGQaS3Parh6U5liQIDAQABAoIBAB9K9jp3xXVlO3DM 8 | KBhmbkg3n6NSV4eW00d9w8cO9E1/0eeZql3knJS7tNO1IwApqiIAHM1j1yP7WONz 9 | 88oUqpSlzwD6iF7KVhC3pHqxEOdDi0Tpn/viXg+Ab2X1IF5guRTfLnKiyviiCazi 10 | edqtBtDb3d6Icx9Oc7gBKcpbQFDGt++wSOb5L+xhRm9B5B4l/6byikiPeKqIK5tC 11 | SoP9Zr1mvpNoGm1P4LvEunFJcRBqVI010VNwfO9P98oVyzJu9/FZZrQxXoY9JdXF 12 | OM6nbl+hMDM3TkEOda9NvBhImozEAvuc97CaaXyR3XivxMqNqNIb4+syUPa2PCS3 13 | ZztI5qECgYEA1gbVG6ifpvpbBkDPi3Im8fM3F7FLLrQc48FdFjdMvDhHD9lVKucD 14 | Uaa8PF9dbbvlu2cwMyfBOKSuWaXxRxRsiqiPmTunS1MvPzQcSrGwUrL2AogGucn6 15 | +NrLQf5P4H5IpkDQ9ih3zwjO6xKFK1WeYnYpHM8qUBtl6q0YFyVBPu0CgYEA05Pn 16 | StWA4D7VSbNnVi6lvFyEOUsTrK3v419598TFiq4eXLq6aV8/CQYzKsSzoG+aOZhX 17 | Li+0uyT5cNzUcXYhTsW1hA/pNhMfxMrYiB1x14zlLp2WRGg4vd/+SxX6d9Yd3acX 18 | 7QzPKgdDicXs9QN8ozJOICKvNbUI53AJdATVEY0CgYEAwvpGeoQLrdq1weSZLrg3 19 | soOX1QW3MDz1dKdbXjnStkWut0mOxR7fbysuoPFf8/ARQcCnsHKvHCMqkpESVWbN 20 | 2yPkbfxiU8Tcbf/TJljqAOz4ISY6ula/RKZONTixHBrvpEW4GAiV3Q5xMsYUe33s 21 | ZFaw7YXtTj0ng7tdDvjpj6ECgYEApHdUU9ejVq2BHslWiqe4LbO9FMxHfvO2hgix 22 | xugupp6y+2Irhb2EQn+PRq+g8hXOzPaezkhHNTKItDL08T3iplkJwJ6dqmszRsZn 23 | i2dYFzZu8M2PAZ4CfZahFbz/9id7D9HTx3EtmH4NAgvZJpyPRkzUbiaIDDettDpj 24 | Hsyi1AECgYAPLvjBzQj4kPF8Zo9pQEUcz4pmupRVfv3aRfjnahDK4qZHEePDRj+J 25 | W7pzayrs1dyN9QLB8pTc424z7f8MB3llCICN+ohs8CR/eW0NEobE9ldDOeoCr1Vh 26 | NhNSbrN1iZ8U4oLkRTMaDKkVngGffvjGi/q0tOU7hJdZOqNlk2Iahg== 27 | -----END RSA PRIVATE KEY----- 28 | -------------------------------------------------------------------------------- /components/arduino-esp32/libb64/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright-Only Dedication (based on United States law) 2 | or Public Domain Certification 3 | 4 | The person or persons who have associated work with this document (the 5 | "Dedicator" or "Certifier") hereby either (a) certifies that, to the best of 6 | his knowledge, the work of authorship identified is in the public domain of the 7 | country from which the work is published, or (b) hereby dedicates whatever 8 | copyright the dedicators holds in the work of authorship identified below (the 9 | "Work") to the public domain. A certifier, moreover, dedicates any copyright 10 | interest he may have in the associated work, and for these purposes, is 11 | described as a "dedicator" below. 12 | 13 | A certifier has taken reasonable steps to verify the copyright status of this 14 | work. Certifier recognizes that his good faith efforts may not shield him from 15 | liability if in fact the work certified is not in the public domain. 16 | 17 | Dedicator makes this dedication for the benefit of the public at large and to 18 | the detriment of the Dedicator's heirs and successors. Dedicator intends this 19 | dedication to be an overt act of relinquishment in perpetuity of all present 20 | and future rights under copyright law, whether vested or contingent, in the 21 | Work. Dedicator understands that such relinquishment of all rights includes 22 | the relinquishment of all rights to enforce (by lawsuit or otherwise) those 23 | copyrights in the Work. 24 | 25 | Dedicator recognizes that, once placed in the public domain, the Work may be 26 | freely reproduced, distributed, transmitted, used, modified, built upon, or 27 | otherwise exploited by anyone for any purpose, commercial or non-commercial, 28 | and in any way, including by methods that have not yet been invented or 29 | conceived. -------------------------------------------------------------------------------- /components/esp32-javascript/libb64/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright-Only Dedication (based on United States law) 2 | or Public Domain Certification 3 | 4 | The person or persons who have associated work with this document (the 5 | "Dedicator" or "Certifier") hereby either (a) certifies that, to the best of 6 | his knowledge, the work of authorship identified is in the public domain of the 7 | country from which the work is published, or (b) hereby dedicates whatever 8 | copyright the dedicators holds in the work of authorship identified below (the 9 | "Work") to the public domain. A certifier, moreover, dedicates any copyright 10 | interest he may have in the associated work, and for these purposes, is 11 | described as a "dedicator" below. 12 | 13 | A certifier has taken reasonable steps to verify the copyright status of this 14 | work. Certifier recognizes that his good faith efforts may not shield him from 15 | liability if in fact the work certified is not in the public domain. 16 | 17 | Dedicator makes this dedication for the benefit of the public at large and to 18 | the detriment of the Dedicator's heirs and successors. Dedicator intends this 19 | dedication to be an overt act of relinquishment in perpetuity of all present 20 | and future rights under copyright law, whether vested or contingent, in the 21 | Work. Dedicator understands that such relinquishment of all rights includes 22 | the relinquishment of all rights to enforce (by lawsuit or otherwise) those 23 | copyrights in the Work. 24 | 25 | Dedicator recognizes that, once placed in the public domain, the Work may be 26 | freely reproduced, distributed, transmitted, used, modified, built upon, or 27 | otherwise exploited by anyone for any purpose, commercial or non-commercial, 28 | and in any way, including by methods that have not yet been invented or 29 | conceived. -------------------------------------------------------------------------------- /docs/interfaces/_socket_events_modules_socket_events_index_.bufferentry.md: -------------------------------------------------------------------------------- 1 | [esp32-javascript](../README.md) › ["socket-events/modules/socket-events/index"](../modules/_socket_events_modules_socket_events_index_.md) › [BufferEntry](_socket_events_modules_socket_events_index_.bufferentry.md) 2 | 3 | # Interface: BufferEntry 4 | 5 | ## Hierarchy 6 | 7 | * **BufferEntry** 8 | 9 | ## Index 10 | 11 | ### Properties 12 | 13 | * [cb](_socket_events_modules_socket_events_index_.bufferentry.md#optional-cb) 14 | * [data](_socket_events_modules_socket_events_index_.bufferentry.md#data) 15 | * [len](_socket_events_modules_socket_events_index_.bufferentry.md#len) 16 | * [written](_socket_events_modules_socket_events_index_.bufferentry.md#written) 17 | 18 | ## Properties 19 | 20 | ### `Optional` cb 21 | 22 | • **cb**? : *undefined | function* 23 | 24 | *Defined in [socket-events/modules/socket-events/index.ts:162](https://github.com/marcelkottmann/esp32-javascript/blob/22ffb3d/components/socket-events/modules/socket-events/index.ts#L162)* 25 | 26 | ___ 27 | 28 | ### data 29 | 30 | • **data**: *Uint8Array* 31 | 32 | *Defined in [socket-events/modules/socket-events/index.ts:160](https://github.com/marcelkottmann/esp32-javascript/blob/22ffb3d/components/socket-events/modules/socket-events/index.ts#L160)* 33 | 34 | ___ 35 | 36 | ### len 37 | 38 | • **len**: *number* 39 | 40 | *Defined in [socket-events/modules/socket-events/index.ts:161](https://github.com/marcelkottmann/esp32-javascript/blob/22ffb3d/components/socket-events/modules/socket-events/index.ts#L161)* 41 | 42 | ___ 43 | 44 | ### written 45 | 46 | • **written**: *number* 47 | 48 | *Defined in [socket-events/modules/socket-events/index.ts:159](https://github.com/marcelkottmann/esp32-javascript/blob/22ffb3d/components/socket-events/modules/socket-events/index.ts#L159)* 49 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32/soc/gpio_sd_struct.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 _SOC_GPIO_SD_STRUCT_H_ 15 | #define _SOC_GPIO_SD_STRUCT_H_ 16 | 17 | #include 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | typedef volatile struct gpio_sd_dev_s { 24 | union { 25 | struct { 26 | uint32_t duty: 8; 27 | uint32_t prescale: 8; 28 | uint32_t reserved16: 16; 29 | }; 30 | uint32_t val; 31 | } channel[8]; 32 | union { 33 | struct { 34 | uint32_t reserved0: 31; 35 | uint32_t clk_en: 1; 36 | }; 37 | uint32_t val; 38 | } cg; 39 | union { 40 | struct { 41 | uint32_t reserved0: 31; 42 | uint32_t spi_swap: 1; 43 | }; 44 | uint32_t val; 45 | } misc; 46 | union { 47 | struct { 48 | uint32_t date: 28; 49 | uint32_t reserved28: 4; 50 | }; 51 | uint32_t val; 52 | } version; 53 | } gpio_sd_dev_t; 54 | extern gpio_sd_dev_t SIGMADELTA; 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif /* _SOC_GPIO_SD_STRUCT_H_ */ 61 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32s2/soc/gpio_sd_struct.h: -------------------------------------------------------------------------------- 1 | // Copyright 2017-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 | #ifndef _SOC_GPIO_SD_STRUCT_H_ 15 | #define _SOC_GPIO_SD_STRUCT_H_ 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | typedef volatile struct { 21 | union { 22 | struct { 23 | uint32_t duty: 8; 24 | uint32_t prescale: 8; 25 | uint32_t reserved16: 16; 26 | }; 27 | uint32_t val; 28 | } channel[8]; 29 | union { 30 | struct { 31 | uint32_t reserved0: 31; 32 | uint32_t clk_en: 1; 33 | }; 34 | uint32_t val; 35 | } cg; 36 | union { 37 | struct { 38 | uint32_t reserved0: 30; 39 | uint32_t function_clk_en: 1; 40 | uint32_t spi_swap: 1; 41 | }; 42 | uint32_t val; 43 | } misc; 44 | union { 45 | struct { 46 | uint32_t date: 28; 47 | uint32_t reserved28: 4; 48 | }; 49 | uint32_t val; 50 | } version; 51 | } gpio_sd_dev_t; 52 | extern gpio_sd_dev_t SIGMADELTA; 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif /* _SOC_GPIO_SD_STRUCT_H_ */ 58 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/m5stack_core2/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 20 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | #define TX2 14 15 | #define RX2 13 16 | 17 | static const uint8_t TX = 1; 18 | static const uint8_t RX = 3; 19 | 20 | static const uint8_t SDA = 32; 21 | static const uint8_t SCL = 33; 22 | 23 | static const uint8_t SS = 5; 24 | static const uint8_t MOSI = 23; 25 | static const uint8_t MISO = 38; 26 | static const uint8_t SCK = 18; 27 | 28 | static const uint8_t G23 = 23; 29 | static const uint8_t G38 = 38; 30 | static const uint8_t G18 = 18; 31 | static const uint8_t G3 = 3; 32 | static const uint8_t G13 = 13; 33 | static const uint8_t G21 = 21; 34 | static const uint8_t G32 = 32; 35 | static const uint8_t G27 = 27; 36 | static const uint8_t G2 = 2; 37 | static const uint8_t G35 = 35; 38 | static const uint8_t G36 = 36; 39 | static const uint8_t G25 = 25; 40 | static const uint8_t G26 = 26; 41 | static const uint8_t G1 = 1; 42 | static const uint8_t G14 = 14; 43 | static const uint8_t G22 = 22; 44 | static const uint8_t G33 = 33; 45 | static const uint8_t G19 = 19; 46 | static const uint8_t G0 = 0; 47 | static const uint8_t G34 = 34; 48 | 49 | static const uint8_t G12 = 12; 50 | static const uint8_t G15 = 15; 51 | static const uint8_t G17 = 17; 52 | static const uint8_t G5 = 5; 53 | 54 | static const uint8_t DAC1 = 25; 55 | static const uint8_t DAC2 = 26; 56 | 57 | static const uint8_t ADC1 = 35; 58 | static const uint8_t ADC2 = 36; 59 | 60 | #endif /* Pins_Arduino_h */ 61 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32/soc/touch_sensor_channel.h: -------------------------------------------------------------------------------- 1 | // Copyright 2019 Espressif Systems (Shanghai) PTE LTD 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #ifndef _SOC_TOUCH_CHANNEL_H 16 | #define _SOC_TOUCH_CHANNEL_H 17 | 18 | //Touch channels 19 | #define TOUCH_PAD_GPIO4_CHANNEL TOUCH_PAD_NUM0 20 | #define TOUCH_PAD_NUM0_GPIO_NUM 4 21 | 22 | #define TOUCH_PAD_GPIO0_CHANNEL TOUCH_PAD_NUM1 23 | #define TOUCH_PAD_NUM1_GPIO_NUM 0 24 | 25 | #define TOUCH_PAD_GPIO2_CHANNEL TOUCH_PAD_NUM2 26 | #define TOUCH_PAD_NUM2_GPIO_NUM 2 27 | 28 | #define TOUCH_PAD_GPIO15_CHANNEL TOUCH_PAD_NUM3 29 | #define TOUCH_PAD_NUM3_GPIO_NUM 15 30 | 31 | #define TOUCH_PAD_GPIO13_CHANNEL TOUCH_PAD_NUM4 32 | #define TOUCH_PAD_NUM4_GPIO_NUM 13 33 | 34 | #define TOUCH_PAD_GPIO12_CHANNEL TOUCH_PAD_NUM5 35 | #define TOUCH_PAD_NUM5_GPIO_NUM 12 36 | 37 | #define TOUCH_PAD_GPIO14_CHANNEL TOUCH_PAD_NUM6 38 | #define TOUCH_PAD_NUM6_GPIO_NUM 14 39 | 40 | #define TOUCH_PAD_GPIO27_CHANNEL TOUCH_PAD_NUM7 41 | #define TOUCH_PAD_NUM7_GPIO_NUM 27 42 | 43 | #define TOUCH_PAD_GPIO33_CHANNEL TOUCH_PAD_NUM8 44 | #define TOUCH_PAD_NUM8_GPIO_NUM 33 45 | 46 | #define TOUCH_PAD_GPIO32_CHANNEL TOUCH_PAD_NUM9 47 | #define TOUCH_PAD_NUM9_GPIO_NUM 32 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/bpi-bit/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p) < 20) ? (esp32_adc2gpio[(p)]) : -1) 11 | #define digitalPinToInterrupt(p) (((p) < 40) ? (p) : -1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | static const uint8_t BUZZER = 25; 15 | 16 | static const uint8_t BUTTON_A = 35; 17 | static const uint8_t BUTTON_B = 27; 18 | 19 | static const uint8_t RGB_LED = 4; 20 | 21 | static const uint8_t LIGHT_SENSOR1 = 36; 22 | static const uint8_t LIGHT_SENSOR2 = 39; 23 | 24 | static const uint8_t TEMPERATURE_SENSOR = 34; 25 | 26 | static const uint8_t MPU9250_INT = 0; 27 | 28 | static const uint8_t TX = 1; 29 | static const uint8_t RX = 3; 30 | 31 | static const uint8_t SDA = 21; 32 | static const uint8_t SCL = 22; 33 | 34 | static const uint8_t SS = 5; 35 | static const uint8_t MOSI = 23; 36 | static const uint8_t MISO = 19; 37 | static const uint8_t SCK = 18; 38 | 39 | static const uint8_t P0 = 25; 40 | static const uint8_t P1 = 32; 41 | static const uint8_t P2 = 33; 42 | static const uint8_t P3 = 13; 43 | static const uint8_t P4 = 15; 44 | static const uint8_t P5 = 35; 45 | static const uint8_t P6 = 12; 46 | static const uint8_t P7 = 14; 47 | static const uint8_t P8 = 16; 48 | static const uint8_t P9 = 17; 49 | static const uint8_t P10 = 26; 50 | static const uint8_t P11 = 27; 51 | static const uint8_t P12 = 2; 52 | static const uint8_t P13 = 18; 53 | static const uint8_t P14 = 19; 54 | static const uint8_t P15 = 23; 55 | static const uint8_t P16 = 5; 56 | static const uint8_t P19 = 22; 57 | static const uint8_t P20 = 21; 58 | 59 | static const uint8_t DAC1 = 25; 60 | static const uint8_t DAC2 = 26; 61 | 62 | #endif /* Pins_Arduino_h */ 63 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/lolin32-lite/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | static const uint8_t TX = 1; 15 | static const uint8_t RX = 3; 16 | 17 | static const uint8_t LED_BUILTIN = 22; 18 | #define BUILTIN_LED LED_BUILTIN // backward compatibility 19 | 20 | static const uint8_t SDA = 19; 21 | static const uint8_t SCL = 23; 22 | 23 | static const uint8_t SS = 5; 24 | static const uint8_t MOSI = 23; 25 | static const uint8_t MISO = 19; 26 | static const uint8_t SCK = 18; 27 | 28 | static const uint8_t A0 = 36; 29 | static const uint8_t A3 = 39; 30 | static const uint8_t A4 = 32; 31 | static const uint8_t A5 = 33; 32 | static const uint8_t A6 = 34; 33 | static const uint8_t A7 = 35; 34 | static const uint8_t A10 = 4; 35 | static const uint8_t A11 = 0; 36 | static const uint8_t A12 = 2; 37 | static const uint8_t A13 = 15; 38 | static const uint8_t A14 = 13; 39 | static const uint8_t A15 = 12; 40 | static const uint8_t A16 = 14; 41 | static const uint8_t A17 = 27; 42 | static const uint8_t A18 = 25; 43 | static const uint8_t A19 = 26; 44 | 45 | static const uint8_t T0 = 4; 46 | static const uint8_t T1 = 0; 47 | static const uint8_t T2 = 2; 48 | static const uint8_t T3 = 15; 49 | static const uint8_t T4 = 13; 50 | static const uint8_t T5 = 12; 51 | static const uint8_t T6 = 14; 52 | static const uint8_t T7 = 27; 53 | static const uint8_t T8 = 33; 54 | static const uint8_t T9 = 32; 55 | 56 | static const uint8_t DAC1 = 25; 57 | static const uint8_t DAC2 = 26; 58 | 59 | #endif /* Pins_Arduino_h */ 60 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/esp32/hal/rtc_cntl_ll.h: -------------------------------------------------------------------------------- 1 | // Copyright 2020 Espressif Systems (Shanghai) PTE LTD 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #pragma once 16 | 17 | #include "soc/soc.h" 18 | #include "soc/rtc.h" 19 | 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | static inline void rtc_cntl_ll_set_wakeup_timer(uint64_t t) 26 | { 27 | WRITE_PERI_REG(RTC_CNTL_SLP_TIMER0_REG, t & UINT32_MAX); 28 | WRITE_PERI_REG(RTC_CNTL_SLP_TIMER1_REG, t >> 32); 29 | } 30 | 31 | static inline void rtc_cntl_ll_ext1_clear_wakeup_pins(void) 32 | { 33 | REG_SET_BIT(RTC_CNTL_EXT_WAKEUP1_REG, RTC_CNTL_EXT_WAKEUP1_STATUS_CLR); 34 | } 35 | 36 | static inline uint32_t rtc_cntl_ll_ext1_get_wakeup_pins(void) 37 | { 38 | return REG_GET_FIELD(RTC_CNTL_EXT_WAKEUP1_STATUS_REG, RTC_CNTL_EXT_WAKEUP1_STATUS); 39 | } 40 | 41 | static inline void rtc_cntl_ll_ext1_set_wakeup_pins(uint32_t mask, int mode) 42 | { 43 | REG_SET_FIELD(RTC_CNTL_EXT_WAKEUP1_REG, RTC_CNTL_EXT_WAKEUP1_SEL, mask); 44 | SET_PERI_REG_BITS(RTC_CNTL_EXT_WAKEUP_CONF_REG, 0x1, 45 | mode, RTC_CNTL_EXT_WAKEUP1_LV_S); 46 | } 47 | 48 | static inline void rtc_cntl_ll_ulp_wakeup_enable(void) 49 | { 50 | SET_PERI_REG_MASK(RTC_CNTL_STATE0_REG, RTC_CNTL_ULP_CP_WAKEUP_FORCE_EN); 51 | } 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/fm-devkit/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | static const uint8_t TX = 1; 15 | static const uint8_t RX = 3; 16 | 17 | // IO 18 | static const uint8_t LED_BUILTIN = 5; 19 | static const uint8_t SW1 = 4; 20 | static const uint8_t SW2 = 18; 21 | static const uint8_t SW3 = 19; 22 | static const uint8_t SW4 = 21; 23 | 24 | //I2S DAC 25 | static const uint8_t I2S_MCLK = 2; // CLOCK must be an integer multiplier of SCLK 26 | static const uint8_t I2S_LRCLK = 25; // LRCLK 27 | static const uint8_t I2S_SCLK = 26; // SCLK - Fs (44100 Hz) 28 | static const uint8_t I2S_DOUT = 22; // DATA 29 | 30 | //GPIO 31 | static const uint8_t D0 = 34; // GPI - Input Only 32 | static const uint8_t D1 = 35; // GPI - Input Only 33 | static const uint8_t D2 = 32; // GPO - Output Only 34 | static const uint8_t D3 = 33; // GPO - Output Only 35 | static const uint8_t D4 = 27; 36 | static const uint8_t D5 = 14; 37 | static const uint8_t D6 = 12; 38 | static const uint8_t D7 = 13; 39 | static const uint8_t D8 = 15; 40 | static const uint8_t D9 = 23; 41 | static const uint8_t D10 = 0; 42 | 43 | // I2C BUS, 2k2 hardware pull-ups 44 | static const uint8_t SDA = 16; 45 | static const uint8_t SCL = 17; 46 | 47 | // SPI - unused but you can create your own definition in your sketch 48 | static const int8_t SCK = -1; 49 | static const int8_t MISO = -1; 50 | static const int8_t MOSI = -1; 51 | static const int8_t SS = -1; 52 | 53 | #endif /* Pins_Arduino_h */ 54 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/oroca_edubot/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | static const uint8_t LED_BUILTIN = 13; 15 | #define BUILTIN_LED LED_BUILTIN // backward compatibility 16 | #define LED_BUILTIN LED_BUILTIN 17 | 18 | static const uint8_t TX = 17; 19 | static const uint8_t RX = 16; 20 | 21 | static const uint8_t SDA = 23; 22 | static const uint8_t SCL = 22; 23 | 24 | static const uint8_t SS = 2; 25 | static const uint8_t MOSI = 18; 26 | static const uint8_t MISO = 19; 27 | static const uint8_t SCK = 5; 28 | 29 | 30 | static const uint8_t A0 = 34; 31 | static const uint8_t A1 = 39; 32 | static const uint8_t A2 = 36; 33 | static const uint8_t A3 = 33; 34 | 35 | static const uint8_t D0 = 4; 36 | static const uint8_t D1 = 16; 37 | static const uint8_t D2 = 17; 38 | static const uint8_t D3 = 22; 39 | static const uint8_t D4 = 23; 40 | static const uint8_t D5 = 5; 41 | static const uint8_t D6 = 18; 42 | static const uint8_t D7 = 19; 43 | static const uint8_t D8 = 33; 44 | 45 | // vbat measure 46 | static const uint8_t VBAT = 35; 47 | 48 | 49 | static const uint8_t T0 = 4; 50 | static const uint8_t T1 = 0; 51 | static const uint8_t T2 = 2; 52 | static const uint8_t T3 = 15; 53 | static const uint8_t T4 = 13; 54 | static const uint8_t T5 = 12; 55 | static const uint8_t T6 = 14; 56 | static const uint8_t T7 = 27; 57 | static const uint8_t T8 = 33; 58 | static const uint8_t T9 = 32; 59 | 60 | static const uint8_t DAC1 = 25; 61 | static const uint8_t DAC2 = 26; 62 | 63 | #endif /* Pins_Arduino_h */ 64 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/sparkfun_lora_gateway_1-channel/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | static const int LED_BUILTIN = 17; 15 | 16 | static const uint8_t TX = 1; 17 | static const uint8_t RX = 3; 18 | 19 | static const uint8_t SDA = 21; 20 | static const uint8_t SCL = 22; 21 | 22 | static const uint8_t SS = 16; 23 | static const uint8_t MOSI = 13; 24 | static const uint8_t MISO = 12; 25 | static const uint8_t SCK = 14; 26 | 27 | static const uint8_t A0 = 36; 28 | static const uint8_t A3 = 39; 29 | static const uint8_t A4 = 32; 30 | static const uint8_t A5 = 33; 31 | static const uint8_t A6 = 34; 32 | static const uint8_t A7 = 35; 33 | static const uint8_t A10 = 4; 34 | static const uint8_t A11 = 0; 35 | static const uint8_t A12 = 2; 36 | static const uint8_t A13 = 15; 37 | static const uint8_t A14 = 13; 38 | static const uint8_t A15 = 12; 39 | static const uint8_t A16 = 14; 40 | static const uint8_t A17 = 27; 41 | static const uint8_t A18 = 25; 42 | static const uint8_t A19 = 26; 43 | 44 | static const uint8_t T0 = 4; 45 | static const uint8_t T1 = 0; 46 | static const uint8_t T2 = 2; 47 | static const uint8_t T3 = 15; 48 | static const uint8_t T4 = 13; 49 | static const uint8_t T5 = 12; 50 | static const uint8_t T6 = 14; 51 | static const uint8_t T7 = 27; 52 | static const uint8_t T8 = 33; 53 | static const uint8_t T9 = 32; 54 | 55 | static const uint8_t DAC1 = 25; 56 | static const uint8_t DAC2 = 26; 57 | 58 | #endif /* Pins_Arduino_h */ 59 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/tinypico/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | static const uint8_t TX = 1; 15 | static const uint8_t RX = 3; 16 | 17 | static const uint8_t SDA = 21; 18 | static const uint8_t SCL = 22; 19 | 20 | static const uint8_t SS = 5; 21 | static const uint8_t MOSI = 23; 22 | static const uint8_t MISO = 19; 23 | static const uint8_t SCK = 18; 24 | 25 | static const uint8_t A0 = 36; 26 | static const uint8_t A3 = 39; 27 | static const uint8_t A4 = 32; 28 | static const uint8_t A5 = 33; 29 | static const uint8_t A6 = 34; 30 | static const uint8_t A7 = 35; 31 | static const uint8_t A10 = 4; 32 | static const uint8_t A11 = 0; 33 | static const uint8_t A12 = 2; 34 | static const uint8_t A13 = 15; 35 | static const uint8_t A14 = 13; 36 | static const uint8_t A15 = 12; 37 | static const uint8_t A16 = 14; 38 | static const uint8_t A17 = 27; 39 | static const uint8_t A18 = 25; 40 | static const uint8_t A19 = 26; 41 | 42 | static const uint8_t T0 = 4; 43 | static const uint8_t T1 = 0; 44 | static const uint8_t T2 = 2; 45 | static const uint8_t T3 = 15; 46 | static const uint8_t T4 = 13; 47 | static const uint8_t T5 = 12; 48 | static const uint8_t T6 = 14; 49 | static const uint8_t T7 = 27; 50 | static const uint8_t T8 = 33; 51 | static const uint8_t T9 = 32; 52 | 53 | static const uint8_t DAC1 = 25; 54 | static const uint8_t DAC2 = 26; 55 | 56 | static const uint8_t APA_POWER = 13; 57 | static const uint8_t APA_DATA = 2; 58 | static const uint8_t APA_CLK = 12; 59 | 60 | #endif /* Pins_Arduino_h */ 61 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/ttgo-t7-v13-mini32/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | static const uint8_t TX = 1; 15 | static const uint8_t RX = 3; 16 | 17 | static const uint8_t LED_BUILTIN = 22; 18 | #define BUILTIN_LED LED_BUILTIN // backward compatibility 19 | 20 | static const uint8_t SDA = 21; 21 | static const uint8_t SCL = 22; 22 | 23 | static const uint8_t SS = 5; 24 | static const uint8_t MOSI = 23; 25 | static const uint8_t MISO = 19; 26 | static const uint8_t SCK = 18; 27 | 28 | static const uint8_t A0 = 36; 29 | static const uint8_t A3 = 39; 30 | static const uint8_t A4 = 32; 31 | static const uint8_t A5 = 33; 32 | static const uint8_t A6 = 34; 33 | static const uint8_t A7 = 35; 34 | static const uint8_t A10 = 4; 35 | static const uint8_t A11 = 0; 36 | static const uint8_t A12 = 2; 37 | static const uint8_t A13 = 15; 38 | static const uint8_t A14 = 13; 39 | static const uint8_t A15 = 12; 40 | static const uint8_t A16 = 14; 41 | static const uint8_t A17 = 27; 42 | static const uint8_t A18 = 25; 43 | static const uint8_t A19 = 26; 44 | 45 | static const uint8_t T0 = 4; 46 | static const uint8_t T1 = 0; 47 | static const uint8_t T2 = 2; 48 | static const uint8_t T3 = 15; 49 | static const uint8_t T4 = 13; 50 | static const uint8_t T5 = 12; 51 | static const uint8_t T6 = 14; 52 | static const uint8_t T7 = 27; 53 | static const uint8_t T8 = 33; 54 | static const uint8_t T9 = 32; 55 | 56 | static const uint8_t DAC1 = 25; 57 | static const uint8_t DAC2 = 26; 58 | 59 | #endif /* Pins_Arduino_h */ 60 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/ttgo-t7-v14-mini32/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | static const uint8_t TX = 1; 15 | static const uint8_t RX = 3; 16 | 17 | static const uint8_t LED_BUILTIN = 19; 18 | #define BUILTIN_LED LED_BUILTIN // backward compatibility 19 | 20 | static const uint8_t SDA = 21; 21 | static const uint8_t SCL = 22; 22 | 23 | static const uint8_t SS = 5; 24 | static const uint8_t MOSI = 23; 25 | static const uint8_t MISO = 19; 26 | static const uint8_t SCK = 18; 27 | 28 | static const uint8_t A0 = 36; 29 | static const uint8_t A3 = 39; 30 | static const uint8_t A4 = 32; 31 | static const uint8_t A5 = 33; 32 | static const uint8_t A6 = 34; 33 | static const uint8_t A7 = 35; 34 | static const uint8_t A10 = 4; 35 | static const uint8_t A11 = 0; 36 | static const uint8_t A12 = 2; 37 | static const uint8_t A13 = 15; 38 | static const uint8_t A14 = 13; 39 | static const uint8_t A15 = 12; 40 | static const uint8_t A16 = 14; 41 | static const uint8_t A17 = 27; 42 | static const uint8_t A18 = 25; 43 | static const uint8_t A19 = 26; 44 | 45 | static const uint8_t T0 = 4; 46 | static const uint8_t T1 = 0; 47 | static const uint8_t T2 = 2; 48 | static const uint8_t T3 = 15; 49 | static const uint8_t T4 = 13; 50 | static const uint8_t T5 = 12; 51 | static const uint8_t T6 = 14; 52 | static const uint8_t T7 = 27; 53 | static const uint8_t T8 = 33; 54 | static const uint8_t T9 = 32; 55 | 56 | static const uint8_t DAC1 = 25; 57 | static const uint8_t DAC2 = 26; 58 | 59 | #endif /* Pins_Arduino_h */ 60 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/mhetesp32devkit/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | static const uint8_t LED_BUILTIN = 2; 15 | #define BUILTIN_LED LED_BUILTIN 16 | #define LED_BUILTIN LED_BUILTIN 17 | 18 | static const uint8_t TX = 1; 19 | static const uint8_t RX = 3; 20 | 21 | static const uint8_t SDA = 21; 22 | static const uint8_t SCL = 22; 23 | 24 | static const uint8_t SS = 5; 25 | static const uint8_t MOSI = 23; 26 | static const uint8_t MISO = 19; 27 | static const uint8_t SCK = 18; 28 | 29 | static const uint8_t A0 = 36; 30 | static const uint8_t A3 = 39; 31 | static const uint8_t A4 = 32; 32 | static const uint8_t A5 = 33; 33 | static const uint8_t A6 = 34; 34 | static const uint8_t A7 = 35; 35 | static const uint8_t A10 = 4; 36 | static const uint8_t A11 = 0; 37 | static const uint8_t A12 = 2; 38 | static const uint8_t A13 = 15; 39 | static const uint8_t A14 = 13; 40 | static const uint8_t A15 = 12; 41 | static const uint8_t A16 = 14; 42 | static const uint8_t A17 = 27; 43 | static const uint8_t A18 = 25; 44 | static const uint8_t A19 = 26; 45 | 46 | static const uint8_t T0 = 4; 47 | static const uint8_t T1 = 0; 48 | static const uint8_t T2 = 2; 49 | static const uint8_t T3 = 15; 50 | static const uint8_t T4 = 13; 51 | static const uint8_t T5 = 12; 52 | static const uint8_t T6 = 14; 53 | static const uint8_t T7 = 27; 54 | static const uint8_t T8 = 33; 55 | static const uint8_t T9 = 32; 56 | 57 | static const uint8_t DAC1 = 25; 58 | static const uint8_t DAC2 = 26; 59 | 60 | #endif /* Pins_Arduino_h */ 61 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/mhetesp32minikit/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | static const uint8_t LED_BUILTIN = 2; 15 | #define BUILTIN_LED LED_BUILTIN 16 | #define LED_BUILTIN LED_BUILTIN 17 | 18 | static const uint8_t TX = 1; 19 | static const uint8_t RX = 3; 20 | 21 | static const uint8_t SDA = 21; 22 | static const uint8_t SCL = 22; 23 | 24 | static const uint8_t SS = 5; 25 | static const uint8_t MOSI = 23; 26 | static const uint8_t MISO = 19; 27 | static const uint8_t SCK = 18; 28 | 29 | static const uint8_t A0 = 36; 30 | static const uint8_t A3 = 39; 31 | static const uint8_t A4 = 32; 32 | static const uint8_t A5 = 33; 33 | static const uint8_t A6 = 34; 34 | static const uint8_t A7 = 35; 35 | static const uint8_t A10 = 4; 36 | static const uint8_t A11 = 0; 37 | static const uint8_t A12 = 2; 38 | static const uint8_t A13 = 15; 39 | static const uint8_t A14 = 13; 40 | static const uint8_t A15 = 12; 41 | static const uint8_t A16 = 14; 42 | static const uint8_t A17 = 27; 43 | static const uint8_t A18 = 25; 44 | static const uint8_t A19 = 26; 45 | 46 | static const uint8_t T0 = 4; 47 | static const uint8_t T1 = 0; 48 | static const uint8_t T2 = 2; 49 | static const uint8_t T3 = 15; 50 | static const uint8_t T4 = 13; 51 | static const uint8_t T5 = 12; 52 | static const uint8_t T6 = 14; 53 | static const uint8_t T7 = 27; 54 | static const uint8_t T8 = 33; 55 | static const uint8_t T9 = 32; 56 | 57 | static const uint8_t DAC1 = 25; 58 | static const uint8_t DAC2 = 26; 59 | 60 | #endif /* Pins_Arduino_h */ 61 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/onehorse32dev/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | static const uint8_t LED_BUILTIN = 5; 15 | #define BUILTIN_LED LED_BUILTIN // backward compatibility 16 | #define LED_BUILTIN LED_BUILTIN 17 | 18 | static const uint8_t KEY_BUILTIN = 0; 19 | 20 | static const uint8_t TX = 1; 21 | static const uint8_t RX = 3; 22 | 23 | static const uint8_t SDA = 21; 24 | static const uint8_t SCL = 22; 25 | 26 | static const uint8_t SS = 5; 27 | static const uint8_t MOSI = 23; 28 | static const uint8_t MISO = 19; 29 | static const uint8_t SCK = 18; 30 | 31 | static const uint8_t A0 = 36; 32 | static const uint8_t A1 = 37; 33 | static const uint8_t A2 = 38; 34 | static const uint8_t A3 = 39; 35 | static const uint8_t A6 = 34; 36 | static const uint8_t A7 = 35; 37 | static const uint8_t A10 = 4; 38 | static const uint8_t A11 = 0; 39 | static const uint8_t A12 = 2; 40 | static const uint8_t A13 = 15; 41 | static const uint8_t A14 = 13; 42 | static const uint8_t A15 = 12; 43 | static const uint8_t A16 = 14; 44 | static const uint8_t A17 = 27; 45 | static const uint8_t A18 = 25; 46 | static const uint8_t A19 = 26; 47 | 48 | static const uint8_t T0 = 4; 49 | static const uint8_t T1 = 0; 50 | static const uint8_t T2 = 2; 51 | static const uint8_t T3 = 15; 52 | static const uint8_t T4 = 13; 53 | static const uint8_t T5 = 12; 54 | static const uint8_t T6 = 14; 55 | static const uint8_t T7 = 27; 56 | 57 | static const uint8_t DAC1 = 25; 58 | static const uint8_t DAC2 = 26; 59 | 60 | #endif /* Pins_Arduino_h */ 61 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/widora-air/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 7 8 | #define NUM_ANALOG_INPUTS 10 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | static const uint8_t LED_BUILTIN = 25; 15 | #define BUILTIN_LED LED_BUILTIN // backward compatibility 16 | #define LED_BUILTIN LED_BUILTIN 17 | 18 | 19 | static const uint8_t KEY_BUILTIN = 0; 20 | 21 | static const uint8_t TX = 1; 22 | static const uint8_t RX = 3; 23 | 24 | static const uint8_t SDA = 23; 25 | static const uint8_t SCL = 19; 26 | 27 | static const uint8_t SS = 5; 28 | static const uint8_t MOSI = 16; 29 | static const uint8_t MISO = 17; 30 | static const uint8_t SCK = 18; 31 | 32 | static const uint8_t A0 = 36; 33 | static const uint8_t A1 = 39; 34 | static const uint8_t A2 = 35; 35 | static const uint8_t A3 = 25; 36 | static const uint8_t A4 = 26; 37 | static const uint8_t A5 = 14; 38 | static const uint8_t A6 = 12; 39 | static const uint8_t A7 = 15; 40 | static const uint8_t A8 = 13; 41 | static const uint8_t A9 = 2; 42 | 43 | static const uint8_t D0 = 19; 44 | static const uint8_t D1 = 23; 45 | static const uint8_t D2 = 18; 46 | static const uint8_t D3 = 17; 47 | static const uint8_t D4 = 16; 48 | static const uint8_t D5 = 5; 49 | static const uint8_t D6 = 4; 50 | 51 | static const uint8_t T0 = 19; 52 | static const uint8_t T1 = 23; 53 | static const uint8_t T2 = 18; 54 | static const uint8_t T3 = 17; 55 | static const uint8_t T4 = 16; 56 | static const uint8_t T5 = 5; 57 | static const uint8_t T6 = 4; 58 | 59 | static const uint8_t DAC1 = 25; 60 | static const uint8_t DAC2 = 26; 61 | 62 | #endif /* Pins_Arduino_h */ 63 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/adafruit_feather_esp32s2/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | 7 | #define USB_VID 0x239A 8 | #define USB_PID 0x80EB 9 | #define USB_MANUFACTURER "Adafruit" 10 | #define USB_PRODUCT "Adafruit Feather ESP32-S2" 11 | #define USB_SERIAL "" 12 | 13 | 14 | #define EXTERNAL_NUM_INTERRUPTS 46 15 | #define NUM_DIGITAL_PINS 48 16 | #define NUM_ANALOG_INPUTS 20 17 | 18 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 19 | #define digitalPinToInterrupt(p) (((p)<48)?(p):-1) 20 | #define digitalPinHasPWM(p) (p < 46) 21 | 22 | static const uint8_t PIN_NEOPIXEL = 33; 23 | static const uint8_t PIN_NEOPIXEL_POWER = 21; 24 | static const uint8_t LED_BUILTIN = 13; 25 | 26 | static const uint8_t TX = 39; 27 | static const uint8_t RX = 38; 28 | 29 | static const uint8_t SDA = 3; 30 | static const uint8_t SCL = 4; 31 | 32 | static const uint8_t SS = 42; 33 | static const uint8_t MOSI = 35; 34 | static const uint8_t SCK = 36; 35 | static const uint8_t MISO = 37; 36 | 37 | static const uint8_t A0 = 18; 38 | static const uint8_t A1 = 17; 39 | static const uint8_t A2 = 16; 40 | static const uint8_t A3 = 15; 41 | static const uint8_t A4 = 14; 42 | static const uint8_t A5 = 8; 43 | 44 | static const uint8_t T1 = 1; 45 | static const uint8_t T2 = 2; 46 | static const uint8_t T3 = 3; 47 | static const uint8_t T4 = 4; 48 | static const uint8_t T5 = 5; 49 | static const uint8_t T6 = 6; 50 | static const uint8_t T7 = 7; 51 | static const uint8_t T8 = 8; 52 | static const uint8_t T9 = 9; 53 | static const uint8_t T10 = 10; 54 | static const uint8_t T11 = 11; 55 | static const uint8_t T12 = 12; 56 | static const uint8_t T13 = 13; 57 | static const uint8_t T14 = 14; 58 | 59 | static const uint8_t DAC1 = 17; 60 | static const uint8_t DAC2 = 18; 61 | 62 | #endif /* Pins_Arduino_h */ 63 | -------------------------------------------------------------------------------- /components/socket-events/include/tcp.h: -------------------------------------------------------------------------------- 1 | /* 2 | MIT License 3 | 4 | Copyright (c) 2021 Marcel Kottmann 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or 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, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | */ 24 | 25 | #if !defined(EL_TCP_H_INCLUDED) 26 | #define EL_TCP_H_INCLUDED 27 | 28 | #include 29 | #include 30 | #include "openssl/ssl.h" 31 | 32 | #ifdef __cplusplus 33 | extern "C" 34 | { 35 | #endif 36 | 37 | int createNonBlockingSocket(int domain, int type, int protocol, bool nonblocking); 38 | int connectNonBlocking(int sockfd, const char *hostname, int portno); 39 | int bindAndListen(int sockfd, int portno); 40 | int acceptIncoming(int sockfd); 41 | int readSocket(int sockfd, char *msg, int len); 42 | int writeSocket(int sockfd, const char *msg, int len, SSL *ssl); 43 | void closeSocket(int sockfd); 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | 49 | #endif -------------------------------------------------------------------------------- /docs/interfaces/_esp32_javascript_modules_esp32_javascript_http_.esp32jsrequest.md: -------------------------------------------------------------------------------- 1 | [esp32-javascript](../README.md) › ["esp32-javascript/modules/esp32-javascript/http"](../modules/_esp32_javascript_modules_esp32_javascript_http_.md) › [Esp32JsRequest](_esp32_javascript_modules_esp32_javascript_http_.esp32jsrequest.md) 2 | 3 | # Interface: Esp32JsRequest 4 | 5 | ## Hierarchy 6 | 7 | * **Esp32JsRequest** 8 | 9 | ## Index 10 | 11 | ### Properties 12 | 13 | * [body](_esp32_javascript_modules_esp32_javascript_http_.esp32jsrequest.md#body) 14 | * [headers](_esp32_javascript_modules_esp32_javascript_http_.esp32jsrequest.md#headers) 15 | * [method](_esp32_javascript_modules_esp32_javascript_http_.esp32jsrequest.md#method) 16 | * [path](_esp32_javascript_modules_esp32_javascript_http_.esp32jsrequest.md#path) 17 | 18 | ## Properties 19 | 20 | ### body 21 | 22 | • **body**: *string | null* 23 | 24 | *Defined in [esp32-javascript/modules/esp32-javascript/http.ts:35](https://github.com/marcelkottmann/esp32-javascript/blob/22ffb3d/components/esp32-javascript/modules/esp32-javascript/http.ts#L35)* 25 | 26 | ___ 27 | 28 | ### headers 29 | 30 | • **headers**: *Headers* 31 | 32 | *Defined in [esp32-javascript/modules/esp32-javascript/http.ts:33](https://github.com/marcelkottmann/esp32-javascript/blob/22ffb3d/components/esp32-javascript/modules/esp32-javascript/http.ts#L33)* 33 | 34 | ___ 35 | 36 | ### method 37 | 38 | • **method**: *string* 39 | 40 | *Defined in [esp32-javascript/modules/esp32-javascript/http.ts:34](https://github.com/marcelkottmann/esp32-javascript/blob/22ffb3d/components/esp32-javascript/modules/esp32-javascript/http.ts#L34)* 41 | 42 | ___ 43 | 44 | ### path 45 | 46 | • **path**: *string* 47 | 48 | *Defined in [esp32-javascript/modules/esp32-javascript/http.ts:32](https://github.com/marcelkottmann/esp32-javascript/blob/22ffb3d/components/esp32-javascript/modules/esp32-javascript/http.ts#L32)* 49 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/esp32-devkit-lipo/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | static const uint8_t TX = 1; 15 | static const uint8_t RX = 3; 16 | 17 | #define TX1 33 // Ext1 pin 8 18 | #define RX1 25 // Ext1 pin 9 19 | 20 | #define TX2 19 // Ext2 pin 8 21 | #define RX2 18 // Ext2 pin 9 22 | 23 | static const uint8_t SDA = 21; 24 | static const uint8_t SCL = 22; 25 | 26 | static const uint8_t SS = 5; 27 | static const uint8_t MOSI = 23; 28 | static const uint8_t MISO = 19; 29 | static const uint8_t SCK = 18; 30 | 31 | static const uint8_t A0 = 36; 32 | static const uint8_t A3 = 39; 33 | static const uint8_t A4 = 32; 34 | static const uint8_t A5 = 33; 35 | static const uint8_t A6 = 34; 36 | static const uint8_t A7 = 35; 37 | static const uint8_t A10 = 4; 38 | static const uint8_t A11 = 0; 39 | static const uint8_t A12 = 2; 40 | static const uint8_t A13 = 15; 41 | static const uint8_t A14 = 13; 42 | static const uint8_t A15 = 12; 43 | static const uint8_t A16 = 14; 44 | static const uint8_t A17 = 27; 45 | static const uint8_t A18 = 25; 46 | static const uint8_t A19 = 26; 47 | 48 | static const uint8_t T0 = 4; 49 | static const uint8_t T1 = 0; 50 | static const uint8_t T2 = 2; 51 | static const uint8_t T3 = 15; 52 | static const uint8_t T4 = 13; 53 | static const uint8_t T5 = 12; 54 | static const uint8_t T6 = 14; 55 | static const uint8_t T7 = 27; 56 | static const uint8_t T8 = 33; 57 | static const uint8_t T9 = 32; 58 | 59 | static const uint8_t DAC1 = 25; 60 | static const uint8_t DAC2 = 26; 61 | 62 | #endif /* Pins_Arduino_h */ 63 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/doitESP32devkitV1/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | static const uint8_t LED_BUILTIN = 2; 15 | #define BUILTIN_LED LED_BUILTIN // backward compatibility 16 | #define LED_BUILTIN LED_BUILTIN 17 | 18 | static const uint8_t TX = 1; 19 | static const uint8_t RX = 3; 20 | 21 | static const uint8_t SDA = 21; 22 | static const uint8_t SCL = 22; 23 | 24 | static const uint8_t SS = 5; 25 | static const uint8_t MOSI = 23; 26 | static const uint8_t MISO = 19; 27 | static const uint8_t SCK = 18; 28 | 29 | static const uint8_t A0 = 36; 30 | static const uint8_t A3 = 39; 31 | static const uint8_t A4 = 32; 32 | static const uint8_t A5 = 33; 33 | static const uint8_t A6 = 34; 34 | static const uint8_t A7 = 35; 35 | static const uint8_t A10 = 4; 36 | static const uint8_t A11 = 0; 37 | static const uint8_t A12 = 2; 38 | static const uint8_t A13 = 15; 39 | static const uint8_t A14 = 13; 40 | static const uint8_t A15 = 12; 41 | static const uint8_t A16 = 14; 42 | static const uint8_t A17 = 27; 43 | static const uint8_t A18 = 25; 44 | static const uint8_t A19 = 26; 45 | 46 | static const uint8_t T0 = 4; 47 | static const uint8_t T1 = 0; 48 | static const uint8_t T2 = 2; 49 | static const uint8_t T3 = 15; 50 | static const uint8_t T4 = 13; 51 | static const uint8_t T5 = 12; 52 | static const uint8_t T6 = 14; 53 | static const uint8_t T7 = 27; 54 | static const uint8_t T8 = 33; 55 | static const uint8_t T9 = 32; 56 | 57 | static const uint8_t DAC1 = 25; 58 | static const uint8_t DAC2 = 26; 59 | 60 | #endif /* Pins_Arduino_h */ 61 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/esp32thing_plus/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | static const uint8_t LED_BUILTIN = 13; 15 | #define BUILTIN_LED LED_BUILTIN // backward compatibility 16 | #define LED_BUILTIN LED_BUILTIN 17 | 18 | static const uint8_t TX = 17; 19 | static const uint8_t RX = 16; 20 | 21 | #define TX1 TX 22 | #define RX1 RX 23 | 24 | static const uint8_t SDA = 23; 25 | static const uint8_t SCL = 22; 26 | 27 | static const uint8_t SS = 33; 28 | static const uint8_t MOSI = 18; 29 | static const uint8_t MISO = 19; 30 | static const uint8_t SCK = 5; 31 | 32 | // mapping to match other feathers and also in order 33 | static const uint8_t A0 = 26; 34 | static const uint8_t A1 = 25; 35 | static const uint8_t A2 = 34; 36 | static const uint8_t A3 = 39; 37 | static const uint8_t A4 = 36; 38 | static const uint8_t A5 = 4; 39 | static const uint8_t A6 = 14; 40 | static const uint8_t A7 = 32; 41 | static const uint8_t A8 = 15; 42 | static const uint8_t A9 = 33; 43 | static const uint8_t A10 = 27; 44 | static const uint8_t A11 = 12; 45 | static const uint8_t A12 = 13; 46 | 47 | 48 | static const uint8_t T0 = 4; 49 | static const uint8_t T1 = 0; 50 | static const uint8_t T2 = 2; 51 | static const uint8_t T3 = 15; 52 | static const uint8_t T4 = 13; 53 | static const uint8_t T5 = 12; 54 | static const uint8_t T6 = 14; 55 | static const uint8_t T7 = 27; 56 | static const uint8_t T8 = 33; 57 | static const uint8_t T9 = 32; 58 | 59 | static const uint8_t DAC1 = 25; 60 | static const uint8_t DAC2 = 26; 61 | 62 | #endif /* Pins_Arduino_h */ 63 | -------------------------------------------------------------------------------- /components/arduino-esp32/include/variants/lolin32/pins_arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Pins_Arduino_h 2 | #define Pins_Arduino_h 3 | 4 | #include 5 | 6 | #define EXTERNAL_NUM_INTERRUPTS 16 7 | #define NUM_DIGITAL_PINS 40 8 | #define NUM_ANALOG_INPUTS 16 9 | 10 | #define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1) 11 | #define digitalPinToInterrupt(p) (((p)<40)?(p):-1) 12 | #define digitalPinHasPWM(p) (p < 34) 13 | 14 | static const uint8_t LED_BUILTIN = 5; 15 | #define BUILTIN_LED LED_BUILTIN // backward compatibility 16 | #define LED_BUILTIN LED_BUILTIN 17 | 18 | 19 | 20 | static const uint8_t TX = 1; 21 | static const uint8_t RX = 3; 22 | 23 | static const uint8_t SDA = 21; 24 | static const uint8_t SCL = 22; 25 | 26 | static const uint8_t SS = 5; 27 | static const uint8_t MOSI = 23; 28 | static const uint8_t MISO = 19; 29 | static const uint8_t SCK = 18; 30 | 31 | static const uint8_t A0 = 36; 32 | static const uint8_t A3 = 39; 33 | static const uint8_t A4 = 32; 34 | static const uint8_t A5 = 33; 35 | static const uint8_t A6 = 34; 36 | static const uint8_t A7 = 35; 37 | static const uint8_t A10 = 4; 38 | static const uint8_t A11 = 0; 39 | static const uint8_t A12 = 2; 40 | static const uint8_t A13 = 15; 41 | static const uint8_t A14 = 13; 42 | static const uint8_t A15 = 12; 43 | static const uint8_t A16 = 14; 44 | static const uint8_t A17 = 27; 45 | static const uint8_t A18 = 25; 46 | static const uint8_t A19 = 26; 47 | 48 | static const uint8_t T0 = 4; 49 | static const uint8_t T1 = 0; 50 | static const uint8_t T2 = 2; 51 | static const uint8_t T3 = 15; 52 | static const uint8_t T4 = 13; 53 | static const uint8_t T5 = 12; 54 | static const uint8_t T6 = 14; 55 | static const uint8_t T7 = 27; 56 | static const uint8_t T8 = 33; 57 | static const uint8_t T9 = 32; 58 | 59 | static const uint8_t DAC1 = 25; 60 | static const uint8_t DAC2 = 26; 61 | 62 | #endif /* Pins_Arduino_h */ 63 | --------------------------------------------------------------------------------