From 0ab61219efa158df2abd41a81041a0a86ed274af Mon Sep 17 00:00:00 2001 From: kuba2k2 Date: Mon, 26 Feb 2024 20:36:32 +0000 Subject: [PATCH] Deployed a1f8516 with MkDocs version: 1.4.2 --- .nojekyll | 0 404.html | 2270 ++++++ CNAME | 1 + SUMMARY/index.html | 2425 ++++++ assets/images/favicon.png | Bin 0 -> 1870 bytes assets/javascripts/bundle.5cf534bf.min.js | 29 + assets/javascripts/bundle.5cf534bf.min.js.map | 8 + assets/javascripts/lunr/min/lunr.ar.min.js | 1 + assets/javascripts/lunr/min/lunr.da.min.js | 18 + assets/javascripts/lunr/min/lunr.de.min.js | 18 + assets/javascripts/lunr/min/lunr.du.min.js | 18 + assets/javascripts/lunr/min/lunr.es.min.js | 18 + assets/javascripts/lunr/min/lunr.fi.min.js | 18 + assets/javascripts/lunr/min/lunr.fr.min.js | 18 + assets/javascripts/lunr/min/lunr.hi.min.js | 1 + assets/javascripts/lunr/min/lunr.hu.min.js | 18 + assets/javascripts/lunr/min/lunr.it.min.js | 18 + assets/javascripts/lunr/min/lunr.ja.min.js | 1 + assets/javascripts/lunr/min/lunr.jp.min.js | 1 + assets/javascripts/lunr/min/lunr.ko.min.js | 1 + assets/javascripts/lunr/min/lunr.multi.min.js | 1 + assets/javascripts/lunr/min/lunr.nl.min.js | 18 + assets/javascripts/lunr/min/lunr.no.min.js | 18 + assets/javascripts/lunr/min/lunr.pt.min.js | 18 + assets/javascripts/lunr/min/lunr.ro.min.js | 18 + assets/javascripts/lunr/min/lunr.ru.min.js | 18 + .../lunr/min/lunr.stemmer.support.min.js | 1 + assets/javascripts/lunr/min/lunr.sv.min.js | 18 + assets/javascripts/lunr/min/lunr.ta.min.js | 1 + assets/javascripts/lunr/min/lunr.th.min.js | 1 + assets/javascripts/lunr/min/lunr.tr.min.js | 18 + assets/javascripts/lunr/min/lunr.vi.min.js | 1 + assets/javascripts/lunr/min/lunr.zh.min.js | 1 + assets/javascripts/lunr/tinyseg.js | 206 + assets/javascripts/lunr/wordcut.js | 6708 +++++++++++++++++ .../workers/search.12658920.min.js | 42 + .../workers/search.12658920.min.js.map | 8 + assets/stylesheets/main.3bd4f189.min.css | 1 + assets/stylesheets/main.3bd4f189.min.css.map | 1 + assets/stylesheets/palette.2505c338.min.css | 1 + .../stylesheets/palette.2505c338.min.css.map | 1 + boards.json | 1 + boards/SUMMARY/index.html | 2323 ++++++ boards/_base/beken-7231-tuya.json | 8 + boards/_base/beken-7231.json | 10 + boards/_base/beken-7231n.json | 33 + boards/_base/beken-7231q.json | 19 + boards/_base/beken-7231t.json | 29 + boards/_base/beken-7252.json | 40 + boards/_base/beken-72xx.json | 50 + boards/_base/generic.json | 7 + boards/_base/ic/bk7231-qfn32.json | 139 + boards/_base/ic/bk7231-qfn40.json | 186 + boards/_base/ic/bk7231q-qfn40.json | 170 + boards/_base/ic/bk7252-qfn68.json | 259 + boards/_base/ic/rtl8710bn.json | 167 + boards/_base/ic/rtl8720cf.json | 186 + boards/_base/pcb/bw12.json | 78 + boards/_base/pcb/bw15.json | 73 + boards/_base/pcb/cb1s-test.json | 69 + boards/_base/pcb/cb1s.json | 101 + boards/_base/pcb/cb2l-test.json | 105 + boards/_base/pcb/cb2l.json | 60 + boards/_base/pcb/cb2s-test.json | 59 + boards/_base/pcb/cb2s.json | 68 + boards/_base/pcb/cb3l.json | 79 + boards/_base/pcb/cb3s.json | 104 + boards/_base/pcb/cb3se.json | 102 + boards/_base/pcb/cblc5-test.json | 104 + boards/_base/pcb/cblc5.json | 78 + boards/_base/pcb/cbu-test.json | 30 + boards/_base/pcb/cbu.json | 100 + boards/_base/pcb/lsc-lma35.json | 96 + boards/_base/pcb/t102.json | 56 + boards/_base/pcb/t103.json | 79 + boards/_base/pcb/t112.json | 70 + boards/_base/pcb/wa2-test.json | 143 + boards/_base/pcb/wa2.json | 93 + boards/_base/pcb/wb1s.json | 99 + boards/_base/pcb/wb2l-m1-test.json | 16 + boards/_base/pcb/wb2l-test.json | 165 + boards/_base/pcb/wb2l.json | 79 + boards/_base/pcb/wb2s-test.json | 158 + boards/_base/pcb/wb2s.json | 96 + boards/_base/pcb/wb3l.json | 102 + boards/_base/pcb/wb3s.json | 104 + boards/_base/pcb/wblc5-test.json | 152 + boards/_base/pcb/wblc5.json | 95 + boards/_base/pcb/wr1.json | 82 + boards/_base/pcb/wr1e.json | 82 + boards/_base/pcb/wr2-base.json | 9 + boards/_base/pcb/wr2-test.json | 44 + boards/_base/pcb/wr2.json | 57 + boards/_base/pcb/wr2e-test.json | 44 + boards/_base/pcb/wr2e.json | 60 + boards/_base/pcb/wr2l-base.json | 9 + boards/_base/pcb/wr2l.json | 36 + boards/_base/pcb/wr2le.json | 33 + boards/_base/pcb/wr3-base.json | 9 + boards/_base/pcb/wr3.json | 73 + boards/_base/pcb/wr3e.json | 73 + boards/_base/pcb/wr3l-base.json | 10 + boards/_base/pcb/wr3n.json | 68 + boards/_base/realtek-ambz-2mb-468k.json | 15 + boards/_base/realtek-ambz-2mb-788k.json | 15 + boards/_base/realtek-ambz-4mb-980k.json | 15 + boards/_base/realtek-ambz-bx.json | 5 + boards/_base/realtek-ambz-tuya.json | 5 + boards/_base/realtek-ambz.json | 52 + boards/_base/realtek-ambz2-2mb-900k.json | 12 + boards/_base/realtek-ambz2-2mb-992k.json | 11 + boards/_base/realtek-ambz2-8710.json | 12 + boards/_base/realtek-ambz2-8720.json | 14 + boards/_base/realtek-ambz2-image.json | 96 + boards/_base/realtek-ambz2-tuya.json | 5 + boards/_base/realtek-ambz2.json | 41 + boards/bw12.json | 25 + boards/bw12/bw12.svg | 327 + boards/bw12/index.html | 2650 +++++++ boards/bw15.json | 26 + boards/bw15/bw15.svg | 367 + boards/bw15/index.html | 2657 +++++++ boards/cb1s.json | 20 + boards/cb1s/cb1s.svg | 413 + boards/cb1s/index.html | 2667 +++++++ boards/cb2l.json | 23 + boards/cb2l/cb2l.svg | 250 + boards/cb2l/index.html | 2631 +++++++ boards/cb2s.json | 23 + boards/cb2s/cb2s.svg | 272 + boards/cb2s/index.html | 2647 +++++++ boards/cb3l.json | 22 + boards/cb3l/cb3l.svg | 265 + boards/cb3l/index.html | 2655 +++++++ boards/cb3s.json | 22 + boards/cb3s/cb3s.svg | 391 + boards/cb3s/index.html | 2671 +++++++ boards/cb3se.json | 22 + boards/cb3se/cb3se.svg | 361 + boards/cb3se/index.html | 2695 +++++++ boards/cblc5.json | 20 + boards/cblc5/cblc5.svg | 205 + boards/cblc5/index.html | 2619 +++++++ boards/cbu.json | 23 + boards/cbu/cbu.svg | 459 ++ boards/cbu/index.html | 2711 +++++++ boards/generic-bk7231n-qfn32-tuya.json | 100 + boards/generic-bk7231n-qfn32-tuya/index.html | 2691 +++++++ boards/generic-bk7231t-qfn32-tuya.json | 101 + boards/generic-bk7231t-qfn32-tuya/index.html | 2691 +++++++ boards/generic-bk7252.json | 193 + boards/generic-bk7252/index.html | 2831 +++++++ boards/generic-rtl8710bn-2mb-468k.json | 95 + boards/generic-rtl8710bn-2mb-468k/index.html | 2677 +++++++ boards/generic-rtl8710bn-2mb-788k.json | 95 + boards/generic-rtl8710bn-2mb-788k/index.html | 2677 +++++++ boards/generic-rtl8710bx-4mb-980k.json | 100 + boards/generic-rtl8710bx-4mb-980k/index.html | 2695 +++++++ boards/generic-rtl8720cf-2mb-992k.json | 102 + boards/generic-rtl8720cf-2mb-992k/index.html | 2692 +++++++ boards/lsc-lma35-t.json | 30 + boards/lsc-lma35-t/index.html | 2694 +++++++ boards/lsc-lma35-t/lsc-lma35-t.svg | 349 + boards/lsc-lma35.json | 29 + boards/lsc-lma35/index.html | 2694 +++++++ boards/lsc-lma35/lsc-lma35.svg | 349 + boards/shapes/tuya2_pcb.json | 54 + boards/shapes/tuyau_pcb.json | 54 + boards/t102-v1.1.json | 22 + boards/t102-v1.1/index.html | 2633 +++++++ boards/t102-v1.1/t102-v1.1.svg | 260 + boards/t103-v1.0.json | 26 + boards/t103-v1.0/index.html | 2665 +++++++ boards/t103-v1.0/t103-v1.0.svg | 337 + boards/t112-v1.1.json | 22 + boards/t112-v1.1/index.html | 2649 +++++++ boards/t112-v1.1/t112-v1.1.svg | 287 + boards/templates/custom-20x24-22.json | 141 + boards/templates/tuya-16x24.json | 27 + boards/templates/tuya1.json | 99 + boards/templates/tuya1s.json | 64 + boards/templates/tuya2.json | 80 + boards/templates/tuya2l.json | 73 + boards/templates/tuyalc5.json | 255 + boards/templates/tuyau.json | 162 + boards/variants/bw12.c | 48 + boards/variants/bw12.h | 138 + boards/variants/bw15.c | 54 + boards/variants/bw15.h | 133 + boards/variants/cb1s.c | 57 + boards/variants/cb1s.h | 112 + boards/variants/cb2l.c | 42 + boards/variants/cb2l.h | 74 + boards/variants/cb2s.c | 48 + boards/variants/cb2s.h | 96 + boards/variants/cb3l.c | 51 + boards/variants/cb3l.h | 88 + boards/variants/cb3s.c | 57 + boards/variants/cb3s.h | 105 + boards/variants/cb3se.c | 66 + boards/variants/cb3se.h | 132 + boards/variants/cblc5.c | 39 + boards/variants/cblc5.h | 82 + boards/variants/cbu.c | 72 + boards/variants/cbu.h | 144 + boards/variants/generic-bk7231n-qfn32-tuya.c | 72 + boards/variants/generic-bk7231n-qfn32-tuya.h | 144 + boards/variants/generic-bk7231t-qfn32-tuya.c | 72 + boards/variants/generic-bk7231t-qfn32-tuya.h | 144 + boards/variants/generic-bk7252.c | 129 + boards/variants/generic-bk7252.h | 223 + boards/variants/generic-rtl8710bn-2mb-468k.c | 69 + boards/variants/generic-rtl8710bn-2mb-468k.h | 177 + boards/variants/generic-rtl8710bn-2mb-788k.c | 69 + boards/variants/generic-rtl8710bn-2mb-788k.h | 177 + boards/variants/generic-rtl8710bx-4mb-980k.c | 66 + boards/variants/generic-rtl8710bx-4mb-980k.h | 174 + boards/variants/generic-rtl8720cf-2mb-992k.c | 75 + boards/variants/generic-rtl8720cf-2mb-992k.h | 167 + boards/variants/lsc-lma35-t.c | 60 + boards/variants/lsc-lma35-t.h | 111 + boards/variants/lsc-lma35.c | 60 + boards/variants/lsc-lma35.h | 111 + boards/variants/t102-v1.1.c | 42 + boards/variants/t102-v1.1.h | 96 + boards/variants/t103-v1.0.c | 51 + boards/variants/t103-v1.0.h | 141 + boards/variants/t112-v1.1.c | 48 + boards/variants/t112-v1.1.h | 138 + boards/variants/wa2.c | 54 + boards/variants/wa2.h | 100 + boards/variants/wb1s.c | 48 + boards/variants/wb1s.h | 96 + boards/variants/wb2l-m1.c | 54 + boards/variants/wb2l-m1.h | 108 + boards/variants/wb2l.c | 54 + boards/variants/wb2l.h | 108 + boards/variants/wb2s.c | 57 + boards/variants/wb2s.h | 112 + boards/variants/wb3l.c | 63 + boards/variants/wb3l.h | 120 + boards/variants/wb3s.c | 60 + boards/variants/wb3s.h | 116 + boards/variants/wblc5.c | 48 + boards/variants/wblc5.h | 100 + boards/variants/wr1.c | 48 + boards/variants/wr1.h | 137 + boards/variants/wr1e.c | 48 + boards/variants/wr1e.h | 137 + boards/variants/wr2.c | 45 + boards/variants/wr2.h | 99 + boards/variants/wr2e.c | 45 + boards/variants/wr2e.h | 106 + boards/variants/wr2l.c | 30 + boards/variants/wr2l.h | 48 + boards/variants/wr2le.c | 30 + boards/variants/wr2le.h | 46 + boards/variants/wr3.c | 51 + boards/variants/wr3.h | 141 + boards/variants/wr3e.c | 51 + boards/variants/wr3e.h | 141 + boards/variants/wr3l.c | 51 + boards/variants/wr3l.h | 141 + boards/variants/wr3le.c | 51 + boards/variants/wr3le.h | 141 + boards/variants/wr3n.c | 45 + boards/variants/wr3n.h | 99 + boards/wa2.json | 20 + boards/wa2/index.html | 2649 +++++++ boards/wa2/wa2.svg | 366 + boards/wb1s.json | 23 + boards/wb1s/index.html | 2671 +++++++ boards/wb1s/wb1s.svg | 402 + boards/wb2l-m1.json | 21 + boards/wb2l-m1/index.html | 2659 +++++++ boards/wb2l-m1/wb2l-m1.svg | 343 + boards/wb2l.json | 24 + boards/wb2l/index.html | 2663 +++++++ boards/wb2l/wb2l.svg | 343 + boards/wb2s.json | 24 + boards/wb2s/index.html | 2671 +++++++ boards/wb2s/wb2s.svg | 367 + boards/wb3l.json | 23 + boards/wb3l/index.html | 2687 +++++++ boards/wb3l/wb3l.svg | 388 + boards/wb3s.json | 23 + boards/wb3s/index.html | 2679 +++++++ boards/wb3s/wb3s.svg | 386 + boards/wblc5.json | 21 + boards/wblc5/index.html | 2643 +++++++ boards/wblc5/wblc5.svg | 277 + boards/wr1.json | 21 + boards/wr1/index.html | 2641 +++++++ boards/wr1/wr1.svg | 343 + boards/wr1e.json | 21 + boards/wr1e/index.html | 2641 +++++++ boards/wr1e/wr1e.svg | 343 + boards/wr2.json | 24 + boards/wr2/index.html | 2639 +++++++ boards/wr2/wr2.svg | 278 + boards/wr2e.json | 24 + boards/wr2e/index.html | 2639 +++++++ boards/wr2e/wr2e.svg | 274 + boards/wr2l.json | 24 + boards/wr2l/index.html | 2607 +++++++ boards/wr2l/wr2l.svg | 161 + boards/wr2le.json | 21 + boards/wr2le/index.html | 2603 +++++++ boards/wr2le/wr2le.svg | 161 + boards/wr3.json | 23 + boards/wr3/index.html | 2655 +++++++ boards/wr3/wr3.svg | 321 + boards/wr3e.json | 23 + boards/wr3e/index.html | 2655 +++++++ boards/wr3e/wr3e.svg | 321 + boards/wr3l.json | 24 + boards/wr3l/index.html | 2655 +++++++ boards/wr3l/wr3l.svg | 321 + boards/wr3le.json | 24 + boards/wr3le/index.html | 2655 +++++++ boards/wr3le/wr3le.svg | 321 + boards/wr3n.json | 23 + boards/wr3n/index.html | 2639 +++++++ boards/wr3n/wr3n.svg | 281 + builder/family/beken-72xx.py | 551 ++ builder/family/realtek-ambz.py | 308 + builder/family/realtek-ambz2.py | 435 ++ builder/frameworks/arduino.py | 83 + builder/frameworks/base.py | 169 + builder/main.py | 135 + builder/python-venv.py | 122 + builder/utils/config.py | 85 + builder/utils/cores.py | 109 + builder/utils/env.py | 193 + builder/utils/flash.py | 117 + builder/utils/libs-external.py | 67 + builder/utils/libs-queue.py | 218 + builder/utils/ltchiptool-util.py | 100 + cores/beken-7231n/base/config/sys_config.h | 134 + cores/beken-7231n/base/fixups/temp_detect.c | 6 + cores/beken-7231n/base/lt_defs.h | 5 + cores/beken-7231q/base/config/sys_config.h | 105 + cores/beken-7231q/base/fixups/bk7231q.c | 26 + cores/beken-7231q/base/fixups/bk7231q.h | 19 + cores/beken-7231t/base/config/sys_config.h | 118 + cores/beken-7231t/base/lt_defs.h | 5 + cores/beken-7251/base/config/sys_config.h | 134 + cores/beken-7251/base/lt_defs.h | 5 + .../arduino/libraries/Serial/Serial.cpp | 92 + .../arduino/libraries/Serial/SerialPrivate.h | 14 + .../arduino/libraries/WiFi/WiFi.cpp | 63 + .../arduino/libraries/WiFi/WiFiAP.cpp | 126 + .../arduino/libraries/WiFi/WiFiEvents.cpp | 149 + .../arduino/libraries/WiFi/WiFiGeneric.cpp | 103 + .../arduino/libraries/WiFi/WiFiPrivate.h | 112 + .../arduino/libraries/WiFi/WiFiSTA.cpp | 248 + .../arduino/libraries/WiFi/WiFiScan.cpp | 105 + cores/beken-72xx/arduino/src/ArduinoFamily.h | 27 + cores/beken-72xx/arduino/src/lt_defs.h | 7 + cores/beken-72xx/arduino/src/main.cpp | 34 + cores/beken-72xx/arduino/src/wiring.c | 120 + cores/beken-72xx/arduino/src/wiring_analog.c | 150 + cores/beken-72xx/arduino/src/wiring_data.h | 26 + cores/beken-72xx/arduino/src/wiring_digital.c | 47 + cores/beken-72xx/arduino/src/wiring_irq.c | 70 + cores/beken-72xx/base/api/lt_cpu.c | 13 + cores/beken-72xx/base/api/lt_device.c | 43 + cores/beken-72xx/base/api/lt_flash.c | 26 + cores/beken-72xx/base/api/lt_init.c | 14 + cores/beken-72xx/base/api/lt_mem.c | 21 + cores/beken-72xx/base/api/lt_ota.c | 39 + cores/beken-72xx/base/api/lt_sleep.c | 39 + cores/beken-72xx/base/api/lt_wdt.c | 18 + cores/beken-72xx/base/config/lwipopts.h | 18 + cores/beken-72xx/base/fixups/arch_main.c | 61 + cores/beken-72xx/base/fixups/ate_app.c | 7 + .../base/fixups/boot_handlers_bk7231u.S | 499 ++ cores/beken-72xx/base/fixups/clock_cal.c | 127 + cores/beken-72xx/base/fixups/clock_rtos.c | 125 + cores/beken-72xx/base/fixups/gcc10.c | 7 + cores/beken-72xx/base/fixups/generic.h | 17 + cores/beken-72xx/base/fixups/include.h | 12 + cores/beken-72xx/base/fixups/intc.c | 420 ++ cores/beken-72xx/base/fixups/param_config.h | 8 + cores/beken-72xx/base/fixups/uart_pub.h | 16 + cores/beken-72xx/base/lt_defs.h | 18 + cores/beken-72xx/base/lt_family.h | 20 + .../base/port/fal_flash_bk72xx_port.c | 65 + cores/beken-72xx/base/port/printf.c | 18 + cores/beken-72xx/base/port/printf_port.h | 15 + cores/beken-72xx/base/sdk_extern.h | 26 + cores/beken-72xx/base/sdk_private.h | 40 + cores/beken-72xx/base/wraps/BkDriverFlash.c | 127 + cores/beken-72xx/base/wraps/wlan_ui.c | 32 + cores/beken-72xx/misc/bk7231_bsp.template.ld | 165 + cores/beken-72xx/misc/bk7231n_bsp.template.ld | 406 + cores/beken-72xx/misc/bk72xx.cfg | 48 + .../arduino/libraries/api/Serial/Serial.cpp | 36 + .../arduino/libraries/api/Serial/Serial.h | 57 + .../api/SoftwareSerial/SoftwareSerial.cpp | 45 + .../api/SoftwareSerial/SoftwareSerial.h | 76 + .../arduino/libraries/api/WiFi/WiFi.cpp | 77 + .../common/arduino/libraries/api/WiFi/WiFi.h | 201 + .../arduino/libraries/api/WiFi/WiFiAP.cpp | 23 + .../arduino/libraries/api/WiFi/WiFiEvents.cpp | 84 + .../arduino/libraries/api/WiFi/WiFiEvents.h | 173 + .../libraries/api/WiFi/WiFiGeneric.cpp | 154 + .../arduino/libraries/api/WiFi/WiFiSTA.cpp | 48 + .../arduino/libraries/api/WiFi/WiFiScan.cpp | 93 + .../arduino/libraries/api/WiFi/WiFiType.h | 189 + .../common/arduino/libraries/common/FS/FS.cpp | 228 + cores/common/arduino/libraries/common/FS/FS.h | 152 + .../common/IPv6Address/IPv6Address.cpp | 99 + .../common/IPv6Address/IPv6Address.h | 97 + .../common/IPv6Address/api/IPv6Address.h | 5 + .../common/arduino/libraries/common/MD5/MD5.h | 33 + .../libraries/common/MD5/MD5HostapdImpl.h | 19 + .../libraries/common/MD5/MD5MbedTLSImpl.cpp | 24 + .../libraries/common/MD5/MD5MbedTLSImpl.h | 19 + .../common/Preferences/Preferences.h | 85 + .../libraries/common/Update/Update.cpp | 210 + .../arduino/libraries/common/Update/Update.h | 176 + .../libraries/common/Update/UpdateUtil.cpp | 202 + .../common/WiFiClient/LwIPClient.cpp | 393 + .../libraries/common/WiFiClient/LwIPClient.h | 62 + .../common/WiFiClient/LwIPRxBuffer.cpp | 117 + .../common/WiFiClient/LwIPRxBuffer.h | 24 + .../common/WiFiClient/MbedTLSClient.cpp | 483 ++ .../common/WiFiClient/MbedTLSClient.h | 88 + .../libraries/common/WiFiClient/WiFiClient.h | 78 + .../common/WiFiClient/WiFiClientSecure.h | 53 + .../common/WiFiServer/LwIPServer.cpp | 143 + .../libraries/common/WiFiServer/LwIPServer.h | 50 + .../libraries/common/WiFiServer/WiFiServer.h | 76 + .../libraries/common/WiFiUdp/LwIPUdp.cpp | 285 + .../libraries/common/WiFiUdp/LwIPUdp.h | 49 + .../libraries/common/WiFiUdp/WiFiUdp.h | 36 + .../libraries/common/mDNS/LwIPmDNS.cpp | 203 + .../arduino/libraries/common/mDNS/mDNS.cpp | 40 + .../arduino/libraries/common/mDNS/mDNS.h | 128 + .../libraries/ext/HTTPClient/HTTPClient.cpp | 1625 ++++ .../libraries/ext/HTTPClient/HTTPClient.h | 305 + .../ext/StreamString/StreamString.cpp | 61 + .../libraries/ext/StreamString/StreamString.h | 39 + .../libraries/ext/WebServer/HTTP_Method.h | 56 + .../libraries/ext/WebServer/Parsing.cpp | 609 ++ .../arduino/libraries/ext/WebServer/Uri.h | 29 + .../libraries/ext/WebServer/WebServer.cpp | 721 ++ .../libraries/ext/WebServer/WebServer.h | 224 + .../ext/WebServer/detail/RequestHandler.h | 53 + .../WebServer/detail/RequestHandlersImpl.h | 149 + .../ext/WebServer/detail/mimetable.cpp | 33 + .../ext/WebServer/detail/mimetable.h | 38 + .../libraries/ext/WebServer/uri/UriBraces.h | 61 + .../libraries/ext/WebServer/uri/UriGlob.h | 19 + .../libraries/ext/WebServer/uri/UriRegex.h | 41 + .../libraries/ext/WiFiMulti/WiFiMulti.cpp | 248 + .../libraries/ext/WiFiMulti/WiFiMulti.h | 47 + .../arduino/libraries/ext/base64/base64.cpp | 64 + .../arduino/libraries/ext/base64/base64.h | 9 + .../libraries/ext/base64/libb64/AUTHORS | 7 + .../libraries/ext/base64/libb64/LICENSE | 29 + .../libraries/ext/base64/libb64/cdecode.c | 99 + .../libraries/ext/base64/libb64/cdecode.h | 38 + .../libraries/ext/base64/libb64/cencode.c | 102 + .../libraries/ext/base64/libb64/cencode.h | 41 + .../arduino/libraries/ext/cbuf/cbuf.cpp | 196 + .../common/arduino/libraries/ext/cbuf/cbuf.h | 79 + .../common/arduino/libraries/inline/ESP/ESP.h | 157 + .../arduino/libraries/inline/Flash/Flash.h | 64 + cores/common/arduino/libraries/inline/LT/LT.h | 151 + .../common/arduino/libraries/inline/OTA/OTA.h | 77 + .../arduino/libraries/inline/Singletons.cpp | 11 + .../common/arduino/libraries/inline/WDT/WDT.h | 41 + cores/common/arduino/src/Arduino.h | 61 + cores/common/arduino/src/Events.cpp | 5 + cores/common/arduino/src/Events.h | 117 + cores/common/arduino/src/HardwareI2C.h | 66 + cores/common/arduino/src/common/abi.cpp | 36 + cores/common/arduino/src/common/dtostrf.c | 28 + .../arduino/src/common/serial_event.cpp | 11 + cores/common/arduino/src/compat/ESPmDNS.h | 5 + cores/common/arduino/src/compat/FS.h | 5 + cores/common/arduino/src/compat/FSImpl.h | 3 + cores/common/arduino/src/compat/WiFiAP.h | 7 + cores/common/arduino/src/compat/md5.h | 6 + cores/common/arduino/src/compat/pgmspace.h | 5 + cores/common/arduino/src/compat/vfs_api.h | 3 + cores/common/arduino/src/main.c | 27 + cores/common/arduino/src/posix/time.c | 50 + cores/common/arduino/src/wiring/wiring.c | 22 + .../arduino/src/wiring/wiring_compat.cpp | 9 + .../common/arduino/src/wiring/wiring_compat.h | 42 + .../common/arduino/src/wiring/wiring_custom.c | 145 + .../common/arduino/src/wiring/wiring_custom.h | 100 + cores/common/arduino/src/wiring/wiring_irq.c | 7 + .../common/arduino/src/wiring/wiring_math.cpp | 43 + .../arduino/src/wiring/wiring_private.c | 25 + .../arduino/src/wiring/wiring_private.h | 64 + .../common/arduino/src/wiring/wiring_shift.c | 54 + cores/common/base/api/lt_cpu.c | 58 + cores/common/base/api/lt_cpu.h | 68 + cores/common/base/api/lt_device.c | 84 + cores/common/base/api/lt_device.h | 115 + cores/common/base/api/lt_flash.c | 39 + cores/common/base/api/lt_flash.h | 64 + cores/common/base/api/lt_init.h | 26 + cores/common/base/api/lt_mem.c | 26 + cores/common/base/api/lt_mem.h | 30 + cores/common/base/api/lt_ota.c | 156 + cores/common/base/api/lt_ota.h | 135 + cores/common/base/api/lt_sleep.c | 11 + cores/common/base/api/lt_sleep.h | 31 + cores/common/base/api/lt_utils.c | 74 + cores/common/base/api/lt_utils.h | 67 + cores/common/base/api/lt_wdt.c | 11 + cores/common/base/api/lt_wdt.h | 23 + cores/common/base/compat/certs.h | 5 + cores/common/base/compat/err.h | 5 + cores/common/base/compat/lwip/lwip_timers.h | 5 + cores/common/base/compat/netdb.h | 5 + cores/common/base/compat/netif.h | 5 + cores/common/base/compat/sockets.h | 5 + cores/common/base/compat/sys.h | 5 + cores/common/base/compat/tcpip.h | 5 + cores/common/base/compat/udp.h | 11 + cores/common/base/config/fal_cfg.h | 47 + cores/common/base/config/fdb_cfg.h | 48 + cores/common/base/config/lwipopts.h | 95 + cores/common/base/config/printf_config.h | 155 + cores/common/base/fixups/errno.h | 22 + cores/common/base/fixups/lwip/errno.h | 5 + cores/common/base/fixups/malloc.c | 88 + cores/common/base/libretiny.h | 50 + cores/common/base/lt_api.h | 25 + cores/common/base/lt_config.h | 132 + cores/common/base/lt_logger.c | 178 + cores/common/base/lt_logger.h | 177 + cores/common/base/lt_main.c | 31 + cores/common/base/lt_pins.h | 69 + cores/common/base/lt_posix_api.h | 9 + cores/common/base/lt_types.h | 47 + cores/common/base/posix/itoa.c | 111 + cores/common/base/posix/strcasecmp.c | 97 + cores/common/base/posix/strdup.c | 13 + cores/common/base/posix/strptime.c | 197 + cores/common/base/wraps/putchar.c | 9 + cores/common/base/wraps/puts.c | 21 + .../SoftwareSerial/SoftwareSerial.cpp | 100 + .../arduino/libraries/WiFi/WiFi.cpp | 36 + .../arduino/libraries/WiFi/WiFiAP.cpp | 148 + .../arduino/libraries/WiFi/WiFiEvents.cpp | 208 + .../arduino/libraries/WiFi/WiFiGeneric.cpp | 234 + .../arduino/libraries/WiFi/WiFiPrivate.h | 99 + .../arduino/libraries/WiFi/WiFiSTA.cpp | 224 + .../arduino/libraries/WiFi/WiFiScan.cpp | 60 + .../arduino/libraries/Wire/Wire.cpp | 197 + .../realtek-amb/arduino/libraries/Wire/Wire.h | 68 + cores/realtek-amb/arduino/src/ArduinoFamily.h | 27 + cores/realtek-amb/arduino/src/api/lt_cpu.c | 8 + cores/realtek-amb/arduino/src/lt_defs.h | 8 + cores/realtek-amb/arduino/src/main.cpp | 31 + cores/realtek-amb/arduino/src/wiring.c | 72 + cores/realtek-amb/arduino/src/wiring_analog.c | 80 + cores/realtek-amb/arduino/src/wiring_data.h | 24 + .../realtek-amb/arduino/src/wiring_digital.c | 71 + cores/realtek-amb/arduino/src/wiring_irq.c | 79 + cores/realtek-amb/arduino/src/wiring_pulse.c | 76 + cores/realtek-amb/base/api/lt_flash.c | 14 + cores/realtek-amb/base/api/lt_wdt.c | 18 + cores/realtek-amb/base/config/build_info.h | 18 + cores/realtek-amb/base/config/lwipopts.h | 33 + cores/realtek-amb/base/config/main.h | 45 + cores/realtek-amb/base/fixups/basic_types.h | 19 + cores/realtek-amb/base/fixups/cmsis_ipsr.c | 11 + .../realtek-amb/base/fixups/machine/endian.h | 21 + .../base/fixups/platform/platform_stdlib.h | 3 + .../realtek-amb/base/fixups/platform_stdlib.h | 26 + .../realtek-amb/base/fixups/section_config.h | 6 + cores/realtek-amb/base/fixups/wifi_mode.c | 6 + cores/realtek-amb/base/lt_defs.h | 10 + .../base/port/fal_flash_ambz_port.c | 41 + cores/realtek-amb/base/sdk_private.h | 92 + .../arduino/libraries/Serial/Serial.cpp | 135 + .../arduino/libraries/Serial/SerialPrivate.h | 19 + cores/realtek-ambz/arduino/src/lt_defs.h | 6 + cores/realtek-ambz/base/api/lt_cpu.c | 34 + cores/realtek-ambz/base/api/lt_device.c | 39 + cores/realtek-ambz/base/api/lt_flash.c | 14 + cores/realtek-ambz/base/api/lt_init.c | 16 + cores/realtek-ambz/base/api/lt_mem.c | 8 + cores/realtek-ambz/base/api/lt_ota.c | 78 + .../realtek-ambz/base/config/FreeRTOSConfig.h | 8 + .../realtek-ambz/base/config/platform_opts.h | 14 + .../base/fixups/app_start_patch.c | 118 + cores/realtek-ambz/base/fixups/cmsis.h | 50 + cores/realtek-ambz/base/fixups/hal_crypto.h | 12 + .../base/fixups/lib_rtlstd_patch.a | Bin 0 -> 13516 bytes .../base/fixups/lib_rtlstd_patch/index.html | 2298 ++++++ cores/realtek-ambz/base/fixups/log_uart.c | 30 + cores/realtek-ambz/base/fixups/memproc.h | 9 + cores/realtek-ambz/base/fixups/net_sockets.c | 739 ++ cores/realtek-ambz/base/fixups/strproc.h | 8 + cores/realtek-ambz/base/lt_defs.h | 10 + cores/realtek-ambz/base/lt_family.h | 28 + cores/realtek-ambz/base/port/printf.c | 44 + cores/realtek-ambz/base/port/printf_port.h | 18 + cores/realtek-ambz/base/sdk_extern.h | 17 + cores/realtek-ambz/base/wraps/stdlib.c | 115 + cores/realtek-ambz/misc/amebaz.cfg | 59 + cores/realtek-ambz/misc/boot_all_10C7.bin | Bin 0 -> 4120 bytes cores/realtek-ambz/misc/boot_all_77F7.bin | Bin 0 -> 4620 bytes cores/realtek-ambz/misc/boot_all_C556.bin | Bin 0 -> 4356 bytes .../misc/export-rom_symbol_v01.txt | 1427 ++++ .../rlx8711B-symbol-v02-img2_xip1.template.ld | 222 + .../rlx8711B-symbol-v02-img2_xip2.template.ld | 222 + .../arduino/libraries/Serial/Serial.cpp | 102 + .../arduino/libraries/Serial/SerialPrivate.h | 18 + cores/realtek-ambz2/arduino/src/lt_defs.h | 9 + cores/realtek-ambz2/base/api/lt_cpu.c | 21 + cores/realtek-ambz2/base/api/lt_device.c | 61 + cores/realtek-ambz2/base/api/lt_init.c | 14 + cores/realtek-ambz2/base/api/lt_mem.c | 8 + cores/realtek-ambz2/base/api/lt_ota.c | 24 + cores/realtek-ambz2/base/config/lwipopts.h | 10 + .../realtek-ambz2/base/config/platform_conf.h | 22 + .../realtek-ambz2/base/config/platform_opts.h | 9 + cores/realtek-ambz2/base/fixups/cmd_shell.c | 7 + cores/realtek-ambz2/base/fixups/cmsis.h | 10 + cores/realtek-ambz2/base/fixups/diag.h | 19 + cores/realtek-ambz2/base/fixups/hal_flash.h | 13 + cores/realtek-ambz2/base/fixups/memory.c | 32 + cores/realtek-ambz2/base/fixups/memory.h | 17 + .../base/fixups/rtl8710c_freertos_pmu.h | 11 + cores/realtek-ambz2/base/fixups/strproc.c | 168 + cores/realtek-ambz2/base/fixups/strproc.h | 22 + cores/realtek-ambz2/base/fixups/time64.h | 8 + cores/realtek-ambz2/base/fixups/utility.h | 6 + cores/realtek-ambz2/base/fixups/wireless.h | 5 + cores/realtek-ambz2/base/lt_defs.h | 10 + cores/realtek-ambz2/base/lt_family.h | 22 + cores/realtek-ambz2/base/port/printf.c | 29 + cores/realtek-ambz2/base/port/printf_port.h | 16 + cores/realtek-ambz2/base/sdk_extern.h | 28 + cores/realtek-ambz2/misc/rtl8710c_ram.ld | 395 + docs/CNAME | 1 + docs/TODO/index.html | 2537 +++++++ docs/boards_tuya_all.json | 768 ++ docs/contrib/lt-api-functions/index.html | 2718 +++++++ docs/contrib/lt-api/index.html | 2751 +++++++ docs/contrib/ota/index.html | 2547 +++++++ docs/contrib/ota/library/index.html | 2408 ++++++ docs/contrib/ota/uf2ota/index.html | 2362 ++++++ docs/contrib/porting/index.html | 2508 ++++++ docs/contrib/project-structure/index.html | 2348 ++++++ docs/contrib/stdlib/index.html | 2406 ++++++ docs/dev/config/index.html | 2622 +++++++ docs/dev/libs-3rd-party/index.html | 2424 ++++++ docs/dev/lt-api/index.html | 3580 +++++++++ docs/dev/migration_v1.0.0/index.html | 2420 ++++++ docs/flashing/SUMMARY/index.html | 2294 ++++++ docs/flashing/dumping/index.html | 2309 ++++++ docs/flashing/esphome/index.html | 2508 ++++++ docs/flashing/platformio/index.html | 2392 ++++++ docs/flashing/tools/adr/index.html | 2394 ++++++ docs/flashing/tools/cloudcutter/index.html | 2454 ++++++ docs/flashing/tools/ltchiptool/index.html | 2648 +++++++ docs/getting-started/gpio/index.html | 2404 ++++++ docs/getting-started/index.html | 2402 ++++++ docs/inc/find-board/index.html | 2284 ++++++ docs/inc/flashing-note/index.html | 2288 ++++++ docs/inc/ota-cloudcutter/index.html | 2312 ++++++ docs/inc/ota-openbeken/index.html | 2308 ++++++ docs/inc/uart-adr/index.html | 2284 ++++++ docs/inc/uart-cen/index.html | 2288 ++++++ docs/inc/uart-info/index.html | 2284 ++++++ docs/inc/uart-ltchiptool/index.html | 2311 ++++++ docs/inc/uart-power/index.html | 2288 ++++++ docs/index.html | 2294 ++++++ docs/platform/SUMMARY/index.html | 2290 ++++++ docs/platform/beken-72xx/index.html | 2687 +++++++ docs/platform/beken-72xx/keys/index.html | 2433 ++++++ docs/platform/realtek-amb/index.html | 2573 +++++++ .../realtek-ambz/debugging/index.html | 2656 +++++++ .../realtek-ambz/exception-decoder/index.html | 2314 ++++++ docs/platform/realtek-ambz/index.html | 2509 ++++++ docs/projects/esphome/index.html | 2645 +++++++ docs/requirements.txt | 8 + docs/resources/SUMMARY/index.html | 2283 ++++++ docs/resources/beken-flash/index.html | 3283 ++++++++ docs/resources/documents/index.html | 2420 ++++++ docs/resources/tuya-pin-config/index.html | 3453 +++++++++ docs/script.js | 6 + .../__pycache__/markdown.cpython-310.pyc | Bin 0 -> 3498 bytes .../__pycache__/write_boards.cpython-310.pyc | Bin 0 -> 11176 bytes docs/scripts/build_json.py | 17 + docs/scripts/markdown.py | 71 + docs/scripts/prepare_doxygen.py | 38 + docs/scripts/write_apis.py | 129 + docs/scripts/write_boards.py | 481 ++ docs/status/supported/index.html | 3737 +++++++++ docs/status/supported_boards/index.html | 2797 +++++++ docs/status/supported_chips/index.html | 2307 ++++++ docs/status/supported_families/index.html | 2371 ++++++ .../unsupported_boards_tuya_all/index.html | 2811 +++++++ docs/style.css | 32 + examples/PinScan/index.html | 2578 +++++++ examples/PinScan/platformio.ini | 12 + examples/PinScan/src/analog.cpp | 70 + examples/PinScan/src/digital.cpp | 210 + examples/PinScan/src/help.cpp | 67 + examples/PinScan/src/pinscan.cpp | 185 + examples/PinScan/src/pinscan.h | 39 + examples/PinScan/src/ui.cpp | 37 + examples/SUMMARY/index.html | 2289 ++++++ external-libs.json | 145 + external-libs.schema.json | 65 + families.json | 104 + families.schema.json | 48 + index.html | 2394 ++++++ link/bk72xx-keys/index.html | 15 + link/boards/index.html | 15 + link/cloudcutter-digiblur/index.html | 15 + link/cloudcutter-video/index.html | 15 + link/config-debug/index.html | 15 + link/config-serial/index.html | 15 + link/config/index.html | 15 + link/flashing-beken-72xx/index.html | 15 + link/flashing-realtek-ambz/index.html | 15 + link/gpio-access/index.html | 15 + link/kickstart/index.html | 15 + ltapi/_arduino_8h/index.html | 2309 ++++++ ltapi/_arduino_8h_source/index.html | 2355 ++++++ ltapi/_e_s_p_8h/index.html | 2374 ++++++ ltapi/_e_s_p_8h_source/index.html | 2380 ++++++ ltapi/_e_s_pm_d_n_s_8h/index.html | 2298 ++++++ ltapi/_e_s_pm_d_n_s_8h_source/index.html | 2299 ++++++ ltapi/_events_8cpp/index.html | 2298 ++++++ ltapi/_events_8cpp_source/index.html | 2299 ++++++ ltapi/_events_8h/index.html | 2594 +++++++ ltapi/_events_8h_source/index.html | 2411 ++++++ ltapi/_f_s_8cpp/index.html | 2298 ++++++ ltapi/_f_s_8cpp_source/index.html | 2522 +++++++ ltapi/_f_s_impl_8h/index.html | 2295 ++++++ ltapi/_f_s_impl_8h_source/index.html | 2297 ++++++ ltapi/_flash_8h/index.html | 2374 ++++++ ltapi/_flash_8h_source/index.html | 2327 ++++++ ltapi/_h_t_t_p___method_8h/index.html | 2443 ++++++ ltapi/_h_t_t_p___method_8h_source/index.html | 2350 ++++++ ltapi/_h_t_t_p_client_8cpp/index.html | 2295 ++++++ ltapi/_h_t_t_p_client_8cpp_source/index.html | 3717 +++++++++ ltapi/_h_t_t_p_client_8h/index.html | 2746 +++++++ ltapi/_h_t_t_p_client_8h_source/index.html | 2551 +++++++ ltapi/_hardware_i2_c_8h/index.html | 2328 ++++++ ltapi/_hardware_i2_c_8h_source/index.html | 2360 ++++++ ltapi/_i_pv6_address_8cpp/index.html | 2300 ++++++ ltapi/_i_pv6_address_8cpp_source/index.html | 2393 ++++++ ltapi/_i_pv6_address_8h/index.html | 2352 ++++++ ltapi/_i_pv6_address_8h_source/index.html | 2391 ++++++ ltapi/_l_t_8h/index.html | 2465 ++++++ ltapi/_l_t_8h_source/index.html | 2373 ++++++ ltapi/_lw_i_p_client_8cpp/index.html | 2295 ++++++ ltapi/_lw_i_p_client_8cpp_source/index.html | 2687 +++++++ ltapi/_lw_i_p_client_8h/index.html | 2376 ++++++ ltapi/_lw_i_p_client_8h_source/index.html | 2356 ++++++ ltapi/_lw_i_p_rx_buffer_8cpp/index.html | 2295 ++++++ .../_lw_i_p_rx_buffer_8cpp_source/index.html | 2411 ++++++ ltapi/_lw_i_p_rx_buffer_8h/index.html | 2329 ++++++ ltapi/_lw_i_p_rx_buffer_8h_source/index.html | 2318 ++++++ ltapi/_lw_i_p_server_8cpp/index.html | 2295 ++++++ ltapi/_lw_i_p_server_8cpp_source/index.html | 2437 ++++++ ltapi/_lw_i_p_server_8h/index.html | 2374 ++++++ ltapi/_lw_i_p_server_8h_source/index.html | 2344 ++++++ ltapi/_lw_i_p_udp_8cpp/index.html | 2295 ++++++ ltapi/_lw_i_p_udp_8cpp_source/index.html | 2579 +++++++ ltapi/_lw_i_p_udp_8h/index.html | 2375 ++++++ ltapi/_lw_i_p_udp_8h_source/index.html | 2343 ++++++ ltapi/_lw_i_pm_d_n_s_8cpp/index.html | 2295 ++++++ ltapi/_lw_i_pm_d_n_s_8cpp_source/index.html | 2497 ++++++ ltapi/_m_d5_hostapd_impl_8h/index.html | 2371 ++++++ ltapi/_m_d5_hostapd_impl_8h_source/index.html | 2313 ++++++ ltapi/_m_d5_mbed_t_l_s_impl_8cpp/index.html | 2295 ++++++ .../index.html | 2318 ++++++ ltapi/_m_d5_mbed_t_l_s_impl_8h/index.html | 2371 ++++++ .../index.html | 2313 ++++++ ltapi/_mbed_t_l_s_client_8cpp/index.html | 2295 ++++++ .../_mbed_t_l_s_client_8cpp_source/index.html | 2777 +++++++ ltapi/_mbed_t_l_s_client_8h/index.html | 2374 ++++++ ltapi/_mbed_t_l_s_client_8h_source/index.html | 2382 ++++++ ltapi/_o_t_a_8h/index.html | 2374 ++++++ ltapi/_o_t_a_8h_source/index.html | 2322 ++++++ ltapi/_parsing_8cpp/index.html | 2295 ++++++ ltapi/_parsing_8cpp_source/index.html | 2903 +++++++ ltapi/_preferences_8h/index.html | 2389 ++++++ ltapi/_preferences_8h_source/index.html | 2379 ++++++ ltapi/_request_handler_8h/index.html | 2329 ++++++ ltapi/_request_handler_8h_source/index.html | 2347 ++++++ ltapi/_request_handlers_impl_8h/index.html | 2335 ++++++ .../index.html | 2443 ++++++ ltapi/_serial_8cpp/index.html | 2298 ++++++ ltapi/_serial_8cpp_source/index.html | 2330 ++++++ ltapi/_serial_8h/index.html | 2376 ++++++ ltapi/_serial_8h_source/index.html | 2351 ++++++ ltapi/_singletons_8cpp/index.html | 2409 ++++++ ltapi/_singletons_8cpp_source/index.html | 2305 ++++++ ltapi/_software_serial_8cpp/index.html | 2298 ++++++ ltapi/_software_serial_8cpp_source/index.html | 2339 ++++++ ltapi/_software_serial_8h/index.html | 2397 ++++++ ltapi/_software_serial_8h_source/index.html | 2370 ++++++ ltapi/_stream_string_8cpp/index.html | 2299 ++++++ ltapi/_stream_string_8cpp_source/index.html | 2333 ++++++ ltapi/_stream_string_8h/index.html | 2325 ++++++ ltapi/_stream_string_8h_source/index.html | 2312 ++++++ ltapi/_update_8cpp/index.html | 2470 ++++++ ltapi/_update_8cpp_source/index.html | 2467 ++++++ ltapi/_update_8h/index.html | 2529 +++++++ ltapi/_update_8h_source/index.html | 2434 ++++++ ltapi/_update_util_8cpp/index.html | 2510 ++++++ ltapi/_update_util_8cpp_source/index.html | 2450 ++++++ ltapi/_uri_8h/index.html | 2329 ++++++ ltapi/_uri_8h_source/index.html | 2323 ++++++ ltapi/_uri_braces_8h/index.html | 2328 ++++++ ltapi/_uri_braces_8h_source/index.html | 2355 ++++++ ltapi/_uri_glob_8h/index.html | 2329 ++++++ ltapi/_uri_glob_8h_source/index.html | 2313 ++++++ ltapi/_uri_regex_8h/index.html | 2329 ++++++ ltapi/_uri_regex_8h_source/index.html | 2335 ++++++ ltapi/_w_d_t_8h/index.html | 2374 ++++++ ltapi/_w_d_t_8h_source/index.html | 2314 ++++++ ltapi/_web_server_8cpp/index.html | 2295 ++++++ ltapi/_web_server_8cpp_source/index.html | 3015 ++++++++ ltapi/_web_server_8h/index.html | 2589 +++++++ ltapi/_web_server_8h_source/index.html | 2518 +++++++ ltapi/_wi_fi_8cpp/index.html | 2414 ++++++ ltapi/_wi_fi_8cpp_source/index.html | 2371 ++++++ ltapi/_wi_fi_8h/index.html | 2397 ++++++ ltapi/_wi_fi_8h_source/index.html | 2495 ++++++ ltapi/_wi_fi_a_p_8cpp/index.html | 2354 ++++++ ltapi/_wi_fi_a_p_8cpp_source/index.html | 2317 ++++++ ltapi/_wi_fi_a_p_8h/index.html | 2298 ++++++ ltapi/_wi_fi_a_p_8h_source/index.html | 2301 ++++++ ltapi/_wi_fi_client_8h/index.html | 2329 ++++++ ltapi/_wi_fi_client_8h_source/index.html | 2372 ++++++ ltapi/_wi_fi_client_secure_8h/index.html | 2329 ++++++ .../_wi_fi_client_secure_8h_source/index.html | 2347 ++++++ ltapi/_wi_fi_events_8cpp/index.html | 2298 ++++++ ltapi/_wi_fi_events_8cpp_source/index.html | 2378 ++++++ ltapi/_wi_fi_events_8h/index.html | 2625 +++++++ ltapi/_wi_fi_events_8h_source/index.html | 2443 ++++++ ltapi/_wi_fi_generic_8cpp/index.html | 2354 ++++++ ltapi/_wi_fi_generic_8cpp_source/index.html | 2448 ++++++ ltapi/_wi_fi_multi_8cpp/index.html | 2305 ++++++ ltapi/_wi_fi_multi_8cpp_source/index.html | 2517 +++++++ ltapi/_wi_fi_multi_8h/index.html | 2333 ++++++ ltapi/_wi_fi_multi_8h_source/index.html | 2316 ++++++ ltapi/_wi_fi_s_t_a_8cpp/index.html | 2354 ++++++ ltapi/_wi_fi_s_t_a_8cpp_source/index.html | 2342 ++++++ ltapi/_wi_fi_scan_8cpp/index.html | 2298 ++++++ ltapi/_wi_fi_scan_8cpp_source/index.html | 2387 ++++++ ltapi/_wi_fi_server_8h/index.html | 2331 ++++++ ltapi/_wi_fi_server_8h_source/index.html | 2370 ++++++ ltapi/_wi_fi_type_8h/index.html | 2918 +++++++ ltapi/_wi_fi_type_8h_source/index.html | 2483 ++++++ ltapi/_wi_fi_udp_8h/index.html | 2329 ++++++ ltapi/_wi_fi_udp_8h_source/index.html | 2330 ++++++ ltapi/abi_8cpp/index.html | 2370 ++++++ ltapi/abi_8cpp_source/index.html | 2330 ++++++ ltapi/annotated/index.html | 2378 ++++++ ltapi/api_2_i_pv6_address_8h/index.html | 2298 ++++++ .../api_2_i_pv6_address_8h_source/index.html | 2299 ++++++ ltapi/base64_8cpp/index.html | 2301 ++++++ ltapi/base64_8cpp_source/index.html | 2322 ++++++ ltapi/base64_8h/index.html | 2328 ++++++ ltapi/base64_8h_source/index.html | 2303 ++++++ ltapi/cbuf_8cpp/index.html | 2298 ++++++ ltapi/cbuf_8cpp_source/index.html | 2490 ++++++ ltapi/cbuf_8h/index.html | 2330 ++++++ ltapi/cbuf_8h_source/index.html | 2373 ++++++ ltapi/cdecode_8c/index.html | 2493 ++++++ ltapi/cdecode_8c_source/index.html | 2393 ++++++ ltapi/cdecode_8h/index.html | 2525 +++++++ ltapi/cdecode_8h_source/index.html | 2332 ++++++ ltapi/cencode_8c/index.html | 2424 ++++++ ltapi/cencode_8c_source/index.html | 2396 ++++++ ltapi/cencode_8h/index.html | 2541 +++++++ ltapi/cencode_8h_source/index.html | 2335 ++++++ ltapi/certs_8h/index.html | 2298 ++++++ ltapi/certs_8h_source/index.html | 2299 ++++++ ltapi/class_esp_class/index.html | 2616 +++++++ ltapi/class_flash_class/index.html | 2538 +++++++ .../class_function_request_handler/index.html | 2603 +++++++ ltapi/class_h_t_t_p_client/index.html | 4448 +++++++++++ ltapi/class_hardware_i2_c/index.html | 2767 +++++++ ltapi/class_i_preferences/index.html | 3033 ++++++++ ltapi/class_i_wi_fi_client/index.html | 2914 +++++++ ltapi/class_i_wi_fi_client_secure/index.html | 2806 +++++++ ltapi/class_i_wi_fi_server/index.html | 2771 +++++++ ltapi/class_i_wi_fi_u_d_p/index.html | 2885 +++++++ ltapi/class_libre_tiny/index.html | 2522 +++++++ ltapi/class_libre_tiny_o_t_a/index.html | 2409 ++++++ ltapi/class_libre_tiny_w_d_t/index.html | 2358 ++++++ ltapi/class_lw_i_p_client/index.html | 2905 +++++++ ltapi/class_lw_i_p_rx_buffer/index.html | 2424 ++++++ ltapi/class_lw_i_p_server/index.html | 2633 +++++++ ltapi/class_lw_i_p_u_d_p/index.html | 2795 +++++++ ltapi/class_mbed_t_l_s_client/index.html | 3250 ++++++++ ltapi/class_member_enums/index.html | 2291 ++++++ ltapi/class_member_functions/index.html | 2967 ++++++++ ltapi/class_member_typedefs/index.html | 2311 ++++++ ltapi/class_member_variables/index.html | 2760 +++++++ ltapi/class_members/index.html | 3222 ++++++++ ltapi/class_request_handler/index.html | 2510 ++++++ ltapi/class_serial_class/index.html | 2565 +++++++ ltapi/class_software_serial/index.html | 2618 +++++++ ltapi/class_static_request_handler/index.html | 2629 +++++++ ltapi/class_stream_string/index.html | 2433 ++++++ ltapi/class_update_class/index.html | 3153 ++++++++ ltapi/class_uri/index.html | 2490 ++++++ ltapi/class_uri_braces/index.html | 2485 ++++++ ltapi/class_uri_glob/index.html | 2470 ++++++ ltapi/class_uri_regex/index.html | 2485 ++++++ ltapi/class_web_server/index.html | 4817 ++++++++++++ ltapi/class_wi_fi_class/index.html | 4623 ++++++++++++ ltapi/class_wi_fi_multi/index.html | 2485 ++++++ .../classarduino_1_1_i_pv6_address/index.html | 2910 +++++++ ltapi/classbase64/index.html | 2387 ++++++ ltapi/classcbuf/index.html | 2787 +++++++ ltapi/classes/index.html | 2667 +++++++ ltapi/classfs_1_1_f_s/index.html | 2594 +++++++ ltapi/classfs_1_1_f_s_impl/index.html | 2461 ++++++ ltapi/classfs_1_1_file/index.html | 2715 +++++++ ltapi/classfs_1_1_file_impl/index.html | 2575 +++++++ ltapi/classm_d_n_s/index.html | 3059 ++++++++ .../index.html | 2328 ++++++ .../index.html | 2324 ++++++ .../index.html | 2328 ++++++ .../index.html | 2324 ++++++ .../index.html | 2350 ++++++ .../index.html | 2336 ++++++ .../index.html | 2350 ++++++ .../index.html | 2348 ++++++ .../index.html | 2324 ++++++ .../index.html | 2328 ++++++ .../index.html | 2324 ++++++ .../index.html | 2324 ++++++ .../index.html | 2328 ++++++ .../index.html | 2336 ++++++ .../index.html | 2328 ++++++ .../index.html | 2324 ++++++ .../index.html | 2332 ++++++ .../index.html | 2332 ++++++ .../index.html | 2332 ++++++ .../index.html | 2328 ++++++ .../index.html | 2344 ++++++ .../index.html | 2398 ++++++ .../index.html | 2360 ++++++ .../index.html | 2324 ++++++ .../index.html | 2336 ++++++ .../index.html | 2336 ++++++ .../index.html | 2336 ++++++ .../index.html | 2356 ++++++ .../index.html | 2324 ++++++ .../index.html | 2418 ++++++ .../index.html | 2332 ++++++ .../index.html | 2328 ++++++ .../index.html | 2336 ++++++ .../index.html | 2328 ++++++ .../index.html | 2328 ++++++ .../index.html | 2328 ++++++ .../index.html | 2324 ++++++ .../index.html | 2332 ++++++ .../index.html | 2437 ++++++ .../index.html | 2374 ++++++ .../index.html | 2332 ++++++ .../index.html | 2374 ++++++ .../index.html | 2332 ++++++ .../index.html | 2324 ++++++ .../index.html | 2324 ++++++ .../index.html | 2350 ++++++ .../index.html | 2352 ++++++ .../index.html | 2366 ++++++ .../index.html | 2356 ++++++ ltapi/dtostrf_8c/index.html | 2357 ++++++ ltapi/dtostrf_8c_source/index.html | 2322 ++++++ ltapi/err_8h/index.html | 2298 ++++++ ltapi/err_8h_source/index.html | 2299 ++++++ ltapi/errno_8h/index.html | 2398 ++++++ ltapi/errno_8h_source/index.html | 2316 ++++++ ltapi/fal__cfg_8h/index.html | 2554 +++++++ ltapi/fal__cfg_8h_source/index.html | 2337 ++++++ ltapi/fdb__cfg_8h/index.html | 2393 ++++++ ltapi/fdb__cfg_8h_source/index.html | 2342 ++++++ ltapi/files/index.html | 2574 +++++++ ltapi/functions/index.html | 2718 +++++++ ltapi/hierarchy/index.html | 2401 ++++++ ltapi/itoa_8c/index.html | 2410 ++++++ ltapi/itoa_8c_source/index.html | 2405 ++++++ .../index.html | 2437 ++++++ .../index.html | 2446 ++++++ .../index.html | 2618 +++++++ .../index.html | 2327 ++++++ ltapi/libretiny_8h/index.html | 2488 ++++++ ltapi/libretiny_8h_source/index.html | 2344 ++++++ ltapi/links/index.html | 2804 +++++++ ltapi/lt__api_8h/index.html | 2306 ++++++ ltapi/lt__api_8h_source/index.html | 2319 ++++++ ltapi/lt__config_8h/index.html | 2811 +++++++ ltapi/lt__config_8h_source/index.html | 2426 ++++++ ltapi/lt__cpu_8c/index.html | 2424 ++++++ ltapi/lt__cpu_8c_source/index.html | 2352 ++++++ ltapi/lt__cpu_8h/index.html | 2506 ++++++ ltapi/lt__cpu_8h_source/index.html | 2323 ++++++ ltapi/lt__device_8c/index.html | 2463 ++++++ ltapi/lt__device_8c_source/index.html | 2378 ++++++ ltapi/lt__device_8h/index.html | 2803 +++++++ ltapi/lt__device_8h_source/index.html | 2358 ++++++ ltapi/lt__flash_8c/index.html | 2457 ++++++ ltapi/lt__flash_8c_source/index.html | 2333 ++++++ ltapi/lt__flash_8h/index.html | 2492 ++++++ ltapi/lt__flash_8h_source/index.html | 2317 ++++++ ltapi/lt__init_8h/index.html | 2380 ++++++ ltapi/lt__init_8h_source/index.html | 2305 ++++++ ltapi/lt__logger_8c/index.html | 2722 +++++++ ltapi/lt__logger_8c_source/index.html | 2472 ++++++ ltapi/lt__logger_8h/index.html | 3260 ++++++++ ltapi/lt__logger_8h_source/index.html | 2463 ++++++ ltapi/lt__main_8c/index.html | 2433 ++++++ ltapi/lt__main_8c_source/index.html | 2325 ++++++ ltapi/lt__mem_8c/index.html | 2354 ++++++ ltapi/lt__mem_8c_source/index.html | 2320 ++++++ ltapi/lt__mem_8h/index.html | 2408 ++++++ ltapi/lt__mem_8h_source/index.html | 2309 ++++++ ltapi/lt__ota_8c/index.html | 2553 +++++++ ltapi/lt__ota_8c_source/index.html | 2450 ++++++ ltapi/lt__ota_8h/index.html | 2661 +++++++ ltapi/lt__ota_8h_source/index.html | 2343 ++++++ ltapi/lt__pins_8h/index.html | 2475 ++++++ ltapi/lt__pins_8h_source/index.html | 2363 ++++++ ltapi/lt__posix__api_8h/index.html | 2408 ++++++ ltapi/lt__posix__api_8h_source/index.html | 2303 ++++++ ltapi/lt__sleep_8c/index.html | 2298 ++++++ ltapi/lt__sleep_8c_source/index.html | 2305 ++++++ ltapi/lt__sleep_8h/index.html | 2417 ++++++ ltapi/lt__sleep_8h_source/index.html | 2307 ++++++ ltapi/lt__types_8h/index.html | 2463 ++++++ ltapi/lt__types_8h_source/index.html | 2341 ++++++ ltapi/lt__utils_8c/index.html | 2442 ++++++ ltapi/lt__utils_8c_source/index.html | 2368 ++++++ ltapi/lt__utils_8h/index.html | 2516 +++++++ ltapi/lt__utils_8h_source/index.html | 2331 ++++++ ltapi/lt__wdt_8c/index.html | 2354 ++++++ ltapi/lt__wdt_8c_source/index.html | 2305 ++++++ ltapi/lt__wdt_8h/index.html | 2389 ++++++ ltapi/lt__wdt_8h_source/index.html | 2305 ++++++ ltapi/lwip_2errno_8h/index.html | 2298 ++++++ ltapi/lwip_2errno_8h_source/index.html | 2299 ++++++ ltapi/lwip__timers_8h/index.html | 2298 ++++++ ltapi/lwip__timers_8h_source/index.html | 2299 ++++++ ltapi/lwipopts_8h/index.html | 2479 ++++++ ltapi/lwipopts_8h_source/index.html | 2385 ++++++ ltapi/m_d_n_s_8cpp/index.html | 2354 ++++++ ltapi/m_d_n_s_8cpp_source/index.html | 2334 ++++++ ltapi/m_d_n_s_8h/index.html | 2481 ++++++ ltapi/m_d_n_s_8h_source/index.html | 2422 ++++++ ltapi/macros/index.html | 2940 ++++++++ ltapi/main_8c/index.html | 2368 ++++++ ltapi/main_8c_source/index.html | 2317 ++++++ ltapi/malloc_8c/index.html | 2351 ++++++ ltapi/malloc_8c_source/index.html | 2382 ++++++ ltapi/mimetable_8cpp/index.html | 2329 ++++++ ltapi/mimetable_8cpp_source/index.html | 2327 ++++++ ltapi/mimetable_8h/index.html | 2347 ++++++ ltapi/mimetable_8h_source/index.html | 2332 ++++++ ltapi/modules/index.html | 2292 ++++++ ltapi/namespace_member_enums/index.html | 2321 ++++++ ltapi/namespace_member_functions/index.html | 2291 ++++++ ltapi/namespace_member_typedefs/index.html | 2311 ++++++ ltapi/namespace_member_variables/index.html | 2310 ++++++ ltapi/namespace_members/index.html | 2344 ++++++ ltapi/namespacearduino/index.html | 2324 ++++++ ltapi/namespacefs/index.html | 2414 ++++++ ltapi/namespacemime/index.html | 2537 +++++++ ltapi/namespaces/index.html | 2297 ++++++ ltapi/netdb_8h/index.html | 2298 ++++++ ltapi/netdb_8h_source/index.html | 2299 ++++++ ltapi/netif_8h/index.html | 2298 ++++++ ltapi/netif_8h_source/index.html | 2299 ++++++ ltapi/pages/index.html | 2292 ++++++ ltapi/pgmspace_8h/index.html | 2298 ++++++ ltapi/pgmspace_8h_source/index.html | 2299 ++++++ ltapi/printf__config_8h/index.html | 2666 +++++++ ltapi/printf__config_8h_source/index.html | 2449 ++++++ ltapi/putchar_8c/index.html | 2355 ++++++ ltapi/putchar_8c_source/index.html | 2303 ++++++ ltapi/puts_8c/index.html | 2355 ++++++ ltapi/puts_8c_source/index.html | 2315 ++++++ ltapi/serial__event_8cpp/index.html | 2382 ++++++ ltapi/serial__event_8cpp_source/index.html | 2305 ++++++ ltapi/sockets_8h/index.html | 2298 ++++++ ltapi/sockets_8h_source/index.html | 2299 ++++++ ltapi/src_2compat_2_f_s_8h/index.html | 2298 ++++++ ltapi/src_2compat_2_f_s_8h_source/index.html | 2299 ++++++ ltapi/src_2compat_2_m_d5_8h/index.html | 2298 ++++++ ltapi/src_2compat_2_m_d5_8h_source/index.html | 2300 ++++++ ltapi/strcasecmp_8c/index.html | 2465 ++++++ ltapi/strcasecmp_8c_source/index.html | 2391 ++++++ ltapi/strdup_8c/index.html | 2356 ++++++ ltapi/strdup_8c_source/index.html | 2307 ++++++ ltapi/strptime_8c/index.html | 2362 ++++++ ltapi/strptime_8c_source/index.html | 2491 ++++++ ltapi/struct_cookie/index.html | 2502 ++++++ ltapi/struct_event_handler__s/index.html | 2496 ++++++ .../index.html | 2362 ++++++ ltapi/struct_h_t_t_p_upload/index.html | 2432 ++++++ ltapi/struct_m_d5_context/index.html | 2376 ++++++ ltapi/struct_pin_info/index.html | 2390 ++++++ ltapi/struct_soft_data/index.html | 2404 ++++++ ltapi/struct_soft_serial/index.html | 2390 ++++++ .../index.html | 2362 ++++++ ltapi/struct_wi_fi_mac_addr/index.html | 2348 ++++++ ltapi/struct_wi_fi_network_info/index.html | 2488 ++++++ ltapi/struct_wi_fi_scan_a_p/index.html | 2404 ++++++ ltapi/struct_wi_fi_scan_data/index.html | 2390 ++++++ ltapi/struct_wifi_a_plist__t/index.html | 2362 ++++++ ltapi/structarduino__event__t/index.html | 2362 ++++++ ltapi/structbase64__decodestate/index.html | 2362 ++++++ ltapi/structbase64__encodestate/index.html | 2376 ++++++ ltapi/structesp__ip4__addr/index.html | 2348 ++++++ ltapi/structesp__ip6__addr/index.html | 2362 ++++++ .../structesp__netif__ip6__info__t/index.html | 2353 ++++++ .../structesp__netif__ip__info__t/index.html | 2351 ++++++ .../index.html | 2335 ++++++ ltapi/structip__event__got__ip6__t/index.html | 2359 ++++++ ltapi/structip__event__got__ip__t/index.html | 2394 ++++++ ltapi/structlt__flash__id__t/index.html | 2380 ++++++ ltapi/structlt__ota__ctx__t/index.html | 2478 ++++++ ltapi/structmbedtls__md5__context/index.html | 2379 ++++++ ltapi/structmime_1_1_entry/index.html | 2362 ++++++ .../index.html | 2359 ++++++ .../index.html | 2343 ++++++ .../index.html | 2351 ++++++ .../index.html | 2351 ++++++ .../index.html | 2383 ++++++ .../index.html | 2335 ++++++ .../index.html | 2343 ++++++ .../index.html | 2367 ++++++ .../index.html | 2359 ++++++ .../index.html | 2351 ++++++ .../index.html | 2335 ++++++ .../index.html | 2359 ++++++ .../index.html | 2383 ++++++ ltapi/sys_8h/index.html | 2298 ++++++ ltapi/sys_8h_source/index.html | 2299 ++++++ ltapi/tcpip_8h/index.html | 2298 ++++++ ltapi/tcpip_8h_source/index.html | 2299 ++++++ ltapi/time_8c/index.html | 2501 ++++++ ltapi/time_8c_source/index.html | 2344 ++++++ ltapi/udp_8h/index.html | 2352 ++++++ ltapi/udp_8h_source/index.html | 2305 ++++++ ltapi/unionarduino__event__info__t/index.html | 2516 +++++++ ltapi/variables/index.html | 2543 +++++++ ltapi/vfs__api_8h/index.html | 2295 ++++++ ltapi/vfs__api_8h_source/index.html | 2297 ++++++ ltapi/wiring_8c/index.html | 2354 ++++++ ltapi/wiring_8c_source/index.html | 2316 ++++++ ltapi/wiring__compat_8cpp/index.html | 2354 ++++++ ltapi/wiring__compat_8cpp_source/index.html | 2303 ++++++ ltapi/wiring__compat_8h/index.html | 2598 +++++++ ltapi/wiring__compat_8h_source/index.html | 2335 ++++++ ltapi/wiring__custom_8c/index.html | 2685 +++++++ ltapi/wiring__custom_8c_source/index.html | 2390 ++++++ ltapi/wiring__custom_8h/index.html | 3030 ++++++++ ltapi/wiring__custom_8h_source/index.html | 2368 ++++++ ltapi/wiring__irq_8c/index.html | 2356 ++++++ ltapi/wiring__irq_8c_source/index.html | 2301 ++++++ ltapi/wiring__math_8cpp/index.html | 2387 ++++++ ltapi/wiring__math_8cpp_source/index.html | 2337 ++++++ ltapi/wiring__private_8c/index.html | 2298 ++++++ ltapi/wiring__private_8c_source/index.html | 2313 ++++++ ltapi/wiring__private_8h/index.html | 2560 +++++++ ltapi/wiring__private_8h_source/index.html | 2358 ++++++ ltapi/wiring__shift_8c/index.html | 2376 ++++++ ltapi/wiring__shift_8c_source/index.html | 2348 ++++++ monitor/filter_rtl_hard_fault.py | 138 + platform.json | 121 + search/search_index.json | 1 + sitemap.xml | 2758 +++++++ sitemap.xml.gz | Bin 0 -> 4369 bytes src/mkdoxy/LICENSE | 21 + src/mkdoxy/Makefile | 19 + .../docs/media/Basic-implementation-old.png | Bin 0 -> 147376 bytes .../docs/media/Basic-implementation.png | Bin 0 -> 131857 bytes .../docs/media/Basic-implementation.svg | 132 + src/mkdoxy/index.html | 2626 +++++++ src/mkdoxy/mkdoxy.egg-info/PKG-INFO | 287 + src/mkdoxy/mkdoxy.egg-info/SOURCES.txt | 39 + .../mkdoxy.egg-info/dependency_links.txt | 1 + src/mkdoxy/mkdoxy.egg-info/entry_points.txt | 2 + src/mkdoxy/mkdoxy.egg-info/requires.txt | 3 + src/mkdoxy/mkdoxy.egg-info/top_level.txt | 1 + src/mkdoxy/mkdoxy/__init__.py | 0 src/mkdoxy/mkdoxy/cache.py | 12 + src/mkdoxy/mkdoxy/constants.py | 156 + src/mkdoxy/mkdoxy/doxygen.py | 121 + src/mkdoxy/mkdoxy/doxyrun.py | 107 + src/mkdoxy/mkdoxy/finder.py | 70 + src/mkdoxy/mkdoxy/generatorAuto.py | 248 + src/mkdoxy/mkdoxy/generatorBase.py | 299 + src/mkdoxy/mkdoxy/generatorSnippets.py | 247 + src/mkdoxy/mkdoxy/markdown.py | 225 + src/mkdoxy/mkdoxy/node.py | 780 ++ src/mkdoxy/mkdoxy/plugin.py | 195 + src/mkdoxy/mkdoxy/property.py | 347 + src/mkdoxy/mkdoxy/templates/annotated.jinja2 | 12 + src/mkdoxy/mkdoxy/templates/classes.jinja2 | 12 + src/mkdoxy/mkdoxy/templates/code.jinja2 | 23 + src/mkdoxy/mkdoxy/templates/error.jinja2 | 8 + src/mkdoxy/mkdoxy/templates/files.jinja2 | 12 + src/mkdoxy/mkdoxy/templates/hierarchy.jinja2 | 14 + src/mkdoxy/mkdoxy/templates/index.jinja2 | 10 + src/mkdoxy/mkdoxy/templates/memDef.jinja2 | 31 + src/mkdoxy/mkdoxy/templates/memTab.jinja2 | 32 + src/mkdoxy/mkdoxy/templates/member.jinja2 | 107 + src/mkdoxy/mkdoxy/templates/modules.jinja2 | 12 + src/mkdoxy/mkdoxy/templates/namespaces.jinja2 | 12 + src/mkdoxy/mkdoxy/templates/page.jinja2 | 3 + src/mkdoxy/mkdoxy/templates/pages.jinja2 | 7 + .../mkdoxy/templates/programlisting.jinja2 | 17 + src/mkdoxy/mkdoxy/utils.py | 110 + src/mkdoxy/mkdoxy/xml_parser.py | 274 + src/mkdoxy/requirements.txt | 3 + src/mkdoxy/setup.py | 38 + src/mkdoxy/tests/basic.py | 7 + src/mkdoxy/tests/callDoxyByName.py | 24 + src/mkdoxy/tests/doxygenSubprocess.py | 18 + src/mkdoxy/tests/exceptKeyboardInterrupt.py | 11 + src/mkdoxy/tests/files/Makefile | 15 + src/mkdoxy/tests/files/docs/index.html | 2453 ++++++ src/mkdoxy/tests/files/mkdocs.yml | 132 + src/mkdoxy/tests/files/src-animal/animal.h | 229 + .../tests/files/src-animal/animal_interface.h | 35 + src/mkdoxy/tests/files/src-animal/bird.h | 32 + src/mkdoxy/tests/files/src-animal/config.h | 18 + src/mkdoxy/tests/files/src-animal/example.h | 22 + .../files/src-animal/markdown-demo/index.html | 2530 +++++++ .../tests/files/src-animal/special_bird.h | 25 + .../tests/files/src-animal/utils/exception.h | 51 + src/mkdoxy/tests/files/src-esp/RBCX.h | 5 + src/mkdoxy/tests/files/src-esp/RBCXAngle.cpp | 35 + src/mkdoxy/tests/files/src-esp/RBCXAngle.h | 61 + .../tests/files/src-esp/RBCXBattery.cpp | 33 + src/mkdoxy/tests/files/src-esp/RBCXBattery.h | 49 + .../tests/files/src-esp/RBCXButtons.cpp | 37 + src/mkdoxy/tests/files/src-esp/RBCXButtons.h | 68 + src/mkdoxy/tests/files/src-esp/RBCXLeds.cpp | 43 + src/mkdoxy/tests/files/src-esp/RBCXLeds.h | 50 + .../tests/files/src-esp/RBCXManager.cpp | 295 + src/mkdoxy/tests/files/src-esp/RBCXManager.h | 227 + src/mkdoxy/tests/files/src-esp/RBCXMotor.cpp | 248 + src/mkdoxy/tests/files/src-esp/RBCXMotor.h | 112 + src/mkdoxy/tests/files/src-esp/RBCXNvs.cpp | 73 + src/mkdoxy/tests/files/src-esp/RBCXNvs.h | 34 + src/mkdoxy/tests/files/src-esp/RBCXPiezo.cpp | 29 + src/mkdoxy/tests/files/src-esp/RBCXPiezo.h | 26 + src/mkdoxy/tests/files/src-esp/RBCXPinout.h | 24 + .../tests/files/src-esp/RBCXSmartServo.cpp | 221 + .../tests/files/src-esp/RBCXSmartServo.h | 70 + .../tests/files/src-esp/RBCXStupidServo.cpp | 36 + .../tests/files/src-esp/RBCXStupidServo.h | 40 + src/mkdoxy/tests/files/src-esp/RBCXTimers.cpp | 148 + src/mkdoxy/tests/files/src-esp/RBCXTimers.h | 69 + .../tests/files/src-esp/RBCXUltrasound.cpp | 110 + .../tests/files/src-esp/RBCXUltrasound.h | 59 + src/mkdoxy/tests/files/src-esp/RBCXUtil.h | 78 + src/mkdoxy/tests/files/src-esp/RBCXVersion.h | 9 + src/mkdoxy/tests/files/src-esp/main.cpp | 47 + src/mkdoxy/tests/files/src-esp/test.cpp | 53 + .../tests/files/src-stm32/include/Bsp.hpp | 412 + .../src-stm32/include/ButtonController.hpp | 4 + .../src-stm32/include/BuzzerController.hpp | 5 + .../files/src-stm32/include/CdcUartTunnel.hpp | 8 + .../files/src-stm32/include/ControlLink.hpp | 11 + .../files/src-stm32/include/DebugLink.hpp | 8 + .../files/src-stm32/include/Dispatcher.hpp | 9 + .../files/src-stm32/include/Esp32Manager.hpp | 56 + .../files/src-stm32/include/FreeRTOSConfig.h | 174 + .../files/src-stm32/include/I2cController.hpp | 108 + .../tests/files/src-stm32/include/Motor.hpp | 174 + .../src-stm32/include/MotorController.hpp | 7 + .../tests/files/src-stm32/include/Mpu6050.hpp | 792 ++ .../files/src-stm32/include/MpuController.hpp | 801 ++ .../src-stm32/include/OledController.hpp | 89 + .../include/OledController_fonts.hpp | 14 + .../tests/files/src-stm32/include/Power.hpp | 16 + .../tests/files/src-stm32/include/README | 39 + .../include/StupidServoController.hpp | 7 + .../include/UltrasoundController.hpp | 8 + .../files/src-stm32/include/UsbCdcLink.h | 28 + .../include/utils/BasePriorityRaiser.hpp | 28 + .../src-stm32/include/utils/ByteFifo.hpp | 117 + .../files/src-stm32/include/utils/Debug.hpp | 70 + .../files/src-stm32/include/utils/Flash.hpp | 57 + .../files/src-stm32/include/utils/HalDma.hpp | 100 + .../include/utils/MessageBufferWrapper.hpp | 80 + .../src-stm32/include/utils/MutexWrapper.hpp | 31 + .../src-stm32/include/utils/QueueWrapper.hpp | 84 + .../src-stm32/include/utils/Regulator.hpp | 94 + .../include/utils/StreamBufferWrapper.hpp | 67 + .../src-stm32/include/utils/TaskWrapper.hpp | 40 + .../src-stm32/include/utils/TickTimer.hpp | 49 + .../src-stm32/include/utils/XorShift.hpp | 20 + src/mkdoxy/tests/files/src-stm32/src/Bsp.cpp | 61 + .../files/src-stm32/src/ButtonController.cpp | 51 + .../files/src-stm32/src/CdcUartTunnel.cpp | 180 + .../tests/files/src-stm32/src/ControlLink.cpp | 126 + .../tests/files/src-stm32/src/DebugLink.cpp | 487 ++ .../tests/files/src-stm32/src/Dispatcher.cpp | 129 + .../files/src-stm32/src/Esp32Manager.cpp | 150 + .../files/src-stm32/src/FreeRTOSCallbacks.cpp | 66 + .../files/src-stm32/src/I2cController.cpp | 577 ++ .../files/src-stm32/src/MotorController.cpp | 233 + .../files/src-stm32/src/MpuController.cpp | 3540 +++++++++ .../files/src-stm32/src/OledController.cpp | 514 ++ .../src-stm32/src/OledController_fonts.cpp | 876 +++ .../tests/files/src-stm32/src/Power.cpp | 329 + .../src-stm32/src/StupidServoController.cpp | 107 + .../src-stm32/src/UltrasoundController.cpp | 126 + .../files/src-stm32/src/UsbCdcDescriptors.c | 16 + .../tests/files/src-stm32/src/UsbCdcLink.cpp | 503 ++ .../files/src-stm32/src/bootloader/sboot.S | 12 + .../src-stm32/src/bootloader/sboot_v11.bin | Bin 0 -> 3248 bytes src/mkdoxy/tests/files/src-stm32/src/main.cpp | 72 + .../tests/files/src-stm32/src/utils/Debug.cpp | 18 + src/mkdoxy/tests/metaDataParse.py | 62 + src/mkdoxy/tests/mkdocsValidateCfg.py | 22 + src/mkdoxy/tests/originalTest.py | 16 + src/mkdoxy/tests/parseMdTags.py | 36 + src/mkdoxy/tests/snippetsTest.py | 71 + src/mkdoxy/tests/testTemplate.py | 56 + tools/libretiny/__init__.py | 14 + tools/libretiny/board.py | 34 + tools/libretiny/dict.py | 65 + tools/libretiny/family.py | 97 + tools/libretiny/fileio.py | 17 + tools/libretiny/lvm.py | 19 + tools/libretiny/obj.py | 62 + 1346 files changed, 1442074 insertions(+) create mode 100644 .nojekyll create mode 100644 404.html create mode 100644 CNAME create mode 100644 SUMMARY/index.html create mode 100644 assets/images/favicon.png create mode 100644 assets/javascripts/bundle.5cf534bf.min.js create mode 100644 assets/javascripts/bundle.5cf534bf.min.js.map create mode 100644 assets/javascripts/lunr/min/lunr.ar.min.js create mode 100644 assets/javascripts/lunr/min/lunr.da.min.js create mode 100644 assets/javascripts/lunr/min/lunr.de.min.js create mode 100644 assets/javascripts/lunr/min/lunr.du.min.js create mode 100644 assets/javascripts/lunr/min/lunr.es.min.js create mode 100644 assets/javascripts/lunr/min/lunr.fi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.fr.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.hu.min.js create mode 100644 assets/javascripts/lunr/min/lunr.it.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ja.min.js create mode 100644 assets/javascripts/lunr/min/lunr.jp.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ko.min.js create mode 100644 assets/javascripts/lunr/min/lunr.multi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.nl.min.js create mode 100644 assets/javascripts/lunr/min/lunr.no.min.js create mode 100644 assets/javascripts/lunr/min/lunr.pt.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ro.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ru.min.js create mode 100644 assets/javascripts/lunr/min/lunr.stemmer.support.min.js create mode 100644 assets/javascripts/lunr/min/lunr.sv.min.js create mode 100644 assets/javascripts/lunr/min/lunr.ta.min.js create mode 100644 assets/javascripts/lunr/min/lunr.th.min.js create mode 100644 assets/javascripts/lunr/min/lunr.tr.min.js create mode 100644 assets/javascripts/lunr/min/lunr.vi.min.js create mode 100644 assets/javascripts/lunr/min/lunr.zh.min.js create mode 100644 assets/javascripts/lunr/tinyseg.js create mode 100644 assets/javascripts/lunr/wordcut.js create mode 100644 assets/javascripts/workers/search.12658920.min.js create mode 100644 assets/javascripts/workers/search.12658920.min.js.map create mode 100644 assets/stylesheets/main.3bd4f189.min.css create mode 100644 assets/stylesheets/main.3bd4f189.min.css.map create mode 100644 assets/stylesheets/palette.2505c338.min.css create mode 100644 assets/stylesheets/palette.2505c338.min.css.map create mode 100644 boards.json create mode 100644 boards/SUMMARY/index.html create mode 100644 boards/_base/beken-7231-tuya.json create mode 100644 boards/_base/beken-7231.json create mode 100644 boards/_base/beken-7231n.json create mode 100644 boards/_base/beken-7231q.json create mode 100644 boards/_base/beken-7231t.json create mode 100644 boards/_base/beken-7252.json create mode 100644 boards/_base/beken-72xx.json create mode 100644 boards/_base/generic.json create mode 100644 boards/_base/ic/bk7231-qfn32.json create mode 100644 boards/_base/ic/bk7231-qfn40.json create mode 100644 boards/_base/ic/bk7231q-qfn40.json create mode 100644 boards/_base/ic/bk7252-qfn68.json create mode 100644 boards/_base/ic/rtl8710bn.json create mode 100644 boards/_base/ic/rtl8720cf.json create mode 100644 boards/_base/pcb/bw12.json create mode 100644 boards/_base/pcb/bw15.json create mode 100644 boards/_base/pcb/cb1s-test.json create mode 100644 boards/_base/pcb/cb1s.json create mode 100644 boards/_base/pcb/cb2l-test.json create mode 100644 boards/_base/pcb/cb2l.json create mode 100644 boards/_base/pcb/cb2s-test.json create mode 100644 boards/_base/pcb/cb2s.json create mode 100644 boards/_base/pcb/cb3l.json create mode 100644 boards/_base/pcb/cb3s.json create mode 100644 boards/_base/pcb/cb3se.json create mode 100644 boards/_base/pcb/cblc5-test.json create mode 100644 boards/_base/pcb/cblc5.json create mode 100644 boards/_base/pcb/cbu-test.json create mode 100644 boards/_base/pcb/cbu.json create mode 100644 boards/_base/pcb/lsc-lma35.json create mode 100644 boards/_base/pcb/t102.json create mode 100644 boards/_base/pcb/t103.json create mode 100644 boards/_base/pcb/t112.json create mode 100644 boards/_base/pcb/wa2-test.json create mode 100644 boards/_base/pcb/wa2.json create mode 100644 boards/_base/pcb/wb1s.json create mode 100644 boards/_base/pcb/wb2l-m1-test.json create mode 100644 boards/_base/pcb/wb2l-test.json create mode 100644 boards/_base/pcb/wb2l.json create mode 100644 boards/_base/pcb/wb2s-test.json create mode 100644 boards/_base/pcb/wb2s.json create mode 100644 boards/_base/pcb/wb3l.json create mode 100644 boards/_base/pcb/wb3s.json create mode 100644 boards/_base/pcb/wblc5-test.json create mode 100644 boards/_base/pcb/wblc5.json create mode 100644 boards/_base/pcb/wr1.json create mode 100644 boards/_base/pcb/wr1e.json create mode 100644 boards/_base/pcb/wr2-base.json create mode 100644 boards/_base/pcb/wr2-test.json create mode 100644 boards/_base/pcb/wr2.json create mode 100644 boards/_base/pcb/wr2e-test.json create mode 100644 boards/_base/pcb/wr2e.json create mode 100644 boards/_base/pcb/wr2l-base.json create mode 100644 boards/_base/pcb/wr2l.json create mode 100644 boards/_base/pcb/wr2le.json create mode 100644 boards/_base/pcb/wr3-base.json create mode 100644 boards/_base/pcb/wr3.json create mode 100644 boards/_base/pcb/wr3e.json create mode 100644 boards/_base/pcb/wr3l-base.json create mode 100644 boards/_base/pcb/wr3n.json create mode 100644 boards/_base/realtek-ambz-2mb-468k.json create mode 100644 boards/_base/realtek-ambz-2mb-788k.json create mode 100644 boards/_base/realtek-ambz-4mb-980k.json create mode 100644 boards/_base/realtek-ambz-bx.json create mode 100644 boards/_base/realtek-ambz-tuya.json create mode 100644 boards/_base/realtek-ambz.json create mode 100644 boards/_base/realtek-ambz2-2mb-900k.json create mode 100644 boards/_base/realtek-ambz2-2mb-992k.json create mode 100644 boards/_base/realtek-ambz2-8710.json create mode 100644 boards/_base/realtek-ambz2-8720.json create mode 100644 boards/_base/realtek-ambz2-image.json create mode 100644 boards/_base/realtek-ambz2-tuya.json create mode 100644 boards/_base/realtek-ambz2.json create mode 100644 boards/bw12.json create mode 100644 boards/bw12/bw12.svg create mode 100644 boards/bw12/index.html create mode 100644 boards/bw15.json create mode 100644 boards/bw15/bw15.svg create mode 100644 boards/bw15/index.html create mode 100644 boards/cb1s.json create mode 100644 boards/cb1s/cb1s.svg create mode 100644 boards/cb1s/index.html create mode 100644 boards/cb2l.json create mode 100644 boards/cb2l/cb2l.svg create mode 100644 boards/cb2l/index.html create mode 100644 boards/cb2s.json create mode 100644 boards/cb2s/cb2s.svg create mode 100644 boards/cb2s/index.html create mode 100644 boards/cb3l.json create mode 100644 boards/cb3l/cb3l.svg create mode 100644 boards/cb3l/index.html create mode 100644 boards/cb3s.json create mode 100644 boards/cb3s/cb3s.svg create mode 100644 boards/cb3s/index.html create mode 100644 boards/cb3se.json create mode 100644 boards/cb3se/cb3se.svg create mode 100644 boards/cb3se/index.html create mode 100644 boards/cblc5.json create mode 100644 boards/cblc5/cblc5.svg create mode 100644 boards/cblc5/index.html create mode 100644 boards/cbu.json create mode 100644 boards/cbu/cbu.svg create mode 100644 boards/cbu/index.html create mode 100644 boards/generic-bk7231n-qfn32-tuya.json create mode 100644 boards/generic-bk7231n-qfn32-tuya/index.html create mode 100644 boards/generic-bk7231t-qfn32-tuya.json create mode 100644 boards/generic-bk7231t-qfn32-tuya/index.html create mode 100644 boards/generic-bk7252.json create mode 100644 boards/generic-bk7252/index.html create mode 100644 boards/generic-rtl8710bn-2mb-468k.json create mode 100644 boards/generic-rtl8710bn-2mb-468k/index.html create mode 100644 boards/generic-rtl8710bn-2mb-788k.json create mode 100644 boards/generic-rtl8710bn-2mb-788k/index.html create mode 100644 boards/generic-rtl8710bx-4mb-980k.json create mode 100644 boards/generic-rtl8710bx-4mb-980k/index.html create mode 100644 boards/generic-rtl8720cf-2mb-992k.json create mode 100644 boards/generic-rtl8720cf-2mb-992k/index.html create mode 100644 boards/lsc-lma35-t.json create mode 100644 boards/lsc-lma35-t/index.html create mode 100644 boards/lsc-lma35-t/lsc-lma35-t.svg create mode 100644 boards/lsc-lma35.json create mode 100644 boards/lsc-lma35/index.html create mode 100644 boards/lsc-lma35/lsc-lma35.svg create mode 100644 boards/shapes/tuya2_pcb.json create mode 100644 boards/shapes/tuyau_pcb.json create mode 100644 boards/t102-v1.1.json create mode 100644 boards/t102-v1.1/index.html create mode 100644 boards/t102-v1.1/t102-v1.1.svg create mode 100644 boards/t103-v1.0.json create mode 100644 boards/t103-v1.0/index.html create mode 100644 boards/t103-v1.0/t103-v1.0.svg create mode 100644 boards/t112-v1.1.json create mode 100644 boards/t112-v1.1/index.html create mode 100644 boards/t112-v1.1/t112-v1.1.svg create mode 100644 boards/templates/custom-20x24-22.json create mode 100644 boards/templates/tuya-16x24.json create mode 100644 boards/templates/tuya1.json create mode 100644 boards/templates/tuya1s.json create mode 100644 boards/templates/tuya2.json create mode 100644 boards/templates/tuya2l.json create mode 100644 boards/templates/tuyalc5.json create mode 100644 boards/templates/tuyau.json create mode 100644 boards/variants/bw12.c create mode 100644 boards/variants/bw12.h create mode 100644 boards/variants/bw15.c create mode 100644 boards/variants/bw15.h create mode 100644 boards/variants/cb1s.c create mode 100644 boards/variants/cb1s.h create mode 100644 boards/variants/cb2l.c create mode 100644 boards/variants/cb2l.h create mode 100644 boards/variants/cb2s.c create mode 100644 boards/variants/cb2s.h create mode 100644 boards/variants/cb3l.c create mode 100644 boards/variants/cb3l.h create mode 100644 boards/variants/cb3s.c create mode 100644 boards/variants/cb3s.h create mode 100644 boards/variants/cb3se.c create mode 100644 boards/variants/cb3se.h create mode 100644 boards/variants/cblc5.c create mode 100644 boards/variants/cblc5.h create mode 100644 boards/variants/cbu.c create mode 100644 boards/variants/cbu.h create mode 100644 boards/variants/generic-bk7231n-qfn32-tuya.c create mode 100644 boards/variants/generic-bk7231n-qfn32-tuya.h create mode 100644 boards/variants/generic-bk7231t-qfn32-tuya.c create mode 100644 boards/variants/generic-bk7231t-qfn32-tuya.h create mode 100644 boards/variants/generic-bk7252.c create mode 100644 boards/variants/generic-bk7252.h create mode 100644 boards/variants/generic-rtl8710bn-2mb-468k.c create mode 100644 boards/variants/generic-rtl8710bn-2mb-468k.h create mode 100644 boards/variants/generic-rtl8710bn-2mb-788k.c create mode 100644 boards/variants/generic-rtl8710bn-2mb-788k.h create mode 100644 boards/variants/generic-rtl8710bx-4mb-980k.c create mode 100644 boards/variants/generic-rtl8710bx-4mb-980k.h create mode 100644 boards/variants/generic-rtl8720cf-2mb-992k.c create mode 100644 boards/variants/generic-rtl8720cf-2mb-992k.h create mode 100644 boards/variants/lsc-lma35-t.c create mode 100644 boards/variants/lsc-lma35-t.h create mode 100644 boards/variants/lsc-lma35.c create mode 100644 boards/variants/lsc-lma35.h create mode 100644 boards/variants/t102-v1.1.c create mode 100644 boards/variants/t102-v1.1.h create mode 100644 boards/variants/t103-v1.0.c create mode 100644 boards/variants/t103-v1.0.h create mode 100644 boards/variants/t112-v1.1.c create mode 100644 boards/variants/t112-v1.1.h create mode 100644 boards/variants/wa2.c create mode 100644 boards/variants/wa2.h create mode 100644 boards/variants/wb1s.c create mode 100644 boards/variants/wb1s.h create mode 100644 boards/variants/wb2l-m1.c create mode 100644 boards/variants/wb2l-m1.h create mode 100644 boards/variants/wb2l.c create mode 100644 boards/variants/wb2l.h create mode 100644 boards/variants/wb2s.c create mode 100644 boards/variants/wb2s.h create mode 100644 boards/variants/wb3l.c create mode 100644 boards/variants/wb3l.h create mode 100644 boards/variants/wb3s.c create mode 100644 boards/variants/wb3s.h create mode 100644 boards/variants/wblc5.c create mode 100644 boards/variants/wblc5.h create mode 100644 boards/variants/wr1.c create mode 100644 boards/variants/wr1.h create mode 100644 boards/variants/wr1e.c create mode 100644 boards/variants/wr1e.h create mode 100644 boards/variants/wr2.c create mode 100644 boards/variants/wr2.h create mode 100644 boards/variants/wr2e.c create mode 100644 boards/variants/wr2e.h create mode 100644 boards/variants/wr2l.c create mode 100644 boards/variants/wr2l.h create mode 100644 boards/variants/wr2le.c create mode 100644 boards/variants/wr2le.h create mode 100644 boards/variants/wr3.c create mode 100644 boards/variants/wr3.h create mode 100644 boards/variants/wr3e.c create mode 100644 boards/variants/wr3e.h create mode 100644 boards/variants/wr3l.c create mode 100644 boards/variants/wr3l.h create mode 100644 boards/variants/wr3le.c create mode 100644 boards/variants/wr3le.h create mode 100644 boards/variants/wr3n.c create mode 100644 boards/variants/wr3n.h create mode 100644 boards/wa2.json create mode 100644 boards/wa2/index.html create mode 100644 boards/wa2/wa2.svg create mode 100644 boards/wb1s.json create mode 100644 boards/wb1s/index.html create mode 100644 boards/wb1s/wb1s.svg create mode 100644 boards/wb2l-m1.json create mode 100644 boards/wb2l-m1/index.html create mode 100644 boards/wb2l-m1/wb2l-m1.svg create mode 100644 boards/wb2l.json create mode 100644 boards/wb2l/index.html create mode 100644 boards/wb2l/wb2l.svg create mode 100644 boards/wb2s.json create mode 100644 boards/wb2s/index.html create mode 100644 boards/wb2s/wb2s.svg create mode 100644 boards/wb3l.json create mode 100644 boards/wb3l/index.html create mode 100644 boards/wb3l/wb3l.svg create mode 100644 boards/wb3s.json create mode 100644 boards/wb3s/index.html create mode 100644 boards/wb3s/wb3s.svg create mode 100644 boards/wblc5.json create mode 100644 boards/wblc5/index.html create mode 100644 boards/wblc5/wblc5.svg create mode 100644 boards/wr1.json create mode 100644 boards/wr1/index.html create mode 100644 boards/wr1/wr1.svg create mode 100644 boards/wr1e.json create mode 100644 boards/wr1e/index.html create mode 100644 boards/wr1e/wr1e.svg create mode 100644 boards/wr2.json create mode 100644 boards/wr2/index.html create mode 100644 boards/wr2/wr2.svg create mode 100644 boards/wr2e.json create mode 100644 boards/wr2e/index.html create mode 100644 boards/wr2e/wr2e.svg create mode 100644 boards/wr2l.json create mode 100644 boards/wr2l/index.html create mode 100644 boards/wr2l/wr2l.svg create mode 100644 boards/wr2le.json create mode 100644 boards/wr2le/index.html create mode 100644 boards/wr2le/wr2le.svg create mode 100644 boards/wr3.json create mode 100644 boards/wr3/index.html create mode 100644 boards/wr3/wr3.svg create mode 100644 boards/wr3e.json create mode 100644 boards/wr3e/index.html create mode 100644 boards/wr3e/wr3e.svg create mode 100644 boards/wr3l.json create mode 100644 boards/wr3l/index.html create mode 100644 boards/wr3l/wr3l.svg create mode 100644 boards/wr3le.json create mode 100644 boards/wr3le/index.html create mode 100644 boards/wr3le/wr3le.svg create mode 100644 boards/wr3n.json create mode 100644 boards/wr3n/index.html create mode 100644 boards/wr3n/wr3n.svg create mode 100644 builder/family/beken-72xx.py create mode 100644 builder/family/realtek-ambz.py create mode 100644 builder/family/realtek-ambz2.py create mode 100644 builder/frameworks/arduino.py create mode 100644 builder/frameworks/base.py create mode 100644 builder/main.py create mode 100644 builder/python-venv.py create mode 100644 builder/utils/config.py create mode 100644 builder/utils/cores.py create mode 100644 builder/utils/env.py create mode 100644 builder/utils/flash.py create mode 100644 builder/utils/libs-external.py create mode 100644 builder/utils/libs-queue.py create mode 100644 builder/utils/ltchiptool-util.py create mode 100644 cores/beken-7231n/base/config/sys_config.h create mode 100644 cores/beken-7231n/base/fixups/temp_detect.c create mode 100644 cores/beken-7231n/base/lt_defs.h create mode 100644 cores/beken-7231q/base/config/sys_config.h create mode 100644 cores/beken-7231q/base/fixups/bk7231q.c create mode 100644 cores/beken-7231q/base/fixups/bk7231q.h create mode 100644 cores/beken-7231t/base/config/sys_config.h create mode 100644 cores/beken-7231t/base/lt_defs.h create mode 100644 cores/beken-7251/base/config/sys_config.h create mode 100644 cores/beken-7251/base/lt_defs.h create mode 100644 cores/beken-72xx/arduino/libraries/Serial/Serial.cpp create mode 100644 cores/beken-72xx/arduino/libraries/Serial/SerialPrivate.h create mode 100644 cores/beken-72xx/arduino/libraries/WiFi/WiFi.cpp create mode 100644 cores/beken-72xx/arduino/libraries/WiFi/WiFiAP.cpp create mode 100644 cores/beken-72xx/arduino/libraries/WiFi/WiFiEvents.cpp create mode 100644 cores/beken-72xx/arduino/libraries/WiFi/WiFiGeneric.cpp create mode 100644 cores/beken-72xx/arduino/libraries/WiFi/WiFiPrivate.h create mode 100644 cores/beken-72xx/arduino/libraries/WiFi/WiFiSTA.cpp create mode 100644 cores/beken-72xx/arduino/libraries/WiFi/WiFiScan.cpp create mode 100644 cores/beken-72xx/arduino/src/ArduinoFamily.h create mode 100644 cores/beken-72xx/arduino/src/lt_defs.h create mode 100644 cores/beken-72xx/arduino/src/main.cpp create mode 100644 cores/beken-72xx/arduino/src/wiring.c create mode 100644 cores/beken-72xx/arduino/src/wiring_analog.c create mode 100644 cores/beken-72xx/arduino/src/wiring_data.h create mode 100644 cores/beken-72xx/arduino/src/wiring_digital.c create mode 100644 cores/beken-72xx/arduino/src/wiring_irq.c create mode 100644 cores/beken-72xx/base/api/lt_cpu.c create mode 100644 cores/beken-72xx/base/api/lt_device.c create mode 100644 cores/beken-72xx/base/api/lt_flash.c create mode 100644 cores/beken-72xx/base/api/lt_init.c create mode 100644 cores/beken-72xx/base/api/lt_mem.c create mode 100644 cores/beken-72xx/base/api/lt_ota.c create mode 100644 cores/beken-72xx/base/api/lt_sleep.c create mode 100644 cores/beken-72xx/base/api/lt_wdt.c create mode 100644 cores/beken-72xx/base/config/lwipopts.h create mode 100644 cores/beken-72xx/base/fixups/arch_main.c create mode 100644 cores/beken-72xx/base/fixups/ate_app.c create mode 100644 cores/beken-72xx/base/fixups/boot_handlers_bk7231u.S create mode 100644 cores/beken-72xx/base/fixups/clock_cal.c create mode 100644 cores/beken-72xx/base/fixups/clock_rtos.c create mode 100644 cores/beken-72xx/base/fixups/gcc10.c create mode 100644 cores/beken-72xx/base/fixups/generic.h create mode 100644 cores/beken-72xx/base/fixups/include.h create mode 100644 cores/beken-72xx/base/fixups/intc.c create mode 100644 cores/beken-72xx/base/fixups/param_config.h create mode 100644 cores/beken-72xx/base/fixups/uart_pub.h create mode 100644 cores/beken-72xx/base/lt_defs.h create mode 100644 cores/beken-72xx/base/lt_family.h create mode 100644 cores/beken-72xx/base/port/fal_flash_bk72xx_port.c create mode 100644 cores/beken-72xx/base/port/printf.c create mode 100644 cores/beken-72xx/base/port/printf_port.h create mode 100644 cores/beken-72xx/base/sdk_extern.h create mode 100644 cores/beken-72xx/base/sdk_private.h create mode 100644 cores/beken-72xx/base/wraps/BkDriverFlash.c create mode 100644 cores/beken-72xx/base/wraps/wlan_ui.c create mode 100644 cores/beken-72xx/misc/bk7231_bsp.template.ld create mode 100644 cores/beken-72xx/misc/bk7231n_bsp.template.ld create mode 100644 cores/beken-72xx/misc/bk72xx.cfg create mode 100644 cores/common/arduino/libraries/api/Serial/Serial.cpp create mode 100644 cores/common/arduino/libraries/api/Serial/Serial.h create mode 100644 cores/common/arduino/libraries/api/SoftwareSerial/SoftwareSerial.cpp create mode 100644 cores/common/arduino/libraries/api/SoftwareSerial/SoftwareSerial.h create mode 100644 cores/common/arduino/libraries/api/WiFi/WiFi.cpp create mode 100644 cores/common/arduino/libraries/api/WiFi/WiFi.h create mode 100644 cores/common/arduino/libraries/api/WiFi/WiFiAP.cpp create mode 100644 cores/common/arduino/libraries/api/WiFi/WiFiEvents.cpp create mode 100644 cores/common/arduino/libraries/api/WiFi/WiFiEvents.h create mode 100644 cores/common/arduino/libraries/api/WiFi/WiFiGeneric.cpp create mode 100644 cores/common/arduino/libraries/api/WiFi/WiFiSTA.cpp create mode 100644 cores/common/arduino/libraries/api/WiFi/WiFiScan.cpp create mode 100644 cores/common/arduino/libraries/api/WiFi/WiFiType.h create mode 100644 cores/common/arduino/libraries/common/FS/FS.cpp create mode 100644 cores/common/arduino/libraries/common/FS/FS.h create mode 100644 cores/common/arduino/libraries/common/IPv6Address/IPv6Address.cpp create mode 100644 cores/common/arduino/libraries/common/IPv6Address/IPv6Address.h create mode 100644 cores/common/arduino/libraries/common/IPv6Address/api/IPv6Address.h create mode 100644 cores/common/arduino/libraries/common/MD5/MD5.h create mode 100644 cores/common/arduino/libraries/common/MD5/MD5HostapdImpl.h create mode 100644 cores/common/arduino/libraries/common/MD5/MD5MbedTLSImpl.cpp create mode 100644 cores/common/arduino/libraries/common/MD5/MD5MbedTLSImpl.h create mode 100644 cores/common/arduino/libraries/common/Preferences/Preferences.h create mode 100644 cores/common/arduino/libraries/common/Update/Update.cpp create mode 100644 cores/common/arduino/libraries/common/Update/Update.h create mode 100644 cores/common/arduino/libraries/common/Update/UpdateUtil.cpp create mode 100644 cores/common/arduino/libraries/common/WiFiClient/LwIPClient.cpp create mode 100644 cores/common/arduino/libraries/common/WiFiClient/LwIPClient.h create mode 100644 cores/common/arduino/libraries/common/WiFiClient/LwIPRxBuffer.cpp create mode 100644 cores/common/arduino/libraries/common/WiFiClient/LwIPRxBuffer.h create mode 100644 cores/common/arduino/libraries/common/WiFiClient/MbedTLSClient.cpp create mode 100644 cores/common/arduino/libraries/common/WiFiClient/MbedTLSClient.h create mode 100644 cores/common/arduino/libraries/common/WiFiClient/WiFiClient.h create mode 100644 cores/common/arduino/libraries/common/WiFiClient/WiFiClientSecure.h create mode 100644 cores/common/arduino/libraries/common/WiFiServer/LwIPServer.cpp create mode 100644 cores/common/arduino/libraries/common/WiFiServer/LwIPServer.h create mode 100644 cores/common/arduino/libraries/common/WiFiServer/WiFiServer.h create mode 100644 cores/common/arduino/libraries/common/WiFiUdp/LwIPUdp.cpp create mode 100644 cores/common/arduino/libraries/common/WiFiUdp/LwIPUdp.h create mode 100644 cores/common/arduino/libraries/common/WiFiUdp/WiFiUdp.h create mode 100644 cores/common/arduino/libraries/common/mDNS/LwIPmDNS.cpp create mode 100644 cores/common/arduino/libraries/common/mDNS/mDNS.cpp create mode 100644 cores/common/arduino/libraries/common/mDNS/mDNS.h create mode 100644 cores/common/arduino/libraries/ext/HTTPClient/HTTPClient.cpp create mode 100644 cores/common/arduino/libraries/ext/HTTPClient/HTTPClient.h create mode 100644 cores/common/arduino/libraries/ext/StreamString/StreamString.cpp create mode 100644 cores/common/arduino/libraries/ext/StreamString/StreamString.h create mode 100644 cores/common/arduino/libraries/ext/WebServer/HTTP_Method.h create mode 100644 cores/common/arduino/libraries/ext/WebServer/Parsing.cpp create mode 100644 cores/common/arduino/libraries/ext/WebServer/Uri.h create mode 100644 cores/common/arduino/libraries/ext/WebServer/WebServer.cpp create mode 100644 cores/common/arduino/libraries/ext/WebServer/WebServer.h create mode 100644 cores/common/arduino/libraries/ext/WebServer/detail/RequestHandler.h create mode 100644 cores/common/arduino/libraries/ext/WebServer/detail/RequestHandlersImpl.h create mode 100644 cores/common/arduino/libraries/ext/WebServer/detail/mimetable.cpp create mode 100644 cores/common/arduino/libraries/ext/WebServer/detail/mimetable.h create mode 100644 cores/common/arduino/libraries/ext/WebServer/uri/UriBraces.h create mode 100644 cores/common/arduino/libraries/ext/WebServer/uri/UriGlob.h create mode 100644 cores/common/arduino/libraries/ext/WebServer/uri/UriRegex.h create mode 100644 cores/common/arduino/libraries/ext/WiFiMulti/WiFiMulti.cpp create mode 100644 cores/common/arduino/libraries/ext/WiFiMulti/WiFiMulti.h create mode 100644 cores/common/arduino/libraries/ext/base64/base64.cpp create mode 100644 cores/common/arduino/libraries/ext/base64/base64.h create mode 100644 cores/common/arduino/libraries/ext/base64/libb64/AUTHORS create mode 100644 cores/common/arduino/libraries/ext/base64/libb64/LICENSE create mode 100644 cores/common/arduino/libraries/ext/base64/libb64/cdecode.c create mode 100644 cores/common/arduino/libraries/ext/base64/libb64/cdecode.h create mode 100644 cores/common/arduino/libraries/ext/base64/libb64/cencode.c create mode 100644 cores/common/arduino/libraries/ext/base64/libb64/cencode.h create mode 100644 cores/common/arduino/libraries/ext/cbuf/cbuf.cpp create mode 100644 cores/common/arduino/libraries/ext/cbuf/cbuf.h create mode 100644 cores/common/arduino/libraries/inline/ESP/ESP.h create mode 100644 cores/common/arduino/libraries/inline/Flash/Flash.h create mode 100644 cores/common/arduino/libraries/inline/LT/LT.h create mode 100644 cores/common/arduino/libraries/inline/OTA/OTA.h create mode 100644 cores/common/arduino/libraries/inline/Singletons.cpp create mode 100644 cores/common/arduino/libraries/inline/WDT/WDT.h create mode 100644 cores/common/arduino/src/Arduino.h create mode 100644 cores/common/arduino/src/Events.cpp create mode 100644 cores/common/arduino/src/Events.h create mode 100644 cores/common/arduino/src/HardwareI2C.h create mode 100644 cores/common/arduino/src/common/abi.cpp create mode 100644 cores/common/arduino/src/common/dtostrf.c create mode 100644 cores/common/arduino/src/common/serial_event.cpp create mode 100644 cores/common/arduino/src/compat/ESPmDNS.h create mode 100644 cores/common/arduino/src/compat/FS.h create mode 100644 cores/common/arduino/src/compat/FSImpl.h create mode 100644 cores/common/arduino/src/compat/WiFiAP.h create mode 100644 cores/common/arduino/src/compat/md5.h create mode 100644 cores/common/arduino/src/compat/pgmspace.h create mode 100644 cores/common/arduino/src/compat/vfs_api.h create mode 100644 cores/common/arduino/src/main.c create mode 100644 cores/common/arduino/src/posix/time.c create mode 100644 cores/common/arduino/src/wiring/wiring.c create mode 100644 cores/common/arduino/src/wiring/wiring_compat.cpp create mode 100644 cores/common/arduino/src/wiring/wiring_compat.h create mode 100644 cores/common/arduino/src/wiring/wiring_custom.c create mode 100644 cores/common/arduino/src/wiring/wiring_custom.h create mode 100644 cores/common/arduino/src/wiring/wiring_irq.c create mode 100644 cores/common/arduino/src/wiring/wiring_math.cpp create mode 100644 cores/common/arduino/src/wiring/wiring_private.c create mode 100644 cores/common/arduino/src/wiring/wiring_private.h create mode 100644 cores/common/arduino/src/wiring/wiring_shift.c create mode 100644 cores/common/base/api/lt_cpu.c create mode 100644 cores/common/base/api/lt_cpu.h create mode 100644 cores/common/base/api/lt_device.c create mode 100644 cores/common/base/api/lt_device.h create mode 100644 cores/common/base/api/lt_flash.c create mode 100644 cores/common/base/api/lt_flash.h create mode 100644 cores/common/base/api/lt_init.h create mode 100644 cores/common/base/api/lt_mem.c create mode 100644 cores/common/base/api/lt_mem.h create mode 100644 cores/common/base/api/lt_ota.c create mode 100644 cores/common/base/api/lt_ota.h create mode 100644 cores/common/base/api/lt_sleep.c create mode 100644 cores/common/base/api/lt_sleep.h create mode 100644 cores/common/base/api/lt_utils.c create mode 100644 cores/common/base/api/lt_utils.h create mode 100644 cores/common/base/api/lt_wdt.c create mode 100644 cores/common/base/api/lt_wdt.h create mode 100644 cores/common/base/compat/certs.h create mode 100644 cores/common/base/compat/err.h create mode 100644 cores/common/base/compat/lwip/lwip_timers.h create mode 100644 cores/common/base/compat/netdb.h create mode 100644 cores/common/base/compat/netif.h create mode 100644 cores/common/base/compat/sockets.h create mode 100644 cores/common/base/compat/sys.h create mode 100644 cores/common/base/compat/tcpip.h create mode 100644 cores/common/base/compat/udp.h create mode 100644 cores/common/base/config/fal_cfg.h create mode 100644 cores/common/base/config/fdb_cfg.h create mode 100644 cores/common/base/config/lwipopts.h create mode 100644 cores/common/base/config/printf_config.h create mode 100644 cores/common/base/fixups/errno.h create mode 100644 cores/common/base/fixups/lwip/errno.h create mode 100644 cores/common/base/fixups/malloc.c create mode 100644 cores/common/base/libretiny.h create mode 100644 cores/common/base/lt_api.h create mode 100644 cores/common/base/lt_config.h create mode 100644 cores/common/base/lt_logger.c create mode 100644 cores/common/base/lt_logger.h create mode 100644 cores/common/base/lt_main.c create mode 100644 cores/common/base/lt_pins.h create mode 100644 cores/common/base/lt_posix_api.h create mode 100644 cores/common/base/lt_types.h create mode 100644 cores/common/base/posix/itoa.c create mode 100644 cores/common/base/posix/strcasecmp.c create mode 100644 cores/common/base/posix/strdup.c create mode 100644 cores/common/base/posix/strptime.c create mode 100644 cores/common/base/wraps/putchar.c create mode 100644 cores/common/base/wraps/puts.c create mode 100644 cores/realtek-amb/arduino/libraries/SoftwareSerial/SoftwareSerial.cpp create mode 100644 cores/realtek-amb/arduino/libraries/WiFi/WiFi.cpp create mode 100644 cores/realtek-amb/arduino/libraries/WiFi/WiFiAP.cpp create mode 100644 cores/realtek-amb/arduino/libraries/WiFi/WiFiEvents.cpp create mode 100644 cores/realtek-amb/arduino/libraries/WiFi/WiFiGeneric.cpp create mode 100644 cores/realtek-amb/arduino/libraries/WiFi/WiFiPrivate.h create mode 100644 cores/realtek-amb/arduino/libraries/WiFi/WiFiSTA.cpp create mode 100644 cores/realtek-amb/arduino/libraries/WiFi/WiFiScan.cpp create mode 100644 cores/realtek-amb/arduino/libraries/Wire/Wire.cpp create mode 100644 cores/realtek-amb/arduino/libraries/Wire/Wire.h create mode 100644 cores/realtek-amb/arduino/src/ArduinoFamily.h create mode 100644 cores/realtek-amb/arduino/src/api/lt_cpu.c create mode 100644 cores/realtek-amb/arduino/src/lt_defs.h create mode 100644 cores/realtek-amb/arduino/src/main.cpp create mode 100644 cores/realtek-amb/arduino/src/wiring.c create mode 100644 cores/realtek-amb/arduino/src/wiring_analog.c create mode 100644 cores/realtek-amb/arduino/src/wiring_data.h create mode 100644 cores/realtek-amb/arduino/src/wiring_digital.c create mode 100644 cores/realtek-amb/arduino/src/wiring_irq.c create mode 100644 cores/realtek-amb/arduino/src/wiring_pulse.c create mode 100644 cores/realtek-amb/base/api/lt_flash.c create mode 100644 cores/realtek-amb/base/api/lt_wdt.c create mode 100644 cores/realtek-amb/base/config/build_info.h create mode 100644 cores/realtek-amb/base/config/lwipopts.h create mode 100644 cores/realtek-amb/base/config/main.h create mode 100644 cores/realtek-amb/base/fixups/basic_types.h create mode 100644 cores/realtek-amb/base/fixups/cmsis_ipsr.c create mode 100644 cores/realtek-amb/base/fixups/machine/endian.h create mode 100644 cores/realtek-amb/base/fixups/platform/platform_stdlib.h create mode 100644 cores/realtek-amb/base/fixups/platform_stdlib.h create mode 100644 cores/realtek-amb/base/fixups/section_config.h create mode 100644 cores/realtek-amb/base/fixups/wifi_mode.c create mode 100644 cores/realtek-amb/base/lt_defs.h create mode 100644 cores/realtek-amb/base/port/fal_flash_ambz_port.c create mode 100644 cores/realtek-amb/base/sdk_private.h create mode 100644 cores/realtek-ambz/arduino/libraries/Serial/Serial.cpp create mode 100644 cores/realtek-ambz/arduino/libraries/Serial/SerialPrivate.h create mode 100644 cores/realtek-ambz/arduino/src/lt_defs.h create mode 100644 cores/realtek-ambz/base/api/lt_cpu.c create mode 100644 cores/realtek-ambz/base/api/lt_device.c create mode 100644 cores/realtek-ambz/base/api/lt_flash.c create mode 100644 cores/realtek-ambz/base/api/lt_init.c create mode 100644 cores/realtek-ambz/base/api/lt_mem.c create mode 100644 cores/realtek-ambz/base/api/lt_ota.c create mode 100644 cores/realtek-ambz/base/config/FreeRTOSConfig.h create mode 100644 cores/realtek-ambz/base/config/platform_opts.h create mode 100644 cores/realtek-ambz/base/fixups/app_start_patch.c create mode 100644 cores/realtek-ambz/base/fixups/cmsis.h create mode 100644 cores/realtek-ambz/base/fixups/hal_crypto.h create mode 100644 cores/realtek-ambz/base/fixups/lib_rtlstd_patch.a create mode 100644 cores/realtek-ambz/base/fixups/lib_rtlstd_patch/index.html create mode 100644 cores/realtek-ambz/base/fixups/log_uart.c create mode 100644 cores/realtek-ambz/base/fixups/memproc.h create mode 100644 cores/realtek-ambz/base/fixups/net_sockets.c create mode 100644 cores/realtek-ambz/base/fixups/strproc.h create mode 100644 cores/realtek-ambz/base/lt_defs.h create mode 100644 cores/realtek-ambz/base/lt_family.h create mode 100644 cores/realtek-ambz/base/port/printf.c create mode 100644 cores/realtek-ambz/base/port/printf_port.h create mode 100644 cores/realtek-ambz/base/sdk_extern.h create mode 100644 cores/realtek-ambz/base/wraps/stdlib.c create mode 100644 cores/realtek-ambz/misc/amebaz.cfg create mode 100644 cores/realtek-ambz/misc/boot_all_10C7.bin create mode 100644 cores/realtek-ambz/misc/boot_all_77F7.bin create mode 100644 cores/realtek-ambz/misc/boot_all_C556.bin create mode 100644 cores/realtek-ambz/misc/export-rom_symbol_v01.txt create mode 100644 cores/realtek-ambz/misc/rlx8711B-symbol-v02-img2_xip1.template.ld create mode 100644 cores/realtek-ambz/misc/rlx8711B-symbol-v02-img2_xip2.template.ld create mode 100644 cores/realtek-ambz2/arduino/libraries/Serial/Serial.cpp create mode 100644 cores/realtek-ambz2/arduino/libraries/Serial/SerialPrivate.h create mode 100644 cores/realtek-ambz2/arduino/src/lt_defs.h create mode 100644 cores/realtek-ambz2/base/api/lt_cpu.c create mode 100644 cores/realtek-ambz2/base/api/lt_device.c create mode 100644 cores/realtek-ambz2/base/api/lt_init.c create mode 100644 cores/realtek-ambz2/base/api/lt_mem.c create mode 100644 cores/realtek-ambz2/base/api/lt_ota.c create mode 100644 cores/realtek-ambz2/base/config/lwipopts.h create mode 100644 cores/realtek-ambz2/base/config/platform_conf.h create mode 100644 cores/realtek-ambz2/base/config/platform_opts.h create mode 100644 cores/realtek-ambz2/base/fixups/cmd_shell.c create mode 100644 cores/realtek-ambz2/base/fixups/cmsis.h create mode 100644 cores/realtek-ambz2/base/fixups/diag.h create mode 100644 cores/realtek-ambz2/base/fixups/hal_flash.h create mode 100644 cores/realtek-ambz2/base/fixups/memory.c create mode 100644 cores/realtek-ambz2/base/fixups/memory.h create mode 100644 cores/realtek-ambz2/base/fixups/rtl8710c_freertos_pmu.h create mode 100644 cores/realtek-ambz2/base/fixups/strproc.c create mode 100644 cores/realtek-ambz2/base/fixups/strproc.h create mode 100644 cores/realtek-ambz2/base/fixups/time64.h create mode 100644 cores/realtek-ambz2/base/fixups/utility.h create mode 100644 cores/realtek-ambz2/base/fixups/wireless.h create mode 100644 cores/realtek-ambz2/base/lt_defs.h create mode 100644 cores/realtek-ambz2/base/lt_family.h create mode 100644 cores/realtek-ambz2/base/port/printf.c create mode 100644 cores/realtek-ambz2/base/port/printf_port.h create mode 100644 cores/realtek-ambz2/base/sdk_extern.h create mode 100644 cores/realtek-ambz2/misc/rtl8710c_ram.ld create mode 100644 docs/CNAME create mode 100644 docs/TODO/index.html create mode 100644 docs/boards_tuya_all.json create mode 100644 docs/contrib/lt-api-functions/index.html create mode 100644 docs/contrib/lt-api/index.html create mode 100644 docs/contrib/ota/index.html create mode 100644 docs/contrib/ota/library/index.html create mode 100644 docs/contrib/ota/uf2ota/index.html create mode 100644 docs/contrib/porting/index.html create mode 100644 docs/contrib/project-structure/index.html create mode 100644 docs/contrib/stdlib/index.html create mode 100644 docs/dev/config/index.html create mode 100644 docs/dev/libs-3rd-party/index.html create mode 100644 docs/dev/lt-api/index.html create mode 100644 docs/dev/migration_v1.0.0/index.html create mode 100644 docs/flashing/SUMMARY/index.html create mode 100644 docs/flashing/dumping/index.html create mode 100644 docs/flashing/esphome/index.html create mode 100644 docs/flashing/platformio/index.html create mode 100644 docs/flashing/tools/adr/index.html create mode 100644 docs/flashing/tools/cloudcutter/index.html create mode 100644 docs/flashing/tools/ltchiptool/index.html create mode 100644 docs/getting-started/gpio/index.html create mode 100644 docs/getting-started/index.html create mode 100644 docs/inc/find-board/index.html create mode 100644 docs/inc/flashing-note/index.html create mode 100644 docs/inc/ota-cloudcutter/index.html create mode 100644 docs/inc/ota-openbeken/index.html create mode 100644 docs/inc/uart-adr/index.html create mode 100644 docs/inc/uart-cen/index.html create mode 100644 docs/inc/uart-info/index.html create mode 100644 docs/inc/uart-ltchiptool/index.html create mode 100644 docs/inc/uart-power/index.html create mode 100644 docs/index.html create mode 100644 docs/platform/SUMMARY/index.html create mode 100644 docs/platform/beken-72xx/index.html create mode 100644 docs/platform/beken-72xx/keys/index.html create mode 100644 docs/platform/realtek-amb/index.html create mode 100644 docs/platform/realtek-ambz/debugging/index.html create mode 100644 docs/platform/realtek-ambz/exception-decoder/index.html create mode 100644 docs/platform/realtek-ambz/index.html create mode 100644 docs/projects/esphome/index.html create mode 100644 docs/requirements.txt create mode 100644 docs/resources/SUMMARY/index.html create mode 100644 docs/resources/beken-flash/index.html create mode 100644 docs/resources/documents/index.html create mode 100644 docs/resources/tuya-pin-config/index.html create mode 100644 docs/script.js create mode 100644 docs/scripts/__pycache__/markdown.cpython-310.pyc create mode 100644 docs/scripts/__pycache__/write_boards.cpython-310.pyc create mode 100644 docs/scripts/build_json.py create mode 100644 docs/scripts/markdown.py create mode 100644 docs/scripts/prepare_doxygen.py create mode 100644 docs/scripts/write_apis.py create mode 100644 docs/scripts/write_boards.py create mode 100644 docs/status/supported/index.html create mode 100644 docs/status/supported_boards/index.html create mode 100644 docs/status/supported_chips/index.html create mode 100644 docs/status/supported_families/index.html create mode 100644 docs/status/unsupported_boards_tuya_all/index.html create mode 100644 docs/style.css create mode 100644 examples/PinScan/index.html create mode 100644 examples/PinScan/platformio.ini create mode 100644 examples/PinScan/src/analog.cpp create mode 100644 examples/PinScan/src/digital.cpp create mode 100644 examples/PinScan/src/help.cpp create mode 100644 examples/PinScan/src/pinscan.cpp create mode 100644 examples/PinScan/src/pinscan.h create mode 100644 examples/PinScan/src/ui.cpp create mode 100644 examples/SUMMARY/index.html create mode 100644 external-libs.json create mode 100644 external-libs.schema.json create mode 100644 families.json create mode 100644 families.schema.json create mode 100644 index.html create mode 100644 link/bk72xx-keys/index.html create mode 100644 link/boards/index.html create mode 100644 link/cloudcutter-digiblur/index.html create mode 100644 link/cloudcutter-video/index.html create mode 100644 link/config-debug/index.html create mode 100644 link/config-serial/index.html create mode 100644 link/config/index.html create mode 100644 link/flashing-beken-72xx/index.html create mode 100644 link/flashing-realtek-ambz/index.html create mode 100644 link/gpio-access/index.html create mode 100644 link/kickstart/index.html create mode 100644 ltapi/_arduino_8h/index.html create mode 100644 ltapi/_arduino_8h_source/index.html create mode 100644 ltapi/_e_s_p_8h/index.html create mode 100644 ltapi/_e_s_p_8h_source/index.html create mode 100644 ltapi/_e_s_pm_d_n_s_8h/index.html create mode 100644 ltapi/_e_s_pm_d_n_s_8h_source/index.html create mode 100644 ltapi/_events_8cpp/index.html create mode 100644 ltapi/_events_8cpp_source/index.html create mode 100644 ltapi/_events_8h/index.html create mode 100644 ltapi/_events_8h_source/index.html create mode 100644 ltapi/_f_s_8cpp/index.html create mode 100644 ltapi/_f_s_8cpp_source/index.html create mode 100644 ltapi/_f_s_impl_8h/index.html create mode 100644 ltapi/_f_s_impl_8h_source/index.html create mode 100644 ltapi/_flash_8h/index.html create mode 100644 ltapi/_flash_8h_source/index.html create mode 100644 ltapi/_h_t_t_p___method_8h/index.html create mode 100644 ltapi/_h_t_t_p___method_8h_source/index.html create mode 100644 ltapi/_h_t_t_p_client_8cpp/index.html create mode 100644 ltapi/_h_t_t_p_client_8cpp_source/index.html create mode 100644 ltapi/_h_t_t_p_client_8h/index.html create mode 100644 ltapi/_h_t_t_p_client_8h_source/index.html create mode 100644 ltapi/_hardware_i2_c_8h/index.html create mode 100644 ltapi/_hardware_i2_c_8h_source/index.html create mode 100644 ltapi/_i_pv6_address_8cpp/index.html create mode 100644 ltapi/_i_pv6_address_8cpp_source/index.html create mode 100644 ltapi/_i_pv6_address_8h/index.html create mode 100644 ltapi/_i_pv6_address_8h_source/index.html create mode 100644 ltapi/_l_t_8h/index.html create mode 100644 ltapi/_l_t_8h_source/index.html create mode 100644 ltapi/_lw_i_p_client_8cpp/index.html create mode 100644 ltapi/_lw_i_p_client_8cpp_source/index.html create mode 100644 ltapi/_lw_i_p_client_8h/index.html create mode 100644 ltapi/_lw_i_p_client_8h_source/index.html create mode 100644 ltapi/_lw_i_p_rx_buffer_8cpp/index.html create mode 100644 ltapi/_lw_i_p_rx_buffer_8cpp_source/index.html create mode 100644 ltapi/_lw_i_p_rx_buffer_8h/index.html create mode 100644 ltapi/_lw_i_p_rx_buffer_8h_source/index.html create mode 100644 ltapi/_lw_i_p_server_8cpp/index.html create mode 100644 ltapi/_lw_i_p_server_8cpp_source/index.html create mode 100644 ltapi/_lw_i_p_server_8h/index.html create mode 100644 ltapi/_lw_i_p_server_8h_source/index.html create mode 100644 ltapi/_lw_i_p_udp_8cpp/index.html create mode 100644 ltapi/_lw_i_p_udp_8cpp_source/index.html create mode 100644 ltapi/_lw_i_p_udp_8h/index.html create mode 100644 ltapi/_lw_i_p_udp_8h_source/index.html create mode 100644 ltapi/_lw_i_pm_d_n_s_8cpp/index.html create mode 100644 ltapi/_lw_i_pm_d_n_s_8cpp_source/index.html create mode 100644 ltapi/_m_d5_hostapd_impl_8h/index.html create mode 100644 ltapi/_m_d5_hostapd_impl_8h_source/index.html create mode 100644 ltapi/_m_d5_mbed_t_l_s_impl_8cpp/index.html create mode 100644 ltapi/_m_d5_mbed_t_l_s_impl_8cpp_source/index.html create mode 100644 ltapi/_m_d5_mbed_t_l_s_impl_8h/index.html create mode 100644 ltapi/_m_d5_mbed_t_l_s_impl_8h_source/index.html create mode 100644 ltapi/_mbed_t_l_s_client_8cpp/index.html create mode 100644 ltapi/_mbed_t_l_s_client_8cpp_source/index.html create mode 100644 ltapi/_mbed_t_l_s_client_8h/index.html create mode 100644 ltapi/_mbed_t_l_s_client_8h_source/index.html create mode 100644 ltapi/_o_t_a_8h/index.html create mode 100644 ltapi/_o_t_a_8h_source/index.html create mode 100644 ltapi/_parsing_8cpp/index.html create mode 100644 ltapi/_parsing_8cpp_source/index.html create mode 100644 ltapi/_preferences_8h/index.html create mode 100644 ltapi/_preferences_8h_source/index.html create mode 100644 ltapi/_request_handler_8h/index.html create mode 100644 ltapi/_request_handler_8h_source/index.html create mode 100644 ltapi/_request_handlers_impl_8h/index.html create mode 100644 ltapi/_request_handlers_impl_8h_source/index.html create mode 100644 ltapi/_serial_8cpp/index.html create mode 100644 ltapi/_serial_8cpp_source/index.html create mode 100644 ltapi/_serial_8h/index.html create mode 100644 ltapi/_serial_8h_source/index.html create mode 100644 ltapi/_singletons_8cpp/index.html create mode 100644 ltapi/_singletons_8cpp_source/index.html create mode 100644 ltapi/_software_serial_8cpp/index.html create mode 100644 ltapi/_software_serial_8cpp_source/index.html create mode 100644 ltapi/_software_serial_8h/index.html create mode 100644 ltapi/_software_serial_8h_source/index.html create mode 100644 ltapi/_stream_string_8cpp/index.html create mode 100644 ltapi/_stream_string_8cpp_source/index.html create mode 100644 ltapi/_stream_string_8h/index.html create mode 100644 ltapi/_stream_string_8h_source/index.html create mode 100644 ltapi/_update_8cpp/index.html create mode 100644 ltapi/_update_8cpp_source/index.html create mode 100644 ltapi/_update_8h/index.html create mode 100644 ltapi/_update_8h_source/index.html create mode 100644 ltapi/_update_util_8cpp/index.html create mode 100644 ltapi/_update_util_8cpp_source/index.html create mode 100644 ltapi/_uri_8h/index.html create mode 100644 ltapi/_uri_8h_source/index.html create mode 100644 ltapi/_uri_braces_8h/index.html create mode 100644 ltapi/_uri_braces_8h_source/index.html create mode 100644 ltapi/_uri_glob_8h/index.html create mode 100644 ltapi/_uri_glob_8h_source/index.html create mode 100644 ltapi/_uri_regex_8h/index.html create mode 100644 ltapi/_uri_regex_8h_source/index.html create mode 100644 ltapi/_w_d_t_8h/index.html create mode 100644 ltapi/_w_d_t_8h_source/index.html create mode 100644 ltapi/_web_server_8cpp/index.html create mode 100644 ltapi/_web_server_8cpp_source/index.html create mode 100644 ltapi/_web_server_8h/index.html create mode 100644 ltapi/_web_server_8h_source/index.html create mode 100644 ltapi/_wi_fi_8cpp/index.html create mode 100644 ltapi/_wi_fi_8cpp_source/index.html create mode 100644 ltapi/_wi_fi_8h/index.html create mode 100644 ltapi/_wi_fi_8h_source/index.html create mode 100644 ltapi/_wi_fi_a_p_8cpp/index.html create mode 100644 ltapi/_wi_fi_a_p_8cpp_source/index.html create mode 100644 ltapi/_wi_fi_a_p_8h/index.html create mode 100644 ltapi/_wi_fi_a_p_8h_source/index.html create mode 100644 ltapi/_wi_fi_client_8h/index.html create mode 100644 ltapi/_wi_fi_client_8h_source/index.html create mode 100644 ltapi/_wi_fi_client_secure_8h/index.html create mode 100644 ltapi/_wi_fi_client_secure_8h_source/index.html create mode 100644 ltapi/_wi_fi_events_8cpp/index.html create mode 100644 ltapi/_wi_fi_events_8cpp_source/index.html create mode 100644 ltapi/_wi_fi_events_8h/index.html create mode 100644 ltapi/_wi_fi_events_8h_source/index.html create mode 100644 ltapi/_wi_fi_generic_8cpp/index.html create mode 100644 ltapi/_wi_fi_generic_8cpp_source/index.html create mode 100644 ltapi/_wi_fi_multi_8cpp/index.html create mode 100644 ltapi/_wi_fi_multi_8cpp_source/index.html create mode 100644 ltapi/_wi_fi_multi_8h/index.html create mode 100644 ltapi/_wi_fi_multi_8h_source/index.html create mode 100644 ltapi/_wi_fi_s_t_a_8cpp/index.html create mode 100644 ltapi/_wi_fi_s_t_a_8cpp_source/index.html create mode 100644 ltapi/_wi_fi_scan_8cpp/index.html create mode 100644 ltapi/_wi_fi_scan_8cpp_source/index.html create mode 100644 ltapi/_wi_fi_server_8h/index.html create mode 100644 ltapi/_wi_fi_server_8h_source/index.html create mode 100644 ltapi/_wi_fi_type_8h/index.html create mode 100644 ltapi/_wi_fi_type_8h_source/index.html create mode 100644 ltapi/_wi_fi_udp_8h/index.html create mode 100644 ltapi/_wi_fi_udp_8h_source/index.html create mode 100644 ltapi/abi_8cpp/index.html create mode 100644 ltapi/abi_8cpp_source/index.html create mode 100644 ltapi/annotated/index.html create mode 100644 ltapi/api_2_i_pv6_address_8h/index.html create mode 100644 ltapi/api_2_i_pv6_address_8h_source/index.html create mode 100644 ltapi/base64_8cpp/index.html create mode 100644 ltapi/base64_8cpp_source/index.html create mode 100644 ltapi/base64_8h/index.html create mode 100644 ltapi/base64_8h_source/index.html create mode 100644 ltapi/cbuf_8cpp/index.html create mode 100644 ltapi/cbuf_8cpp_source/index.html create mode 100644 ltapi/cbuf_8h/index.html create mode 100644 ltapi/cbuf_8h_source/index.html create mode 100644 ltapi/cdecode_8c/index.html create mode 100644 ltapi/cdecode_8c_source/index.html create mode 100644 ltapi/cdecode_8h/index.html create mode 100644 ltapi/cdecode_8h_source/index.html create mode 100644 ltapi/cencode_8c/index.html create mode 100644 ltapi/cencode_8c_source/index.html create mode 100644 ltapi/cencode_8h/index.html create mode 100644 ltapi/cencode_8h_source/index.html create mode 100644 ltapi/certs_8h/index.html create mode 100644 ltapi/certs_8h_source/index.html create mode 100644 ltapi/class_esp_class/index.html create mode 100644 ltapi/class_flash_class/index.html create mode 100644 ltapi/class_function_request_handler/index.html create mode 100644 ltapi/class_h_t_t_p_client/index.html create mode 100644 ltapi/class_hardware_i2_c/index.html create mode 100644 ltapi/class_i_preferences/index.html create mode 100644 ltapi/class_i_wi_fi_client/index.html create mode 100644 ltapi/class_i_wi_fi_client_secure/index.html create mode 100644 ltapi/class_i_wi_fi_server/index.html create mode 100644 ltapi/class_i_wi_fi_u_d_p/index.html create mode 100644 ltapi/class_libre_tiny/index.html create mode 100644 ltapi/class_libre_tiny_o_t_a/index.html create mode 100644 ltapi/class_libre_tiny_w_d_t/index.html create mode 100644 ltapi/class_lw_i_p_client/index.html create mode 100644 ltapi/class_lw_i_p_rx_buffer/index.html create mode 100644 ltapi/class_lw_i_p_server/index.html create mode 100644 ltapi/class_lw_i_p_u_d_p/index.html create mode 100644 ltapi/class_mbed_t_l_s_client/index.html create mode 100644 ltapi/class_member_enums/index.html create mode 100644 ltapi/class_member_functions/index.html create mode 100644 ltapi/class_member_typedefs/index.html create mode 100644 ltapi/class_member_variables/index.html create mode 100644 ltapi/class_members/index.html create mode 100644 ltapi/class_request_handler/index.html create mode 100644 ltapi/class_serial_class/index.html create mode 100644 ltapi/class_software_serial/index.html create mode 100644 ltapi/class_static_request_handler/index.html create mode 100644 ltapi/class_stream_string/index.html create mode 100644 ltapi/class_update_class/index.html create mode 100644 ltapi/class_uri/index.html create mode 100644 ltapi/class_uri_braces/index.html create mode 100644 ltapi/class_uri_glob/index.html create mode 100644 ltapi/class_uri_regex/index.html create mode 100644 ltapi/class_web_server/index.html create mode 100644 ltapi/class_wi_fi_class/index.html create mode 100644 ltapi/class_wi_fi_multi/index.html create mode 100644 ltapi/classarduino_1_1_i_pv6_address/index.html create mode 100644 ltapi/classbase64/index.html create mode 100644 ltapi/classcbuf/index.html create mode 100644 ltapi/classes/index.html create mode 100644 ltapi/classfs_1_1_f_s/index.html create mode 100644 ltapi/classfs_1_1_f_s_impl/index.html create mode 100644 ltapi/classfs_1_1_file/index.html create mode 100644 ltapi/classfs_1_1_file_impl/index.html create mode 100644 ltapi/classm_d_n_s/index.html create mode 100644 ltapi/dir_061390acc221bc2d9c9cb2f4362dac1d/index.html create mode 100644 ltapi/dir_07703e3b72c625f10ef9850082fac0e3/index.html create mode 100644 ltapi/dir_0a3ac6ff289d4ebfcd0c797d13f9a373/index.html create mode 100644 ltapi/dir_0a5433a1da7b2b93282c1ad1558c5479/index.html create mode 100644 ltapi/dir_0e053ac3caf93ca4495f626616698305/index.html create mode 100644 ltapi/dir_117c171b5277df11652dc53a144cb684/index.html create mode 100644 ltapi/dir_17709fc88a4f25e302be8aa6231cd94b/index.html create mode 100644 ltapi/dir_1927ccce0cee954fb29eb9cedf1bc791/index.html create mode 100644 ltapi/dir_1f237d2cf3ecae9e1cbbfcb1aefdc1b7/index.html create mode 100644 ltapi/dir_20c0973793fbdc84288fa19008185bd9/index.html create mode 100644 ltapi/dir_264b85d2860d8f7b79a05bde705c2149/index.html create mode 100644 ltapi/dir_2f50d07e877c964a6683aa974aacc5a9/index.html create mode 100644 ltapi/dir_317cbb6bf43941e79ffdd996bee8e3bd/index.html create mode 100644 ltapi/dir_368b4a9ec74cf1c10b8199770b5e2c1b/index.html create mode 100644 ltapi/dir_466525e97edd1426939c6f6f1c4cc401/index.html create mode 100644 ltapi/dir_51d9c9f08f6806a0f97badf342e5b4d7/index.html create mode 100644 ltapi/dir_540dc0be13f8284f6014d0451691d894/index.html create mode 100644 ltapi/dir_561e7e821afe2d99042aaa333fa070ac/index.html create mode 100644 ltapi/dir_5cec7dea66206196679083f825c4cd25/index.html create mode 100644 ltapi/dir_5e75bcdb2ffaceb01f94db1177614a08/index.html create mode 100644 ltapi/dir_5ea3aad773d57a5f23d4c7a2455c87eb/index.html create mode 100644 ltapi/dir_715308b29b364e222d2654a6be231c22/index.html create mode 100644 ltapi/dir_7b42ca4cd5530baa6d3cca740865775d/index.html create mode 100644 ltapi/dir_7c3b5015b008a83a07f1017471251f6f/index.html create mode 100644 ltapi/dir_846e8f2c00731a5babdd912d0551347c/index.html create mode 100644 ltapi/dir_84f0c24223fe15b4f2fbb2a476e54856/index.html create mode 100644 ltapi/dir_8526abab122814721f0f43c2acad511e/index.html create mode 100644 ltapi/dir_8a0a878499ba56a6674d17f5d719a3ab/index.html create mode 100644 ltapi/dir_8dc93de83995bf7a7f7c574b7e694258/index.html create mode 100644 ltapi/dir_930634efd5dc4a957bbb6e685a3ccda1/index.html create mode 100644 ltapi/dir_947f33558ea20e7a91b0d58d77bc396d/index.html create mode 100644 ltapi/dir_94e03dba73a2283a03d5afbcd7ac96fd/index.html create mode 100644 ltapi/dir_a154785acb726885f254a47f397a1398/index.html create mode 100644 ltapi/dir_ac62547f78cd9f887119f688c741ca23/index.html create mode 100644 ltapi/dir_b483440aeb16b525e6183721aad24145/index.html create mode 100644 ltapi/dir_b638d0c61cb610adbc247035a3e10d3e/index.html create mode 100644 ltapi/dir_bd1e4bd763507df1c98830c76e327ffd/index.html create mode 100644 ltapi/dir_bdd93a4e8b1efe1644b5e8d87982bdbf/index.html create mode 100644 ltapi/dir_c7e317b16142bccc961a83c0babf0065/index.html create mode 100644 ltapi/dir_cd39a9ca7156574bbf526216c63c01b5/index.html create mode 100644 ltapi/dir_d96db7fd7f8e0e902a4f4b8f7da27505/index.html create mode 100644 ltapi/dir_df2c4eb2fc0858b25d84c91a81f7ab75/index.html create mode 100644 ltapi/dir_e15f2f53a75910fcd29e18d04ab3723d/index.html create mode 100644 ltapi/dir_e34b8d08ec2a080356b302de1e1a00cf/index.html create mode 100644 ltapi/dir_e3ef11b23e60019cef556571ad08a868/index.html create mode 100644 ltapi/dir_e7aea143128db3d890560fea5ce624b6/index.html create mode 100644 ltapi/dir_f12ca718858451d77068237cb7af4643/index.html create mode 100644 ltapi/dir_f2f13d16dd1b4421bdcca863af8fd41a/index.html create mode 100644 ltapi/dir_fbd007664e1d3c6800f6de85378c1012/index.html create mode 100644 ltapi/dtostrf_8c/index.html create mode 100644 ltapi/dtostrf_8c_source/index.html create mode 100644 ltapi/err_8h/index.html create mode 100644 ltapi/err_8h_source/index.html create mode 100644 ltapi/errno_8h/index.html create mode 100644 ltapi/errno_8h_source/index.html create mode 100644 ltapi/fal__cfg_8h/index.html create mode 100644 ltapi/fal__cfg_8h_source/index.html create mode 100644 ltapi/fdb__cfg_8h/index.html create mode 100644 ltapi/fdb__cfg_8h_source/index.html create mode 100644 ltapi/files/index.html create mode 100644 ltapi/functions/index.html create mode 100644 ltapi/hierarchy/index.html create mode 100644 ltapi/itoa_8c/index.html create mode 100644 ltapi/itoa_8c_source/index.html create mode 100644 ltapi/libraries_2common_2_f_s_2_f_s_8h/index.html create mode 100644 ltapi/libraries_2common_2_f_s_2_f_s_8h_source/index.html create mode 100644 ltapi/libraries_2common_2_m_d5_2_m_d5_8h/index.html create mode 100644 ltapi/libraries_2common_2_m_d5_2_m_d5_8h_source/index.html create mode 100644 ltapi/libretiny_8h/index.html create mode 100644 ltapi/libretiny_8h_source/index.html create mode 100644 ltapi/links/index.html create mode 100644 ltapi/lt__api_8h/index.html create mode 100644 ltapi/lt__api_8h_source/index.html create mode 100644 ltapi/lt__config_8h/index.html create mode 100644 ltapi/lt__config_8h_source/index.html create mode 100644 ltapi/lt__cpu_8c/index.html create mode 100644 ltapi/lt__cpu_8c_source/index.html create mode 100644 ltapi/lt__cpu_8h/index.html create mode 100644 ltapi/lt__cpu_8h_source/index.html create mode 100644 ltapi/lt__device_8c/index.html create mode 100644 ltapi/lt__device_8c_source/index.html create mode 100644 ltapi/lt__device_8h/index.html create mode 100644 ltapi/lt__device_8h_source/index.html create mode 100644 ltapi/lt__flash_8c/index.html create mode 100644 ltapi/lt__flash_8c_source/index.html create mode 100644 ltapi/lt__flash_8h/index.html create mode 100644 ltapi/lt__flash_8h_source/index.html create mode 100644 ltapi/lt__init_8h/index.html create mode 100644 ltapi/lt__init_8h_source/index.html create mode 100644 ltapi/lt__logger_8c/index.html create mode 100644 ltapi/lt__logger_8c_source/index.html create mode 100644 ltapi/lt__logger_8h/index.html create mode 100644 ltapi/lt__logger_8h_source/index.html create mode 100644 ltapi/lt__main_8c/index.html create mode 100644 ltapi/lt__main_8c_source/index.html create mode 100644 ltapi/lt__mem_8c/index.html create mode 100644 ltapi/lt__mem_8c_source/index.html create mode 100644 ltapi/lt__mem_8h/index.html create mode 100644 ltapi/lt__mem_8h_source/index.html create mode 100644 ltapi/lt__ota_8c/index.html create mode 100644 ltapi/lt__ota_8c_source/index.html create mode 100644 ltapi/lt__ota_8h/index.html create mode 100644 ltapi/lt__ota_8h_source/index.html create mode 100644 ltapi/lt__pins_8h/index.html create mode 100644 ltapi/lt__pins_8h_source/index.html create mode 100644 ltapi/lt__posix__api_8h/index.html create mode 100644 ltapi/lt__posix__api_8h_source/index.html create mode 100644 ltapi/lt__sleep_8c/index.html create mode 100644 ltapi/lt__sleep_8c_source/index.html create mode 100644 ltapi/lt__sleep_8h/index.html create mode 100644 ltapi/lt__sleep_8h_source/index.html create mode 100644 ltapi/lt__types_8h/index.html create mode 100644 ltapi/lt__types_8h_source/index.html create mode 100644 ltapi/lt__utils_8c/index.html create mode 100644 ltapi/lt__utils_8c_source/index.html create mode 100644 ltapi/lt__utils_8h/index.html create mode 100644 ltapi/lt__utils_8h_source/index.html create mode 100644 ltapi/lt__wdt_8c/index.html create mode 100644 ltapi/lt__wdt_8c_source/index.html create mode 100644 ltapi/lt__wdt_8h/index.html create mode 100644 ltapi/lt__wdt_8h_source/index.html create mode 100644 ltapi/lwip_2errno_8h/index.html create mode 100644 ltapi/lwip_2errno_8h_source/index.html create mode 100644 ltapi/lwip__timers_8h/index.html create mode 100644 ltapi/lwip__timers_8h_source/index.html create mode 100644 ltapi/lwipopts_8h/index.html create mode 100644 ltapi/lwipopts_8h_source/index.html create mode 100644 ltapi/m_d_n_s_8cpp/index.html create mode 100644 ltapi/m_d_n_s_8cpp_source/index.html create mode 100644 ltapi/m_d_n_s_8h/index.html create mode 100644 ltapi/m_d_n_s_8h_source/index.html create mode 100644 ltapi/macros/index.html create mode 100644 ltapi/main_8c/index.html create mode 100644 ltapi/main_8c_source/index.html create mode 100644 ltapi/malloc_8c/index.html create mode 100644 ltapi/malloc_8c_source/index.html create mode 100644 ltapi/mimetable_8cpp/index.html create mode 100644 ltapi/mimetable_8cpp_source/index.html create mode 100644 ltapi/mimetable_8h/index.html create mode 100644 ltapi/mimetable_8h_source/index.html create mode 100644 ltapi/modules/index.html create mode 100644 ltapi/namespace_member_enums/index.html create mode 100644 ltapi/namespace_member_functions/index.html create mode 100644 ltapi/namespace_member_typedefs/index.html create mode 100644 ltapi/namespace_member_variables/index.html create mode 100644 ltapi/namespace_members/index.html create mode 100644 ltapi/namespacearduino/index.html create mode 100644 ltapi/namespacefs/index.html create mode 100644 ltapi/namespacemime/index.html create mode 100644 ltapi/namespaces/index.html create mode 100644 ltapi/netdb_8h/index.html create mode 100644 ltapi/netdb_8h_source/index.html create mode 100644 ltapi/netif_8h/index.html create mode 100644 ltapi/netif_8h_source/index.html create mode 100644 ltapi/pages/index.html create mode 100644 ltapi/pgmspace_8h/index.html create mode 100644 ltapi/pgmspace_8h_source/index.html create mode 100644 ltapi/printf__config_8h/index.html create mode 100644 ltapi/printf__config_8h_source/index.html create mode 100644 ltapi/putchar_8c/index.html create mode 100644 ltapi/putchar_8c_source/index.html create mode 100644 ltapi/puts_8c/index.html create mode 100644 ltapi/puts_8c_source/index.html create mode 100644 ltapi/serial__event_8cpp/index.html create mode 100644 ltapi/serial__event_8cpp_source/index.html create mode 100644 ltapi/sockets_8h/index.html create mode 100644 ltapi/sockets_8h_source/index.html create mode 100644 ltapi/src_2compat_2_f_s_8h/index.html create mode 100644 ltapi/src_2compat_2_f_s_8h_source/index.html create mode 100644 ltapi/src_2compat_2_m_d5_8h/index.html create mode 100644 ltapi/src_2compat_2_m_d5_8h_source/index.html create mode 100644 ltapi/strcasecmp_8c/index.html create mode 100644 ltapi/strcasecmp_8c_source/index.html create mode 100644 ltapi/strdup_8c/index.html create mode 100644 ltapi/strdup_8c_source/index.html create mode 100644 ltapi/strptime_8c/index.html create mode 100644 ltapi/strptime_8c_source/index.html create mode 100644 ltapi/struct_cookie/index.html create mode 100644 ltapi/struct_event_handler__s/index.html create mode 100644 ltapi/struct_h_t_t_p_client_1_1_request_argument/index.html create mode 100644 ltapi/struct_h_t_t_p_upload/index.html create mode 100644 ltapi/struct_m_d5_context/index.html create mode 100644 ltapi/struct_pin_info/index.html create mode 100644 ltapi/struct_soft_data/index.html create mode 100644 ltapi/struct_soft_serial/index.html create mode 100644 ltapi/struct_web_server_1_1_request_argument/index.html create mode 100644 ltapi/struct_wi_fi_mac_addr/index.html create mode 100644 ltapi/struct_wi_fi_network_info/index.html create mode 100644 ltapi/struct_wi_fi_scan_a_p/index.html create mode 100644 ltapi/struct_wi_fi_scan_data/index.html create mode 100644 ltapi/struct_wifi_a_plist__t/index.html create mode 100644 ltapi/structarduino__event__t/index.html create mode 100644 ltapi/structbase64__decodestate/index.html create mode 100644 ltapi/structbase64__encodestate/index.html create mode 100644 ltapi/structesp__ip4__addr/index.html create mode 100644 ltapi/structesp__ip6__addr/index.html create mode 100644 ltapi/structesp__netif__ip6__info__t/index.html create mode 100644 ltapi/structesp__netif__ip__info__t/index.html create mode 100644 ltapi/structip__event__ap__staipassigned__t/index.html create mode 100644 ltapi/structip__event__got__ip6__t/index.html create mode 100644 ltapi/structip__event__got__ip__t/index.html create mode 100644 ltapi/structlt__flash__id__t/index.html create mode 100644 ltapi/structlt__ota__ctx__t/index.html create mode 100644 ltapi/structmbedtls__md5__context/index.html create mode 100644 ltapi/structmime_1_1_entry/index.html create mode 100644 ltapi/structwifi__event__action__tx__status__t/index.html create mode 100644 ltapi/structwifi__event__ap__probe__req__rx__t/index.html create mode 100644 ltapi/structwifi__event__ap__staconnected__t/index.html create mode 100644 ltapi/structwifi__event__ap__stadisconnected__t/index.html create mode 100644 ltapi/structwifi__event__ftm__report__t/index.html create mode 100644 ltapi/structwifi__event__roc__done__t/index.html create mode 100644 ltapi/structwifi__event__sta__authmode__change__t/index.html create mode 100644 ltapi/structwifi__event__sta__connected__t/index.html create mode 100644 ltapi/structwifi__event__sta__disconnected__t/index.html create mode 100644 ltapi/structwifi__event__sta__scan__done__t/index.html create mode 100644 ltapi/structwifi__event__sta__wps__er__pin__t/index.html create mode 100644 ltapi/structwifi__event__sta__wps__er__success__t/index.html create mode 100644 ltapi/structwifi__ftm__report__entry__t/index.html create mode 100644 ltapi/sys_8h/index.html create mode 100644 ltapi/sys_8h_source/index.html create mode 100644 ltapi/tcpip_8h/index.html create mode 100644 ltapi/tcpip_8h_source/index.html create mode 100644 ltapi/time_8c/index.html create mode 100644 ltapi/time_8c_source/index.html create mode 100644 ltapi/udp_8h/index.html create mode 100644 ltapi/udp_8h_source/index.html create mode 100644 ltapi/unionarduino__event__info__t/index.html create mode 100644 ltapi/variables/index.html create mode 100644 ltapi/vfs__api_8h/index.html create mode 100644 ltapi/vfs__api_8h_source/index.html create mode 100644 ltapi/wiring_8c/index.html create mode 100644 ltapi/wiring_8c_source/index.html create mode 100644 ltapi/wiring__compat_8cpp/index.html create mode 100644 ltapi/wiring__compat_8cpp_source/index.html create mode 100644 ltapi/wiring__compat_8h/index.html create mode 100644 ltapi/wiring__compat_8h_source/index.html create mode 100644 ltapi/wiring__custom_8c/index.html create mode 100644 ltapi/wiring__custom_8c_source/index.html create mode 100644 ltapi/wiring__custom_8h/index.html create mode 100644 ltapi/wiring__custom_8h_source/index.html create mode 100644 ltapi/wiring__irq_8c/index.html create mode 100644 ltapi/wiring__irq_8c_source/index.html create mode 100644 ltapi/wiring__math_8cpp/index.html create mode 100644 ltapi/wiring__math_8cpp_source/index.html create mode 100644 ltapi/wiring__private_8c/index.html create mode 100644 ltapi/wiring__private_8c_source/index.html create mode 100644 ltapi/wiring__private_8h/index.html create mode 100644 ltapi/wiring__private_8h_source/index.html create mode 100644 ltapi/wiring__shift_8c/index.html create mode 100644 ltapi/wiring__shift_8c_source/index.html create mode 100644 monitor/filter_rtl_hard_fault.py create mode 100644 platform.json create mode 100644 search/search_index.json create mode 100644 sitemap.xml create mode 100644 sitemap.xml.gz create mode 100644 src/mkdoxy/LICENSE create mode 100644 src/mkdoxy/Makefile create mode 100644 src/mkdoxy/docs/media/Basic-implementation-old.png create mode 100644 src/mkdoxy/docs/media/Basic-implementation.png create mode 100644 src/mkdoxy/docs/media/Basic-implementation.svg create mode 100644 src/mkdoxy/index.html create mode 100644 src/mkdoxy/mkdoxy.egg-info/PKG-INFO create mode 100644 src/mkdoxy/mkdoxy.egg-info/SOURCES.txt create mode 100644 src/mkdoxy/mkdoxy.egg-info/dependency_links.txt create mode 100644 src/mkdoxy/mkdoxy.egg-info/entry_points.txt create mode 100644 src/mkdoxy/mkdoxy.egg-info/requires.txt create mode 100644 src/mkdoxy/mkdoxy.egg-info/top_level.txt create mode 100644 src/mkdoxy/mkdoxy/__init__.py create mode 100644 src/mkdoxy/mkdoxy/cache.py create mode 100644 src/mkdoxy/mkdoxy/constants.py create mode 100644 src/mkdoxy/mkdoxy/doxygen.py create mode 100644 src/mkdoxy/mkdoxy/doxyrun.py create mode 100644 src/mkdoxy/mkdoxy/finder.py create mode 100644 src/mkdoxy/mkdoxy/generatorAuto.py create mode 100644 src/mkdoxy/mkdoxy/generatorBase.py create mode 100644 src/mkdoxy/mkdoxy/generatorSnippets.py create mode 100644 src/mkdoxy/mkdoxy/markdown.py create mode 100644 src/mkdoxy/mkdoxy/node.py create mode 100644 src/mkdoxy/mkdoxy/plugin.py create mode 100644 src/mkdoxy/mkdoxy/property.py create mode 100644 src/mkdoxy/mkdoxy/templates/annotated.jinja2 create mode 100644 src/mkdoxy/mkdoxy/templates/classes.jinja2 create mode 100644 src/mkdoxy/mkdoxy/templates/code.jinja2 create mode 100644 src/mkdoxy/mkdoxy/templates/error.jinja2 create mode 100644 src/mkdoxy/mkdoxy/templates/files.jinja2 create mode 100644 src/mkdoxy/mkdoxy/templates/hierarchy.jinja2 create mode 100644 src/mkdoxy/mkdoxy/templates/index.jinja2 create mode 100644 src/mkdoxy/mkdoxy/templates/memDef.jinja2 create mode 100644 src/mkdoxy/mkdoxy/templates/memTab.jinja2 create mode 100644 src/mkdoxy/mkdoxy/templates/member.jinja2 create mode 100644 src/mkdoxy/mkdoxy/templates/modules.jinja2 create mode 100644 src/mkdoxy/mkdoxy/templates/namespaces.jinja2 create mode 100644 src/mkdoxy/mkdoxy/templates/page.jinja2 create mode 100644 src/mkdoxy/mkdoxy/templates/pages.jinja2 create mode 100644 src/mkdoxy/mkdoxy/templates/programlisting.jinja2 create mode 100644 src/mkdoxy/mkdoxy/utils.py create mode 100644 src/mkdoxy/mkdoxy/xml_parser.py create mode 100644 src/mkdoxy/requirements.txt create mode 100644 src/mkdoxy/setup.py create mode 100644 src/mkdoxy/tests/basic.py create mode 100644 src/mkdoxy/tests/callDoxyByName.py create mode 100644 src/mkdoxy/tests/doxygenSubprocess.py create mode 100644 src/mkdoxy/tests/exceptKeyboardInterrupt.py create mode 100644 src/mkdoxy/tests/files/Makefile create mode 100644 src/mkdoxy/tests/files/docs/index.html create mode 100644 src/mkdoxy/tests/files/mkdocs.yml create mode 100644 src/mkdoxy/tests/files/src-animal/animal.h create mode 100644 src/mkdoxy/tests/files/src-animal/animal_interface.h create mode 100644 src/mkdoxy/tests/files/src-animal/bird.h create mode 100644 src/mkdoxy/tests/files/src-animal/config.h create mode 100644 src/mkdoxy/tests/files/src-animal/example.h create mode 100644 src/mkdoxy/tests/files/src-animal/markdown-demo/index.html create mode 100644 src/mkdoxy/tests/files/src-animal/special_bird.h create mode 100644 src/mkdoxy/tests/files/src-animal/utils/exception.h create mode 100644 src/mkdoxy/tests/files/src-esp/RBCX.h create mode 100644 src/mkdoxy/tests/files/src-esp/RBCXAngle.cpp create mode 100644 src/mkdoxy/tests/files/src-esp/RBCXAngle.h create mode 100644 src/mkdoxy/tests/files/src-esp/RBCXBattery.cpp create mode 100644 src/mkdoxy/tests/files/src-esp/RBCXBattery.h create mode 100644 src/mkdoxy/tests/files/src-esp/RBCXButtons.cpp create mode 100644 src/mkdoxy/tests/files/src-esp/RBCXButtons.h create mode 100644 src/mkdoxy/tests/files/src-esp/RBCXLeds.cpp create mode 100644 src/mkdoxy/tests/files/src-esp/RBCXLeds.h create mode 100644 src/mkdoxy/tests/files/src-esp/RBCXManager.cpp create mode 100644 src/mkdoxy/tests/files/src-esp/RBCXManager.h create mode 100644 src/mkdoxy/tests/files/src-esp/RBCXMotor.cpp create mode 100644 src/mkdoxy/tests/files/src-esp/RBCXMotor.h create mode 100644 src/mkdoxy/tests/files/src-esp/RBCXNvs.cpp create mode 100644 src/mkdoxy/tests/files/src-esp/RBCXNvs.h create mode 100644 src/mkdoxy/tests/files/src-esp/RBCXPiezo.cpp create mode 100644 src/mkdoxy/tests/files/src-esp/RBCXPiezo.h create mode 100644 src/mkdoxy/tests/files/src-esp/RBCXPinout.h create mode 100644 src/mkdoxy/tests/files/src-esp/RBCXSmartServo.cpp create mode 100644 src/mkdoxy/tests/files/src-esp/RBCXSmartServo.h create mode 100644 src/mkdoxy/tests/files/src-esp/RBCXStupidServo.cpp create mode 100644 src/mkdoxy/tests/files/src-esp/RBCXStupidServo.h create mode 100644 src/mkdoxy/tests/files/src-esp/RBCXTimers.cpp create mode 100644 src/mkdoxy/tests/files/src-esp/RBCXTimers.h create mode 100644 src/mkdoxy/tests/files/src-esp/RBCXUltrasound.cpp create mode 100644 src/mkdoxy/tests/files/src-esp/RBCXUltrasound.h create mode 100644 src/mkdoxy/tests/files/src-esp/RBCXUtil.h create mode 100644 src/mkdoxy/tests/files/src-esp/RBCXVersion.h create mode 100644 src/mkdoxy/tests/files/src-esp/main.cpp create mode 100644 src/mkdoxy/tests/files/src-esp/test.cpp create mode 100644 src/mkdoxy/tests/files/src-stm32/include/Bsp.hpp create mode 100644 src/mkdoxy/tests/files/src-stm32/include/ButtonController.hpp create mode 100644 src/mkdoxy/tests/files/src-stm32/include/BuzzerController.hpp create mode 100644 src/mkdoxy/tests/files/src-stm32/include/CdcUartTunnel.hpp create mode 100644 src/mkdoxy/tests/files/src-stm32/include/ControlLink.hpp create mode 100644 src/mkdoxy/tests/files/src-stm32/include/DebugLink.hpp create mode 100644 src/mkdoxy/tests/files/src-stm32/include/Dispatcher.hpp create mode 100644 src/mkdoxy/tests/files/src-stm32/include/Esp32Manager.hpp create mode 100644 src/mkdoxy/tests/files/src-stm32/include/FreeRTOSConfig.h create mode 100644 src/mkdoxy/tests/files/src-stm32/include/I2cController.hpp create mode 100644 src/mkdoxy/tests/files/src-stm32/include/Motor.hpp create mode 100644 src/mkdoxy/tests/files/src-stm32/include/MotorController.hpp create mode 100644 src/mkdoxy/tests/files/src-stm32/include/Mpu6050.hpp create mode 100644 src/mkdoxy/tests/files/src-stm32/include/MpuController.hpp create mode 100644 src/mkdoxy/tests/files/src-stm32/include/OledController.hpp create mode 100644 src/mkdoxy/tests/files/src-stm32/include/OledController_fonts.hpp create mode 100644 src/mkdoxy/tests/files/src-stm32/include/Power.hpp create mode 100644 src/mkdoxy/tests/files/src-stm32/include/README create mode 100644 src/mkdoxy/tests/files/src-stm32/include/StupidServoController.hpp create mode 100644 src/mkdoxy/tests/files/src-stm32/include/UltrasoundController.hpp create mode 100644 src/mkdoxy/tests/files/src-stm32/include/UsbCdcLink.h create mode 100644 src/mkdoxy/tests/files/src-stm32/include/utils/BasePriorityRaiser.hpp create mode 100644 src/mkdoxy/tests/files/src-stm32/include/utils/ByteFifo.hpp create mode 100644 src/mkdoxy/tests/files/src-stm32/include/utils/Debug.hpp create mode 100644 src/mkdoxy/tests/files/src-stm32/include/utils/Flash.hpp create mode 100644 src/mkdoxy/tests/files/src-stm32/include/utils/HalDma.hpp create mode 100644 src/mkdoxy/tests/files/src-stm32/include/utils/MessageBufferWrapper.hpp create mode 100644 src/mkdoxy/tests/files/src-stm32/include/utils/MutexWrapper.hpp create mode 100644 src/mkdoxy/tests/files/src-stm32/include/utils/QueueWrapper.hpp create mode 100644 src/mkdoxy/tests/files/src-stm32/include/utils/Regulator.hpp create mode 100644 src/mkdoxy/tests/files/src-stm32/include/utils/StreamBufferWrapper.hpp create mode 100644 src/mkdoxy/tests/files/src-stm32/include/utils/TaskWrapper.hpp create mode 100644 src/mkdoxy/tests/files/src-stm32/include/utils/TickTimer.hpp create mode 100644 src/mkdoxy/tests/files/src-stm32/include/utils/XorShift.hpp create mode 100644 src/mkdoxy/tests/files/src-stm32/src/Bsp.cpp create mode 100644 src/mkdoxy/tests/files/src-stm32/src/ButtonController.cpp create mode 100644 src/mkdoxy/tests/files/src-stm32/src/CdcUartTunnel.cpp create mode 100644 src/mkdoxy/tests/files/src-stm32/src/ControlLink.cpp create mode 100644 src/mkdoxy/tests/files/src-stm32/src/DebugLink.cpp create mode 100644 src/mkdoxy/tests/files/src-stm32/src/Dispatcher.cpp create mode 100644 src/mkdoxy/tests/files/src-stm32/src/Esp32Manager.cpp create mode 100644 src/mkdoxy/tests/files/src-stm32/src/FreeRTOSCallbacks.cpp create mode 100644 src/mkdoxy/tests/files/src-stm32/src/I2cController.cpp create mode 100644 src/mkdoxy/tests/files/src-stm32/src/MotorController.cpp create mode 100644 src/mkdoxy/tests/files/src-stm32/src/MpuController.cpp create mode 100644 src/mkdoxy/tests/files/src-stm32/src/OledController.cpp create mode 100644 src/mkdoxy/tests/files/src-stm32/src/OledController_fonts.cpp create mode 100644 src/mkdoxy/tests/files/src-stm32/src/Power.cpp create mode 100644 src/mkdoxy/tests/files/src-stm32/src/StupidServoController.cpp create mode 100644 src/mkdoxy/tests/files/src-stm32/src/UltrasoundController.cpp create mode 100644 src/mkdoxy/tests/files/src-stm32/src/UsbCdcDescriptors.c create mode 100644 src/mkdoxy/tests/files/src-stm32/src/UsbCdcLink.cpp create mode 100644 src/mkdoxy/tests/files/src-stm32/src/bootloader/sboot.S create mode 100644 src/mkdoxy/tests/files/src-stm32/src/bootloader/sboot_v11.bin create mode 100644 src/mkdoxy/tests/files/src-stm32/src/main.cpp create mode 100644 src/mkdoxy/tests/files/src-stm32/src/utils/Debug.cpp create mode 100644 src/mkdoxy/tests/metaDataParse.py create mode 100644 src/mkdoxy/tests/mkdocsValidateCfg.py create mode 100644 src/mkdoxy/tests/originalTest.py create mode 100644 src/mkdoxy/tests/parseMdTags.py create mode 100644 src/mkdoxy/tests/snippetsTest.py create mode 100644 src/mkdoxy/tests/testTemplate.py create mode 100644 tools/libretiny/__init__.py create mode 100644 tools/libretiny/board.py create mode 100644 tools/libretiny/dict.py create mode 100644 tools/libretiny/family.py create mode 100644 tools/libretiny/fileio.py create mode 100644 tools/libretiny/lvm.py create mode 100644 tools/libretiny/obj.py diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 000000000..e69de29bb diff --git a/404.html b/404.html new file mode 100644 index 000000000..3874479aa --- /dev/null +++ b/404.html @@ -0,0 +1,2270 @@ + + + + + + + + + + + + + + + + + + LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ +

404 - Not found

+ +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/CNAME b/CNAME new file mode 100644 index 000000000..906056bee --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +docs.libretiny.eu diff --git a/SUMMARY/index.html b/SUMMARY/index.html new file mode 100644 index 000000000..2387ddac1 --- /dev/null +++ b/SUMMARY/index.html @@ -0,0 +1,2425 @@ + + + + + + + + + + + + + + + + + + + + + + + + LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + + + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/images/favicon.png b/assets/images/favicon.png new file mode 100644 index 0000000000000000000000000000000000000000..1cf13b9f9d978896599290a74f77d5dbe7d1655c GIT binary patch literal 1870 zcmV-U2eJ5xP)Gc)JR9QMau)O=X#!i9;T z37kk-upj^(fsR36MHs_+1RCI)NNu9}lD0S{B^g8PN?Ww(5|~L#Ng*g{WsqleV}|#l zz8@ri&cTzw_h33bHI+12+kK6WN$h#n5cD8OQt`5kw6p~9H3()bUQ8OS4Q4HTQ=1Ol z_JAocz`fLbT2^{`8n~UAo=#AUOf=SOq4pYkt;XbC&f#7lb$*7=$na!mWCQ`dBQsO0 zLFBSPj*N?#u5&pf2t4XjEGH|=pPQ8xh7tpx;US5Cx_Ju;!O`ya-yF`)b%TEt5>eP1ZX~}sjjA%FJF?h7cX8=b!DZl<6%Cv z*G0uvvU+vmnpLZ2paivG-(cd*y3$hCIcsZcYOGh{$&)A6*XX&kXZd3G8m)G$Zz-LV z^GF3VAW^Mdv!)4OM8EgqRiz~*Cji;uzl2uC9^=8I84vNp;ltJ|q-*uQwGp2ma6cY7 z;`%`!9UXO@fr&Ebapfs34OmS9^u6$)bJxrucutf>`dKPKT%%*d3XlFVKunp9 zasduxjrjs>f8V=D|J=XNZp;_Zy^WgQ$9WDjgY=z@stwiEBm9u5*|34&1Na8BMjjgf3+SHcr`5~>oz1Y?SW^=K z^bTyO6>Gar#P_W2gEMwq)ot3; zREHn~U&Dp0l6YT0&k-wLwYjb?5zGK`W6S2v+K>AM(95m2C20L|3m~rN8dprPr@t)5lsk9Hu*W z?pS990s;Ez=+Rj{x7p``4>+c0G5^pYnB1^!TL=(?HLHZ+HicG{~4F1d^5Awl_2!1jICM-!9eoLhbbT^;yHcefyTAaqRcY zmuctDopPT!%k+}x%lZRKnzykr2}}XfG_ne?nRQO~?%hkzo;@RN{P6o`&mMUWBYMTe z6i8ChtjX&gXl`nvrU>jah)2iNM%JdjqoaeaU%yVn!^70x-flljp6Q5tK}5}&X8&&G zX3fpb3E(!rH=zVI_9Gjl45w@{(ITqngWFe7@9{mX;tO25Z_8 zQHEpI+FkTU#4xu>RkN>b3Tnc3UpWzPXWm#o55GKF09j^Mh~)K7{QqbO_~(@CVq! zS<8954|P8mXN2MRs86xZ&Q4EfM@JB94b=(YGuk)s&^jiSF=t3*oNK3`rD{H`yQ?d; ztE=laAUoZx5?RC8*WKOj`%LXEkgDd>&^Q4M^z`%u0rg-It=hLCVsq!Z%^6eB-OvOT zFZ28TN&cRmgU}Elrnk43)!>Z1FCPL2K$7}gwzIc48NX}#!A1BpJP?#v5wkNprhV** z?Cpalt1oH&{r!o3eSKc&ap)iz2BTn_VV`4>9M^b3;(YY}4>#ML6{~(4mH+?%07*qo IM6N<$f(jP3KmY&$ literal 0 HcmV?d00001 diff --git a/assets/javascripts/bundle.5cf534bf.min.js b/assets/javascripts/bundle.5cf534bf.min.js new file mode 100644 index 000000000..eb0280e5a --- /dev/null +++ b/assets/javascripts/bundle.5cf534bf.min.js @@ -0,0 +1,29 @@ +"use strict";(()=>{var Hi=Object.create;var xr=Object.defineProperty;var Pi=Object.getOwnPropertyDescriptor;var $i=Object.getOwnPropertyNames,kt=Object.getOwnPropertySymbols,Ii=Object.getPrototypeOf,Er=Object.prototype.hasOwnProperty,an=Object.prototype.propertyIsEnumerable;var on=(e,t,r)=>t in e?xr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,P=(e,t)=>{for(var r in t||(t={}))Er.call(t,r)&&on(e,r,t[r]);if(kt)for(var r of kt(t))an.call(t,r)&&on(e,r,t[r]);return e};var sn=(e,t)=>{var r={};for(var n in e)Er.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&kt)for(var n of kt(e))t.indexOf(n)<0&&an.call(e,n)&&(r[n]=e[n]);return r};var Ht=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var ji=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of $i(t))!Er.call(e,o)&&o!==r&&xr(e,o,{get:()=>t[o],enumerable:!(n=Pi(t,o))||n.enumerable});return e};var yt=(e,t,r)=>(r=e!=null?Hi(Ii(e)):{},ji(t||!e||!e.__esModule?xr(r,"default",{value:e,enumerable:!0}):r,e));var fn=Ht((wr,cn)=>{(function(e,t){typeof wr=="object"&&typeof cn!="undefined"?t():typeof define=="function"&&define.amd?define(t):t()})(wr,function(){"use strict";function e(r){var n=!0,o=!1,i=null,a={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function s(O){return!!(O&&O!==document&&O.nodeName!=="HTML"&&O.nodeName!=="BODY"&&"classList"in O&&"contains"in O.classList)}function f(O){var Ne=O.type,Ue=O.tagName;return!!(Ue==="INPUT"&&a[Ne]&&!O.readOnly||Ue==="TEXTAREA"&&!O.readOnly||O.isContentEditable)}function c(O){O.classList.contains("focus-visible")||(O.classList.add("focus-visible"),O.setAttribute("data-focus-visible-added",""))}function u(O){O.hasAttribute("data-focus-visible-added")&&(O.classList.remove("focus-visible"),O.removeAttribute("data-focus-visible-added"))}function p(O){O.metaKey||O.altKey||O.ctrlKey||(s(r.activeElement)&&c(r.activeElement),n=!0)}function m(O){n=!1}function d(O){s(O.target)&&(n||f(O.target))&&c(O.target)}function h(O){s(O.target)&&(O.target.classList.contains("focus-visible")||O.target.hasAttribute("data-focus-visible-added"))&&(o=!0,window.clearTimeout(i),i=window.setTimeout(function(){o=!1},100),u(O.target))}function v(O){document.visibilityState==="hidden"&&(o&&(n=!0),B())}function B(){document.addEventListener("mousemove",V),document.addEventListener("mousedown",V),document.addEventListener("mouseup",V),document.addEventListener("pointermove",V),document.addEventListener("pointerdown",V),document.addEventListener("pointerup",V),document.addEventListener("touchmove",V),document.addEventListener("touchstart",V),document.addEventListener("touchend",V)}function re(){document.removeEventListener("mousemove",V),document.removeEventListener("mousedown",V),document.removeEventListener("mouseup",V),document.removeEventListener("pointermove",V),document.removeEventListener("pointerdown",V),document.removeEventListener("pointerup",V),document.removeEventListener("touchmove",V),document.removeEventListener("touchstart",V),document.removeEventListener("touchend",V)}function V(O){O.target.nodeName&&O.target.nodeName.toLowerCase()==="html"||(n=!1,re())}document.addEventListener("keydown",p,!0),document.addEventListener("mousedown",m,!0),document.addEventListener("pointerdown",m,!0),document.addEventListener("touchstart",m,!0),document.addEventListener("visibilitychange",v,!0),B(),r.addEventListener("focus",d,!0),r.addEventListener("blur",h,!0),r.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&r.host?r.host.setAttribute("data-js-focus-visible",""):r.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if(typeof window!="undefined"&&typeof document!="undefined"){window.applyFocusVisiblePolyfill=e;var t;try{t=new CustomEvent("focus-visible-polyfill-ready")}catch(r){t=document.createEvent("CustomEvent"),t.initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(t)}typeof document!="undefined"&&e(document)})});var un=Ht(Sr=>{(function(e){var t=function(){try{return!!Symbol.iterator}catch(c){return!1}},r=t(),n=function(c){var u={next:function(){var p=c.shift();return{done:p===void 0,value:p}}};return r&&(u[Symbol.iterator]=function(){return u}),u},o=function(c){return encodeURIComponent(c).replace(/%20/g,"+")},i=function(c){return decodeURIComponent(String(c).replace(/\+/g," "))},a=function(){var c=function(p){Object.defineProperty(this,"_entries",{writable:!0,value:{}});var m=typeof p;if(m!=="undefined")if(m==="string")p!==""&&this._fromString(p);else if(p instanceof c){var d=this;p.forEach(function(re,V){d.append(V,re)})}else if(p!==null&&m==="object")if(Object.prototype.toString.call(p)==="[object Array]")for(var h=0;hd[0]?1:0}),c._entries&&(c._entries={});for(var p=0;p1?i(d[1]):"")}})})(typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:Sr);(function(e){var t=function(){try{var o=new e.URL("b","http://a");return o.pathname="c d",o.href==="http://a/c%20d"&&o.searchParams}catch(i){return!1}},r=function(){var o=e.URL,i=function(f,c){typeof f!="string"&&(f=String(f)),c&&typeof c!="string"&&(c=String(c));var u=document,p;if(c&&(e.location===void 0||c!==e.location.href)){c=c.toLowerCase(),u=document.implementation.createHTMLDocument(""),p=u.createElement("base"),p.href=c,u.head.appendChild(p);try{if(p.href.indexOf(c)!==0)throw new Error(p.href)}catch(O){throw new Error("URL unable to set base "+c+" due to "+O)}}var m=u.createElement("a");m.href=f,p&&(u.body.appendChild(m),m.href=m.href);var d=u.createElement("input");if(d.type="url",d.value=f,m.protocol===":"||!/:/.test(m.href)||!d.checkValidity()&&!c)throw new TypeError("Invalid URL");Object.defineProperty(this,"_anchorElement",{value:m});var h=new e.URLSearchParams(this.search),v=!0,B=!0,re=this;["append","delete","set"].forEach(function(O){var Ne=h[O];h[O]=function(){Ne.apply(h,arguments),v&&(B=!1,re.search=h.toString(),B=!0)}}),Object.defineProperty(this,"searchParams",{value:h,enumerable:!0});var V=void 0;Object.defineProperty(this,"_updateSearchParams",{enumerable:!1,configurable:!1,writable:!1,value:function(){this.search!==V&&(V=this.search,B&&(v=!1,this.searchParams._fromString(this.search),v=!0))}})},a=i.prototype,s=function(f){Object.defineProperty(a,f,{get:function(){return this._anchorElement[f]},set:function(c){this._anchorElement[f]=c},enumerable:!0})};["hash","host","hostname","port","protocol"].forEach(function(f){s(f)}),Object.defineProperty(a,"search",{get:function(){return this._anchorElement.search},set:function(f){this._anchorElement.search=f,this._updateSearchParams()},enumerable:!0}),Object.defineProperties(a,{toString:{get:function(){var f=this;return function(){return f.href}}},href:{get:function(){return this._anchorElement.href.replace(/\?$/,"")},set:function(f){this._anchorElement.href=f,this._updateSearchParams()},enumerable:!0},pathname:{get:function(){return this._anchorElement.pathname.replace(/(^\/?)/,"/")},set:function(f){this._anchorElement.pathname=f},enumerable:!0},origin:{get:function(){var f={"http:":80,"https:":443,"ftp:":21}[this._anchorElement.protocol],c=this._anchorElement.port!=f&&this._anchorElement.port!=="";return this._anchorElement.protocol+"//"+this._anchorElement.hostname+(c?":"+this._anchorElement.port:"")},enumerable:!0},password:{get:function(){return""},set:function(f){},enumerable:!0},username:{get:function(){return""},set:function(f){},enumerable:!0}}),i.createObjectURL=function(f){return o.createObjectURL.apply(o,arguments)},i.revokeObjectURL=function(f){return o.revokeObjectURL.apply(o,arguments)},e.URL=i};if(t()||r(),e.location!==void 0&&!("origin"in e.location)){var n=function(){return e.location.protocol+"//"+e.location.hostname+(e.location.port?":"+e.location.port:"")};try{Object.defineProperty(e.location,"origin",{get:n,enumerable:!0})}catch(o){setInterval(function(){e.location.origin=n()},100)}}})(typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:Sr)});var Qr=Ht((Lt,Kr)=>{/*! + * clipboard.js v2.0.11 + * https://clipboardjs.com/ + * + * Licensed MIT © Zeno Rocha + */(function(t,r){typeof Lt=="object"&&typeof Kr=="object"?Kr.exports=r():typeof define=="function"&&define.amd?define([],r):typeof Lt=="object"?Lt.ClipboardJS=r():t.ClipboardJS=r()})(Lt,function(){return function(){var e={686:function(n,o,i){"use strict";i.d(o,{default:function(){return ki}});var a=i(279),s=i.n(a),f=i(370),c=i.n(f),u=i(817),p=i.n(u);function m(F){try{return document.execCommand(F)}catch(T){return!1}}var d=function(T){var w=p()(T);return m("cut"),w},h=d;function v(F){var T=document.documentElement.getAttribute("dir")==="rtl",w=document.createElement("textarea");w.style.fontSize="12pt",w.style.border="0",w.style.padding="0",w.style.margin="0",w.style.position="absolute",w.style[T?"right":"left"]="-9999px";var k=window.pageYOffset||document.documentElement.scrollTop;return w.style.top="".concat(k,"px"),w.setAttribute("readonly",""),w.value=F,w}var B=function(T,w){var k=v(T);w.container.appendChild(k);var j=p()(k);return m("copy"),k.remove(),j},re=function(T){var w=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body},k="";return typeof T=="string"?k=B(T,w):T instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(T==null?void 0:T.type)?k=B(T.value,w):(k=p()(T),m("copy")),k},V=re;function O(F){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?O=function(w){return typeof w}:O=function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},O(F)}var Ne=function(){var T=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},w=T.action,k=w===void 0?"copy":w,j=T.container,N=T.target,Me=T.text;if(k!=="copy"&&k!=="cut")throw new Error('Invalid "action" value, use either "copy" or "cut"');if(N!==void 0)if(N&&O(N)==="object"&&N.nodeType===1){if(k==="copy"&&N.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if(k==="cut"&&(N.hasAttribute("readonly")||N.hasAttribute("disabled")))throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`)}else throw new Error('Invalid "target" value, use a valid Element');if(Me)return V(Me,{container:j});if(N)return k==="cut"?h(N):V(N,{container:j})},Ue=Ne;function $e(F){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?$e=function(w){return typeof w}:$e=function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},$e(F)}function Oi(F,T){if(!(F instanceof T))throw new TypeError("Cannot call a class as a function")}function nn(F,T){for(var w=0;w0&&arguments[0]!==void 0?arguments[0]:{};this.action=typeof j.action=="function"?j.action:this.defaultAction,this.target=typeof j.target=="function"?j.target:this.defaultTarget,this.text=typeof j.text=="function"?j.text:this.defaultText,this.container=$e(j.container)==="object"?j.container:document.body}},{key:"listenClick",value:function(j){var N=this;this.listener=c()(j,"click",function(Me){return N.onClick(Me)})}},{key:"onClick",value:function(j){var N=j.delegateTarget||j.currentTarget,Me=this.action(N)||"copy",Rt=Ue({action:Me,container:this.container,target:this.target(N),text:this.text(N)});this.emit(Rt?"success":"error",{action:Me,text:Rt,trigger:N,clearSelection:function(){N&&N.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(j){return yr("action",j)}},{key:"defaultTarget",value:function(j){var N=yr("target",j);if(N)return document.querySelector(N)}},{key:"defaultText",value:function(j){return yr("text",j)}},{key:"destroy",value:function(){this.listener.destroy()}}],[{key:"copy",value:function(j){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{container:document.body};return V(j,N)}},{key:"cut",value:function(j){return h(j)}},{key:"isSupported",value:function(){var j=arguments.length>0&&arguments[0]!==void 0?arguments[0]:["copy","cut"],N=typeof j=="string"?[j]:j,Me=!!document.queryCommandSupported;return N.forEach(function(Rt){Me=Me&&!!document.queryCommandSupported(Rt)}),Me}}]),w}(s()),ki=Ri},828:function(n){var o=9;if(typeof Element!="undefined"&&!Element.prototype.matches){var i=Element.prototype;i.matches=i.matchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector||i.webkitMatchesSelector}function a(s,f){for(;s&&s.nodeType!==o;){if(typeof s.matches=="function"&&s.matches(f))return s;s=s.parentNode}}n.exports=a},438:function(n,o,i){var a=i(828);function s(u,p,m,d,h){var v=c.apply(this,arguments);return u.addEventListener(m,v,h),{destroy:function(){u.removeEventListener(m,v,h)}}}function f(u,p,m,d,h){return typeof u.addEventListener=="function"?s.apply(null,arguments):typeof m=="function"?s.bind(null,document).apply(null,arguments):(typeof u=="string"&&(u=document.querySelectorAll(u)),Array.prototype.map.call(u,function(v){return s(v,p,m,d,h)}))}function c(u,p,m,d){return function(h){h.delegateTarget=a(h.target,p),h.delegateTarget&&d.call(u,h)}}n.exports=f},879:function(n,o){o.node=function(i){return i!==void 0&&i instanceof HTMLElement&&i.nodeType===1},o.nodeList=function(i){var a=Object.prototype.toString.call(i);return i!==void 0&&(a==="[object NodeList]"||a==="[object HTMLCollection]")&&"length"in i&&(i.length===0||o.node(i[0]))},o.string=function(i){return typeof i=="string"||i instanceof String},o.fn=function(i){var a=Object.prototype.toString.call(i);return a==="[object Function]"}},370:function(n,o,i){var a=i(879),s=i(438);function f(m,d,h){if(!m&&!d&&!h)throw new Error("Missing required arguments");if(!a.string(d))throw new TypeError("Second argument must be a String");if(!a.fn(h))throw new TypeError("Third argument must be a Function");if(a.node(m))return c(m,d,h);if(a.nodeList(m))return u(m,d,h);if(a.string(m))return p(m,d,h);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}function c(m,d,h){return m.addEventListener(d,h),{destroy:function(){m.removeEventListener(d,h)}}}function u(m,d,h){return Array.prototype.forEach.call(m,function(v){v.addEventListener(d,h)}),{destroy:function(){Array.prototype.forEach.call(m,function(v){v.removeEventListener(d,h)})}}}function p(m,d,h){return s(document.body,m,d,h)}n.exports=f},817:function(n){function o(i){var a;if(i.nodeName==="SELECT")i.focus(),a=i.value;else if(i.nodeName==="INPUT"||i.nodeName==="TEXTAREA"){var s=i.hasAttribute("readonly");s||i.setAttribute("readonly",""),i.select(),i.setSelectionRange(0,i.value.length),s||i.removeAttribute("readonly"),a=i.value}else{i.hasAttribute("contenteditable")&&i.focus();var f=window.getSelection(),c=document.createRange();c.selectNodeContents(i),f.removeAllRanges(),f.addRange(c),a=f.toString()}return a}n.exports=o},279:function(n){function o(){}o.prototype={on:function(i,a,s){var f=this.e||(this.e={});return(f[i]||(f[i]=[])).push({fn:a,ctx:s}),this},once:function(i,a,s){var f=this;function c(){f.off(i,c),a.apply(s,arguments)}return c._=a,this.on(i,c,s)},emit:function(i){var a=[].slice.call(arguments,1),s=((this.e||(this.e={}))[i]||[]).slice(),f=0,c=s.length;for(f;f{"use strict";/*! + * escape-html + * Copyright(c) 2012-2013 TJ Holowaychuk + * Copyright(c) 2015 Andreas Lubbe + * Copyright(c) 2015 Tiancheng "Timothy" Gu + * MIT Licensed + */var is=/["'&<>]/;Jo.exports=as;function as(e){var t=""+e,r=is.exec(t);if(!r)return t;var n,o="",i=0,a=0;for(i=r.index;i0&&i[i.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function W(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,i=[],a;try{for(;(t===void 0||t-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i}function D(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,i;n1||s(m,d)})})}function s(m,d){try{f(n[m](d))}catch(h){p(i[0][3],h)}}function f(m){m.value instanceof Xe?Promise.resolve(m.value.v).then(c,u):p(i[0][2],m)}function c(m){s("next",m)}function u(m){s("throw",m)}function p(m,d){m(d),i.shift(),i.length&&s(i[0][0],i[0][1])}}function mn(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof xe=="function"?xe(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=e[i]&&function(a){return new Promise(function(s,f){a=e[i](a),o(s,f,a.done,a.value)})}}function o(i,a,s,f){Promise.resolve(f).then(function(c){i({value:c,done:s})},a)}}function A(e){return typeof e=="function"}function at(e){var t=function(n){Error.call(n),n.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var $t=at(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription: +`+r.map(function(n,o){return o+1+") "+n.toString()}).join(` + `):"",this.name="UnsubscriptionError",this.errors=r}});function We(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Ie=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,o,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var s=xe(a),f=s.next();!f.done;f=s.next()){var c=f.value;c.remove(this)}}catch(v){t={error:v}}finally{try{f&&!f.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}else a.remove(this);var u=this.initialTeardown;if(A(u))try{u()}catch(v){i=v instanceof $t?v.errors:[v]}var p=this._finalizers;if(p){this._finalizers=null;try{for(var m=xe(p),d=m.next();!d.done;d=m.next()){var h=d.value;try{dn(h)}catch(v){i=i!=null?i:[],v instanceof $t?i=D(D([],W(i)),W(v.errors)):i.push(v)}}}catch(v){n={error:v}}finally{try{d&&!d.done&&(o=m.return)&&o.call(m)}finally{if(n)throw n.error}}}if(i)throw new $t(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)dn(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&We(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&We(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var Tr=Ie.EMPTY;function It(e){return e instanceof Ie||e&&"closed"in e&&A(e.remove)&&A(e.add)&&A(e.unsubscribe)}function dn(e){A(e)?e():e.unsubscribe()}var Le={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var st={setTimeout:function(e,t){for(var r=[],n=2;n0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,o=this,i=o.hasError,a=o.isStopped,s=o.observers;return i||a?Tr:(this.currentObservers=null,s.push(r),new Ie(function(){n.currentObservers=null,We(s,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,o=n.hasError,i=n.thrownError,a=n.isStopped;o?r.error(i):a&&r.complete()},t.prototype.asObservable=function(){var r=new U;return r.source=this,r},t.create=function(r,n){return new wn(r,n)},t}(U);var wn=function(e){ne(t,e);function t(r,n){var o=e.call(this)||this;return o.destination=r,o.source=n,o}return t.prototype.next=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.next)===null||o===void 0||o.call(n,r)},t.prototype.error=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.error)===null||o===void 0||o.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,o;return(o=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&o!==void 0?o:Tr},t}(E);var Et={now:function(){return(Et.delegate||Date).now()},delegate:void 0};var wt=function(e){ne(t,e);function t(r,n,o){r===void 0&&(r=1/0),n===void 0&&(n=1/0),o===void 0&&(o=Et);var i=e.call(this)||this;return i._bufferSize=r,i._windowTime=n,i._timestampProvider=o,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,r),i._windowTime=Math.max(1,n),i}return t.prototype.next=function(r){var n=this,o=n.isStopped,i=n._buffer,a=n._infiniteTimeWindow,s=n._timestampProvider,f=n._windowTime;o||(i.push(r),!a&&i.push(s.now()+f)),this._trimBuffer(),e.prototype.next.call(this,r)},t.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(r),o=this,i=o._infiniteTimeWindow,a=o._buffer,s=a.slice(),f=0;f0?e.prototype.requestAsyncId.call(this,r,n,o):(r.actions.push(this),r._scheduled||(r._scheduled=ut.requestAnimationFrame(function(){return r.flush(void 0)})))},t.prototype.recycleAsyncId=function(r,n,o){var i;if(o===void 0&&(o=0),o!=null?o>0:this.delay>0)return e.prototype.recycleAsyncId.call(this,r,n,o);var a=r.actions;n!=null&&((i=a[a.length-1])===null||i===void 0?void 0:i.id)!==n&&(ut.cancelAnimationFrame(n),r._scheduled=void 0)},t}(Ut);var Tn=function(e){ne(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.flush=function(r){this._active=!0;var n=this._scheduled;this._scheduled=void 0;var o=this.actions,i;r=r||o.shift();do if(i=r.execute(r.state,r.delay))break;while((r=o[0])&&r.id===n&&o.shift());if(this._active=!1,i){for(;(r=o[0])&&r.id===n&&o.shift();)r.unsubscribe();throw i}},t}(Wt);var we=new Tn(On);var R=new U(function(e){return e.complete()});function Dt(e){return e&&A(e.schedule)}function kr(e){return e[e.length-1]}function qe(e){return A(kr(e))?e.pop():void 0}function Se(e){return Dt(kr(e))?e.pop():void 0}function Vt(e,t){return typeof kr(e)=="number"?e.pop():t}var pt=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};function zt(e){return A(e==null?void 0:e.then)}function Nt(e){return A(e[ft])}function qt(e){return Symbol.asyncIterator&&A(e==null?void 0:e[Symbol.asyncIterator])}function Kt(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}function Ki(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Qt=Ki();function Yt(e){return A(e==null?void 0:e[Qt])}function Gt(e){return ln(this,arguments,function(){var r,n,o,i;return Pt(this,function(a){switch(a.label){case 0:r=e.getReader(),a.label=1;case 1:a.trys.push([1,,9,10]),a.label=2;case 2:return[4,Xe(r.read())];case 3:return n=a.sent(),o=n.value,i=n.done,i?[4,Xe(void 0)]:[3,5];case 4:return[2,a.sent()];case 5:return[4,Xe(o)];case 6:return[4,a.sent()];case 7:return a.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function Bt(e){return A(e==null?void 0:e.getReader)}function $(e){if(e instanceof U)return e;if(e!=null){if(Nt(e))return Qi(e);if(pt(e))return Yi(e);if(zt(e))return Gi(e);if(qt(e))return _n(e);if(Yt(e))return Bi(e);if(Bt(e))return Ji(e)}throw Kt(e)}function Qi(e){return new U(function(t){var r=e[ft]();if(A(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function Yi(e){return new U(function(t){for(var r=0;r=2;return function(n){return n.pipe(e?M(function(o,i){return e(o,i,n)}):me,Te(1),r?ke(t):zn(function(){return new Xt}))}}function Nn(){for(var e=[],t=0;t=2,!0))}function fe(e){e===void 0&&(e={});var t=e.connector,r=t===void 0?function(){return new E}:t,n=e.resetOnError,o=n===void 0?!0:n,i=e.resetOnComplete,a=i===void 0?!0:i,s=e.resetOnRefCountZero,f=s===void 0?!0:s;return function(c){var u,p,m,d=0,h=!1,v=!1,B=function(){p==null||p.unsubscribe(),p=void 0},re=function(){B(),u=m=void 0,h=v=!1},V=function(){var O=u;re(),O==null||O.unsubscribe()};return g(function(O,Ne){d++,!v&&!h&&B();var Ue=m=m!=null?m:r();Ne.add(function(){d--,d===0&&!v&&!h&&(p=Fr(V,f))}),Ue.subscribe(Ne),!u&&d>0&&(u=new et({next:function($e){return Ue.next($e)},error:function($e){v=!0,B(),p=Fr(re,o,$e),Ue.error($e)},complete:function(){h=!0,B(),p=Fr(re,a),Ue.complete()}}),$(O).subscribe(u))})(c)}}function Fr(e,t){for(var r=[],n=2;ne.next(document)),e}function K(e,t=document){return Array.from(t.querySelectorAll(e))}function q(e,t=document){let r=se(e,t);if(typeof r=="undefined")throw new ReferenceError(`Missing element: expected "${e}" to be present`);return r}function se(e,t=document){return t.querySelector(e)||void 0}function je(){return document.activeElement instanceof HTMLElement&&document.activeElement||void 0}function tr(e){return L(b(document.body,"focusin"),b(document.body,"focusout")).pipe(Re(1),l(()=>{let t=je();return typeof t!="undefined"?e.contains(t):!1}),z(e===je()),Y())}function Ye(e){return{x:e.offsetLeft,y:e.offsetTop}}function Yn(e){return L(b(window,"load"),b(window,"resize")).pipe(Ae(0,we),l(()=>Ye(e)),z(Ye(e)))}function rr(e){return{x:e.scrollLeft,y:e.scrollTop}}function dt(e){return L(b(e,"scroll"),b(window,"resize")).pipe(Ae(0,we),l(()=>rr(e)),z(rr(e)))}var Bn=function(){if(typeof Map!="undefined")return Map;function e(t,r){var n=-1;return t.some(function(o,i){return o[0]===r?(n=i,!0):!1}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(r){var n=e(this.__entries__,r),o=this.__entries__[n];return o&&o[1]},t.prototype.set=function(r,n){var o=e(this.__entries__,r);~o?this.__entries__[o][1]=n:this.__entries__.push([r,n])},t.prototype.delete=function(r){var n=this.__entries__,o=e(n,r);~o&&n.splice(o,1)},t.prototype.has=function(r){return!!~e(this.__entries__,r)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(r,n){n===void 0&&(n=null);for(var o=0,i=this.__entries__;o0},e.prototype.connect_=function(){!zr||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),xa?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!zr||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var r=t.propertyName,n=r===void 0?"":r,o=ya.some(function(i){return!!~n.indexOf(i)});o&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),Jn=function(e,t){for(var r=0,n=Object.keys(t);r0},e}(),Zn=typeof WeakMap!="undefined"?new WeakMap:new Bn,eo=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=Ea.getInstance(),n=new Ra(t,r,this);Zn.set(this,n)}return e}();["observe","unobserve","disconnect"].forEach(function(e){eo.prototype[e]=function(){var t;return(t=Zn.get(this))[e].apply(t,arguments)}});var ka=function(){return typeof nr.ResizeObserver!="undefined"?nr.ResizeObserver:eo}(),to=ka;var ro=new E,Ha=I(()=>H(new to(e=>{for(let t of e)ro.next(t)}))).pipe(x(e=>L(Oe,H(e)).pipe(C(()=>e.disconnect()))),J(1));function de(e){return{width:e.offsetWidth,height:e.offsetHeight}}function ge(e){return Ha.pipe(S(t=>t.observe(e)),x(t=>ro.pipe(M(({target:r})=>r===e),C(()=>t.unobserve(e)),l(()=>de(e)))),z(de(e)))}function bt(e){return{width:e.scrollWidth,height:e.scrollHeight}}function ar(e){let t=e.parentElement;for(;t&&(e.scrollWidth<=t.scrollWidth&&e.scrollHeight<=t.scrollHeight);)t=(e=t).parentElement;return t?e:void 0}var no=new E,Pa=I(()=>H(new IntersectionObserver(e=>{for(let t of e)no.next(t)},{threshold:0}))).pipe(x(e=>L(Oe,H(e)).pipe(C(()=>e.disconnect()))),J(1));function sr(e){return Pa.pipe(S(t=>t.observe(e)),x(t=>no.pipe(M(({target:r})=>r===e),C(()=>t.unobserve(e)),l(({isIntersecting:r})=>r))))}function oo(e,t=16){return dt(e).pipe(l(({y:r})=>{let n=de(e),o=bt(e);return r>=o.height-n.height-t}),Y())}var cr={drawer:q("[data-md-toggle=drawer]"),search:q("[data-md-toggle=search]")};function io(e){return cr[e].checked}function Ge(e,t){cr[e].checked!==t&&cr[e].click()}function Be(e){let t=cr[e];return b(t,"change").pipe(l(()=>t.checked),z(t.checked))}function $a(e,t){switch(e.constructor){case HTMLInputElement:return e.type==="radio"?/^Arrow/.test(t):!0;case HTMLSelectElement:case HTMLTextAreaElement:return!0;default:return e.isContentEditable}}function Ia(){return L(b(window,"compositionstart").pipe(l(()=>!0)),b(window,"compositionend").pipe(l(()=>!1))).pipe(z(!1))}function ao(){let e=b(window,"keydown").pipe(M(t=>!(t.metaKey||t.ctrlKey)),l(t=>({mode:io("search")?"search":"global",type:t.key,claim(){t.preventDefault(),t.stopPropagation()}})),M(({mode:t,type:r})=>{if(t==="global"){let n=je();if(typeof n!="undefined")return!$a(n,r)}return!0}),fe());return Ia().pipe(x(t=>t?R:e))}function _e(){return new URL(location.href)}function ot(e){location.href=e.href}function so(){return new E}function co(e,t){if(typeof t=="string"||typeof t=="number")e.innerHTML+=t.toString();else if(t instanceof Node)e.appendChild(t);else if(Array.isArray(t))for(let r of t)co(e,r)}function _(e,t,...r){let n=document.createElement(e);if(t)for(let o of Object.keys(t))typeof t[o]!="undefined"&&(typeof t[o]!="boolean"?n.setAttribute(o,t[o]):n.setAttribute(o,""));for(let o of r)co(n,o);return n}function fr(e){if(e>999){let t=+((e-950)%1e3>99);return`${((e+1e-6)/1e3).toFixed(t)}k`}else return e.toString()}function fo(){return location.hash.substring(1)}function uo(e){let t=_("a",{href:e});t.addEventListener("click",r=>r.stopPropagation()),t.click()}function ja(){return b(window,"hashchange").pipe(l(fo),z(fo()),M(e=>e.length>0),J(1))}function po(){return ja().pipe(l(e=>se(`[id="${e}"]`)),M(e=>typeof e!="undefined"))}function Nr(e){let t=matchMedia(e);return Zt(r=>t.addListener(()=>r(t.matches))).pipe(z(t.matches))}function lo(){let e=matchMedia("print");return L(b(window,"beforeprint").pipe(l(()=>!0)),b(window,"afterprint").pipe(l(()=>!1))).pipe(z(e.matches))}function qr(e,t){return e.pipe(x(r=>r?t():R))}function ur(e,t={credentials:"same-origin"}){return ve(fetch(`${e}`,t)).pipe(ce(()=>R),x(r=>r.status!==200?Ot(()=>new Error(r.statusText)):H(r)))}function Fe(e,t){return ur(e,t).pipe(x(r=>r.json()),J(1))}function mo(e,t){let r=new DOMParser;return ur(e,t).pipe(x(n=>n.text()),l(n=>r.parseFromString(n,"text/xml")),J(1))}function pr(e){let t=_("script",{src:e});return I(()=>(document.head.appendChild(t),L(b(t,"load"),b(t,"error").pipe(x(()=>Ot(()=>new ReferenceError(`Invalid script: ${e}`))))).pipe(l(()=>{}),C(()=>document.head.removeChild(t)),Te(1))))}function ho(){return{x:Math.max(0,scrollX),y:Math.max(0,scrollY)}}function bo(){return L(b(window,"scroll",{passive:!0}),b(window,"resize",{passive:!0})).pipe(l(ho),z(ho()))}function vo(){return{width:innerWidth,height:innerHeight}}function go(){return b(window,"resize",{passive:!0}).pipe(l(vo),z(vo()))}function yo(){return Q([bo(),go()]).pipe(l(([e,t])=>({offset:e,size:t})),J(1))}function lr(e,{viewport$:t,header$:r}){let n=t.pipe(X("size")),o=Q([n,r]).pipe(l(()=>Ye(e)));return Q([r,t,o]).pipe(l(([{height:i},{offset:a,size:s},{x:f,y:c}])=>({offset:{x:a.x-f,y:a.y-c+i},size:s})))}(()=>{function e(n,o){parent.postMessage(n,o||"*")}function t(...n){return n.reduce((o,i)=>o.then(()=>new Promise(a=>{let s=document.createElement("script");s.src=i,s.onload=a,document.body.appendChild(s)})),Promise.resolve())}var r=class{constructor(n){this.url=n,this.onerror=null,this.onmessage=null,this.onmessageerror=null,this.m=a=>{a.source===this.w&&(a.stopImmediatePropagation(),this.dispatchEvent(new MessageEvent("message",{data:a.data})),this.onmessage&&this.onmessage(a))},this.e=(a,s,f,c,u)=>{if(s===this.url.toString()){let p=new ErrorEvent("error",{message:a,filename:s,lineno:f,colno:c,error:u});this.dispatchEvent(p),this.onerror&&this.onerror(p)}};let o=new EventTarget;this.addEventListener=o.addEventListener.bind(o),this.removeEventListener=o.removeEventListener.bind(o),this.dispatchEvent=o.dispatchEvent.bind(o);let i=document.createElement("iframe");i.width=i.height=i.frameBorder="0",document.body.appendChild(this.iframe=i),this.w.document.open(),this.w.document.write(` + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + + + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/_base/beken-7231-tuya.json b/boards/_base/beken-7231-tuya.json new file mode 100644 index 000000000..a96531fff --- /dev/null +++ b/boards/_base/beken-7231-tuya.json @@ -0,0 +1,8 @@ +{ + "build": { + "bkcrypt_coeffs": "510fb093a3cbeadc5993a17ec7adeb03" + }, + "flash": { + "tuya": "0x1ED000+0x13000" + } +} diff --git a/boards/_base/beken-7231.json b/boards/_base/beken-7231.json new file mode 100644 index 000000000..d81a6fcb9 --- /dev/null +++ b/boards/_base/beken-7231.json @@ -0,0 +1,10 @@ +{ + "build": { + "ldscript": "bk7231_bsp.ld", + "bkoffset_app": "0x10000", + "bkrbl_size_app": "0x108700" + }, + "upload": { + "maximum_size": 1083136 + } +} diff --git a/boards/_base/beken-7231n.json b/boards/_base/beken-7231n.json new file mode 100644 index 000000000..308a3ba26 --- /dev/null +++ b/boards/_base/beken-7231n.json @@ -0,0 +1,33 @@ +{ + "build": { + "family": "BK7231N", + "ldscript": "bk7231n_bsp.ld", + "bkboot_version": "1.0.1-bk7231n", + "bkoffset_app": "0x10000", + "bkrbl_size_app": "0x108700" + }, + "flash": { + "bootloader": "0x000000+0x11000", + "app": "0x011000+0x119000", + "download": "0x12A000+0xA6000", + "calibration": "0x1D0000+0x1000", + "net": "0x1D1000+0x1000", + "tlv": "0x1D2000+0x1000", + "kvs": "0x1D3000+0x8000", + "userdata": "0x1DB000+0x25000" + }, + "upload": { + "maximum_size": 1083136, + "speed": 460800 + }, + "connectivity": [ + "ble" + ], + "doc": { + "params": { + "extra": { + "Bluetooth": "BLE v5.1" + } + } + } +} diff --git a/boards/_base/beken-7231q.json b/boards/_base/beken-7231q.json new file mode 100644 index 000000000..fedddd931 --- /dev/null +++ b/boards/_base/beken-7231q.json @@ -0,0 +1,19 @@ +{ + "build": { + "family": "BK7231Q", + "bkboot_version": "bk7231q" + }, + "flash": { + "bootloader": "0x000000+0x11000", + "app": "0x011000+0x121000", + "download": "0x132000+0xA6000", + "kvs": "0x1D8000+0x8000", + "calibration": "0x1E0000+0x1000", + "tlv": "0x1E1000+0x1000", + "net": "0x1E2000+0x1000", + "userdata": "0x1E3000+0x1D000" + }, + "upload": { + "speed": 460800 + } +} diff --git a/boards/_base/beken-7231t.json b/boards/_base/beken-7231t.json new file mode 100644 index 000000000..82da778f5 --- /dev/null +++ b/boards/_base/beken-7231t.json @@ -0,0 +1,29 @@ +{ + "build": { + "family": "BK7231T", + "bkboot_version": "1.0.5-bk7231s" + }, + "flash": { + "bootloader": "0x000000+0x11000", + "app": "0x011000+0x121000", + "download": "0x132000+0xA6000", + "kvs": "0x1D8000+0x8000", + "calibration": "0x1E0000+0x1000", + "tlv": "0x1E1000+0x1000", + "net": "0x1E2000+0x1000", + "userdata": "0x1E3000+0x1D000" + }, + "upload": { + "speed": 921600 + }, + "connectivity": [ + "ble" + ], + "doc": { + "params": { + "extra": { + "Bluetooth": "BLE v4.2" + } + } + } +} diff --git a/boards/_base/beken-7252.json b/boards/_base/beken-7252.json new file mode 100644 index 000000000..cc86e67a3 --- /dev/null +++ b/boards/_base/beken-7252.json @@ -0,0 +1,40 @@ +{ + "build": { + "family": "BK7251", + "f_cpu": "180000000L", + "ldscript": "bk7231_bsp.ld", + "bkboot_version": "0.1.3-bk7252", + "bkoffset_app": "0x10000", + "bkrbl_size_app": "0x1A0000" + }, + "flash": { + "bootloader": "0x000000+0x11000", + "app": "0x011000+0x1BA000", + "filesystem": "0x1CB000+0x119000", + "kvs": "0x2E4000+0x8000", + "download": "0x2EC000+0x112000", + "calibration": "0x3FE000+0x1000", + "tlv": "0x3FF000+0x1000" + }, + "debug": { + "gdb_init": [ + "mem 0x200000 0x400000 ro" + ] + }, + "upload": { + "maximum_ram_size": 524288, + "flash_size": 4194304, + "maximum_size": 1703936, + "speed": 921600 + }, + "connectivity": [ + "ble" + ], + "doc": { + "params": { + "extra": { + "Bluetooth": "BLE v5.0" + } + } + } +} diff --git a/boards/_base/beken-72xx.json b/boards/_base/beken-72xx.json new file mode 100644 index 000000000..c98c39209 --- /dev/null +++ b/boards/_base/beken-72xx.json @@ -0,0 +1,50 @@ +{ + "build": { + "f_cpu": "120000000L", + "prefix": "arm-none-eabi-", + "bkota": { + "encryption": "aes256", + "compression": "gzip", + "key": "0123456789ABCDEF0123456789ABCDEF", + "iv": "0123456789ABCDEF" + } + }, + "connectivity": [ + "wifi" + ], + "debug": { + "protocol": "openocd", + "protocols": [ + "openocd" + ], + "openocd_config": "bk72xx.cfg", + "gdb_init": [ + "mem 0x000000 0x200000 ro" + ] + }, + "upload": { + "maximum_ram_size": 262144, + "flash_size": 2097152, + "require_upload_port": true, + "protocol": "uart", + "protocols": [ + "uart" + ] + }, + "doc": { + "params": { + "manufacturer": "Beken", + "series": "BK72XX", + "voltage": "3.0V - 3.6V", + "extra": { + "Wi-Fi": "802.11 b/g/n" + } + }, + "links": { + "Info & flashing guide": "../../docs/platform/beken-72xx/README.md" + }, + "extra": [ + "Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes." + ] + } +} diff --git a/boards/_base/generic.json b/boards/_base/generic.json new file mode 100644 index 000000000..41d47b0ee --- /dev/null +++ b/boards/_base/generic.json @@ -0,0 +1,7 @@ +{ + "pcb": { + "symbol": "GENERIC", + "templates": [], + "vars": {} + } +} diff --git a/boards/_base/ic/bk7231-qfn32.json b/boards/_base/ic/bk7231-qfn32.json new file mode 100644 index 000000000..3f072f5c5 --- /dev/null +++ b/boards/_base/ic/bk7231-qfn32.json @@ -0,0 +1,139 @@ +{ + "pcb": { + "ic": { + "10": { + "C_NAME": "GPIO28", + "GPIO": "P28", + "IRQ": null, + "USB": "DN" + }, + "11": { + "C_NAME": "GPIO14", + "GPIO": "P14", + "IRQ": null, + "SD": "CLK", + "SPI": "SCK" + }, + "12": { + "C_NAME": "GPIO16", + "GPIO": "P16", + "IRQ": null, + "SD": "D0", + "SPI": "MOSI" + }, + "13": { + "C_NAME": "GPIO15", + "GPIO": "P15", + "IRQ": null, + "SD": "CMD", + "SPI": "CS" + }, + "14": { + "C_NAME": "GPIO17", + "GPIO": "P17", + "IRQ": null, + "SD": "D1", + "SPI": "MISO" + }, + "15": { + "C_NAME": "GPIO26", + "GPIO": "P26", + "IRQ": null, + "PWM": 5, + "IRDA": null + }, + "16": { + "C_NAME": "GPIO24", + "GPIO": "P24", + "IRQ": null, + "PWM": 4 + }, + "17": { + "C_NAME": "GPIO23", + "GPIO": "P23", + "IRQ": null, + "ADC": 3, + "JTAG": "TDO", + "FLASH": "FSO" + }, + "18": { + "C_NAME": "GPIO22", + "GPIO": "P22", + "IRQ": null, + "JTAG": "TDI", + "FLASH": "FSI" + }, + "19": { + "C_NAME": "GPIO21", + "GPIO": "P21", + "IRQ": null, + "I2C": "1_SDA", + "JTAG": "TMS", + "I2S": "MCLK", + "FLASH": "^FCS" + }, + "20": { + "C_NAME": "GPIO20", + "GPIO": "P20", + "IRQ": null, + "I2C": "1_SCL", + "JTAG": "TCK", + "FLASH": "FSCK" + }, + "21": { + "IO": "I", + "CTRL": "CEN" + }, + "22": { + "C_NAME": "GPIO6", + "GPIO": "P6", + "IRQ": null, + "PWM": 0 + }, + "23": { + "C_NAME": "GPIO7", + "GPIO": "P7", + "IRQ": null, + "PWM": 1 + }, + "24": { + "C_NAME": "GPIO8", + "GPIO": "P8", + "IRQ": null, + "PWM": 2 + }, + "25": { + "C_NAME": "GPIO9", + "GPIO": "P9", + "IRQ": null, + "PWM": 3 + }, + "26": { + "C_NAME": "GPIO10", + "GPIO": "P10", + "IRQ": null, + "UART": "1_RX" + }, + "27": { + "C_NAME": "GPIO11", + "GPIO": "P11", + "IRQ": null, + "UART": "1_TX" + }, + "28": { + "C_NAME": "GPIO1", + "GPIO": "P1", + "IRQ": null, + "UART": "2_RX", + "I2C": "2_SDA" + }, + "29": { + "C_NAME": "GPIO0", + "GPIO": "P0", + "IRQ": null, + "UART": "2_TX", + "I2C": "2_SCL" + } + } + } +} diff --git a/boards/_base/ic/bk7231-qfn40.json b/boards/_base/ic/bk7231-qfn40.json new file mode 100644 index 000000000..853d19994 --- /dev/null +++ b/boards/_base/ic/bk7231-qfn40.json @@ -0,0 +1,186 @@ +{ + "pcb": { + "ic": { + "10": { + "C_NAME": "GPIO25", + "GPIO": "P25", + "IRQ": null, + "USB": "DP" + }, + "11": { + "C_NAME": "GPIO33", + "GPIO": "P33", + "IRQ": null, + "DVP": "PD1" + }, + "12": { + "C_NAME": "GPIO32", + "GPIO": "P32", + "IRQ": null, + "DVP": "PD0" + }, + "13": { + "C_NAME": "GPIO29", + "GPIO": "P29", + "IRQ": null, + "DVP": "PCLK" + }, + "14": { + "C_NAME": "GPIO27", + "GPIO": "P27", + "IRQ": null, + "DVP": "MCLK" + }, + "15": { + "C_NAME": "GPIO30", + "GPIO": "P30", + "IRQ": null, + "DVP": "HSYNC" + }, + "16": { + "C_NAME": "GPIO31", + "GPIO": "P31", + "IRQ": null, + "DVP": "VSYNC" + }, + "17": { + "C_NAME": "GPIO34", + "GPIO": "P34", + "IRQ": null, + "DVP": "PD2" + }, + "18": { + "C_NAME": "GPIO35", + "GPIO": "P35", + "IRQ": null, + "DVP": "PD3" + }, + "19": { + "C_NAME": "GPIO36", + "GPIO": "P36", + "IRQ": null, + "DVP": "PD4" + }, + "20": { + "C_NAME": "GPIO37", + "GPIO": "P37", + "IRQ": null, + "DVP": "PD5" + }, + "21": { + "C_NAME": "GPIO38", + "GPIO": "P38", + "IRQ": null, + "DVP": "PD6" + }, + "22": { + "C_NAME": "GPIO39", + "GPIO": "P39", + "IRQ": null, + "DVP": "PD7" + }, + "23": { + "C_NAME": "GPIO14", + "GPIO": "P14", + "IRQ": null, + "SD": "CLK", + "SPI": "SCK" + }, + "24": { + "C_NAME": "GPIO16", + "GPIO": "P16", + "IRQ": null, + "SD": "D0", + "SPI": "MOSI" + }, + "25": { + "C_NAME": "GPIO15", + "GPIO": "P15", + "IRQ": null, + "SD": "CMD", + "SPI": "CS" + }, + "26": { + "C_NAME": "GPIO17", + "GPIO": "P17", + "IRQ": null, + "SD": "D1", + "SPI": "MISO" + }, + "27": { + "C_NAME": "GPIO23", + "GPIO": "P23", + "IRQ": null, + "ADC": 3, + "JTAG": "TDO", + "FLASH": "FSO" + }, + "28": { + "C_NAME": "GPIO22", + "GPIO": "P22", + "IRQ": null, + "JTAG": "TDI", + "FLASH": "FSI" + }, + "29": { + "C_NAME": "GPIO21", + "GPIO": "P21", + "IRQ": null, + "I2C": "1_SDA", + "JTAG": "TMS", + "I2S": "MCLK", + "FLASH": "^FCS" + }, + "30": { + "C_NAME": "GPIO20", + "GPIO": "P20", + "IRQ": null, + "I2C": "1_SCL", + "JTAG": "TCK", + "FLASH": "FSCK" + }, + "31": { + "IO": "I", + "CTRL": "CEN" + }, + "32": { + "C_NAME": "GPIO8", + "GPIO": "P8", + "IRQ": null, + "PWM": 2 + }, + "33": { + "C_NAME": "GPIO9", + "GPIO": "P9", + "IRQ": null, + "PWM": 3 + }, + "34": { + "C_NAME": "GPIO10", + "GPIO": "P10", + "IRQ": null, + "UART": "1_RX" + }, + "35": { + "C_NAME": "GPIO11", + "GPIO": "P11", + "IRQ": null, + "UART": "1_TX" + }, + "36": { + "C_NAME": "GPIO1", + "GPIO": "P1", + "IRQ": null, + "UART": "2_RX", + "I2C": "2_SDA" + }, + "37": { + "C_NAME": "GPIO0", + "GPIO": "P0", + "IRQ": null, + "UART": "2_TX", + "I2C": "2_SCL" + } + } + } +} diff --git a/boards/_base/ic/bk7231q-qfn40.json b/boards/_base/ic/bk7231q-qfn40.json new file mode 100644 index 000000000..cf8644dd5 --- /dev/null +++ b/boards/_base/ic/bk7231q-qfn40.json @@ -0,0 +1,170 @@ +{ + "pcb": { + "ic": { + "11": { + "C_NAME": "GPIO30", + "GPIO": "P30", + "IRQ": null, + "USB": "DN" + }, + "12": { + "C_NAME": "GPIO29", + "GPIO": "P29", + "IRQ": null, + "USB": "DP" + }, + "14": { + "C_NAME": "GPIO6", + "GPIO": "P6", + "IRQ": null, + "PWM": 0 + }, + "15": { + "C_NAME": "GPIO7", + "GPIO": "P7", + "IRQ": null, + "PWM": 1 + }, + "16": { + "C_NAME": "GPIO8", + "GPIO": "P8", + "IRQ": null, + "PWM": 2 + }, + "17": { + "C_NAME": "GPIO17", + "GPIO": "P17", + "IRQ": null, + "SD": "D1", + "SPI": "MISO" + }, + "18": { + "C_NAME": "GPIO16", + "GPIO": "P16", + "IRQ": null, + "SD": "D0", + "SPI": "MOSI" + }, + "19": { + "C_NAME": "GPIO14", + "GPIO": "P14", + "IRQ": null, + "SD": "CLK", + "SPI": "SCK" + }, + "20": { + "C_NAME": "GPIO15", + "GPIO": "P15", + "IRQ": null, + "SD": "CMD", + "SPI": "CS" + }, + "21": { + "C_NAME": "GPIO19", + "GPIO": "P19", + "IRQ": null, + "SD": "D3", + "PWM": 5 + }, + "22": { + "C_NAME": "GPIO18", + "GPIO": "P18", + "IRQ": null, + "SD": "D2", + "PWM": 4 + }, + "23": { + "IO": "I", + "CTRL": "TEST" + }, + "24": { + "C_NAME": "GPIO9", + "GPIO": "P9", + "IRQ": null, + "PWM": 3 + }, + "25": { + "C_NAME": "GPIO10", + "GPIO": "P10", + "IRQ": null, + "UART": "1_RX" + }, + "26": { + "C_NAME": "GPIO11", + "GPIO": "P11", + "IRQ": null, + "UART": "1_TX" + }, + "27": { + "C_NAME": "GPIO1", + "GPIO": "P1", + "IRQ": null, + "UART": "2_RX", + "I2C": "2_SDA" + }, + "28": { + "C_NAME": "GPIO0", + "GPIO": "P0", + "IRQ": null, + "UART": "2_TX", + "I2C": "2_SCL" + }, + "29": { + "C_NAME": "GPIO20", + "GPIO": "P20", + "IRQ": null, + "I2C": "1_SCL", + "JTAG": "TCK", + "FLASH": "FSCK" + }, + "30": { + "C_NAME": "GPIO21", + "GPIO": "P21", + "IRQ": null, + "I2C": "1_SDA", + "JTAG": "TMS", + "FLASH": "^FCS" + }, + "31": { + "C_NAME": "GPIO22", + "GPIO": "P22", + "IRQ": null, + "JTAG": "TDI", + "FLASH": "FSI" + }, + "32": { + "C_NAME": "GPIO23", + "GPIO": "P23", + "IRQ": null, + "ADC": 3, + "JTAG": "TDO", + "FLASH": "FSO" + }, + "33": { + "C_NAME": "GPIO25", + "GPIO": "P25", + "IRQ": null + }, + "34": { + "C_NAME": "GPIO28", + "GPIO": "P28", + "IRQ": null + }, + "35": { + "C_NAME": "GPIO4", + "GPIO": "P4", + "IRQ": null, + "ADC": 1, + "I2S": "DIN" + }, + "36": { + "IO": "I", + "CTRL": "CODE" + }, + "37": { + "IO": "I", + "CTRL": "CEN" + } + } + } +} diff --git a/boards/_base/ic/bk7252-qfn68.json b/boards/_base/ic/bk7252-qfn68.json new file mode 100644 index 000000000..270d94881 --- /dev/null +++ b/boards/_base/ic/bk7252-qfn68.json @@ -0,0 +1,259 @@ +{ + "pcb": { + "ic": { + "13": { + "C_NAME": "GPIO28", + "GPIO": "P28", + "IRQ": null, + "USB": "DN" + }, + "14": { + "C_NAME": "GPIO25", + "GPIO": "P25", + "IRQ": null, + "USB": "DP" + }, + "16": { + "C_NAME": "GPIO12", + "GPIO": "P12", + "IRQ": null, + "ADC": 6, + "UART": "1_CTS" + }, + "17": { + "C_NAME": "GPIO13", + "GPIO": "P13", + "IRQ": null, + "ADC": 7, + "UART": "1_RTS" + }, + "18": { + "C_NAME": "GPIO33", + "GPIO": "P33", + "IRQ": null, + "DVP": "PD1" + }, + "19": { + "C_NAME": "GPIO32", + "GPIO": "P32", + "IRQ": null, + "DVP": "PD0" + }, + "20": { + "C_NAME": "GPIO29", + "GPIO": "P29", + "IRQ": null, + "DVP": "PCLK" + }, + "21": { + "C_NAME": "GPIO27", + "GPIO": "P27", + "IRQ": null, + "DVP": "MCLK" + }, + "22": { + "C_NAME": "GPIO30", + "GPIO": "P30", + "IRQ": null, + "DVP": "HSYNC" + }, + "23": { + "C_NAME": "GPIO31", + "GPIO": "P31", + "IRQ": null, + "DVP": "VSYNC" + }, + "24": { + "C_NAME": "GPIO34", + "GPIO": "P34", + "IRQ": null, + "DVP": "PD2" + }, + "25": { + "C_NAME": "GPIO35", + "GPIO": "P35", + "IRQ": null, + "DVP": "PD3" + }, + "26": { + "C_NAME": "GPIO36", + "GPIO": "P36", + "IRQ": null, + "DVP": "PD4" + }, + "27": { + "C_NAME": "GPIO37", + "GPIO": "P37", + "IRQ": null, + "DVP": "PD5" + }, + "28": { + "C_NAME": "GPIO38", + "GPIO": "P38", + "IRQ": null, + "DVP": "PD6" + }, + "29": { + "C_NAME": "GPIO39", + "GPIO": "P39", + "IRQ": null, + "DVP": "PD7" + }, + "30": { + "C_NAME": "GPIO19", + "GPIO": "P19", + "IRQ": null, + "SD": "D3" + }, + "31": { + "C_NAME": "GPIO17", + "GPIO": "P17", + "IRQ": null, + "SD": "D1", + "SPI": "MISO" + }, + "32": { + "C_NAME": "GPIO14", + "GPIO": "P14", + "IRQ": null, + "SD": "CLK", + "SPI": "SCK" + }, + "33": { + "C_NAME": "GPIO16", + "GPIO": "P16", + "IRQ": null, + "SD": "D0", + "SPI": "MOSI" + }, + "34": { + "C_NAME": "GPIO15", + "GPIO": "P15", + "IRQ": null, + "SD": "CMD", + "SPI": "CS" + }, + "35": { + "C_NAME": "GPIO18", + "GPIO": "P18", + "IRQ": null, + "SD": "D2" + }, + "36": { + "C_NAME": "GPIO24", + "GPIO": "P24", + "IRQ": null, + "PWM": 4 + }, + "37": { + "C_NAME": "GPIO26", + "GPIO": "P26", + "IRQ": null, + "PWM": 5, + "IRDA": null + }, + "38": { + "C_NAME": "GPIO23", + "GPIO": "P23", + "IRQ": null, + "ADC": 3, + "JTAG": "TDO", + "FLASH": "FSO" + }, + "39": { + "C_NAME": "GPIO22", + "GPIO": "P22", + "IRQ": null, + "JTAG": "TDI", + "FLASH": "FSI" + }, + "40": { + "C_NAME": "GPIO21", + "GPIO": "P21", + "IRQ": null, + "I2C": "1_SDA", + "JTAG": "TMS", + "I2S": "MCLK", + "FLASH": "^FCS" + }, + "41": { + "C_NAME": "GPIO20", + "GPIO": "P20", + "IRQ": null, + "I2C": "1_SCL", + "JTAG": "TCK", + "FLASH": "FSCK" + }, + "43": { + "IO": "I", + "CTRL": "CEN" + }, + "45": { + "C_NAME": "GPIO5", + "GPIO": "P5", + "IRQ": null, + "ADC": 2, + "I2S": "DOUT" + }, + "46": { + "C_NAME": "GPIO3", + "GPIO": "P3", + "IRQ": null, + "ADC": 5, + "I2S": "WS" + }, + "47": { + "C_NAME": "GPIO4", + "GPIO": "P4", + "IRQ": null, + "ADC": 1, + "I2S": "DIN" + }, + "48": { + "C_NAME": "GPIO2", + "GPIO": "P2", + "IRQ": null, + "ADC": 4, + "I2S": "SCK" + }, + "49": { + "C_NAME": "GPIO6", + "GPIO": "P6", + "IRQ": null, + "PWM": 0 + }, + "50": { + "C_NAME": "GPIO7", + "GPIO": "P7", + "IRQ": null, + "PWM": 1 + }, + "62": { + "C_NAME": "GPIO10", + "GPIO": "P10", + "IRQ": null, + "UART": "1_RX" + }, + "63": { + "C_NAME": "GPIO11", + "GPIO": "P11", + "IRQ": null, + "UART": "1_TX" + }, + "64": { + "C_NAME": "GPIO1", + "GPIO": "P1", + "IRQ": null, + "UART": "2_RX", + "I2C": "2_SDA" + }, + "65": { + "C_NAME": "GPIO0", + "GPIO": "P0", + "IRQ": null, + "UART": "2_TX", + "I2C": "2_SCL" + } + } + } +} diff --git a/boards/_base/ic/rtl8710bn.json b/boards/_base/ic/rtl8710bn.json new file mode 100644 index 000000000..0a3d6e73c --- /dev/null +++ b/boards/_base/ic/rtl8710bn.json @@ -0,0 +1,167 @@ +{ + "pcb": { + "ic": { + "1": { + "C_NAME": "PA_30", + "GPIO": "PA30", + "IRQ": null, + "UART": "2_TX", + "I2C": "0_SDA", + "PWM": 4, + "RTC": "OUT" + }, + "2": { + "C_NAME": "PA_29", + "GPIO": "PA29", + "IRQ": null, + "UART": "2_RX", + "I2C": "0_SCL", + "PWM": 4 + }, + "12": { + "IO": "I", + "CTRL": "CEN" + }, + "13": { + "C_NAME": "PA_14", + "GPIO": "PA14", + "IRQ": null, + "PWM": 0, + "SWD": "CLK" + }, + "14": { + "C_NAME": "PA_15", + "GPIO": "PA15", + "IRQ": null, + "PWM": 1, + "SWD": "DIO" + }, + "16": { + "C_NAME": "PA_0", + "GPIO": "PA00", + "IRQ": null, + "PWM": 2 + }, + "17": { + "C_NAME": "PA_12", + "GPIO": "PA12", + "IRQ": null, + "PWM": 3 + }, + "18": { + "C_NAME": "PA_6", + "GPIO": "PA06", + "IRQ": null, + "SPI": "FCS", + "SD": "D2" + }, + "19": { + "C_NAME": "PA_7", + "GPIO": "PA07", + "IRQ": null, + "SPI": "FD1", + "SD": "D3" + }, + "20": { + "C_NAME": "PA_8", + "GPIO": "PA08", + "IRQ": null, + "SPI": "FD2", + "SD": "CMD" + }, + "21": { + "C_NAME": "PA_9", + "GPIO": "PA09", + "IRQ": null, + "SPI": "FD0", + "SD": "CLK" + }, + "22": { + "C_NAME": "PA_10", + "GPIO": "PA10", + "IRQ": null, + "SPI": "FSCK", + "SD": "D0" + }, + "23": { + "C_NAME": "PA_11", + "GPIO": "PA11", + "IRQ": null, + "SPI": "FD3", + "SD": "D1" + }, + "27": { + "C_NAME": "AD_2", + "GPIONUM": 41, + "IO": "I", + "ADC": 2 + }, + "28": { + "C_NAME": "PA_5", + "GPIO": "PA05", + "IRQ": null, + "PWM": 4, + "WAKE": 1 + }, + "29": { + "C_NAME": "PA_18", + "GPIO": "PA18", + "IRQ": null, + "UART": "0_RX", + "SPI": [ + "0_SCK", + "1_SCK" + ], + "I2C": "1_SCL", + "SD": "D2", + "TMR": "4_TRIG", + "I2S": "0_MCK", + "WAKE": 0 + }, + "30": { + "C_NAME": "PA_19", + "GPIO": "PA19", + "IRQ": null, + "ADC": 1, + "UART": "0_CTS", + "SPI": [ + "0_CS", + "1_CS" + ], + "I2C": "0_SDA", + "SD": "D3", + "TMR": "5_TRIG", + "I2S": "0_TX" + }, + "31": { + "C_NAME": "PA_22", + "GPIO": "PA22", + "IRQ": null, + "UART": "0_RTS", + "SPI": [ + "0_MISO", + "1_MISO" + ], + "I2C": "0_SCL", + "SD": "D0", + "PWM": 5, + "I2S": "0_WS", + "WAKE": 2 + }, + "32": { + "C_NAME": "PA_23", + "GPIO": "PA23", + "IRQ": null, + "UART": "0_TX", + "SPI": [ + "0_MOSI", + "1_MOSI" + ], + "I2C": "1_SDA", + "SD": "D1", + "PWM": 0, + "WAKE": 3 + } + } + } +} diff --git a/boards/_base/ic/rtl8720cf.json b/boards/_base/ic/rtl8720cf.json new file mode 100644 index 000000000..baf08eba7 --- /dev/null +++ b/boards/_base/ic/rtl8720cf.json @@ -0,0 +1,186 @@ +{ + "pcb": { + "ic": { + "1": { + "C_NAME": "PIN_A20", + "GPIO": "PA20", + "IRQ": null, + "SD": "D1", + "SPI": + "0_MISO" + , + "UART": "2_RTS", + "I2C": "0_SDA", + "PWM": 0 + }, + "3": { + "C_NAME": "PIN_A23", + "GPIO": "PA23", + "IRQ": null, + "PWM": 7 + }, + "14": { + "IO": "I", + "CTRL": "CEN" + }, + "15": { + "C_NAME": "PIN_A0", + "GPIO": "PA00", + "IRQ": null, + "JTAG": "TCK", + "UART": "1_RX", + "PWM": 0, + "SWD": "CLK" + }, + "16": { + "C_NAME": "PIN_A1", + "GPIO": "PA01", + "IRQ": null, + "JTAG": "TMS", + "UART": "1_TX", + "PWM": 1, + "SWD": "DIO" + }, + "18": { + "C_NAME": "PIN_A2", + "GPIO": "PA02", + "IRQ": null, + "JTAG": "TDO", + "UART": "1_RX", + "SPI": "0_CS", + "I2C": "0_SCL", + "PWM": 2 + }, + "19": { + "C_NAME": "PIN_A3", + "GPIO": "PA03", + "IRQ": null, + "JTAG": "TDI", + "UART": "1_TX", + "SPI": "0_SCK", + "I2C": "0_SDA", + "PWM": 3 + }, + "20": { + "C_NAME": "PIN_A4", + "GPIO": "PA04", + "IRQ": null, + "JTAG": "tRST", + "UART": "1_CTS", + "SPI": "0_MOSI", + "PWM": 4 + }, + "21": { + "C_NAME": "PIN_A7", + "GPIO": "PA07", + "IRQ": null, + "FLASH": "^FCS", + "SPI": "0_CS" + }, + "22": { + "C_NAME": "PIN_A8", + "GPIO": "PA08", + "IRQ": null, + "FLASH": "FSCK", + "SPI": "0_SCK" + }, + "23": { + "C_NAME": "PIN_A9", + "GPIO": "PA09", + "IRQ": null, + "FLASH": "FD2", + "SPI": "0_MOSI", + "UART": "0_RTS" + }, + "24": { + "C_NAME": "PIN_A10", + "GPIO": "PA10", + "IRQ": null, + "FLASH": "FD1", + "SPI": "0_MISO", + "UART": "0_CTS" + }, + "25": { + "C_NAME": "PIN_A11", + "GPIO": "PA11", + "IRQ": null, + "FLASH": "FD0", + "UART": "0_TX", + "I2C": "0_SCL", + "PWM": 0 + }, + "26": { + "C_NAME": "PIN_A12", + "GPIO": "PA12", + "IRQ": null, + "FLASH": "FD3", + "UART": "0_RX", + "I2C": "0_SDA", + "PWM": 1 + }, + "30": { + "IO": "I", + "C_NAME": "VBAT_IN" + }, + "33": { + "C_NAME": "PIN_A13", + "GPIO": "PA13", + "IRQ": null, + "UART": "0_RX", + "PWM": 7 + }, + "34": { + "C_NAME": "PIN_A14", + "GPIO": "PA14", + "IRQ": null, + "SD": "INT", + "UART": "0_TX", + "PWM": 2 + }, + "36": { + "C_NAME": "PIN_A15", + "GPIO": "PA15", + "IRQ": null, + "SD": "D2", + "SPI": "0_CS", + "UART": "2_RX", + "I2C": "0_SCL", + "PWM": 3 + }, + "37": { + "C_NAME": "PIN_A16", + "GPIO": "PA16", + "IRQ": null, + "SD": "D3", + "SPI": "0_SCK", + "UART": "2_TX", + "I2C": "0_SDA", + "PWM": 4 + }, + "38": { + "C_NAME": "PIN_A17", + "GPIO": "PA17", + "IRQ": null, + "SD": "CMD", + "PWM": 5 + }, + "39": { + "C_NAME": "PIN_A18", + "GPIO": "PA18", + "IRQ": null, + "SD": "CLK", + "PWM": 6 + }, + "40": { + "C_NAME": "PIN_A19", + "GPIO": "PA19", + "IRQ": null, + "SD": "D0", + "SPI": "0_MOSI", + "UART": "2_CTS", + "I2C": "0_SCL", + "PWM": 7 + } + } + } +} diff --git a/boards/_base/pcb/bw12.json b/boards/_base/pcb/bw12.json new file mode 100644 index 000000000..5347eca8c --- /dev/null +++ b/boards/_base/pcb/bw12.json @@ -0,0 +1,78 @@ +{ + "pcb": { + "templates": [ + "esp12s", + "pcb-black", + "rf-type1" + ], + "vars": { + "TRACE_COLOR": "#FAFD9D" + }, + "pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD", + "pinout": { + "1": { + "IC": 14, + "ARD": "D8" + }, + "2": { + "NC": null + }, + "3": { + "IC": 12 + }, + "4": { + "IC": 28, + "ARD": "D0" + }, + "5": { + "IC": 2, + "ARD": "D1" + }, + "6": { + "IC": 16, + "ARD": "D2" + }, + "7": { + "IC": 30, + "ARD": [ + "D3", + "A0" + ] + }, + "8": { + "PWR": 3.3 + }, + "9": { + "GND": null + }, + "10": { + "IC": 31, + "ARD": "D4" + }, + "11": { + "IC": 1, + "ARD": "D5" + }, + "12": { + "IC": 13, + "ARD": "D6" + }, + "13": { + "IC": 17, + "ARD": "D7" + }, + "14": { + "IC": 14, + "ARD": "D8" + }, + "15": { + "IC": 29, + "ARD": "D9" + }, + "16": { + "IC": 32, + "ARD": "D10" + } + } + } +} diff --git a/boards/_base/pcb/bw15.json b/boards/_base/pcb/bw15.json new file mode 100644 index 000000000..217692d34 --- /dev/null +++ b/boards/_base/pcb/bw15.json @@ -0,0 +1,73 @@ +{ + "pcb": { + "templates": [ + "esp12s", + "pcb-black", + "rf-type1" + ], + "pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD", + "pinout": { + "1": { + "IC": 38, + "ARD": "D0" + }, + "2": { + "IC": 39, + "ARD": "D1" + }, + "3": { + "IC": 14 + }, + "4": { + "IC": 18, + "ARD": "D2" + }, + "5": { + "IC": 36, + "ARD": "D3" + }, + "6": { + "IC": 20, + "ARD": "D4" + }, + "7": { + "IC": 40, + "ARD": "D5" + }, + "8": { + "PWR": 3.3 + }, + "9": { + "GND": null + }, + "10": { + "IC": 1, + "ARD": "D6" + }, + "11": { + "IC": 37, + "ARD": "D7" + }, + "12": { + "IC": 15, + "ARD": "D8" + }, + "13": { + "IC": 19, + "ARD": "D9" + }, + "14": { + "IC": 16, + "ARD": "D10" + }, + "15": { + "IC": 33, + "ARD": "D11" + }, + "16": { + "IC": 34, + "ARD": "D12" + } + } + } +} diff --git a/boards/_base/pcb/cb1s-test.json b/boards/_base/pcb/cb1s-test.json new file mode 100644 index 000000000..05e534208 --- /dev/null +++ b/boards/_base/pcb/cb1s-test.json @@ -0,0 +1,69 @@ +{ + "pcb": { + "scale": 14, + "test_pads": { + "TSCK": "cb1s.back.sck.anchor", + "TCSN": "cb1s.back.csn.anchor", + "TSI": "cb1s.back.si.anchor", + "TSO": "cb1s.back.so.anchor" + }, + "back": [ + { + "name": "test_pad_1mm", + "pos": "2.66,14.4" + }, + { + "name": "test_pad_1mm", + "pos": "2.66,15.9" + }, + { + "name": "test_pad_1mm", + "pos": "2.66,17.4" + }, + { + "name": "test_pad_1mm", + "pos": "2.66,18.9" + }, + { + "id": "sck", + "name": "label_line_down", + "pos": "3.5,14.3", + "vars": { + "DIR": "right", + "W": 1.0, + "H": 0 + } + }, + { + "id": "csn", + "name": "label_line_down", + "pos": "3.5,15.8", + "vars": { + "DIR": "right", + "W": 1.0, + "H": 0 + } + }, + { + "id": "si", + "name": "label_line_down", + "pos": "3.5,17.3", + "vars": { + "DIR": "right", + "W": 1.0, + "H": 0 + } + }, + { + "id": "so", + "name": "label_line_down", + "pos": "3.5,18.8", + "vars": { + "DIR": "right", + "W": 1.0, + "H": 0 + } + } + ] + } +} diff --git a/boards/_base/pcb/cb1s.json b/boards/_base/pcb/cb1s.json new file mode 100644 index 000000000..88d9b1225 --- /dev/null +++ b/boards/_base/pcb/cb1s.json @@ -0,0 +1,101 @@ +{ + "pcb": { + "templates": [ + "tuya1", + "pcb-blue-light", + "tuya-16x24", + "rf-type1" + ], + "scale": 15, + "pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD", + "pinout": { + "1": { + "PWR": "VCC5" + }, + "2": { + "IC": 27, + "ARD": "D0" + }, + "3": { + "IC": 26, + "ARD": "D1" + }, + "4": { + "PWR": 3.3 + }, + "5": { + "GND": null + }, + "6": { + "IC": 22, + "ARD": "D2" + }, + "7": { + "IC": 23, + "ARD": "D3" + }, + "8": { + "IC": 29, + "ARD": "D4" + }, + "9": { + "IC": 25, + "ARD": "D5" + }, + "10": { + "IC": 24, + "ARD": "D6" + }, + "11": { + "IC": 28, + "ARD": "D7" + }, + "12": { + "IC": 16, + "ARD": "D8" + }, + "13": { + "IC": 15, + "ARD": "D9" + }, + "14": { + "GND": null + }, + "15": { + "GND": null + }, + "16": { + "IC": 21 + }, + "17": { + "IC": 17, + "ARD": [ + "D10", + "A0" + ] + }, + "18": { + "GND": null + }, + "TSCK": { + "IC": 20, + "ARD": "D11" + }, + "TCSN": { + "IC": 19, + "ARD": "D12" + }, + "TSO": { + "IC": 17, + "ARD": [ + "D10", + "A0" + ] + }, + "TSI": { + "IC": 18, + "ARD": "D13" + } + } + } +} diff --git a/boards/_base/pcb/cb2l-test.json b/boards/_base/pcb/cb2l-test.json new file mode 100644 index 000000000..4148cf484 --- /dev/null +++ b/boards/_base/pcb/cb2l-test.json @@ -0,0 +1,105 @@ +{ + "pcb": { + "test_pads": { + "TRST": "cb2l.back.rst.anchor", + "TRX1": "cb2l.back.u1_rxd.anchor", + "TTX1": "cb2l.back.u1_txd.anchor", + "TTX2": "cb2l.back.u2_txd.anchor", + "TGND": "cb2l.back.gnd.anchor", + "TCSN": "cb2l.back.f_csn.anchor" + }, + "back": [ + { + "name": "test_pad_1mm", + "pos": "1.5,7.5" + }, + { + "name": "label_line_down", + "pos": "0.4,4.7", + "vars": { + "DIR": "right", + "W": 0.2, + "H": 2.7 + } + }, + { + "id": "u1_rxd.anchor", + "type": "rect", + "pos": "0.9,5.0", + "size": "0,0", + "label_dir": "left", + "label_size": 2 + }, + { + "name": "test_pad_1mm", + "pos": "2.2,5.9" + }, + { + "id": "u2_txd", + "name": "label_line_up", + "pos": "2.2,5.1", + "vars": { + "DIR": "left", + "W": 1.5, + "H": 2 + } + }, + { + "name": "test_pad_1mm", + "pos": "4.0,5.9" + }, + { + "id": "u1_txd", + "name": "label_line_up", + "pos": "4.0,5.1", + "vars": { + "DIR": "left", + "W": 3.3, + "H": 4 + } + }, + { + "name": "test_pad_1mm", + "pos": "9.2,5.9" + }, + { + "id": "gnd", + "name": "label_line_up", + "pos": "9.2,5.1", + "vars": { + "DIR": "left", + "W": 8.5, + "H": 6 + } + }, + { + "name": "test_pad_1mm", + "pos": "2.2,10.7" + }, + { + "id": "rst", + "name": "label_line_up", + "pos": "2.2,9.9", + "vars": { + "DIR": "left", + "W": 1.5, + "H": 1.0 + } + }, + { + "name": "test_pad_1mm", + "pos": "2.2,12.0" + }, + { + "id": "f_csn", + "name": "label_line_down", + "pos": "2.2,12.8", + "vars": { + "DIR": "left", + "W": 1.5, + "H": 1.0 + } + } + ] + } +} diff --git a/boards/_base/pcb/cb2l.json b/boards/_base/pcb/cb2l.json new file mode 100644 index 000000000..575a49734 --- /dev/null +++ b/boards/_base/pcb/cb2l.json @@ -0,0 +1,60 @@ +{ + "pcb": { + "templates": [ + "tuya2l", + "pcb-white", + "rf-type1" + ], + "pinout_hidden": "I2S,I2C,JTAG,FLASH", + "pinout": { + "1": { + "IC": 24, + "ARD": "D0" + }, + "2": { + "IC": 23, + "ARD": "D1" + }, + "3": { + "IC": 22, + "ARD": "D2" + }, + "4": { + "IC": 15, + "ARD": "D3" + }, + "5": { + "IC": 16, + "ARD": "D4" + }, + "6": { + "GND": null + }, + "7": { + "PWR": 3.3 + }, + "TGND": { + "GND": null + }, + "TRST": { + "CTRL": "CEN" + }, + "TRX1": { + "IC": 26, + "ARD": "D5" + }, + "TTX2": { + "IC": 29, + "ARD": "D6" + }, + "TTX1": { + "IC": 27, + "ARD": "D7" + }, + "TCSN": { + "IC": 19, + "ARD": "D8" + } + } + } +} diff --git a/boards/_base/pcb/cb2s-test.json b/boards/_base/pcb/cb2s-test.json new file mode 100644 index 000000000..d22bef664 --- /dev/null +++ b/boards/_base/pcb/cb2s-test.json @@ -0,0 +1,59 @@ +{ + "pcb": { + "test_pads": { + "TTX2": "cb2s.back.u2_txd.anchor", + "TRX2": "cb2s.back.u2_rxd.anchor", + "TCSN": "cb2s.back.csn.anchor" + }, + "back": [ + { + "type": "rect", + "pos": "6.0,8.9", + "size": "2.9,2.9", + "preset": "copper1" + }, + { + "id": "u2_txd", + "name": "label_line_up", + "pos": "6.7,6.1", + "vars": { + "DIR": "left", + "W": 2.5, + "H": 0 + } + }, + { + "name": "test_pad_1mm", + "pos": "7.5,6.0" + }, + { + "id": "u2_rxd", + "name": "label_line_up", + "pos": "6.2,8.1", + "vars": { + "DIR": "left", + "W": 2.0, + "H": 0 + } + }, + { + "name": "test_pad_1mm", + "pos": "7.0,8.0" + }, + { + "id": "csn", + "name": "label_line_up", + "pos": "4.2,11.1", + "vars": { + "DIR": "left", + "W": 0, + "H": 0 + } + }, + { + "name": "test_pad_1mm", + "pos": "5.0,11.0" + } + ] + } +} diff --git a/boards/_base/pcb/cb2s.json b/boards/_base/pcb/cb2s.json new file mode 100644 index 000000000..67f05af18 --- /dev/null +++ b/boards/_base/pcb/cb2s.json @@ -0,0 +1,68 @@ +{ + "pcb": { + "templates": [ + "tuya2", + "pcb-blue-light", + "rf-type1" + ], + "pinout_hidden": "I2S,JTAG,FLASH", + "pinout": { + "1": { + "PWR": 3.3 + }, + "2": { + "IC": 22, + "ARD": "D0" + }, + "3": { + "GND": null + }, + "4": { + "IC": 23, + "ARD": "D1" + }, + "5": { + "IC": 26, + "ARD": "D4" + }, + "6": { + "IC": 24, + "ARD": "D2" + }, + "7": { + "IC": 27, + "ARD": "D5" + }, + "8": { + "IC": 17, + "ARD": [ + "D3", + "A0" + ] + }, + "9": { + "IC": 16, + "ARD": "D6" + }, + "10": { + "IC": 21 + }, + "11": { + "IC": 15, + "ARD": "D7" + }, + "TRX2": { + "IC": 28, + "ARD": "D9" + }, + "TTX2": { + "IC": 29, + "ARD": "D8" + }, + "TCSN": { + "IC": 19, + "ARD": "D10" + } + } + } +} diff --git a/boards/_base/pcb/cb3l.json b/boards/_base/pcb/cb3l.json new file mode 100644 index 000000000..8a4f260b1 --- /dev/null +++ b/boards/_base/pcb/cb3l.json @@ -0,0 +1,79 @@ +{ + "pcb": { + "templates": [ + "esp12s", + "pcb-white", + "tuya-16x24", + "rf-type1" + ], + "vars": { + "PINHOLE": 1 + }, + "pinout_hidden": "I2S,SD,SPI,I2C,JTAG,FLASH", + "pinout": { + "1": { + "IC": 21 + }, + "2": { + "IC": 17, + "ARD": [ + "D0", + "A0" + ] + }, + "3": { + "IC": 21 + }, + "4": { + "IC": 11, + "ARD": "D1" + }, + "5": { + "IC": 15, + "ARD": "D2" + }, + "6": { + "IC": 16, + "ARD": "D3" + }, + "7": { + "IC": 22, + "ARD": "D4" + }, + "8": { + "PWR": 3.3 + }, + "9": { + "GND": null + }, + "10": { + "IC": 25, + "ARD": "D5" + }, + "11": { + "IC": 29, + "ARD": "D6" + }, + "12": { + "IC": 19, + "ARD": "D7" + }, + "13": { + "IC": 24, + "ARD": "D8" + }, + "14": { + "IC": 23, + "ARD": "D9" + }, + "15": { + "IC": 26, + "ARD": "D10" + }, + "16": { + "IC": 27, + "ARD": "D11" + } + } + } +} diff --git a/boards/_base/pcb/cb3s.json b/boards/_base/pcb/cb3s.json new file mode 100644 index 000000000..22b4dc08e --- /dev/null +++ b/boards/_base/pcb/cb3s.json @@ -0,0 +1,104 @@ +{ + "pcb": { + "templates": [ + "esp12e-22", + "pcb-blue-light", + "tuya-16x24", + "rf-type1" + ], + "vars": { + "PINHOLE": 0 + }, + "pinout_hidden": "I2S,SD,SPI,SCL2", + "pinout": { + "1": { + "IC": 21 + }, + "2": { + "IC": 17, + "ARD": [ + "D0", + "A0" + ] + }, + "3": { + "IC": 21 + }, + "4": { + "IC": 11, + "ARD": "D1" + }, + "5": { + "IC": 15, + "ARD": "D2" + }, + "6": { + "IC": 16, + "ARD": "D3" + }, + "7": { + "IC": 22, + "ARD": "D4" + }, + "8": { + "PWR": 3.3 + }, + "9": { + "GND": null + }, + "10": { + "IC": 25, + "ARD": "D5" + }, + "11": { + "IC": 29, + "ARD": "D6" + }, + "12": { + "IC": 19, + "ARD": "D7" + }, + "13": { + "IC": 24, + "ARD": "D8" + }, + "14": { + "IC": 23, + "ARD": "D9" + }, + "15": { + "IC": 26, + "ARD": "D10" + }, + "16": { + "IC": 27, + "ARD": "D11" + }, + "17": { + "IC": 17, + "ARD": [ + "D0", + "A0" + ] + }, + "18": { + "IC": 18, + "ARD": "D12" + }, + "19": { + "IC": 19, + "ARD": "D7" + }, + "20": { + "IC": 20, + "ARD": "D13" + }, + "21": { + "NC": null + }, + "22": { + "NC": null + } + } + } +} diff --git a/boards/_base/pcb/cb3se.json b/boards/_base/pcb/cb3se.json new file mode 100644 index 000000000..fc8566fe1 --- /dev/null +++ b/boards/_base/pcb/cb3se.json @@ -0,0 +1,102 @@ +{ + "pcb": { + "templates": [ + "esp12e-22", + "pcb-blue-light", + "tuya-16x24", + "rf-type1" + ], + "vars": { + "PINHOLE": 0 + }, + "pinout_hidden": "I2S,SD,JTAG,FLASH,SCL1", + "pinout": { + "1": { + "IC": 21 + }, + "2": { + "IC": 17, + "ARD": [ + "D0", + "A0" + ] + }, + "3": { + "IC": 21 + }, + "4": { + "IC": 11, + "ARD": "D1" + }, + "5": { + "IC": 15, + "ARD": "D2" + }, + "6": { + "IC": 16, + "ARD": "D3" + }, + "7": { + "IC": 22, + "ARD": "D4" + }, + "8": { + "PWR": 3.3 + }, + "9": { + "GND": null + }, + "10": { + "IC": 25, + "ARD": "D5" + }, + "11": { + "IC": 29, + "ARD": "D6" + }, + "12": { + "IC": 28, + "ARD": "D7" + }, + "13": { + "IC": 24, + "ARD": "D8" + }, + "14": { + "IC": 23, + "ARD": "D9" + }, + "15": { + "IC": 26, + "ARD": "D10" + }, + "16": { + "IC": 27, + "ARD": "D11" + }, + "17": { + "IC": 13, + "ARD": "D12" + }, + "18": { + "IC": 18, + "ARD": "D13" + }, + "19": { + "GND": null + }, + "20": { + "IC": 20, + "ARD": "D14" + }, + "21": { + "IC": 14, + "ARD": "D15" + }, + "22": { + "IC": 12, + "ARD": "D16" + } + } + } +} diff --git a/boards/_base/pcb/cblc5-test.json b/boards/_base/pcb/cblc5-test.json new file mode 100644 index 000000000..c9ef38e3a --- /dev/null +++ b/boards/_base/pcb/cblc5-test.json @@ -0,0 +1,104 @@ +{ + "pcb": { + "test_pads": { + "TRST": "cblc5.back.rst.anchor", + "TRX1": "cblc5.back.r1.anchor", + "TTX1": "cblc5.back.t1.anchor", + "TRX2": "cblc5.back.r2.anchor", + "TTX2": "cblc5.back.t2.anchor", + "TCSN": "cblc5.back.csn.anchor" + }, + "back": [ + { + "name": "test_pad_1mm", + "pos": "1.1,1.1" + }, + { + "id": "t1", + "name": "label_line_up", + "pos": "1.1,0.6", + "vars": { + "DIR": "right", + "RASTER": 2, + "W": 3.8, + "H": 1.4 + } + }, + { + "name": "test_pad_1mm", + "pos": "0.8,3.3" + }, + { + "id": "r1", + "name": "label_line_up", + "pos": "0.8,2.8", + "vars": { + "DIR": "right", + "RASTER": 2, + "W": 4.1, + "H": 1.6 + } + }, + { + "name": "test_pad_1mm", + "pos": "2.4,4.1" + }, + { + "id": "r2", + "name": "label_line_up", + "pos": "2.4,3.6", + "vars": { + "DIR": "right", + "RASTER": 2, + "W": 2.5, + "H": 0.4 + } + }, + { + "name": "test_pad_1mm", + "pos": "3.9,4.1" + }, + { + "id": "t2", + "name": "label_line_down", + "pos": "3.9,4.6", + "vars": { + "DIR": "right", + "RASTER": 2, + "W": 1, + "H": 0.4 + } + }, + { + "name": "test_pad_1mm", + "pos": "1.2,4.9" + }, + { + "name": "test_pad_1mm", + "pos": "1.7,7.0" + }, + { + "id": "rst", + "name": "label_line_down", + "pos": "1.2,5.4", + "vars": { + "DIR": "right", + "RASTER": 2, + "W": 3.7, + "H": 1.6 + } + }, + { + "id": "csn", + "name": "label_line_down", + "pos": "1.7,7.5", + "vars": { + "DIR": "right", + "RASTER": 2, + "W": 3.2, + "H": 1.5 + } + } + ] + } +} diff --git a/boards/_base/pcb/cblc5.json b/boards/_base/pcb/cblc5.json new file mode 100644 index 000000000..dc549cef4 --- /dev/null +++ b/boards/_base/pcb/cblc5.json @@ -0,0 +1,78 @@ +{ + "pcb": { + "templates": [ + "tuyalc5", + "pcb-white" + ], + "pinout_hidden": "I2S,JTAG,FLASH,SDA1", + "pinout": { + "1": { + "CTRL": "ANT" + }, + "2": { + "GND": null + }, + "3": { + "IC": 16, + "ARD": "D0" + }, + "4": { + "IC": 15, + "ARD": "D2" + }, + "5": { + "IC": 22, + "ARD": "D1" + }, + "6": { + "PWR": 3.3 + }, + "TRST": { + "IC": 21 + }, + "TRX1": { + "IC": 26, + "ARD": "D4" + }, + "TTX1": { + "IC": 27, + "ARD": "D3" + }, + "TRX2": { + "IC": 28, + "ARD": "D5" + }, + "TTX2": { + "IC": 29, + "ARD": "D6" + }, + "TCSN": { + "IC": 19, + "ARD": "D7" + } + }, + "front": [ + { + "name": "chip", + "pos": "2.7,3.8", + "vars": { + "W": 5, + "POS": 1 + } + }, + { + "name": "osc", + "pos": "2.5,0.5" + }, + { + "type": "text", + "pos": "0.7,4.2", + "text": "${SYMBOL}", + "font_size": 1.2, + "fill": { + "color": "${SILK_COLOR}" + } + } + ] + } +} diff --git a/boards/_base/pcb/cbu-test.json b/boards/_base/pcb/cbu-test.json new file mode 100644 index 000000000..fe46880b0 --- /dev/null +++ b/boards/_base/pcb/cbu-test.json @@ -0,0 +1,30 @@ +{ + "pcb": { + "test_pads": { + "TCSN": "cbu.back.csn.anchor" + }, + "back": [ + { + "type": "rect", + "pos": "6.3,11.6", + "size": "2.9,2.9", + "preset": "copper1" + }, + { + "id": "csn", + "name": "label_line_up", + "pos": "3.7,13.5", + "vars": { + "DIR": "left", + "RASTER": 2, + "W": 0, + "H": 0 + } + }, + { + "name": "test_pad_1mm", + "pos": "4.4,13.4" + } + ] + } +} diff --git a/boards/_base/pcb/cbu.json b/boards/_base/pcb/cbu.json new file mode 100644 index 000000000..fa242937c --- /dev/null +++ b/boards/_base/pcb/cbu.json @@ -0,0 +1,100 @@ +{ + "pcb": { + "templates": [ + "tuyau", + "pcb-white", + "rf-type1" + ], + "pinout_hidden": "I2S,USB,SD,FLASH", + "pinout": { + "1": { + "IC": 11, + "ARD": "D0" + }, + "2": { + "IC": 12, + "ARD": "D1" + }, + "3": { + "IC": 20, + "ARD": "D2" + }, + "4": { + "IC": 18, + "ARD": "D3" + }, + "5": { + "IC": 17, + "ARD": [ + "D4", + "A0" + ] + }, + "6": { + "IC": 28, + "ARD": "D5" + }, + "7": { + "IC": 29, + "ARD": "D6" + }, + "8": { + "IC": 24, + "ARD": "D7" + }, + "9": { + "IC": 23, + "ARD": "D8" + }, + "10": { + "IC": 22, + "ARD": "D9" + }, + "11": { + "IC": 15, + "ARD": "D10" + }, + "12": { + "IC": 16, + "ARD": "D11" + }, + "13": { + "GND": null + }, + "14": { + "PWR": 3.3 + }, + "15": { + "IC": 27, + "ARD": "D12" + }, + "16": { + "IC": 26, + "ARD": "D13" + }, + "17": { + "IC": 10, + "ARD": "D14" + }, + "18": { + "IC": 21 + }, + "19": { + "IC": 25, + "ARD": "D15" + }, + "20": { + "IC": 14, + "ARD": "D16" + }, + "21": { + "IC": 13, + "ARD": "D17" + }, + "TCSN": { + "IC": 19, + "ARD": "D18" + } + } + } +} diff --git a/boards/_base/pcb/lsc-lma35.json b/boards/_base/pcb/lsc-lma35.json new file mode 100644 index 000000000..2879718c9 --- /dev/null +++ b/boards/_base/pcb/lsc-lma35.json @@ -0,0 +1,96 @@ +{ + "pcb": { + "templates": [ + "custom-20x24-22", + "pcb-blue-light", + "rf-type1" + ], + "pinout_hidden": "I2S,JTAG,FLASH,SD,SPI,SDA1", + "pinout": { + "1": { + "PWR": 3.3 + }, + "2": { + "IC": 15, + "ARD": "D0" + }, + "3": { + "IC": 11, + "ARD": "D1" + }, + "4": { + "IC": 12, + "ARD": "D2" + }, + "5": { + "IC": 16, + "ARD": "D3" + }, + "6": { + "GND": null + }, + "7": { + "IC": 18, + "ARD": "D4" + }, + "8": { + "IC": 29, + "ARD": "D5" + }, + "9": { + "IC": 17, + "ARD": [ + "D6", + "A0" + ] + }, + "10": { + "CTRL": "?" + }, + "11": { + "GND": null + }, + "12": { + "IC": 24, + "ARD": "D7" + }, + "13": { + "IC": 25, + "ARD": "D8" + }, + "14": { + "GND": null + }, + "15": { + "IC": 19, + "ARD": "D9" + }, + "16": { + "IC": 22, + "ARD": "D10" + }, + "17": { + "IC": 23, + "ARD": "D11" + }, + "18": { + "IC": 26, + "ARD": "D12" + }, + "19": { + "GND": null + }, + "20": { + "IC": 27, + "ARD": "D13" + }, + "21": { + "CTRL": "?" + }, + "22": { + "IC": 28, + "ARD": "D14" + } + } + } +} diff --git a/boards/_base/pcb/t102.json b/boards/_base/pcb/t102.json new file mode 100644 index 000000000..58a86ac85 --- /dev/null +++ b/boards/_base/pcb/t102.json @@ -0,0 +1,56 @@ +{ + "pcb": { + "templates": [ + "tuya2", + "pcb-black", + "rf-type1" + ], + "scale": 10.5, + "pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD", + "drawing_hidden": "SPI", + "pinout": { + "1": { + "PWR": 3.3 + }, + "2": { + "IC": 17, + "ARD": "D0" + }, + "3": { + "GND": null + }, + "4": { + "IC": 16, + "ARD": "D1" + }, + "5": { + "IC": 29, + "ARD": "D5" + }, + "6": { + "IC": 28, + "ARD": "D2" + }, + "7": { + "IC": 32, + "ARD": "D6" + }, + "8": { + "IC": 1, + "ARD": "D3" + }, + "9": { + "IC": 13, + "ARD": "D7" + }, + "10": { + "IC": 2, + "ARD": "D4" + }, + "11": { + "IC": 14, + "ARD": "D8" + } + } + } +} diff --git a/boards/_base/pcb/t103.json b/boards/_base/pcb/t103.json new file mode 100644 index 000000000..5657b52f6 --- /dev/null +++ b/boards/_base/pcb/t103.json @@ -0,0 +1,79 @@ +{ + "pcb": { + "templates": [ + "esp12s", + "pcb-white", + "tuya-16x24", + "rf-type1" + ], + "vars": { + "PINHOLE": 1 + }, + "pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD", + "pinout": { + "1": { + "NC": null + }, + "2": { + "IC": 27, + "ARD": "A1" + }, + "3": { + "IC": 12 + }, + "4": { + "IC": 30, + "ARD": [ + "D0", + "A0" + ] + }, + "5": { + "IC": 13, + "ARD": "D1" + }, + "6": { + "IC": 14, + "ARD": "D2" + }, + "7": { + "IC": 16, + "ARD": "D3" + }, + "8": { + "PWR": 3.3 + }, + "9": { + "GND": null + }, + "10": { + "IC": 31, + "ARD": "D4" + }, + "11": { + "IC": 2, + "ARD": "D5" + }, + "12": { + "IC": 1, + "ARD": "D6" + }, + "13": { + "IC": 28, + "ARD": "D7" + }, + "14": { + "IC": 17, + "ARD": "D8" + }, + "15": { + "IC": 29, + "ARD": "D9" + }, + "16": { + "IC": 32, + "ARD": "D10" + } + } + } +} diff --git a/boards/_base/pcb/t112.json b/boards/_base/pcb/t112.json new file mode 100644 index 000000000..0bcb3a1ba --- /dev/null +++ b/boards/_base/pcb/t112.json @@ -0,0 +1,70 @@ +{ + "pcb": { + "templates": [ + "esp01m-14", + "pcb-blue-light", + "rf-type1" + ], + "scale": 10.5, + "pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD", + "drawing_hidden": "I2C,SPI", + "pinout": { + "1": { + "PWR": 3.3 + }, + "2": { + "IC": 2, + "ARD": "D0" + }, + "3": { + "IC": 30, + "ARD": [ + "D1", + "A0" + ] + }, + "4": { + "IC": 14, + "ARD": "D2" + }, + "5": { + "IC": 13, + "ARD": "D3" + }, + "6": { + "IC": 16, + "ARD": "D4" + }, + "7": { + "NC": null + }, + "8": { + "IC": 28, + "ARD": "D5" + }, + "9": { + "IC": 29, + "ARD": "D6" + }, + "10": { + "IC": 17, + "ARD": "D7" + }, + "11": { + "IC": 32, + "ARD": "D8" + }, + "12": { + "IC": 31, + "ARD": "D9" + }, + "13": { + "IC": 1, + "ARD": "D10" + }, + "14": { + "GND": null + } + } + } +} diff --git a/boards/_base/pcb/wa2-test.json b/boards/_base/pcb/wa2-test.json new file mode 100644 index 000000000..661498a23 --- /dev/null +++ b/boards/_base/pcb/wa2-test.json @@ -0,0 +1,143 @@ +{ + "pcb": { + "test_pads": { + "TTEST": "wa2.back.test.anchor", + "TTX2": "wa2.back.2tx.anchor", + "TGND": "wa2.back.gnd.anchor", + "TSCK": "wa2.back.sck.anchor", + "TCSN": "wa2.back.csn.anchor", + "TSI": "wa2.back.si.anchor", + "TSO": "wa2.back.so.anchor", + "TP4": "wa2.back.p4.anchor", + "TVCC": "wa2.back.vbat.anchor" + }, + "back": [ + { + "name": "test_pad_1mm", + "pos": "2.6,6.2" + }, + { + "id": "sck", + "name": "label_line_up", + "pos": "2.6,5.4", + "vars": { + "DIR": "left", + "W": 1.3, + "H": 2 + } + }, + { + "name": "test_pad_1mm", + "pos": "4.6,6.2" + }, + { + "id": "so", + "name": "label_line_up", + "pos": "4.6,5.4", + "vars": { + "DIR": "left", + "W": 3.3, + "H": 4 + } + }, + { + "name": "test_pad_1mm", + "pos": "7.0,6.2" + }, + { + "id": "p4", + "name": "label_line_up", + "pos": "7.0,5.4", + "vars": { + "DIR": "right", + "W": 0, + "H": 4 + } + }, + { + "name": "test_pad_1mm", + "pos": "3.0,8.3" + }, + { + "id": "csn", + "name": "label_line_up", + "pos": "2.2,8.4", + "vars": { + "DIR": "left", + "W": 0.9, + "H": 0 + } + }, + { + "name": "test_pad_1mm", + "pos": "5.2,8.8" + }, + { + "id": "si", + "name": "label_line_up", + "pos": "6.0,8.9", + "vars": { + "DIR": "right", + "W": 1, + "H": 0 + } + }, + { + "name": "test_pad_1mm", + "pos": "2.1,11.6" + }, + { + "id": "2tx", + "name": "label_line_up", + "pos": "1.3,11.7", + "vars": { + "DIR": "left", + "W": 0, + "H": 0 + } + }, + { + "name": "test_pad_1mm", + "pos": "4.3,11.6" + }, + { + "id": "test", + "name": "label_line_up", + "pos": "5.1,11.7", + "vars": { + "DIR": "right", + "W": 1.9, + "H": 0 + } + }, + { + "name": "test_pad_1mm", + "pos": "2.5,14.5" + }, + { + "id": "vbat", + "name": "label_line_up", + "pos": "1.7,14.6", + "vars": { + "DIR": "left", + "W": 0.4, + "H": 0 + } + }, + { + "name": "test_pad_1mm", + "pos": "4.8,14.5" + }, + { + "id": "gnd", + "name": "label_line_up", + "pos": "5.6,14.6", + "vars": { + "DIR": "right", + "W": 1.4, + "H": 0 + } + } + ] + } +} diff --git a/boards/_base/pcb/wa2.json b/boards/_base/pcb/wa2.json new file mode 100644 index 000000000..55e1fe7d5 --- /dev/null +++ b/boards/_base/pcb/wa2.json @@ -0,0 +1,93 @@ +{ + "pcb": { + "scale": 11, + "templates": [ + "tuya2", + "pcb-blue-light", + "rf-type1" + ], + "pinout_hidden": "I2S,SD", + "pinout": { + "1": { + "PWR": 3.3 + }, + "2": { + "IC": 16, + "ARD": "D0" + }, + "3": { + "GND": null + }, + "4": { + "IC": 15, + "ARD": "D1" + }, + "5": { + "IC": 25, + "ARD": "D4" + }, + "6": { + "IC": 14, + "ARD": "D2" + }, + "7": { + "IC": 26, + "ARD": "D5" + }, + "8": { + "IC": 32, + "ARD": [ + "D3", + "A0" + ] + }, + "9": { + "IC": 22, + "ARD": "D6" + }, + "10": { + "IC": 37 + }, + "11": { + "IC": 21, + "ARD": "D7" + }, + "TSCK": { + "IC": 29, + "ARD": "D8" + }, + "TP4": { + "IC": 35, + "ARD": "D9" + }, + "TTEST": { + "IC": 23 + }, + "TTX2": { + "IC": 28, + "ARD": "D10" + }, + "TCSN": { + "IC": 30, + "ARD": "D11" + }, + "TSI": { + "IC": 31, + "ARD": "D12" + }, + "TSO": { + "IC": 32, + "ARD": [ + "D3", + "A0" + ] + }, + "TVCC": { + "PWR": 3.3 + }, + "TGND": { + "GND": null + } + } + } +} diff --git a/boards/_base/pcb/wb1s.json b/boards/_base/pcb/wb1s.json new file mode 100644 index 000000000..8560723f7 --- /dev/null +++ b/boards/_base/pcb/wb1s.json @@ -0,0 +1,99 @@ +{ + "pcb": { + "templates": [ + "tuya1", + "tuya1s", + "pcb-blue-light", + "tuya-16x24", + "rf-type1" + ], + "scale": 15, + "pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD", + "pinout": { + "1": { + "PWR": "VCC5" + }, + "2": { + "IC": 27, + "ARD": "D0" + }, + "3": { + "IC": 26, + "ARD": "D1" + }, + "4": { + "PWR": 3.3 + }, + "5": { + "GND": null + }, + "6": { + "IC": 15, + "ARD": "D2" + }, + "7": { + "IC": 16, + "ARD": "D3" + }, + "8": { + "IC": 29, + "ARD": "D4" + }, + "9": { + "IC": 24, + "ARD": "D5" + }, + "10": { + "IC": 23, + "ARD": "D6" + }, + "11": { + "IC": 28, + "ARD": "D7" + }, + "12": { + "IC": 25, + "ARD": "D8" + }, + "13": { + "IC": 22, + "ARD": "D9" + }, + "14": { + "GND": null + }, + "15": { + "GND": null + }, + "16": { + "IC": 21 + }, + "17": { + "IC": 17, + "ARD": [ + "D10", + "A0" + ] + }, + "18": { + "GND": null + }, + "19": { + "IC": 17, + "ARD": [ + "D10", + "A0" + ] + }, + "20": { + "IC": 18 + }, + "21": { + "IC": 19 + }, + "22": { + "IC": 20 + } + } + } +} diff --git a/boards/_base/pcb/wb2l-m1-test.json b/boards/_base/pcb/wb2l-m1-test.json new file mode 100644 index 000000000..b56840c6a --- /dev/null +++ b/boards/_base/pcb/wb2l-m1-test.json @@ -0,0 +1,16 @@ +{ + "pcb": { + "test_pads": { + "TRST": "wb2l-m1.back.rst.anchor", + "TRX1": "wb2l-m1.back.u1_rxd.anchor", + "TTX1": "wb2l-m1.back.u1_txd.anchor", + "TRX2": "wb2l-m1.back.u2_rxd.anchor", + "TTX2": "wb2l-m1.back.u2_txd.anchor", + "TGND": "wb2l-m1.back.gnd.anchor", + "TSCK": "wb2l-m1.back.f_sck.anchor", + "TCSN": "wb2l-m1.back.f_csn.anchor", + "TSI": "wb2l-m1.back.f_si.anchor", + "TSO": "wb2l-m1.back.f_so.anchor" + } + } +} diff --git a/boards/_base/pcb/wb2l-test.json b/boards/_base/pcb/wb2l-test.json new file mode 100644 index 000000000..265cc9539 --- /dev/null +++ b/boards/_base/pcb/wb2l-test.json @@ -0,0 +1,165 @@ +{ + "pcb": { + "test_pads": { + "TRST": "wb2l.back.rst.anchor", + "TRX1": "wb2l.back.u1_rxd.anchor", + "TTX1": "wb2l.back.u1_txd.anchor", + "TRX2": "wb2l.back.u2_rxd.anchor", + "TTX2": "wb2l.back.u2_txd.anchor", + "TGND": "wb2l.back.gnd.anchor", + "TSCK": "wb2l.back.f_sck.anchor", + "TCSN": "wb2l.back.f_csn.anchor", + "TSI": "wb2l.back.f_si.anchor", + "TSO": "wb2l.back.f_so.anchor" + }, + "back": [ + { + "name": "test_pad_1mm", + "pos": "1.5,7.5" + }, + { + "name": "label_line_down", + "pos": "0.4,4.7", + "vars": { + "DIR": "right", + "W": 0.2, + "H": 2.7 + } + }, + { + "id": "rst.anchor", + "type": "rect", + "pos": "0.9,5.0", + "size": "0,0", + "label_dir": "left", + "label_size": 2 + }, + { + "name": "test_pad_1mm", + "pos": "2.2,5.9" + }, + { + "id": "u1_rxd", + "name": "label_line_up", + "pos": "2.2,5.1", + "vars": { + "DIR": "left", + "W": 1.5, + "H": 2 + } + }, + { + "name": "test_pad_1mm", + "pos": "4.0,5.9" + }, + { + "id": "u1_txd", + "name": "label_line_up", + "pos": "4.0,5.1", + "vars": { + "DIR": "left", + "W": 3.3, + "H": 4 + } + }, + { + "name": "test_pad_1mm", + "pos": "5.7,5.9" + }, + { + "id": "u2_rxd", + "name": "label_line_up", + "pos": "5.7,5.1", + "vars": { + "DIR": "left", + "W": 5.0, + "H": 6 + } + }, + { + "name": "test_pad_1mm", + "pos": "7.3,5.9" + }, + { + "id": "u2_txd", + "name": "label_line_up", + "pos": "7.3,5.1", + "vars": { + "DIR": "left", + "W": 6.6, + "H": 8 + } + }, + { + "name": "test_pad_1mm", + "pos": "9.2,5.9" + }, + { + "id": "gnd", + "name": "label_line_up", + "pos": "9.2,5.1", + "vars": { + "DIR": "left", + "W": 8.5, + "H": 10 + } + }, + { + "name": "test_pad_1mm", + "pos": "2.2,10.7" + }, + { + "id": "f_sck", + "name": "label_line_up", + "pos": "2.2,9.9", + "vars": { + "DIR": "left", + "W": 1.5, + "H": 1.0 + } + }, + { + "name": "test_pad_1mm", + "pos": "2.2,12.0" + }, + { + "id": "f_csn", + "name": "label_line_down", + "pos": "2.2,12.8", + "vars": { + "DIR": "left", + "W": 1.5, + "H": 1.0 + } + }, + { + "name": "test_pad_1mm", + "pos": "3.5,13.5" + }, + { + "id": "f_so", + "name": "label_line_down", + "pos": "3.5,14.3", + "vars": { + "DIR": "left", + "W": 2.8, + "H": 1.5 + } + }, + { + "name": "test_pad_1mm", + "pos": "5.2,13.5" + }, + { + "id": "f_si", + "name": "label_line_down", + "pos": "5.2,14.3", + "vars": { + "DIR": "left", + "W": 4.5, + "H": 3.5 + } + } + ] + } +} diff --git a/boards/_base/pcb/wb2l.json b/boards/_base/pcb/wb2l.json new file mode 100644 index 000000000..9e234d2bb --- /dev/null +++ b/boards/_base/pcb/wb2l.json @@ -0,0 +1,79 @@ +{ + "pcb": { + "templates": [ + "tuya2l", + "pcb-white", + "rf-type1" + ], + "pinout_hidden": "I2S", + "pinout": { + "1": { + "IC": 24, + "ARD": "D0" + }, + "2": { + "IC": 23, + "ARD": "D1" + }, + "3": { + "IC": 22, + "ARD": "D2" + }, + "4": { + "IC": 15, + "ARD": "D3" + }, + "5": { + "IC": 16, + "ARD": "D4" + }, + "6": { + "GND": null + }, + "7": { + "PWR": 3.3 + }, + "TGND": { + "GND": null + }, + "TRST": { + "IC": 21 + }, + "TRX1": { + "IC": 26, + "ARD": "D5" + }, + "TTX1": { + "IC": 27, + "ARD": "D6" + }, + "TRX2": { + "IC": 28, + "ARD": "D7" + }, + "TTX2": { + "IC": 29, + "ARD": "D8" + }, + "TSCK": { + "IC": 20, + "ARD": "D9" + }, + "TCSN": { + "IC": 19, + "ARD": "D10" + }, + "TSO": { + "IC": 17, + "ARD": [ + "D11", + "A0" + ] + }, + "TSI": { + "IC": 18, + "ARD": "D12" + } + } + } +} diff --git a/boards/_base/pcb/wb2s-test.json b/boards/_base/pcb/wb2s-test.json new file mode 100644 index 000000000..81f279011 --- /dev/null +++ b/boards/_base/pcb/wb2s-test.json @@ -0,0 +1,158 @@ +{ + "pcb": { + "test_pads": { + "TRST": "wb2s.back.cen.anchor", + "TRX2": "wb2s.back.2rx.anchor", + "TTX2": "wb2s.back.2tx.anchor", + "TGND": "wb2s.back.gnd.anchor", + "TSCK": "wb2s.back.sck.anchor", + "TCSN": "wb2s.back.csn.anchor", + "TSI": "wb2s.back.si.anchor", + "TSO": "wb2s.back.adc_so.anchor", + "TPWM3": "wb2s.back.pwm3.anchor", + "TVCC": "wb2s.back.vbat.anchor" + }, + "back": [ + { + "name": "test_pad_1mm", + "pos": "2.6,6.2" + }, + { + "id": "sck", + "name": "label_line_up", + "pos": "2.6,5.4", + "vars": { + "DIR": "left", + "W": 1.3, + "H": 2 + } + }, + { + "name": "test_pad_1mm", + "pos": "4.6,6.2" + }, + { + "id": "pwm3", + "name": "label_line_up", + "pos": "4.6,5.4", + "vars": { + "DIR": "left", + "W": 3.3, + "H": 4 + } + }, + { + "name": "test_pad_1mm", + "pos": "7.0,6.2" + }, + { + "id": "2rx", + "name": "label_line_up", + "pos": "7.0,5.4", + "vars": { + "DIR": "right", + "W": 2, + "H": 4 + } + }, + { + "name": "test_pad_1mm", + "pos": "9.0,6.2" + }, + { + "id": "2tx", + "name": "label_line_up", + "pos": "9.0,5.4", + "vars": { + "DIR": "right", + "W": 0, + "H": 2 + } + }, + { + "name": "test_pad_1mm", + "pos": "3.0,8.3" + }, + { + "id": "csn", + "name": "label_line_up", + "pos": "2.2,8.4", + "vars": { + "DIR": "left", + "W": 0.9, + "H": 0 + } + }, + { + "name": "test_pad_1mm", + "pos": "5.2,8.8" + }, + { + "id": "si", + "name": "label_line_up", + "pos": "6.0,8.9", + "vars": { + "DIR": "right", + "W": 3, + "H": 0 + } + }, + { + "name": "test_pad_1mm", + "pos": "2.1,11.6" + }, + { + "id": "adc_so", + "name": "label_line_up", + "pos": "1.3,11.7", + "vars": { + "DIR": "left", + "W": 0, + "H": 0 + } + }, + { + "name": "test_pad_1mm", + "pos": "4.3,11.6" + }, + { + "id": "cen", + "name": "label_line_up", + "pos": "5.1,11.7", + "vars": { + "DIR": "right", + "W": 3.9, + "H": 0 + } + }, + { + "name": "test_pad_1mm", + "pos": "2.5,14.5" + }, + { + "id": "vbat", + "name": "label_line_up", + "pos": "1.7,14.6", + "vars": { + "DIR": "left", + "W": 0.4, + "H": 0 + } + }, + { + "name": "test_pad_1mm", + "pos": "4.8,14.5" + }, + { + "id": "gnd", + "name": "label_line_up", + "pos": "5.6,14.6", + "vars": { + "DIR": "right", + "W": 3.4, + "H": 0 + } + } + ] + } +} diff --git a/boards/_base/pcb/wb2s.json b/boards/_base/pcb/wb2s.json new file mode 100644 index 000000000..a47d327a8 --- /dev/null +++ b/boards/_base/pcb/wb2s.json @@ -0,0 +1,96 @@ +{ + "pcb": { + "templates": [ + "tuya2", + "pcb-blue-light", + "rf-type1" + ], + "pinout_hidden": "I2S,FLASH", + "pinout": { + "1": { + "PWR": 3.3 + }, + "2": { + "IC": 24, + "ARD": "D0" + }, + "3": { + "GND": null + }, + "4": { + "IC": 23, + "ARD": "D1" + }, + "5": { + "IC": 26, + "ARD": "D4" + }, + "6": { + "IC": 22, + "ARD": "D2" + }, + "7": { + "IC": 27, + "ARD": "D5" + }, + "8": { + "IC": 17, + "ARD": [ + "D3", + "A0" + ] + }, + "9": { + "IC": 16, + "ARD": "D6" + }, + "10": { + "IC": 21 + }, + "11": { + "IC": 15, + "ARD": "D7" + }, + "TSCK": { + "IC": 20, + "ARD": "D8" + }, + "TPWM3": { + "IC": 25, + "ARD": "D9" + }, + "TRX2": { + "IC": 28, + "ARD": "D10" + }, + "TTX2": { + "IC": 29, + "ARD": "D11" + }, + "TCSN": { + "IC": 19, + "ARD": "D12" + }, + "TSI": { + "IC": 18, + "ARD": "D13" + }, + "TSO": { + "IC": 17, + "ARD": [ + "D3", + "A0" + ] + }, + "TRST": { + "CTRL": "^RST" + }, + "TVCC": { + "PWR": 3.3 + }, + "TGND": { + "GND": null + } + } + } +} diff --git a/boards/_base/pcb/wb3l.json b/boards/_base/pcb/wb3l.json new file mode 100644 index 000000000..75247f5a0 --- /dev/null +++ b/boards/_base/pcb/wb3l.json @@ -0,0 +1,102 @@ +{ + "pcb": { + "templates": [ + "esp12e-21", + "pcb-white", + "tuya-16x24", + "rf-type1" + ], + "vars": { + "PINHOLE": 0 + }, + "pinout_hidden": "I2S,SD", + "pinout": { + "1": { + "NC": null + }, + "2": { + "IC": 17, + "ARD": [ + "D0", + "A0" + ] + }, + "3": { + "IC": 21 + }, + "4": { + "IC": 11, + "ARD": "D1" + }, + "5": { + "IC": 15, + "ARD": "D2" + }, + "6": { + "IC": 16, + "ARD": "D3" + }, + "7": { + "IC": 22, + "ARD": "D4" + }, + "8": { + "PWR": 3.3 + }, + "9": { + "GND": null + }, + "10": { + "IC": 25, + "ARD": "D5" + }, + "11": { + "IC": 29, + "ARD": "D6" + }, + "12": { + "IC": 12, + "ARD": "D7" + }, + "13": { + "IC": 24, + "ARD": "D8" + }, + "14": { + "IC": 23, + "ARD": "D9" + }, + "15": { + "IC": 26, + "ARD": "D10" + }, + "16": { + "IC": 27, + "ARD": "D11" + }, + "17": { + "IC": 17, + "ARD": [ + "D0", + "A0" + ] + }, + "18": { + "IC": 18, + "ARD": "D12" + }, + "19": { + "IC": 19, + "ARD": "D13" + }, + "20": { + "IC": 20, + "ARD": "D14" + }, + "21": { + "IC": 28, + "ARD": "D15" + } + } + } +} diff --git a/boards/_base/pcb/wb3s.json b/boards/_base/pcb/wb3s.json new file mode 100644 index 000000000..9896ad4cc --- /dev/null +++ b/boards/_base/pcb/wb3s.json @@ -0,0 +1,104 @@ +{ + "pcb": { + "templates": [ + "esp12e-22", + "pcb-blue-light", + "tuya-16x24", + "rf-type1" + ], + "vars": { + "PINHOLE": 0 + }, + "pinout_hidden": "I2S,SD,SPI", + "pinout": { + "1": { + "IC": 21 + }, + "2": { + "IC": 17, + "ARD": [ + "D0", + "A0" + ] + }, + "3": { + "NC": null + }, + "4": { + "IC": 11, + "ARD": "D1" + }, + "5": { + "IC": 15, + "ARD": "D2" + }, + "6": { + "IC": 16, + "ARD": "D3" + }, + "7": { + "IC": 22, + "ARD": "D4" + }, + "8": { + "PWR": 3.3 + }, + "9": { + "GND": null + }, + "10": { + "IC": 23, + "ARD": "D5" + }, + "11": { + "IC": 29, + "ARD": "D6" + }, + "12": { + "IC": 28, + "ARD": "D7" + }, + "13": { + "IC": 25, + "ARD": "D8" + }, + "14": { + "IC": 24, + "ARD": "D9" + }, + "15": { + "IC": 26, + "ARD": "D10" + }, + "16": { + "IC": 27, + "ARD": "D11" + }, + "17": { + "IC": 17, + "ARD": [ + "D0", + "A0" + ] + }, + "18": { + "IC": 18, + "ARD": "D12" + }, + "19": { + "IC": 19, + "ARD": "D13" + }, + "20": { + "IC": 20, + "ARD": "D14" + }, + "21": { + "NC": null + }, + "22": { + "NC": null + } + } + } +} diff --git a/boards/_base/pcb/wblc5-test.json b/boards/_base/pcb/wblc5-test.json new file mode 100644 index 000000000..f956c8431 --- /dev/null +++ b/boards/_base/pcb/wblc5-test.json @@ -0,0 +1,152 @@ +{ + "pcb": { + "test_pads": { + "TRST": "wblc5.back.cen.anchor", + "TRX1": "wblc5.back.r1.anchor", + "TTX1": "wblc5.back.t1.anchor", + "TRX2": "wblc5.back.r2.anchor", + "TTX2": "wblc5.back.t2.anchor", + "TSCK": "wblc5.back.tck.anchor", + "TCSN": "wblc5.back.tms.anchor", + "TSI": "wblc5.back.tdi.anchor", + "TSO": "wblc5.back.tdo.anchor" + }, + "back": [ + { + "name": "test_pad_1mm", + "pos": "0.7,1.1" + }, + { + "id": "r1", + "name": "label_line_up", + "pos": "0.7,0.6", + "vars": { + "DIR": "right", + "RASTER": 2, + "W": 7.2, + "H": 5.1 + } + }, + { + "name": "test_pad_1mm", + "pos": "1.9,0.9" + }, + { + "id": "t1", + "name": "label_line_up", + "pos": "1.9,0.4", + "vars": { + "DIR": "right", + "RASTER": 2, + "W": 5.9, + "H": 2.9 + } + }, + { + "name": "test_pad_1mm", + "pos": "7.8,0.8" + }, + { + "id": "r2", + "name": "label_line_up", + "pos": "7.8,0.3", + "vars": { + "DIR": "right", + "RASTER": 2, + "W": 0, + "H": 0.8 + } + }, + { + "name": "test_pad_1mm", + "pos": "7.8,2.4" + }, + { + "id": "t2", + "name": "label_line_up", + "pos": "7.8,1.9", + "vars": { + "DIR": "right", + "RASTER": 2, + "W": 0, + "H": 0.4 + } + }, + { + "name": "test_pad_1mm", + "pos": "1.3,4.2" + }, + { + "id": "cen", + "name": "label_line_up", + "pos": "2.1,4.3", + "vars": { + "DIR": "right", + "RASTER": 2, + "W": 5.7, + "H": 0 + } + }, + { + "name": "test_pad_1mm", + "pos": "1.6,5.3" + }, + { + "name": "test_pad_1mm", + "pos": "1.3,6.3" + }, + { + "name": "test_pad_1mm", + "pos": "4.5,7.6" + }, + { + "name": "test_pad_1mm", + "pos": "3.8,8.7" + }, + { + "id": "tck", + "name": "label_line_down", + "pos": "1.6,5.8", + "vars": { + "DIR": "right", + "RASTER": 2, + "W": 6.2, + "H": 0.3 + } + }, + { + "id": "tms", + "name": "label_line_down", + "pos": "1.3,6.8", + "vars": { + "DIR": "right", + "RASTER": 2, + "W": 6.5, + "H": 1.3 + } + }, + { + "id": "tdi", + "name": "label_line_down", + "pos": "4.5,8.1", + "vars": { + "DIR": "right", + "RASTER": 2, + "W": 3.3, + "H": 2.0 + } + }, + { + "id": "tdo", + "name": "label_line_down", + "pos": "3.8,9.2", + "vars": { + "DIR": "right", + "RASTER": 2, + "W": 4, + "H": 2.9 + } + } + ] + } +} diff --git a/boards/_base/pcb/wblc5.json b/boards/_base/pcb/wblc5.json new file mode 100644 index 000000000..85112f0fc --- /dev/null +++ b/boards/_base/pcb/wblc5.json @@ -0,0 +1,95 @@ +{ + "pcb": { + "templates": [ + "tuyalc5", + "pcb-white" + ], + "pinout_hidden": "I2S", + "pinout": { + "1": { + "CTRL": "ANT" + }, + "2": { + "GND": null + }, + "3": { + "IC": 16, + "ARD": "D0" + }, + "4": { + "IC": 15, + "ARD": "D2" + }, + "5": { + "IC": 22, + "ARD": "D1" + }, + "6": { + "PWR": 3.3 + }, + "TRST": { + "IC": 21 + }, + "TRX1": { + "IC": 26, + "ARD": "D3" + }, + "TTX1": { + "IC": 27, + "ARD": "D4" + }, + "TRX2": { + "IC": 28, + "ARD": "D5" + }, + "TTX2": { + "IC": 29, + "ARD": "D6" + }, + "TSCK": { + "IC": 20, + "ARD": "D7" + }, + "TCSN": { + "IC": 19, + "ARD": "D8" + }, + "TSO": { + "IC": 17, + "ARD": [ + "D10", + "A0" + ] + }, + "TSI": { + "IC": 18, + "ARD": "D9" + } + }, + "front": [ + { + "name": "chip", + "pos": "2.3,3.5", + "vars": { + "W": 5, + "POS": 1 + } + }, + { + "type": "text", + "pos": "3.5,2.2", + "text": "${SYMBOL}", + "font_size": 1.2, + "fill": { + "color": "${SILK_COLOR}" + } + } + ], + "back": [ + { + "name": "osc", + "pos": "2.6,1.3" + } + ] + } +} diff --git a/boards/_base/pcb/wr1.json b/boards/_base/pcb/wr1.json new file mode 100644 index 000000000..986c86f9c --- /dev/null +++ b/boards/_base/pcb/wr1.json @@ -0,0 +1,82 @@ +{ + "pcb": { + "templates": [ + "tuya1", + "pcb-black", + "tuya-16x24", + "rf-type1" + ], + "scale": 15, + "pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD", + "pinout": { + "1": { + "PWR": "VCC5" + }, + "2": { + "IC": 32, + "ARD": "D0" + }, + "3": { + "IC": 29, + "ARD": "D1" + }, + "4": { + "PWR": 3.3 + }, + "5": { + "GND": null + }, + "6": { + "IC": 13, + "ARD": "D2" + }, + "7": { + "IC": 14, + "ARD": "D3" + }, + "8": { + "IC": 1, + "ARD": "D4" + }, + "9": { + "IC": 16, + "ARD": "D5" + }, + "10": { + "IC": 28, + "ARD": "D6" + }, + "11": { + "IC": 2, + "ARD": "D7" + }, + "12": { + "IC": 30, + "ARD": [ + "D8", + "A0" + ] + }, + "13": { + "IC": 31, + "ARD": "D9" + }, + "14": { + "GND": null + }, + "15": { + "GND": null + }, + "16": { + "IC": 12 + }, + "17": { + "IC": 27, + "ARD": "A1" + }, + "18": { + "GND": null + } + } + } +} diff --git a/boards/_base/pcb/wr1e.json b/boards/_base/pcb/wr1e.json new file mode 100644 index 000000000..e56d66e2f --- /dev/null +++ b/boards/_base/pcb/wr1e.json @@ -0,0 +1,82 @@ +{ + "pcb": { + "templates": [ + "tuya1", + "pcb-blue-light", + "tuya-16x24", + "rf-type1" + ], + "scale": 15, + "pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD", + "pinout": { + "1": { + "PWR": "VCC5" + }, + "2": { + "IC": 32, + "ARD": "D0" + }, + "3": { + "IC": 29, + "ARD": "D1" + }, + "4": { + "PWR": 3.3 + }, + "5": { + "GND": null + }, + "6": { + "IC": 13, + "ARD": "D2" + }, + "7": { + "IC": 14, + "ARD": "D3" + }, + "8": { + "IC": 1, + "ARD": "D4" + }, + "9": { + "IC": 17, + "ARD": "D5" + }, + "10": { + "IC": 28, + "ARD": "D6" + }, + "11": { + "IC": 2, + "ARD": "D7" + }, + "12": { + "IC": 30, + "ARD": [ + "D8", + "A0" + ] + }, + "13": { + "IC": 31, + "ARD": "D9" + }, + "14": { + "GND": null + }, + "15": { + "GND": null + }, + "16": { + "IC": 12 + }, + "17": { + "IC": 27, + "ARD": "A1" + }, + "18": { + "GND": null + } + } + } +} diff --git a/boards/_base/pcb/wr2-base.json b/boards/_base/pcb/wr2-base.json new file mode 100644 index 000000000..19978447e --- /dev/null +++ b/boards/_base/pcb/wr2-base.json @@ -0,0 +1,9 @@ +{ + "pcb": { + "templates": [ + "tuya2", + "pcb-blue-light", + "rf-type1" + ] + } +} diff --git a/boards/_base/pcb/wr2-test.json b/boards/_base/pcb/wr2-test.json new file mode 100644 index 000000000..2174f1602 --- /dev/null +++ b/boards/_base/pcb/wr2-test.json @@ -0,0 +1,44 @@ +{ + "pcb": { + "back": [ + { + "comment": "RXD Pad", + "name": "test_pad_1mm", + "pos": "5.4,14.5" + }, + { + "comment": "TXD Pad", + "name": "test_pad_1mm", + "pos": "5.4,13.2" + }, + { + "comment": "RXD Pad label", + "id": "rxd", + "name": "label_line_up", + "pos": "4.6,14.6", + "vars": { + "DIR": "left", + "RASTER": 2, + "W": 2.1, + "H": 0 + } + }, + { + "comment": "TXD Pad label", + "id": "txd", + "name": "label_line_up", + "pos": "5.4,12.4", + "vars": { + "DIR": "left", + "RASTER": 2, + "W": 2.7, + "H": 0.5 + } + } + ], + "test_pads": { + "TRX2": "wr2.back.rxd.anchor", + "TTX2": "wr2.back.txd.anchor" + } + } +} diff --git a/boards/_base/pcb/wr2.json b/boards/_base/pcb/wr2.json new file mode 100644 index 000000000..2988706eb --- /dev/null +++ b/boards/_base/pcb/wr2.json @@ -0,0 +1,57 @@ +{ + "pcb": { + "pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD", + "drawing_hidden": "SPI", + "pinout": { + "1": { + "PWR": 3.3 + }, + "2": { + "IC": 17, + "ARD": "D0" + }, + "3": { + "GND": null + }, + "4": { + "IC": 16, + "ARD": "D1" + }, + "5": { + "IC": 29, + "ARD": "D4" + }, + "6": { + "IC": 28, + "ARD": "D2" + }, + "7": { + "IC": 32, + "ARD": "D5" + }, + "8": { + "IC": 27, + "ARD": "A1" + }, + "9": { + "IC": 13, + "ARD": "D6" + }, + "10": { + "IC": 12 + }, + "11": { + "IC": 14, + "ARD": "D7" + }, + "TTX2": { + "IC": 1, + "ARD": "D8" + }, + "TRX2": { + "IC": 2, + "ARD": "D9" + } + } + } +} diff --git a/boards/_base/pcb/wr2e-test.json b/boards/_base/pcb/wr2e-test.json new file mode 100644 index 000000000..e956b2225 --- /dev/null +++ b/boards/_base/pcb/wr2e-test.json @@ -0,0 +1,44 @@ +{ + "pcb": { + "back": [ + { + "comment": "RXD Pad", + "name": "test_pad_1mm", + "pos": "5.4,14.5" + }, + { + "comment": "TXD Pad", + "name": "test_pad_1mm", + "pos": "5.4,13.2" + }, + { + "comment": "RXD Pad label", + "id": "rxd", + "name": "label_line_up", + "pos": "4.6,14.6", + "vars": { + "DIR": "left", + "RASTER": 2, + "W": 2.1, + "H": 0 + } + }, + { + "comment": "TXD Pad label", + "id": "txd", + "name": "label_line_up", + "pos": "5.4,12.4", + "vars": { + "DIR": "left", + "RASTER": 2, + "W": 2.7, + "H": 0.5 + } + } + ], + "test_pads": { + "TRX2": "wr2e.back.rxd.anchor", + "TTX2": "wr2e.back.txd.anchor" + } + } +} diff --git a/boards/_base/pcb/wr2e.json b/boards/_base/pcb/wr2e.json new file mode 100644 index 000000000..91316d5a7 --- /dev/null +++ b/boards/_base/pcb/wr2e.json @@ -0,0 +1,60 @@ +{ + "pcb": { + "pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD,SDA0", + "drawing_hidden": "SPI", + "pinout": { + "1": { + "PWR": 3.3 + }, + "2": { + "IC": 17, + "ARD": "D0" + }, + "3": { + "GND": null + }, + "4": { + "IC": 30, + "ARD": [ + "D1", + "A0" + ] + }, + "5": { + "IC": 29, + "ARD": "D3" + }, + "6": { + "IC": 28, + "ARD": "D2" + }, + "7": { + "IC": 32, + "ARD": "D4" + }, + "8": { + "IC": 27, + "ARD": "A1" + }, + "9": { + "IC": 13, + "ARD": "D5" + }, + "10": { + "IC": 12 + }, + "11": { + "IC": 14, + "ARD": "D6" + }, + "TTX2": { + "IC": 1, + "ARD": "D7" + }, + "TRX2": { + "IC": 2, + "ARD": "D8" + } + } + } +} diff --git a/boards/_base/pcb/wr2l-base.json b/boards/_base/pcb/wr2l-base.json new file mode 100644 index 000000000..ae893450a --- /dev/null +++ b/boards/_base/pcb/wr2l-base.json @@ -0,0 +1,9 @@ +{ + "pcb": { + "templates": [ + "tuya2l", + "pcb-blue-light", + "rf-type1" + ] + } +} diff --git a/boards/_base/pcb/wr2l.json b/boards/_base/pcb/wr2l.json new file mode 100644 index 000000000..672552438 --- /dev/null +++ b/boards/_base/pcb/wr2l.json @@ -0,0 +1,36 @@ +{ + "pcb": { + "pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD,SPI,I2C", + "pinout": { + "1": { + "IC": 14, + "ARD": "D0" + }, + "2": { + "IC": 13, + "ARD": "D1" + }, + "3": { + "IC": 28, + "ARD": "D2" + }, + "4": { + "IC": 30, + "ARD": [ + "D3", + "A0" + ] + }, + "5": { + "IC": 17, + "ARD": "D4" + }, + "6": { + "GND": null + }, + "7": { + "PWR": 3.3 + } + } + } +} diff --git a/boards/_base/pcb/wr2le.json b/boards/_base/pcb/wr2le.json new file mode 100644 index 000000000..d52c7ce6f --- /dev/null +++ b/boards/_base/pcb/wr2le.json @@ -0,0 +1,33 @@ +{ + "pcb": { + "pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD,SPI,I2C", + "pinout": { + "1": { + "IC": 14, + "ARD": "D0" + }, + "2": { + "IC": 13, + "ARD": "D1" + }, + "3": { + "IC": 28, + "ARD": "D2" + }, + "4": { + "IC": 31, + "ARD": "D3" + }, + "5": { + "IC": 17, + "ARD": "D4" + }, + "6": { + "GND": null + }, + "7": { + "PWR": 3.3 + } + } + } +} diff --git a/boards/_base/pcb/wr3-base.json b/boards/_base/pcb/wr3-base.json new file mode 100644 index 000000000..2015c6775 --- /dev/null +++ b/boards/_base/pcb/wr3-base.json @@ -0,0 +1,9 @@ +{ + "pcb": { + "templates": [ + "esp12s", + "tuya-16x24", + "rf-type1" + ] + } +} diff --git a/boards/_base/pcb/wr3.json b/boards/_base/pcb/wr3.json new file mode 100644 index 000000000..92b641f25 --- /dev/null +++ b/boards/_base/pcb/wr3.json @@ -0,0 +1,73 @@ +{ + "pcb": { + "templates": [ + "pcb-black" + ], + "pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD", + "pinout": { + "1": { + "NC": null + }, + "2": { + "IC": 31, + "ARD": "D0" + }, + "3": { + "IC": 12 + }, + "4": { + "IC": 30, + "ARD": [ + "D1", + "A0" + ] + }, + "5": { + "IC": 13, + "ARD": "D2" + }, + "6": { + "IC": 14, + "ARD": "D3" + }, + "7": { + "IC": 16, + "ARD": "D4" + }, + "8": { + "PWR": 3.3 + }, + "9": { + "GND": null + }, + "10": { + "IC": 27, + "ARD": "A1" + }, + "11": { + "IC": 2, + "ARD": "D5" + }, + "12": { + "IC": 1, + "ARD": "D6" + }, + "13": { + "IC": 28, + "ARD": "D7" + }, + "14": { + "IC": 17, + "ARD": "D8" + }, + "15": { + "IC": 29, + "ARD": "D9" + }, + "16": { + "IC": 32, + "ARD": "D10" + } + } + } +} diff --git a/boards/_base/pcb/wr3e.json b/boards/_base/pcb/wr3e.json new file mode 100644 index 000000000..62732a32d --- /dev/null +++ b/boards/_base/pcb/wr3e.json @@ -0,0 +1,73 @@ +{ + "pcb": { + "templates": [ + "pcb-blue-light" + ], + "pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD", + "pinout": { + "1": { + "NC": null + }, + "2": { + "IC": 27, + "ARD": "A1" + }, + "3": { + "IC": 12 + }, + "4": { + "IC": 2, + "ARD": "D0" + }, + "5": { + "IC": 13, + "ARD": "D1" + }, + "6": { + "IC": 14, + "ARD": "D2" + }, + "7": { + "IC": 31, + "ARD": "D3" + }, + "8": { + "PWR": 3.3 + }, + "9": { + "GND": null + }, + "10": { + "IC": 16, + "ARD": "D4" + }, + "11": { + "IC": 1, + "ARD": "D5" + }, + "12": { + "IC": 30, + "ARD": [ + "D6", + "A0" + ] + }, + "13": { + "IC": 28, + "ARD": "D7" + }, + "14": { + "IC": 17, + "ARD": "D8" + }, + "15": { + "IC": 29, + "ARD": "D9" + }, + "16": { + "IC": 32, + "ARD": "D10" + } + } + } +} diff --git a/boards/_base/pcb/wr3l-base.json b/boards/_base/pcb/wr3l-base.json new file mode 100644 index 000000000..c0ba943d3 --- /dev/null +++ b/boards/_base/pcb/wr3l-base.json @@ -0,0 +1,10 @@ +{ + "pcb": { + "templates": [ + "esp12s", + "pcb-white", + "tuya-16x24", + "rf-type1" + ] + } +} diff --git a/boards/_base/pcb/wr3n.json b/boards/_base/pcb/wr3n.json new file mode 100644 index 000000000..6686f1b1b --- /dev/null +++ b/boards/_base/pcb/wr3n.json @@ -0,0 +1,68 @@ +{ + "pcb": { + "templates": [ + "pcb-black" + ], + "pinout_hidden": "I2S,TRIG,WAKE,CTS,RTS,SD", + "pinout": { + "1": { + "NC": null + }, + "2": { + "IC": 27, + "ARD": "A1" + }, + "3": { + "IC": 12 + }, + "4": { + "IC": 2, + "ARD": "D0" + }, + "5": { + "IC": 13, + "ARD": "D1" + }, + "6": { + "IC": 14, + "ARD": "D2" + }, + "7": { + "IC": 16, + "ARD": "D3" + }, + "8": { + "PWR": 3.3 + }, + "9": { + "GND": null + }, + "10": { + "NC": null + }, + "11": { + "IC": 1, + "ARD": "D4" + }, + "12": { + "NC": null + }, + "13": { + "IC": 28, + "ARD": "D5" + }, + "14": { + "IC": 17, + "ARD": "D6" + }, + "15": { + "IC": 29, + "ARD": "D7" + }, + "16": { + "IC": 32, + "ARD": "D8" + } + } + } +} diff --git a/boards/_base/realtek-ambz-2mb-468k.json b/boards/_base/realtek-ambz-2mb-468k.json new file mode 100644 index 000000000..2e016b20d --- /dev/null +++ b/boards/_base/realtek-ambz-2mb-468k.json @@ -0,0 +1,15 @@ +{ + "build": { + "amb_boot_all": "boot_all_77F7.bin" + }, + "flash": { + "ota1": "0x00B000+0x75000", + "ota2": "0x080000+0x75000", + "kvs": "0x0F5000+0x8000", + "userdata": "0x0FD000+0x102000" + }, + "upload": { + "flash_size": 2097152, + "maximum_size": 479232 + } +} diff --git a/boards/_base/realtek-ambz-2mb-788k.json b/boards/_base/realtek-ambz-2mb-788k.json new file mode 100644 index 000000000..9cf5546e6 --- /dev/null +++ b/boards/_base/realtek-ambz-2mb-788k.json @@ -0,0 +1,15 @@ +{ + "build": { + "amb_boot_all": "boot_all_77F7.bin" + }, + "flash": { + "ota1": "0x00B000+0xC5000", + "ota2": "0x0D0000+0xC5000", + "kvs": "0x195000+0x8000", + "userdata": "0x19D000+0x62000" + }, + "upload": { + "flash_size": 2097152, + "maximum_size": 806912 + } +} diff --git a/boards/_base/realtek-ambz-4mb-980k.json b/boards/_base/realtek-ambz-4mb-980k.json new file mode 100644 index 000000000..e90cf7f97 --- /dev/null +++ b/boards/_base/realtek-ambz-4mb-980k.json @@ -0,0 +1,15 @@ +{ + "build": { + "amb_boot_all": "boot_all_C556.bin" + }, + "flash": { + "ota1": "0x00B000+0xF5000", + "ota2": "0x100000+0xF5000", + "kvs": "0x1F5000+0x8000", + "userdata": "0x1FD000+0x202000" + }, + "upload": { + "flash_size": 4194304, + "maximum_size": 1003520 + } +} diff --git a/boards/_base/realtek-ambz-bx.json b/boards/_base/realtek-ambz-bx.json new file mode 100644 index 000000000..7e565e2cf --- /dev/null +++ b/boards/_base/realtek-ambz-bx.json @@ -0,0 +1,5 @@ +{ + "build": { + "f_cpu": "62500000L" + } +} diff --git a/boards/_base/realtek-ambz-tuya.json b/boards/_base/realtek-ambz-tuya.json new file mode 100644 index 000000000..629b69cd4 --- /dev/null +++ b/boards/_base/realtek-ambz-tuya.json @@ -0,0 +1,5 @@ +{ + "flash": { + "tuya": "0x1EB000+0x15000" + } +} diff --git a/boards/_base/realtek-ambz.json b/boards/_base/realtek-ambz.json new file mode 100644 index 000000000..cfafa7d51 --- /dev/null +++ b/boards/_base/realtek-ambz.json @@ -0,0 +1,52 @@ +{ + "build": { + "family": "RTL8710B", + "ldscript": "rlx8711B-symbol-v02-img2_xip1.ld", + "f_cpu": "125000000L", + "prefix": "arm-none-eabi-", + "amb_flash_addr": "0x08000000" + }, + "flash": { + "boot_xip": "0x000000+0x4000", + "boot_ram": "0x004000+0x4000", + "system": "0x009000+0x1000", + "calibration": "0x00A000+0x1000", + "rdp": "0x1FF000+0x1000" + }, + "connectivity": [ + "wifi" + ], + "debug": { + "protocol": "openocd", + "protocols": [ + "openocd" + ], + "openocd_config": "amebaz.cfg", + "gdb_init": [ + "mem 0x8000000 0x8200000 ro" + ] + }, + "upload": { + "maximum_ram_size": 262144, + "require_upload_port": true, + "speed": 1500000, + "protocol": "uart", + "protocols": [ + "uart" + ] + }, + "doc": { + "params": { + "manufacturer": "Realtek", + "series": "AmebaZ", + "voltage": "3.0V - 3.6V", + "extra": { + "Wi-Fi": "802.11 b/g/n" + } + }, + "links": { + "Info & flashing guide": "../../docs/platform/realtek-ambz/README.md", + "Debugging": "../../docs/platform/realtek-ambz/debugging.md" + } + } +} diff --git a/boards/_base/realtek-ambz2-2mb-900k.json b/boards/_base/realtek-ambz2-2mb-900k.json new file mode 100644 index 000000000..b1f9ed8f9 --- /dev/null +++ b/boards/_base/realtek-ambz2-2mb-900k.json @@ -0,0 +1,12 @@ +{ + "flash": { + "ota1": "0x010000+0xE0000", + "ota2": "0x0F0000+0xE0000", + "kvs": "0x1D0000+0x8000", + "userdata": "0x1D8000+0x28000" + }, + "upload": { + "flash_size": 2097152, + "maximum_size": 917504 + } +} diff --git a/boards/_base/realtek-ambz2-2mb-992k.json b/boards/_base/realtek-ambz2-2mb-992k.json new file mode 100644 index 000000000..58fb342b0 --- /dev/null +++ b/boards/_base/realtek-ambz2-2mb-992k.json @@ -0,0 +1,11 @@ +{ + "flash": { + "ota1": "0x00C000+0xF8000", + "ota2": "0x104000+0xF8000", + "kvs": "0x1FC000+0x4000" + }, + "upload": { + "flash_size": 2097152, + "maximum_size": 1015808 + } +} diff --git a/boards/_base/realtek-ambz2-8710.json b/boards/_base/realtek-ambz2-8710.json new file mode 100644 index 000000000..5d26240a9 --- /dev/null +++ b/boards/_base/realtek-ambz2-8710.json @@ -0,0 +1,12 @@ +{ + "connectivity": [ + "wifi" + ], + "doc": { + "params": { + "extra": { + "Wi-Fi": "802.11 b/g/n" + } + } + } +} diff --git a/boards/_base/realtek-ambz2-8720.json b/boards/_base/realtek-ambz2-8720.json new file mode 100644 index 000000000..eef930dc6 --- /dev/null +++ b/boards/_base/realtek-ambz2-8720.json @@ -0,0 +1,14 @@ +{ + "connectivity": [ + "wifi", + "ble" + ], + "doc": { + "params": { + "extra": { + "Wi-Fi": "802.11 b/g/n", + "BLE": "v4.2" + } + } + } +} diff --git a/boards/_base/realtek-ambz2-image.json b/boards/_base/realtek-ambz2-image.json new file mode 100644 index 000000000..1ac54e338 --- /dev/null +++ b/boards/_base/realtek-ambz2-image.json @@ -0,0 +1,96 @@ +{ + "image": { + "keys": { + "decryption": "a0d6dae7e062ca94cbb294bf896b9f68cf8438774256ac7403ca4fd9a1c9564f", + "keyblock": { + "part_table": "882aa16c8c44a7760aa8c9ab22e3568c6fa16c2afa4f0cea29a10abcdf60e44f", + "boot": "882aa16c8c44a7760aa8c9ab22e3568c6fa16c2afa4f0cea29a10abcdf60e44f" + }, + "hash_keys": { + "part_table": "47e5661335a4c5e0a94d69f3c737d54f2383791332939753ef24279608f6d72b", + "boot": "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "ota1": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e5f", + "ota2": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e5f" + }, + "user_keys": { + "boot": "aa0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "ota1": "bb0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f", + "ota2": "bb0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f" + }, + "xip_sce_key": "a0d6dae7e062ca94cbb294bf896b9f68", + "xip_sce_iv": "94879487948794879487948794879487" + }, + "ptable": { + "boot": "BOOT", + "ota1": "FW1", + "ota2": "FW2" + }, + "boot": { + "name": "boot.sram", + "type": "SRAM", + "entry": "__ram_start_table_start__", + "elf": [ + ".ram.func.table", + ".data", + ".ram.code_text", + ".ram.code_rodata" + ], + "is_boot": true + }, + "fw": [ + { + "type": "FWHS_S", + "sections": [ + { + "name": "fwhs.sram", + "type": "SRAM", + "entry": "__ram_start_table_start__", + "elf": [ + ".ram.img.signature", + ".ram.func.table", + ".data", + ".ram.code_text", + ".ram.code_rodata" + ] + }, + { + "name": "fwhs.psram", + "type": "PSRAM", + "entry": "__psram_start__", + "elf": [ + ".psram.data", + ".psram.code_text", + ".psram.code_rodata" + ] + } + ] + }, + { + "type": "XIP", + "sections": [ + { + "name": "fwhs.xip_c", + "entry": "XIP_RamImgSignature_s", + "type": "XIP", + "elf": [ + ".xip.code_c" + ] + } + ] + }, + { + "type": "XIP", + "sections": [ + { + "name": "fwhs.xip_p", + "entry": "__xip_code_rodata_start__", + "type": "XIP", + "elf": [ + ".xip.code_p" + ] + } + ] + } + ] + } +} diff --git a/boards/_base/realtek-ambz2-tuya.json b/boards/_base/realtek-ambz2-tuya.json new file mode 100644 index 000000000..1ad51a578 --- /dev/null +++ b/boards/_base/realtek-ambz2-tuya.json @@ -0,0 +1,5 @@ +{ + "flash": { + "tuya": "0x1D5000+0x10000" + } +} diff --git a/boards/_base/realtek-ambz2.json b/boards/_base/realtek-ambz2.json new file mode 100644 index 000000000..05d4ffd86 --- /dev/null +++ b/boards/_base/realtek-ambz2.json @@ -0,0 +1,41 @@ +{ + "build": { + "family": "RTL8720C", + "f_cpu": "100000000L", + "prefix": "arm-none-eabi-", + "ldscript": "rtl8710c_ram.ld" + }, + "flash": { + "part_table": "0x000000+0x1000", + "system": "0x001000+0x1000", + "calibration": "0x002000+0x1000", + "boot": "0x004000+0x8000" + }, + "debug": { + "protocol": "openocd", + "protocols": [ + "openocd" + ], + "openocd_config": "amebaz2.cfg", + "gdb_init": [ + "mem 0x9b000000 0x9c000000 ro" + ] + }, + "upload": { + "maximum_ram_size": 262144, + "protocol": "uart", + "protocols": [ + "uart" + ] + }, + "doc": { + "params": { + "manufacturer": "Realtek", + "series": "AmebaZ2", + "voltage": "3.0V - 3.6V" + }, + "links": { + "General info": "../../docs/platform/realtek-amb/README.md" + } + } +} diff --git a/boards/bw12.json b/boards/bw12.json new file mode 100644 index 000000000..f662362ea --- /dev/null +++ b/boards/bw12.json @@ -0,0 +1,25 @@ +{ + "_base": [ + "realtek-ambz", + "realtek-ambz-2mb-468k", + "realtek-ambz-bx", + "ic/rtl8710bn", + "pcb/bw12" + ], + "build": { + "mcu": "rtl8710bx", + "variant": "bw12" + }, + "name": "BW12", + "url": "http://www.ai-thinker.com/pro_view-13.html", + "vendor": "Ai-Thinker Co., Ltd.", + "pcb": { + "symbol": "BW12" + }, + "doc": { + "fccid": "2ARI3-BW1X", + "links": { + "Vendor datasheet": "https://docs.ai-thinker.com/_media/rtl8710/hardware/bw12_datasheet_en.pdf" + } + } +} diff --git a/boards/bw12/bw12.svg b/boards/bw12/bw12.svg new file mode 100644 index 000000000..c8c5b6e7c --- /dev/null +++ b/boards/bw12/bw12.svg @@ -0,0 +1,327 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + PA15 + + + + PWM1 + + + + SWDIO + + + + + 2 + + + + + 3 + + + + CEN + + + + + 4 + + + + PA05 + + + + PWM4 + + + + + 5 + + + + PA29 + + + + RX2 + + + + SCL0 + + + + PWM4 + + + + + 6 + + + + PA00 + + + + PWM2 + + + + + 7 + + + + PA19 + + + + ADC1 + + + + SDA0 + + + + CS0 + + + + CS1 + + + + + 8 + + + + 3V3 + + + + + 9 + + + + GND + + + + + 10 + + + + PA22 + + + + SCL0 + + + + MISO0 + + + + MISO1 + + + + PWM5 + + + + + 11 + + + + PA30 + + + + TX2 + + + + SDA0 + + + + PWM4 + + + + + 12 + + + + PA14 + + + + PWM0 + + + + SWCLK + + + + + 13 + + + + PA12 + + + + PWM3 + + + + + 14 + + + + PA15 + + + + PWM1 + + + + SWDIO + + + + + 15 + + + + PA18 + + + + RX0 + + + + SCL1 + + + + SCK0 + + + + SCK1 + + + + + 16 + + + + PA23 + + + + TX0 + + + + SDA1 + + + + MOSI0 + + + + MOSI1 + + + + PWM0 + diff --git a/boards/bw12/index.html b/boards/bw12/index.html new file mode 100644 index 000000000..5e32df987 --- /dev/null +++ b/boards/bw12/index.html @@ -0,0 +1,2650 @@ + + + + + + + + + + + + + + + + + + + + + + + + BW12 - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

BW12

+

by Ai-Thinker Co., Ltd.

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codebw12
MCURTL8710BX
ManufacturerRealtek
SeriesAmebaZ
Frequency62.5 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O11x GPIO, 6x PWM, 2x UART, 1x ADC
Wi-Fi802.11 b/g/n
FCC ID2ARI3-BW1X
+

Usage

+

Board code: bw12

+

In platformio.ini:

+
[env:bw12]
+platform = libretiny
+board = bw12
+framework = arduino
+
+

In ESPHome YAML:

+
rtl87xx:
+  board: bw12
+
+

Pinout

+

Pinout

+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
PA00PWM2
PA05PWM4
PA12PWM3
PA14PWM0SWCLK
PA15PWM1SWDIO
PA18RX0SCL1SCK0, SCK1
PA19, ADC1SDA0CS0, CS1
PA22SCL0MISO0, MISO1PWM5
PA23TX0SDA1MOSI0, MOSI1PWM0
PA29RX2SCL0PWM4
PA30TX2SDA0PWM4
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Boot XIP0x00000016 KiB / 0x40000x004000
Boot RAM0x00400016 KiB / 0x40000x008000
(reserved)0x0080004 KiB / 0x10000x009000
System Data0x0090004 KiB / 0x10000x00A000
Calibration0x00A0004 KiB / 0x10000x00B000
OTA1 Image0x00B000468 KiB / 0x750000x080000
OTA2 Image0x080000468 KiB / 0x750000x0F5000
Key-Value Store0x0F500032 KiB / 0x80000x0FD000
User Data0x0FD0001 MiB / 0x1020000x1FF000
RDP0x1FF0004 KiB / 0x10000x200000
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/bw15.json b/boards/bw15.json new file mode 100644 index 000000000..e2b972e61 --- /dev/null +++ b/boards/bw15.json @@ -0,0 +1,26 @@ +{ + "_base": [ + "realtek-ambz2", + "realtek-ambz2-8720", + "realtek-ambz2-image", + "realtek-ambz2-2mb-992k", + "ic/rtl8720cf", + "pcb/bw15" + ], + "build": { + "mcu": "rtl8720cf", + "variant": "bw15" + }, + "name": "BW15", + "url": "https://docs.ai-thinker.com/_media/rtl8710/docs/bw15_datasheet_en.pdf", + "vendor": "Ai-Thinker Co., Ltd.", + "pcb": { + "symbol": "BW15" + }, + "doc": { + "fccid": "2AXVG-BW15", + "links": { + "Vendor datasheet": "https://docs.ai-thinker.com/_media/rtl8710/docs/bw15_datasheet_en.pdf" + } + } +} diff --git a/boards/bw15/bw15.svg b/boards/bw15/bw15.svg new file mode 100644 index 000000000..c48deaa8b --- /dev/null +++ b/boards/bw15/bw15.svg @@ -0,0 +1,367 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + PA17 + + + + PWM5 + + + + + 2 + + + + PA18 + + + + PWM6 + + + + + 3 + + + + CEN + + + + + 4 + + + + PA02 + + + + RX1 + + + + SCL0 + + + + CS0 + + + + PWM2 + + + + TDO + + + + + 5 + + + + PA15 + + + + RX2 + + + + SCL0 + + + + CS0 + + + + PWM3 + + + + + 6 + + + + PA04 + + + + MOSI0 + + + + PWM4 + + + + tRST + + + + + 7 + + + + PA19 + + + + SCL0 + + + + MOSI0 + + + + PWM7 + + + + + 8 + + + + 3V3 + + + + + 9 + + + + GND + + + + + 10 + + + + PA20 + + + + SDA0 + + + + MISO0 + + + + PWM0 + + + + + 11 + + + + PA16 + + + + TX2 + + + + SDA0 + + + + SCK0 + + + + PWM4 + + + + + 12 + + + + PA00 + + + + RX1 + + + + PWM0 + + + + TCK + + + + SWCLK + + + + + 13 + + + + PA03 + + + + TX1 + + + + SDA0 + + + + SCK0 + + + + PWM3 + + + + TDI + + + + + 14 + + + + PA01 + + + + TX1 + + + + PWM1 + + + + TMS + + + + SWDIO + + + + + 15 + + + + PA13 + + + + RX0 + + + + PWM7 + + + + + 16 + + + + PA14 + + + + TX0 + + + + PWM2 + diff --git a/boards/bw15/index.html b/boards/bw15/index.html new file mode 100644 index 000000000..8e7cdef9b --- /dev/null +++ b/boards/bw15/index.html @@ -0,0 +1,2657 @@ + + + + + + + + + + + + + + + + + + + + + + + + BW15 - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

BW15

+

by Ai-Thinker Co., Ltd.

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codebw15
MCURTL8720CF
ManufacturerRealtek
SeriesAmebaZ2
Frequency100 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O13x GPIO, 8x PWM, 3x UART
Wi-Fi802.11 b/g/n
BLEv4.2
FCC ID2AXVG-BW15
+

Usage

+

Board code: bw15

+

In platformio.ini:

+
[env:bw15]
+platform = libretiny
+board = bw15
+framework = arduino
+
+

In ESPHome YAML:

+
rtl87xx:
+  board: bw15
+
+

Pinout

+

Pinout

+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
PA00RX1PWM0SWCLK, TCK
PA01TX1PWM1SWDIO, TMS
PA02RX1SCL0CS0PWM2TDO
PA03TX1SDA0SCK0PWM3TDI
PA04MOSI0PWM4tRST
PA13RX0PWM7
PA14TX0PWM2
PA15RX2SCL0CS0PWM3
PA16TX2SDA0SCK0PWM4
PA17PWM5
PA18PWM6
PA19SCL0MOSI0PWM7
PA20SDA0MISO0PWM0
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Partition Table0x0000004 KiB / 0x10000x001000
System Data0x0010004 KiB / 0x10000x002000
Calibration0x0020004 KiB / 0x10000x003000
(reserved)0x0030004 KiB / 0x10000x004000
Boot Image0x00400032 KiB / 0x80000x00C000
OTA1 Image0x00C000992 KiB / 0xF80000x104000
OTA2 Image0x104000992 KiB / 0xF80000x1FC000
Key-Value Store0x1FC00016 KiB / 0x40000x200000
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/cb1s.json b/boards/cb1s.json new file mode 100644 index 000000000..b97e6ea4c --- /dev/null +++ b/boards/cb1s.json @@ -0,0 +1,20 @@ +{ + "_base": [ + "beken-72xx", + "beken-7231n", + "beken-7231-tuya", + "ic/bk7231-qfn32", + "pcb/cb1s", + "pcb/cb1s-test" + ], + "build": { + "mcu": "bk7231n", + "variant": "cb1s" + }, + "name": "CB1S Wi-Fi Module", + "url": "https://developer.tuya.com/en/docs/iot/cb1s-module-datasheet?id=Kaij1abmwyjq2", + "vendor": "Tuya Inc.", + "pcb": { + "symbol": "CB1S" + } +} diff --git a/boards/cb1s/cb1s.svg b/boards/cb1s/cb1s.svg new file mode 100644 index 000000000..c44c62675 --- /dev/null +++ b/boards/cb1s/cb1s.svg @@ -0,0 +1,413 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CB1S + + + + + + + + + + + + + + + + + 1 + + + + VCC5 + + + + + 2 + + + + P11 + + + + TX1 + + + + + 3 + + + + P10 + + + + RX1 + + + + + 4 + + + + 3V3 + + + + + 5 + + + + GND + + + + + 6 + + + + P6 + + + + PWM0 + + + + + 7 + + + + P7 + + + + PWM1 + + + + + 8 + + + + P0 + + + + TX2 + + + + SCL2 + + + + + 9 + + + + P9 + + + + PWM3 + + + + + 10 + + + + P8 + + + + PWM2 + + + + + 11 + + + + P1 + + + + RX2 + + + + SDA2 + + + + + 12 + + + + P24 + + + + PWM4 + + + + + 13 + + + + P26 + + + + IRDA + + + + PWM5 + + + + + 14 + + + + GND + + + + + 15 + + + + GND + + + + + 16 + + + + CEN + + + + + 17 + + + + P23 + + + + ADC3 + + + + TDO + + + + FSO + + + + + 18 + + + + GND + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + P20 + + + + SCL1 + + + + TCK + + + + FSCK + + + + + P21 + + + + SDA1 + + + + TMS + + + + ___ + FCS + + + + + P23 + + + + ADC3 + + + + TDO + + + + FSO + + + + + P22 + + + + TDI + + + + FSI + diff --git a/boards/cb1s/index.html b/boards/cb1s/index.html new file mode 100644 index 000000000..24ec4ac7a --- /dev/null +++ b/boards/cb1s/index.html @@ -0,0 +1,2667 @@ + + + + + + + + + + + + + + + + + + + + + + + + CB1S - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

CB1S Wi-Fi Module

+

by Tuya Inc.

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codecb1s
MCUBK7231N
ManufacturerBeken
SeriesBK72XX
Frequency120 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O14x GPIO, 6x PWM, 2x UART, 1x ADC
Wi-Fi802.11 b/g/n
BluetoothBLE v5.1
+

Usage

+

Board code: cb1s

+

In platformio.ini:

+
[env:cb1s]
+platform = libretiny
+board = cb1s
+framework = arduino
+
+

In ESPHome YAML:

+
bk72xx:
+  board: cb1s
+
+

Pinout

+

Pinout

+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
P0TX2SCL2
P1RX2SDA2
P6PWM0
P7PWM1
P8PWM2
P9PWM3
P10RX1
P11TX1
P20SCL1TCK
P21SDA1TMS
P22TDI
P23, ADC3TDO
P24PWM4
P26PWM5
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Bootloader0x00000068 KiB / 0x110000x011000
App Image0x0110001.1 MiB / 0x1190000x12A000
OTA Image0x12A000664 KiB / 0xA60000x1D0000
Calibration0x1D00004 KiB / 0x10000x1D1000
Network Data0x1D10004 KiB / 0x10000x1D2000
TLV Store0x1D20004 KiB / 0x10000x1D3000
Key-Value Store0x1D300032 KiB / 0x80000x1DB000
User Data0x1DB000148 KiB / 0x250000x200000
Tuya Storage0x1ED00076 KiB / 0x130000x200000
+

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/cb2l.json b/boards/cb2l.json new file mode 100644 index 000000000..84413c938 --- /dev/null +++ b/boards/cb2l.json @@ -0,0 +1,23 @@ +{ + "_base": [ + "beken-72xx", + "beken-7231n", + "beken-7231-tuya", + "ic/bk7231-qfn32", + "pcb/cb2l", + "pcb/cb2l-test" + ], + "build": { + "mcu": "bk7231n", + "variant": "cb2l" + }, + "name": "CB2L Wi-Fi Module", + "url": "https://developer.tuya.com/en/docs/iot/cb2l-module-datasheet?id=Kai2eku1m3pyl", + "vendor": "Tuya Inc.", + "doc": { + "fccid": "2ANDL-CB2L" + }, + "pcb": { + "symbol": "CB2L" + } +} diff --git a/boards/cb2l/cb2l.svg b/boards/cb2l/cb2l.svg new file mode 100644 index 000000000..55274cf45 --- /dev/null +++ b/boards/cb2l/cb2l.svg @@ -0,0 +1,250 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CB2L + + + + + + + + + + + + + + + + + 1 + + + + P8 + + + + PWM2 + + + + + 2 + + + + P7 + + + + PWM1 + + + + + 3 + + + + P6 + + + + PWM0 + + + + + 4 + + + + P26 + + + + IRDA + + + + PWM5 + + + + + 5 + + + + P24 + + + + PWM4 + + + + + 6 + + + + GND + + + + + 7 + + + + 3V3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GND + + + + + CEN + + + + + P10 + + + + RX1 + + + + + P0 + + + + TX2 + + + + + P11 + + + + TX1 + + + + + P21 + diff --git a/boards/cb2l/index.html b/boards/cb2l/index.html new file mode 100644 index 000000000..a3077776e --- /dev/null +++ b/boards/cb2l/index.html @@ -0,0 +1,2631 @@ + + + + + + + + + + + + + + + + + + + + + + + + CB2L - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

CB2L Wi-Fi Module

+

by Tuya Inc.

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codecb2l
MCUBK7231N
ManufacturerBeken
SeriesBK72XX
Frequency120 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O9x GPIO, 5x PWM, 2x UART
Wi-Fi802.11 b/g/n
BluetoothBLE v5.1
FCC ID2ANDL-CB2L
+

Usage

+

Board code: cb2l

+

In platformio.ini:

+
[env:cb2l]
+platform = libretiny
+board = cb2l
+framework = arduino
+
+

In ESPHome YAML:

+
bk72xx:
+  board: cb2l
+
+

Pinout

+

Pinout

+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
P0TX2
P6PWM0
P7PWM1
P8PWM2
P10RX1
P11TX1
P21
P24PWM4
P26PWM5
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Bootloader0x00000068 KiB / 0x110000x011000
App Image0x0110001.1 MiB / 0x1190000x12A000
OTA Image0x12A000664 KiB / 0xA60000x1D0000
Calibration0x1D00004 KiB / 0x10000x1D1000
Network Data0x1D10004 KiB / 0x10000x1D2000
TLV Store0x1D20004 KiB / 0x10000x1D3000
Key-Value Store0x1D300032 KiB / 0x80000x1DB000
User Data0x1DB000148 KiB / 0x250000x200000
Tuya Storage0x1ED00076 KiB / 0x130000x200000
+

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/cb2s.json b/boards/cb2s.json new file mode 100644 index 000000000..a4df4e2a0 --- /dev/null +++ b/boards/cb2s.json @@ -0,0 +1,23 @@ +{ + "_base": [ + "beken-72xx", + "beken-7231n", + "beken-7231-tuya", + "ic/bk7231-qfn32", + "pcb/cb2s", + "pcb/cb2s-test" + ], + "build": { + "mcu": "bk7231n", + "variant": "cb2s" + }, + "name": "CB2S Wi-Fi Module", + "url": "https://developer.tuya.com/en/docs/iot/cb2s-module-datasheet?id=Kafgfsa2aaypq", + "vendor": "Tuya Inc.", + "doc": { + "fccid": "2ANDL-CB2S" + }, + "pcb": { + "symbol": "CB2S" + } +} diff --git a/boards/cb2s/cb2s.svg b/boards/cb2s/cb2s.svg new file mode 100644 index 000000000..26437835b --- /dev/null +++ b/boards/cb2s/cb2s.svg @@ -0,0 +1,272 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CB2S + + + + + + + + + + + + + + + + + 2 + + + + P6 + + + + PWM0 + + + + + 4 + + + + P7 + + + + PWM1 + + + + + 6 + + + + P8 + + + + PWM2 + + + + + 8 + + + + P23 + + + + ADC3 + + + + + 10 + + + + CEN + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + 3V3 + + + + + 3 + + + + GND + + + + + 5 + + + + P10 + + + + RX1 + + + + + 7 + + + + P11 + + + + TX1 + + + + + 9 + + + + P24 + + + + PWM4 + + + + + 11 + + + + P26 + + + + IRDA + + + + PWM5 + + + + + P1 + + + + RX2 + + + + SDA2 + + + + + P0 + + + + TX2 + + + + SCL2 + + + + + P21 + + + + SDA1 + diff --git a/boards/cb2s/index.html b/boards/cb2s/index.html new file mode 100644 index 000000000..20cddacb2 --- /dev/null +++ b/boards/cb2s/index.html @@ -0,0 +1,2647 @@ + + + + + + + + + + + + + + + + + + + + + + + + CB2S - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

CB2S Wi-Fi Module

+

by Tuya Inc.

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codecb2s
MCUBK7231N
ManufacturerBeken
SeriesBK72XX
Frequency120 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O11x GPIO, 5x PWM, 2x UART, 1x ADC
Wi-Fi802.11 b/g/n
BluetoothBLE v5.1
FCC ID2ANDL-CB2S
+

Usage

+

Board code: cb2s

+

In platformio.ini:

+
[env:cb2s]
+platform = libretiny
+board = cb2s
+framework = arduino
+
+

In ESPHome YAML:

+
bk72xx:
+  board: cb2s
+
+

Pinout

+

Pinout

+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
P0TX2SCL2
P1RX2SDA2
P6PWM0
P7PWM1
P8PWM2
P10RX1
P11TX1
P21SDA1
P23, ADC3
P24PWM4
P26PWM5
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Bootloader0x00000068 KiB / 0x110000x011000
App Image0x0110001.1 MiB / 0x1190000x12A000
OTA Image0x12A000664 KiB / 0xA60000x1D0000
Calibration0x1D00004 KiB / 0x10000x1D1000
Network Data0x1D10004 KiB / 0x10000x1D2000
TLV Store0x1D20004 KiB / 0x10000x1D3000
Key-Value Store0x1D300032 KiB / 0x80000x1DB000
User Data0x1DB000148 KiB / 0x250000x200000
Tuya Storage0x1ED00076 KiB / 0x130000x200000
+

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/cb3l.json b/boards/cb3l.json new file mode 100644 index 000000000..ea2161a05 --- /dev/null +++ b/boards/cb3l.json @@ -0,0 +1,22 @@ +{ + "_base": [ + "beken-72xx", + "beken-7231n", + "beken-7231-tuya", + "ic/bk7231-qfn32", + "pcb/cb3l" + ], + "build": { + "mcu": "bk7231n", + "variant": "cb3l" + }, + "name": "CB3L Wi-Fi Module", + "url": "https://developer.tuya.com/en/docs/iot/cb3l-module-datasheet?id=Kai51ngmrh3qm", + "vendor": "Tuya Inc.", + "doc": { + "fccid": "2ANDL-CB3L" + }, + "pcb": { + "symbol": "CB3L" + } +} diff --git a/boards/cb3l/cb3l.svg b/boards/cb3l/cb3l.svg new file mode 100644 index 000000000..0e52771b5 --- /dev/null +++ b/boards/cb3l/cb3l.svg @@ -0,0 +1,265 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CB3L + + + + + + + + + + + + + + + + + 1 + + + + CEN + + + + + 2 + + + + P23 + + + + ADC3 + + + + + 3 + + + + CEN + + + + + 4 + + + + P14 + + + + + 5 + + + + P26 + + + + IRDA + + + + PWM5 + + + + + 6 + + + + P24 + + + + PWM4 + + + + + 7 + + + + P6 + + + + PWM0 + + + + + 8 + + + + 3V3 + + + + + 9 + + + + GND + + + + + 10 + + + + P9 + + + + PWM3 + + + + + 11 + + + + P0 + + + + TX2 + + + + + 12 + + + + P21 + + + + + 13 + + + + P8 + + + + PWM2 + + + + + 14 + + + + P7 + + + + PWM1 + + + + + 15 + + + + P10 + + + + RX1 + + + + + 16 + + + + P11 + + + + TX1 + diff --git a/boards/cb3l/index.html b/boards/cb3l/index.html new file mode 100644 index 000000000..12b645931 --- /dev/null +++ b/boards/cb3l/index.html @@ -0,0 +1,2655 @@ + + + + + + + + + + + + + + + + + + + + + + + + CB3L - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

CB3L Wi-Fi Module

+

by Tuya Inc.

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codecb3l
MCUBK7231N
ManufacturerBeken
SeriesBK72XX
Frequency120 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O12x GPIO, 6x PWM, 2x UART, 1x ADC
Wi-Fi802.11 b/g/n
BluetoothBLE v5.1
FCC ID2ANDL-CB3L
+

Usage

+

Board code: cb3l

+

In platformio.ini:

+
[env:cb3l]
+platform = libretiny
+board = cb3l
+framework = arduino
+
+

In ESPHome YAML:

+
bk72xx:
+  board: cb3l
+
+

Pinout

+

Pinout

+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
P0TX2
P6PWM0
P7PWM1
P8PWM2
P9PWM3
P10RX1
P11TX1
P14
P21
P23, ADC3
P24PWM4
P26PWM5
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Bootloader0x00000068 KiB / 0x110000x011000
App Image0x0110001.1 MiB / 0x1190000x12A000
OTA Image0x12A000664 KiB / 0xA60000x1D0000
Calibration0x1D00004 KiB / 0x10000x1D1000
Network Data0x1D10004 KiB / 0x10000x1D2000
TLV Store0x1D20004 KiB / 0x10000x1D3000
Key-Value Store0x1D300032 KiB / 0x80000x1DB000
User Data0x1DB000148 KiB / 0x250000x200000
Tuya Storage0x1ED00076 KiB / 0x130000x200000
+

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/cb3s.json b/boards/cb3s.json new file mode 100644 index 000000000..9aea41171 --- /dev/null +++ b/boards/cb3s.json @@ -0,0 +1,22 @@ +{ + "_base": [ + "beken-72xx", + "beken-7231n", + "beken-7231-tuya", + "ic/bk7231-qfn32", + "pcb/cb3s" + ], + "build": { + "mcu": "bk7231n", + "variant": "cb3s" + }, + "name": "CB3S Wi-Fi Module", + "url": "https://developer.tuya.com/en/docs/iot/cb3s?id=Kai94mec0s076", + "vendor": "Tuya Inc.", + "doc": { + "fccid": "2ANDL-CB3S" + }, + "pcb": { + "symbol": "CB3S" + } +} diff --git a/boards/cb3s/cb3s.svg b/boards/cb3s/cb3s.svg new file mode 100644 index 000000000..5766fdaeb --- /dev/null +++ b/boards/cb3s/cb3s.svg @@ -0,0 +1,391 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CB3S + + + + + + + + + + + + + + + + + 1 + + + + CEN + + + + + 2 + + + + P23 + + + + ADC3 + + + + TDO + + + + FSO + + + + + 3 + + + + CEN + + + + + 4 + + + + P14 + + + + + 5 + + + + P26 + + + + IRDA + + + + PWM5 + + + + + 6 + + + + P24 + + + + PWM4 + + + + + 7 + + + + P6 + + + + PWM0 + + + + + 8 + + + + 3V3 + + + + + 9 + + + + GND + + + + + 10 + + + + P9 + + + + PWM3 + + + + + 11 + + + + P0 + + + + TX2 + + + + + 12 + + + + P21 + + + + SDA1 + + + + TMS + + + + ___ + FCS + + + + + 13 + + + + P8 + + + + PWM2 + + + + + 14 + + + + P7 + + + + PWM1 + + + + + 15 + + + + P10 + + + + RX1 + + + + + 16 + + + + P11 + + + + TX1 + + + + + 17 + + + + P23 + + + + ADC3 + + + + TDO + + + + FSO + + + + + 18 + + + + P22 + + + + TDI + + + + FSI + + + + + 19 + + + + P21 + + + + SDA1 + + + + TMS + + + + ___ + FCS + + + + + 20 + + + + P20 + + + + SCL1 + + + + TCK + + + + FSCK + + + + + 21 + + + + + 22 + diff --git a/boards/cb3s/index.html b/boards/cb3s/index.html new file mode 100644 index 000000000..03ca8a6d7 --- /dev/null +++ b/boards/cb3s/index.html @@ -0,0 +1,2671 @@ + + + + + + + + + + + + + + + + + + + + + + + + CB3S - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

CB3S Wi-Fi Module

+

by Tuya Inc.

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codecb3s
MCUBK7231N
ManufacturerBeken
SeriesBK72XX
Frequency120 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O14x GPIO, 6x PWM, 2x UART, 1x ADC
Wi-Fi802.11 b/g/n
BluetoothBLE v5.1
FCC ID2ANDL-CB3S
+

Usage

+

Board code: cb3s

+

In platformio.ini:

+
[env:cb3s]
+platform = libretiny
+board = cb3s
+framework = arduino
+
+

In ESPHome YAML:

+
bk72xx:
+  board: cb3s
+
+

Pinout

+

Pinout

+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
P0TX2
P6PWM0
P7PWM1
P8PWM2
P9PWM3
P10RX1
P11TX1
P14
P20SCL1TCK
P21SDA1TMS
P22TDI
P23, ADC3TDO
P24PWM4
P26PWM5
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Bootloader0x00000068 KiB / 0x110000x011000
App Image0x0110001.1 MiB / 0x1190000x12A000
OTA Image0x12A000664 KiB / 0xA60000x1D0000
Calibration0x1D00004 KiB / 0x10000x1D1000
Network Data0x1D10004 KiB / 0x10000x1D2000
TLV Store0x1D20004 KiB / 0x10000x1D3000
Key-Value Store0x1D300032 KiB / 0x80000x1DB000
User Data0x1DB000148 KiB / 0x250000x200000
Tuya Storage0x1ED00076 KiB / 0x130000x200000
+

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/cb3se.json b/boards/cb3se.json new file mode 100644 index 000000000..104e9d091 --- /dev/null +++ b/boards/cb3se.json @@ -0,0 +1,22 @@ +{ + "_base": [ + "beken-72xx", + "beken-7231n", + "beken-7231-tuya", + "ic/bk7231-qfn32", + "pcb/cb3se" + ], + "build": { + "mcu": "bk7231n", + "variant": "cb3se" + }, + "name": "CB3SE Wi-Fi Module", + "url": "https://developer.tuya.com/en/docs/iot/CB3SE-Module-Datasheet?id=Kanoiluul7nl2", + "vendor": "Tuya Inc.", + "doc": { + "fccid": "2ANDL-CB3SE" + }, + "pcb": { + "symbol": "CB3SE" + } +} diff --git a/boards/cb3se/cb3se.svg b/boards/cb3se/cb3se.svg new file mode 100644 index 000000000..10427b828 --- /dev/null +++ b/boards/cb3se/cb3se.svg @@ -0,0 +1,361 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CB3SE + + + + + + + + + + + + + + + + + 1 + + + + CEN + + + + + 2 + + + + P23 + + + + ADC3 + + + + + 3 + + + + CEN + + + + + 4 + + + + P14 + + + + SCK + + + + + 5 + + + + P26 + + + + IRDA + + + + PWM5 + + + + + 6 + + + + P24 + + + + PWM4 + + + + + 7 + + + + P6 + + + + PWM0 + + + + + 8 + + + + 3V3 + + + + + 9 + + + + GND + + + + + 10 + + + + P9 + + + + PWM3 + + + + + 11 + + + + P0 + + + + TX2 + + + + SCL2 + + + + + 12 + + + + P1 + + + + RX2 + + + + SDA2 + + + + + 13 + + + + P8 + + + + PWM2 + + + + + 14 + + + + P7 + + + + PWM1 + + + + + 15 + + + + P10 + + + + RX1 + + + + + 16 + + + + P11 + + + + TX1 + + + + + 17 + + + + P15 + + + + CS + + + + + 18 + + + + P22 + + + + + 19 + + + + GND + + + + + 20 + + + + P20 + + + + + 21 + + + + P17 + + + + MISO + + + + + 22 + + + + P16 + + + + MOSI + diff --git a/boards/cb3se/index.html b/boards/cb3se/index.html new file mode 100644 index 000000000..4ae7f09a4 --- /dev/null +++ b/boards/cb3se/index.html @@ -0,0 +1,2695 @@ + + + + + + + + + + + + + + + + + + + + + + + + CB3SE - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

CB3SE Wi-Fi Module

+

by Tuya Inc.

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codecb3se
MCUBK7231N
ManufacturerBeken
SeriesBK72XX
Frequency120 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O17x GPIO, 6x PWM, 2x UART, 1x ADC
Wi-Fi802.11 b/g/n
BluetoothBLE v5.1
FCC ID2ANDL-CB3SE
+

Usage

+

Board code: cb3se

+

In platformio.ini:

+
[env:cb3se]
+platform = libretiny
+board = cb3se
+framework = arduino
+
+

In ESPHome YAML:

+
bk72xx:
+  board: cb3se
+
+

Pinout

+

Pinout

+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
P0TX2SCL2
P1RX2SDA2
P6PWM0
P7PWM1
P8PWM2
P9PWM3
P10RX1
P11TX1
P14SCK
P15CS
P16MOSI
P17MISO
P20
P22
P23, ADC3
P24PWM4
P26PWM5
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Bootloader0x00000068 KiB / 0x110000x011000
App Image0x0110001.1 MiB / 0x1190000x12A000
OTA Image0x12A000664 KiB / 0xA60000x1D0000
Calibration0x1D00004 KiB / 0x10000x1D1000
Network Data0x1D10004 KiB / 0x10000x1D2000
TLV Store0x1D20004 KiB / 0x10000x1D3000
Key-Value Store0x1D300032 KiB / 0x80000x1DB000
User Data0x1DB000148 KiB / 0x250000x200000
Tuya Storage0x1ED00076 KiB / 0x130000x200000
+

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/cblc5.json b/boards/cblc5.json new file mode 100644 index 000000000..7e91a732b --- /dev/null +++ b/boards/cblc5.json @@ -0,0 +1,20 @@ +{ + "_base": [ + "beken-72xx", + "beken-7231n", + "beken-7231-tuya", + "ic/bk7231-qfn32", + "pcb/cblc5", + "pcb/cblc5-test" + ], + "build": { + "mcu": "bk7231n", + "variant": "cblc5" + }, + "name": "CBLC5 Wi-Fi Module", + "url": "https://developer.tuya.com/en/docs/iot/cblc5-module-datasheet?id=Ka07iqyusq1wm", + "vendor": "Tuya Inc.", + "pcb": { + "symbol": "CBLC5" + } +} diff --git a/boards/cblc5/cblc5.svg b/boards/cblc5/cblc5.svg new file mode 100644 index 000000000..06f991648 --- /dev/null +++ b/boards/cblc5/cblc5.svg @@ -0,0 +1,205 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CBLC5 + + + + + 1 + + + + ANT + + + + + 3 + + + + P24 + + + + PWM4 + + + + + 5 + + + + P6 + + + + PWM0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2 + + + + GND + + + + + 4 + + + + P26 + + + + IRDA + + + + PWM5 + + + + + 6 + + + + 3V3 + + + + + CEN + + + + + P10 + + + + RX1 + + + + + P11 + + + + TX1 + + + + + P1 + + + + RX2 + + + + SDA2 + + + + + P0 + + + + TX2 + + + + SCL2 + + + + + P21 + diff --git a/boards/cblc5/index.html b/boards/cblc5/index.html new file mode 100644 index 000000000..2966419b7 --- /dev/null +++ b/boards/cblc5/index.html @@ -0,0 +1,2619 @@ + + + + + + + + + + + + + + + + + + + + + + + + CBLC5 - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

CBLC5 Wi-Fi Module

+

by Tuya Inc.

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codecblc5
MCUBK7231N
ManufacturerBeken
SeriesBK72XX
Frequency120 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O8x GPIO, 3x PWM, 2x UART
Wi-Fi802.11 b/g/n
BluetoothBLE v5.1
+

Usage

+

Board code: cblc5

+

In platformio.ini:

+
[env:cblc5]
+platform = libretiny
+board = cblc5
+framework = arduino
+
+

In ESPHome YAML:

+
bk72xx:
+  board: cblc5
+
+

Pinout

+

Pinout

+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
P0TX2SCL2
P1RX2SDA2
P6PWM0
P10RX1
P11TX1
P21
P24PWM4
P26PWM5
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Bootloader0x00000068 KiB / 0x110000x011000
App Image0x0110001.1 MiB / 0x1190000x12A000
OTA Image0x12A000664 KiB / 0xA60000x1D0000
Calibration0x1D00004 KiB / 0x10000x1D1000
Network Data0x1D10004 KiB / 0x10000x1D2000
TLV Store0x1D20004 KiB / 0x10000x1D3000
Key-Value Store0x1D300032 KiB / 0x80000x1DB000
User Data0x1DB000148 KiB / 0x250000x200000
Tuya Storage0x1ED00076 KiB / 0x130000x200000
+

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/cbu.json b/boards/cbu.json new file mode 100644 index 000000000..92431d75e --- /dev/null +++ b/boards/cbu.json @@ -0,0 +1,23 @@ +{ + "_base": [ + "beken-72xx", + "beken-7231n", + "beken-7231-tuya", + "ic/bk7231-qfn32", + "pcb/cbu", + "pcb/cbu-test" + ], + "build": { + "mcu": "bk7231n", + "variant": "cbu" + }, + "name": "CBU Wi-Fi Module", + "url": "https://developer.tuya.com/en/docs/iot/cbu-module-datasheet?id=Ka07pykl5dk4u", + "vendor": "Tuya Inc.", + "doc": { + "fccid": "2ANDL-CBU" + }, + "pcb": { + "symbol": "CBU" + } +} diff --git a/boards/cbu/cbu.svg b/boards/cbu/cbu.svg new file mode 100644 index 000000000..d8705f4b3 --- /dev/null +++ b/boards/cbu/cbu.svg @@ -0,0 +1,459 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CBU + + + + + + + + + + + + + + + + + 1 + + + + P14 + + + + SCK + + + + + 2 + + + + P16 + + + + MOSI + + + + + 3 + + + + P20 + + + + SCL1 + + + + TCK + + + + + 4 + + + + P22 + + + + TDI + + + + + 5 + + + + P23 + + + + ADC3 + + + + TDO + + + + + 6 + + + + P1 + + + + RX2 + + + + SDA2 + + + + + 7 + + + + P0 + + + + TX2 + + + + SCL2 + + + + + 8 + + + + P8 + + + + PWM2 + + + + + 9 + + + + P7 + + + + PWM1 + + + + + 10 + + + + P6 + + + + PWM0 + + + + + 11 + + + + P26 + + + + IRDA + + + + PWM5 + + + + + 12 + + + + P24 + + + + PWM4 + + + + + 13 + + + + GND + + + + + 14 + + + + 3V3 + + + + + 15 + + + + P11 + + + + TX1 + + + + + 16 + + + + P10 + + + + RX1 + + + + + 17 + + + + P28 + + + + + 18 + + + + CEN + + + + + 19 + + + + P9 + + + + PWM3 + + + + + 20 + + + + P17 + + + + MISO + + + + + 21 + + + + P15 + + + + CS + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + P21 + + + + SDA1 + + + + TMS + diff --git a/boards/cbu/index.html b/boards/cbu/index.html new file mode 100644 index 000000000..48cfac8a9 --- /dev/null +++ b/boards/cbu/index.html @@ -0,0 +1,2711 @@ + + + + + + + + + + + + + + + + + + + + + + + + CBU - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

CBU Wi-Fi Module

+

by Tuya Inc.

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codecbu
MCUBK7231N
ManufacturerBeken
SeriesBK72XX
Frequency120 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O19x GPIO, 6x PWM, 2x UART, 1x ADC
Wi-Fi802.11 b/g/n
BluetoothBLE v5.1
FCC ID2ANDL-CBU
+

Usage

+

Board code: cbu

+

In platformio.ini:

+
[env:cbu]
+platform = libretiny
+board = cbu
+framework = arduino
+
+

In ESPHome YAML:

+
bk72xx:
+  board: cbu
+
+

Pinout

+

Pinout

+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
P0TX2SCL2
P1RX2SDA2
P6PWM0
P7PWM1
P8PWM2
P9PWM3
P10RX1
P11TX1
P14SCK
P15CS
P16MOSI
P17MISO
P20SCL1TCK
P21SDA1TMS
P22TDI
P23, ADC3TDO
P24PWM4
P26PWM5
P28
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Bootloader0x00000068 KiB / 0x110000x011000
App Image0x0110001.1 MiB / 0x1190000x12A000
OTA Image0x12A000664 KiB / 0xA60000x1D0000
Calibration0x1D00004 KiB / 0x10000x1D1000
Network Data0x1D10004 KiB / 0x10000x1D2000
TLV Store0x1D20004 KiB / 0x10000x1D3000
Key-Value Store0x1D300032 KiB / 0x80000x1DB000
User Data0x1DB000148 KiB / 0x250000x200000
Tuya Storage0x1ED00076 KiB / 0x130000x200000
+

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/generic-bk7231n-qfn32-tuya.json b/boards/generic-bk7231n-qfn32-tuya.json new file mode 100644 index 000000000..c38eaabd9 --- /dev/null +++ b/boards/generic-bk7231n-qfn32-tuya.json @@ -0,0 +1,100 @@ +{ + "_base": [ + "generic", + "beken-72xx", + "beken-7231n", + "beken-7231-tuya", + "ic/bk7231-qfn32" + ], + "build": { + "mcu": "bk7231n", + "variant": "generic-bk7231n-qfn32-tuya" + }, + "name": "Generic - BK7231N (Tuya QFN32)", + "symbol": "BK7231N (Tuya QFN32)", + "url": "https://docs.libretiny.eu/boards/generic-bk7231n-qfn32-tuya/", + "vendor": "Generic", + "pcb": { + "pinout": { + "1": { + "IC": 29, + "ARD": "D0" + }, + "2": { + "IC": 28, + "ARD": "D1" + }, + "3": { + "IC": 22, + "ARD": "D2" + }, + "4": { + "IC": 23, + "ARD": "D3" + }, + "5": { + "IC": 24, + "ARD": "D4" + }, + "6": { + "IC": 25, + "ARD": "D5" + }, + "7": { + "IC": 26, + "ARD": "D6" + }, + "8": { + "IC": 27, + "ARD": "D7" + }, + "9": { + "IC": 11, + "ARD": "D8" + }, + "10": { + "IC": 13, + "ARD": "D9" + }, + "11": { + "IC": 12, + "ARD": "D10" + }, + "12": { + "IC": 14, + "ARD": "D11" + }, + "13": { + "IC": 20, + "ARD": "D12" + }, + "14": { + "IC": 19, + "ARD": "D13" + }, + "15": { + "IC": 18, + "ARD": "D14" + }, + "16": { + "IC": 17, + "ARD": [ + "D15", + "A0" + ] + }, + "17": { + "IC": 16, + "ARD": "D16" + }, + "18": { + "IC": 15, + "ARD": "D17" + }, + "19": { + "IC": 10, + "ARD": "D18" + } + } + } +} diff --git a/boards/generic-bk7231n-qfn32-tuya/index.html b/boards/generic-bk7231n-qfn32-tuya/index.html new file mode 100644 index 000000000..223a5c428 --- /dev/null +++ b/boards/generic-bk7231n-qfn32-tuya/index.html @@ -0,0 +1,2691 @@ + + + + + + + + + + + + + + + + + + + + + + + + Generic - BK7231N (Tuya QFN32) - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Generic - BK7231N (Tuya QFN32)

+

by Generic

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codegeneric-bk7231n-qfn32-tuya
MCUBK7231N
ManufacturerBeken
SeriesBK72XX
Frequency120 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O19x GPIO, 6x PWM, 2x UART, 1x ADC
Wi-Fi802.11 b/g/n
BluetoothBLE v5.1
+

Usage

+

Board code: generic-bk7231n-qfn32-tuya

+

In platformio.ini:

+
[env:generic-bk7231n-qfn32-tuya]
+platform = libretiny
+board = generic-bk7231n-qfn32-tuya
+framework = arduino
+
+

In ESPHome YAML:

+
bk72xx:
+  board: generic-bk7231n-qfn32-tuya
+
+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
P0TX2SCL2
P1RX2SDA2
P6PWM0
P7PWM1
P8PWM2
P9PWM3
P10RX1
P11TX1
P14SCK
P15CS
P16MOSI
P17MISO
P20SCL1TCK
P21SDA1TMS
P22TDI
P23, ADC3TDO
P24PWM4
P26PWM5
P28
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Bootloader0x00000068 KiB / 0x110000x011000
App Image0x0110001.1 MiB / 0x1190000x12A000
OTA Image0x12A000664 KiB / 0xA60000x1D0000
Calibration0x1D00004 KiB / 0x10000x1D1000
Network Data0x1D10004 KiB / 0x10000x1D2000
TLV Store0x1D20004 KiB / 0x10000x1D3000
Key-Value Store0x1D300032 KiB / 0x80000x1DB000
User Data0x1DB000148 KiB / 0x250000x200000
Tuya Storage0x1ED00076 KiB / 0x130000x200000
+

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/generic-bk7231t-qfn32-tuya.json b/boards/generic-bk7231t-qfn32-tuya.json new file mode 100644 index 000000000..cfa840cf7 --- /dev/null +++ b/boards/generic-bk7231t-qfn32-tuya.json @@ -0,0 +1,101 @@ +{ + "_base": [ + "generic", + "beken-72xx", + "beken-7231", + "beken-7231t", + "beken-7231-tuya", + "ic/bk7231-qfn32" + ], + "build": { + "mcu": "bk7231t", + "variant": "generic-bk7231t-qfn32-tuya" + }, + "name": "Generic - BK7231T (Tuya QFN32)", + "symbol": "BK7231T (Tuya QFN32)", + "url": "https://docs.libretiny.eu/boards/generic-bk7231t-qfn32-tuya/", + "vendor": "Generic", + "pcb": { + "pinout": { + "1": { + "IC": 29, + "ARD": "D0" + }, + "2": { + "IC": 28, + "ARD": "D1" + }, + "3": { + "IC": 22, + "ARD": "D2" + }, + "4": { + "IC": 23, + "ARD": "D3" + }, + "5": { + "IC": 24, + "ARD": "D4" + }, + "6": { + "IC": 25, + "ARD": "D5" + }, + "7": { + "IC": 26, + "ARD": "D6" + }, + "8": { + "IC": 27, + "ARD": "D7" + }, + "9": { + "IC": 11, + "ARD": "D8" + }, + "10": { + "IC": 13, + "ARD": "D9" + }, + "11": { + "IC": 12, + "ARD": "D10" + }, + "12": { + "IC": 14, + "ARD": "D11" + }, + "13": { + "IC": 20, + "ARD": "D12" + }, + "14": { + "IC": 19, + "ARD": "D13" + }, + "15": { + "IC": 18, + "ARD": "D14" + }, + "16": { + "IC": 17, + "ARD": [ + "D15", + "A0" + ] + }, + "17": { + "IC": 16, + "ARD": "D16" + }, + "18": { + "IC": 15, + "ARD": "D17" + }, + "19": { + "IC": 10, + "ARD": "D18" + } + } + } +} diff --git a/boards/generic-bk7231t-qfn32-tuya/index.html b/boards/generic-bk7231t-qfn32-tuya/index.html new file mode 100644 index 000000000..7eaf37835 --- /dev/null +++ b/boards/generic-bk7231t-qfn32-tuya/index.html @@ -0,0 +1,2691 @@ + + + + + + + + + + + + + + + + + + + + + + + + Generic - BK7231T (Tuya QFN32) - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Generic - BK7231T (Tuya QFN32)

+

by Generic

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codegeneric-bk7231t-qfn32-tuya
MCUBK7231T
ManufacturerBeken
SeriesBK72XX
Frequency120 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O19x GPIO, 6x PWM, 2x UART, 1x ADC
Wi-Fi802.11 b/g/n
BluetoothBLE v4.2
+

Usage

+

Board code: generic-bk7231t-qfn32-tuya

+

In platformio.ini:

+
[env:generic-bk7231t-qfn32-tuya]
+platform = libretiny
+board = generic-bk7231t-qfn32-tuya
+framework = arduino
+
+

In ESPHome YAML:

+
bk72xx:
+  board: generic-bk7231t-qfn32-tuya
+
+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
P0TX2SCL2
P1RX2SDA2
P6PWM0
P7PWM1
P8PWM2
P9PWM3
P10RX1
P11TX1
P14SCK
P15CS
P16MOSI
P17MISO
P20SCL1TCK
P21SDA1TMS
P22TDI
P23, ADC3TDO
P24PWM4
P26PWM5
P28
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Bootloader0x00000068 KiB / 0x110000x011000
App Image0x0110001.1 MiB / 0x1210000x132000
OTA Image0x132000664 KiB / 0xA60000x1D8000
Key-Value Store0x1D800032 KiB / 0x80000x1E0000
Calibration0x1E00004 KiB / 0x10000x1E1000
TLV Store0x1E10004 KiB / 0x10000x1E2000
Network Data0x1E20004 KiB / 0x10000x1E3000
User Data0x1E3000116 KiB / 0x1D0000x200000
Tuya Storage0x1ED00076 KiB / 0x130000x200000
+

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/generic-bk7252.json b/boards/generic-bk7252.json new file mode 100644 index 000000000..47053512e --- /dev/null +++ b/boards/generic-bk7252.json @@ -0,0 +1,193 @@ +{ + "_base": [ + "generic", + "beken-72xx", + "beken-7252", + "ic/bk7252-qfn68" + ], + "build": { + "mcu": "bk7252", + "variant": "generic-bk7252" + }, + "name": "Generic - BK7252", + "symbol": "BK7252", + "url": "https://docs.libretiny.eu/boards/generic-bk7252/", + "vendor": "Generic", + "pcb": { + "pinout": { + "1": { + "IC": 65, + "ARD": "D0" + }, + "2": { + "IC": 64, + "ARD": "D1" + }, + "3": { + "IC": 48, + "ARD": [ + "D2", + "A5" + ] + }, + "4": { + "IC": 46, + "ARD": [ + "D3", + "A4" + ] + }, + "5": { + "IC": 47, + "ARD": [ + "D4", + "A1" + ] + }, + "6": { + "IC": 45, + "ARD": [ + "D5", + "A2" + ] + }, + "7": { + "IC": 49, + "ARD": "D6" + }, + "8": { + "IC": 50, + "ARD": "D7" + }, + "9": { + "IC": 62, + "ARD": "D8" + }, + "10": { + "IC": 63, + "ARD": "D9" + }, + "11": { + "IC": 16, + "ARD": [ + "D10", + "A6" + ] + }, + "12": { + "IC": 17, + "ARD": [ + "D11", + "A7" + ] + }, + "13": { + "IC": 32, + "ARD": "D12" + }, + "14": { + "IC": 34, + "ARD": "D13" + }, + "15": { + "IC": 33, + "ARD": "D14" + }, + "16": { + "IC": 31, + "ARD": "D15" + }, + "17": { + "IC": 35, + "ARD": "D16" + }, + "18": { + "IC": 30, + "ARD": "D17" + }, + "19": { + "IC": 41, + "ARD": "D18" + }, + "20": { + "IC": 40, + "ARD": "D19" + }, + "21": { + "IC": 39, + "ARD": "D20" + }, + "22": { + "IC": 38, + "ARD": [ + "D21", + "A3" + ] + }, + "23": { + "IC": 36, + "ARD": "D22" + }, + "24": { + "IC": 14, + "ARD": "D23" + }, + "25": { + "IC": 37, + "ARD": "D24" + }, + "26": { + "IC": 21, + "ARD": "D25" + }, + "27": { + "IC": 13, + "ARD": "D26" + }, + "28": { + "IC": 20, + "ARD": "D27" + }, + "29": { + "IC": 22, + "ARD": "D28" + }, + "30": { + "IC": 23, + "ARD": "D29" + }, + "31": { + "IC": 19, + "ARD": "D30" + }, + "32": { + "IC": 18, + "ARD": "D31" + }, + "33": { + "IC": 24, + "ARD": "D32" + }, + "34": { + "IC": 25, + "ARD": "D33" + }, + "35": { + "IC": 26, + "ARD": "D34" + }, + "36": { + "IC": 27, + "ARD": "D35" + }, + "37": { + "IC": 28, + "ARD": "D36" + }, + "38": { + "IC": 29, + "ARD": "D37" + } + } + } +} diff --git a/boards/generic-bk7252/index.html b/boards/generic-bk7252/index.html new file mode 100644 index 000000000..3815f66a5 --- /dev/null +++ b/boards/generic-bk7252/index.html @@ -0,0 +1,2831 @@ + + + + + + + + + + + + + + + + + + + + + + + + Generic - BK7252 - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Generic - BK7252

+

by Generic

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codegeneric-bk7252
MCUBK7252
ManufacturerBeken
SeriesBK72XX
Frequency180 MHz
Flash size4 MiB
RAM size512 KiB
Voltage3.0V - 3.6V
I/O38x GPIO, 4x PWM, 2x UART, 7x ADC
Wi-Fi802.11 b/g/n
BluetoothBLE v5.0
+

Usage

+

Board code: generic-bk7252

+

In platformio.ini:

+
[env:generic-bk7252]
+platform = libretiny
+board = generic-bk7252
+framework = arduino
+
+

In ESPHome YAML:

+
bk72xx:
+  board: generic-bk7252
+
+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
P0TX2SCL2
P1RX2SDA2
P2, ADC4
P3, ADC5
P4, ADC1
P5, ADC2
P6PWM0
P7PWM1
P10RX1
P11TX1
P12, ADC6CTS1
P13, ADC7RTS1
P14SCK
P15CS
P16MOSI
P17MISO
P18
P19
P20SCL1TCK
P21SDA1TMS
P22TDI
P23, ADC3TDO
P24PWM4
P25
P26PWM5
P27MCLK
P28
P29PCLK
P30HSYNC
P31VSYNC
P32PD0
P33PD1
P34PD2
P35PD3
P36PD4
P37PD5
P38PD6
P39PD7
+

Flash memory map

+

Flash size: 4 MiB / 4,194,304 B / 0x400000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Bootloader0x00000068 KiB / 0x110000x011000
App Image0x0110001.7 MiB / 0x1BA0000x1CB000
File System0x1CB0001.1 MiB / 0x1190000x2E4000
Key-Value Store0x2E400032 KiB / 0x80000x2EC000
OTA Image0x2EC0001.1 MiB / 0x1120000x3FE000
Calibration0x3FE0004 KiB / 0x10000x3FF000
TLV Store0x3FF0004 KiB / 0x10000x400000
+

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/generic-rtl8710bn-2mb-468k.json b/boards/generic-rtl8710bn-2mb-468k.json new file mode 100644 index 000000000..c3206b87d --- /dev/null +++ b/boards/generic-rtl8710bn-2mb-468k.json @@ -0,0 +1,95 @@ +{ + "_base": [ + "generic", + "realtek-ambz", + "realtek-ambz-2mb-468k", + "ic/rtl8710bn" + ], + "build": { + "mcu": "rtl8710bn", + "variant": "generic-rtl8710bn-2mb-468k" + }, + "name": "Generic - RTL8710BN (2M/468k)", + "symbol": "RTL8710BN (2M/468k)", + "url": "https://docs.libretiny.eu/boards/generic-rtl8710bn-2mb-468k/", + "vendor": "Generic", + "pcb": { + "pinout": { + "1": { + "IC": 16, + "ARD": "D0" + }, + "2": { + "IC": 28, + "ARD": "D1" + }, + "3": { + "IC": 18, + "ARD": "D2" + }, + "4": { + "IC": 19, + "ARD": "D3" + }, + "5": { + "IC": 20, + "ARD": "D4" + }, + "6": { + "IC": 21, + "ARD": "D5" + }, + "7": { + "IC": 22, + "ARD": "D6" + }, + "8": { + "IC": 23, + "ARD": "D7" + }, + "9": { + "IC": 17, + "ARD": "D8" + }, + "10": { + "IC": 13, + "ARD": "D9" + }, + "11": { + "IC": 14, + "ARD": "D10" + }, + "12": { + "IC": 29, + "ARD": "D11" + }, + "13": { + "IC": 30, + "ARD": [ + "D12", + "A0" + ] + }, + "14": { + "IC": 31, + "ARD": "D13" + }, + "15": { + "IC": 32, + "ARD": "D14" + }, + "16": { + "IC": 2, + "ARD": "D15" + }, + "17": { + "IC": 1, + "ARD": "D16" + }, + "18": { + "IC": 27, + "ARD": "A1" + } + } + } +} diff --git a/boards/generic-rtl8710bn-2mb-468k/index.html b/boards/generic-rtl8710bn-2mb-468k/index.html new file mode 100644 index 000000000..37ac01ac7 --- /dev/null +++ b/boards/generic-rtl8710bn-2mb-468k/index.html @@ -0,0 +1,2677 @@ + + + + + + + + + + + + + + + + + + + + + + + + Generic - RTL8710BN (2M/468k) - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Generic - RTL8710BN (2M/468k)

+

by Generic

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codegeneric-rtl8710bn-2mb-468k
MCURTL8710BN
ManufacturerRealtek
SeriesAmebaZ
Frequency125 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O17x GPIO, 6x PWM, 2x UART, 2x ADC
Wi-Fi802.11 b/g/n
+

Usage

+

Board code: generic-rtl8710bn-2mb-468k

+

In platformio.ini:

+
[env:generic-rtl8710bn-2mb-468k]
+platform = libretiny
+board = generic-rtl8710bn-2mb-468k
+framework = arduino
+
+

In ESPHome YAML:

+
rtl87xx:
+  board: generic-rtl8710bn-2mb-468k
+
+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
PA00PWM2
PA05PWM4
PA06FCS
PA07FD1
PA08FD2
PA09FD0
PA10FSCK
PA11FD3
PA12PWM3
PA14PWM0SWCLK
PA15PWM1SWDIO
PA18RX0SCL1SCK0, SCK1
PA19, ADC1CTS0SDA0CS0, CS1
PA22RTS0SCL0MISO0, MISO1PWM5
PA23TX0SDA1MOSI0, MOSI1PWM0
PA29RX2SCL0PWM4
PA30TX2SDA0PWM4
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Boot XIP0x00000016 KiB / 0x40000x004000
Boot RAM0x00400016 KiB / 0x40000x008000
(reserved)0x0080004 KiB / 0x10000x009000
System Data0x0090004 KiB / 0x10000x00A000
Calibration0x00A0004 KiB / 0x10000x00B000
OTA1 Image0x00B000468 KiB / 0x750000x080000
OTA2 Image0x080000468 KiB / 0x750000x0F5000
Key-Value Store0x0F500032 KiB / 0x80000x0FD000
User Data0x0FD0001 MiB / 0x1020000x1FF000
RDP0x1FF0004 KiB / 0x10000x200000
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/generic-rtl8710bn-2mb-788k.json b/boards/generic-rtl8710bn-2mb-788k.json new file mode 100644 index 000000000..a4b8dcc99 --- /dev/null +++ b/boards/generic-rtl8710bn-2mb-788k.json @@ -0,0 +1,95 @@ +{ + "_base": [ + "generic", + "realtek-ambz", + "realtek-ambz-2mb-788k", + "ic/rtl8710bn" + ], + "build": { + "mcu": "rtl8710bn", + "variant": "generic-rtl8710bn-2mb-788k" + }, + "name": "Generic - RTL8710BN (2M/788k)", + "symbol": "RTL8710BN (2M/788k)", + "url": "https://docs.libretiny.eu/boards/generic-rtl8710bn-2mb-788k/", + "vendor": "Generic", + "pcb": { + "pinout": { + "1": { + "IC": 16, + "ARD": "D0" + }, + "2": { + "IC": 28, + "ARD": "D1" + }, + "3": { + "IC": 18, + "ARD": "D2" + }, + "4": { + "IC": 19, + "ARD": "D3" + }, + "5": { + "IC": 20, + "ARD": "D4" + }, + "6": { + "IC": 21, + "ARD": "D5" + }, + "7": { + "IC": 22, + "ARD": "D6" + }, + "8": { + "IC": 23, + "ARD": "D7" + }, + "9": { + "IC": 17, + "ARD": "D8" + }, + "10": { + "IC": 13, + "ARD": "D9" + }, + "11": { + "IC": 14, + "ARD": "D10" + }, + "12": { + "IC": 29, + "ARD": "D11" + }, + "13": { + "IC": 30, + "ARD": [ + "D12", + "A0" + ] + }, + "14": { + "IC": 31, + "ARD": "D13" + }, + "15": { + "IC": 32, + "ARD": "D14" + }, + "16": { + "IC": 2, + "ARD": "D15" + }, + "17": { + "IC": 1, + "ARD": "D16" + }, + "18": { + "IC": 27, + "ARD": "A1" + } + } + } +} diff --git a/boards/generic-rtl8710bn-2mb-788k/index.html b/boards/generic-rtl8710bn-2mb-788k/index.html new file mode 100644 index 000000000..0820d57a4 --- /dev/null +++ b/boards/generic-rtl8710bn-2mb-788k/index.html @@ -0,0 +1,2677 @@ + + + + + + + + + + + + + + + + + + + + + + + + Generic - RTL8710BN (2M/788k) - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Generic - RTL8710BN (2M/788k)

+

by Generic

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codegeneric-rtl8710bn-2mb-788k
MCURTL8710BN
ManufacturerRealtek
SeriesAmebaZ
Frequency125 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O17x GPIO, 6x PWM, 2x UART, 2x ADC
Wi-Fi802.11 b/g/n
+

Usage

+

Board code: generic-rtl8710bn-2mb-788k

+

In platformio.ini:

+
[env:generic-rtl8710bn-2mb-788k]
+platform = libretiny
+board = generic-rtl8710bn-2mb-788k
+framework = arduino
+
+

In ESPHome YAML:

+
rtl87xx:
+  board: generic-rtl8710bn-2mb-788k
+
+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
PA00PWM2
PA05PWM4
PA06FCS
PA07FD1
PA08FD2
PA09FD0
PA10FSCK
PA11FD3
PA12PWM3
PA14PWM0SWCLK
PA15PWM1SWDIO
PA18RX0SCL1SCK0, SCK1
PA19, ADC1CTS0SDA0CS0, CS1
PA22RTS0SCL0MISO0, MISO1PWM5
PA23TX0SDA1MOSI0, MOSI1PWM0
PA29RX2SCL0PWM4
PA30TX2SDA0PWM4
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Boot XIP0x00000016 KiB / 0x40000x004000
Boot RAM0x00400016 KiB / 0x40000x008000
(reserved)0x0080004 KiB / 0x10000x009000
System Data0x0090004 KiB / 0x10000x00A000
Calibration0x00A0004 KiB / 0x10000x00B000
OTA1 Image0x00B000788 KiB / 0xC50000x0D0000
OTA2 Image0x0D0000788 KiB / 0xC50000x195000
Key-Value Store0x19500032 KiB / 0x80000x19D000
User Data0x19D000392 KiB / 0x620000x1FF000
RDP0x1FF0004 KiB / 0x10000x200000
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/generic-rtl8710bx-4mb-980k.json b/boards/generic-rtl8710bx-4mb-980k.json new file mode 100644 index 000000000..fb5a9a5d1 --- /dev/null +++ b/boards/generic-rtl8710bx-4mb-980k.json @@ -0,0 +1,100 @@ +{ + "_base": [ + "generic", + "realtek-ambz", + "realtek-ambz-4mb-980k", + "realtek-ambz-bx", + "ic/rtl8710bn" + ], + "build": { + "mcu": "rtl8710bx", + "variant": "generic-rtl8710bx-4mb-980k" + }, + "name": "Generic - RTL8710BX (4M/980k)", + "symbol": "RTL8710BX (4M/980k)", + "url": "https://docs.libretiny.eu/boards/generic-rtl8710bx-4mb-980k/", + "vendor": "Generic", + "doc": { + "extra": [ + "## Information", + "This is a generic board definition for RTL8710BX with 4 MiB of flash. It has a bigger application partition size (980 KiB). The used bootloader is also different from the standard Tuya one.", + "It can be found in [Ezviz T31 smart plug](https://www.ezviz.com/product/T31/2021) - bare chip soldered onto the manufacturer-made PCB. The plug is not Tuya/SmartLife-compatible and has a 25Q32CSIG flash chip. Refer to [libretiny#23](https://github.com/libretiny-eu/libretiny/issues/23) for photos and more information.", + "Note that stock firmware seems to use smaller app images (0x80000 / 512 KiB). After 0x180000 some product-test data and device logs can be found. Because the OTA2 offset is 0x100000, the board definition was configured to use all available space." + ] + }, + "pcb": { + "pinout": { + "1": { + "IC": 16, + "ARD": "D0" + }, + "2": { + "IC": 28, + "ARD": "D1" + }, + "3": { + "IC": 18, + "ARD": "D2" + }, + "4": { + "IC": 19, + "ARD": "D3" + }, + "5": { + "IC": 20, + "ARD": "D4" + }, + "6": { + "IC": 21, + "ARD": "D5" + }, + "7": { + "IC": 22, + "ARD": "D6" + }, + "8": { + "IC": 23, + "ARD": "D7" + }, + "9": { + "IC": 17, + "ARD": "D8" + }, + "10": { + "IC": 13, + "ARD": "D9" + }, + "11": { + "IC": 14, + "ARD": "D10" + }, + "12": { + "IC": 29, + "ARD": "D11" + }, + "13": { + "IC": 30, + "ARD": [ + "D12", + "A0" + ] + }, + "14": { + "IC": 31, + "ARD": "D13" + }, + "15": { + "IC": 32, + "ARD": "D14" + }, + "16": { + "IC": 2, + "ARD": "D15" + }, + "17": { + "IC": 1, + "ARD": "D16" + } + } + } +} diff --git a/boards/generic-rtl8710bx-4mb-980k/index.html b/boards/generic-rtl8710bx-4mb-980k/index.html new file mode 100644 index 000000000..0130264ad --- /dev/null +++ b/boards/generic-rtl8710bx-4mb-980k/index.html @@ -0,0 +1,2695 @@ + + + + + + + + + + + + + + + + + + + + + + + + Generic - RTL8710BX (4M/980k) - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Generic - RTL8710BX (4M/980k)

+

by Generic

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codegeneric-rtl8710bx-4mb-980k
MCURTL8710BX
ManufacturerRealtek
SeriesAmebaZ
Frequency62.5 MHz
Flash size4 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O17x GPIO, 6x PWM, 2x UART, 1x ADC
Wi-Fi802.11 b/g/n
+

Usage

+

Board code: generic-rtl8710bx-4mb-980k

+

In platformio.ini:

+
[env:generic-rtl8710bx-4mb-980k]
+platform = libretiny
+board = generic-rtl8710bx-4mb-980k
+framework = arduino
+
+

In ESPHome YAML:

+
rtl87xx:
+  board: generic-rtl8710bx-4mb-980k
+
+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
PA00PWM2
PA05PWM4
PA06FCS
PA07FD1
PA08FD2
PA09FD0
PA10FSCK
PA11FD3
PA12PWM3
PA14PWM0SWCLK
PA15PWM1SWDIO
PA18RX0SCL1SCK0, SCK1
PA19, ADC1CTS0SDA0CS0, CS1
PA22RTS0SCL0MISO0, MISO1PWM5
PA23TX0SDA1MOSI0, MOSI1PWM0
PA29RX2SCL0PWM4
PA30TX2SDA0PWM4
+

Flash memory map

+

Flash size: 4 MiB / 4,194,304 B / 0x400000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Boot XIP0x00000016 KiB / 0x40000x004000
Boot RAM0x00400016 KiB / 0x40000x008000
(reserved)0x0080004 KiB / 0x10000x009000
System Data0x0090004 KiB / 0x10000x00A000
Calibration0x00A0004 KiB / 0x10000x00B000
OTA1 Image0x00B000980 KiB / 0xF50000x100000
OTA2 Image0x100000980 KiB / 0xF50000x1F5000
Key-Value Store0x1F500032 KiB / 0x80000x1FD000
User Data0x1FD0002 MiB / 0x2020000x3FF000
RDP0x1FF0004 KiB / 0x10000x200000
+

Information

+

This is a generic board definition for RTL8710BX with 4 MiB of flash. It has a bigger application partition size (980 KiB). The used bootloader is also different from the standard Tuya one.

+

It can be found in Ezviz T31 smart plug - bare chip soldered onto the manufacturer-made PCB. The plug is not Tuya/SmartLife-compatible and has a 25Q32CSIG flash chip. Refer to libretiny#23 for photos and more information.

+

Note that stock firmware seems to use smaller app images (0x80000 / 512 KiB). After 0x180000 some product-test data and device logs can be found. Because the OTA2 offset is 0x100000, the board definition was configured to use all available space.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/generic-rtl8720cf-2mb-992k.json b/boards/generic-rtl8720cf-2mb-992k.json new file mode 100644 index 000000000..906f2972f --- /dev/null +++ b/boards/generic-rtl8720cf-2mb-992k.json @@ -0,0 +1,102 @@ +{ + "_base": [ + "generic", + "realtek-ambz2", + "realtek-ambz2-8720", + "realtek-ambz2-image", + "realtek-ambz2-2mb-992k", + "ic/rtl8720cf" + ], + "build": { + "mcu": "rtl8720cf", + "variant": "generic-rtl8720cf-2mb-992k" + }, + "name": "Generic - RTL8720CF (2M/992k)", + "symbol": "RTL8720CF (2M/992k)", + "url": "https://docs.libretiny.eu/boards/generic-rtl8720cf-2mb-992k/", + "vendor": "Generic", + "pcb": { + "pinout": { + "1": { + "IC": 15, + "ARD": "D0" + }, + "2": { + "IC": 16, + "ARD": "D1" + }, + "3": { + "IC": 18, + "ARD": "D2" + }, + "4": { + "IC": 19, + "ARD": "D3" + }, + "5": { + "IC": 20, + "ARD": "D4" + }, + "6": { + "IC": 21, + "ARD": "D5" + }, + "7": { + "IC": 22, + "ARD": "D6" + }, + "8": { + "IC": 23, + "ARD": "D7" + }, + "9": { + "IC": 24, + "ARD": "D8" + }, + "10": { + "IC": 25, + "ARD": "D9" + }, + "11": { + "IC": 26, + "ARD": "D10" + }, + "12": { + "IC": 33, + "ARD": "D11" + }, + "13": { + "IC": 34, + "ARD": "D12" + }, + "14": { + "IC": 36, + "ARD": "D13" + }, + "15": { + "IC": 37, + "ARD": "D14" + }, + "16": { + "IC": 38, + "ARD": "D15" + }, + "17": { + "IC": 39, + "ARD": "D16" + }, + "18": { + "IC": 40, + "ARD": "D17" + }, + "19": { + "IC": 1, + "ARD": "D18" + }, + "20": { + "IC": 3, + "ARD": "D19" + } + } + } +} diff --git a/boards/generic-rtl8720cf-2mb-992k/index.html b/boards/generic-rtl8720cf-2mb-992k/index.html new file mode 100644 index 000000000..7319b838c --- /dev/null +++ b/boards/generic-rtl8720cf-2mb-992k/index.html @@ -0,0 +1,2692 @@ + + + + + + + + + + + + + + + + + + + + + + + + Generic - RTL8720CF (2M/992k) - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Generic - RTL8720CF (2M/992k)

+

by Generic

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codegeneric-rtl8720cf-2mb-992k
MCURTL8720CF
ManufacturerRealtek
SeriesAmebaZ2
Frequency100 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O20x GPIO, 8x PWM, 3x UART
Wi-Fi802.11 b/g/n
BLEv4.2
+

Usage

+

Board code: generic-rtl8720cf-2mb-992k

+

In platformio.ini:

+
[env:generic-rtl8720cf-2mb-992k]
+platform = libretiny
+board = generic-rtl8720cf-2mb-992k
+framework = arduino
+
+

In ESPHome YAML:

+
rtl87xx:
+  board: generic-rtl8720cf-2mb-992k
+
+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
PA00RX1PWM0SWCLK, TCK
PA01TX1PWM1SWDIO, TMS
PA02RX1SCL0CS0PWM2TDO
PA03TX1SDA0SCK0PWM3TDI
PA04CTS1MOSI0PWM4tRST
PA07CS0
PA08SCK0
PA09RTS0MOSI0
PA10CTS0MISO0
PA11TX0SCL0PWM0
PA12RX0SDA0PWM1
PA13RX0PWM7
PA14TX0PWM2
PA15RX2SCL0CS0PWM3
PA16TX2SDA0SCK0PWM4
PA17PWM5
PA18PWM6
PA19CTS2SCL0MOSI0PWM7
PA20RTS2SDA0MISO0PWM0
PA23PWM7
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Partition Table0x0000004 KiB / 0x10000x001000
System Data0x0010004 KiB / 0x10000x002000
Calibration0x0020004 KiB / 0x10000x003000
(reserved)0x0030004 KiB / 0x10000x004000
Boot Image0x00400032 KiB / 0x80000x00C000
OTA1 Image0x00C000992 KiB / 0xF80000x104000
OTA2 Image0x104000992 KiB / 0xF80000x1FC000
Key-Value Store0x1FC00016 KiB / 0x40000x200000
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/lsc-lma35-t.json b/boards/lsc-lma35-t.json new file mode 100644 index 000000000..60a7cbad9 --- /dev/null +++ b/boards/lsc-lma35-t.json @@ -0,0 +1,30 @@ +{ + "_base": [ + "beken-72xx", + "beken-7231", + "beken-7231t", + "beken-7231-tuya", + "ic/bk7231-qfn32", + "pcb/lsc-lma35" + ], + "build": { + "mcu": "bk7231t", + "variant": "lsc-lma35-t" + }, + "name": "LSC LMA35 BK7231T", + "symbol": "LSC LMA35 T", + "url": "https://www.action.com/de-at/p/lsc-smart-connect-outdoor-led-streifen/", + "vendor": "Unknown", + "pcb": { + "symbol": "LMA35" + }, + "doc": { + "extra": [ + "## Information", + "This board has no marking on the front side, only something that looks like PCB manufacturing info on the back; thus it was named based on these symbols.", + "It can be found in 'LSC Smart Connect Outdoor LED Strip', and is likely custom-made for this product.", + "The pinout was established by writing to and probing consecutive GPIOs, using the generic board definition.", + "Pins marked with '?' are currently unknown, with a possibility of being CEN. Pin 22 (P1/D14) is also not confirmed." + ] + } +} diff --git a/boards/lsc-lma35-t/index.html b/boards/lsc-lma35-t/index.html new file mode 100644 index 000000000..90ee09736 --- /dev/null +++ b/boards/lsc-lma35-t/index.html @@ -0,0 +1,2694 @@ + + + + + + + + + + + + + + + + + + + + + + + + LSC LMA35 T - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

LSC LMA35 BK7231T

+

by Unknown

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codelsc-lma35-t
MCUBK7231T
ManufacturerBeken
SeriesBK72XX
Frequency120 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O15x GPIO, 6x PWM, 2x UART, 1x ADC
Wi-Fi802.11 b/g/n
BluetoothBLE v4.2
+

Usage

+

Board code: lsc-lma35-t

+

In platformio.ini:

+
[env:lsc-lma35-t]
+platform = libretiny
+board = lsc-lma35-t
+framework = arduino
+
+

In ESPHome YAML:

+
bk72xx:
+  board: lsc-lma35-t
+
+

Pinout

+

Pinout

+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
P0TX2SCL2
P1RX2SDA2
P6PWM0
P7PWM1
P8PWM2
P9PWM3
P10RX1
P11TX1
P14
P16
P21
P22
P23, ADC3
P24PWM4
P26PWM5
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Bootloader0x00000068 KiB / 0x110000x011000
App Image0x0110001.1 MiB / 0x1210000x132000
OTA Image0x132000664 KiB / 0xA60000x1D8000
Key-Value Store0x1D800032 KiB / 0x80000x1E0000
Calibration0x1E00004 KiB / 0x10000x1E1000
TLV Store0x1E10004 KiB / 0x10000x1E2000
Network Data0x1E20004 KiB / 0x10000x1E3000
User Data0x1E3000116 KiB / 0x1D0000x200000
Tuya Storage0x1ED00076 KiB / 0x130000x200000
+

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

+

Information

+

This board has no marking on the front side, only something that looks like PCB manufacturing info on the back; thus it was named based on these symbols.

+

It can be found in 'LSC Smart Connect Outdoor LED Strip', and is likely custom-made for this product.

+

The pinout was established by writing to and probing consecutive GPIOs, using the generic board definition.

+

Pins marked with '?' are currently unknown, with a possibility of being CEN. Pin 22 (P1/D14) is also not confirmed.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/lsc-lma35-t/lsc-lma35-t.svg b/boards/lsc-lma35-t/lsc-lma35-t.svg new file mode 100644 index 000000000..554b42bbd --- /dev/null +++ b/boards/lsc-lma35-t/lsc-lma35-t.svg @@ -0,0 +1,349 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + 3V3 + + + + + 2 + + + + P26 + + + + IRDA + + + + PWM5 + + + + + 3 + + + + P14 + + + + + 4 + + + + P16 + + + + + 5 + + + + P24 + + + + PWM4 + + + + + 6 + + + + GND + + + + + 7 + + + + P22 + + + + + 8 + + + + P0 + + + + TX2 + + + + SCL2 + + + + + 9 + + + + P23 + + + + ADC3 + + + + + 10 + + + + ? + + + + + 11 + + + + GND + + + + + 12 + + + + P8 + + + + PWM2 + + + + + 13 + + + + P9 + + + + PWM3 + + + + + 14 + + + + GND + + + + + 15 + + + + P21 + + + + + 16 + + + + P6 + + + + PWM0 + + + + + 17 + + + + P7 + + + + PWM1 + + + + + 18 + + + + P10 + + + + RX1 + + + + + 19 + + + + GND + + + + + 20 + + + + P11 + + + + TX1 + + + + + 21 + + + + ? + + + + + 22 + + + + P1 + + + + RX2 + + + + SDA2 + diff --git a/boards/lsc-lma35.json b/boards/lsc-lma35.json new file mode 100644 index 000000000..2f97e6e15 --- /dev/null +++ b/boards/lsc-lma35.json @@ -0,0 +1,29 @@ +{ + "_base": [ + "beken-72xx", + "beken-7231n", + "beken-7231-tuya", + "ic/bk7231-qfn32", + "pcb/lsc-lma35" + ], + "build": { + "mcu": "bk7231n", + "variant": "lsc-lma35" + }, + "name": "LSC LMA35 BK7231N", + "symbol": "LSC LMA35 N", + "url": "https://www.action.com/de-at/p/lsc-smart-connect-outdoor-led-streifen/", + "vendor": "Unknown", + "pcb": { + "symbol": "LMA35" + }, + "doc": { + "extra": [ + "## Information", + "This board has no marking on the front side, only something that looks like PCB manufacturing info on the back; thus it was named based on these symbols.", + "It can be found in 'LSC Smart Connect Outdoor LED Strip', and is likely custom-made for this product.", + "The pinout was established by writing to and probing consecutive GPIOs, using the generic board definition.", + "Pins marked with '?' are currently unknown, with a possibility of being CEN. Pin 22 (P1/D14) is also not confirmed." + ] + } +} diff --git a/boards/lsc-lma35/index.html b/boards/lsc-lma35/index.html new file mode 100644 index 000000000..900586666 --- /dev/null +++ b/boards/lsc-lma35/index.html @@ -0,0 +1,2694 @@ + + + + + + + + + + + + + + + + + + + + + + + + LSC LMA35 N - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

LSC LMA35 BK7231N

+

by Unknown

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codelsc-lma35
MCUBK7231N
ManufacturerBeken
SeriesBK72XX
Frequency120 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O15x GPIO, 6x PWM, 2x UART, 1x ADC
Wi-Fi802.11 b/g/n
BluetoothBLE v5.1
+

Usage

+

Board code: lsc-lma35

+

In platformio.ini:

+
[env:lsc-lma35]
+platform = libretiny
+board = lsc-lma35
+framework = arduino
+
+

In ESPHome YAML:

+
bk72xx:
+  board: lsc-lma35
+
+

Pinout

+

Pinout

+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
P0TX2SCL2
P1RX2SDA2
P6PWM0
P7PWM1
P8PWM2
P9PWM3
P10RX1
P11TX1
P14
P16
P21
P22
P23, ADC3
P24PWM4
P26PWM5
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Bootloader0x00000068 KiB / 0x110000x011000
App Image0x0110001.1 MiB / 0x1190000x12A000
OTA Image0x12A000664 KiB / 0xA60000x1D0000
Calibration0x1D00004 KiB / 0x10000x1D1000
Network Data0x1D10004 KiB / 0x10000x1D2000
TLV Store0x1D20004 KiB / 0x10000x1D3000
Key-Value Store0x1D300032 KiB / 0x80000x1DB000
User Data0x1DB000148 KiB / 0x250000x200000
Tuya Storage0x1ED00076 KiB / 0x130000x200000
+

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

+

Information

+

This board has no marking on the front side, only something that looks like PCB manufacturing info on the back; thus it was named based on these symbols.

+

It can be found in 'LSC Smart Connect Outdoor LED Strip', and is likely custom-made for this product.

+

The pinout was established by writing to and probing consecutive GPIOs, using the generic board definition.

+

Pins marked with '?' are currently unknown, with a possibility of being CEN. Pin 22 (P1/D14) is also not confirmed.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/lsc-lma35/lsc-lma35.svg b/boards/lsc-lma35/lsc-lma35.svg new file mode 100644 index 000000000..554b42bbd --- /dev/null +++ b/boards/lsc-lma35/lsc-lma35.svg @@ -0,0 +1,349 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + 3V3 + + + + + 2 + + + + P26 + + + + IRDA + + + + PWM5 + + + + + 3 + + + + P14 + + + + + 4 + + + + P16 + + + + + 5 + + + + P24 + + + + PWM4 + + + + + 6 + + + + GND + + + + + 7 + + + + P22 + + + + + 8 + + + + P0 + + + + TX2 + + + + SCL2 + + + + + 9 + + + + P23 + + + + ADC3 + + + + + 10 + + + + ? + + + + + 11 + + + + GND + + + + + 12 + + + + P8 + + + + PWM2 + + + + + 13 + + + + P9 + + + + PWM3 + + + + + 14 + + + + GND + + + + + 15 + + + + P21 + + + + + 16 + + + + P6 + + + + PWM0 + + + + + 17 + + + + P7 + + + + PWM1 + + + + + 18 + + + + P10 + + + + RX1 + + + + + 19 + + + + GND + + + + + 20 + + + + P11 + + + + TX1 + + + + + 21 + + + + ? + + + + + 22 + + + + P1 + + + + RX2 + + + + SDA2 + diff --git a/boards/shapes/tuya2_pcb.json b/boards/shapes/tuya2_pcb.json new file mode 100644 index 000000000..74ccba216 --- /dev/null +++ b/boards/shapes/tuya2_pcb.json @@ -0,0 +1,54 @@ +[ + { + "type": "rect", + "pos": "0,0", + "size": "15,17.9", + "preset": "${MASK_PRESET}" + }, + { + "comment": "Left cut stroke horizontal", + "type": "rect", + "pos": "0,14.35", + "size": "1.60,0.1", + "preset": "pcb_stroke" + }, + { + "comment": "Left cut stroke vertical", + "type": "rect", + "pos": "1.60,14.35", + "size": "0.1,3.45", + "preset": "pcb_stroke" + }, + { + "comment": "Left cut background", + "type": "rect", + "pos": "-0.1,14.45", + "size": "1.70,3.55", + "fill": { + "color": "white" + } + }, + { + "comment": "Right cut stroke horizontal", + "type": "rect", + "pos": "13.3,14.35", + "size": "1.60,0.1", + "preset": "pcb_stroke" + }, + { + "comment": "Right cut stroke vertical", + "type": "rect", + "pos": "13.3,14.35", + "size": "0.1,3.45", + "preset": "pcb_stroke" + }, + { + "comment": "Right cut background", + "type": "rect", + "pos": "13.4,14.45", + "size": "1.70,3.55", + "fill": { + "color": "white" + } + } +] diff --git a/boards/shapes/tuyau_pcb.json b/boards/shapes/tuyau_pcb.json new file mode 100644 index 000000000..ec813bb1e --- /dev/null +++ b/boards/shapes/tuyau_pcb.json @@ -0,0 +1,54 @@ +[ + { + "type": "rect", + "pos": "0,0", + "size": "15.8,20.3", + "preset": "${MASK_PRESET}" + }, + { + "comment": "Left cut stroke horizontal", + "type": "rect", + "pos": "0,17.4", + "size": "1.50,0.1", + "preset": "pcb_stroke" + }, + { + "comment": "Left cut stroke vertical", + "type": "rect", + "pos": "1.50,17.4", + "size": "0.1,2.8", + "preset": "pcb_stroke" + }, + { + "comment": "Left cut background", + "type": "rect", + "pos": "-0.1,17.5", + "size": "1.60,2.85", + "fill": { + "color": "white" + } + }, + { + "comment": "Right cut stroke horizontal", + "type": "rect", + "pos": "14.1,17.4", + "size": "1.60,0.1", + "preset": "pcb_stroke" + }, + { + "comment": "Right cut stroke vertical", + "type": "rect", + "pos": "14.1,17.4", + "size": "0.1,2.8", + "preset": "pcb_stroke" + }, + { + "comment": "Right cut background", + "type": "rect", + "pos": "14.2,17.5", + "size": "1.70,2.85", + "fill": { + "color": "white" + } + } +] diff --git a/boards/t102-v1.1.json b/boards/t102-v1.1.json new file mode 100644 index 000000000..7bb0daf51 --- /dev/null +++ b/boards/t102-v1.1.json @@ -0,0 +1,22 @@ +{ + "_base": [ + "realtek-ambz", + "realtek-ambz-2mb-788k", + "ic/rtl8710bn", + "pcb/t102" + ], + "build": { + "mcu": "rtl8710bn", + "variant": "t102-v1.1" + }, + "name": "T102_V1.1", + "url": "https://docs.libretiny.eu/boards/t102-v1.1/", + "vendor": "Unknown", + "doc": { + "fccid": "2AU7O-T102V11", + "mcu": "w302" + }, + "pcb": { + "symbol": "T102_V1.1" + } +} diff --git a/boards/t102-v1.1/index.html b/boards/t102-v1.1/index.html new file mode 100644 index 000000000..b7594c856 --- /dev/null +++ b/boards/t102-v1.1/index.html @@ -0,0 +1,2633 @@ + + + + + + + + + + + + + + + + + + + + + + + + T102-V1.1 - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

T102_V1.1

+

by Unknown

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codet102-v1.1
MCURTL8710BN (W302)
ManufacturerRealtek
SeriesAmebaZ
Frequency125 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O9x GPIO, 5x PWM, 2x UART
Wi-Fi802.11 b/g/n
FCC ID2AU7O-T102V11
+

Usage

+

Board code: t102-v1.1

+

In platformio.ini:

+
[env:t102-v1.1]
+platform = libretiny
+board = t102-v1.1
+framework = arduino
+
+

In ESPHome YAML:

+
rtl87xx:
+  board: t102-v1.1
+
+

Pinout

+

Pinout

+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
PA00PWM2
PA05PWM4
PA12PWM3
PA14PWM0SWCLK
PA15PWM1SWDIO
PA18RX0SCL1SCK0, SCK1
PA23TX0SDA1MOSI0, MOSI1PWM0
PA29RX2SCL0PWM4
PA30TX2SDA0PWM4
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Boot XIP0x00000016 KiB / 0x40000x004000
Boot RAM0x00400016 KiB / 0x40000x008000
(reserved)0x0080004 KiB / 0x10000x009000
System Data0x0090004 KiB / 0x10000x00A000
Calibration0x00A0004 KiB / 0x10000x00B000
OTA1 Image0x00B000788 KiB / 0xC50000x0D0000
OTA2 Image0x0D0000788 KiB / 0xC50000x195000
Key-Value Store0x19500032 KiB / 0x80000x19D000
User Data0x19D000392 KiB / 0x620000x1FF000
RDP0x1FF0004 KiB / 0x10000x200000
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/t102-v1.1/t102-v1.1.svg b/boards/t102-v1.1/t102-v1.1.svg new file mode 100644 index 000000000..d4b76e9cc --- /dev/null +++ b/boards/t102-v1.1/t102-v1.1.svg @@ -0,0 +1,260 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + T102_V1.1 + + + + + + + + + + + + + + + + + 2 + + + + PA12 + + + + PWM3 + + + + + 4 + + + + PA00 + + + + PWM2 + + + + + 6 + + + + PA05 + + + + PWM4 + + + + + 8 + + + + PA30 + + + + TX2 + + + + SDA0 + + + + PWM4 + + + + + 10 + + + + PA29 + + + + RX2 + + + + SCL0 + + + + PWM4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + 3V3 + + + + + 3 + + + + GND + + + + + 5 + + + + PA18 + + + + RX0 + + + + SCL1 + + + + + 7 + + + + PA23 + + + + TX0 + + + + SDA1 + + + + PWM0 + + + + + 9 + + + + PA14 + + + + PWM0 + + + + SWCLK + + + + + 11 + + + + PA15 + + + + PWM1 + + + + SWDIO + diff --git a/boards/t103-v1.0.json b/boards/t103-v1.0.json new file mode 100644 index 000000000..25692a102 --- /dev/null +++ b/boards/t103-v1.0.json @@ -0,0 +1,26 @@ +{ + "_base": [ + "realtek-ambz", + "realtek-ambz-2mb-788k", + "realtek-ambz-bx", + "ic/rtl8710bn", + "pcb/t103" + ], + "build": { + "mcu": "rtl8710bx", + "variant": "t103-v1.0" + }, + "name": "T103_V1.0", + "url": "https://docs.libretiny.eu/boards/t103-v1.0/", + "vendor": "Unknown", + "doc": { + "fccid": "2AU7O-T102V11", + "extra": [ + "## Source", + "Pinout information sourced from [teardown post by @p.kaczmarek2 from Elektroda](https://www.elektroda.pl/rtvforum/topic3984148.html)." + ] + }, + "pcb": { + "symbol": "T103_V1.0" + } +} diff --git a/boards/t103-v1.0/index.html b/boards/t103-v1.0/index.html new file mode 100644 index 000000000..9352a27ab --- /dev/null +++ b/boards/t103-v1.0/index.html @@ -0,0 +1,2665 @@ + + + + + + + + + + + + + + + + + + + + + + + + T103-V1.0 - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

T103_V1.0

+

by Unknown

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codet103-v1.0
MCURTL8710BX
ManufacturerRealtek
SeriesAmebaZ
Frequency62.5 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O11x GPIO, 6x PWM, 2x UART, 2x ADC
Wi-Fi802.11 b/g/n
FCC ID2AU7O-T102V11
+

Usage

+

Board code: t103-v1.0

+

In platformio.ini:

+
[env:t103-v1.0]
+platform = libretiny
+board = t103-v1.0
+framework = arduino
+
+

In ESPHome YAML:

+
rtl87xx:
+  board: t103-v1.0
+
+

Pinout

+

Pinout

+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
PA00PWM2
PA05PWM4
PA12PWM3
PA14PWM0SWCLK
PA15PWM1SWDIO
PA18RX0SCL1SCK0, SCK1
PA19, ADC1SDA0CS0, CS1
PA22SCL0MISO0, MISO1PWM5
PA23TX0SDA1MOSI0, MOSI1PWM0
PA29RX2SCL0PWM4
PA30TX2SDA0PWM4
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Boot XIP0x00000016 KiB / 0x40000x004000
Boot RAM0x00400016 KiB / 0x40000x008000
(reserved)0x0080004 KiB / 0x10000x009000
System Data0x0090004 KiB / 0x10000x00A000
Calibration0x00A0004 KiB / 0x10000x00B000
OTA1 Image0x00B000788 KiB / 0xC50000x0D0000
OTA2 Image0x0D0000788 KiB / 0xC50000x195000
Key-Value Store0x19500032 KiB / 0x80000x19D000
User Data0x19D000392 KiB / 0x620000x1FF000
RDP0x1FF0004 KiB / 0x10000x200000
+

Source

+

Pinout information sourced from teardown post by @p.kaczmarek2 from Elektroda.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/t103-v1.0/t103-v1.0.svg b/boards/t103-v1.0/t103-v1.0.svg new file mode 100644 index 000000000..de2a803a6 --- /dev/null +++ b/boards/t103-v1.0/t103-v1.0.svg @@ -0,0 +1,337 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + T103_V1.0 + + + + + + + + + + + + + + + + + 1 + + + + + 2 + + + + ADC2 + + + + + 3 + + + + CEN + + + + + 4 + + + + PA19 + + + + ADC1 + + + + SDA0 + + + + CS0 + + + + CS1 + + + + + 5 + + + + PA14 + + + + PWM0 + + + + SWCLK + + + + + 6 + + + + PA15 + + + + PWM1 + + + + SWDIO + + + + + 7 + + + + PA00 + + + + PWM2 + + + + + 8 + + + + 3V3 + + + + + 9 + + + + GND + + + + + 10 + + + + PA22 + + + + SCL0 + + + + MISO0 + + + + MISO1 + + + + PWM5 + + + + + 11 + + + + PA29 + + + + RX2 + + + + SCL0 + + + + PWM4 + + + + + 12 + + + + PA30 + + + + TX2 + + + + SDA0 + + + + PWM4 + + + + + 13 + + + + PA05 + + + + PWM4 + + + + + 14 + + + + PA12 + + + + PWM3 + + + + + 15 + + + + PA18 + + + + RX0 + + + + SCL1 + + + + SCK0 + + + + SCK1 + + + + + 16 + + + + PA23 + + + + TX0 + + + + SDA1 + + + + MOSI0 + + + + MOSI1 + + + + PWM0 + diff --git a/boards/t112-v1.1.json b/boards/t112-v1.1.json new file mode 100644 index 000000000..2d43fe4dd --- /dev/null +++ b/boards/t112-v1.1.json @@ -0,0 +1,22 @@ +{ + "_base": [ + "realtek-ambz", + "realtek-ambz-2mb-788k", + "ic/rtl8710bn", + "pcb/t112" + ], + "build": { + "mcu": "rtl8710bn", + "variant": "t112-v1.1" + }, + "name": "T112_V1.1", + "url": "https://docs.libretiny.eu/boards/t112-v1.1/", + "vendor": "Unknown", + "doc": { + "fccid": "2AU7O-T102V11", + "mcu": "w302" + }, + "pcb": { + "symbol": "T112_V1.1" + } +} diff --git a/boards/t112-v1.1/index.html b/boards/t112-v1.1/index.html new file mode 100644 index 000000000..9839c9e75 --- /dev/null +++ b/boards/t112-v1.1/index.html @@ -0,0 +1,2649 @@ + + + + + + + + + + + + + + + + + + + + + + + + T112-V1.1 - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

T112_V1.1

+

by Unknown

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codet112-v1.1
MCURTL8710BN (W302)
ManufacturerRealtek
SeriesAmebaZ
Frequency125 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O11x GPIO, 6x PWM, 2x UART, 1x ADC
Wi-Fi802.11 b/g/n
FCC ID2AU7O-T102V11
+

Usage

+

Board code: t112-v1.1

+

In platformio.ini:

+
[env:t112-v1.1]
+platform = libretiny
+board = t112-v1.1
+framework = arduino
+
+

In ESPHome YAML:

+
rtl87xx:
+  board: t112-v1.1
+
+

Pinout

+

Pinout

+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
PA00PWM2
PA05PWM4
PA12PWM3
PA14PWM0SWCLK
PA15PWM1SWDIO
PA18RX0SCL1SCK0, SCK1
PA19, ADC1SDA0CS0, CS1
PA22SCL0MISO0, MISO1PWM5
PA23TX0SDA1MOSI0, MOSI1PWM0
PA29RX2SCL0PWM4
PA30TX2SDA0PWM4
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Boot XIP0x00000016 KiB / 0x40000x004000
Boot RAM0x00400016 KiB / 0x40000x008000
(reserved)0x0080004 KiB / 0x10000x009000
System Data0x0090004 KiB / 0x10000x00A000
Calibration0x00A0004 KiB / 0x10000x00B000
OTA1 Image0x00B000788 KiB / 0xC50000x0D0000
OTA2 Image0x0D0000788 KiB / 0xC50000x195000
Key-Value Store0x19500032 KiB / 0x80000x19D000
User Data0x19D000392 KiB / 0x620000x1FF000
RDP0x1FF0004 KiB / 0x10000x200000
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/t112-v1.1/t112-v1.1.svg b/boards/t112-v1.1/t112-v1.1.svg new file mode 100644 index 000000000..b29386cfe --- /dev/null +++ b/boards/t112-v1.1/t112-v1.1.svg @@ -0,0 +1,287 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + T112_V1.1 + + + + + + + + + + + + + + + + + 1 + + + + 3V3 + + + + + 2 + + + + PA29 + + + + RX2 + + + + PWM4 + + + + + 3 + + + + PA19 + + + + ADC1 + + + + + 4 + + + + PA15 + + + + PWM1 + + + + SWDIO + + + + + 5 + + + + PA14 + + + + PWM0 + + + + SWCLK + + + + + 6 + + + + PA00 + + + + PWM2 + + + + + 7 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 8 + + + + PA05 + + + + PWM4 + + + + + 9 + + + + PA18 + + + + RX0 + + + + + 10 + + + + PA12 + + + + PWM3 + + + + + 11 + + + + PA23 + + + + TX0 + + + + PWM0 + + + + + 12 + + + + PA22 + + + + PWM5 + + + + + 13 + + + + PA30 + + + + TX2 + + + + PWM4 + + + + + 14 + + + + GND + diff --git a/boards/templates/custom-20x24-22.json b/boards/templates/custom-20x24-22.json new file mode 100644 index 000000000..c17eb8e6e --- /dev/null +++ b/boards/templates/custom-20x24-22.json @@ -0,0 +1,141 @@ +{ + "name": "custom-20x24-22", + "title": "Custom 20x24mm form factor (22-pin)", + "width": 20, + "height": 24, + "vars": { + "PINTYPE_VERT": "pin_vert_cast_nohole", + "PINTYPE_HORZ": "pin_horz_cast_nohole", + "RASTER": 2, + "RF_W": 20, + "RF_H": 6.5 + }, + "front": [ + { + "comment": "PCB soldermask", + "type": "rect", + "pos": "0,0", + "size": "20,24", + "preset": "${MASK_PRESET}" + }, + { + "comment": "Pins (1-7)", + "id": "left", + "name": "r_pins_vert", + "repeat": 7, + "pos": "0,8.5", + "vars": { + "PINDIR": "left" + } + }, + { + "comment": "Pins (8-15)", + "id": "right", + "name": "r_pins_vert", + "repeat": 7, + "pos": "20,8.5", + "vars": { + "PINDIR": "right" + } + }, + { + "comment": "Pins (16-22)", + "name": "r_pins_horz", + "repeat": 8, + "pos": "3,24", + "vars": { + "PINDIR": "down" + } + }, + { + "comment": "Pin labels (16-22)", + "id": "down", + "name": "r_labels_horz", + "repeat": 8, + "pos": "3,24", + "vars": { + "PINDIR": "down" + } + }, + { + "comment": "Metal shielding", + "type": "rect", + "pos": "1.2,6.95", + "size": "17.6,15.8", + "preset": "shield" + } + ], + "back": [ + { + "comment": "PCB soldermask", + "type": "rect", + "pos": "0,0", + "size": "20,24", + "preset": "${MASK_PRESET}" + }, + { + "comment": "Pins (8-15)", + "id": "right", + "name": "r_pins_vert", + "repeat": 7, + "pos": "0,8.5", + "vars": { + "PINDIR": "left" + } + }, + { + "comment": "Pins (1-7)", + "id": "left", + "name": "r_pins_vert", + "repeat": 7, + "pos": "20,8.5", + "vars": { + "PINDIR": "right" + } + }, + { + "comment": "Pins (16-22)", + "name": "r_pins_horz", + "repeat": 8, + "pos": "3,24", + "vars": { + "PINDIR": "down" + } + }, + { + "comment": "Pin labels (16-22)", + "id": "down", + "name": "r_labels_horz", + "repeat": 8, + "pos": "3,24", + "vars": { + "PINDIR": "down" + } + } + ], + "pads": { + "1": "custom-20x24-22.front.left.pin1", + "2": "custom-20x24-22.front.left.pin2", + "3": "custom-20x24-22.front.left.pin3", + "4": "custom-20x24-22.front.left.pin4", + "5": "custom-20x24-22.front.left.pin5", + "6": "custom-20x24-22.front.left.pin6", + "7": "custom-20x24-22.front.left.pin7", + "8": "custom-20x24-22.front.right.pin7", + "9": "custom-20x24-22.front.right.pin6", + "10": "custom-20x24-22.front.right.pin5", + "11": "custom-20x24-22.front.right.pin4", + "12": "custom-20x24-22.front.right.pin3", + "13": "custom-20x24-22.front.right.pin2", + "14": "custom-20x24-22.front.right.pin1", + "15": "custom-20x24-22.front.down.label1.anchor", + "16": "custom-20x24-22.front.down.label2.anchor", + "17": "custom-20x24-22.front.down.label3.anchor", + "18": "custom-20x24-22.front.down.label4.anchor", + "19": "custom-20x24-22.front.down.label5.anchor", + "20": "custom-20x24-22.front.down.label6.anchor", + "21": "custom-20x24-22.front.down.label7.anchor", + "22": "custom-20x24-22.front.down.label8.anchor" + }, + "test_pads": {} +} diff --git a/boards/templates/tuya-16x24.json b/boards/templates/tuya-16x24.json new file mode 100644 index 000000000..4fe687393 --- /dev/null +++ b/boards/templates/tuya-16x24.json @@ -0,0 +1,27 @@ +{ + "name": "tuya-16x24", + "title": "Tuya boards; 16x24mm; 16 or 22 pin", + "width": 16, + "height": 24, + "front": [ + { + "comment": "Line below model name", + "type": "rect", + "pos": "0.5,6.2", + "size": "15,0.15", + "fill": { + "color": "${SILK_COLOR}" + } + }, + { + "comment": "Board model name", + "type": "text", + "pos": "7.0,5.5", + "text": "${SYMBOL}", + "font_size": 1.0, + "fill": { + "color": "${SILK_COLOR}" + } + } + ] +} diff --git a/boards/templates/tuya1.json b/boards/templates/tuya1.json new file mode 100644 index 000000000..3135f6ccf --- /dev/null +++ b/boards/templates/tuya1.json @@ -0,0 +1,99 @@ +{ + "name": "tuya1", + "title": "Tuya boards; 1 series", + "width": 18, + "height": 23.5, + "vars": { + "PINTYPE_VERT": "pin_vert_cast_nohole", + "PINTYPE_HORZ": "pin_horz_cast_nohole", + "RASTER": 1.5, + "RF_W": 18, + "RF_H": 6.1 + }, + "front": [ + { + "comment": "PCB soldermask", + "type": "rect", + "pos": "0,0", + "size": "18,23.5", + "preset": "${MASK_PRESET}" + }, + { + "comment": "Metal shielding", + "type": "rect", + "pos": "1.3,7.3", + "size": "15.4,15.4", + "preset": "shield" + }, + { + "comment": "Pins (1-9)", + "id": "left", + "name": "r_pins_vert", + "repeat": 9, + "pos": "0,10.6", + "vars": { + "PINDIR": "left" + } + }, + { + "comment": "Pins (10-18)", + "id": "right", + "name": "r_pins_vert", + "repeat": 9, + "pos": "18,10.6", + "vars": { + "PINDIR": "right" + } + } + ], + "back": [ + { + "comment": "PCB soldermask", + "type": "rect", + "pos": "0,0", + "size": "18,23.5", + "preset": "${MASK_PRESET}" + }, + { + "comment": "Pins (1-9)", + "id": "left", + "name": "r_pins_vert", + "repeat": 9, + "pos": "0,10.6", + "vars": { + "PINDIR": "left" + } + }, + { + "comment": "Pins (10-18)", + "id": "right", + "name": "r_pins_vert", + "repeat": 9, + "pos": "18,10.6", + "vars": { + "PINDIR": "right" + } + } + ], + "pads": { + "1": "tuya1.front.left.pin1", + "2": "tuya1.front.left.pin2", + "3": "tuya1.front.left.pin3", + "4": "tuya1.front.left.pin4", + "5": "tuya1.front.left.pin5", + "6": "tuya1.front.left.pin6", + "7": "tuya1.front.left.pin7", + "8": "tuya1.front.left.pin8", + "9": "tuya1.front.left.pin9", + "10": "tuya1.front.right.pin9", + "11": "tuya1.front.right.pin8", + "12": "tuya1.front.right.pin7", + "13": "tuya1.front.right.pin6", + "14": "tuya1.front.right.pin5", + "15": "tuya1.front.right.pin4", + "16": "tuya1.front.right.pin3", + "17": "tuya1.front.right.pin2", + "18": "tuya1.front.right.pin1" + }, + "test_pads": {} +} diff --git a/boards/templates/tuya1s.json b/boards/templates/tuya1s.json new file mode 100644 index 000000000..a5436d4ff --- /dev/null +++ b/boards/templates/tuya1s.json @@ -0,0 +1,64 @@ +{ + "name": "tuya1s", + "title": "Tuya boards; 1S series", + "width": 18, + "height": 23.5, + "vars": { + "PINTYPE_VERT": "pin_vert_cast_nohole", + "PINTYPE_HORZ": "pin_horz_cast_nohole", + "RASTER": 1.5, + "RF_W": 18, + "RF_H": 6.1 + }, + "front": [ + { + "comment": "Pins (19-24)", + "name": "r_pins_horz", + "repeat": 6, + "pos": "5.25,23.5", + "vars": { + "PINDIR": "down" + } + }, + { + "comment": "Pin labels (19-24)", + "id": "down", + "name": "r_labels_horz", + "repeat": 6, + "pos": "5.25,23.5", + "vars": { + "PINDIR": "down" + } + } + ], + "back": [ + { + "comment": "Pins (10-18)", + "name": "r_pins_vert", + "repeat": 9, + "pos": "18,10.6", + "vars": { + "PINDIR": "right" + } + }, + { + "comment": "Pins (19-24)", + "id": "down", + "name": "r_pins_horz", + "repeat": 6, + "pos": "5.25,23.5", + "vars": { + "PINDIR": "down" + } + } + ], + "pads": { + "19": "tuya1s.front.down.label1.anchor", + "20": "tuya1s.front.down.label2.anchor", + "21": "tuya1s.front.down.label3.anchor", + "22": "tuya1s.front.down.label4.anchor", + "23": "tuya1s.front.down.label5.anchor", + "24": "tuya1s.front.down.label6.anchor" + }, + "test_pads": {} +} diff --git a/boards/templates/tuya2.json b/boards/templates/tuya2.json new file mode 100644 index 000000000..e7f11a76f --- /dev/null +++ b/boards/templates/tuya2.json @@ -0,0 +1,80 @@ +{ + "name": "tuya2", + "title": "Tuya boards; 2 series", + "width": 15, + "height": 17.9, + "vars": { + "PINTYPE_HORZ": "pad_10x25", + "PINDIR": "down", + "RASTER": 2, + "RF_W": 15, + "RF_H": 5.5 + }, + "front": [ + { + "name": "tuya2_pcb", + "pos": "0,0" + }, + { + "comment": "Metal shielding", + "type": "rect", + "pos": "0.3,6", + "size": "14.4,8", + "preset": "shield" + }, + { + "comment": "Pins (10,8,6,4,2)", + "name": "r_pins_horz", + "repeat": 5, + "pos": "3.5,16.3" + }, + { + "comment": "Pin labels (10,8,6,4,2)", + "id": "pins", + "name": "r_labels_horz", + "repeat": 5, + "pos": "3.5,17.9" + }, + { + "type": "text", + "pos": "6.0,5.5", + "text": "${SYMBOL}", + "font_size": 1.0, + "fill": { + "color": "${SILK_COLOR}" + } + } + ], + "back": [ + { + "name": "tuya2_pcb", + "pos": "0,0" + }, + { + "comment": "Pins (1,3,5,7,9,11)", + "name": "r_pins_horz", + "repeat": 6, + "pos": "2.5,16.3" + }, + { + "comment": "Pin labels (1,3,5,7,9,11)", + "id": "pins", + "name": "r_labels_horz", + "repeat": 6, + "pos": "2.5,17.9" + } + ], + "pads": { + "1": "tuya2.back.pins.label1.anchor", + "2": "tuya2.front.pins.label5.anchor", + "3": "tuya2.back.pins.label2.anchor", + "4": "tuya2.front.pins.label4.anchor", + "5": "tuya2.back.pins.label3.anchor", + "6": "tuya2.front.pins.label3.anchor", + "7": "tuya2.back.pins.label4.anchor", + "8": "tuya2.front.pins.label2.anchor", + "9": "tuya2.back.pins.label5.anchor", + "10": "tuya2.front.pins.label1.anchor", + "11": "tuya2.back.pins.label6.anchor" + } +} diff --git a/boards/templates/tuya2l.json b/boards/templates/tuya2l.json new file mode 100644 index 000000000..8098c9301 --- /dev/null +++ b/boards/templates/tuya2l.json @@ -0,0 +1,73 @@ +{ + "name": "tuya2l", + "title": "Tuya boards; 2L series", + "width": 15, + "height": 17.3, + "vars": { + "PINTYPE_HORZ": "pin_horz_cast_hole", + "PINDIR": "down", + "RASTER": 2, + "RF_W": 15, + "RF_H": 5.5 + }, + "front": [ + { + "type": "rect", + "pos": "0,0", + "size": "15,17.3", + "preset": "${MASK_PRESET}" + }, + { + "comment": "Metal shielding", + "type": "rect", + "pos": "0.7,6", + "size": "13.6,9", + "preset": "shield" + }, + { + "comment": "Pins (1-7)", + "name": "r_pins_horz", + "repeat": 7, + "pos": "1.5,17.3" + }, + { + "comment": "Pin labels (1-7)", + "id": "pins", + "name": "r_labels_horz", + "repeat": 7, + "pos": "1.5,17.3" + }, + { + "type": "text", + "pos": "6.0,5.5", + "text": "${SYMBOL}", + "font_size": 1.0, + "fill": { + "color": "${SILK_COLOR}" + } + } + ], + "back": [ + { + "type": "rect", + "pos": "0,0", + "size": "15,17.3", + "preset": "${MASK_PRESET}" + }, + { + "comment": "Pins (1-7)", + "name": "r_pins_horz", + "repeat": 7, + "pos": "1.5,17.3" + } + ], + "pads": { + "1": "tuya2l.front.pins.label1.anchor", + "2": "tuya2l.front.pins.label2.anchor", + "3": "tuya2l.front.pins.label3.anchor", + "4": "tuya2l.front.pins.label4.anchor", + "5": "tuya2l.front.pins.label5.anchor", + "6": "tuya2l.front.pins.label6.anchor", + "7": "tuya2l.front.pins.label7.anchor" + } +} diff --git a/boards/templates/tuyalc5.json b/boards/templates/tuyalc5.json new file mode 100644 index 000000000..174b138db --- /dev/null +++ b/boards/templates/tuyalc5.json @@ -0,0 +1,255 @@ +{ + "name": "tuyalc5", + "title": "Tuya boards; LC5 series", + "width": 15.8, + "height": 20.3, + "vars": { + "RASTER": 2 + }, + "front": [ + { + "type": "rect", + "pos": "0,0", + "size": "8.5,12.7", + "preset": "${MASK_PRESET}" + }, + { + "comment": "Middle cut background", + "type": "rect", + "pos": "4,10.3", + "size": "2.5,2.4", + "fill": { + "color": "white" + } + }, + { + "comment": "Middle cut stroke top", + "type": "rect", + "pos": "3.9,10.2", + "size": "2.7,0.1", + "preset": "pcb_stroke" + }, + { + "comment": "Middle cut stroke left", + "type": "rect", + "pos": "3.9,10.3", + "size": "0.1,2.4", + "preset": "pcb_stroke" + }, + { + "comment": "Middle cut stroke right", + "type": "rect", + "pos": "6.5,10.3", + "size": "0.1,2.4", + "preset": "pcb_stroke" + }, + { + "comment": "Right cut background", + "type": "rect", + "pos": "7.7,10.3", + "size": "0.8,2.4", + "fill": { + "color": "white" + } + }, + { + "comment": "Right cut stroke top", + "type": "rect", + "pos": "7.6,10.2", + "size": "0.9,0.1", + "preset": "pcb_stroke" + }, + { + "comment": "Right cut stroke left", + "type": "rect", + "pos": "7.6,10.3", + "size": "0.1,2.4", + "preset": "pcb_stroke" + }, + { + "comment": "Pins (1-2)", + "id": "left", + "name": "r_pins_horz", + "repeat": 2, + "pos": "1.26,11.58", + "vars": { + "PINTYPE_HORZ": "pad", + "PINDIR": "down", + "RASTER": 2, + "W": 1, + "H": 2, + "R": 0.3 + } + }, + { + "comment": "Pins (3)", + "name": "pad", + "pos": "7.13,11.58", + "vars": { + "W": 1, + "H": 2, + "R": 0.3 + } + }, + { + "comment": "Pin label (1)", + "id": "pin1", + "name": "label_line_down", + "pos": "1.26,12.7", + "vars": { + "DIR": "left", + "W": 0, + "H": 2 + } + }, + { + "comment": "Pin label (2)", + "id": "pin2", + "name": "label_line_down", + "pos": "3.26,12.7", + "vars": { + "DIR": "left", + "W": 2, + "H": 4 + } + }, + { + "comment": "Pin label (3)", + "id": "pin3", + "name": "label_line_down", + "pos": "7.13,12.7", + "vars": { + "DIR": "left", + "W": 5.87, + "H": 6 + } + } + ], + "back": [ + { + "type": "rect", + "pos": "0,0", + "size": "8.5,12.7", + "preset": "${MASK_PRESET}" + }, + { + "comment": "Middle cut background", + "type": "rect", + "pos": "8.5-4-2.5,10.3", + "size": "2.5,2.4", + "fill": { + "color": "white" + } + }, + { + "comment": "Middle cut stroke top", + "type": "rect", + "pos": "8.5-3.9-2.7,10.2", + "size": "2.7,0.1", + "preset": "pcb_stroke" + }, + { + "comment": "Middle cut stroke left", + "type": "rect", + "pos": "8.5-3.9-0.1,10.3", + "size": "0.1,2.4", + "preset": "pcb_stroke" + }, + { + "comment": "Middle cut stroke right", + "type": "rect", + "pos": "8.5-6.5-0.1,10.3", + "size": "0.1,2.4", + "preset": "pcb_stroke" + }, + { + "comment": "Right cut background", + "type": "rect", + "pos": "8.5-7.7-0.8,10.3", + "size": "0.8,2.4", + "fill": { + "color": "white" + } + }, + { + "comment": "Right cut stroke top", + "type": "rect", + "pos": "8.5-7.6-0.9,10.2", + "size": "0.9,0.1", + "preset": "pcb_stroke" + }, + { + "comment": "Right cut stroke left", + "type": "rect", + "pos": "8.5-7.6-0.1,10.3", + "size": "0.1,2.4", + "preset": "pcb_stroke" + }, + { + "comment": "Pins (1-2)", + "id": "left", + "name": "r_pins_horz", + "repeat": 2, + "pos": "8.5-1.26-2,11.58", + "vars": { + "PINTYPE_HORZ": "pad", + "PINDIR": "down", + "RASTER": 2, + "W": 1, + "H": 2, + "R": 0.3 + } + }, + { + "comment": "Pins (3)", + "name": "pad", + "pos": "8.5-7.13,11.58", + "vars": { + "W": 1, + "H": 2, + "R": 0.3 + } + }, + { + "comment": "Pin label (1)", + "id": "pin1", + "name": "label_line_down", + "pos": "8.5-1.26,12.7", + "vars": { + "DIR": "right", + "W": 0, + "H": 2 + } + }, + { + "comment": "Pin label (2)", + "id": "pin2", + "name": "label_line_down", + "pos": "8.5-3.26,12.7", + "vars": { + "DIR": "right", + "W": 2, + "H": 4 + } + }, + { + "comment": "Pin label (3)", + "id": "pin3", + "name": "label_line_down", + "pos": "8.5-7.13,12.7", + "vars": { + "DIR": "right", + "W": 5.87, + "H": 6 + } + } + ], + "pads": { + "1": "tuyalc5.front.pin1.anchor", + "2": "tuyalc5.back.pin1.anchor", + "3": "tuyalc5.front.pin2.anchor", + "4": "tuyalc5.back.pin2.anchor", + "5": "tuyalc5.front.pin3.anchor", + "6": "tuyalc5.back.pin3.anchor" + } +} diff --git a/boards/templates/tuyau.json b/boards/templates/tuyau.json new file mode 100644 index 000000000..7fe5aec89 --- /dev/null +++ b/boards/templates/tuyau.json @@ -0,0 +1,162 @@ +{ + "name": "tuyau", + "title": "Tuya boards; U series", + "width": 15.8, + "height": 20.3, + "vars": { + "PINTYPE_VERT": "pin_vert_cast_nohole", + "PINTYPE_HORZ": "pin_horz_cast_nohole", + "RF_W": 15.8, + "RF_H": 5.2 + }, + "front": [ + { + "name": "tuyau_pcb", + "pos": "0,0" + }, + { + "comment": "Metal shielding", + "type": "rect", + "pos": "1.1,5.6", + "size": "13.6,11.5", + "preset": "shield" + }, + { + "comment": "Pins (1-7)", + "id": "left", + "name": "r_pins_vert", + "repeat": 7, + "pos": "0,6.1", + "vars": { + "PINDIR": "left", + "RASTER": 1.4 + } + }, + { + "comment": "Pins (8-14)", + "name": "r_pins_horz", + "repeat": 7, + "pos": "2.5,20.3", + "vars": { + "PINDIR": "down", + "RASTER": 1.8 + } + }, + { + "comment": "Long pads (8-14)", + "name": "r_pins_horz", + "repeat": 7, + "pos": "2.5,17.5 + 1.2", + "vars": { + "PINTYPE_HORZ": "pad", + "W": "0.6 * 1.8", + "H": 2.4, + "R": 0, + "RASTER": 1.8 + } + }, + { + "comment": "Pin labels (8-14)", + "id": "down", + "name": "r_labels_horz", + "repeat": 7, + "pos": "2.5,20.3", + "vars": { + "PINDIR": "down", + "RASTER": 1.8 + } + }, + { + "comment": "Pins (15-21)", + "id": "right", + "name": "r_pins_vert", + "repeat": 7, + "pos": "15.8,6.1", + "vars": { + "PINDIR": "right", + "RASTER": 1.4 + } + }, + { + "type": "text", + "pos": "6.5,5.0", + "text": "${SYMBOL}", + "font_size": 1.0, + "fill": { + "color": "${SILK_COLOR}" + } + } + ], + "back": [ + { + "name": "tuyau_pcb", + "pos": "0,0" + }, + { + "comment": "Pins (1-7)", + "name": "r_pins_vert", + "repeat": 7, + "pos": "0,6.1", + "vars": { + "PINDIR": "left", + "RASTER": 1.4 + } + }, + { + "comment": "Pins (8-14)", + "name": "r_pins_horz", + "repeat": 7, + "pos": "2.5,20.3", + "vars": { + "PINDIR": "down", + "RASTER": 1.8 + } + }, + { + "comment": "Long pads (8-14)", + "name": "r_pins_horz", + "repeat": 7, + "pos": "2.5,17.5 + 1.2", + "vars": { + "PINTYPE_HORZ": "pad", + "W": "0.6 * 1.8", + "H": 2.4, + "R": 0, + "RASTER": 1.8 + } + }, + { + "comment": "Pins (15-21)", + "name": "r_pins_vert", + "repeat": 7, + "pos": "15.8,6.1", + "vars": { + "PINDIR": "right", + "RASTER": 1.4 + } + } + ], + "pads": { + "1": "tuyau.front.left.pin1", + "2": "tuyau.front.left.pin2", + "3": "tuyau.front.left.pin3", + "4": "tuyau.front.left.pin4", + "5": "tuyau.front.left.pin5", + "6": "tuyau.front.left.pin6", + "7": "tuyau.front.left.pin7", + "8": "tuyau.front.down.label1.anchor", + "9": "tuyau.front.down.label2.anchor", + "10": "tuyau.front.down.label3.anchor", + "11": "tuyau.front.down.label4.anchor", + "12": "tuyau.front.down.label5.anchor", + "13": "tuyau.front.down.label6.anchor", + "14": "tuyau.front.down.label7.anchor", + "15": "tuyau.front.right.pin7", + "16": "tuyau.front.right.pin6", + "17": "tuyau.front.right.pin5", + "18": "tuyau.front.right.pin4", + "19": "tuyau.front.right.pin3", + "20": "tuyau.front.right.pin2", + "21": "tuyau.front.right.pin1" + } +} diff --git a/boards/variants/bw12.c b/boards/variants/bw12.c new file mode 100644 index 000000000..8b631e674 --- /dev/null +++ b/boards/variants/bw12.c @@ -0,0 +1,48 @@ +/* This file was auto-generated from bw12.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: PA05, PWM4, WAKE1 + {PA_5, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D1: PA29, UART2_RX, I2C0_SCL, PWM4 + {PA_29, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D2: PA00, PWM2 + {PA_0, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D3: PA19, ADC1, UART0_CTS, SPI0_CS, SPI1_CS, I2C0_SDA, SD_D3, TMR5_TRIG, I2S0_TX + {PA_19, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D4: PA22, UART0_RTS, SPI0_MISO, SPI1_MISO, I2C0_SCL, SD_D0, PWM5, I2S0_WS, WAKE2 + {PA_22, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D5: PA30, UART2_TX, I2C0_SDA, PWM4 + {PA_30, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D6: PA14, PWM0, SWCLK + {PA_14, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D7: PA12, PWM3 + {PA_12, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D8: PA15, PWM1, SWDIO + {PA_15, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D9: PA18, UART0_RX, SPI0_SCK, SPI1_SCK, I2C1_SCL, SD_D2, TMR4_TRIG, I2S0_MCK, WAKE0 + {PA_18, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D10: PA23, UART0_TX, SPI0_MOSI, SPI1_MOSI, I2C1_SDA, SD_D1, PWM0, WAKE3 + {PA_23, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_SPI | PIN_UART, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[2]), // PA_0 (D2) + [5] = &(lt_arduino_pin_info_list[0]), // PA_5 (D0) + [12] = &(lt_arduino_pin_info_list[7]), // PA_12 (D7) + [14] = &(lt_arduino_pin_info_list[6]), // PA_14 (D6) + [15] = &(lt_arduino_pin_info_list[8]), // PA_15 (D8) + [18] = &(lt_arduino_pin_info_list[9]), // PA_18 (D9) + [19] = &(lt_arduino_pin_info_list[3]), // PA_19 (D3) + [22] = &(lt_arduino_pin_info_list[4]), // PA_22 (D4) + [23] = &(lt_arduino_pin_info_list[10]), // PA_23 (D10) + [29] = &(lt_arduino_pin_info_list[1]), // PA_29 (D1) + [30] = &(lt_arduino_pin_info_list[5]), // PA_30 (D5) +}; +// clang-format on diff --git a/boards/variants/bw12.h b/boards/variants/bw12.h new file mode 100644 index 000000000..8d66f68a5 --- /dev/null +++ b/boards/variants/bw12.h @@ -0,0 +1,138 @@ +/* This file was auto-generated from bw12.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 11 // Total GPIO count +#define NUM_DIGITAL_PINS 11 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 1 // ADC inputs +#define NUM_ANALOG_OUTPUTS 9 // PWM & DAC outputs +#define PINS_GPIO_MAX 30 // Last usable GPIO number + +// SPI Interfaces +// -------------- +#define PIN_SPI0_CS 19u // PA_19 +#define PIN_SPI0_MISO 22u // PA_22 +#define PIN_SPI0_MOSI 23u // PA_23 +#define PIN_SPI0_SCK 18u // PA_18 +#define PIN_SPI1_CS 19u // PA_19 +#define PIN_SPI1_MISO 22u // PA_22 +#define PIN_SPI1_MOSI 23u // PA_23 +#define PIN_SPI1_SCK 18u // PA_18 +#define PINS_SPI0_CS (pin_size_t[]){19u} +#define PINS_SPI0_MISO (pin_size_t[]){22u} +#define PINS_SPI0_MOSI (pin_size_t[]){23u} +#define PINS_SPI0_SCK (pin_size_t[]){18u} +#define PINS_SPI1_CS (pin_size_t[]){19u} +#define PINS_SPI1_MISO (pin_size_t[]){22u} +#define PINS_SPI1_MOSI (pin_size_t[]){23u} +#define PINS_SPI1_SCK (pin_size_t[]){18u} + +// Wire Interfaces +// --------------- +#define PIN_WIRE0_SCL_0 29u // PA_29 +#define PIN_WIRE0_SCL_1 22u // PA_22 +#define PIN_WIRE0_SDA_0 19u // PA_19 +#define PIN_WIRE0_SDA_1 30u // PA_30 +#define PIN_WIRE1_SCL 18u // PA_18 +#define PIN_WIRE1_SDA 23u // PA_23 +#define PINS_WIRE0_SCL (pin_size_t[]){29u, 22u} +#define PINS_WIRE0_SDA (pin_size_t[]){19u, 30u} +#define PINS_WIRE1_SCL (pin_size_t[]){18u} +#define PINS_WIRE1_SDA (pin_size_t[]){23u} + +// Serial ports +// ------------ +#define PIN_SERIAL0_CTS 19u // PA_19 +#define PIN_SERIAL0_RTS 22u // PA_22 +#define PIN_SERIAL0_RX 18u // PA_18 +#define PIN_SERIAL0_TX 23u // PA_23 +#define PIN_SERIAL2_RX 29u // PA_29 +#define PIN_SERIAL2_TX 30u // PA_30 +#define PINS_SERIAL0_CTS (pin_size_t[]){19u} +#define PINS_SERIAL0_RTS (pin_size_t[]){22u} +#define PINS_SERIAL0_RX (pin_size_t[]){18u} +#define PINS_SERIAL0_TX (pin_size_t[]){23u} +#define PINS_SERIAL2_RX (pin_size_t[]){29u} +#define PINS_SERIAL2_TX (pin_size_t[]){30u} + +// Pin function macros +// ------------------- +#define PIN_ADC1 19u // PA_19 +#define PIN_CS0 19u // PA_19 +#define PIN_CS1 19u // PA_19 +#define PIN_CTS0 19u // PA_19 +#define PIN_MISO0 22u // PA_22 +#define PIN_MISO1 22u // PA_22 +#define PIN_MOSI0 23u // PA_23 +#define PIN_MOSI1 23u // PA_23 +#define PIN_PA00 0u // PA_0 +#define PIN_PA05 5u // PA_5 +#define PIN_PA12 12u // PA_12 +#define PIN_PA14 14u // PA_14 +#define PIN_PA15 15u // PA_15 +#define PIN_PA18 18u // PA_18 +#define PIN_PA19 19u // PA_19 +#define PIN_PA22 22u // PA_22 +#define PIN_PA23 23u // PA_23 +#define PIN_PA29 29u // PA_29 +#define PIN_PA30 30u // PA_30 +#define PIN_PWM1 15u // PA_15 +#define PIN_PWM2 0u // PA_0 +#define PIN_PWM3 12u // PA_12 +#define PIN_PWM4 30u // PA_30 +#define PIN_PWM5 22u // PA_22 +#define PIN_RTS0 22u // PA_22 +#define PIN_RX0 18u // PA_18 +#define PIN_RX2 29u // PA_29 +#define PIN_SCK0 18u // PA_18 +#define PIN_SCK1 18u // PA_18 +#define PIN_SCL1 18u // PA_18 +#define PIN_SDA1 23u // PA_23 +#define PIN_TX0 23u // PA_23 +#define PIN_TX2 30u // PA_30 + +// Port availability +// ----------------- +#define HAS_SERIAL0 1 +#define HAS_SERIAL2 1 +#define HAS_SPI0 1 +#define HAS_SPI1 1 +#define HAS_WIRE0 1 +#define HAS_WIRE1 1 +#define SERIAL_INTERFACES_COUNT 2 +#define SPI_INTERFACES_COUNT 2 +#define WIRE_INTERFACES_COUNT 2 + +// Arduino pin names +// ----------------- +#define PIN_D0 5u // PA_5 +#define PIN_D1 29u // PA_29 +#define PIN_D2 0u // PA_0 +#define PIN_D3 19u // PA_19 +#define PIN_D4 22u // PA_22 +#define PIN_D5 30u // PA_30 +#define PIN_D6 14u // PA_14 +#define PIN_D7 12u // PA_12 +#define PIN_D8 15u // PA_15 +#define PIN_D9 18u // PA_18 +#define PIN_D10 23u // PA_23 +#define PIN_A0 19u // PA_19 + +// Static pin names +// ---------------- +static const unsigned char A0 = PIN_A0; +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; +static const unsigned char D9 = PIN_D9; +static const unsigned char D10 = PIN_D10; diff --git a/boards/variants/bw15.c b/boards/variants/bw15.c new file mode 100644 index 000000000..a769d2698 --- /dev/null +++ b/boards/variants/bw15.c @@ -0,0 +1,54 @@ +/* This file was auto-generated from bw15.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: PA17, SD_CMD, PWM5 + {PIN_A17, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D1: PA18, SD_CLK, PWM6 + {PIN_A18, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D2: PA02, TDO, UART1_RX, SPI0_CS, I2C0_SCL, PWM2 + {PIN_A2, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_JTAG | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D3: PA15, SD_D2, SPI0_CS, UART2_RX, I2C0_SCL, PWM3 + {PIN_A15, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D4: PA04, tRST, UART1_CTS, SPI0_MOSI, PWM4 + {PIN_A4, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_JTAG | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D5: PA19, SD_D0, SPI0_MOSI, UART2_CTS, I2C0_SCL, PWM7 + {PIN_A19, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D6: PA20, SD_D1, SPI0_MISO, UART2_RTS, I2C0_SDA, PWM0 + {PIN_A20, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D7: PA16, SD_D3, SPI0_SCK, UART2_TX, I2C0_SDA, PWM4 + {PIN_A16, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D8: PA00, TCK, UART1_RX, PWM0, SWCLK + {PIN_A0, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_JTAG | PIN_SWD | PIN_UART, PIN_NONE, 0}, + // D9: PA03, TDI, UART1_TX, SPI0_SCK, I2C0_SDA, PWM3 + {PIN_A3, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_JTAG | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D10: PA01, TMS, UART1_TX, PWM1, SWDIO + {PIN_A1, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_JTAG | PIN_SWD | PIN_UART, PIN_NONE, 0}, + // D11: PA13, UART0_RX, PWM7 + {PIN_A13, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_UART, PIN_NONE, 0}, + // D12: PA14, SD_INT, UART0_TX, PWM2 + {PIN_A14, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_UART, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[8]), // PIN_A0 (D8) + [1] = &(lt_arduino_pin_info_list[10]), // PIN_A1 (D10) + [2] = &(lt_arduino_pin_info_list[2]), // PIN_A2 (D2) + [3] = &(lt_arduino_pin_info_list[9]), // PIN_A3 (D9) + [4] = &(lt_arduino_pin_info_list[4]), // PIN_A4 (D4) + [13] = &(lt_arduino_pin_info_list[11]), // PIN_A13 (D11) + [14] = &(lt_arduino_pin_info_list[12]), // PIN_A14 (D12) + [15] = &(lt_arduino_pin_info_list[3]), // PIN_A15 (D3) + [16] = &(lt_arduino_pin_info_list[7]), // PIN_A16 (D7) + [17] = &(lt_arduino_pin_info_list[0]), // PIN_A17 (D0) + [18] = &(lt_arduino_pin_info_list[1]), // PIN_A18 (D1) + [19] = &(lt_arduino_pin_info_list[5]), // PIN_A19 (D5) + [20] = &(lt_arduino_pin_info_list[6]), // PIN_A20 (D6) +}; +// clang-format on diff --git a/boards/variants/bw15.h b/boards/variants/bw15.h new file mode 100644 index 000000000..fb8100a3e --- /dev/null +++ b/boards/variants/bw15.h @@ -0,0 +1,133 @@ +/* This file was auto-generated from bw15.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 13 // Total GPIO count +#define NUM_DIGITAL_PINS 13 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 0 // ADC inputs +#define NUM_ANALOG_OUTPUTS 13 // PWM & DAC outputs +#define PINS_GPIO_MAX 20 // Last usable GPIO number + +// SPI Interfaces +// -------------- +#define PIN_SPI0_CS_0 2u // PIN_A2 +#define PIN_SPI0_CS_1 15u // PIN_A15 +#define PIN_SPI0_MISO 20u // PIN_A20 +#define PIN_SPI0_MOSI_0 4u // PIN_A4 +#define PIN_SPI0_MOSI_1 19u // PIN_A19 +#define PIN_SPI0_SCK_0 16u // PIN_A16 +#define PIN_SPI0_SCK_1 3u // PIN_A3 +#define PINS_SPI0_CS (pin_size_t[]){2u, 15u} +#define PINS_SPI0_MISO (pin_size_t[]){20u} +#define PINS_SPI0_MOSI (pin_size_t[]){4u, 19u} +#define PINS_SPI0_SCK (pin_size_t[]){16u, 3u} + +// Wire Interfaces +// --------------- +#define PIN_WIRE0_SCL_0 2u // PIN_A2 +#define PIN_WIRE0_SCL_1 15u // PIN_A15 +#define PIN_WIRE0_SCL_2 19u // PIN_A19 +#define PIN_WIRE0_SDA_0 20u // PIN_A20 +#define PIN_WIRE0_SDA_1 16u // PIN_A16 +#define PIN_WIRE0_SDA_2 3u // PIN_A3 +#define PINS_WIRE0_SCL (pin_size_t[]){2u, 15u, 19u} +#define PINS_WIRE0_SDA (pin_size_t[]){20u, 16u, 3u} + +// Serial ports +// ------------ +#define PIN_SERIAL0_RX 13u // PIN_A13 +#define PIN_SERIAL0_TX 14u // PIN_A14 +#define PIN_SERIAL1_CTS 4u // PIN_A4 +#define PIN_SERIAL1_RX_0 2u // PIN_A2 +#define PIN_SERIAL1_RX_1 0u // PIN_A0 +#define PIN_SERIAL1_TX_0 3u // PIN_A3 +#define PIN_SERIAL1_TX_1 1u // PIN_A1 +#define PIN_SERIAL2_CTS 19u // PIN_A19 +#define PIN_SERIAL2_RTS 20u // PIN_A20 +#define PIN_SERIAL2_RX 15u // PIN_A15 +#define PIN_SERIAL2_TX 16u // PIN_A16 +#define PINS_SERIAL0_RX (pin_size_t[]){13u} +#define PINS_SERIAL0_TX (pin_size_t[]){14u} +#define PINS_SERIAL1_CTS (pin_size_t[]){4u} +#define PINS_SERIAL1_RX (pin_size_t[]){2u, 0u} +#define PINS_SERIAL1_TX (pin_size_t[]){3u, 1u} +#define PINS_SERIAL2_CTS (pin_size_t[]){19u} +#define PINS_SERIAL2_RTS (pin_size_t[]){20u} +#define PINS_SERIAL2_RX (pin_size_t[]){15u} +#define PINS_SERIAL2_TX (pin_size_t[]){16u} + +// Pin function macros +// ------------------- +#define PIN_CTS1 4u // PIN_A4 +#define PIN_CTS2 19u // PIN_A19 +#define PIN_MISO0 20u // PIN_A20 +#define PIN_PA00 0u // PIN_A0 +#define PIN_PA01 1u // PIN_A1 +#define PIN_PA02 2u // PIN_A2 +#define PIN_PA03 3u // PIN_A3 +#define PIN_PA04 4u // PIN_A4 +#define PIN_PA13 13u // PIN_A13 +#define PIN_PA14 14u // PIN_A14 +#define PIN_PA15 15u // PIN_A15 +#define PIN_PA16 16u // PIN_A16 +#define PIN_PA17 17u // PIN_A17 +#define PIN_PA18 18u // PIN_A18 +#define PIN_PA19 19u // PIN_A19 +#define PIN_PA20 20u // PIN_A20 +#define PIN_PWM1 1u // PIN_A1 +#define PIN_PWM5 17u // PIN_A17 +#define PIN_PWM6 18u // PIN_A18 +#define PIN_RTS2 20u // PIN_A20 +#define PIN_RX0 13u // PIN_A13 +#define PIN_RX2 15u // PIN_A15 +#define PIN_SCL0 19u // PIN_A19 +#define PIN_SDA0 3u // PIN_A3 +#define PIN_TX0 14u // PIN_A14 +#define PIN_TX2 16u // PIN_A16 + +// Port availability +// ----------------- +#define HAS_SERIAL0 1 +#define HAS_SERIAL1 1 +#define HAS_SERIAL2 1 +#define HAS_SPI0 1 +#define HAS_WIRE0 1 +#define SERIAL_INTERFACES_COUNT 3 +#define SPI_INTERFACES_COUNT 1 +#define WIRE_INTERFACES_COUNT 1 + +// Arduino pin names +// ----------------- +#define PIN_D0 17u // PIN_A17 +#define PIN_D1 18u // PIN_A18 +#define PIN_D2 2u // PIN_A2 +#define PIN_D3 15u // PIN_A15 +#define PIN_D4 4u // PIN_A4 +#define PIN_D5 19u // PIN_A19 +#define PIN_D6 20u // PIN_A20 +#define PIN_D7 16u // PIN_A16 +#define PIN_D8 0u // PIN_A0 +#define PIN_D9 3u // PIN_A3 +#define PIN_D10 1u // PIN_A1 +#define PIN_D11 13u // PIN_A13 +#define PIN_D12 14u // PIN_A14 + +// Static pin names +// ---------------- +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; +static const unsigned char D9 = PIN_D9; +static const unsigned char D10 = PIN_D10; +static const unsigned char D11 = PIN_D11; +static const unsigned char D12 = PIN_D12; diff --git a/boards/variants/cb1s.c b/boards/variants/cb1s.c new file mode 100644 index 000000000..55ef8ccc3 --- /dev/null +++ b/boards/variants/cb1s.c @@ -0,0 +1,57 @@ +/* This file was auto-generated from cb1s.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: P11, UART1_TX + {GPIO11, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D1: P10, UART1_RX + {GPIO10, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D2: P6, PWM0 + {GPIO6, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D3: P7, PWM1 + {GPIO7, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D4: P0, UART2_TX, I2C2_SCL + {GPIO0, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D5: P9, PWM3 + {GPIO9, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D6: P8, PWM2 + {GPIO8, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D7: P1, UART2_RX, I2C2_SDA + {GPIO1, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D8: P24, PWM4 + {GPIO24, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D9: P26, PWM5, IRDA + {GPIO26, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D10: P23, ADC3, TDO, FSO + {GPIO23, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_JTAG, PIN_NONE, 0}, + // D11: P20, I2C1_SCL, TCK, FSCK + {GPIO20, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_JTAG, PIN_NONE, 0}, + // D12: P21, I2C1_SDA, TMS, MCLK, ^FCS + {GPIO21, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_JTAG, PIN_NONE, 0}, + // D13: P22, TDI, FSI + {GPIO22, PIN_GPIO | PIN_IRQ | PIN_JTAG, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[4]), // GPIO0 (D4) + [1] = &(lt_arduino_pin_info_list[7]), // GPIO1 (D7) + [6] = &(lt_arduino_pin_info_list[2]), // GPIO6 (D2) + [7] = &(lt_arduino_pin_info_list[3]), // GPIO7 (D3) + [8] = &(lt_arduino_pin_info_list[6]), // GPIO8 (D6) + [9] = &(lt_arduino_pin_info_list[5]), // GPIO9 (D5) + [10] = &(lt_arduino_pin_info_list[1]), // GPIO10 (D1) + [11] = &(lt_arduino_pin_info_list[0]), // GPIO11 (D0) + [20] = &(lt_arduino_pin_info_list[11]), // GPIO20 (D11) + [21] = &(lt_arduino_pin_info_list[12]), // GPIO21 (D12) + [22] = &(lt_arduino_pin_info_list[13]), // GPIO22 (D13) + [23] = &(lt_arduino_pin_info_list[10]), // GPIO23 (D10) + [24] = &(lt_arduino_pin_info_list[8]), // GPIO24 (D8) + [26] = &(lt_arduino_pin_info_list[9]), // GPIO26 (D9) +}; +// clang-format on diff --git a/boards/variants/cb1s.h b/boards/variants/cb1s.h new file mode 100644 index 000000000..39e3273ae --- /dev/null +++ b/boards/variants/cb1s.h @@ -0,0 +1,112 @@ +/* This file was auto-generated from cb1s.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 14 // Total GPIO count +#define NUM_DIGITAL_PINS 14 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 1 // ADC inputs +#define NUM_ANALOG_OUTPUTS 6 // PWM & DAC outputs +#define PINS_GPIO_MAX 26 // Last usable GPIO number + +// Wire Interfaces +// --------------- +#define PIN_WIRE1_SCL 20u // GPIO20 +#define PIN_WIRE1_SDA 21u // GPIO21 +#define PIN_WIRE2_SCL 0u // GPIO0 +#define PIN_WIRE2_SDA 1u // GPIO1 +#define PINS_WIRE1_SCL (pin_size_t[]){20u} +#define PINS_WIRE1_SDA (pin_size_t[]){21u} +#define PINS_WIRE2_SCL (pin_size_t[]){0u} +#define PINS_WIRE2_SDA (pin_size_t[]){1u} + +// Serial ports +// ------------ +#define PIN_SERIAL1_RX 10u // GPIO10 +#define PIN_SERIAL1_TX 11u // GPIO11 +#define PIN_SERIAL2_RX 1u // GPIO1 +#define PIN_SERIAL2_TX 0u // GPIO0 +#define PINS_SERIAL1_RX (pin_size_t[]){10u} +#define PINS_SERIAL1_TX (pin_size_t[]){11u} +#define PINS_SERIAL2_RX (pin_size_t[]){1u} +#define PINS_SERIAL2_TX (pin_size_t[]){0u} + +// Pin function macros +// ------------------- +#define PIN_ADC3 23u // GPIO23 +#define PIN_P0 0u // GPIO0 +#define PIN_P1 1u // GPIO1 +#define PIN_P6 6u // GPIO6 +#define PIN_P7 7u // GPIO7 +#define PIN_P8 8u // GPIO8 +#define PIN_P9 9u // GPIO9 +#define PIN_P10 10u // GPIO10 +#define PIN_P11 11u // GPIO11 +#define PIN_P20 20u // GPIO20 +#define PIN_P21 21u // GPIO21 +#define PIN_P22 22u // GPIO22 +#define PIN_P23 23u // GPIO23 +#define PIN_P24 24u // GPIO24 +#define PIN_P26 26u // GPIO26 +#define PIN_PWM0 6u // GPIO6 +#define PIN_PWM1 7u // GPIO7 +#define PIN_PWM2 8u // GPIO8 +#define PIN_PWM3 9u // GPIO9 +#define PIN_PWM4 24u // GPIO24 +#define PIN_PWM5 26u // GPIO26 +#define PIN_RX1 10u // GPIO10 +#define PIN_RX2 1u // GPIO1 +#define PIN_SCL1 20u // GPIO20 +#define PIN_SCL2 0u // GPIO0 +#define PIN_SDA1 21u // GPIO21 +#define PIN_SDA2 1u // GPIO1 +#define PIN_TX1 11u // GPIO11 +#define PIN_TX2 0u // GPIO0 + +// Port availability +// ----------------- +#define HAS_SERIAL1 1 +#define HAS_SERIAL2 1 +#define HAS_WIRE1 1 +#define HAS_WIRE2 1 +#define SERIAL_INTERFACES_COUNT 2 +#define WIRE_INTERFACES_COUNT 2 + +// Arduino pin names +// ----------------- +#define PIN_D0 11u // GPIO11 +#define PIN_D1 10u // GPIO10 +#define PIN_D2 6u // GPIO6 +#define PIN_D3 7u // GPIO7 +#define PIN_D4 0u // GPIO0 +#define PIN_D5 9u // GPIO9 +#define PIN_D6 8u // GPIO8 +#define PIN_D7 1u // GPIO1 +#define PIN_D8 24u // GPIO24 +#define PIN_D9 26u // GPIO26 +#define PIN_D10 23u // GPIO23 +#define PIN_D11 20u // GPIO20 +#define PIN_D12 21u // GPIO21 +#define PIN_D13 22u // GPIO22 +#define PIN_A0 23u // GPIO23 + +// Static pin names +// ---------------- +static const unsigned char A0 = PIN_A0; +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; +static const unsigned char D9 = PIN_D9; +static const unsigned char D10 = PIN_D10; +static const unsigned char D11 = PIN_D11; +static const unsigned char D12 = PIN_D12; +static const unsigned char D13 = PIN_D13; diff --git a/boards/variants/cb2l.c b/boards/variants/cb2l.c new file mode 100644 index 000000000..a613471da --- /dev/null +++ b/boards/variants/cb2l.c @@ -0,0 +1,42 @@ +/* This file was auto-generated from cb2l.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: P8, PWM2 + {GPIO8, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D1: P7, PWM1 + {GPIO7, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D2: P6, PWM0 + {GPIO6, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D3: P26, PWM5, IRDA + {GPIO26, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D4: P24, PWM4 + {GPIO24, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D5: P10, UART1_RX + {GPIO10, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D6: P0, UART2_TX, I2C2_SCL + {GPIO0, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D7: P11, UART1_TX + {GPIO11, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D8: P21, I2C1_SDA, TMS, MCLK, ^FCS + {GPIO21, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_JTAG, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[6]), // GPIO0 (D6) + [6] = &(lt_arduino_pin_info_list[2]), // GPIO6 (D2) + [7] = &(lt_arduino_pin_info_list[1]), // GPIO7 (D1) + [8] = &(lt_arduino_pin_info_list[0]), // GPIO8 (D0) + [10] = &(lt_arduino_pin_info_list[5]), // GPIO10 (D5) + [11] = &(lt_arduino_pin_info_list[7]), // GPIO11 (D7) + [21] = &(lt_arduino_pin_info_list[8]), // GPIO21 (D8) + [24] = &(lt_arduino_pin_info_list[4]), // GPIO24 (D4) + [26] = &(lt_arduino_pin_info_list[3]), // GPIO26 (D3) +}; +// clang-format on diff --git a/boards/variants/cb2l.h b/boards/variants/cb2l.h new file mode 100644 index 000000000..57c3abb36 --- /dev/null +++ b/boards/variants/cb2l.h @@ -0,0 +1,74 @@ +/* This file was auto-generated from cb2l.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 9 // Total GPIO count +#define NUM_DIGITAL_PINS 9 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 0 // ADC inputs +#define NUM_ANALOG_OUTPUTS 5 // PWM & DAC outputs +#define PINS_GPIO_MAX 26 // Last usable GPIO number + +// Serial ports +// ------------ +#define PIN_SERIAL1_RX 10u // GPIO10 +#define PIN_SERIAL1_TX 11u // GPIO11 +#define PIN_SERIAL2_TX 0u // GPIO0 +#define PINS_SERIAL1_RX (pin_size_t[]){10u} +#define PINS_SERIAL1_TX (pin_size_t[]){11u} +#define PINS_SERIAL2_TX (pin_size_t[]){0u} + +// Pin function macros +// ------------------- +#define PIN_P0 0u // GPIO0 +#define PIN_P6 6u // GPIO6 +#define PIN_P7 7u // GPIO7 +#define PIN_P8 8u // GPIO8 +#define PIN_P10 10u // GPIO10 +#define PIN_P11 11u // GPIO11 +#define PIN_P21 21u // GPIO21 +#define PIN_P24 24u // GPIO24 +#define PIN_P26 26u // GPIO26 +#define PIN_PWM0 6u // GPIO6 +#define PIN_PWM1 7u // GPIO7 +#define PIN_PWM2 8u // GPIO8 +#define PIN_PWM4 24u // GPIO24 +#define PIN_PWM5 26u // GPIO26 +#define PIN_RX1 10u // GPIO10 +#define PIN_SCL2 0u // GPIO0 +#define PIN_SDA1 21u // GPIO21 +#define PIN_TX1 11u // GPIO11 +#define PIN_TX2 0u // GPIO0 + +// Port availability +// ----------------- +#define HAS_SERIAL1 1 +#define HAS_SERIAL2 1 +#define SERIAL_INTERFACES_COUNT 2 + +// Arduino pin names +// ----------------- +#define PIN_D0 8u // GPIO8 +#define PIN_D1 7u // GPIO7 +#define PIN_D2 6u // GPIO6 +#define PIN_D3 26u // GPIO26 +#define PIN_D4 24u // GPIO24 +#define PIN_D5 10u // GPIO10 +#define PIN_D6 0u // GPIO0 +#define PIN_D7 11u // GPIO11 +#define PIN_D8 21u // GPIO21 + +// Static pin names +// ---------------- +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; diff --git a/boards/variants/cb2s.c b/boards/variants/cb2s.c new file mode 100644 index 000000000..8ab2a422e --- /dev/null +++ b/boards/variants/cb2s.c @@ -0,0 +1,48 @@ +/* This file was auto-generated from cb2s.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: P6, PWM0 + {GPIO6, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D1: P7, PWM1 + {GPIO7, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D2: P8, PWM2 + {GPIO8, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D3: P23, ADC3, TDO, FSO + {GPIO23, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_JTAG, PIN_NONE, 0}, + // D4: P10, UART1_RX + {GPIO10, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D5: P11, UART1_TX + {GPIO11, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D6: P24, PWM4 + {GPIO24, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D7: P26, PWM5, IRDA + {GPIO26, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D8: P0, UART2_TX, I2C2_SCL + {GPIO0, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D9: P1, UART2_RX, I2C2_SDA + {GPIO1, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D10: P21, I2C1_SDA, TMS, MCLK, ^FCS + {GPIO21, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_JTAG, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[8]), // GPIO0 (D8) + [1] = &(lt_arduino_pin_info_list[9]), // GPIO1 (D9) + [6] = &(lt_arduino_pin_info_list[0]), // GPIO6 (D0) + [7] = &(lt_arduino_pin_info_list[1]), // GPIO7 (D1) + [8] = &(lt_arduino_pin_info_list[2]), // GPIO8 (D2) + [10] = &(lt_arduino_pin_info_list[4]), // GPIO10 (D4) + [11] = &(lt_arduino_pin_info_list[5]), // GPIO11 (D5) + [21] = &(lt_arduino_pin_info_list[10]), // GPIO21 (D10) + [23] = &(lt_arduino_pin_info_list[3]), // GPIO23 (D3) + [24] = &(lt_arduino_pin_info_list[6]), // GPIO24 (D6) + [26] = &(lt_arduino_pin_info_list[7]), // GPIO26 (D7) +}; +// clang-format on diff --git a/boards/variants/cb2s.h b/boards/variants/cb2s.h new file mode 100644 index 000000000..7f776e80b --- /dev/null +++ b/boards/variants/cb2s.h @@ -0,0 +1,96 @@ +/* This file was auto-generated from cb2s.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 11 // Total GPIO count +#define NUM_DIGITAL_PINS 11 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 1 // ADC inputs +#define NUM_ANALOG_OUTPUTS 5 // PWM & DAC outputs +#define PINS_GPIO_MAX 26 // Last usable GPIO number + +// Wire Interfaces +// --------------- +#define PIN_WIRE2_SCL 0u // GPIO0 +#define PIN_WIRE2_SDA 1u // GPIO1 +#define PINS_WIRE2_SCL (pin_size_t[]){0u} +#define PINS_WIRE2_SDA (pin_size_t[]){1u} + +// Serial ports +// ------------ +#define PIN_SERIAL1_RX 10u // GPIO10 +#define PIN_SERIAL1_TX 11u // GPIO11 +#define PIN_SERIAL2_RX 1u // GPIO1 +#define PIN_SERIAL2_TX 0u // GPIO0 +#define PINS_SERIAL1_RX (pin_size_t[]){10u} +#define PINS_SERIAL1_TX (pin_size_t[]){11u} +#define PINS_SERIAL2_RX (pin_size_t[]){1u} +#define PINS_SERIAL2_TX (pin_size_t[]){0u} + +// Pin function macros +// ------------------- +#define PIN_ADC3 23u // GPIO23 +#define PIN_P0 0u // GPIO0 +#define PIN_P1 1u // GPIO1 +#define PIN_P6 6u // GPIO6 +#define PIN_P7 7u // GPIO7 +#define PIN_P8 8u // GPIO8 +#define PIN_P10 10u // GPIO10 +#define PIN_P11 11u // GPIO11 +#define PIN_P21 21u // GPIO21 +#define PIN_P23 23u // GPIO23 +#define PIN_P24 24u // GPIO24 +#define PIN_P26 26u // GPIO26 +#define PIN_PWM0 6u // GPIO6 +#define PIN_PWM1 7u // GPIO7 +#define PIN_PWM2 8u // GPIO8 +#define PIN_PWM4 24u // GPIO24 +#define PIN_PWM5 26u // GPIO26 +#define PIN_RX1 10u // GPIO10 +#define PIN_RX2 1u // GPIO1 +#define PIN_SCL2 0u // GPIO0 +#define PIN_SDA1 21u // GPIO21 +#define PIN_SDA2 1u // GPIO1 +#define PIN_TX1 11u // GPIO11 +#define PIN_TX2 0u // GPIO0 + +// Port availability +// ----------------- +#define HAS_SERIAL1 1 +#define HAS_SERIAL2 1 +#define HAS_WIRE2 1 +#define SERIAL_INTERFACES_COUNT 2 +#define WIRE_INTERFACES_COUNT 1 + +// Arduino pin names +// ----------------- +#define PIN_D0 6u // GPIO6 +#define PIN_D1 7u // GPIO7 +#define PIN_D2 8u // GPIO8 +#define PIN_D3 23u // GPIO23 +#define PIN_D4 10u // GPIO10 +#define PIN_D5 11u // GPIO11 +#define PIN_D6 24u // GPIO24 +#define PIN_D7 26u // GPIO26 +#define PIN_D8 0u // GPIO0 +#define PIN_D9 1u // GPIO1 +#define PIN_D10 21u // GPIO21 +#define PIN_A0 23u // GPIO23 + +// Static pin names +// ---------------- +static const unsigned char A0 = PIN_A0; +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; +static const unsigned char D9 = PIN_D9; +static const unsigned char D10 = PIN_D10; diff --git a/boards/variants/cb3l.c b/boards/variants/cb3l.c new file mode 100644 index 000000000..6d592ce6b --- /dev/null +++ b/boards/variants/cb3l.c @@ -0,0 +1,51 @@ +/* This file was auto-generated from cb3l.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: P23, ADC3, TDO, FSO + {GPIO23, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_JTAG, PIN_NONE, 0}, + // D1: P14, SD_CLK, SCK + {GPIO14, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D2: P26, PWM5, IRDA + {GPIO26, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D3: P24, PWM4 + {GPIO24, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D4: P6, PWM0 + {GPIO6, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D5: P9, PWM3 + {GPIO9, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D6: P0, UART2_TX, I2C2_SCL + {GPIO0, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D7: P21, I2C1_SDA, TMS, MCLK, ^FCS + {GPIO21, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_JTAG, PIN_NONE, 0}, + // D8: P8, PWM2 + {GPIO8, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D9: P7, PWM1 + {GPIO7, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D10: P10, UART1_RX + {GPIO10, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D11: P11, UART1_TX + {GPIO11, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[6]), // GPIO0 (D6) + [6] = &(lt_arduino_pin_info_list[4]), // GPIO6 (D4) + [7] = &(lt_arduino_pin_info_list[9]), // GPIO7 (D9) + [8] = &(lt_arduino_pin_info_list[8]), // GPIO8 (D8) + [9] = &(lt_arduino_pin_info_list[5]), // GPIO9 (D5) + [10] = &(lt_arduino_pin_info_list[10]), // GPIO10 (D10) + [11] = &(lt_arduino_pin_info_list[11]), // GPIO11 (D11) + [14] = &(lt_arduino_pin_info_list[1]), // GPIO14 (D1) + [21] = &(lt_arduino_pin_info_list[7]), // GPIO21 (D7) + [23] = &(lt_arduino_pin_info_list[0]), // GPIO23 (D0) + [24] = &(lt_arduino_pin_info_list[3]), // GPIO24 (D3) + [26] = &(lt_arduino_pin_info_list[2]), // GPIO26 (D2) +}; +// clang-format on diff --git a/boards/variants/cb3l.h b/boards/variants/cb3l.h new file mode 100644 index 000000000..cc371748a --- /dev/null +++ b/boards/variants/cb3l.h @@ -0,0 +1,88 @@ +/* This file was auto-generated from cb3l.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 12 // Total GPIO count +#define NUM_DIGITAL_PINS 12 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 1 // ADC inputs +#define NUM_ANALOG_OUTPUTS 6 // PWM & DAC outputs +#define PINS_GPIO_MAX 26 // Last usable GPIO number + +// Serial ports +// ------------ +#define PIN_SERIAL1_RX 10u // GPIO10 +#define PIN_SERIAL1_TX 11u // GPIO11 +#define PIN_SERIAL2_TX 0u // GPIO0 +#define PINS_SERIAL1_RX (pin_size_t[]){10u} +#define PINS_SERIAL1_TX (pin_size_t[]){11u} +#define PINS_SERIAL2_TX (pin_size_t[]){0u} + +// Pin function macros +// ------------------- +#define PIN_ADC3 23u // GPIO23 +#define PIN_P0 0u // GPIO0 +#define PIN_P6 6u // GPIO6 +#define PIN_P7 7u // GPIO7 +#define PIN_P8 8u // GPIO8 +#define PIN_P9 9u // GPIO9 +#define PIN_P10 10u // GPIO10 +#define PIN_P11 11u // GPIO11 +#define PIN_P14 14u // GPIO14 +#define PIN_P21 21u // GPIO21 +#define PIN_P23 23u // GPIO23 +#define PIN_P24 24u // GPIO24 +#define PIN_P26 26u // GPIO26 +#define PIN_PWM0 6u // GPIO6 +#define PIN_PWM1 7u // GPIO7 +#define PIN_PWM2 8u // GPIO8 +#define PIN_PWM3 9u // GPIO9 +#define PIN_PWM4 24u // GPIO24 +#define PIN_PWM5 26u // GPIO26 +#define PIN_RX1 10u // GPIO10 +#define PIN_SCK 14u // GPIO14 +#define PIN_SCL2 0u // GPIO0 +#define PIN_SDA1 21u // GPIO21 +#define PIN_TX1 11u // GPIO11 +#define PIN_TX2 0u // GPIO0 + +// Port availability +// ----------------- +#define HAS_SERIAL1 1 +#define HAS_SERIAL2 1 +#define SERIAL_INTERFACES_COUNT 2 + +// Arduino pin names +// ----------------- +#define PIN_D0 23u // GPIO23 +#define PIN_D1 14u // GPIO14 +#define PIN_D2 26u // GPIO26 +#define PIN_D3 24u // GPIO24 +#define PIN_D4 6u // GPIO6 +#define PIN_D5 9u // GPIO9 +#define PIN_D6 0u // GPIO0 +#define PIN_D7 21u // GPIO21 +#define PIN_D8 8u // GPIO8 +#define PIN_D9 7u // GPIO7 +#define PIN_D10 10u // GPIO10 +#define PIN_D11 11u // GPIO11 +#define PIN_A0 23u // GPIO23 + +// Static pin names +// ---------------- +static const unsigned char A0 = PIN_A0; +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; +static const unsigned char D9 = PIN_D9; +static const unsigned char D10 = PIN_D10; +static const unsigned char D11 = PIN_D11; diff --git a/boards/variants/cb3s.c b/boards/variants/cb3s.c new file mode 100644 index 000000000..049d81960 --- /dev/null +++ b/boards/variants/cb3s.c @@ -0,0 +1,57 @@ +/* This file was auto-generated from cb3s.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: P23, ADC3, TDO, FSO + {GPIO23, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_JTAG, PIN_NONE, 0}, + // D1: P14, SD_CLK, SCK + {GPIO14, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D2: P26, PWM5, IRDA + {GPIO26, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D3: P24, PWM4 + {GPIO24, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D4: P6, PWM0 + {GPIO6, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D5: P9, PWM3 + {GPIO9, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D6: P0, UART2_TX, I2C2_SCL + {GPIO0, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D7: P21, I2C1_SDA, TMS, MCLK, ^FCS + {GPIO21, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_JTAG, PIN_NONE, 0}, + // D8: P8, PWM2 + {GPIO8, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D9: P7, PWM1 + {GPIO7, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D10: P10, UART1_RX + {GPIO10, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D11: P11, UART1_TX + {GPIO11, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D12: P22, TDI, FSI + {GPIO22, PIN_GPIO | PIN_IRQ | PIN_JTAG, PIN_NONE, 0}, + // D13: P20, I2C1_SCL, TCK, FSCK + {GPIO20, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_JTAG, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[6]), // GPIO0 (D6) + [6] = &(lt_arduino_pin_info_list[4]), // GPIO6 (D4) + [7] = &(lt_arduino_pin_info_list[9]), // GPIO7 (D9) + [8] = &(lt_arduino_pin_info_list[8]), // GPIO8 (D8) + [9] = &(lt_arduino_pin_info_list[5]), // GPIO9 (D5) + [10] = &(lt_arduino_pin_info_list[10]), // GPIO10 (D10) + [11] = &(lt_arduino_pin_info_list[11]), // GPIO11 (D11) + [14] = &(lt_arduino_pin_info_list[1]), // GPIO14 (D1) + [20] = &(lt_arduino_pin_info_list[13]), // GPIO20 (D13) + [21] = &(lt_arduino_pin_info_list[7]), // GPIO21 (D7) + [22] = &(lt_arduino_pin_info_list[12]), // GPIO22 (D12) + [23] = &(lt_arduino_pin_info_list[0]), // GPIO23 (D0) + [24] = &(lt_arduino_pin_info_list[3]), // GPIO24 (D3) + [26] = &(lt_arduino_pin_info_list[2]), // GPIO26 (D2) +}; +// clang-format on diff --git a/boards/variants/cb3s.h b/boards/variants/cb3s.h new file mode 100644 index 000000000..fda659625 --- /dev/null +++ b/boards/variants/cb3s.h @@ -0,0 +1,105 @@ +/* This file was auto-generated from cb3s.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 14 // Total GPIO count +#define NUM_DIGITAL_PINS 14 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 1 // ADC inputs +#define NUM_ANALOG_OUTPUTS 6 // PWM & DAC outputs +#define PINS_GPIO_MAX 26 // Last usable GPIO number + +// Wire Interfaces +// --------------- +#define PIN_WIRE1_SCL 20u // GPIO20 +#define PIN_WIRE1_SDA_0 21u // GPIO21 +#define PIN_WIRE1_SDA_1 21u // GPIO21 +#define PINS_WIRE1_SCL (pin_size_t[]){20u} +#define PINS_WIRE1_SDA (pin_size_t[]){21u, 21u} + +// Serial ports +// ------------ +#define PIN_SERIAL1_RX 10u // GPIO10 +#define PIN_SERIAL1_TX 11u // GPIO11 +#define PIN_SERIAL2_TX 0u // GPIO0 +#define PINS_SERIAL1_RX (pin_size_t[]){10u} +#define PINS_SERIAL1_TX (pin_size_t[]){11u} +#define PINS_SERIAL2_TX (pin_size_t[]){0u} + +// Pin function macros +// ------------------- +#define PIN_ADC3 23u // GPIO23 +#define PIN_P0 0u // GPIO0 +#define PIN_P6 6u // GPIO6 +#define PIN_P7 7u // GPIO7 +#define PIN_P8 8u // GPIO8 +#define PIN_P9 9u // GPIO9 +#define PIN_P10 10u // GPIO10 +#define PIN_P11 11u // GPIO11 +#define PIN_P14 14u // GPIO14 +#define PIN_P20 20u // GPIO20 +#define PIN_P21 21u // GPIO21 +#define PIN_P22 22u // GPIO22 +#define PIN_P23 23u // GPIO23 +#define PIN_P24 24u // GPIO24 +#define PIN_P26 26u // GPIO26 +#define PIN_PWM0 6u // GPIO6 +#define PIN_PWM1 7u // GPIO7 +#define PIN_PWM2 8u // GPIO8 +#define PIN_PWM3 9u // GPIO9 +#define PIN_PWM4 24u // GPIO24 +#define PIN_PWM5 26u // GPIO26 +#define PIN_RX1 10u // GPIO10 +#define PIN_SCK 14u // GPIO14 +#define PIN_SCL1 20u // GPIO20 +#define PIN_SCL2 0u // GPIO0 +#define PIN_SDA1 21u // GPIO21 +#define PIN_TX1 11u // GPIO11 +#define PIN_TX2 0u // GPIO0 + +// Port availability +// ----------------- +#define HAS_SERIAL1 1 +#define HAS_SERIAL2 1 +#define HAS_WIRE1 1 +#define SERIAL_INTERFACES_COUNT 2 +#define WIRE_INTERFACES_COUNT 1 + +// Arduino pin names +// ----------------- +#define PIN_D0 23u // GPIO23 +#define PIN_D1 14u // GPIO14 +#define PIN_D2 26u // GPIO26 +#define PIN_D3 24u // GPIO24 +#define PIN_D4 6u // GPIO6 +#define PIN_D5 9u // GPIO9 +#define PIN_D6 0u // GPIO0 +#define PIN_D7 21u // GPIO21 +#define PIN_D8 8u // GPIO8 +#define PIN_D9 7u // GPIO7 +#define PIN_D10 10u // GPIO10 +#define PIN_D11 11u // GPIO11 +#define PIN_D12 22u // GPIO22 +#define PIN_D13 20u // GPIO20 +#define PIN_A0 23u // GPIO23 + +// Static pin names +// ---------------- +static const unsigned char A0 = PIN_A0; +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; +static const unsigned char D9 = PIN_D9; +static const unsigned char D10 = PIN_D10; +static const unsigned char D11 = PIN_D11; +static const unsigned char D12 = PIN_D12; +static const unsigned char D13 = PIN_D13; diff --git a/boards/variants/cb3se.c b/boards/variants/cb3se.c new file mode 100644 index 000000000..7cd476df8 --- /dev/null +++ b/boards/variants/cb3se.c @@ -0,0 +1,66 @@ +/* This file was auto-generated from cb3se.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: P23, ADC3, TDO, FSO + {GPIO23, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_JTAG, PIN_NONE, 0}, + // D1: P14, SD_CLK, SCK + {GPIO14, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D2: P26, PWM5, IRDA + {GPIO26, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D3: P24, PWM4 + {GPIO24, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D4: P6, PWM0 + {GPIO6, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D5: P9, PWM3 + {GPIO9, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D6: P0, UART2_TX, I2C2_SCL + {GPIO0, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D7: P1, UART2_RX, I2C2_SDA + {GPIO1, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D8: P8, PWM2 + {GPIO8, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D9: P7, PWM1 + {GPIO7, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D10: P10, UART1_RX + {GPIO10, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D11: P11, UART1_TX + {GPIO11, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D12: P15, SD_CMD, CS + {GPIO15, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D13: P22, TDI, FSI + {GPIO22, PIN_GPIO | PIN_IRQ | PIN_JTAG, PIN_NONE, 0}, + // D14: P20, I2C1_SCL, TCK, FSCK + {GPIO20, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_JTAG, PIN_NONE, 0}, + // D15: P17, SD_D1, MISO + {GPIO17, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D16: P16, SD_D0, MOSI + {GPIO16, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[6]), // GPIO0 (D6) + [1] = &(lt_arduino_pin_info_list[7]), // GPIO1 (D7) + [6] = &(lt_arduino_pin_info_list[4]), // GPIO6 (D4) + [7] = &(lt_arduino_pin_info_list[9]), // GPIO7 (D9) + [8] = &(lt_arduino_pin_info_list[8]), // GPIO8 (D8) + [9] = &(lt_arduino_pin_info_list[5]), // GPIO9 (D5) + [10] = &(lt_arduino_pin_info_list[10]), // GPIO10 (D10) + [11] = &(lt_arduino_pin_info_list[11]), // GPIO11 (D11) + [14] = &(lt_arduino_pin_info_list[1]), // GPIO14 (D1) + [15] = &(lt_arduino_pin_info_list[12]), // GPIO15 (D12) + [16] = &(lt_arduino_pin_info_list[16]), // GPIO16 (D16) + [17] = &(lt_arduino_pin_info_list[15]), // GPIO17 (D15) + [20] = &(lt_arduino_pin_info_list[14]), // GPIO20 (D14) + [22] = &(lt_arduino_pin_info_list[13]), // GPIO22 (D13) + [23] = &(lt_arduino_pin_info_list[0]), // GPIO23 (D0) + [24] = &(lt_arduino_pin_info_list[3]), // GPIO24 (D3) + [26] = &(lt_arduino_pin_info_list[2]), // GPIO26 (D2) +}; +// clang-format on diff --git a/boards/variants/cb3se.h b/boards/variants/cb3se.h new file mode 100644 index 000000000..92285ed82 --- /dev/null +++ b/boards/variants/cb3se.h @@ -0,0 +1,132 @@ +/* This file was auto-generated from cb3se.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 17 // Total GPIO count +#define NUM_DIGITAL_PINS 17 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 1 // ADC inputs +#define NUM_ANALOG_OUTPUTS 6 // PWM & DAC outputs +#define PINS_GPIO_MAX 26 // Last usable GPIO number + +// SPI Interfaces +// -------------- +#define PIN_SPI0_CS 15u // GPIO15 +#define PIN_SPI0_MISO 17u // GPIO17 +#define PIN_SPI0_MOSI 16u // GPIO16 +#define PIN_SPI0_SCK 14u // GPIO14 +#define PINS_SPI0_CS (pin_size_t[]){15u} +#define PINS_SPI0_MISO (pin_size_t[]){17u} +#define PINS_SPI0_MOSI (pin_size_t[]){16u} +#define PINS_SPI0_SCK (pin_size_t[]){14u} + +// Wire Interfaces +// --------------- +#define PIN_WIRE2_SCL 0u // GPIO0 +#define PIN_WIRE2_SDA 1u // GPIO1 +#define PINS_WIRE2_SCL (pin_size_t[]){0u} +#define PINS_WIRE2_SDA (pin_size_t[]){1u} + +// Serial ports +// ------------ +#define PIN_SERIAL1_RX 10u // GPIO10 +#define PIN_SERIAL1_TX 11u // GPIO11 +#define PIN_SERIAL2_RX 1u // GPIO1 +#define PIN_SERIAL2_TX 0u // GPIO0 +#define PINS_SERIAL1_RX (pin_size_t[]){10u} +#define PINS_SERIAL1_TX (pin_size_t[]){11u} +#define PINS_SERIAL2_RX (pin_size_t[]){1u} +#define PINS_SERIAL2_TX (pin_size_t[]){0u} + +// Pin function macros +// ------------------- +#define PIN_ADC3 23u // GPIO23 +#define PIN_CS 15u // GPIO15 +#define PIN_MISO 17u // GPIO17 +#define PIN_MOSI 16u // GPIO16 +#define PIN_P0 0u // GPIO0 +#define PIN_P1 1u // GPIO1 +#define PIN_P6 6u // GPIO6 +#define PIN_P7 7u // GPIO7 +#define PIN_P8 8u // GPIO8 +#define PIN_P9 9u // GPIO9 +#define PIN_P10 10u // GPIO10 +#define PIN_P11 11u // GPIO11 +#define PIN_P14 14u // GPIO14 +#define PIN_P15 15u // GPIO15 +#define PIN_P16 16u // GPIO16 +#define PIN_P17 17u // GPIO17 +#define PIN_P20 20u // GPIO20 +#define PIN_P22 22u // GPIO22 +#define PIN_P23 23u // GPIO23 +#define PIN_P24 24u // GPIO24 +#define PIN_P26 26u // GPIO26 +#define PIN_PWM0 6u // GPIO6 +#define PIN_PWM1 7u // GPIO7 +#define PIN_PWM2 8u // GPIO8 +#define PIN_PWM3 9u // GPIO9 +#define PIN_PWM4 24u // GPIO24 +#define PIN_PWM5 26u // GPIO26 +#define PIN_RX1 10u // GPIO10 +#define PIN_RX2 1u // GPIO1 +#define PIN_SCK 14u // GPIO14 +#define PIN_SCL1 20u // GPIO20 +#define PIN_SCL2 0u // GPIO0 +#define PIN_SDA2 1u // GPIO1 +#define PIN_TX1 11u // GPIO11 +#define PIN_TX2 0u // GPIO0 + +// Port availability +// ----------------- +#define HAS_SERIAL1 1 +#define HAS_SERIAL2 1 +#define HAS_SPI0 1 +#define HAS_WIRE2 1 +#define SERIAL_INTERFACES_COUNT 2 +#define SPI_INTERFACES_COUNT 1 +#define WIRE_INTERFACES_COUNT 1 + +// Arduino pin names +// ----------------- +#define PIN_D0 23u // GPIO23 +#define PIN_D1 14u // GPIO14 +#define PIN_D2 26u // GPIO26 +#define PIN_D3 24u // GPIO24 +#define PIN_D4 6u // GPIO6 +#define PIN_D5 9u // GPIO9 +#define PIN_D6 0u // GPIO0 +#define PIN_D7 1u // GPIO1 +#define PIN_D8 8u // GPIO8 +#define PIN_D9 7u // GPIO7 +#define PIN_D10 10u // GPIO10 +#define PIN_D11 11u // GPIO11 +#define PIN_D12 15u // GPIO15 +#define PIN_D13 22u // GPIO22 +#define PIN_D14 20u // GPIO20 +#define PIN_D15 17u // GPIO17 +#define PIN_D16 16u // GPIO16 +#define PIN_A0 23u // GPIO23 + +// Static pin names +// ---------------- +static const unsigned char A0 = PIN_A0; +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; +static const unsigned char D9 = PIN_D9; +static const unsigned char D10 = PIN_D10; +static const unsigned char D11 = PIN_D11; +static const unsigned char D12 = PIN_D12; +static const unsigned char D13 = PIN_D13; +static const unsigned char D14 = PIN_D14; +static const unsigned char D15 = PIN_D15; +static const unsigned char D16 = PIN_D16; diff --git a/boards/variants/cblc5.c b/boards/variants/cblc5.c new file mode 100644 index 000000000..e0f4e18ad --- /dev/null +++ b/boards/variants/cblc5.c @@ -0,0 +1,39 @@ +/* This file was auto-generated from cblc5.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: P24, PWM4 + {GPIO24, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D1: P6, PWM0 + {GPIO6, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D2: P26, PWM5, IRDA + {GPIO26, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D3: P11, UART1_TX + {GPIO11, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D4: P10, UART1_RX + {GPIO10, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D5: P1, UART2_RX, I2C2_SDA + {GPIO1, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D6: P0, UART2_TX, I2C2_SCL + {GPIO0, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D7: P21, I2C1_SDA, TMS, MCLK, ^FCS + {GPIO21, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_JTAG, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[6]), // GPIO0 (D6) + [1] = &(lt_arduino_pin_info_list[5]), // GPIO1 (D5) + [6] = &(lt_arduino_pin_info_list[1]), // GPIO6 (D1) + [10] = &(lt_arduino_pin_info_list[4]), // GPIO10 (D4) + [11] = &(lt_arduino_pin_info_list[3]), // GPIO11 (D3) + [21] = &(lt_arduino_pin_info_list[7]), // GPIO21 (D7) + [24] = &(lt_arduino_pin_info_list[0]), // GPIO24 (D0) + [26] = &(lt_arduino_pin_info_list[2]), // GPIO26 (D2) +}; +// clang-format on diff --git a/boards/variants/cblc5.h b/boards/variants/cblc5.h new file mode 100644 index 000000000..159759e13 --- /dev/null +++ b/boards/variants/cblc5.h @@ -0,0 +1,82 @@ +/* This file was auto-generated from cblc5.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 8 // Total GPIO count +#define NUM_DIGITAL_PINS 8 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 0 // ADC inputs +#define NUM_ANALOG_OUTPUTS 3 // PWM & DAC outputs +#define PINS_GPIO_MAX 26 // Last usable GPIO number + +// Wire Interfaces +// --------------- +#define PIN_WIRE2_SCL 0u // GPIO0 +#define PIN_WIRE2_SDA 1u // GPIO1 +#define PINS_WIRE2_SCL (pin_size_t[]){0u} +#define PINS_WIRE2_SDA (pin_size_t[]){1u} + +// Serial ports +// ------------ +#define PIN_SERIAL1_RX 10u // GPIO10 +#define PIN_SERIAL1_TX 11u // GPIO11 +#define PIN_SERIAL2_RX 1u // GPIO1 +#define PIN_SERIAL2_TX 0u // GPIO0 +#define PINS_SERIAL1_RX (pin_size_t[]){10u} +#define PINS_SERIAL1_TX (pin_size_t[]){11u} +#define PINS_SERIAL2_RX (pin_size_t[]){1u} +#define PINS_SERIAL2_TX (pin_size_t[]){0u} + +// Pin function macros +// ------------------- +#define PIN_P0 0u // GPIO0 +#define PIN_P1 1u // GPIO1 +#define PIN_P6 6u // GPIO6 +#define PIN_P10 10u // GPIO10 +#define PIN_P11 11u // GPIO11 +#define PIN_P21 21u // GPIO21 +#define PIN_P24 24u // GPIO24 +#define PIN_P26 26u // GPIO26 +#define PIN_PWM0 6u // GPIO6 +#define PIN_PWM4 24u // GPIO24 +#define PIN_PWM5 26u // GPIO26 +#define PIN_RX1 10u // GPIO10 +#define PIN_RX2 1u // GPIO1 +#define PIN_SCL2 0u // GPIO0 +#define PIN_SDA1 21u // GPIO21 +#define PIN_SDA2 1u // GPIO1 +#define PIN_TX1 11u // GPIO11 +#define PIN_TX2 0u // GPIO0 + +// Port availability +// ----------------- +#define HAS_SERIAL1 1 +#define HAS_SERIAL2 1 +#define HAS_WIRE2 1 +#define SERIAL_INTERFACES_COUNT 2 +#define WIRE_INTERFACES_COUNT 1 + +// Arduino pin names +// ----------------- +#define PIN_D0 24u // GPIO24 +#define PIN_D1 6u // GPIO6 +#define PIN_D2 26u // GPIO26 +#define PIN_D3 11u // GPIO11 +#define PIN_D4 10u // GPIO10 +#define PIN_D5 1u // GPIO1 +#define PIN_D6 0u // GPIO0 +#define PIN_D7 21u // GPIO21 + +// Static pin names +// ---------------- +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; diff --git a/boards/variants/cbu.c b/boards/variants/cbu.c new file mode 100644 index 000000000..2ce39d5b7 --- /dev/null +++ b/boards/variants/cbu.c @@ -0,0 +1,72 @@ +/* This file was auto-generated from cbu.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: P14, SD_CLK, SCK + {GPIO14, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D1: P16, SD_D0, MOSI + {GPIO16, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D2: P20, I2C1_SCL, TCK, FSCK + {GPIO20, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_JTAG, PIN_NONE, 0}, + // D3: P22, TDI, FSI + {GPIO22, PIN_GPIO | PIN_IRQ | PIN_JTAG, PIN_NONE, 0}, + // D4: P23, ADC3, TDO, FSO + {GPIO23, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_JTAG, PIN_NONE, 0}, + // D5: P1, UART2_RX, I2C2_SDA + {GPIO1, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D6: P0, UART2_TX, I2C2_SCL + {GPIO0, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D7: P8, PWM2 + {GPIO8, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D8: P7, PWM1 + {GPIO7, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D9: P6, PWM0 + {GPIO6, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D10: P26, PWM5, IRDA + {GPIO26, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D11: P24, PWM4 + {GPIO24, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D12: P11, UART1_TX + {GPIO11, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D13: P10, UART1_RX + {GPIO10, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D14: P28, DN + {GPIO28, PIN_GPIO | PIN_IRQ, PIN_NONE, 0}, + // D15: P9, PWM3 + {GPIO9, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D16: P17, SD_D1, MISO + {GPIO17, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D17: P15, SD_CMD, CS + {GPIO15, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D18: P21, I2C1_SDA, TMS, MCLK, ^FCS + {GPIO21, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_JTAG, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[6]), // GPIO0 (D6) + [1] = &(lt_arduino_pin_info_list[5]), // GPIO1 (D5) + [6] = &(lt_arduino_pin_info_list[9]), // GPIO6 (D9) + [7] = &(lt_arduino_pin_info_list[8]), // GPIO7 (D8) + [8] = &(lt_arduino_pin_info_list[7]), // GPIO8 (D7) + [9] = &(lt_arduino_pin_info_list[15]), // GPIO9 (D15) + [10] = &(lt_arduino_pin_info_list[13]), // GPIO10 (D13) + [11] = &(lt_arduino_pin_info_list[12]), // GPIO11 (D12) + [14] = &(lt_arduino_pin_info_list[0]), // GPIO14 (D0) + [15] = &(lt_arduino_pin_info_list[17]), // GPIO15 (D17) + [16] = &(lt_arduino_pin_info_list[1]), // GPIO16 (D1) + [17] = &(lt_arduino_pin_info_list[16]), // GPIO17 (D16) + [20] = &(lt_arduino_pin_info_list[2]), // GPIO20 (D2) + [21] = &(lt_arduino_pin_info_list[18]), // GPIO21 (D18) + [22] = &(lt_arduino_pin_info_list[3]), // GPIO22 (D3) + [23] = &(lt_arduino_pin_info_list[4]), // GPIO23 (D4) + [24] = &(lt_arduino_pin_info_list[11]), // GPIO24 (D11) + [26] = &(lt_arduino_pin_info_list[10]), // GPIO26 (D10) + [28] = &(lt_arduino_pin_info_list[14]), // GPIO28 (D14) +}; +// clang-format on diff --git a/boards/variants/cbu.h b/boards/variants/cbu.h new file mode 100644 index 000000000..2cca37c83 --- /dev/null +++ b/boards/variants/cbu.h @@ -0,0 +1,144 @@ +/* This file was auto-generated from cbu.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 19 // Total GPIO count +#define NUM_DIGITAL_PINS 19 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 1 // ADC inputs +#define NUM_ANALOG_OUTPUTS 6 // PWM & DAC outputs +#define PINS_GPIO_MAX 28 // Last usable GPIO number + +// SPI Interfaces +// -------------- +#define PIN_SPI0_CS 15u // GPIO15 +#define PIN_SPI0_MISO 17u // GPIO17 +#define PIN_SPI0_MOSI 16u // GPIO16 +#define PIN_SPI0_SCK 14u // GPIO14 +#define PINS_SPI0_CS (pin_size_t[]){15u} +#define PINS_SPI0_MISO (pin_size_t[]){17u} +#define PINS_SPI0_MOSI (pin_size_t[]){16u} +#define PINS_SPI0_SCK (pin_size_t[]){14u} + +// Wire Interfaces +// --------------- +#define PIN_WIRE1_SCL 20u // GPIO20 +#define PIN_WIRE1_SDA 21u // GPIO21 +#define PIN_WIRE2_SCL 0u // GPIO0 +#define PIN_WIRE2_SDA 1u // GPIO1 +#define PINS_WIRE1_SCL (pin_size_t[]){20u} +#define PINS_WIRE1_SDA (pin_size_t[]){21u} +#define PINS_WIRE2_SCL (pin_size_t[]){0u} +#define PINS_WIRE2_SDA (pin_size_t[]){1u} + +// Serial ports +// ------------ +#define PIN_SERIAL1_RX 10u // GPIO10 +#define PIN_SERIAL1_TX 11u // GPIO11 +#define PIN_SERIAL2_RX 1u // GPIO1 +#define PIN_SERIAL2_TX 0u // GPIO0 +#define PINS_SERIAL1_RX (pin_size_t[]){10u} +#define PINS_SERIAL1_TX (pin_size_t[]){11u} +#define PINS_SERIAL2_RX (pin_size_t[]){1u} +#define PINS_SERIAL2_TX (pin_size_t[]){0u} + +// Pin function macros +// ------------------- +#define PIN_ADC3 23u // GPIO23 +#define PIN_CS 15u // GPIO15 +#define PIN_MISO 17u // GPIO17 +#define PIN_MOSI 16u // GPIO16 +#define PIN_P0 0u // GPIO0 +#define PIN_P1 1u // GPIO1 +#define PIN_P6 6u // GPIO6 +#define PIN_P7 7u // GPIO7 +#define PIN_P8 8u // GPIO8 +#define PIN_P9 9u // GPIO9 +#define PIN_P10 10u // GPIO10 +#define PIN_P11 11u // GPIO11 +#define PIN_P14 14u // GPIO14 +#define PIN_P15 15u // GPIO15 +#define PIN_P16 16u // GPIO16 +#define PIN_P17 17u // GPIO17 +#define PIN_P20 20u // GPIO20 +#define PIN_P21 21u // GPIO21 +#define PIN_P22 22u // GPIO22 +#define PIN_P23 23u // GPIO23 +#define PIN_P24 24u // GPIO24 +#define PIN_P26 26u // GPIO26 +#define PIN_P28 28u // GPIO28 +#define PIN_PWM0 6u // GPIO6 +#define PIN_PWM1 7u // GPIO7 +#define PIN_PWM2 8u // GPIO8 +#define PIN_PWM3 9u // GPIO9 +#define PIN_PWM4 24u // GPIO24 +#define PIN_PWM5 26u // GPIO26 +#define PIN_RX1 10u // GPIO10 +#define PIN_RX2 1u // GPIO1 +#define PIN_SCK 14u // GPIO14 +#define PIN_SCL1 20u // GPIO20 +#define PIN_SCL2 0u // GPIO0 +#define PIN_SDA1 21u // GPIO21 +#define PIN_SDA2 1u // GPIO1 +#define PIN_TX1 11u // GPIO11 +#define PIN_TX2 0u // GPIO0 + +// Port availability +// ----------------- +#define HAS_SERIAL1 1 +#define HAS_SERIAL2 1 +#define HAS_SPI0 1 +#define HAS_WIRE1 1 +#define HAS_WIRE2 1 +#define SERIAL_INTERFACES_COUNT 2 +#define SPI_INTERFACES_COUNT 1 +#define WIRE_INTERFACES_COUNT 2 + +// Arduino pin names +// ----------------- +#define PIN_D0 14u // GPIO14 +#define PIN_D1 16u // GPIO16 +#define PIN_D2 20u // GPIO20 +#define PIN_D3 22u // GPIO22 +#define PIN_D4 23u // GPIO23 +#define PIN_D5 1u // GPIO1 +#define PIN_D6 0u // GPIO0 +#define PIN_D7 8u // GPIO8 +#define PIN_D8 7u // GPIO7 +#define PIN_D9 6u // GPIO6 +#define PIN_D10 26u // GPIO26 +#define PIN_D11 24u // GPIO24 +#define PIN_D12 11u // GPIO11 +#define PIN_D13 10u // GPIO10 +#define PIN_D14 28u // GPIO28 +#define PIN_D15 9u // GPIO9 +#define PIN_D16 17u // GPIO17 +#define PIN_D17 15u // GPIO15 +#define PIN_D18 21u // GPIO21 +#define PIN_A0 23u // GPIO23 + +// Static pin names +// ---------------- +static const unsigned char A0 = PIN_A0; +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; +static const unsigned char D9 = PIN_D9; +static const unsigned char D10 = PIN_D10; +static const unsigned char D11 = PIN_D11; +static const unsigned char D12 = PIN_D12; +static const unsigned char D13 = PIN_D13; +static const unsigned char D14 = PIN_D14; +static const unsigned char D15 = PIN_D15; +static const unsigned char D16 = PIN_D16; +static const unsigned char D17 = PIN_D17; +static const unsigned char D18 = PIN_D18; diff --git a/boards/variants/generic-bk7231n-qfn32-tuya.c b/boards/variants/generic-bk7231n-qfn32-tuya.c new file mode 100644 index 000000000..64a732a34 --- /dev/null +++ b/boards/variants/generic-bk7231n-qfn32-tuya.c @@ -0,0 +1,72 @@ +/* This file was auto-generated from generic-bk7231n-qfn32-tuya.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: P0, UART2_TX, I2C2_SCL + {GPIO0, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D1: P1, UART2_RX, I2C2_SDA + {GPIO1, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D2: P6, PWM0 + {GPIO6, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D3: P7, PWM1 + {GPIO7, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D4: P8, PWM2 + {GPIO8, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D5: P9, PWM3 + {GPIO9, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D6: P10, UART1_RX + {GPIO10, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D7: P11, UART1_TX + {GPIO11, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D8: P14, SD_CLK, SCK + {GPIO14, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D9: P15, SD_CMD, CS + {GPIO15, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D10: P16, SD_D0, MOSI + {GPIO16, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D11: P17, SD_D1, MISO + {GPIO17, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D12: P20, I2C1_SCL, TCK, FSCK + {GPIO20, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_JTAG, PIN_NONE, 0}, + // D13: P21, I2C1_SDA, TMS, MCLK, ^FCS + {GPIO21, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_JTAG, PIN_NONE, 0}, + // D14: P22, TDI, FSI + {GPIO22, PIN_GPIO | PIN_IRQ | PIN_JTAG, PIN_NONE, 0}, + // D15: P23, ADC3, TDO, FSO + {GPIO23, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_JTAG, PIN_NONE, 0}, + // D16: P24, PWM4 + {GPIO24, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D17: P26, PWM5, IRDA + {GPIO26, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D18: P28, DN + {GPIO28, PIN_GPIO | PIN_IRQ, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[0]), // GPIO0 (D0) + [1] = &(lt_arduino_pin_info_list[1]), // GPIO1 (D1) + [6] = &(lt_arduino_pin_info_list[2]), // GPIO6 (D2) + [7] = &(lt_arduino_pin_info_list[3]), // GPIO7 (D3) + [8] = &(lt_arduino_pin_info_list[4]), // GPIO8 (D4) + [9] = &(lt_arduino_pin_info_list[5]), // GPIO9 (D5) + [10] = &(lt_arduino_pin_info_list[6]), // GPIO10 (D6) + [11] = &(lt_arduino_pin_info_list[7]), // GPIO11 (D7) + [14] = &(lt_arduino_pin_info_list[8]), // GPIO14 (D8) + [15] = &(lt_arduino_pin_info_list[9]), // GPIO15 (D9) + [16] = &(lt_arduino_pin_info_list[10]), // GPIO16 (D10) + [17] = &(lt_arduino_pin_info_list[11]), // GPIO17 (D11) + [20] = &(lt_arduino_pin_info_list[12]), // GPIO20 (D12) + [21] = &(lt_arduino_pin_info_list[13]), // GPIO21 (D13) + [22] = &(lt_arduino_pin_info_list[14]), // GPIO22 (D14) + [23] = &(lt_arduino_pin_info_list[15]), // GPIO23 (D15) + [24] = &(lt_arduino_pin_info_list[16]), // GPIO24 (D16) + [26] = &(lt_arduino_pin_info_list[17]), // GPIO26 (D17) + [28] = &(lt_arduino_pin_info_list[18]), // GPIO28 (D18) +}; +// clang-format on diff --git a/boards/variants/generic-bk7231n-qfn32-tuya.h b/boards/variants/generic-bk7231n-qfn32-tuya.h new file mode 100644 index 000000000..8f2e4545a --- /dev/null +++ b/boards/variants/generic-bk7231n-qfn32-tuya.h @@ -0,0 +1,144 @@ +/* This file was auto-generated from generic-bk7231n-qfn32-tuya.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 19 // Total GPIO count +#define NUM_DIGITAL_PINS 19 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 1 // ADC inputs +#define NUM_ANALOG_OUTPUTS 6 // PWM & DAC outputs +#define PINS_GPIO_MAX 28 // Last usable GPIO number + +// SPI Interfaces +// -------------- +#define PIN_SPI0_CS 15u // GPIO15 +#define PIN_SPI0_MISO 17u // GPIO17 +#define PIN_SPI0_MOSI 16u // GPIO16 +#define PIN_SPI0_SCK 14u // GPIO14 +#define PINS_SPI0_CS (pin_size_t[]){15u} +#define PINS_SPI0_MISO (pin_size_t[]){17u} +#define PINS_SPI0_MOSI (pin_size_t[]){16u} +#define PINS_SPI0_SCK (pin_size_t[]){14u} + +// Wire Interfaces +// --------------- +#define PIN_WIRE1_SCL 20u // GPIO20 +#define PIN_WIRE1_SDA 21u // GPIO21 +#define PIN_WIRE2_SCL 0u // GPIO0 +#define PIN_WIRE2_SDA 1u // GPIO1 +#define PINS_WIRE1_SCL (pin_size_t[]){20u} +#define PINS_WIRE1_SDA (pin_size_t[]){21u} +#define PINS_WIRE2_SCL (pin_size_t[]){0u} +#define PINS_WIRE2_SDA (pin_size_t[]){1u} + +// Serial ports +// ------------ +#define PIN_SERIAL1_RX 10u // GPIO10 +#define PIN_SERIAL1_TX 11u // GPIO11 +#define PIN_SERIAL2_RX 1u // GPIO1 +#define PIN_SERIAL2_TX 0u // GPIO0 +#define PINS_SERIAL1_RX (pin_size_t[]){10u} +#define PINS_SERIAL1_TX (pin_size_t[]){11u} +#define PINS_SERIAL2_RX (pin_size_t[]){1u} +#define PINS_SERIAL2_TX (pin_size_t[]){0u} + +// Pin function macros +// ------------------- +#define PIN_ADC3 23u // GPIO23 +#define PIN_CS 15u // GPIO15 +#define PIN_MISO 17u // GPIO17 +#define PIN_MOSI 16u // GPIO16 +#define PIN_P0 0u // GPIO0 +#define PIN_P1 1u // GPIO1 +#define PIN_P6 6u // GPIO6 +#define PIN_P7 7u // GPIO7 +#define PIN_P8 8u // GPIO8 +#define PIN_P9 9u // GPIO9 +#define PIN_P10 10u // GPIO10 +#define PIN_P11 11u // GPIO11 +#define PIN_P14 14u // GPIO14 +#define PIN_P15 15u // GPIO15 +#define PIN_P16 16u // GPIO16 +#define PIN_P17 17u // GPIO17 +#define PIN_P20 20u // GPIO20 +#define PIN_P21 21u // GPIO21 +#define PIN_P22 22u // GPIO22 +#define PIN_P23 23u // GPIO23 +#define PIN_P24 24u // GPIO24 +#define PIN_P26 26u // GPIO26 +#define PIN_P28 28u // GPIO28 +#define PIN_PWM0 6u // GPIO6 +#define PIN_PWM1 7u // GPIO7 +#define PIN_PWM2 8u // GPIO8 +#define PIN_PWM3 9u // GPIO9 +#define PIN_PWM4 24u // GPIO24 +#define PIN_PWM5 26u // GPIO26 +#define PIN_RX1 10u // GPIO10 +#define PIN_RX2 1u // GPIO1 +#define PIN_SCK 14u // GPIO14 +#define PIN_SCL1 20u // GPIO20 +#define PIN_SCL2 0u // GPIO0 +#define PIN_SDA1 21u // GPIO21 +#define PIN_SDA2 1u // GPIO1 +#define PIN_TX1 11u // GPIO11 +#define PIN_TX2 0u // GPIO0 + +// Port availability +// ----------------- +#define HAS_SERIAL1 1 +#define HAS_SERIAL2 1 +#define HAS_SPI0 1 +#define HAS_WIRE1 1 +#define HAS_WIRE2 1 +#define SERIAL_INTERFACES_COUNT 2 +#define SPI_INTERFACES_COUNT 1 +#define WIRE_INTERFACES_COUNT 2 + +// Arduino pin names +// ----------------- +#define PIN_D0 0u // GPIO0 +#define PIN_D1 1u // GPIO1 +#define PIN_D2 6u // GPIO6 +#define PIN_D3 7u // GPIO7 +#define PIN_D4 8u // GPIO8 +#define PIN_D5 9u // GPIO9 +#define PIN_D6 10u // GPIO10 +#define PIN_D7 11u // GPIO11 +#define PIN_D8 14u // GPIO14 +#define PIN_D9 15u // GPIO15 +#define PIN_D10 16u // GPIO16 +#define PIN_D11 17u // GPIO17 +#define PIN_D12 20u // GPIO20 +#define PIN_D13 21u // GPIO21 +#define PIN_D14 22u // GPIO22 +#define PIN_D15 23u // GPIO23 +#define PIN_D16 24u // GPIO24 +#define PIN_D17 26u // GPIO26 +#define PIN_D18 28u // GPIO28 +#define PIN_A0 23u // GPIO23 + +// Static pin names +// ---------------- +static const unsigned char A0 = PIN_A0; +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; +static const unsigned char D9 = PIN_D9; +static const unsigned char D10 = PIN_D10; +static const unsigned char D11 = PIN_D11; +static const unsigned char D12 = PIN_D12; +static const unsigned char D13 = PIN_D13; +static const unsigned char D14 = PIN_D14; +static const unsigned char D15 = PIN_D15; +static const unsigned char D16 = PIN_D16; +static const unsigned char D17 = PIN_D17; +static const unsigned char D18 = PIN_D18; diff --git a/boards/variants/generic-bk7231t-qfn32-tuya.c b/boards/variants/generic-bk7231t-qfn32-tuya.c new file mode 100644 index 000000000..539e8bae2 --- /dev/null +++ b/boards/variants/generic-bk7231t-qfn32-tuya.c @@ -0,0 +1,72 @@ +/* This file was auto-generated from generic-bk7231t-qfn32-tuya.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: P0, UART2_TX, I2C2_SCL + {GPIO0, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D1: P1, UART2_RX, I2C2_SDA + {GPIO1, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D2: P6, PWM0 + {GPIO6, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D3: P7, PWM1 + {GPIO7, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D4: P8, PWM2 + {GPIO8, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D5: P9, PWM3 + {GPIO9, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D6: P10, UART1_RX + {GPIO10, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D7: P11, UART1_TX + {GPIO11, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D8: P14, SD_CLK, SCK + {GPIO14, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D9: P15, SD_CMD, CS + {GPIO15, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D10: P16, SD_D0, MOSI + {GPIO16, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D11: P17, SD_D1, MISO + {GPIO17, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D12: P20, I2C1_SCL, TCK, FSCK + {GPIO20, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_JTAG, PIN_NONE, 0}, + // D13: P21, I2C1_SDA, TMS, MCLK, ^FCS + {GPIO21, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_JTAG, PIN_NONE, 0}, + // D14: P22, TDI, FSI + {GPIO22, PIN_GPIO | PIN_IRQ | PIN_JTAG, PIN_NONE, 0}, + // D15: P23, ADC3, TDO, FSO + {GPIO23, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_JTAG, PIN_NONE, 0}, + // D16: P24, PWM4 + {GPIO24, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D17: P26, PWM5, IRDA + {GPIO26, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D18: P28, DN + {GPIO28, PIN_GPIO | PIN_IRQ, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[0]), // GPIO0 (D0) + [1] = &(lt_arduino_pin_info_list[1]), // GPIO1 (D1) + [6] = &(lt_arduino_pin_info_list[2]), // GPIO6 (D2) + [7] = &(lt_arduino_pin_info_list[3]), // GPIO7 (D3) + [8] = &(lt_arduino_pin_info_list[4]), // GPIO8 (D4) + [9] = &(lt_arduino_pin_info_list[5]), // GPIO9 (D5) + [10] = &(lt_arduino_pin_info_list[6]), // GPIO10 (D6) + [11] = &(lt_arduino_pin_info_list[7]), // GPIO11 (D7) + [14] = &(lt_arduino_pin_info_list[8]), // GPIO14 (D8) + [15] = &(lt_arduino_pin_info_list[9]), // GPIO15 (D9) + [16] = &(lt_arduino_pin_info_list[10]), // GPIO16 (D10) + [17] = &(lt_arduino_pin_info_list[11]), // GPIO17 (D11) + [20] = &(lt_arduino_pin_info_list[12]), // GPIO20 (D12) + [21] = &(lt_arduino_pin_info_list[13]), // GPIO21 (D13) + [22] = &(lt_arduino_pin_info_list[14]), // GPIO22 (D14) + [23] = &(lt_arduino_pin_info_list[15]), // GPIO23 (D15) + [24] = &(lt_arduino_pin_info_list[16]), // GPIO24 (D16) + [26] = &(lt_arduino_pin_info_list[17]), // GPIO26 (D17) + [28] = &(lt_arduino_pin_info_list[18]), // GPIO28 (D18) +}; +// clang-format on diff --git a/boards/variants/generic-bk7231t-qfn32-tuya.h b/boards/variants/generic-bk7231t-qfn32-tuya.h new file mode 100644 index 000000000..13376cccd --- /dev/null +++ b/boards/variants/generic-bk7231t-qfn32-tuya.h @@ -0,0 +1,144 @@ +/* This file was auto-generated from generic-bk7231t-qfn32-tuya.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 19 // Total GPIO count +#define NUM_DIGITAL_PINS 19 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 1 // ADC inputs +#define NUM_ANALOG_OUTPUTS 6 // PWM & DAC outputs +#define PINS_GPIO_MAX 28 // Last usable GPIO number + +// SPI Interfaces +// -------------- +#define PIN_SPI0_CS 15u // GPIO15 +#define PIN_SPI0_MISO 17u // GPIO17 +#define PIN_SPI0_MOSI 16u // GPIO16 +#define PIN_SPI0_SCK 14u // GPIO14 +#define PINS_SPI0_CS (pin_size_t[]){15u} +#define PINS_SPI0_MISO (pin_size_t[]){17u} +#define PINS_SPI0_MOSI (pin_size_t[]){16u} +#define PINS_SPI0_SCK (pin_size_t[]){14u} + +// Wire Interfaces +// --------------- +#define PIN_WIRE1_SCL 20u // GPIO20 +#define PIN_WIRE1_SDA 21u // GPIO21 +#define PIN_WIRE2_SCL 0u // GPIO0 +#define PIN_WIRE2_SDA 1u // GPIO1 +#define PINS_WIRE1_SCL (pin_size_t[]){20u} +#define PINS_WIRE1_SDA (pin_size_t[]){21u} +#define PINS_WIRE2_SCL (pin_size_t[]){0u} +#define PINS_WIRE2_SDA (pin_size_t[]){1u} + +// Serial ports +// ------------ +#define PIN_SERIAL1_RX 10u // GPIO10 +#define PIN_SERIAL1_TX 11u // GPIO11 +#define PIN_SERIAL2_RX 1u // GPIO1 +#define PIN_SERIAL2_TX 0u // GPIO0 +#define PINS_SERIAL1_RX (pin_size_t[]){10u} +#define PINS_SERIAL1_TX (pin_size_t[]){11u} +#define PINS_SERIAL2_RX (pin_size_t[]){1u} +#define PINS_SERIAL2_TX (pin_size_t[]){0u} + +// Pin function macros +// ------------------- +#define PIN_ADC3 23u // GPIO23 +#define PIN_CS 15u // GPIO15 +#define PIN_MISO 17u // GPIO17 +#define PIN_MOSI 16u // GPIO16 +#define PIN_P0 0u // GPIO0 +#define PIN_P1 1u // GPIO1 +#define PIN_P6 6u // GPIO6 +#define PIN_P7 7u // GPIO7 +#define PIN_P8 8u // GPIO8 +#define PIN_P9 9u // GPIO9 +#define PIN_P10 10u // GPIO10 +#define PIN_P11 11u // GPIO11 +#define PIN_P14 14u // GPIO14 +#define PIN_P15 15u // GPIO15 +#define PIN_P16 16u // GPIO16 +#define PIN_P17 17u // GPIO17 +#define PIN_P20 20u // GPIO20 +#define PIN_P21 21u // GPIO21 +#define PIN_P22 22u // GPIO22 +#define PIN_P23 23u // GPIO23 +#define PIN_P24 24u // GPIO24 +#define PIN_P26 26u // GPIO26 +#define PIN_P28 28u // GPIO28 +#define PIN_PWM0 6u // GPIO6 +#define PIN_PWM1 7u // GPIO7 +#define PIN_PWM2 8u // GPIO8 +#define PIN_PWM3 9u // GPIO9 +#define PIN_PWM4 24u // GPIO24 +#define PIN_PWM5 26u // GPIO26 +#define PIN_RX1 10u // GPIO10 +#define PIN_RX2 1u // GPIO1 +#define PIN_SCK 14u // GPIO14 +#define PIN_SCL1 20u // GPIO20 +#define PIN_SCL2 0u // GPIO0 +#define PIN_SDA1 21u // GPIO21 +#define PIN_SDA2 1u // GPIO1 +#define PIN_TX1 11u // GPIO11 +#define PIN_TX2 0u // GPIO0 + +// Port availability +// ----------------- +#define HAS_SERIAL1 1 +#define HAS_SERIAL2 1 +#define HAS_SPI0 1 +#define HAS_WIRE1 1 +#define HAS_WIRE2 1 +#define SERIAL_INTERFACES_COUNT 2 +#define SPI_INTERFACES_COUNT 1 +#define WIRE_INTERFACES_COUNT 2 + +// Arduino pin names +// ----------------- +#define PIN_D0 0u // GPIO0 +#define PIN_D1 1u // GPIO1 +#define PIN_D2 6u // GPIO6 +#define PIN_D3 7u // GPIO7 +#define PIN_D4 8u // GPIO8 +#define PIN_D5 9u // GPIO9 +#define PIN_D6 10u // GPIO10 +#define PIN_D7 11u // GPIO11 +#define PIN_D8 14u // GPIO14 +#define PIN_D9 15u // GPIO15 +#define PIN_D10 16u // GPIO16 +#define PIN_D11 17u // GPIO17 +#define PIN_D12 20u // GPIO20 +#define PIN_D13 21u // GPIO21 +#define PIN_D14 22u // GPIO22 +#define PIN_D15 23u // GPIO23 +#define PIN_D16 24u // GPIO24 +#define PIN_D17 26u // GPIO26 +#define PIN_D18 28u // GPIO28 +#define PIN_A0 23u // GPIO23 + +// Static pin names +// ---------------- +static const unsigned char A0 = PIN_A0; +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; +static const unsigned char D9 = PIN_D9; +static const unsigned char D10 = PIN_D10; +static const unsigned char D11 = PIN_D11; +static const unsigned char D12 = PIN_D12; +static const unsigned char D13 = PIN_D13; +static const unsigned char D14 = PIN_D14; +static const unsigned char D15 = PIN_D15; +static const unsigned char D16 = PIN_D16; +static const unsigned char D17 = PIN_D17; +static const unsigned char D18 = PIN_D18; diff --git a/boards/variants/generic-bk7252.c b/boards/variants/generic-bk7252.c new file mode 100644 index 000000000..7c138dc91 --- /dev/null +++ b/boards/variants/generic-bk7252.c @@ -0,0 +1,129 @@ +/* This file was auto-generated from generic-bk7252.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: P0, UART2_TX, I2C2_SCL + {GPIO0, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D1: P1, UART2_RX, I2C2_SDA + {GPIO1, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D2: P2, ADC4, SCK + {GPIO2, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_I2S, PIN_NONE, 0}, + // D3: P3, ADC5, WS + {GPIO3, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_I2S, PIN_NONE, 0}, + // D4: P4, ADC1, DIN + {GPIO4, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_I2S, PIN_NONE, 0}, + // D5: P5, ADC2, DOUT + {GPIO5, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_I2S, PIN_NONE, 0}, + // D6: P6, PWM0 + {GPIO6, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D7: P7, PWM1 + {GPIO7, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D8: P10, UART1_RX + {GPIO10, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D9: P11, UART1_TX + {GPIO11, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D10: P12, ADC6, UART1_CTS + {GPIO12, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_UART, PIN_NONE, 0}, + // D11: P13, ADC7, UART1_RTS + {GPIO13, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_UART, PIN_NONE, 0}, + // D12: P14, SD_CLK, SCK + {GPIO14, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D13: P15, SD_CMD, CS + {GPIO15, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D14: P16, SD_D0, MOSI + {GPIO16, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D15: P17, SD_D1, MISO + {GPIO17, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D16: P18, SD_D2 + {GPIO18, PIN_GPIO | PIN_IRQ, PIN_NONE, 0}, + // D17: P19, SD_D3 + {GPIO19, PIN_GPIO | PIN_IRQ, PIN_NONE, 0}, + // D18: P20, I2C1_SCL, TCK, FSCK + {GPIO20, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_JTAG, PIN_NONE, 0}, + // D19: P21, I2C1_SDA, TMS, MCLK, ^FCS + {GPIO21, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_JTAG, PIN_NONE, 0}, + // D20: P22, TDI, FSI + {GPIO22, PIN_GPIO | PIN_IRQ | PIN_JTAG, PIN_NONE, 0}, + // D21: P23, ADC3, TDO, FSO + {GPIO23, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_JTAG, PIN_NONE, 0}, + // D22: P24, PWM4 + {GPIO24, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D23: P25, DP + {GPIO25, PIN_GPIO | PIN_IRQ, PIN_NONE, 0}, + // D24: P26, PWM5, IRDA + {GPIO26, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D25: P27, DVP_MCLK + {GPIO27, PIN_GPIO | PIN_IRQ, PIN_NONE, 0}, + // D26: P28, DN + {GPIO28, PIN_GPIO | PIN_IRQ, PIN_NONE, 0}, + // D27: P29, DVP_PCLK + {GPIO29, PIN_GPIO | PIN_IRQ, PIN_NONE, 0}, + // D28: P30, DVP_HSYNC + {GPIO30, PIN_GPIO | PIN_IRQ, PIN_NONE, 0}, + // D29: P31, DVP_VSYNC + {GPIO31, PIN_GPIO | PIN_IRQ, PIN_NONE, 0}, + // D30: P32, DVP_PD0 + {GPIO32, PIN_GPIO | PIN_IRQ, PIN_NONE, 0}, + // D31: P33, DVP_PD1 + {GPIO33, PIN_GPIO | PIN_IRQ, PIN_NONE, 0}, + // D32: P34, DVP_PD2 + {GPIO34, PIN_GPIO | PIN_IRQ, PIN_NONE, 0}, + // D33: P35, DVP_PD3 + {GPIO35, PIN_GPIO | PIN_IRQ, PIN_NONE, 0}, + // D34: P36, DVP_PD4 + {GPIO36, PIN_GPIO | PIN_IRQ, PIN_NONE, 0}, + // D35: P37, DVP_PD5 + {GPIO37, PIN_GPIO | PIN_IRQ, PIN_NONE, 0}, + // D36: P38, DVP_PD6 + {GPIO38, PIN_GPIO | PIN_IRQ, PIN_NONE, 0}, + // D37: P39, DVP_PD7 + {GPIO39, PIN_GPIO | PIN_IRQ, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[0]), // GPIO0 (D0) + [1] = &(lt_arduino_pin_info_list[1]), // GPIO1 (D1) + [2] = &(lt_arduino_pin_info_list[2]), // GPIO2 (D2) + [3] = &(lt_arduino_pin_info_list[3]), // GPIO3 (D3) + [4] = &(lt_arduino_pin_info_list[4]), // GPIO4 (D4) + [5] = &(lt_arduino_pin_info_list[5]), // GPIO5 (D5) + [6] = &(lt_arduino_pin_info_list[6]), // GPIO6 (D6) + [7] = &(lt_arduino_pin_info_list[7]), // GPIO7 (D7) + [10] = &(lt_arduino_pin_info_list[8]), // GPIO10 (D8) + [11] = &(lt_arduino_pin_info_list[9]), // GPIO11 (D9) + [12] = &(lt_arduino_pin_info_list[10]), // GPIO12 (D10) + [13] = &(lt_arduino_pin_info_list[11]), // GPIO13 (D11) + [14] = &(lt_arduino_pin_info_list[12]), // GPIO14 (D12) + [15] = &(lt_arduino_pin_info_list[13]), // GPIO15 (D13) + [16] = &(lt_arduino_pin_info_list[14]), // GPIO16 (D14) + [17] = &(lt_arduino_pin_info_list[15]), // GPIO17 (D15) + [18] = &(lt_arduino_pin_info_list[16]), // GPIO18 (D16) + [19] = &(lt_arduino_pin_info_list[17]), // GPIO19 (D17) + [20] = &(lt_arduino_pin_info_list[18]), // GPIO20 (D18) + [21] = &(lt_arduino_pin_info_list[19]), // GPIO21 (D19) + [22] = &(lt_arduino_pin_info_list[20]), // GPIO22 (D20) + [23] = &(lt_arduino_pin_info_list[21]), // GPIO23 (D21) + [24] = &(lt_arduino_pin_info_list[22]), // GPIO24 (D22) + [25] = &(lt_arduino_pin_info_list[23]), // GPIO25 (D23) + [26] = &(lt_arduino_pin_info_list[24]), // GPIO26 (D24) + [27] = &(lt_arduino_pin_info_list[25]), // GPIO27 (D25) + [28] = &(lt_arduino_pin_info_list[26]), // GPIO28 (D26) + [29] = &(lt_arduino_pin_info_list[27]), // GPIO29 (D27) + [30] = &(lt_arduino_pin_info_list[28]), // GPIO30 (D28) + [31] = &(lt_arduino_pin_info_list[29]), // GPIO31 (D29) + [32] = &(lt_arduino_pin_info_list[30]), // GPIO32 (D30) + [33] = &(lt_arduino_pin_info_list[31]), // GPIO33 (D31) + [34] = &(lt_arduino_pin_info_list[32]), // GPIO34 (D32) + [35] = &(lt_arduino_pin_info_list[33]), // GPIO35 (D33) + [36] = &(lt_arduino_pin_info_list[34]), // GPIO36 (D34) + [37] = &(lt_arduino_pin_info_list[35]), // GPIO37 (D35) + [38] = &(lt_arduino_pin_info_list[36]), // GPIO38 (D36) + [39] = &(lt_arduino_pin_info_list[37]), // GPIO39 (D37) +}; +// clang-format on diff --git a/boards/variants/generic-bk7252.h b/boards/variants/generic-bk7252.h new file mode 100644 index 000000000..ea0488334 --- /dev/null +++ b/boards/variants/generic-bk7252.h @@ -0,0 +1,223 @@ +/* This file was auto-generated from generic-bk7252.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 38 // Total GPIO count +#define NUM_DIGITAL_PINS 38 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 7 // ADC inputs +#define NUM_ANALOG_OUTPUTS 4 // PWM & DAC outputs +#define PINS_GPIO_MAX 39 // Last usable GPIO number + +// SPI Interfaces +// -------------- +#define PIN_SPI0_CS 15u // GPIO15 +#define PIN_SPI0_MISO 17u // GPIO17 +#define PIN_SPI0_MOSI 16u // GPIO16 +#define PIN_SPI0_SCK 14u // GPIO14 +#define PINS_SPI0_CS (pin_size_t[]){15u} +#define PINS_SPI0_MISO (pin_size_t[]){17u} +#define PINS_SPI0_MOSI (pin_size_t[]){16u} +#define PINS_SPI0_SCK (pin_size_t[]){14u} + +// Wire Interfaces +// --------------- +#define PIN_WIRE1_SCL 20u // GPIO20 +#define PIN_WIRE1_SDA 21u // GPIO21 +#define PIN_WIRE2_SCL 0u // GPIO0 +#define PIN_WIRE2_SDA 1u // GPIO1 +#define PINS_WIRE1_SCL (pin_size_t[]){20u} +#define PINS_WIRE1_SDA (pin_size_t[]){21u} +#define PINS_WIRE2_SCL (pin_size_t[]){0u} +#define PINS_WIRE2_SDA (pin_size_t[]){1u} + +// Serial ports +// ------------ +#define PIN_SERIAL1_CTS 12u // GPIO12 +#define PIN_SERIAL1_RTS 13u // GPIO13 +#define PIN_SERIAL1_RX 10u // GPIO10 +#define PIN_SERIAL1_TX 11u // GPIO11 +#define PIN_SERIAL2_RX 1u // GPIO1 +#define PIN_SERIAL2_TX 0u // GPIO0 +#define PINS_SERIAL1_CTS (pin_size_t[]){12u} +#define PINS_SERIAL1_RTS (pin_size_t[]){13u} +#define PINS_SERIAL1_RX (pin_size_t[]){10u} +#define PINS_SERIAL1_TX (pin_size_t[]){11u} +#define PINS_SERIAL2_RX (pin_size_t[]){1u} +#define PINS_SERIAL2_TX (pin_size_t[]){0u} + +// Pin function macros +// ------------------- +#define PIN_ADC1 4u // GPIO4 +#define PIN_ADC2 5u // GPIO5 +#define PIN_ADC3 23u // GPIO23 +#define PIN_ADC4 2u // GPIO2 +#define PIN_ADC5 3u // GPIO3 +#define PIN_ADC6 12u // GPIO12 +#define PIN_ADC7 13u // GPIO13 +#define PIN_CS 15u // GPIO15 +#define PIN_CTS1 12u // GPIO12 +#define PIN_MISO 17u // GPIO17 +#define PIN_MOSI 16u // GPIO16 +#define PIN_P0 0u // GPIO0 +#define PIN_P1 1u // GPIO1 +#define PIN_P2 2u // GPIO2 +#define PIN_P3 3u // GPIO3 +#define PIN_P4 4u // GPIO4 +#define PIN_P5 5u // GPIO5 +#define PIN_P6 6u // GPIO6 +#define PIN_P7 7u // GPIO7 +#define PIN_P10 10u // GPIO10 +#define PIN_P11 11u // GPIO11 +#define PIN_P12 12u // GPIO12 +#define PIN_P13 13u // GPIO13 +#define PIN_P14 14u // GPIO14 +#define PIN_P15 15u // GPIO15 +#define PIN_P16 16u // GPIO16 +#define PIN_P17 17u // GPIO17 +#define PIN_P18 18u // GPIO18 +#define PIN_P19 19u // GPIO19 +#define PIN_P20 20u // GPIO20 +#define PIN_P21 21u // GPIO21 +#define PIN_P22 22u // GPIO22 +#define PIN_P23 23u // GPIO23 +#define PIN_P24 24u // GPIO24 +#define PIN_P25 25u // GPIO25 +#define PIN_P26 26u // GPIO26 +#define PIN_P27 27u // GPIO27 +#define PIN_P28 28u // GPIO28 +#define PIN_P29 29u // GPIO29 +#define PIN_P30 30u // GPIO30 +#define PIN_P31 31u // GPIO31 +#define PIN_P32 32u // GPIO32 +#define PIN_P33 33u // GPIO33 +#define PIN_P34 34u // GPIO34 +#define PIN_P35 35u // GPIO35 +#define PIN_P36 36u // GPIO36 +#define PIN_P37 37u // GPIO37 +#define PIN_P38 38u // GPIO38 +#define PIN_P39 39u // GPIO39 +#define PIN_PWM0 6u // GPIO6 +#define PIN_PWM1 7u // GPIO7 +#define PIN_PWM4 24u // GPIO24 +#define PIN_PWM5 26u // GPIO26 +#define PIN_RTS1 13u // GPIO13 +#define PIN_RX1 10u // GPIO10 +#define PIN_RX2 1u // GPIO1 +#define PIN_SCK 14u // GPIO14 +#define PIN_SCL1 20u // GPIO20 +#define PIN_SCL2 0u // GPIO0 +#define PIN_SDA1 21u // GPIO21 +#define PIN_SDA2 1u // GPIO1 +#define PIN_TX1 11u // GPIO11 +#define PIN_TX2 0u // GPIO0 + +// Port availability +// ----------------- +#define HAS_SERIAL1 1 +#define HAS_SERIAL2 1 +#define HAS_SPI0 1 +#define HAS_WIRE1 1 +#define HAS_WIRE2 1 +#define SERIAL_INTERFACES_COUNT 2 +#define SPI_INTERFACES_COUNT 1 +#define WIRE_INTERFACES_COUNT 2 + +// Arduino pin names +// ----------------- +#define PIN_D0 0u // GPIO0 +#define PIN_D1 1u // GPIO1 +#define PIN_D2 2u // GPIO2 +#define PIN_D3 3u // GPIO3 +#define PIN_D4 4u // GPIO4 +#define PIN_D5 5u // GPIO5 +#define PIN_D6 6u // GPIO6 +#define PIN_D7 7u // GPIO7 +#define PIN_D8 10u // GPIO10 +#define PIN_D9 11u // GPIO11 +#define PIN_D10 12u // GPIO12 +#define PIN_D11 13u // GPIO13 +#define PIN_D12 14u // GPIO14 +#define PIN_D13 15u // GPIO15 +#define PIN_D14 16u // GPIO16 +#define PIN_D15 17u // GPIO17 +#define PIN_D16 18u // GPIO18 +#define PIN_D17 19u // GPIO19 +#define PIN_D18 20u // GPIO20 +#define PIN_D19 21u // GPIO21 +#define PIN_D20 22u // GPIO22 +#define PIN_D21 23u // GPIO23 +#define PIN_D22 24u // GPIO24 +#define PIN_D23 25u // GPIO25 +#define PIN_D24 26u // GPIO26 +#define PIN_D25 27u // GPIO27 +#define PIN_D26 28u // GPIO28 +#define PIN_D27 29u // GPIO29 +#define PIN_D28 30u // GPIO30 +#define PIN_D29 31u // GPIO31 +#define PIN_D30 32u // GPIO32 +#define PIN_D31 33u // GPIO33 +#define PIN_D32 34u // GPIO34 +#define PIN_D33 35u // GPIO35 +#define PIN_D34 36u // GPIO36 +#define PIN_D35 37u // GPIO37 +#define PIN_D36 38u // GPIO38 +#define PIN_D37 39u // GPIO39 +#define PIN_A1 4u // GPIO4 +#define PIN_A2 5u // GPIO5 +#define PIN_A3 23u // GPIO23 +#define PIN_A4 3u // GPIO3 +#define PIN_A5 2u // GPIO2 +#define PIN_A6 12u // GPIO12 +#define PIN_A7 13u // GPIO13 + +// Static pin names +// ---------------- +static const unsigned char A1 = PIN_A1; +static const unsigned char A2 = PIN_A2; +static const unsigned char A3 = PIN_A3; +static const unsigned char A4 = PIN_A4; +static const unsigned char A5 = PIN_A5; +static const unsigned char A6 = PIN_A6; +static const unsigned char A7 = PIN_A7; +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; +static const unsigned char D9 = PIN_D9; +static const unsigned char D10 = PIN_D10; +static const unsigned char D11 = PIN_D11; +static const unsigned char D12 = PIN_D12; +static const unsigned char D13 = PIN_D13; +static const unsigned char D14 = PIN_D14; +static const unsigned char D15 = PIN_D15; +static const unsigned char D16 = PIN_D16; +static const unsigned char D17 = PIN_D17; +static const unsigned char D18 = PIN_D18; +static const unsigned char D19 = PIN_D19; +static const unsigned char D20 = PIN_D20; +static const unsigned char D21 = PIN_D21; +static const unsigned char D22 = PIN_D22; +static const unsigned char D23 = PIN_D23; +static const unsigned char D24 = PIN_D24; +static const unsigned char D25 = PIN_D25; +static const unsigned char D26 = PIN_D26; +static const unsigned char D27 = PIN_D27; +static const unsigned char D28 = PIN_D28; +static const unsigned char D29 = PIN_D29; +static const unsigned char D30 = PIN_D30; +static const unsigned char D31 = PIN_D31; +static const unsigned char D32 = PIN_D32; +static const unsigned char D33 = PIN_D33; +static const unsigned char D34 = PIN_D34; +static const unsigned char D35 = PIN_D35; +static const unsigned char D36 = PIN_D36; +static const unsigned char D37 = PIN_D37; diff --git a/boards/variants/generic-rtl8710bn-2mb-468k.c b/boards/variants/generic-rtl8710bn-2mb-468k.c new file mode 100644 index 000000000..10a9b9883 --- /dev/null +++ b/boards/variants/generic-rtl8710bn-2mb-468k.c @@ -0,0 +1,69 @@ +/* This file was auto-generated from generic-rtl8710bn-2mb-468k.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: PA00, PWM2 + {PA_0, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D1: PA05, PWM4, WAKE1 + {PA_5, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D2: PA06, FCS, SD_D2 + {PA_6, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D3: PA07, FD1, SD_D3 + {PA_7, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D4: PA08, FD2, SD_CMD + {PA_8, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D5: PA09, FD0, SD_CLK + {PA_9, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D6: PA10, FSCK, SD_D0 + {PA_10, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D7: PA11, FD3, SD_D1 + {PA_11, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D8: PA12, PWM3 + {PA_12, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D9: PA14, PWM0, SWCLK + {PA_14, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D10: PA15, PWM1, SWDIO + {PA_15, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D11: PA18, UART0_RX, SPI0_SCK, SPI1_SCK, I2C1_SCL, SD_D2, TMR4_TRIG, I2S0_MCK, WAKE0 + {PA_18, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D12: PA19, ADC1, UART0_CTS, SPI0_CS, SPI1_CS, I2C0_SDA, SD_D3, TMR5_TRIG, I2S0_TX + {PA_19, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D13: PA22, UART0_RTS, SPI0_MISO, SPI1_MISO, I2C0_SCL, SD_D0, PWM5, I2S0_WS, WAKE2 + {PA_22, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D14: PA23, UART0_TX, SPI0_MOSI, SPI1_MOSI, I2C1_SDA, SD_D1, PWM0, WAKE3 + {PA_23, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D15: PA29, UART2_RX, I2C0_SCL, PWM4 + {PA_29, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D16: PA30, UART2_TX, I2C0_SDA, PWM4 + {PA_30, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // A1: ADC2 + {AD_2, PIN_ADC, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[0]), // PA_0 (D0) + [5] = &(lt_arduino_pin_info_list[1]), // PA_5 (D1) + [6] = &(lt_arduino_pin_info_list[2]), // PA_6 (D2) + [7] = &(lt_arduino_pin_info_list[3]), // PA_7 (D3) + [8] = &(lt_arduino_pin_info_list[4]), // PA_8 (D4) + [9] = &(lt_arduino_pin_info_list[5]), // PA_9 (D5) + [10] = &(lt_arduino_pin_info_list[6]), // PA_10 (D6) + [11] = &(lt_arduino_pin_info_list[7]), // PA_11 (D7) + [12] = &(lt_arduino_pin_info_list[8]), // PA_12 (D8) + [14] = &(lt_arduino_pin_info_list[9]), // PA_14 (D9) + [15] = &(lt_arduino_pin_info_list[10]), // PA_15 (D10) + [18] = &(lt_arduino_pin_info_list[11]), // PA_18 (D11) + [19] = &(lt_arduino_pin_info_list[12]), // PA_19 (D12) + [22] = &(lt_arduino_pin_info_list[13]), // PA_22 (D13) + [23] = &(lt_arduino_pin_info_list[14]), // PA_23 (D14) + [29] = &(lt_arduino_pin_info_list[15]), // PA_29 (D15) + [30] = &(lt_arduino_pin_info_list[16]), // PA_30 (D16) + [41] = &(lt_arduino_pin_info_list[17]), // AD_2 (A1) +}; +// clang-format on diff --git a/boards/variants/generic-rtl8710bn-2mb-468k.h b/boards/variants/generic-rtl8710bn-2mb-468k.h new file mode 100644 index 000000000..d5d1e2659 --- /dev/null +++ b/boards/variants/generic-rtl8710bn-2mb-468k.h @@ -0,0 +1,177 @@ +/* This file was auto-generated from generic-rtl8710bn-2mb-468k.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 18 // Total GPIO count +#define NUM_DIGITAL_PINS 17 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 2 // ADC inputs +#define NUM_ANALOG_OUTPUTS 9 // PWM & DAC outputs +#define PINS_GPIO_MAX 41 // Last usable GPIO number + +// SPI Interfaces +// -------------- +#define PIN_SPI0_CS 19u // PA_19 +#define PIN_SPI0_FCS 6u // PA_6 +#define PIN_SPI0_FD0 9u // PA_9 +#define PIN_SPI0_FD1 7u // PA_7 +#define PIN_SPI0_FD2 8u // PA_8 +#define PIN_SPI0_FD3 11u // PA_11 +#define PIN_SPI0_FSCK 10u // PA_10 +#define PIN_SPI0_MISO 22u // PA_22 +#define PIN_SPI0_MOSI 23u // PA_23 +#define PIN_SPI0_SCK 18u // PA_18 +#define PIN_SPI1_CS 19u // PA_19 +#define PIN_SPI1_MISO 22u // PA_22 +#define PIN_SPI1_MOSI 23u // PA_23 +#define PIN_SPI1_SCK 18u // PA_18 +#define PINS_SPI0_CS (pin_size_t[]){19u} +#define PINS_SPI0_FCS (pin_size_t[]){6u} +#define PINS_SPI0_FD0 (pin_size_t[]){9u} +#define PINS_SPI0_FD1 (pin_size_t[]){7u} +#define PINS_SPI0_FD2 (pin_size_t[]){8u} +#define PINS_SPI0_FD3 (pin_size_t[]){11u} +#define PINS_SPI0_FSCK (pin_size_t[]){10u} +#define PINS_SPI0_MISO (pin_size_t[]){22u} +#define PINS_SPI0_MOSI (pin_size_t[]){23u} +#define PINS_SPI0_SCK (pin_size_t[]){18u} +#define PINS_SPI1_CS (pin_size_t[]){19u} +#define PINS_SPI1_MISO (pin_size_t[]){22u} +#define PINS_SPI1_MOSI (pin_size_t[]){23u} +#define PINS_SPI1_SCK (pin_size_t[]){18u} + +// Wire Interfaces +// --------------- +#define PIN_WIRE0_SCL_0 22u // PA_22 +#define PIN_WIRE0_SCL_1 29u // PA_29 +#define PIN_WIRE0_SDA_0 19u // PA_19 +#define PIN_WIRE0_SDA_1 30u // PA_30 +#define PIN_WIRE1_SCL 18u // PA_18 +#define PIN_WIRE1_SDA 23u // PA_23 +#define PINS_WIRE0_SCL (pin_size_t[]){22u, 29u} +#define PINS_WIRE0_SDA (pin_size_t[]){19u, 30u} +#define PINS_WIRE1_SCL (pin_size_t[]){18u} +#define PINS_WIRE1_SDA (pin_size_t[]){23u} + +// Serial ports +// ------------ +#define PIN_SERIAL0_CTS 19u // PA_19 +#define PIN_SERIAL0_RTS 22u // PA_22 +#define PIN_SERIAL0_RX 18u // PA_18 +#define PIN_SERIAL0_TX 23u // PA_23 +#define PIN_SERIAL2_RX 29u // PA_29 +#define PIN_SERIAL2_TX 30u // PA_30 +#define PINS_SERIAL0_CTS (pin_size_t[]){19u} +#define PINS_SERIAL0_RTS (pin_size_t[]){22u} +#define PINS_SERIAL0_RX (pin_size_t[]){18u} +#define PINS_SERIAL0_TX (pin_size_t[]){23u} +#define PINS_SERIAL2_RX (pin_size_t[]){29u} +#define PINS_SERIAL2_TX (pin_size_t[]){30u} + +// Pin function macros +// ------------------- +#define PIN_ADC1 19u // PA_19 +#define PIN_ADC2 41u // AD_2 +#define PIN_CS0 19u // PA_19 +#define PIN_CS1 19u // PA_19 +#define PIN_CTS0 19u // PA_19 +#define PIN_FCS 6u // PA_6 +#define PIN_FD0 9u // PA_9 +#define PIN_FD1 7u // PA_7 +#define PIN_FD2 8u // PA_8 +#define PIN_FD3 11u // PA_11 +#define PIN_FSCK 10u // PA_10 +#define PIN_MISO0 22u // PA_22 +#define PIN_MISO1 22u // PA_22 +#define PIN_MOSI0 23u // PA_23 +#define PIN_MOSI1 23u // PA_23 +#define PIN_PA00 0u // PA_0 +#define PIN_PA05 5u // PA_5 +#define PIN_PA06 6u // PA_6 +#define PIN_PA07 7u // PA_7 +#define PIN_PA08 8u // PA_8 +#define PIN_PA09 9u // PA_9 +#define PIN_PA10 10u // PA_10 +#define PIN_PA11 11u // PA_11 +#define PIN_PA12 12u // PA_12 +#define PIN_PA14 14u // PA_14 +#define PIN_PA15 15u // PA_15 +#define PIN_PA18 18u // PA_18 +#define PIN_PA19 19u // PA_19 +#define PIN_PA22 22u // PA_22 +#define PIN_PA23 23u // PA_23 +#define PIN_PA29 29u // PA_29 +#define PIN_PA30 30u // PA_30 +#define PIN_PWM1 15u // PA_15 +#define PIN_PWM2 0u // PA_0 +#define PIN_PWM3 12u // PA_12 +#define PIN_PWM4 30u // PA_30 +#define PIN_PWM5 22u // PA_22 +#define PIN_RTS0 22u // PA_22 +#define PIN_RX0 18u // PA_18 +#define PIN_RX2 29u // PA_29 +#define PIN_SCK0 18u // PA_18 +#define PIN_SCK1 18u // PA_18 +#define PIN_SCL1 18u // PA_18 +#define PIN_SDA1 23u // PA_23 +#define PIN_TX0 23u // PA_23 +#define PIN_TX2 30u // PA_30 + +// Port availability +// ----------------- +#define HAS_SERIAL0 1 +#define HAS_SERIAL2 1 +#define HAS_SPI0 1 +#define HAS_SPI1 1 +#define HAS_WIRE0 1 +#define HAS_WIRE1 1 +#define SERIAL_INTERFACES_COUNT 2 +#define SPI_INTERFACES_COUNT 2 +#define WIRE_INTERFACES_COUNT 2 + +// Arduino pin names +// ----------------- +#define PIN_D0 0u // PA_0 +#define PIN_D1 5u // PA_5 +#define PIN_D2 6u // PA_6 +#define PIN_D3 7u // PA_7 +#define PIN_D4 8u // PA_8 +#define PIN_D5 9u // PA_9 +#define PIN_D6 10u // PA_10 +#define PIN_D7 11u // PA_11 +#define PIN_D8 12u // PA_12 +#define PIN_D9 14u // PA_14 +#define PIN_D10 15u // PA_15 +#define PIN_D11 18u // PA_18 +#define PIN_D12 19u // PA_19 +#define PIN_D13 22u // PA_22 +#define PIN_D14 23u // PA_23 +#define PIN_D15 29u // PA_29 +#define PIN_D16 30u // PA_30 +#define PIN_A0 19u // PA_19 +#define PIN_A1 41u // AD_2 + +// Static pin names +// ---------------- +static const unsigned char A0 = PIN_A0; +static const unsigned char A1 = PIN_A1; +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; +static const unsigned char D9 = PIN_D9; +static const unsigned char D10 = PIN_D10; +static const unsigned char D11 = PIN_D11; +static const unsigned char D12 = PIN_D12; +static const unsigned char D13 = PIN_D13; +static const unsigned char D14 = PIN_D14; +static const unsigned char D15 = PIN_D15; +static const unsigned char D16 = PIN_D16; diff --git a/boards/variants/generic-rtl8710bn-2mb-788k.c b/boards/variants/generic-rtl8710bn-2mb-788k.c new file mode 100644 index 000000000..a19fd6c44 --- /dev/null +++ b/boards/variants/generic-rtl8710bn-2mb-788k.c @@ -0,0 +1,69 @@ +/* This file was auto-generated from generic-rtl8710bn-2mb-788k.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: PA00, PWM2 + {PA_0, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D1: PA05, PWM4, WAKE1 + {PA_5, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D2: PA06, FCS, SD_D2 + {PA_6, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D3: PA07, FD1, SD_D3 + {PA_7, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D4: PA08, FD2, SD_CMD + {PA_8, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D5: PA09, FD0, SD_CLK + {PA_9, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D6: PA10, FSCK, SD_D0 + {PA_10, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D7: PA11, FD3, SD_D1 + {PA_11, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D8: PA12, PWM3 + {PA_12, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D9: PA14, PWM0, SWCLK + {PA_14, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D10: PA15, PWM1, SWDIO + {PA_15, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D11: PA18, UART0_RX, SPI0_SCK, SPI1_SCK, I2C1_SCL, SD_D2, TMR4_TRIG, I2S0_MCK, WAKE0 + {PA_18, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D12: PA19, ADC1, UART0_CTS, SPI0_CS, SPI1_CS, I2C0_SDA, SD_D3, TMR5_TRIG, I2S0_TX + {PA_19, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D13: PA22, UART0_RTS, SPI0_MISO, SPI1_MISO, I2C0_SCL, SD_D0, PWM5, I2S0_WS, WAKE2 + {PA_22, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D14: PA23, UART0_TX, SPI0_MOSI, SPI1_MOSI, I2C1_SDA, SD_D1, PWM0, WAKE3 + {PA_23, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D15: PA29, UART2_RX, I2C0_SCL, PWM4 + {PA_29, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D16: PA30, UART2_TX, I2C0_SDA, PWM4 + {PA_30, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // A1: ADC2 + {AD_2, PIN_ADC, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[0]), // PA_0 (D0) + [5] = &(lt_arduino_pin_info_list[1]), // PA_5 (D1) + [6] = &(lt_arduino_pin_info_list[2]), // PA_6 (D2) + [7] = &(lt_arduino_pin_info_list[3]), // PA_7 (D3) + [8] = &(lt_arduino_pin_info_list[4]), // PA_8 (D4) + [9] = &(lt_arduino_pin_info_list[5]), // PA_9 (D5) + [10] = &(lt_arduino_pin_info_list[6]), // PA_10 (D6) + [11] = &(lt_arduino_pin_info_list[7]), // PA_11 (D7) + [12] = &(lt_arduino_pin_info_list[8]), // PA_12 (D8) + [14] = &(lt_arduino_pin_info_list[9]), // PA_14 (D9) + [15] = &(lt_arduino_pin_info_list[10]), // PA_15 (D10) + [18] = &(lt_arduino_pin_info_list[11]), // PA_18 (D11) + [19] = &(lt_arduino_pin_info_list[12]), // PA_19 (D12) + [22] = &(lt_arduino_pin_info_list[13]), // PA_22 (D13) + [23] = &(lt_arduino_pin_info_list[14]), // PA_23 (D14) + [29] = &(lt_arduino_pin_info_list[15]), // PA_29 (D15) + [30] = &(lt_arduino_pin_info_list[16]), // PA_30 (D16) + [41] = &(lt_arduino_pin_info_list[17]), // AD_2 (A1) +}; +// clang-format on diff --git a/boards/variants/generic-rtl8710bn-2mb-788k.h b/boards/variants/generic-rtl8710bn-2mb-788k.h new file mode 100644 index 000000000..2f7777567 --- /dev/null +++ b/boards/variants/generic-rtl8710bn-2mb-788k.h @@ -0,0 +1,177 @@ +/* This file was auto-generated from generic-rtl8710bn-2mb-788k.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 18 // Total GPIO count +#define NUM_DIGITAL_PINS 17 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 2 // ADC inputs +#define NUM_ANALOG_OUTPUTS 9 // PWM & DAC outputs +#define PINS_GPIO_MAX 41 // Last usable GPIO number + +// SPI Interfaces +// -------------- +#define PIN_SPI0_CS 19u // PA_19 +#define PIN_SPI0_FCS 6u // PA_6 +#define PIN_SPI0_FD0 9u // PA_9 +#define PIN_SPI0_FD1 7u // PA_7 +#define PIN_SPI0_FD2 8u // PA_8 +#define PIN_SPI0_FD3 11u // PA_11 +#define PIN_SPI0_FSCK 10u // PA_10 +#define PIN_SPI0_MISO 22u // PA_22 +#define PIN_SPI0_MOSI 23u // PA_23 +#define PIN_SPI0_SCK 18u // PA_18 +#define PIN_SPI1_CS 19u // PA_19 +#define PIN_SPI1_MISO 22u // PA_22 +#define PIN_SPI1_MOSI 23u // PA_23 +#define PIN_SPI1_SCK 18u // PA_18 +#define PINS_SPI0_CS (pin_size_t[]){19u} +#define PINS_SPI0_FCS (pin_size_t[]){6u} +#define PINS_SPI0_FD0 (pin_size_t[]){9u} +#define PINS_SPI0_FD1 (pin_size_t[]){7u} +#define PINS_SPI0_FD2 (pin_size_t[]){8u} +#define PINS_SPI0_FD3 (pin_size_t[]){11u} +#define PINS_SPI0_FSCK (pin_size_t[]){10u} +#define PINS_SPI0_MISO (pin_size_t[]){22u} +#define PINS_SPI0_MOSI (pin_size_t[]){23u} +#define PINS_SPI0_SCK (pin_size_t[]){18u} +#define PINS_SPI1_CS (pin_size_t[]){19u} +#define PINS_SPI1_MISO (pin_size_t[]){22u} +#define PINS_SPI1_MOSI (pin_size_t[]){23u} +#define PINS_SPI1_SCK (pin_size_t[]){18u} + +// Wire Interfaces +// --------------- +#define PIN_WIRE0_SCL_0 22u // PA_22 +#define PIN_WIRE0_SCL_1 29u // PA_29 +#define PIN_WIRE0_SDA_0 19u // PA_19 +#define PIN_WIRE0_SDA_1 30u // PA_30 +#define PIN_WIRE1_SCL 18u // PA_18 +#define PIN_WIRE1_SDA 23u // PA_23 +#define PINS_WIRE0_SCL (pin_size_t[]){22u, 29u} +#define PINS_WIRE0_SDA (pin_size_t[]){19u, 30u} +#define PINS_WIRE1_SCL (pin_size_t[]){18u} +#define PINS_WIRE1_SDA (pin_size_t[]){23u} + +// Serial ports +// ------------ +#define PIN_SERIAL0_CTS 19u // PA_19 +#define PIN_SERIAL0_RTS 22u // PA_22 +#define PIN_SERIAL0_RX 18u // PA_18 +#define PIN_SERIAL0_TX 23u // PA_23 +#define PIN_SERIAL2_RX 29u // PA_29 +#define PIN_SERIAL2_TX 30u // PA_30 +#define PINS_SERIAL0_CTS (pin_size_t[]){19u} +#define PINS_SERIAL0_RTS (pin_size_t[]){22u} +#define PINS_SERIAL0_RX (pin_size_t[]){18u} +#define PINS_SERIAL0_TX (pin_size_t[]){23u} +#define PINS_SERIAL2_RX (pin_size_t[]){29u} +#define PINS_SERIAL2_TX (pin_size_t[]){30u} + +// Pin function macros +// ------------------- +#define PIN_ADC1 19u // PA_19 +#define PIN_ADC2 41u // AD_2 +#define PIN_CS0 19u // PA_19 +#define PIN_CS1 19u // PA_19 +#define PIN_CTS0 19u // PA_19 +#define PIN_FCS 6u // PA_6 +#define PIN_FD0 9u // PA_9 +#define PIN_FD1 7u // PA_7 +#define PIN_FD2 8u // PA_8 +#define PIN_FD3 11u // PA_11 +#define PIN_FSCK 10u // PA_10 +#define PIN_MISO0 22u // PA_22 +#define PIN_MISO1 22u // PA_22 +#define PIN_MOSI0 23u // PA_23 +#define PIN_MOSI1 23u // PA_23 +#define PIN_PA00 0u // PA_0 +#define PIN_PA05 5u // PA_5 +#define PIN_PA06 6u // PA_6 +#define PIN_PA07 7u // PA_7 +#define PIN_PA08 8u // PA_8 +#define PIN_PA09 9u // PA_9 +#define PIN_PA10 10u // PA_10 +#define PIN_PA11 11u // PA_11 +#define PIN_PA12 12u // PA_12 +#define PIN_PA14 14u // PA_14 +#define PIN_PA15 15u // PA_15 +#define PIN_PA18 18u // PA_18 +#define PIN_PA19 19u // PA_19 +#define PIN_PA22 22u // PA_22 +#define PIN_PA23 23u // PA_23 +#define PIN_PA29 29u // PA_29 +#define PIN_PA30 30u // PA_30 +#define PIN_PWM1 15u // PA_15 +#define PIN_PWM2 0u // PA_0 +#define PIN_PWM3 12u // PA_12 +#define PIN_PWM4 30u // PA_30 +#define PIN_PWM5 22u // PA_22 +#define PIN_RTS0 22u // PA_22 +#define PIN_RX0 18u // PA_18 +#define PIN_RX2 29u // PA_29 +#define PIN_SCK0 18u // PA_18 +#define PIN_SCK1 18u // PA_18 +#define PIN_SCL1 18u // PA_18 +#define PIN_SDA1 23u // PA_23 +#define PIN_TX0 23u // PA_23 +#define PIN_TX2 30u // PA_30 + +// Port availability +// ----------------- +#define HAS_SERIAL0 1 +#define HAS_SERIAL2 1 +#define HAS_SPI0 1 +#define HAS_SPI1 1 +#define HAS_WIRE0 1 +#define HAS_WIRE1 1 +#define SERIAL_INTERFACES_COUNT 2 +#define SPI_INTERFACES_COUNT 2 +#define WIRE_INTERFACES_COUNT 2 + +// Arduino pin names +// ----------------- +#define PIN_D0 0u // PA_0 +#define PIN_D1 5u // PA_5 +#define PIN_D2 6u // PA_6 +#define PIN_D3 7u // PA_7 +#define PIN_D4 8u // PA_8 +#define PIN_D5 9u // PA_9 +#define PIN_D6 10u // PA_10 +#define PIN_D7 11u // PA_11 +#define PIN_D8 12u // PA_12 +#define PIN_D9 14u // PA_14 +#define PIN_D10 15u // PA_15 +#define PIN_D11 18u // PA_18 +#define PIN_D12 19u // PA_19 +#define PIN_D13 22u // PA_22 +#define PIN_D14 23u // PA_23 +#define PIN_D15 29u // PA_29 +#define PIN_D16 30u // PA_30 +#define PIN_A0 19u // PA_19 +#define PIN_A1 41u // AD_2 + +// Static pin names +// ---------------- +static const unsigned char A0 = PIN_A0; +static const unsigned char A1 = PIN_A1; +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; +static const unsigned char D9 = PIN_D9; +static const unsigned char D10 = PIN_D10; +static const unsigned char D11 = PIN_D11; +static const unsigned char D12 = PIN_D12; +static const unsigned char D13 = PIN_D13; +static const unsigned char D14 = PIN_D14; +static const unsigned char D15 = PIN_D15; +static const unsigned char D16 = PIN_D16; diff --git a/boards/variants/generic-rtl8710bx-4mb-980k.c b/boards/variants/generic-rtl8710bx-4mb-980k.c new file mode 100644 index 000000000..b2f0fce83 --- /dev/null +++ b/boards/variants/generic-rtl8710bx-4mb-980k.c @@ -0,0 +1,66 @@ +/* This file was auto-generated from generic-rtl8710bx-4mb-980k.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: PA00, PWM2 + {PA_0, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D1: PA05, PWM4, WAKE1 + {PA_5, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D2: PA06, FCS, SD_D2 + {PA_6, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D3: PA07, FD1, SD_D3 + {PA_7, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D4: PA08, FD2, SD_CMD + {PA_8, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D5: PA09, FD0, SD_CLK + {PA_9, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D6: PA10, FSCK, SD_D0 + {PA_10, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D7: PA11, FD3, SD_D1 + {PA_11, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D8: PA12, PWM3 + {PA_12, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D9: PA14, PWM0, SWCLK + {PA_14, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D10: PA15, PWM1, SWDIO + {PA_15, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D11: PA18, UART0_RX, SPI0_SCK, SPI1_SCK, I2C1_SCL, SD_D2, TMR4_TRIG, I2S0_MCK, WAKE0 + {PA_18, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D12: PA19, ADC1, UART0_CTS, SPI0_CS, SPI1_CS, I2C0_SDA, SD_D3, TMR5_TRIG, I2S0_TX + {PA_19, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D13: PA22, UART0_RTS, SPI0_MISO, SPI1_MISO, I2C0_SCL, SD_D0, PWM5, I2S0_WS, WAKE2 + {PA_22, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D14: PA23, UART0_TX, SPI0_MOSI, SPI1_MOSI, I2C1_SDA, SD_D1, PWM0, WAKE3 + {PA_23, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D15: PA29, UART2_RX, I2C0_SCL, PWM4 + {PA_29, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D16: PA30, UART2_TX, I2C0_SDA, PWM4 + {PA_30, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[0]), // PA_0 (D0) + [5] = &(lt_arduino_pin_info_list[1]), // PA_5 (D1) + [6] = &(lt_arduino_pin_info_list[2]), // PA_6 (D2) + [7] = &(lt_arduino_pin_info_list[3]), // PA_7 (D3) + [8] = &(lt_arduino_pin_info_list[4]), // PA_8 (D4) + [9] = &(lt_arduino_pin_info_list[5]), // PA_9 (D5) + [10] = &(lt_arduino_pin_info_list[6]), // PA_10 (D6) + [11] = &(lt_arduino_pin_info_list[7]), // PA_11 (D7) + [12] = &(lt_arduino_pin_info_list[8]), // PA_12 (D8) + [14] = &(lt_arduino_pin_info_list[9]), // PA_14 (D9) + [15] = &(lt_arduino_pin_info_list[10]), // PA_15 (D10) + [18] = &(lt_arduino_pin_info_list[11]), // PA_18 (D11) + [19] = &(lt_arduino_pin_info_list[12]), // PA_19 (D12) + [22] = &(lt_arduino_pin_info_list[13]), // PA_22 (D13) + [23] = &(lt_arduino_pin_info_list[14]), // PA_23 (D14) + [29] = &(lt_arduino_pin_info_list[15]), // PA_29 (D15) + [30] = &(lt_arduino_pin_info_list[16]), // PA_30 (D16) +}; +// clang-format on diff --git a/boards/variants/generic-rtl8710bx-4mb-980k.h b/boards/variants/generic-rtl8710bx-4mb-980k.h new file mode 100644 index 000000000..901c398f9 --- /dev/null +++ b/boards/variants/generic-rtl8710bx-4mb-980k.h @@ -0,0 +1,174 @@ +/* This file was auto-generated from generic-rtl8710bx-4mb-980k.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 17 // Total GPIO count +#define NUM_DIGITAL_PINS 17 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 1 // ADC inputs +#define NUM_ANALOG_OUTPUTS 9 // PWM & DAC outputs +#define PINS_GPIO_MAX 30 // Last usable GPIO number + +// SPI Interfaces +// -------------- +#define PIN_SPI0_CS 19u // PA_19 +#define PIN_SPI0_FCS 6u // PA_6 +#define PIN_SPI0_FD0 9u // PA_9 +#define PIN_SPI0_FD1 7u // PA_7 +#define PIN_SPI0_FD2 8u // PA_8 +#define PIN_SPI0_FD3 11u // PA_11 +#define PIN_SPI0_FSCK 10u // PA_10 +#define PIN_SPI0_MISO 22u // PA_22 +#define PIN_SPI0_MOSI 23u // PA_23 +#define PIN_SPI0_SCK 18u // PA_18 +#define PIN_SPI1_CS 19u // PA_19 +#define PIN_SPI1_MISO 22u // PA_22 +#define PIN_SPI1_MOSI 23u // PA_23 +#define PIN_SPI1_SCK 18u // PA_18 +#define PINS_SPI0_CS (pin_size_t[]){19u} +#define PINS_SPI0_FCS (pin_size_t[]){6u} +#define PINS_SPI0_FD0 (pin_size_t[]){9u} +#define PINS_SPI0_FD1 (pin_size_t[]){7u} +#define PINS_SPI0_FD2 (pin_size_t[]){8u} +#define PINS_SPI0_FD3 (pin_size_t[]){11u} +#define PINS_SPI0_FSCK (pin_size_t[]){10u} +#define PINS_SPI0_MISO (pin_size_t[]){22u} +#define PINS_SPI0_MOSI (pin_size_t[]){23u} +#define PINS_SPI0_SCK (pin_size_t[]){18u} +#define PINS_SPI1_CS (pin_size_t[]){19u} +#define PINS_SPI1_MISO (pin_size_t[]){22u} +#define PINS_SPI1_MOSI (pin_size_t[]){23u} +#define PINS_SPI1_SCK (pin_size_t[]){18u} + +// Wire Interfaces +// --------------- +#define PIN_WIRE0_SCL_0 22u // PA_22 +#define PIN_WIRE0_SCL_1 29u // PA_29 +#define PIN_WIRE0_SDA_0 19u // PA_19 +#define PIN_WIRE0_SDA_1 30u // PA_30 +#define PIN_WIRE1_SCL 18u // PA_18 +#define PIN_WIRE1_SDA 23u // PA_23 +#define PINS_WIRE0_SCL (pin_size_t[]){22u, 29u} +#define PINS_WIRE0_SDA (pin_size_t[]){19u, 30u} +#define PINS_WIRE1_SCL (pin_size_t[]){18u} +#define PINS_WIRE1_SDA (pin_size_t[]){23u} + +// Serial ports +// ------------ +#define PIN_SERIAL0_CTS 19u // PA_19 +#define PIN_SERIAL0_RTS 22u // PA_22 +#define PIN_SERIAL0_RX 18u // PA_18 +#define PIN_SERIAL0_TX 23u // PA_23 +#define PIN_SERIAL2_RX 29u // PA_29 +#define PIN_SERIAL2_TX 30u // PA_30 +#define PINS_SERIAL0_CTS (pin_size_t[]){19u} +#define PINS_SERIAL0_RTS (pin_size_t[]){22u} +#define PINS_SERIAL0_RX (pin_size_t[]){18u} +#define PINS_SERIAL0_TX (pin_size_t[]){23u} +#define PINS_SERIAL2_RX (pin_size_t[]){29u} +#define PINS_SERIAL2_TX (pin_size_t[]){30u} + +// Pin function macros +// ------------------- +#define PIN_ADC1 19u // PA_19 +#define PIN_CS0 19u // PA_19 +#define PIN_CS1 19u // PA_19 +#define PIN_CTS0 19u // PA_19 +#define PIN_FCS 6u // PA_6 +#define PIN_FD0 9u // PA_9 +#define PIN_FD1 7u // PA_7 +#define PIN_FD2 8u // PA_8 +#define PIN_FD3 11u // PA_11 +#define PIN_FSCK 10u // PA_10 +#define PIN_MISO0 22u // PA_22 +#define PIN_MISO1 22u // PA_22 +#define PIN_MOSI0 23u // PA_23 +#define PIN_MOSI1 23u // PA_23 +#define PIN_PA00 0u // PA_0 +#define PIN_PA05 5u // PA_5 +#define PIN_PA06 6u // PA_6 +#define PIN_PA07 7u // PA_7 +#define PIN_PA08 8u // PA_8 +#define PIN_PA09 9u // PA_9 +#define PIN_PA10 10u // PA_10 +#define PIN_PA11 11u // PA_11 +#define PIN_PA12 12u // PA_12 +#define PIN_PA14 14u // PA_14 +#define PIN_PA15 15u // PA_15 +#define PIN_PA18 18u // PA_18 +#define PIN_PA19 19u // PA_19 +#define PIN_PA22 22u // PA_22 +#define PIN_PA23 23u // PA_23 +#define PIN_PA29 29u // PA_29 +#define PIN_PA30 30u // PA_30 +#define PIN_PWM1 15u // PA_15 +#define PIN_PWM2 0u // PA_0 +#define PIN_PWM3 12u // PA_12 +#define PIN_PWM4 30u // PA_30 +#define PIN_PWM5 22u // PA_22 +#define PIN_RTS0 22u // PA_22 +#define PIN_RX0 18u // PA_18 +#define PIN_RX2 29u // PA_29 +#define PIN_SCK0 18u // PA_18 +#define PIN_SCK1 18u // PA_18 +#define PIN_SCL1 18u // PA_18 +#define PIN_SDA1 23u // PA_23 +#define PIN_TX0 23u // PA_23 +#define PIN_TX2 30u // PA_30 + +// Port availability +// ----------------- +#define HAS_SERIAL0 1 +#define HAS_SERIAL2 1 +#define HAS_SPI0 1 +#define HAS_SPI1 1 +#define HAS_WIRE0 1 +#define HAS_WIRE1 1 +#define SERIAL_INTERFACES_COUNT 2 +#define SPI_INTERFACES_COUNT 2 +#define WIRE_INTERFACES_COUNT 2 + +// Arduino pin names +// ----------------- +#define PIN_D0 0u // PA_0 +#define PIN_D1 5u // PA_5 +#define PIN_D2 6u // PA_6 +#define PIN_D3 7u // PA_7 +#define PIN_D4 8u // PA_8 +#define PIN_D5 9u // PA_9 +#define PIN_D6 10u // PA_10 +#define PIN_D7 11u // PA_11 +#define PIN_D8 12u // PA_12 +#define PIN_D9 14u // PA_14 +#define PIN_D10 15u // PA_15 +#define PIN_D11 18u // PA_18 +#define PIN_D12 19u // PA_19 +#define PIN_D13 22u // PA_22 +#define PIN_D14 23u // PA_23 +#define PIN_D15 29u // PA_29 +#define PIN_D16 30u // PA_30 +#define PIN_A0 19u // PA_19 + +// Static pin names +// ---------------- +static const unsigned char A0 = PIN_A0; +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; +static const unsigned char D9 = PIN_D9; +static const unsigned char D10 = PIN_D10; +static const unsigned char D11 = PIN_D11; +static const unsigned char D12 = PIN_D12; +static const unsigned char D13 = PIN_D13; +static const unsigned char D14 = PIN_D14; +static const unsigned char D15 = PIN_D15; +static const unsigned char D16 = PIN_D16; diff --git a/boards/variants/generic-rtl8720cf-2mb-992k.c b/boards/variants/generic-rtl8720cf-2mb-992k.c new file mode 100644 index 000000000..26deb19bf --- /dev/null +++ b/boards/variants/generic-rtl8720cf-2mb-992k.c @@ -0,0 +1,75 @@ +/* This file was auto-generated from generic-rtl8720cf-2mb-992k.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: PA00, TCK, UART1_RX, PWM0, SWCLK + {PIN_A0, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_JTAG | PIN_SWD | PIN_UART, PIN_NONE, 0}, + // D1: PA01, TMS, UART1_TX, PWM1, SWDIO + {PIN_A1, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_JTAG | PIN_SWD | PIN_UART, PIN_NONE, 0}, + // D2: PA02, TDO, UART1_RX, SPI0_CS, I2C0_SCL, PWM2 + {PIN_A2, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_JTAG | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D3: PA03, TDI, UART1_TX, SPI0_SCK, I2C0_SDA, PWM3 + {PIN_A3, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_JTAG | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D4: PA04, tRST, UART1_CTS, SPI0_MOSI, PWM4 + {PIN_A4, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_JTAG | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D5: PA07, ^FCS, SPI0_CS + {PIN_A7, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D6: PA08, FSCK, SPI0_SCK + {PIN_A8, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D7: PA09, FD2, SPI0_MOSI, UART0_RTS + {PIN_A9, PIN_GPIO | PIN_IRQ | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D8: PA10, FD1, SPI0_MISO, UART0_CTS + {PIN_A10, PIN_GPIO | PIN_IRQ | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D9: PA11, FD0, UART0_TX, I2C0_SCL, PWM0 + {PIN_A11, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D10: PA12, FD3, UART0_RX, I2C0_SDA, PWM1 + {PIN_A12, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D11: PA13, UART0_RX, PWM7 + {PIN_A13, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_UART, PIN_NONE, 0}, + // D12: PA14, SD_INT, UART0_TX, PWM2 + {PIN_A14, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_UART, PIN_NONE, 0}, + // D13: PA15, SD_D2, SPI0_CS, UART2_RX, I2C0_SCL, PWM3 + {PIN_A15, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D14: PA16, SD_D3, SPI0_SCK, UART2_TX, I2C0_SDA, PWM4 + {PIN_A16, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D15: PA17, SD_CMD, PWM5 + {PIN_A17, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D16: PA18, SD_CLK, PWM6 + {PIN_A18, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D17: PA19, SD_D0, SPI0_MOSI, UART2_CTS, I2C0_SCL, PWM7 + {PIN_A19, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D18: PA20, SD_D1, SPI0_MISO, UART2_RTS, I2C0_SDA, PWM0 + {PIN_A20, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D19: PA23, PWM7 + {PIN_A23, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[0]), // PIN_A0 (D0) + [1] = &(lt_arduino_pin_info_list[1]), // PIN_A1 (D1) + [2] = &(lt_arduino_pin_info_list[2]), // PIN_A2 (D2) + [3] = &(lt_arduino_pin_info_list[3]), // PIN_A3 (D3) + [4] = &(lt_arduino_pin_info_list[4]), // PIN_A4 (D4) + [7] = &(lt_arduino_pin_info_list[5]), // PIN_A7 (D5) + [8] = &(lt_arduino_pin_info_list[6]), // PIN_A8 (D6) + [9] = &(lt_arduino_pin_info_list[7]), // PIN_A9 (D7) + [10] = &(lt_arduino_pin_info_list[8]), // PIN_A10 (D8) + [11] = &(lt_arduino_pin_info_list[9]), // PIN_A11 (D9) + [12] = &(lt_arduino_pin_info_list[10]), // PIN_A12 (D10) + [13] = &(lt_arduino_pin_info_list[11]), // PIN_A13 (D11) + [14] = &(lt_arduino_pin_info_list[12]), // PIN_A14 (D12) + [15] = &(lt_arduino_pin_info_list[13]), // PIN_A15 (D13) + [16] = &(lt_arduino_pin_info_list[14]), // PIN_A16 (D14) + [17] = &(lt_arduino_pin_info_list[15]), // PIN_A17 (D15) + [18] = &(lt_arduino_pin_info_list[16]), // PIN_A18 (D16) + [19] = &(lt_arduino_pin_info_list[17]), // PIN_A19 (D17) + [20] = &(lt_arduino_pin_info_list[18]), // PIN_A20 (D18) + [23] = &(lt_arduino_pin_info_list[19]), // PIN_A23 (D19) +}; +// clang-format on diff --git a/boards/variants/generic-rtl8720cf-2mb-992k.h b/boards/variants/generic-rtl8720cf-2mb-992k.h new file mode 100644 index 000000000..4ddb3e7f3 --- /dev/null +++ b/boards/variants/generic-rtl8720cf-2mb-992k.h @@ -0,0 +1,167 @@ +/* This file was auto-generated from generic-rtl8720cf-2mb-992k.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 20 // Total GPIO count +#define NUM_DIGITAL_PINS 20 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 0 // ADC inputs +#define NUM_ANALOG_OUTPUTS 16 // PWM & DAC outputs +#define PINS_GPIO_MAX 23 // Last usable GPIO number + +// SPI Interfaces +// -------------- +#define PIN_SPI0_CS_0 2u // PIN_A2 +#define PIN_SPI0_CS_1 7u // PIN_A7 +#define PIN_SPI0_CS_2 15u // PIN_A15 +#define PIN_SPI0_MISO_0 10u // PIN_A10 +#define PIN_SPI0_MISO_1 20u // PIN_A20 +#define PIN_SPI0_MOSI_0 4u // PIN_A4 +#define PIN_SPI0_MOSI_1 9u // PIN_A9 +#define PIN_SPI0_MOSI_2 19u // PIN_A19 +#define PIN_SPI0_SCK_0 3u // PIN_A3 +#define PIN_SPI0_SCK_1 8u // PIN_A8 +#define PIN_SPI0_SCK_2 16u // PIN_A16 +#define PINS_SPI0_CS (pin_size_t[]){2u, 7u, 15u} +#define PINS_SPI0_MISO (pin_size_t[]){10u, 20u} +#define PINS_SPI0_MOSI (pin_size_t[]){4u, 9u, 19u} +#define PINS_SPI0_SCK (pin_size_t[]){3u, 8u, 16u} + +// Wire Interfaces +// --------------- +#define PIN_WIRE0_SCL_0 2u // PIN_A2 +#define PIN_WIRE0_SCL_1 11u // PIN_A11 +#define PIN_WIRE0_SCL_2 15u // PIN_A15 +#define PIN_WIRE0_SCL_3 19u // PIN_A19 +#define PIN_WIRE0_SDA_0 3u // PIN_A3 +#define PIN_WIRE0_SDA_1 12u // PIN_A12 +#define PIN_WIRE0_SDA_2 16u // PIN_A16 +#define PIN_WIRE0_SDA_3 20u // PIN_A20 +#define PINS_WIRE0_SCL (pin_size_t[]){2u, 11u, 15u, 19u} +#define PINS_WIRE0_SDA (pin_size_t[]){3u, 12u, 16u, 20u} + +// Serial ports +// ------------ +#define PIN_SERIAL0_CTS 10u // PIN_A10 +#define PIN_SERIAL0_RTS 9u // PIN_A9 +#define PIN_SERIAL0_RX_0 12u // PIN_A12 +#define PIN_SERIAL0_RX_1 13u // PIN_A13 +#define PIN_SERIAL0_TX_0 11u // PIN_A11 +#define PIN_SERIAL0_TX_1 14u // PIN_A14 +#define PIN_SERIAL1_CTS 4u // PIN_A4 +#define PIN_SERIAL1_RX_0 0u // PIN_A0 +#define PIN_SERIAL1_RX_1 2u // PIN_A2 +#define PIN_SERIAL1_TX_0 1u // PIN_A1 +#define PIN_SERIAL1_TX_1 3u // PIN_A3 +#define PIN_SERIAL2_CTS 19u // PIN_A19 +#define PIN_SERIAL2_RTS 20u // PIN_A20 +#define PIN_SERIAL2_RX 15u // PIN_A15 +#define PIN_SERIAL2_TX 16u // PIN_A16 +#define PINS_SERIAL0_CTS (pin_size_t[]){10u} +#define PINS_SERIAL0_RTS (pin_size_t[]){9u} +#define PINS_SERIAL0_RX (pin_size_t[]){12u, 13u} +#define PINS_SERIAL0_TX (pin_size_t[]){11u, 14u} +#define PINS_SERIAL1_CTS (pin_size_t[]){4u} +#define PINS_SERIAL1_RX (pin_size_t[]){0u, 2u} +#define PINS_SERIAL1_TX (pin_size_t[]){1u, 3u} +#define PINS_SERIAL2_CTS (pin_size_t[]){19u} +#define PINS_SERIAL2_RTS (pin_size_t[]){20u} +#define PINS_SERIAL2_RX (pin_size_t[]){15u} +#define PINS_SERIAL2_TX (pin_size_t[]){16u} + +// Pin function macros +// ------------------- +#define PIN_CS0 15u // PIN_A15 +#define PIN_CTS0 10u // PIN_A10 +#define PIN_CTS1 4u // PIN_A4 +#define PIN_CTS2 19u // PIN_A19 +#define PIN_MOSI0 19u // PIN_A19 +#define PIN_PA00 0u // PIN_A0 +#define PIN_PA01 1u // PIN_A1 +#define PIN_PA02 2u // PIN_A2 +#define PIN_PA03 3u // PIN_A3 +#define PIN_PA04 4u // PIN_A4 +#define PIN_PA07 7u // PIN_A7 +#define PIN_PA08 8u // PIN_A8 +#define PIN_PA09 9u // PIN_A9 +#define PIN_PA10 10u // PIN_A10 +#define PIN_PA11 11u // PIN_A11 +#define PIN_PA12 12u // PIN_A12 +#define PIN_PA13 13u // PIN_A13 +#define PIN_PA14 14u // PIN_A14 +#define PIN_PA15 15u // PIN_A15 +#define PIN_PA16 16u // PIN_A16 +#define PIN_PA17 17u // PIN_A17 +#define PIN_PA18 18u // PIN_A18 +#define PIN_PA19 19u // PIN_A19 +#define PIN_PA20 20u // PIN_A20 +#define PIN_PA23 23u // PIN_A23 +#define PIN_PWM0 20u // PIN_A20 +#define PIN_PWM5 17u // PIN_A17 +#define PIN_PWM6 18u // PIN_A18 +#define PIN_PWM7 23u // PIN_A23 +#define PIN_RTS0 9u // PIN_A9 +#define PIN_RTS2 20u // PIN_A20 +#define PIN_RX2 15u // PIN_A15 +#define PIN_SCK0 16u // PIN_A16 +#define PIN_TX2 16u // PIN_A16 + +// Port availability +// ----------------- +#define HAS_SERIAL0 1 +#define HAS_SERIAL1 1 +#define HAS_SERIAL2 1 +#define HAS_SPI0 1 +#define HAS_WIRE0 1 +#define SERIAL_INTERFACES_COUNT 3 +#define SPI_INTERFACES_COUNT 1 +#define WIRE_INTERFACES_COUNT 1 + +// Arduino pin names +// ----------------- +#define PIN_D0 0u // PIN_A0 +#define PIN_D1 1u // PIN_A1 +#define PIN_D2 2u // PIN_A2 +#define PIN_D3 3u // PIN_A3 +#define PIN_D4 4u // PIN_A4 +#define PIN_D5 7u // PIN_A7 +#define PIN_D6 8u // PIN_A8 +#define PIN_D7 9u // PIN_A9 +#define PIN_D8 10u // PIN_A10 +#define PIN_D9 11u // PIN_A11 +#define PIN_D10 12u // PIN_A12 +#define PIN_D11 13u // PIN_A13 +#define PIN_D12 14u // PIN_A14 +#define PIN_D13 15u // PIN_A15 +#define PIN_D14 16u // PIN_A16 +#define PIN_D15 17u // PIN_A17 +#define PIN_D16 18u // PIN_A18 +#define PIN_D17 19u // PIN_A19 +#define PIN_D18 20u // PIN_A20 +#define PIN_D19 23u // PIN_A23 + +// Static pin names +// ---------------- +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; +static const unsigned char D9 = PIN_D9; +static const unsigned char D10 = PIN_D10; +static const unsigned char D11 = PIN_D11; +static const unsigned char D12 = PIN_D12; +static const unsigned char D13 = PIN_D13; +static const unsigned char D14 = PIN_D14; +static const unsigned char D15 = PIN_D15; +static const unsigned char D16 = PIN_D16; +static const unsigned char D17 = PIN_D17; +static const unsigned char D18 = PIN_D18; +static const unsigned char D19 = PIN_D19; diff --git a/boards/variants/lsc-lma35-t.c b/boards/variants/lsc-lma35-t.c new file mode 100644 index 000000000..2ac070c02 --- /dev/null +++ b/boards/variants/lsc-lma35-t.c @@ -0,0 +1,60 @@ +/* This file was auto-generated from lsc-lma35-t.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: P26, PWM5, IRDA + {GPIO26, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D1: P14, SD_CLK, SCK + {GPIO14, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D2: P16, SD_D0, MOSI + {GPIO16, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D3: P24, PWM4 + {GPIO24, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D4: P22, TDI, FSI + {GPIO22, PIN_GPIO | PIN_IRQ | PIN_JTAG, PIN_NONE, 0}, + // D5: P0, UART2_TX, I2C2_SCL + {GPIO0, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D6: P23, ADC3, TDO, FSO + {GPIO23, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_JTAG, PIN_NONE, 0}, + // D7: P8, PWM2 + {GPIO8, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D8: P9, PWM3 + {GPIO9, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D9: P21, I2C1_SDA, TMS, MCLK, ^FCS + {GPIO21, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_JTAG, PIN_NONE, 0}, + // D10: P6, PWM0 + {GPIO6, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D11: P7, PWM1 + {GPIO7, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D12: P10, UART1_RX + {GPIO10, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D13: P11, UART1_TX + {GPIO11, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D14: P1, UART2_RX, I2C2_SDA + {GPIO1, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[5]), // GPIO0 (D5) + [1] = &(lt_arduino_pin_info_list[14]), // GPIO1 (D14) + [6] = &(lt_arduino_pin_info_list[10]), // GPIO6 (D10) + [7] = &(lt_arduino_pin_info_list[11]), // GPIO7 (D11) + [8] = &(lt_arduino_pin_info_list[7]), // GPIO8 (D7) + [9] = &(lt_arduino_pin_info_list[8]), // GPIO9 (D8) + [10] = &(lt_arduino_pin_info_list[12]), // GPIO10 (D12) + [11] = &(lt_arduino_pin_info_list[13]), // GPIO11 (D13) + [14] = &(lt_arduino_pin_info_list[1]), // GPIO14 (D1) + [16] = &(lt_arduino_pin_info_list[2]), // GPIO16 (D2) + [21] = &(lt_arduino_pin_info_list[9]), // GPIO21 (D9) + [22] = &(lt_arduino_pin_info_list[4]), // GPIO22 (D4) + [23] = &(lt_arduino_pin_info_list[6]), // GPIO23 (D6) + [24] = &(lt_arduino_pin_info_list[3]), // GPIO24 (D3) + [26] = &(lt_arduino_pin_info_list[0]), // GPIO26 (D0) +}; +// clang-format on diff --git a/boards/variants/lsc-lma35-t.h b/boards/variants/lsc-lma35-t.h new file mode 100644 index 000000000..75ba4fb4b --- /dev/null +++ b/boards/variants/lsc-lma35-t.h @@ -0,0 +1,111 @@ +/* This file was auto-generated from lsc-lma35-t.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 15 // Total GPIO count +#define NUM_DIGITAL_PINS 15 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 1 // ADC inputs +#define NUM_ANALOG_OUTPUTS 6 // PWM & DAC outputs +#define PINS_GPIO_MAX 26 // Last usable GPIO number + +// Wire Interfaces +// --------------- +#define PIN_WIRE2_SCL 0u // GPIO0 +#define PIN_WIRE2_SDA 1u // GPIO1 +#define PINS_WIRE2_SCL (pin_size_t[]){0u} +#define PINS_WIRE2_SDA (pin_size_t[]){1u} + +// Serial ports +// ------------ +#define PIN_SERIAL1_RX 10u // GPIO10 +#define PIN_SERIAL1_TX 11u // GPIO11 +#define PIN_SERIAL2_RX 1u // GPIO1 +#define PIN_SERIAL2_TX 0u // GPIO0 +#define PINS_SERIAL1_RX (pin_size_t[]){10u} +#define PINS_SERIAL1_TX (pin_size_t[]){11u} +#define PINS_SERIAL2_RX (pin_size_t[]){1u} +#define PINS_SERIAL2_TX (pin_size_t[]){0u} + +// Pin function macros +// ------------------- +#define PIN_ADC3 23u // GPIO23 +#define PIN_MOSI 16u // GPIO16 +#define PIN_P0 0u // GPIO0 +#define PIN_P1 1u // GPIO1 +#define PIN_P6 6u // GPIO6 +#define PIN_P7 7u // GPIO7 +#define PIN_P8 8u // GPIO8 +#define PIN_P9 9u // GPIO9 +#define PIN_P10 10u // GPIO10 +#define PIN_P11 11u // GPIO11 +#define PIN_P14 14u // GPIO14 +#define PIN_P16 16u // GPIO16 +#define PIN_P21 21u // GPIO21 +#define PIN_P22 22u // GPIO22 +#define PIN_P23 23u // GPIO23 +#define PIN_P24 24u // GPIO24 +#define PIN_P26 26u // GPIO26 +#define PIN_PWM0 6u // GPIO6 +#define PIN_PWM1 7u // GPIO7 +#define PIN_PWM2 8u // GPIO8 +#define PIN_PWM3 9u // GPIO9 +#define PIN_PWM4 24u // GPIO24 +#define PIN_PWM5 26u // GPIO26 +#define PIN_RX1 10u // GPIO10 +#define PIN_RX2 1u // GPIO1 +#define PIN_SCK 14u // GPIO14 +#define PIN_SCL2 0u // GPIO0 +#define PIN_SDA1 21u // GPIO21 +#define PIN_SDA2 1u // GPIO1 +#define PIN_TX1 11u // GPIO11 +#define PIN_TX2 0u // GPIO0 + +// Port availability +// ----------------- +#define HAS_SERIAL1 1 +#define HAS_SERIAL2 1 +#define HAS_WIRE2 1 +#define SERIAL_INTERFACES_COUNT 2 +#define WIRE_INTERFACES_COUNT 1 + +// Arduino pin names +// ----------------- +#define PIN_D0 26u // GPIO26 +#define PIN_D1 14u // GPIO14 +#define PIN_D2 16u // GPIO16 +#define PIN_D3 24u // GPIO24 +#define PIN_D4 22u // GPIO22 +#define PIN_D5 0u // GPIO0 +#define PIN_D6 23u // GPIO23 +#define PIN_D7 8u // GPIO8 +#define PIN_D8 9u // GPIO9 +#define PIN_D9 21u // GPIO21 +#define PIN_D10 6u // GPIO6 +#define PIN_D11 7u // GPIO7 +#define PIN_D12 10u // GPIO10 +#define PIN_D13 11u // GPIO11 +#define PIN_D14 1u // GPIO1 +#define PIN_A0 23u // GPIO23 + +// Static pin names +// ---------------- +static const unsigned char A0 = PIN_A0; +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; +static const unsigned char D9 = PIN_D9; +static const unsigned char D10 = PIN_D10; +static const unsigned char D11 = PIN_D11; +static const unsigned char D12 = PIN_D12; +static const unsigned char D13 = PIN_D13; +static const unsigned char D14 = PIN_D14; diff --git a/boards/variants/lsc-lma35.c b/boards/variants/lsc-lma35.c new file mode 100644 index 000000000..c04545bb9 --- /dev/null +++ b/boards/variants/lsc-lma35.c @@ -0,0 +1,60 @@ +/* This file was auto-generated from lsc-lma35.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: P26, PWM5, IRDA + {GPIO26, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D1: P14, SD_CLK, SCK + {GPIO14, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D2: P16, SD_D0, MOSI + {GPIO16, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D3: P24, PWM4 + {GPIO24, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D4: P22, TDI, FSI + {GPIO22, PIN_GPIO | PIN_IRQ | PIN_JTAG, PIN_NONE, 0}, + // D5: P0, UART2_TX, I2C2_SCL + {GPIO0, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D6: P23, ADC3, TDO, FSO + {GPIO23, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_JTAG, PIN_NONE, 0}, + // D7: P8, PWM2 + {GPIO8, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D8: P9, PWM3 + {GPIO9, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D9: P21, I2C1_SDA, TMS, MCLK, ^FCS + {GPIO21, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_JTAG, PIN_NONE, 0}, + // D10: P6, PWM0 + {GPIO6, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D11: P7, PWM1 + {GPIO7, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D12: P10, UART1_RX + {GPIO10, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D13: P11, UART1_TX + {GPIO11, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D14: P1, UART2_RX, I2C2_SDA + {GPIO1, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[5]), // GPIO0 (D5) + [1] = &(lt_arduino_pin_info_list[14]), // GPIO1 (D14) + [6] = &(lt_arduino_pin_info_list[10]), // GPIO6 (D10) + [7] = &(lt_arduino_pin_info_list[11]), // GPIO7 (D11) + [8] = &(lt_arduino_pin_info_list[7]), // GPIO8 (D7) + [9] = &(lt_arduino_pin_info_list[8]), // GPIO9 (D8) + [10] = &(lt_arduino_pin_info_list[12]), // GPIO10 (D12) + [11] = &(lt_arduino_pin_info_list[13]), // GPIO11 (D13) + [14] = &(lt_arduino_pin_info_list[1]), // GPIO14 (D1) + [16] = &(lt_arduino_pin_info_list[2]), // GPIO16 (D2) + [21] = &(lt_arduino_pin_info_list[9]), // GPIO21 (D9) + [22] = &(lt_arduino_pin_info_list[4]), // GPIO22 (D4) + [23] = &(lt_arduino_pin_info_list[6]), // GPIO23 (D6) + [24] = &(lt_arduino_pin_info_list[3]), // GPIO24 (D3) + [26] = &(lt_arduino_pin_info_list[0]), // GPIO26 (D0) +}; +// clang-format on diff --git a/boards/variants/lsc-lma35.h b/boards/variants/lsc-lma35.h new file mode 100644 index 000000000..37b2623b5 --- /dev/null +++ b/boards/variants/lsc-lma35.h @@ -0,0 +1,111 @@ +/* This file was auto-generated from lsc-lma35.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 15 // Total GPIO count +#define NUM_DIGITAL_PINS 15 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 1 // ADC inputs +#define NUM_ANALOG_OUTPUTS 6 // PWM & DAC outputs +#define PINS_GPIO_MAX 26 // Last usable GPIO number + +// Wire Interfaces +// --------------- +#define PIN_WIRE2_SCL 0u // GPIO0 +#define PIN_WIRE2_SDA 1u // GPIO1 +#define PINS_WIRE2_SCL (pin_size_t[]){0u} +#define PINS_WIRE2_SDA (pin_size_t[]){1u} + +// Serial ports +// ------------ +#define PIN_SERIAL1_RX 10u // GPIO10 +#define PIN_SERIAL1_TX 11u // GPIO11 +#define PIN_SERIAL2_RX 1u // GPIO1 +#define PIN_SERIAL2_TX 0u // GPIO0 +#define PINS_SERIAL1_RX (pin_size_t[]){10u} +#define PINS_SERIAL1_TX (pin_size_t[]){11u} +#define PINS_SERIAL2_RX (pin_size_t[]){1u} +#define PINS_SERIAL2_TX (pin_size_t[]){0u} + +// Pin function macros +// ------------------- +#define PIN_ADC3 23u // GPIO23 +#define PIN_MOSI 16u // GPIO16 +#define PIN_P0 0u // GPIO0 +#define PIN_P1 1u // GPIO1 +#define PIN_P6 6u // GPIO6 +#define PIN_P7 7u // GPIO7 +#define PIN_P8 8u // GPIO8 +#define PIN_P9 9u // GPIO9 +#define PIN_P10 10u // GPIO10 +#define PIN_P11 11u // GPIO11 +#define PIN_P14 14u // GPIO14 +#define PIN_P16 16u // GPIO16 +#define PIN_P21 21u // GPIO21 +#define PIN_P22 22u // GPIO22 +#define PIN_P23 23u // GPIO23 +#define PIN_P24 24u // GPIO24 +#define PIN_P26 26u // GPIO26 +#define PIN_PWM0 6u // GPIO6 +#define PIN_PWM1 7u // GPIO7 +#define PIN_PWM2 8u // GPIO8 +#define PIN_PWM3 9u // GPIO9 +#define PIN_PWM4 24u // GPIO24 +#define PIN_PWM5 26u // GPIO26 +#define PIN_RX1 10u // GPIO10 +#define PIN_RX2 1u // GPIO1 +#define PIN_SCK 14u // GPIO14 +#define PIN_SCL2 0u // GPIO0 +#define PIN_SDA1 21u // GPIO21 +#define PIN_SDA2 1u // GPIO1 +#define PIN_TX1 11u // GPIO11 +#define PIN_TX2 0u // GPIO0 + +// Port availability +// ----------------- +#define HAS_SERIAL1 1 +#define HAS_SERIAL2 1 +#define HAS_WIRE2 1 +#define SERIAL_INTERFACES_COUNT 2 +#define WIRE_INTERFACES_COUNT 1 + +// Arduino pin names +// ----------------- +#define PIN_D0 26u // GPIO26 +#define PIN_D1 14u // GPIO14 +#define PIN_D2 16u // GPIO16 +#define PIN_D3 24u // GPIO24 +#define PIN_D4 22u // GPIO22 +#define PIN_D5 0u // GPIO0 +#define PIN_D6 23u // GPIO23 +#define PIN_D7 8u // GPIO8 +#define PIN_D8 9u // GPIO9 +#define PIN_D9 21u // GPIO21 +#define PIN_D10 6u // GPIO6 +#define PIN_D11 7u // GPIO7 +#define PIN_D12 10u // GPIO10 +#define PIN_D13 11u // GPIO11 +#define PIN_D14 1u // GPIO1 +#define PIN_A0 23u // GPIO23 + +// Static pin names +// ---------------- +static const unsigned char A0 = PIN_A0; +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; +static const unsigned char D9 = PIN_D9; +static const unsigned char D10 = PIN_D10; +static const unsigned char D11 = PIN_D11; +static const unsigned char D12 = PIN_D12; +static const unsigned char D13 = PIN_D13; +static const unsigned char D14 = PIN_D14; diff --git a/boards/variants/t102-v1.1.c b/boards/variants/t102-v1.1.c new file mode 100644 index 000000000..153748b53 --- /dev/null +++ b/boards/variants/t102-v1.1.c @@ -0,0 +1,42 @@ +/* This file was auto-generated from t102-v1.1.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: PA12, PWM3 + {PA_12, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D1: PA00, PWM2 + {PA_0, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D2: PA05, PWM4, WAKE1 + {PA_5, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D3: PA30, UART2_TX, I2C0_SDA, PWM4 + {PA_30, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D4: PA29, UART2_RX, I2C0_SCL, PWM4 + {PA_29, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D5: PA18, UART0_RX, SPI0_SCK, SPI1_SCK, I2C1_SCL, SD_D2, TMR4_TRIG, I2S0_MCK, WAKE0 + {PA_18, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D6: PA23, UART0_TX, SPI0_MOSI, SPI1_MOSI, I2C1_SDA, SD_D1, PWM0, WAKE3 + {PA_23, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D7: PA14, PWM0, SWCLK + {PA_14, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D8: PA15, PWM1, SWDIO + {PA_15, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[1]), // PA_0 (D1) + [5] = &(lt_arduino_pin_info_list[2]), // PA_5 (D2) + [12] = &(lt_arduino_pin_info_list[0]), // PA_12 (D0) + [14] = &(lt_arduino_pin_info_list[7]), // PA_14 (D7) + [15] = &(lt_arduino_pin_info_list[8]), // PA_15 (D8) + [18] = &(lt_arduino_pin_info_list[5]), // PA_18 (D5) + [23] = &(lt_arduino_pin_info_list[6]), // PA_23 (D6) + [29] = &(lt_arduino_pin_info_list[4]), // PA_29 (D4) + [30] = &(lt_arduino_pin_info_list[3]), // PA_30 (D3) +}; +// clang-format on diff --git a/boards/variants/t102-v1.1.h b/boards/variants/t102-v1.1.h new file mode 100644 index 000000000..77860ee13 --- /dev/null +++ b/boards/variants/t102-v1.1.h @@ -0,0 +1,96 @@ +/* This file was auto-generated from t102-v1.1.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 9 // Total GPIO count +#define NUM_DIGITAL_PINS 9 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 0 // ADC inputs +#define NUM_ANALOG_OUTPUTS 8 // PWM & DAC outputs +#define PINS_GPIO_MAX 30 // Last usable GPIO number + +// Wire Interfaces +// --------------- +#define PIN_WIRE0_SCL 29u // PA_29 +#define PIN_WIRE0_SDA 30u // PA_30 +#define PIN_WIRE1_SCL 18u // PA_18 +#define PIN_WIRE1_SDA 23u // PA_23 +#define PINS_WIRE0_SCL (pin_size_t[]){29u} +#define PINS_WIRE0_SDA (pin_size_t[]){30u} +#define PINS_WIRE1_SCL (pin_size_t[]){18u} +#define PINS_WIRE1_SDA (pin_size_t[]){23u} + +// Serial ports +// ------------ +#define PIN_SERIAL0_RX 18u // PA_18 +#define PIN_SERIAL0_TX 23u // PA_23 +#define PIN_SERIAL2_RX 29u // PA_29 +#define PIN_SERIAL2_TX 30u // PA_30 +#define PINS_SERIAL0_RX (pin_size_t[]){18u} +#define PINS_SERIAL0_TX (pin_size_t[]){23u} +#define PINS_SERIAL2_RX (pin_size_t[]){29u} +#define PINS_SERIAL2_TX (pin_size_t[]){30u} + +// Pin function macros +// ------------------- +#define PIN_MOSI0 23u // PA_23 +#define PIN_MOSI1 23u // PA_23 +#define PIN_PA00 0u // PA_0 +#define PIN_PA05 5u // PA_5 +#define PIN_PA12 12u // PA_12 +#define PIN_PA14 14u // PA_14 +#define PIN_PA15 15u // PA_15 +#define PIN_PA18 18u // PA_18 +#define PIN_PA23 23u // PA_23 +#define PIN_PA29 29u // PA_29 +#define PIN_PA30 30u // PA_30 +#define PIN_PWM1 15u // PA_15 +#define PIN_PWM2 0u // PA_0 +#define PIN_PWM3 12u // PA_12 +#define PIN_PWM4 29u // PA_29 +#define PIN_RX0 18u // PA_18 +#define PIN_RX2 29u // PA_29 +#define PIN_SCK0 18u // PA_18 +#define PIN_SCK1 18u // PA_18 +#define PIN_SCL0 29u // PA_29 +#define PIN_SCL1 18u // PA_18 +#define PIN_SDA0 30u // PA_30 +#define PIN_SDA1 23u // PA_23 +#define PIN_TX0 23u // PA_23 +#define PIN_TX2 30u // PA_30 + +// Port availability +// ----------------- +#define HAS_SERIAL0 1 +#define HAS_SERIAL2 1 +#define HAS_WIRE0 1 +#define HAS_WIRE1 1 +#define SERIAL_INTERFACES_COUNT 2 +#define WIRE_INTERFACES_COUNT 2 + +// Arduino pin names +// ----------------- +#define PIN_D0 12u // PA_12 +#define PIN_D1 0u // PA_0 +#define PIN_D2 5u // PA_5 +#define PIN_D3 30u // PA_30 +#define PIN_D4 29u // PA_29 +#define PIN_D5 18u // PA_18 +#define PIN_D6 23u // PA_23 +#define PIN_D7 14u // PA_14 +#define PIN_D8 15u // PA_15 + +// Static pin names +// ---------------- +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; diff --git a/boards/variants/t103-v1.0.c b/boards/variants/t103-v1.0.c new file mode 100644 index 000000000..a4cff7c94 --- /dev/null +++ b/boards/variants/t103-v1.0.c @@ -0,0 +1,51 @@ +/* This file was auto-generated from t103-v1.0.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: PA19, ADC1, UART0_CTS, SPI0_CS, SPI1_CS, I2C0_SDA, SD_D3, TMR5_TRIG, I2S0_TX + {PA_19, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D1: PA14, PWM0, SWCLK + {PA_14, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D2: PA15, PWM1, SWDIO + {PA_15, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D3: PA00, PWM2 + {PA_0, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D4: PA22, UART0_RTS, SPI0_MISO, SPI1_MISO, I2C0_SCL, SD_D0, PWM5, I2S0_WS, WAKE2 + {PA_22, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D5: PA29, UART2_RX, I2C0_SCL, PWM4 + {PA_29, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D6: PA30, UART2_TX, I2C0_SDA, PWM4 + {PA_30, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D7: PA05, PWM4, WAKE1 + {PA_5, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D8: PA12, PWM3 + {PA_12, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D9: PA18, UART0_RX, SPI0_SCK, SPI1_SCK, I2C1_SCL, SD_D2, TMR4_TRIG, I2S0_MCK, WAKE0 + {PA_18, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D10: PA23, UART0_TX, SPI0_MOSI, SPI1_MOSI, I2C1_SDA, SD_D1, PWM0, WAKE3 + {PA_23, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // A1: ADC2 + {AD_2, PIN_ADC, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[3]), // PA_0 (D3) + [5] = &(lt_arduino_pin_info_list[7]), // PA_5 (D7) + [12] = &(lt_arduino_pin_info_list[8]), // PA_12 (D8) + [14] = &(lt_arduino_pin_info_list[1]), // PA_14 (D1) + [15] = &(lt_arduino_pin_info_list[2]), // PA_15 (D2) + [18] = &(lt_arduino_pin_info_list[9]), // PA_18 (D9) + [19] = &(lt_arduino_pin_info_list[0]), // PA_19 (D0) + [22] = &(lt_arduino_pin_info_list[4]), // PA_22 (D4) + [23] = &(lt_arduino_pin_info_list[10]), // PA_23 (D10) + [29] = &(lt_arduino_pin_info_list[5]), // PA_29 (D5) + [30] = &(lt_arduino_pin_info_list[6]), // PA_30 (D6) + [41] = &(lt_arduino_pin_info_list[11]), // AD_2 (A1) +}; +// clang-format on diff --git a/boards/variants/t103-v1.0.h b/boards/variants/t103-v1.0.h new file mode 100644 index 000000000..140407b03 --- /dev/null +++ b/boards/variants/t103-v1.0.h @@ -0,0 +1,141 @@ +/* This file was auto-generated from t103-v1.0.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 12 // Total GPIO count +#define NUM_DIGITAL_PINS 11 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 2 // ADC inputs +#define NUM_ANALOG_OUTPUTS 9 // PWM & DAC outputs +#define PINS_GPIO_MAX 41 // Last usable GPIO number + +// SPI Interfaces +// -------------- +#define PIN_SPI0_CS 19u // PA_19 +#define PIN_SPI0_MISO 22u // PA_22 +#define PIN_SPI0_MOSI 23u // PA_23 +#define PIN_SPI0_SCK 18u // PA_18 +#define PIN_SPI1_CS 19u // PA_19 +#define PIN_SPI1_MISO 22u // PA_22 +#define PIN_SPI1_MOSI 23u // PA_23 +#define PIN_SPI1_SCK 18u // PA_18 +#define PINS_SPI0_CS (pin_size_t[]){19u} +#define PINS_SPI0_MISO (pin_size_t[]){22u} +#define PINS_SPI0_MOSI (pin_size_t[]){23u} +#define PINS_SPI0_SCK (pin_size_t[]){18u} +#define PINS_SPI1_CS (pin_size_t[]){19u} +#define PINS_SPI1_MISO (pin_size_t[]){22u} +#define PINS_SPI1_MOSI (pin_size_t[]){23u} +#define PINS_SPI1_SCK (pin_size_t[]){18u} + +// Wire Interfaces +// --------------- +#define PIN_WIRE0_SCL_0 22u // PA_22 +#define PIN_WIRE0_SCL_1 29u // PA_29 +#define PIN_WIRE0_SDA_0 19u // PA_19 +#define PIN_WIRE0_SDA_1 30u // PA_30 +#define PIN_WIRE1_SCL 18u // PA_18 +#define PIN_WIRE1_SDA 23u // PA_23 +#define PINS_WIRE0_SCL (pin_size_t[]){22u, 29u} +#define PINS_WIRE0_SDA (pin_size_t[]){19u, 30u} +#define PINS_WIRE1_SCL (pin_size_t[]){18u} +#define PINS_WIRE1_SDA (pin_size_t[]){23u} + +// Serial ports +// ------------ +#define PIN_SERIAL0_CTS 19u // PA_19 +#define PIN_SERIAL0_RTS 22u // PA_22 +#define PIN_SERIAL0_RX 18u // PA_18 +#define PIN_SERIAL0_TX 23u // PA_23 +#define PIN_SERIAL2_RX 29u // PA_29 +#define PIN_SERIAL2_TX 30u // PA_30 +#define PINS_SERIAL0_CTS (pin_size_t[]){19u} +#define PINS_SERIAL0_RTS (pin_size_t[]){22u} +#define PINS_SERIAL0_RX (pin_size_t[]){18u} +#define PINS_SERIAL0_TX (pin_size_t[]){23u} +#define PINS_SERIAL2_RX (pin_size_t[]){29u} +#define PINS_SERIAL2_TX (pin_size_t[]){30u} + +// Pin function macros +// ------------------- +#define PIN_ADC1 19u // PA_19 +#define PIN_ADC2 41u // AD_2 +#define PIN_CS0 19u // PA_19 +#define PIN_CS1 19u // PA_19 +#define PIN_CTS0 19u // PA_19 +#define PIN_MISO0 22u // PA_22 +#define PIN_MISO1 22u // PA_22 +#define PIN_MOSI0 23u // PA_23 +#define PIN_MOSI1 23u // PA_23 +#define PIN_PA00 0u // PA_0 +#define PIN_PA05 5u // PA_5 +#define PIN_PA12 12u // PA_12 +#define PIN_PA14 14u // PA_14 +#define PIN_PA15 15u // PA_15 +#define PIN_PA18 18u // PA_18 +#define PIN_PA19 19u // PA_19 +#define PIN_PA22 22u // PA_22 +#define PIN_PA23 23u // PA_23 +#define PIN_PA29 29u // PA_29 +#define PIN_PA30 30u // PA_30 +#define PIN_PWM1 15u // PA_15 +#define PIN_PWM2 0u // PA_0 +#define PIN_PWM3 12u // PA_12 +#define PIN_PWM4 5u // PA_5 +#define PIN_PWM5 22u // PA_22 +#define PIN_RTS0 22u // PA_22 +#define PIN_RX0 18u // PA_18 +#define PIN_RX2 29u // PA_29 +#define PIN_SCK0 18u // PA_18 +#define PIN_SCK1 18u // PA_18 +#define PIN_SCL1 18u // PA_18 +#define PIN_SDA1 23u // PA_23 +#define PIN_TX0 23u // PA_23 +#define PIN_TX2 30u // PA_30 + +// Port availability +// ----------------- +#define HAS_SERIAL0 1 +#define HAS_SERIAL2 1 +#define HAS_SPI0 1 +#define HAS_SPI1 1 +#define HAS_WIRE0 1 +#define HAS_WIRE1 1 +#define SERIAL_INTERFACES_COUNT 2 +#define SPI_INTERFACES_COUNT 2 +#define WIRE_INTERFACES_COUNT 2 + +// Arduino pin names +// ----------------- +#define PIN_D0 19u // PA_19 +#define PIN_D1 14u // PA_14 +#define PIN_D2 15u // PA_15 +#define PIN_D3 0u // PA_0 +#define PIN_D4 22u // PA_22 +#define PIN_D5 29u // PA_29 +#define PIN_D6 30u // PA_30 +#define PIN_D7 5u // PA_5 +#define PIN_D8 12u // PA_12 +#define PIN_D9 18u // PA_18 +#define PIN_D10 23u // PA_23 +#define PIN_A0 19u // PA_19 +#define PIN_A1 41u // AD_2 + +// Static pin names +// ---------------- +static const unsigned char A0 = PIN_A0; +static const unsigned char A1 = PIN_A1; +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; +static const unsigned char D9 = PIN_D9; +static const unsigned char D10 = PIN_D10; diff --git a/boards/variants/t112-v1.1.c b/boards/variants/t112-v1.1.c new file mode 100644 index 000000000..03dda234e --- /dev/null +++ b/boards/variants/t112-v1.1.c @@ -0,0 +1,48 @@ +/* This file was auto-generated from t112-v1.1.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: PA29, UART2_RX, I2C0_SCL, PWM4 + {PA_29, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D1: PA19, ADC1, UART0_CTS, SPI0_CS, SPI1_CS, I2C0_SDA, SD_D3, TMR5_TRIG, I2S0_TX + {PA_19, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D2: PA15, PWM1, SWDIO + {PA_15, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D3: PA14, PWM0, SWCLK + {PA_14, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D4: PA00, PWM2 + {PA_0, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D5: PA05, PWM4, WAKE1 + {PA_5, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D6: PA18, UART0_RX, SPI0_SCK, SPI1_SCK, I2C1_SCL, SD_D2, TMR4_TRIG, I2S0_MCK, WAKE0 + {PA_18, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D7: PA12, PWM3 + {PA_12, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D8: PA23, UART0_TX, SPI0_MOSI, SPI1_MOSI, I2C1_SDA, SD_D1, PWM0, WAKE3 + {PA_23, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D9: PA22, UART0_RTS, SPI0_MISO, SPI1_MISO, I2C0_SCL, SD_D0, PWM5, I2S0_WS, WAKE2 + {PA_22, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D10: PA30, UART2_TX, I2C0_SDA, PWM4 + {PA_30, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[4]), // PA_0 (D4) + [5] = &(lt_arduino_pin_info_list[5]), // PA_5 (D5) + [12] = &(lt_arduino_pin_info_list[7]), // PA_12 (D7) + [14] = &(lt_arduino_pin_info_list[3]), // PA_14 (D3) + [15] = &(lt_arduino_pin_info_list[2]), // PA_15 (D2) + [18] = &(lt_arduino_pin_info_list[6]), // PA_18 (D6) + [19] = &(lt_arduino_pin_info_list[1]), // PA_19 (D1) + [22] = &(lt_arduino_pin_info_list[9]), // PA_22 (D9) + [23] = &(lt_arduino_pin_info_list[8]), // PA_23 (D8) + [29] = &(lt_arduino_pin_info_list[0]), // PA_29 (D0) + [30] = &(lt_arduino_pin_info_list[10]), // PA_30 (D10) +}; +// clang-format on diff --git a/boards/variants/t112-v1.1.h b/boards/variants/t112-v1.1.h new file mode 100644 index 000000000..30b548d2c --- /dev/null +++ b/boards/variants/t112-v1.1.h @@ -0,0 +1,138 @@ +/* This file was auto-generated from t112-v1.1.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 11 // Total GPIO count +#define NUM_DIGITAL_PINS 11 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 1 // ADC inputs +#define NUM_ANALOG_OUTPUTS 9 // PWM & DAC outputs +#define PINS_GPIO_MAX 30 // Last usable GPIO number + +// SPI Interfaces +// -------------- +#define PIN_SPI0_CS 19u // PA_19 +#define PIN_SPI0_MISO 22u // PA_22 +#define PIN_SPI0_MOSI 23u // PA_23 +#define PIN_SPI0_SCK 18u // PA_18 +#define PIN_SPI1_CS 19u // PA_19 +#define PIN_SPI1_MISO 22u // PA_22 +#define PIN_SPI1_MOSI 23u // PA_23 +#define PIN_SPI1_SCK 18u // PA_18 +#define PINS_SPI0_CS (pin_size_t[]){19u} +#define PINS_SPI0_MISO (pin_size_t[]){22u} +#define PINS_SPI0_MOSI (pin_size_t[]){23u} +#define PINS_SPI0_SCK (pin_size_t[]){18u} +#define PINS_SPI1_CS (pin_size_t[]){19u} +#define PINS_SPI1_MISO (pin_size_t[]){22u} +#define PINS_SPI1_MOSI (pin_size_t[]){23u} +#define PINS_SPI1_SCK (pin_size_t[]){18u} + +// Wire Interfaces +// --------------- +#define PIN_WIRE0_SCL_0 29u // PA_29 +#define PIN_WIRE0_SCL_1 22u // PA_22 +#define PIN_WIRE0_SDA_0 19u // PA_19 +#define PIN_WIRE0_SDA_1 30u // PA_30 +#define PIN_WIRE1_SCL 18u // PA_18 +#define PIN_WIRE1_SDA 23u // PA_23 +#define PINS_WIRE0_SCL (pin_size_t[]){29u, 22u} +#define PINS_WIRE0_SDA (pin_size_t[]){19u, 30u} +#define PINS_WIRE1_SCL (pin_size_t[]){18u} +#define PINS_WIRE1_SDA (pin_size_t[]){23u} + +// Serial ports +// ------------ +#define PIN_SERIAL0_CTS 19u // PA_19 +#define PIN_SERIAL0_RTS 22u // PA_22 +#define PIN_SERIAL0_RX 18u // PA_18 +#define PIN_SERIAL0_TX 23u // PA_23 +#define PIN_SERIAL2_RX 29u // PA_29 +#define PIN_SERIAL2_TX 30u // PA_30 +#define PINS_SERIAL0_CTS (pin_size_t[]){19u} +#define PINS_SERIAL0_RTS (pin_size_t[]){22u} +#define PINS_SERIAL0_RX (pin_size_t[]){18u} +#define PINS_SERIAL0_TX (pin_size_t[]){23u} +#define PINS_SERIAL2_RX (pin_size_t[]){29u} +#define PINS_SERIAL2_TX (pin_size_t[]){30u} + +// Pin function macros +// ------------------- +#define PIN_ADC1 19u // PA_19 +#define PIN_CS0 19u // PA_19 +#define PIN_CS1 19u // PA_19 +#define PIN_CTS0 19u // PA_19 +#define PIN_MISO0 22u // PA_22 +#define PIN_MISO1 22u // PA_22 +#define PIN_MOSI0 23u // PA_23 +#define PIN_MOSI1 23u // PA_23 +#define PIN_PA00 0u // PA_0 +#define PIN_PA05 5u // PA_5 +#define PIN_PA12 12u // PA_12 +#define PIN_PA14 14u // PA_14 +#define PIN_PA15 15u // PA_15 +#define PIN_PA18 18u // PA_18 +#define PIN_PA19 19u // PA_19 +#define PIN_PA22 22u // PA_22 +#define PIN_PA23 23u // PA_23 +#define PIN_PA29 29u // PA_29 +#define PIN_PA30 30u // PA_30 +#define PIN_PWM1 15u // PA_15 +#define PIN_PWM2 0u // PA_0 +#define PIN_PWM3 12u // PA_12 +#define PIN_PWM4 30u // PA_30 +#define PIN_PWM5 22u // PA_22 +#define PIN_RTS0 22u // PA_22 +#define PIN_RX0 18u // PA_18 +#define PIN_RX2 29u // PA_29 +#define PIN_SCK0 18u // PA_18 +#define PIN_SCK1 18u // PA_18 +#define PIN_SCL1 18u // PA_18 +#define PIN_SDA1 23u // PA_23 +#define PIN_TX0 23u // PA_23 +#define PIN_TX2 30u // PA_30 + +// Port availability +// ----------------- +#define HAS_SERIAL0 1 +#define HAS_SERIAL2 1 +#define HAS_SPI0 1 +#define HAS_SPI1 1 +#define HAS_WIRE0 1 +#define HAS_WIRE1 1 +#define SERIAL_INTERFACES_COUNT 2 +#define SPI_INTERFACES_COUNT 2 +#define WIRE_INTERFACES_COUNT 2 + +// Arduino pin names +// ----------------- +#define PIN_D0 29u // PA_29 +#define PIN_D1 19u // PA_19 +#define PIN_D2 15u // PA_15 +#define PIN_D3 14u // PA_14 +#define PIN_D4 0u // PA_0 +#define PIN_D5 5u // PA_5 +#define PIN_D6 18u // PA_18 +#define PIN_D7 12u // PA_12 +#define PIN_D8 23u // PA_23 +#define PIN_D9 22u // PA_22 +#define PIN_D10 30u // PA_30 +#define PIN_A0 19u // PA_19 + +// Static pin names +// ---------------- +static const unsigned char A0 = PIN_A0; +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; +static const unsigned char D9 = PIN_D9; +static const unsigned char D10 = PIN_D10; diff --git a/boards/variants/wa2.c b/boards/variants/wa2.c new file mode 100644 index 000000000..9127c2457 --- /dev/null +++ b/boards/variants/wa2.c @@ -0,0 +1,54 @@ +/* This file was auto-generated from wa2.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: P8, PWM2 + {GPIO8, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D1: P7, PWM1 + {GPIO7, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D2: P6, PWM0 + {GPIO6, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D3: P23, ADC3, TDO, FSO + {GPIO23, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_JTAG, PIN_NONE, 0}, + // D4: P10, UART1_RX + {GPIO10, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D5: P11, UART1_TX + {GPIO11, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D6: P18, SD_D2, PWM4 + {GPIO18, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D7: P19, SD_D3, PWM5 + {GPIO19, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D8: P20, I2C1_SCL, TCK, FSCK + {GPIO20, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_JTAG, PIN_NONE, 0}, + // D9: P4, ADC1, DIN + {GPIO4, PIN_GPIO | PIN_IRQ | PIN_I2S, PIN_NONE, 0}, + // D10: P0, UART2_TX, I2C2_SCL + {GPIO0, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D11: P21, I2C1_SDA, TMS, ^FCS + {GPIO21, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_JTAG, PIN_NONE, 0}, + // D12: P22, TDI, FSI + {GPIO22, PIN_GPIO | PIN_IRQ | PIN_JTAG, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[10]), // GPIO0 (D10) + [4] = &(lt_arduino_pin_info_list[9]), // GPIO4 (D9) + [6] = &(lt_arduino_pin_info_list[2]), // GPIO6 (D2) + [7] = &(lt_arduino_pin_info_list[1]), // GPIO7 (D1) + [8] = &(lt_arduino_pin_info_list[0]), // GPIO8 (D0) + [10] = &(lt_arduino_pin_info_list[4]), // GPIO10 (D4) + [11] = &(lt_arduino_pin_info_list[5]), // GPIO11 (D5) + [18] = &(lt_arduino_pin_info_list[6]), // GPIO18 (D6) + [19] = &(lt_arduino_pin_info_list[7]), // GPIO19 (D7) + [20] = &(lt_arduino_pin_info_list[8]), // GPIO20 (D8) + [21] = &(lt_arduino_pin_info_list[11]), // GPIO21 (D11) + [22] = &(lt_arduino_pin_info_list[12]), // GPIO22 (D12) + [23] = &(lt_arduino_pin_info_list[3]), // GPIO23 (D3) +}; +// clang-format on diff --git a/boards/variants/wa2.h b/boards/variants/wa2.h new file mode 100644 index 000000000..f383a1ab2 --- /dev/null +++ b/boards/variants/wa2.h @@ -0,0 +1,100 @@ +/* This file was auto-generated from wa2.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 13 // Total GPIO count +#define NUM_DIGITAL_PINS 13 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 1 // ADC inputs +#define NUM_ANALOG_OUTPUTS 5 // PWM & DAC outputs +#define PINS_GPIO_MAX 23 // Last usable GPIO number + +// Wire Interfaces +// --------------- +#define PIN_WIRE1_SCL 20u // GPIO20 +#define PIN_WIRE1_SDA 21u // GPIO21 +#define PINS_WIRE1_SCL (pin_size_t[]){20u} +#define PINS_WIRE1_SDA (pin_size_t[]){21u} + +// Serial ports +// ------------ +#define PIN_SERIAL1_RX 10u // GPIO10 +#define PIN_SERIAL1_TX 11u // GPIO11 +#define PIN_SERIAL2_TX 0u // GPIO0 +#define PINS_SERIAL1_RX (pin_size_t[]){10u} +#define PINS_SERIAL1_TX (pin_size_t[]){11u} +#define PINS_SERIAL2_TX (pin_size_t[]){0u} + +// Pin function macros +// ------------------- +#define PIN_ADC1 4u // GPIO4 +#define PIN_ADC3 23u // GPIO23 +#define PIN_P0 0u // GPIO0 +#define PIN_P4 4u // GPIO4 +#define PIN_P6 6u // GPIO6 +#define PIN_P7 7u // GPIO7 +#define PIN_P8 8u // GPIO8 +#define PIN_P10 10u // GPIO10 +#define PIN_P11 11u // GPIO11 +#define PIN_P18 18u // GPIO18 +#define PIN_P19 19u // GPIO19 +#define PIN_P20 20u // GPIO20 +#define PIN_P21 21u // GPIO21 +#define PIN_P22 22u // GPIO22 +#define PIN_P23 23u // GPIO23 +#define PIN_PWM0 6u // GPIO6 +#define PIN_PWM1 7u // GPIO7 +#define PIN_PWM2 8u // GPIO8 +#define PIN_PWM4 18u // GPIO18 +#define PIN_PWM5 19u // GPIO19 +#define PIN_RX1 10u // GPIO10 +#define PIN_SCL1 20u // GPIO20 +#define PIN_SCL2 0u // GPIO0 +#define PIN_SDA1 21u // GPIO21 +#define PIN_TX1 11u // GPIO11 +#define PIN_TX2 0u // GPIO0 + +// Port availability +// ----------------- +#define HAS_SERIAL1 1 +#define HAS_SERIAL2 1 +#define HAS_WIRE1 1 +#define SERIAL_INTERFACES_COUNT 2 +#define WIRE_INTERFACES_COUNT 1 + +// Arduino pin names +// ----------------- +#define PIN_D0 8u // GPIO8 +#define PIN_D1 7u // GPIO7 +#define PIN_D2 6u // GPIO6 +#define PIN_D3 23u // GPIO23 +#define PIN_D4 10u // GPIO10 +#define PIN_D5 11u // GPIO11 +#define PIN_D6 18u // GPIO18 +#define PIN_D7 19u // GPIO19 +#define PIN_D8 20u // GPIO20 +#define PIN_D9 4u // GPIO4 +#define PIN_D10 0u // GPIO0 +#define PIN_D11 21u // GPIO21 +#define PIN_D12 22u // GPIO22 +#define PIN_A0 23u // GPIO23 + +// Static pin names +// ---------------- +static const unsigned char A0 = PIN_A0; +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; +static const unsigned char D9 = PIN_D9; +static const unsigned char D10 = PIN_D10; +static const unsigned char D11 = PIN_D11; +static const unsigned char D12 = PIN_D12; diff --git a/boards/variants/wb1s.c b/boards/variants/wb1s.c new file mode 100644 index 000000000..1a039f1a5 --- /dev/null +++ b/boards/variants/wb1s.c @@ -0,0 +1,48 @@ +/* This file was auto-generated from wb1s.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: P11, UART1_TX + {GPIO11, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D1: P10, UART1_RX + {GPIO10, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D2: P26, PWM5, IRDA + {GPIO26, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D3: P24, PWM4 + {GPIO24, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D4: P0, UART2_TX, I2C2_SCL + {GPIO0, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D5: P8, PWM2 + {GPIO8, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D6: P7, PWM1 + {GPIO7, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D7: P1, UART2_RX, I2C2_SDA + {GPIO1, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D8: P9, PWM3 + {GPIO9, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D9: P6, PWM0 + {GPIO6, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D10: P23, ADC3, TDO, FSO + {GPIO23, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_JTAG, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[4]), // GPIO0 (D4) + [1] = &(lt_arduino_pin_info_list[7]), // GPIO1 (D7) + [6] = &(lt_arduino_pin_info_list[9]), // GPIO6 (D9) + [7] = &(lt_arduino_pin_info_list[6]), // GPIO7 (D6) + [8] = &(lt_arduino_pin_info_list[5]), // GPIO8 (D5) + [9] = &(lt_arduino_pin_info_list[8]), // GPIO9 (D8) + [10] = &(lt_arduino_pin_info_list[1]), // GPIO10 (D1) + [11] = &(lt_arduino_pin_info_list[0]), // GPIO11 (D0) + [23] = &(lt_arduino_pin_info_list[10]), // GPIO23 (D10) + [24] = &(lt_arduino_pin_info_list[3]), // GPIO24 (D3) + [26] = &(lt_arduino_pin_info_list[2]), // GPIO26 (D2) +}; +// clang-format on diff --git a/boards/variants/wb1s.h b/boards/variants/wb1s.h new file mode 100644 index 000000000..ef785dc98 --- /dev/null +++ b/boards/variants/wb1s.h @@ -0,0 +1,96 @@ +/* This file was auto-generated from wb1s.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 11 // Total GPIO count +#define NUM_DIGITAL_PINS 11 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 1 // ADC inputs +#define NUM_ANALOG_OUTPUTS 6 // PWM & DAC outputs +#define PINS_GPIO_MAX 26 // Last usable GPIO number + +// Wire Interfaces +// --------------- +#define PIN_WIRE2_SCL 0u // GPIO0 +#define PIN_WIRE2_SDA 1u // GPIO1 +#define PINS_WIRE2_SCL (pin_size_t[]){0u} +#define PINS_WIRE2_SDA (pin_size_t[]){1u} + +// Serial ports +// ------------ +#define PIN_SERIAL1_RX 10u // GPIO10 +#define PIN_SERIAL1_TX 11u // GPIO11 +#define PIN_SERIAL2_RX 1u // GPIO1 +#define PIN_SERIAL2_TX 0u // GPIO0 +#define PINS_SERIAL1_RX (pin_size_t[]){10u} +#define PINS_SERIAL1_TX (pin_size_t[]){11u} +#define PINS_SERIAL2_RX (pin_size_t[]){1u} +#define PINS_SERIAL2_TX (pin_size_t[]){0u} + +// Pin function macros +// ------------------- +#define PIN_ADC3 23u // GPIO23 +#define PIN_P0 0u // GPIO0 +#define PIN_P1 1u // GPIO1 +#define PIN_P6 6u // GPIO6 +#define PIN_P7 7u // GPIO7 +#define PIN_P8 8u // GPIO8 +#define PIN_P9 9u // GPIO9 +#define PIN_P10 10u // GPIO10 +#define PIN_P11 11u // GPIO11 +#define PIN_P23 23u // GPIO23 +#define PIN_P24 24u // GPIO24 +#define PIN_P26 26u // GPIO26 +#define PIN_PWM0 6u // GPIO6 +#define PIN_PWM1 7u // GPIO7 +#define PIN_PWM2 8u // GPIO8 +#define PIN_PWM3 9u // GPIO9 +#define PIN_PWM4 24u // GPIO24 +#define PIN_PWM5 26u // GPIO26 +#define PIN_RX1 10u // GPIO10 +#define PIN_RX2 1u // GPIO1 +#define PIN_SCL2 0u // GPIO0 +#define PIN_SDA2 1u // GPIO1 +#define PIN_TX1 11u // GPIO11 +#define PIN_TX2 0u // GPIO0 + +// Port availability +// ----------------- +#define HAS_SERIAL1 1 +#define HAS_SERIAL2 1 +#define HAS_WIRE2 1 +#define SERIAL_INTERFACES_COUNT 2 +#define WIRE_INTERFACES_COUNT 1 + +// Arduino pin names +// ----------------- +#define PIN_D0 11u // GPIO11 +#define PIN_D1 10u // GPIO10 +#define PIN_D2 26u // GPIO26 +#define PIN_D3 24u // GPIO24 +#define PIN_D4 0u // GPIO0 +#define PIN_D5 8u // GPIO8 +#define PIN_D6 7u // GPIO7 +#define PIN_D7 1u // GPIO1 +#define PIN_D8 9u // GPIO9 +#define PIN_D9 6u // GPIO6 +#define PIN_D10 23u // GPIO23 +#define PIN_A0 23u // GPIO23 + +// Static pin names +// ---------------- +static const unsigned char A0 = PIN_A0; +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; +static const unsigned char D9 = PIN_D9; +static const unsigned char D10 = PIN_D10; diff --git a/boards/variants/wb2l-m1.c b/boards/variants/wb2l-m1.c new file mode 100644 index 000000000..6ec0255ac --- /dev/null +++ b/boards/variants/wb2l-m1.c @@ -0,0 +1,54 @@ +/* This file was auto-generated from wb2l-m1.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: P8, PWM2 + {GPIO8, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D1: P7, PWM1 + {GPIO7, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D2: P6, PWM0 + {GPIO6, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D3: P26, PWM5, IRDA + {GPIO26, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D4: P24, PWM4 + {GPIO24, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D5: P10, UART1_RX + {GPIO10, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D6: P11, UART1_TX + {GPIO11, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D7: P1, UART2_RX, I2C2_SDA + {GPIO1, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D8: P0, UART2_TX, I2C2_SCL + {GPIO0, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D9: P20, I2C1_SCL, TCK, FSCK + {GPIO20, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_JTAG, PIN_NONE, 0}, + // D10: P21, I2C1_SDA, TMS, MCLK, ^FCS + {GPIO21, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_JTAG, PIN_NONE, 0}, + // D11: P23, ADC3, TDO, FSO + {GPIO23, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_JTAG, PIN_NONE, 0}, + // D12: P22, TDI, FSI + {GPIO22, PIN_GPIO | PIN_IRQ | PIN_JTAG, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[8]), // GPIO0 (D8) + [1] = &(lt_arduino_pin_info_list[7]), // GPIO1 (D7) + [6] = &(lt_arduino_pin_info_list[2]), // GPIO6 (D2) + [7] = &(lt_arduino_pin_info_list[1]), // GPIO7 (D1) + [8] = &(lt_arduino_pin_info_list[0]), // GPIO8 (D0) + [10] = &(lt_arduino_pin_info_list[5]), // GPIO10 (D5) + [11] = &(lt_arduino_pin_info_list[6]), // GPIO11 (D6) + [20] = &(lt_arduino_pin_info_list[9]), // GPIO20 (D9) + [21] = &(lt_arduino_pin_info_list[10]), // GPIO21 (D10) + [22] = &(lt_arduino_pin_info_list[12]), // GPIO22 (D12) + [23] = &(lt_arduino_pin_info_list[11]), // GPIO23 (D11) + [24] = &(lt_arduino_pin_info_list[4]), // GPIO24 (D4) + [26] = &(lt_arduino_pin_info_list[3]), // GPIO26 (D3) +}; +// clang-format on diff --git a/boards/variants/wb2l-m1.h b/boards/variants/wb2l-m1.h new file mode 100644 index 000000000..31e4c396f --- /dev/null +++ b/boards/variants/wb2l-m1.h @@ -0,0 +1,108 @@ +/* This file was auto-generated from wb2l-m1.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 13 // Total GPIO count +#define NUM_DIGITAL_PINS 13 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 1 // ADC inputs +#define NUM_ANALOG_OUTPUTS 5 // PWM & DAC outputs +#define PINS_GPIO_MAX 26 // Last usable GPIO number + +// Wire Interfaces +// --------------- +#define PIN_WIRE1_SCL 20u // GPIO20 +#define PIN_WIRE1_SDA 21u // GPIO21 +#define PIN_WIRE2_SCL 0u // GPIO0 +#define PIN_WIRE2_SDA 1u // GPIO1 +#define PINS_WIRE1_SCL (pin_size_t[]){20u} +#define PINS_WIRE1_SDA (pin_size_t[]){21u} +#define PINS_WIRE2_SCL (pin_size_t[]){0u} +#define PINS_WIRE2_SDA (pin_size_t[]){1u} + +// Serial ports +// ------------ +#define PIN_SERIAL1_RX 10u // GPIO10 +#define PIN_SERIAL1_TX 11u // GPIO11 +#define PIN_SERIAL2_RX 1u // GPIO1 +#define PIN_SERIAL2_TX 0u // GPIO0 +#define PINS_SERIAL1_RX (pin_size_t[]){10u} +#define PINS_SERIAL1_TX (pin_size_t[]){11u} +#define PINS_SERIAL2_RX (pin_size_t[]){1u} +#define PINS_SERIAL2_TX (pin_size_t[]){0u} + +// Pin function macros +// ------------------- +#define PIN_ADC3 23u // GPIO23 +#define PIN_P0 0u // GPIO0 +#define PIN_P1 1u // GPIO1 +#define PIN_P6 6u // GPIO6 +#define PIN_P7 7u // GPIO7 +#define PIN_P8 8u // GPIO8 +#define PIN_P10 10u // GPIO10 +#define PIN_P11 11u // GPIO11 +#define PIN_P20 20u // GPIO20 +#define PIN_P21 21u // GPIO21 +#define PIN_P22 22u // GPIO22 +#define PIN_P23 23u // GPIO23 +#define PIN_P24 24u // GPIO24 +#define PIN_P26 26u // GPIO26 +#define PIN_PWM0 6u // GPIO6 +#define PIN_PWM1 7u // GPIO7 +#define PIN_PWM2 8u // GPIO8 +#define PIN_PWM4 24u // GPIO24 +#define PIN_PWM5 26u // GPIO26 +#define PIN_RX1 10u // GPIO10 +#define PIN_RX2 1u // GPIO1 +#define PIN_SCL1 20u // GPIO20 +#define PIN_SCL2 0u // GPIO0 +#define PIN_SDA1 21u // GPIO21 +#define PIN_SDA2 1u // GPIO1 +#define PIN_TX1 11u // GPIO11 +#define PIN_TX2 0u // GPIO0 + +// Port availability +// ----------------- +#define HAS_SERIAL1 1 +#define HAS_SERIAL2 1 +#define HAS_WIRE1 1 +#define HAS_WIRE2 1 +#define SERIAL_INTERFACES_COUNT 2 +#define WIRE_INTERFACES_COUNT 2 + +// Arduino pin names +// ----------------- +#define PIN_D0 8u // GPIO8 +#define PIN_D1 7u // GPIO7 +#define PIN_D2 6u // GPIO6 +#define PIN_D3 26u // GPIO26 +#define PIN_D4 24u // GPIO24 +#define PIN_D5 10u // GPIO10 +#define PIN_D6 11u // GPIO11 +#define PIN_D7 1u // GPIO1 +#define PIN_D8 0u // GPIO0 +#define PIN_D9 20u // GPIO20 +#define PIN_D10 21u // GPIO21 +#define PIN_D11 23u // GPIO23 +#define PIN_D12 22u // GPIO22 +#define PIN_A0 23u // GPIO23 + +// Static pin names +// ---------------- +static const unsigned char A0 = PIN_A0; +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; +static const unsigned char D9 = PIN_D9; +static const unsigned char D10 = PIN_D10; +static const unsigned char D11 = PIN_D11; +static const unsigned char D12 = PIN_D12; diff --git a/boards/variants/wb2l.c b/boards/variants/wb2l.c new file mode 100644 index 000000000..650145430 --- /dev/null +++ b/boards/variants/wb2l.c @@ -0,0 +1,54 @@ +/* This file was auto-generated from wb2l.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: P8, PWM2 + {GPIO8, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D1: P7, PWM1 + {GPIO7, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D2: P6, PWM0 + {GPIO6, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D3: P26, PWM5, IRDA + {GPIO26, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D4: P24, PWM4 + {GPIO24, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D5: P10, UART1_RX + {GPIO10, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D6: P11, UART1_TX + {GPIO11, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D7: P1, UART2_RX, I2C2_SDA + {GPIO1, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D8: P0, UART2_TX, I2C2_SCL + {GPIO0, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D9: P20, I2C1_SCL, TCK, FSCK + {GPIO20, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_JTAG, PIN_NONE, 0}, + // D10: P21, I2C1_SDA, TMS, MCLK, ^FCS + {GPIO21, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_JTAG, PIN_NONE, 0}, + // D11: P23, ADC3, TDO, FSO + {GPIO23, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_JTAG, PIN_NONE, 0}, + // D12: P22, TDI, FSI + {GPIO22, PIN_GPIO | PIN_IRQ | PIN_JTAG, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[8]), // GPIO0 (D8) + [1] = &(lt_arduino_pin_info_list[7]), // GPIO1 (D7) + [6] = &(lt_arduino_pin_info_list[2]), // GPIO6 (D2) + [7] = &(lt_arduino_pin_info_list[1]), // GPIO7 (D1) + [8] = &(lt_arduino_pin_info_list[0]), // GPIO8 (D0) + [10] = &(lt_arduino_pin_info_list[5]), // GPIO10 (D5) + [11] = &(lt_arduino_pin_info_list[6]), // GPIO11 (D6) + [20] = &(lt_arduino_pin_info_list[9]), // GPIO20 (D9) + [21] = &(lt_arduino_pin_info_list[10]), // GPIO21 (D10) + [22] = &(lt_arduino_pin_info_list[12]), // GPIO22 (D12) + [23] = &(lt_arduino_pin_info_list[11]), // GPIO23 (D11) + [24] = &(lt_arduino_pin_info_list[4]), // GPIO24 (D4) + [26] = &(lt_arduino_pin_info_list[3]), // GPIO26 (D3) +}; +// clang-format on diff --git a/boards/variants/wb2l.h b/boards/variants/wb2l.h new file mode 100644 index 000000000..6a12059fc --- /dev/null +++ b/boards/variants/wb2l.h @@ -0,0 +1,108 @@ +/* This file was auto-generated from wb2l.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 13 // Total GPIO count +#define NUM_DIGITAL_PINS 13 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 1 // ADC inputs +#define NUM_ANALOG_OUTPUTS 5 // PWM & DAC outputs +#define PINS_GPIO_MAX 26 // Last usable GPIO number + +// Wire Interfaces +// --------------- +#define PIN_WIRE1_SCL 20u // GPIO20 +#define PIN_WIRE1_SDA 21u // GPIO21 +#define PIN_WIRE2_SCL 0u // GPIO0 +#define PIN_WIRE2_SDA 1u // GPIO1 +#define PINS_WIRE1_SCL (pin_size_t[]){20u} +#define PINS_WIRE1_SDA (pin_size_t[]){21u} +#define PINS_WIRE2_SCL (pin_size_t[]){0u} +#define PINS_WIRE2_SDA (pin_size_t[]){1u} + +// Serial ports +// ------------ +#define PIN_SERIAL1_RX 10u // GPIO10 +#define PIN_SERIAL1_TX 11u // GPIO11 +#define PIN_SERIAL2_RX 1u // GPIO1 +#define PIN_SERIAL2_TX 0u // GPIO0 +#define PINS_SERIAL1_RX (pin_size_t[]){10u} +#define PINS_SERIAL1_TX (pin_size_t[]){11u} +#define PINS_SERIAL2_RX (pin_size_t[]){1u} +#define PINS_SERIAL2_TX (pin_size_t[]){0u} + +// Pin function macros +// ------------------- +#define PIN_ADC3 23u // GPIO23 +#define PIN_P0 0u // GPIO0 +#define PIN_P1 1u // GPIO1 +#define PIN_P6 6u // GPIO6 +#define PIN_P7 7u // GPIO7 +#define PIN_P8 8u // GPIO8 +#define PIN_P10 10u // GPIO10 +#define PIN_P11 11u // GPIO11 +#define PIN_P20 20u // GPIO20 +#define PIN_P21 21u // GPIO21 +#define PIN_P22 22u // GPIO22 +#define PIN_P23 23u // GPIO23 +#define PIN_P24 24u // GPIO24 +#define PIN_P26 26u // GPIO26 +#define PIN_PWM0 6u // GPIO6 +#define PIN_PWM1 7u // GPIO7 +#define PIN_PWM2 8u // GPIO8 +#define PIN_PWM4 24u // GPIO24 +#define PIN_PWM5 26u // GPIO26 +#define PIN_RX1 10u // GPIO10 +#define PIN_RX2 1u // GPIO1 +#define PIN_SCL1 20u // GPIO20 +#define PIN_SCL2 0u // GPIO0 +#define PIN_SDA1 21u // GPIO21 +#define PIN_SDA2 1u // GPIO1 +#define PIN_TX1 11u // GPIO11 +#define PIN_TX2 0u // GPIO0 + +// Port availability +// ----------------- +#define HAS_SERIAL1 1 +#define HAS_SERIAL2 1 +#define HAS_WIRE1 1 +#define HAS_WIRE2 1 +#define SERIAL_INTERFACES_COUNT 2 +#define WIRE_INTERFACES_COUNT 2 + +// Arduino pin names +// ----------------- +#define PIN_D0 8u // GPIO8 +#define PIN_D1 7u // GPIO7 +#define PIN_D2 6u // GPIO6 +#define PIN_D3 26u // GPIO26 +#define PIN_D4 24u // GPIO24 +#define PIN_D5 10u // GPIO10 +#define PIN_D6 11u // GPIO11 +#define PIN_D7 1u // GPIO1 +#define PIN_D8 0u // GPIO0 +#define PIN_D9 20u // GPIO20 +#define PIN_D10 21u // GPIO21 +#define PIN_D11 23u // GPIO23 +#define PIN_D12 22u // GPIO22 +#define PIN_A0 23u // GPIO23 + +// Static pin names +// ---------------- +static const unsigned char A0 = PIN_A0; +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; +static const unsigned char D9 = PIN_D9; +static const unsigned char D10 = PIN_D10; +static const unsigned char D11 = PIN_D11; +static const unsigned char D12 = PIN_D12; diff --git a/boards/variants/wb2s.c b/boards/variants/wb2s.c new file mode 100644 index 000000000..b08506c7b --- /dev/null +++ b/boards/variants/wb2s.c @@ -0,0 +1,57 @@ +/* This file was auto-generated from wb2s.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: P8, PWM2 + {GPIO8, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D1: P7, PWM1 + {GPIO7, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D2: P6, PWM0 + {GPIO6, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D3: P23, ADC3, TDO, FSO + {GPIO23, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_JTAG, PIN_NONE, 0}, + // D4: P10, UART1_RX + {GPIO10, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D5: P11, UART1_TX + {GPIO11, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D6: P24, PWM4 + {GPIO24, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D7: P26, PWM5, IRDA + {GPIO26, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D8: P20, I2C1_SCL, TCK, FSCK + {GPIO20, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_JTAG, PIN_NONE, 0}, + // D9: P9, PWM3 + {GPIO9, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D10: P1, UART2_RX, I2C2_SDA + {GPIO1, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D11: P0, UART2_TX, I2C2_SCL + {GPIO0, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D12: P21, I2C1_SDA, TMS, MCLK, ^FCS + {GPIO21, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_JTAG, PIN_NONE, 0}, + // D13: P22, TDI, FSI + {GPIO22, PIN_GPIO | PIN_IRQ | PIN_JTAG, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[11]), // GPIO0 (D11) + [1] = &(lt_arduino_pin_info_list[10]), // GPIO1 (D10) + [6] = &(lt_arduino_pin_info_list[2]), // GPIO6 (D2) + [7] = &(lt_arduino_pin_info_list[1]), // GPIO7 (D1) + [8] = &(lt_arduino_pin_info_list[0]), // GPIO8 (D0) + [9] = &(lt_arduino_pin_info_list[9]), // GPIO9 (D9) + [10] = &(lt_arduino_pin_info_list[4]), // GPIO10 (D4) + [11] = &(lt_arduino_pin_info_list[5]), // GPIO11 (D5) + [20] = &(lt_arduino_pin_info_list[8]), // GPIO20 (D8) + [21] = &(lt_arduino_pin_info_list[12]), // GPIO21 (D12) + [22] = &(lt_arduino_pin_info_list[13]), // GPIO22 (D13) + [23] = &(lt_arduino_pin_info_list[3]), // GPIO23 (D3) + [24] = &(lt_arduino_pin_info_list[6]), // GPIO24 (D6) + [26] = &(lt_arduino_pin_info_list[7]), // GPIO26 (D7) +}; +// clang-format on diff --git a/boards/variants/wb2s.h b/boards/variants/wb2s.h new file mode 100644 index 000000000..bb7db5893 --- /dev/null +++ b/boards/variants/wb2s.h @@ -0,0 +1,112 @@ +/* This file was auto-generated from wb2s.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 14 // Total GPIO count +#define NUM_DIGITAL_PINS 14 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 1 // ADC inputs +#define NUM_ANALOG_OUTPUTS 6 // PWM & DAC outputs +#define PINS_GPIO_MAX 26 // Last usable GPIO number + +// Wire Interfaces +// --------------- +#define PIN_WIRE1_SCL 20u // GPIO20 +#define PIN_WIRE1_SDA 21u // GPIO21 +#define PIN_WIRE2_SCL 0u // GPIO0 +#define PIN_WIRE2_SDA 1u // GPIO1 +#define PINS_WIRE1_SCL (pin_size_t[]){20u} +#define PINS_WIRE1_SDA (pin_size_t[]){21u} +#define PINS_WIRE2_SCL (pin_size_t[]){0u} +#define PINS_WIRE2_SDA (pin_size_t[]){1u} + +// Serial ports +// ------------ +#define PIN_SERIAL1_RX 10u // GPIO10 +#define PIN_SERIAL1_TX 11u // GPIO11 +#define PIN_SERIAL2_RX 1u // GPIO1 +#define PIN_SERIAL2_TX 0u // GPIO0 +#define PINS_SERIAL1_RX (pin_size_t[]){10u} +#define PINS_SERIAL1_TX (pin_size_t[]){11u} +#define PINS_SERIAL2_RX (pin_size_t[]){1u} +#define PINS_SERIAL2_TX (pin_size_t[]){0u} + +// Pin function macros +// ------------------- +#define PIN_ADC3 23u // GPIO23 +#define PIN_P0 0u // GPIO0 +#define PIN_P1 1u // GPIO1 +#define PIN_P6 6u // GPIO6 +#define PIN_P7 7u // GPIO7 +#define PIN_P8 8u // GPIO8 +#define PIN_P9 9u // GPIO9 +#define PIN_P10 10u // GPIO10 +#define PIN_P11 11u // GPIO11 +#define PIN_P20 20u // GPIO20 +#define PIN_P21 21u // GPIO21 +#define PIN_P22 22u // GPIO22 +#define PIN_P23 23u // GPIO23 +#define PIN_P24 24u // GPIO24 +#define PIN_P26 26u // GPIO26 +#define PIN_PWM0 6u // GPIO6 +#define PIN_PWM1 7u // GPIO7 +#define PIN_PWM2 8u // GPIO8 +#define PIN_PWM3 9u // GPIO9 +#define PIN_PWM4 24u // GPIO24 +#define PIN_PWM5 26u // GPIO26 +#define PIN_RX1 10u // GPIO10 +#define PIN_RX2 1u // GPIO1 +#define PIN_SCL1 20u // GPIO20 +#define PIN_SCL2 0u // GPIO0 +#define PIN_SDA1 21u // GPIO21 +#define PIN_SDA2 1u // GPIO1 +#define PIN_TX1 11u // GPIO11 +#define PIN_TX2 0u // GPIO0 + +// Port availability +// ----------------- +#define HAS_SERIAL1 1 +#define HAS_SERIAL2 1 +#define HAS_WIRE1 1 +#define HAS_WIRE2 1 +#define SERIAL_INTERFACES_COUNT 2 +#define WIRE_INTERFACES_COUNT 2 + +// Arduino pin names +// ----------------- +#define PIN_D0 8u // GPIO8 +#define PIN_D1 7u // GPIO7 +#define PIN_D2 6u // GPIO6 +#define PIN_D3 23u // GPIO23 +#define PIN_D4 10u // GPIO10 +#define PIN_D5 11u // GPIO11 +#define PIN_D6 24u // GPIO24 +#define PIN_D7 26u // GPIO26 +#define PIN_D8 20u // GPIO20 +#define PIN_D9 9u // GPIO9 +#define PIN_D10 1u // GPIO1 +#define PIN_D11 0u // GPIO0 +#define PIN_D12 21u // GPIO21 +#define PIN_D13 22u // GPIO22 +#define PIN_A0 23u // GPIO23 + +// Static pin names +// ---------------- +static const unsigned char A0 = PIN_A0; +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; +static const unsigned char D9 = PIN_D9; +static const unsigned char D10 = PIN_D10; +static const unsigned char D11 = PIN_D11; +static const unsigned char D12 = PIN_D12; +static const unsigned char D13 = PIN_D13; diff --git a/boards/variants/wb3l.c b/boards/variants/wb3l.c new file mode 100644 index 000000000..aad420e48 --- /dev/null +++ b/boards/variants/wb3l.c @@ -0,0 +1,63 @@ +/* This file was auto-generated from wb3l.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: P23, ADC3, TDO, FSO + {GPIO23, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_JTAG, PIN_NONE, 0}, + // D1: P14, SD_CLK, SCK + {GPIO14, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D2: P26, PWM5, IRDA + {GPIO26, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D3: P24, PWM4 + {GPIO24, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D4: P6, PWM0 + {GPIO6, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D5: P9, PWM3 + {GPIO9, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D6: P0, UART2_TX, I2C2_SCL + {GPIO0, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D7: P16, SD_D0, MOSI + {GPIO16, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D8: P8, PWM2 + {GPIO8, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D9: P7, PWM1 + {GPIO7, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D10: P10, UART1_RX + {GPIO10, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D11: P11, UART1_TX + {GPIO11, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D12: P22, TDI, FSI + {GPIO22, PIN_GPIO | PIN_IRQ | PIN_JTAG, PIN_NONE, 0}, + // D13: P21, I2C1_SDA, TMS, MCLK, ^FCS + {GPIO21, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_JTAG, PIN_NONE, 0}, + // D14: P20, I2C1_SCL, TCK, FSCK + {GPIO20, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_JTAG, PIN_NONE, 0}, + // D15: P1, UART2_RX, I2C2_SDA + {GPIO1, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[6]), // GPIO0 (D6) + [1] = &(lt_arduino_pin_info_list[15]), // GPIO1 (D15) + [6] = &(lt_arduino_pin_info_list[4]), // GPIO6 (D4) + [7] = &(lt_arduino_pin_info_list[9]), // GPIO7 (D9) + [8] = &(lt_arduino_pin_info_list[8]), // GPIO8 (D8) + [9] = &(lt_arduino_pin_info_list[5]), // GPIO9 (D5) + [10] = &(lt_arduino_pin_info_list[10]), // GPIO10 (D10) + [11] = &(lt_arduino_pin_info_list[11]), // GPIO11 (D11) + [14] = &(lt_arduino_pin_info_list[1]), // GPIO14 (D1) + [16] = &(lt_arduino_pin_info_list[7]), // GPIO16 (D7) + [20] = &(lt_arduino_pin_info_list[14]), // GPIO20 (D14) + [21] = &(lt_arduino_pin_info_list[13]), // GPIO21 (D13) + [22] = &(lt_arduino_pin_info_list[12]), // GPIO22 (D12) + [23] = &(lt_arduino_pin_info_list[0]), // GPIO23 (D0) + [24] = &(lt_arduino_pin_info_list[3]), // GPIO24 (D3) + [26] = &(lt_arduino_pin_info_list[2]), // GPIO26 (D2) +}; +// clang-format on diff --git a/boards/variants/wb3l.h b/boards/variants/wb3l.h new file mode 100644 index 000000000..f3c0b1acd --- /dev/null +++ b/boards/variants/wb3l.h @@ -0,0 +1,120 @@ +/* This file was auto-generated from wb3l.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 16 // Total GPIO count +#define NUM_DIGITAL_PINS 16 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 1 // ADC inputs +#define NUM_ANALOG_OUTPUTS 6 // PWM & DAC outputs +#define PINS_GPIO_MAX 26 // Last usable GPIO number + +// Wire Interfaces +// --------------- +#define PIN_WIRE1_SCL 20u // GPIO20 +#define PIN_WIRE1_SDA 21u // GPIO21 +#define PIN_WIRE2_SCL 0u // GPIO0 +#define PIN_WIRE2_SDA 1u // GPIO1 +#define PINS_WIRE1_SCL (pin_size_t[]){20u} +#define PINS_WIRE1_SDA (pin_size_t[]){21u} +#define PINS_WIRE2_SCL (pin_size_t[]){0u} +#define PINS_WIRE2_SDA (pin_size_t[]){1u} + +// Serial ports +// ------------ +#define PIN_SERIAL1_RX 10u // GPIO10 +#define PIN_SERIAL1_TX 11u // GPIO11 +#define PIN_SERIAL2_RX 1u // GPIO1 +#define PIN_SERIAL2_TX 0u // GPIO0 +#define PINS_SERIAL1_RX (pin_size_t[]){10u} +#define PINS_SERIAL1_TX (pin_size_t[]){11u} +#define PINS_SERIAL2_RX (pin_size_t[]){1u} +#define PINS_SERIAL2_TX (pin_size_t[]){0u} + +// Pin function macros +// ------------------- +#define PIN_ADC3 23u // GPIO23 +#define PIN_MOSI 16u // GPIO16 +#define PIN_P0 0u // GPIO0 +#define PIN_P1 1u // GPIO1 +#define PIN_P6 6u // GPIO6 +#define PIN_P7 7u // GPIO7 +#define PIN_P8 8u // GPIO8 +#define PIN_P9 9u // GPIO9 +#define PIN_P10 10u // GPIO10 +#define PIN_P11 11u // GPIO11 +#define PIN_P14 14u // GPIO14 +#define PIN_P16 16u // GPIO16 +#define PIN_P20 20u // GPIO20 +#define PIN_P21 21u // GPIO21 +#define PIN_P22 22u // GPIO22 +#define PIN_P23 23u // GPIO23 +#define PIN_P24 24u // GPIO24 +#define PIN_P26 26u // GPIO26 +#define PIN_PWM0 6u // GPIO6 +#define PIN_PWM1 7u // GPIO7 +#define PIN_PWM2 8u // GPIO8 +#define PIN_PWM3 9u // GPIO9 +#define PIN_PWM4 24u // GPIO24 +#define PIN_PWM5 26u // GPIO26 +#define PIN_RX1 10u // GPIO10 +#define PIN_RX2 1u // GPIO1 +#define PIN_SCK 14u // GPIO14 +#define PIN_SCL1 20u // GPIO20 +#define PIN_SCL2 0u // GPIO0 +#define PIN_SDA1 21u // GPIO21 +#define PIN_SDA2 1u // GPIO1 +#define PIN_TX1 11u // GPIO11 +#define PIN_TX2 0u // GPIO0 + +// Port availability +// ----------------- +#define HAS_SERIAL1 1 +#define HAS_SERIAL2 1 +#define HAS_WIRE1 1 +#define HAS_WIRE2 1 +#define SERIAL_INTERFACES_COUNT 2 +#define WIRE_INTERFACES_COUNT 2 + +// Arduino pin names +// ----------------- +#define PIN_D0 23u // GPIO23 +#define PIN_D1 14u // GPIO14 +#define PIN_D2 26u // GPIO26 +#define PIN_D3 24u // GPIO24 +#define PIN_D4 6u // GPIO6 +#define PIN_D5 9u // GPIO9 +#define PIN_D6 0u // GPIO0 +#define PIN_D7 16u // GPIO16 +#define PIN_D8 8u // GPIO8 +#define PIN_D9 7u // GPIO7 +#define PIN_D10 10u // GPIO10 +#define PIN_D11 11u // GPIO11 +#define PIN_D12 22u // GPIO22 +#define PIN_D13 21u // GPIO21 +#define PIN_D14 20u // GPIO20 +#define PIN_D15 1u // GPIO1 +#define PIN_A0 23u // GPIO23 + +// Static pin names +// ---------------- +static const unsigned char A0 = PIN_A0; +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; +static const unsigned char D9 = PIN_D9; +static const unsigned char D10 = PIN_D10; +static const unsigned char D11 = PIN_D11; +static const unsigned char D12 = PIN_D12; +static const unsigned char D13 = PIN_D13; +static const unsigned char D14 = PIN_D14; +static const unsigned char D15 = PIN_D15; diff --git a/boards/variants/wb3s.c b/boards/variants/wb3s.c new file mode 100644 index 000000000..98666976f --- /dev/null +++ b/boards/variants/wb3s.c @@ -0,0 +1,60 @@ +/* This file was auto-generated from wb3s.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: P23, ADC3, TDO, FSO + {GPIO23, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_JTAG, PIN_NONE, 0}, + // D1: P14, SD_CLK, SCK + {GPIO14, PIN_GPIO | PIN_IRQ | PIN_SPI, PIN_NONE, 0}, + // D2: P26, PWM5, IRDA + {GPIO26, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D3: P24, PWM4 + {GPIO24, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D4: P6, PWM0 + {GPIO6, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D5: P7, PWM1 + {GPIO7, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D6: P0, UART2_TX, I2C2_SCL + {GPIO0, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D7: P1, UART2_RX, I2C2_SDA + {GPIO1, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D8: P9, PWM3 + {GPIO9, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D9: P8, PWM2 + {GPIO8, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D10: P10, UART1_RX + {GPIO10, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D11: P11, UART1_TX + {GPIO11, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D12: P22, TDI, FSI + {GPIO22, PIN_GPIO | PIN_IRQ | PIN_JTAG, PIN_NONE, 0}, + // D13: P21, I2C1_SDA, TMS, MCLK, ^FCS + {GPIO21, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_JTAG, PIN_NONE, 0}, + // D14: P20, I2C1_SCL, TCK, FSCK + {GPIO20, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_JTAG, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[6]), // GPIO0 (D6) + [1] = &(lt_arduino_pin_info_list[7]), // GPIO1 (D7) + [6] = &(lt_arduino_pin_info_list[4]), // GPIO6 (D4) + [7] = &(lt_arduino_pin_info_list[5]), // GPIO7 (D5) + [8] = &(lt_arduino_pin_info_list[9]), // GPIO8 (D9) + [9] = &(lt_arduino_pin_info_list[8]), // GPIO9 (D8) + [10] = &(lt_arduino_pin_info_list[10]), // GPIO10 (D10) + [11] = &(lt_arduino_pin_info_list[11]), // GPIO11 (D11) + [14] = &(lt_arduino_pin_info_list[1]), // GPIO14 (D1) + [20] = &(lt_arduino_pin_info_list[14]), // GPIO20 (D14) + [21] = &(lt_arduino_pin_info_list[13]), // GPIO21 (D13) + [22] = &(lt_arduino_pin_info_list[12]), // GPIO22 (D12) + [23] = &(lt_arduino_pin_info_list[0]), // GPIO23 (D0) + [24] = &(lt_arduino_pin_info_list[3]), // GPIO24 (D3) + [26] = &(lt_arduino_pin_info_list[2]), // GPIO26 (D2) +}; +// clang-format on diff --git a/boards/variants/wb3s.h b/boards/variants/wb3s.h new file mode 100644 index 000000000..c7a2c320e --- /dev/null +++ b/boards/variants/wb3s.h @@ -0,0 +1,116 @@ +/* This file was auto-generated from wb3s.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 15 // Total GPIO count +#define NUM_DIGITAL_PINS 15 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 1 // ADC inputs +#define NUM_ANALOG_OUTPUTS 6 // PWM & DAC outputs +#define PINS_GPIO_MAX 26 // Last usable GPIO number + +// Wire Interfaces +// --------------- +#define PIN_WIRE1_SCL 20u // GPIO20 +#define PIN_WIRE1_SDA 21u // GPIO21 +#define PIN_WIRE2_SCL 0u // GPIO0 +#define PIN_WIRE2_SDA 1u // GPIO1 +#define PINS_WIRE1_SCL (pin_size_t[]){20u} +#define PINS_WIRE1_SDA (pin_size_t[]){21u} +#define PINS_WIRE2_SCL (pin_size_t[]){0u} +#define PINS_WIRE2_SDA (pin_size_t[]){1u} + +// Serial ports +// ------------ +#define PIN_SERIAL1_RX 10u // GPIO10 +#define PIN_SERIAL1_TX 11u // GPIO11 +#define PIN_SERIAL2_RX 1u // GPIO1 +#define PIN_SERIAL2_TX 0u // GPIO0 +#define PINS_SERIAL1_RX (pin_size_t[]){10u} +#define PINS_SERIAL1_TX (pin_size_t[]){11u} +#define PINS_SERIAL2_RX (pin_size_t[]){1u} +#define PINS_SERIAL2_TX (pin_size_t[]){0u} + +// Pin function macros +// ------------------- +#define PIN_ADC3 23u // GPIO23 +#define PIN_P0 0u // GPIO0 +#define PIN_P1 1u // GPIO1 +#define PIN_P6 6u // GPIO6 +#define PIN_P7 7u // GPIO7 +#define PIN_P8 8u // GPIO8 +#define PIN_P9 9u // GPIO9 +#define PIN_P10 10u // GPIO10 +#define PIN_P11 11u // GPIO11 +#define PIN_P14 14u // GPIO14 +#define PIN_P20 20u // GPIO20 +#define PIN_P21 21u // GPIO21 +#define PIN_P22 22u // GPIO22 +#define PIN_P23 23u // GPIO23 +#define PIN_P24 24u // GPIO24 +#define PIN_P26 26u // GPIO26 +#define PIN_PWM0 6u // GPIO6 +#define PIN_PWM1 7u // GPIO7 +#define PIN_PWM2 8u // GPIO8 +#define PIN_PWM3 9u // GPIO9 +#define PIN_PWM4 24u // GPIO24 +#define PIN_PWM5 26u // GPIO26 +#define PIN_RX1 10u // GPIO10 +#define PIN_RX2 1u // GPIO1 +#define PIN_SCK 14u // GPIO14 +#define PIN_SCL1 20u // GPIO20 +#define PIN_SCL2 0u // GPIO0 +#define PIN_SDA1 21u // GPIO21 +#define PIN_SDA2 1u // GPIO1 +#define PIN_TX1 11u // GPIO11 +#define PIN_TX2 0u // GPIO0 + +// Port availability +// ----------------- +#define HAS_SERIAL1 1 +#define HAS_SERIAL2 1 +#define HAS_WIRE1 1 +#define HAS_WIRE2 1 +#define SERIAL_INTERFACES_COUNT 2 +#define WIRE_INTERFACES_COUNT 2 + +// Arduino pin names +// ----------------- +#define PIN_D0 23u // GPIO23 +#define PIN_D1 14u // GPIO14 +#define PIN_D2 26u // GPIO26 +#define PIN_D3 24u // GPIO24 +#define PIN_D4 6u // GPIO6 +#define PIN_D5 7u // GPIO7 +#define PIN_D6 0u // GPIO0 +#define PIN_D7 1u // GPIO1 +#define PIN_D8 9u // GPIO9 +#define PIN_D9 8u // GPIO8 +#define PIN_D10 10u // GPIO10 +#define PIN_D11 11u // GPIO11 +#define PIN_D12 22u // GPIO22 +#define PIN_D13 21u // GPIO21 +#define PIN_D14 20u // GPIO20 +#define PIN_A0 23u // GPIO23 + +// Static pin names +// ---------------- +static const unsigned char A0 = PIN_A0; +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; +static const unsigned char D9 = PIN_D9; +static const unsigned char D10 = PIN_D10; +static const unsigned char D11 = PIN_D11; +static const unsigned char D12 = PIN_D12; +static const unsigned char D13 = PIN_D13; +static const unsigned char D14 = PIN_D14; diff --git a/boards/variants/wblc5.c b/boards/variants/wblc5.c new file mode 100644 index 000000000..4aa1d92c5 --- /dev/null +++ b/boards/variants/wblc5.c @@ -0,0 +1,48 @@ +/* This file was auto-generated from wblc5.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: P24, PWM4 + {GPIO24, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D1: P6, PWM0 + {GPIO6, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D2: P26, PWM5, IRDA + {GPIO26, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D3: P10, UART1_RX + {GPIO10, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D4: P11, UART1_TX + {GPIO11, PIN_GPIO | PIN_IRQ | PIN_UART, PIN_NONE, 0}, + // D5: P1, UART2_RX, I2C2_SDA + {GPIO1, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D6: P0, UART2_TX, I2C2_SCL + {GPIO0, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D7: P20, I2C1_SCL, TCK, FSCK + {GPIO20, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_JTAG, PIN_NONE, 0}, + // D8: P21, I2C1_SDA, TMS, MCLK, ^FCS + {GPIO21, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_JTAG, PIN_NONE, 0}, + // D9: P22, TDI, FSI + {GPIO22, PIN_GPIO | PIN_IRQ | PIN_JTAG, PIN_NONE, 0}, + // D10: P23, ADC3, TDO, FSO + {GPIO23, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_JTAG, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[6]), // GPIO0 (D6) + [1] = &(lt_arduino_pin_info_list[5]), // GPIO1 (D5) + [6] = &(lt_arduino_pin_info_list[1]), // GPIO6 (D1) + [10] = &(lt_arduino_pin_info_list[3]), // GPIO10 (D3) + [11] = &(lt_arduino_pin_info_list[4]), // GPIO11 (D4) + [20] = &(lt_arduino_pin_info_list[7]), // GPIO20 (D7) + [21] = &(lt_arduino_pin_info_list[8]), // GPIO21 (D8) + [22] = &(lt_arduino_pin_info_list[9]), // GPIO22 (D9) + [23] = &(lt_arduino_pin_info_list[10]), // GPIO23 (D10) + [24] = &(lt_arduino_pin_info_list[0]), // GPIO24 (D0) + [26] = &(lt_arduino_pin_info_list[2]), // GPIO26 (D2) +}; +// clang-format on diff --git a/boards/variants/wblc5.h b/boards/variants/wblc5.h new file mode 100644 index 000000000..02d25c00e --- /dev/null +++ b/boards/variants/wblc5.h @@ -0,0 +1,100 @@ +/* This file was auto-generated from wblc5.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 11 // Total GPIO count +#define NUM_DIGITAL_PINS 11 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 1 // ADC inputs +#define NUM_ANALOG_OUTPUTS 3 // PWM & DAC outputs +#define PINS_GPIO_MAX 26 // Last usable GPIO number + +// Wire Interfaces +// --------------- +#define PIN_WIRE1_SCL 20u // GPIO20 +#define PIN_WIRE1_SDA 21u // GPIO21 +#define PIN_WIRE2_SCL 0u // GPIO0 +#define PIN_WIRE2_SDA 1u // GPIO1 +#define PINS_WIRE1_SCL (pin_size_t[]){20u} +#define PINS_WIRE1_SDA (pin_size_t[]){21u} +#define PINS_WIRE2_SCL (pin_size_t[]){0u} +#define PINS_WIRE2_SDA (pin_size_t[]){1u} + +// Serial ports +// ------------ +#define PIN_SERIAL1_RX 10u // GPIO10 +#define PIN_SERIAL1_TX 11u // GPIO11 +#define PIN_SERIAL2_RX 1u // GPIO1 +#define PIN_SERIAL2_TX 0u // GPIO0 +#define PINS_SERIAL1_RX (pin_size_t[]){10u} +#define PINS_SERIAL1_TX (pin_size_t[]){11u} +#define PINS_SERIAL2_RX (pin_size_t[]){1u} +#define PINS_SERIAL2_TX (pin_size_t[]){0u} + +// Pin function macros +// ------------------- +#define PIN_ADC3 23u // GPIO23 +#define PIN_P0 0u // GPIO0 +#define PIN_P1 1u // GPIO1 +#define PIN_P6 6u // GPIO6 +#define PIN_P10 10u // GPIO10 +#define PIN_P11 11u // GPIO11 +#define PIN_P20 20u // GPIO20 +#define PIN_P21 21u // GPIO21 +#define PIN_P22 22u // GPIO22 +#define PIN_P23 23u // GPIO23 +#define PIN_P24 24u // GPIO24 +#define PIN_P26 26u // GPIO26 +#define PIN_PWM0 6u // GPIO6 +#define PIN_PWM4 24u // GPIO24 +#define PIN_PWM5 26u // GPIO26 +#define PIN_RX1 10u // GPIO10 +#define PIN_RX2 1u // GPIO1 +#define PIN_SCL1 20u // GPIO20 +#define PIN_SCL2 0u // GPIO0 +#define PIN_SDA1 21u // GPIO21 +#define PIN_SDA2 1u // GPIO1 +#define PIN_TX1 11u // GPIO11 +#define PIN_TX2 0u // GPIO0 + +// Port availability +// ----------------- +#define HAS_SERIAL1 1 +#define HAS_SERIAL2 1 +#define HAS_WIRE1 1 +#define HAS_WIRE2 1 +#define SERIAL_INTERFACES_COUNT 2 +#define WIRE_INTERFACES_COUNT 2 + +// Arduino pin names +// ----------------- +#define PIN_D0 24u // GPIO24 +#define PIN_D1 6u // GPIO6 +#define PIN_D2 26u // GPIO26 +#define PIN_D3 10u // GPIO10 +#define PIN_D4 11u // GPIO11 +#define PIN_D5 1u // GPIO1 +#define PIN_D6 0u // GPIO0 +#define PIN_D7 20u // GPIO20 +#define PIN_D8 21u // GPIO21 +#define PIN_D9 22u // GPIO22 +#define PIN_D10 23u // GPIO23 +#define PIN_A0 23u // GPIO23 + +// Static pin names +// ---------------- +static const unsigned char A0 = PIN_A0; +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; +static const unsigned char D9 = PIN_D9; +static const unsigned char D10 = PIN_D10; diff --git a/boards/variants/wr1.c b/boards/variants/wr1.c new file mode 100644 index 000000000..5e920bdfd --- /dev/null +++ b/boards/variants/wr1.c @@ -0,0 +1,48 @@ +/* This file was auto-generated from wr1.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: PA23, UART0_TX, SPI0_MOSI, SPI1_MOSI, I2C1_SDA, SD_D1, PWM0, WAKE3 + {PA_23, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D1: PA18, UART0_RX, SPI0_SCK, SPI1_SCK, I2C1_SCL, SD_D2, TMR4_TRIG, I2S0_MCK, WAKE0 + {PA_18, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D2: PA14, PWM0, SWCLK + {PA_14, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D3: PA15, PWM1, SWDIO + {PA_15, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D4: PA30, UART2_TX, I2C0_SDA, PWM4 + {PA_30, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D5: PA00, PWM2 + {PA_0, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D6: PA05, PWM4, WAKE1 + {PA_5, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D7: PA29, UART2_RX, I2C0_SCL, PWM4 + {PA_29, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D8: PA19, ADC1, UART0_CTS, SPI0_CS, SPI1_CS, I2C0_SDA, SD_D3, TMR5_TRIG, I2S0_TX + {PA_19, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D9: PA22, UART0_RTS, SPI0_MISO, SPI1_MISO, I2C0_SCL, SD_D0, PWM5, I2S0_WS, WAKE2 + {PA_22, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // A1: ADC2 + {AD_2, PIN_ADC, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[5]), // PA_0 (D5) + [5] = &(lt_arduino_pin_info_list[6]), // PA_5 (D6) + [14] = &(lt_arduino_pin_info_list[2]), // PA_14 (D2) + [15] = &(lt_arduino_pin_info_list[3]), // PA_15 (D3) + [18] = &(lt_arduino_pin_info_list[1]), // PA_18 (D1) + [19] = &(lt_arduino_pin_info_list[8]), // PA_19 (D8) + [22] = &(lt_arduino_pin_info_list[9]), // PA_22 (D9) + [23] = &(lt_arduino_pin_info_list[0]), // PA_23 (D0) + [29] = &(lt_arduino_pin_info_list[7]), // PA_29 (D7) + [30] = &(lt_arduino_pin_info_list[4]), // PA_30 (D4) + [41] = &(lt_arduino_pin_info_list[10]), // AD_2 (A1) +}; +// clang-format on diff --git a/boards/variants/wr1.h b/boards/variants/wr1.h new file mode 100644 index 000000000..8c2cd4cb8 --- /dev/null +++ b/boards/variants/wr1.h @@ -0,0 +1,137 @@ +/* This file was auto-generated from wr1.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 11 // Total GPIO count +#define NUM_DIGITAL_PINS 10 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 2 // ADC inputs +#define NUM_ANALOG_OUTPUTS 8 // PWM & DAC outputs +#define PINS_GPIO_MAX 41 // Last usable GPIO number + +// SPI Interfaces +// -------------- +#define PIN_SPI0_CS 19u // PA_19 +#define PIN_SPI0_MISO 22u // PA_22 +#define PIN_SPI0_MOSI 23u // PA_23 +#define PIN_SPI0_SCK 18u // PA_18 +#define PIN_SPI1_CS 19u // PA_19 +#define PIN_SPI1_MISO 22u // PA_22 +#define PIN_SPI1_MOSI 23u // PA_23 +#define PIN_SPI1_SCK 18u // PA_18 +#define PINS_SPI0_CS (pin_size_t[]){19u} +#define PINS_SPI0_MISO (pin_size_t[]){22u} +#define PINS_SPI0_MOSI (pin_size_t[]){23u} +#define PINS_SPI0_SCK (pin_size_t[]){18u} +#define PINS_SPI1_CS (pin_size_t[]){19u} +#define PINS_SPI1_MISO (pin_size_t[]){22u} +#define PINS_SPI1_MOSI (pin_size_t[]){23u} +#define PINS_SPI1_SCK (pin_size_t[]){18u} + +// Wire Interfaces +// --------------- +#define PIN_WIRE0_SCL_0 29u // PA_29 +#define PIN_WIRE0_SCL_1 22u // PA_22 +#define PIN_WIRE0_SDA_0 30u // PA_30 +#define PIN_WIRE0_SDA_1 19u // PA_19 +#define PIN_WIRE1_SCL 18u // PA_18 +#define PIN_WIRE1_SDA 23u // PA_23 +#define PINS_WIRE0_SCL (pin_size_t[]){29u, 22u} +#define PINS_WIRE0_SDA (pin_size_t[]){30u, 19u} +#define PINS_WIRE1_SCL (pin_size_t[]){18u} +#define PINS_WIRE1_SDA (pin_size_t[]){23u} + +// Serial ports +// ------------ +#define PIN_SERIAL0_CTS 19u // PA_19 +#define PIN_SERIAL0_RTS 22u // PA_22 +#define PIN_SERIAL0_RX 18u // PA_18 +#define PIN_SERIAL0_TX 23u // PA_23 +#define PIN_SERIAL2_RX 29u // PA_29 +#define PIN_SERIAL2_TX 30u // PA_30 +#define PINS_SERIAL0_CTS (pin_size_t[]){19u} +#define PINS_SERIAL0_RTS (pin_size_t[]){22u} +#define PINS_SERIAL0_RX (pin_size_t[]){18u} +#define PINS_SERIAL0_TX (pin_size_t[]){23u} +#define PINS_SERIAL2_RX (pin_size_t[]){29u} +#define PINS_SERIAL2_TX (pin_size_t[]){30u} + +// Pin function macros +// ------------------- +#define PIN_ADC1 19u // PA_19 +#define PIN_ADC2 41u // AD_2 +#define PIN_CS0 19u // PA_19 +#define PIN_CS1 19u // PA_19 +#define PIN_CTS0 19u // PA_19 +#define PIN_MISO0 22u // PA_22 +#define PIN_MISO1 22u // PA_22 +#define PIN_MOSI0 23u // PA_23 +#define PIN_MOSI1 23u // PA_23 +#define PIN_PA00 0u // PA_0 +#define PIN_PA05 5u // PA_5 +#define PIN_PA14 14u // PA_14 +#define PIN_PA15 15u // PA_15 +#define PIN_PA18 18u // PA_18 +#define PIN_PA19 19u // PA_19 +#define PIN_PA22 22u // PA_22 +#define PIN_PA23 23u // PA_23 +#define PIN_PA29 29u // PA_29 +#define PIN_PA30 30u // PA_30 +#define PIN_PWM1 15u // PA_15 +#define PIN_PWM2 0u // PA_0 +#define PIN_PWM4 29u // PA_29 +#define PIN_PWM5 22u // PA_22 +#define PIN_RTS0 22u // PA_22 +#define PIN_RX0 18u // PA_18 +#define PIN_RX2 29u // PA_29 +#define PIN_SCK0 18u // PA_18 +#define PIN_SCK1 18u // PA_18 +#define PIN_SCL1 18u // PA_18 +#define PIN_SDA1 23u // PA_23 +#define PIN_TX0 23u // PA_23 +#define PIN_TX2 30u // PA_30 + +// Port availability +// ----------------- +#define HAS_SERIAL0 1 +#define HAS_SERIAL2 1 +#define HAS_SPI0 1 +#define HAS_SPI1 1 +#define HAS_WIRE0 1 +#define HAS_WIRE1 1 +#define SERIAL_INTERFACES_COUNT 2 +#define SPI_INTERFACES_COUNT 2 +#define WIRE_INTERFACES_COUNT 2 + +// Arduino pin names +// ----------------- +#define PIN_D0 23u // PA_23 +#define PIN_D1 18u // PA_18 +#define PIN_D2 14u // PA_14 +#define PIN_D3 15u // PA_15 +#define PIN_D4 30u // PA_30 +#define PIN_D5 0u // PA_0 +#define PIN_D6 5u // PA_5 +#define PIN_D7 29u // PA_29 +#define PIN_D8 19u // PA_19 +#define PIN_D9 22u // PA_22 +#define PIN_A0 19u // PA_19 +#define PIN_A1 41u // AD_2 + +// Static pin names +// ---------------- +static const unsigned char A0 = PIN_A0; +static const unsigned char A1 = PIN_A1; +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; +static const unsigned char D9 = PIN_D9; diff --git a/boards/variants/wr1e.c b/boards/variants/wr1e.c new file mode 100644 index 000000000..0403623b7 --- /dev/null +++ b/boards/variants/wr1e.c @@ -0,0 +1,48 @@ +/* This file was auto-generated from wr1e.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: PA23, UART0_TX, SPI0_MOSI, SPI1_MOSI, I2C1_SDA, SD_D1, PWM0, WAKE3 + {PA_23, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D1: PA18, UART0_RX, SPI0_SCK, SPI1_SCK, I2C1_SCL, SD_D2, TMR4_TRIG, I2S0_MCK, WAKE0 + {PA_18, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D2: PA14, PWM0, SWCLK + {PA_14, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D3: PA15, PWM1, SWDIO + {PA_15, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D4: PA30, UART2_TX, I2C0_SDA, PWM4 + {PA_30, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D5: PA12, PWM3 + {PA_12, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D6: PA05, PWM4, WAKE1 + {PA_5, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D7: PA29, UART2_RX, I2C0_SCL, PWM4 + {PA_29, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D8: PA19, ADC1, UART0_CTS, SPI0_CS, SPI1_CS, I2C0_SDA, SD_D3, TMR5_TRIG, I2S0_TX + {PA_19, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D9: PA22, UART0_RTS, SPI0_MISO, SPI1_MISO, I2C0_SCL, SD_D0, PWM5, I2S0_WS, WAKE2 + {PA_22, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // A1: ADC2 + {AD_2, PIN_ADC, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [5] = &(lt_arduino_pin_info_list[6]), // PA_5 (D6) + [12] = &(lt_arduino_pin_info_list[5]), // PA_12 (D5) + [14] = &(lt_arduino_pin_info_list[2]), // PA_14 (D2) + [15] = &(lt_arduino_pin_info_list[3]), // PA_15 (D3) + [18] = &(lt_arduino_pin_info_list[1]), // PA_18 (D1) + [19] = &(lt_arduino_pin_info_list[8]), // PA_19 (D8) + [22] = &(lt_arduino_pin_info_list[9]), // PA_22 (D9) + [23] = &(lt_arduino_pin_info_list[0]), // PA_23 (D0) + [29] = &(lt_arduino_pin_info_list[7]), // PA_29 (D7) + [30] = &(lt_arduino_pin_info_list[4]), // PA_30 (D4) + [41] = &(lt_arduino_pin_info_list[10]), // AD_2 (A1) +}; +// clang-format on diff --git a/boards/variants/wr1e.h b/boards/variants/wr1e.h new file mode 100644 index 000000000..6d885f199 --- /dev/null +++ b/boards/variants/wr1e.h @@ -0,0 +1,137 @@ +/* This file was auto-generated from wr1e.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 11 // Total GPIO count +#define NUM_DIGITAL_PINS 10 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 2 // ADC inputs +#define NUM_ANALOG_OUTPUTS 8 // PWM & DAC outputs +#define PINS_GPIO_MAX 41 // Last usable GPIO number + +// SPI Interfaces +// -------------- +#define PIN_SPI0_CS 19u // PA_19 +#define PIN_SPI0_MISO 22u // PA_22 +#define PIN_SPI0_MOSI 23u // PA_23 +#define PIN_SPI0_SCK 18u // PA_18 +#define PIN_SPI1_CS 19u // PA_19 +#define PIN_SPI1_MISO 22u // PA_22 +#define PIN_SPI1_MOSI 23u // PA_23 +#define PIN_SPI1_SCK 18u // PA_18 +#define PINS_SPI0_CS (pin_size_t[]){19u} +#define PINS_SPI0_MISO (pin_size_t[]){22u} +#define PINS_SPI0_MOSI (pin_size_t[]){23u} +#define PINS_SPI0_SCK (pin_size_t[]){18u} +#define PINS_SPI1_CS (pin_size_t[]){19u} +#define PINS_SPI1_MISO (pin_size_t[]){22u} +#define PINS_SPI1_MOSI (pin_size_t[]){23u} +#define PINS_SPI1_SCK (pin_size_t[]){18u} + +// Wire Interfaces +// --------------- +#define PIN_WIRE0_SCL_0 29u // PA_29 +#define PIN_WIRE0_SCL_1 22u // PA_22 +#define PIN_WIRE0_SDA_0 30u // PA_30 +#define PIN_WIRE0_SDA_1 19u // PA_19 +#define PIN_WIRE1_SCL 18u // PA_18 +#define PIN_WIRE1_SDA 23u // PA_23 +#define PINS_WIRE0_SCL (pin_size_t[]){29u, 22u} +#define PINS_WIRE0_SDA (pin_size_t[]){30u, 19u} +#define PINS_WIRE1_SCL (pin_size_t[]){18u} +#define PINS_WIRE1_SDA (pin_size_t[]){23u} + +// Serial ports +// ------------ +#define PIN_SERIAL0_CTS 19u // PA_19 +#define PIN_SERIAL0_RTS 22u // PA_22 +#define PIN_SERIAL0_RX 18u // PA_18 +#define PIN_SERIAL0_TX 23u // PA_23 +#define PIN_SERIAL2_RX 29u // PA_29 +#define PIN_SERIAL2_TX 30u // PA_30 +#define PINS_SERIAL0_CTS (pin_size_t[]){19u} +#define PINS_SERIAL0_RTS (pin_size_t[]){22u} +#define PINS_SERIAL0_RX (pin_size_t[]){18u} +#define PINS_SERIAL0_TX (pin_size_t[]){23u} +#define PINS_SERIAL2_RX (pin_size_t[]){29u} +#define PINS_SERIAL2_TX (pin_size_t[]){30u} + +// Pin function macros +// ------------------- +#define PIN_ADC1 19u // PA_19 +#define PIN_ADC2 41u // AD_2 +#define PIN_CS0 19u // PA_19 +#define PIN_CS1 19u // PA_19 +#define PIN_CTS0 19u // PA_19 +#define PIN_MISO0 22u // PA_22 +#define PIN_MISO1 22u // PA_22 +#define PIN_MOSI0 23u // PA_23 +#define PIN_MOSI1 23u // PA_23 +#define PIN_PA05 5u // PA_5 +#define PIN_PA12 12u // PA_12 +#define PIN_PA14 14u // PA_14 +#define PIN_PA15 15u // PA_15 +#define PIN_PA18 18u // PA_18 +#define PIN_PA19 19u // PA_19 +#define PIN_PA22 22u // PA_22 +#define PIN_PA23 23u // PA_23 +#define PIN_PA29 29u // PA_29 +#define PIN_PA30 30u // PA_30 +#define PIN_PWM1 15u // PA_15 +#define PIN_PWM3 12u // PA_12 +#define PIN_PWM4 29u // PA_29 +#define PIN_PWM5 22u // PA_22 +#define PIN_RTS0 22u // PA_22 +#define PIN_RX0 18u // PA_18 +#define PIN_RX2 29u // PA_29 +#define PIN_SCK0 18u // PA_18 +#define PIN_SCK1 18u // PA_18 +#define PIN_SCL1 18u // PA_18 +#define PIN_SDA1 23u // PA_23 +#define PIN_TX0 23u // PA_23 +#define PIN_TX2 30u // PA_30 + +// Port availability +// ----------------- +#define HAS_SERIAL0 1 +#define HAS_SERIAL2 1 +#define HAS_SPI0 1 +#define HAS_SPI1 1 +#define HAS_WIRE0 1 +#define HAS_WIRE1 1 +#define SERIAL_INTERFACES_COUNT 2 +#define SPI_INTERFACES_COUNT 2 +#define WIRE_INTERFACES_COUNT 2 + +// Arduino pin names +// ----------------- +#define PIN_D0 23u // PA_23 +#define PIN_D1 18u // PA_18 +#define PIN_D2 14u // PA_14 +#define PIN_D3 15u // PA_15 +#define PIN_D4 30u // PA_30 +#define PIN_D5 12u // PA_12 +#define PIN_D6 5u // PA_5 +#define PIN_D7 29u // PA_29 +#define PIN_D8 19u // PA_19 +#define PIN_D9 22u // PA_22 +#define PIN_A0 19u // PA_19 +#define PIN_A1 41u // AD_2 + +// Static pin names +// ---------------- +static const unsigned char A0 = PIN_A0; +static const unsigned char A1 = PIN_A1; +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; +static const unsigned char D9 = PIN_D9; diff --git a/boards/variants/wr2.c b/boards/variants/wr2.c new file mode 100644 index 000000000..dd41428c9 --- /dev/null +++ b/boards/variants/wr2.c @@ -0,0 +1,45 @@ +/* This file was auto-generated from wr2.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: PA12, PWM3 + {PA_12, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D1: PA00, PWM2 + {PA_0, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D2: PA05, PWM4, WAKE1 + {PA_5, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D4: PA18, UART0_RX, SPI0_SCK, SPI1_SCK, I2C1_SCL, SD_D2, TMR4_TRIG, I2S0_MCK, WAKE0 + {PA_18, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D5: PA23, UART0_TX, SPI0_MOSI, SPI1_MOSI, I2C1_SDA, SD_D1, PWM0, WAKE3 + {PA_23, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D6: PA14, PWM0, SWCLK + {PA_14, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D7: PA15, PWM1, SWDIO + {PA_15, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D8: PA30, UART2_TX, I2C0_SDA, PWM4 + {PA_30, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D9: PA29, UART2_RX, I2C0_SCL, PWM4 + {PA_29, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // A1: ADC2 + {AD_2, PIN_ADC, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[1]), // PA_0 (D1) + [5] = &(lt_arduino_pin_info_list[2]), // PA_5 (D2) + [12] = &(lt_arduino_pin_info_list[0]), // PA_12 (D0) + [14] = &(lt_arduino_pin_info_list[5]), // PA_14 (D6) + [15] = &(lt_arduino_pin_info_list[6]), // PA_15 (D7) + [18] = &(lt_arduino_pin_info_list[3]), // PA_18 (D4) + [23] = &(lt_arduino_pin_info_list[4]), // PA_23 (D5) + [29] = &(lt_arduino_pin_info_list[8]), // PA_29 (D9) + [30] = &(lt_arduino_pin_info_list[7]), // PA_30 (D8) + [41] = &(lt_arduino_pin_info_list[9]), // AD_2 (A1) +}; +// clang-format on diff --git a/boards/variants/wr2.h b/boards/variants/wr2.h new file mode 100644 index 000000000..b80d862ae --- /dev/null +++ b/boards/variants/wr2.h @@ -0,0 +1,99 @@ +/* This file was auto-generated from wr2.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 10 // Total GPIO count +#define NUM_DIGITAL_PINS 9 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 1 // ADC inputs +#define NUM_ANALOG_OUTPUTS 8 // PWM & DAC outputs +#define PINS_GPIO_MAX 41 // Last usable GPIO number + +// Wire Interfaces +// --------------- +#define PIN_WIRE0_SCL 29u // PA_29 +#define PIN_WIRE0_SDA 30u // PA_30 +#define PIN_WIRE1_SCL 18u // PA_18 +#define PIN_WIRE1_SDA 23u // PA_23 +#define PINS_WIRE0_SCL (pin_size_t[]){29u} +#define PINS_WIRE0_SDA (pin_size_t[]){30u} +#define PINS_WIRE1_SCL (pin_size_t[]){18u} +#define PINS_WIRE1_SDA (pin_size_t[]){23u} + +// Serial ports +// ------------ +#define PIN_SERIAL0_RX 18u // PA_18 +#define PIN_SERIAL0_TX 23u // PA_23 +#define PIN_SERIAL2_RX 29u // PA_29 +#define PIN_SERIAL2_TX 30u // PA_30 +#define PINS_SERIAL0_RX (pin_size_t[]){18u} +#define PINS_SERIAL0_TX (pin_size_t[]){23u} +#define PINS_SERIAL2_RX (pin_size_t[]){29u} +#define PINS_SERIAL2_TX (pin_size_t[]){30u} + +// Pin function macros +// ------------------- +#define PIN_ADC2 41u // AD_2 +#define PIN_MOSI0 23u // PA_23 +#define PIN_MOSI1 23u // PA_23 +#define PIN_PA00 0u // PA_0 +#define PIN_PA05 5u // PA_5 +#define PIN_PA12 12u // PA_12 +#define PIN_PA14 14u // PA_14 +#define PIN_PA15 15u // PA_15 +#define PIN_PA18 18u // PA_18 +#define PIN_PA23 23u // PA_23 +#define PIN_PA29 29u // PA_29 +#define PIN_PA30 30u // PA_30 +#define PIN_PWM1 15u // PA_15 +#define PIN_PWM2 0u // PA_0 +#define PIN_PWM3 12u // PA_12 +#define PIN_PWM4 29u // PA_29 +#define PIN_RX0 18u // PA_18 +#define PIN_RX2 29u // PA_29 +#define PIN_SCK0 18u // PA_18 +#define PIN_SCK1 18u // PA_18 +#define PIN_SCL0 29u // PA_29 +#define PIN_SCL1 18u // PA_18 +#define PIN_SDA0 30u // PA_30 +#define PIN_SDA1 23u // PA_23 +#define PIN_TX0 23u // PA_23 +#define PIN_TX2 30u // PA_30 + +// Port availability +// ----------------- +#define HAS_SERIAL0 1 +#define HAS_SERIAL2 1 +#define HAS_WIRE0 1 +#define HAS_WIRE1 1 +#define SERIAL_INTERFACES_COUNT 2 +#define WIRE_INTERFACES_COUNT 2 + +// Arduino pin names +// ----------------- +#define PIN_D0 12u // PA_12 +#define PIN_D1 0u // PA_0 +#define PIN_D2 5u // PA_5 +#define PIN_D4 18u // PA_18 +#define PIN_D5 23u // PA_23 +#define PIN_D6 14u // PA_14 +#define PIN_D7 15u // PA_15 +#define PIN_D8 30u // PA_30 +#define PIN_D9 29u // PA_29 +#define PIN_A1 41u // AD_2 + +// Static pin names +// ---------------- +static const unsigned char A1 = PIN_A1; +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; +static const unsigned char D9 = PIN_D9; diff --git a/boards/variants/wr2e.c b/boards/variants/wr2e.c new file mode 100644 index 000000000..c75372933 --- /dev/null +++ b/boards/variants/wr2e.c @@ -0,0 +1,45 @@ +/* This file was auto-generated from wr2e.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: PA12, PWM3 + {PA_12, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D1: PA19, ADC1, UART0_CTS, SPI0_CS, SPI1_CS, I2C0_SDA, SD_D3, TMR5_TRIG, I2S0_TX + {PA_19, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D2: PA05, PWM4, WAKE1 + {PA_5, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D3: PA18, UART0_RX, SPI0_SCK, SPI1_SCK, I2C1_SCL, SD_D2, TMR4_TRIG, I2S0_MCK, WAKE0 + {PA_18, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D4: PA23, UART0_TX, SPI0_MOSI, SPI1_MOSI, I2C1_SDA, SD_D1, PWM0, WAKE3 + {PA_23, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D5: PA14, PWM0, SWCLK + {PA_14, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D6: PA15, PWM1, SWDIO + {PA_15, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D7: PA30, UART2_TX, I2C0_SDA, PWM4 + {PA_30, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D8: PA29, UART2_RX, I2C0_SCL, PWM4 + {PA_29, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // A1: ADC2 + {AD_2, PIN_ADC, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [5] = &(lt_arduino_pin_info_list[2]), // PA_5 (D2) + [12] = &(lt_arduino_pin_info_list[0]), // PA_12 (D0) + [14] = &(lt_arduino_pin_info_list[5]), // PA_14 (D5) + [15] = &(lt_arduino_pin_info_list[6]), // PA_15 (D6) + [18] = &(lt_arduino_pin_info_list[3]), // PA_18 (D3) + [19] = &(lt_arduino_pin_info_list[1]), // PA_19 (D1) + [23] = &(lt_arduino_pin_info_list[4]), // PA_23 (D4) + [29] = &(lt_arduino_pin_info_list[8]), // PA_29 (D8) + [30] = &(lt_arduino_pin_info_list[7]), // PA_30 (D7) + [41] = &(lt_arduino_pin_info_list[9]), // AD_2 (A1) +}; +// clang-format on diff --git a/boards/variants/wr2e.h b/boards/variants/wr2e.h new file mode 100644 index 000000000..f13cb1ab4 --- /dev/null +++ b/boards/variants/wr2e.h @@ -0,0 +1,106 @@ +/* This file was auto-generated from wr2e.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 10 // Total GPIO count +#define NUM_DIGITAL_PINS 9 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 2 // ADC inputs +#define NUM_ANALOG_OUTPUTS 7 // PWM & DAC outputs +#define PINS_GPIO_MAX 41 // Last usable GPIO number + +// Wire Interfaces +// --------------- +#define PIN_WIRE0_SCL 29u // PA_29 +#define PIN_WIRE0_SDA_0 19u // PA_19 +#define PIN_WIRE0_SDA_1 30u // PA_30 +#define PIN_WIRE1_SCL 18u // PA_18 +#define PIN_WIRE1_SDA 23u // PA_23 +#define PINS_WIRE0_SCL (pin_size_t[]){29u} +#define PINS_WIRE0_SDA (pin_size_t[]){19u, 30u} +#define PINS_WIRE1_SCL (pin_size_t[]){18u} +#define PINS_WIRE1_SDA (pin_size_t[]){23u} + +// Serial ports +// ------------ +#define PIN_SERIAL0_CTS 19u // PA_19 +#define PIN_SERIAL0_RX 18u // PA_18 +#define PIN_SERIAL0_TX 23u // PA_23 +#define PIN_SERIAL2_RX 29u // PA_29 +#define PIN_SERIAL2_TX 30u // PA_30 +#define PINS_SERIAL0_CTS (pin_size_t[]){19u} +#define PINS_SERIAL0_RX (pin_size_t[]){18u} +#define PINS_SERIAL0_TX (pin_size_t[]){23u} +#define PINS_SERIAL2_RX (pin_size_t[]){29u} +#define PINS_SERIAL2_TX (pin_size_t[]){30u} + +// Pin function macros +// ------------------- +#define PIN_ADC1 19u // PA_19 +#define PIN_ADC2 41u // AD_2 +#define PIN_CS0 19u // PA_19 +#define PIN_CS1 19u // PA_19 +#define PIN_CTS0 19u // PA_19 +#define PIN_MOSI0 23u // PA_23 +#define PIN_MOSI1 23u // PA_23 +#define PIN_PA05 5u // PA_5 +#define PIN_PA12 12u // PA_12 +#define PIN_PA14 14u // PA_14 +#define PIN_PA15 15u // PA_15 +#define PIN_PA18 18u // PA_18 +#define PIN_PA19 19u // PA_19 +#define PIN_PA23 23u // PA_23 +#define PIN_PA29 29u // PA_29 +#define PIN_PA30 30u // PA_30 +#define PIN_PWM1 15u // PA_15 +#define PIN_PWM3 12u // PA_12 +#define PIN_PWM4 29u // PA_29 +#define PIN_RX0 18u // PA_18 +#define PIN_RX2 29u // PA_29 +#define PIN_SCK0 18u // PA_18 +#define PIN_SCK1 18u // PA_18 +#define PIN_SCL0 29u // PA_29 +#define PIN_SCL1 18u // PA_18 +#define PIN_SDA1 23u // PA_23 +#define PIN_TX0 23u // PA_23 +#define PIN_TX2 30u // PA_30 + +// Port availability +// ----------------- +#define HAS_SERIAL0 1 +#define HAS_SERIAL2 1 +#define HAS_WIRE0 1 +#define HAS_WIRE1 1 +#define SERIAL_INTERFACES_COUNT 2 +#define WIRE_INTERFACES_COUNT 2 + +// Arduino pin names +// ----------------- +#define PIN_D0 12u // PA_12 +#define PIN_D1 19u // PA_19 +#define PIN_D2 5u // PA_5 +#define PIN_D3 18u // PA_18 +#define PIN_D4 23u // PA_23 +#define PIN_D5 14u // PA_14 +#define PIN_D6 15u // PA_15 +#define PIN_D7 30u // PA_30 +#define PIN_D8 29u // PA_29 +#define PIN_A0 19u // PA_19 +#define PIN_A1 41u // AD_2 + +// Static pin names +// ---------------- +static const unsigned char A0 = PIN_A0; +static const unsigned char A1 = PIN_A1; +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; diff --git a/boards/variants/wr2l.c b/boards/variants/wr2l.c new file mode 100644 index 000000000..250ab3493 --- /dev/null +++ b/boards/variants/wr2l.c @@ -0,0 +1,30 @@ +/* This file was auto-generated from wr2l.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: PA15, PWM1, SWDIO + {PA_15, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D1: PA14, PWM0, SWCLK + {PA_14, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D2: PA05, PWM4, WAKE1 + {PA_5, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D3: PA19, ADC1, UART0_CTS, SPI0_CS, SPI1_CS, I2C0_SDA, SD_D3, TMR5_TRIG, I2S0_TX + {PA_19, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D4: PA12, PWM3 + {PA_12, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [5] = &(lt_arduino_pin_info_list[2]), // PA_5 (D2) + [12] = &(lt_arduino_pin_info_list[4]), // PA_12 (D4) + [14] = &(lt_arduino_pin_info_list[1]), // PA_14 (D1) + [15] = &(lt_arduino_pin_info_list[0]), // PA_15 (D0) + [19] = &(lt_arduino_pin_info_list[3]), // PA_19 (D3) +}; +// clang-format on diff --git a/boards/variants/wr2l.h b/boards/variants/wr2l.h new file mode 100644 index 000000000..70feccdf9 --- /dev/null +++ b/boards/variants/wr2l.h @@ -0,0 +1,48 @@ +/* This file was auto-generated from wr2l.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 5 // Total GPIO count +#define NUM_DIGITAL_PINS 5 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 1 // ADC inputs +#define NUM_ANALOG_OUTPUTS 4 // PWM & DAC outputs +#define PINS_GPIO_MAX 19 // Last usable GPIO number + +// Pin function macros +// ------------------- +#define PIN_ADC1 19u // PA_19 +#define PIN_CS0 19u // PA_19 +#define PIN_CS1 19u // PA_19 +#define PIN_CTS0 19u // PA_19 +#define PIN_PA05 5u // PA_5 +#define PIN_PA12 12u // PA_12 +#define PIN_PA14 14u // PA_14 +#define PIN_PA15 15u // PA_15 +#define PIN_PA19 19u // PA_19 +#define PIN_PWM0 14u // PA_14 +#define PIN_PWM1 15u // PA_15 +#define PIN_PWM3 12u // PA_12 +#define PIN_PWM4 5u // PA_5 +#define PIN_SDA0 19u // PA_19 + +// Arduino pin names +// ----------------- +#define PIN_D0 15u // PA_15 +#define PIN_D1 14u // PA_14 +#define PIN_D2 5u // PA_5 +#define PIN_D3 19u // PA_19 +#define PIN_D4 12u // PA_12 +#define PIN_A0 19u // PA_19 + +// Static pin names +// ---------------- +static const unsigned char A0 = PIN_A0; +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; diff --git a/boards/variants/wr2le.c b/boards/variants/wr2le.c new file mode 100644 index 000000000..00570cffd --- /dev/null +++ b/boards/variants/wr2le.c @@ -0,0 +1,30 @@ +/* This file was auto-generated from wr2le.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: PA15, PWM1, SWDIO + {PA_15, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D1: PA14, PWM0, SWCLK + {PA_14, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D2: PA05, PWM4, WAKE1 + {PA_5, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D3: PA22, UART0_RTS, SPI0_MISO, SPI1_MISO, I2C0_SCL, SD_D0, PWM5, I2S0_WS, WAKE2 + {PA_22, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D4: PA12, PWM3 + {PA_12, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [5] = &(lt_arduino_pin_info_list[2]), // PA_5 (D2) + [12] = &(lt_arduino_pin_info_list[4]), // PA_12 (D4) + [14] = &(lt_arduino_pin_info_list[1]), // PA_14 (D1) + [15] = &(lt_arduino_pin_info_list[0]), // PA_15 (D0) + [22] = &(lt_arduino_pin_info_list[3]), // PA_22 (D3) +}; +// clang-format on diff --git a/boards/variants/wr2le.h b/boards/variants/wr2le.h new file mode 100644 index 000000000..5ac549c5c --- /dev/null +++ b/boards/variants/wr2le.h @@ -0,0 +1,46 @@ +/* This file was auto-generated from wr2le.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 5 // Total GPIO count +#define NUM_DIGITAL_PINS 5 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 0 // ADC inputs +#define NUM_ANALOG_OUTPUTS 5 // PWM & DAC outputs +#define PINS_GPIO_MAX 22 // Last usable GPIO number + +// Pin function macros +// ------------------- +#define PIN_MISO0 22u // PA_22 +#define PIN_MISO1 22u // PA_22 +#define PIN_PA05 5u // PA_5 +#define PIN_PA12 12u // PA_12 +#define PIN_PA14 14u // PA_14 +#define PIN_PA15 15u // PA_15 +#define PIN_PA22 22u // PA_22 +#define PIN_PWM0 14u // PA_14 +#define PIN_PWM1 15u // PA_15 +#define PIN_PWM3 12u // PA_12 +#define PIN_PWM4 5u // PA_5 +#define PIN_PWM5 22u // PA_22 +#define PIN_RTS0 22u // PA_22 +#define PIN_SCL0 22u // PA_22 + +// Arduino pin names +// ----------------- +#define PIN_D0 15u // PA_15 +#define PIN_D1 14u // PA_14 +#define PIN_D2 5u // PA_5 +#define PIN_D3 22u // PA_22 +#define PIN_D4 12u // PA_12 + +// Static pin names +// ---------------- +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; diff --git a/boards/variants/wr3.c b/boards/variants/wr3.c new file mode 100644 index 000000000..abdd1288c --- /dev/null +++ b/boards/variants/wr3.c @@ -0,0 +1,51 @@ +/* This file was auto-generated from wr3.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: PA22, UART0_RTS, SPI0_MISO, SPI1_MISO, I2C0_SCL, SD_D0, PWM5, I2S0_WS, WAKE2 + {PA_22, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D1: PA19, ADC1, UART0_CTS, SPI0_CS, SPI1_CS, I2C0_SDA, SD_D3, TMR5_TRIG, I2S0_TX + {PA_19, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D2: PA14, PWM0, SWCLK + {PA_14, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D3: PA15, PWM1, SWDIO + {PA_15, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D4: PA00, PWM2 + {PA_0, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D5: PA29, UART2_RX, I2C0_SCL, PWM4 + {PA_29, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D6: PA30, UART2_TX, I2C0_SDA, PWM4 + {PA_30, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D7: PA05, PWM4, WAKE1 + {PA_5, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D8: PA12, PWM3 + {PA_12, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D9: PA18, UART0_RX, SPI0_SCK, SPI1_SCK, I2C1_SCL, SD_D2, TMR4_TRIG, I2S0_MCK, WAKE0 + {PA_18, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D10: PA23, UART0_TX, SPI0_MOSI, SPI1_MOSI, I2C1_SDA, SD_D1, PWM0, WAKE3 + {PA_23, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // A1: ADC2 + {AD_2, PIN_ADC, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[4]), // PA_0 (D4) + [5] = &(lt_arduino_pin_info_list[7]), // PA_5 (D7) + [12] = &(lt_arduino_pin_info_list[8]), // PA_12 (D8) + [14] = &(lt_arduino_pin_info_list[2]), // PA_14 (D2) + [15] = &(lt_arduino_pin_info_list[3]), // PA_15 (D3) + [18] = &(lt_arduino_pin_info_list[9]), // PA_18 (D9) + [19] = &(lt_arduino_pin_info_list[1]), // PA_19 (D1) + [22] = &(lt_arduino_pin_info_list[0]), // PA_22 (D0) + [23] = &(lt_arduino_pin_info_list[10]), // PA_23 (D10) + [29] = &(lt_arduino_pin_info_list[5]), // PA_29 (D5) + [30] = &(lt_arduino_pin_info_list[6]), // PA_30 (D6) + [41] = &(lt_arduino_pin_info_list[11]), // AD_2 (A1) +}; +// clang-format on diff --git a/boards/variants/wr3.h b/boards/variants/wr3.h new file mode 100644 index 000000000..df456a7d9 --- /dev/null +++ b/boards/variants/wr3.h @@ -0,0 +1,141 @@ +/* This file was auto-generated from wr3.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 12 // Total GPIO count +#define NUM_DIGITAL_PINS 11 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 2 // ADC inputs +#define NUM_ANALOG_OUTPUTS 9 // PWM & DAC outputs +#define PINS_GPIO_MAX 41 // Last usable GPIO number + +// SPI Interfaces +// -------------- +#define PIN_SPI0_CS 19u // PA_19 +#define PIN_SPI0_MISO 22u // PA_22 +#define PIN_SPI0_MOSI 23u // PA_23 +#define PIN_SPI0_SCK 18u // PA_18 +#define PIN_SPI1_CS 19u // PA_19 +#define PIN_SPI1_MISO 22u // PA_22 +#define PIN_SPI1_MOSI 23u // PA_23 +#define PIN_SPI1_SCK 18u // PA_18 +#define PINS_SPI0_CS (pin_size_t[]){19u} +#define PINS_SPI0_MISO (pin_size_t[]){22u} +#define PINS_SPI0_MOSI (pin_size_t[]){23u} +#define PINS_SPI0_SCK (pin_size_t[]){18u} +#define PINS_SPI1_CS (pin_size_t[]){19u} +#define PINS_SPI1_MISO (pin_size_t[]){22u} +#define PINS_SPI1_MOSI (pin_size_t[]){23u} +#define PINS_SPI1_SCK (pin_size_t[]){18u} + +// Wire Interfaces +// --------------- +#define PIN_WIRE0_SCL_0 22u // PA_22 +#define PIN_WIRE0_SCL_1 29u // PA_29 +#define PIN_WIRE0_SDA_0 19u // PA_19 +#define PIN_WIRE0_SDA_1 30u // PA_30 +#define PIN_WIRE1_SCL 18u // PA_18 +#define PIN_WIRE1_SDA 23u // PA_23 +#define PINS_WIRE0_SCL (pin_size_t[]){22u, 29u} +#define PINS_WIRE0_SDA (pin_size_t[]){19u, 30u} +#define PINS_WIRE1_SCL (pin_size_t[]){18u} +#define PINS_WIRE1_SDA (pin_size_t[]){23u} + +// Serial ports +// ------------ +#define PIN_SERIAL0_CTS 19u // PA_19 +#define PIN_SERIAL0_RTS 22u // PA_22 +#define PIN_SERIAL0_RX 18u // PA_18 +#define PIN_SERIAL0_TX 23u // PA_23 +#define PIN_SERIAL2_RX 29u // PA_29 +#define PIN_SERIAL2_TX 30u // PA_30 +#define PINS_SERIAL0_CTS (pin_size_t[]){19u} +#define PINS_SERIAL0_RTS (pin_size_t[]){22u} +#define PINS_SERIAL0_RX (pin_size_t[]){18u} +#define PINS_SERIAL0_TX (pin_size_t[]){23u} +#define PINS_SERIAL2_RX (pin_size_t[]){29u} +#define PINS_SERIAL2_TX (pin_size_t[]){30u} + +// Pin function macros +// ------------------- +#define PIN_ADC1 19u // PA_19 +#define PIN_ADC2 41u // AD_2 +#define PIN_CS0 19u // PA_19 +#define PIN_CS1 19u // PA_19 +#define PIN_CTS0 19u // PA_19 +#define PIN_MISO0 22u // PA_22 +#define PIN_MISO1 22u // PA_22 +#define PIN_MOSI0 23u // PA_23 +#define PIN_MOSI1 23u // PA_23 +#define PIN_PA00 0u // PA_0 +#define PIN_PA05 5u // PA_5 +#define PIN_PA12 12u // PA_12 +#define PIN_PA14 14u // PA_14 +#define PIN_PA15 15u // PA_15 +#define PIN_PA18 18u // PA_18 +#define PIN_PA19 19u // PA_19 +#define PIN_PA22 22u // PA_22 +#define PIN_PA23 23u // PA_23 +#define PIN_PA29 29u // PA_29 +#define PIN_PA30 30u // PA_30 +#define PIN_PWM1 15u // PA_15 +#define PIN_PWM2 0u // PA_0 +#define PIN_PWM3 12u // PA_12 +#define PIN_PWM4 5u // PA_5 +#define PIN_PWM5 22u // PA_22 +#define PIN_RTS0 22u // PA_22 +#define PIN_RX0 18u // PA_18 +#define PIN_RX2 29u // PA_29 +#define PIN_SCK0 18u // PA_18 +#define PIN_SCK1 18u // PA_18 +#define PIN_SCL1 18u // PA_18 +#define PIN_SDA1 23u // PA_23 +#define PIN_TX0 23u // PA_23 +#define PIN_TX2 30u // PA_30 + +// Port availability +// ----------------- +#define HAS_SERIAL0 1 +#define HAS_SERIAL2 1 +#define HAS_SPI0 1 +#define HAS_SPI1 1 +#define HAS_WIRE0 1 +#define HAS_WIRE1 1 +#define SERIAL_INTERFACES_COUNT 2 +#define SPI_INTERFACES_COUNT 2 +#define WIRE_INTERFACES_COUNT 2 + +// Arduino pin names +// ----------------- +#define PIN_D0 22u // PA_22 +#define PIN_D1 19u // PA_19 +#define PIN_D2 14u // PA_14 +#define PIN_D3 15u // PA_15 +#define PIN_D4 0u // PA_0 +#define PIN_D5 29u // PA_29 +#define PIN_D6 30u // PA_30 +#define PIN_D7 5u // PA_5 +#define PIN_D8 12u // PA_12 +#define PIN_D9 18u // PA_18 +#define PIN_D10 23u // PA_23 +#define PIN_A0 19u // PA_19 +#define PIN_A1 41u // AD_2 + +// Static pin names +// ---------------- +static const unsigned char A0 = PIN_A0; +static const unsigned char A1 = PIN_A1; +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; +static const unsigned char D9 = PIN_D9; +static const unsigned char D10 = PIN_D10; diff --git a/boards/variants/wr3e.c b/boards/variants/wr3e.c new file mode 100644 index 000000000..e47c10c57 --- /dev/null +++ b/boards/variants/wr3e.c @@ -0,0 +1,51 @@ +/* This file was auto-generated from wr3e.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: PA29, UART2_RX, I2C0_SCL, PWM4 + {PA_29, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D1: PA14, PWM0, SWCLK + {PA_14, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D2: PA15, PWM1, SWDIO + {PA_15, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D3: PA22, UART0_RTS, SPI0_MISO, SPI1_MISO, I2C0_SCL, SD_D0, PWM5, I2S0_WS, WAKE2 + {PA_22, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D4: PA00, PWM2 + {PA_0, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D5: PA30, UART2_TX, I2C0_SDA, PWM4 + {PA_30, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D6: PA19, ADC1, UART0_CTS, SPI0_CS, SPI1_CS, I2C0_SDA, SD_D3, TMR5_TRIG, I2S0_TX + {PA_19, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D7: PA05, PWM4, WAKE1 + {PA_5, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D8: PA12, PWM3 + {PA_12, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D9: PA18, UART0_RX, SPI0_SCK, SPI1_SCK, I2C1_SCL, SD_D2, TMR4_TRIG, I2S0_MCK, WAKE0 + {PA_18, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D10: PA23, UART0_TX, SPI0_MOSI, SPI1_MOSI, I2C1_SDA, SD_D1, PWM0, WAKE3 + {PA_23, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // A1: ADC2 + {AD_2, PIN_ADC, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[4]), // PA_0 (D4) + [5] = &(lt_arduino_pin_info_list[7]), // PA_5 (D7) + [12] = &(lt_arduino_pin_info_list[8]), // PA_12 (D8) + [14] = &(lt_arduino_pin_info_list[1]), // PA_14 (D1) + [15] = &(lt_arduino_pin_info_list[2]), // PA_15 (D2) + [18] = &(lt_arduino_pin_info_list[9]), // PA_18 (D9) + [19] = &(lt_arduino_pin_info_list[6]), // PA_19 (D6) + [22] = &(lt_arduino_pin_info_list[3]), // PA_22 (D3) + [23] = &(lt_arduino_pin_info_list[10]), // PA_23 (D10) + [29] = &(lt_arduino_pin_info_list[0]), // PA_29 (D0) + [30] = &(lt_arduino_pin_info_list[5]), // PA_30 (D5) + [41] = &(lt_arduino_pin_info_list[11]), // AD_2 (A1) +}; +// clang-format on diff --git a/boards/variants/wr3e.h b/boards/variants/wr3e.h new file mode 100644 index 000000000..38269d3f8 --- /dev/null +++ b/boards/variants/wr3e.h @@ -0,0 +1,141 @@ +/* This file was auto-generated from wr3e.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 12 // Total GPIO count +#define NUM_DIGITAL_PINS 11 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 2 // ADC inputs +#define NUM_ANALOG_OUTPUTS 9 // PWM & DAC outputs +#define PINS_GPIO_MAX 41 // Last usable GPIO number + +// SPI Interfaces +// -------------- +#define PIN_SPI0_CS 19u // PA_19 +#define PIN_SPI0_MISO 22u // PA_22 +#define PIN_SPI0_MOSI 23u // PA_23 +#define PIN_SPI0_SCK 18u // PA_18 +#define PIN_SPI1_CS 19u // PA_19 +#define PIN_SPI1_MISO 22u // PA_22 +#define PIN_SPI1_MOSI 23u // PA_23 +#define PIN_SPI1_SCK 18u // PA_18 +#define PINS_SPI0_CS (pin_size_t[]){19u} +#define PINS_SPI0_MISO (pin_size_t[]){22u} +#define PINS_SPI0_MOSI (pin_size_t[]){23u} +#define PINS_SPI0_SCK (pin_size_t[]){18u} +#define PINS_SPI1_CS (pin_size_t[]){19u} +#define PINS_SPI1_MISO (pin_size_t[]){22u} +#define PINS_SPI1_MOSI (pin_size_t[]){23u} +#define PINS_SPI1_SCK (pin_size_t[]){18u} + +// Wire Interfaces +// --------------- +#define PIN_WIRE0_SCL_0 29u // PA_29 +#define PIN_WIRE0_SCL_1 22u // PA_22 +#define PIN_WIRE0_SDA_0 30u // PA_30 +#define PIN_WIRE0_SDA_1 19u // PA_19 +#define PIN_WIRE1_SCL 18u // PA_18 +#define PIN_WIRE1_SDA 23u // PA_23 +#define PINS_WIRE0_SCL (pin_size_t[]){29u, 22u} +#define PINS_WIRE0_SDA (pin_size_t[]){30u, 19u} +#define PINS_WIRE1_SCL (pin_size_t[]){18u} +#define PINS_WIRE1_SDA (pin_size_t[]){23u} + +// Serial ports +// ------------ +#define PIN_SERIAL0_CTS 19u // PA_19 +#define PIN_SERIAL0_RTS 22u // PA_22 +#define PIN_SERIAL0_RX 18u // PA_18 +#define PIN_SERIAL0_TX 23u // PA_23 +#define PIN_SERIAL2_RX 29u // PA_29 +#define PIN_SERIAL2_TX 30u // PA_30 +#define PINS_SERIAL0_CTS (pin_size_t[]){19u} +#define PINS_SERIAL0_RTS (pin_size_t[]){22u} +#define PINS_SERIAL0_RX (pin_size_t[]){18u} +#define PINS_SERIAL0_TX (pin_size_t[]){23u} +#define PINS_SERIAL2_RX (pin_size_t[]){29u} +#define PINS_SERIAL2_TX (pin_size_t[]){30u} + +// Pin function macros +// ------------------- +#define PIN_ADC1 19u // PA_19 +#define PIN_ADC2 41u // AD_2 +#define PIN_CS0 19u // PA_19 +#define PIN_CS1 19u // PA_19 +#define PIN_CTS0 19u // PA_19 +#define PIN_MISO0 22u // PA_22 +#define PIN_MISO1 22u // PA_22 +#define PIN_MOSI0 23u // PA_23 +#define PIN_MOSI1 23u // PA_23 +#define PIN_PA00 0u // PA_0 +#define PIN_PA05 5u // PA_5 +#define PIN_PA12 12u // PA_12 +#define PIN_PA14 14u // PA_14 +#define PIN_PA15 15u // PA_15 +#define PIN_PA18 18u // PA_18 +#define PIN_PA19 19u // PA_19 +#define PIN_PA22 22u // PA_22 +#define PIN_PA23 23u // PA_23 +#define PIN_PA29 29u // PA_29 +#define PIN_PA30 30u // PA_30 +#define PIN_PWM1 15u // PA_15 +#define PIN_PWM2 0u // PA_0 +#define PIN_PWM3 12u // PA_12 +#define PIN_PWM4 5u // PA_5 +#define PIN_PWM5 22u // PA_22 +#define PIN_RTS0 22u // PA_22 +#define PIN_RX0 18u // PA_18 +#define PIN_RX2 29u // PA_29 +#define PIN_SCK0 18u // PA_18 +#define PIN_SCK1 18u // PA_18 +#define PIN_SCL1 18u // PA_18 +#define PIN_SDA1 23u // PA_23 +#define PIN_TX0 23u // PA_23 +#define PIN_TX2 30u // PA_30 + +// Port availability +// ----------------- +#define HAS_SERIAL0 1 +#define HAS_SERIAL2 1 +#define HAS_SPI0 1 +#define HAS_SPI1 1 +#define HAS_WIRE0 1 +#define HAS_WIRE1 1 +#define SERIAL_INTERFACES_COUNT 2 +#define SPI_INTERFACES_COUNT 2 +#define WIRE_INTERFACES_COUNT 2 + +// Arduino pin names +// ----------------- +#define PIN_D0 29u // PA_29 +#define PIN_D1 14u // PA_14 +#define PIN_D2 15u // PA_15 +#define PIN_D3 22u // PA_22 +#define PIN_D4 0u // PA_0 +#define PIN_D5 30u // PA_30 +#define PIN_D6 19u // PA_19 +#define PIN_D7 5u // PA_5 +#define PIN_D8 12u // PA_12 +#define PIN_D9 18u // PA_18 +#define PIN_D10 23u // PA_23 +#define PIN_A0 19u // PA_19 +#define PIN_A1 41u // AD_2 + +// Static pin names +// ---------------- +static const unsigned char A0 = PIN_A0; +static const unsigned char A1 = PIN_A1; +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; +static const unsigned char D9 = PIN_D9; +static const unsigned char D10 = PIN_D10; diff --git a/boards/variants/wr3l.c b/boards/variants/wr3l.c new file mode 100644 index 000000000..8261af786 --- /dev/null +++ b/boards/variants/wr3l.c @@ -0,0 +1,51 @@ +/* This file was auto-generated from wr3l.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: PA22, UART0_RTS, SPI0_MISO, SPI1_MISO, I2C0_SCL, SD_D0, PWM5, I2S0_WS, WAKE2 + {PA_22, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D1: PA19, ADC1, UART0_CTS, SPI0_CS, SPI1_CS, I2C0_SDA, SD_D3, TMR5_TRIG, I2S0_TX + {PA_19, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D2: PA14, PWM0, SWCLK + {PA_14, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D3: PA15, PWM1, SWDIO + {PA_15, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D4: PA00, PWM2 + {PA_0, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D5: PA29, UART2_RX, I2C0_SCL, PWM4 + {PA_29, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D6: PA30, UART2_TX, I2C0_SDA, PWM4 + {PA_30, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D7: PA05, PWM4, WAKE1 + {PA_5, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D8: PA12, PWM3 + {PA_12, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D9: PA18, UART0_RX, SPI0_SCK, SPI1_SCK, I2C1_SCL, SD_D2, TMR4_TRIG, I2S0_MCK, WAKE0 + {PA_18, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D10: PA23, UART0_TX, SPI0_MOSI, SPI1_MOSI, I2C1_SDA, SD_D1, PWM0, WAKE3 + {PA_23, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // A1: ADC2 + {AD_2, PIN_ADC, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[4]), // PA_0 (D4) + [5] = &(lt_arduino_pin_info_list[7]), // PA_5 (D7) + [12] = &(lt_arduino_pin_info_list[8]), // PA_12 (D8) + [14] = &(lt_arduino_pin_info_list[2]), // PA_14 (D2) + [15] = &(lt_arduino_pin_info_list[3]), // PA_15 (D3) + [18] = &(lt_arduino_pin_info_list[9]), // PA_18 (D9) + [19] = &(lt_arduino_pin_info_list[1]), // PA_19 (D1) + [22] = &(lt_arduino_pin_info_list[0]), // PA_22 (D0) + [23] = &(lt_arduino_pin_info_list[10]), // PA_23 (D10) + [29] = &(lt_arduino_pin_info_list[5]), // PA_29 (D5) + [30] = &(lt_arduino_pin_info_list[6]), // PA_30 (D6) + [41] = &(lt_arduino_pin_info_list[11]), // AD_2 (A1) +}; +// clang-format on diff --git a/boards/variants/wr3l.h b/boards/variants/wr3l.h new file mode 100644 index 000000000..0a10156a9 --- /dev/null +++ b/boards/variants/wr3l.h @@ -0,0 +1,141 @@ +/* This file was auto-generated from wr3l.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 12 // Total GPIO count +#define NUM_DIGITAL_PINS 11 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 2 // ADC inputs +#define NUM_ANALOG_OUTPUTS 9 // PWM & DAC outputs +#define PINS_GPIO_MAX 41 // Last usable GPIO number + +// SPI Interfaces +// -------------- +#define PIN_SPI0_CS 19u // PA_19 +#define PIN_SPI0_MISO 22u // PA_22 +#define PIN_SPI0_MOSI 23u // PA_23 +#define PIN_SPI0_SCK 18u // PA_18 +#define PIN_SPI1_CS 19u // PA_19 +#define PIN_SPI1_MISO 22u // PA_22 +#define PIN_SPI1_MOSI 23u // PA_23 +#define PIN_SPI1_SCK 18u // PA_18 +#define PINS_SPI0_CS (pin_size_t[]){19u} +#define PINS_SPI0_MISO (pin_size_t[]){22u} +#define PINS_SPI0_MOSI (pin_size_t[]){23u} +#define PINS_SPI0_SCK (pin_size_t[]){18u} +#define PINS_SPI1_CS (pin_size_t[]){19u} +#define PINS_SPI1_MISO (pin_size_t[]){22u} +#define PINS_SPI1_MOSI (pin_size_t[]){23u} +#define PINS_SPI1_SCK (pin_size_t[]){18u} + +// Wire Interfaces +// --------------- +#define PIN_WIRE0_SCL_0 22u // PA_22 +#define PIN_WIRE0_SCL_1 29u // PA_29 +#define PIN_WIRE0_SDA_0 19u // PA_19 +#define PIN_WIRE0_SDA_1 30u // PA_30 +#define PIN_WIRE1_SCL 18u // PA_18 +#define PIN_WIRE1_SDA 23u // PA_23 +#define PINS_WIRE0_SCL (pin_size_t[]){22u, 29u} +#define PINS_WIRE0_SDA (pin_size_t[]){19u, 30u} +#define PINS_WIRE1_SCL (pin_size_t[]){18u} +#define PINS_WIRE1_SDA (pin_size_t[]){23u} + +// Serial ports +// ------------ +#define PIN_SERIAL0_CTS 19u // PA_19 +#define PIN_SERIAL0_RTS 22u // PA_22 +#define PIN_SERIAL0_RX 18u // PA_18 +#define PIN_SERIAL0_TX 23u // PA_23 +#define PIN_SERIAL2_RX 29u // PA_29 +#define PIN_SERIAL2_TX 30u // PA_30 +#define PINS_SERIAL0_CTS (pin_size_t[]){19u} +#define PINS_SERIAL0_RTS (pin_size_t[]){22u} +#define PINS_SERIAL0_RX (pin_size_t[]){18u} +#define PINS_SERIAL0_TX (pin_size_t[]){23u} +#define PINS_SERIAL2_RX (pin_size_t[]){29u} +#define PINS_SERIAL2_TX (pin_size_t[]){30u} + +// Pin function macros +// ------------------- +#define PIN_ADC1 19u // PA_19 +#define PIN_ADC2 41u // AD_2 +#define PIN_CS0 19u // PA_19 +#define PIN_CS1 19u // PA_19 +#define PIN_CTS0 19u // PA_19 +#define PIN_MISO0 22u // PA_22 +#define PIN_MISO1 22u // PA_22 +#define PIN_MOSI0 23u // PA_23 +#define PIN_MOSI1 23u // PA_23 +#define PIN_PA00 0u // PA_0 +#define PIN_PA05 5u // PA_5 +#define PIN_PA12 12u // PA_12 +#define PIN_PA14 14u // PA_14 +#define PIN_PA15 15u // PA_15 +#define PIN_PA18 18u // PA_18 +#define PIN_PA19 19u // PA_19 +#define PIN_PA22 22u // PA_22 +#define PIN_PA23 23u // PA_23 +#define PIN_PA29 29u // PA_29 +#define PIN_PA30 30u // PA_30 +#define PIN_PWM1 15u // PA_15 +#define PIN_PWM2 0u // PA_0 +#define PIN_PWM3 12u // PA_12 +#define PIN_PWM4 5u // PA_5 +#define PIN_PWM5 22u // PA_22 +#define PIN_RTS0 22u // PA_22 +#define PIN_RX0 18u // PA_18 +#define PIN_RX2 29u // PA_29 +#define PIN_SCK0 18u // PA_18 +#define PIN_SCK1 18u // PA_18 +#define PIN_SCL1 18u // PA_18 +#define PIN_SDA1 23u // PA_23 +#define PIN_TX0 23u // PA_23 +#define PIN_TX2 30u // PA_30 + +// Port availability +// ----------------- +#define HAS_SERIAL0 1 +#define HAS_SERIAL2 1 +#define HAS_SPI0 1 +#define HAS_SPI1 1 +#define HAS_WIRE0 1 +#define HAS_WIRE1 1 +#define SERIAL_INTERFACES_COUNT 2 +#define SPI_INTERFACES_COUNT 2 +#define WIRE_INTERFACES_COUNT 2 + +// Arduino pin names +// ----------------- +#define PIN_D0 22u // PA_22 +#define PIN_D1 19u // PA_19 +#define PIN_D2 14u // PA_14 +#define PIN_D3 15u // PA_15 +#define PIN_D4 0u // PA_0 +#define PIN_D5 29u // PA_29 +#define PIN_D6 30u // PA_30 +#define PIN_D7 5u // PA_5 +#define PIN_D8 12u // PA_12 +#define PIN_D9 18u // PA_18 +#define PIN_D10 23u // PA_23 +#define PIN_A0 19u // PA_19 +#define PIN_A1 41u // AD_2 + +// Static pin names +// ---------------- +static const unsigned char A0 = PIN_A0; +static const unsigned char A1 = PIN_A1; +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; +static const unsigned char D9 = PIN_D9; +static const unsigned char D10 = PIN_D10; diff --git a/boards/variants/wr3le.c b/boards/variants/wr3le.c new file mode 100644 index 000000000..b96370fa2 --- /dev/null +++ b/boards/variants/wr3le.c @@ -0,0 +1,51 @@ +/* This file was auto-generated from wr3le.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: PA29, UART2_RX, I2C0_SCL, PWM4 + {PA_29, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D1: PA14, PWM0, SWCLK + {PA_14, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D2: PA15, PWM1, SWDIO + {PA_15, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D3: PA22, UART0_RTS, SPI0_MISO, SPI1_MISO, I2C0_SCL, SD_D0, PWM5, I2S0_WS, WAKE2 + {PA_22, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D4: PA00, PWM2 + {PA_0, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D5: PA30, UART2_TX, I2C0_SDA, PWM4 + {PA_30, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D6: PA19, ADC1, UART0_CTS, SPI0_CS, SPI1_CS, I2C0_SDA, SD_D3, TMR5_TRIG, I2S0_TX + {PA_19, PIN_GPIO | PIN_IRQ | PIN_ADC | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D7: PA05, PWM4, WAKE1 + {PA_5, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D8: PA12, PWM3 + {PA_12, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D9: PA18, UART0_RX, SPI0_SCK, SPI1_SCK, I2C1_SCL, SD_D2, TMR4_TRIG, I2S0_MCK, WAKE0 + {PA_18, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D10: PA23, UART0_TX, SPI0_MOSI, SPI1_MOSI, I2C1_SDA, SD_D1, PWM0, WAKE3 + {PA_23, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // A1: ADC2 + {AD_2, PIN_ADC, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[4]), // PA_0 (D4) + [5] = &(lt_arduino_pin_info_list[7]), // PA_5 (D7) + [12] = &(lt_arduino_pin_info_list[8]), // PA_12 (D8) + [14] = &(lt_arduino_pin_info_list[1]), // PA_14 (D1) + [15] = &(lt_arduino_pin_info_list[2]), // PA_15 (D2) + [18] = &(lt_arduino_pin_info_list[9]), // PA_18 (D9) + [19] = &(lt_arduino_pin_info_list[6]), // PA_19 (D6) + [22] = &(lt_arduino_pin_info_list[3]), // PA_22 (D3) + [23] = &(lt_arduino_pin_info_list[10]), // PA_23 (D10) + [29] = &(lt_arduino_pin_info_list[0]), // PA_29 (D0) + [30] = &(lt_arduino_pin_info_list[5]), // PA_30 (D5) + [41] = &(lt_arduino_pin_info_list[11]), // AD_2 (A1) +}; +// clang-format on diff --git a/boards/variants/wr3le.h b/boards/variants/wr3le.h new file mode 100644 index 000000000..da682ace3 --- /dev/null +++ b/boards/variants/wr3le.h @@ -0,0 +1,141 @@ +/* This file was auto-generated from wr3le.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 12 // Total GPIO count +#define NUM_DIGITAL_PINS 11 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 2 // ADC inputs +#define NUM_ANALOG_OUTPUTS 9 // PWM & DAC outputs +#define PINS_GPIO_MAX 41 // Last usable GPIO number + +// SPI Interfaces +// -------------- +#define PIN_SPI0_CS 19u // PA_19 +#define PIN_SPI0_MISO 22u // PA_22 +#define PIN_SPI0_MOSI 23u // PA_23 +#define PIN_SPI0_SCK 18u // PA_18 +#define PIN_SPI1_CS 19u // PA_19 +#define PIN_SPI1_MISO 22u // PA_22 +#define PIN_SPI1_MOSI 23u // PA_23 +#define PIN_SPI1_SCK 18u // PA_18 +#define PINS_SPI0_CS (pin_size_t[]){19u} +#define PINS_SPI0_MISO (pin_size_t[]){22u} +#define PINS_SPI0_MOSI (pin_size_t[]){23u} +#define PINS_SPI0_SCK (pin_size_t[]){18u} +#define PINS_SPI1_CS (pin_size_t[]){19u} +#define PINS_SPI1_MISO (pin_size_t[]){22u} +#define PINS_SPI1_MOSI (pin_size_t[]){23u} +#define PINS_SPI1_SCK (pin_size_t[]){18u} + +// Wire Interfaces +// --------------- +#define PIN_WIRE0_SCL_0 29u // PA_29 +#define PIN_WIRE0_SCL_1 22u // PA_22 +#define PIN_WIRE0_SDA_0 30u // PA_30 +#define PIN_WIRE0_SDA_1 19u // PA_19 +#define PIN_WIRE1_SCL 18u // PA_18 +#define PIN_WIRE1_SDA 23u // PA_23 +#define PINS_WIRE0_SCL (pin_size_t[]){29u, 22u} +#define PINS_WIRE0_SDA (pin_size_t[]){30u, 19u} +#define PINS_WIRE1_SCL (pin_size_t[]){18u} +#define PINS_WIRE1_SDA (pin_size_t[]){23u} + +// Serial ports +// ------------ +#define PIN_SERIAL0_CTS 19u // PA_19 +#define PIN_SERIAL0_RTS 22u // PA_22 +#define PIN_SERIAL0_RX 18u // PA_18 +#define PIN_SERIAL0_TX 23u // PA_23 +#define PIN_SERIAL2_RX 29u // PA_29 +#define PIN_SERIAL2_TX 30u // PA_30 +#define PINS_SERIAL0_CTS (pin_size_t[]){19u} +#define PINS_SERIAL0_RTS (pin_size_t[]){22u} +#define PINS_SERIAL0_RX (pin_size_t[]){18u} +#define PINS_SERIAL0_TX (pin_size_t[]){23u} +#define PINS_SERIAL2_RX (pin_size_t[]){29u} +#define PINS_SERIAL2_TX (pin_size_t[]){30u} + +// Pin function macros +// ------------------- +#define PIN_ADC1 19u // PA_19 +#define PIN_ADC2 41u // AD_2 +#define PIN_CS0 19u // PA_19 +#define PIN_CS1 19u // PA_19 +#define PIN_CTS0 19u // PA_19 +#define PIN_MISO0 22u // PA_22 +#define PIN_MISO1 22u // PA_22 +#define PIN_MOSI0 23u // PA_23 +#define PIN_MOSI1 23u // PA_23 +#define PIN_PA00 0u // PA_0 +#define PIN_PA05 5u // PA_5 +#define PIN_PA12 12u // PA_12 +#define PIN_PA14 14u // PA_14 +#define PIN_PA15 15u // PA_15 +#define PIN_PA18 18u // PA_18 +#define PIN_PA19 19u // PA_19 +#define PIN_PA22 22u // PA_22 +#define PIN_PA23 23u // PA_23 +#define PIN_PA29 29u // PA_29 +#define PIN_PA30 30u // PA_30 +#define PIN_PWM1 15u // PA_15 +#define PIN_PWM2 0u // PA_0 +#define PIN_PWM3 12u // PA_12 +#define PIN_PWM4 5u // PA_5 +#define PIN_PWM5 22u // PA_22 +#define PIN_RTS0 22u // PA_22 +#define PIN_RX0 18u // PA_18 +#define PIN_RX2 29u // PA_29 +#define PIN_SCK0 18u // PA_18 +#define PIN_SCK1 18u // PA_18 +#define PIN_SCL1 18u // PA_18 +#define PIN_SDA1 23u // PA_23 +#define PIN_TX0 23u // PA_23 +#define PIN_TX2 30u // PA_30 + +// Port availability +// ----------------- +#define HAS_SERIAL0 1 +#define HAS_SERIAL2 1 +#define HAS_SPI0 1 +#define HAS_SPI1 1 +#define HAS_WIRE0 1 +#define HAS_WIRE1 1 +#define SERIAL_INTERFACES_COUNT 2 +#define SPI_INTERFACES_COUNT 2 +#define WIRE_INTERFACES_COUNT 2 + +// Arduino pin names +// ----------------- +#define PIN_D0 29u // PA_29 +#define PIN_D1 14u // PA_14 +#define PIN_D2 15u // PA_15 +#define PIN_D3 22u // PA_22 +#define PIN_D4 0u // PA_0 +#define PIN_D5 30u // PA_30 +#define PIN_D6 19u // PA_19 +#define PIN_D7 5u // PA_5 +#define PIN_D8 12u // PA_12 +#define PIN_D9 18u // PA_18 +#define PIN_D10 23u // PA_23 +#define PIN_A0 19u // PA_19 +#define PIN_A1 41u // AD_2 + +// Static pin names +// ---------------- +static const unsigned char A0 = PIN_A0; +static const unsigned char A1 = PIN_A1; +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; +static const unsigned char D9 = PIN_D9; +static const unsigned char D10 = PIN_D10; diff --git a/boards/variants/wr3n.c b/boards/variants/wr3n.c new file mode 100644 index 000000000..5af75b67e --- /dev/null +++ b/boards/variants/wr3n.c @@ -0,0 +1,45 @@ +/* This file was auto-generated from wr3n.json using boardgen */ + +#include + +#ifdef LT_VARIANT_INCLUDE +#include LT_VARIANT_INCLUDE +#endif + +// clang-format off +PinInfo lt_arduino_pin_info_list[PINS_COUNT] = { + // D0: PA29, UART2_RX, I2C0_SCL, PWM4 + {PA_29, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D1: PA14, PWM0, SWCLK + {PA_14, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D2: PA15, PWM1, SWDIO + {PA_15, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_SWD, PIN_NONE, 0}, + // D3: PA00, PWM2 + {PA_0, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D4: PA30, UART2_TX, I2C0_SDA, PWM4 + {PA_30, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_UART, PIN_NONE, 0}, + // D5: PA05, PWM4, WAKE1 + {PA_5, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D6: PA12, PWM3 + {PA_12, PIN_GPIO | PIN_IRQ | PIN_PWM, PIN_NONE, 0}, + // D7: PA18, UART0_RX, SPI0_SCK, SPI1_SCK, I2C1_SCL, SD_D2, TMR4_TRIG, I2S0_MCK, WAKE0 + {PA_18, PIN_GPIO | PIN_IRQ | PIN_I2C | PIN_I2S | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // D8: PA23, UART0_TX, SPI0_MOSI, SPI1_MOSI, I2C1_SDA, SD_D1, PWM0, WAKE3 + {PA_23, PIN_GPIO | PIN_IRQ | PIN_PWM | PIN_I2C | PIN_SPI | PIN_UART, PIN_NONE, 0}, + // A1: ADC2 + {AD_2, PIN_ADC, PIN_NONE, 0}, +}; + +PinInfo *lt_arduino_pin_gpio_map[] = { + [0] = &(lt_arduino_pin_info_list[3]), // PA_0 (D3) + [5] = &(lt_arduino_pin_info_list[5]), // PA_5 (D5) + [12] = &(lt_arduino_pin_info_list[6]), // PA_12 (D6) + [14] = &(lt_arduino_pin_info_list[1]), // PA_14 (D1) + [15] = &(lt_arduino_pin_info_list[2]), // PA_15 (D2) + [18] = &(lt_arduino_pin_info_list[7]), // PA_18 (D7) + [23] = &(lt_arduino_pin_info_list[8]), // PA_23 (D8) + [29] = &(lt_arduino_pin_info_list[0]), // PA_29 (D0) + [30] = &(lt_arduino_pin_info_list[4]), // PA_30 (D4) + [41] = &(lt_arduino_pin_info_list[9]), // AD_2 (A1) +}; +// clang-format on diff --git a/boards/variants/wr3n.h b/boards/variants/wr3n.h new file mode 100644 index 000000000..e608a2933 --- /dev/null +++ b/boards/variants/wr3n.h @@ -0,0 +1,99 @@ +/* This file was auto-generated from wr3n.json using boardgen */ + +#pragma once + +// clang-format off + +// Pins +// ---- +#define PINS_COUNT 10 // Total GPIO count +#define NUM_DIGITAL_PINS 9 // Digital inputs/outputs +#define NUM_ANALOG_INPUTS 1 // ADC inputs +#define NUM_ANALOG_OUTPUTS 8 // PWM & DAC outputs +#define PINS_GPIO_MAX 41 // Last usable GPIO number + +// Wire Interfaces +// --------------- +#define PIN_WIRE0_SCL 29u // PA_29 +#define PIN_WIRE0_SDA 30u // PA_30 +#define PIN_WIRE1_SCL 18u // PA_18 +#define PIN_WIRE1_SDA 23u // PA_23 +#define PINS_WIRE0_SCL (pin_size_t[]){29u} +#define PINS_WIRE0_SDA (pin_size_t[]){30u} +#define PINS_WIRE1_SCL (pin_size_t[]){18u} +#define PINS_WIRE1_SDA (pin_size_t[]){23u} + +// Serial ports +// ------------ +#define PIN_SERIAL0_RX 18u // PA_18 +#define PIN_SERIAL0_TX 23u // PA_23 +#define PIN_SERIAL2_RX 29u // PA_29 +#define PIN_SERIAL2_TX 30u // PA_30 +#define PINS_SERIAL0_RX (pin_size_t[]){18u} +#define PINS_SERIAL0_TX (pin_size_t[]){23u} +#define PINS_SERIAL2_RX (pin_size_t[]){29u} +#define PINS_SERIAL2_TX (pin_size_t[]){30u} + +// Pin function macros +// ------------------- +#define PIN_ADC2 41u // AD_2 +#define PIN_MOSI0 23u // PA_23 +#define PIN_MOSI1 23u // PA_23 +#define PIN_PA00 0u // PA_0 +#define PIN_PA05 5u // PA_5 +#define PIN_PA12 12u // PA_12 +#define PIN_PA14 14u // PA_14 +#define PIN_PA15 15u // PA_15 +#define PIN_PA18 18u // PA_18 +#define PIN_PA23 23u // PA_23 +#define PIN_PA29 29u // PA_29 +#define PIN_PA30 30u // PA_30 +#define PIN_PWM1 15u // PA_15 +#define PIN_PWM2 0u // PA_0 +#define PIN_PWM3 12u // PA_12 +#define PIN_PWM4 5u // PA_5 +#define PIN_RX0 18u // PA_18 +#define PIN_RX2 29u // PA_29 +#define PIN_SCK0 18u // PA_18 +#define PIN_SCK1 18u // PA_18 +#define PIN_SCL0 29u // PA_29 +#define PIN_SCL1 18u // PA_18 +#define PIN_SDA0 30u // PA_30 +#define PIN_SDA1 23u // PA_23 +#define PIN_TX0 23u // PA_23 +#define PIN_TX2 30u // PA_30 + +// Port availability +// ----------------- +#define HAS_SERIAL0 1 +#define HAS_SERIAL2 1 +#define HAS_WIRE0 1 +#define HAS_WIRE1 1 +#define SERIAL_INTERFACES_COUNT 2 +#define WIRE_INTERFACES_COUNT 2 + +// Arduino pin names +// ----------------- +#define PIN_D0 29u // PA_29 +#define PIN_D1 14u // PA_14 +#define PIN_D2 15u // PA_15 +#define PIN_D3 0u // PA_0 +#define PIN_D4 30u // PA_30 +#define PIN_D5 5u // PA_5 +#define PIN_D6 12u // PA_12 +#define PIN_D7 18u // PA_18 +#define PIN_D8 23u // PA_23 +#define PIN_A1 41u // AD_2 + +// Static pin names +// ---------------- +static const unsigned char A1 = PIN_A1; +static const unsigned char D0 = PIN_D0; +static const unsigned char D1 = PIN_D1; +static const unsigned char D2 = PIN_D2; +static const unsigned char D3 = PIN_D3; +static const unsigned char D4 = PIN_D4; +static const unsigned char D5 = PIN_D5; +static const unsigned char D6 = PIN_D6; +static const unsigned char D7 = PIN_D7; +static const unsigned char D8 = PIN_D8; diff --git a/boards/wa2.json b/boards/wa2.json new file mode 100644 index 000000000..f71f87223 --- /dev/null +++ b/boards/wa2.json @@ -0,0 +1,20 @@ +{ + "_base": [ + "beken-72xx", + "beken-7231", + "beken-7231q", + "ic/bk7231q-qfn40", + "pcb/wa2", + "pcb/wa2-test" + ], + "build": { + "mcu": "bk7231q", + "variant": "wa2" + }, + "name": "WA2 Wi-Fi Module", + "url": "https://docs.libretiny.eu/boards/wa2/", + "vendor": "Tuya Inc.", + "pcb": { + "symbol": "WA2" + } +} diff --git a/boards/wa2/index.html b/boards/wa2/index.html new file mode 100644 index 000000000..e9476b910 --- /dev/null +++ b/boards/wa2/index.html @@ -0,0 +1,2649 @@ + + + + + + + + + + + + + + + + + + + + + + + + WA2 - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

WA2 Wi-Fi Module

+

by Tuya Inc.

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codewa2
MCUBK7231Q
ManufacturerBeken
SeriesBK72XX
Frequency120 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O13x GPIO, 5x PWM, 2x UART, 2x ADC
Wi-Fi802.11 b/g/n
+

Usage

+

Board code: wa2

+

In platformio.ini:

+
[env:wa2]
+platform = libretiny
+board = wa2
+framework = arduino
+
+

In ESPHome YAML:

+
bk72xx:
+  board: wa2
+
+

Pinout

+

Pinout

+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
P0TX2SCL2
P4, ADC1
P6PWM0
P7PWM1
P8PWM2
P10RX1
P11TX1
P18PWM4
P19PWM5
P20SCL1TCK
P21SDA1TMS
P22TDI
P23, ADC3TDO
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Bootloader0x00000068 KiB / 0x110000x011000
App Image0x0110001.1 MiB / 0x1210000x132000
OTA Image0x132000664 KiB / 0xA60000x1D8000
Key-Value Store0x1D800032 KiB / 0x80000x1E0000
Calibration0x1E00004 KiB / 0x10000x1E1000
TLV Store0x1E10004 KiB / 0x10000x1E2000
Network Data0x1E20004 KiB / 0x10000x1E3000
User Data0x1E3000116 KiB / 0x1D0000x200000
+

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/wa2/wa2.svg b/boards/wa2/wa2.svg new file mode 100644 index 000000000..e1c6e338e --- /dev/null +++ b/boards/wa2/wa2.svg @@ -0,0 +1,366 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WA2 + + + + + + + + + + + + + + + + + 2 + + + + P8 + + + + PWM2 + + + + + 4 + + + + P7 + + + + PWM1 + + + + + 6 + + + + P6 + + + + PWM0 + + + + + 8 + + + + P23 + + + + ADC3 + + + + TDO + + + + FSO + + + + + 10 + + + + CEN + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + 3V3 + + + + + 3 + + + + GND + + + + + 5 + + + + P10 + + + + RX1 + + + + + 7 + + + + P11 + + + + TX1 + + + + + 9 + + + + P18 + + + + PWM4 + + + + + 11 + + + + P19 + + + + PWM5 + + + + + P20 + + + + SCL1 + + + + TCK + + + + FSCK + + + + + P4 + + + + ADC1 + + + + + TEST + + + + + P0 + + + + TX2 + + + + SCL2 + + + + + P21 + + + + SDA1 + + + + TMS + + + + ___ + FCS + + + + + P22 + + + + TDI + + + + FSI + + + + + P23 + + + + ADC3 + + + + TDO + + + + FSO + + + + + 3V3 + + + + + GND + diff --git a/boards/wb1s.json b/boards/wb1s.json new file mode 100644 index 000000000..f9097cb5f --- /dev/null +++ b/boards/wb1s.json @@ -0,0 +1,23 @@ +{ + "_base": [ + "beken-72xx", + "beken-7231", + "beken-7231t", + "beken-7231-tuya", + "ic/bk7231-qfn32", + "pcb/wb1s" + ], + "build": { + "mcu": "bk7231t", + "variant": "wb1s" + }, + "name": "WB1S Wi-Fi Module", + "url": "https://developer.tuya.com/en/docs/iot/wb1s?id=K9duevbj3ol4x", + "vendor": "Tuya Inc.", + "doc": { + "fccid": "2ANDL-WB1S" + }, + "pcb": { + "symbol": "WB1S" + } +} diff --git a/boards/wb1s/index.html b/boards/wb1s/index.html new file mode 100644 index 000000000..27cb3f7fc --- /dev/null +++ b/boards/wb1s/index.html @@ -0,0 +1,2671 @@ + + + + + + + + + + + + + + + + + + + + + + + + WB1S - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

WB1S Wi-Fi Module

+

by Tuya Inc.

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codewb1s
MCUBK7231T
ManufacturerBeken
SeriesBK72XX
Frequency120 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O14x GPIO, 6x PWM, 2x UART, 1x ADC
Wi-Fi802.11 b/g/n
BluetoothBLE v4.2
FCC ID2ANDL-WB1S
+

Usage

+

Board code: wb1s

+

In platformio.ini:

+
[env:wb1s]
+platform = libretiny
+board = wb1s
+framework = arduino
+
+

In ESPHome YAML:

+
bk72xx:
+  board: wb1s
+
+

Pinout

+

Pinout

+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
P0TX2SCL2
P1RX2SDA2
P6PWM0
P7PWM1
P8PWM2
P9PWM3
P10RX1
P11TX1
P20SCL1TCK
P21SDA1TMS
P22TDI
P23, ADC3TDO
P24PWM4
P26PWM5
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Bootloader0x00000068 KiB / 0x110000x011000
App Image0x0110001.1 MiB / 0x1210000x132000
OTA Image0x132000664 KiB / 0xA60000x1D8000
Key-Value Store0x1D800032 KiB / 0x80000x1E0000
Calibration0x1E00004 KiB / 0x10000x1E1000
TLV Store0x1E10004 KiB / 0x10000x1E2000
Network Data0x1E20004 KiB / 0x10000x1E3000
User Data0x1E3000116 KiB / 0x1D0000x200000
Tuya Storage0x1ED00076 KiB / 0x130000x200000
+

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/wb1s/wb1s.svg b/boards/wb1s/wb1s.svg new file mode 100644 index 000000000..37feaeb32 --- /dev/null +++ b/boards/wb1s/wb1s.svg @@ -0,0 +1,402 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WB1S + + + + + + + + + + + + + + + + + 1 + + + + VCC5 + + + + + 2 + + + + P11 + + + + TX1 + + + + + 3 + + + + P10 + + + + RX1 + + + + + 4 + + + + 3V3 + + + + + 5 + + + + GND + + + + + 6 + + + + P26 + + + + IRDA + + + + PWM5 + + + + + 7 + + + + P24 + + + + PWM4 + + + + + 8 + + + + P0 + + + + TX2 + + + + SCL2 + + + + + 9 + + + + P8 + + + + PWM2 + + + + + 10 + + + + P7 + + + + PWM1 + + + + + 11 + + + + P1 + + + + RX2 + + + + SDA2 + + + + + 12 + + + + P9 + + + + PWM3 + + + + + 13 + + + + P6 + + + + PWM0 + + + + + 14 + + + + GND + + + + + 15 + + + + GND + + + + + 16 + + + + CEN + + + + + 17 + + + + P23 + + + + ADC3 + + + + TDO + + + + FSO + + + + + 18 + + + + GND + + + + + 19 + + + + P23 + + + + ADC3 + + + + TDO + + + + FSO + + + + + 20 + + + + P22 + + + + TDI + + + + FSI + + + + + 21 + + + + P21 + + + + SDA1 + + + + TMS + + + + ___ + FCS + + + + + 22 + + + + P20 + + + + SCL1 + + + + TCK + + + + FSCK + diff --git a/boards/wb2l-m1.json b/boards/wb2l-m1.json new file mode 100644 index 000000000..a0252faa1 --- /dev/null +++ b/boards/wb2l-m1.json @@ -0,0 +1,21 @@ +{ + "_base": [ + "beken-72xx", + "beken-7231n", + "beken-7231-tuya", + "ic/bk7231-qfn32", + "pcb/wb2l", + "pcb/wb2l-test", + "pcb/wb2l-m1-test" + ], + "build": { + "mcu": "bk7231n", + "variant": "wb2l-m1" + }, + "name": "WB2L_M1 Wi-Fi Module", + "url": "https://docs.libretiny.eu/boards/wb2l-m1/", + "vendor": "Tuya Inc.", + "pcb": { + "symbol": "WB2L_M1" + } +} diff --git a/boards/wb2l-m1/index.html b/boards/wb2l-m1/index.html new file mode 100644 index 000000000..3a99eac46 --- /dev/null +++ b/boards/wb2l-m1/index.html @@ -0,0 +1,2659 @@ + + + + + + + + + + + + + + + + + + + + + + + + WB2L-M1 - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

WB2L_M1 Wi-Fi Module

+

by Tuya Inc.

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codewb2l-m1
MCUBK7231N
ManufacturerBeken
SeriesBK72XX
Frequency120 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O13x GPIO, 5x PWM, 2x UART, 1x ADC
Wi-Fi802.11 b/g/n
BluetoothBLE v5.1
+

Usage

+

Board code: wb2l-m1

+

In platformio.ini:

+
[env:wb2l-m1]
+platform = libretiny
+board = wb2l-m1
+framework = arduino
+
+

In ESPHome YAML:

+
bk72xx:
+  board: wb2l-m1
+
+

Pinout

+

Pinout

+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
P0TX2SCL2
P1RX2SDA2
P6PWM0
P7PWM1
P8PWM2
P10RX1
P11TX1
P20SCL1TCK
P21SDA1TMS
P22TDI
P23, ADC3TDO
P24PWM4
P26PWM5
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Bootloader0x00000068 KiB / 0x110000x011000
App Image0x0110001.1 MiB / 0x1190000x12A000
OTA Image0x12A000664 KiB / 0xA60000x1D0000
Calibration0x1D00004 KiB / 0x10000x1D1000
Network Data0x1D10004 KiB / 0x10000x1D2000
TLV Store0x1D20004 KiB / 0x10000x1D3000
Key-Value Store0x1D300032 KiB / 0x80000x1DB000
User Data0x1DB000148 KiB / 0x250000x200000
Tuya Storage0x1ED00076 KiB / 0x130000x200000
+

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/wb2l-m1/wb2l-m1.svg b/boards/wb2l-m1/wb2l-m1.svg new file mode 100644 index 000000000..455ee10f1 --- /dev/null +++ b/boards/wb2l-m1/wb2l-m1.svg @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WB2L_M1 + + + + + + + + + + + + + + + + + 1 + + + + P8 + + + + PWM2 + + + + + 2 + + + + P7 + + + + PWM1 + + + + + 3 + + + + P6 + + + + PWM0 + + + + + 4 + + + + P26 + + + + IRDA + + + + PWM5 + + + + + 5 + + + + P24 + + + + PWM4 + + + + + 6 + + + + GND + + + + + 7 + + + + 3V3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GND + + + + + CEN + + + + + P10 + + + + RX1 + + + + + P11 + + + + TX1 + + + + + P1 + + + + RX2 + + + + SDA2 + + + + + P0 + + + + TX2 + + + + SCL2 + + + + + P20 + + + + SCL1 + + + + TCK + + + + FSCK + + + + + P21 + + + + SDA1 + + + + TMS + + + + ___ + FCS + + + + + P23 + + + + ADC3 + + + + TDO + + + + FSO + + + + + P22 + + + + TDI + + + + FSI + diff --git a/boards/wb2l.json b/boards/wb2l.json new file mode 100644 index 000000000..06527101c --- /dev/null +++ b/boards/wb2l.json @@ -0,0 +1,24 @@ +{ + "_base": [ + "beken-72xx", + "beken-7231", + "beken-7231t", + "beken-7231-tuya", + "ic/bk7231-qfn32", + "pcb/wb2l", + "pcb/wb2l-test" + ], + "build": { + "mcu": "bk7231t", + "variant": "wb2l" + }, + "name": "WB2L Wi-Fi Module", + "url": "https://developer.tuya.com/en/docs/iot/wb2l-datasheet?id=K9duegc9bualu", + "vendor": "Tuya Inc.", + "doc": { + "fccid": "2ANDL-WB2L" + }, + "pcb": { + "symbol": "WB2L" + } +} diff --git a/boards/wb2l/index.html b/boards/wb2l/index.html new file mode 100644 index 000000000..4fb5284eb --- /dev/null +++ b/boards/wb2l/index.html @@ -0,0 +1,2663 @@ + + + + + + + + + + + + + + + + + + + + + + + + WB2L - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

WB2L Wi-Fi Module

+

by Tuya Inc.

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codewb2l
MCUBK7231T
ManufacturerBeken
SeriesBK72XX
Frequency120 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O13x GPIO, 5x PWM, 2x UART, 1x ADC
Wi-Fi802.11 b/g/n
BluetoothBLE v4.2
FCC ID2ANDL-WB2L
+

Usage

+

Board code: wb2l

+

In platformio.ini:

+
[env:wb2l]
+platform = libretiny
+board = wb2l
+framework = arduino
+
+

In ESPHome YAML:

+
bk72xx:
+  board: wb2l
+
+

Pinout

+

Pinout

+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
P0TX2SCL2
P1RX2SDA2
P6PWM0
P7PWM1
P8PWM2
P10RX1
P11TX1
P20SCL1TCK
P21SDA1TMS
P22TDI
P23, ADC3TDO
P24PWM4
P26PWM5
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Bootloader0x00000068 KiB / 0x110000x011000
App Image0x0110001.1 MiB / 0x1210000x132000
OTA Image0x132000664 KiB / 0xA60000x1D8000
Key-Value Store0x1D800032 KiB / 0x80000x1E0000
Calibration0x1E00004 KiB / 0x10000x1E1000
TLV Store0x1E10004 KiB / 0x10000x1E2000
Network Data0x1E20004 KiB / 0x10000x1E3000
User Data0x1E3000116 KiB / 0x1D0000x200000
Tuya Storage0x1ED00076 KiB / 0x130000x200000
+

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/wb2l/wb2l.svg b/boards/wb2l/wb2l.svg new file mode 100644 index 000000000..2dadc06da --- /dev/null +++ b/boards/wb2l/wb2l.svg @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WB2L + + + + + + + + + + + + + + + + + 1 + + + + P8 + + + + PWM2 + + + + + 2 + + + + P7 + + + + PWM1 + + + + + 3 + + + + P6 + + + + PWM0 + + + + + 4 + + + + P26 + + + + IRDA + + + + PWM5 + + + + + 5 + + + + P24 + + + + PWM4 + + + + + 6 + + + + GND + + + + + 7 + + + + 3V3 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + GND + + + + + CEN + + + + + P10 + + + + RX1 + + + + + P11 + + + + TX1 + + + + + P1 + + + + RX2 + + + + SDA2 + + + + + P0 + + + + TX2 + + + + SCL2 + + + + + P20 + + + + SCL1 + + + + TCK + + + + FSCK + + + + + P21 + + + + SDA1 + + + + TMS + + + + ___ + FCS + + + + + P23 + + + + ADC3 + + + + TDO + + + + FSO + + + + + P22 + + + + TDI + + + + FSI + diff --git a/boards/wb2s.json b/boards/wb2s.json new file mode 100644 index 000000000..3f9966cd9 --- /dev/null +++ b/boards/wb2s.json @@ -0,0 +1,24 @@ +{ + "_base": [ + "beken-72xx", + "beken-7231", + "beken-7231t", + "beken-7231-tuya", + "ic/bk7231-qfn32", + "pcb/wb2s", + "pcb/wb2s-test" + ], + "build": { + "mcu": "bk7231t", + "variant": "wb2s" + }, + "name": "WB2S Wi-Fi Module", + "url": "https://developer.tuya.com/en/docs/iot/wb2s-module-datasheet?id=K9ghecl7kc479", + "vendor": "Tuya Inc.", + "doc": { + "fccid": "2ANDL-WB2S" + }, + "pcb": { + "symbol": "WB2S" + } +} diff --git a/boards/wb2s/index.html b/boards/wb2s/index.html new file mode 100644 index 000000000..e254b0594 --- /dev/null +++ b/boards/wb2s/index.html @@ -0,0 +1,2671 @@ + + + + + + + + + + + + + + + + + + + + + + + + WB2S - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

WB2S Wi-Fi Module

+

by Tuya Inc.

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codewb2s
MCUBK7231T
ManufacturerBeken
SeriesBK72XX
Frequency120 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O14x GPIO, 6x PWM, 2x UART, 1x ADC
Wi-Fi802.11 b/g/n
BluetoothBLE v4.2
FCC ID2ANDL-WB2S
+

Usage

+

Board code: wb2s

+

In platformio.ini:

+
[env:wb2s]
+platform = libretiny
+board = wb2s
+framework = arduino
+
+

In ESPHome YAML:

+
bk72xx:
+  board: wb2s
+
+

Pinout

+

Pinout

+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
P0TX2SCL2
P1RX2SDA2
P6PWM0
P7PWM1
P8PWM2
P9PWM3
P10RX1
P11TX1
P20SCL1TCK
P21SDA1TMS
P22TDI
P23, ADC3TDO
P24PWM4
P26PWM5
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Bootloader0x00000068 KiB / 0x110000x011000
App Image0x0110001.1 MiB / 0x1210000x132000
OTA Image0x132000664 KiB / 0xA60000x1D8000
Key-Value Store0x1D800032 KiB / 0x80000x1E0000
Calibration0x1E00004 KiB / 0x10000x1E1000
TLV Store0x1E10004 KiB / 0x10000x1E2000
Network Data0x1E20004 KiB / 0x10000x1E3000
User Data0x1E3000116 KiB / 0x1D0000x200000
Tuya Storage0x1ED00076 KiB / 0x130000x200000
+

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/wb2s/wb2s.svg b/boards/wb2s/wb2s.svg new file mode 100644 index 000000000..6205c01ad --- /dev/null +++ b/boards/wb2s/wb2s.svg @@ -0,0 +1,367 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WB2S + + + + + + + + + + + + + + + + + 2 + + + + P8 + + + + PWM2 + + + + + 4 + + + + P7 + + + + PWM1 + + + + + 6 + + + + P6 + + + + PWM0 + + + + + 8 + + + + P23 + + + + ADC3 + + + + TDO + + + + + 10 + + + + CEN + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + 3V3 + + + + + 3 + + + + GND + + + + + 5 + + + + P10 + + + + RX1 + + + + + 7 + + + + P11 + + + + TX1 + + + + + 9 + + + + P24 + + + + PWM4 + + + + + 11 + + + + P26 + + + + IRDA + + + + PWM5 + + + + + P20 + + + + SCL1 + + + + TCK + + + + + P9 + + + + PWM3 + + + + + P1 + + + + RX2 + + + + SDA2 + + + + + P0 + + + + TX2 + + + + SCL2 + + + + + P21 + + + + SDA1 + + + + TMS + + + + + P22 + + + + TDI + + + + + P23 + + + + ADC3 + + + + TDO + + + + + ___ + RST + + + + + 3V3 + + + + + GND + diff --git a/boards/wb3l.json b/boards/wb3l.json new file mode 100644 index 000000000..81711e4f0 --- /dev/null +++ b/boards/wb3l.json @@ -0,0 +1,23 @@ +{ + "_base": [ + "beken-72xx", + "beken-7231", + "beken-7231t", + "beken-7231-tuya", + "ic/bk7231-qfn32", + "pcb/wb3l" + ], + "build": { + "mcu": "bk7231t", + "variant": "wb3l" + }, + "name": "WB3L Wi-Fi Module", + "url": "https://developer.tuya.com/en/docs/iot/wb3l-module-datasheet?id=K9duiggw2v8sp", + "vendor": "Tuya Inc.", + "doc": { + "fccid": "2ANDL-WB3L" + }, + "pcb": { + "symbol": "WB3L" + } +} diff --git a/boards/wb3l/index.html b/boards/wb3l/index.html new file mode 100644 index 000000000..c9536aac0 --- /dev/null +++ b/boards/wb3l/index.html @@ -0,0 +1,2687 @@ + + + + + + + + + + + + + + + + + + + + + + + + WB3L - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

WB3L Wi-Fi Module

+

by Tuya Inc.

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codewb3l
MCUBK7231T
ManufacturerBeken
SeriesBK72XX
Frequency120 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O16x GPIO, 6x PWM, 2x UART, 1x ADC
Wi-Fi802.11 b/g/n
BluetoothBLE v4.2
FCC ID2ANDL-WB3L
+

Usage

+

Board code: wb3l

+

In platformio.ini:

+
[env:wb3l]
+platform = libretiny
+board = wb3l
+framework = arduino
+
+

In ESPHome YAML:

+
bk72xx:
+  board: wb3l
+
+

Pinout

+

Pinout

+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
P0TX2SCL2
P1RX2SDA2
P6PWM0
P7PWM1
P8PWM2
P9PWM3
P10RX1
P11TX1
P14SCK
P16MOSI
P20SCL1TCK
P21SDA1TMS
P22TDI
P23, ADC3TDO
P24PWM4
P26PWM5
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Bootloader0x00000068 KiB / 0x110000x011000
App Image0x0110001.1 MiB / 0x1210000x132000
OTA Image0x132000664 KiB / 0xA60000x1D8000
Key-Value Store0x1D800032 KiB / 0x80000x1E0000
Calibration0x1E00004 KiB / 0x10000x1E1000
TLV Store0x1E10004 KiB / 0x10000x1E2000
Network Data0x1E20004 KiB / 0x10000x1E3000
User Data0x1E3000116 KiB / 0x1D0000x200000
Tuya Storage0x1ED00076 KiB / 0x130000x200000
+

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/wb3l/wb3l.svg b/boards/wb3l/wb3l.svg new file mode 100644 index 000000000..ded840296 --- /dev/null +++ b/boards/wb3l/wb3l.svg @@ -0,0 +1,388 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WB3L + + + + + + + + + + + + + + + + + 1 + + + + + 2 + + + + P23 + + + + ADC3 + + + + TDO + + + + FSO + + + + + 3 + + + + CEN + + + + + 4 + + + + P14 + + + + SCK + + + + + 5 + + + + P26 + + + + IRDA + + + + PWM5 + + + + + 6 + + + + P24 + + + + PWM4 + + + + + 7 + + + + P6 + + + + PWM0 + + + + + 8 + + + + 3V3 + + + + + 9 + + + + GND + + + + + 10 + + + + P9 + + + + PWM3 + + + + + 11 + + + + P0 + + + + TX2 + + + + SCL2 + + + + + 12 + + + + P16 + + + + MOSI + + + + + 13 + + + + P8 + + + + PWM2 + + + + + 14 + + + + P7 + + + + PWM1 + + + + + 15 + + + + P10 + + + + RX1 + + + + + 16 + + + + P11 + + + + TX1 + + + + + 17 + + + + P23 + + + + ADC3 + + + + TDO + + + + FSO + + + + + 18 + + + + P22 + + + + TDI + + + + FSI + + + + + 19 + + + + P21 + + + + SDA1 + + + + TMS + + + + ___ + FCS + + + + + 20 + + + + P20 + + + + SCL1 + + + + TCK + + + + FSCK + + + + + 21 + + + + P1 + + + + RX2 + + + + SDA2 + diff --git a/boards/wb3s.json b/boards/wb3s.json new file mode 100644 index 000000000..cd50b811f --- /dev/null +++ b/boards/wb3s.json @@ -0,0 +1,23 @@ +{ + "_base": [ + "beken-72xx", + "beken-7231", + "beken-7231t", + "beken-7231-tuya", + "ic/bk7231-qfn32", + "pcb/wb3s" + ], + "build": { + "mcu": "bk7231t", + "variant": "wb3s" + }, + "name": "WB3S Wi-Fi Module", + "url": "https://developer.tuya.com/en/docs/iot/wb3s-module-datasheet?id=K9dx20n6hz5n4", + "vendor": "Tuya Inc.", + "doc": { + "fccid": "2ANDL-WB3S" + }, + "pcb": { + "symbol": "WB3S" + } +} diff --git a/boards/wb3s/index.html b/boards/wb3s/index.html new file mode 100644 index 000000000..01309f5c6 --- /dev/null +++ b/boards/wb3s/index.html @@ -0,0 +1,2679 @@ + + + + + + + + + + + + + + + + + + + + + + + + WB3S - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

WB3S Wi-Fi Module

+

by Tuya Inc.

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codewb3s
MCUBK7231T
ManufacturerBeken
SeriesBK72XX
Frequency120 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O15x GPIO, 6x PWM, 2x UART, 1x ADC
Wi-Fi802.11 b/g/n
BluetoothBLE v4.2
FCC ID2ANDL-WB3S
+

Usage

+

Board code: wb3s

+

In platformio.ini:

+
[env:wb3s]
+platform = libretiny
+board = wb3s
+framework = arduino
+
+

In ESPHome YAML:

+
bk72xx:
+  board: wb3s
+
+

Pinout

+

Pinout

+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
P0TX2SCL2
P1RX2SDA2
P6PWM0
P7PWM1
P8PWM2
P9PWM3
P10RX1
P11TX1
P14
P20SCL1TCK
P21SDA1TMS
P22TDI
P23, ADC3TDO
P24PWM4
P26PWM5
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Bootloader0x00000068 KiB / 0x110000x011000
App Image0x0110001.1 MiB / 0x1210000x132000
OTA Image0x132000664 KiB / 0xA60000x1D8000
Key-Value Store0x1D800032 KiB / 0x80000x1E0000
Calibration0x1E00004 KiB / 0x10000x1E1000
TLV Store0x1E10004 KiB / 0x10000x1E2000
Network Data0x1E20004 KiB / 0x10000x1E3000
User Data0x1E3000116 KiB / 0x1D0000x200000
Tuya Storage0x1ED00076 KiB / 0x130000x200000
+

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/wb3s/wb3s.svg b/boards/wb3s/wb3s.svg new file mode 100644 index 000000000..816c6c65e --- /dev/null +++ b/boards/wb3s/wb3s.svg @@ -0,0 +1,386 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WB3S + + + + + + + + + + + + + + + + + 1 + + + + CEN + + + + + 2 + + + + P23 + + + + ADC3 + + + + TDO + + + + FSO + + + + + 3 + + + + + 4 + + + + P14 + + + + + 5 + + + + P26 + + + + IRDA + + + + PWM5 + + + + + 6 + + + + P24 + + + + PWM4 + + + + + 7 + + + + P6 + + + + PWM0 + + + + + 8 + + + + 3V3 + + + + + 9 + + + + GND + + + + + 10 + + + + P7 + + + + PWM1 + + + + + 11 + + + + P0 + + + + TX2 + + + + SCL2 + + + + + 12 + + + + P1 + + + + RX2 + + + + SDA2 + + + + + 13 + + + + P9 + + + + PWM3 + + + + + 14 + + + + P8 + + + + PWM2 + + + + + 15 + + + + P10 + + + + RX1 + + + + + 16 + + + + P11 + + + + TX1 + + + + + 17 + + + + P23 + + + + ADC3 + + + + TDO + + + + FSO + + + + + 18 + + + + P22 + + + + TDI + + + + FSI + + + + + 19 + + + + P21 + + + + SDA1 + + + + TMS + + + + ___ + FCS + + + + + 20 + + + + P20 + + + + SCL1 + + + + TCK + + + + FSCK + + + + + 21 + + + + + 22 + diff --git a/boards/wblc5.json b/boards/wblc5.json new file mode 100644 index 000000000..89ee15186 --- /dev/null +++ b/boards/wblc5.json @@ -0,0 +1,21 @@ +{ + "_base": [ + "beken-72xx", + "beken-7231", + "beken-7231t", + "beken-7231-tuya", + "ic/bk7231-qfn32", + "pcb/wblc5", + "pcb/wblc5-test" + ], + "build": { + "mcu": "bk7231t", + "variant": "wblc5" + }, + "name": "WBLC5 Wi-Fi Module", + "url": "https://developer.tuya.com/en/docs/iot/wblc5-module-datasheet?id=K9duilns1f3gi", + "vendor": "Tuya Inc.", + "pcb": { + "symbol": "WBLC5" + } +} diff --git a/boards/wblc5/index.html b/boards/wblc5/index.html new file mode 100644 index 000000000..bfaff54a1 --- /dev/null +++ b/boards/wblc5/index.html @@ -0,0 +1,2643 @@ + + + + + + + + + + + + + + + + + + + + + + + + WBLC5 - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

WBLC5 Wi-Fi Module

+

by Tuya Inc.

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codewblc5
MCUBK7231T
ManufacturerBeken
SeriesBK72XX
Frequency120 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O11x GPIO, 3x PWM, 2x UART, 1x ADC
Wi-Fi802.11 b/g/n
BluetoothBLE v4.2
+

Usage

+

Board code: wblc5

+

In platformio.ini:

+
[env:wblc5]
+platform = libretiny
+board = wblc5
+framework = arduino
+
+

In ESPHome YAML:

+
bk72xx:
+  board: wblc5
+
+

Pinout

+

Pinout

+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
P0TX2SCL2
P1RX2SDA2
P6PWM0
P10RX1
P11TX1
P20SCL1TCK
P21SDA1TMS
P22TDI
P23, ADC3TDO
P24PWM4
P26PWM5
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Bootloader0x00000068 KiB / 0x110000x011000
App Image0x0110001.1 MiB / 0x1210000x132000
OTA Image0x132000664 KiB / 0xA60000x1D8000
Key-Value Store0x1D800032 KiB / 0x80000x1E0000
Calibration0x1E00004 KiB / 0x10000x1E1000
TLV Store0x1E10004 KiB / 0x10000x1E2000
Network Data0x1E20004 KiB / 0x10000x1E3000
User Data0x1E3000116 KiB / 0x1D0000x200000
Tuya Storage0x1ED00076 KiB / 0x130000x200000
+

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/wblc5/wblc5.svg b/boards/wblc5/wblc5.svg new file mode 100644 index 000000000..27d693a5a --- /dev/null +++ b/boards/wblc5/wblc5.svg @@ -0,0 +1,277 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WBLC5 + + + + + 1 + + + + ANT + + + + + 3 + + + + P24 + + + + PWM4 + + + + + 5 + + + + P6 + + + + PWM0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 2 + + + + GND + + + + + 4 + + + + P26 + + + + IRDA + + + + PWM5 + + + + + 6 + + + + 3V3 + + + + + CEN + + + + + P10 + + + + RX1 + + + + + P11 + + + + TX1 + + + + + P1 + + + + RX2 + + + + SDA2 + + + + + P0 + + + + TX2 + + + + SCL2 + + + + + P20 + + + + SCL1 + + + + TCK + + + + FSCK + + + + + P21 + + + + SDA1 + + + + TMS + + + + ___ + FCS + + + + + P23 + + + + ADC3 + + + + TDO + + + + FSO + + + + + P22 + + + + TDI + + + + FSI + diff --git a/boards/wr1.json b/boards/wr1.json new file mode 100644 index 000000000..62bcf8d43 --- /dev/null +++ b/boards/wr1.json @@ -0,0 +1,21 @@ +{ + "_base": [ + "realtek-ambz", + "realtek-ambz-2mb-788k", + "ic/rtl8710bn", + "pcb/wr1" + ], + "build": { + "mcu": "rtl8710bn", + "variant": "wr1" + }, + "name": "WR1 Wi-Fi Module", + "url": "https://developer.tuya.com/en/docs/iot/wifiwr1module?id=K9605tc0k90t3", + "vendor": "Tuya Inc.", + "doc": { + "fccid": "2ANDL-WR1" + }, + "pcb": { + "symbol": "WR1" + } +} diff --git a/boards/wr1/index.html b/boards/wr1/index.html new file mode 100644 index 000000000..bab998634 --- /dev/null +++ b/boards/wr1/index.html @@ -0,0 +1,2641 @@ + + + + + + + + + + + + + + + + + + + + + + + + WR1 - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

WR1 Wi-Fi Module

+

by Tuya Inc.

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codewr1
MCURTL8710BN
ManufacturerRealtek
SeriesAmebaZ
Frequency125 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O10x GPIO, 5x PWM, 2x UART, 2x ADC
Wi-Fi802.11 b/g/n
FCC ID2ANDL-WR1
+

Usage

+

Board code: wr1

+

In platformio.ini:

+
[env:wr1]
+platform = libretiny
+board = wr1
+framework = arduino
+
+

In ESPHome YAML:

+
rtl87xx:
+  board: wr1
+
+

Pinout

+

Pinout

+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
PA00PWM2
PA05PWM4
PA14PWM0SWCLK
PA15PWM1SWDIO
PA18RX0SCL1SCK0, SCK1
PA19, ADC1SDA0CS0, CS1
PA22SCL0MISO0, MISO1PWM5
PA23TX0SDA1MOSI0, MOSI1PWM0
PA29RX2SCL0PWM4
PA30TX2SDA0PWM4
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Boot XIP0x00000016 KiB / 0x40000x004000
Boot RAM0x00400016 KiB / 0x40000x008000
(reserved)0x0080004 KiB / 0x10000x009000
System Data0x0090004 KiB / 0x10000x00A000
Calibration0x00A0004 KiB / 0x10000x00B000
OTA1 Image0x00B000788 KiB / 0xC50000x0D0000
OTA2 Image0x0D0000788 KiB / 0xC50000x195000
Key-Value Store0x19500032 KiB / 0x80000x19D000
User Data0x19D000392 KiB / 0x620000x1FF000
RDP0x1FF0004 KiB / 0x10000x200000
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/wr1/wr1.svg b/boards/wr1/wr1.svg new file mode 100644 index 000000000..c1563b7f9 --- /dev/null +++ b/boards/wr1/wr1.svg @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WR1 + + + + + + + + + + + + + + + + + 1 + + + + VCC5 + + + + + 2 + + + + PA23 + + + + TX0 + + + + SDA1 + + + + MOSI0 + + + + MOSI1 + + + + PWM0 + + + + + 3 + + + + PA18 + + + + RX0 + + + + SCL1 + + + + SCK0 + + + + SCK1 + + + + + 4 + + + + 3V3 + + + + + 5 + + + + GND + + + + + 6 + + + + PA14 + + + + PWM0 + + + + SWCLK + + + + + 7 + + + + PA15 + + + + PWM1 + + + + SWDIO + + + + + 8 + + + + PA30 + + + + TX2 + + + + SDA0 + + + + PWM4 + + + + + 9 + + + + PA00 + + + + PWM2 + + + + + 10 + + + + PA05 + + + + PWM4 + + + + + 11 + + + + PA29 + + + + RX2 + + + + SCL0 + + + + PWM4 + + + + + 12 + + + + PA19 + + + + ADC1 + + + + SDA0 + + + + CS0 + + + + CS1 + + + + + 13 + + + + PA22 + + + + SCL0 + + + + MISO0 + + + + MISO1 + + + + PWM5 + + + + + 14 + + + + GND + + + + + 15 + + + + GND + + + + + 16 + + + + CEN + + + + + 17 + + + + ADC2 + + + + + 18 + + + + GND + diff --git a/boards/wr1e.json b/boards/wr1e.json new file mode 100644 index 000000000..00421ae68 --- /dev/null +++ b/boards/wr1e.json @@ -0,0 +1,21 @@ +{ + "_base": [ + "realtek-ambz", + "realtek-ambz-2mb-788k", + "ic/rtl8710bn", + "pcb/wr1e" + ], + "build": { + "mcu": "rtl8710bn", + "variant": "wr1e" + }, + "name": "WR1E Wi-Fi Module", + "url": "https://developer.tuya.com/en/docs/iot/wr1e?id=K96smbbeycxtf", + "vendor": "Tuya Inc.", + "doc": { + "fccid": "2ANDL-WR1E" + }, + "pcb": { + "symbol": "WR1E" + } +} diff --git a/boards/wr1e/index.html b/boards/wr1e/index.html new file mode 100644 index 000000000..b0c97778d --- /dev/null +++ b/boards/wr1e/index.html @@ -0,0 +1,2641 @@ + + + + + + + + + + + + + + + + + + + + + + + + WR1E - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

WR1E Wi-Fi Module

+

by Tuya Inc.

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codewr1e
MCURTL8710BN
ManufacturerRealtek
SeriesAmebaZ
Frequency125 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O10x GPIO, 5x PWM, 2x UART, 2x ADC
Wi-Fi802.11 b/g/n
FCC ID2ANDL-WR1E
+

Usage

+

Board code: wr1e

+

In platformio.ini:

+
[env:wr1e]
+platform = libretiny
+board = wr1e
+framework = arduino
+
+

In ESPHome YAML:

+
rtl87xx:
+  board: wr1e
+
+

Pinout

+

Pinout

+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
PA05PWM4
PA12PWM3
PA14PWM0SWCLK
PA15PWM1SWDIO
PA18RX0SCL1SCK0, SCK1
PA19, ADC1SDA0CS0, CS1
PA22SCL0MISO0, MISO1PWM5
PA23TX0SDA1MOSI0, MOSI1PWM0
PA29RX2SCL0PWM4
PA30TX2SDA0PWM4
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Boot XIP0x00000016 KiB / 0x40000x004000
Boot RAM0x00400016 KiB / 0x40000x008000
(reserved)0x0080004 KiB / 0x10000x009000
System Data0x0090004 KiB / 0x10000x00A000
Calibration0x00A0004 KiB / 0x10000x00B000
OTA1 Image0x00B000788 KiB / 0xC50000x0D0000
OTA2 Image0x0D0000788 KiB / 0xC50000x195000
Key-Value Store0x19500032 KiB / 0x80000x19D000
User Data0x19D000392 KiB / 0x620000x1FF000
RDP0x1FF0004 KiB / 0x10000x200000
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/wr1e/wr1e.svg b/boards/wr1e/wr1e.svg new file mode 100644 index 000000000..769635bcb --- /dev/null +++ b/boards/wr1e/wr1e.svg @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WR1E + + + + + + + + + + + + + + + + + 1 + + + + VCC5 + + + + + 2 + + + + PA23 + + + + TX0 + + + + SDA1 + + + + MOSI0 + + + + MOSI1 + + + + PWM0 + + + + + 3 + + + + PA18 + + + + RX0 + + + + SCL1 + + + + SCK0 + + + + SCK1 + + + + + 4 + + + + 3V3 + + + + + 5 + + + + GND + + + + + 6 + + + + PA14 + + + + PWM0 + + + + SWCLK + + + + + 7 + + + + PA15 + + + + PWM1 + + + + SWDIO + + + + + 8 + + + + PA30 + + + + TX2 + + + + SDA0 + + + + PWM4 + + + + + 9 + + + + PA12 + + + + PWM3 + + + + + 10 + + + + PA05 + + + + PWM4 + + + + + 11 + + + + PA29 + + + + RX2 + + + + SCL0 + + + + PWM4 + + + + + 12 + + + + PA19 + + + + ADC1 + + + + SDA0 + + + + CS0 + + + + CS1 + + + + + 13 + + + + PA22 + + + + SCL0 + + + + MISO0 + + + + MISO1 + + + + PWM5 + + + + + 14 + + + + GND + + + + + 15 + + + + GND + + + + + 16 + + + + CEN + + + + + 17 + + + + ADC2 + + + + + 18 + + + + GND + diff --git a/boards/wr2.json b/boards/wr2.json new file mode 100644 index 000000000..654a2f997 --- /dev/null +++ b/boards/wr2.json @@ -0,0 +1,24 @@ +{ + "_base": [ + "realtek-ambz", + "realtek-ambz-tuya", + "realtek-ambz-2mb-788k", + "ic/rtl8710bn", + "pcb/wr2-base", + "pcb/wr2", + "pcb/wr2-test" + ], + "build": { + "mcu": "rtl8710bn", + "variant": "wr2" + }, + "name": "WR2 Wi-Fi Module", + "url": "https://developer.tuya.com/en/docs/iot/wifiwr2module?id=K9605tko0juc3", + "vendor": "Tuya Inc.", + "doc": { + "fccid": "2ANDL-WR2" + }, + "pcb": { + "symbol": "WR2" + } +} diff --git a/boards/wr2/index.html b/boards/wr2/index.html new file mode 100644 index 000000000..f8ec961cd --- /dev/null +++ b/boards/wr2/index.html @@ -0,0 +1,2639 @@ + + + + + + + + + + + + + + + + + + + + + + + + WR2 - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

WR2 Wi-Fi Module

+

by Tuya Inc.

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codewr2
MCURTL8710BN
ManufacturerRealtek
SeriesAmebaZ
Frequency125 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O9x GPIO, 5x PWM, 2x UART, 1x ADC
Wi-Fi802.11 b/g/n
FCC ID2ANDL-WR2
+

Usage

+

Board code: wr2

+

In platformio.ini:

+
[env:wr2]
+platform = libretiny
+board = wr2
+framework = arduino
+
+

In ESPHome YAML:

+
rtl87xx:
+  board: wr2
+
+

Pinout

+

Pinout

+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
PA00PWM2
PA05PWM4
PA12PWM3
PA14PWM0SWCLK
PA15PWM1SWDIO
PA18RX0SCL1SCK0, SCK1
PA23TX0SDA1MOSI0, MOSI1PWM0
PA29RX2SCL0PWM4
PA30TX2SDA0PWM4
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Boot XIP0x00000016 KiB / 0x40000x004000
Boot RAM0x00400016 KiB / 0x40000x008000
(reserved)0x0080004 KiB / 0x10000x009000
System Data0x0090004 KiB / 0x10000x00A000
Calibration0x00A0004 KiB / 0x10000x00B000
OTA1 Image0x00B000788 KiB / 0xC50000x0D0000
OTA2 Image0x0D0000788 KiB / 0xC50000x195000
Key-Value Store0x19500032 KiB / 0x80000x19D000
User Data0x19D000392 KiB / 0x620000x1FF000
Tuya Storage0x1EB00084 KiB / 0x150000x200000
RDP0x1FF0004 KiB / 0x10000x200000
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/wr2/wr2.svg b/boards/wr2/wr2.svg new file mode 100644 index 000000000..50bbde845 --- /dev/null +++ b/boards/wr2/wr2.svg @@ -0,0 +1,278 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WR2 + + + + + + + + + + + + + + + + + 2 + + + + PA12 + + + + PWM3 + + + + + 4 + + + + PA00 + + + + PWM2 + + + + + 6 + + + + PA05 + + + + PWM4 + + + + + 8 + + + + ADC2 + + + + + 10 + + + + CEN + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + 3V3 + + + + + 3 + + + + GND + + + + + 5 + + + + PA18 + + + + RX0 + + + + SCL1 + + + + + 7 + + + + PA23 + + + + TX0 + + + + SDA1 + + + + PWM0 + + + + + 9 + + + + PA14 + + + + PWM0 + + + + SWCLK + + + + + 11 + + + + PA15 + + + + PWM1 + + + + SWDIO + + + + + PA30 + + + + TX2 + + + + SDA0 + + + + PWM4 + + + + + PA29 + + + + RX2 + + + + SCL0 + + + + PWM4 + diff --git a/boards/wr2e.json b/boards/wr2e.json new file mode 100644 index 000000000..0157b6b83 --- /dev/null +++ b/boards/wr2e.json @@ -0,0 +1,24 @@ +{ + "_base": [ + "realtek-ambz", + "realtek-ambz-tuya", + "realtek-ambz-2mb-788k", + "ic/rtl8710bn", + "pcb/wr2-base", + "pcb/wr2e", + "pcb/wr2e-test" + ], + "build": { + "mcu": "rtl8710bn", + "variant": "wr2e" + }, + "name": "WR2E Wi-Fi Module", + "url": "https://developer.tuya.com/en/docs/iot/wr2e?id=K97scnsjhue4h", + "vendor": "Tuya Inc.", + "doc": { + "fccid": "2ANDL-WR2E" + }, + "pcb": { + "symbol": "WR2E" + } +} diff --git a/boards/wr2e/index.html b/boards/wr2e/index.html new file mode 100644 index 000000000..b185b2253 --- /dev/null +++ b/boards/wr2e/index.html @@ -0,0 +1,2639 @@ + + + + + + + + + + + + + + + + + + + + + + + + WR2E - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

WR2E Wi-Fi Module

+

by Tuya Inc.

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codewr2e
MCURTL8710BN
ManufacturerRealtek
SeriesAmebaZ
Frequency125 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O9x GPIO, 4x PWM, 2x UART, 2x ADC
Wi-Fi802.11 b/g/n
FCC ID2ANDL-WR2E
+

Usage

+

Board code: wr2e

+

In platformio.ini:

+
[env:wr2e]
+platform = libretiny
+board = wr2e
+framework = arduino
+
+

In ESPHome YAML:

+
rtl87xx:
+  board: wr2e
+
+

Pinout

+

Pinout

+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
PA05PWM4
PA12PWM3
PA14PWM0SWCLK
PA15PWM1SWDIO
PA18RX0SCL1SCK0, SCK1
PA19, ADC1CS0, CS1
PA23TX0SDA1MOSI0, MOSI1PWM0
PA29RX2SCL0PWM4
PA30TX2PWM4
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Boot XIP0x00000016 KiB / 0x40000x004000
Boot RAM0x00400016 KiB / 0x40000x008000
(reserved)0x0080004 KiB / 0x10000x009000
System Data0x0090004 KiB / 0x10000x00A000
Calibration0x00A0004 KiB / 0x10000x00B000
OTA1 Image0x00B000788 KiB / 0xC50000x0D0000
OTA2 Image0x0D0000788 KiB / 0xC50000x195000
Key-Value Store0x19500032 KiB / 0x80000x19D000
User Data0x19D000392 KiB / 0x620000x1FF000
Tuya Storage0x1EB00084 KiB / 0x150000x200000
RDP0x1FF0004 KiB / 0x10000x200000
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/wr2e/wr2e.svg b/boards/wr2e/wr2e.svg new file mode 100644 index 000000000..14c722b09 --- /dev/null +++ b/boards/wr2e/wr2e.svg @@ -0,0 +1,274 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WR2E + + + + + + + + + + + + + + + + + 2 + + + + PA12 + + + + PWM3 + + + + + 4 + + + + PA19 + + + + ADC1 + + + + + 6 + + + + PA05 + + + + PWM4 + + + + + 8 + + + + ADC2 + + + + + 10 + + + + CEN + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1 + + + + 3V3 + + + + + 3 + + + + GND + + + + + 5 + + + + PA18 + + + + RX0 + + + + SCL1 + + + + + 7 + + + + PA23 + + + + TX0 + + + + SDA1 + + + + PWM0 + + + + + 9 + + + + PA14 + + + + PWM0 + + + + SWCLK + + + + + 11 + + + + PA15 + + + + PWM1 + + + + SWDIO + + + + + PA30 + + + + TX2 + + + + PWM4 + + + + + PA29 + + + + RX2 + + + + SCL0 + + + + PWM4 + diff --git a/boards/wr2l.json b/boards/wr2l.json new file mode 100644 index 000000000..4225f7b6d --- /dev/null +++ b/boards/wr2l.json @@ -0,0 +1,24 @@ +{ + "_base": [ + "realtek-ambz", + "realtek-ambz-tuya", + "realtek-ambz-2mb-788k", + "realtek-ambz-bx", + "ic/rtl8710bn", + "pcb/wr2l-base", + "pcb/wr2l" + ], + "build": { + "mcu": "rtl8710bx", + "variant": "wr2l" + }, + "name": "WR2L Wi-Fi Module", + "url": "https://developer.tuya.com/en/docs/iot/wifiwr2lmodule?id=K9605tnbj7gva", + "vendor": "Tuya Inc.", + "doc": { + "fccid": "2ANDL-WR2L" + }, + "pcb": { + "symbol": "WR2L" + } +} diff --git a/boards/wr2l/index.html b/boards/wr2l/index.html new file mode 100644 index 000000000..8332813a8 --- /dev/null +++ b/boards/wr2l/index.html @@ -0,0 +1,2607 @@ + + + + + + + + + + + + + + + + + + + + + + + + WR2L - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

WR2L Wi-Fi Module

+

by Tuya Inc.

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codewr2l
MCURTL8710BX
ManufacturerRealtek
SeriesAmebaZ
Frequency62.5 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O5x GPIO, 4x PWM, 1x UART, 1x ADC
Wi-Fi802.11 b/g/n
FCC ID2ANDL-WR2L
+

Usage

+

Board code: wr2l

+

In platformio.ini:

+
[env:wr2l]
+platform = libretiny
+board = wr2l
+framework = arduino
+
+

In ESPHome YAML:

+
rtl87xx:
+  board: wr2l
+
+

Pinout

+

Pinout

+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
PA05PWM4
PA12PWM3
PA14PWM0SWCLK
PA15PWM1SWDIO
PA19, ADC1
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Boot XIP0x00000016 KiB / 0x40000x004000
Boot RAM0x00400016 KiB / 0x40000x008000
(reserved)0x0080004 KiB / 0x10000x009000
System Data0x0090004 KiB / 0x10000x00A000
Calibration0x00A0004 KiB / 0x10000x00B000
OTA1 Image0x00B000788 KiB / 0xC50000x0D0000
OTA2 Image0x0D0000788 KiB / 0xC50000x195000
Key-Value Store0x19500032 KiB / 0x80000x19D000
User Data0x19D000392 KiB / 0x620000x1FF000
Tuya Storage0x1EB00084 KiB / 0x150000x200000
RDP0x1FF0004 KiB / 0x10000x200000
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/wr2l/wr2l.svg b/boards/wr2l/wr2l.svg new file mode 100644 index 000000000..eeec5a225 --- /dev/null +++ b/boards/wr2l/wr2l.svg @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WR2L + + + + + + + + + + + + + + + + + 1 + + + + PA15 + + + + PWM1 + + + + SWDIO + + + + + 2 + + + + PA14 + + + + PWM0 + + + + SWCLK + + + + + 3 + + + + PA05 + + + + PWM4 + + + + + 4 + + + + PA19 + + + + ADC1 + + + + + 5 + + + + PA12 + + + + PWM3 + + + + + 6 + + + + GND + + + + + 7 + + + + 3V3 + diff --git a/boards/wr2le.json b/boards/wr2le.json new file mode 100644 index 000000000..c60d6eb68 --- /dev/null +++ b/boards/wr2le.json @@ -0,0 +1,21 @@ +{ + "_base": [ + "realtek-ambz", + "realtek-ambz-tuya", + "realtek-ambz-2mb-788k", + "realtek-ambz-bx", + "ic/rtl8710bn", + "pcb/wr2l-base", + "pcb/wr2le" + ], + "build": { + "mcu": "rtl8710bx", + "variant": "wr2le" + }, + "name": "WR2LE Wi-Fi Module", + "url": "https://developer.tuya.com/en/docs/iot/wr2le?id=K9eio9y9e8i8c", + "vendor": "Tuya Inc.", + "pcb": { + "symbol": "WR2LE" + } +} diff --git a/boards/wr2le/index.html b/boards/wr2le/index.html new file mode 100644 index 000000000..42cea9875 --- /dev/null +++ b/boards/wr2le/index.html @@ -0,0 +1,2603 @@ + + + + + + + + + + + + + + + + + + + + + + + + WR2LE - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

WR2LE Wi-Fi Module

+

by Tuya Inc.

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codewr2le
MCURTL8710BX
ManufacturerRealtek
SeriesAmebaZ
Frequency62.5 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O5x GPIO, 5x PWM, 1x UART
Wi-Fi802.11 b/g/n
+

Usage

+

Board code: wr2le

+

In platformio.ini:

+
[env:wr2le]
+platform = libretiny
+board = wr2le
+framework = arduino
+
+

In ESPHome YAML:

+
rtl87xx:
+  board: wr2le
+
+

Pinout

+

Pinout

+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
PA05PWM4
PA12PWM3
PA14PWM0SWCLK
PA15PWM1SWDIO
PA22PWM5
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Boot XIP0x00000016 KiB / 0x40000x004000
Boot RAM0x00400016 KiB / 0x40000x008000
(reserved)0x0080004 KiB / 0x10000x009000
System Data0x0090004 KiB / 0x10000x00A000
Calibration0x00A0004 KiB / 0x10000x00B000
OTA1 Image0x00B000788 KiB / 0xC50000x0D0000
OTA2 Image0x0D0000788 KiB / 0xC50000x195000
Key-Value Store0x19500032 KiB / 0x80000x19D000
User Data0x19D000392 KiB / 0x620000x1FF000
Tuya Storage0x1EB00084 KiB / 0x150000x200000
RDP0x1FF0004 KiB / 0x10000x200000
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/wr2le/wr2le.svg b/boards/wr2le/wr2le.svg new file mode 100644 index 000000000..44bfea7bb --- /dev/null +++ b/boards/wr2le/wr2le.svg @@ -0,0 +1,161 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WR2LE + + + + + + + + + + + + + + + + + 1 + + + + PA15 + + + + PWM1 + + + + SWDIO + + + + + 2 + + + + PA14 + + + + PWM0 + + + + SWCLK + + + + + 3 + + + + PA05 + + + + PWM4 + + + + + 4 + + + + PA22 + + + + PWM5 + + + + + 5 + + + + PA12 + + + + PWM3 + + + + + 6 + + + + GND + + + + + 7 + + + + 3V3 + diff --git a/boards/wr3.json b/boards/wr3.json new file mode 100644 index 000000000..b36440620 --- /dev/null +++ b/boards/wr3.json @@ -0,0 +1,23 @@ +{ + "_base": [ + "realtek-ambz", + "realtek-ambz-tuya", + "realtek-ambz-2mb-788k", + "ic/rtl8710bn", + "pcb/wr3-base", + "pcb/wr3" + ], + "build": { + "mcu": "rtl8710bn", + "variant": "wr3" + }, + "name": "WR3 Wi-Fi Module", + "url": "https://developer.tuya.com/en/docs/iot/wr3-module-datasheet?id=K9g3ainzbj9z1", + "vendor": "Tuya Inc.", + "doc": { + "fccid": "2ANDL-WR3" + }, + "pcb": { + "symbol": "WR3" + } +} diff --git a/boards/wr3/index.html b/boards/wr3/index.html new file mode 100644 index 000000000..2dab2aa98 --- /dev/null +++ b/boards/wr3/index.html @@ -0,0 +1,2655 @@ + + + + + + + + + + + + + + + + + + + + + + + + WR3 - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

WR3 Wi-Fi Module

+

by Tuya Inc.

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codewr3
MCURTL8710BN
ManufacturerRealtek
SeriesAmebaZ
Frequency125 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O11x GPIO, 6x PWM, 2x UART, 2x ADC
Wi-Fi802.11 b/g/n
FCC ID2ANDL-WR3
+

Usage

+

Board code: wr3

+

In platformio.ini:

+
[env:wr3]
+platform = libretiny
+board = wr3
+framework = arduino
+
+

In ESPHome YAML:

+
rtl87xx:
+  board: wr3
+
+

Pinout

+

Pinout

+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
PA00PWM2
PA05PWM4
PA12PWM3
PA14PWM0SWCLK
PA15PWM1SWDIO
PA18RX0SCL1SCK0, SCK1
PA19, ADC1SDA0CS0, CS1
PA22SCL0MISO0, MISO1PWM5
PA23TX0SDA1MOSI0, MOSI1PWM0
PA29RX2SCL0PWM4
PA30TX2SDA0PWM4
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Boot XIP0x00000016 KiB / 0x40000x004000
Boot RAM0x00400016 KiB / 0x40000x008000
(reserved)0x0080004 KiB / 0x10000x009000
System Data0x0090004 KiB / 0x10000x00A000
Calibration0x00A0004 KiB / 0x10000x00B000
OTA1 Image0x00B000788 KiB / 0xC50000x0D0000
OTA2 Image0x0D0000788 KiB / 0xC50000x195000
Key-Value Store0x19500032 KiB / 0x80000x19D000
User Data0x19D000392 KiB / 0x620000x1FF000
Tuya Storage0x1EB00084 KiB / 0x150000x200000
RDP0x1FF0004 KiB / 0x10000x200000
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/wr3/wr3.svg b/boards/wr3/wr3.svg new file mode 100644 index 000000000..245eee061 --- /dev/null +++ b/boards/wr3/wr3.svg @@ -0,0 +1,321 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WR3 + + + + + + + + + + + + + + + + + 1 + + + + + 2 + + + + PA22 + + + + SCL0 + + + + MISO0 + + + + MISO1 + + + + PWM5 + + + + + 3 + + + + CEN + + + + + 4 + + + + PA19 + + + + ADC1 + + + + SDA0 + + + + CS0 + + + + CS1 + + + + + 5 + + + + PA14 + + + + PWM0 + + + + SWCLK + + + + + 6 + + + + PA15 + + + + PWM1 + + + + SWDIO + + + + + 7 + + + + PA00 + + + + PWM2 + + + + + 8 + + + + 3V3 + + + + + 9 + + + + GND + + + + + 10 + + + + ADC2 + + + + + 11 + + + + PA29 + + + + RX2 + + + + SCL0 + + + + PWM4 + + + + + 12 + + + + PA30 + + + + TX2 + + + + SDA0 + + + + PWM4 + + + + + 13 + + + + PA05 + + + + PWM4 + + + + + 14 + + + + PA12 + + + + PWM3 + + + + + 15 + + + + PA18 + + + + RX0 + + + + SCL1 + + + + SCK0 + + + + SCK1 + + + + + 16 + + + + PA23 + + + + TX0 + + + + SDA1 + + + + MOSI0 + + + + MOSI1 + + + + PWM0 + diff --git a/boards/wr3e.json b/boards/wr3e.json new file mode 100644 index 000000000..853346837 --- /dev/null +++ b/boards/wr3e.json @@ -0,0 +1,23 @@ +{ + "_base": [ + "realtek-ambz", + "realtek-ambz-tuya", + "realtek-ambz-2mb-788k", + "ic/rtl8710bn", + "pcb/wr3-base", + "pcb/wr3e" + ], + "build": { + "mcu": "rtl8710bn", + "variant": "wr3e" + }, + "name": "WR3E Wi-Fi Module", + "url": "https://developer.tuya.com/en/docs/iot/wr3e-module-datasheet?id=K9elwlqbfosbc", + "vendor": "Tuya Inc.", + "doc": { + "fccid": "2ANDL-WR3E" + }, + "pcb": { + "symbol": "WR3E" + } +} diff --git a/boards/wr3e/index.html b/boards/wr3e/index.html new file mode 100644 index 000000000..837d94cba --- /dev/null +++ b/boards/wr3e/index.html @@ -0,0 +1,2655 @@ + + + + + + + + + + + + + + + + + + + + + + + + WR3E - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

WR3E Wi-Fi Module

+

by Tuya Inc.

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codewr3e
MCURTL8710BN
ManufacturerRealtek
SeriesAmebaZ
Frequency125 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O11x GPIO, 6x PWM, 2x UART, 2x ADC
Wi-Fi802.11 b/g/n
FCC ID2ANDL-WR3E
+

Usage

+

Board code: wr3e

+

In platformio.ini:

+
[env:wr3e]
+platform = libretiny
+board = wr3e
+framework = arduino
+
+

In ESPHome YAML:

+
rtl87xx:
+  board: wr3e
+
+

Pinout

+

Pinout

+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
PA00PWM2
PA05PWM4
PA12PWM3
PA14PWM0SWCLK
PA15PWM1SWDIO
PA18RX0SCL1SCK0, SCK1
PA19, ADC1SDA0CS0, CS1
PA22SCL0MISO0, MISO1PWM5
PA23TX0SDA1MOSI0, MOSI1PWM0
PA29RX2SCL0PWM4
PA30TX2SDA0PWM4
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Boot XIP0x00000016 KiB / 0x40000x004000
Boot RAM0x00400016 KiB / 0x40000x008000
(reserved)0x0080004 KiB / 0x10000x009000
System Data0x0090004 KiB / 0x10000x00A000
Calibration0x00A0004 KiB / 0x10000x00B000
OTA1 Image0x00B000788 KiB / 0xC50000x0D0000
OTA2 Image0x0D0000788 KiB / 0xC50000x195000
Key-Value Store0x19500032 KiB / 0x80000x19D000
User Data0x19D000392 KiB / 0x620000x1FF000
Tuya Storage0x1EB00084 KiB / 0x150000x200000
RDP0x1FF0004 KiB / 0x10000x200000
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/wr3e/wr3e.svg b/boards/wr3e/wr3e.svg new file mode 100644 index 000000000..792d4aeb9 --- /dev/null +++ b/boards/wr3e/wr3e.svg @@ -0,0 +1,321 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WR3E + + + + + + + + + + + + + + + + + 1 + + + + + 2 + + + + ADC2 + + + + + 3 + + + + CEN + + + + + 4 + + + + PA29 + + + + RX2 + + + + SCL0 + + + + PWM4 + + + + + 5 + + + + PA14 + + + + PWM0 + + + + SWCLK + + + + + 6 + + + + PA15 + + + + PWM1 + + + + SWDIO + + + + + 7 + + + + PA22 + + + + SCL0 + + + + MISO0 + + + + MISO1 + + + + PWM5 + + + + + 8 + + + + 3V3 + + + + + 9 + + + + GND + + + + + 10 + + + + PA00 + + + + PWM2 + + + + + 11 + + + + PA30 + + + + TX2 + + + + SDA0 + + + + PWM4 + + + + + 12 + + + + PA19 + + + + ADC1 + + + + SDA0 + + + + CS0 + + + + CS1 + + + + + 13 + + + + PA05 + + + + PWM4 + + + + + 14 + + + + PA12 + + + + PWM3 + + + + + 15 + + + + PA18 + + + + RX0 + + + + SCL1 + + + + SCK0 + + + + SCK1 + + + + + 16 + + + + PA23 + + + + TX0 + + + + SDA1 + + + + MOSI0 + + + + MOSI1 + + + + PWM0 + diff --git a/boards/wr3l.json b/boards/wr3l.json new file mode 100644 index 000000000..0bda55d98 --- /dev/null +++ b/boards/wr3l.json @@ -0,0 +1,24 @@ +{ + "_base": [ + "realtek-ambz", + "realtek-ambz-tuya", + "realtek-ambz-2mb-788k", + "realtek-ambz-bx", + "ic/rtl8710bn", + "pcb/wr3l-base", + "pcb/wr3" + ], + "build": { + "mcu": "rtl8710bx", + "variant": "wr3l" + }, + "name": "WR3L Wi-Fi Module", + "url": "https://developer.tuya.com/en/docs/iot/wifiwr3lmodule?id=K9605tt0kveqm", + "vendor": "Tuya Inc.", + "doc": { + "fccid": "2ANDL-WR3L" + }, + "pcb": { + "symbol": "WR3L" + } +} diff --git a/boards/wr3l/index.html b/boards/wr3l/index.html new file mode 100644 index 000000000..b320b8b00 --- /dev/null +++ b/boards/wr3l/index.html @@ -0,0 +1,2655 @@ + + + + + + + + + + + + + + + + + + + + + + + + WR3L - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

WR3L Wi-Fi Module

+

by Tuya Inc.

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codewr3l
MCURTL8710BX
ManufacturerRealtek
SeriesAmebaZ
Frequency62.5 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O11x GPIO, 6x PWM, 2x UART, 2x ADC
Wi-Fi802.11 b/g/n
FCC ID2ANDL-WR3L
+

Usage

+

Board code: wr3l

+

In platformio.ini:

+
[env:wr3l]
+platform = libretiny
+board = wr3l
+framework = arduino
+
+

In ESPHome YAML:

+
rtl87xx:
+  board: wr3l
+
+

Pinout

+

Pinout

+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
PA00PWM2
PA05PWM4
PA12PWM3
PA14PWM0SWCLK
PA15PWM1SWDIO
PA18RX0SCL1SCK0, SCK1
PA19, ADC1SDA0CS0, CS1
PA22SCL0MISO0, MISO1PWM5
PA23TX0SDA1MOSI0, MOSI1PWM0
PA29RX2SCL0PWM4
PA30TX2SDA0PWM4
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Boot XIP0x00000016 KiB / 0x40000x004000
Boot RAM0x00400016 KiB / 0x40000x008000
(reserved)0x0080004 KiB / 0x10000x009000
System Data0x0090004 KiB / 0x10000x00A000
Calibration0x00A0004 KiB / 0x10000x00B000
OTA1 Image0x00B000788 KiB / 0xC50000x0D0000
OTA2 Image0x0D0000788 KiB / 0xC50000x195000
Key-Value Store0x19500032 KiB / 0x80000x19D000
User Data0x19D000392 KiB / 0x620000x1FF000
Tuya Storage0x1EB00084 KiB / 0x150000x200000
RDP0x1FF0004 KiB / 0x10000x200000
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/wr3l/wr3l.svg b/boards/wr3l/wr3l.svg new file mode 100644 index 000000000..a4e985834 --- /dev/null +++ b/boards/wr3l/wr3l.svg @@ -0,0 +1,321 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WR3L + + + + + + + + + + + + + + + + + 1 + + + + + 2 + + + + PA22 + + + + SCL0 + + + + MISO0 + + + + MISO1 + + + + PWM5 + + + + + 3 + + + + CEN + + + + + 4 + + + + PA19 + + + + ADC1 + + + + SDA0 + + + + CS0 + + + + CS1 + + + + + 5 + + + + PA14 + + + + PWM0 + + + + SWCLK + + + + + 6 + + + + PA15 + + + + PWM1 + + + + SWDIO + + + + + 7 + + + + PA00 + + + + PWM2 + + + + + 8 + + + + 3V3 + + + + + 9 + + + + GND + + + + + 10 + + + + ADC2 + + + + + 11 + + + + PA29 + + + + RX2 + + + + SCL0 + + + + PWM4 + + + + + 12 + + + + PA30 + + + + TX2 + + + + SDA0 + + + + PWM4 + + + + + 13 + + + + PA05 + + + + PWM4 + + + + + 14 + + + + PA12 + + + + PWM3 + + + + + 15 + + + + PA18 + + + + RX0 + + + + SCL1 + + + + SCK0 + + + + SCK1 + + + + + 16 + + + + PA23 + + + + TX0 + + + + SDA1 + + + + MOSI0 + + + + MOSI1 + + + + PWM0 + diff --git a/boards/wr3le.json b/boards/wr3le.json new file mode 100644 index 000000000..a06a6ed79 --- /dev/null +++ b/boards/wr3le.json @@ -0,0 +1,24 @@ +{ + "_base": [ + "realtek-ambz", + "realtek-ambz-tuya", + "realtek-ambz-2mb-788k", + "realtek-ambz-bx", + "ic/rtl8710bn", + "pcb/wr3l-base", + "pcb/wr3e" + ], + "build": { + "mcu": "rtl8710bx", + "variant": "wr3le" + }, + "name": "WR3LE Wi-Fi Module", + "url": "https://developer.tuya.com/en/docs/iot/wr3le?id=K986l7a1ha8tm", + "vendor": "Tuya Inc.", + "doc": { + "fccid": "2ANDL-WR3LE" + }, + "pcb": { + "symbol": "WR3LE" + } +} diff --git a/boards/wr3le/index.html b/boards/wr3le/index.html new file mode 100644 index 000000000..c9aeb7dad --- /dev/null +++ b/boards/wr3le/index.html @@ -0,0 +1,2655 @@ + + + + + + + + + + + + + + + + + + + + + + + + WR3LE - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

WR3LE Wi-Fi Module

+

by Tuya Inc.

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codewr3le
MCURTL8710BX
ManufacturerRealtek
SeriesAmebaZ
Frequency62.5 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O11x GPIO, 6x PWM, 2x UART, 2x ADC
Wi-Fi802.11 b/g/n
FCC ID2ANDL-WR3LE
+

Usage

+

Board code: wr3le

+

In platformio.ini:

+
[env:wr3le]
+platform = libretiny
+board = wr3le
+framework = arduino
+
+

In ESPHome YAML:

+
rtl87xx:
+  board: wr3le
+
+

Pinout

+

Pinout

+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
PA00PWM2
PA05PWM4
PA12PWM3
PA14PWM0SWCLK
PA15PWM1SWDIO
PA18RX0SCL1SCK0, SCK1
PA19, ADC1SDA0CS0, CS1
PA22SCL0MISO0, MISO1PWM5
PA23TX0SDA1MOSI0, MOSI1PWM0
PA29RX2SCL0PWM4
PA30TX2SDA0PWM4
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Boot XIP0x00000016 KiB / 0x40000x004000
Boot RAM0x00400016 KiB / 0x40000x008000
(reserved)0x0080004 KiB / 0x10000x009000
System Data0x0090004 KiB / 0x10000x00A000
Calibration0x00A0004 KiB / 0x10000x00B000
OTA1 Image0x00B000788 KiB / 0xC50000x0D0000
OTA2 Image0x0D0000788 KiB / 0xC50000x195000
Key-Value Store0x19500032 KiB / 0x80000x19D000
User Data0x19D000392 KiB / 0x620000x1FF000
Tuya Storage0x1EB00084 KiB / 0x150000x200000
RDP0x1FF0004 KiB / 0x10000x200000
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/wr3le/wr3le.svg b/boards/wr3le/wr3le.svg new file mode 100644 index 000000000..104005730 --- /dev/null +++ b/boards/wr3le/wr3le.svg @@ -0,0 +1,321 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WR3LE + + + + + + + + + + + + + + + + + 1 + + + + + 2 + + + + ADC2 + + + + + 3 + + + + CEN + + + + + 4 + + + + PA29 + + + + RX2 + + + + SCL0 + + + + PWM4 + + + + + 5 + + + + PA14 + + + + PWM0 + + + + SWCLK + + + + + 6 + + + + PA15 + + + + PWM1 + + + + SWDIO + + + + + 7 + + + + PA22 + + + + SCL0 + + + + MISO0 + + + + MISO1 + + + + PWM5 + + + + + 8 + + + + 3V3 + + + + + 9 + + + + GND + + + + + 10 + + + + PA00 + + + + PWM2 + + + + + 11 + + + + PA30 + + + + TX2 + + + + SDA0 + + + + PWM4 + + + + + 12 + + + + PA19 + + + + ADC1 + + + + SDA0 + + + + CS0 + + + + CS1 + + + + + 13 + + + + PA05 + + + + PWM4 + + + + + 14 + + + + PA12 + + + + PWM3 + + + + + 15 + + + + PA18 + + + + RX0 + + + + SCL1 + + + + SCK0 + + + + SCK1 + + + + + 16 + + + + PA23 + + + + TX0 + + + + SDA1 + + + + MOSI0 + + + + MOSI1 + + + + PWM0 + diff --git a/boards/wr3n.json b/boards/wr3n.json new file mode 100644 index 000000000..0a5c404d2 --- /dev/null +++ b/boards/wr3n.json @@ -0,0 +1,23 @@ +{ + "_base": [ + "realtek-ambz", + "realtek-ambz-tuya", + "realtek-ambz-2mb-788k", + "ic/rtl8710bn", + "pcb/wr3-base", + "pcb/wr3n" + ], + "build": { + "mcu": "rtl8710bn", + "variant": "wr3n" + }, + "name": "WR3N Wi-Fi Module", + "url": "https://developer.tuya.com/en/docs/iot/wr3n-datasheet?id=K98zdx31ztdge", + "vendor": "Tuya Inc.", + "doc": { + "fccid": "2ANDL-WR3N" + }, + "pcb": { + "symbol": "WR3N" + } +} diff --git a/boards/wr3n/index.html b/boards/wr3n/index.html new file mode 100644 index 000000000..8a4193e67 --- /dev/null +++ b/boards/wr3n/index.html @@ -0,0 +1,2639 @@ + + + + + + + + + + + + + + + + + + + + + + + + WR3N - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

WR3N Wi-Fi Module

+

by Tuya Inc.

+

Product page

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterValue
Board codewr3n
MCURTL8710BN
ManufacturerRealtek
SeriesAmebaZ
Frequency125 MHz
Flash size2 MiB
RAM size256 KiB
Voltage3.0V - 3.6V
I/O9x GPIO, 5x PWM, 2x UART, 1x ADC
Wi-Fi802.11 b/g/n
FCC ID2ANDL-WR3N
+

Usage

+

Board code: wr3n

+

In platformio.ini:

+
[env:wr3n]
+platform = libretiny
+board = wr3n
+framework = arduino
+
+

In ESPHome YAML:

+
rtl87xx:
+  board: wr3n
+
+

Pinout

+

Pinout

+

Pin functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name(s)UARTI²CSPIPWMOther
PA00PWM2
PA05PWM4
PA12PWM3
PA14PWM0SWCLK
PA15PWM1SWDIO
PA18RX0SCL1SCK0, SCK1
PA23TX0SDA1MOSI0, MOSI1PWM0
PA29RX2SCL0PWM4
PA30TX2SDA0PWM4
+

Flash memory map

+

Flash size: 2 MiB / 2,097,152 B / 0x200000

+

Hex values are in bytes.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameStartLengthEnd
Boot XIP0x00000016 KiB / 0x40000x004000
Boot RAM0x00400016 KiB / 0x40000x008000
(reserved)0x0080004 KiB / 0x10000x009000
System Data0x0090004 KiB / 0x10000x00A000
Calibration0x00A0004 KiB / 0x10000x00B000
OTA1 Image0x00B000788 KiB / 0xC50000x0D0000
OTA2 Image0x0D0000788 KiB / 0xC50000x195000
Key-Value Store0x19500032 KiB / 0x80000x19D000
User Data0x19D000392 KiB / 0x620000x1FF000
Tuya Storage0x1EB00084 KiB / 0x150000x200000
RDP0x1FF0004 KiB / 0x10000x200000
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/boards/wr3n/wr3n.svg b/boards/wr3n/wr3n.svg new file mode 100644 index 000000000..c59dc194c --- /dev/null +++ b/boards/wr3n/wr3n.svg @@ -0,0 +1,281 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WR3N + + + + + + + + + + + + + + + + + 1 + + + + + 2 + + + + ADC2 + + + + + 3 + + + + CEN + + + + + 4 + + + + PA29 + + + + RX2 + + + + SCL0 + + + + PWM4 + + + + + 5 + + + + PA14 + + + + PWM0 + + + + SWCLK + + + + + 6 + + + + PA15 + + + + PWM1 + + + + SWDIO + + + + + 7 + + + + PA00 + + + + PWM2 + + + + + 8 + + + + 3V3 + + + + + 9 + + + + GND + + + + + 10 + + + + + 11 + + + + PA30 + + + + TX2 + + + + SDA0 + + + + PWM4 + + + + + 12 + + + + + 13 + + + + PA05 + + + + PWM4 + + + + + 14 + + + + PA12 + + + + PWM3 + + + + + 15 + + + + PA18 + + + + RX0 + + + + SCL1 + + + + SCK0 + + + + SCK1 + + + + + 16 + + + + PA23 + + + + TX0 + + + + SDA1 + + + + MOSI0 + + + + MOSI1 + + + + PWM0 + diff --git a/builder/family/beken-72xx.py b/builder/family/beken-72xx.py new file mode 100644 index 000000000..534a4e518 --- /dev/null +++ b/builder/family/beken-72xx.py @@ -0,0 +1,551 @@ +# Copyright (c) Kuba Szczodrzyński 2022-06-13. + +from os.path import join + +from platformio.platform.board import PlatformBoardConfig +from SCons.Script import DefaultEnvironment, Environment + +env: Environment = DefaultEnvironment() +board: PlatformBoardConfig = env.BoardConfig() +queue = env.AddLibraryQueue("beken-72xx") +env.ConfigureFamily() + +ROOT_DIR = join("$SDK_DIR", "beken378") +APP_DIR = join(ROOT_DIR, "app") +DRIVER_DIR = join(ROOT_DIR, "driver") +FUNC_DIR = join(ROOT_DIR, "func") + +# Load sys_config.h into env +env.LoadConfig(join("$FAMILY_DIR", "base", "config", "sys_config.h")) + +# Define vars used during build +SOC_BK7231 = 1 +SOC_BK7231U = 2 +SOC_BK7221U = 3 +SOC_BK7251 = 3 +SOC_BK7271 = 4 +SOC_BK7231N = 5 +SOC_BK7236 = 6 +SOC_NAMES = { + SOC_BK7231: "bk7231u", + SOC_BK7231U: "bk7231u", + SOC_BK7251: "bk7251", + SOC_BK7271: "bk7271", + SOC_BK7231N: "bk7231n", + SOC_BK7236: "bk7236", +} +SOC = env.Cfg("CFG_SOC_NAME") +WPA_VERSION = "wpa_supplicant_2_9" if env.Cfg("CFG_USE_WPA_29") else "hostapd-2.5" + +# Flags +queue.AppendPublic( + CCFLAGS=[ + "-mcpu=arm968e-s", + "-march=armv5te", + "-mthumb", + "-mthumb-interwork", + "-Wno-write-strings", + "-Wno-attributes", + # anything higher, like -O2 or -Os, causes random issues + # like bootlooping, missing (blank) strings, random lockups during boot + "+<-O1>", + "-<-Os>", + ], + CPPDEFINES=[ + # SDK options + ("CFG_OS_FREERTOS", "1"), + ("MBEDTLS_CONFIG_FILE", r"\"tls_config.h\""), + ("WIFI_BLE_COEXIST", "1"), + ("WOLFSSL_BEKEN", env.Cfg("CFG_WPA3")), + "MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED", + ("INCLUDE_xTaskGetHandle", "1"), + ], + ASFLAGS=[ + "-mcpu=arm968e-s", + "-march=armv5te", + "-marm", + "-mthumb-interwork", + "-g", + "-x", + "assembler-with-cpp", + ], + LINKFLAGS=[ + "-mcpu=arm968e-s", + "-marm", + "-mthumb-interwork", + "--specs=nano.specs", + "-Wl,-wrap,bk_flash_get_info", + "-Wl,-wrap,bk_flash_erase", + "-Wl,-wrap,bk_flash_write", + "-Wl,-wrap,bk_flash_read", + # stdio wrappers (base/port/printf.c) + "-Wl,-wrap,bk_printf", + ], +) +queue.AppendPrivate( + CCFLAGS=[ + "-Wno-comment", + "-Wno-char-subscripts", + "-Wno-missing-braces", + "-Wno-return-type", + ], + CFLAGS=[ + "-Wno-format", + "-Wno-unknown-pragmas", + ], +) + +srcs_core = [] + +# Fix for BK7231T's bootloader compatibility +if board.get("build.bkboot_version") in ["1.0.5-bk7231s", "bk7231q"]: + # this has to be public, so that fixups/intc.c sees it + queue.AppendPublic(CPPDEFINES=[("CFG_SUPPORT_BOOTLOADER", "1")]) + queue.AddLibrary( + name="bdk_boot", + base_dir="$CORES_DIR/beken-72xx/base/fixups", + srcs=["+"], + ) +else: + srcs_core.append("+") + +# Sources - from framework-beken-bdk/beken378/beken_src.mk +queue.AddLibrary( + name="bdk_core", + base_dir=ROOT_DIR, + srcs=[ + "+", + "+", + "+", + "+", + *srcs_core, + ], + includes=[ + "+", + "+", + "+", + "+", + "+", + "+", + "+<../release>", + ], +) + +# Sources - app module +queue.AddLibrary( + name="bdk_app", + base_dir=APP_DIR, + srcs=[ + "+", + "+", + "+", + "+", + "+", + ], + includes=[ + "+", + "+", + "+", + "+", + "+", + ], +) + +# Sources - drivers +queue.AddLibrary( + name="bdk_driver", + base_dir=DRIVER_DIR, + srcs=[ + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "-", + "-", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + ], + includes=[ + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+<../ip/**>", + ], + options=dict(CCFLAGS=["-Wno-unused-variable"]), +) + +# Sources - functional components +queue.AddLibrary( + name="bdk_func", + base_dir=FUNC_DIR, + srcs=[ + "+", + "+", + "+", + SOC != SOC_BK7231 and "+", + "+", + "+", + "+", + "+", + "+", + "-", # fixups + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "-", + "+", + "+", + ], + includes=[ + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", # for config/lwipopts.h + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + f"+<{WPA_VERSION}/bk_patch>", + f"+<{WPA_VERSION}/hostapd>", + f"+<{WPA_VERSION}/src>", + f"+<{WPA_VERSION}/src/ap>", + f"+<{WPA_VERSION}/src/common>", + f"+<{WPA_VERSION}/src/drivers>", + f"+<{WPA_VERSION}/src/utils>", + f"+<{WPA_VERSION}/wpa_supplicant>", + ], +) + +# Sources - FreeRTOS +freertos_opts = dict( + CCFLAGS=[ + # build FreeRTOS port in ARM mode + "+<-marm>", + "-<-mthumb>", + ], +) +env.Replace(FREERTOS_PORT="beken-bdk", FREERTOS_PORT_DEFINE="BEKEN_BDK") +queue.AddExternalLibrary("freertos", options=freertos_opts) +queue.AddExternalLibrary("freertos-port", options=freertos_opts) +queue.AddLibrary( + name="bdk_freertos_thumb", + base_dir=ROOT_DIR, + srcs=[ + "+", + "-", + ], + includes=[ + "+", + ], +) + +# Sources - lwIP +queue.AddExternalLibrary("lwip", port="bdk") + +# Sources - mbedTLS 2.6.0 +queue.AddLibrary( + name="bdk_mbedtls", + base_dir=join(FUNC_DIR, "mbedtls"), + srcs=[ + "+", + "+", + ], + includes=[ + "+", + "+", + ], + options=dict( + CCFLAGS=[ + "-Wno-unused-variable", + "-Wno-implicit-function-declaration", + "-w", + ], + ), +) + +# Sources - chip-specific drivers +if SOC in [SOC_BK7231, SOC_BK7231U, SOC_BK7251]: + queue.AddLibrary( + name="bdk_driver_spi", + base_dir=join(DRIVER_DIR, "spi"), + srcs=[ + "+", + "+", + "+", + ], + ) +if SOC in [SOC_BK7231N]: + queue.AddLibrary( + name="bdk_driver_spi", + base_dir=join(DRIVER_DIR, "spi"), + srcs=[ + "+", + "+", + "+", + ], + ) +if SOC in [SOC_BK7251]: + queue.AddLibrary( + name="bdk_bk7251", + base_dir=ROOT_DIR, + srcs=[ + "+", + "+", + "+", + "+", + ], + includes=[ + "+", + "+", + ], + ) + +# Sources - enabled through config +if env.Cfg("CFG_SDIO"): + queue.AddLibrary( + name="bdk_driver_sdio", + base_dir=ROOT_DIR, + srcs=[ + "+", + "+", + ], + ) +if env.Cfg("CFG_BK_AWARE"): + queue.AddLibrary( + name="bdk_driver_sdio", + base_dir="$SDK_DIR", + srcs=[ + "+", + "+", + ], + includes=[ + "+", + ], + ) +if env.Cfg("CFG_USE_SDCARD_HOST"): + queue.AddLibrary( + name="bdk_func_fatfs", + base_dir=join(FUNC_DIR, "fatfs"), + srcs=[ + "+<*.c>", + "-", + ], + includes=[ + "+<.>", + ], + ) +if env.Cfg("CFG_WPA3"): + queue.AddLibrary( + name="bdk_wolfssl", + base_dir=join(FUNC_DIR, "wolfssl"), + srcs=[ + "+", + "+", + "+", + "+", + "+", + "+", + ], + includes=[ + "+<.>", + ], + ) +if env.Cfg("CFG_SUPPORT_BLE") and env.Cfg("CFG_BLE_VERSION") == env.Cfg( + "BLE_VERSION_4_2" +): + queue.AddLibrary( + name="bdk_ble_4_2", + base_dir=join(DRIVER_DIR, "ble"), + srcs=[ + "+<**/*.c>", + ], + includes=[ + "+<.>", + "+<**/include>", + "+", + "+", + "+", + "+", + "+", + "+", + ], + ) +if env.Cfg("CFG_SUPPORT_BLE") and env.Cfg("CFG_BLE_VERSION") == env.Cfg( + "BLE_VERSION_5_x" +): + queue.AddLibrary( + name="bdk_ble_5_x", + base_dir=join(DRIVER_DIR, "ble_5_x_rw"), + srcs=[ + "+<**/*.c>", + "-", + "-", + ], + includes=[ + "+<**/api>", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "-", + ], + ) +if env.Cfg("ATSVR_CFG"): + queue.AddLibrary( + name="bdk_atsvr", + base_dir=join(FUNC_DIR, "at_server"), + srcs=[ + "+<**/*.c>", + ], + includes=[ + "+<.>", + "+<*>", + ], + ) +if env.Cfg("CFG_USB") or env.Cfg("CFG_USE_SDCARD_HOST"): + queue.AddLibrary( + name="bdk_driver_usb", + base_dir=ROOT_DIR, + srcs=[ + "+", + "+", + ], + includes=[ + "+", + ], + ) + +# Libs & linker config +queue.AppendPublic( + LIBPATH=[ + join("$SDK_DIR", "beken378", "lib"), + join("$SDK_DIR", "beken378", "func", "airkiss"), + ], + LIBS=[ + "airkiss", + "sensor", + "usb", + # "wpa", # this is compiled from func/hostapd_intf/hostapd_intf.c + SOC != SOC_BK7231 and f"ble_{SOC_NAMES[SOC]}", + f"cal_{SOC_NAMES[SOC]}", + f"rf_test_{SOC_NAMES[SOC]}", + f"rf_use_{SOC_NAMES[SOC]}", + f"rwnx_{SOC_NAMES[SOC]}", + f"supplicant_{SOC_NAMES[SOC]}", + f"uart_debug_{SOC_NAMES[SOC]}", + "gcc", + "g", + "c", + "m", + "nosys", + ], +) + +# Misc options +env.Replace( + SIZEPROGREGEXP=r"^(?:\.vectors|\.text|\.rodata|\.data|\.ARM\.exidx)\s+([0-9]+).*", + SIZEDATAREGEXP=r"^(?:\.vectors|\.data|\.bss)\s+([0-9]+).*", + SIZECHECKCMD="$SIZETOOL -A -d $SOURCES", + SIZEPRINTCMD="$SIZETOOL -B -d $SOURCES", +) +# Generate linker scripts with correct flash offsets +env.GenerateLinkerScript(board, board.get("build.ldscript")) + + +def to_offset(addr: int) -> int: + return int(addr + (addr // 32) * 2) + + +# Calculate RBL header offset +app_offs = int(env["FLASH_APP_OFFSET"], 16) +app_size = int(board.get("build.bkrbl_size_app"), 16) +rbl_offs = to_offset(app_size) - 102 +env.Replace(FLASH_RBL_OFFSET=f"0x{app_offs + rbl_offs:06X}") + +# Build all libraries +queue.BuildLibraries() + +# Rename Arduino's delay() to delayMilliseconds() +env.Append( + CPPDEFINES=[ + ("'delay(ms)'", "'delayMilliseconds(ms)'"), + ], +) + +# Main firmware outputs and actions +image_app_crc = "${BUILD_DIR}/image_${MCULC}_app.${FLASH_APP_OFFSET}.crc" +image_app_rblh = "${BUILD_DIR}/image_${MCULC}_app.${FLASH_RBL_OFFSET}.rblh" +image_ota_rbl = "${BUILD_DIR}/image_${MCULC}_app.ota.rbl" +env.Replace( + # linker command (encryption + packaging) + LINK='${LTCHIPTOOL} link2bin ${BOARD_JSON} "" ""', + # UF2OTA input list + UF2OTA=[ + # app binary image (enc+crc) for flasher + f"{image_app_crc}=flasher:app", + # app RBL header (with crc) for flasher + f"{image_app_rblh}+{rbl_offs}=flasher:app", + # OTA RBL package for device only + f"{image_ota_rbl}=device:download", + ], +) diff --git a/builder/family/realtek-ambz.py b/builder/family/realtek-ambz.py new file mode 100644 index 000000000..38b3c67b6 --- /dev/null +++ b/builder/family/realtek-ambz.py @@ -0,0 +1,308 @@ +# Copyright (c) Kuba Szczodrzyński 2022-04-20. + +from os.path import join + +from platformio.platform.board import PlatformBoardConfig +from SCons.Script import Builder, DefaultEnvironment, Environment + +env: Environment = DefaultEnvironment() +board: PlatformBoardConfig = env.BoardConfig() +queue = env.AddLibraryQueue("realtek-ambz") +env.ConfigureFamily() + +# Flags +queue.AppendPublic( + CCFLAGS=[ + "-mcpu=cortex-m4", + "-mthumb", + "-mfloat-abi=hard", + "-mfpu=fpv4-sp-d16", + "-fno-short-enums", + ], + CPPDEFINES=[ + # other options + "M3", + "CONFIG_PLATFORM_8711B", + ("ERRNO", "1"), # for LwIP + "MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED", # enable PSK in mbedTLS + # "MBEDTLS_DEBUG_C", + "MBED_PERIPHERALNAMES_H", # see fixups/cmsis.h + ], + LINKFLAGS=[ + "-mcpu=cortex-m4", + "-mthumb", + "-mfloat-abi=hard", + "-mfpu=fpv4-sp-d16", + "--specs=nano.specs", + # the entrypoint in ROM (?) + "-Wl,--entry=Reset_Handler", + # start function table in startup.c + "-Wl,--undefined=gImage2EntryFun0", + "-Wl,-wrap,rom_psk_CalcGTK", + "-Wl,-wrap,rom_psk_CalcPTK", + "-Wl,-wrap,CalcMIC", + "-Wl,-wrap,CheckMIC", + "-Wl,-wrap,aes_80211_encrypt", + "-Wl,-wrap,aes_80211_decrypt", + "-Wl,-wrap,DecGTK", + # ROM stdlib (wraps/stdlib.c) + # stock SDK defines these as macros + "-Wl,-wrap,atoi", + "-Wl,-wrap,atol", + "-Wl,-wrap,strtol", + "-Wl,-wrap,strtoul", + "-Wl,-wrap,rand", + "-Wl,-wrap,strcat", + "-Wl,-wrap,strcpy", + "-Wl,-wrap,strncat", + "-Wl,-wrap,strncpy", + "-Wl,-wrap,strchr", + "-Wl,-wrap,strcmp", + "-Wl,-wrap,strlen", + "-Wl,-wrap,strncmp", + "-Wl,-wrap,strpbrk", + "-Wl,-wrap,strstr", + "-Wl,-wrap,strtok", + "-Wl,-wrap,memchr", + "-Wl,-wrap,memcmp", + "-Wl,-wrap,memcpy", + "-Wl,-wrap,memmove", + "-Wl,-wrap,memset", + "-Wl,-wrap,strsep", + # stdio wrappers (base/port/printf.c) + "-Wl,-wrap,rtl_printf", + "-Wl,-wrap,rtl_sprintf", + "-Wl,-wrap,rtl_snprintf", + "-Wl,-wrap,rtl_vsnprintf", + "-Wl,-wrap,rtl_vsnprintf_r", + "-Wl,-wrap,rtl_vprintf", + "-Wl,-wrap,rtl_vfprintf", + "-Wl,-wrap,DiagPrintf", + "-Wl,-wrap,DiagSPrintf", + "-Wl,-wrap,DiagSnPrintf", + "-Wl,-wrap,prvDiagPrintf", + "-Wl,-wrap,prvDiagSPrintf", + "-Wl,-wrap,VSprintf", + "-Wl,-wrap,LOG_PRINTF", + "-Wl,-wrap,__rtl_vfprintf_r_v1_00", + ], +) +queue.AppendPrivate( + CFLAGS=[ + "-Wno-implicit-function-declaration", + "-Wno-incompatible-pointer-types", + "-Wno-int-conversion", + "-Wno-pointer-sign", + ], +) + +# Sources - from SDK project/realtek_amebaz_va0_example/GCC-RELEASE/application.mk +# - "console" is disabled as it introduces build error, and is generally useless +# - "utilities example" are also not really needed +queue.AddLibrary( + name="ambz_sdk", + base_dir="$SDK_DIR", + srcs=[ + # NOTE: a fixup is used instead, to remove default main() + # "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "ARDUINO" not in "ENV" and "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + ], + includes=[ + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + # keep PolarSSL headers for ROM crypto functions + "+", + # includes that are missing in the vanilla SDK makefiles + "+", + "+", + "+", + "+", + "+", + ], + options=dict( + CFLAGS=["-w"], + ), +) + +# Sources - FreeRTOS +env.Replace(FREERTOS_PORT=env["FAMILY_NAME"], FREERTOS_PORT_DEFINE="REALTEK_AMB1") +queue.AddExternalLibrary("freertos") +queue.AddExternalLibrary("freertos-port") + +# Sources - lwIP +queue.AddExternalLibrary("lwip", port="amb1") + +# Sources - mbedTLS +queue.AddLibrary( + name="ambz_mbedtls", + base_dir="$SDK_DIR", + srcs=[ + # mbedTLS from SDK + "+", + # replace this with a fixup + "-", + ], + includes=[ + "+", + ], +) + +# Libs & linker config +queue.AppendPublic( + LIBPATH=[ + # fmt: off + join("$SDK_DIR", "component", "soc", "realtek", "8711b", "misc", "bsp", "lib", "common", "GCC"), + # fmt: on + ], + LIBS=[ + "_platform", + "_wlan", + "_wps", + "_p2p", + "_dct", + # use lib_rtlstd.a without some __aeabi functions + "_rtlstd_patch", + "m", + "c", + "nosys", + "gcc", + "_websocket", + "_http", + "_mdns", + ], +) + +# Misc options +env.Replace( + SIZEPROGREGEXP=r"^(?:\.ram_image2\.entry|\.ram_image2\.text|\.ram_image2\.data|\.xip_image2\.text)\s+([0-9]+).*", + SIZEDATAREGEXP=r"^(?:\.ram_image2\.entry|\.ram_image2\.data|\.ram_image2\.bss|\.ram_image2\.skb\.bss)\s+([0-9]+).*", + SIZECHECKCMD="$SIZETOOL -A -d $SOURCES", + SIZEPRINTCMD="$SIZETOOL -B -d $SOURCES", +) +# Generate linker scripts with correct flash offsets +env.GenerateLinkerScript(board, board.get("build.ldscript")) +env.GenerateLinkerScript(board, board.get("build.ldscript").replace("xip1", "xip2")) + +env.Append( + BUILDERS=dict( + BinToObj=Builder( + action=" ".join( + [ + "$OBJCOPY", + "-I binary", + "-O elf32-littlearm", + "-B arm", + "$SOURCE", + "$TARGET", + ], + ), + ) + ), +) + +# Bootloader library +boot_all = board.get("build.amb_boot_all") +target_boot = env.StaticLibrary( + join("$BUILD_DIR", "boot_all"), + env.BinToObj( + join("$BUILD_DIR", "boot_all.o"), + join("$MISC_DIR", boot_all), + ), +) +env.Prepend(LIBS=[target_boot]) + +# Build all libraries +queue.BuildLibraries() + +# Main firmware outputs and actions +image_ota1 = "${BUILD_DIR}/image_ota1.${FLASH_OTA1_OFFSET}.bin" +image_ota2 = "${BUILD_DIR}/image_ota2.${FLASH_OTA2_OFFSET}.bin" +env.Replace( + # linker command (dual .bin outputs) + LINK="${LTCHIPTOOL} link2bin ${BOARD_JSON} xip1 xip2", + # UF2OTA input list + UF2OTA=[ + # same OTA images for flasher and device + f"{image_ota1},{image_ota2}=device:ota1,ota2;flasher:ota1,ota2", + ], +) diff --git a/builder/family/realtek-ambz2.py b/builder/family/realtek-ambz2.py new file mode 100644 index 000000000..e593bec4f --- /dev/null +++ b/builder/family/realtek-ambz2.py @@ -0,0 +1,435 @@ +# Copyright (c) Kuba Szczodrzyński 2022-07-20. + +from os.path import isfile, join +from shutil import copyfile + +from platformio.platform.base import PlatformBase +from platformio.platform.board import PlatformBoardConfig +from SCons.Script import DefaultEnvironment, Environment + +env: Environment = DefaultEnvironment() +platform: PlatformBase = env.PioPlatform() +board: PlatformBoardConfig = env.BoardConfig() +queue = env.AddLibraryQueue("realtek-ambz2") +env.ConfigureFamily() + +COMPONENT_DIR = join("$SDK_DIR", "component") + +# Flags +queue.AppendPublic( + CCFLAGS=[ + "-march=armv8-m.main+dsp", + "-mthumb", + "-mcmse", + "-mfloat-abi=soft", + "-fno-short-enums", + ], + CFLAGS=[ + "-Wpointer-arith", + "-Wno-write-strings", + "-Wno-maybe-uninitialized", + ], + CXXFLAGS=[ + "-fno-use-cxa-atexit", + ], + CPPDEFINES=[ + # other options + "__thumb2__", + "CONFIG_PLATFORM_8710C", + ("__ARM_ARCH_8M_MAIN__", "1"), + ("CONFIG_BUILD_RAM", "1"), + "V8M_STKOVF", + ], + CPPPATH=[ + # allow including from GCC instead of RTL SDK + join( + platform.get_package_dir("toolchain-gccarmnoneeabi"), + "arm-none-eabi", + "include", + ), + ], + LINKFLAGS=[ + "-march=armv8-m.main+dsp", + "-mthumb", + "-mcmse", + "-mfloat-abi=soft", + "--specs=nano.specs", + "-Wl,--use-blx", + "-Wl,--undefined=gRamStartFun", + "-Wl,--warn-section-align", + "-Wl,-wrap,aesccmp_construct_mic_iv", + "-Wl,-wrap,aesccmp_construct_mic_header1", + "-Wl,-wrap,aesccmp_construct_ctr_preload", + "-Wl,-wrap,rom_psk_CalcGTK", + "-Wl,-wrap,rom_psk_CalcPTK", + "-Wl,-wrap,aes_80211_encrypt", + "-Wl,-wrap,aes_80211_decrypt", + # stdlib wrappers + "-Wl,-wrap,strcat", + "-Wl,-wrap,strchr", + "-Wl,-wrap,strcmp", + "-Wl,-wrap,strncmp", + "-Wl,-wrap,strcpy", + "-Wl,-wrap,strncpy", + "-Wl,-wrap,strlen", + "-Wl,-wrap,strncat", + "-Wl,-wrap,strpbrk", + "-Wl,-wrap,strspn", + "-Wl,-wrap,strstr", + "-Wl,-wrap,strtok", + "-Wl,-wrap,strxfrm", + "-Wl,-wrap,strtod", + "-Wl,-wrap,strtof", + "-Wl,-wrap,strtold", + "-Wl,-wrap,strtoll", + "-Wl,-wrap,strtoul", + "-Wl,-wrap,strtoull", + "-Wl,-wrap,atoi", + "-Wl,-wrap,atol", + "-Wl,-wrap,atof", + "-Wl,-wrap,memcmp", + "-Wl,-wrap,memcpy", + "-Wl,-wrap,memmove", + "-Wl,-wrap,memset", + # TODO remove this if possible + "-Wl,-wrap,putc", + # rt_printf wrappers are not here, as they're just changing code using #defines + ], +) + +# Sources - from SDK project/realtek_amebaz2_v0_example/GCC-RELEASE/application.is.mk +# - without "utilities - example", "bluetooth - example" and "network - app - mqtt" +queue.AddLibrary( + name="ambz2_sdk", + base_dir=COMPONENT_DIR, + srcs=[ + # cmsis + "+", + "+", + "+", + # utilities + "+", + "+", + "+", + # os + "+", + "+", + "+", + "+", + "+", + "+", + # peripheral - api + "+", + # peripheral - hal + "+", + "+", + "+", + "+", + # peripheral - wlan + # "+", + # file_system - fatfs + "+", + "+", + "+", + "+", + "+", + "+", + ], + includes=[ + "+<$SDK_DIR/project/realtek_amebaz2_v0_example/inc>", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + ], + options=dict( + CCFLAGS=[ + "-Wno-int-conversion", + "-Wno-unused-label", + "-Wno-unused-but-set-variable", + "-Wno-pointer-sign", + "-Wno-parentheses", + "-Wno-implicit-function-declaration", + "-Wno-misleading-indentation", + "-Wno-unused-value", + # TODO remove this; only for example_wlan_fast_connect.c and at_cmd/* + "-Wno-format-truncation", + "-Wno-return-type", + "-Wno-unused-variable", + ], + ), +) + +# Sources - FreeRTOS +env.Replace(FREERTOS_PORT=env["FAMILY_NAME"], FREERTOS_PORT_DEFINE="REALTEK_AMBZ2") +queue.AddExternalLibrary("freertos") +queue.AddExternalLibrary("freertos-port") + +# Sources - lwIP +queue.AddExternalLibrary("lwip", port="ambz2") + +# Sources - network utilities +queue.AddLibrary( + name="ambz2_net", + base_dir=COMPONENT_DIR, + srcs=[ + # network - api + "+", + # network - api - wifi + "+", + "ARDUINO" in "ENV" and "-", + # network - api - wifi - rtw_wpa_supplicant + "+", + "+", + # network - app + "+", + "+", + "+", + "+", + "+", + "+", + # network - coap + "+", + # network - http + "+", + "+", + # network + "+", + # network - websocket + "+", + # network - mdns + "+", + # network - lwip - port + "+", + # network - ssl - ssl_ram_map + "+", + "+", + ], + includes=[ + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + ], + options=dict( + CCFLAGS=[ + "-Wno-pointer-sign", + "-Wno-unused-value", + "-Wno-format", + "-Wno-implicit-function-declaration", + "-Wno-unused-function", + "-Wno-parentheses", + "-Wno-incompatible-pointer-types", + "-Wno-array-bounds", + "-Wno-stringop-overflow", + ], + ), +) + +# Sources - Bluetooth support +queue.AddLibrary( + name="ambz2_bluetooth", + base_dir=join(COMPONENT_DIR, "common", "bluetooth", "realtek", "sdk"), + srcs=[ + "+", + "+", + "+", + "+", + "+", + # "+", + # "+", + "+", + "+", + "-", + ], + includes=[ + "+<.>", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + ], + options=dict( + CCFLAGS=[ + "-Wno-unused-function", + "-Wno-unused-variable", + "-Wno-implicit-function-declaration", + ], + ), +) + +# Sources - mbedTLS +queue.AddLibrary( + name="ambz2_mbedtls", + base_dir=join(COMPONENT_DIR, "common", "network", "ssl", "mbedtls-2.4.0"), + srcs=[ + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + ], + includes=[ + "+", + ], +) + +# Libs & linker config +queue.AppendPublic( + LIBPATH=[ + # fmt: off + join(COMPONENT_DIR, "soc", "realtek", "8710c", "misc", "bsp", "lib", "common", "GCC"), + join(COMPONENT_DIR, "soc", "realtek", "8710c", "fwlib", "lib", "lib"), + join(COMPONENT_DIR, "common", "bluetooth", "realtek", "sdk", "board", "amebaz2", "lib"), + join(COMPONENT_DIR, "soc", "realtek", "8710c", "misc", "bsp", "ROM"), + # fmt: on + ], + LIBS=[ + "_soc_is", + "_wlan", + "_http", + "_dct", + "_eap", + "_p2p", + "_websocket", + "_wps", + "m", + "c", + "nosys", + "gcc", + # SCons trims the .a suffix automatically + ":hal_pmc.a.a", + ":btgap.a.a", + ], +) + +# Misc options +env.Replace( + SIZEPROGREGEXP=r"^(?:\.ram\..*?|\.psram\.[cd].*?|\.data|\.xip[\._].*?)\s+([0-9]+).*", + SIZEDATAREGEXP=r"^(?:\.ram\..*?|\.data)\s+([0-9]+).*", + SIZECHECKCMD="$SIZETOOL -A -d $SOURCES", + SIZEPRINTCMD="$SIZETOOL -B -d $SOURCES", +) + +# Bootloader - copy for linking +# fmt: off +bootloader_src = env.subst("${SDK_DIR}/component/soc/realtek/8710c/misc/bsp/image/bootloader.axf") +bootloader_dst = env.subst("${BUILD_DIR}/bootloader.axf") +# fmt: on +if not isfile(bootloader_dst): + copyfile(bootloader_src, bootloader_dst) + +# OTA2 clearing - 4096 bytes of 0xFF +image_ota_clear = env.subst("${BUILD_DIR}/raw_ota_clear.bin") +if not isfile(image_ota_clear): + with open(image_ota_clear, "wb") as f: + f.write(b"\xFF" * 4096) + +# Build all libraries +queue.BuildLibraries() + +# Main firmware outputs and actions +image_part_table = "${BUILD_DIR}/image_part_table.${FLASH_PART_TABLE_OFFSET}.bin" +image_bootloader = "${BUILD_DIR}/image_bootloader.${FLASH_BOOT_OFFSET}.bin" +image_firmware_is = "${BUILD_DIR}/image_firmware_is.${FLASH_OTA1_OFFSET}.bin" +env.Replace( + # linker command (dual .bin outputs) + LINK='${LTCHIPTOOL} link2bin ${BOARD_JSON} "" ""', + # UF2OTA input list + UF2OTA=[ + # same OTA images for flasher and device + f"{image_firmware_is},{image_firmware_is}=device:ota1,ota2;flasher:ota1,ota2", + # having flashed an application image, update the bootloader and partition table (incl. keys) + f"{image_bootloader}=device:boot;flasher:boot", + f"{image_part_table}=device:part_table;flasher:part_table", + # clearing headers of the "other" OTA image (hence the indexes are swapped) + f"{image_ota_clear},{image_ota_clear}=device:ota2,ota1;flasher:ota2,ota1", + ], +) diff --git a/builder/frameworks/arduino.py b/builder/frameworks/arduino.py new file mode 100644 index 000000000..5dbe110bc --- /dev/null +++ b/builder/frameworks/arduino.py @@ -0,0 +1,83 @@ +# Copyright (c) Kuba Szczodrzyński 2022-04-23. + +from os.path import join + +import click +from ltchiptool import Family +from SCons.Script import DefaultEnvironment, Environment + +# Let everyone know we're using the Arduino framework +env: Environment = DefaultEnvironment() +env["ARDUINO"] = True +family: Family = env["FAMILY_OBJ"] + +# Add base cores' sources first +env.SConscript("base.py") + +# Build a safe environment for this script +queue = env.AddLibraryQueue("arduino", prepend_includes=True) + +# Add sources common among all families +env.AddCoreSources( + queue=queue, + name="common_arduino", + path=join("$COMMON_DIR", "arduino", "src"), +) +env.AddArduinoLibraries( + queue=queue, + name="common_arduino", + path=join("$COMMON_DIR", "arduino", "libraries"), +) +# Add sources for this family and each parent +found = False +for f in family.inheritance: + code = f"{f.code}_arduino" + path = join("$CORES_DIR", f.name, "arduino") + + found = env.AddCoreSources(queue, name=code, path=join(path, "src")) or found + env.AddArduinoLibraries(queue, name=code, path=join(path, "libraries")) + + if f.short_name: + env.Prepend(CPPDEFINES=[(f"ARDUINO_ARCH_{f.short_name}", "1")]) + if f.code: + env.Prepend(CPPDEFINES=[(f"ARDUINO_ARCH_{f.code.upper()}", "1")]) + +# Fail if Arduino core wasn't found +if not found: + click.secho( + f"Platform '{family.name}' doesn't support Arduino framework - " + "the Arduino core source files are absent.", + fg="red", + ) + exit(1) + +# Sources - ArduinoCore-API +queue.AddExternalLibrary("arduino-api") + +# Sources - board variant +queue.AddLibrary( + name="board_${VARIANT}", + base_dir="$VARIANTS_DIR", + srcs=[ + "+<${VARIANT}.c>", + ], + # not adding includes since they're added with the base core +) + +# Flags & linker options +queue.AppendPublic( + CPPDEFINES=[ + ("LIBRETUYA_ARDUINO", 1), + ("LIBRETINY_ARDUINO", 1), + ("ARDUINO", 10812), + ("ARDUINO_SDK", 1), + ], + LINKFLAGS=[ + # wrappers from posix/time.c + "-Wl,-wrap,gettimeofday", + "-Wl,-wrap,settimeofday", + ], +) + +# Build all libraries +queue.BuildLibraries() diff --git a/builder/frameworks/base.py b/builder/frameworks/base.py new file mode 100644 index 000000000..c9317c23a --- /dev/null +++ b/builder/frameworks/base.py @@ -0,0 +1,169 @@ +# Copyright (c) Kuba Szczodrzyński 2023-02-26. + +from os.path import join + +import click +from ltchiptool import Family +from platformio.platform.base import PlatformBase +from platformio.platform.board import PlatformBoardConfig +from SCons.Errors import UserError +from SCons.Script import DefaultEnvironment, Environment + +env: Environment = DefaultEnvironment() +board: PlatformBoardConfig = env.BoardConfig() +platform: PlatformBase = env.PioPlatform() +family: Family = env["FAMILY_OBJ"] + +# Parse custom options +env.ParseCustomOptions(platform) +# Parse custom flash layout +env.ParseCustomFlashLayout(platform, board) +# Add flash layout C defines +env.AddFlashLayout(board) +# Write custom header options +env.ApplyCustomOptions(platform) +# Export board manifest for ltchiptool +env.ExportBoardData(board) +# Print information about versions and custom options +env.PrintInfo(platform, board) + +# TODO remove include path prepending ("!<...>") +# Move common core sources (env.AddCoreSources()) and Arduino libs +# below per-family sources (to maintain child families taking precedence) + +# Global public flags +# Refer to https://gcc.gnu.org/onlinedocs/gcc/Option-Summary.html +env.Append( + CCFLAGS=[ + # C Language Options + "-fsigned-char", # Let the type char be signed + # Debugging Options + "-g2", # produce debugging information; the default level is 2 + # Optimization Options + "-Os", # optimize for size; enables all -O2 optimizations except those that often increase code size + "-fdata-sections", # place each function or data item into its own section + "-ffunction-sections", # place each function or data item into its own section + "-fno-strict-aliasing", # (don't) assume the strictest aliasing rules applicable + "-fno-inline-functions", # (don't) consider all functions for inlining + "-fno-delete-null-pointer-checks", # assume that programs can safely dereference null pointers + # Preprocessor Options + "-MMD", # output a rule suitable for make describing the dependencies of the main source file + # Code Generation Options + "-fno-common", # place uninitialized global variables in the BSS section of the object file + "-fno-exceptions", # disable exception handling + # Developer Options + "-fstack-usage", # output stack usage information for the program, on a per-function basis + ], + CFLAGS=[ + "-std=gnu99", + ], + CXXFLAGS=[ + "-std=gnu++11", + "-fno-rtti", # disable generation of information about every class with virtual functions + ], +) + +# Include SDK builder scripts +# No environment options that follow later will be considered +found = False +for f in family.inheritance: + try: + env.Prepend(LIBPATH=[join("$CORES_DIR", f.name, "misc")]) + env.SConscript(f"../family/{f.name}.py", must_exist=True) + found = True + except UserError: + pass +# Fail if no SDK builder was found +if not found: + click.secho( + f"Platform '{family.name}' is currently not supported - " + "no SDK builder script could be found.", + fg="red", + ) + exit(1) + +# Build a safe environment for this script +queue = env.AddLibraryQueue("base", prepend_includes=True) +# Add sources & include paths for each core +env.AddCoreSources(queue, name="common", path=join("$COMMON_DIR", "base")) +for f in family.inheritance: + env.AddCoreSources(queue, name=f.code, path=join("$CORES_DIR", f.name, "base")) + + if f.short_name: + env.Prepend(CPPDEFINES=[(f"LT_{f.short_name}", "1")]) + if f.code: + env.Prepend(CPPDEFINES=[(f"LT_{f.code.upper()}", "1")]) + +# Sources - external libraries +queue.AddExternalLibrary("uf2ota") +queue.AddExternalLibrary("flashdb") +queue.AddExternalLibrary("printf") + +# Find optimization level and add __OPTIMIZE_LEVEL__ macro +for flag in env["CCFLAGS"]: + if not flag.startswith("-O"): + continue + env.Append(CPPDEFINES=[("__OPTIMIZE_LEVEL__", flag[2])]) + +# Non-SDK defines & linker options +queue.AppendPublic( + CCFLAGS=[ + "-Wreturn-type", + "-Wno-undef", + ], + CFLAGS=[ + "-Werror=implicit-function-declaration", + ], + CXXFLAGS=[ + "-Wno-literal-suffix", + "-Wno-write-strings", + "-Wno-psabi", # parameter passing for argument of type ... changed in GCC 7.1 + ], + CPPDEFINES=[ + ("LIBRETUYA", 1), + ("LIBRETINY", 1), + ("LT_VERSION", env["LT_VERSION"]), + ("LT_BOARD", "${VARIANT}"), + ("LT_VARIANT_H", r"\"${VARIANT}.h\""), + ("F_CPU", board.get("build.f_cpu")), + ("MCU", "${MCU}"), + ("MCULC", "${MCULC}"), + ("FAMILY", "F_${FAMILY_SHORT_NAME}"), + # Add flash layout defines created in env.AddFlashLayout() + *env["FLASH_DEFINES"].items(), + ], + CPPPATH=[ + "$VARIANTS_DIR", + ], + LINKFLAGS=[ + "-g2", + "-Os", + "-Wl,--as-needed", + "-Wl,--build-id=none", + "-Wl,--cref", + "-Wl,--gc-sections", + "-Wl,--no-enum-size-warning", + "-Wl,--no-wchar-size-warning", + "-Wl,--no-undefined", + "-Wl,--warn-common", + # malloc.c wrappers + "-Wl,-wrap,malloc", + "-Wl,-wrap,calloc", + "-Wl,-wrap,zalloc", + "-Wl,-wrap,realloc", + "-Wl,-wrap,free", + "-Wl,-wrap,_malloc_r", + "-Wl,-wrap,_calloc_r", + "-Wl,-wrap,_realloc_r", + "-Wl,-wrap,_free_r", + # linker map path + '"-Wl,-Map=' + join("$BUILD_DIR", "${PROGNAME}.map") + '"', + ], + LIBS=[ + "stdc++", + "supc++", + ], +) + +# Build everything from the base core +queue.BuildLibraries() diff --git a/builder/main.py b/builder/main.py new file mode 100644 index 000000000..8536591aa --- /dev/null +++ b/builder/main.py @@ -0,0 +1,135 @@ +# Copyright (c) Kuba Szczodrzyński 2022-04-20. + +import sys +from os.path import join + +from platformio.platform.base import PlatformBase +from platformio.platform.board import PlatformBoardConfig +from SCons.Script import ( + COMMAND_LINE_TARGETS, + AlwaysBuild, + Default, + DefaultEnvironment, + Environment, +) + +env: Environment = DefaultEnvironment() +platform: PlatformBase = env.PioPlatform() +board: PlatformBoardConfig = env.BoardConfig() + +python_deps = { + "ltchiptool": ">=4.5.1,<5.0", +} +env.SConscript("python-venv.py", exports="env") +env.ConfigurePythonVenv() +env.InstallPythonDependencies(python_deps) + +# Utilities +env.SConscript("utils/config.py", exports="env") +env.SConscript("utils/cores.py", exports="env") +env.SConscript("utils/env.py", exports="env") +env.SConscript("utils/flash.py", exports="env") +env.SConscript("utils/libs-external.py", exports="env") +env.SConscript("utils/libs-queue.py", exports="env") +env.SConscript("utils/ltchiptool-util.py", exports="env") + +# Firmware name +if env.get("PROGNAME", "program") == "program": + env.Replace(PROGNAME="raw_firmware") +env.Replace(PROGSUFFIX=".elf") + +# Configure the toolchain +prefix = board.get("build.prefix", "") +env.Replace( + AR=prefix + "gcc-ar", + AS=prefix + "gcc", + CC=prefix + "gcc", + CXX=prefix + "g++", + GDB=prefix + "gdb", + NM=prefix + "gcc-nm", + LINK=prefix + "gcc", + OBJCOPY=prefix + "objcopy", + OBJDUMP=prefix + "objdump", + RANLIB=prefix + "gcc-ranlib", + SIZETOOL=prefix + "size", +) + +# Environment variables, include paths, etc. +env.ConfigureEnvironment(platform, board) + +# Family builders details: +# - call env.AddLibrary("lib name", "base dir", [sources]) to add lib sources +# - call env.BuildLibraries() to build lib targets with safe envs +# - configure LINK, UF2OTA and UPLOAD_ACTIONS +# - script code ordering: +# - global vars +# - # Tools +# - # Flags (C(XX)FLAGS / CPPDEFINES / LINKFLAGS) +# - sources (env.AddLibrary) +# - # Libs & linker config (LIBPATH / LIBS / LDSCRIPT_PATH) +# - # Misc options +# - # Uploader +# - # Bootloader library +# - env.BuildLibraries() +# - # Main firmware outputs and actions + +# Framework builder (base.py/arduino.py) is executed in BuildProgram() +# Force including the base framework in case no other is specified +if "nobuild" not in COMMAND_LINE_TARGETS and not env.get("PIOFRAMEWORK"): + env.SConscript("frameworks/base.py") + +# +# Target: Build executable and linkable firmware +# +target_uf2 = join("${BUILD_DIR}", "firmware.uf2") +if "nobuild" in COMMAND_LINE_TARGETS: + target_elf = join("${BUILD_DIR}", "${PROGNAME}.elf") + env["UF2OTA"] = "dummy" # forcefully allow uploading using ltchiptool +else: + target_elf = env.BuildProgram() + target_uf2 = env.BuildUF2OTA(target_uf2, target_elf) + env.Depends(target_uf2, "checkprogsize") + +AlwaysBuild(env.Alias("nobuild", target_uf2)) +target_buildprog = env.Alias("buildprog", target_uf2, target_uf2) + +# +# Target: Print binary size +# +target_size = env.Alias( + "size", + target_elf, + env.VerboseAction("${SIZEPRINTCMD}", "Calculating size ${SOURCE}"), +) +AlwaysBuild(target_size) + +# +# Target: Upload firmware +# +upload_protocol = env.subst("${UPLOAD_PROTOCOL}") or "uart" +upload_actions = [] +upload_source = target_uf2 +ltchiptool_flags = "UF2OTA" in env and env.GetLtchiptoolWriteFlags() + +if ltchiptool_flags: + # use ltchiptool for flashing, if available + env.Replace( + LTCHIPTOOL_FLAGS=ltchiptool_flags, + UPLOADER="${LTCHIPTOOL} flash write", + UPLOADCMD="${UPLOADER} ${LTCHIPTOOL_FLAGS} ${UPLOADERFLAGS} ${SOURCE}", + ) + upload_actions = [ + env.VerboseAction(env.AutodetectUploadPort, "Looking for upload port..."), + env.VerboseAction("${UPLOADCMD}", "Uploading ${SOURCE}"), + ] +elif upload_protocol == "custom": + upload_actions = [env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE")] +else: + sys.stderr.write("Warning! Unknown upload protocol %s\n" % upload_protocol) + +AlwaysBuild(env.Alias("upload", upload_source, upload_actions)) + +# +# Default targets +# +Default([target_buildprog, target_size]) diff --git a/builder/python-venv.py b/builder/python-venv.py new file mode 100644 index 000000000..6869f32e3 --- /dev/null +++ b/builder/python-venv.py @@ -0,0 +1,122 @@ +# Copyright (c) Kuba Szczodrzyński 2023-09-07. + +import json +import site +import subprocess +import sys +from pathlib import Path + +import semantic_version +from platformio.compat import IS_WINDOWS +from platformio.package.version import pepver_to_semver +from platformio.platform.base import PlatformBase +from SCons.Script import DefaultEnvironment, Environment + +env: Environment = DefaultEnvironment() +platform: PlatformBase = env.PioPlatform() + +# code borrowed and modified from espressif32/builder/frameworks/espidf.py + + +def env_configure_python_venv(env: Environment): + venv_path = Path(env.subst("${PROJECT_CORE_DIR}"), "penv", ".libretiny") + + pip_path = venv_path.joinpath( + "Scripts" if IS_WINDOWS else "bin", + "pip" + (".exe" if IS_WINDOWS else ""), + ) + python_path = venv_path.joinpath( + "Scripts" if IS_WINDOWS else "bin", + "python" + (".exe" if IS_WINDOWS else ""), + ) + site_path = venv_path.joinpath( + "Lib" if IS_WINDOWS else "lib", + "." if IS_WINDOWS else f"python{sys.version_info[0]}.{sys.version_info[1]}", + "site-packages", + ) + + if not pip_path.is_file(): + # Use the built-in PlatformIO Python to create a standalone virtual env + result = env.Execute( + env.VerboseAction( + f'"$PYTHONEXE" -m venv --clear "{venv_path.absolute()}"', + "LibreTiny: Creating a virtual environment for Python dependencies", + ) + ) + if not python_path.is_file(): + # Creating the venv failed + raise RuntimeError( + f"Failed to create virtual environment. Error code {result}" + ) + if not pip_path.is_file(): + # Creating the venv succeeded but pip didn't get installed + # (i.e. Debian/Ubuntu without ensurepip) + print( + "LibreTiny: Failed to install pip, running get-pip.py", file=sys.stderr + ) + import requests + + with requests.get("https://bootstrap.pypa.io/get-pip.py") as r: + p = subprocess.Popen( + args=str(python_path.absolute()), + stdin=subprocess.PIPE, + ) + p.communicate(r.content) + p.wait() + + assert ( + pip_path.is_file() + ), f"Error: Missing the pip binary in virtual environment `{pip_path.absolute()}`" + assert ( + python_path.is_file() + ), f"Error: Missing Python executable file `{python_path.absolute()}`" + assert ( + site_path.is_dir() + ), f"Error: Missing site-packages directory `{site_path.absolute()}`" + + env.Replace(LTPYTHONEXE=python_path.absolute(), LTPYTHONENV=venv_path.absolute()) + site.addsitedir(str(site_path.absolute())) + + +def env_install_python_dependencies(env: Environment, dependencies: dict): + try: + pip_output = subprocess.check_output( + [ + env.subst("${LTPYTHONEXE}"), + "-m", + "pip", + "list", + "--format=json", + "--disable-pip-version-check", + ] + ) + pip_data = json.loads(pip_output) + packages = {p["name"]: pepver_to_semver(p["version"]) for p in pip_data} + except: + print( + "LibreTiny: Warning! Couldn't extract the list of installed Python packages" + ) + packages = {} + + to_install = [] + for name, spec in dependencies.items(): + install_spec = f'"{name}{dependencies[name]}"' + if name not in packages: + to_install.append(install_spec) + elif spec: + version_spec = semantic_version.Spec(spec) + if not version_spec.match(packages[name]): + to_install.append(install_spec) + + if to_install: + env.Execute( + env.VerboseAction( + '"${LTPYTHONEXE}" -m pip install --prefer-binary -U ' + + " ".join(to_install), + "LibreTiny: Installing Python dependencies", + ) + ) + + +env.AddMethod(env_configure_python_venv, "ConfigurePythonVenv") +env.AddMethod(env_install_python_dependencies, "InstallPythonDependencies") diff --git a/builder/utils/config.py b/builder/utils/config.py new file mode 100644 index 000000000..8ebf70172 --- /dev/null +++ b/builder/utils/config.py @@ -0,0 +1,85 @@ +# Copyright (c) Kuba Szczodrzyński 2022-06-13. + +from os.path import isfile + +from SCons.Script import DefaultEnvironment, Environment + +env: Environment = DefaultEnvironment() + + +def env_load_defines(env: Environment, path: str): + path = env.subst(path) + if not isfile(path): + raise FileNotFoundError(f"Defines file not found ({path})") + config = {} + f = open(path, "r", encoding="utf-8") + for line in f: + line: str + if not line.startswith("#define"): + continue + line = line[7:].strip() + line = line.split(None, 2) + if len(line) == 1: + key, value = line[0], 1 + elif len(line) == 2: + key, value = line[0], line[1] + else: + raise ValueError(f"Unknown directive: {line}") + for tpl in env["CPPDEFINES"]: + if isinstance(tpl, tuple): + k = tpl[0] + else: + k = tpl + if k == key: + env["CPPDEFINES"].remove(tpl) + break + env.Append(CPPDEFINES=[(key, value)]) + config[key] = value + env.Append( + CONFIG=config, + ) + f.close() + + +def env_load_config(env: Environment, path: str): + path = env.subst(path) + if not isfile(path): + raise FileNotFoundError(f"Config file not found ({path})") + STRIP_CHARS = "\t " + config = {} + f = open(path, "r", encoding="utf-8") + for line in f: + line: str + if not line.startswith("#define"): + continue + line = line[7:].strip(STRIP_CHARS) + (key, value) = line.split(None, 2) + value = value.strip(STRIP_CHARS) + if value.isnumeric(): + value = int(value, 0) + elif value.startswith('"') and value.endswith('"'): + value = value[1:-1] + else: + # store defines as bytes + value = value.encode() + config[key] = value + env.Append( + CONFIG=config, + ) + f.close() + + +def env_get_config(env: Environment, key: str): + config: dict = env["CONFIG"] + if not config: + return None + value = config.get(key, None) + while isinstance(value, bytes): + value = config.get(value.decode(), None) + return value + + +env.AddMethod(env_load_defines, "LoadDefines") +env.AddMethod(env_load_config, "LoadConfig") +env.AddMethod(env_get_config, "Cfg") +env.AddMethod(env_get_config, "GetConfig") diff --git a/builder/utils/cores.py b/builder/utils/cores.py new file mode 100644 index 000000000..9e4018466 --- /dev/null +++ b/builder/utils/cores.py @@ -0,0 +1,109 @@ +# Copyright (c) Kuba Szczodrzyński 2023-02-26. + +from os.path import isdir, join + +from ltchiptool import Family +from SCons.Script import DefaultEnvironment, Environment + +env: Environment = DefaultEnvironment() + + +def env_configure_family(env: Environment): + env.Prepend( + CPPPATH=[ + join("$COMMON_DIR", "base", "fixups"), + join("$COMMON_DIR", "base", "config"), + join("$COMMON_DIR", "base", "compat"), + ], + ) + + family: Family = env["FAMILY_OBJ"] + for f in family.inheritance: + path = join("$CORES_DIR", f.name, "base") + if not isdir(env.subst(path)): + continue + env.Prepend( + CPPPATH=[ + join(path, "fixups"), + join(path, "config"), + join(path, "compat"), + ], + LIBPATH=[ + join(path, "fixups"), + ], + ) + + +def env_add_core_sources(env: Environment, queue, name: str, path: str) -> bool: + if not isdir(env.subst(path)): + return False + try: + env.LoadDefines(join(path, "lt_defs.h")) + except FileNotFoundError: + pass + queue.AddLibrary( + name=f"core_{name}", + base_dir=path, + srcs=[ + "+<*.c*>", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + ], + includes=[ + # prepend the paths before SDK directories + "!<.>", + "!", + "!", + "!", + "!", + ], + ) + queue.AddLibrary( + name=f"core_{name}_fixups", + base_dir=path, + srcs=[ + "+", + ], + includes=[ + "!", + ], + options=dict( + # disable all warnings for fixups + CCFLAGS=["-w"], + ), + ) + return True + + +def env_add_arduino_libraries(env: Environment, queue, name: str, path: str) -> bool: + if not isdir(env.subst(path)): + return False + queue.AddLibrary( + name=f"core_{name}_libraries", + base_dir=path, + srcs=[ + "+<**/*.c*>", + ], + includes=( + [ + "!<*/.>", + "!<*/*>", + ] + if name.startswith("common") + else [ + "!<.>", + "!<*>", + ] + ), + ) + return True + + +env.AddMethod(env_configure_family, "ConfigureFamily") +env.AddMethod(env_add_core_sources, "AddCoreSources") +env.AddMethod(env_add_arduino_libraries, "AddArduinoLibraries") diff --git a/builder/utils/env.py b/builder/utils/env.py new file mode 100644 index 000000000..721c6f725 --- /dev/null +++ b/builder/utils/env.py @@ -0,0 +1,193 @@ +# Copyright (c) Kuba Szczodrzyński 2022-05-04. + +import json +import sys +from os import makedirs +from os.path import isdir, join +from subprocess import PIPE, Popen +from typing import Dict + +from ltchiptool import Family, get_version +from ltchiptool.util.lvm import LVM +from ltchiptool.util.misc import sizeof +from platformio.platform.base import PlatformBase +from platformio.platform.board import PlatformBoardConfig +from SCons.Script import DefaultEnvironment, Environment + +env: Environment = DefaultEnvironment() + + +def read_version(platform_dir: str, version: str): + if not isdir(join(platform_dir, ".git")): + sys.stderr.write("Warning! Non-Git installations are NOT SUPPORTED.\n") + return version + try: + p = Popen( + ["git", "rev-parse", "--short", "HEAD"], stdout=PIPE, cwd=platform_dir + ) + if p.wait() != 0: + sys.stderr.write( + f"Warning! Non-zero return code received from Git: {p.returncode}\n" + ) + return version + sha = p.stdout.read().decode().strip() + + p = Popen(["git", "diff", "--quiet"], stdout=PIPE, cwd=platform_dir) + dirty = p.wait() != 0 + except (FileNotFoundError, IndexError): + sys.stderr.write( + "Warning! Git executable not found, or unreadable data received. Cannot read version information.\n" + ) + return version + + ids = [ + sha and "sha", + sha[:7] or None, + "dirty" if dirty else None, + ] + build_str = ".".join(filter(None, ids)) + return f"{version}+{build_str}" if build_str else version + + +def env_configure( + env: Environment, + platform: PlatformBase, + board: PlatformBoardConfig, +) -> Family: + # Read external libraries list + with open(join(platform.get_dir(), "external-libs.json")) as f: + external_libs = json.load(f) + # Get Family object for this board + family = Family.get(short_name=board.get("build.family")) + # Default environment variables + env.Replace( + SDK_DIR=platform.get_package_dir(board.get("package")), + LT_DIR=platform.get_dir(), + CORES_DIR=join("${LT_DIR}", "cores"), + COMMON_DIR=join("${LT_DIR}", "cores", "common"), + LT_VERSION=read_version(platform.get_dir(), platform.version), + # Build directories & paths + VARIANTS_DIR=join("${LT_DIR}", "boards", "variants"), + FAMILY_DIR=join("${LT_DIR}", "cores", "${FAMILY_NAME}"), + MISC_DIR=join("${FAMILY_DIR}", "misc"), + LDSCRIPT_PATH=[board.get("build.ldscript")], + # Board config variables + MCU=board.get("build.mcu").upper(), + MCULC=board.get("build.mcu").lower(), + VARIANT=board.get("build.variant"), + # ltchiptool config: + # -r output raw log messages + # -i 1 indent log messages + LTCHIPTOOL='"${LTPYTHONEXE}" -m ltchiptool -r -i 1 -L "${LT_DIR}"', + # Fix for link2bin to get tmpfile name in argv + LINKCOM="${LINK} ${LINKARGS}", + LINKARGS="${TEMPFILE('-o $TARGET $LINKFLAGS $__RPATH $SOURCES $_LIBDIRFLAGS $_LIBFLAGS', '$LINKCOMSTR')}", + # Store the family object + FAMILY_OBJ=family, + EXTERNAL_LIBS=external_libs, + ) + # Store family parameters as environment variables + env.Replace(**dict(family)) + # Set platform directory in ltchiptool (for use in this process only) + LVM.add_path(platform.get_dir()) + return family + + +def env_print_info( + env: Environment, + platform: PlatformBase, + board: PlatformBoardConfig, +): + TAB = " " * 4 + + def dump(k, v, indent=""): + k = k.replace("#", ".") + if isinstance(v, dict): + print(f"{indent} - {k}:") + for k, v in sorted(v.items()): + dump(k, v, indent + TAB) + elif isinstance(v, list): + print(f"{indent} - {k}:") + for k, v in enumerate(v): + dump(k, v, indent + TAB) + else: + print(f"{indent} - {k} = {v}") + + # Print information about installed core versions + print("PLATFORM VERSIONS:") + print(" - libretiny @", env["LT_VERSION"]) + print(" - ltchiptool @", get_version()) + # Print custom platformio.ini options + if platform.custom_opts: + print("CUSTOM OPTIONS:") + for k, v in sorted(platform.custom_opts.items()): + dump(k, v) + # Print custom flash layout + if env.get("FLASH_IS_CUSTOM", False): + print("CUSTOM FLASH LAYOUT:") + for name, layout in board.get("flash").items(): + (_, _, length) = layout.partition("+") + length = int(length, 16) + print(f" - {name}: {layout} ({sizeof(length)})") + + +def env_parse_custom_options(env: Environment, platform: PlatformBase): + opts: dict = platform.custom_opts.get("options", None) + if not opts: + return + headers = { + "lwip": "lwipopts.h", + "freertos": "FreeRTOSConfig.h", + } + for header, options in list(opts.items()): + if not isinstance(options, str): + raise TypeError("Options value should be str") + options = options.strip().splitlines() + opts_dict = {} + for line in options: + if "=" not in line: + raise ValueError(f"Invalid option: {line}") + k, _, v = line.partition("=") + k = k.strip() + v = v.strip() + opts_dict[k] = v + # replace predefined header names + opts.pop(header) + header = headers.get(header, header) + header = header.replace(".", "#") + opts[header] = opts_dict + + +def env_apply_custom_options(env: Environment, platform: PlatformBase): + opts = platform.custom_opts.get("options", None) + if not opts: + return + header_dir = join("${BUILD_DIR}", "include") + real_dir = env.subst(header_dir) + makedirs(real_dir, exist_ok=True) + + for header, options in opts.items(): + header: str + options: Dict[str, str] + # open the header file for writing + header = header.replace("#", ".") + f = open(join(real_dir, header), "w") + f.write(f'#include_next "{header}"\n' "\n" "#pragma once\n" "\n") + # write all #defines + for k, v in options.items(): + f.write( + f"// {k} = {v}\n" + f"#ifdef {k}\n" + f"#undef {k}\n" + f"#endif\n" + f"#define {k} {v}\n" + ) + f.close() + # prepend newly created headers before any other + env.Prepend(CPPPATH=[header_dir]) + + +env.AddMethod(env_configure, "ConfigureEnvironment") +env.AddMethod(env_print_info, "PrintInfo") +env.AddMethod(env_parse_custom_options, "ParseCustomOptions") +env.AddMethod(env_apply_custom_options, "ApplyCustomOptions") diff --git a/builder/utils/flash.py b/builder/utils/flash.py new file mode 100644 index 000000000..69b81414e --- /dev/null +++ b/builder/utils/flash.py @@ -0,0 +1,117 @@ +# Copyright (c) Kuba Szczodrzyński 2022-06-12. + +import re +from os.path import isfile, join +from typing import Dict + +from ltchiptool.util.fileio import chext +from platformio.platform.base import PlatformBase +from platformio.platform.board import PlatformBoardConfig +from SCons.Script import DefaultEnvironment, Environment + +env: Environment = DefaultEnvironment() + + +def env_parse_custom_flash_layout( + env: Environment, + platform: PlatformBase, + board: PlatformBoardConfig, +): + opts: dict = platform.custom_opts.get("flash", None) + if not opts: + return + flash_layout: dict = board.get("flash") + + # find all default partitions + partitions: Dict[str, int] = {} + flash_size = 0 + for name, layout in flash_layout.items(): + (offset, _, length) = layout.partition("+") + offset = int(offset, 16) + length = int(length, 16) + partitions[name] = offset + flash_size = max(flash_size, offset + length) + + # set custom offsets + for name, offset in opts.items(): + offset = int(offset, 0) + partitions[name] = offset + + # recalculate partition sizes + flash_layout = {} + partitions = sorted(partitions.items(), key=lambda p: p[1]) + for i, (name, offset) in enumerate(partitions): + end = partitions[i + 1][1] if i + 1 < len(partitions) else flash_size + length = end - offset + flash_layout[name] = f"0x{offset:06X}+0x{length:X}" + board.manifest["flash"] = flash_layout + env["FLASH_IS_CUSTOM"] = True + + +def env_add_flash_layout(env: Environment, board: PlatformBoardConfig): + flash_layout: dict = board.get("flash") + if flash_layout: + defines = {} + flash_size = 0 + fal_items = "" + # add "root" partition + fal_items += "FAL_PART_TABLE_ITEM(root,ROOT)" + # add all partitions + for name, layout in flash_layout.items(): + name = name.upper() + (offset, _, length) = layout.partition("+") + offset = int(offset, 16) + length = int(length, 16) + defines[f"FLASH_{name}_OFFSET"] = f"0x{offset:06X}" + defines[f"FLASH_{name}_LENGTH"] = f"0x{length:06X}" + fal_items += f"FAL_PART_TABLE_ITEM({name.lower()}, {name})" + flash_size = max(flash_size, offset + length) + defines["FLASH_LENGTH"] = f"0x{flash_size:06X}" + # for "root" partition + defines["FLASH_ROOT_OFFSET"] = "0x000000" + defines["FLASH_ROOT_LENGTH"] = f"0x{flash_size:06X}" + # add partition table array + defines["FAL_PART_TABLE"] = "{" + fal_items + "}" + env.Replace(FLASH_DEFINES=defines) + env.Replace(**defines) + + +def env_generate_linker_script(env: Environment, board: PlatformBoardConfig, name: str): + template_name = chext(name, "template.ld") + + # find the linker script template in LIBPATH + input = None + for path in env["LIBPATH"]: + path = env.subst(path) + if isfile(join(path, template_name)): + input = join(path, template_name) + break + if not input: + raise FileNotFoundError(template_name) + + # load the .template.ld script + with open(input, "r") as f: + ldscript = f.read() + + def transform(match: re.Match): + key = match[1] + if key in env: + return env[key] + if key.startswith("BOARD_"): + key = key[6:].lower() + return board.get(key) + raise ValueError(f"Unrecognized template key: {key}") + + ldscript = re.sub(r"\${([A-Z0-9_.]+)}", transform, ldscript) + + # write .ld script + output = join("${BUILD_DIR}", name) + with open(env.subst(output), "w") as f: + f.write(ldscript) + + env.Prepend(LIBPATH=["${BUILD_DIR}"]) + + +env.AddMethod(env_parse_custom_flash_layout, "ParseCustomFlashLayout") +env.AddMethod(env_add_flash_layout, "AddFlashLayout") +env.AddMethod(env_generate_linker_script, "GenerateLinkerScript") diff --git a/builder/utils/libs-external.py b/builder/utils/libs-external.py new file mode 100644 index 000000000..14dd477bc --- /dev/null +++ b/builder/utils/libs-external.py @@ -0,0 +1,67 @@ +# Copyright (c) Kuba Szczodrzyński 2023-02-26. + +from dataclasses import dataclass +from typing import Dict, List, Optional, Union + +from ltchiptool.util.dict import merge_dicts +from platformio.package.meta import PackageItem +from platformio.platform.base import PlatformBase +from SCons.Script import DefaultEnvironment, Environment + +env: Environment = DefaultEnvironment() +platform: PlatformBase = env.PioPlatform() + + +@dataclass +class ExternalLibrary: + package: str + sources: List[str] + includes: List[str] + flags: List[str] = None + linkflags: List[str] = None + defines: Dict[str, Union[str, int]] = None + + def __post_init__(self): + self.flags = self.flags or [] + self.linkflags = self.linkflags or [] + self.defines = self.defines or {} + + +def env_add_external_library( + env: Environment, + queue, + name: str, + port: Optional[str] = None, + options: Dict[str, List[str]] = {}, +): + if port: + name += f"-{port}" + external_libs = env["EXTERNAL_LIBS"] + lib = ExternalLibrary(**external_libs[name]) + version = platform.versions.get(lib.package, None) + + package: PackageItem = platform.pm.get_package( + platform.get_package_spec(lib.package, version) + ) + if not package: + raise ValueError( + f"Version '{version}' of library '{name}' ({lib.package}) is not installed" + ) + + opts_default = dict( + CFLAGS=lib.flags, + CPPDEFINES=[(k, v) for k, v in lib.defines.items()], + LINKFLAGS=lib.linkflags, + ) + options = merge_dicts(opts_default, options) + + queue.AddLibrary( + name=name.replace("-", "_"), + base_dir=package.path, + srcs=lib.sources, + includes=lib.includes, + options=options, + ) + + +env.AddMethod(env_add_external_library, "AddExternalLibrary") diff --git a/builder/utils/libs-queue.py b/builder/utils/libs-queue.py new file mode 100644 index 000000000..ddca5a27e --- /dev/null +++ b/builder/utils/libs-queue.py @@ -0,0 +1,218 @@ +# Copyright (c) Kuba Szczodrzyński 2023-02-28. + +import fnmatch +from dataclasses import InitVar, dataclass, field +from glob import glob +from os.path import isdir, join +from typing import Dict, Generator, List, Tuple + +from ltchiptool.util.dict import merge_dicts +from SCons.Script import DefaultEnvironment, Environment + +env: Environment = DefaultEnvironment() +ENV_PUBLIC_ONLY = ["CPPPATH", "LIBPATH", "LIBS", "LINKFLAGS"] + + +def add_base_dir( + env: Environment, + base_dir: str, + expressions: List[str], + subst: bool = False, +): + out = [] + for expr in expressions: + if expr == False or expr is None: + # support '[cond] and [path]' logical expressions + continue + if expr[1] != "<" or expr[-1] != ">": + raise ValueError(f"Not a valid glob: {expr}") + if expr[2] == "$": + # do not append base path + path = expr[2:-1] + else: + path = join(base_dir, expr[2:-1]) + if subst: + path = env.subst(path) + out.append(expr[0] + "<" + path + ">") + return out + + +def iter_expressions(expressions: List[str]) -> Generator[Tuple[str, str], None, None]: + for expr in expressions: + if expr == False or expr is None: + # support '[cond] and [path]' logical expressions + continue + if expr[1:2] != "<" or expr[-1:] != ">": + yield ("+", expr) + continue + yield (expr[0], expr[2:-1]) + + +def apply_options(env: Environment, options: Dict[str, List[str]]): + non_expr_keys = ["CPPDEFINES"] + for key, values in options.items(): + if not values: + continue + if key in non_expr_keys or not isinstance(values[0], str): + env.Append(**{key: values}) + continue + for dir, value in iter_expressions(values): + if dir == "+": + env.Append(**{key: [value]}) + elif dir == "!": + env.Prepend(**{key: [value]}) + elif dir == "-": + if value not in env[key]: + raise ValueError(f"Invalid option; {value} is not in {key}") + env[key].remove(value) + + +@dataclass +class Library: + env: InitVar[Environment] + name: str + base_dir: str + srcs: List[str] + includes: List[str] = field(default_factory=lambda: []) + options: Dict[str, List[str]] = field(default_factory=lambda: {}) + + def __post_init__(self, env: Environment): + # add base dir to all globs + self.srcs = add_base_dir(env, self.base_dir, self.srcs) + self.includes = add_base_dir(env, self.base_dir, self.includes, subst=True) + + +class LibraryQueue: + env: Environment + name: str + queue: List[Library] + includes: List[str] + options_public: dict + options_private: dict + prepend_includes: bool + built: bool = False + + def __init__( + self, + env: Environment, + name: str, + prepend_includes: bool = False, + ) -> None: + self.env = env + self.name = name + self.queue = [] + self.includes = [] + self.options_public = {} + self.options_private = {} + self.prepend_includes = prepend_includes + + def AddLibrary(self, **kwargs): + lib = Library(env=self.env, **kwargs) + # search all include paths + for dir, expr in iter_expressions(lib.includes): + if dir == "-": + for item in fnmatch.filter(self.includes, expr): + if item in self.includes: + self.includes.remove(item) + continue + for item in glob(expr, recursive=True): + if not isdir(item): + continue + if dir == "!": + self.includes.insert(0, item) + else: + self.includes.append(item) + # move public-only options to the global env + for key in ENV_PUBLIC_ONLY: + if key not in lib.options: + continue + option = lib.options.pop(key) + self.options_public = merge_dicts(self.options_public, {key: option}) + self.queue.append(lib) + + def AddExternalLibrary(self, *args, **kwargs): + return self.env.AddExternalLibrary(self, *args, **kwargs) + + def AppendPublic(self, **kwargs): + if "CPPPATH" in kwargs: + self.includes += kwargs["CPPPATH"] + kwargs.pop("CPPPATH") + self.options_public = merge_dicts(self.options_public, kwargs) + + def AppendPrivate(self, **kwargs): + if any(key in ENV_PUBLIC_ONLY for key in kwargs.keys()): + raise ValueError("Cannot set these as private options") + self.options_private = merge_dicts(self.options_private, kwargs) + + def Print(self): + def print_list(items): + print( + "\n".join( + f"{i+1: 4d}. {self.env.subst(str(item))}" + for i, item in enumerate(items) + ) + ) + + print() + print(f"Library Queue - {self.name}") + print("Environment paths:") + print_list(self.env["CPPPATH"]) + print( + "Include paths (%s):" % ("prepend" if self.prepend_includes else "append") + ) + print_list(self.includes) + print("Environment options:") + opts = ["CFLAGS", "CCFLAGS", "CXXFLAGS", "CPPDEFINES", "ASFLAGS"] + opts = {k: v for k, v in self.env.items() if k in opts} + print_list(opts.items()) + print("Options - public:") + print_list(self.options_public.items()) + print("Options - private:") + print_list(self.options_private.items()) + print("Libraries:") + print_list(self.queue) + + def BuildLibraries(self): + if self.built: + raise RuntimeError("Cannot build a library queue twice") + + # add public options to the environment + apply_options(self.env, self.options_public) + # treat all include paths as public + if self.prepend_includes: + self.env.Prepend(CPPPATH=self.includes) + else: + self.env.Append(CPPPATH=self.includes) + + # clone the environment for the whole library queue + queue_env = self.env.Clone() + # add private options to the cloned environment + apply_options(queue_env, self.options_private) + + for lib in self.queue: + if lib.options: + # clone the environment separately for each library + lib_env = queue_env.Clone() + # add library-scoped options + apply_options(lib_env, lib.options) + else: + # no library-scoped options, just use the base env + lib_env = queue_env + # build library with (name, base_dir, sources) options + target = lib_env.BuildLibrary( + join("$BUILD_DIR", lib.name), lib.base_dir, lib.srcs + ) + self.env.Prepend(LIBS=[target]) + + self.built = True + + +def env_add_library_queue( + env: Environment, + name: str, + prepend_includes: bool = False, +) -> LibraryQueue: + return LibraryQueue(env, name, prepend_includes) + + +env.AddMethod(env_add_library_queue, "AddLibraryQueue") diff --git a/builder/utils/ltchiptool-util.py b/builder/utils/ltchiptool-util.py new file mode 100644 index 000000000..4ac01c195 --- /dev/null +++ b/builder/utils/ltchiptool-util.py @@ -0,0 +1,100 @@ +# Copyright (c) Kuba Szczodrzyński 2022-06-02. + +import json +from datetime import datetime +from os.path import basename, join, normpath + +from platformio.platform.base import PlatformBase +from platformio.platform.board import PlatformBoardConfig +from SCons.Script import Builder, DefaultEnvironment, Environment + +env: Environment = DefaultEnvironment() +platform: PlatformBase = env.PioPlatform() + + +def env_uf2ota(env: Environment, *args, **kwargs): + now = datetime.now() + project_dir = env.subst("$PROJECT_DIR") + project_name = basename(normpath(project_dir)) + project_version = now.strftime("%y.%m.%d") + lt_version = platform.version + + if platform.custom("fw_name"): + project_name = platform.custom("fw_name") + if platform.custom("fw_version"): + project_version = platform.custom("fw_version") + + output = [ + project_name, + project_version, + "${VARIANT}", + "${MCULC}", + f"lt{lt_version}", + ] + output = "_".join(output) + ".uf2" + if platform.custom("fw_output"): + output = platform.custom("fw_output") + + outputs = [ + join("${BUILD_DIR}", output), + join("${BUILD_DIR}", "firmware.uf2"), + join("${BUILD_DIR}", "firmware.bin"), + ] + output_opts = [f'--output "{output}"' for output in outputs] + + cmd = [ + "@${LTCHIPTOOL} uf2 write", + *output_opts, + "--board ${BOARD_JSON}", + f"--lt-version {lt_version}", + f'--fw "{project_name}:{project_version}"', + f"--date {int(now.timestamp())}", + "--legacy", + *(f'"{arg}"' for arg in env["UF2OTA"]), + ] + + for output in outputs: + print(f"|-- {basename(env.subst(output))}") + env.Execute(" ".join(cmd)) + + +def env_flash_write(env: Environment): + # UPLOAD_PROTOCOL = upload_protocol or board->upload.protocol + # UPLOAD_PORT = upload_port (PIO can choose this automatically I guess) + # UPLOAD_SPEED = upload_speed or board->upload.speed (**can be empty**) + protocol = env.subst("${UPLOAD_PROTOCOL}") + speed = env.subst("${UPLOAD_SPEED}") + if protocol == "uart": + # upload via UART + if speed: + return [ + "-d", + "${UPLOAD_PORT}", + "-b", + "${UPLOAD_SPEED}", + ] + return [ + "-d", + "${UPLOAD_PORT}", + ] + else: + # can't upload via ltchiptool + return [] + + +def env_export_board_data(env: Environment, board: PlatformBoardConfig): + output = join("${BUILD_DIR}", "board.json") + with open(env.subst(output), "w") as f: + json.dump(board.manifest, f, indent="\t") + env["BOARD_JSON"] = output + + +env.Append( + BUILDERS=dict( + BuildUF2OTA=Builder( + action=[env.VerboseAction(env_uf2ota, "Building UF2 OTA image")] + ) + ) +) +env.AddMethod(env_flash_write, "GetLtchiptoolWriteFlags") +env.AddMethod(env_export_board_data, "ExportBoardData") diff --git a/cores/beken-7231n/base/config/sys_config.h b/cores/beken-7231n/base/config/sys_config.h new file mode 100644 index 000000000..2a67a98a3 --- /dev/null +++ b/cores/beken-7231n/base/config/sys_config.h @@ -0,0 +1,134 @@ +#pragma once + +#define ASSERT_HALT 1 +#define ASSERT_IGNORE 2 +#define ASSERT_REBOOT 3 +#define AT_SERVICE_CFG 0 +#define BLE_DEFAULT_WIFI_REQUEST 2 +#define BLE_VERSION_4_2 1 +#define BLE_VERSION_5_x 2 +#define BLE_WIFI_CO_REQUEST 3 +#define CFG_AIRKISS_TEST 0 +#define CFG_AP_MONITOR_COEXIST 0 +#define CFG_AP_SUPPORT_HT_IE 0 +#define CFG_ASSERT_OPTION ASSERT_IGNORE +#define CFG_BACKGROUND_PRINT 0 +#define CFG_BK_AWARE 0 +#define CFG_BK_AWARE_OUI "\xC8\x47\x8C" +#define CFG_BLE_ADV_NUM 1 +#define CFG_BLE_CONN_NUM 1 +#define CFG_BLE_INIT_NUM 0 +#define CFG_BLE_SCAN_NUM 1 +#define CFG_BLE_VERSION BLE_VERSION_5_x +#define CFG_EASY_FLASH 0 +#define CFG_ENABLE_BUTTON 0 +#define CFG_ENABLE_DEMO_TEST 0 +#define CFG_ENABLE_WPA_LOG 0 +#define CFG_GENERAL_DMA 1 +#define CFG_IEEE80211N 1 +#define CFG_IEEE80211W 0 +#define CFG_INT_WDG_ENABLED 0 +#define CFG_INT_WDG_PERIOD_MS 10000 +#define CFG_IPERF_TEST 0 +#define CFG_JTAG_ENABLE 0 +#define CFG_LESS_MEMERY_IN_RWNX 0 +#define CFG_LWIP_MEM_POLICY LWIP_REDUCE_THE_PLAN +#define CFG_MAC_PHY_BAPASS 1 +#define CFG_MSDU_RESV_HEAD_LEN 96 +#define CFG_MSDU_RESV_TAIL_LEN 16 +#define CFG_PERIPHERAL_TEST 0 +#define CFG_REAL_SDIO 0 +#define CFG_RELEASE_FIRMWARE 0 +#define CFG_ROLE_LAUNCH 0 +#define CFG_RUNNING_PLATFORM SOC_PLATFORM +#define CFG_RWNX_QOS_MSDU 1 +#define CFG_RX_SENSITIVITY_TEST 1 +#define CFG_SARADC_CALIBRATE 0 +#define CFG_SDIO 0 +#define CFG_SDIO_TRANS 0 +#define CFG_SOC_NAME SOC_BK7231N +#define CFG_SUPPOET_BSSID_CONNECT 0 +#define CFG_SUPPORT_BKREG 1 +#define CFG_SUPPORT_BLE 1 +#define CFG_SUPPORT_BLE_MESH 0 +#define CFG_SUPPORT_BSSID_CONNECT 0 +#define CFG_SUPPORT_CALIBRATION 1 +#define CFG_SUPPORT_MANUAL_CALI 1 +#define CFG_SUPPORT_OTA_HTTP 1 +#define CFG_SUPPORT_OTA_TFTP 0 +#define CFG_SUPPORT_SPI_TEST 0 +#define CFG_SUPPORT_TIANZHIHENG_DRONE 0 +#define CFG_SUPPORT_TPC_PA_MAP 1 +#define CFG_SYS_REDUCE_NORMAL_POWER 0 +#define CFG_TASK_WDG_ENABLED 0 +#define CFG_TASK_WDG_PERIOD_MS 60000 +#define CFG_TCP_SERVER_TEST 0 +#define CFG_TX_EVM_TEST 1 +#define CFG_UART_DEBUG 0 +#define CFG_UART_DEBUG_COMMAND_LINE 1 +#define CFG_UDISK_MP3 0 +#define CFG_USB 0 +#define CFG_USE_AP_IDLE 0 +#define CFG_USE_AP_PS 0 +#define CFG_USE_AUD_ADC 0 +#define CFG_USE_AUD_DAC 0 +#define CFG_USE_AUDIO 0 +#define CFG_USE_BLE_PS 1 +#define CFG_USE_CAMERA_INTF 0 +#define CFG_USE_DEEP_PS 1 +#define CFG_USE_DHCP 1 +#define CFG_USE_FAKERTC_PS 0 +#define CFG_USE_FTPD_UPGRADE 0 +#define CFG_USE_I2C1 0 +#define CFG_USE_I2C2 1 +#define CFG_USE_LWIP_NETSTACK 1 +#define CFG_USE_MCU_PS 1 +#define CFG_USE_PTA 0 +#define CFG_USE_SDCARD_HOST 0 +#define CFG_USE_SPI_DMA 1 +#define CFG_USE_SPI_MASTER 1 +#define CFG_USE_SPI_SLAVE 1 +#define CFG_USE_SPIDMA 0 +#define CFG_USE_STA_PS 1 +#define CFG_USE_TEMPERATURE_DETECT 0 +#define CFG_USE_TICK_CAL 1 +#define CFG_USE_UART1 1 +#define CFG_USE_USB_CHARGE 0 +#define CFG_USE_USB_HOST 0 +#define CFG_USE_WPA_29 1 +#define CFG_WFA_CERT 0 +#define CFG_WIFI_RAW_TX_CMD 0 +#define CFG_WIFI_SENSOR 0 +#define CFG_WLAN_FAST_CONNECT 0 +#define CFG_WPA_CTRL_IFACE 1 +#define CFG_WPA3 0 +#define CFG_XTAL_FREQUENCE CFG_XTAL_FREQUENCE_26M +#define CFG_XTAL_FREQUENCE_26M 26000000 +#define CFG_XTAL_FREQUENCE_40M 40000000 +#define CONFIG_APP_MP3PLAYER 0 +#define FPGA_PLATFORM 0 +#define LWIP_DEFAULT_MEM_POLICY 1 +#define LWIP_REDUCE_THE_PLAN 2 +#define OSMALLOC_STATISTICAL 0 +#define RF_USE_POLICY WIFI_DEFAULT_BLE_REQUEST +#define SOC_BK7221U 3 +#define SOC_BK7231 1 +#define SOC_BK7231N 5 +#define SOC_BK7231U 2 +#define SOC_BK7271 4 +#define SOC_PLATFORM 1 +#define THD_APPLICATION_PRIORITY 3 +#define THD_CORE_PRIORITY 2 +#define THD_EXTENDED_APP_PRIORITY 5 +#define THD_HOSTAPD_PRIORITY 5 +#define THD_INIT_PRIORITY 4 +#define THD_LWIP_PRIORITY 4 +#define THD_MEDIA_PRIORITY 4 +#define THD_RECONNECT_PRIORITY 4 +#define THD_UBG_PRIORITY 5 +#define THD_UMP3_PRIORITY 4 +#define THD_WPAS_PRIORITY 5 +#define THDD_KEY_SCAN_PRIORITY 7 +#define UART1_USE_FIFO_REC 0 +#define UART2_USE_FIFO_REC 0 +#define WIFI_DEFAULT_BLE_REQUEST 1 diff --git a/cores/beken-7231n/base/fixups/temp_detect.c b/cores/beken-7231n/base/fixups/temp_detect.c new file mode 100644 index 000000000..07014ddb2 --- /dev/null +++ b/cores/beken-7231n/base/fixups/temp_detect.c @@ -0,0 +1,6 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-07-07. */ + +// Fix for compiling on BK7231N with CFG_USE_TEMPERATURE_DETECT=0 +// Method is used by libuart_debug_bk7231n.a / bkreg_run_command_implement() + +void temp_detect_change_configuration(unsigned long intval, unsigned long thre, unsigned long dist) {} diff --git a/cores/beken-7231n/base/lt_defs.h b/cores/beken-7231n/base/lt_defs.h new file mode 100644 index 000000000..e0995057c --- /dev/null +++ b/cores/beken-7231n/base/lt_defs.h @@ -0,0 +1,5 @@ +#pragma once + +#error "Don't include this file directly" + +#define LT_HW_BLE 1 diff --git a/cores/beken-7231q/base/config/sys_config.h b/cores/beken-7231q/base/config/sys_config.h new file mode 100644 index 000000000..6f592e0f9 --- /dev/null +++ b/cores/beken-7231q/base/config/sys_config.h @@ -0,0 +1,105 @@ +#pragma once + +#define CFG_AIRKISS_TEST 0 +#define CFG_AP_MONITOR_COEXIST 0 +#define CFG_AP_SUPPORT_HT_IE 0 +#define CFG_BACKGROUND_PRINT 0 +#define CFG_BK_AWARE 0 +#define CFG_BK_AWARE_OUI "\xC8\x47\x8C" +#define CFG_EASY_FLASH 1 +#define CFG_ENABLE_BUTTON 0 +#define CFG_ENABLE_DEMO_TEST 0 +#define CFG_ENABLE_WPA_LOG 0 +#define CFG_GENERAL_DMA 1 +#define CFG_IEEE80211N 1 +#define CFG_IEEE80211W 0 +#define CFG_IPERF_TEST 0 +#define CFG_JTAG_ENABLE 0 +#define CFG_LESS_MEMERY_IN_RWNX 0 +#define CFG_MAC_PHY_BAPASS 1 +#define CFG_MSDU_RESV_HEAD_LEN 96 +#define CFG_MSDU_RESV_TAIL_LEN 16 +#define CFG_REAL_SDIO 0 +#define CFG_RELEASE_FIRMWARE 0 +#define CFG_RF_OTA_TEST 0 +#define CFG_RF_USER_BLE 0 +#define CFG_ROLE_LAUNCH 0 +#define CFG_RUNNING_PLATFORM SOC_PLATFORM +#define CFG_RWNX_QOS_MSDU 1 +#define CFG_RX_SENSITIVITY_TEST 1 +#define CFG_SARADC_CALIBRATE 0 +#define CFG_SDIO 0 +#define CFG_SDIO_TRANS 0 +#define CFG_SOC_NAME SOC_BK7231 +#define CFG_SUPPORT_BKREG 1 +#define CFG_SUPPORT_BLE 0 +#define CFG_SUPPORT_BSSID_CONNECT 0 +#define CFG_SUPPORT_CALIBRATION 1 +#define CFG_SUPPORT_MANUAL_CALI 1 +#define CFG_SUPPORT_OTA_HTTP 1 +#define CFG_SUPPORT_OTA_TFTP 0 +#define CFG_SUPPORT_TPC_PA_MAP 1 +#define CFG_SYS_REDUCE_NORMAL_POWER 0 +#define CFG_TCP_SERVER_TEST 0 +#define CFG_TX_EVM_TEST 1 +#define CFG_UART_DEBUG 0 +#define CFG_UART_DEBUG_COMMAND_LINE 1 +#define CFG_UDISK_MP3 0 +#define CFG_USB 0 +#define CFG_USE_AP_IDLE 0 +#define CFG_USE_AP_PS 0 +#define CFG_USE_APP_DEMO_VIDEO_TRANSFER 0 +#define CFG_USE_AUD_ADC 0 +#define CFG_USE_AUD_DAC 0 +#define CFG_USE_AUDIO 0 +#define CFG_USE_BLE_PS 0 +#define CFG_USE_CAMERA_INTF 0 +#define CFG_USE_DEEP_PS 1 +#define CFG_USE_DHCP 1 +#define CFG_USE_FAKERTC_PS 0 +#define CFG_USE_FTPD_UPGRADE 0 +#define CFG_USE_HSLAVE_SPI 0 +#define CFG_USE_LWIP_NETSTACK 1 +#define CFG_USE_MCU_PS 0 +#define CFG_USE_SDCARD_HOST 0 +#define CFG_USE_SPIDMA 0 +#define CFG_USE_STA_PS 1 +#define CFG_USE_TEMPERATURE_DETECT 0 +#define CFG_USE_TICK_CAL 0 +#define CFG_USE_UART1 0 +#define CFG_USE_USB_CHARGE 0 +#define CFG_USE_USB_HOST 0 +#define CFG_USE_WPA_29 1 +#define CFG_WFA_CERT 0 +#define CFG_WIFI_RAW_TX_CMD 0 +#define CFG_WIFI_SENSOR 0 +#define CFG_WLAN_FAST_CONNECT 0 +#define CFG_WPA_CTRL_IFACE 1 +#define CFG_WPA3 0 +#define CFG_XTAL_FREQUENCE CFG_XTAL_FREQUENCE_26M +#define CFG_XTAL_FREQUENCE_26M 26000000 +#define CFG_XTAL_FREQUENCE_40M 40000000 +#define CONFIG_APP_MP3PLAYER 0 +#define FPGA_PLATFORM 0 +#define OSMALLOC_STATISTICAL 0 +#define RF_USE_POLICY WIFI_DEFAULT_BLE_REQUEST +#define SOC_BK7221U 3 +#define SOC_BK7231 1 +#define SOC_BK7231N 5 +#define SOC_BK7231U 2 +#define SOC_PLATFORM 1 +#define THD_APPLICATION_PRIORITY 3 +#define THD_CORE_PRIORITY 2 +#define THD_EXTENDED_APP_PRIORITY 5 +#define THD_HOSTAPD_PRIORITY 5 +#define THD_INIT_PRIORITY 4 +#define THD_LWIP_PRIORITY 4 +#define THD_MEDIA_PRIORITY 4 +#define THD_RECONNECT_PRIORITY 4 +#define THD_UBG_PRIORITY 5 +#define THD_UMP3_PRIORITY 4 +#define THD_WPAS_PRIORITY 5 +#define THDD_KEY_SCAN_PRIORITY 7 +#define UART1_USE_FIFO_REC 0 +#define UART2_USE_FIFO_REC 0 +#define WIFI_DEFAULT_BLE_REQUEST 1 diff --git a/cores/beken-7231q/base/fixups/bk7231q.c b/cores/beken-7231q/base/fixups/bk7231q.c new file mode 100644 index 000000000..425e5bf50 --- /dev/null +++ b/cores/beken-7231q/base/fixups/bk7231q.c @@ -0,0 +1,26 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-06-20. */ + +int ble_active = 0; +int ble_switch_mac_sleeped = 0; + +int wifi_notice_ble_status() { + return 0; +} + +int wn_txl_hd_pending_is_allow() { + return 1; +} + +int if_ble_sleep() { + return 1; +} + +void ble_switch_rf_to_wifi() {} + +int rwip_get_current_time() { + return 0; +} + +int rwip_get_next_target_time() { + return 0; +} diff --git a/cores/beken-7231q/base/fixups/bk7231q.h b/cores/beken-7231q/base/fixups/bk7231q.h new file mode 100644 index 000000000..997621039 --- /dev/null +++ b/cores/beken-7231q/base/fixups/bk7231q.h @@ -0,0 +1,19 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-06-20. */ + +#pragma once + +#define GPIO_SD1_DMA_MODULE GPIO_SD_DMA_MODULE +#define SARADC_ADC_SATURATION_CFG (SARADC_BASE + 3 * 4) +#define SARADC_ADC_SAT_CTRL_MASK (0x3) +#define SARADC_ADC_DAT_AFTER_STA SARADC_ADC_DATA + +#define CMD_GET_SCTRL_RETETION 0xC123F48 +#define CMD_SET_SCTRL_RETETION 0xC123F49 + +inline void turnon_PA_in_temp_dect() {} + +inline void turnoff_PA_in_temp_dect() {} + +inline int if_ble_sleep() { + return 1; +} diff --git a/cores/beken-7231t/base/config/sys_config.h b/cores/beken-7231t/base/config/sys_config.h new file mode 100644 index 000000000..ceee972fa --- /dev/null +++ b/cores/beken-7231t/base/config/sys_config.h @@ -0,0 +1,118 @@ +#pragma once + +#define BLE_DEFAULT_WIFI_REQUEST 2 +#define BLE_VERSION_4_2 1 +#define BLE_VERSION_5_x 2 +#define BLE_WIFI_CO_REQUEST 3 +#define CFG_AIRKISS_TEST 0 +#define CFG_AP_MONITOR_COEXIST 0 +#define CFG_AP_SUPPORT_HT_IE 0 +#define CFG_BACKGROUND_PRINT 0 +#define CFG_BK_AWARE 0 +#define CFG_BK_AWARE_OUI "\xC8\x47\x8C" +#define CFG_BLE_VERSION BLE_VERSION_4_2 +#define CFG_EASY_FLASH 1 +#define CFG_ENABLE_BUTTON 0 +#define CFG_ENABLE_DEMO_TEST 0 +#define CFG_ENABLE_WPA_LOG 0 +#define CFG_GENERAL_DMA 1 +#define CFG_IEEE80211N 1 +#define CFG_IEEE80211W 0 +#define CFG_INT_WDG_ENABLED 0 +#define CFG_INT_WDG_PERIOD_MS 10000 +#define CFG_IPERF_TEST 0 +#define CFG_JTAG_ENABLE 0 +#define CFG_LESS_MEMERY_IN_RWNX 0 +#define CFG_MAC_PHY_BAPASS 1 +#define CFG_MSDU_RESV_HEAD_LEN 96 +#define CFG_MSDU_RESV_TAIL_LEN 16 +#define CFG_REAL_SDIO 0 +#define CFG_RELEASE_FIRMWARE 0 +#define CFG_RF_OTA_TEST 0 +#define CFG_ROLE_LAUNCH 0 +#define CFG_RUNNING_PLATFORM SOC_PLATFORM +#define CFG_RWNX_QOS_MSDU 1 +#define CFG_RX_SENSITIVITY_TEST 1 +#define CFG_SARADC_CALIBRATE 0 +#define CFG_SDIO 0 +#define CFG_SDIO_TRANS 0 +#define CFG_SOC_NAME SOC_BK7231U +#define CFG_SUPPORT_BKREG 1 +#define CFG_SUPPORT_BLE 1 +#define CFG_SUPPORT_BLE_MESH 0 +#define CFG_SUPPORT_BSSID_CONNECT 0 +#define CFG_SUPPORT_CALIBRATION 1 +#define CFG_SUPPORT_MANUAL_CALI 1 +#define CFG_SUPPORT_OTA_HTTP 1 +#define CFG_SUPPORT_OTA_TFTP 0 +#define CFG_SUPPORT_TPC_PA_MAP 1 +#define CFG_SYS_REDUCE_NORMAL_POWER 0 +#define CFG_TASK_WDG_ENABLED 0 +#define CFG_TASK_WDG_PERIOD_MS 60000 +#define CFG_TCP_SERVER_TEST 0 +#define CFG_TX_EVM_TEST 1 +#define CFG_UART_DEBUG 0 +#define CFG_UART_DEBUG_COMMAND_LINE 1 +#define CFG_UDISK_MP3 0 +#define CFG_USB 0 +#define CFG_USE_AP_IDLE 0 +#define CFG_USE_AP_PS 0 +#define CFG_USE_APP_DEMO_VIDEO_TRANSFER 0 +#define CFG_USE_AUD_ADC 0 +#define CFG_USE_AUD_DAC 0 +#define CFG_USE_AUDIO 0 +#define CFG_USE_BLE_PS 1 +#define CFG_USE_CAMERA_INTF 0 +#define CFG_USE_DEEP_PS 1 +#define CFG_USE_DHCP 1 +#define CFG_USE_FAKERTC_PS 0 +#define CFG_USE_FTPD_UPGRADE 0 +#define CFG_USE_HSLAVE_SPI 0 +#define CFG_USE_LWIP_NETSTACK 1 +#define CFG_USE_MCU_PS 1 +#define CFG_USE_PTA 0 +#define CFG_USE_SDCARD_HOST 0 +#define CFG_USE_SPIDMA 0 +#define CFG_USE_STA_PS 1 +#define CFG_USE_TEMPERATURE_DETECT 0 +#define CFG_USE_TICK_CAL 1 +#define CFG_USE_UART1 0 +#define CFG_USE_USB_CHARGE 0 +#define CFG_USE_USB_DEVICE 1 +#define CFG_USE_USB_DEVICE_CARD_READER 1 +#define CFG_USE_USB_HOST 0 +#define CFG_USE_WPA_29 1 +#define CFG_WFA_CERT 0 +#define CFG_WIFI_RAW_TX_CMD 0 +#define CFG_WIFI_SENSOR 0 +#define CFG_WLAN_FAST_CONNECT 0 +#define CFG_WPA_CTRL_IFACE 1 +#define CFG_WPA3 0 +#define CFG_XTAL_FREQUENCE CFG_XTAL_FREQUENCE_26M +#define CFG_XTAL_FREQUENCE_26M 26000000 +#define CFG_XTAL_FREQUENCE_40M 40000000 +#define CONFIG_APP_MP3PLAYER 0 +#define FPGA_PLATFORM 0 +#define OSMALLOC_STATISTICAL 0 +#define RF_USE_POLICY WIFI_DEFAULT_BLE_REQUEST +#define SOC_BK7221U 3 +#define SOC_BK7231 1 +#define SOC_BK7231N 5 +#define SOC_BK7231U 2 +#define SOC_BK7271 4 +#define SOC_PLATFORM 1 +#define THD_APPLICATION_PRIORITY 3 +#define THD_CORE_PRIORITY 2 +#define THD_EXTENDED_APP_PRIORITY 5 +#define THD_HOSTAPD_PRIORITY 5 +#define THD_INIT_PRIORITY 4 +#define THD_LWIP_PRIORITY 4 +#define THD_MEDIA_PRIORITY 4 +#define THD_RECONNECT_PRIORITY 4 +#define THD_UBG_PRIORITY 5 +#define THD_UMP3_PRIORITY 4 +#define THD_WPAS_PRIORITY 5 +#define THDD_KEY_SCAN_PRIORITY 7 +#define UART1_USE_FIFO_REC 0 +#define UART2_USE_FIFO_REC 0 +#define WIFI_DEFAULT_BLE_REQUEST 1 diff --git a/cores/beken-7231t/base/lt_defs.h b/cores/beken-7231t/base/lt_defs.h new file mode 100644 index 000000000..e0995057c --- /dev/null +++ b/cores/beken-7231t/base/lt_defs.h @@ -0,0 +1,5 @@ +#pragma once + +#error "Don't include this file directly" + +#define LT_HW_BLE 1 diff --git a/cores/beken-7251/base/config/sys_config.h b/cores/beken-7251/base/config/sys_config.h new file mode 100644 index 000000000..52dad227e --- /dev/null +++ b/cores/beken-7251/base/config/sys_config.h @@ -0,0 +1,134 @@ +#pragma once + +#define AT_SERVICE_CFG 0 +#define BLE_DEFAULT_WIFI_REQUEST 2 +#define BLE_VERSION_4_2 1 +#define BLE_VERSION_5_x 2 +#define BLE_WIFI_CO_REQUEST 3 +#define CFG_AIRKISS_TEST 0 +#define CFG_AP_MONITOR_COEXIST 0 +#define CFG_AP_SUPPORT_HT_IE 0 +#define CFG_BACKGROUND_PRINT 0 +#define CFG_BK_AWARE 0 +#define CFG_BK_AWARE_OUI "\xC8\x47\x8C" +#define CFG_BK7221_MDM_WATCHDOG_PATCH 0 +#define CFG_BLE_VERSION BLE_VERSION_4_2 +#define CFG_EASY_FLASH 1 +#define CFG_ENABLE_BUTTON 0 +#define CFG_ENABLE_DEMO_TEST 0 +#define CFG_ENABLE_WPA_LOG 0 +#define CFG_GENERAL_DMA 1 +#define CFG_IEEE80211N 1 +#define CFG_IEEE80211W 0 +#define CFG_INT_WDG_ENABLED 1 +#define CFG_INT_WDG_PERIOD_MS 10000 +#define CFG_IPERF_TEST 0 +#define CFG_JTAG_ENABLE 0 +#define CFG_LESS_MEMERY_IN_RWNX 0 +#define CFG_MAC_PHY_BAPASS 1 +#define CFG_MSDU_RESV_HEAD_LEN 96 +#define CFG_MSDU_RESV_TAIL_LEN 16 +#define CFG_REAL_SDIO 0 +#define CFG_RELEASE_FIRMWARE 0 +#define CFG_ROLE_LAUNCH 0 +#define CFG_RUNNING_PLATFORM SOC_PLATFORM +#define CFG_RWNX_QOS_MSDU 1 +#define CFG_RX_SENSITIVITY_TEST 1 +#define CFG_SARADC_CALIBRATE 0 +#define CFG_SD_HOST_INTF SD1_HOST_INTF +#define CFG_SDIO 0 +#define CFG_SDIO_TRANS 0 +#define CFG_SOC_NAME SOC_BK7221U +#define CFG_SUPPOET_BSSID_CONNECT 0 +#define CFG_SUPPORT_BKREG 1 +#define CFG_SUPPORT_BLE 1 +#define CFG_SUPPORT_BLE_MESH 0 +#define CFG_SUPPORT_BSSID_CONNECT 0 +#define CFG_SUPPORT_CALIBRATION 1 +#define CFG_SUPPORT_CCD 0 +#define CFG_SUPPORT_HID 0 +#define CFG_SUPPORT_MANUAL_CALI 1 +#define CFG_SUPPORT_MSD 0 +#define CFG_SUPPORT_OTA_HTTP 1 +#define CFG_SUPPORT_OTA_TFTP 0 +#define CFG_SUPPORT_TPC_PA_MAP 1 +#define CFG_SUPPORT_UVC 0 +#define CFG_SYS_REDUCE_NORMAL_POWER 0 +#define CFG_TASK_WDG_ENABLED 0 +#define CFG_TASK_WDG_PERIOD_MS 60000 +#define CFG_TCP_SERVER_TEST 0 +#define CFG_TX_EVM_TEST 1 +#define CFG_UART_DEBUG 0 +#define CFG_UART_DEBUG_COMMAND_LINE 1 +#define CFG_UDISK_MP3 0 +#define CFG_USB 0 +#define CFG_USE_AP_IDLE 0 +#define CFG_USE_AP_PS 0 +#define CFG_USE_APP_DEMO_VIDEO_TRANSFER 0 +#define CFG_USE_AUD_ADC 1 +#define CFG_USE_AUD_DAC 1 +#define CFG_USE_AUDIO 1 +#define CFG_USE_BLE_PS 1 +#define CFG_USE_CAMERA_INTF 0 +#define CFG_USE_DCACHE 0 +#define CFG_USE_DEEP_PS 1 +#define CFG_USE_DHCP 1 +#define CFG_USE_FAKERTC_PS 0 +#define CFG_USE_FFT 0 +#define CFG_USE_FTPD_UPGRADE 0 +#define CFG_USE_HSLAVE_SPI 0 +#define CFG_USE_I2S 0 +#define CFG_USE_IRDA 0 +#define CFG_USE_LWIP_NETSTACK 1 +#define CFG_USE_MCU_PS 1 +#define CFG_USE_PTA 0 +#define CFG_USE_QSPI 1 +#define CFG_USE_SDCARD_HOST 1 +#define CFG_USE_SECURITY 0 +#define CFG_USE_SPI_MASTER 1 +#define CFG_USE_SPI_MST_FLASH 1 +#define CFG_USE_SPI_MST_PSRAM 0 +#define CFG_USE_SPI_SLAVE 0 +#define CFG_USE_SPIDMA 0 +#define CFG_USE_STA_PS 1 +#define CFG_USE_TEMPERATURE_DETECT 0 +#define CFG_USE_TICK_CAL 1 +#define CFG_USE_UART1 1 +#define CFG_USE_USB_CHARGE 0 +#define CFG_USE_USB_DEVICE 1 +#define CFG_USE_USB_DEVICE_CARD_READER 1 +#define CFG_USE_USB_HOST 0 +#define CFG_USE_WPA_29 1 +#define CFG_WFA_CERT 0 +#define CFG_WIFI_RAW_TX_CMD 0 +#define CFG_WIFI_SENSOR 0 +#define CFG_WLAN_FAST_CONNECT 0 +#define CFG_WPA_CTRL_IFACE 1 +#define CFG_WPA3 0 +#define CFG_XTAL_FREQUENCE CFG_XTAL_FREQUENCE_26M +#define CFG_XTAL_FREQUENCE_26M 26000000 +#define CFG_XTAL_FREQUENCE_40M 40000000 +#define CONFIG_APP_MP3PLAYER 0 +#define FPGA_PLATFORM 0 +#define OSMALLOC_STATISTICAL 0 +#define RF_USE_POLICY WIFI_DEFAULT_BLE_REQUEST +#define SD_HOST_INTF 0 +#define SD1_HOST_INTF 1 +#define SOC_BK7221U 3 +#define SOC_BK7231 1 +#define SOC_BK7231N 5 +#define SOC_BK7231U 2 +#define SOC_PLATFORM 1 +#define THD_APPLICATION_PRIORITY 3 +#define THD_CORE_PRIORITY 2 +#define THD_EXTENDED_APP_PRIORITY 5 +#define THD_HOSTAPD_PRIORITY 5 +#define THD_INIT_PRIORITY 4 +#define THD_LWIP_PRIORITY 4 +#define THD_MEDIA_PRIORITY 4 +#define THD_RECONNECT_PRIORITY 4 +#define THD_UBG_PRIORITY 5 +#define THD_UMP3_PRIORITY 4 +#define THD_WPAS_PRIORITY 5 +#define THDD_KEY_SCAN_PRIORITY 7 +#define WIFI_DEFAULT_BLE_REQUEST 1 diff --git a/cores/beken-7251/base/lt_defs.h b/cores/beken-7251/base/lt_defs.h new file mode 100644 index 000000000..e0995057c --- /dev/null +++ b/cores/beken-7251/base/lt_defs.h @@ -0,0 +1,5 @@ +#pragma once + +#error "Don't include this file directly" + +#define LT_HW_BLE 1 diff --git a/cores/beken-72xx/arduino/libraries/Serial/Serial.cpp b/cores/beken-72xx/arduino/libraries/Serial/Serial.cpp new file mode 100644 index 000000000..0aafcb940 --- /dev/null +++ b/cores/beken-72xx/arduino/libraries/Serial/Serial.cpp @@ -0,0 +1,92 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-23. */ + +#include "SerialPrivate.h" + +#if LT_HW_UART1 +SerialClass Serial1(UART1_PORT); +#endif +#if LT_HW_UART2 +SerialClass Serial2(UART2_PORT); +#endif + +static void callback(int port, void *param) { + int ch; + while ((ch = uart_read_byte(port)) != -1) { +#if LT_AUTO_DOWNLOAD_REBOOT && defined(LT_UART_ADR_PATTERN) && PIN_SERIAL1_RX != PIN_INVALID + // parse UART protocol commands on UART1 + if (port == UART1_PORT) + SerialClass::adrParse(ch); +#endif + pBUF->store_char(ch); + } +} + +void SerialClass::begin(unsigned long baudrate, uint16_t config) { + if (!this->data) { + this->data = new SerialData(); + this->buf = &BUF; + } + + if (this->baudrate != baudrate || this->config != config) + this->configure(baudrate, config); +} + +void SerialClass::configure(unsigned long baudrate, uint16_t config) { + if (!this->data) + return; + + uint8_t dataWidth = ((config & SERIAL_DATA_MASK) >> 8) - 1; // 0x100..0x400 -> 0..3 + uint8_t parity = 3 - (config & SERIAL_PARITY_MASK); // 0x3..0x1 -> 0..2 + uint8_t stopBits = (config & SERIAL_STOP_BIT_MASK) == SERIAL_STOP_BIT_2; // 0x10..0x30 -> 0..1 + + bk_uart_config_t cfg = { + .baud_rate = baudrate, + .data_width = (uart_data_width_t)dataWidth, + .parity = (uart_parity_t)parity, + .stop_bits = (uart_stop_bits_t)stopBits, + .flow_control = FLOW_CTRL_DISABLED, + }; + + if (port == 1) + uart1_init(); + else if (port == 2) + uart2_init(); + uart_hw_set_change(port, &cfg); + uart_rx_callback_set(port, callback, &BUF); + + this->baudrate = baudrate; + this->config = config; +} + +void SerialClass::end() { + if (!this->data) + return; + + uart_rx_callback_set(port, NULL, NULL); + switch (port) { + case 1: + uart1_exit(); + break; + case 2: + uart2_exit(); + break; + } + + delete DATA; + this->data = NULL; + this->buf = NULL; + this->baudrate = 0; +} + +void SerialClass::flush() { + if (!this->data) + return; + uart_wait_tx_over(); +} + +size_t SerialClass::write(uint8_t c) { + if (!this->data) + return 0; + bk_send_byte(port, c); + return 1; +} diff --git a/cores/beken-72xx/arduino/libraries/Serial/SerialPrivate.h b/cores/beken-72xx/arduino/libraries/Serial/SerialPrivate.h new file mode 100644 index 000000000..c481237c0 --- /dev/null +++ b/cores/beken-72xx/arduino/libraries/Serial/SerialPrivate.h @@ -0,0 +1,14 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-05-24. */ + +#pragma once + +#include +#include + +typedef struct { + RingBuffer buf; +} SerialData; + +#define DATA ((SerialData *)data) +#define BUF (DATA->buf) +#define pBUF ((RingBuffer *)param) diff --git a/cores/beken-72xx/arduino/libraries/WiFi/WiFi.cpp b/cores/beken-72xx/arduino/libraries/WiFi/WiFi.cpp new file mode 100644 index 000000000..32f7d2e15 --- /dev/null +++ b/cores/beken-72xx/arduino/libraries/WiFi/WiFi.cpp @@ -0,0 +1,63 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-26. */ + +#include "WiFiPrivate.h" + +WiFiClass::WiFiClass() { + data = (WiFiData *)calloc(1, sizeof(WiFiData)); + + DATA->scanSem = xSemaphoreCreateBinary(); + STA_CFG.dhcp_mode = DHCP_CLIENT; + STA_ADV_CFG.dhcp_mode = DHCP_CLIENT; +} + +WiFiClass::~WiFiClass() { + vSemaphoreDelete(DATA->scanSem); + free(data); + data = NULL; +} + +WiFiStatus eventTypeToStatus(uint8_t type) { + // rw_msg_pub.h:9 + switch (type) { + case RW_EVT_STA_IDLE: + return WL_IDLE_STATUS; + case RW_EVT_STA_NO_AP_FOUND: + return WL_NO_SSID_AVAIL; + case RW_EVT_STA_CONNECTING: + case RW_EVT_STA_CONNECTED: + return WL_SCAN_COMPLETED; + case RW_EVT_STA_GOT_IP: + return WL_CONNECTED; + case RW_EVT_STA_PASSWORD_WRONG: + case RW_EVT_STA_ASSOC_FULL: + case RW_EVT_STA_CONNECT_FAILED: + return WL_CONNECT_FAILED; + case RW_EVT_STA_BEACON_LOSE: + return WL_CONNECTION_LOST; + case RW_EVT_STA_DISCONNECTED: + return WL_DISCONNECTED; + } + return WL_IDLE_STATUS; +} + +WiFiAuthMode securityTypeToAuthMode(uint8_t type) { + // wlan_ui_pub.h:62 + switch (type) { + case BK_SECURITY_TYPE_NONE: + return WIFI_AUTH_OPEN; + case BK_SECURITY_TYPE_WEP: + return WIFI_AUTH_WEP; + case BK_SECURITY_TYPE_WPA_TKIP: + case BK_SECURITY_TYPE_WPA_AES: + return WIFI_AUTH_WPA_PSK; + case BK_SECURITY_TYPE_WPA2_TKIP: + case BK_SECURITY_TYPE_WPA2_AES: + case BK_SECURITY_TYPE_WPA2_MIXED: + return WIFI_AUTH_WPA2_PSK; + case BK_SECURITY_TYPE_WPA3_SAE: + return WIFI_AUTH_WPA3_PSK; + case BK_SECURITY_TYPE_WPA3_WPA2_MIXED: + return WIFI_AUTH_WPA2_WPA3_PSK; + } + return WIFI_AUTH_INVALID; +} diff --git a/cores/beken-72xx/arduino/libraries/WiFi/WiFiAP.cpp b/cores/beken-72xx/arduino/libraries/WiFi/WiFiAP.cpp new file mode 100644 index 000000000..3c98e01f7 --- /dev/null +++ b/cores/beken-72xx/arduino/libraries/WiFi/WiFiAP.cpp @@ -0,0 +1,126 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-07-01. */ + +#include "WiFiPrivate.h" + +bool WiFiClass::softAP(const char *ssid, const char *passphrase, int channel, bool ssidHidden, int maxClients) { + if (!enableAP(true)) + return WL_CONNECT_FAILED; + if (!validate(ssid, passphrase)) + return WL_CONNECT_FAILED; + + LT_HEAP_I(); + + // Beken SDK bug: bk_wlan_ap_init_adv() doesn't null-terminate the passphrase + memset(g_ap_param_ptr->key, '\0', 65); + + strcpy(AP_CFG.wifi_ssid, ssid); + if (passphrase) { + strcpy(AP_CFG.wifi_key, passphrase); + AP_CFG.security = BK_SECURITY_TYPE_WPA2_MIXED; + } else { + AP_CFG.wifi_key[0] = '\0'; + AP_CFG.security = BK_SECURITY_TYPE_NONE; + } + + AP_CFG.channel = channel; + AP_CFG.ssid_hidden = ssidHidden; + AP_CFG.max_con = maxClients; + AP_CFG.dhcp_mode = DHCP_SERVER; + AP_CFG.wifi_retry_interval = 100; + + LT_IM(WIFI, "Creating SoftAP %s", ssid); + + if (!AP_CFG.local_ip_addr[0]) { + LT_DM(WIFI, "Setting default IP config"); + softAPConfig((uint32_t)0, (uint32_t)0, (uint32_t)0); + } + + LT_DM(WIFI, "Static IP: %s / %s / %s", AP_CFG.local_ip_addr, AP_CFG.net_mask, AP_CFG.gateway_ip_addr); + + __wrap_bk_printf_disable(); + OSStatus ret = bk_wlan_start_ap_adv(&AP_CFG); + __wrap_bk_printf_enable(); + + if (ret != 0) { + LT_EM(WIFI, "SoftAP failed; ret=%d", ret); + return false; + } + LT_DM(WIFI, "AP start OK"); + return true; +} + +bool WiFiClass::softAPConfig(IPAddress localIP, IPAddress gateway, IPAddress subnet) { + if (!localIP) { + localIP = gateway = IPAddress(192, 168, 43, 1); + subnet = IPAddress(255, 255, 255, 0); + } + sprintf(AP_CFG.local_ip_addr, IP_FMT, localIP[0], localIP[1], localIP[2], localIP[3]); + sprintf(AP_CFG.net_mask, IP_FMT, subnet[0], subnet[1], subnet[2], subnet[3]); + sprintf(AP_CFG.gateway_ip_addr, IP_FMT, gateway[0], gateway[1], gateway[2], gateway[3]); + // from wlan_ui.c:1370 + if (uap_ip_is_start()) { + uap_ip_down(); + ip_address_set( + BK_STATION, + AP_CFG.dhcp_mode, + AP_CFG.local_ip_addr, + AP_CFG.net_mask, + AP_CFG.gateway_ip_addr, + AP_CFG.dns_server_ip_addr + ); + uap_ip_start(); + } + return true; +} + +bool WiFiClass::softAPdisconnect(bool wifiOff) { + if (!(getMode() & WIFI_MODE_AP)) + // do not call SDK methods before even initializing WiFi first + return true; + return bk_wlan_stop(BK_SOFT_AP) == kNoErr; +} + +uint8_t WiFiClass::softAPgetStationNum() { + return 0; +} + +IPAddress WiFiClass::softAPIP() { + AP_GET_IP_STATUS_RETURN((uint32_t)0); + IPAddress ip; + ip.fromString(IP_STATUS.ip); + return ip; +} + +IPAddress WiFiClass::softAPSubnetMask() { + AP_GET_IP_STATUS_RETURN((uint32_t)0); + IPAddress ip; + ip.fromString(IP_STATUS.mask); + return ip; +} + +const char *WiFiClass::softAPgetHostname() { + struct netif *ifs = (struct netif *)net_get_uap_handle(); + return netif_get_hostname(ifs); +} + +bool WiFiClass::softAPsetHostname(const char *hostname) { + struct netif *ifs = (struct netif *)net_get_uap_handle(); + netif_set_hostname(ifs, (char *)hostname); + return true; +} + +uint8_t *WiFiClass::softAPmacAddress(uint8_t *mac) { + setMacAddress(mac); + return mac; +} + +String WiFiClass::softAPmacAddress(void) { + uint8_t mac[ETH_ALEN]; + wifi_get_mac_address((char *)mac, CONFIG_ROLE_AP); + return macToString(mac); +} + +const String WiFiClass::softAPSSID(void) { + AP_GET_LINK_STATUS_RETURN(""); + return AP_CFG.wifi_ssid; +} diff --git a/cores/beken-72xx/arduino/libraries/WiFi/WiFiEvents.cpp b/cores/beken-72xx/arduino/libraries/WiFi/WiFiEvents.cpp new file mode 100644 index 000000000..6aa3cef34 --- /dev/null +++ b/cores/beken-72xx/arduino/libraries/WiFi/WiFiEvents.cpp @@ -0,0 +1,149 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-07-10. */ + +#include "WiFiPrivate.h" + +#include + +static xQueueHandle wifiEventQueueHandle = NULL; +static xTaskHandle wifiEventTaskHandle = NULL; + +static const rw_evt_type eventConnected = RW_EVT_STA_CONNECTED; + +// callback for bk_wlan_status_register_cb() +static void wifiStatusCallback(rw_evt_type *pEvent) { + if (wifiEventQueueHandle && wifiEventTaskHandle) { + xQueueSend(wifiEventQueueHandle, pEvent, portMAX_DELAY); + } else { + wifiEventHandler(*pEvent); + } +} + +static void wifiEventTask(void *arg) { + rw_evt_type event = RW_EVT_MAX; + for (;;) { + if (xQueueReceive(wifiEventQueueHandle, &event, portMAX_DELAY) == pdTRUE) { + wifiEventHandler(event); + } + } +} + +void wifiEventSendArduino(EventId event) { + event = (EventId)(RW_EVT_ARDUINO | event); + wifiStatusCallback((rw_evt_type *)&event); +} + +void startWifiTask() { + if (!wifiEventQueueHandle) { + LT_HEAP_I(); + wifiEventQueueHandle = xQueueCreate(32, sizeof(rw_evt_type)); + LT_HEAP_I(); + } + if (!wifiEventTaskHandle) { + LT_HEAP_I(); + xTaskCreate(wifiEventTask, "wifievent", 512, NULL, 4, &wifiEventTaskHandle); + LT_HEAP_I(); + } + bk_wlan_status_register_cb((FUNC_1PARAM_PTR)wifiStatusCallback); +} + +void wifiEventHandler(rw_evt_type event) { + if (!pWiFi) + return; // failsafe + + LT_DM(WIFI, "BK event %u", event); + + if (event <= RW_EVT_STA_GOT_IP) + pDATA->lastStaEvent = event; + else + pDATA->lastApEvent = event; + + EventId eventId; + EventInfo eventInfo; + String ssid; + + memset(&eventInfo, 0, sizeof(EventInfo)); + + switch (event) { + case RW_EVT_STA_IDLE: + eventId = ARDUINO_EVENT_WIFI_READY; + break; + + case RW_EVT_STA_BEACON_LOSE: + case RW_EVT_STA_PASSWORD_WRONG: + case RW_EVT_STA_NO_AP_FOUND: + case RW_EVT_STA_ASSOC_FULL: + case RW_EVT_STA_DISCONNECTED: + case RW_EVT_STA_CONNECT_FAILED: + eventId = ARDUINO_EVENT_WIFI_STA_DISCONNECTED; + eventInfo.wifi_sta_disconnected.ssid_len = 0; + switch (event) { + case RW_EVT_STA_BEACON_LOSE: + eventInfo.wifi_sta_disconnected.reason = WIFI_REASON_BEACON_TIMEOUT; + break; + case RW_EVT_STA_PASSWORD_WRONG: + eventInfo.wifi_sta_disconnected.reason = WIFI_REASON_AUTH_FAIL; + break; + case RW_EVT_STA_NO_AP_FOUND: + eventInfo.wifi_sta_disconnected.reason = WIFI_REASON_NO_AP_FOUND; + break; + case RW_EVT_STA_ASSOC_FULL: + eventInfo.wifi_sta_disconnected.reason = WIFI_REASON_ASSOC_TOOMANY; + break; + case RW_EVT_STA_DISCONNECTED: + eventInfo.wifi_sta_disconnected.reason = WIFI_REASON_ASSOC_LEAVE; + break; + case RW_EVT_STA_CONNECT_FAILED: + eventInfo.wifi_sta_disconnected.reason = WIFI_REASON_CONNECTION_FAIL; + break; + default: + eventInfo.wifi_sta_disconnected.reason = WIFI_REASON_UNSPECIFIED; + break; + } + break; + + case RW_EVT_STA_CONNECTED: + eventId = ARDUINO_EVENT_WIFI_STA_CONNECTED; + ssid = pWiFi->SSID(); + eventInfo.wifi_sta_connected.ssid_len = ssid.length(); + eventInfo.wifi_sta_connected.channel = pWiFi->channel(); + eventInfo.wifi_sta_connected.authmode = pWiFi->getEncryption(); + memcpy(eventInfo.wifi_sta_connected.ssid, ssid.c_str(), eventInfo.wifi_sta_connected.ssid_len + 1); + memcpy(eventInfo.wifi_sta_connected.bssid, pWiFi->BSSID(), 6); + break; + + case RW_EVT_STA_GOT_IP: + eventId = ARDUINO_EVENT_WIFI_STA_GOT_IP; + eventInfo.got_ip.if_index = 0; + eventInfo.got_ip.ip_changed = true; + eventInfo.got_ip.ip_info.ip.addr = WiFi.localIP(); + eventInfo.got_ip.ip_info.netmask.addr = WiFi.subnetMask(); + eventInfo.got_ip.ip_info.gw.addr = WiFi.gatewayIP(); + break; + + case RW_EVT_AP_CONNECTED: + eventId = ARDUINO_EVENT_WIFI_AP_STACONNECTED; + // TODO station MAC + break; + + case RW_EVT_AP_DISCONNECTED: + eventId = ARDUINO_EVENT_WIFI_AP_STADISCONNECTED; + // TODO station MAC + break; + + case RW_EVT_ARDUINO | ARDUINO_EVENT_WIFI_SCAN_DONE: + eventId = ARDUINO_EVENT_WIFI_SCAN_DONE; + eventInfo.wifi_scan_done.status = 0; + if (pWiFi->scan) + eventInfo.wifi_scan_done.number = pWiFi->scan->count; + eventInfo.wifi_scan_done.scan_id = 0; + break; + + default: + if (event < RW_EVT_ARDUINO) + return; + eventId = (EventId)(event - RW_EVT_ARDUINO); + break; + } + + pWiFi->postEvent(eventId, eventInfo); +} diff --git a/cores/beken-72xx/arduino/libraries/WiFi/WiFiGeneric.cpp b/cores/beken-72xx/arduino/libraries/WiFi/WiFiGeneric.cpp new file mode 100644 index 000000000..1374c76d3 --- /dev/null +++ b/cores/beken-72xx/arduino/libraries/WiFi/WiFiGeneric.cpp @@ -0,0 +1,103 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-26. */ + +#include "WiFiPrivate.h" + +bool WiFiClass::modePriv(WiFiMode mode, WiFiModeAction sta, WiFiModeAction ap) { + __wrap_bk_printf_disable(); + startWifiTask(); + + if (!__bk_rf_is_init) { + LT_DM(WIFI, "Initializing func&app"); + func_init_extended(); + app_pre_start(); + // wait for the init_thread to finish its job + while (xTaskGetHandle("init_thread")) { + LT_VM(WIFI, "Waiting for init_thread"); + delay(10); + } + LT_DM(WIFI, "Init OK"); + __bk_rf_is_init = true; + } + + LT_HEAP_I(); + + if (mode) { + LT_DM(WIFI, "Wakeup RF"); + uint32_t reg = 1; // this is only checked for being true-ish + sddev_control(SCTRL_DEV_NAME, CMD_RF_HOLD_BIT_SET, ®); + } + + if (sta == WLMODE_ENABLE) { + LT_DM(WIFI, "Enabling STA"); + bk_wlan_sta_init(NULL); +#if CFG_WPA_CTRL_IFACE + wlan_sta_enable(); +#endif + wifiEventSendArduino(ARDUINO_EVENT_WIFI_STA_START); + } else if (sta == WLMODE_DISABLE) { + LT_DM(WIFI, "Disabling STA"); + bk_wlan_stop(BK_STATION); + wifiEventSendArduino(ARDUINO_EVENT_WIFI_STA_STOP); + } + + LT_HEAP_I(); + + if (ap == WLMODE_ENABLE) { + LT_DM(WIFI, "Enabling AP"); + // fake it - on BK7231, enabling the AP without starting it breaks all connection attempts + DATA->apEnabled = true; + wifiEventSendArduino(ARDUINO_EVENT_WIFI_AP_START); + } else if (ap == WLMODE_DISABLE) { + LT_DM(WIFI, "Disabling AP"); + bk_wlan_stop(BK_SOFT_AP); + DATA->apEnabled = false; + wifiEventSendArduino(ARDUINO_EVENT_WIFI_AP_STOP); + } + + // force checking actual mode again + mode = getMode(); + + LT_HEAP_I(); + + __wrap_bk_printf_enable(); + return true; +} + +WiFiMode WiFiClass::getMode() { + uint8_t sta = !!bk_wlan_has_role(VIF_STA) * WIFI_MODE_STA; + uint8_t ap = DATA->apEnabled * WIFI_MODE_AP; // report the faked value + return (WiFiMode)(sta | ap); +} + +WiFiStatus WiFiClass::status() { + rw_evt_type status = DATA->lastStaEvent; + if (status == RW_EVT_STA_CONNECTED && STA_CFG.dhcp_mode == DHCP_DISABLE) + status = RW_EVT_STA_GOT_IP; + return eventTypeToStatus(status); +} + +IPAddress WiFiClass::hostByName(const char *hostname) { + ip_addr_t ip; + int ret = netconn_gethostbyname(hostname, &ip); + if (ret == ERR_OK) { + return ip.addr; + } + return IPAddress(); +} + +bool WiFiClass::setSleep(bool enable) { + LT_DM(WIFI, "WiFi sleep mode %u", enable); + if (enable) { + // Replicating OpenBeken PowerSave feature + // https://github.com/openshwprojects/OpenBK7231T_App/blob/567c5756b489f0670988fad1c2742a19f0f217ea/src/cmnds/cmd_main.c#L58 + bk_wlan_power_save_set_level((BK_PS_LEVEL)(PS_RF_SLEEP_BIT | PS_MCU_SLEEP_BIT)); + } else { + bk_wlan_power_save_set_level((BK_PS_LEVEL)0); + } + DATA->sleep = enable; + return true; +} + +bool WiFiClass::getSleep() { + return DATA->sleep; +} diff --git a/cores/beken-72xx/arduino/libraries/WiFi/WiFiPrivate.h b/cores/beken-72xx/arduino/libraries/WiFi/WiFiPrivate.h new file mode 100644 index 000000000..38ec80c00 --- /dev/null +++ b/cores/beken-72xx/arduino/libraries/WiFi/WiFiPrivate.h @@ -0,0 +1,112 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-26. */ + +#pragma once + +#include +#include + +extern "C" { + +#include +#include +#include +// port/net.h +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern void func_init_extended(); +extern void app_pre_start(); +extern void bk_wlan_ap_init(network_InitTypeDef_st *inNetworkInitPara); +extern int bk_wlan_power_save_set_level(BK_PS_LEVEL level); + +// func/hostapd-2.5/wpa_supplicant/main_supplicant.c +extern struct wpa_ssid_value *wpas_connect_ssid; + +// app/param_config.c +extern general_param_t *g_wlan_general_param; +extern ap_param_t *g_ap_param_ptr; +extern sta_param_t *g_sta_param_ptr; +extern uint8_t system_mac[6]; + +// WiFi.cpp +WiFiStatus eventTypeToStatus(uint8_t type); +WiFiAuthMode securityTypeToAuthMode(uint8_t type); + +// WiFiEvents.cpp +extern void wifiEventSendArduino(EventId event); +extern void startWifiTask(); +extern void wifiEventHandler(rw_evt_type event); + +#define RW_EVT_ARDUINO (1 << 7) + +#define IP_FMT "%u.%u.%u.%u" + +typedef struct { + network_InitTypeDef_st configSta; + network_InitTypeDef_adv_st configStaAdv; + network_InitTypeDef_ap_st configAp; + unsigned long scannedAt; + SemaphoreHandle_t scanSem; + IPStatusTypedef statusIp; + LinkStatusTypeDef statusLink; + rw_evt_type lastStaEvent; + rw_evt_type lastApEvent; + bool apEnabled; + bool sleep; +} WiFiData; + +#define DATA ((WiFiData *)data) +#define pDATA ((WiFiData *)pWiFi->data) +#define cDATA ((WiFiData *)cls->data) + +#define STA_CFG (DATA->configSta) +#define STA_ADV_CFG (DATA->configStaAdv) +#define AP_CFG (DATA->configAp) +#define IP_STATUS (DATA->statusIp) +#define LINK_STATUS (DATA->statusLink) + +#define STA_GET_LINK_STATUS_RETURN(ret) \ + { \ + if (!sta_ip_is_start()) \ + return ret; \ + memset(&LINK_STATUS, 0x00, sizeof(LinkStatusTypeDef)); \ + bk_wlan_get_link_status(&LINK_STATUS); \ + } + +#define STA_GET_IP_STATUS_RETURN(ret) \ + { \ + if (!sta_ip_is_start()) \ + return ret; \ + memset(&IP_STATUS, 0x00, sizeof(IPStatusTypedef)); \ + bk_wlan_get_ip_status(&IP_STATUS, BK_STATION); \ + } + +#define AP_GET_LINK_STATUS_RETURN(ret) \ + { \ + if (!uap_ip_is_start()) \ + return ret; \ + } + +#define AP_GET_IP_STATUS_RETURN(ret) \ + { \ + if (!uap_ip_is_start()) \ + return ret; \ + memset(&IP_STATUS, 0x00, sizeof(IPStatusTypedef)); \ + bk_wlan_get_ip_status(&IP_STATUS, BK_SOFT_AP); \ + } + +} // extern "C" diff --git a/cores/beken-72xx/arduino/libraries/WiFi/WiFiSTA.cpp b/cores/beken-72xx/arduino/libraries/WiFi/WiFiSTA.cpp new file mode 100644 index 000000000..a5558d101 --- /dev/null +++ b/cores/beken-72xx/arduino/libraries/WiFi/WiFiSTA.cpp @@ -0,0 +1,248 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-27. */ + +#include "WiFiPrivate.h" + +WiFiStatus +WiFiClass::begin(const char *ssid, const char *passphrase, int32_t channel, const uint8_t *bssid, bool connect) { + if (!enableSTA(true)) + return WL_CONNECT_FAILED; + if (!validate(ssid, passphrase)) + return WL_CONNECT_FAILED; + + LT_HEAP_I(); + + disconnect(false); + + if (bssid) { + strcpy(STA_ADV_CFG.ap_info.ssid, ssid); + if (passphrase) { + strcpy(STA_ADV_CFG.key, passphrase); + STA_ADV_CFG.key_len = strlen(passphrase); + } else { + STA_ADV_CFG.key[0] = '\0'; + STA_ADV_CFG.key_len = 0; + } + STA_ADV_CFG.ap_info.channel = channel; + STA_ADV_CFG.wifi_retry_interval = 100; + } else { + strcpy(STA_CFG.wifi_ssid, ssid); + if (passphrase) { + strcpy(STA_CFG.wifi_key, passphrase); + } else { + STA_CFG.wifi_key[0] = '\0'; + } + STA_CFG.wifi_retry_interval = 100; + STA_CFG.wifi_mode = BK_STATION; + } + + if (reconnect(bssid)) + return WL_CONNECTED; + + return WL_CONNECT_FAILED; +} + +bool WiFiClass::config(IPAddress localIP, IPAddress gateway, IPAddress subnet, IPAddress dns1, IPAddress dns2) { + STA_CFG.dhcp_mode = localIP ? DHCP_DISABLE : DHCP_CLIENT; + STA_ADV_CFG.dhcp_mode = localIP ? DHCP_DISABLE : DHCP_CLIENT; + if (localIP) { + sprintf(STA_CFG.local_ip_addr, IP_FMT, localIP[0], localIP[1], localIP[2], localIP[3]); + sprintf(STA_CFG.net_mask, IP_FMT, subnet[0], subnet[1], subnet[2], subnet[3]); + sprintf(STA_CFG.gateway_ip_addr, IP_FMT, gateway[0], gateway[1], gateway[2], gateway[3]); + sprintf(STA_ADV_CFG.local_ip_addr, IP_FMT, localIP[0], localIP[1], localIP[2], localIP[3]); + sprintf(STA_ADV_CFG.net_mask, IP_FMT, subnet[0], subnet[1], subnet[2], subnet[3]); + sprintf(STA_ADV_CFG.gateway_ip_addr, IP_FMT, gateway[0], gateway[1], gateway[2], gateway[3]); + if (dns1) { + sprintf(STA_CFG.dns_server_ip_addr, IP_FMT, dns1[0], dns1[1], dns1[2], dns1[3]); + sprintf(STA_ADV_CFG.dns_server_ip_addr, IP_FMT, dns1[0], dns1[1], dns1[2], dns1[3]); + } else { + STA_CFG.dns_server_ip_addr[0] = '\0'; + STA_ADV_CFG.dns_server_ip_addr[0] = '\0'; + } + } else { + STA_CFG.local_ip_addr[0] = '\0'; + STA_CFG.net_mask[0] = '\0'; + STA_CFG.gateway_ip_addr[0] = '\0'; + STA_CFG.dns_server_ip_addr[0] = '\0'; + STA_ADV_CFG.local_ip_addr[0] = '\0'; + STA_ADV_CFG.net_mask[0] = '\0'; + STA_ADV_CFG.gateway_ip_addr[0] = '\0'; + STA_ADV_CFG.dns_server_ip_addr[0] = '\0'; + } + + // from wlan_ui.c:1370 + if (sta_ip_is_start()) { + sta_ip_down(); + ip_address_set( + BK_STATION, + STA_CFG.dhcp_mode, + STA_CFG.local_ip_addr, + STA_CFG.net_mask, + STA_CFG.gateway_ip_addr, + STA_CFG.dns_server_ip_addr + ); + sta_ip_start(); + } + return true; +} + +bool WiFiClass::reconnect(const uint8_t *bssid) { + if (!bssid && !STA_CFG.wifi_ssid[0]) { + LT_EM(WIFI, "(B)SSID not specified"); + goto error; + } + + if (bssid) { + LT_IM(WIFI, "Connecting to " MACSTR, MAC2STR(bssid)); + } else { + LT_IM(WIFI, "Connecting to %s", STA_CFG.wifi_ssid); + } + + LT_DM(WIFI, "Data = %p", DATA->configSta); + + if (bssid) + memcpy(STA_ADV_CFG.ap_info.bssid, bssid, 6); + else + memset(STA_CFG.wifi_bssid, 0x00, 6); + + if (STA_CFG.dhcp_mode == DHCP_DISABLE) { + LT_DM(WIFI, "Static IP: %s / %s / %s", STA_CFG.local_ip_addr, STA_CFG.net_mask, STA_CFG.gateway_ip_addr); + LT_DM(WIFI, "Static DNS: %s", STA_CFG.dns_server_ip_addr); + } else { + LT_DM(WIFI, "Using DHCP"); + } + + LT_DM(WIFI, "Starting WiFi..."); + + __wrap_bk_printf_disable(); + if (bssid) { + bk_wlan_start_sta_adv(&STA_ADV_CFG); + } else { + bk_wlan_start_sta(&STA_CFG); + } + __wrap_bk_printf_enable(); + + LT_DM(WIFI, "Start OK"); + return true; + +error: + return false; +} + +bool WiFiClass::disconnect(bool wifiOff) { +#if LT_DEBUG_WIFI + memset(&LINK_STATUS, 0x00, sizeof(LinkStatusTypeDef)); + bk_wlan_get_link_status(&LINK_STATUS); + LT_DM(WIFI, "Disconnecting from %s (wifiOff=%d)", LINK_STATUS.ssid, wifiOff); +#endif + bk_wlan_connection_loss(); + if (wifiOff) + enableSTA(false); + return true; +} + +bool WiFiClass::setAutoReconnect(bool autoReconnect) { + return false; +} + +bool WiFiClass::getAutoReconnect() { + return false; +} + +IPAddress WiFiClass::localIP() { + STA_GET_IP_STATUS_RETURN((uint32_t)0); + IPAddress ip; + ip.fromString(IP_STATUS.ip); + return ip; +} + +IPAddress WiFiClass::subnetMask() { + STA_GET_IP_STATUS_RETURN((uint32_t)0); + IPAddress ip; + ip.fromString(IP_STATUS.mask); + return ip; +} + +IPAddress WiFiClass::gatewayIP() { + STA_GET_IP_STATUS_RETURN((uint32_t)0); + IPAddress ip; + ip.fromString(IP_STATUS.gate); + return ip; +} + +IPAddress WiFiClass::dnsIP(uint8_t dns_no) { + STA_GET_IP_STATUS_RETURN((uint32_t)0); + IPAddress ip; + ip.fromString(IP_STATUS.dns); + return ip; +} + +IPAddress WiFiClass::broadcastIP() { + return calculateBroadcast(localIP(), subnetMask()); +} + +const char *WiFiClass::getHostname() { + struct netif *ifs = (struct netif *)net_get_sta_handle(); + return netif_get_hostname(ifs); +} + +bool WiFiClass::setHostname(const char *hostname) { + struct netif *ifs = (struct netif *)net_get_sta_handle(); + netif_set_hostname(ifs, (char *)hostname); + return true; +} + +uint8_t *WiFiClass::macAddress(uint8_t *mac) { + wifi_get_mac_address((char *)mac, CONFIG_ROLE_STA); + return mac; +} + +bool WiFiClass::setMacAddress(const uint8_t *mac) { + if (mac[0] & 0x01) { + LT_EM(WIFI, "Invalid MAC address"); + return false; + } + // ensure "mac_inited" is true + wifi_get_mac_address((char *)system_mac, BK_STATION); + // store the MAC globally + memcpy(system_mac, mac, 6); + WiFiMode previousMode = getMode(); + if (previousMode) { + mode(WIFI_MODE_NULL); + mode(previousMode); + } + return true; +} + +const String WiFiClass::SSID() { + STA_GET_LINK_STATUS_RETURN(""); + return (char *)LINK_STATUS.ssid; +} + +const String WiFiClass::psk() { + if (!isConnected()) + return ""; + struct wpa_supplicant *wpas = wpa_suppliant_ctrl_get_wpas(); + if (!wpas || !wpas->conf || !wpas->conf->ssid) + return ""; + return (char *)wpas->conf->ssid->passphrase; +} + +uint8_t *WiFiClass::BSSID() { + STA_GET_LINK_STATUS_RETURN(NULL); + return LINK_STATUS.bssid; +} + +int32_t WiFiClass::channel() { + STA_GET_LINK_STATUS_RETURN(0); + return LINK_STATUS.channel; +} + +int8_t WiFiClass::RSSI() { + STA_GET_LINK_STATUS_RETURN(0); + return LINK_STATUS.wifi_strength; +} + +WiFiAuthMode WiFiClass::getEncryption() { + STA_GET_LINK_STATUS_RETURN(WIFI_AUTH_INVALID); + return securityTypeToAuthMode(LINK_STATUS.security); +} diff --git a/cores/beken-72xx/arduino/libraries/WiFi/WiFiScan.cpp b/cores/beken-72xx/arduino/libraries/WiFi/WiFiScan.cpp new file mode 100644 index 000000000..fe739658d --- /dev/null +++ b/cores/beken-72xx/arduino/libraries/WiFi/WiFiScan.cpp @@ -0,0 +1,105 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-27. */ + +#include "WiFiPrivate.h" + +static void scanHandler(void *ctx, uint8_t param) { + LT_HEAP_I(); + WiFiClass *cls = (WiFiClass *)ctx; + if (!cls) { + LT_WM(WIFI, "Called without ctx"); + return; + } + WiFiScanData *scan = cls->scan; + if (!scan) { + LT_WM(WIFI, "Called without cls->scan"); + return; + } + + uint8_t apNum = 0; + ScanResult_adv result; + result.ApNum = 0; + result.ApList = NULL; + if (wlan_sta_scan_result(&result)) { + LT_EM(WIFI, "Failed to get scan result"); + goto end; + } + LT_IM(WIFI, "Found %d APs", result.ApNum); + + apNum = cls->scanAlloc(result.ApNum); + if (0 == apNum) { + LT_WM(WIFI, "scan->ap alloc failed"); + goto end; + } + + if (apNum < result.ApNum) { + LT_WM(WIFI, "alloc failed, only %d APs will be copied"); + } + + for (uint8_t i = 0; i < apNum; i++) { + scan->ap[i].ssid = strdup(result.ApList[i].ssid); + scan->ap[i].auth = securityTypeToAuthMode(result.ApList[i].security); + scan->ap[i].rssi = result.ApList[i].ApPower; + scan->ap[i].channel = result.ApList[i].channel; + memcpy(scan->ap[i].bssid.addr, result.ApList[i].bssid, 6); + } + + cDATA->scannedAt = millis(); + + wifiEventSendArduino(ARDUINO_EVENT_WIFI_SCAN_DONE); + +end: + scan->timeout = 0; + if (scan->running) { + // running == false means it was discarded (timeout) + scan->running = false; + xSemaphoreGive(cDATA->scanSem); + } + if (result.ApList) { + free(result.ApList); + } + LT_HEAP_I(); + return; +} + +int16_t WiFiClass::scanNetworks(bool async, bool showHidden, bool passive, uint32_t maxMsPerChannel, uint8_t channel) { + if (scan && scan->running) { + if (scan->timeout && millis() > scan->timeout) { + LT_WM(WIFI, "Scan timeout, discarding"); + scan->running = false; + } else { + return WIFI_SCAN_RUNNING; + } + } + enableSTA(true); + scanDelete(); + scanInit(); + + LT_IM(WIFI, "Starting WiFi scan"); + + __wrap_bk_printf_disable(); + mhdr_scanu_reg_cb(scanHandler, this); + bk_wlan_start_scan(); + + LT_HEAP_I(); + + scan->running = true; + scan->timeout = millis() + maxMsPerChannel * 20 + 1000; + + int16_t ret = WIFI_SCAN_RUNNING; + if (!async) { + LT_IM(WIFI, "Waiting for results"); + xSemaphoreTake(DATA->scanSem, 1); // reset the semaphore quickly + xSemaphoreTake(DATA->scanSem, pdMS_TO_TICKS(maxMsPerChannel * 20)); + if (scan->running) { + scanDelete(); + ret = WIFI_SCAN_FAILED; + goto exit; + } + ret = scan->count; + goto exit; + } + +exit: + __wrap_bk_printf_enable(); + return ret; +} diff --git a/cores/beken-72xx/arduino/src/ArduinoFamily.h b/cores/beken-72xx/arduino/src/ArduinoFamily.h new file mode 100644 index 000000000..9e3801cda --- /dev/null +++ b/cores/beken-72xx/arduino/src/ArduinoFamily.h @@ -0,0 +1,27 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-02. */ + +#pragma once + +// Provide GPIO names to variant.cpp files +#define LT_VARIANT_INCLUDE "gpio_pub.h" + +#include + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +extern void vPortClearInterruptMask(uint32_t ulNewMaskValue); +extern uint32_t ulPortSetInterruptMask(void); + +// TODO +// #define clockCyclesPerMicrosecond() (SystemCoreClock / 1000000L) +// #define clockCyclesToMicroseconds(a) (a * 1000L / (SystemCoreClock / 1000L)) +// #define microsecondsToClockCycles(a) (a * (SystemCoreClock / 1000000L)) + +#define interrupts() vPortClearInterruptMask(0) +#define noInterrupts() ulPortSetInterruptMask() + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/cores/beken-72xx/arduino/src/lt_defs.h b/cores/beken-72xx/arduino/src/lt_defs.h new file mode 100644 index 000000000..3acbe6415 --- /dev/null +++ b/cores/beken-72xx/arduino/src/lt_defs.h @@ -0,0 +1,7 @@ +#pragma once + +#error "Don't include this file directly" + +#define LT_ARD_HAS_WIFI 1 +#define LT_ARD_HAS_SERIAL 1 +#define LT_ARD_MD5_HOSTAPD 1 diff --git a/cores/beken-72xx/arduino/src/main.cpp b/cores/beken-72xx/arduino/src/main.cpp new file mode 100644 index 000000000..baf3ff7f5 --- /dev/null +++ b/cores/beken-72xx/arduino/src/main.cpp @@ -0,0 +1,34 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-19. */ + +#include + +extern "C" { + +#include +#include + +beken_thread_t mainThread; + +#if LT_AUTO_DOWNLOAD_REBOOT && defined(PIN_SERIAL1_RX) && defined(PIN_SERIAL1_TX) +void lt_init_arduino() { + // initialize auto-download-reboot parser + Serial1.begin(115200); +} +#endif + +bool startMainTask() { + OSStatus ret = rtos_create_thread( + &mainThread, + THD_APPLICATION_PRIORITY, + "main", + (beken_thread_function_t)mainTask, + 8192, + NULL + ); + if (ret != kNoErr) + return false; + vTaskStartScheduler(); + return true; +} + +} // extern "C" diff --git a/cores/beken-72xx/arduino/src/wiring.c b/cores/beken-72xx/arduino/src/wiring.c new file mode 100644 index 000000000..cc37e37ce --- /dev/null +++ b/cores/beken-72xx/arduino/src/wiring.c @@ -0,0 +1,120 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-19. */ + +#include "wiring_private.h" + +#if LT_BK7231Q +#undef LT_MICROS_HIGH_RES +#define LT_MICROS_HIGH_RES 0 +#endif + +#define TICKS_PER_US (CFG_XTAL_FREQUENCE / 1000 / 1000) +#define US_PER_OVERFLOW (portTICK_PERIOD_MS * 1000) +#define TICKS_PER_OVERFLOW (TICKS_PER_US * US_PER_OVERFLOW) + +#if LT_MICROS_HIGH_RES +static uint32_t getTicksCount() { + // copied from bk_timer_ctrl(), for speeds + uint32_t timeout = 0; + REG_WRITE(TIMER0_2_READ_CTL, (BKTIMER0 << 2) | 1); + while (REG_READ(TIMER0_2_READ_CTL) & 1) { + timeout++; + if (timeout > (120 * 1000)) + return 0; + } + return REG_READ(TIMER0_2_READ_VALUE); +} +#endif + +void delayMicroseconds(unsigned int us) { +#if LT_MICROS_HIGH_RES + if (us == 0) + return; + us--; + uint32_t startTick = getTicksCount(); + /* startTick2 accounts for the case where the timer counter overflows */ + uint32_t startTick2 = startTick - TICKS_PER_OVERFLOW; + uint32_t delayTicks = TICKS_PER_US * us; + while (delayTicks > TICKS_PER_OVERFLOW) { + // The delay is longer than what the timer can count. + // Let it overflow until only a fraction of TICKS_PER_OVERFLOW remain. + while (getTicksCount() > startTick) {} + while (getTicksCount() < startTick) {} + delayTicks -= TICKS_PER_OVERFLOW; + } + while ((getTicksCount() - startTick < delayTicks) || // normal case + (getTicksCount() - startTick2 < delayTicks) // counter overflow case + ) {} +#else + volatile uint32_t i, j; + for (i = 0; i < us; i++) { + for (j = 0; j < 6; j++) {} + } +#endif +} + +unsigned long millis() { + return xTaskGetTickCount() * portTICK_PERIOD_MS; +} + +unsigned long micros() { +#if LT_MICROS_HIGH_RES + static uint32_t lastMillis = 0; + static uint32_t correctedMillis = 0; + static uint32_t lastTicks = 0; + uint32_t nowMillis = millis(); + uint32_t nowTicks = getTicksCount(); + bool tickOverflow = nowTicks < lastTicks; + bool millisUpdated = nowMillis != lastMillis; + if (millisUpdated) { + /* reset artificially corrected millis */ + correctedMillis = nowMillis; + } else if (tickOverflow) { + /* + This can happen if micros is called from within a interruptLock block (interrupts disabled). + In this case, if the tick counter rolls over, millis() won't be updated, and micros will + lag by US_PER_OVERFLOW milliseconds (one rollover). + The workaround only works as long as micros() calls happen within 2ms of eachother. + WARNING: if interrupts are disabled for more than 2ms, micros() and millis() will temporarily get out of sync. + */ + correctedMillis += portTICK_PERIOD_MS; + } + lastMillis = nowMillis; + lastTicks = nowTicks; + return correctedMillis * 1000 + nowTicks / (CFG_XTAL_FREQUENCE / 1000 / 1000); +#else +#if 0 + uint32_t timeout = 0; + REG_WRITE(TIMER3_5_READ_CTL, (BKTIMER3 << 2) | 1); + while (REG_READ(TIMER3_5_READ_CTL) & 1) { + timeout++; + if (timeout > (120 * 1000)) + return 0; + } + return millis() * 1000 + REG_READ(TIMER3_5_READ_VALUE) / 32; +#endif + return millis() * 1000; +#endif +} + +void pinRemoveMode(PinInfo *pin, uint32_t mask) { + PinData *data = pinData(pin); + if ((mask & PIN_GPIO) && (pin->enabled & PIN_GPIO)) { + gpio_config(pin->gpio, GMODE_INPUT_PULLDOWN); + pinDisable(pin, PIN_GPIO); + } + if ((mask & PIN_IRQ) && (pin->enabled & PIN_IRQ)) { + data->irqHandler = NULL; + gpio_int_disable(pin->gpio); + pinDisable(pin, PIN_IRQ); + } + if ((mask & PIN_PWM) && (pin->enabled & PIN_PWM)) { + if (data->pwmState != LT_PWM_STOPPED) { + data->pwmState = LT_PWM_STOPPED; + data->pwm.cfg.bits.en = PWM_DISABLE; + __wrap_bk_printf_disable(); + sddev_control(PWM_DEV_NAME, CMD_PWM_DEINIT_PARAM, &data->pwm); + __wrap_bk_printf_enable(); + } + pinDisable(pin, PIN_PWM); + } +} diff --git a/cores/beken-72xx/arduino/src/wiring_analog.c b/cores/beken-72xx/arduino/src/wiring_analog.c new file mode 100644 index 000000000..110f33bbf --- /dev/null +++ b/cores/beken-72xx/arduino/src/wiring_analog.c @@ -0,0 +1,150 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-20. */ + +#include "wiring_private.h" + +static GPIO_INDEX pwmToGpio[] = { + GPIO6, // PWM0 + GPIO7, // PWM1 + GPIO8, // PWM2 + GPIO9, // PWM3 + GPIO24, // PWM4 + GPIO26, // PWM5 +}; + +#if CFG_SOC_NAME == SOC_BK7231N +static GPIO_INDEX adcToGpio[] = { + -1, // ADC0 - VBAT + GPIONUM, // ADC1 + GPIONUM, // ADC2 + GPIO23, // ADC3 + GPIONUM, // ADC4 + GPIONUM, // ADC5 + GPIONUM, // ADC6 + GPIONUM, // ADC7 +}; +#else +static GPIO_INDEX adcToGpio[] = { + -1, // ADC0 - VBAT + GPIO4, // ADC1 + GPIO5, // ADC2 + GPIO23, // ADC3 + GPIO2, // ADC4 + GPIO3, // ADC5 + GPIO12, // ADC6 + GPIO13, // ADC7 +}; +#endif + +static uint8_t gpioToPwm(GPIO_INDEX gpio) { + for (uint8_t i = 0; i < sizeof(pwmToGpio) / sizeof(GPIO_INDEX); i++) { + if (pwmToGpio[i] == gpio) + return i; + } + return 0; +} + +static uint8_t gpioToAdc(GPIO_INDEX gpio) { + for (uint8_t i = 0; i < sizeof(adcToGpio) / sizeof(GPIO_INDEX); i++) { + if (adcToGpio[i] == gpio) + return i; + } + return 0; +} + +static uint16_t adcData[1]; + +uint16_t analogReadVoltage(pin_size_t pinNumber) { + pinCheckGetInfo(pinNumber, PIN_ADC, 0); + + UINT32 status; + saradc_desc_t adc; + DD_HANDLE handle; + saradc_config_param_init(&adc); + adc.channel = gpioToAdc(pin->gpio); + adc.mode = ADC_CONFIG_MODE_CONTINUE; + adc.pData = adcData; + adc.data_buff_size = 1; + handle = ddev_open(SARADC_DEV_NAME, &status, (uint32_t)&adc); + if (handle == -1) { + return 0; + } + + if (status != SARADC_SUCCESS) { + ddev_close(handle); + return 0; + } + + // wait for data + while (!adc.has_data || adc.current_sample_data_cnt < 1) { + delay(1); + } + uint8_t run_stop = 0; // stop + ddev_control(handle, SARADC_CMD_RUN_OR_STOP_ADC, &run_stop); + ddev_close(handle); + return adcData[0]; +} + +uint16_t analogReadMaxVoltage(pin_size_t pinNumber) { + return 3300; +} + +void analogWrite(pin_size_t pinNumber, int value) { + pinCheckGetData(pinNumber, PIN_PWM, ); + + // GPIO can't be used together with PWM + pinRemoveMode(pin, PIN_GPIO | PIN_IRQ); + + uint32_t frequency = 26 * _analogWritePeriod - 1; + + if (!pinEnabled(pin, PIN_PWM)) { + pinEnable(pin, PIN_PWM); + data->pwmState = LT_PWM_STOPPED; + data->pwm.channel = gpioToPwm(pin->gpio); + data->pwm.cfg.bits.en = PWM_ENABLE; + data->pwm.cfg.bits.int_en = PWM_INT_DIS; + data->pwm.cfg.bits.mode = PWM_PWM_MODE; + data->pwm.cfg.bits.clk = PWM_CLK_26M; + data->pwm.end_value = frequency; + data->pwm.p_Int_Handler = NULL; + } + + float percent = value * 1.0 / ((1 << _analogWriteResolution) - 1); + uint32_t dutyCycle = percent * frequency; + uint32_t channel = data->pwm.channel; +#if CFG_SOC_NAME != SOC_BK7231N + data->pwm.duty_cycle = dutyCycle; +#else + data->pwm.duty_cycle1 = dutyCycle; + data->pwm.duty_cycle2 = 0; + data->pwm.duty_cycle3 = 0; +#endif + + if ((data->pwmState == LT_PWM_STOPPED) || (data->pwmState == LT_PWM_PAUSED)) { + if (dutyCycle) { + // enable PWM and set its value + + __wrap_bk_printf_disable(); + sddev_control(PWM_DEV_NAME, CMD_PWM_INIT_PARAM, &data->pwm); + sddev_control(PWM_DEV_NAME, CMD_PWM_INIT_LEVL_SET_HIGH, &channel); + sddev_control(PWM_DEV_NAME, CMD_PWM_UNIT_ENABLE, &channel); + __wrap_bk_printf_enable(); + + data->pwmState = LT_PWM_RUNNING; + } + } else if (data->pwmState == LT_PWM_RUNNING) { + if (dutyCycle) { + __wrap_bk_printf_disable(); + sddev_control(PWM_DEV_NAME, CMD_PWM_INIT_LEVL_SET_HIGH, &channel); + sddev_control(PWM_DEV_NAME, CMD_PWM_SET_DUTY_CYCLE, &data->pwm); + __wrap_bk_printf_enable(); + } else { + __wrap_bk_printf_disable(); + sddev_control(PWM_DEV_NAME, CMD_PWM_INIT_LEVL_SET_LOW, &channel); + sddev_control(PWM_DEV_NAME, CMD_PWM_SET_DUTY_CYCLE, &data->pwm); + sddev_control(PWM_DEV_NAME, CMD_PWM_UNIT_DISABLE, &channel); + __wrap_bk_printf_enable(); + + data->pwmState = LT_PWM_PAUSED; + } + } +} diff --git a/cores/beken-72xx/arduino/src/wiring_data.h b/cores/beken-72xx/arduino/src/wiring_data.h new file mode 100644 index 000000000..461eb6220 --- /dev/null +++ b/cores/beken-72xx/arduino/src/wiring_data.h @@ -0,0 +1,26 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-05-24. */ + +#pragma once + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum lt_pwm_state_tag { LT_PWM_STOPPED, LT_PWM_RUNNING, LT_PWM_PAUSED } lt_pwm_state_t; + +struct PinData_s { + pwm_param_t pwm; + lt_pwm_state_t pwmState; + PinMode gpioMode; + PinStatus irqMode; + void *irqHandler; + void *irqParam; + bool irqChange; +}; + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/cores/beken-72xx/arduino/src/wiring_digital.c b/cores/beken-72xx/arduino/src/wiring_digital.c new file mode 100644 index 000000000..ab7dcffa0 --- /dev/null +++ b/cores/beken-72xx/arduino/src/wiring_digital.c @@ -0,0 +1,47 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-20. */ + +#include "wiring_private.h" + +void pinMode(pin_size_t pinNumber, PinMode pinMode) { + pinCheckGetData(pinNumber, PIN_GPIO, ); + + if (pinEnabled(pin, PIN_GPIO) && data->gpioMode == pinMode) + return; + + // GPIO can't be used together with PWM + pinRemoveMode(pin, PIN_PWM); + + switch (pinMode) { + case INPUT: + gpio_config(pin->gpio, GMODE_INPUT); + break; + case OUTPUT: + gpio_config(pin->gpio, GMODE_OUTPUT); + break; + case INPUT_PULLUP: + gpio_config(pin->gpio, GMODE_INPUT_PULLUP); + break; + case INPUT_PULLDOWN: + gpio_config(pin->gpio, GMODE_INPUT_PULLDOWN); + break; + case OUTPUT_OPENDRAIN: + gpio_config(pin->gpio, GMODE_SET_HIGH_IMPENDANCE); + break; + default: + return; + } + pinEnable(pin, PIN_GPIO); + data->gpioMode = pinMode; +} + +void digitalWrite(pin_size_t pinNumber, PinStatus status) { + pinCheckGetData(pinNumber, PIN_GPIO, ); + pinSetOutputPull(pin, data, pinNumber, status); + gpio_output(pin->gpio, !!status); +} + +PinStatus digitalRead(pin_size_t pinNumber) { + pinCheckGetData(pinNumber, PIN_GPIO, LOW); + pinSetInputMode(pin, data, pinNumber); + return gpio_input(pin->gpio); +} diff --git a/cores/beken-72xx/arduino/src/wiring_irq.c b/cores/beken-72xx/arduino/src/wiring_irq.c new file mode 100644 index 000000000..884bc03f2 --- /dev/null +++ b/cores/beken-72xx/arduino/src/wiring_irq.c @@ -0,0 +1,70 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-07-31. */ + +#include "wiring_private.h" + +static void irqHandler(unsigned char gpio) { + PinInfo *pin = pinByGpio(gpio); + if (pin == NULL) + return; + PinData *data = pinData(pin); + if (!data->irqHandler) + return; + if (data->irqChange) { + if (data->gpioMode == INPUT_PULLDOWN) { + data->gpioMode = INPUT_PULLUP; + gpio_int_enable(pin->gpio, GPIO_INT_LEVEL_FALLING, irqHandler); + } else if (data->gpioMode == INPUT_PULLUP) { + data->gpioMode = INPUT_PULLDOWN; + gpio_int_enable(pin->gpio, GPIO_INT_LEVEL_RISING, irqHandler); + } + } + if (!data->irqParam) + ((voidFuncPtr)data->irqHandler)(); + else + ((voidFuncPtrParam)data->irqHandler)(data->irqParam); +} + +void attachInterruptParam(pin_size_t interruptNumber, voidFuncPtrParam callback, PinStatus mode, void *param) { + pinCheckGetData(interruptNumber, PIN_IRQ, ); + + data->irqHandler = callback; + data->irqParam = param; + + if (pinEnabled(pin, PIN_IRQ) && data->irqMode == mode) + return; + + // GPIO can't be used together with PWM + pinRemoveMode(pin, PIN_PWM); + + uint32_t event = 0; + bool change = false; + switch (mode) { + case LOW: + event = GPIO_INT_LEVEL_LOW; + break; + case HIGH: + event = GPIO_INT_LEVEL_HIGH; + break; + case FALLING: + event = GPIO_INT_LEVEL_FALLING; + break; + case RISING: + event = GPIO_INT_LEVEL_RISING; + break; + case CHANGE: + event = GPIO_INT_LEVEL_FALLING; + change = true; + break; + default: + return; + } + pinEnable(pin, PIN_IRQ); + data->irqMode = mode; + data->irqChange = change; + + gpio_int_enable(pin->gpio, event, irqHandler); +} + +void detachInterrupt(pin_size_t interruptNumber) { + pinModeRemove(interruptNumber, PIN_IRQ); +} diff --git a/cores/beken-72xx/base/api/lt_cpu.c b/cores/beken-72xx/base/api/lt_cpu.c new file mode 100644 index 000000000..d767cbbbc --- /dev/null +++ b/cores/beken-72xx/base/api/lt_cpu.c @@ -0,0 +1,13 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-02-27. */ + +#include +#include + +lt_cpu_model_t lt_cpu_get_model() { + uint8_t chipId = *(uint8_t *)(SCTRL_CHIP_ID); + return CPU_MODEL_ENUM(FAMILY, chipId); +} + +const char *lt_cpu_get_core_type() { + return "ARM968E-S (ARMv5TE)"; +} diff --git a/cores/beken-72xx/base/api/lt_device.c b/cores/beken-72xx/base/api/lt_device.c new file mode 100644 index 000000000..eed4f7e37 --- /dev/null +++ b/cores/beken-72xx/base/api/lt_device.c @@ -0,0 +1,43 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-02-27. */ + +#include +#include + +void lt_get_device_mac(uint8_t *mac) { + cfg_load_mac(mac); +} + +void lt_reboot() { + bk_reboot(); +} + +bool lt_reboot_download_mode() { + bk_reboot(); + return true; +} + +lt_reboot_reason_t lt_get_reboot_reason() { + switch (bk_misc_get_start_type()) { + case RESET_SOURCE_POWERON: + return REBOOT_REASON_POWER; + case RESET_SOURCE_REBOOT: + return REBOOT_REASON_SOFTWARE; + case RESET_SOURCE_WATCHDOG: + return REBOOT_REASON_WATCHDOG; + case RESET_SOURCE_CRASH_XAT0: + case RESET_SOURCE_CRASH_UNDEFINED: + case RESET_SOURCE_CRASH_PREFETCH_ABORT: + case RESET_SOURCE_CRASH_DATA_ABORT: + case RESET_SOURCE_CRASH_UNUSED: + case RESET_SOURCE_CRASH_PER_XAT0: + return REBOOT_REASON_CRASH; + case RESET_SOURCE_DEEPPS_USB: + return REBOOT_REASON_SLEEP_USB; + case RESET_SOURCE_DEEPPS_GPIO: + return REBOOT_REASON_SLEEP_GPIO; + case RESET_SOURCE_DEEPPS_RTC: + return REBOOT_REASON_SLEEP_RTC; + default: + return REBOOT_REASON_UNKNOWN; + } +} diff --git a/cores/beken-72xx/base/api/lt_flash.c b/cores/beken-72xx/base/api/lt_flash.c new file mode 100644 index 000000000..9eaed7888 --- /dev/null +++ b/cores/beken-72xx/base/api/lt_flash.c @@ -0,0 +1,26 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-02-27. */ + +#include +#include + +// can't include as it collides with on Windows -_- +#define REG_FLASH_BASE 0x00803000 +#define REG_FLASH_OPERATE_SW (REG_FLASH_BASE + 0 * 4) +#define REG_FLASH_RDID (REG_FLASH_BASE + 4 * 4) +#define FLASH_BUSY_SW (0x01UL << 31) +#define FLASH_WP_VALUE (0x01UL << 30) +#define FLASH_OP_SW (0x01UL << 29) +#define FLASH_OP_TYPE_POS 24 +#define FLASH_OP_RDID 20 + +lt_flash_id_t lt_flash_get_id() { + uint32_t data = (FLASH_OP_RDID << FLASH_OP_TYPE_POS) | FLASH_OP_SW | FLASH_WP_VALUE; + REG_WRITE(REG_FLASH_OPERATE_SW, data); + while (REG_READ(REG_FLASH_OPERATE_SW) & FLASH_BUSY_SW) {} + lt_flash_id_t id = { + .manufacturer_id = REG_RD8(REG_FLASH_RDID, 2), + .chip_id = REG_RD8(REG_FLASH_RDID, 1), + .chip_size_id = REG_RD8(REG_FLASH_RDID, 0), + }; + return id; +} diff --git a/cores/beken-72xx/base/api/lt_init.c b/cores/beken-72xx/base/api/lt_init.c new file mode 100644 index 000000000..2064d73aa --- /dev/null +++ b/cores/beken-72xx/base/api/lt_init.c @@ -0,0 +1,14 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-02-27. */ + +#include +#include + +void lt_init_family() { + // set default UART output port + uart_print_port = LT_UART_DEFAULT_PORT - 1; + // initialize the UART (needed e.g. after deep sleep) + if (uart_print_port == 1) + uart1_init(); + else if (uart_print_port == 2) + uart2_init(); +} diff --git a/cores/beken-72xx/base/api/lt_mem.c b/cores/beken-72xx/base/api/lt_mem.c new file mode 100644 index 000000000..f6038fede --- /dev/null +++ b/cores/beken-72xx/base/api/lt_mem.c @@ -0,0 +1,21 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-02-27. */ + +#include +#include + +uint32_t lt_ram_get_size() { + return 256 * 1024; +} + +uint32_t lt_heap_get_size() { +#if configDYNAMIC_HEAP_SIZE + extern unsigned char _empty_ram; +#if CFG_SOC_NAME == SOC_BK7231N + return (0x00400000 + 192 * 1024) - (uint32_t)(&_empty_ram); +#else + return (0x00400000 + 256 * 1024) - (uint32_t)(&_empty_ram); +#endif +#else + return configTOTAL_HEAP_SIZE; +#endif +} diff --git a/cores/beken-72xx/base/api/lt_ota.c b/cores/beken-72xx/base/api/lt_ota.c new file mode 100644 index 000000000..2961e76f4 --- /dev/null +++ b/cores/beken-72xx/base/api/lt_ota.c @@ -0,0 +1,39 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-02-27. */ + +#include +#include + +lt_ota_type_t lt_ota_get_type() { + return OTA_TYPE_SINGLE; +} + +bool lt_ota_is_valid(uint8_t index) { + if (index != 0) + return false; + // check download RBL + // TODO: maybe check header CRC or even binary hashes + uint32_t magic; + lt_flash_read(FLASH_DOWNLOAD_OFFSET, (uint8_t *)&magic, 4); + return magic == 0x004C4252; // "RBL\0", little-endian +} + +uint8_t lt_ota_dual_get_current() { + return 0; +} + +uint8_t lt_ota_dual_get_stored() { + return 0; +} + +bool lt_ota_switch(bool revert) { + if (!lt_ota_is_valid(0)) + // no valid "download" image + // - return false when trying to activate + // - return true when trying to revert + return revert; + if (revert) { + // there's a valid "download" image, which has to be removed + return lt_flash_erase_block(FLASH_DOWNLOAD_OFFSET); + } + return true; +} diff --git a/cores/beken-72xx/base/api/lt_sleep.c b/cores/beken-72xx/base/api/lt_sleep.c new file mode 100644 index 000000000..e643ded07 --- /dev/null +++ b/cores/beken-72xx/base/api/lt_sleep.c @@ -0,0 +1,39 @@ +/* Copyright (c) Peter Sarkozi 2023-06-17. */ + +#include +#include + +static PS_DEEP_CTRL_PARAM deep_sleep_param; + +void lt_deep_sleep_config_gpio(uint32_t gpio_index_map, bool on_high) { + deep_sleep_param.wake_up_way |= PS_DEEP_WAKEUP_GPIO; + deep_sleep_param.gpio_index_map |= gpio_index_map; + if (on_high) { + deep_sleep_param.gpio_edge_map |= gpio_index_map; + } else { + deep_sleep_param.gpio_edge_map &= (~gpio_index_map); + } +} + +void lt_deep_sleep_unset_gpio(uint32_t gpio_index_map) { + deep_sleep_param.gpio_index_map &= (~gpio_index_map); +} + +void lt_deep_sleep_config_timer(uint32_t sleep_duration_ms) { + deep_sleep_param.wake_up_way |= PS_DEEP_WAKEUP_RTC; + uint64_t sleep_ticks = 32.768 * sleep_duration_ms; + if (sleep_ticks >= 0xFFFFFFFF) { + deep_sleep_param.sleep_time = 0xFFFFFFFE; + } else { + deep_sleep_param.sleep_time = sleep_ticks & 0xFFFFFFFF; + } +} + +void lt_deep_sleep_enter() { + bk_misc_update_set_type(RESET_SOURCE_DEEPPS_GPIO); + GLOBAL_INT_DECLARATION(); + GLOBAL_INT_DISABLE(); + sctrl_enter_rtos_deep_sleep((PS_DEEP_CTRL_PARAM *)&deep_sleep_param); + ps_delay(500); + GLOBAL_INT_RESTORE(); +} diff --git a/cores/beken-72xx/base/api/lt_wdt.c b/cores/beken-72xx/base/api/lt_wdt.c new file mode 100644 index 000000000..b0648d087 --- /dev/null +++ b/cores/beken-72xx/base/api/lt_wdt.c @@ -0,0 +1,18 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-02-27. */ + +#include +#include + +bool lt_wdt_enable(uint32_t timeout) { + wdt_ctrl(WCMD_SET_PERIOD, &timeout); + wdt_ctrl(WCMD_POWER_UP, NULL); + return true; +} + +void lt_wdt_disable() { + wdt_ctrl(WCMD_POWER_DOWN, NULL); +} + +void lt_wdt_feed() { + wdt_ctrl(WCMD_RELOAD_PERIOD, NULL); +} diff --git a/cores/beken-72xx/base/config/lwipopts.h b/cores/beken-72xx/base/config/lwipopts.h new file mode 100644 index 000000000..07408f1fa --- /dev/null +++ b/cores/beken-72xx/base/config/lwipopts.h @@ -0,0 +1,18 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-27. */ + +#pragma once + +#include_next "lwipopts.h" + +// mDNS support +#undef MEMP_NUM_UDP_PCB +#define LWIP_NUM_NETIF_CLIENT_DATA 2 +#define LWIP_NETIF_EXT_STATUS_CALLBACK 1 +#define MEMP_NUM_UDP_PCB (MAX_SOCKETS_UDP + 2 + 1) + +#define ip_addr ip4_addr +#define ip_addr_t ip4_addr_t + +// increase TCP/IP thread stack size (was 512) +#undef TCPIP_THREAD_STACKSIZE +#define TCPIP_THREAD_STACKSIZE 1024 diff --git a/cores/beken-72xx/base/fixups/arch_main.c b/cores/beken-72xx/base/fixups/arch_main.c new file mode 100644 index 000000000..0e226889f --- /dev/null +++ b/cores/beken-72xx/base/fixups/arch_main.c @@ -0,0 +1,61 @@ +/** + **************************************************************************************** + * + * @file arch_main.c + * + * @brief Main loop of the application. + * + * Copyright (C) Beken Corp 2011-2020 + * + **************************************************************************************** + */ +#include "BkDriverFlash.h" +#include "BkDriverWdg.h" +#include "driver_pub.h" +#include "func_pub.h" +#include "include.h" +#include "intc.h" +#include "param_config.h" +#include "start_type_pub.h" + +#if CFG_SUPPORT_BOOTLOADER +void entry_set_world_flag(void) { + *(volatile uint32_t *)0x00400000 = 1; +} +#endif // CFG_SUPPORT_BOOTLOADER + +extern void lt_main(void); + +// declare as weak to override with Arduino framework +__attribute__((weak)) void __wrap_bk_printf_disable(); +__attribute__((weak)) void __wrap_bk_printf_enable(); + +unsigned char __bk_rf_is_init = 0; + +void entry_main(void) { + // compatibility with BK7231S_1.0.5 +#if CFG_SUPPORT_BOOTLOADER + entry_set_world_flag(); +#endif + // suppress all output during initialization + __wrap_bk_printf_disable(); + // read reboot cause into bk_misc_get_start_type() + bk_misc_init_start_type(); + // register all sctrl drivers (driver/common/dd.c dd_init_tbl[]) + driver_init(); + // reboot the board if start_type == RESET_SOURCE_CRASH_PER_XAT0 + bk_misc_check_start_type(); + // init drivers + intc_init(); + hal_flash_init(); + cfg_param_init(); + // enable watchdog +#if CFG_INT_WDG_ENABLED + bk_wdg_initialize(CFG_INT_WDG_PERIOD_MS); + bk_wdg_reload(); +#endif + // enable bk_printf output again + __wrap_bk_printf_enable(); + // run the app + lt_main(); +} diff --git a/cores/beken-72xx/base/fixups/ate_app.c b/cores/beken-72xx/base/fixups/ate_app.c new file mode 100644 index 000000000..2dad5e973 --- /dev/null +++ b/cores/beken-72xx/base/fixups/ate_app.c @@ -0,0 +1,7 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-14. */ + +#include "include.h" + +uint32_t get_ate_mode_state(void) { + return 0; +} diff --git a/cores/beken-72xx/base/fixups/boot_handlers_bk7231u.S b/cores/beken-72xx/base/fixups/boot_handlers_bk7231u.S new file mode 100644 index 000000000..e607951e6 --- /dev/null +++ b/cores/beken-72xx/base/fixups/boot_handlers_bk7231u.S @@ -0,0 +1,499 @@ +/** + **************************************************************************************** + * + * @file boot_handlers.s + * + * @brief ARM Exception Vector handler functions. + * + * Copyright (C) RivieraWaves 2011-2016 + * + **************************************************************************************** + */ + .globl entry_main + .globl intc_irq + .globl intc_fiq + .globl boot_reset + .globl boot_swi + .globl boot_undefined + .globl boot_pabort + .globl boot_dabort + .globl boot_reserved + .globl irq_handler + .globl fiq_handler + .globl vPortStartFirstTask + .globl do_irq + .globl do_fiq + .globl do_swi + .globl do_undefined + .globl do_pabort + .globl do_dabort + .globl do_reserved + .globl bk_trap_udef + .globl bk_trap_pabt + .globl bk_trap_dabt + .globl bk_trap_resv + +#include "sys_config.h" + +/* ======================================================================== + * Macros + * ======================================================================== */ +#define _FIQ_STACK_SIZE_ 0x7F0 +#define _IRQ_STACK_SIZE_ 0xFF0 +#define _SVC_STACK_SIZE_ 0x3F0 +#define _SYS_STACK_SIZE_ 0x3F0 +#define _UND_STACK_SIZE_ 0x010 +#define _ABT_STACK_SIZE_ 0x010 + +#define BOOT_MODE_MASK 0x1F +#define BOOT_MODE_USR 0x10 +#define BOOT_MODE_FIQ 0x11 +#define BOOT_MODE_IRQ 0x12 +#define BOOT_MODE_SVC 0x13 +#define BOOT_MODE_ABT 0x17 +#define BOOT_MODE_UND 0x1B +#define BOOT_MODE_SYS 0x1F +#define BOOT_FIQ_IRQ_MASK 0xC0 +#define BOOT_IRQ_MASK 0x80 + +#define BOOT_COLOR_UNUSED 0xAAAAAAAA //Pattern to fill UNUSED stack +#define BOOT_COLOR_SVC 0xBBBBBBBB //Pattern to fill SVC stack +#define BOOT_COLOR_IRQ 0xCCCCCCCC //Pattern to fill IRQ stack +#define BOOT_COLOR_FIQ 0xDDDDDDDD //Pattern to fill FIQ stack +#define BOOT_COLOR_SYS 0xEEEEEEEE //Pattern to fill SYS stack + +/* ======================================================================== + Context save and restore macro definitions + * ======================================================================== */ + +/* ========================================================================*/ +.macro portSAVE_CONTEXT + //Push R0 as we are going to use the register. + STMDB SP!, {R0} + + MRS R0, spsr + AND R0, R0, #0x1F + CMP R0, #0x1F + BNE 10f + + //Set R0 to point to the task stack pointer. + STMDB SP, {SP}^ + NOP + SUB SP, SP, #4 + LDMIA SP!, {R0} + + //Push the return address onto the stack. + STMDB R0!, {LR} + + //Now we have saved LR we can use it instead of R0. + MOV LR, R0 + + //Pop R0 so we can save it onto the system mode stack. + LDMIA SP!, {R0} + + //Push all the system mode registers onto the task stack. + STMDB LR, {R0-R14}^ + NOP + NOP + SUB LR, LR, #60 + + //Push the SPSR onto the task stack. + MRS R0, SPSR + STMDB LR!, {R0} + + LDR R0, =ulCriticalNesting + LDR R0, [R0] + STMDB LR!, {R0} + + //Store the new top of stack for the task. + LDR R0, =pxCurrentTCB + LDR R0, [R0] + STR LR, [R0] + + B 11f + +10: + LDMIA SP!, {R0} + + STMDB r13!, {r0-r12,r14} + NOP + NOP + + LDR R0, =ulCriticalNesting + LDR R0, [R0] + STMDB r13!, {R0} + + LDR R0, =pxCurrentTCB + LDR R0, [R0] + STMDB r13!, {R0} + + SUB r13, r13, #8 + +11: + MOV R0, R0 + .endm + +/* ========================================================================*/ +.macro portRESTORE_CONTEXT + MRS R0, spsr + AND R0, R0, #0x1F + CMP R0, #0x1F + BNE 20f + + //Set the LR to the task stack. + LDR R0, =pxCurrentTCB + LDR R0, [R0] + LDR LR, [R0] + + //The critical nesting depth is the first item on the stack. + //Load it into the ulCriticalNesting variable. + LDR R0, =ulCriticalNesting + LDMFD LR!, {R1} + STR R1, [R0] + + //Get the SPSR from the stack. + LDMFD LR!, {R0} + MSR SPSR_cxsf, R0 + + //Restore all system mode registers for the task. + LDMFD LR, {R0-R14}^ + NOP + NOP + + //Restore the return address. + LDR LR, [LR, #+60] + + //And return - correcting the offset in the LR to obtain the + //correct address. + SUBS PC, LR, #4 + +20: + ADD r13, r13, #0x8 + + LDR R0, =pxCurrentTCB + LDMFD r13!, {R1} + STR R1, [R0] + + LDR R0, =ulCriticalNesting + LDMFD r13!, {R1} + STR R1, [R0] + + LDMIA r13!, {r0-r12,r14} + NOP + NOP + + SUBS pc, r14, #0x4 + .endm + +/* ========================================================================*/ +.macro firstRESTORE_CONTEXT + //Set the LR to the task stack. + LDR R0, =pxCurrentTCB + LDR R0, [R0] + LDR LR, [R0] + + //The critical nesting depth is the first item on the stack. + //Load it into the ulCriticalNesting variable. + LDR R0, =ulCriticalNesting + LDMFD LR!, {R1} + STR R1, [R0] + + //Get the SPSR from the stack. + LDMFD LR!, {R0} + MSR SPSR_cxsf, R0 + + //Restore all system mode registers for the task. + LDMFD LR, {R0-R14}^ + NOP + NOP + + //Restore the return address. + LDR LR, [LR, #+60] + + //And return - correcting the offset in the LR to obtain the + //correct address. + SUBS PC, LR, #4 + .endm + +/* ======================================================================== + * Macro for switching ARM mode + */ +.macro BOOT_CHANGE_MODE, mode, mode_mask + MRS R0, CPSR + BIC R0, R0, #\mode_mask + ORR R0, R0, #\mode + MSR CPSR_c, R0 + .endm + +/* ======================================================================== + * Macro for setting the stack + */ +.macro BOOT_SET_STACK, stackStart, stackLen, color + LDR R0, \stackStart + LDR R1, \stackLen + + ADD R1, R1, R0 + MOV SP, R1 //Set stack pointer + + LDR R2, =\color + +3: + CMP R0, R1 //End of stack? + STRLT R2, [r0] //Colorize stack word + ADDLT R0, R0, #4 + BLT 3b //branch to previous local label + .endm + + .section .data + .align 3 + .global und_stack_start + und_stack_start: + .space _UND_STACK_SIZE_ + + .align 3 + .global abt_stack_start +abt_stack_start: + .space _ABT_STACK_SIZE_ + + .align 3 + .global fiq_stack_start +fiq_stack_start: + .space _FIQ_STACK_SIZE_ + + .align 3 + .global irq_stack_start + irq_stack_start: + .space _IRQ_STACK_SIZE_ + + .align 3 + .global sys_stack_start +sys_stack_start: + .space _SYS_STACK_SIZE_ + + .align 3 + .global svc_stack_start +svc_stack_start: + .space _SVC_STACK_SIZE_ + + +/* ======================================================================== + * Functions + * ======================================================================== + * Function to handle reset vector + */ + .globl boot_reset + .section ".boot", "ax" + +boot_reset: + //Disable IRQ and FIQ before starting anything + MRS R0, CPSR + ORR R0, R0, #0xC0 + MSR CPSR_c, R0 + + //Setup all stacks //Note: Abt and Usr mode are not used + BOOT_CHANGE_MODE BOOT_MODE_SYS BOOT_MODE_MASK + BOOT_SET_STACK boot_stack_base_SYS boot_stack_len_SYS BOOT_COLOR_SYS + + BOOT_CHANGE_MODE BOOT_MODE_ABT BOOT_MODE_MASK + BOOT_SET_STACK boot_stack_base_UNUSED boot_stack_len_UNUSED BOOT_COLOR_UNUSED + + BOOT_CHANGE_MODE BOOT_MODE_UND BOOT_MODE_MASK + BOOT_SET_STACK boot_stack_base_UNUSED boot_stack_len_UNUSED BOOT_COLOR_UNUSED + + BOOT_CHANGE_MODE BOOT_MODE_IRQ BOOT_MODE_MASK + BOOT_SET_STACK boot_stack_base_IRQ boot_stack_len_IRQ BOOT_COLOR_IRQ + + BOOT_CHANGE_MODE BOOT_MODE_FIQ BOOT_MODE_MASK + BOOT_SET_STACK boot_stack_base_FIQ boot_stack_len_FIQ BOOT_COLOR_FIQ + + //Clear FIQ banked registers while in FIQ mode + MOV R8, #0 + MOV R9, #0 + MOV R10, #0 + MOV R11, #0 + MOV R12, #0 + + BOOT_CHANGE_MODE BOOT_MODE_SVC BOOT_MODE_MASK + BOOT_SET_STACK boot_stack_base_SVC boot_stack_len_SVC BOOT_COLOR_SVC + + /*Stay in Supervisor Mode + copy data from binary to ram*/ + BL _sysboot_copy_data_to_ram + + /*Init the BSS section*/ + BL _sysboot_zi_init + + //================== + //Clear Registers + MOV R0, #0 + MOV R1, #0 + MOV R2, #0 + MOV R3, #0 + MOV R4, #0 + MOV R5, #0 + MOV R6, #0 + MOV R7, #0 + MOV R8, #0 + MOV R9, #0 + MOV R10, #0 + MOV R11, #0 + MOV R12, #0 + + /* start main entry*/ + B entry_main + B . + +/* ======================================================================== + * Globals + * ======================================================================== */ +boot_stack_base_UNUSED: + .word und_stack_start + +boot_stack_len_UNUSED: + .word _UND_STACK_SIZE_ + +boot_stack_base_IRQ: + .word irq_stack_start + +boot_stack_len_IRQ: + .word _IRQ_STACK_SIZE_ + +boot_stack_base_SVC: + .word svc_stack_start + +boot_stack_len_SVC: + .word _SVC_STACK_SIZE_ + +boot_stack_base_FIQ: + .word fiq_stack_start + +boot_stack_len_FIQ: + .word _FIQ_STACK_SIZE_ + +boot_stack_base_SYS: + .word sys_stack_start + +boot_stack_len_SYS: + .word _SYS_STACK_SIZE_ + +/*FUNCTION: _sysboot_copy_data_to_ram*/ +/*DESCRIPTION: copy main stack code from FLASH/ROM to SRAM*/ +_sysboot_copy_data_to_ram: + LDR R0, =_data_flash_begin + LDR R1, =_data_ram_begin + LDR R2, =_data_ram_end + +4: CMP R1, R2 + LDRLO R4, [R0], #4 + STRLO R4, [R1], #4 + BLO 4b + BX LR + +/*FUNCTION: _sysboot_zi_init*/ +/*DESCRIPTION: Initialise Zero-Init Data Segment*/ +_sysboot_zi_init: + LDR R0, =_bss_start + LDR R1, =_bss_end + + MOV R3, R1 + MOV R4, R0 + MOV R2, #0 +5: CMP R4, R3 + STRLO R2, [R4], #4 + BLO 5b + BX LR + +#if (CFG_SOC_NAME == SOC_BK7231N) +/*FUNCTION: _sysboot_copy_code_to_itcm*/ +/*DESCRIPTION: copy itcm code from FLASH/ROM to SRAM*/ +_sysboot_copy_code_to_itcm: + LDR R0, =_itcmcode_flash_begin + LDR R1, =_itcmcode_ram_begin + LDR R2, =_itcmcode_ram_end + +6: CMP R1, R2 + LDRLO R4, [R0], #4 + STRLO R4, [R1], #4 + BLO 6b + BX LR + +/*FUNCTION: _sysboot_sdbss_init*/ +/*DESCRIPTION: Initialise Zero-Init Data Segment of TCM */ +_sysboot_tcmbss_init: + LDR R0, =_tcmbss_start + LDR R1, =_tcmbss_end + + MOV R3, R1 + MOV R4, R0 + MOV R2, #0 +8: CMP R4, R3 + STRLO R2, [R4], #4 + BLO 8b + BX LR +#endif + + .align 5 +boot_undefined: + B boot_undefined + + .align 5 +boot_swi: + B vPortYieldProcessor + + .align 5 +boot_pabort: + B boot_pabort + + .align 5 +boot_dabort: + B boot_dabort + + .align 5 +boot_reserved: + B boot_reserved + + .align 5 +irq_handler: + portSAVE_CONTEXT + LDR R0, =intc_irq + MOV LR, PC + BX R0 + portRESTORE_CONTEXT + + .align 5 +fiq_handler: + portSAVE_CONTEXT + LDR R0, =intc_fiq + MOV LR, PC + BX R0 + portRESTORE_CONTEXT + +/*Starting the first task is just a matter of restoring the context that*/ +/*was created by pxPortInitialiseStack().*/ +vPortStartFirstTask: + firstRESTORE_CONTEXT + +/*Manual context switch function. This is the SWI hander.*/ +vPortYieldProcessor: +#if (0 == CFG_SUPPORT_BOOTLOADER) + ADD LR, LR, #4 //Add 4 to the LR to make the LR appear exactly + //as if the context was saved during and IRQ + //handler. +#endif // CFG_SUPPORT_BOOTLOADER + + portSAVE_CONTEXT //Save the context of the current task... + + LDR R0, =vTaskSwitchContext + MOV LR, PC + BX R0 + + portRESTORE_CONTEXT //Restore the context of the selected task. + + .code 32 + .global WFI + .type WFI,%function +WFI: + MOV R0, #0 + MCR p15, 0, R0, c7, c0, 4 + BX LR +/*EOF*/ diff --git a/cores/beken-72xx/base/fixups/clock_cal.c b/cores/beken-72xx/base/fixups/clock_cal.c new file mode 100644 index 000000000..f68059dcd --- /dev/null +++ b/cores/beken-72xx/base/fixups/clock_cal.c @@ -0,0 +1,127 @@ +#include "include.h" + +#include "bk_timer_pub.h" +#include "drv_model_pub.h" +#include "fake_clock_pub.h" +#include "mcu_ps_pub.h" +#include "power_save_pub.h" +#include "pwm_pub.h" +#include "sys_rtos.h" + +static CAL_TICK_T cal_tick_save; +UINT32 use_cal_net = 0; + +UINT32 fclk_cal_endvalue(UINT32 mode) { + UINT32 value = 1; + + if (PWM_CLK_32K == mode) { + /* 32 kHz clock */ + value = FCLK_DURATION_MS * 32; + } else if (PWM_CLK_26M == mode) { + /* 26 MHz clock */ + value = FCLK_DURATION_MS * 26000; + } + + return value; +} + +#if CFG_USE_TICK_CAL +static UINT32 timer_cal_init(void) { + UINT32 fclk; + + fclk = BK_TICKS_TO_MS(fclk_get_tick()); + + cal_tick_save.fclk_tick = fclk; + cal_tick_save.tmp1 = 0; + return 0; +} + +extern int increase_tick; + +static UINT32 timer_cal_tick(void) { + UINT32 fclk, tmp2; + UINT32 machw = 0; + INT32 lost; + GLOBAL_INT_DECLARATION(); + + GLOBAL_INT_DISABLE(); + + fclk = BK_TICKS_TO_MS(fclk_get_tick()); + cal_tick_save.tmp1 += ONE_CAL_TIME; + + tmp2 = fclk; + + lost = (INT32)(cal_tick_save.tmp1 - (UINT32)tmp2); + + if ((lost >= (2 * FCLK_DURATION_MS))) { + lost -= FCLK_DURATION_MS; + fclk_update_tick(BK_MS_TO_TICKS(lost)); + increase_tick = 0; + } else { + if (lost <= (-(2 * FCLK_DURATION_MS))) { + if (lost < (-50000)) { + os_printf("m reset:%x %x\r\n", lost, machw); + } + increase_tick = lost + FCLK_DURATION_MS; + } + } + + mcu_ps_machw_init(); + GLOBAL_INT_RESTORE(); + return 0; +} + +static void cal_timer_hdl(UINT8 param) { + timer_cal_tick(); +} + +static void cal_timer_set(void) { + timer_param_t param; + UINT32 ret; + UINT32 timer_channel; + + timer_cal_init(); + + param.channel = CAL_TIMER_ID; + param.div = 1; + param.period = ONE_CAL_TIME; + param.t_Int_Handler = cal_timer_hdl; + + ret = sddev_control(TIMER_DEV_NAME, CMD_TIMER_INIT_PARAM, ¶m); + ASSERT(BK_TIMER_SUCCESS == ret); + timer_channel = param.channel; + ret = sddev_control(TIMER_DEV_NAME, CMD_TIMER_UNIT_ENABLE, &timer_channel); + ASSERT(BK_TIMER_SUCCESS == ret); +} + +static void cal_timer_deset(void) { + UINT32 ret; + UINT32 timer_channel; + + timer_channel = CAL_TIMER_ID; + ret = sddev_control(TIMER_DEV_NAME, CMD_TIMER_UNIT_DISABLE, &timer_channel); + ASSERT(BK_TIMER_SUCCESS == ret); + timer_cal_init(); +} + +UINT32 bk_cal_init(UINT32 setting) { + GLOBAL_INT_DECLARATION(); + GLOBAL_INT_DISABLE(); + + if (1 == setting) { + cal_timer_deset(); + use_cal_net = 1; + mcu_ps_machw_init(); + os_printf("decset:%d %d %d %d\r\n", use_cal_net, fclk_get_tick(), fclk_get_second(), xTaskGetTickCount()); + } else { + mcu_ps_machw_cal(); + cal_timer_set(); + use_cal_net = 0; + mcu_ps_machw_reset(); + os_printf("cset:%d %d %d %d\r\n", use_cal_net, fclk_get_tick(), fclk_get_second(), xTaskGetTickCount()); + } + GLOBAL_INT_RESTORE(); + + return 0; +} +#endif diff --git a/cores/beken-72xx/base/fixups/clock_rtos.c b/cores/beken-72xx/base/fixups/clock_rtos.c new file mode 100644 index 000000000..107cf4633 --- /dev/null +++ b/cores/beken-72xx/base/fixups/clock_rtos.c @@ -0,0 +1,125 @@ +#include "include.h" + +#include "bk_timer_pub.h" +#include "drv_model_pub.h" +#include "fake_clock_pub.h" +#include "icu_pub.h" +#include "mcu_ps_pub.h" +#include "power_save_pub.h" +#include "pwm_pub.h" +#include "rtos_pub.h" +#include "sys_rtos.h" +#include "uart_pub.h" + +// from lt_config.h +#if !defined(LT_MICROS_HIGH_RES) && !LT_BK7231Q +#define LT_MICROS_HIGH_RES 1 +#endif + +// main FreeRTOS timer ID +static BK_HW_TIMER_INDEX fclk_id = BK_PWM_TIMER_ID0; + +extern UINT32 bk_cal_init(UINT32 setting); +extern void mcu_ps_increase_clr(void); +extern uint32_t preempt_delayed_schedule_get_flag(void); +extern void preempt_delayed_schedule_clear_flag(void); + +// forward definitions +static void fclk_timer_hw_init(BK_HW_TIMER_INDEX timer_id); +static void fclk_hdl(UINT8 param); + +void fclk_init(void) { +#if (CFG_SOC_NAME == SOC_BK7231) + fclk_timer_hw_init(BK_PWM_TIMER_ID3); +#elif LT_MICROS_HIGH_RES + fclk_timer_hw_init(BK_TIMER_ID0); +#else + fclk_timer_hw_init(BK_TIMER_ID3); +#endif + +#if CFG_USE_TICK_CAL + bk_cal_init(0); +#endif +} + +/* timer_id: BK_PWM_TIMER_ID0 or BK_TIMER_ID3 */ +static void fclk_timer_hw_init(BK_HW_TIMER_INDEX timer_id) { +#if (CFG_SOC_NAME == SOC_BK7231) + ASSERT(timer_id >= BK_PWM_TIMER_ID0); +#endif + + fclk_id = timer_id; + if (fclk_id >= BK_PWM_TIMER_ID0) { // pwm timer + pwm_param_t param; + param.channel = (fclk_id - BK_PWM_TIMER_ID0); + param.cfg.bits.en = PWM_ENABLE; + param.cfg.bits.int_en = PWM_INT_EN; + param.cfg.bits.mode = PWM_TIMER_MODE; + param.cfg.bits.clk = PWM_CLK_26M; + param.p_Int_Handler = fclk_hdl; +#if (CFG_SOC_NAME == SOC_BK7231N) + param.duty_cycle1 = 0; +#else + param.duty_cycle = 0; +#endif + param.end_value = fclk_cal_endvalue((UINT32)param.cfg.bits.clk); + + sddev_control(PWM_DEV_NAME, CMD_PWM_INIT_PARAM, ¶m); + } else { // timer + timer_param_t param; + param.channel = fclk_id; + param.div = 1; +#if LT_MICROS_HIGH_RES + param.period = FCLK_DURATION_MS * 1000; +#else + param.period = FCLK_DURATION_MS; +#endif + param.t_Int_Handler = fclk_hdl; + +#if LT_MICROS_HIGH_RES + UINT32 ret = sddev_control(TIMER_DEV_NAME, CMD_TIMER_INIT_PARAM_US, ¶m); +#else + UINT32 ret = sddev_control(TIMER_DEV_NAME, CMD_TIMER_INIT_PARAM, ¶m); +#endif + ASSERT(BK_TIMER_SUCCESS == ret); + sddev_control(TIMER_DEV_NAME, CMD_TIMER_UNIT_ENABLE, ¶m.channel); + } +} + +static void fclk_hdl(UINT8 param) { +#if CFG_USE_TICK_CAL + if (!mcu_ps_need_pstick()) + return; +#endif + GLOBAL_INT_DECLARATION(); + GLOBAL_INT_DISABLE(); + if (xTaskIncrementTick() != pdFALSE || preempt_delayed_schedule_get_flag()) { + preempt_delayed_schedule_clear_flag(); + /* Select a new task to run. */ + vTaskSwitchContext(); + } + GLOBAL_INT_RESTORE(); +} + +UINT32 fclk_update_tick(UINT32 tick) { + GLOBAL_INT_DECLARATION(); + if (tick == 0) + return 0; + GLOBAL_INT_DISABLE(); + mcu_ps_increase_clr(); + vTaskStepTick(tick); + GLOBAL_INT_RESTORE(); + return 0; +} + +UINT64 fclk_get_tick(void) { + return xTaskGetTickCount(); +} + +UINT32 fclk_get_second(void) { + return xTaskGetTickCount() / FCLK_SECOND; +} + +BK_HW_TIMER_INDEX fclk_get_tick_id(void) { + return fclk_id; +} diff --git a/cores/beken-72xx/base/fixups/gcc10.c b/cores/beken-72xx/base/fixups/gcc10.c new file mode 100644 index 000000000..2b97eac64 --- /dev/null +++ b/cores/beken-72xx/base/fixups/gcc10.c @@ -0,0 +1,7 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-13. */ + +// Compiling with GCC 10.3.1 requires this or it will produce linker errors. +// See: +// - https://github.com/purduesigbots/pros/issues/153#issuecomment-519335375 +// - https://stackoverflow.com/a/64664385 +void __sync_synchronize(void) {} diff --git a/cores/beken-72xx/base/fixups/generic.h b/cores/beken-72xx/base/fixups/generic.h new file mode 100644 index 000000000..f729b1301 --- /dev/null +++ b/cores/beken-72xx/base/fixups/generic.h @@ -0,0 +1,17 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-01. */ + +#include_next "generic.h" + +#pragma once + +// allow lwIP to define these (Beken, why) +#undef htons +#undef ntohs +#undef htonl +#undef ntohl + +// fix conflicts with std::max() and std::min() +#ifdef __cplusplus +#undef max +#undef min +#endif diff --git a/cores/beken-72xx/base/fixups/include.h b/cores/beken-72xx/base/fixups/include.h new file mode 100644 index 000000000..85fa1aa88 --- /dev/null +++ b/cores/beken-72xx/base/fixups/include.h @@ -0,0 +1,12 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-14. */ + +#include_next "include.h" + +#pragma once + +// force including fixups/generic.h, even by BDK/include.h +#include "generic.h" + +#if CFG_SOC_NAME == SOC_BK7231 +#include "bk7231q.h" +#endif diff --git a/cores/beken-72xx/base/fixups/intc.c b/cores/beken-72xx/base/fixups/intc.c new file mode 100644 index 000000000..27dfab305 --- /dev/null +++ b/cores/beken-72xx/base/fixups/intc.c @@ -0,0 +1,420 @@ +/** + **************************************************************************************** + * + * @file intc.c + * + * @brief Definition of the Interrupt Controller (INTCTRL) API. + * + * Copyright (C) RivieraWaves 2011-2016 + * + **************************************************************************************** + */ + +/* + * INCLUDE FILES + **************************************************************************************** + */ +#include "compiler.h" +#include "intc.h" +#include "intc_pub.h" + +#include "include.h" +#include "arm_arch.h" +#include "drv_model_pub.h" +#include "icu_pub.h" +#include "mem_pub.h" +#include "uart_pub.h" +#include "power_save_pub.h" +#include "start_type_pub.h" + +ISR_T _isrs[INTC_MAX_COUNT] = {{{0, 0}},}; +static UINT32 isrs_mask = 0; +static ISR_LIST_T isr_hdr = {{&isr_hdr.isr, &isr_hdr.isr},}; + +void intc_hdl_entry(UINT32 int_status) +{ + UINT32 i; + ISR_T *f; + UINT32 status; + LIST_HEADER_T *n; + LIST_HEADER_T *pos; + + status = int_status & isrs_mask; + INTC_PRT("intc:%x:%x\r\n", int_status, status); + + #if CFG_USE_STA_PS + power_save_dtim_wake(status); + #endif + + list_for_each_safe(pos, n, &isr_hdr.isr) + { + f = list_entry(pos, ISR_T, list); + i = f->int_num; + + if ((BIT(i) & status)) + { + f->isr_func(); + status &= ~(BIT(i)); + } + + if(0 == status) + { + return; + } + } +} + +void intc_service_register(UINT8 int_num, UINT8 int_pri, FUNCPTR isr) +{ + LIST_HEADER_T *pos, *n; + ISR_T *tmp_ptr, *cur_ptr; + ISR_T buf_ele; + + GLOBAL_INT_DECLARATION(); + + buf_ele = _isrs[int_num]; + cur_ptr = &_isrs[int_num]; + cur_ptr->isr_func = isr; + cur_ptr->int_num = int_num; + cur_ptr->pri = int_pri; + + INTC_PRT("reg_isr:%d:%d:%p\r\n", int_num, int_pri, isr); + + GLOBAL_INT_DISABLE(); + if (list_empty(&isr_hdr.isr)) + { + list_add_head(&cur_ptr->list, &isr_hdr.isr); + goto ok; + } + + /* Insert the ISR to the function list, this list is sorted by priority number */ + list_for_each_safe(pos, n, &isr_hdr.isr) + { + tmp_ptr = list_entry(pos, ISR_T, list); + + if (int_pri < tmp_ptr->pri) + { + /* add entry at the head of the queue */ + list_add_tail(&cur_ptr->list, &tmp_ptr->list); + + INTC_PRT("reg_isr_o1\r\n"); + + goto ok; + } + else if (int_pri == tmp_ptr->pri) + { + INTC_PRT("reg_isr_error\r\n"); + goto error; + } + } + + list_add_tail(&cur_ptr->list, &isr_hdr.isr); + INTC_PRT("reg_isr_o2\r\n"); + +ok: + isrs_mask |= BIT(int_num); + GLOBAL_INT_RESTORE(); + + return; + +error: + /* something wrong */ + _isrs[int_num] = buf_ele; + GLOBAL_INT_RESTORE(); + + return; +} + +void intc_service_change_handler(UINT8 int_num, FUNCPTR isr) +{ + LIST_HEADER_T *pos, *n; + ISR_T *tmp_ptr, *cur_ptr; + ISR_T buf_ele; + UINT8 int_pri; + + GLOBAL_INT_DECLARATION(); + + buf_ele = _isrs[int_num]; + cur_ptr = &_isrs[int_num]; + int_pri = cur_ptr->pri; + + if(!cur_ptr->isr_func) + return; + + INTC_PRT("reg_isr:%d:%d:%p\r\n", int_num, int_pri, isr); + + GLOBAL_INT_DISABLE(); + if (list_empty(&isr_hdr.isr)) + { + goto exit; + } + + /* Insert the ISR to the function list, this list is sorted by priority number */ + list_for_each_safe(pos, n, &isr_hdr.isr) + { + tmp_ptr = list_entry(pos, ISR_T, list); + + if (int_pri == tmp_ptr->pri) + { + buf_ele.isr_func = isr; + break; + } + } + +exit: + /* something wrong */ + _isrs[int_num] = buf_ele; + GLOBAL_INT_RESTORE(); + + return; +} + +/* + * FUNCTION DEFINITIONS + **************************************************************************************** + */ +void intc_spurious(void) +{ + ASSERT(0); +} + +void intc_enable(int index) +{ + UINT32 param; + + param = (1UL << index); + sddev_control(ICU_DEV_NAME, CMD_ICU_INT_ENABLE, ¶m); +} + +void intc_disable(int index) +{ + UINT32 param; + + param = (1UL << index); + sddev_control(ICU_DEV_NAME, CMD_ICU_INT_DISABLE, ¶m); +} + +void rf_ps_wakeup_isr_idle_int_cb(void) +{ +#if ( CONFIG_APP_MP3PLAYER == 1 ) + UINT32 irq_status; + + irq_status = sddev_control(ICU_DEV_NAME, CMD_GET_INTR_STATUS, 0); + + if(irq_status & 1<r0, regs->r1, regs->r2, regs->r3); + os_printf("r04:0x%08x r05:0x%08x r06:0x%08x r07:0x%08x\n", + regs->r4, regs->r5, regs->r6, regs->r7); + os_printf("r08:0x%08x r09:0x%08x r10:0x%08x\n", + regs->r8, regs->r9, regs->r10); + os_printf("fp :0x%08x ip :0x%08x\n", + regs->fp, regs->ip); + os_printf("sp :0x%08x lr :0x%08x pc :0x%08x\n", + regs->sp, regs->lr, regs->pc); + os_printf("SPSR:0x%08x\n", regs->spsr); + os_printf("CPSR:0x%08x\n", regs->cpsr); + + int i; + const unsigned int *reg1; + + os_printf("\nseparate regs:\n"); + + reg1 = (const unsigned int *)0x400024; + os_printf("SYS:cpsr r8-r14\n"); + for(i=0;i<0x20>>2;i++) + { + os_printf("0x%08x\n",*(reg1 + i)); + } + + os_printf("IRQ:cpsr spsr r8-r14\n"); + reg1 = (const unsigned int *)0x400044; + for(i=0;i<0x24>>2;i++) + { + os_printf("0x%08x\n",*(reg1 + i)); + } + + os_printf("FIR:cpsr spsr r8-r14\n"); + reg1 = (const unsigned int *)0x400068; + for(i=0;i<0x24>>2;i++) + { + os_printf("0x%08x\n",*(reg1 + i)); + } + + os_printf("ABT:cpsr spsr r8-r14\n"); + reg1 = (const unsigned int *)0x40008c; + for(i=0;i<0x24>>2;i++) + { + os_printf("0x%08x\n",*(reg1 + i)); + } + + os_printf("UND:cpsr spsr r8-r14\n"); + reg1 = (const unsigned int *)0x4000b0; + for(i=0;i<0x24>>2;i++) + { + os_printf("0x%08x\n",*(reg1 + i)); + } + + os_printf("SVC:cpsr spsr r8-r14\n"); + reg1 = (const unsigned int *)0x4000d4; + for(i=0;i<0x24>>2;i++) + { + os_printf("0x%08x\n",*(reg1 + i)); + } + + os_printf("\r\n"); + +} + +void bk_trap_udef(struct arm_registers *regs) +{ +#if (CFG_SOC_NAME == SOC_BK7231N) + *((volatile uint32_t *)START_TYPE_ADDR) = (uint32_t)(CRASH_UNDEFINED_VALUE & 0xffff); +#else + *((volatile uint32_t *)START_TYPE_ADDR) = (uint32_t)CRASH_UNDEFINED_VALUE; +#endif + os_printf("undefined instruction\n"); + bk_show_register(regs); + bk_cpu_shutdown(); +} + +void bk_trap_pabt(struct arm_registers *regs) +{ +#if (CFG_SOC_NAME == SOC_BK7231N) + *((volatile uint32_t *)START_TYPE_ADDR) = (uint32_t)(CRASH_PREFETCH_ABORT_VALUE & 0xffff); +#else + *((volatile uint32_t *)START_TYPE_ADDR) = (uint32_t)CRASH_PREFETCH_ABORT_VALUE; +#endif + os_printf("prefetch abort\n"); + bk_show_register(regs); + bk_cpu_shutdown(); +} + +void bk_trap_dabt(struct arm_registers *regs) +{ +#if (CFG_SOC_NAME == SOC_BK7231N) + *((volatile uint32_t *)START_TYPE_ADDR) = (uint32_t)(CRASH_DATA_ABORT_VALUE & 0xffff); +#else + *((volatile uint32_t *)START_TYPE_ADDR) = (uint32_t)CRASH_DATA_ABORT_VALUE; +#endif + os_printf("data abort\n"); + bk_show_register(regs); + bk_cpu_shutdown(); +} + +void bk_trap_resv(struct arm_registers *regs) +{ +#if (CFG_SOC_NAME == SOC_BK7231N) + *((volatile uint32_t *)START_TYPE_ADDR) = (uint32_t)(CRASH_UNUSED_VALUE & 0xffff); +#else + *((volatile uint32_t *)START_TYPE_ADDR) = (uint32_t)CRASH_UNUSED_VALUE; +#endif + os_printf("not used\n"); + bk_show_register(regs); + bk_cpu_shutdown(); +} + +/// @} diff --git a/cores/beken-72xx/base/fixups/param_config.h b/cores/beken-72xx/base/fixups/param_config.h new file mode 100644 index 000000000..68cef1bb0 --- /dev/null +++ b/cores/beken-72xx/base/fixups/param_config.h @@ -0,0 +1,8 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-14. */ + +#include_next "param_config.h" + +#pragma once + +#undef WIFI_MAC_POS +#define WIFI_MAC_POS -1 // do not use stored MAC address by default diff --git a/cores/beken-72xx/base/fixups/uart_pub.h b/cores/beken-72xx/base/fixups/uart_pub.h new file mode 100644 index 000000000..9626f7812 --- /dev/null +++ b/cores/beken-72xx/base/fixups/uart_pub.h @@ -0,0 +1,16 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-20. */ + +#include_next "uart_pub.h" + +#pragma once + +// make uart.c call __wrap_bk_printf() instead of bk_printf() +// standard wrapping does not work in this case, as bk_printf() +// is implemented in the same translation unit +extern void __wrap_bk_printf(const char *fmt, ...); +#undef bk_printf +#undef os_printf +#undef as_printf +// not defining bk_printf() again, as this would just change the impl name +#define os_printf __wrap_bk_printf +#define as_printf (__wrap_bk_printf("%s:%d\r\n", __FUNCTION__, __LINE__)) diff --git a/cores/beken-72xx/base/lt_defs.h b/cores/beken-72xx/base/lt_defs.h new file mode 100644 index 000000000..3aac8ce9d --- /dev/null +++ b/cores/beken-72xx/base/lt_defs.h @@ -0,0 +1,18 @@ +#pragma once + +#error "Don't include this file directly" + +#define LT_HAS_FLASH 1 +#define LT_HAS_FREERTOS 1 +#define LT_HAS_LWIP 1 +#define LT_HAS_LWIP2 1 +#define LT_HAS_MBEDTLS 1 +#define LT_HAS_OTA 1 +#define LT_HAS_PRINTF 1 +#define LT_HW_DEEP_SLEEP 1 +#define LT_HW_WATCHDOG 1 +#define LT_HW_WIFI 1 + +#define LT_HEAP_FUNC xPortGetFreeHeapSize +#define LT_REALLOC_FUNC pvPortRealloc +#define LT_REMALLOC 1 diff --git a/cores/beken-72xx/base/lt_family.h b/cores/beken-72xx/base/lt_family.h new file mode 100644 index 000000000..cf3139979 --- /dev/null +++ b/cores/beken-72xx/base/lt_family.h @@ -0,0 +1,20 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-02-27. */ + +#pragma once + +#include + +// Choose the main UART output port +#ifndef LT_UART_DEFAULT_PORT +#if LT_HW_UART2 +#define LT_UART_DEFAULT_PORT 2 +#elif LT_HW_UART1 +#define LT_UART_DEFAULT_PORT 1 +#else +#error "No serial port is available" +#endif +#endif + +// Auto-download-reboot detection pattern +// Link check command (CMD_LinkCheck=0) +#define LT_UART_ADR_PATTERN 0x01, 0xE0, 0xFC, 0x01, 0x00 diff --git a/cores/beken-72xx/base/port/fal_flash_bk72xx_port.c b/cores/beken-72xx/base/port/fal_flash_bk72xx_port.c new file mode 100644 index 000000000..d8b723acc --- /dev/null +++ b/cores/beken-72xx/base/port/fal_flash_bk72xx_port.c @@ -0,0 +1,65 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-19. */ + +#include +#include + +#include + +#define FLASH_ERASE_MIN_SIZE (4 * 1024) + +extern uint32_t flash_ctrl(uint32_t cmd, void *param); +extern PROTECT_TYPE get_flash_protect(); +extern void flash_protection_op(uint8_t mode, PROTECT_TYPE type); + +static void unprotect() { + PROTECT_TYPE type = get_flash_protect(); + if (type != FLASH_PROTECT_NONE) { + flash_protection_op(0, FLASH_PROTECT_NONE); +#if LT_LOGLEVEL <= LT_LEVEL_DEBUG + LT_D("Flash protect: %u -> %u", type, get_flash_protect()); + uint16_t sr = 0; + flash_ctrl(CMD_FLASH_READ_SR, &sr); + LT_D("SR = %04x", sr); +#endif + } +} + +static int init() { + __wrap_bk_printf_disable(); + flash_init(); + flash_ctrl(CMD_FLASH_WRITE_ENABLE, NULL); + unprotect(); + __wrap_bk_printf_enable(); + return 0; +} + +static int read(long offset, uint8_t *buf, size_t size) { + flash_read((char *)buf, size, offset); + return size; +} + +static int write(long offset, const uint8_t *buf, size_t size) { + unprotect(); + flash_write((char *)buf, size, offset); + return size; +} + +static int erase(long offset, size_t size) { + unprotect(); + offset &= ~(FLASH_ERASE_MIN_SIZE - 1); + size = ((size - 1) / FLASH_ERASE_MIN_SIZE) + 1; + for (uint16_t i = 0; i < size; i++) { + uint32_t addr = offset + i * FLASH_ERASE_MIN_SIZE; + flash_ctrl(CMD_FLASH_ERASE_SECTOR, &addr); + } + return size * FLASH_ERASE_MIN_SIZE; +} + +const struct fal_flash_dev flash0 = { + .name = FAL_FLASH_DEV_NAME, + .addr = 0x0, + .len = FLASH_LENGTH, + .blk_size = FLASH_ERASE_MIN_SIZE, + .ops = {init, read, write, erase}, + .write_gran = 1, +}; diff --git a/cores/beken-72xx/base/port/printf.c b/cores/beken-72xx/base/port/printf.c new file mode 100644 index 000000000..4967136b6 --- /dev/null +++ b/cores/beken-72xx/base/port/printf.c @@ -0,0 +1,18 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-19. */ + +#include + +#include + +extern void bk_send_byte(uint8_t uport, uint8_t data); +extern int uart_print_port; + +void putchar_(char c) { + bk_send_byte(uart_print_port, c); +} + +void putchar_p(char c, unsigned long port) { + bk_send_byte((port & 0xFF) - 1, c); +} + +WRAP_PRINTF(bk_printf); diff --git a/cores/beken-72xx/base/port/printf_port.h b/cores/beken-72xx/base/port/printf_port.h new file mode 100644 index 000000000..c627e53c4 --- /dev/null +++ b/cores/beken-72xx/base/port/printf_port.h @@ -0,0 +1,15 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-20. */ + +#pragma once + +#include + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +WRAP_DISABLE_DEF(bk_printf); + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/cores/beken-72xx/base/sdk_extern.h b/cores/beken-72xx/base/sdk_extern.h new file mode 100644 index 000000000..4cbccb07b --- /dev/null +++ b/cores/beken-72xx/base/sdk_extern.h @@ -0,0 +1,26 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-05-24. */ + +#pragma once + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +#include + +// SDK +extern uint8_t system_mac[]; +extern int uart_print_port; +uint32_t wdt_ctrl(uint32_t cmd, void *param); +void bk_send_byte(uint8_t uport, uint8_t data); +void uart_hw_set_change(uint8_t uport, bk_uart_config_t *uart_config); +int uart_rx_callback_set(int uport, uart_callback callback, void *param); +void sctrl_enter_rtos_deep_sleep(PS_DEEP_CTRL_PARAM *deep_param); +void ps_delay(volatile UINT16 times); + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/cores/beken-72xx/base/sdk_private.h b/cores/beken-72xx/base/sdk_private.h new file mode 100644 index 000000000..05e783238 --- /dev/null +++ b/cores/beken-72xx/base/sdk_private.h @@ -0,0 +1,40 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-18. */ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +// most stuff is here - this has to be before other includes! +#include +// other includes +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +// conflict with stl_algobase.h +#undef min +#undef max + +// from fixups/arch_main.c +extern unsigned char __bk_rf_is_init; + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/cores/beken-72xx/base/wraps/BkDriverFlash.c b/cores/beken-72xx/base/wraps/BkDriverFlash.c new file mode 100644 index 000000000..8b7bf4ac4 --- /dev/null +++ b/cores/beken-72xx/base/wraps/BkDriverFlash.c @@ -0,0 +1,127 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-07-07. */ + +#include "BkDriverFlash.h" +#include "drv_model_pub.h" +#include "uart_pub.h" + +static const bk_logic_partition_t bk7231_partitions[BK_PARTITION_MAX] = { + { + .partition_owner = BK_FLASH_EMBEDDED, + .partition_description = "Bootloader", + .partition_start_addr = FLASH_BOOTLOADER_OFFSET, + .partition_length = FLASH_BOOTLOADER_LENGTH, + .partition_options = PAR_OPT_READ_EN | PAR_OPT_WRITE_DIS, + }, + { + .partition_owner = BK_FLASH_EMBEDDED, + .partition_description = "Application", + .partition_start_addr = FLASH_APP_OFFSET, + .partition_length = FLASH_APP_LENGTH, + .partition_options = PAR_OPT_READ_EN | PAR_OPT_WRITE_DIS, + }, + { + .partition_owner = BK_FLASH_EMBEDDED, + .partition_description = "ota", + .partition_start_addr = FLASH_DOWNLOAD_OFFSET, + .partition_length = FLASH_DOWNLOAD_LENGTH, + .partition_options = PAR_OPT_READ_EN | PAR_OPT_WRITE_DIS, + }, + { + .partition_owner = BK_FLASH_EMBEDDED, + .partition_description = "RF Firmware", + .partition_start_addr = FLASH_CALIBRATION_OFFSET, + .partition_length = FLASH_CALIBRATION_LENGTH, + .partition_options = PAR_OPT_READ_EN | PAR_OPT_WRITE_DIS, + }, + { + .partition_owner = BK_FLASH_EMBEDDED, + .partition_description = "NET info", + .partition_start_addr = FLASH_TLV_OFFSET, + .partition_length = FLASH_TLV_LENGTH, + .partition_options = PAR_OPT_READ_EN | PAR_OPT_WRITE_DIS, + }, +}; + +bk_logic_partition_t *__wrap_bk_flash_get_info(bk_partition_t partition) { + if ((partition >= BK_PARTITION_BOOTLOADER) && (partition < BK_PARTITION_MAX)) + return (bk_logic_partition_t *)&bk7231_partitions[partition]; + return NULL; +} + +OSStatus __wrap_bk_flash_erase(bk_partition_t partition, uint32_t off_set, uint32_t size) { + uint32_t i; + uint32_t param; + UINT32 status; + DD_HANDLE flash_hdl; + uint32_t start_sector, end_sector; + bk_logic_partition_t *partition_info; + GLOBAL_INT_DECLARATION(); + partition_info = bk_flash_get_info(partition); + start_sector = off_set >> 12; + end_sector = (off_set + size - 1) >> 12; + flash_hdl = ddev_open(FLASH_DEV_NAME, &status, 0); + ASSERT(DD_HANDLE_UNVALID != flash_hdl); + for (i = start_sector; i <= end_sector; i++) { + param = partition_info->partition_start_addr + (i << 12); + GLOBAL_INT_DISABLE(); + ddev_control(flash_hdl, CMD_FLASH_ERASE_SECTOR, (void *)¶m); + GLOBAL_INT_RESTORE(); + } + return kNoErr; +} + +OSStatus +__wrap_bk_flash_write(bk_partition_t partition, volatile uint32_t off_set, uint8_t *inBuffer, uint32_t inBufferLength) { + UINT32 status; + DD_HANDLE flash_hdl; + uint32_t start_addr; + bk_logic_partition_t *partition_info; + GLOBAL_INT_DECLARATION(); + if (NULL == inBuffer) { + os_printf("%s inBuffer=NULL\r\n", __FUNCTION__); + return kParamErr; + } + partition_info = bk_flash_get_info(partition); + if (NULL == partition_info) { + os_printf("%s partiion not found\r\n", __FUNCTION__); + return kNotFoundErr; + } + start_addr = partition_info->partition_start_addr + off_set; + flash_hdl = ddev_open(FLASH_DEV_NAME, &status, 0); + if (DD_HANDLE_UNVALID == flash_hdl) { + os_printf("%s open failed\r\n", __FUNCTION__); + return kOpenErr; + } + GLOBAL_INT_DISABLE(); + ddev_write(flash_hdl, (char *)inBuffer, inBufferLength, start_addr); + GLOBAL_INT_RESTORE(); + return kNoErr; +} + +OSStatus +__wrap_bk_flash_read(bk_partition_t partition, volatile uint32_t off_set, uint8_t *outBuffer, uint32_t inBufferLength) { + UINT32 status; + uint32_t start_addr; + DD_HANDLE flash_hdl; + bk_logic_partition_t *partition_info; + GLOBAL_INT_DECLARATION(); + if (NULL == outBuffer) { + os_printf("%s outBuffer=NULL\r\n", __FUNCTION__); + return kParamErr; + } + partition_info = bk_flash_get_info(partition); + if (NULL == partition_info) { + os_printf("%s partiion not found\r\n", __FUNCTION__); + return kNotFoundErr; + } + start_addr = partition_info->partition_start_addr + off_set; + flash_hdl = ddev_open(FLASH_DEV_NAME, &status, 0); + if (DD_HANDLE_UNVALID == flash_hdl) { + os_printf("%s open failed\r\n", __FUNCTION__); + return kOpenErr; + } + GLOBAL_INT_DISABLE(); + ddev_read(flash_hdl, (char *)outBuffer, inBufferLength, start_addr); + GLOBAL_INT_RESTORE(); + return kNoErr; +} diff --git a/cores/beken-72xx/base/wraps/wlan_ui.c b/cores/beken-72xx/base/wraps/wlan_ui.c new file mode 100644 index 000000000..c003e5c08 --- /dev/null +++ b/cores/beken-72xx/base/wraps/wlan_ui.c @@ -0,0 +1,32 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-07-01. */ + +#if 0 + +#include +#include + +// NOTE: this wrap is currently not used, as the related methods +// are in the same translation unit (wlan_ui.c), so wrapping doesn't work + +extern void __real_bk_wlan_sta_init_adv(network_InitTypeDef_adv_st *inNetworkInitParaAdv); +extern sta_param_t *g_sta_param_ptr; + +// enable/disable fast connect according to the config parameters +void __wrap_bk_wlan_sta_init_adv(network_InitTypeDef_adv_st *inNetworkInitParaAdv) { + // let it do the job first + __real_bk_wlan_sta_init_adv(inNetworkInitParaAdv); + // correct the parameter + bool fast_connect = false; + if (inNetworkInitParaAdv->ap_info.channel) { + // enable fast connect after finding first non-zero octet of BSSID + for (uint8_t i = 0; i < 6; i++) { + if (inNetworkInitParaAdv->ap_info.bssid[i] != 0x00) { + fast_connect = true; + break; + } + } + } + g_sta_param_ptr->fast_connect_set = fast_connect; +} + +#endif diff --git a/cores/beken-72xx/misc/bk7231_bsp.template.ld b/cores/beken-72xx/misc/bk7231_bsp.template.ld new file mode 100644 index 000000000..b0e90b01a --- /dev/null +++ b/cores/beken-72xx/misc/bk7231_bsp.template.ld @@ -0,0 +1,165 @@ +/* + * Script for GNU linker. + * Describes layout of sections, location of stack. + * + * In this case vectors are at location 0 (reset @ 0x08) + * + * +------------+ 0x00400020 + * data | + * end + * |(heap) | + * . . + * . . + * |(heap limit)| + * + * |- - - - - - | + * stack bottom 256k + * +------------+ + * + * +------------+ 0x0000000 + * |vectors | + * | | + * |------------+ + * |text | + * |data | + * | | 1024k + * +------------+ + */ + +/* Split memory into area for vectors and ram */ +MEMORY +{ + flash (rx) : ORIGIN = ${BOARD_BUILD.BKOFFSET_APP}, LENGTH = ${BOARD_BUILD.BKRBL_SIZE_APP} + ram (rw!x): ORIGIN = 0x00400100, LENGTH = 256k - 0x100 +} + +OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") +OUTPUT_ARCH(arm) +ENTRY(_vector_start); +_vector_start = ORIGIN(flash); + +SECTIONS +{ + /* vectors go to vectors region */ + . = ORIGIN(flash); + .vectors : + { + KEEP(*(*.vectors)) + KEEP( *(*.boot)) + } > flash + + /* instructions go to the text region*/ + + . = ALIGN(0x8); + /* code, instructions.for example: i=i+1; */ + .text : + { + *(.text) + *(.text.*) + *(.stub) + + /* https://www.embedded.com/building-bare-metal-arm-systems-with-gnu-part-3/ */ + KEEP(*crtbegin.o(.ctors)) + KEEP(*(EXCLUDE_FILE (*ctrend.o) .ctors)) + KEEP(*(SORT(.ctors.*))) + KEEP(*crtend.o(.ctors)) + KEEP(*crtbegin.o(.dtors)) + KEEP(*(EXCLUDE_FILE (*crtend.o) .dtors)) + KEEP(*(SORT(.dtors.*))) + KEEP(*crtend.o(.dtors)) + + . = ALIGN(4); + __preinit_array_start = .; + KEEP(*(.preinit_array)) + __preinit_array_end = .; + . = ALIGN(4); + __init_array_start = .; + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + __init_array_end = .; + . = ALIGN(4); + __fini_array_start = .; + KEEP(*(SORT(.fini_array.*))) + KEEP(*(.fini_array)) + __fini_array_end = .; + + . = ALIGN (4); + __cmd_table_start__ = .; + KEEP(*(.cmd.table.data*)) + __cmd_table_end__ = .; + + /* https://community.silabs.com/s/article/understand-the-gnu-linker-script-of-cortex-m4?language=en_US */ + KEEP(*(.init)) + KEEP(*(.fini)) + *(.init) + *(.fini) + + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t*) + *(.glue_7t) *(.glue_7) + } > flash + + /* read only data.for example: const int rom_data[3]={1,2,3}; */ + .rodata ALIGN(8) : + { + *(.rodata) + *(.rodata.*) + *(.gnu.linkonce.r*) + } > flash + + .ARM.exidx : + { + __exidx_start = .; + *(.ARM.exidx*) + *(.gnu.linkonce.armexidx.*) + __exidx_end = .; + } > flash + + /* globals.for example: int ram_data[3]={4,5,6}; */ + /* VMA in RAM, but keep LMA in flash */ + _begin_data = .; + .data : AT ( _begin_data ) + { + *(.data .data.*) + *(.sdata) + *(.gnu.linkonce.d*) + SORT(CONSTRUCTORS) + } >ram + + /* Loader will copy data from _flash_begin to _ram_begin..ram_end */ + _data_flash_begin = LOADADDR(.data); + _data_ram_begin = ADDR(.data); + _data_ram_end = .; + + /* uninitialized data section - global int i; */ + .bss ALIGN(8): + { + _bss_start = .; + *boot_handlers.O(.bss .bss.* .scommon .sbss .dynbss COMMON) + *(.bss .bss.*) + *(.scommon) + *(.sbss) + *(.dynbss) + *(COMMON) + /* Align here to ensure that the .bss section occupies space up to + _end. Align after .bss to ensure correct alignment even if the + .bss section disappears because there are no input sections. */ + . = ALIGN(32 / 8); + _bss_end = .; + } > ram /* in RAM */ + + . = ALIGN (8); + _empty_ram = .; + + /* This symbol defines end of code/data sections. Heap starts here. */ + PROVIDE(end = .); +} + +GROUP( + libgcc.a + libg.a + libc.a + libm.a + libnosys.a +) diff --git a/cores/beken-72xx/misc/bk7231n_bsp.template.ld b/cores/beken-72xx/misc/bk7231n_bsp.template.ld new file mode 100644 index 000000000..c7ab85334 --- /dev/null +++ b/cores/beken-72xx/misc/bk7231n_bsp.template.ld @@ -0,0 +1,406 @@ +/* + * Script for GNU linker. + * Describes layout of sections, location of stack. + * + * In this case vectors are at location 0 (reset @ 0x08) + * + * +------------+ 0x00400020 + * data | + * end + * |(heap) | + * . . + * . . + * |(heap limit)| + * + * |- - - - - - | + * stack bottom 256k + * +------------+ + * + * +------------+ 0x0000000 + * |vectors | + * | | + * |------------+ + * |text | + * |data | + * | | 1024k + * +------------+ + */ + +/* Split memory into area for vectors and ram */ +MEMORY +{ + flash (rx) : ORIGIN = ${BOARD_BUILD.BKOFFSET_APP}, LENGTH = ${BOARD_BUILD.BKRBL_SIZE_APP} + tcm (rw!x): ORIGIN = 0x003F0000, LENGTH = 60k - 512 + itcm (rwx): ORIGIN = 0x003FEE00, LENGTH = 4k + 512 + ram (rw!x): ORIGIN = 0x00400100, LENGTH = 192k - 0x100 +} + +OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") +OUTPUT_ARCH(arm) +ENTRY(_vector_start); +_vector_start = ORIGIN(flash); + +SECTIONS +{ + /* vectors go to vectors region */ + . = ORIGIN(flash); + .vectors : + { + KEEP(*(*.vectors)) + KEEP( *(*.boot)) + } > flash + + /* instructions go to the text region*/ + + . = ORIGIN(itcm); + .itcm.code ALIGN(8) : + { + /* itcm 4KB code */ + *(.text.intc_hdl_entry) + *(.text.intc_irq) + *(.text.intc_fiq) + *(.text.bk_timer_isr) + *(.text.power_save_wakeup_isr) + *(.text.bmsg_rx_sender) + *(.text.bmsg_null_sender) + *(.text.fclk_get_tick) + *(.text.flash_read_sr) + *(.text.flash_write_sr) + *(.text.flash_clr_qwfr) + *(.text.set_flash_protect) + *(.text.flash_read) + *(.text.flash_read_data) + *(.text.flash_set_qe) + *(.text.flash_set_qwfr) + *(.text.flash_set_line_mode*) + *(.text.flash_get_line_mode) + *(.text.flash_write) + *(.text.flash_ctrl) + *(.text.power_save_dtim_wake) + *(.text.sctrl_fix_dpll_div) + + *(.text.vTaskSuspendAll) + *(.text.xTaskGetTickCount) + *(.text.xTaskGetTickCountFromISR) + *(.text.vTaskStepTick) + *(.text.xTaskIncrementTick) + *(.text.xTaskResumeAll) + *(.text.vTaskSwitchContext) + *(.text.vApplicationIdleHook) + *(.text.platform_is_in_irq_context) + *(.text.platform_is_in_fiq_context) + *(.text.platform_is_in_interrupt_context) + *(.text.portENABLE_IRQ) + *(.text.portENABLE_FIQ) + *(.text.portDISABLE_FIQ) + *(.text.portDISABLE_IRQ) + *(.text.vPortEnterCritical) + *(.text.vPortExitCritical) + } > itcm AT>flash + _itcmcode_flash_begin = LOADADDR(.itcm.code); + _itcmcode_ram_begin = ADDR(.itcm.code); + _itcmcode_ram_end = _itcmcode_ram_begin + SIZEOF(.itcm.code); + + . = ALIGN(0x8); + /* code, instructions.for example: i=i+1; */ + .text : + { + *(.text) + *(.text.*) + *(.stub) + + /* https://www.embedded.com/building-bare-metal-arm-systems-with-gnu-part-3/ */ + KEEP(*crtbegin.o(.ctors)) + KEEP(*(EXCLUDE_FILE (*ctrend.o) .ctors)) + KEEP(*(SORT(.ctors.*))) + KEEP(*crtend.o(.ctors)) + KEEP(*crtbegin.o(.dtors)) + KEEP(*(EXCLUDE_FILE (*crtend.o) .dtors)) + KEEP(*(SORT(.dtors.*))) + KEEP(*crtend.o(.dtors)) + + . = ALIGN(4); + __preinit_array_start = .; + KEEP(*(.preinit_array)) + __preinit_array_end = .; + . = ALIGN(4); + __init_array_start = .; + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + __init_array_end = .; + . = ALIGN(4); + __fini_array_start = .; + KEEP(*(SORT(.fini_array.*))) + KEEP(*(.fini_array)) + __fini_array_end = .; + + . = ALIGN (4); + __cmd_table_start__ = .; + KEEP(*(.cmd.table.data*)) + __cmd_table_end__ = .; + + /* https://community.silabs.com/s/article/understand-the-gnu-linker-script-of-cortex-m4?language=en_US */ + KEEP(*(.init)) + KEEP(*(.fini)) + *(.init) + *(.fini) + + /* .gnu.warning sections are handled specially by elf32.em. */ + *(.gnu.warning) + *(.gnu.linkonce.t*) + *(.glue_7t) *(.glue_7) + } > flash + + /* read only data.for example: const int rom_data[3]={1,2,3}; */ + .rodata ALIGN(8) : + { + *(.rodata) + *(.rodata.*) + *(.gnu.linkonce.r*) + } > flash + + .ARM.exidx : + { + __exidx_start = .; + *(.ARM.exidx*) + *(.gnu.linkonce.armexidx.*) + __exidx_end = .; + } > flash + + . = ORIGIN(tcm); + .tcm ALIGN(8) : + { + *apm_task.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *apm.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *app_ble_init.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *app_ble_task.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *app_ble_task.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *app_ble.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *app_comm.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *app_sdp.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *app_sec.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *app_task.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *app.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *arbitrate.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *arch_main*.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *ate_app*.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *bam_task.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *bam.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *bk_timer.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *bk7011_cal*.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *bk7231N_cal.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *BkDriverFlash.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *ble_aes.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *ble_main.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *ble_rf_port.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *ble_rf_xvr.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *ble_ui.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *ble_util_buf.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *ble.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *chan.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *cmd_evm.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *cmd_rx_sensitivity.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *comm_task.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *comm.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *common_list.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *common_utils.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *common.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *ctrl_iface.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *dbg_mwsgen.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *dbg_swdiag.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *dbg_task.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *dbg.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *dd.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *dhcp-server-main.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *dhcp-server.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *dhcp.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *dma.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *dns.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *drv_model.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *ecc_p256.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *eloop.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *etharp.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *fake_clock.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *flash.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *gapc_task.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *gapc.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *gapm_task.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *gapm.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *gattc_task.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *gattc.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *gattm_task.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *gattm.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *gpio.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *h4tl.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *hal_dma.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *hal_machw.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *hci_fc.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *hci_tl.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *hci.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *heap_4.marm.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *hostapd*.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *ieee802_11_demo.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *igmp.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *intc.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *ip4_addr.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *ip4.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *irda*.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *ke_env.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *kernel_event.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *kernel_task.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *kernel.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *l2cc_task.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *l2cc.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *l2cm.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *llc_task.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *llc.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *lld_adv.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *lld_con.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *lld_init.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *lld_per_adv.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *lld_test.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *lld.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *llm_task.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *llm.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *mac_phy_bypass.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *main_none.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *main_supplicant.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *manual_cal_bk7231U.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *me_task.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *me.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *mem_arch.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *mm_bcn.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *mm_task.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *mm_timer.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *mm.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *net.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *netif.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *param_config.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *phy_trident*.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *ping.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *power_save*.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *prf_utils.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *prf.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *ps.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *pwm_bk7231n.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *raw.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *rc.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *rf_xvr.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *role_launch.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *RomCallFlash.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *rtos_pub*.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *rw_ieee80211.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *rw_msg_rx.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *rwble.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *rwip_driver.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *rwip.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *rwip.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *rwnx_intf*.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *rwnx.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *rx_sensitivity.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *rx_swdesc.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *rxl_cntrl.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *rxl_hwdesc.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *rxu_cntrl.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *sa_ap.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *sa_station.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *saradc.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *scan_task.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *scan.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *scanu_task.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *scanu.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *sch_alarm.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *sch_arb.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *sch_plan.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *sch_prog.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *sch_slice.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *sdp_common.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *sdp_service_task.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *sdp_service.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *sm_task.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *sm.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *sockets.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *spi*.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *sta_mgmt.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *start_type.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *sys_arch.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *sys_ctrl.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *tasks.marm.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *tcp_in.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *tcp.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *tcpip.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *td.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *temp_detect.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *timeouts.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *timers.marm.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *tx_evm.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *tx_swdesc.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *txl_buffer.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *txl_cfm.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *txl_cntrl.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *uart_ble.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *uart.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *vif_mgmt.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *wdt.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *wlan_cli*.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *wlan_ui*.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *wpa_debug.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *wpa_psk_cache.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *wpa_psk_cache.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + *wpa_supplicant.o(.bss .bss.* .scommon .sbss .dynbss COMMON) + + /* *memp.o(.bss .bss.* .scommon .sbss .dynbss COMMON) */ + /* *mem.o(.bss .bss.* .scommon .sbss .dynbss COMMON) */ + } >tcm AT>flash + _tcmbss_start = ADDR(.tcm); + _tcmbss_end = _tcmbss_start + SIZEOF(.tcm); + + . = ORIGIN(ram); + /* globals.for example: int ram_data[3]={4,5,6}; */ + /* VMA in RAM, but keep LMA in flash */ + _begin_data = .; + .data : + { + *(.data .data.*) + *(.sdata) + *(.gnu.linkonce.d*) + SORT(CONSTRUCTORS) + } >ram AT>flash + _end_data = .; + + /* Loader will copy data from _flash_begin to _ram_begin..ram_end */ + _data_flash_begin = LOADADDR(.data); + _data_ram_begin = ADDR(.data); + _data_ram_end = .; + + /* uninitialized data section - global int i; */ + .bss ALIGN(8): + { + _bss_start = .; + *boot_handlers.O(.bss .bss.* .scommon .sbss .dynbss COMMON) + *(.bss .bss.*) + *(.scommon) + *(.sbss) + *(.dynbss) + *(COMMON) + /* Align here to ensure that the .bss section occupies space up to + _end. Align after .bss to ensure correct alignment even if the + .bss section disappears because there are no input sections. */ + . = ALIGN(32 / 8); + _bss_end = .; + } > ram /* in RAM */ + + . = ALIGN (8); + _empty_ram = .; + + /* This symbol defines end of code/data sections. Heap starts here. */ + PROVIDE(end = .); +} + +GROUP( + libgcc.a + libg.a + libc.a + libm.a + libnosys.a +) diff --git a/cores/beken-72xx/misc/bk72xx.cfg b/cores/beken-72xx/misc/bk72xx.cfg new file mode 100644 index 000000000..19fda6b6a --- /dev/null +++ b/cores/beken-72xx/misc/bk72xx.cfg @@ -0,0 +1,48 @@ +# BK72XX OpenOCD config +# credit: @xabean at https://www.elektroda.com/rtvforum/viewtopic.php?p=20028605#20028605 + +# we only have CEN (aka chip enable, system reset) +reset_config srst_only + +# CEN is normally pulled high, but sometimes it can help to force it high, not just low +reset_config srst_push_pull + +# on connect, deassert (reset to HIGH) the SRST pin +reset_config connect_deassert_srst + +# we have no TRST pin, tell OpenOCD to imagine it's tied to SRST +reset_config srst_pulls_trst + +# use JTAG +transport select jtag + +# 1000 kHz should work +adapter speed 1000 + +# wait 200ms after releasing srst before we send JTAG commands over TMS, +# we will never reset into halt because we have no tRST pin :( +adapter srst delay 200 + +if { [info exists CHIPNAME] } { + set _CHIPNAME $CHIPNAME +} else { + set _CHIPNAME bk7231t +} + +if { [info exists ENDIAN] } { + set _ENDIAN $ENDIAN +} else { + # this defaults to a little endian + set _ENDIAN little +} + +if { [info exists CPUTAPID] } { + set _CPUTAPID $CPUTAPID +} else { + set _CPUTAPID 0x15968001 +} + +jtag newtap $_CHIPNAME cpu -irlen 4 -expected-id $_CPUTAPID + +set _TARGETNAME $_CHIPNAME.cpu +target create $_TARGETNAME arm966e -endian $_ENDIAN -chain-position $_TARGETNAME diff --git a/cores/common/arduino/libraries/api/Serial/Serial.cpp b/cores/common/arduino/libraries/api/Serial/Serial.cpp new file mode 100644 index 000000000..d9a3cb46d --- /dev/null +++ b/cores/common/arduino/libraries/api/Serial/Serial.cpp @@ -0,0 +1,36 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-05-23. */ + +#include "Serial.h" + +SerialClass::SerialClass(uint32_t port, pin_size_t rx, pin_size_t tx) { + this->port = port; + this->rx = rx; + this->tx = tx; + this->buf = NULL; + this->data = NULL; +} + +#if LT_AUTO_DOWNLOAD_REBOOT && defined(LT_UART_ADR_PATTERN) +static uint8_t adrState = 0; +static uint8_t adrCmd[] = {LT_UART_ADR_PATTERN}; + +void SerialClass::adrParse(uint8_t c) { + adrState = (adrState + 1) * (c == adrCmd[adrState]); + if (adrState == sizeof(adrCmd) / sizeof(uint8_t)) { + LT_I("Auto download mode: rebooting"); + LT.restartDownloadMode(); + } +} +#endif + +int SerialClass::available() { + return this->buf ? this->buf->available() : 0; +} + +int SerialClass::peek() { + return this->buf ? this->buf->peek() : -1; +} + +int SerialClass::read() { + return this->buf ? this->buf->read_char() : -1; +} diff --git a/cores/common/arduino/libraries/api/Serial/Serial.h b/cores/common/arduino/libraries/api/Serial/Serial.h new file mode 100644 index 000000000..1b80b6809 --- /dev/null +++ b/cores/common/arduino/libraries/api/Serial/Serial.h @@ -0,0 +1,57 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-23. */ + +#pragma once + +#include +#include +#include + +using namespace arduino; + +class SerialClass : public HardwareSerial { + private: + uint32_t port; + pin_size_t rx; + pin_size_t tx; + + public: + void *data; + + private: + RingBuffer *buf; + uint32_t baudrate; + uint16_t config; + + public: + SerialClass(uint32_t port, pin_size_t rx = PIN_INVALID, pin_size_t tx = PIN_INVALID); + + inline void begin(unsigned long baudrate) { + begin(baudrate, SERIAL_8N1); + } + + inline void configure(unsigned long baudrate) { + configure(baudrate, SERIAL_8N1); + } + + void begin(unsigned long baudrate, uint16_t config); + void configure(unsigned long baudrate, uint16_t config); + void end(); + int available(); + int peek(); + int read(); + void flush(); + size_t write(uint8_t c); + + operator bool() { + return !!buf; + } + + public: +#if LT_AUTO_DOWNLOAD_REBOOT + static void adrParse(uint8_t c); +#endif + + using Print::write; +}; + +#define HAS_SERIAL_CLASS 1 diff --git a/cores/common/arduino/libraries/api/SoftwareSerial/SoftwareSerial.cpp b/cores/common/arduino/libraries/api/SoftwareSerial/SoftwareSerial.cpp new file mode 100644 index 000000000..af60a5f3e --- /dev/null +++ b/cores/common/arduino/libraries/api/SoftwareSerial/SoftwareSerial.cpp @@ -0,0 +1,45 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-07-03. */ + +#include "SoftwareSerial.h" + +#if LT_ARD_HAS_SOFTSERIAL + +SoftwareSerial::SoftwareSerial(pin_size_t receivePin, pin_size_t transmitPin, bool inverted) { + data.rx.buf = NULL; + data.tx.buf = NULL; + data.rx.pin = receivePin; + data.tx.pin = transmitPin; + data.invert = inverted == true; +} + +int SoftwareSerial::available() { + return data.rx.buf->available(); +} + +int SoftwareSerial::peek() { + return data.rx.buf->peek(); +} + +int SoftwareSerial::read() { + return data.rx.buf->read_char(); +} + +void SoftwareSerial::flush() { + while (data.rx.buf->available()) { + yield(); + } +} + +size_t SoftwareSerial::write(uint8_t c) { + while (data.tx.buf->isFull()) { + yield(); + } + data.tx.buf->store_char(c); + if (data.tx.state == SS_IDLE) { + data.tx.state = SS_START; + this->startTx(); + } + return 1; +} + +#endif diff --git a/cores/common/arduino/libraries/api/SoftwareSerial/SoftwareSerial.h b/cores/common/arduino/libraries/api/SoftwareSerial/SoftwareSerial.h new file mode 100644 index 000000000..151b194b6 --- /dev/null +++ b/cores/common/arduino/libraries/api/SoftwareSerial/SoftwareSerial.h @@ -0,0 +1,76 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-07-03. */ + +#pragma once + +#if LT_ARD_HAS_SOFTSERIAL || DOXYGEN + +#include +#include +#include + +using namespace arduino; + +typedef enum { + SS_IDLE = 0, + SS_START, + SS_DATA0, + SS_DATA1, + SS_DATA2, + SS_DATA3, + SS_DATA4, + SS_DATA5, + SS_DATA6, + SS_DATA7, + SS_STOP, + SS_END, +} SoftState; + +typedef struct { + SoftState state; + RingBuffer *buf; + uint8_t byte; + pin_size_t pin; + void *param; +} SoftData; + +typedef struct { + SoftData rx; + SoftData tx; + uint8_t invert; + void *param; +} SoftSerial; + +class SoftwareSerial : public HardwareSerial { + private: + SoftSerial data; + void *param; + + public: + SoftwareSerial(pin_size_t receivePin, pin_size_t transmitPin, bool inverted = false); + + inline void begin(unsigned long baudrate) { + begin(baudrate, SERIAL_8N1); + } + + int available(); + int peek(); + int read(); + void flush(); + size_t write(uint8_t c); + + operator bool() { + return data.rx.buf || data.tx.buf; + } + + public: // Family needs to implement these methods only + void begin(unsigned long baudrate, uint16_t config); + void end(); + + private: + void startTx(); + void endTx(); + + using Print::write; +}; + +#endif diff --git a/cores/common/arduino/libraries/api/WiFi/WiFi.cpp b/cores/common/arduino/libraries/api/WiFi/WiFi.cpp new file mode 100644 index 000000000..d20012a9e --- /dev/null +++ b/cores/common/arduino/libraries/api/WiFi/WiFi.cpp @@ -0,0 +1,77 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-25. */ + +#include "WiFi.h" + +void WiFiClass::printDiag(Print &dest) { + dest.print("Mode: "); + dest.println(WiFiModeText[getMode()]); + + dest.print("Status: "); + dest.println(WiFiStatusText[status()]); + + if (getMode() & WIFI_MODE_STA) { + dest.println("-- Station --"); + dest.print("SSID: "); + if (isConnected()) { + dest.println(SSID()); + dest.print("Channel: "); + dest.println(channel()); + dest.print("BSSID: "); + dest.println(BSSIDstr()); + dest.print("RSSI: "); + dest.println(RSSI()); + dest.print("Encryption: "); + dest.println(WiFiAuthModeText[getEncryption()]); + dest.print("IP: "); + dest.println(localIP()); + dest.print("MAC: "); + dest.println(macAddress()); + dest.print("Hostname: "); + dest.println(getHostname()); + } else { + dest.println("disconnected"); + } + } + + if (getMode() & WIFI_MODE_AP) { + dest.println("-- Access Point --"); + dest.print("SSID: "); + if (softAPSSID().length()) { + dest.println(softAPSSID()); + dest.print("IP: "); + dest.println(softAPIP()); + dest.print("MAC: "); + dest.println(softAPmacAddress()); + dest.print("Hostname: "); + dest.println(softAPgetHostname()); + } else { + dest.println("disconnected"); + } + } +} + +bool WiFiClass::validate(const char *ssid, const char *passphrase) { + if (!ssid || *ssid == 0x00 || strlen(ssid) > 32) { + LT_WM(WIFI, "SSID not specified or too long"); + return false; + } + if (passphrase) { + uint16_t length = strlen(passphrase); + if (length < 8) { + LT_WM(WIFI, "Passphrase too short (%u)", length); + return false; + } + if (length > 63) { + LT_WM(WIFI, "Passphrase too long (%u)", length); + return false; + } + } + return true; +} + +__attribute__((weak)) void WiFiClass::dataInitialize() {} + +__attribute__((weak)) void WiFiClass::dataFree() {} + +WiFiClass WiFi; +WiFiClass *pWiFi = NULL; diff --git a/cores/common/arduino/libraries/api/WiFi/WiFi.h b/cores/common/arduino/libraries/api/WiFi/WiFi.h new file mode 100644 index 000000000..92e0266ce --- /dev/null +++ b/cores/common/arduino/libraries/api/WiFi/WiFi.h @@ -0,0 +1,201 @@ +/* + WiFi.h - esp32 Wifi support. + Based on WiFi.h from Arduino WiFi shield library. + Copyright (c) 2011-2014 Arduino. All right reserved. + Modified by Ivan Grokhotkov, December 2014 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#pragma once + +#include +#include +#include +#include +#include + +#include "WiFiType.h" + +#include +#include +#include +#include + +class WiFiClass { + public: + // must be public for WiFiEvents & WiFiScan static handlers + void *data; + WiFiScanData *scan = NULL; + + public: /* WiFi.cpp */ + WiFiClass(); + ~WiFiClass(); + void printDiag(Print &dest); + bool validate(const char *ssid, const char *passphrase); + void dataInitialize(); + void dataFree(); + + public: /* WiFiGeneric.cpp */ + bool mode(WiFiMode mode); + bool modePriv(WiFiMode mode, WiFiModeAction sta, WiFiModeAction ap); + WiFiMode getMode(); + WiFiStatus status(); + + bool enableSTA(bool enable); + bool enableAP(bool enable); + + bool setSleep(bool enable); + bool getSleep(); + + bool setTxPower(int power); + int getTxPower(); + + int hostByName(const char *hostname, IPAddress &aResult); + IPAddress hostByName(const char *hostname); + + static IPAddress calculateNetworkID(IPAddress ip, IPAddress subnet); + static IPAddress calculateBroadcast(IPAddress ip, IPAddress subnet); + static uint8_t calculateSubnetCIDR(IPAddress subnetMask); + static String macToString(uint8_t *mac); + + static void resetNetworkInfo(WiFiNetworkInfo &info); + + private: /* WiFiGeneric.cpp */ + bool restoreSTAConfig(const WiFiNetworkInfo &info); + bool restoreAPConfig(const WiFiNetworkInfo &info); + + protected: /* WiFiEvents.cpp */ + static std::vector handlers; + + public: /* WiFiEvents.cpp */ + uint16_t onEvent(EventCb callback, EventId eventId = ARDUINO_EVENT_MAX); + uint16_t onEvent(EventFuncCb callback, EventId eventId = ARDUINO_EVENT_MAX); + uint16_t onEvent(EventSysCb callback, EventId eventId = ARDUINO_EVENT_MAX); + void removeEvent(EventCb callback, EventId eventId); + void removeEvent(EventSysCb callback, EventId eventId); + void removeEvent(uint16_t id); + static void postEvent(EventId eventId, EventInfo eventInfo); + + public: /* WiFiSTA.cpp */ + WiFiStatus begin( + const char *ssid, + const char *passphrase = NULL, + int32_t channel = 0, + const uint8_t *bssid = NULL, + bool connect = true + ); + WiFiStatus + begin(char *ssid, char *passphrase = NULL, int32_t channel = 0, const uint8_t *bssid = NULL, bool connect = true); + + bool config( + IPAddress localIP, + IPAddress gateway, + IPAddress subnet, + IPAddress dns1 = (uint32_t)0x00000000, + IPAddress dns2 = (uint32_t)0x00000000 + ); + + bool reconnect(const uint8_t *bssid = NULL); + bool disconnect(bool wifiOff = false); + + bool isConnected(); + + bool setAutoReconnect(bool autoReconnect); + bool getAutoReconnect(); + + WiFiStatus waitForConnectResult(unsigned long timeout); + + IPAddress localIP(); + uint8_t *macAddress(uint8_t *mac); + String macAddress(); + IPAddress subnetMask(); + IPAddress gatewayIP(); + IPAddress dnsIP(uint8_t dns_no = 0); + IPAddress broadcastIP(); + IPAddress networkID(); + uint8_t subnetCIDR(); + bool enableIpV6(); + IPv6Address localIPv6(); + const char *getHostname(); + bool setHostname(const char *hostname); + bool setMacAddress(const uint8_t *mac); + + inline bool hostname(const String &aHostname) { + return setHostname(aHostname.c_str()); + } + + const String SSID(); + const String psk(); + uint8_t *BSSID(); + String BSSIDstr(); + int32_t channel(); + int8_t RSSI(); + WiFiAuthMode getEncryption(); + + public: /* WiFiScan.cpp */ + int16_t scanNetworks( + bool async = false, + bool showHidden = false, + bool passive = false, + uint32_t maxMsPerChannel = 300, + uint8_t channel = 0 + ); + bool getNetworkInfo( + uint8_t networkItem, + String &ssid, + WiFiAuthMode &encryptionType, + int32_t &RSSI, + uint8_t *&BSSID, + int32_t &channel + ); + + int16_t scanComplete(); + uint8_t scanAlloc(uint8_t count); + void scanInit(); + void scanDelete(); + + String SSID(uint8_t networkItem); + WiFiAuthMode encryptionType(uint8_t networkItem); + int32_t RSSI(uint8_t networkItem); + uint8_t *BSSID(uint8_t networkItem); + String BSSIDstr(uint8_t networkItem); + int32_t channel(uint8_t networkItem); + + public: /* WiFiAP.cpp */ + bool softAP( + const char *ssid, const char *passphrase = NULL, int channel = 1, bool ssidHidden = false, int maxClients = 4 + ); + bool softAPConfig(IPAddress localIP, IPAddress gateway, IPAddress subnet); + bool softAPdisconnect(bool wifiOff = false); + + uint8_t softAPgetStationNum(); + + IPAddress softAPIP(); + IPAddress softAPBroadcastIP(); + IPAddress softAPNetworkID(); + uint8_t softAPSubnetCIDR(); + IPAddress softAPSubnetMask(); + bool softAPenableIpV6(); + IPv6Address softAPIPv6(); + const char *softAPgetHostname(); + bool softAPsetHostname(const char *hostname); + uint8_t *softAPmacAddress(uint8_t *mac); + String softAPmacAddress(void); + const String softAPSSID(void); +}; + +extern WiFiClass WiFi; +extern WiFiClass *pWiFi; diff --git a/cores/common/arduino/libraries/api/WiFi/WiFiAP.cpp b/cores/common/arduino/libraries/api/WiFi/WiFiAP.cpp new file mode 100644 index 000000000..4a26ea50e --- /dev/null +++ b/cores/common/arduino/libraries/api/WiFi/WiFiAP.cpp @@ -0,0 +1,23 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-25. */ + +#include "WiFi.h" + +IPAddress WiFiClass::softAPBroadcastIP() { + return calculateBroadcast(softAPIP(), softAPSubnetMask()); +} + +IPAddress WiFiClass::softAPNetworkID() { + return calculateNetworkID(softAPIP(), softAPSubnetMask()); +} + +uint8_t WiFiClass::softAPSubnetCIDR() { + return calculateSubnetCIDR(softAPSubnetMask()); +} + +__attribute__((weak)) bool WiFiClass::softAPenableIpV6() { + return false; +} + +__attribute__((weak)) IPv6Address WiFiClass::softAPIPv6() { + return IPv6Address(); +} diff --git a/cores/common/arduino/libraries/api/WiFi/WiFiEvents.cpp b/cores/common/arduino/libraries/api/WiFi/WiFiEvents.cpp new file mode 100644 index 000000000..bb93b9936 --- /dev/null +++ b/cores/common/arduino/libraries/api/WiFi/WiFiEvents.cpp @@ -0,0 +1,84 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-05-17. */ + +#include "WiFi.h" + +std::vector WiFiClass::handlers; + +uint16_t WiFiClass::onEvent(EventCb callback, EventId eventId) { + if (!callback) + return 0; + EventHandler handler; + handler.cb = callback; + handler.eventId = eventId; + handlers.push_back(handler); + return handler.id; +} + +uint16_t WiFiClass::onEvent(EventFuncCb callback, EventId eventId) { + if (!callback) + return 0; + EventHandler handler; + handler.fcb = callback; + handler.eventId = eventId; + handlers.push_back(handler); + return handler.id; +} + +uint16_t WiFiClass::onEvent(EventSysCb callback, EventId eventId) { + if (!callback) + return 0; + EventHandler handler; + handler.scb = callback; + handler.eventId = eventId; + handlers.push_back(handler); + return handler.id; +} + +void WiFiClass::removeEvent(EventCb callback, EventId eventId) { + if (!callback) + return; + for (uint16_t i = 0; i < handlers.size(); i++) { + EventHandler handler = handlers[i]; + if (handler.cb == callback && handler.eventId == eventId) { + handlers.erase(handlers.begin() + i); + } + } +} + +void WiFiClass::removeEvent(EventSysCb callback, EventId eventId) { + if (!callback) + return; + for (uint16_t i = 0; i < handlers.size(); i++) { + EventHandler handler = handlers[i]; + if (handler.scb == callback && handler.eventId == eventId) { + handlers.erase(handlers.begin() + i); + } + } +} + +void WiFiClass::removeEvent(uint16_t id) { + for (uint16_t i = 0; i < handlers.size(); i++) { + EventHandler handler = handlers[i]; + if (handler.id == id) { + handlers.erase(handlers.begin() + i); + } + } +} + +void WiFiClass::postEvent(EventId eventId, EventInfo eventInfo) { + for (auto handler : handlers) { + if (handler.eventId != ARDUINO_EVENT_MAX && handler.eventId != eventId) + continue; + if (handler.cb) { + handler.cb(eventId); + } else if (handler.fcb) { + handler.fcb(eventId, eventInfo); + } else if (handler.scb) { + Event_t event = { + .event_id = eventId, + .event_info = eventInfo, + }; + handler.scb(&event); + } + } +} diff --git a/cores/common/arduino/libraries/api/WiFi/WiFiEvents.h b/cores/common/arduino/libraries/api/WiFi/WiFiEvents.h new file mode 100644 index 000000000..c7283609b --- /dev/null +++ b/cores/common/arduino/libraries/api/WiFi/WiFiEvents.h @@ -0,0 +1,173 @@ +/* + * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#pragma once + +#include "WiFiType.h" + +/** Argument structure for WIFI_EVENT_SCAN_DONE event */ +typedef struct { + uint32_t status; /**< status of scanning APs: 0 - success, 1 - failure */ + uint8_t number; /**< number of scan results */ + uint8_t scan_id; /**< scan sequence number, used for block scan */ +} wifi_event_sta_scan_done_t; + +/** Argument structure for WIFI_EVENT_STA_CONNECTED event */ +typedef struct { + uint8_t ssid[32]; /**< SSID of connected AP */ + uint8_t ssid_len; /**< SSID length of connected AP */ + uint8_t bssid[6]; /**< BSSID of connected AP*/ + uint8_t channel; /**< channel of connected AP*/ + wifi_auth_mode_t authmode; /**< authentication mode used by AP*/ +} wifi_event_sta_connected_t; + +/** Argument structure for WIFI_EVENT_STA_DISCONNECTED event */ +typedef struct { + uint8_t ssid[32]; /**< SSID of disconnected AP */ + uint8_t ssid_len; /**< SSID length of disconnected AP */ + uint8_t bssid[6]; /**< BSSID of disconnected AP */ + uint8_t reason; /**< reason of disconnection */ +} wifi_event_sta_disconnected_t; + +/** Argument structure for WIFI_EVENT_STA_AUTHMODE_CHANGE event */ +typedef struct { + wifi_auth_mode_t old_mode; /**< the old auth mode of AP */ + wifi_auth_mode_t new_mode; /**< the new auth mode of AP */ +} wifi_event_sta_authmode_change_t; + +/** Argument structure for WIFI_EVENT_STA_WPS_ER_PIN event */ +typedef struct { + uint8_t pin_code[8]; /**< PIN code of station in enrollee mode */ +} wifi_event_sta_wps_er_pin_t; + +/** Argument structure for WIFI_EVENT_STA_WPS_ER_FAILED event */ +typedef enum { + WPS_FAIL_REASON_NORMAL = 0, /**< ESP32 WPS normal fail reason */ + WPS_FAIL_REASON_RECV_M2D, /**< ESP32 WPS receive M2D frame */ + WPS_FAIL_REASON_MAX +} wifi_event_sta_wps_fail_reason_t; + +#define MAX_SSID_LEN 32 +#define MAX_PASSPHRASE_LEN 64 +#define MAX_WPS_AP_CRED 3 + +/** Argument structure for WIFI_EVENT_STA_WPS_ER_SUCCESS event */ +typedef struct { + uint8_t ap_cred_cnt; /**< Number of AP credentials received */ + + struct { + uint8_t ssid[MAX_SSID_LEN]; /**< SSID of AP */ + uint8_t passphrase[MAX_PASSPHRASE_LEN]; /**< Passphrase for the AP */ + } ap_cred[MAX_WPS_AP_CRED]; /**< All AP credentials received from WPS handshake */ +} wifi_event_sta_wps_er_success_t; + +/** Argument structure for WIFI_EVENT_AP_STACONNECTED event */ +typedef struct { + uint8_t mac[6]; /**< MAC address of the station connected to ESP32 soft-AP */ + uint8_t aid; /**< the aid that ESP32 soft-AP gives to the station connected to */ + bool is_mesh_child; /**< flag to identify mesh child */ +} wifi_event_ap_staconnected_t; + +/** Argument structure for WIFI_EVENT_AP_STADISCONNECTED event */ +typedef struct { + uint8_t mac[6]; /**< MAC address of the station disconnects to ESP32 soft-AP */ + uint8_t aid; /**< the aid that ESP32 soft-AP gave to the station disconnects to */ + bool is_mesh_child; /**< flag to identify mesh child */ +} wifi_event_ap_stadisconnected_t; + +/** Argument structure for WIFI_EVENT_AP_PROBEREQRECVED event */ +typedef struct { + int rssi; /**< Received probe request signal strength */ + uint8_t mac[6]; /**< MAC address of the station which send probe request */ +} wifi_event_ap_probe_req_rx_t; + +/** + * @brief FTM operation status types + * + */ +typedef enum { + FTM_STATUS_SUCCESS = 0, /**< FTM exchange is successful */ + FTM_STATUS_UNSUPPORTED, /**< Peer does not support FTM */ + FTM_STATUS_CONF_REJECTED, /**< Peer rejected FTM configuration in FTM Request */ + FTM_STATUS_NO_RESPONSE, /**< Peer did not respond to FTM Requests */ + FTM_STATUS_FAIL, /**< Unknown error during FTM exchange */ +} wifi_ftm_status_t; + +/** Argument structure for */ +typedef struct { + uint8_t dlog_token; /**< Dialog Token of the FTM frame */ + int8_t rssi; /**< RSSI of the FTM frame received */ + uint32_t rtt; /**< Round Trip Time in pSec with a peer */ + uint64_t t1; /**< Time of departure of FTM frame from FTM Responder in pSec */ + uint64_t t2; /**< Time of arrival of FTM frame at FTM Initiator in pSec */ + uint64_t t3; /**< Time of departure of ACK from FTM Initiator in pSec */ + uint64_t t4; /**< Time of arrival of ACK at FTM Responder in pSec */ +} wifi_ftm_report_entry_t; + +/** Argument structure for WIFI_EVENT_FTM_REPORT event */ +typedef struct { + uint8_t peer_mac[6]; /**< MAC address of the FTM Peer */ + wifi_ftm_status_t status; /**< Status of the FTM operation */ + uint32_t rtt_raw; /**< Raw average Round-Trip-Time with peer in Nano-Seconds */ + uint32_t rtt_est; /**< Estimated Round-Trip-Time with peer in Nano-Seconds */ + uint32_t dist_est; /**< Estimated one-way distance in Centi-Meters */ + wifi_ftm_report_entry_t + *ftm_report_data; /**< Pointer to FTM Report with multiple entries, should be freed after use */ + uint8_t ftm_report_num_entries; /**< Number of entries in the FTM Report data */ +} wifi_event_ftm_report_t; + +#define WIFI_STATIS_BUFFER (1 << 0) +#define WIFI_STATIS_RXTX (1 << 1) +#define WIFI_STATIS_HW (1 << 2) +#define WIFI_STATIS_DIAG (1 << 3) +#define WIFI_STATIS_PS (1 << 4) +#define WIFI_STATIS_ALL (-1) + +/** Argument structure for WIFI_EVENT_ACTION_TX_STATUS event */ +typedef struct { + int ifx; /**< WiFi interface to send request to */ + uint32_t context; /**< Context to identify the request */ + uint8_t da[6]; /**< Destination MAC address */ + uint8_t status; /**< Status of the operation */ +} wifi_event_action_tx_status_t; + +/** Argument structure for WIFI_EVENT_ROC_DONE event */ +typedef struct { + uint32_t context; /**< Context to identify the request */ +} wifi_event_roc_done_t; + +/** Event structure for IP_EVENT_STA_GOT_IP, IP_EVENT_ETH_GOT_IP events */ +typedef struct { + esp_ip4_addr_t ip; /**< Interface IPV4 address */ + esp_ip4_addr_t netmask; /**< Interface IPV4 netmask */ + esp_ip4_addr_t gw; /**< Interface IPV4 gateway address */ +} esp_netif_ip_info_t; + +/** @brief IPV6 IP address information + */ +typedef struct { + esp_ip6_addr_t ip; /**< Interface IPV6 address */ +} esp_netif_ip6_info_t; + +typedef struct { + int if_index; /*!< Interface index for which the event is received (left for legacy compilation) */ + void *esp_netif; /*!< Pointer to corresponding esp-netif object */ + esp_netif_ip_info_t ip_info; /*!< IP address, netmask, gatway IP address */ + bool ip_changed; /*!< Whether the assigned IP has changed or not */ +} ip_event_got_ip_t; + +/** Event structure for IP_EVENT_GOT_IP6 event */ +typedef struct { + int if_index; /*!< Interface index for which the event is received (left for legacy compilation) */ + void *esp_netif; /*!< Pointer to corresponding esp-netif object */ + esp_netif_ip6_info_t ip6_info; /*!< IPv6 address of the interface */ + int ip_index; /*!< IPv6 address index */ +} ip_event_got_ip6_t; + +/** Event structure for IP_EVENT_AP_STAIPASSIGNED event */ +typedef struct { + esp_ip4_addr_t ip; /*!< IP address which was assigned to the station */ +} ip_event_ap_staipassigned_t; diff --git a/cores/common/arduino/libraries/api/WiFi/WiFiGeneric.cpp b/cores/common/arduino/libraries/api/WiFi/WiFiGeneric.cpp new file mode 100644 index 000000000..e3fddb44a --- /dev/null +++ b/cores/common/arduino/libraries/api/WiFi/WiFiGeneric.cpp @@ -0,0 +1,154 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-25. */ + +#include "WiFi.h" + +#if LT_HAS_FREERTOS +#include +#endif + +bool WiFiClass::mode(WiFiMode mode) { + // store a pointer to WiFi for WiFiEvents.cpp + pWiFi = this; + + WiFiMode currentMode = getMode(); + LT_DM(WIFI, "Mode changing %s -> %s", WiFiModeText[currentMode], WiFiModeText[mode]); + if (mode == currentMode) + return true; + + // get mode changes as 0/1 + WiFiModeAction sta = WiFiModeAction((mode & WIFI_MODE_STA) != (currentMode & WIFI_MODE_STA)); + WiFiModeAction ap = WiFiModeAction((mode & WIFI_MODE_AP) != (currentMode & WIFI_MODE_AP)); + // change 0/1 to 1/2 + sta = WiFiModeAction(sta + sta * !!(mode & WIFI_MODE_STA)); + ap = WiFiModeAction(ap + ap * !!(mode & WIFI_MODE_AP)); + // initialize data structures if wifi is enabled + if (mode) + dataInitialize(); + // actually change the mode + LT_HEAP_I(); + if (!modePriv(mode, sta, ap)) + return false; + if (getMode() != mode) { + LT_WM(WIFI, "Mode changed to %d (requested %d)", getMode(), mode); + } + return true; +} + +bool WiFiClass::enableSTA(bool enable) { + WiFiMode currentMode = getMode(); + if (((currentMode & WIFI_MODE_STA) != 0) != enable) { + return mode((WiFiMode)(currentMode ^ WIFI_MODE_STA)); + } + return true; +} + +bool WiFiClass::enableAP(bool enable) { + WiFiMode currentMode = getMode(); + if (((currentMode & WIFI_MODE_AP) != 0) != enable) { + return mode((WiFiMode)(currentMode ^ WIFI_MODE_AP)); + } + return true; +} + +__attribute__((weak)) bool WiFiClass::setSleep(bool enable) { + return false; +} + +__attribute__((weak)) bool WiFiClass::getSleep() { + return false; +} + +__attribute__((weak)) bool WiFiClass::setTxPower(int power) { + return false; +} + +__attribute__((weak)) int WiFiClass::getTxPower() { + return 0; +} + +int WiFiClass::hostByName(const char *hostname, IPAddress &aResult) { + aResult = hostByName(hostname); + return true; +} + +IPAddress WiFiClass::calculateNetworkID(IPAddress ip, IPAddress subnet) { + IPAddress networkID; + + for (size_t i = 0; i < 4; i++) + networkID[i] = subnet[i] & ip[i]; + + return networkID; +} + +IPAddress WiFiClass::calculateBroadcast(IPAddress ip, IPAddress subnet) { + IPAddress broadcastIp; + + for (int i = 0; i < 4; i++) + broadcastIp[i] = ~subnet[i] | ip[i]; + + return broadcastIp; +} + +uint8_t WiFiClass::calculateSubnetCIDR(IPAddress subnetMask) { + uint8_t CIDR = 0; + + for (uint8_t i = 0; i < 4; i++) { + if (subnetMask[i] == 0x80) // 128 + CIDR += 1; + else if (subnetMask[i] == 0xC0) // 192 + CIDR += 2; + else if (subnetMask[i] == 0xE0) // 224 + CIDR += 3; + else if (subnetMask[i] == 0xF0) // 242 + CIDR += 4; + else if (subnetMask[i] == 0xF8) // 248 + CIDR += 5; + else if (subnetMask[i] == 0xFC) // 252 + CIDR += 6; + else if (subnetMask[i] == 0xFE) // 254 + CIDR += 7; + else if (subnetMask[i] == 0xFF) // 255 + CIDR += 8; + } + + return CIDR; +} + +String WiFiClass::macToString(uint8_t *mac) { + char macStr[18]; // 6*2 + 5*':' + '\0' + sprintf(macStr, "%02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); + return macStr; +} + +void WiFiClass::resetNetworkInfo(WiFiNetworkInfo &info) { + LT_VM(WIFI, "Resetting network info: %s", info.ssid); + free(info.ssid); + free(info.password); + free(info.bssid); + // wipe the structure, except IP addresses + memset(&info, 0x00, sizeof(WiFiNetworkInfo) - 5 * sizeof(uint32_t)); +} + +bool WiFiClass::restoreSTAConfig(const WiFiNetworkInfo &info) { + LT_DM(WIFI, "Restoring %s config: %s", "STA", info.ssid); + if (!info.ssid) + return false; + if (info.localIP) { + LT_DM(WIFI, "Restoring STA IP config"); + if (!config(info.localIP, info.gateway, info.subnet, info.dns1, info.dns2)) + return false; + } + return begin(info.ssid, info.password, info.channel, info.bssid); +} + +bool WiFiClass::restoreAPConfig(const WiFiNetworkInfo &info) { + LT_DM(WIFI, "Restoring %s config: %s", "AP", info.ssid); + if (!info.ssid) + return false; + if (info.localIP) { + LT_DM(WIFI, "Restoring AP IP config"); + if (!softAPConfig(info.localIP, info.gateway, info.subnet)) + return false; + } + return softAP(info.ssid, info.password, info.channel, info.ssidHidden); +} diff --git a/cores/common/arduino/libraries/api/WiFi/WiFiSTA.cpp b/cores/common/arduino/libraries/api/WiFi/WiFiSTA.cpp new file mode 100644 index 000000000..684cc6399 --- /dev/null +++ b/cores/common/arduino/libraries/api/WiFi/WiFiSTA.cpp @@ -0,0 +1,48 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-25. */ + +#include "WiFi.h" + +WiFiStatus WiFiClass::begin(char *ssid, char *passphrase, int32_t channel, const uint8_t *bssid, bool connect) { + return begin((const char *)ssid, (const char *)passphrase, channel, bssid, connect); +} + +bool WiFiClass::isConnected() { + return status() == WL_CONNECTED; +} + +WiFiStatus WiFiClass::waitForConnectResult(unsigned long timeout) { + if ((getMode() & WIFI_MODE_STA) == 0) { + return WL_DISCONNECTED; + } + unsigned long start = millis(); + while ((!status() || status() >= WL_DISCONNECTED) && (millis() - start) < timeout) { + delay(100); + } + return status(); +} + +String WiFiClass::macAddress(void) { + uint8_t mac[6]; + macAddress(mac); + return macToString(mac); +} + +IPAddress WiFiClass::networkID() { + return calculateNetworkID(gatewayIP(), subnetMask()); +} + +uint8_t WiFiClass::subnetCIDR() { + return calculateSubnetCIDR(subnetMask()); +} + +String WiFiClass::BSSIDstr() { + return macToString(BSSID()); +} + +__attribute__((weak)) bool WiFiClass::enableIpV6() { + return false; +} + +__attribute__((weak)) IPv6Address WiFiClass::localIPv6() { + return IPv6Address(); +} diff --git a/cores/common/arduino/libraries/api/WiFi/WiFiScan.cpp b/cores/common/arduino/libraries/api/WiFi/WiFiScan.cpp new file mode 100644 index 000000000..20bb83c7c --- /dev/null +++ b/cores/common/arduino/libraries/api/WiFi/WiFiScan.cpp @@ -0,0 +1,93 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-25. */ + +#include "WiFi.h" + +bool WiFiClass::getNetworkInfo( + uint8_t networkItem, String &ssid, WiFiAuthMode &encType, int32_t &rssi, uint8_t *&bssid, int32_t &channel +) { + ssid = SSID(networkItem); + encType = encryptionType(networkItem); + rssi = RSSI(networkItem); + bssid = BSSID(networkItem); + channel = this->channel(networkItem); + return true; +} + +int16_t WiFiClass::scanComplete() { + if (!scan) + return 0; + if (scan->running) + return WIFI_SCAN_RUNNING; + return scan->count; +} + +void WiFiClass::scanInit() { + if (scan) + return; + scan = (WiFiScanData *)calloc(1, sizeof(WiFiScanData)); +} + +void WiFiClass::scanDelete() { + if (!scan) + return; + for (uint8_t i = 0; i < scan->count; i++) { + free(scan->ap[i].ssid); + } + free(scan->ap); + free(scan); + scan = NULL; +} + +uint8_t WiFiClass::scanAlloc(uint8_t count) { + if ((!scan->ap) || (count > scan->count)) { + auto newMem = (WiFiScanAP *)realloc(scan->ap, count * sizeof(WiFiScanAP)); + if (!newMem) { + return scan->count; + } + scan->ap = newMem; + } + if (!scan->ap) { + scan->count = 0; + return 0; + } + if (count > scan->count) { + // clear only new entries + memset(scan->ap + scan->count, 0, sizeof(WiFiScanAP) * (count - scan->count)); + } + scan->count = count; + return count; +} + +String WiFiClass::SSID(uint8_t networkItem) { + if (!scan || networkItem >= scan->count) + return ""; + return scan->ap[networkItem].ssid; +} + +WiFiAuthMode WiFiClass::encryptionType(uint8_t networkItem) { + if (!scan || networkItem >= scan->count) + return WIFI_AUTH_INVALID; + return scan->ap[networkItem].auth; +} + +int32_t WiFiClass::RSSI(uint8_t networkItem) { + if (!scan || networkItem >= scan->count) + return 0; + return scan->ap[networkItem].rssi; +} + +uint8_t *WiFiClass::BSSID(uint8_t networkItem) { + if (!scan || networkItem >= scan->count) + return NULL; + return scan->ap[networkItem].bssid.addr; +} + +String WiFiClass::BSSIDstr(uint8_t networkItem) { + return macToString(BSSID(networkItem)); +} + +int32_t WiFiClass::channel(uint8_t networkItem) { + if (!scan || networkItem >= scan->count) + return 0; + return scan->ap[networkItem].channel; +} diff --git a/cores/common/arduino/libraries/api/WiFi/WiFiType.h b/cores/common/arduino/libraries/api/WiFi/WiFiType.h new file mode 100644 index 000000000..3d5942a50 --- /dev/null +++ b/cores/common/arduino/libraries/api/WiFi/WiFiType.h @@ -0,0 +1,189 @@ +/* + ESP8266WiFiType.h - esp8266 Wifi support. + Copyright (c) 2011-2014 Arduino. All right reserved. + Modified by Ivan Grokhotkov, December 2014 + Reworked by Markus Sattler, December 2015 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#pragma once + +#include + +#define WIFI_SCAN_RUNNING (-1) +#define WIFI_SCAN_FAILED (-2) + +#define WiFiMode_t wifi_mode_t +#define WiFiMode wifi_mode_t +#define WiFiStatus wl_status_t +#define WiFiAuthMode wifi_auth_mode_t + +#define WIFI_OFF WIFI_MODE_NULL +#define WIFI_STA WIFI_MODE_STA +#define WIFI_AP WIFI_MODE_AP +#define WIFI_AP_STA WIFI_MODE_APSTA + +#define WiFiEvent_t arduino_event_id_t +#define WiFiEventInfo_t arduino_event_info_t +#define WiFiEventId_t uint16_t + +typedef struct { + uint8_t addr[6]; +} WiFiMacAddr; + +struct esp_ip6_addr { + uint32_t addr[4]; + uint8_t zone; +}; + +struct esp_ip4_addr { + uint32_t addr; +}; + +typedef struct esp_ip4_addr esp_ip4_addr_t; +typedef struct esp_ip6_addr esp_ip6_addr_t; + +typedef enum { + WIFI_MODE_NULL = 0, /**< null mode */ + WIFI_MODE_STA, /**< WiFi station mode */ + WIFI_MODE_AP, /**< WiFi soft-AP mode */ + WIFI_MODE_APSTA, /**< WiFi station + soft-AP mode */ + WIFI_MODE_MAX +} wifi_mode_t; + +typedef enum { + WL_NO_SHIELD = 255, // for compatibility with WiFi Shield library + WL_IDLE_STATUS = 0, + WL_NO_SSID_AVAIL = 1, + WL_SCAN_COMPLETED = 2, + WL_CONNECTED = 3, + WL_CONNECT_FAILED = 4, + WL_CONNECTION_LOST = 5, + WL_DISCONNECTED = 6, +} wl_status_t; + +typedef enum { + WIFI_AUTH_OPEN = 0, /**< authenticate mode : open */ + WIFI_AUTH_WEP, /**< authenticate mode : WEP */ + WIFI_AUTH_WPA_PSK, /**< authenticate mode : WPA_PSK */ + WIFI_AUTH_WPA2_PSK, /**< authenticate mode : WPA2_PSK */ + WIFI_AUTH_WPA_WPA2_PSK, /**< authenticate mode : WPA_WPA2_PSK */ + WIFI_AUTH_WPA2_ENTERPRISE, /**< authenticate mode : WPA2_ENTERPRISE */ + WIFI_AUTH_WPA3_PSK, /**< authenticate mode : WPA3_PSK */ + WIFI_AUTH_WPA2_WPA3_PSK, /**< authenticate mode : WPA2_WPA3_PSK */ + WIFI_AUTH_WAPI_PSK, /**< authenticate mode : WAPI_PSK */ + WIFI_AUTH_WPA, + WIFI_AUTH_WPA2, + WIFI_AUTH_AUTO = 200, + WIFI_AUTH_INVALID = 255, + WIFI_AUTH_MAX +} wifi_auth_mode_t; + +typedef enum { + WIFI_REASON_UNSPECIFIED = 1, + WIFI_REASON_AUTH_EXPIRE = 2, + WIFI_REASON_AUTH_LEAVE = 3, + WIFI_REASON_ASSOC_EXPIRE = 4, + WIFI_REASON_ASSOC_TOOMANY = 5, + WIFI_REASON_NOT_AUTHED = 6, + WIFI_REASON_NOT_ASSOCED = 7, + WIFI_REASON_ASSOC_LEAVE = 8, + WIFI_REASON_ASSOC_NOT_AUTHED = 9, + WIFI_REASON_DISASSOC_PWRCAP_BAD = 10, + WIFI_REASON_DISASSOC_SUPCHAN_BAD = 11, + WIFI_REASON_BSS_TRANSITION_DISASSOC = 12, + WIFI_REASON_IE_INVALID = 13, + WIFI_REASON_MIC_FAILURE = 14, + WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT = 15, + WIFI_REASON_GROUP_KEY_UPDATE_TIMEOUT = 16, + WIFI_REASON_IE_IN_4WAY_DIFFERS = 17, + WIFI_REASON_GROUP_CIPHER_INVALID = 18, + WIFI_REASON_PAIRWISE_CIPHER_INVALID = 19, + WIFI_REASON_AKMP_INVALID = 20, + WIFI_REASON_UNSUPP_RSN_IE_VERSION = 21, + WIFI_REASON_INVALID_RSN_IE_CAP = 22, + WIFI_REASON_802_1X_AUTH_FAILED = 23, + WIFI_REASON_CIPHER_SUITE_REJECTED = 24, + WIFI_REASON_INVALID_PMKID = 53, + WIFI_REASON_BEACON_TIMEOUT = 200, + WIFI_REASON_NO_AP_FOUND = 201, + WIFI_REASON_AUTH_FAIL = 202, + WIFI_REASON_ASSOC_FAIL = 203, + WIFI_REASON_HANDSHAKE_TIMEOUT = 204, + WIFI_REASON_CONNECTION_FAIL = 205, + WIFI_REASON_AP_TSF_RESET = 206, + WIFI_REASON_ROAMING = 207, +} wifi_err_reason_t; + +typedef struct { + char *ssid; + char *password; + uint8_t *bssid; + bool ssidHidden; + int channel; + int auth; + uint32_t localIP; + uint32_t subnet; + uint32_t gateway; + uint32_t dns1; + uint32_t dns2; +} WiFiNetworkInfo; + +typedef struct { + char *ssid; + WiFiAuthMode auth; + int32_t rssi; + WiFiMacAddr bssid; + int32_t channel; +} WiFiScanAP; + +typedef struct { + bool running = false; + unsigned long timeout = 0; + uint8_t count = 0; + WiFiScanAP *ap = NULL; +} WiFiScanData; + +typedef enum { + WLMODE_NONE = 0, + WLMODE_DISABLE = 1, + WLMODE_ENABLE = 2, +} WiFiModeAction; + +static const char *WiFiModeText[] = {"NULL", "STA", "AP", "AP+STA"}; +static const char *WiFiStatusText[] = { + "Idle", + "No SSID", + "Scan Completed", + "Connected", + "Connect failed", + "Connection lost", + "Disconnected", +}; +static const char *WiFiAuthModeText[] = { + "Open", + "WEP", + "WPA PSK", + "WPA2 PSK", + "WPA/WPA2 PSK", + "WPA2 EAP", + "WPA3 PSK", + "WPA2/WPA3 PSK", + "WAPI PSK", + "WPA", + "WPA2", + "Auto", +}; diff --git a/cores/common/arduino/libraries/common/FS/FS.cpp b/cores/common/arduino/libraries/common/FS/FS.cpp new file mode 100644 index 000000000..28cdfad2c --- /dev/null +++ b/cores/common/arduino/libraries/common/FS/FS.cpp @@ -0,0 +1,228 @@ +/* + FS.cpp - file system wrapper + Copyright (c) 2015 Ivan Grokhotkov. All rights reserved. + This file is part of the esp8266 core for Arduino environment. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "FS.h" + +using namespace fs; + +size_t File::write(uint8_t c) { + if (!*this) { + return 0; + } + return _p->write(&c, 1); +} + +time_t File::getLastWrite() { + if (!*this) { + return 0; + } + return _p->getLastWrite(); +} + +size_t File::write(const uint8_t *buf, size_t size) { + if (!*this) { + return 0; + } + return _p->write(buf, size); +} + +int File::available() { + if (!*this) { + return false; + } + return _p->size() - _p->position(); +} + +int File::read() { + if (!*this) { + return -1; + } + uint8_t result; + if (_p->read(&result, 1) != 1) { + return -1; + } + return result; +} + +size_t File::read(uint8_t *buf, size_t size) { + if (!*this) { + return -1; + } + return _p->read(buf, size); +} + +int File::peek() { + if (!*this) { + return -1; + } + size_t curPos = _p->position(); + int result = read(); + seek(curPos, SeekSet); + return result; +} + +void File::flush() { + if (!*this) { + return; + } + _p->flush(); +} + +bool File::seek(uint32_t pos, SeekMode mode) { + if (!*this) { + return false; + } + return _p->seek(pos, mode); +} + +size_t File::position() const { + if (!*this) { + return 0; + } + return _p->position(); +} + +size_t File::size() const { + if (!*this) { + return 0; + } + return _p->size(); +} + +bool File::setBufferSize(size_t size) { + if (!*this) { + return 0; + } + return _p->setBufferSize(size); +} + +void File::close() { + if (_p) { + _p->close(); + _p = nullptr; + } +} + +File::operator bool() const { + return _p != nullptr && *_p != false; +} + +const char *File::path() const { + if (!*this) { + return nullptr; + } + return _p->path(); +} + +const char *File::name() const { + if (!*this) { + return nullptr; + } + return _p->name(); +} + +// to implement +boolean File::isDirectory(void) { + if (!*this) { + return false; + } + return _p->isDirectory(); +} + +File File::openNextFile(const char *mode) { + if (!*this) { + return File(); + } + return _p->openNextFile(mode); +} + +void File::rewindDirectory(void) { + if (!*this) { + return; + } + _p->rewindDirectory(); +} + +File FS::open(const String &path, const char *mode, const bool create) { + return open(path.c_str(), mode, create); +} + +File FS::open(const char *path, const char *mode, const bool create) { + if (!_impl) { + return File(); + } + + return File(_impl->open(path, mode, create)); +} + +bool FS::exists(const char *path) { + if (!_impl) { + return false; + } + return _impl->exists(path); +} + +bool FS::exists(const String &path) { + return exists(path.c_str()); +} + +bool FS::remove(const char *path) { + if (!_impl) { + return false; + } + return _impl->remove(path); +} + +bool FS::remove(const String &path) { + return remove(path.c_str()); +} + +bool FS::rename(const char *pathFrom, const char *pathTo) { + if (!_impl) { + return false; + } + return _impl->rename(pathFrom, pathTo); +} + +bool FS::rename(const String &pathFrom, const String &pathTo) { + return rename(pathFrom.c_str(), pathTo.c_str()); +} + +bool FS::mkdir(const char *path) { + if (!_impl) { + return false; + } + return _impl->mkdir(path); +} + +bool FS::mkdir(const String &path) { + return mkdir(path.c_str()); +} + +bool FS::rmdir(const char *path) { + if (!_impl) { + return false; + } + return _impl->rmdir(path); +} + +bool FS::rmdir(const String &path) { + return rmdir(path.c_str()); +} diff --git a/cores/common/arduino/libraries/common/FS/FS.h b/cores/common/arduino/libraries/common/FS/FS.h new file mode 100644 index 000000000..58ae87d96 --- /dev/null +++ b/cores/common/arduino/libraries/common/FS/FS.h @@ -0,0 +1,152 @@ +/* + FS.h - file system wrapper + Copyright (c) 2015 Ivan Grokhotkov. All rights reserved. + This file is part of the esp8266 core for Arduino environment. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#pragma once + +#include +#include + +namespace fs { + +#define FILE_READ "r" +#define FILE_WRITE "w" +#define FILE_APPEND "a" + +class File; + +class FileImpl; +typedef std::shared_ptr FileImplPtr; +class FSImpl; +typedef std::shared_ptr FSImplPtr; + +enum SeekMode { SeekSet = 0, SeekCur = 1, SeekEnd = 2 }; + +class File : public Stream { + public: + File(FileImplPtr p = FileImplPtr()) : _p(p) { + _timeout = 0; + } + + size_t write(uint8_t) override; + size_t write(const uint8_t *buf, size_t size) override; + int available() override; + int read() override; + int peek() override; + void flush() override; + size_t read(uint8_t *buf, size_t size); + + size_t readBytes(char *buffer, size_t length) { + return read((uint8_t *)buffer, length); + } + + bool seek(uint32_t pos, SeekMode mode); + + bool seek(uint32_t pos) { + return seek(pos, SeekSet); + } + + size_t position() const; + size_t size() const; + bool setBufferSize(size_t size); + void close(); + operator bool() const; + time_t getLastWrite(); + const char *path() const; + const char *name() const; + + boolean isDirectory(void); + File openNextFile(const char *mode = FILE_READ); + void rewindDirectory(void); + + protected: + FileImplPtr _p; +}; + +class FileImpl { + public: + virtual ~FileImpl() {} + + virtual size_t write(const uint8_t *buf, size_t size) = 0; + virtual size_t read(uint8_t *buf, size_t size) = 0; + virtual void flush() = 0; + virtual bool seek(uint32_t pos, SeekMode mode) = 0; + virtual size_t position() const = 0; + virtual size_t size() const = 0; + virtual bool setBufferSize(size_t size) = 0; + virtual void close() = 0; + virtual time_t getLastWrite() = 0; + virtual const char *path() const = 0; + virtual const char *name() const = 0; + virtual boolean isDirectory(void) = 0; + virtual FileImplPtr openNextFile(const char *mode) = 0; + virtual void rewindDirectory(void) = 0; + virtual operator bool() = 0; +}; + +class FS { + public: + FS(FSImplPtr impl) : _impl(impl) {} + + File open(const char *path, const char *mode = FILE_READ, const bool create = false); + File open(const String &path, const char *mode = FILE_READ, const bool create = false); + + bool exists(const char *path); + bool exists(const String &path); + + bool remove(const char *path); + bool remove(const String &path); + + bool rename(const char *pathFrom, const char *pathTo); + bool rename(const String &pathFrom, const String &pathTo); + + bool mkdir(const char *path); + bool mkdir(const String &path); + + bool rmdir(const char *path); + bool rmdir(const String &path); + + protected: + FSImplPtr _impl; +}; + +class FSImpl { + public: + FSImpl() {} + + virtual ~FSImpl() {} + + virtual FileImplPtr open(const char *path, const char *mode, const bool create) = 0; + virtual bool exists(const char *path) = 0; + virtual bool rename(const char *pathFrom, const char *pathTo) = 0; + virtual bool remove(const char *path) = 0; + virtual bool mkdir(const char *path) = 0; + virtual bool rmdir(const char *path) = 0; +}; + +} // namespace fs + +#ifndef FS_NO_GLOBALS +using fs::File; +using fs::FS; +using fs::SeekCur; +using fs::SeekEnd; +using fs::SeekMode; +using fs::SeekSet; +#endif // FS_NO_GLOBALS diff --git a/cores/common/arduino/libraries/common/IPv6Address/IPv6Address.cpp b/cores/common/arduino/libraries/common/IPv6Address/IPv6Address.cpp new file mode 100644 index 000000000..454dcb17c --- /dev/null +++ b/cores/common/arduino/libraries/common/IPv6Address/IPv6Address.cpp @@ -0,0 +1,99 @@ +/* + IPv6Address.cpp - Base class that provides IPv6Address + Copyright (c) 2011 Adrian McEwen. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "IPv6Address.h" + +#include +#include + +IPv6Address::IPv6Address() { + memset(_address.bytes, 0, sizeof(_address.bytes)); +} + +IPv6Address::IPv6Address(const uint8_t *address) { + memcpy(_address.bytes, address, sizeof(_address.bytes)); +} + +IPv6Address::IPv6Address(const uint32_t *address) { + memcpy(_address.bytes, (const uint8_t *)address, sizeof(_address.bytes)); +} + +IPv6Address &IPv6Address::operator=(const uint8_t *address) { + memcpy(_address.bytes, address, sizeof(_address.bytes)); + return *this; +} + +bool IPv6Address::operator==(const uint8_t *addr) const { + return memcmp(addr, _address.bytes, sizeof(_address.bytes)) == 0; +} + +size_t IPv6Address::printTo(Print &p) const { + /* size_t n = 0; + for(int i = 0; i < 16; i+=2) { + if(i){ + n += p.print(':'); + } + n += p.printf("%02x", _address.bytes[i]); + n += p.printf("%02x", _address.bytes[i+1]); + + } + return n; */ + return 0; +} + +String IPv6Address::toString() const { + char szRet[40]; + sprintf( + szRet, + "%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x", + _address.bytes[0], + _address.bytes[1], + _address.bytes[2], + _address.bytes[3], + _address.bytes[4], + _address.bytes[5], + _address.bytes[6], + _address.bytes[7], + _address.bytes[8], + _address.bytes[9], + _address.bytes[10], + _address.bytes[11], + _address.bytes[12], + _address.bytes[13], + _address.bytes[14], + _address.bytes[15] + ); + return String(szRet); +} + +bool IPv6Address::fromString(const char *address) { + // format 0011:2233:4455:6677:8899:aabb:ccdd:eeff + if (strlen(address) != 39) { + return false; + } + char *pos = (char *)address; + size_t i = 0; + for (i = 0; i < 16; i += 2) { + if (!sscanf(pos, "%2hhx", &_address.bytes[i]) || !sscanf(pos + 2, "%2hhx", &_address.bytes[i + 1])) { + return false; + } + pos += 5; + } + return true; +} diff --git a/cores/common/arduino/libraries/common/IPv6Address/IPv6Address.h b/cores/common/arduino/libraries/common/IPv6Address/IPv6Address.h new file mode 100644 index 000000000..6d5c40068 --- /dev/null +++ b/cores/common/arduino/libraries/common/IPv6Address/IPv6Address.h @@ -0,0 +1,97 @@ +/* + IPv6Address.h - Base class that provides IPv6Address + Copyright (c) 2011 Adrian McEwen. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#pragma once + +#include +#include +#include + +// A class to make it easier to handle and pass around IP addresses + +namespace arduino { + +class IPv6Address : public Printable { + private: + union { + uint8_t bytes[16]; // IPv4 address + uint32_t dword[4]; + } _address; + + // Access the raw byte array containing the address. Because this returns a pointer + // to the internal structure rather than a copy of the address this function should only + // be used when you know that the usage of the returned uint8_t* will be transient and not + // stored. + uint8_t *raw_address() { + return _address.bytes; + } + + public: + // Constructors + IPv6Address(); + IPv6Address(const uint8_t *address); + IPv6Address(const uint32_t *address); + + virtual ~IPv6Address() {} + + bool fromString(const char *address); + + bool fromString(const String &address) { + return fromString(address.c_str()); + } + + operator const uint8_t *() const { + return _address.bytes; + } + + operator const uint32_t *() const { + return _address.dword; + } + + bool operator==(const IPv6Address &addr) const { + return (_address.dword[0] == addr._address.dword[0]) && (_address.dword[1] == addr._address.dword[1]) && + (_address.dword[2] == addr._address.dword[2]) && (_address.dword[3] == addr._address.dword[3]); + } + + bool operator==(const uint8_t *addr) const; + + // Overloaded index operator to allow getting and setting individual octets of the address + uint8_t operator[](int index) const { + return _address.bytes[index]; + } + + uint8_t &operator[](int index) { + return _address.bytes[index]; + } + + // Overloaded copy operators to allow initialisation of IPv6Address objects from other types + IPv6Address &operator=(const uint8_t *address); + + // TODO implement printTo() + virtual size_t printTo(Print &p) const; + String toString() const; + + friend class UDP; + friend class Client; + friend class Server; +}; + +} // namespace arduino + +using arduino::IPv6Address; diff --git a/cores/common/arduino/libraries/common/IPv6Address/api/IPv6Address.h b/cores/common/arduino/libraries/common/IPv6Address/api/IPv6Address.h new file mode 100644 index 000000000..d41722f44 --- /dev/null +++ b/cores/common/arduino/libraries/common/IPv6Address/api/IPv6Address.h @@ -0,0 +1,5 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-30. */ + +#pragma once + +#include "../IPv6Address.h" diff --git a/cores/common/arduino/libraries/common/MD5/MD5.h b/cores/common/arduino/libraries/common/MD5/MD5.h new file mode 100644 index 000000000..75805d693 --- /dev/null +++ b/cores/common/arduino/libraries/common/MD5/MD5.h @@ -0,0 +1,33 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-03. */ + +#pragma once + +#include + +// available built-in implementations +#if LT_ARD_MD5_MBEDTLS +#include "MD5MbedTLSImpl.h" +#endif +#if LT_ARD_MD5_HOSTAPD +#include "MD5HostapdImpl.h" +#endif + +// common API +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +#ifndef LT_MD5_CTX_T +#define LT_MD5_CTX_T void +#endif + +// for compatibility with ESP8266 +typedef LT_MD5_CTX_T md5_context_t; + +void MD5Init(LT_MD5_CTX_T *context); +void MD5Update(LT_MD5_CTX_T *context, const unsigned char *buf, unsigned len); +void MD5Final(unsigned char digest[16], LT_MD5_CTX_T *context); + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/cores/common/arduino/libraries/common/MD5/MD5HostapdImpl.h b/cores/common/arduino/libraries/common/MD5/MD5HostapdImpl.h new file mode 100644 index 000000000..5bc092ba6 --- /dev/null +++ b/cores/common/arduino/libraries/common/MD5/MD5HostapdImpl.h @@ -0,0 +1,19 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-07-12. */ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +struct MD5Context { + unsigned long buf[4]; + unsigned long bits[2]; + unsigned char in[64]; +}; + +#define LT_MD5_CTX_T struct MD5Context + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/cores/common/arduino/libraries/common/MD5/MD5MbedTLSImpl.cpp b/cores/common/arduino/libraries/common/MD5/MD5MbedTLSImpl.cpp new file mode 100644 index 000000000..89972824d --- /dev/null +++ b/cores/common/arduino/libraries/common/MD5/MD5MbedTLSImpl.cpp @@ -0,0 +1,24 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-07-11. */ + +#if LT_ARD_MD5_MBEDTLS + +extern "C" { + +#include + +void MD5Init(mbedtls_md5_context *context) { + mbedtls_md5_init(context); + mbedtls_md5_starts(context); +} + +void MD5Update(mbedtls_md5_context *context, const unsigned char *buf, unsigned len) { + mbedtls_md5_update(context, buf, len); +} + +void MD5Final(unsigned char digest[16], mbedtls_md5_context *context) { + mbedtls_md5_finish(context, digest); +} + +} // extern "C" + +#endif // LT_ARD_MD5_MBEDTLS diff --git a/cores/common/arduino/libraries/common/MD5/MD5MbedTLSImpl.h b/cores/common/arduino/libraries/common/MD5/MD5MbedTLSImpl.h new file mode 100644 index 000000000..76369c835 --- /dev/null +++ b/cores/common/arduino/libraries/common/MD5/MD5MbedTLSImpl.h @@ -0,0 +1,19 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-07-11. */ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct { + unsigned long total[2]; /*!< number of bytes processed */ + unsigned long state[4]; /*!< intermediate digest state */ + unsigned char buffer[64]; /*!< data block being processed */ +} mbedtls_md5_context; + +#define LT_MD5_CTX_T mbedtls_md5_context + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/cores/common/arduino/libraries/common/Preferences/Preferences.h b/cores/common/arduino/libraries/common/Preferences/Preferences.h new file mode 100644 index 000000000..0a7404af5 --- /dev/null +++ b/cores/common/arduino/libraries/common/Preferences/Preferences.h @@ -0,0 +1,85 @@ +// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#pragma once + +#include +#include +#include + +#include + +typedef enum { + PT_I8, + PT_U8, + PT_I16, + PT_U16, + PT_I32, + PT_U32, + PT_I64, + PT_U64, + PT_STR, + PT_BLOB, + PT_INVALID, +} PreferenceType; + +class IPreferences { + public: + IPreferences() {} + + ~IPreferences() {} + + bool begin(const char *name, bool readOnly = false, const char *partition_label = NULL); + void end(); + + bool clear(); + bool remove(const char *key); + + size_t putChar(const char *key, int8_t value); + size_t putUChar(const char *key, uint8_t value); + size_t putShort(const char *key, int16_t value); + size_t putUShort(const char *key, uint16_t value); + size_t putInt(const char *key, int32_t value); + size_t putUInt(const char *key, uint32_t value); + size_t putLong(const char *key, int32_t value); + size_t putULong(const char *key, uint32_t value); + size_t putLong64(const char *key, int64_t value); + size_t putULong64(const char *key, uint64_t value); + size_t putFloat(const char *key, float_t value); + size_t putDouble(const char *key, double_t value); + size_t putBool(const char *key, bool value); + size_t putString(const char *key, const char *value); + size_t putString(const char *key, String value); + size_t putBytes(const char *key, const void *value, size_t len); + + bool isKey(const char *key); + PreferenceType getType(const char *key); + int8_t getChar(const char *key, int8_t defaultValue = 0); + uint8_t getUChar(const char *key, uint8_t defaultValue = 0); + int16_t getShort(const char *key, int16_t defaultValue = 0); + uint16_t getUShort(const char *key, uint16_t defaultValue = 0); + int32_t getInt(const char *key, int32_t defaultValue = 0); + uint32_t getUInt(const char *key, uint32_t defaultValue = 0); + int32_t getLong(const char *key, int32_t defaultValue = 0); + uint32_t getULong(const char *key, uint32_t defaultValue = 0); + int64_t getLong64(const char *key, int64_t defaultValue = 0); + uint64_t getULong64(const char *key, uint64_t defaultValue = 0); + float_t getFloat(const char *key, float_t defaultValue = NAN); + double_t getDouble(const char *key, double_t defaultValue = NAN); + bool getBool(const char *key, bool defaultValue = false); + size_t getString(const char *key, char *value, size_t maxLen); + String getString(const char *key, String defaultValue = String()); + size_t getBytesLength(const char *key); + size_t getBytes(const char *key, void *buf, size_t maxLen); + size_t freeEntries(); +}; diff --git a/cores/common/arduino/libraries/common/Update/Update.cpp b/cores/common/arduino/libraries/common/Update/Update.cpp new file mode 100644 index 000000000..9c053909c --- /dev/null +++ b/cores/common/arduino/libraries/common/Update/Update.cpp @@ -0,0 +1,210 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-05-29. */ + +#include "Update.h" + +static const UpdateError errorMap[] = { + UPDATE_ERROR_OK, /* UF2_ERR_OK - no error */ + UPDATE_ERROR_OK, /* UF2_ERR_IGNORE - block should be ignored */ + UPDATE_ERROR_MAGIC_BYTE, /* UF2_ERR_MAGIC - wrong magic numbers */ + UPDATE_ERROR_BAD_ARGUMENT, /* UF2_ERR_FAMILY - family ID mismatched */ + UPDATE_ERROR_BAD_ARGUMENT, /* UF2_ERR_NOT_HEADER - block is not a header */ + UPDATE_ERROR_BAD_ARGUMENT, /* UF2_ERR_OTA_VER - unknown/invalid OTA format version */ + UPDATE_ERROR_MAGIC_BYTE, /* UF2_ERR_OTA_WRONG - no data for current OTA scheme */ + UPDATE_ERROR_NO_PARTITION, /* UF2_ERR_PART_404 - no partition with that name */ + UPDATE_ERROR_BAD_ARGUMENT, /* UF2_ERR_PART_INVALID - invalid partition info tag */ + UPDATE_ERROR_BAD_ARGUMENT, /* UF2_ERR_PART_UNSET - attempted to write without target partition */ + UPDATE_ERROR_BAD_ARGUMENT, /* UF2_ERR_DATA_TOO_LONG - data too long - tags won't fit */ + UPDATE_ERROR_BAD_ARGUMENT, /* UF2_ERR_SEQ_MISMATCH - sequence number mismatched */ + UPDATE_ERROR_ERASE, /* UF2_ERR_ERASE_FAILED - erasing flash failed */ + UPDATE_ERROR_WRITE, /* UF2_ERR_WRITE_FAILED - writing to flash failed */ + UPDATE_ERROR_WRITE, /* UF2_ERR_WRITE_LENGTH - wrote fewer data than requested */ + UPDATE_ERROR_WRITE, /* UF2_ERR_WRITE_PROTECT - target area is write-protected */ + UPDATE_ERROR_WRITE, /* UF2_ERR_ALLOC_FAILED - dynamic memory allocation failed */ +}; + +/** + * @brief Initialize the update process. + * + * @param size total UF2 file size + * @param command must be U_FLASH + * @return false if parameters are invalid or update is running, true otherwise + */ +bool UpdateClass::begin( + size_t size, + int command, + __attribute__((unused)) int ledPin, + __attribute__((unused)) uint8_t ledOn, + __attribute__((unused)) const char *label +) { +#if !LT_HAS_OTA + LT_E("OTA is not yet supported on this chip!"); + this->errArd = UPDATE_ERROR_BAD_ARGUMENT; + return false; +#endif + if (this->ctx) { + return false; + } + this->clearError(); + if (size == 0) { + this->errArd = UPDATE_ERROR_SIZE; + return false; + } + if (command != U_FLASH) { + this->errArd = UPDATE_ERROR_BAD_ARGUMENT; + return false; + } + if (size == UPDATE_SIZE_UNKNOWN) { + size = 0; + } + + this->ctx = static_cast(malloc(sizeof(lt_ota_ctx_t))); + lt_ota_begin(this->ctx, size); + this->ctx->callback = reinterpret_cast(progressHandler); + this->ctx->callback_param = this; + + this->md5Ctx = static_cast(malloc(sizeof(LT_MD5_CTX_T))); + MD5Init(this->md5Ctx); + + return true; +} + +/** + * @brief Finalize the update process. Check for errors and update completion, then activate the new firmware image. + * + * @param evenIfRemaining don't raise errors if still in progress + * @return false in case of errors or no update running; true otherwise + */ +bool UpdateClass::end(bool evenIfRemaining) { + if (!this->ctx) + return false; + + // update is running or finished; cleanup and end it + if (!isFinished() && !evenIfRemaining) + // abort if not finished + this->errArd = UPDATE_ERROR_ABORT; + + if (!this->md5Digest) + this->md5Digest = static_cast(malloc(16)); + MD5Final(this->md5Digest, this->md5Ctx); + + this->cleanup(/* clearError= */ evenIfRemaining); + return !this->hasError(); +} + +/** + * @brief Cleanup (free) the update context. + * Try activating the firmware if possible, set local error codes. + * + * @param clearError assume successful finish after correct activation + */ +void UpdateClass::cleanup(bool clearError) { + if (!this->ctx) + return; + + if (!lt_ota_end(this->ctx)) { + // activating firmware failed + this->errArd = UPDATE_ERROR_ACTIVATE; + this->errUf2 = UF2_ERR_OK; + } else if (this->md5Digest && this->md5Expected && memcmp(this->md5Digest, this->md5Expected, 16) != 0) { + // MD5 doesn't match + this->errArd = UPDATE_ERROR_MD5; + this->errUf2 = UF2_ERR_OK; + } else if (clearError) { + // successful finish and activation, clear error codes + this->clearError(); + } else if (this->ctx->error > UF2_ERR_IGNORE) { + // make error code based on UF2OTA code + this->errArd = errorMap[this->ctx->error]; + this->errUf2 = this->ctx->error; + } else { + // only keep Arduino error code (set by the caller) + this->errUf2 = UF2_ERR_OK; + } + +#if LT_DEBUG_OTA + if (this->hasError()) + this->printErrorContext(); +#endif + + free(this->ctx); + this->ctx = nullptr; + free(this->md5Ctx); + this->md5Ctx = nullptr; + free(this->md5Digest); + this->md5Digest = nullptr; + free(this->md5Expected); + this->md5Expected = nullptr; +} + +/** + * @brief Write a chunk of data to the buffer or flash memory. + * + * It's advised to write in 512-byte chunks (or its multiples). + * + * @param data chunk of data + * @param len length of the chunk + * @return size_t amount of bytes written + */ +size_t UpdateClass::write(const uint8_t *data, size_t len) { + if (!this->ctx) + return 0; + + MD5Update(this->md5Ctx, data, len); + size_t written = lt_ota_write(ctx, data, len); + if (written != len) + this->cleanup(/* clearError= */ false); + return written; +} + +/** + * @brief Write all data remaining in the given stream. + * + * If the stream doesn't produce any data within UPDATE_TIMEOUT_MS, + * the update process will be aborted. + * + * @param data stream to read from + * @return size_t amount of bytes written + */ +size_t UpdateClass::writeStream(Stream &data) { + if (!this->ctx) + return 0; + + size_t written = 0; + uint32_t lastData = millis(); + // loop until the update is complete + while (remaining()) { + // check stream availability + auto available = data.available(); + if (available <= 0) { + if (millis() - lastData > UPDATE_TIMEOUT_MS) { + // waited for data too long; abort with error + this->errArd = UPDATE_ERROR_STREAM; + this->cleanup(/* clearError= */ false); + return written; + } + continue; + } + // available > 0 + lastData = millis(); + + // read data to fit in the remaining buffer space + auto bufSize = this->ctx->buf_pos - this->ctx->buf; + auto read = data.readBytes(this->ctx->buf_pos, UF2_BLOCK_SIZE - bufSize); + // update MD5 + MD5Update(this->md5Ctx, this->ctx->buf_pos, read); + // increment buffer writing head + this->ctx->buf_pos += read; + // process the block if complete + if (bufSize + read == UF2_BLOCK_SIZE) + lt_ota_write_block(this->ctx, reinterpret_cast(this->ctx->buf)); + // abort on errors + if (hasError()) { + this->cleanup(/* clearError= */ false); + return written; + } + written += read; + } + return written; +} + +UpdateClass Update; diff --git a/cores/common/arduino/libraries/common/Update/Update.h b/cores/common/arduino/libraries/common/Update/Update.h new file mode 100644 index 000000000..1d7963bf2 --- /dev/null +++ b/cores/common/arduino/libraries/common/Update/Update.h @@ -0,0 +1,176 @@ +#pragma once + +#include +#include +#include +#include + +typedef enum { + UPDATE_ERROR_OK = 0, //!< No Error + UPDATE_ERROR_WRITE = 1, //!< Flash Write Failed + UPDATE_ERROR_ERASE = 2, //!< Flash Erase Failed + UPDATE_ERROR_READ = 3, //!< Flash Read Failed + UPDATE_ERROR_SPACE = 4, //!< Not Enough Space + UPDATE_ERROR_SIZE = 5, //!< Bad Size Given + UPDATE_ERROR_STREAM = 6, //!< Stream Read Timeout + UPDATE_ERROR_MD5 = 7, //!< MD5 Check Failed + UPDATE_ERROR_MAGIC_BYTE = 8, //!< Wrong Magic Byte + UPDATE_ERROR_ACTIVATE = 9, //!< Could Not Activate The Firmware + UPDATE_ERROR_NO_PARTITION = 10, //!< Partition Could Not be Found + UPDATE_ERROR_BAD_ARGUMENT = 11, //!< Bad Argument + UPDATE_ERROR_ABORT = 12, //!< Aborted +} UpdateError; + +typedef enum { + U_FLASH = 0, + U_SPIFFS = 100, + U_AUTH = 200, +} UpdateCommand; + +#define UPDATE_SIZE_UNKNOWN 0xFFFFFFFF + +#define ENCRYPTED_BLOCK_SIZE 16 + +#define UPDATE_TIMEOUT_MS 30 * 1000 + +class UpdateClass { + public: + typedef std::function THandlerFunction_Progress; + + public: /* Update.cpp */ + bool begin( + size_t size = UPDATE_SIZE_UNKNOWN, + int command = U_FLASH, + int ledPin = -1, + uint8_t ledOn = LOW, + const char *label = nullptr + ); + bool end(bool evenIfRemaining = false); + + size_t write(const uint8_t *data, size_t len); + size_t writeStream(Stream &data); + + private: /* Update.cpp */ + void cleanup(bool clearError = false); + + public: /* UpdateUtil.cpp */ + UpdateClass &onProgress(THandlerFunction_Progress handler); + static bool canRollBack(); + static bool rollBack(); + bool setMD5(const char *md5); + String md5String(); + void md5(uint8_t *result); + uint16_t getErrorCode() const; + bool hasError() const; + void clearError(); + const char *errorString() const; + void printError(Print &out) const; + + private: /* UpdateUtil.cpp */ + static void progressHandler(UpdateClass *self); + void printErrorContext(); + + private: + lt_ota_ctx_t *ctx{nullptr}; + uf2_err_t errUf2{UF2_ERR_OK}; + UpdateError errArd{UPDATE_ERROR_OK}; + THandlerFunction_Progress callback{nullptr}; + LT_MD5_CTX_T *md5Ctx{nullptr}; + uint8_t *md5Digest{nullptr}; + uint8_t *md5Expected{nullptr}; + + public: + /** + * @brief Get Arduino error code of the update. + */ + inline UpdateError getError() const { + return this->errArd; + } + + /** + * @brief Get UF2OTA error code of the update. + */ + inline uf2_err_t getUF2Error() const { + return this->ctx ? this->ctx->error : this->errUf2; + } + + /** + * @brief Same as end(). + */ + inline void abort() { + this->end(); + } + + /** + * @brief Check if the update process has been started. + */ + inline bool isRunning() { + return this->ctx; + } + + /** + * @brief Check if the update process hasn't been started or has been completed. + */ + inline bool isFinished() { + return !(this->ctx && this->ctx->bytes_written != this->ctx->bytes_total); + } + + /** + * @brief Return complete update image size. + */ + inline size_t size() { + return this->ctx ? this->ctx->bytes_total : 0; + } + + /** + * @brief Return amount of bytes already written. + */ + inline size_t progress() { + return this->ctx ? this->ctx->bytes_written : 0; + } + + /** + * @brief Return amount of bytes remaining to write. + */ + inline size_t remaining() { + return this->size() - this->progress(); + } + + /** + * @brief Get firmware name from UF2 info. + */ + inline const char *getFirmwareName() { + if (this->ctx) + return this->ctx->info.fw_name; + return nullptr; + } + + /** + * @brief Get firmware version from UF2 info. + */ + inline const char *getFirmwareVersion() { + if (this->ctx) + return this->ctx->info.fw_version; + return nullptr; + } + + /** + * @brief Get LibreTiny version from UF2 info. + */ + inline const char *getLibreTinyVersion() { + if (this->ctx) + return this->ctx->info.lt_version; + return nullptr; + } + + /** + * @brief Get target board name from UF2 info. + */ + inline const char *getBoardName() { + if (this->ctx) + return this->ctx->info.board; + return nullptr; + } +}; + +extern UpdateClass Update; diff --git a/cores/common/arduino/libraries/common/Update/UpdateUtil.cpp b/cores/common/arduino/libraries/common/Update/UpdateUtil.cpp new file mode 100644 index 000000000..25fced028 --- /dev/null +++ b/cores/common/arduino/libraries/common/Update/UpdateUtil.cpp @@ -0,0 +1,202 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-05-30. */ + +#include "Update.h" + +#include + +extern "C" { +#include +} + +static const char *errUf2Text[] = { + nullptr, // UF2_ERR_OK (0) + nullptr, // UF2_ERR_IGNORE (1) + "Bad Magic Number", // UF2_ERR_MAGIC (2) + "Bad Family ID", // UF2_ERR_FAMILY (3) + "Missing Header", // UF2_ERR_NOT_HEADER (4) + "Old OTA Format Found", // UF2_ERR_OTA_VER (5) + "Image Not Applicable", // UF2_ERR_OTA_WRONG (6) + "Partition Not Found", // UF2_ERR_PART_404 (7) + "Partition Info Invalid", // UF2_ERR_PART_INVALID (8) + "Partition Info Missing", // UF2_ERR_PART_UNSET (9) + "Block Data Too Long", // UF2_ERR_DATA_TOO_LONG (10) + "Bad Block Sequence Number", // UF2_ERR_SEQ_MISMATCH (11) + "Flash Erase Failed", // UF2_ERR_ERASE_FAILED (12) + "Flash Write Failed", // UF2_ERR_WRITE_FAILED (13) + "Write Failed Length", // UF2_ERR_WRITE_LENGTH (14) + "Partition Write-Protected", // UF2_ERR_WRITE_PROTECT (15) + "Memory Alloc Failed", // UF2_ERR_ALLOC_FAILED (16) +}; + +static const char *errArdText[] = { + nullptr, // UPDATE_ERROR_OK (0) + nullptr, // UPDATE_ERROR_WRITE (1) + nullptr, // UPDATE_ERROR_ERASE (2) + nullptr, // UPDATE_ERROR_READ (3) + nullptr, // UPDATE_ERROR_SPACE (4) + "Bad Size Given", // UPDATE_ERROR_SIZE (5) + "Stream Read Timeout", // UPDATE_ERROR_STREAM (6) + "MD5 Check Failed", // UPDATE_ERROR_MD5 (7) + nullptr, // UPDATE_ERROR_MAGIC_BYTE (8) + "Could Not Activate The Firmware", // UPDATE_ERROR_ACTIVATE (9) + nullptr, // UPDATE_ERROR_NO_PARTITION (10) + "Bad Argument", // UPDATE_ERROR_BAD_ARGUMENT (11) + "Aborted", // UPDATE_ERROR_ABORT (12) +}; + +static char errorStr[14]; + +/** + * @brief Set the callback invoked after writing data to flash. + */ +UpdateClass &UpdateClass::onProgress(THandlerFunction_Progress handler) { + this->callback = std::move(handler); + return *this; +} + +void UpdateClass::progressHandler(UpdateClass *self) { + if (self->callback) + self->callback(self->ctx->bytes_written, self->ctx->bytes_total); +} + +/** + * @brief Check if OTA rollback is possible (switching the stored index to another partition). + * + * Note that this is not the same as "switching" OTA with revert=true. + * + * @return true if 2nd image is valid and the chip is dual-OTA; false otherwise + */ +bool UpdateClass::canRollBack() { + return lt_ota_can_rollback(); +} + +/** + * @brief Try to switch OTA index to the other image. For single-OTA chips, only check if the upgrade image is valid. + * + * This can be used to "activate" the upgrade after flashing. + * + * @param revert switch if (and only if) the other image is already marked as active (i.e. + * switch back to the running image) + * @return false if the second image (or upgrade image) is not valid; false if writing failed; true otherwise + */ +bool UpdateClass::rollBack() { + if (!lt_ota_can_rollback()) + return false; + return lt_ota_switch(/* revert= */ false); +} + +/** + * @brief Set the expected MD5 of the firmware (hexadecimal string). + */ +bool UpdateClass::setMD5(const char *md5) { + if (strlen(md5) != 32) + return false; + if (!this->md5Expected) + this->md5Expected = static_cast(malloc(16)); + if (!this->md5Expected) + return false; + lt_xtob(md5, 32, this->md5Expected); + return true; +} + +/** + * @brief Return a hexadecimal string of calculated firmware MD5 sum. + */ +String UpdateClass::md5String() { + if (!this->md5Digest) + return ""; + char out[32 + 1]; + lt_btox(this->md5Digest, 16, out); + return String(out); +} + +/** + * @brief Get calculated MD5 digest of the firmware. + */ +void UpdateClass::md5(uint8_t *result) { + if (!this->md5Digest) { + memset(result, '\0', 16); + return; + } + memcpy(result, this->md5Digest, 16); +} + +/** + * @brief Get combined error code of the update. + */ +uint16_t UpdateClass::getErrorCode() const { + return (this->getError() << 8) | this->getUF2Error(); +} + +/** + * @brief Check if any error has occurred (incl. aborting the update). + */ +bool UpdateClass::hasError() const { + return this->getError() != UPDATE_ERROR_OK || this->getUF2Error() > UF2_ERR_IGNORE; +} + +/** + * @brief Clear all errors. This is NOT recommended. + */ +void UpdateClass::clearError() { + this->errArd = UPDATE_ERROR_OK; + this->errUf2 = UF2_ERR_OK; + if (this->ctx) + this->ctx->error = UF2_ERR_OK; +} + +/** + * @brief Get a textual description of the error. + */ +const char *UpdateClass::errorString() const { + uint8_t err; + if ((err = this->getUF2Error()) > UF2_ERR_IGNORE) + return errUf2Text[err]; + if ((err = this->getError()) != UPDATE_ERROR_OK) + return errArdText[err]; + if (!this->hasError()) + return ""; + sprintf(errorStr, "ard=%u,uf2=%u", this->getError(), this->getUF2Error()); + return errorStr; +} + +/** + * @brief Print string error info to the stream. + */ +void UpdateClass::printError(Print &out) const { + out.println(errorString()); +} + +/** + * @brief Print details about the error and current OTA state. + */ +void UpdateClass::printErrorContext() { +#if LT_DEBUG_OTA + if (!this->ctx) + return; + + LT_EM(OTA, "Error: %s", errorString()); + if (errArd == UPDATE_ERROR_ABORT) + return; + + LT_EM(OTA, "- written: %u of %u", this->ctx->bytes_written, this->ctx->bytes_total); + LT_EM( + OTA, + "- buf: size=%lld, left=%lld", + this->ctx->buf_pos - this->ctx->buf, + this->ctx->buf + UF2_BLOCK_SIZE - this->ctx->buf_pos + ); + hexdump(this->ctx->buf, this->ctx->buf_pos - this->ctx->buf); + + if (ctx) + LT_EM( + OTA, + "- ctx: seq=%u, part=%s", + this->ctx->uf2.seq - 1, // print last parsed block seq + this->ctx->uf2.part ? this->ctx->uf2.part->name : nullptr + ); + + auto *block = (uf2_block_t *)this->ctx->buf; + LT_EM(OTA, "- buf: seq=%u/%u, addr=%u, len=%u", block->block_seq, block->block_count, block->addr, block->len); +#endif +} diff --git a/cores/common/arduino/libraries/common/WiFiClient/LwIPClient.cpp b/cores/common/arduino/libraries/common/WiFiClient/LwIPClient.cpp new file mode 100644 index 000000000..d4b5101ab --- /dev/null +++ b/cores/common/arduino/libraries/common/WiFiClient/LwIPClient.cpp @@ -0,0 +1,393 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-26. */ + +#if LT_ARD_HAS_WIFI && LT_HAS_LWIP + +#include "LwIPClient.h" + +#include + +#define MAX_SOCK_NUM 4 +#define WIFI_CLIENT_CONNECT_TIMEOUT 3000 +#define WIFI_CLIENT_READ_TIMEOUT 3000 +#define WIFI_CLIENT_WRITE_RETRY 10 +#define WIFI_CLIENT_SELECT_TIMEOUT 1000 +#define WIFI_CLIENT_FLUSH_BUF_SIZE 1024 + +// disable #defines removing lwip_ prefix +#undef LWIP_COMPAT_SOCKETS +#define LWIP_COMPAT_SOCKETS 0 + +extern "C" { + +#include +#include +#include +#include +#include + +} // extern "C" + +class SocketHandle { + public: + int fd; + + SocketHandle(int fd) : fd(fd) {} + + ~SocketHandle() { + lwip_close(fd); + } +}; + +LwIPClient::LwIPClient() { + LT_VM(CLIENT, "LwIPClient()"); + _connected = false; + _sock = NULL; + _rxBuffer = NULL; + _timeout = WIFI_CLIENT_CONNECT_TIMEOUT; +} + +LwIPClient::LwIPClient(int sock) { + LT_VM(CLIENT, "LwIPClient(%d)", sock); + _connected = true; + _sock = std::make_shared(sock); + _rxBuffer = std::make_shared(sock); + _timeout = WIFI_CLIENT_CONNECT_TIMEOUT; +} + +LwIPClient::~LwIPClient() { + LT_VM(CLIENT, "~LwIPClient()"); + stop(); +} + +LwIPClient &LwIPClient::operator=(const LwIPClient &other) { + stop(); + _connected = other._connected; + _sock = other._sock; + _rxBuffer = other._rxBuffer; + return *this; +} + +bool IWiFiClient::operator==(const IWiFiClient &other) const { + return fd() == other.fd() && remoteIP() == other.remoteIP() && remotePort() == other.remotePort(); +} + +int LwIPClient::connect(IPAddress ip, uint16_t port) { + return connect(ip, port, _timeout); +} + +int LwIPClient::connect(const char *host, uint16_t port) { + return connect(host, port, _timeout); +} + +int LwIPClient::connect(const char *host, uint16_t port, int32_t timeout) { + IPAddress ip = WiFi.hostByName(host); + if (!ip) + return 0; + return connect(ip, port, timeout); +} + +int LwIPClient::connect(IPAddress ip, uint16_t port, int32_t timeout) { + if (_connected) + stop(); + int sock = lwip_socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); + if (sock < 0) { + LT_DM(CLIENT, "socket failed"); + return -1; + } + + if (timeout <= 0) + timeout = _timeout; // use default when -1 passed as timeout + + lwip_fcntl(sock, F_SETFL, lwip_fcntl(sock, F_GETFL, 0) | O_NONBLOCK); + + LT_ERRNO(); + + struct sockaddr_in addr; + memset(&addr, 0, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_addr.s_addr = ip; + addr.sin_port = htons(port); + fd_set fdset; + struct timeval tv; + FD_ZERO(&fdset); + FD_SET(sock, &fdset); + tv.tv_sec = 0; + tv.tv_usec = timeout * 1000; // millis -> micros + + int res = lwip_connect(sock, (struct sockaddr *)&addr, sizeof(addr)); + if (res < 0 && errno != EINPROGRESS) { + LT_EM(CLIENT, "Connect failed; errno=%d", errno); + lwip_close(sock); + return -1; + } + + res = lwip_select(sock + 1, NULL, &fdset, NULL, timeout < 0 ? NULL : &tv); + if (res < 0) { + LT_EM(CLIENT, "Select failed; errno=%d", errno); + lwip_close(sock); + return 0; + } + if (res == 0) { + LT_EM(CLIENT, "Select timeout; errno=%d", errno); + lwip_close(sock); + return 0; + } + + int sockerr; + socklen_t len = (socklen_t)sizeof(sockerr); + res = lwip_getsockopt(sock, SOL_SOCKET, SO_ERROR, &sockerr, &len); + + if (res < 0 || sockerr != 0) { + LT_EM(CLIENT, "Socket error; res=%d, sockerr=%d", res, sockerr); + lwip_close(sock); + return 0; + } + + int enable = 1; + lwip_setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout)); + lwip_setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, &timeout, sizeof(timeout)); + lwip_setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, &enable, sizeof(enable)); + lwip_setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, &enable, sizeof(enable)); + + LT_ERRNO(); + + lwip_fcntl(sock, F_SETFL, lwip_fcntl(sock, F_GETFL, 0) & ~O_NONBLOCK); + + LT_ERRNO(); + + _connected = true; + _sock = std::make_shared(sock); + _rxBuffer = std::make_shared(sock); + return 1; +} + +size_t LwIPClient::write(uint8_t data) { + return write(&data, 1); +} + +size_t LwIPClient::write(Stream &stream) { + uint8_t *buf = (uint8_t *)malloc(1360); + if (!buf) { + return 0; + } + size_t toRead = 0, toWrite = 0, written = 0; + size_t available = stream.available(); + while (available) { + toRead = (available > 1360) ? 1360 : available; + toWrite = stream.readBytes(buf, toRead); + written += write(buf, toWrite); + available = stream.available(); + } + free(buf); + return written; +} + +size_t LwIPClient::write(const uint8_t *buf, size_t size) { + if (_sock < 0 || !_connected || !size) { + setWriteError(); + return 0; + } + + int retry = WIFI_CLIENT_WRITE_RETRY; + int written = 0; + while (retry) { + fd_set fdset; + struct timeval tv; + FD_ZERO(&fdset); + FD_SET(fd(), &fdset); + tv.tv_sec = 0; + tv.tv_usec = WIFI_CLIENT_SELECT_TIMEOUT * 1000; + retry--; + + if (lwip_select(fd() + 1, NULL, &fdset, NULL, &tv) < 0) { + LT_WM(CLIENT, "Select failed; errno=%d", errno); + return 0; + } + + if (FD_ISSET(fd(), &fdset)) { + int res = lwip_send(fd(), buf, size, MSG_DONTWAIT); + if (res > 0) { + written += res; + if (res >= size) { + retry = 0; + } else { + buf += res; + size -= res; + retry = WIFI_CLIENT_WRITE_RETRY; + } + } else if (res < 0 && errno != EAGAIN) { + LT_WM(CLIENT, "Send failed; errno=%d", errno); + setWriteError(res); + _connected = false; + retry = 0; + } else { + // Try again + } + } + } + LT_DM(CLIENT, "wrote %d bytes", written); + return written; +} + +int LwIPClient::available() { + if (!_connected || !_rxBuffer) + return 0; + int res = _rxBuffer->available(); + if (_rxBuffer->failed()) { + LT_ERRNO(); + stop(); + } + return res; +} + +int LwIPClient::fd() const { + if (!_sock) + return -1; + return _sock->fd; +} + +int LwIPClient::socket() { + return fd(); +} + +int LwIPClient::setTimeout(uint32_t seconds) { + Client::setTimeout(seconds * 1000); + lwip_setsockopt(fd(), SOL_SOCKET, SO_RCVTIMEO, &_timeout, sizeof(_timeout)); + return lwip_setsockopt(fd(), SOL_SOCKET, SO_SNDTIMEO, &_timeout, sizeof(_timeout)); +} + +int LwIPClient::read() { + uint8_t data; + int res = read(&data, 1); + if (res < 0) + return res; + if (res == 0) + return -1; + return data; +} + +int LwIPClient::read(uint8_t *buf, size_t size) { + int res = -1; + if (_rxBuffer) { + res = _rxBuffer->read(buf, size); + if (_rxBuffer->failed()) { + stop(); + } + } + return res; +} + +int LwIPClient::peek() { + int res = -1; + if (_rxBuffer) { + res = _rxBuffer->peek(); + if (_rxBuffer->failed()) { + stop(); + } + } + return res; +} + +void LwIPClient::flush() { + int res; + size_t len = available(); + if (!len) + return; + uint8_t *buf = (uint8_t *)malloc(WIFI_CLIENT_FLUSH_BUF_SIZE); + if (!buf) + return; + while (len) { + res = lwip_recv(fd(), buf, LWIP_MIN(len, WIFI_CLIENT_FLUSH_BUF_SIZE), MSG_DONTWAIT); + if (res < 0) { + stop(); + break; + } + len -= res; + } + free(buf); +} + +void LwIPClient::stop() { + LT_VM(CLIENT, "Stopping TCP"); + _connected = false; + _sock = NULL; + _rxBuffer = NULL; +} + +uint8_t LwIPClient::connected() { + if (_connected) { + uint8_t dummy; + if (lwip_recv(fd(), &dummy, 0, MSG_DONTWAIT) <= 0) { + switch (errno) { + case EWOULDBLOCK: + case ENOENT: // caused by vfs + case 0: + _connected = true; + break; + case ENOTCONN: + case EPIPE: + case ECONNRESET: + case ECONNREFUSED: + case ECONNABORTED: + LT_IM(CLIENT, "Connection closed; errno=%d", errno); + _connected = false; + break; + default: + LT_WM(CLIENT, "Connection status unknown; errno=%d", errno); + _connected = true; + break; + } + } + } + return _connected; +} + +IPAddress __attribute__((noinline)) getaddr(int sock, int (*func)(int, struct sockaddr *, socklen_t *)) { + struct sockaddr addr; + socklen_t len = sizeof(addr); + func(sock, &addr, &len); + struct sockaddr_in *s = (struct sockaddr_in *)&addr; + return IPAddress((uint32_t)(s->sin_addr.s_addr)); +} + +uint16_t __attribute__((noinline)) getport(int sock, int (*func)(int, struct sockaddr *, socklen_t *)) { + struct sockaddr addr; + socklen_t len = sizeof(addr); + func(sock, &addr, &len); + struct sockaddr_in *s = (struct sockaddr_in *)&addr; + return ntohs(s->sin_port); +} + +IPAddress LwIPClient::remoteIP() const { + return getaddr(fd(), lwip_getpeername); +} + +IPAddress LwIPClient::remoteIP(int fd) const { + return getaddr(fd, lwip_getpeername); +} + +uint16_t LwIPClient::remotePort() const { + return getport(fd(), lwip_getpeername); +} + +uint16_t LwIPClient::remotePort(int fd) const { + return getport(fd, lwip_getpeername); +} + +IPAddress LwIPClient::localIP() const { + return getaddr(fd(), lwip_getsockname); +} + +IPAddress LwIPClient::localIP(int fd) const { + return getaddr(fd, lwip_getsockname); +} + +uint16_t LwIPClient::localPort() const { + return getport(fd(), lwip_getsockname); +} + +uint16_t LwIPClient::localPort(int fd) const { + return getport(fd, lwip_getsockname); +} + +#endif diff --git a/cores/common/arduino/libraries/common/WiFiClient/LwIPClient.h b/cores/common/arduino/libraries/common/WiFiClient/LwIPClient.h new file mode 100644 index 000000000..d4411f98e --- /dev/null +++ b/cores/common/arduino/libraries/common/WiFiClient/LwIPClient.h @@ -0,0 +1,62 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-26. */ + +#pragma once + +#if (LT_ARD_HAS_WIFI && LT_HAS_LWIP) || DOXYGEN + +#include "WiFiClient.h" + +#include "LwIPRxBuffer.h" +#include + +class SocketHandle; + +class LwIPClient : public IWiFiClient { + private: + bool _connected; + std::shared_ptr _sock; + std::shared_ptr _rxBuffer; + + public: + LwIPClient(); + LwIPClient(int sock); + ~LwIPClient(); + + int connect(IPAddress ip, uint16_t port); + int connect(const char *host, uint16_t port); + int connect(IPAddress ip, uint16_t port, int32_t timeout); + int connect(const char *host, uint16_t port, int32_t timeout); + + size_t write(uint8_t data); + size_t write(const uint8_t *buf, size_t size); + size_t write(Stream &stream); + + int available(); + int fd() const; + int socket(); + int setTimeout(uint32_t seconds); + + int read(); + int read(uint8_t *buf, size_t size); + int peek(); + void flush(); + void stop(); + uint8_t connected(); + + LwIPClient &operator=(const LwIPClient &other); + + IPAddress remoteIP() const; + IPAddress remoteIP(int sock) const; + uint16_t remotePort() const; + uint16_t remotePort(int sock) const; + IPAddress localIP() const; + IPAddress localIP(int sock) const; + uint16_t localPort() const; + uint16_t localPort(int sock) const; + + using Print::write; +}; + +typedef LwIPClient WiFiClient; + +#endif diff --git a/cores/common/arduino/libraries/common/WiFiClient/LwIPRxBuffer.cpp b/cores/common/arduino/libraries/common/WiFiClient/LwIPRxBuffer.cpp new file mode 100644 index 000000000..b1bc7ecc3 --- /dev/null +++ b/cores/common/arduino/libraries/common/WiFiClient/LwIPRxBuffer.cpp @@ -0,0 +1,117 @@ +#if LT_HAS_LWIP + +#include "LwIPRxBuffer.h" + +// disable #defines removing lwip_ prefix +#undef LWIP_COMPAT_SOCKETS +#define LWIP_COMPAT_SOCKETS 0 + +extern "C" { + +#include + +} // extern "C" + +size_t LwIPRxBuffer::r_available() { + if (_sock < 0) { + LT_DM(CLIENT, "_sock < 0"); + return 0; + } + int count = 0; // must be of same size as in lwip_ioctl() + int res = lwip_ioctl(_sock, FIONREAD, &count); + if (res < 0) { + LT_DM(CLIENT, "lwip_ioctl()=%d, errno=%d", res, errno); + _failed = true; + return 0; + } + return count; +} + +size_t LwIPRxBuffer::fillBuffer() { + if (!_buffer) { + _buffer = (uint8_t *)malloc(_size); + if (!_buffer) { + LT_E("buffer alloc failed"); + _failed = true; + return 0; + } + } + if (_fill && _pos == _fill) { + _fill = 0; + _pos = 0; + } + if (!_buffer || _size <= _fill || !r_available()) { + return 0; + } + int res = lwip_recv(_sock, _buffer + _fill, _size - _fill, MSG_DONTWAIT); + if (res < 0) { + if (errno != EWOULDBLOCK) { + LT_ERRNO(); + _failed = true; + } + return 0; + } + _fill += res; + return res; +} + +LwIPRxBuffer::LwIPRxBuffer(int sock, size_t size) + : _size(size), _buffer(NULL), _pos(0), _fill(0), _sock(sock), _failed(false) { + //_buffer = (uint8_t *)malloc(_size); +} + +LwIPRxBuffer::~LwIPRxBuffer() { + free(_buffer); +} + +bool LwIPRxBuffer::failed() { + return _failed; +} + +int LwIPRxBuffer::read(uint8_t *dst, size_t len) { + if (!dst || !len || (_pos == _fill && !fillBuffer())) { + return _failed ? -1 : 0; + } + size_t a = _fill - _pos; + if (len <= a || ((len - a) <= (_size - _fill) && fillBuffer() >= (len - a))) { + if (len == 1) { + *dst = _buffer[_pos]; + } else { + memcpy(dst, _buffer + _pos, len); + } + _pos += len; + return len; + } + size_t left = len; + size_t toRead = a; + uint8_t *buf = dst; + memcpy(buf, _buffer + _pos, toRead); + _pos += toRead; + left -= toRead; + buf += toRead; + while (left) { + if (!fillBuffer()) { + return len - left; + } + a = _fill - _pos; + toRead = (a > left) ? left : a; + memcpy(buf, _buffer + _pos, toRead); + _pos += toRead; + left -= toRead; + buf += toRead; + } + return len; +} + +int LwIPRxBuffer::peek() { + if (_pos == _fill && !fillBuffer()) { + return -1; + } + return _buffer[_pos]; +} + +size_t LwIPRxBuffer::available() { + return _fill - _pos + r_available(); +} + +#endif diff --git a/cores/common/arduino/libraries/common/WiFiClient/LwIPRxBuffer.h b/cores/common/arduino/libraries/common/WiFiClient/LwIPRxBuffer.h new file mode 100644 index 000000000..b2eeb3786 --- /dev/null +++ b/cores/common/arduino/libraries/common/WiFiClient/LwIPRxBuffer.h @@ -0,0 +1,24 @@ +#pragma once + +#include +#include + +class LwIPRxBuffer { + private: + size_t _size; + uint8_t *_buffer; + size_t _pos; + size_t _fill; + int _sock; + bool _failed; + size_t r_available(); + size_t fillBuffer(); + + public: + LwIPRxBuffer(int sock, size_t size = 1436); + ~LwIPRxBuffer(); + bool failed(); + int read(uint8_t *dst, size_t len); + int peek(); + size_t available(); +}; diff --git a/cores/common/arduino/libraries/common/WiFiClient/MbedTLSClient.cpp b/cores/common/arduino/libraries/common/WiFiClient/MbedTLSClient.cpp new file mode 100644 index 000000000..65a8c1d30 --- /dev/null +++ b/cores/common/arduino/libraries/common/WiFiClient/MbedTLSClient.cpp @@ -0,0 +1,483 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-30. */ + +#if LT_ARD_HAS_WIFI && LT_HAS_MBEDTLS + +#include "MbedTLSClient.h" + +#include + +extern "C" { + +#include +#include +#include +#include +#include +#include + +#if LT_HAS_FREERTOS +#include +#endif + +} // extern "C" + +#define _clientKeyC ((mbedtls_pk_context *)_clientKey) + +MbedTLSClient::MbedTLSClient() : WiFiClient() { + init(); // ensure the context is zero filled +} + +MbedTLSClient::MbedTLSClient(int sock) : WiFiClient(sock) { + init(); // ensure the context is zero filled +} + +MbedTLSClient::~MbedTLSClient() { + LT_VM(CLIENT, "~MbedTLSClient()"); + stop(); +} + +void MbedTLSClient::stop() { + if (!_sslCtx) + return; + LT_VM(SSL, "Stopping SSL"); + + if (_sslCfg->ca_chain) { + mbedtls_x509_crt_free(_caCert); + } + if (_sslCfg->key_cert) { + mbedtls_x509_crt_free(_clientCert); + mbedtls_pk_free(_clientKeyC); + } + mbedtls_ssl_free(_sslCtx); + mbedtls_ssl_config_free(_sslCfg); + + free(_sslCtx); + free(_sslCfg); + free(_caCert); + free(_clientCert); + free(_clientKey); + _sslCtx = NULL; + + LT_HEAP_I(); +} + +void MbedTLSClient::init() { + if (!_sslCtx) { + _sslCtx = (mbedtls_ssl_context *)malloc(sizeof(mbedtls_ssl_context)); + _sslCfg = (mbedtls_ssl_config *)malloc(sizeof(mbedtls_ssl_config)); + _caCert = (mbedtls_x509_crt *)malloc(sizeof(mbedtls_x509_crt)); + _clientCert = (mbedtls_x509_crt *)malloc(sizeof(mbedtls_x509_crt)); + _clientKey = (mbedtls_pk_context *)malloc(sizeof(mbedtls_pk_context)); + } + // Realtek AmbZ: init platform here to ensure HW crypto is initialized in ssl_init + mbedtls_platform_set_calloc_free(calloc, free); + mbedtls_ssl_init(_sslCtx); + mbedtls_ssl_config_init(_sslCfg); +} + +int MbedTLSClient::connect(IPAddress ip, uint16_t port, int32_t timeout) { + return connect(ipToString(ip).c_str(), port, timeout); +} + +int MbedTLSClient::connect(const char *host, uint16_t port, int32_t timeout) { + if (_pskIdentStr && _pskStr) + return connect(host, port, timeout, NULL, NULL, NULL, _pskIdentStr, _pskStr) == 0; + return connect(host, port, timeout, _caCertStr, _clientCertStr, _clientKeyStr, NULL, NULL) == 0; +} + +int MbedTLSClient::connect( + IPAddress ip, uint16_t port, const char *rootCABuf, const char *clientCert, const char *clientKey +) { + return connect(ipToString(ip).c_str(), port, 0, rootCABuf, clientCert, clientKey, NULL, NULL) == 0; +} + +int MbedTLSClient::connect( + const char *host, uint16_t port, const char *rootCABuf, const char *clientCert, const char *clientKey +) { + return connect(host, port, 0, rootCABuf, clientCert, clientKey, NULL, NULL) == 0; +} + +int MbedTLSClient::connect(IPAddress ip, uint16_t port, const char *pskIdent, const char *psk) { + return connect(ipToString(ip).c_str(), port, 0, NULL, NULL, NULL, pskIdent, psk) == 0; +} + +int MbedTLSClient::connect(const char *host, uint16_t port, const char *pskIdent, const char *psk) { + return connect(host, port, 0, NULL, NULL, NULL, pskIdent, psk) == 0; +} + +static int ssl_random(void *data, unsigned char *output, size_t len) { + lt_rand_bytes((uint8_t *)output, len); + return 0; +} + +void debug_cb(void *ctx, int level, const char *file, int line, const char *str) { + // do not print the trailing \n + uint16_t len = strlen(str); + char *msg = (char *)str; + msg[len - 1] = '\0'; + LT_IM(SSL, "%04d: |%d| %s", line, level, msg); +} + +int MbedTLSClient::connect( + const char *host, + uint16_t port, + int32_t timeout, + const char *rootCABuf, + const char *clientCert, + const char *clientKey, + const char *pskIdent, + const char *psk +) { + LT_HEAP_I(); + + if (!rootCABuf && !pskIdent && !psk && !_insecure && !_useRootCA) + return -1; + + if (timeout <= 0) + timeout = _timeout; // use default when -1 passed as timeout + + IPAddress addr = WiFi.hostByName(host); + if (!(uint32_t)addr) + return -1; + + int ret = WiFiClient::connect(addr, port, timeout); + if (ret < 0) { + LT_EM(SSL, "SSL socket failed"); + return ret; + } + + char *uid = "lt-ssl"; // TODO + + LT_VM(SSL, "Init SSL"); + init(); + LT_HEAP_I(); + + // mbedtls_debug_set_threshold(4); + // mbedtls_ssl_conf_dbg(&_sslCfg, debug_cb, NULL); + + ret = mbedtls_ssl_config_defaults( + _sslCfg, + MBEDTLS_SSL_IS_CLIENT, + MBEDTLS_SSL_TRANSPORT_STREAM, + MBEDTLS_SSL_PRESET_DEFAULT + ); + LT_RET_NZ(ret); + +#ifdef MBEDTLS_SSL_ALPN + if (_alpnProtocols) { + ret = mbedtls_ssl_conf_alpn_protocols(&_sslCfg, _alpnProtocols); + LT_RET_NZ(ret); + } +#endif + + if (_insecure) { + mbedtls_ssl_conf_authmode(_sslCfg, MBEDTLS_SSL_VERIFY_NONE); + } else if (rootCABuf) { + mbedtls_x509_crt_init(_caCert); + mbedtls_ssl_conf_authmode(_sslCfg, MBEDTLS_SSL_VERIFY_REQUIRED); + ret = mbedtls_x509_crt_parse(_caCert, (const unsigned char *)rootCABuf, strlen(rootCABuf) + 1); + mbedtls_ssl_conf_ca_chain(_sslCfg, _caCert, NULL); + if (ret < 0) { + mbedtls_x509_crt_free(_caCert); + LT_RET(ret); + } + } else if (_useRootCA) { + return -1; // not implemented + } else if (pskIdent && psk) { +#ifdef MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED + uint16_t len = strlen(psk); + if ((len & 1) != 0 || len > 2 * MBEDTLS_PSK_MAX_LEN) { + LT_EM(SSL, "PSK length invalid"); + return -1; + } + unsigned char pskBin[MBEDTLS_PSK_MAX_LEN] = {}; + for (uint8_t i = 0; i < len; i++) { + uint8_t c = psk[i]; + c |= 0b00100000; // make lowercase + c -= '0' * (c >= '0' && c <= '9'); + c -= ('a' - 10) * (c >= 'a' && c <= 'z'); + if (c > 0xf) + return -1; + pskBin[i / 2] |= c << (4 * ((i & 1) ^ 1)); + } + ret = mbedtls_ssl_conf_psk(_sslCfg, pskBin, len / 2, (const unsigned char *)pskIdent, strlen(pskIdent)); + LT_RET_NZ(ret); +#else + return -1; +#endif + } else { + return -1; + } + + if (!_insecure && clientCert && clientKey) { + mbedtls_x509_crt_init(_clientCert); + mbedtls_pk_init(_clientKeyC); + LT_VM(SSL, "Loading client cert"); + ret = mbedtls_x509_crt_parse(_clientCert, (const unsigned char *)clientCert, strlen(clientCert) + 1); + if (ret < 0) { + mbedtls_x509_crt_free(_clientCert); + LT_RET(ret); + } + LT_VM(SSL, "Loading private key"); + ret = mbedtls_pk_parse_key(_clientKeyC, (const unsigned char *)clientKey, strlen(clientKey) + 1, NULL, 0); + if (ret < 0) { + mbedtls_x509_crt_free(_clientCert); + LT_RET(ret); + } + mbedtls_ssl_conf_own_cert(_sslCfg, _clientCert, _clientKeyC); + } + + LT_VM(SSL, "Setting TLS hostname"); + ret = mbedtls_ssl_set_hostname(_sslCtx, host); + LT_RET_NZ(ret); + + mbedtls_ssl_conf_rng(_sslCfg, ssl_random, NULL); + ret = mbedtls_ssl_setup(_sslCtx, _sslCfg); + LT_RET_NZ(ret); + + _sockTls = fd(); + mbedtls_ssl_set_bio(_sslCtx, &_sockTls, mbedtls_net_send, mbedtls_net_recv, NULL); + mbedtls_net_set_nonblock((mbedtls_net_context *)&_sockTls); + + LT_HEAP_I(); + + LT_VM(SSL, "SSL handshake"); + if (_handshakeTimeout == 0) + _handshakeTimeout = timeout; + unsigned long start = millis(); + while (ret = mbedtls_ssl_handshake(_sslCtx)) { + if (ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE) { + LT_RET(ret); + } + if ((millis() - start) > _handshakeTimeout) { + LT_EM(SSL, "SSL handshake timeout"); + return -1; + } + delay(2); + } + + LT_HEAP_I(); + + if (clientCert && clientKey) { + LT_DM( + SSL, + "Protocol %s, ciphersuite %s", + mbedtls_ssl_get_version(_sslCtx), + mbedtls_ssl_get_ciphersuite(_sslCtx) + ); + ret = mbedtls_ssl_get_record_expansion(_sslCtx); + if (ret >= 0) + LT_DM(SSL, "Record expansion: %d", ret); + else { + LT_WM(SSL, "Record expansion unknown"); + } + } + + LT_VM(SSL, "Verifying certificate"); + ret = mbedtls_ssl_get_verify_result(_sslCtx); + if (ret) { + char buf[512]; + memset(buf, 0, sizeof(buf)); + mbedtls_x509_crt_verify_info(buf, sizeof(buf), " ! ", ret); + LT_EM(SSL, "Failed to verify peer certificate! Verification info: %s", buf); + return ret; + } + + if (rootCABuf) + mbedtls_x509_crt_free(_caCert); + if (clientCert) + mbedtls_x509_crt_free(_clientCert); + if (clientKey != NULL) + mbedtls_pk_free(_clientKeyC); + return 0; // OK +} + +size_t MbedTLSClient::write(const uint8_t *buf, size_t size) { + int ret = -1; + while ((ret = mbedtls_ssl_write(_sslCtx, buf, size)) <= 0) { + if (ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE && ret < 0) { + LT_RET(ret); + } + delay(2); + } + return ret; +} + +int MbedTLSClient::available() { + bool peeked = _peeked >= 0; + if (!connected()) + return peeked; + + int ret = mbedtls_ssl_read(_sslCtx, NULL, 0); + if (ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE && ret < 0) { + stop(); + return peeked ? peeked : ret; + } + return mbedtls_ssl_get_bytes_avail(_sslCtx) + peeked; +} + +int MbedTLSClient::read(uint8_t *buf, size_t size) { + bool peeked = false; + int toRead = available(); + if ((!buf && size) || toRead <= 0) + return -1; + if (!size) + return 0; + if (_peeked >= 0) { + buf[0] = _peeked; + _peeked = -1; + size--; + toRead--; + if (!size || !toRead) + return 1; + buf++; + peeked = true; + } + + int ret = mbedtls_ssl_read(_sslCtx, buf, size); + if (ret < 0) { + stop(); + return peeked ? peeked : ret; + } + return ret + peeked; +} + +int MbedTLSClient::peek() { + if (_peeked >= 0) + return _peeked; + _peeked = timedRead(); + return _peeked; +} + +void MbedTLSClient::flush() {} + +int MbedTLSClient::lastError(char *buf, const size_t size) { + return 0; // TODO (?) +} + +void MbedTLSClient::setInsecure() { + _caCertStr = NULL; + _clientCertStr = NULL; + _clientKeyStr = NULL; + _pskIdentStr = NULL; + _pskStr = NULL; + _insecure = true; +} + +// TODO only allocate _caCert, _clientCert and _clientKey when one +// of the following functions is used + +void MbedTLSClient::setPreSharedKey(const char *pskIdent, const char *psk) { + _pskIdentStr = pskIdent; + _pskStr = psk; +} + +void MbedTLSClient::setCACert(const char *rootCA) { + _caCertStr = rootCA; +} + +void MbedTLSClient::setCertificate(const char *clientCA) { + _clientCertStr = clientCA; +} + +void MbedTLSClient::setPrivateKey(const char *privateKey) { + _clientKeyStr = privateKey; +} + +char *streamToStr(Stream &stream, size_t size) { + char *buf = (char *)malloc(size + 1); + if (!buf) + return NULL; + if (size != stream.readBytes(buf, size)) { + free(buf); + return NULL; + } + buf[size] = '\0'; + return buf; +} + +bool MbedTLSClient::loadCACert(Stream &stream, size_t size) { + char *str = streamToStr(stream, size); + if (str) { + _caCertStr = str; + return true; + } + return false; +} + +bool MbedTLSClient::loadCertificate(Stream &stream, size_t size) { + char *str = streamToStr(stream, size); + if (str) { + _clientCertStr = str; + return true; + } + return false; +} + +bool MbedTLSClient::loadPrivateKey(Stream &stream, size_t size) { + char *str = streamToStr(stream, size); + if (str) { + _clientKeyStr = str; + return true; + } + return false; +} + +bool MbedTLSClient::verify(const char *fingerprint, const char *domainName) { + uint8_t fpLocal[32] = {}; + uint16_t len = strlen(fingerprint); + uint8_t byte = 0; + for (uint8_t i = 0; i < len; i++) { + uint8_t c = fingerprint[i]; + while ((c == ' ' || c == ':') && i < len) { + c = fingerprint[++i]; + } + c |= 0b00100000; // make lowercase + c -= '0' * (c >= '0' && c <= '9'); + c -= ('a' - 10) * (c >= 'a' && c <= 'z'); + if (c > 0xf) + return -1; + fpLocal[byte / 2] |= c << (4 * ((byte & 1) ^ 1)); + byte++; + if (byte >= 64) + break; + } + + uint8_t fpRemote[32]; + if (!getFingerprintSHA256(fpRemote)) + return false; + + if (memcmp(fpLocal, fpRemote, 32)) { + LT_DM(SSL, "Fingerprints don't match"); + return false; + } + + if (!domainName) + return true; + // TODO domain name verification + return true; +} + +void MbedTLSClient::setHandshakeTimeout(unsigned long handshakeTimeout) { + _handshakeTimeout = handshakeTimeout * 1000; +} + +void MbedTLSClient::setAlpnProtocols(const char **alpnProtocols) { + _alpnProtocols = alpnProtocols; +} + +bool MbedTLSClient::getFingerprintSHA256(uint8_t result[32]) { + const mbedtls_x509_crt *cert = mbedtls_ssl_get_peer_cert(_sslCtx); + if (!cert) { + LT_EM(SSL, "Failed to get peer certificate"); + return false; + } + mbedtls_sha256_context shaCtx; + mbedtls_sha256_init(&shaCtx); + mbedtls_sha256_starts(&shaCtx, false); + mbedtls_sha256_update(&shaCtx, cert->raw.p, cert->raw.len); + mbedtls_sha256_finish(&shaCtx, result); + return true; +} + +#endif // LT_ARD_HAS_WIFI && LT_HAS_MBEDTLS diff --git a/cores/common/arduino/libraries/common/WiFiClient/MbedTLSClient.h b/cores/common/arduino/libraries/common/WiFiClient/MbedTLSClient.h new file mode 100644 index 000000000..98f925181 --- /dev/null +++ b/cores/common/arduino/libraries/common/WiFiClient/MbedTLSClient.h @@ -0,0 +1,88 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-30. */ + +#pragma once + +#if (LT_ARD_HAS_WIFI && LT_HAS_MBEDTLS) || DOXYGEN + +#include "WiFiClientSecure.h" + +struct mbedtls_ssl_context; +struct mbedtls_ssl_config; +struct mbedtls_x509_crt; + +class MbedTLSClient : public WiFiClient, public IWiFiClientSecure { + private: + mbedtls_ssl_context *_sslCtx = NULL; + mbedtls_ssl_config *_sslCfg; + mbedtls_x509_crt *_caCert; + mbedtls_x509_crt *_clientCert; + void *_clientKey; + uint32_t _handshakeTimeout = 0; + + void init(); + int _sockTls = -1; + bool _insecure = false; + bool _useRootCA = false; + int _peeked = -1; + + const char *_caCertStr; + const char *_clientCertStr; + const char *_clientKeyStr; + const char *_pskIdentStr; + const char *_pskStr; + const char **_alpnProtocols; + + int connect( + const char *host, + uint16_t port, + int32_t timeout, + const char *rootCABuf, + const char *clientCert, + const char *clientKey, + const char *pskIdent, + const char *psk + ); + + public: + MbedTLSClient(); + MbedTLSClient(int sock); + ~MbedTLSClient(); + + int connect(IPAddress ip, uint16_t port, int32_t timeout); + int connect(const char *host, uint16_t port, int32_t timeout); + + int connect(IPAddress ip, uint16_t port, const char *rootCABuf, const char *clientCert, const char *clientKey); + int connect(const char *host, uint16_t port, const char *rootCABuf, const char *clientCert, const char *clientKey); + int connect(IPAddress ip, uint16_t port, const char *pskIdent, const char *psk); + int connect(const char *host, uint16_t port, const char *pskIdent, const char *psk); + + size_t write(const uint8_t *buf, size_t size); + + int available(); + + int read(uint8_t *buf, size_t size); + int peek(); + void flush(); + void stop(); + + int lastError(char *buf, const size_t size); + void setInsecure(); // Don't validate the chain, just accept whatever is given. VERY INSECURE! + void setPreSharedKey(const char *pskIdent, const char *psk); // psk in hex + void setCACert(const char *rootCA); + void setCertificate(const char *clientCA); + void setPrivateKey(const char *privateKey); + bool loadCACert(Stream &stream, size_t size); + bool loadCertificate(Stream &stream, size_t size); + bool loadPrivateKey(Stream &stream, size_t size); + bool verify(const char *fingerprint, const char *domainName); + void setHandshakeTimeout(unsigned long handshakeTimeout); + void setAlpnProtocols(const char **alpnProtocols); + bool getFingerprintSHA256(uint8_t result[32]); + + using WiFiClient::connect; + using WiFiClient::read; +}; + +typedef MbedTLSClient WiFiClientSecure; + +#endif diff --git a/cores/common/arduino/libraries/common/WiFiClient/WiFiClient.h b/cores/common/arduino/libraries/common/WiFiClient/WiFiClient.h new file mode 100644 index 000000000..e0650b844 --- /dev/null +++ b/cores/common/arduino/libraries/common/WiFiClient/WiFiClient.h @@ -0,0 +1,78 @@ +/* + Client.h - Base class that provides Client + Copyright (c) 2011 Adrian McEwen. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#pragma once + +#include +#include + +class IWiFiClient : public Client { + public: + IWiFiClient() {} + + IWiFiClient(int sock) {} + + ~IWiFiClient() {} + + virtual int connect(IPAddress ip, uint16_t port, int32_t timeout) = 0; + virtual int connect(const char *host, uint16_t port, int32_t timeout) = 0; + + virtual size_t write(Stream &stream) = 0; + + size_t write_P(PGM_P buffer, size_t size) { + return write((const uint8_t *)buffer, size); + } + + virtual int fd() const = 0; + virtual int socket() = 0; + virtual int setTimeout(uint32_t seconds) = 0; + + bool operator==(const IWiFiClient &other) const; + + operator bool() { + return connected(); + } + + virtual bool operator==(const bool value) { + return bool() == value; + } + + virtual bool operator!=(const bool value) { + return bool() != value; + } + + virtual bool operator!=(const IWiFiClient &other) { + return !this->operator==(other); + }; + + virtual IPAddress remoteIP() const = 0; + virtual IPAddress remoteIP(int sock) const = 0; + virtual uint16_t remotePort() const = 0; + virtual uint16_t remotePort(int sock) const = 0; + virtual IPAddress localIP() const = 0; + virtual IPAddress localIP(int sock) const = 0; + virtual uint16_t localPort() const = 0; + virtual uint16_t localPort(int sock) const = 0; + + using Print::write; +}; + +#if LT_ARD_HAS_WIFI && LT_HAS_LWIP +#include "LwIPClient.h" +#endif diff --git a/cores/common/arduino/libraries/common/WiFiClient/WiFiClientSecure.h b/cores/common/arduino/libraries/common/WiFiClient/WiFiClientSecure.h new file mode 100644 index 000000000..296a41614 --- /dev/null +++ b/cores/common/arduino/libraries/common/WiFiClient/WiFiClientSecure.h @@ -0,0 +1,53 @@ +/* + WiFiClientSecure.h - Base class that provides Client SSL to ESP32 + Copyright (c) 2011 Adrian McEwen. All right reserved. + Additions Copyright (C) 2017 Evandro Luis Copercini. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#pragma once + +#include + +#include "WiFiClient.h" + +class IWiFiClientSecure { + public: + virtual int + connect(IPAddress ip, uint16_t port, const char *rootCABuf, const char *clientCert, const char *clientKey) = 0; + virtual int + connect(const char *host, uint16_t port, const char *rootCABuf, const char *clientCert, const char *clientKey) = 0; + virtual int connect(IPAddress ip, uint16_t port, const char *pskIdent, const char *psk) = 0; + virtual int connect(const char *host, uint16_t port, const char *pskIdent, const char *psk) = 0; + + virtual int lastError(char *buf, const size_t size) = 0; + virtual void setInsecure() = 0; // Don't validate the chain, just accept whatever is given. VERY INSECURE! + virtual void setPreSharedKey(const char *pskIdent, const char *psk) = 0; // psk in hex + virtual void setCACert(const char *rootCA) = 0; + virtual void setCertificate(const char *clientCA) = 0; + virtual void setPrivateKey(const char *privateKey) = 0; + virtual bool loadCACert(Stream &stream, size_t size) = 0; + virtual bool loadCertificate(Stream &stream, size_t size) = 0; + virtual bool loadPrivateKey(Stream &stream, size_t size) = 0; + virtual bool verify(const char *fingerprint, const char *domainName) = 0; + virtual void setHandshakeTimeout(unsigned long handshakeTimeout) = 0; + virtual void setAlpnProtocols(const char **alpnProtocols) = 0; + virtual bool getFingerprintSHA256(uint8_t result[32]) = 0; +}; + +#if LT_ARD_HAS_WIFI && LT_HAS_MBEDTLS +#include "MbedTLSClient.h" +#endif diff --git a/cores/common/arduino/libraries/common/WiFiServer/LwIPServer.cpp b/cores/common/arduino/libraries/common/WiFiServer/LwIPServer.cpp new file mode 100644 index 000000000..70dc7cc6f --- /dev/null +++ b/cores/common/arduino/libraries/common/WiFiServer/LwIPServer.cpp @@ -0,0 +1,143 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-26. */ + +#if LT_ARD_HAS_WIFI && LT_HAS_LWIP + +#include "LwIPServer.h" + +// disable #defines removing lwip_ prefix +#undef LWIP_COMPAT_SOCKETS +#define LWIP_COMPAT_SOCKETS 0 + +extern "C" { +#include +// #include +#include +#include +#include +} + +LwIPServer::LwIPServer(uint32_t addr, uint16_t port, uint8_t maxClients) + : _sock(-1), _sockAccepted(-1), _addr(addr), _port(port), _maxClients(maxClients), _active(false), _noDelay(false) { +} + +LwIPServer::operator bool() { + return _active; +} + +bool LwIPServer::begin(uint16_t port, bool reuseAddr) { + if (_active) + return true; + if (port) + _port = port; + + _sock = lwip_socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); + if (_sock < 0) { + LT_EM(SERVER, "Socket failed; errno=%d", errno); + return false; + } + + int enable = reuseAddr; + lwip_setsockopt(_sock, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(enable)); + + struct sockaddr_in addr; + addr.sin_family = AF_INET; + addr.sin_addr.s_addr = _addr; + addr.sin_port = htons(_port); + + if (lwip_bind(_sock, (struct sockaddr *)&addr, sizeof(addr)) < 0) { + LT_EM(SERVER, "Bind failed; errno=%d", errno); + return false; + } + + if (lwip_listen(_sock, _maxClients) < 0) { + LT_EM(SERVER, "Bind failed; errno=%d", errno); + return false; + } + + uint8_t *addrB = (uint8_t *)&_addr; + LT_IM(SERVER, "Server running on %hhu.%hhu.%hhu.%hhu:%hu", addrB[0], addrB[1], addrB[2], addrB[3], _port); + + lwip_fcntl(_sock, F_SETFL, O_NONBLOCK); + _active = true; + _noDelay = false; + _sockAccepted = -1; + return true; +} + +void LwIPServer::end() { + if (_sock == -1) + return; + lwip_close(_sock); + _sock = -1; + _active = -1; +} + +WiFiClient LwIPServer::accept() { + if (!_active) + return WiFiClient(); + + int sock; + if (_sockAccepted >= 0) { + sock = _sockAccepted; + _sockAccepted = -1; + } else { + struct sockaddr_in addr; + socklen_t len = sizeof(addr); + sock = lwip_accept(_sock, (struct sockaddr *)&addr, &len); + } + + if (sock >= 0) { + int enable = 1; + if (lwip_setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, &enable, sizeof(enable)) == ERR_OK) { + enable = _noDelay; + if (lwip_setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, &enable, sizeof(enable)) == ERR_OK) { + // HOTFIX: allow the TCP thread to receive data + // I'm not sure what's happening there, so this should probably be fixed properly. + // When a connection arrives, sometimes TCP hasn't received anything yet. This causes + // calling WiFiClient::connected() check for lwip_recv(), which returns EWOULDBLOCK + // as the client is still connected. The problem is that there's basically an infinite loop + // created: nowhere in that code is a yield()/delay() that would allow TCP thread to work + // and receive data, so LwIP still sees a connected client that sends nothing. At least + // that's what I understand. And any loop that doesn't call delay() seems to block the TCP + // stack completely and prevents it from even being pinged. + LT_DM(SERVER, "Got client"); + delay(5); + return WiFiClient(sock); + } + } + } + + return WiFiClient(); +} + +int LwIPServer::setTimeout(uint32_t seconds) { + struct timeval tv; + tv.tv_sec = seconds; + tv.tv_usec = 0; + if (lwip_setsockopt(_sock, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv)) < 0) + return -1; + return lwip_setsockopt(_sock, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv)); +} + +void LwIPServer::setNoDelay(bool noDelay) { + _noDelay = noDelay; +} + +bool LwIPServer::getNoDelay() { + return _noDelay; +} + +bool LwIPServer::hasClient() { + if (_sockAccepted >= 0) { + return true; + } + struct sockaddr_in addr; + socklen_t len = sizeof(addr); + _sockAccepted = lwip_accept(_sock, (struct sockaddr *)&addr, &len); + if (_sockAccepted >= 0) { + return true; + } + return false; +} + +#endif diff --git a/cores/common/arduino/libraries/common/WiFiServer/LwIPServer.h b/cores/common/arduino/libraries/common/WiFiServer/LwIPServer.h new file mode 100644 index 000000000..ca2e03b01 --- /dev/null +++ b/cores/common/arduino/libraries/common/WiFiServer/LwIPServer.h @@ -0,0 +1,50 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-26. */ + +#pragma once + +#if (LT_ARD_HAS_WIFI && LT_HAS_LWIP) || DOXYGEN + +#include "WiFiServer.h" + +class LwIPServer : public IWiFiServer { + private: + int _sock; + int _sockAccepted; + uint32_t _addr; + uint16_t _port; + uint8_t _maxClients; + bool _active; + bool _noDelay = false; + + private: + LwIPServer(uint32_t addr, uint16_t port = 80, uint8_t maxClients = 4); + + public: + LwIPServer(uint16_t port = 80, uint8_t maxClients = 4) : LwIPServer((uint32_t)0, port, maxClients) {} + + LwIPServer(int port = 80, uint8_t maxClients = 4) : LwIPServer((uint32_t)0, port, maxClients) {} + + LwIPServer(const IPAddress &addr, uint16_t port = 80, uint8_t maxClients = 4) + : LwIPServer((uint32_t)addr, port, maxClients) {} + + operator bool(); + + bool begin(uint16_t port = 0, bool reuseAddr = true); + void end(); + WiFiClient accept(); + + size_t write(const uint8_t *buffer, size_t size) { + return 0; + } + + void stopAll() {} + + int setTimeout(uint32_t seconds); + void setNoDelay(bool noDelay); + bool getNoDelay(); + bool hasClient(); +}; + +typedef LwIPServer WiFiServer; + +#endif diff --git a/cores/common/arduino/libraries/common/WiFiServer/WiFiServer.h b/cores/common/arduino/libraries/common/WiFiServer/WiFiServer.h new file mode 100644 index 000000000..0b8dbc1a8 --- /dev/null +++ b/cores/common/arduino/libraries/common/WiFiServer/WiFiServer.h @@ -0,0 +1,76 @@ +/* + Server.h - Server class for Raspberry Pi + Copyright (c) 2016 Hristo Gochkov All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#pragma once + +#include +#include + +#include "WiFiClient.h" + +#include + +template ::value>> + +class IWiFiServer : public Print { // arduino::Server is useless anyway + public: + void listenOnLocalhost() {} + + IWiFiServer(uint16_t port = 80, uint8_t maxClients = 4) {} + + IWiFiServer(const IPAddress &addr, uint16_t port = 80, uint8_t maxClients = 4) {} + + ~IWiFiServer() { + stop(); + } + + TWiFiClient available() { + return accept(); + }; + + virtual operator bool() = 0; + + virtual bool begin(uint16_t port = 0, bool reuseAddr = true) = 0; + virtual void end() = 0; + virtual TWiFiClient accept() = 0; + + void close() { + end(); + } + + void stop() { + end(); + } + + virtual int setTimeout(uint32_t seconds) = 0; + virtual void stopAll() = 0; + virtual void setNoDelay(bool noDelay) = 0; + virtual bool getNoDelay() = 0; + virtual bool hasClient() = 0; + + size_t write(uint8_t data) { + return write(&data, 1); + } + + using Print::write; +}; + +#if LT_ARD_HAS_WIFI && LT_HAS_LWIP +#include "LwIPServer.h" +#endif diff --git a/cores/common/arduino/libraries/common/WiFiUdp/LwIPUdp.cpp b/cores/common/arduino/libraries/common/WiFiUdp/LwIPUdp.cpp new file mode 100644 index 000000000..bf5e0e1ab --- /dev/null +++ b/cores/common/arduino/libraries/common/WiFiUdp/LwIPUdp.cpp @@ -0,0 +1,285 @@ +/* + Udp.cpp - UDP class for Raspberry Pi + Copyright (c) 2016 Hristo Gochkov All right reserved. + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#if LT_ARD_HAS_WIFI && LT_HAS_LWIP + +#include "LwIPUdp.h" + +extern "C" { + +#include +#include + +} // extern "C" + +#undef write +#undef read + +LwIPUDP::LwIPUDP() : udp_server(-1), server_port(0), remote_port(0), tx_buffer(0), tx_buffer_len(0), rx_buffer(0) {} + +LwIPUDP::~LwIPUDP() { + stop(); +} + +uint8_t LwIPUDP::begin(IPAddress address, uint16_t port) { + stop(); + + server_port = port; + + tx_buffer = new char[1460]; + if (!tx_buffer) { + log_e("could not create tx buffer: %d", errno); + return 0; + } + + if ((udp_server = socket(AF_INET, SOCK_DGRAM, 0)) == -1) { + log_e("could not create socket: %d", errno); + return 0; + } + + int yes = 1; + if (setsockopt(udp_server, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)) < 0) { + log_e("could not set socket option: %d", errno); + stop(); + return 0; + } + + struct sockaddr_in addr; + memset((char *)&addr, 0, sizeof(addr)); + addr.sin_family = AF_INET; + addr.sin_port = htons(server_port); + addr.sin_addr.s_addr = (in_addr_t)address; + if (bind(udp_server, (struct sockaddr *)&addr, sizeof(addr)) == -1) { + log_e("could not bind socket: %d", errno); + stop(); + return 0; + } + fcntl(udp_server, F_SETFL, O_NONBLOCK); + return 1; +} + +uint8_t LwIPUDP::begin(uint16_t p) { + return begin(IPAddress((uint32_t)INADDR_ANY), p); +} + +uint8_t LwIPUDP::beginMulticast(IPAddress a, uint16_t p) { + if (begin(IPAddress((uint32_t)INADDR_ANY), p)) { + if ((uint32_t)a != 0) { + struct ip_mreq mreq; + mreq.imr_multiaddr.s_addr = (in_addr_t)a; + mreq.imr_interface.s_addr = INADDR_ANY; + if (setsockopt(udp_server, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)) < 0) { + log_e("could not join igmp: %d", errno); + stop(); + return 0; + } + multicast_ip = a; + } + return 1; + } + return 0; +} + +void LwIPUDP::stop() { + if (tx_buffer) { + delete[] tx_buffer; + tx_buffer = NULL; + } + tx_buffer_len = 0; + if (rx_buffer) { + cbuf *b = rx_buffer; + rx_buffer = NULL; + delete b; + } + if (udp_server == -1) + return; + if ((uint32_t)multicast_ip != 0) { + struct ip_mreq mreq; + mreq.imr_multiaddr.s_addr = (in_addr_t)multicast_ip; + mreq.imr_interface.s_addr = (in_addr_t)0; + setsockopt(udp_server, IPPROTO_IP, IP_DROP_MEMBERSHIP, &mreq, sizeof(mreq)); + multicast_ip = IPAddress((uint32_t)INADDR_ANY); + } + close(udp_server); + udp_server = -1; +} + +int LwIPUDP::beginMulticastPacket() { + if (!server_port || multicast_ip == IPAddress((uint32_t)INADDR_ANY)) + return 0; + remote_ip = multicast_ip; + remote_port = server_port; + return beginPacket(); +} + +int LwIPUDP::beginPacket() { + if (!remote_port) + return 0; + + // allocate tx_buffer if is necessary + if (!tx_buffer) { + tx_buffer = new char[1460]; + if (!tx_buffer) { + log_e("could not create tx buffer: %d", errno); + return 0; + } + } + + tx_buffer_len = 0; + + // check whereas socket is already open + if (udp_server != -1) + return 1; + + if ((udp_server = socket(AF_INET, SOCK_DGRAM, 0)) == -1) { + log_e("could not create socket: %d", errno); + return 0; + } + + fcntl(udp_server, F_SETFL, O_NONBLOCK); + + return 1; +} + +int LwIPUDP::beginPacket(IPAddress ip, uint16_t port) { + remote_ip = ip; + remote_port = port; + return beginPacket(); +} + +int LwIPUDP::beginPacket(const char *host, uint16_t port) { + struct hostent *server; + server = gethostbyname(host); + if (server == NULL) { + log_e("could not get host from dns: %d", errno); + return 0; + } + return beginPacket(IPAddress((const uint8_t *)(server->h_addr_list[0])), port); +} + +int LwIPUDP::endPacket() { + struct sockaddr_in recipient; + recipient.sin_addr.s_addr = (uint32_t)remote_ip; + recipient.sin_family = AF_INET; + recipient.sin_port = htons(remote_port); + int sent = sendto(udp_server, tx_buffer, tx_buffer_len, 0, (struct sockaddr *)&recipient, sizeof(recipient)); + if (sent < 0) { + log_e("could not send data: %d", errno); + return 0; + } + return 1; +} + +size_t LwIPUDP::write(uint8_t data) { + if (tx_buffer_len == 1460) { + endPacket(); + tx_buffer_len = 0; + } + tx_buffer[tx_buffer_len++] = data; + return 1; +} + +size_t LwIPUDP::write(const uint8_t *buffer, size_t size) { + size_t i; + for (i = 0; i < size; i++) + write(buffer[i]); + return i; +} + +int LwIPUDP::parsePacket() { + if (rx_buffer) + return 0; + struct sockaddr_in si_other; + int slen = sizeof(si_other), len; + char *buf = new char[1460]; + if (!buf) { + return 0; + } + if ((len = recvfrom(udp_server, buf, 1460, MSG_DONTWAIT, (struct sockaddr *)&si_other, (socklen_t *)&slen)) == -1) { + delete[] buf; + if (errno == EWOULDBLOCK) { + return 0; + } + log_e("could not receive data: %d", errno); + return 0; + } + remote_ip = IPAddress(si_other.sin_addr.s_addr); + remote_port = ntohs(si_other.sin_port); + if (len > 0) { + rx_buffer = new cbuf(len); + rx_buffer->write(buf, len); + } + delete[] buf; + return len; +} + +int LwIPUDP::available() { + if (!rx_buffer) + return 0; + return rx_buffer->available(); +} + +int LwIPUDP::read() { + if (!rx_buffer) + return -1; + int out = rx_buffer->read(); + if (!rx_buffer->available()) { + cbuf *b = rx_buffer; + rx_buffer = 0; + delete b; + } + return out; +} + +int LwIPUDP::read(unsigned char *buffer, size_t len) { + return read((char *)buffer, len); +} + +int LwIPUDP::read(char *buffer, size_t len) { + if (!rx_buffer) + return 0; + int out = rx_buffer->read(buffer, len); + if (!rx_buffer->available()) { + cbuf *b = rx_buffer; + rx_buffer = 0; + delete b; + } + return out; +} + +int LwIPUDP::peek() { + if (!rx_buffer) + return -1; + return rx_buffer->peek(); +} + +void LwIPUDP::flush() { + if (!rx_buffer) + return; + cbuf *b = rx_buffer; + rx_buffer = 0; + delete b; +} + +IPAddress LwIPUDP::remoteIP() { + return remote_ip; +} + +uint16_t LwIPUDP::remotePort() { + return remote_port; +} + +#endif diff --git a/cores/common/arduino/libraries/common/WiFiUdp/LwIPUdp.h b/cores/common/arduino/libraries/common/WiFiUdp/LwIPUdp.h new file mode 100644 index 000000000..7ff6d4a7a --- /dev/null +++ b/cores/common/arduino/libraries/common/WiFiUdp/LwIPUdp.h @@ -0,0 +1,49 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-09-10. */ + +#pragma once + +#if (LT_ARD_HAS_WIFI && LT_HAS_LWIP) || DOXYGEN + +#include "WiFiUdp.h" + +#include + +class LwIPUDP : public IWiFiUDP { + private: + int udp_server; + IPAddress multicast_ip; + IPAddress remote_ip; + uint16_t server_port; + uint16_t remote_port; + char *tx_buffer; + size_t tx_buffer_len; + cbuf *rx_buffer; + + public: + LwIPUDP(); + ~LwIPUDP(); + uint8_t begin(IPAddress ip, uint16_t port); + uint8_t begin(uint16_t port); + uint8_t beginMulticast(IPAddress ip, uint16_t port); + void stop(); + int beginMulticastPacket(); + int beginPacket(); + int beginPacket(IPAddress ip, uint16_t port); + int beginPacket(const char *host, uint16_t port); + int endPacket(); + size_t write(uint8_t); + size_t write(const uint8_t *buffer, size_t size); + int parsePacket(); + int available(); + int read(); + int read(unsigned char *buffer, size_t len); + int read(char *buffer, size_t len); + int peek(); + void flush(); + IPAddress remoteIP(); + uint16_t remotePort(); +}; + +typedef LwIPUDP WiFiUDP; + +#endif diff --git a/cores/common/arduino/libraries/common/WiFiUdp/WiFiUdp.h b/cores/common/arduino/libraries/common/WiFiUdp/WiFiUdp.h new file mode 100644 index 000000000..28e018030 --- /dev/null +++ b/cores/common/arduino/libraries/common/WiFiUdp/WiFiUdp.h @@ -0,0 +1,36 @@ +#pragma once + +#include +#include + +class IWiFiUDP : public UDP { + public: + IWiFiUDP() {} + + ~IWiFiUDP() {} + + virtual uint8_t begin(IPAddress ip, uint16_t port) = 0; + virtual uint8_t begin(uint16_t port) = 0; + virtual uint8_t beginMulticast(IPAddress ip, uint16_t port) = 0; + virtual void stop() = 0; + virtual int beginMulticastPacket() = 0; + virtual int beginPacket() = 0; + virtual int beginPacket(IPAddress ip, uint16_t port) = 0; + virtual int beginPacket(const char *host, uint16_t port) = 0; + virtual int endPacket() = 0; + virtual size_t write(uint8_t) = 0; + virtual size_t write(const uint8_t *buffer, size_t size) = 0; + virtual int parsePacket() = 0; + virtual int available() = 0; + virtual int read() = 0; + virtual int read(unsigned char *buffer, size_t len) = 0; + virtual int read(char *buffer, size_t len) = 0; + virtual int peek() = 0; + virtual void flush() = 0; + virtual IPAddress remoteIP() = 0; + virtual uint16_t remotePort() = 0; +}; + +#if LT_ARD_HAS_WIFI && LT_HAS_LWIP +#include "LwIPUdp.h" +#endif diff --git a/cores/common/arduino/libraries/common/mDNS/LwIPmDNS.cpp b/cores/common/arduino/libraries/common/mDNS/LwIPmDNS.cpp new file mode 100644 index 000000000..0f602dbc5 --- /dev/null +++ b/cores/common/arduino/libraries/common/mDNS/LwIPmDNS.cpp @@ -0,0 +1,203 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-05-23. */ + +#if LT_HAS_LWIP2 + +#include "mDNS.h" +#include + +extern "C" { +#include +#include +#include +#include +#include +} + +#if LWIP_VERSION_SIMPLE < 20100 && defined(LWIP_NETIF_EXT_STATUS_CALLBACK) +#warning "LWIP_NETIF_EXT_STATUS_CALLBACK not available before lwIP 2.1.0" +#undef LWIP_NETIF_EXT_STATUS_CALLBACK +#endif + +#if LWIP_MDNS_RESPONDER + +static std::vector services_name; +static std::vector services; +static std::vector protos; +static std::vector ports; +static std::vector> records; + +static const char *hostName; +#ifdef LWIP_NETIF_EXT_STATUS_CALLBACK +NETIF_DECLARE_EXT_CALLBACK(netif_callback) +#endif + +mDNS::mDNS() {} + +mDNS::~mDNS() {} + +static void mdnsTxtCallback(struct mdns_service *service, void *userdata) { + size_t index = (size_t)userdata; + if (index >= records.size()) + return; + + for (const auto record : records[index]) { + err_t err = mdns_resp_add_service_txtitem(service, record, strlen(record)); + if (err != ERR_OK) + return; + } +} + +static void mdnsStatusCallback(struct netif *netif, uint8_t result) { + LT_DM(MDNS, "Status: netif %u, status %u", netif->num, result); +} + +#ifdef LWIP_NETIF_EXT_STATUS_CALLBACK +static void addServices(struct netif *netif) { + for (uint8_t i = 0; i < services.size(); i++) { + LT_DM( + MDNS, + "Add service: netif %u / %s / %s / %u / %u", + netif->num, + services_name[i], + services[i], + protos[i], + ports[i] + ); + mdns_resp_add_service( + netif, + services_name[i], + services[i], + (mdns_sd_proto)protos[i], + ports[i], + 255, + mdnsTxtCallback, + reinterpret_cast(i) // index of newly added service + ); + } +} +#endif + +static bool enableMDNS(struct netif *netif) { + if (netif_is_up(netif)) { + LT_DM(MDNS, "Starting mDNS on netif %u", netif->num); + if ((netif->flags & NETIF_FLAG_IGMP) == 0) { + netif->flags |= NETIF_FLAG_IGMP; + igmp_start(netif); + LT_DM(MDNS, "Added IGMP to netif %u", netif->num); + } + err_t ret = mdns_resp_add_netif(netif, hostName, 255); + if (ret == ERR_OK) { + LT_DM(MDNS, "mDNS started on netif %u, announcing it to network", netif->num); +#if LWIP_VERSION_SIMPLE >= 20100 + mdns_resp_announce(netif); +#else +#warning "lwIP version older than 2.1.0, mdns_resp_announce() unavailable" +#endif + return true; + } else { + LT_DM(MDNS, "Cannot start mDNS on netif %u; ret=%d, errno=%d", netif->num, ret, errno); + } + } + return false; +} + +#ifdef LWIP_NETIF_EXT_STATUS_CALLBACK +static void +mdns_netif_ext_status_callback(struct netif *netif, netif_nsc_reason_t reason, const netif_ext_callback_args_t *args) { + if (reason & LWIP_NSC_NETIF_REMOVED) { + LT_DM(MDNS, "Netif removed, stopping mDNS on netif %u", netif->num); + mdns_resp_remove_netif(netif); + } else if (reason & LWIP_NSC_STATUS_CHANGED) { + LT_DM(MDNS, "Netif changed, starting mDNS on netif %u", netif->num); + if (enableMDNS(netif) && services.size() > 0) { + LT_DM(MDNS, "Adding services to netif %u", netif->num); + addServices(netif); + } + } +} +#endif + +bool mDNS::begin(const char *hostname) { + hostName = strdup(hostname); + setInstanceName(hostname); +#ifdef LWIP_NETIF_EXT_STATUS_CALLBACK + netif_add_ext_callback(&netif_callback, mdns_netif_ext_status_callback); +#endif + LT_DM(MDNS, "Starting (%s)", hostname); +#if LWIP_VERSION_MAJOR >= 2 && LWIP_VERSION_MINOR >= 1 + mdns_resp_register_name_result_cb(mdnsStatusCallback); +#endif + mdns_resp_init(); + struct netif *netif; + for (netif = netif_list; netif != NULL; netif = netif->next) { + enableMDNS(netif); + } + return true; +} + +void mDNS::end() { + struct netif *netif = netif_list; + while (netif != NULL) { + if (netif_is_up(netif)) + mdns_resp_remove_netif(netif); + netif = netif->next; + } +} + +bool mDNS::addServiceImpl(const char *name, const char *service, uint8_t proto, uint16_t port) { + bool added = false; + struct netif *netif = netif_list; + while (netif != NULL) { + if (netif_is_up(netif)) { + // register TXT callback; + // pass service index as userdata parameter + LT_DM(MDNS, "Add service: netif %u / %s / %s / %u / %u", netif->num, name, service, proto, port); + mdns_resp_add_service( + netif, + name, + service, + (mdns_sd_proto)proto, + port, + 255, + mdnsTxtCallback, + (void *)services.size() // index of newly added service + ); + added = true; + } + netif = netif->next; + } + + if (!added) + return false; + + // add the service to TXT record arrays + services_name.push_back(strdup(name)); + services.push_back(strdup(service)); + protos.push_back(proto); + ports.push_back(port); + records.emplace_back(); + + return true; +} + +bool mDNS::addServiceTxtImpl(const char *service, uint8_t proto, const char *item) { + int8_t index = -1; + for (uint8_t i = 0; i < services.size(); i++) { + // find a matching service + if (strcmp(services[i], service) == 0 && protos[i] == proto) { + index = i; + break; + } + } + if (index == -1) + return false; + + records[index].push_back(strdup(item)); + return true; +} + +MDNSResponder MDNS; + +#endif + +#endif diff --git a/cores/common/arduino/libraries/common/mDNS/mDNS.cpp b/cores/common/arduino/libraries/common/mDNS/mDNS.cpp new file mode 100644 index 000000000..4de68fdea --- /dev/null +++ b/cores/common/arduino/libraries/common/mDNS/mDNS.cpp @@ -0,0 +1,40 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-08-26. */ + +#include "mDNS.h" + +static char *ensureUnderscore(const char *value) { + uint8_t len = strlen(value) + 1; + char *result = (char *)malloc(len); + result[0] = '_'; + strcpy(result + 1, value + (value[0] == '_')); + return result; +} + +void mDNS::setInstanceName(const char *name) { + if (instanceName) + free(instanceName); + instanceName = strdup(name); +} + +bool mDNS::addService(char *service, char *proto, uint16_t port) { + char *_service = ensureUnderscore(service); + uint8_t _proto = strncmp(proto + (proto[0] == '_'), "tcp", 3) == 0 ? MDNS_TCP : MDNS_UDP; + + bool result = addServiceImpl(instanceName ? instanceName : "LT mDNS", _service, _proto, port); + free(_service); + return result; +} + +bool mDNS::addServiceTxt(char *service, char *proto, char *key, char *value) { + char *_service = ensureUnderscore(service); + uint8_t _proto = strncmp(proto + (proto[0] == '_'), "tcp", 3) == 0 ? MDNS_TCP : MDNS_UDP; + + uint8_t txt_len = strlen(key) + strlen(value) + 1; + char *txt = (char *)malloc(txt_len + 1); + sprintf(txt, "%s=%s", key, value); + + bool result = addServiceTxtImpl(_service, _proto, txt); + free(_service); + free(txt); + return result; +} diff --git a/cores/common/arduino/libraries/common/mDNS/mDNS.h b/cores/common/arduino/libraries/common/mDNS/mDNS.h new file mode 100644 index 000000000..6a15cd39b --- /dev/null +++ b/cores/common/arduino/libraries/common/mDNS/mDNS.h @@ -0,0 +1,128 @@ +/* +ESP8266 Multicast DNS (port of CC3000 Multicast DNS library) +Version 1.1 +Copyright (c) 2013 Tony DiCola (tony@tonydicola.com) +ESP8266 port (c) 2015 Ivan Grokhotkov (ivan@esp8266.com) +MDNS-SD Suport 2015 Hristo Gochkov (hristo@espressif.com) +Extended MDNS-SD support 2016 Lars Englund (lars.englund@gmail.com) +Rewritten for ESP32 by Hristo Gochkov (hristo@espressif.com) + +This is a simple implementation of multicast DNS query support for an Arduino +running on ESP32 chip. + +Usage: +- Include the ESP32 Multicast DNS library in the sketch. +- Call the begin method in the sketch's setup and provide a domain name (without + the '.local' suffix, i.e. just provide 'foo' to resolve 'foo.local'), and the + Adafruit CC3000 class instance. Optionally provide a time to live (in seconds) + for the DNS record--the default is 1 hour. +- Call the update method in each iteration of the sketch's loop function. + +License (MIT license): + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + THE SOFTWARE. + +*/ + +#pragma once + +#include +#include + +#define MDNS_UDP 0 +#define MDNS_TCP 1 + +class mDNS { + private: + bool addServiceImpl(const char *name, const char *service, uint8_t proto, uint16_t port); + bool addServiceTxtImpl(const char *service, uint8_t proto, const char *item); + + char *instanceName = NULL; + + public: + mDNS(); + ~mDNS(); + + bool begin(const char *hostname); + void end(); + + void setInstanceName(const char *name); + bool addService(char *service, char *proto, uint16_t port); + bool addServiceTxt(char *service, char *proto, char *key, char *value); + // void enableArduino(uint16_t port = 3232, bool auth = false); + // void disableArduino(); + // void enableWorkstation(esp_interface_t interface = ESP_IF_WIFI_STA); + // void disableWorkstation(); + + IPAddress queryHost(char *host, uint32_t timeout = 2000); + int queryService(char *service, char *proto); + + String hostname(int idx); + IPAddress IP(int idx); + IPv6Address IPv6(int idx); + uint16_t port(int idx); + int numTxt(int idx); + bool hasTxt(int idx, const char *key); + String txt(int idx, const char *key); + String txt(int idx, int txtIdx); + String txtKey(int idx, int txtIdx); + + void setInstanceName(String name) { + setInstanceName(name.c_str()); + } + + void setInstanceName(char *name) { + setInstanceName((const char *)name); + } + + bool addService(const char *service, const char *proto, uint16_t port) { + return addService((char *)service, (char *)proto, port); + } + + bool addService(String service, String proto, uint16_t port) { + return addService(service.c_str(), proto.c_str(), port); + } + + void addServiceTxt(const char *service, const char *proto, const char *key, const char *value) { + addServiceTxt((char *)service, (char *)proto, (char *)key, (char *)value); + } + + void addServiceTxt(String service, String proto, String key, String value) { + addServiceTxt(service.c_str(), proto.c_str(), key.c_str(), value.c_str()); + } + + IPAddress queryHost(const char *host, uint32_t timeout = 2000) { + return queryHost((char *)host, timeout); + } + + IPAddress queryHost(String host, uint32_t timeout = 2000) { + return queryHost(host.c_str(), timeout); + } + + int queryService(const char *service, const char *proto) { + return queryService((char *)service, (char *)proto); + } + + int queryService(String service, String proto) { + return queryService(service.c_str(), proto.c_str()); + } +}; + +typedef mDNS MDNSResponder; + +extern MDNSResponder MDNS; diff --git a/cores/common/arduino/libraries/ext/HTTPClient/HTTPClient.cpp b/cores/common/arduino/libraries/ext/HTTPClient/HTTPClient.cpp new file mode 100644 index 000000000..c99ea3c24 --- /dev/null +++ b/cores/common/arduino/libraries/ext/HTTPClient/HTTPClient.cpp @@ -0,0 +1,1625 @@ +/** + * HTTPClient.cpp + * + * Created on: 02.11.2015 + * + * Copyright (c) 2015 Markus Sattler. All rights reserved. + * This file is part of the HTTPClient for Arduino. + * Port to ESP32 by Evandro Luis Copercini (2017), + * changed fingerprints to CA verification. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + * Adapted in October 2018 + */ + +#if LT_ARD_HAS_WIFI + +#include + +#ifdef HTTPCLIENT_1_1_COMPATIBLE +#include +#include +#endif + +// #include +#include + +#include "HTTPClient.h" + +/// Cookie jar support +#include + +#ifdef HTTPCLIENT_1_1_COMPATIBLE +class TransportTraits { + public: + virtual ~TransportTraits() {} + + virtual std::unique_ptr create() { + return std::unique_ptr(new WiFiClient()); + } + + virtual bool verify(WiFiClient &client, const char *host) { + return true; + } +}; + +class TLSTraits : public TransportTraits { + public: + TLSTraits(const char *CAcert, const char *clicert = nullptr, const char *clikey = nullptr) + : _cacert(CAcert), _clicert(clicert), _clikey(clikey) {} + + std::unique_ptr create() override { + return std::unique_ptr(new WiFiClientSecure()); + } + + bool verify(WiFiClient &client, const char *host) override { + WiFiClientSecure &wcs = static_cast(client); + if (_cacert == nullptr) { + wcs.setInsecure(); + } else { + wcs.setCACert(_cacert); + wcs.setCertificate(_clicert); + wcs.setPrivateKey(_clikey); + } + return true; + } + + protected: + const char *_cacert; + const char *_clicert; + const char *_clikey; +}; +#endif // HTTPCLIENT_1_1_COMPATIBLE + +/** + * constructor + */ +HTTPClient::HTTPClient() {} + +/** + * destructor + */ +HTTPClient::~HTTPClient() { + if (_client) { + _client->stop(); + } + if (_currentHeaders) { + delete[] _currentHeaders; + } + if (_tcpDeprecated) { + _tcpDeprecated.reset(nullptr); + } + if (_transportTraits) { + _transportTraits.reset(nullptr); + } +} + +void HTTPClient::clear() { + _returnCode = 0; + _size = -1; + _headers = ""; +} + +/** + * parsing the url for all needed parameters + * @param client Client& + * @param url String + * @param https bool + * @return success bool + */ +bool HTTPClient::begin(WiFiClient &client, String url) { +#ifdef HTTPCLIENT_1_1_COMPATIBLE + if (_tcpDeprecated) { + log_d("mix up of new and deprecated api"); + _canReuse = false; + end(); + } +#endif + + _client = &client; + + // check for : (http: or https:) + int index = url.indexOf(':'); + if (index < 0) { + log_d("failed to parse protocol"); + return false; + } + + String protocol = url.substring(0, index); + if (protocol != "http" && protocol != "https") { + log_d("unknown protocol '%s'", protocol.c_str()); + return false; + } + + _port = (protocol == "https" ? 443 : 80); + _secure = (protocol == "https"); + return beginInternal(url, protocol.c_str()); +} + +/** + * directly supply all needed parameters + * @param client Client& + * @param host String + * @param port uint16_t + * @param uri String + * @param https bool + * @return success bool + */ +bool HTTPClient::begin(WiFiClient &client, String host, uint16_t port, String uri, bool https) { +#ifdef HTTPCLIENT_1_1_COMPATIBLE + if (_tcpDeprecated) { + log_d("mix up of new and deprecated api"); + _canReuse = false; + end(); + } +#endif + + _client = &client; + + clear(); + _host = host; + _port = port; + _uri = uri; + _protocol = (https ? "https" : "http"); + _secure = https; + return true; +} + +#ifdef HTTPCLIENT_1_1_COMPATIBLE +bool HTTPClient::begin(String url, const char *CAcert) { + if (_client && !_tcpDeprecated) { + log_d("mix up of new and deprecated api"); + _canReuse = false; + end(); + } + + clear(); + _port = 443; + if (!beginInternal(url, "https")) { + return false; + } + _secure = true; + _transportTraits = TransportTraitsPtr(new TLSTraits(CAcert)); + if (!_transportTraits) { + log_e("could not create transport traits"); + return false; + } + + return true; +} + +/** + * parsing the url for all needed parameters + * @param url String + */ +bool HTTPClient::begin(String url) { + if (_client && !_tcpDeprecated) { + log_d("mix up of new and deprecated api"); + _canReuse = false; + end(); + } + + clear(); + _port = 80; + if (!beginInternal(url, "http")) { + return begin(url, (const char *)NULL); + } + _transportTraits = TransportTraitsPtr(new TransportTraits()); + if (!_transportTraits) { + log_e("could not create transport traits"); + return false; + } + + return true; +} +#endif // HTTPCLIENT_1_1_COMPATIBLE + +bool HTTPClient::beginInternal(String url, const char *expectedProtocol) { + log_v("url: %s", url.c_str()); + + // check for : (http: or https: + int index = url.indexOf(':'); + if (index < 0) { + log_e("failed to parse protocol"); + return false; + } + + _protocol = url.substring(0, index); + if (_protocol != expectedProtocol) { + log_d("unexpected protocol: %s, expected %s", _protocol.c_str(), expectedProtocol); + return false; + } + + url.remove(0, (index + 3)); // remove http:// or https:// + + index = url.indexOf('/'); + if (index == -1) { + index = url.length(); + url += '/'; + } + String host = url.substring(0, index); + url.remove(0, index); // remove host part + + // get Authorization + index = host.indexOf('@'); + if (index >= 0) { + // auth info + String auth = host.substring(0, index); + host.remove(0, index + 1); // remove auth part including @ + _base64Authorization = base64::encode(auth); + } + + // get port + index = host.indexOf(':'); + String the_host; + if (index >= 0) { + the_host = host.substring(0, index); // hostname + host.remove(0, (index + 1)); // remove hostname + : + _port = host.toInt(); // get port + } else { + the_host = host; + } + if (_host != the_host && connected()) { + log_d("switching host from '%s' to '%s'. disconnecting first", _host.c_str(), the_host.c_str()); + _canReuse = false; + disconnect(true); + } + _host = the_host; + _uri = url; + log_d("protocol: %s, host: %s port: %d url: %s", _protocol.c_str(), _host.c_str(), _port, _uri.c_str()); + return true; +} + +#ifdef HTTPCLIENT_1_1_COMPATIBLE +bool HTTPClient::begin(String host, uint16_t port, String uri) { + if (_client && !_tcpDeprecated) { + log_d("mix up of new and deprecated api"); + _canReuse = false; + end(); + } + + clear(); + _host = host; + _port = port; + _uri = uri; + _transportTraits = TransportTraitsPtr(new TransportTraits()); + log_d("host: %s port: %d uri: %s", host.c_str(), port, uri.c_str()); + return true; +} + +bool HTTPClient::begin(String host, uint16_t port, String uri, const char *CAcert) { + if (_client && !_tcpDeprecated) { + log_d("mix up of new and deprecated api"); + _canReuse = false; + end(); + } + + clear(); + _host = host; + _port = port; + _uri = uri; + + if (strlen(CAcert) == 0) { + return false; + } + _secure = true; + _transportTraits = TransportTraitsPtr(new TLSTraits(CAcert)); + return true; +} + +bool HTTPClient::begin( + String host, uint16_t port, String uri, const char *CAcert, const char *cli_cert, const char *cli_key +) { + if (_client && !_tcpDeprecated) { + log_d("mix up of new and deprecated api"); + _canReuse = false; + end(); + } + + clear(); + _host = host; + _port = port; + _uri = uri; + + if (strlen(CAcert) == 0) { + return false; + } + _secure = true; + _transportTraits = TransportTraitsPtr(new TLSTraits(CAcert, cli_cert, cli_key)); + return true; +} +#endif // HTTPCLIENT_1_1_COMPATIBLE + +/** + * end + * called after the payload is handled + */ +void HTTPClient::end(void) { + disconnect(false); + clear(); +} + +/** + * disconnect + * close the TCP socket + */ +void HTTPClient::disconnect(bool preserveClient) { + if (connected()) { + if (_client->available() > 0) { + log_d("still data in buffer (%d), clean up.\n", _client->available()); + _client->flush(); + } + + if (_reuse && _canReuse) { + log_d("tcp keep open for reuse"); + } else { + log_d("tcp stop"); + _client->stop(); + if (!preserveClient) { + _client = nullptr; +#ifdef HTTPCLIENT_1_1_COMPATIBLE + if (_tcpDeprecated) { + _transportTraits.reset(nullptr); + _tcpDeprecated.reset(nullptr); + } +#endif + } + } + } else { + log_d("tcp is closed\n"); + } +} + +/** + * connected + * @return connected status + */ +bool HTTPClient::connected() { + if (_client) { + return ((_client->available() > 0) || _client->connected()); + } + return false; +} + +/** + * try to reuse the connection to the server + * keep-alive + * @param reuse bool + */ +void HTTPClient::setReuse(bool reuse) { + _reuse = reuse; +} + +/** + * set User Agent + * @param userAgent const char * + */ +void HTTPClient::setUserAgent(const String &userAgent) { + _userAgent = userAgent; +} + +/** + * set the Authorizatio for the http request + * @param user const char * + * @param password const char * + */ +void HTTPClient::setAuthorization(const char *user, const char *password) { + if (user && password) { + String auth = user; + auth += ":"; + auth += password; + _base64Authorization = base64::encode(auth); + } +} + +/** + * set the Authorizatio for the http request + * @param auth const char * base64 + */ +void HTTPClient::setAuthorization(const char *auth) { + if (auth) { + _base64Authorization = auth; + } +} + +/** + * set the Authorization type for the http request + * @param authType const char * + */ +void HTTPClient::setAuthorizationType(const char *authType) { + if (authType) { + _authorizationType = authType; + } +} + +/** + * set the timeout (ms) for establishing a connection to the server + * @param connectTimeout int32_t + */ +void HTTPClient::setConnectTimeout(int32_t connectTimeout) { + _connectTimeout = connectTimeout; +} + +/** + * set the timeout for the TCP connection + * @param timeout unsigned int + */ +void HTTPClient::setTimeout(uint16_t timeout) { + _tcpTimeout = timeout; + if (connected()) { + _client->setTimeout((timeout + 500) / 1000); + } +} + +/** + * use HTTP1.0 + * @param use + */ +void HTTPClient::useHTTP10(bool useHTTP10) { + _useHTTP10 = useHTTP10; + _reuse = !useHTTP10; +} + +/** + * send a GET request + * @return http code + */ +int HTTPClient::GET() { + return sendRequest("GET"); +} + +/** + * sends a post request to the server + * @param payload uint8_t * + * @param size size_t + * @return http code + */ +int HTTPClient::POST(uint8_t *payload, size_t size) { + return sendRequest("POST", payload, size); +} + +int HTTPClient::POST(String payload) { + return POST((uint8_t *)payload.c_str(), payload.length()); +} + +/** + * sends a patch request to the server + * @param payload uint8_t * + * @param size size_t + * @return http code + */ +int HTTPClient::PATCH(uint8_t *payload, size_t size) { + return sendRequest("PATCH", payload, size); +} + +int HTTPClient::PATCH(String payload) { + return PATCH((uint8_t *)payload.c_str(), payload.length()); +} + +/** + * sends a put request to the server + * @param payload uint8_t * + * @param size size_t + * @return http code + */ +int HTTPClient::PUT(uint8_t *payload, size_t size) { + return sendRequest("PUT", payload, size); +} + +int HTTPClient::PUT(String payload) { + return PUT((uint8_t *)payload.c_str(), payload.length()); +} + +/** + * sendRequest + * @param type const char * "GET", "POST", .... + * @param payload String data for the message body + * @return + */ +int HTTPClient::sendRequest(const char *type, String payload) { + return sendRequest(type, (uint8_t *)payload.c_str(), payload.length()); +} + +/** + * sendRequest + * @param type const char * "GET", "POST", .... + * @param payload uint8_t * data for the message body if null not send + * @param size size_t size for the message body if 0 not send + * @return -1 if no info or > 0 when Content-Length is set by server + */ +int HTTPClient::sendRequest(const char *type, uint8_t *payload, size_t size) { + int code; + bool redirect = false; + uint16_t redirectCount = 0; + do { + // wipe out any existing headers from previous request + for (size_t i = 0; i < _headerKeysCount; i++) { + if (_currentHeaders[i].value.length() > 0) { + _currentHeaders[i].value = ""; // LT: changed from clear() + } + } + + log_d("request type: '%s' redirCount: %d\n", type, redirectCount); + + // connect to server + if (!connect()) { + return returnError(HTTPC_ERROR_CONNECTION_REFUSED); + } + + if (payload && size > 0) { + addHeader(F("Content-Length"), String(size)); + } + + // add cookies to header, if present + String cookie_string; + if (generateCookieString(&cookie_string)) { + addHeader("Cookie", cookie_string); + } + + // send Header + if (!sendHeader(type)) { + return returnError(HTTPC_ERROR_SEND_HEADER_FAILED); + } + + // send Payload if needed + if (payload && size > 0) { + if (_client->write(&payload[0], size) != size) { + return returnError(HTTPC_ERROR_SEND_PAYLOAD_FAILED); + } + } + + code = handleHeaderResponse(); + log_d("sendRequest code=%d\n", code); + + // Handle redirections as stated in RFC document: + // https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html + // + // Implementing HTTP_CODE_FOUND as redirection with GET method, + // to follow most of existing user agent implementations. + // + redirect = false; + if (_followRedirects != HTTPC_DISABLE_FOLLOW_REDIRECTS && redirectCount < _redirectLimit && + _location.length() > 0) { + switch (code) { + // redirecting using the same method + case HTTP_CODE_MOVED_PERMANENTLY: + case HTTP_CODE_TEMPORARY_REDIRECT: { + if ( + // allow to force redirections on other methods + // (the RFC require user to accept the redirection) + _followRedirects == HTTPC_FORCE_FOLLOW_REDIRECTS || + // allow GET and HEAD methods without force + !strcmp(type, "GET") || + !strcmp(type, "HEAD") + ) { + redirectCount += 1; + log_d( + "following redirect (the same method): '%s' redirCount: %d\n", + _location.c_str(), + redirectCount + ); + if (!setURL(_location)) { + log_d("failed setting URL for redirection\n"); + // no redirection + break; + } + // redirect using the same request method and payload, diffrent URL + redirect = true; + } + break; + } + // redirecting with method dropped to GET or HEAD + // note: it does not need `HTTPC_FORCE_FOLLOW_REDIRECTS` for any method + case HTTP_CODE_FOUND: + case HTTP_CODE_SEE_OTHER: { + redirectCount += 1; + log_d( + "following redirect (dropped to GET/HEAD): '%s' redirCount: %d\n", + _location.c_str(), + redirectCount + ); + if (!setURL(_location)) { + log_d("failed setting URL for redirection\n"); + // no redirection + break; + } + // redirect after changing method to GET/HEAD and dropping payload + type = "GET"; + payload = nullptr; + size = 0; + redirect = true; + break; + } + + default: + break; + } + } + + } while (redirect); + // handle Server Response (Header) + return returnError(code); +} + +/** + * sendRequest + * @param type const char * "GET", "POST", .... + * @param stream Stream * data stream for the message body + * @param size size_t size for the message body if 0 not Content-Length is send + * @return -1 if no info or > 0 when Content-Length is set by server + */ +int HTTPClient::sendRequest(const char *type, Stream *stream, size_t size) { + + if (!stream) { + return returnError(HTTPC_ERROR_NO_STREAM); + } + + // connect to server + if (!connect()) { + return returnError(HTTPC_ERROR_CONNECTION_REFUSED); + } + + if (size > 0) { + addHeader("Content-Length", String(size)); + } + + // add cookies to header, if present + String cookie_string; + if (generateCookieString(&cookie_string)) { + addHeader("Cookie", cookie_string); + } + + // send Header + if (!sendHeader(type)) { + return returnError(HTTPC_ERROR_SEND_HEADER_FAILED); + } + + int buff_size = HTTP_TCP_BUFFER_SIZE; + + int len = size; + int bytesWritten = 0; + + if (len == 0) { + len = -1; + } + + // if possible create smaller buffer then HTTP_TCP_BUFFER_SIZE + if ((len > 0) && (len < HTTP_TCP_BUFFER_SIZE)) { + buff_size = len; + } + + // create buffer for read + uint8_t *buff = (uint8_t *)malloc(buff_size); + + if (buff) { + // read all data from stream and send it to server + while (connected() && (stream->available() > -1) && (len > 0 || len == -1)) { + + // get available data size + int sizeAvailable = stream->available(); + + if (sizeAvailable) { + + int readBytes = sizeAvailable; + + // read only the asked bytes + if (len > 0 && readBytes > len) { + readBytes = len; + } + + // not read more the buffer can handle + if (readBytes > buff_size) { + readBytes = buff_size; + } + + // read data + int bytesRead = stream->readBytes(buff, readBytes); + + // write it to Stream + int bytesWrite = _client->write((const uint8_t *)buff, bytesRead); + bytesWritten += bytesWrite; + + // are all Bytes a writen to stream ? + if (bytesWrite != bytesRead) { + log_d("short write, asked for %d but got %d retry...", bytesRead, bytesWrite); + + // check for write error + if (_client->getWriteError()) { + log_d("stream write error %d", _client->getWriteError()); + + // reset write error for retry + _client->clearWriteError(); + } + + // some time for the stream + delay(1); + + int leftBytes = (readBytes - bytesWrite); + + // retry to send the missed bytes + bytesWrite = _client->write((const uint8_t *)(buff + bytesWrite), leftBytes); + bytesWritten += bytesWrite; + + if (bytesWrite != leftBytes) { + // failed again + log_d("short write, asked for %d but got %d failed.", leftBytes, bytesWrite); + free(buff); + return returnError(HTTPC_ERROR_SEND_PAYLOAD_FAILED); + } + } + + // check for write error + if (_client->getWriteError()) { + log_d("stream write error %d", _client->getWriteError()); + free(buff); + return returnError(HTTPC_ERROR_SEND_PAYLOAD_FAILED); + } + + // count bytes to read left + if (len > 0) { + len -= readBytes; + } + + delay(0); + } else { + delay(1); + } + } + + free(buff); + + if (size && (int)size != bytesWritten) { + log_d("Stream payload bytesWritten %d and size %d mismatch!.", bytesWritten, size); + log_d("ERROR SEND PAYLOAD FAILED!"); + return returnError(HTTPC_ERROR_SEND_PAYLOAD_FAILED); + } else { + log_d("Stream payload written: %d", bytesWritten); + } + + } else { + log_d("too less ram! need %d", HTTP_TCP_BUFFER_SIZE); + return returnError(HTTPC_ERROR_TOO_LESS_RAM); + } + + // handle Server Response (Header) + return returnError(handleHeaderResponse()); +} + +/** + * size of message body / payload + * @return -1 if no info or > 0 when Content-Length is set by server + */ +int HTTPClient::getSize(void) { + return _size; +} + +/** + * returns the stream of the tcp connection + * @return WiFiClient + */ +WiFiClient &HTTPClient::getStream(void) { + if (connected()) { + return *_client; + } + + log_w("getStream: not connected"); + static WiFiClient empty; + return empty; +} + +/** + * returns a pointer to the stream of the tcp connection + * @return WiFiClient* + */ +WiFiClient *HTTPClient::getStreamPtr(void) { + if (connected()) { + return _client; + } + + log_w("getStreamPtr: not connected"); + return nullptr; +} + +/** + * write all message body / payload to Stream + * @param stream Stream * + * @return bytes written ( negative values are error codes ) + */ +int HTTPClient::writeToStream(Stream *stream) { + + if (!stream) { + return returnError(HTTPC_ERROR_NO_STREAM); + } + + if (!connected()) { + return returnError(HTTPC_ERROR_NOT_CONNECTED); + } + + // get length of document (is -1 when Server sends no Content-Length header) + int len = _size; + int ret = 0; + + if (_transferEncoding == HTTPC_TE_IDENTITY) { + ret = writeToStreamDataBlock(stream, len); + + // have we an error? + if (ret < 0) { + return returnError(ret); + } + } else if (_transferEncoding == HTTPC_TE_CHUNKED) { + int size = 0; + while (1) { + if (!connected()) { + return returnError(HTTPC_ERROR_CONNECTION_LOST); + } + String chunkHeader = _client->readStringUntil('\n'); + + if (chunkHeader.length() <= 0) { + return returnError(HTTPC_ERROR_READ_TIMEOUT); + } + + chunkHeader.trim(); // remove \r + + // read size of chunk + len = (uint32_t)strtol((const char *)chunkHeader.c_str(), NULL, 16); + size += len; + log_d(" read chunk len: %d", len); + + // data left? + if (len > 0) { + int r = writeToStreamDataBlock(stream, len); + if (r < 0) { + // error in writeToStreamDataBlock + return returnError(r); + } + ret += r; + } else { + + // if no length Header use global chunk size + if (_size <= 0) { + _size = size; + } + + // check if we have write all data out + if (ret != _size) { + return returnError(HTTPC_ERROR_STREAM_WRITE); + } + break; + } + + // read trailing \r\n at the end of the chunk + char buf[2]; + auto trailing_seq_len = _client->readBytes((uint8_t *)buf, 2); + if (trailing_seq_len != 2 || buf[0] != '\r' || buf[1] != '\n') { + return returnError(HTTPC_ERROR_READ_TIMEOUT); + } + + delay(0); + } + } else { + return returnError(HTTPC_ERROR_ENCODING); + } + + // end(); + disconnect(true); + return ret; +} + +/** + * return all payload as String (may need lot of ram or trigger out of memory!) + * @return String + */ +/* String HTTPClient::getString(void) { + // _size can be -1 when Server sends no Content-Length header + if (_size > 0 || _size == -1) { + StreamString sstring; + // try to reserve needed memory (noop if _size == -1) + if (sstring.reserve((_size + 1))) { + writeToStream(&sstring); + return sstring; + } else { + log_d("not enough memory to reserve a string! need: %d", (_size + 1)); + } + } + + return ""; +} */ + +/** + * converts error code to String + * @param error int + * @return String + */ +String HTTPClient::errorToString(int error) { + switch (error) { + case HTTPC_ERROR_CONNECTION_REFUSED: + return F("connection refused"); + case HTTPC_ERROR_SEND_HEADER_FAILED: + return F("send header failed"); + case HTTPC_ERROR_SEND_PAYLOAD_FAILED: + return F("send payload failed"); + case HTTPC_ERROR_NOT_CONNECTED: + return F("not connected"); + case HTTPC_ERROR_CONNECTION_LOST: + return F("connection lost"); + case HTTPC_ERROR_NO_STREAM: + return F("no stream"); + case HTTPC_ERROR_NO_HTTP_SERVER: + return F("no HTTP server"); + case HTTPC_ERROR_TOO_LESS_RAM: + return F("too less ram"); + case HTTPC_ERROR_ENCODING: + return F("Transfer-Encoding not supported"); + case HTTPC_ERROR_STREAM_WRITE: + return F("Stream write error"); + case HTTPC_ERROR_READ_TIMEOUT: + return F("read Timeout"); + default: + return String(); + } +} + +/** + * adds Header to the request + * @param name + * @param value + * @param first + */ +void HTTPClient::addHeader(const String &name, const String &value, bool first, bool replace) { + // not allow set of Header handled by code + if (!name.equalsIgnoreCase(F("Connection")) && !name.equalsIgnoreCase(F("User-Agent")) && + !name.equalsIgnoreCase(F("Host")) && + !(name.equalsIgnoreCase(F("Authorization")) && _base64Authorization.length())) { + + String headerLine = name; + headerLine += ": "; + + if (replace) { + int headerStart = _headers.indexOf(headerLine); + if (headerStart != -1 && (headerStart == 0 || _headers[headerStart - 1] == '\n')) { + int headerEnd = _headers.indexOf('\n', headerStart); + _headers = _headers.substring(0, headerStart) + _headers.substring(headerEnd + 1); + } + } + + headerLine += value; + headerLine += "\r\n"; + if (first) { + _headers = headerLine + _headers; + } else { + _headers += headerLine; + } + } +} + +void HTTPClient::collectHeaders(const char *headerKeys[], const size_t headerKeysCount) { + _headerKeysCount = headerKeysCount; + if (_currentHeaders) { + delete[] _currentHeaders; + } + _currentHeaders = new RequestArgument[_headerKeysCount]; + for (size_t i = 0; i < _headerKeysCount; i++) { + _currentHeaders[i].key = headerKeys[i]; + } +} + +String HTTPClient::header(const char *name) { + for (size_t i = 0; i < _headerKeysCount; ++i) { + if (_currentHeaders[i].key == name) { + return _currentHeaders[i].value; + } + } + return String(); +} + +String HTTPClient::header(size_t i) { + if (i < _headerKeysCount) { + return _currentHeaders[i].value; + } + return String(); +} + +String HTTPClient::headerName(size_t i) { + if (i < _headerKeysCount) { + return _currentHeaders[i].key; + } + return String(); +} + +int HTTPClient::headers() { + return _headerKeysCount; +} + +bool HTTPClient::hasHeader(const char *name) { + for (size_t i = 0; i < _headerKeysCount; ++i) { + if ((_currentHeaders[i].key == name) && (_currentHeaders[i].value.length() > 0)) { + return true; + } + } + return false; +} + +/** + * init TCP connection and handle ssl verify if needed + * @return true if connection is ok + */ +bool HTTPClient::connect(void) { + if (connected()) { + if (_reuse) { + log_d("already connected, reusing connection"); + } else { + log_d("already connected, try reuse!"); + } + while (_client->available() > 0) { + _client->read(); + } + return true; + } + +#ifdef HTTPCLIENT_1_1_COMPATIBLE + if (_transportTraits && !_client) { + _tcpDeprecated = _transportTraits->create(); + if (!_tcpDeprecated) { + log_e("failed to create client"); + return false; + } + _client = _tcpDeprecated.get(); + } +#endif + + if (!_client) { + log_d("HTTPClient::begin was not called or returned error"); + return false; + } +#ifdef HTTPCLIENT_1_1_COMPATIBLE + if (_tcpDeprecated && !_transportTraits->verify(*_client, _host.c_str())) { + log_d("transport level verify failed"); + _client->stop(); + return false; + } +#endif + if (!_client->connect(_host.c_str(), _port, _connectTimeout)) { + log_d("failed connect to %s:%u", _host.c_str(), _port); + return false; + } + + // set Timeout for WiFiClient and for Stream::readBytesUntil() and Stream::readStringUntil() + _client->setTimeout((_tcpTimeout + 500) / 1000); + + log_d(" connected to %s:%u", _host.c_str(), _port); + + /* + #ifdef ESP8266 + _client->setNoDelay(true); + #endif + */ + return connected(); +} + +/** + * sends HTTP request header + * @param type (GET, POST, ...) + * @return status + */ +bool HTTPClient::sendHeader(const char *type) { + if (!connected()) { + return false; + } + + String header = String(type) + " " + _uri + F(" HTTP/1."); + + if (_useHTTP10) { + header += "0"; + } else { + header += "1"; + } + + header += String(F("\r\nHost: ")) + _host; + if (_port != 80 && _port != 443) { + header += ':'; + header += String(_port); + } + header += String(F("\r\nUser-Agent: ")) + _userAgent + F("\r\nConnection: "); + + if (_reuse) { + header += F("keep-alive"); + } else { + header += F("close"); + } + header += "\r\n"; + + if (!_useHTTP10) { + header += F("Accept-Encoding: identity;q=1,chunked;q=0.1,*;q=0\r\n"); + } + + if (_base64Authorization.length()) { + _base64Authorization.replace("\n", ""); + header += F("Authorization: "); + header += _authorizationType; + header += " "; + header += _base64Authorization; + header += "\r\n"; + } + + header += _headers + "\r\n"; + + return (_client->write((const uint8_t *)header.c_str(), header.length()) == header.length()); +} + +/** + * reads the response from the server + * @return int http code + */ +int HTTPClient::handleHeaderResponse() { + + if (!connected()) { + return HTTPC_ERROR_NOT_CONNECTED; + } + + _returnCode = 0; + _size = -1; + _canReuse = _reuse; + + String transferEncoding; + + _transferEncoding = HTTPC_TE_IDENTITY; + unsigned long lastDataTime = millis(); + bool firstLine = true; + String date; + + while (connected()) { + size_t len = _client->available(); + if (len > 0) { + String headerLine = _client->readStringUntil('\n'); + headerLine.trim(); // remove \r + + lastDataTime = millis(); + + log_v("RX: '%s'", headerLine.c_str()); + + if (firstLine) { + firstLine = false; + if (_canReuse && headerLine.startsWith("HTTP/1.")) { + _canReuse = (headerLine[sizeof "HTTP/1." - 1] != '0'); + } + int codePos = headerLine.indexOf(' ') + 1; + _returnCode = headerLine.substring(codePos, headerLine.indexOf(' ', codePos)).toInt(); + } else if (headerLine.indexOf(':')) { + String headerName = headerLine.substring(0, headerLine.indexOf(':')); + String headerValue = headerLine.substring(headerLine.indexOf(':') + 1); + headerValue.trim(); + + if (headerName.equalsIgnoreCase("Date")) { + date = headerValue; + } + + if (headerName.equalsIgnoreCase("Content-Length")) { + _size = headerValue.toInt(); + } + + if (_canReuse && headerName.equalsIgnoreCase("Connection")) { + if (headerValue.indexOf("close") >= 0 && headerValue.indexOf("keep-alive") < 0) { + _canReuse = false; + } + } + + if (headerName.equalsIgnoreCase("Transfer-Encoding")) { + transferEncoding = headerValue; + } + + if (headerName.equalsIgnoreCase("Location")) { + _location = headerValue; + } + + if (headerName.equalsIgnoreCase("Set-Cookie")) { + setCookie(date, headerValue); + } + + for (size_t i = 0; i < _headerKeysCount; i++) { + if (_currentHeaders[i].key.equalsIgnoreCase(headerName)) { + // Uncomment the following lines if you need to add support for multiple headers with the same + // key: if (!_currentHeaders[i].value.isEmpty()) { + // // Existing value, append this one with a comma + // _currentHeaders[i].value += ','; + // _currentHeaders[i].value += headerValue; + // } else { + _currentHeaders[i].value = headerValue; + // } + break; // We found a match, stop looking + } + } + } + + if (headerLine == "") { + log_d("code: %d", _returnCode); + + if (_size > 0) { + log_d("size: %d", _size); + } + + if (transferEncoding.length() > 0) { + log_d("Transfer-Encoding: %s", transferEncoding.c_str()); + if (transferEncoding.equalsIgnoreCase("chunked")) { + _transferEncoding = HTTPC_TE_CHUNKED; + } else if (transferEncoding.equalsIgnoreCase("identity")) { + _transferEncoding = HTTPC_TE_IDENTITY; + } else { + return HTTPC_ERROR_ENCODING; + } + } else { + _transferEncoding = HTTPC_TE_IDENTITY; + } + + if (_returnCode) { + return _returnCode; + } else { + log_d("Remote host is not an HTTP Server!"); + return HTTPC_ERROR_NO_HTTP_SERVER; + } + } + + } else { + if ((millis() - lastDataTime) > _tcpTimeout) { + return HTTPC_ERROR_READ_TIMEOUT; + } + delay(10); + } + } + + return HTTPC_ERROR_CONNECTION_LOST; +} + +/** + * write one Data Block to Stream + * @param stream Stream * + * @param size int + * @return < 0 = error >= 0 = size written + */ +int HTTPClient::writeToStreamDataBlock(Stream *stream, int size) { + int buff_size = HTTP_TCP_BUFFER_SIZE; + int len = size; + int bytesWritten = 0; + + // if possible create smaller buffer then HTTP_TCP_BUFFER_SIZE + if ((len > 0) && (len < HTTP_TCP_BUFFER_SIZE)) { + buff_size = len; + } + + // create buffer for read + uint8_t *buff = (uint8_t *)malloc(buff_size); + + if (buff) { + // read all data from server + while (connected() && (len > 0 || len == -1)) { + + // get available data size + size_t sizeAvailable = _client->available(); + + if (sizeAvailable) { + + int readBytes = sizeAvailable; + + // read only the asked bytes + if (len > 0 && readBytes > len) { + readBytes = len; + } + + // not read more the buffer can handle + if (readBytes > buff_size) { + readBytes = buff_size; + } + + // stop if no more reading + if (readBytes == 0) + break; + + // read data + int bytesRead = _client->readBytes(buff, readBytes); + + // write it to Stream + int bytesWrite = stream->write(buff, bytesRead); + bytesWritten += bytesWrite; + + // are all Bytes a writen to stream ? + if (bytesWrite != bytesRead) { + log_d("short write asked for %d but got %d retry...", bytesRead, bytesWrite); + + // check for write error + if (stream->getWriteError()) { + log_d("stream write error %d", stream->getWriteError()); + + // reset write error for retry + stream->clearWriteError(); + } + + // some time for the stream + delay(1); + + int leftBytes = (readBytes - bytesWrite); + + // retry to send the missed bytes + bytesWrite = stream->write((buff + bytesWrite), leftBytes); + bytesWritten += bytesWrite; + + if (bytesWrite != leftBytes) { + // failed again + log_w("short write asked for %d but got %d failed.", leftBytes, bytesWrite); + free(buff); + return HTTPC_ERROR_STREAM_WRITE; + } + } + + // check for write error + if (stream->getWriteError()) { + log_w("stream write error %d", stream->getWriteError()); + free(buff); + return HTTPC_ERROR_STREAM_WRITE; + } + + // count bytes to read left + if (len > 0) { + len -= readBytes; + } + + delay(0); + } else { + delay(1); + } + } + + free(buff); + + log_d("connection closed or file end (written: %d).", bytesWritten); + + if ((size > 0) && (size != bytesWritten)) { + log_d("bytesWritten %d and size %d mismatch!.", bytesWritten, size); + return HTTPC_ERROR_STREAM_WRITE; + } + + } else { + log_w("too less ram! need %d", HTTP_TCP_BUFFER_SIZE); + return HTTPC_ERROR_TOO_LESS_RAM; + } + + return bytesWritten; +} + +/** + * called to handle error return, may disconnect the connection if still exists + * @param error + * @return error + */ +int HTTPClient::returnError(int error) { + if (error < 0) { + log_w("error(%d): %s", error, errorToString(error).c_str()); + if (connected()) { + log_d("tcp stop"); + _client->stop(); + } + } + return error; +} + +void HTTPClient::setFollowRedirects(followRedirects_t follow) { + _followRedirects = follow; +} + +void HTTPClient::setRedirectLimit(uint16_t limit) { + _redirectLimit = limit; +} + +/** + * set the URL to a new value. Handy for following redirects. + * @param url + */ +bool HTTPClient::setURL(const String &url) { + // if the new location is only a path then only update the URI + if (url && url[0] == '/') { + _uri = url; + clear(); + return true; + } + + if (!url.startsWith(_protocol + ':')) { + log_d("new URL not the same protocol, expected '%s', URL: '%s'\n", _protocol.c_str(), url.c_str()); + return false; + } + + // check if the port is specified + int indexPort = url.indexOf(':', 6); // find the first ':' excluding the one from the protocol + int indexURI = url.indexOf('/', 7); // find where the URI starts to make sure the ':' is not part of it + if (indexPort == -1 || indexPort > indexURI) { + // the port is not specified + _port = (_protocol == "https" ? 443 : 80); + } + + // disconnect but preserve _client. + // Also have to keep the connection otherwise it will free some of the memory used by _client + // and will blow up later when trying to do _client->available() or similar + _canReuse = true; + disconnect(true); + return beginInternal(url, _protocol.c_str()); +} + +const String &HTTPClient::getLocation(void) { + return _location; +} + +void HTTPClient::setCookieJar(CookieJar *cookieJar) { + _cookieJar = cookieJar; +} + +void HTTPClient::resetCookieJar() { + _cookieJar = nullptr; +} + +void HTTPClient::clearAllCookies() { + if (_cookieJar) + _cookieJar->clear(); +} + +void HTTPClient::setCookie(String date, String headerValue) { + if (!_cookieJar) { + return; + } +#define HTTP_TIME_PATTERN "%a, %d %b %Y %H:%M:%S" + + Cookie cookie; + String value; + int pos1, pos2; + + headerValue.toLowerCase(); + + struct tm tm; + strptime(date.c_str(), HTTP_TIME_PATTERN, &tm); + cookie.date = mktime(&tm); + + pos1 = headerValue.indexOf('='); + pos2 = headerValue.indexOf(';'); + + if (pos1 >= 0 && pos2 > pos1) { + cookie.name = headerValue.substring(0, pos1); + cookie.value = headerValue.substring(pos1 + 1, pos2); + } else { + return; // invalid cookie header + } + + // expires + if (headerValue.indexOf("expires=") >= 0) { + pos1 = headerValue.indexOf("expires=") + strlen("expires="); + pos2 = headerValue.indexOf(';', pos1); + + if (pos2 > pos1) + value = headerValue.substring(pos1, pos2); + else + value = headerValue.substring(pos1); + + strptime(value.c_str(), HTTP_TIME_PATTERN, &tm); + cookie.expires.date = mktime(&tm); + cookie.expires.valid = true; + } + + // max-age + if (headerValue.indexOf("max-age=") >= 0) { + pos1 = headerValue.indexOf("max-age=") + strlen("max-age="); + pos2 = headerValue.indexOf(';', pos1); + + if (pos2 > pos1) + value = headerValue.substring(pos1, pos2); + else + value = headerValue.substring(pos1); + + cookie.max_age.duration = value.toInt(); + cookie.max_age.valid = true; + } + + // domain + if (headerValue.indexOf("domain=") >= 0) { + pos1 = headerValue.indexOf("domain=") + strlen("domain="); + pos2 = headerValue.indexOf(';', pos1); + + if (pos2 > pos1) + value = headerValue.substring(pos1, pos2); + else + value = headerValue.substring(pos1); + + if (value.startsWith(".")) + value.remove(0, 1); + + if (_host.indexOf(value) >= 0) { + cookie.domain = value; + } else { + return; // server tries to set a cookie on a different domain; ignore it + } + } else { + pos1 = _host.lastIndexOf('.', _host.lastIndexOf('.') - 1); + if (pos1 >= 0) + cookie.domain = _host.substring(pos1 + 1); + else + cookie.domain = _host; + } + + // path + if (headerValue.indexOf("path=") >= 0) { + pos1 = headerValue.indexOf("path=") + strlen("path="); + pos2 = headerValue.indexOf(';', pos1); + + if (pos2 > pos1) + cookie.path = headerValue.substring(pos1, pos2); + else + cookie.path = headerValue.substring(pos1); + } + + // HttpOnly + cookie.http_only = (headerValue.indexOf("httponly") >= 0); + + // secure + cookie.secure = (headerValue.indexOf("secure") >= 0); + + // overwrite or delete cookie in/from cookie jar + time_t now_local = time(NULL); + time_t now_gmt = mktime(gmtime(&now_local)); + + bool found = false; + + for (auto c = _cookieJar->begin(); c != _cookieJar->end(); ++c) { + if (c->domain == cookie.domain && c->name == cookie.name) { + // when evaluating, max-age takes precedence over expires if both are defined + if ((cookie.max_age.valid && ((cookie.date + cookie.max_age.duration) < now_gmt)) || + cookie.max_age.duration <= 0 || + (!cookie.max_age.valid && cookie.expires.valid && cookie.expires.date < now_gmt)) { + _cookieJar->erase(c); + c--; + } else { + *c = cookie; + } + found = true; + } + } + + // add cookie to jar + if (!found && !(cookie.max_age.valid && cookie.max_age.duration <= 0)) + _cookieJar->push_back(cookie); +} + +bool HTTPClient::generateCookieString(String *cookieString) { + time_t now_local = time(NULL); + time_t now_gmt = mktime(gmtime(&now_local)); + + *cookieString = ""; + bool found = false; + + if (!_cookieJar) { + return false; + } + for (auto c = _cookieJar->begin(); c != _cookieJar->end(); ++c) { + if ((c->max_age.valid && ((c->date + c->max_age.duration) < now_gmt)) || + (!c->max_age.valid && c->expires.valid && c->expires.date < now_gmt)) { + _cookieJar->erase(c); + c--; + } else if (_host.indexOf(c->domain) >= 0 && (!c->secure || _secure)) { + if (*cookieString == "") + *cookieString = c->name + "=" + c->value; + else + *cookieString += " ;" + c->name + "=" + c->value; + found = true; + } + } + + return found; +} + +#endif // LT_ARD_HAS_WIFI diff --git a/cores/common/arduino/libraries/ext/HTTPClient/HTTPClient.h b/cores/common/arduino/libraries/ext/HTTPClient/HTTPClient.h new file mode 100644 index 000000000..fcc277b78 --- /dev/null +++ b/cores/common/arduino/libraries/ext/HTTPClient/HTTPClient.h @@ -0,0 +1,305 @@ +/** + * HTTPClient.h + * + * Created on: 02.11.2015 + * + * Copyright (c) 2015 Markus Sattler. All rights reserved. + * This file is part of the HTTPClient for Arduino. + * Port to ESP32 by Evandro Luis Copercini (2017), + * changed fingerprints to CA verification. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#ifndef HTTPClient_H_ +#define HTTPClient_H_ + +#ifndef HTTPCLIENT_1_1_COMPATIBLE +#define HTTPCLIENT_1_1_COMPATIBLE +#endif + +#include +#include +#include +#include + +/// Cookie jar support +#include + +#define HTTPCLIENT_DEFAULT_TCP_TIMEOUT (5000) + +/// HTTP client errors +#define HTTPC_ERROR_CONNECTION_REFUSED (-1) +#define HTTPC_ERROR_SEND_HEADER_FAILED (-2) +#define HTTPC_ERROR_SEND_PAYLOAD_FAILED (-3) +#define HTTPC_ERROR_NOT_CONNECTED (-4) +#define HTTPC_ERROR_CONNECTION_LOST (-5) +#define HTTPC_ERROR_NO_STREAM (-6) +#define HTTPC_ERROR_NO_HTTP_SERVER (-7) +#define HTTPC_ERROR_TOO_LESS_RAM (-8) +#define HTTPC_ERROR_ENCODING (-9) +#define HTTPC_ERROR_STREAM_WRITE (-10) +#define HTTPC_ERROR_READ_TIMEOUT (-11) + +/// size for the stream handling +#define HTTP_TCP_BUFFER_SIZE (1460) + +/// HTTP codes see RFC7231 +typedef enum { + HTTP_CODE_CONTINUE = 100, + HTTP_CODE_SWITCHING_PROTOCOLS = 101, + HTTP_CODE_PROCESSING = 102, + HTTP_CODE_OK = 200, + HTTP_CODE_CREATED = 201, + HTTP_CODE_ACCEPTED = 202, + HTTP_CODE_NON_AUTHORITATIVE_INFORMATION = 203, + HTTP_CODE_NO_CONTENT = 204, + HTTP_CODE_RESET_CONTENT = 205, + HTTP_CODE_PARTIAL_CONTENT = 206, + HTTP_CODE_MULTI_STATUS = 207, + HTTP_CODE_ALREADY_REPORTED = 208, + HTTP_CODE_IM_USED = 226, + HTTP_CODE_MULTIPLE_CHOICES = 300, + HTTP_CODE_MOVED_PERMANENTLY = 301, + HTTP_CODE_FOUND = 302, + HTTP_CODE_SEE_OTHER = 303, + HTTP_CODE_NOT_MODIFIED = 304, + HTTP_CODE_USE_PROXY = 305, + HTTP_CODE_TEMPORARY_REDIRECT = 307, + HTTP_CODE_PERMANENT_REDIRECT = 308, + HTTP_CODE_BAD_REQUEST = 400, + HTTP_CODE_UNAUTHORIZED = 401, + HTTP_CODE_PAYMENT_REQUIRED = 402, + HTTP_CODE_FORBIDDEN = 403, + HTTP_CODE_NOT_FOUND = 404, + HTTP_CODE_METHOD_NOT_ALLOWED = 405, + HTTP_CODE_NOT_ACCEPTABLE = 406, + HTTP_CODE_PROXY_AUTHENTICATION_REQUIRED = 407, + HTTP_CODE_REQUEST_TIMEOUT = 408, + HTTP_CODE_CONFLICT = 409, + HTTP_CODE_GONE = 410, + HTTP_CODE_LENGTH_REQUIRED = 411, + HTTP_CODE_PRECONDITION_FAILED = 412, + HTTP_CODE_PAYLOAD_TOO_LARGE = 413, + HTTP_CODE_URI_TOO_LONG = 414, + HTTP_CODE_UNSUPPORTED_MEDIA_TYPE = 415, + HTTP_CODE_RANGE_NOT_SATISFIABLE = 416, + HTTP_CODE_EXPECTATION_FAILED = 417, + HTTP_CODE_MISDIRECTED_REQUEST = 421, + HTTP_CODE_UNPROCESSABLE_ENTITY = 422, + HTTP_CODE_LOCKED = 423, + HTTP_CODE_FAILED_DEPENDENCY = 424, + HTTP_CODE_UPGRADE_REQUIRED = 426, + HTTP_CODE_PRECONDITION_REQUIRED = 428, + HTTP_CODE_TOO_MANY_REQUESTS = 429, + HTTP_CODE_REQUEST_HEADER_FIELDS_TOO_LARGE = 431, + HTTP_CODE_INTERNAL_SERVER_ERROR = 500, + HTTP_CODE_NOT_IMPLEMENTED = 501, + HTTP_CODE_BAD_GATEWAY = 502, + HTTP_CODE_SERVICE_UNAVAILABLE = 503, + HTTP_CODE_GATEWAY_TIMEOUT = 504, + HTTP_CODE_HTTP_VERSION_NOT_SUPPORTED = 505, + HTTP_CODE_VARIANT_ALSO_NEGOTIATES = 506, + HTTP_CODE_INSUFFICIENT_STORAGE = 507, + HTTP_CODE_LOOP_DETECTED = 508, + HTTP_CODE_NOT_EXTENDED = 510, + HTTP_CODE_NETWORK_AUTHENTICATION_REQUIRED = 511 +} t_http_codes; + +typedef enum { HTTPC_TE_IDENTITY, HTTPC_TE_CHUNKED } transferEncoding_t; + +/** + * redirection follow mode. + * + `HTTPC_DISABLE_FOLLOW_REDIRECTS` - no redirection will be followed. + * + `HTTPC_STRICT_FOLLOW_REDIRECTS` - strict RFC2616, only requests using + * GET or HEAD methods will be redirected (using the same method), + * since the RFC requires end-user confirmation in other cases. + * + `HTTPC_FORCE_FOLLOW_REDIRECTS` - all redirections will be followed, + * regardless of a used method. New request will use the same method, + * and they will include the same body data and the same headers. + * In the sense of the RFC, it's just like every redirection is confirmed. + */ +typedef enum { + HTTPC_DISABLE_FOLLOW_REDIRECTS, + HTTPC_STRICT_FOLLOW_REDIRECTS, + HTTPC_FORCE_FOLLOW_REDIRECTS +} followRedirects_t; + +#ifdef HTTPCLIENT_1_1_COMPATIBLE +class TransportTraits; +typedef std::unique_ptr TransportTraitsPtr; +#endif + +// cookie jar support +typedef struct { + String host; // host which tries to set the cookie + time_t date; // timestamp of the response that set the cookie + String name; + String value; + String domain; + String path = ""; + + struct { + time_t date = 0; + bool valid = false; + } expires; + + struct { + time_t duration = 0; + bool valid = false; + } max_age; + + bool http_only = false; + bool secure = false; +} Cookie; + +typedef std::vector CookieJar; + +class HTTPClient { + public: + HTTPClient(); + ~HTTPClient(); + + /* + * Since both begin() functions take a reference to client as a parameter, you need to + * ensure the client object lives the entire time of the HTTPClient + */ + bool begin(WiFiClient &client, String url); + bool begin(WiFiClient &client, String host, uint16_t port, String uri = "/", bool https = false); + +#ifdef HTTPCLIENT_1_1_COMPATIBLE + bool begin(String url); + bool begin(String url, const char *CAcert); + bool begin(String host, uint16_t port, String uri = "/"); + bool begin(String host, uint16_t port, String uri, const char *CAcert); + bool begin(String host, uint16_t port, String uri, const char *CAcert, const char *cli_cert, const char *cli_key); +#endif + + void end(void); + + bool connected(void); + + void setReuse(bool reuse); /// keep-alive + void setUserAgent(const String &userAgent); + void setAuthorization(const char *user, const char *password); + void setAuthorization(const char *auth); + void setAuthorizationType(const char *authType); + void setConnectTimeout(int32_t connectTimeout); + void setTimeout(uint16_t timeout); + + // Redirections + void setFollowRedirects(followRedirects_t follow); + void setRedirectLimit(uint16_t limit); // max redirects to follow for a single request + + bool setURL(const String &url); + void useHTTP10(bool usehttp10 = true); + + /// request handling + int GET(); + int PATCH(uint8_t *payload, size_t size); + int PATCH(String payload); + int POST(uint8_t *payload, size_t size); + int POST(String payload); + int PUT(uint8_t *payload, size_t size); + int PUT(String payload); + int sendRequest(const char *type, String payload); + int sendRequest(const char *type, uint8_t *payload = NULL, size_t size = 0); + int sendRequest(const char *type, Stream *stream, size_t size = 0); + + void addHeader(const String &name, const String &value, bool first = false, bool replace = true); + + /// Response handling + void collectHeaders(const char *headerKeys[], const size_t headerKeysCount); + String header(const char *name); // get request header value by name + String header(size_t i); // get request header value by number + String headerName(size_t i); // get request header name by number + int headers(); // get header count + bool hasHeader(const char *name); // check if header exists + + int getSize(void); + const String &getLocation(void); + + WiFiClient &getStream(void); + WiFiClient *getStreamPtr(void); + int writeToStream(Stream *stream); + // String getString(void); + + static String errorToString(int error); + + /// Cookie jar support + void setCookieJar(CookieJar *cookieJar); + void resetCookieJar(); + void clearAllCookies(); + + protected: + struct RequestArgument { + String key; + String value; + }; + + bool beginInternal(String url, const char *expectedProtocol); + void disconnect(bool preserveClient = false); + void clear(); + int returnError(int error); + bool connect(void); + bool sendHeader(const char *type); + int handleHeaderResponse(); + int writeToStreamDataBlock(Stream *stream, int len); + + /// Cookie jar support + void setCookie(String date, String headerValue); + bool generateCookieString(String *cookieString); + +#ifdef HTTPCLIENT_1_1_COMPATIBLE + TransportTraitsPtr _transportTraits; + std::unique_ptr _tcpDeprecated; +#endif + + WiFiClient *_client = nullptr; + + /// request handling + String _host; + uint16_t _port = 0; + int32_t _connectTimeout = -1; + bool _reuse = true; + uint16_t _tcpTimeout = HTTPCLIENT_DEFAULT_TCP_TIMEOUT; + bool _useHTTP10 = false; + bool _secure = false; + + String _uri; + String _protocol; + String _headers; + String _userAgent = "ESP32HTTPClient"; + String _base64Authorization; + String _authorizationType = "Basic"; + + /// Response handling + RequestArgument *_currentHeaders = nullptr; + size_t _headerKeysCount = 0; + + int _returnCode = 0; + int _size = -1; + bool _canReuse = false; + followRedirects_t _followRedirects = HTTPC_DISABLE_FOLLOW_REDIRECTS; + uint16_t _redirectLimit = 10; + String _location; + transferEncoding_t _transferEncoding = HTTPC_TE_IDENTITY; + + /// Cookie jar support + CookieJar *_cookieJar = nullptr; +}; + +#endif /* HTTPClient_H_ */ diff --git a/cores/common/arduino/libraries/ext/StreamString/StreamString.cpp b/cores/common/arduino/libraries/ext/StreamString/StreamString.cpp new file mode 100644 index 000000000..6cf2def27 --- /dev/null +++ b/cores/common/arduino/libraries/ext/StreamString/StreamString.cpp @@ -0,0 +1,61 @@ +/** + StreamString.cpp + + Copyright (c) 2015 Markus Sattler. All rights reserved. + This file is part of the esp8266 core for Arduino environment. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + */ + +#include +#include "StreamString.h" + +size_t StreamString::write(const uint8_t *data, size_t size) { + if(size && data) { + concat(data, size); + return size; + } + return 0; +} + +size_t StreamString::write(uint8_t data) { + return concat((char) data); +} + +int StreamString::available() { + return length(); +} + +int StreamString::read() { + if(length()) { + char c = charAt(0); + remove(0, 1); + return c; + + } + return -1; +} + +int StreamString::peek() { + if(length()) { + char c = charAt(0); + return c; + } + return -1; +} + +void StreamString::flush() { +} diff --git a/cores/common/arduino/libraries/ext/StreamString/StreamString.h b/cores/common/arduino/libraries/ext/StreamString/StreamString.h new file mode 100644 index 000000000..dbdf3fb00 --- /dev/null +++ b/cores/common/arduino/libraries/ext/StreamString/StreamString.h @@ -0,0 +1,39 @@ +/** + StreamString.h + + Copyright (c) 2015 Markus Sattler. All rights reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + +#ifndef STREAMSTRING_H_ +#define STREAMSTRING_H_ + + +class StreamString: public Stream, public String +{ +public: + size_t write(const uint8_t *buffer, size_t size) override; + size_t write(uint8_t data) override; + + int available() override; + int read() override; + int peek() override; + void flush() override; +}; + + +#endif /* STREAMSTRING_H_ */ diff --git a/cores/common/arduino/libraries/ext/WebServer/HTTP_Method.h b/cores/common/arduino/libraries/ext/WebServer/HTTP_Method.h new file mode 100644 index 000000000..b739a2fb8 --- /dev/null +++ b/cores/common/arduino/libraries/ext/WebServer/HTTP_Method.h @@ -0,0 +1,56 @@ +#pragma once + +/* Request Methods */ +#define HTTP_METHOD_MAP(XX) \ + XX(0, DELETE, DELETE) \ + XX(1, GET, GET) \ + XX(2, HEAD, HEAD) \ + XX(3, POST, POST) \ + XX(4, PUT, PUT) \ + /* pathological */ \ + XX(5, CONNECT, CONNECT) \ + XX(6, OPTIONS, OPTIONS) \ + XX(7, TRACE, TRACE) \ + /* WebDAV */ \ + XX(8, COPY, COPY) \ + XX(9, LOCK, LOCK) \ + XX(10, MKCOL, MKCOL) \ + XX(11, MOVE, MOVE) \ + XX(12, PROPFIND, PROPFIND) \ + XX(13, PROPPATCH, PROPPATCH) \ + XX(14, SEARCH, SEARCH) \ + XX(15, UNLOCK, UNLOCK) \ + XX(16, BIND, BIND) \ + XX(17, REBIND, REBIND) \ + XX(18, UNBIND, UNBIND) \ + XX(19, ACL, ACL) \ + /* subversion */ \ + XX(20, REPORT, REPORT) \ + XX(21, MKACTIVITY, MKACTIVITY) \ + XX(22, CHECKOUT, CHECKOUT) \ + XX(23, MERGE, MERGE) \ + /* upnp */ \ + XX(24, MSEARCH, M - SEARCH) \ + XX(25, NOTIFY, NOTIFY) \ + XX(26, SUBSCRIBE, SUBSCRIBE) \ + XX(27, UNSUBSCRIBE, UNSUBSCRIBE) \ + /* RFC-5789 */ \ + XX(28, PATCH, PATCH) \ + XX(29, PURGE, PURGE) \ + /* CalDAV */ \ + XX(30, MKCALENDAR, MKCALENDAR) \ + /* RFC-2068, section 19.6.1.2 */ \ + XX(31, LINK, LINK) \ + XX(32, UNLINK, UNLINK) \ + /* icecast */ \ + XX(33, SOURCE, SOURCE) + +enum http_method { + +#define XX(num, name, string) HTTP_##name = num, + HTTP_METHOD_MAP(XX) +#undef XX +}; + +typedef enum http_method HTTPMethod; +#define HTTP_ANY (HTTPMethod)(255) diff --git a/cores/common/arduino/libraries/ext/WebServer/Parsing.cpp b/cores/common/arduino/libraries/ext/WebServer/Parsing.cpp new file mode 100644 index 000000000..df0d436f9 --- /dev/null +++ b/cores/common/arduino/libraries/ext/WebServer/Parsing.cpp @@ -0,0 +1,609 @@ +/* + Parsing.cpp - HTTP request parsing. + + Copyright (c) 2015 Ivan Grokhotkov. All rights reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Modified 8 May 2015 by Hristo Gochkov (proper post and file upload handling) +*/ + +#if LT_ARD_HAS_WIFI + +#include + +#include "WebServer.h" +#include "WiFiClient.h" +#include "WiFiServer.h" +#include "detail/mimetable.h" + +#ifndef WEBSERVER_MAX_POST_ARGS +#define WEBSERVER_MAX_POST_ARGS 32 +#endif + +#define __STR(a) #a +#define _STR(a) __STR(a) +const char *_http_method_str[] = { +#define XX(num, name, string) _STR(name), + HTTP_METHOD_MAP(XX) +#undef XX +}; + +static const char Content_Type[] PROGMEM = "Content-Type"; +static const char filename[] PROGMEM = "filename"; + +static char *readBytesWithTimeout(WiFiClient &client, size_t maxLength, size_t &dataLength, int timeout_ms) { + char *buf = nullptr; + dataLength = 0; + while (dataLength < maxLength) { + int tries = timeout_ms; + size_t newLength; + while (!(newLength = client.available()) && tries--) + delay(1); + if (!newLength) { + break; + } + if (!buf) { + buf = (char *)malloc(newLength + 1); + if (!buf) { + return nullptr; + } + } else { + char *newBuf = (char *)realloc(buf, dataLength + newLength + 1); + if (!newBuf) { + free(buf); + return nullptr; + } + buf = newBuf; + } + client.readBytes(buf + dataLength, newLength); + dataLength += newLength; + buf[dataLength] = '\0'; + } + return buf; +} + +bool WebServer::_parseRequest(WiFiClient &client) { + // Read the first line of HTTP request + String req = client.readStringUntil('\r'); + client.readStringUntil('\n'); + // reset header value + for (int i = 0; i < _headerKeysCount; ++i) { + _currentHeaders[i].value = String(); + } + + // First line of HTTP request looks like "GET /path HTTP/1.1" + // Retrieve the "/path" part by finding the spaces + int addr_start = req.indexOf(' '); + int addr_end = req.indexOf(' ', addr_start + 1); + if (addr_start == -1 || addr_end == -1) { + log_e("Invalid request: %s", req.c_str()); + return false; + } + + String methodStr = req.substring(0, addr_start); + String url = req.substring(addr_start + 1, addr_end); + String versionEnd = req.substring(addr_end + 8); + _currentVersion = atoi(versionEnd.c_str()); + String searchStr = ""; + int hasSearch = url.indexOf('?'); + if (hasSearch != -1) { + searchStr = url.substring(hasSearch + 1); + url = url.substring(0, hasSearch); + } + _currentUri = url; + _chunked = false; + + HTTPMethod method = HTTP_ANY; + size_t num_methods = sizeof(_http_method_str) / sizeof(const char *); + for (size_t i = 0; i < num_methods; i++) { + if (methodStr == _http_method_str[i]) { + method = (HTTPMethod)i; + break; + } + } + if (method == HTTP_ANY) { + log_e("Unknown HTTP Method: %s", methodStr.c_str()); + return false; + } + _currentMethod = method; + + log_v("method: %s url: %s search: %s", methodStr.c_str(), url.c_str(), searchStr.c_str()); + + // attach handler + RequestHandler *handler; + for (handler = _firstHandler; handler; handler = handler->next()) { + if (handler->canHandle(_currentMethod, _currentUri)) + break; + } + _currentHandler = handler; + + String formData; + // below is needed only when POST type request + if (method == HTTP_POST || method == HTTP_PUT || method == HTTP_PATCH || method == HTTP_DELETE) { + String boundaryStr; + String headerName; + String headerValue; + bool isForm = false; + bool isEncoded = false; + uint32_t contentLength = 0; + // parse headers + while (1) { + req = client.readStringUntil('\r'); + client.readStringUntil('\n'); + if (req == "") + break; // no moar headers + int headerDiv = req.indexOf(':'); + if (headerDiv == -1) { + break; + } + headerName = req.substring(0, headerDiv); + headerValue = req.substring(headerDiv + 1); + headerValue.trim(); + _collectHeader(headerName.c_str(), headerValue.c_str()); + + log_v("headerName: %s", headerName.c_str()); + log_v("headerValue: %s", headerValue.c_str()); + + if (headerName.equalsIgnoreCase(FPSTR(Content_Type))) { + using namespace mime; + if (headerValue.startsWith(FPSTR(mimeTable[txt].mimeType))) { + isForm = false; + } else if (headerValue.startsWith(F("application/x-www-form-urlencoded"))) { + isForm = false; + isEncoded = true; + } else if (headerValue.startsWith(F("multipart/"))) { + boundaryStr = headerValue.substring(headerValue.indexOf('=') + 1); + boundaryStr.replace("\"", ""); + isForm = true; + } + } else if (headerName.equalsIgnoreCase(F("Content-Length"))) { + contentLength = headerValue.toInt(); + } else if (headerName.equalsIgnoreCase(F("Host"))) { + _hostHeader = headerValue; + } + } + + if (!isForm) { + size_t plainLength; + char *plainBuf = readBytesWithTimeout(client, contentLength, plainLength, HTTP_MAX_POST_WAIT); + if (plainLength < contentLength) { + free(plainBuf); + return false; + } + if (contentLength > 0) { + if (isEncoded) { + // url encoded form + if (searchStr != "") + searchStr += '&'; + searchStr += plainBuf; + } + _parseArguments(searchStr); + if (!isEncoded) { + // plain post json or other data + RequestArgument &arg = _currentArgs[_currentArgCount++]; + arg.key = F("plain"); + arg.value = String(plainBuf); + } + + log_v("Plain: %s", plainBuf); + free(plainBuf); + } else { + // No content - but we can still have arguments in the URL. + _parseArguments(searchStr); + } + } + + if (isForm) { + _parseArguments(searchStr); + if (!_parseForm(client, boundaryStr, contentLength)) { + return false; + } + } + } else { + String headerName; + String headerValue; + // parse headers + while (1) { + req = client.readStringUntil('\r'); + client.readStringUntil('\n'); + if (req == "") + break; // no moar headers + int headerDiv = req.indexOf(':'); + if (headerDiv == -1) { + break; + } + headerName = req.substring(0, headerDiv); + headerValue = req.substring(headerDiv + 2); + _collectHeader(headerName.c_str(), headerValue.c_str()); + + log_v("headerName: %s", headerName.c_str()); + log_v("headerValue: %s", headerValue.c_str()); + + if (headerName.equalsIgnoreCase("Host")) { + _hostHeader = headerValue; + } + } + _parseArguments(searchStr); + } + client.flush(); + + log_v("Request: %s", url.c_str()); + log_v(" Arguments: %s", searchStr.c_str()); + + return true; +} + +bool WebServer::_collectHeader(const char *headerName, const char *headerValue) { + for (int i = 0; i < _headerKeysCount; i++) { + if (_currentHeaders[i].key.equalsIgnoreCase(headerName)) { + _currentHeaders[i].value = headerValue; + return true; + } + } + return false; +} + +void WebServer::_parseArguments(String data) { + log_v("args: %s", data.c_str()); + if (_currentArgs) + delete[] _currentArgs; + _currentArgs = 0; + if (data.length() == 0) { + _currentArgCount = 0; + _currentArgs = new RequestArgument[1]; + return; + } + _currentArgCount = 1; + + for (int i = 0; i < (int)data.length();) { + i = data.indexOf('&', i); + if (i == -1) + break; + ++i; + ++_currentArgCount; + } + log_v("args count: %d", _currentArgCount); + + _currentArgs = new RequestArgument[_currentArgCount + 1]; + int pos = 0; + int iarg; + for (iarg = 0; iarg < _currentArgCount;) { + int equal_sign_index = data.indexOf('=', pos); + int next_arg_index = data.indexOf('&', pos); + log_v("pos %d =@%d &@%d", pos, equal_sign_index, next_arg_index); + if ((equal_sign_index == -1) || ((equal_sign_index > next_arg_index) && (next_arg_index != -1))) { + log_e("arg missing value: %d", iarg); + if (next_arg_index == -1) + break; + pos = next_arg_index + 1; + continue; + } + RequestArgument &arg = _currentArgs[iarg]; + arg.key = urlDecode(data.substring(pos, equal_sign_index)); + arg.value = urlDecode(data.substring(equal_sign_index + 1, next_arg_index)); + log_v("arg %d key: %s value: %s", iarg, arg.key.c_str(), arg.value.c_str()); + ++iarg; + if (next_arg_index == -1) + break; + pos = next_arg_index + 1; + } + _currentArgCount = iarg; + log_v("args count: %d", _currentArgCount); +} + +void WebServer::_uploadWriteByte(uint8_t b) { + if (_currentUpload->currentSize == HTTP_UPLOAD_BUFLEN) { + if (_currentHandler && _currentHandler->canUpload(_currentUri)) + _currentHandler->upload(*this, _currentUri, *_currentUpload); + _currentUpload->totalSize += _currentUpload->currentSize; + _currentUpload->currentSize = 0; + } + _currentUpload->buf[_currentUpload->currentSize++] = b; +} + +int WebServer::_uploadReadByte(WiFiClient &client) { + int res = client.read(); + if (res < 0) { + // keep trying until you either read a valid byte or timeout + unsigned long startMillis = millis(); + long timeoutIntervalMillis = client.getTimeout(); + boolean timedOut = false; + for (;;) { + if (!client.connected()) + return -1; + // loosely modeled after blinkWithoutDelay pattern + while (!timedOut && !client.available() && client.connected()) { + delay(2); + timedOut = millis() - startMillis >= timeoutIntervalMillis; + } + + res = client.read(); + if (res >= 0) { + return res; // exit on a valid read + } + // NOTE: it is possible to get here and have all of the following + // assertions hold true + // + // -- client.available() > 0 + // -- client.connected == true + // -- res == -1 + // + // a simple retry strategy overcomes this which is to say the + // assertion is not permanent, but the reason that this works + // is elusive, and possibly indicative of a more subtle underlying + // issue + + timedOut = millis() - startMillis >= timeoutIntervalMillis; + if (timedOut) { + return res; // exit on a timeout + } + } + } + + return res; +} + +bool WebServer::_parseForm(WiFiClient &client, String boundary, uint32_t len) { + (void)len; + log_v("Parse Form: Boundary: %s Length: %d", boundary.c_str(), len); + String line; + int retry = 0; + do { + line = client.readStringUntil('\r'); + ++retry; + } while (line.length() == 0 && retry < 3); + + client.readStringUntil('\n'); + // start reading the form + if (line == ("--" + boundary)) { + if (_postArgs) + delete[] _postArgs; + _postArgs = new RequestArgument[WEBSERVER_MAX_POST_ARGS]; + _postArgsLen = 0; + while (1) { + String argName; + String argValue; + String argType; + String argFilename; + bool argIsFile = false; + + line = client.readStringUntil('\r'); + client.readStringUntil('\n'); + if (line.length() > 19 && line.substring(0, 19).equalsIgnoreCase(F("Content-Disposition"))) { + int nameStart = line.indexOf('='); + if (nameStart != -1) { + argName = line.substring(nameStart + 2); + nameStart = argName.indexOf('='); + if (nameStart == -1) { + argName = argName.substring(0, argName.length() - 1); + } else { + argFilename = argName.substring(nameStart + 2, argName.length() - 1); + argName = argName.substring(0, argName.indexOf('"')); + argIsFile = true; + log_v("PostArg FileName: %s", argFilename.c_str()); + // use GET to set the filename if uploading using blob + if (argFilename == F("blob") && hasArg(FPSTR(filename))) + argFilename = arg(FPSTR(filename)); + } + log_v("PostArg Name: %s", argName.c_str()); + using namespace mime; + argType = FPSTR(mimeTable[txt].mimeType); + line = client.readStringUntil('\r'); + client.readStringUntil('\n'); + if (line.length() > 12 && line.substring(0, 12).equalsIgnoreCase(FPSTR(Content_Type))) { + argType = line.substring(line.indexOf(':') + 2); + // skip next line + client.readStringUntil('\r'); + client.readStringUntil('\n'); + } + log_v("PostArg Type: %s", argType.c_str()); + if (!argIsFile) { + while (1) { + line = client.readStringUntil('\r'); + client.readStringUntil('\n'); + if (line.startsWith("--" + boundary)) + break; + if (argValue.length() > 0) + argValue += "\n"; + argValue += line; + } + log_v("PostArg Value: %s", argValue.c_str()); + + RequestArgument &arg = _postArgs[_postArgsLen++]; + arg.key = argName; + arg.value = argValue; + + if (line == ("--" + boundary + "--")) { + log_v("Done Parsing POST"); + break; + } else if (_postArgsLen >= WEBSERVER_MAX_POST_ARGS) { + log_e("Too many PostArgs (max: %d) in request.", WEBSERVER_MAX_POST_ARGS); + return false; + } + } else { + _currentUpload.reset(new HTTPUpload()); + _currentUpload->status = UPLOAD_FILE_START; + _currentUpload->name = argName; + _currentUpload->filename = argFilename; + _currentUpload->type = argType; + _currentUpload->totalSize = 0; + _currentUpload->currentSize = 0; + log_v( + "Start File: %s Type: %s", + _currentUpload->filename.c_str(), + _currentUpload->type.c_str() + ); + if (_currentHandler && _currentHandler->canUpload(_currentUri)) + _currentHandler->upload(*this, _currentUri, *_currentUpload); + _currentUpload->status = UPLOAD_FILE_WRITE; + int argByte = _uploadReadByte(client); + readfile: + + while (argByte != 0x0D) { + if (argByte < 0) + return _parseFormUploadAborted(); + _uploadWriteByte(argByte); + argByte = _uploadReadByte(client); + } + + argByte = _uploadReadByte(client); + if (argByte < 0) + return _parseFormUploadAborted(); + if (argByte == 0x0A) { + argByte = _uploadReadByte(client); + if (argByte < 0) + return _parseFormUploadAborted(); + if ((char)argByte != '-') { + // continue reading the file + _uploadWriteByte(0x0D); + _uploadWriteByte(0x0A); + goto readfile; + } else { + argByte = _uploadReadByte(client); + if (argByte < 0) + return _parseFormUploadAborted(); + if ((char)argByte != '-') { + // continue reading the file + _uploadWriteByte(0x0D); + _uploadWriteByte(0x0A); + _uploadWriteByte((uint8_t)('-')); + goto readfile; + } + } + + uint8_t endBuf[boundary.length()]; + uint32_t i = 0; + while (i < boundary.length()) { + argByte = _uploadReadByte(client); + if (argByte < 0) + return _parseFormUploadAborted(); + if ((char)argByte == 0x0D) { + _uploadWriteByte(0x0D); + _uploadWriteByte(0x0A); + _uploadWriteByte((uint8_t)('-')); + _uploadWriteByte((uint8_t)('-')); + uint32_t j = 0; + while (j < i) { + _uploadWriteByte(endBuf[j++]); + } + goto readfile; + } + endBuf[i++] = (uint8_t)argByte; + } + + if (strstr((const char *)endBuf, boundary.c_str()) != NULL) { + if (_currentHandler && _currentHandler->canUpload(_currentUri)) + _currentHandler->upload(*this, _currentUri, *_currentUpload); + _currentUpload->totalSize += _currentUpload->currentSize; + _currentUpload->status = UPLOAD_FILE_END; + if (_currentHandler && _currentHandler->canUpload(_currentUri)) + _currentHandler->upload(*this, _currentUri, *_currentUpload); + log_v( + "End File: %s Type: %s Size: %d", + _currentUpload->filename.c_str(), + _currentUpload->type.c_str(), + _currentUpload->totalSize + ); + line = client.readStringUntil(0x0D); + client.readStringUntil(0x0A); + if (line == "--") { + log_v("Done Parsing POST"); + break; + } + continue; + } else { + _uploadWriteByte(0x0D); + _uploadWriteByte(0x0A); + _uploadWriteByte((uint8_t)('-')); + _uploadWriteByte((uint8_t)('-')); + uint32_t i = 0; + while (i < boundary.length()) { + _uploadWriteByte(endBuf[i++]); + } + argByte = _uploadReadByte(client); + goto readfile; + } + } else { + _uploadWriteByte(0x0D); + goto readfile; + } + break; + } + } + } + } + + int iarg; + int totalArgs = ((WEBSERVER_MAX_POST_ARGS - _postArgsLen) < _currentArgCount) + ? (WEBSERVER_MAX_POST_ARGS - _postArgsLen) + : _currentArgCount; + for (iarg = 0; iarg < totalArgs; iarg++) { + RequestArgument &arg = _postArgs[_postArgsLen++]; + arg.key = _currentArgs[iarg].key; + arg.value = _currentArgs[iarg].value; + } + if (_currentArgs) + delete[] _currentArgs; + _currentArgs = new RequestArgument[_postArgsLen]; + for (iarg = 0; iarg < _postArgsLen; iarg++) { + RequestArgument &arg = _currentArgs[iarg]; + arg.key = _postArgs[iarg].key; + arg.value = _postArgs[iarg].value; + } + _currentArgCount = iarg; + if (_postArgs) { + delete[] _postArgs; + _postArgs = nullptr; + _postArgsLen = 0; + } + return true; + } + log_e("Error: line: %s", line.c_str()); + return false; +} + +String WebServer::urlDecode(const String &text) { + String decoded = ""; + char temp[] = "0x00"; + unsigned int len = text.length(); + unsigned int i = 0; + while (i < len) { + char decodedChar; + char encodedChar = text.charAt(i++); + if ((encodedChar == '%') && (i + 1 < len)) { + temp[2] = text.charAt(i++); + temp[3] = text.charAt(i++); + + decodedChar = strtol(temp, NULL, 16); + } else { + if (encodedChar == '+') { + decodedChar = ' '; + } else { + decodedChar = encodedChar; // normal ascii char + } + } + decoded += decodedChar; + } + return decoded; +} + +bool WebServer::_parseFormUploadAborted() { + _currentUpload->status = UPLOAD_FILE_ABORTED; + if (_currentHandler && _currentHandler->canUpload(_currentUri)) + _currentHandler->upload(*this, _currentUri, *_currentUpload); + return false; +} + +#endif // LT_ARD_HAS_WIFI diff --git a/cores/common/arduino/libraries/ext/WebServer/Uri.h b/cores/common/arduino/libraries/ext/WebServer/Uri.h new file mode 100644 index 000000000..67602fa55 --- /dev/null +++ b/cores/common/arduino/libraries/ext/WebServer/Uri.h @@ -0,0 +1,29 @@ +#pragma once + +#include +#include + +class Uri { + + protected: + const String _uri; + + public: + Uri(const char *uri) : _uri(uri) {} + + Uri(const String &uri) : _uri(uri) {} + + Uri(const __FlashStringHelper *uri) : _uri(String(uri)) {} + + virtual ~Uri() {} + + virtual Uri *clone() const { + return new Uri(_uri); + }; + + virtual void initPathArgs(__attribute__((unused)) std::vector &pathArgs) {} + + virtual bool canHandle(const String &requestUri, __attribute__((unused)) std::vector &pathArgs) { + return _uri == requestUri; + } +}; diff --git a/cores/common/arduino/libraries/ext/WebServer/WebServer.cpp b/cores/common/arduino/libraries/ext/WebServer/WebServer.cpp new file mode 100644 index 000000000..8510c92af --- /dev/null +++ b/cores/common/arduino/libraries/ext/WebServer/WebServer.cpp @@ -0,0 +1,721 @@ +/* + WebServer.cpp - Dead simple web-server. + Supports only one simultaneous client, knows how to handle GET and POST. + + Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Modified 8 May 2015 by Hristo Gochkov (proper post and file upload handling) +*/ + +#if LT_ARD_HAS_WIFI + +#include + +#include "FS.h" +#include "WebServer.h" +#include "WiFiClient.h" +#include "WiFiServer.h" +#include "detail/RequestHandlersImpl.h" +// #include "mbedtls/md5.h" +#include + +static const char AUTHORIZATION_HEADER[] = "Authorization"; +static const char qop_auth[] PROGMEM = "qop=auth"; +static const char qop_auth_quoted[] PROGMEM = "qop=\"auth\""; +static const char WWW_Authenticate[] = "WWW-Authenticate"; +static const char Content_Length[] = "Content-Length"; + +WebServer::WebServer(IPAddress addr, int port) + : _corsEnabled(false), _server(addr, port), _currentMethod(HTTP_ANY), _currentVersion(0), _currentStatus(HC_NONE), + _statusChange(0), _nullDelay(true), _currentHandler(nullptr), _firstHandler(nullptr), _lastHandler(nullptr), + _currentArgCount(0), _currentArgs(nullptr), _postArgsLen(0), _postArgs(nullptr), _headerKeysCount(0), + _currentHeaders(nullptr), _contentLength(0), _chunked(false) { + log_v("WebServer::Webserver(addr=%s, port=%d)", ipToString(addr).c_str(), port); +} + +WebServer::WebServer(int port) + : _corsEnabled(false), _server(port), _currentMethod(HTTP_ANY), _currentVersion(0), _currentStatus(HC_NONE), + _statusChange(0), _nullDelay(true), _currentHandler(nullptr), _firstHandler(nullptr), _lastHandler(nullptr), + _currentArgCount(0), _currentArgs(nullptr), _postArgsLen(0), _postArgs(nullptr), _headerKeysCount(0), + _currentHeaders(nullptr), _contentLength(0), _chunked(false) { + log_v("WebServer::Webserver(port=%d)", port); +} + +WebServer::~WebServer() { + _server.close(); + if (_currentHeaders) + delete[] _currentHeaders; + RequestHandler *handler = _firstHandler; + while (handler) { + RequestHandler *next = handler->next(); + delete handler; + handler = next; + } +} + +void WebServer::begin() { + close(); + _server.begin(); + _server.setNoDelay(true); +} + +void WebServer::begin(uint16_t port) { + close(); + _server.begin(port); + _server.setNoDelay(true); +} + +String WebServer::_extractParam(String &authReq, const String ¶m, const char delimit) { + int _begin = authReq.indexOf(param); + if (_begin == -1) + return ""; + return authReq.substring(_begin + param.length(), authReq.indexOf(delimit, _begin + param.length())); +} + +static String md5str(String &in) { + /* char out[33] = {0}; + mbedtls_md5_context _ctx; + uint8_t i; + uint8_t *_buf = (uint8_t *)malloc(16); + if (_buf == NULL) + return String(out); + memset(_buf, 0x00, 16); + mbedtls_md5_init(&_ctx); + mbedtls_md5_starts_ret(&_ctx); + mbedtls_md5_update_ret(&_ctx, (const uint8_t *)in.c_str(), in.length()); + mbedtls_md5_finish_ret(&_ctx, _buf); + for (i = 0; i < 16; i++) { + sprintf(out + (i * 2), "%02x", _buf[i]); + } + out[32] = 0; + free(_buf); + return String(out); */ + return ""; +} + +bool WebServer::authenticate(const char *username, const char *password) { + if (hasHeader(FPSTR(AUTHORIZATION_HEADER))) { + String authReq = header(FPSTR(AUTHORIZATION_HEADER)); + if (authReq.startsWith(F("Basic"))) { + authReq = authReq.substring(6); + authReq.trim(); + char toencodeLen = strlen(username) + strlen(password) + 1; + char *toencode = new char[toencodeLen + 1]; + if (toencode == NULL) { + authReq = ""; + return false; + } + char *encoded = new char[base64_encode_expected_len(toencodeLen) + 1]; + if (encoded == NULL) { + authReq = ""; + delete[] toencode; + return false; + } + sprintf(toencode, "%s:%s", username, password); + if (base64_encode_chars(toencode, toencodeLen, encoded) > 0 && authReq.equals(encoded)) { + authReq = ""; + delete[] toencode; + delete[] encoded; + return true; + } + delete[] toencode; + delete[] encoded; + } else if (authReq.startsWith(F("Digest"))) { + authReq = authReq.substring(7); + log_v("%s", authReq.c_str()); + String _username = _extractParam(authReq, F("username=\""), '\"'); + if (!_username.length() || _username != String(username)) { + authReq = ""; + return false; + } + // extracting required parameters for RFC 2069 simpler Digest + String _realm = _extractParam(authReq, F("realm=\""), '\"'); + String _nonce = _extractParam(authReq, F("nonce=\""), '\"'); + String _uri = _extractParam(authReq, F("uri=\""), '\"'); + String _response = _extractParam(authReq, F("response=\""), '\"'); + String _opaque = _extractParam(authReq, F("opaque=\""), '\"'); + + if ((!_realm.length()) || (!_nonce.length()) || (!_uri.length()) || (!_response.length()) || + (!_opaque.length())) { + authReq = ""; + return false; + } + if ((_opaque != _sopaque) || (_nonce != _snonce) || (_realm != _srealm)) { + authReq = ""; + return false; + } + // parameters for the RFC 2617 newer Digest + String _nc, _cnonce; + if (authReq.indexOf(FPSTR(qop_auth)) != -1 || authReq.indexOf(FPSTR(qop_auth_quoted)) != -1) { + _nc = _extractParam(authReq, F("nc="), ','); + _cnonce = _extractParam(authReq, F("cnonce=\""), '\"'); + } + String _H1 = md5str(String(username) + ':' + _realm + ':' + String(password)); + log_v("Hash of user:realm:pass=%s", _H1.c_str()); + String _H2 = ""; + if (_currentMethod == HTTP_GET) { + _H2 = md5str(String(F("GET:")) + _uri); + } else if (_currentMethod == HTTP_POST) { + _H2 = md5str(String(F("POST:")) + _uri); + } else if (_currentMethod == HTTP_PUT) { + _H2 = md5str(String(F("PUT:")) + _uri); + } else if (_currentMethod == HTTP_DELETE) { + _H2 = md5str(String(F("DELETE:")) + _uri); + } else { + _H2 = md5str(String(F("GET:")) + _uri); + } + log_v("Hash of GET:uri=%s", _H2.c_str()); + String _responsecheck = ""; + if (authReq.indexOf(FPSTR(qop_auth)) != -1 || authReq.indexOf(FPSTR(qop_auth_quoted)) != -1) { + _responsecheck = md5str(_H1 + ':' + _nonce + ':' + _nc + ':' + _cnonce + F(":auth:") + _H2); + } else { + _responsecheck = md5str(_H1 + ':' + _nonce + ':' + _H2); + } + log_v("The Proper response=%s", _responsecheck.c_str()); + if (_response == _responsecheck) { + authReq = ""; + return true; + } + } + authReq = ""; + } + return false; +} + +String WebServer::_getRandomHexString() { + char buffer[33]; // buffer to hold 32 Hex Digit + /0 + int i; + for (i = 0; i < 4; i++) { + sprintf(buffer + (i * 8), "%08x", rand()); + } + return String(buffer); +} + +void WebServer::requestAuthentication(HTTPAuthMethod mode, const char *realm, const String &authFailMsg) { + if (realm == NULL) { + _srealm = String(F("Login Required")); + } else { + _srealm = String(realm); + } + if (mode == BASIC_AUTH) { + sendHeader(String(FPSTR(WWW_Authenticate)), String(F("Basic realm=\"")) + _srealm + String(F("\""))); + } else { + _snonce = _getRandomHexString(); + _sopaque = _getRandomHexString(); + sendHeader( + String(FPSTR(WWW_Authenticate)), + String(F("Digest realm=\"")) + _srealm + String(F("\", qop=\"auth\", nonce=\"")) + _snonce + + String(F("\", opaque=\"")) + _sopaque + String(F("\"")) + ); + } + using namespace mime; + send(401, String(FPSTR(mimeTable[html].mimeType)), authFailMsg); +} + +void WebServer::on(const Uri &uri, WebServer::THandlerFunction handler) { + on(uri, HTTP_ANY, handler); +} + +void WebServer::on(const Uri &uri, HTTPMethod method, WebServer::THandlerFunction fn) { + on(uri, method, fn, _fileUploadHandler); +} + +void WebServer::on(const Uri &uri, HTTPMethod method, WebServer::THandlerFunction fn, WebServer::THandlerFunction ufn) { + _addRequestHandler(new FunctionRequestHandler(fn, ufn, uri, method)); +} + +void WebServer::addHandler(RequestHandler *handler) { + _addRequestHandler(handler); +} + +void WebServer::_addRequestHandler(RequestHandler *handler) { + if (!_lastHandler) { + _firstHandler = handler; + _lastHandler = handler; + } else { + _lastHandler->next(handler); + _lastHandler = handler; + } +} + +void WebServer::serveStatic(const char *uri, FS &fs, const char *path, const char *cache_header) { + _addRequestHandler(new StaticRequestHandler(fs, path, uri, cache_header)); +} + +void WebServer::handleClient() { + if (_currentStatus == HC_NONE) { + WiFiClient client = _server.available(); + if (!client) { + if (_nullDelay) { + delay(1); + } + return; + } + + log_v("New client: client.localIP()=%s", ipToString(client.localIP()).c_str()); + + _currentClient = client; + _currentStatus = HC_WAIT_READ; + _statusChange = millis(); + } + + bool keepCurrentClient = false; + bool callYield = false; + + if (_currentClient.connected()) { + switch (_currentStatus) { + case HC_NONE: + // No-op to avoid C++ compiler warning + break; + case HC_WAIT_READ: + // Wait for data from client to become available + if (_currentClient.available()) { + if (_parseRequest(_currentClient)) { + // because HTTP_MAX_SEND_WAIT is expressed in milliseconds, + // it must be divided by 1000 + _currentClient.setTimeout(HTTP_MAX_SEND_WAIT / 1000); + _contentLength = CONTENT_LENGTH_NOT_SET; + _handleRequest(); + + // Fix for issue with Chrome based browsers: + // https://github.com/espressif/arduino-esp32/issues/3652 + // if (_currentClient.connected()) { + // _currentStatus = HC_WAIT_CLOSE; + // _statusChange = millis(); + // keepCurrentClient = true; + // } + } + } else { // !_currentClient.available() + if (millis() - _statusChange <= HTTP_MAX_DATA_WAIT) { + keepCurrentClient = true; + } + callYield = true; + } + break; + case HC_WAIT_CLOSE: + // Wait for client to close the connection + if (millis() - _statusChange <= HTTP_MAX_CLOSE_WAIT) { + keepCurrentClient = true; + callYield = true; + } + } + } + + if (!keepCurrentClient) { + _currentClient = WiFiClient(); + _currentStatus = HC_NONE; + _currentUpload.reset(); + } + + if (callYield) { + yield(); + } +} + +void WebServer::close() { + _server.close(); + _currentStatus = HC_NONE; + if (!_headerKeysCount) + collectHeaders(0, 0); +} + +void WebServer::stop() { + close(); +} + +void WebServer::sendHeader(const String &name, const String &value, bool first) { + String headerLine = name; + headerLine += F(": "); + headerLine += value; + headerLine += "\r\n"; + + if (first) { + _responseHeaders = headerLine + _responseHeaders; + } else { + _responseHeaders += headerLine; + } +} + +void WebServer::setContentLength(const size_t contentLength) { + _contentLength = contentLength; +} + +void WebServer::enableDelay(boolean value) { + _nullDelay = value; +} + +void WebServer::enableCORS(boolean value) { + _corsEnabled = value; +} + +void WebServer::enableCrossOrigin(boolean value) { + enableCORS(value); +} + +void WebServer::_prepareHeader(String &response, int code, const char *content_type, size_t contentLength) { + response = String(F("HTTP/1.")) + String(_currentVersion) + ' '; + response += String(code); + response += ' '; + response += _responseCodeToString(code); + response += "\r\n"; + + using namespace mime; + if (!content_type) + content_type = mimeTable[html].mimeType; + + sendHeader(String(F("Content-Type")), String(FPSTR(content_type)), true); + if (_contentLength == CONTENT_LENGTH_NOT_SET) { + sendHeader(String(FPSTR(Content_Length)), String(contentLength)); + } else if (_contentLength != CONTENT_LENGTH_UNKNOWN) { + sendHeader(String(FPSTR(Content_Length)), String(_contentLength)); + } else if (_contentLength == CONTENT_LENGTH_UNKNOWN && _currentVersion) { // HTTP/1.1 or above client + // let's do chunked + _chunked = true; + sendHeader(String(F("Accept-Ranges")), String(F("none"))); + sendHeader(String(F("Transfer-Encoding")), String(F("chunked"))); + } + if (_corsEnabled) { + sendHeader(String(FPSTR("Access-Control-Allow-Origin")), String("*")); + sendHeader(String(FPSTR("Access-Control-Allow-Methods")), String("*")); + sendHeader(String(FPSTR("Access-Control-Allow-Headers")), String("*")); + } + sendHeader(String(F("Connection")), String(F("close"))); + + response += _responseHeaders; + response += "\r\n"; + _responseHeaders = ""; +} + +void WebServer::send(int code, const char *content_type, const String &content) { + String header; + // Can we asume the following? + // if(code == 200 && content.length() == 0 && _contentLength == CONTENT_LENGTH_NOT_SET) + // _contentLength = CONTENT_LENGTH_UNKNOWN; + _prepareHeader(header, code, content_type, content.length()); + _currentClientWrite(header.c_str(), header.length()); + if (content.length()) + sendContent(content); +} + +void WebServer::send_P(int code, PGM_P content_type, PGM_P content) { + size_t contentLength = 0; + + if (content != NULL) { + contentLength = strlen_P(content); + } + + String header; + char type[64]; + strncpy_P(type, (PGM_P)content_type, sizeof(type)); + _prepareHeader(header, code, (const char *)type, contentLength); + _currentClientWrite(header.c_str(), header.length()); + sendContent_P(content); +} + +void WebServer::send_P(int code, PGM_P content_type, PGM_P content, size_t contentLength) { + String header; + char type[64]; + strncpy_P(type, (PGM_P)content_type, sizeof(type)); + _prepareHeader(header, code, (const char *)type, contentLength); + sendContent(header); + sendContent_P(content, contentLength); +} + +void WebServer::send(int code, char *content_type, const String &content) { + send(code, (const char *)content_type, content); +} + +void WebServer::send(int code, const String &content_type, const String &content) { + send(code, (const char *)content_type.c_str(), content); +} + +void WebServer::sendContent(const String &content) { + sendContent(content.c_str(), content.length()); +} + +void WebServer::sendContent(const char *content, size_t contentLength) { + const char *footer = "\r\n"; + if (_chunked) { + char *chunkSize = (char *)malloc(11); + if (chunkSize) { + sprintf(chunkSize, "%x%s", contentLength, footer); + _currentClientWrite(chunkSize, strlen(chunkSize)); + free(chunkSize); + } + } + _currentClientWrite(content, contentLength); + if (_chunked) { + _currentClient.write(footer, 2); + if (contentLength == 0) { + _chunked = false; + } + } +} + +void WebServer::sendContent_P(PGM_P content) { + sendContent_P(content, strlen_P(content)); +} + +void WebServer::sendContent_P(PGM_P content, size_t size) { + const char *footer = "\r\n"; + if (_chunked) { + char *chunkSize = (char *)malloc(11); + if (chunkSize) { + sprintf(chunkSize, "%x%s", size, footer); + _currentClientWrite(chunkSize, strlen(chunkSize)); + free(chunkSize); + } + } + _currentClientWrite_P(content, size); + if (_chunked) { + _currentClient.write(footer, 2); + if (size == 0) { + _chunked = false; + } + } +} + +void WebServer::_streamFileCore(const size_t fileSize, const String &fileName, const String &contentType) { + using namespace mime; + setContentLength(fileSize); + if (fileName.endsWith(String(FPSTR(mimeTable[gz].endsWith))) && + contentType != String(FPSTR(mimeTable[gz].mimeType)) && + contentType != String(FPSTR(mimeTable[none].mimeType))) { + sendHeader(F("Content-Encoding"), F("gzip")); + } + send(200, contentType, ""); +} + +String WebServer::pathArg(unsigned int i) { + if (_currentHandler != nullptr) + return _currentHandler->pathArg(i); + return ""; +} + +String WebServer::arg(String name) { + for (int j = 0; j < _postArgsLen; ++j) { + if (_postArgs[j].key == name) + return _postArgs[j].value; + } + for (int i = 0; i < _currentArgCount; ++i) { + if (_currentArgs[i].key == name) + return _currentArgs[i].value; + } + return ""; +} + +String WebServer::arg(int i) { + if (i < _currentArgCount) + return _currentArgs[i].value; + return ""; +} + +String WebServer::argName(int i) { + if (i < _currentArgCount) + return _currentArgs[i].key; + return ""; +} + +int WebServer::args() { + return _currentArgCount; +} + +bool WebServer::hasArg(String name) { + for (int j = 0; j < _postArgsLen; ++j) { + if (_postArgs[j].key == name) + return true; + } + for (int i = 0; i < _currentArgCount; ++i) { + if (_currentArgs[i].key == name) + return true; + } + return false; +} + +String WebServer::header(String name) { + for (int i = 0; i < _headerKeysCount; ++i) { + if (_currentHeaders[i].key.equalsIgnoreCase(name)) + return _currentHeaders[i].value; + } + return ""; +} + +void WebServer::collectHeaders(const char *headerKeys[], const size_t headerKeysCount) { + _headerKeysCount = headerKeysCount + 1; + if (_currentHeaders) + delete[] _currentHeaders; + _currentHeaders = new RequestArgument[_headerKeysCount]; + _currentHeaders[0].key = FPSTR(AUTHORIZATION_HEADER); + for (int i = 1; i < _headerKeysCount; i++) { + _currentHeaders[i].key = headerKeys[i - 1]; + } +} + +String WebServer::header(int i) { + if (i < _headerKeysCount) + return _currentHeaders[i].value; + return ""; +} + +String WebServer::headerName(int i) { + if (i < _headerKeysCount) + return _currentHeaders[i].key; + return ""; +} + +int WebServer::headers() { + return _headerKeysCount; +} + +bool WebServer::hasHeader(String name) { + for (int i = 0; i < _headerKeysCount; ++i) { + if ((_currentHeaders[i].key.equalsIgnoreCase(name)) && (_currentHeaders[i].value.length() > 0)) + return true; + } + return false; +} + +String WebServer::hostHeader() { + return _hostHeader; +} + +void WebServer::onFileUpload(THandlerFunction fn) { + _fileUploadHandler = fn; +} + +void WebServer::onNotFound(THandlerFunction fn) { + _notFoundHandler = fn; +} + +void WebServer::_handleRequest() { + bool handled = false; + if (!_currentHandler) { + log_e("request handler not found"); + } else { + handled = _currentHandler->handle(*this, _currentMethod, _currentUri); + if (!handled) { + log_e("request handler failed to handle request"); + } + } + if (!handled && _notFoundHandler) { + _notFoundHandler(); + handled = true; + } + if (!handled) { + using namespace mime; + send(404, String(FPSTR(mimeTable[html].mimeType)), String(F("Not found: ")) + _currentUri); + handled = true; + } + if (handled) { + _finalizeResponse(); + } + _currentUri = ""; +} + +void WebServer::_finalizeResponse() { + if (_chunked) { + sendContent(""); + } +} + +String WebServer::_responseCodeToString(int code) { + switch (code) { + case 100: + return F("Continue"); + case 101: + return F("Switching Protocols"); + case 200: + return F("OK"); + case 201: + return F("Created"); + case 202: + return F("Accepted"); + case 203: + return F("Non-Authoritative Information"); + case 204: + return F("No Content"); + case 205: + return F("Reset Content"); + case 206: + return F("Partial Content"); + case 300: + return F("Multiple Choices"); + case 301: + return F("Moved Permanently"); + case 302: + return F("Found"); + case 303: + return F("See Other"); + case 304: + return F("Not Modified"); + case 305: + return F("Use Proxy"); + case 307: + return F("Temporary Redirect"); + case 400: + return F("Bad Request"); + case 401: + return F("Unauthorized"); + case 402: + return F("Payment Required"); + case 403: + return F("Forbidden"); + case 404: + return F("Not Found"); + case 405: + return F("Method Not Allowed"); + case 406: + return F("Not Acceptable"); + case 407: + return F("Proxy Authentication Required"); + case 408: + return F("Request Time-out"); + case 409: + return F("Conflict"); + case 410: + return F("Gone"); + case 411: + return F("Length Required"); + case 412: + return F("Precondition Failed"); + case 413: + return F("Request Entity Too Large"); + case 414: + return F("Request-URI Too Large"); + case 415: + return F("Unsupported Media Type"); + case 416: + return F("Requested range not satisfiable"); + case 417: + return F("Expectation Failed"); + case 500: + return F("Internal Server Error"); + case 501: + return F("Not Implemented"); + case 502: + return F("Bad Gateway"); + case 503: + return F("Service Unavailable"); + case 504: + return F("Gateway Time-out"); + case 505: + return F("HTTP Version not supported"); + default: + return F(""); + } +} + +#endif // LT_ARD_HAS_WIFI diff --git a/cores/common/arduino/libraries/ext/WebServer/WebServer.h b/cores/common/arduino/libraries/ext/WebServer/WebServer.h new file mode 100644 index 000000000..f89502a23 --- /dev/null +++ b/cores/common/arduino/libraries/ext/WebServer/WebServer.h @@ -0,0 +1,224 @@ +/* + WebServer.h - Dead simple web-server. + Supports only one simultaneous client, knows how to handle GET and POST. + + Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Modified 8 May 2015 by Hristo Gochkov (proper post and file upload handling) +*/ + +#pragma once + +#include "HTTP_Method.h" +#include "Uri.h" +#include +#include +#include + +enum HTTPUploadStatus { UPLOAD_FILE_START, UPLOAD_FILE_WRITE, UPLOAD_FILE_END, UPLOAD_FILE_ABORTED }; + +enum HTTPClientStatus { HC_NONE, HC_WAIT_READ, HC_WAIT_CLOSE }; + +enum HTTPAuthMethod { BASIC_AUTH, DIGEST_AUTH }; + +#define HTTP_DOWNLOAD_UNIT_SIZE 1436 + +#ifndef HTTP_UPLOAD_BUFLEN +#define HTTP_UPLOAD_BUFLEN 1436 +#endif + +#define HTTP_MAX_DATA_WAIT 5000 // ms to wait for the client to send the request +#define HTTP_MAX_POST_WAIT 5000 // ms to wait for POST data to arrive +#define HTTP_MAX_SEND_WAIT 5000 // ms to wait for data chunk to be ACKed +#define HTTP_MAX_CLOSE_WAIT 2000 // ms to wait for the client to close the connection + +#define CONTENT_LENGTH_UNKNOWN ((size_t)-1) +#define CONTENT_LENGTH_NOT_SET ((size_t)-2) + +class WebServer; + +typedef struct { + HTTPUploadStatus status; + String filename; + String name; + String type; + size_t totalSize; // file size + size_t currentSize; // size of data currently in buf + uint8_t buf[HTTP_UPLOAD_BUFLEN]; +} HTTPUpload; + +#include "detail/RequestHandler.h" + +namespace fs { +class FS; +} + +class WebServer { + public: + WebServer(IPAddress addr, int port = 80); + WebServer(int port = 80); + virtual ~WebServer(); + + virtual void begin(); + virtual void begin(uint16_t port); + virtual void handleClient(); + + virtual void close(); + void stop(); + + bool authenticate(const char *username, const char *password); + void requestAuthentication( + HTTPAuthMethod mode = BASIC_AUTH, const char *realm = NULL, const String &authFailMsg = String("") + ); + + typedef std::function THandlerFunction; + void on(const Uri &uri, THandlerFunction fn); + void on(const Uri &uri, HTTPMethod method, THandlerFunction fn); + void on(const Uri &uri, HTTPMethod method, THandlerFunction fn, THandlerFunction ufn); // ufn handles file uploads + void addHandler(RequestHandler *handler); + void serveStatic(const char *uri, fs::FS &fs, const char *path, const char *cache_header = NULL); + void onNotFound(THandlerFunction fn); // called when handler is not assigned + void onFileUpload(THandlerFunction ufn); // handle file uploads + + String uri() { + return _currentUri; + } + + HTTPMethod method() { + return _currentMethod; + } + + virtual WiFiClient client() { + return _currentClient; + } + + HTTPUpload &upload() { + return *_currentUpload; + } + + String pathArg(unsigned int i); // get request path argument by number + String arg(String name); // get request argument value by name + String arg(int i); // get request argument value by number + String argName(int i); // get request argument name by number + int args(); // get arguments count + bool hasArg(String name); // check if argument exists + void collectHeaders(const char *headerKeys[], const size_t headerKeysCount); // set the request headers to collect + String header(String name); // get request header value by name + String header(int i); // get request header value by number + String headerName(int i); // get request header name by number + int headers(); // get header count + bool hasHeader(String name); // check if header exists + + String hostHeader(); // get request host header if available or empty String if not + + // send response to the client + // code - HTTP response code, can be 200 or 404 + // content_type - HTTP content type, like "text/plain" or "image/png" + // content - actual content body + void send(int code, const char *content_type = NULL, const String &content = String("")); + void send(int code, char *content_type, const String &content); + void send(int code, const String &content_type, const String &content); + void send_P(int code, PGM_P content_type, PGM_P content); + void send_P(int code, PGM_P content_type, PGM_P content, size_t contentLength); + + void enableDelay(boolean value); + void enableCORS(boolean value = true); + void enableCrossOrigin(boolean value = true); + + void setContentLength(const size_t contentLength); + void sendHeader(const String &name, const String &value, bool first = false); + void sendContent(const String &content); + void sendContent(const char *content, size_t contentLength); + void sendContent_P(PGM_P content); + void sendContent_P(PGM_P content, size_t size); + + static String urlDecode(const String &text); + + template + size_t streamFile(T &file, const String &contentType) { + _streamFileCore(file.size(), file.name(), contentType); + return _currentClient.write(file); + } + + protected: + virtual size_t _currentClientWrite(const char *b, size_t l) { + return _currentClient.write(b, l); + } + + virtual size_t _currentClientWrite_P(PGM_P b, size_t l) { + return _currentClient.write_P(b, l); + } + + void _addRequestHandler(RequestHandler *handler); + void _handleRequest(); + void _finalizeResponse(); + bool _parseRequest(WiFiClient &client); + void _parseArguments(String data); + static String _responseCodeToString(int code); + bool _parseForm(WiFiClient &client, String boundary, uint32_t len); + bool _parseFormUploadAborted(); + void _uploadWriteByte(uint8_t b); + int _uploadReadByte(WiFiClient &client); + void _prepareHeader(String &response, int code, const char *content_type, size_t contentLength); + bool _collectHeader(const char *headerName, const char *headerValue); + + void _streamFileCore(const size_t fileSize, const String &fileName, const String &contentType); + + String _getRandomHexString(); + // for extracting Auth parameters + String _extractParam(String &authReq, const String ¶m, const char delimit = '"'); + + struct RequestArgument { + String key; + String value; + }; + + boolean _corsEnabled; + WiFiServer _server; + + WiFiClient _currentClient; + HTTPMethod _currentMethod; + String _currentUri; + uint8_t _currentVersion; + HTTPClientStatus _currentStatus; + unsigned long _statusChange; + boolean _nullDelay; + + RequestHandler *_currentHandler; + RequestHandler *_firstHandler; + RequestHandler *_lastHandler; + THandlerFunction _notFoundHandler; + THandlerFunction _fileUploadHandler; + + int _currentArgCount; + RequestArgument *_currentArgs; + int _postArgsLen; + RequestArgument *_postArgs; + + std::unique_ptr _currentUpload; + + int _headerKeysCount; + RequestArgument *_currentHeaders; + size_t _contentLength; + String _responseHeaders; + + String _hostHeader; + bool _chunked; + + String _snonce; // Store noance and opaque for future comparison + String _sopaque; + String _srealm; // Store the Auth realm between Calls +}; diff --git a/cores/common/arduino/libraries/ext/WebServer/detail/RequestHandler.h b/cores/common/arduino/libraries/ext/WebServer/detail/RequestHandler.h new file mode 100644 index 000000000..7b6279aba --- /dev/null +++ b/cores/common/arduino/libraries/ext/WebServer/detail/RequestHandler.h @@ -0,0 +1,53 @@ +#pragma once + +#include +#include + +class RequestHandler { + public: + virtual ~RequestHandler() {} + + virtual bool canHandle(HTTPMethod method, String uri) { + (void)method; + (void)uri; + return false; + } + + virtual bool canUpload(String uri) { + (void)uri; + return false; + } + + virtual bool handle(WebServer &server, HTTPMethod requestMethod, String requestUri) { + (void)server; + (void)requestMethod; + (void)requestUri; + return false; + } + + virtual void upload(WebServer &server, String requestUri, HTTPUpload &upload) { + (void)server; + (void)requestUri; + (void)upload; + } + + RequestHandler *next() { + return _next; + } + + void next(RequestHandler *r) { + _next = r; + } + + private: + RequestHandler *_next = nullptr; + + protected: + std::vector pathArgs; + + public: + const String &pathArg(unsigned int i) { + assert(i < pathArgs.size()); + return pathArgs[i]; + } +}; diff --git a/cores/common/arduino/libraries/ext/WebServer/detail/RequestHandlersImpl.h b/cores/common/arduino/libraries/ext/WebServer/detail/RequestHandlersImpl.h new file mode 100644 index 000000000..8d0cd9ddc --- /dev/null +++ b/cores/common/arduino/libraries/ext/WebServer/detail/RequestHandlersImpl.h @@ -0,0 +1,149 @@ +#pragma once + +#include "RequestHandler.h" +#include "Uri.h" +#include "WString.h" +#include "mimetable.h" + +using namespace mime; + +class FunctionRequestHandler : public RequestHandler { + public: + FunctionRequestHandler( + WebServer::THandlerFunction fn, WebServer::THandlerFunction ufn, const Uri &uri, HTTPMethod method + ) + : _fn(fn), _ufn(ufn), _uri(uri.clone()), _method(method) { + _uri->initPathArgs(pathArgs); + } + + ~FunctionRequestHandler() { + delete _uri; + } + + bool canHandle(HTTPMethod requestMethod, String requestUri) override { + if (_method != HTTP_ANY && _method != requestMethod) + return false; + + return _uri->canHandle(requestUri, pathArgs); + } + + bool canUpload(String requestUri) override { + if (!_ufn || !canHandle(HTTP_POST, requestUri)) + return false; + + return true; + } + + bool handle(WebServer &server, HTTPMethod requestMethod, String requestUri) override { + (void)server; + if (!canHandle(requestMethod, requestUri)) + return false; + + _fn(); + return true; + } + + void upload(WebServer &server, String requestUri, HTTPUpload &upload) override { + (void)server; + (void)upload; + if (canUpload(requestUri)) + _ufn(); + } + + protected: + WebServer::THandlerFunction _fn; + WebServer::THandlerFunction _ufn; + Uri *_uri; + HTTPMethod _method; +}; + +class StaticRequestHandler : public RequestHandler { + public: + StaticRequestHandler(FS &fs, const char *path, const char *uri, const char *cache_header) + : _fs(fs), _uri(uri), _path(path), _cache_header(cache_header) { + File f = fs.open(path); + _isFile = (f && (!f.isDirectory())); + log_v( + "StaticRequestHandler: path=%s uri=%s isFile=%d, cache_header=%s\r\n", + path, + uri, + _isFile, + cache_header ? cache_header : "" + ); // issue 5506 - cache_header can be nullptr + _baseUriLength = _uri.length(); + } + + bool canHandle(HTTPMethod requestMethod, String requestUri) override { + if (requestMethod != HTTP_GET) + return false; + + if ((_isFile && requestUri != _uri) || !requestUri.startsWith(_uri)) + return false; + + return true; + } + + bool handle(WebServer &server, HTTPMethod requestMethod, String requestUri) override { + if (!canHandle(requestMethod, requestUri)) + return false; + + log_v("StaticRequestHandler::handle: request=%s _uri=%s\r\n", requestUri.c_str(), _uri.c_str()); + + String path(_path); + + if (!_isFile) { + // Base URI doesn't point to a file. + // If a directory is requested, look for index file. + if (requestUri.endsWith("/")) + requestUri += "index.htm"; + + // Append whatever follows this URI in request to get the file path. + path += requestUri.substring(_baseUriLength); + } + log_v("StaticRequestHandler::handle: path=%s, isFile=%d\r\n", path.c_str(), _isFile); + + String contentType = getContentType(path); + + // look for gz file, only if the original specified path is not a gz. So part only works to send gzip via + // content encoding when a non compressed is asked for if you point the the path to gzip you will serve the gzip + // as content type "application/x-gzip", not text or javascript etc... + if (!path.endsWith(FPSTR(mimeTable[gz].endsWith)) && !_fs.exists(path)) { + String pathWithGz = path + FPSTR(mimeTable[gz].endsWith); + if (_fs.exists(pathWithGz)) + path += FPSTR(mimeTable[gz].endsWith); + } + + File f = _fs.open(path, "r"); + if (!f || !f.available()) + return false; + + if (_cache_header.length() != 0) + server.sendHeader("Cache-Control", _cache_header); + + server.streamFile(f, contentType); + return true; + } + + static String getContentType(const String &path) { + char buff[sizeof(mimeTable[0].mimeType)]; + // Check all entries but last one for match, return if found + for (size_t i = 0; i < sizeof(mimeTable) / sizeof(mimeTable[0]) - 1; i++) { + strcpy_P(buff, mimeTable[i].endsWith); + if (path.endsWith(buff)) { + strcpy_P(buff, mimeTable[i].mimeType); + return String(buff); + } + } + // Fall-through and just return default type + strcpy_P(buff, mimeTable[sizeof(mimeTable) / sizeof(mimeTable[0]) - 1].mimeType); + return String(buff); + } + + protected: + FS _fs; + String _uri; + String _path; + String _cache_header; + bool _isFile; + size_t _baseUriLength; +}; diff --git a/cores/common/arduino/libraries/ext/WebServer/detail/mimetable.cpp b/cores/common/arduino/libraries/ext/WebServer/detail/mimetable.cpp new file mode 100644 index 000000000..779095053 --- /dev/null +++ b/cores/common/arduino/libraries/ext/WebServer/detail/mimetable.cpp @@ -0,0 +1,33 @@ +#include "mimetable.h" +#include "pgmspace.h" + +namespace mime { + +// Table of extension->MIME strings stored in PROGMEM, needs to be global due to GCC section typing rules +const Entry mimeTable[maxType] = { + {".html", "text/html" }, + {".htm", "text/html" }, + {".css", "text/css" }, + {".txt", "text/plain" }, + {".js", "application/javascript" }, + {".json", "application/json" }, + {".png", "image/png" }, + {".gif", "image/gif" }, + {".jpg", "image/jpeg" }, + {".ico", "image/x-icon" }, + {".svg", "image/svg+xml" }, + {".ttf", "application/x-font-ttf" }, + {".otf", "application/x-font-opentype" }, + {".woff", "application/font-woff" }, + {".woff2", "application/font-woff2" }, + {".eot", "application/vnd.ms-fontobject"}, + {".sfnt", "application/font-sfnt" }, + {".xml", "text/xml" }, + {".pdf", "application/pdf" }, + {".zip", "application/zip" }, + {".gz", "application/x-gzip" }, + {".appcache", "text/cache-manifest" }, + {"", "application/octet-stream" } +}; + +} // namespace mime diff --git a/cores/common/arduino/libraries/ext/WebServer/detail/mimetable.h b/cores/common/arduino/libraries/ext/WebServer/detail/mimetable.h new file mode 100644 index 000000000..9e5dd8b56 --- /dev/null +++ b/cores/common/arduino/libraries/ext/WebServer/detail/mimetable.h @@ -0,0 +1,38 @@ +#pragma once + +namespace mime { + +enum type { + html, + htm, + css, + txt, + js, + json, + png, + gif, + jpg, + ico, + svg, + ttf, + otf, + woff, + woff2, + eot, + sfnt, + xml, + pdf, + zip, + gz, + appcache, + none, + maxType +}; + +struct Entry { + const char endsWith[16]; + const char mimeType[32]; +}; + +extern const Entry mimeTable[maxType]; +} // namespace mime diff --git a/cores/common/arduino/libraries/ext/WebServer/uri/UriBraces.h b/cores/common/arduino/libraries/ext/WebServer/uri/UriBraces.h new file mode 100644 index 000000000..b641f4bcd --- /dev/null +++ b/cores/common/arduino/libraries/ext/WebServer/uri/UriBraces.h @@ -0,0 +1,61 @@ +#pragma once + +#include "Uri.h" + +class UriBraces : public Uri { + + public: + explicit UriBraces(const char *uri) : Uri(uri){}; + explicit UriBraces(const String &uri) : Uri(uri){}; + + Uri *clone() const override final { + return new UriBraces(_uri); + }; + + void initPathArgs(std::vector &pathArgs) override final { + int numParams = 0, start = 0; + do { + start = _uri.indexOf("{}", start); + if (start > 0) { + numParams++; + start += 2; + } + } while (start > 0); + pathArgs.resize(numParams); + } + + bool canHandle(const String &requestUri, std::vector &pathArgs) override final { + if (Uri::canHandle(requestUri, pathArgs)) + return true; + + size_t uriLength = _uri.length(); + unsigned int pathArgIndex = 0; + unsigned int requestUriIndex = 0; + for (unsigned int i = 0; i < uriLength; i++, requestUriIndex++) { + char uriChar = _uri[i]; + char requestUriChar = requestUri[requestUriIndex]; + + if (uriChar == requestUriChar) + continue; + if (uriChar != '{') + return false; + + i += 2; // index of char after '}' + if (i >= uriLength) { + // there is no char after '}' + pathArgs[pathArgIndex] = requestUri.substring(requestUriIndex); + return pathArgs[pathArgIndex].indexOf("/") == -1; // path argument may not contain a '/' + } else { + char charEnd = _uri[i]; + int uriIndex = requestUri.indexOf(charEnd, requestUriIndex); + if (uriIndex < 0) + return false; + pathArgs[pathArgIndex] = requestUri.substring(requestUriIndex, uriIndex); + requestUriIndex = (unsigned int)uriIndex; + } + pathArgIndex++; + } + + return requestUriIndex >= requestUri.length(); + } +}; diff --git a/cores/common/arduino/libraries/ext/WebServer/uri/UriGlob.h b/cores/common/arduino/libraries/ext/WebServer/uri/UriGlob.h new file mode 100644 index 000000000..243a98dbb --- /dev/null +++ b/cores/common/arduino/libraries/ext/WebServer/uri/UriGlob.h @@ -0,0 +1,19 @@ +#pragma once + +#include "Uri.h" +#include + +class UriGlob : public Uri { + + public: + explicit UriGlob(const char *uri) : Uri(uri){}; + explicit UriGlob(const String &uri) : Uri(uri){}; + + Uri *clone() const override final { + return new UriGlob(_uri); + }; + + bool canHandle(const String &requestUri, __attribute__((unused)) std::vector &pathArgs) override final { + return fnmatch(_uri.c_str(), requestUri.c_str(), 0) == 0; + } +}; diff --git a/cores/common/arduino/libraries/ext/WebServer/uri/UriRegex.h b/cores/common/arduino/libraries/ext/WebServer/uri/UriRegex.h new file mode 100644 index 000000000..176300d54 --- /dev/null +++ b/cores/common/arduino/libraries/ext/WebServer/uri/UriRegex.h @@ -0,0 +1,41 @@ +#pragma once + +#include "Uri.h" +#include + +class UriRegex : public Uri { + + public: + explicit UriRegex(const char *uri) : Uri(uri){}; + explicit UriRegex(const String &uri) : Uri(uri){}; + + Uri *clone() const override final { + return new UriRegex(_uri); + }; + + void initPathArgs(std::vector &pathArgs) override final { + std::regex rgx((_uri + "|").c_str()); + std::smatch matches; + std::string s{""}; + std::regex_search(s, matches, rgx); + pathArgs.resize(matches.size() - 1); + } + + bool canHandle(const String &requestUri, std::vector &pathArgs) override final { + if (Uri::canHandle(requestUri, pathArgs)) + return true; + + unsigned int pathArgIndex = 0; + std::regex rgx(_uri.c_str()); + std::smatch matches; + std::string s(requestUri.c_str()); + if (std::regex_search(s, matches, rgx)) { + for (size_t i = 1; i < matches.size(); ++i) { // skip first + pathArgs[pathArgIndex] = String(matches[i].str().c_str()); + pathArgIndex++; + } + return true; + } + return false; + } +}; diff --git a/cores/common/arduino/libraries/ext/WiFiMulti/WiFiMulti.cpp b/cores/common/arduino/libraries/ext/WiFiMulti/WiFiMulti.cpp new file mode 100644 index 000000000..b66ca65d0 --- /dev/null +++ b/cores/common/arduino/libraries/ext/WiFiMulti/WiFiMulti.cpp @@ -0,0 +1,248 @@ +/** + * + * @file WiFiMulti.cpp + * @date 16.05.2015 + * @author Markus Sattler + * + * Copyright (c) 2015 Markus Sattler. All rights reserved. + * This file is part of the esp8266 core for Arduino environment. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#if LT_ARD_HAS_WIFI + +#include "WiFiMulti.h" +#include +#include +#include + +WiFiMulti::WiFiMulti() {} + +WiFiMulti::~WiFiMulti() { + for (uint32_t i = 0; i < APlist.size(); i++) { + WifiAPlist_t entry = APlist[i]; + if (entry.ssid) { + free(entry.ssid); + } + if (entry.passphrase) { + free(entry.passphrase); + } + } + APlist.clear(); +} + +bool WiFiMulti::addAP(const char *ssid, const char *passphrase) { + WifiAPlist_t newAP; + + if (!ssid || *ssid == 0x00 || strlen(ssid) > 31) { + // fail SSID too long or missing! + LT_EM(WIFI, "SSID missing or too long"); + return false; + } + + if (passphrase && strlen(passphrase) > 64) { + // fail passphrase too long! + LT_EM(WIFI, "Passphrase too long"); + return false; + } + + newAP.ssid = strdup(ssid); + + if (!newAP.ssid) { + LT_EM(WIFI, "Fail newAP.ssid == 0"); + return false; + } + + if (passphrase && *passphrase != 0x00) { + newAP.passphrase = strdup(passphrase); + if (!newAP.passphrase) { + LT_EM(WIFI, "Fail newAP.passphrase == 0"); + free(newAP.ssid); + return false; + } + } else { + newAP.passphrase = NULL; + } + + APlist.push_back(newAP); + LT_VM(WIFI, "Add SSID: %s", newAP.ssid); + return true; +} + +uint8_t WiFiMulti::run(uint32_t connectTimeout) { + int8_t scanResult; + uint8_t status = WiFi.status(); + if (status == WL_CONNECTED) { + for (uint32_t x = 0; x < APlist.size(); x++) { + if (WiFi.SSID() == APlist[x].ssid) { + return status; + } + } + WiFi.disconnect(false); + delay(10); + status = WiFi.status(); + } + + scanResult = WiFi.scanNetworks(); + if (scanResult == WIFI_SCAN_RUNNING) { + // scan is running + return WL_NO_SSID_AVAIL; + } else if (scanResult >= 0) { + // scan done analyze + WifiAPlist_t bestNetwork{NULL, NULL}; + int bestNetworkDb = INT_MIN; + uint8_t bestBSSID[6]; + int32_t bestChannel = 0; + + LT_IM(WIFI, "Scan finished"); + + if (scanResult == 0) { + LT_IM(WIFI, "No networks found"); + } else { + LT_IM(WIFI, "%d networks found", scanResult); + for (int8_t i = 0; i < scanResult; ++i) { + + String ssid_scan; + int32_t rssi_scan; + WiFiAuthMode sec_scan; + uint8_t *BSSID_scan; + int32_t chan_scan; + + WiFi.getNetworkInfo(i, ssid_scan, sec_scan, rssi_scan, BSSID_scan, chan_scan); + + bool known = false; + for (uint32_t x = APlist.size(); x > 0; x--) { + WifiAPlist_t entry = APlist[x - 1]; + + if (ssid_scan == entry.ssid) { // SSID match + known = true; + if (rssi_scan > bestNetworkDb) { // best network + if (sec_scan == WIFI_AUTH_OPEN || + entry.passphrase) { // check for passphrase if not open wlan + bestNetworkDb = rssi_scan; + bestChannel = chan_scan; + memcpy((void *)&bestNetwork, (void *)&entry, sizeof(bestNetwork)); + memcpy((void *)&bestBSSID, (void *)BSSID_scan, sizeof(bestBSSID)); + } + } + break; + } + } + + if (known) { + LT_DM( + WIFI, + " ---> %d: [%d][%02X:%02X:%02X:%02X:%02X:%02X] %s (%d) %c", + i, + chan_scan, + BSSID_scan[0], + BSSID_scan[1], + BSSID_scan[2], + BSSID_scan[3], + BSSID_scan[4], + BSSID_scan[5], + ssid_scan.c_str(), + rssi_scan, + (sec_scan == WIFI_AUTH_OPEN) ? ' ' : '*' + ); + } else { + LT_DM( + WIFI, + " %d: [%d][%02X:%02X:%02X:%02X:%02X:%02X] %s (%d) %c", + i, + chan_scan, + BSSID_scan[0], + BSSID_scan[1], + BSSID_scan[2], + BSSID_scan[3], + BSSID_scan[4], + BSSID_scan[5], + ssid_scan.c_str(), + rssi_scan, + (sec_scan == WIFI_AUTH_OPEN) ? ' ' : '*' + ); + } + } + } + + // clean up ram + WiFi.scanDelete(); + + if (bestNetwork.ssid) { + LT_IM( + WIFI, + "Connecting to BSSID: %02X:%02X:%02X:%02X:%02X:%02X SSID: %s Channel: %d (%d)", + bestBSSID[0], + bestBSSID[1], + bestBSSID[2], + bestBSSID[3], + bestBSSID[4], + bestBSSID[5], + bestNetwork.ssid, + bestChannel, + bestNetworkDb + ); + + WiFi.begin(bestNetwork.ssid, bestNetwork.passphrase, bestChannel, bestBSSID); + status = WiFi.status(); + + auto startTime = millis(); + // wait for connection, fail, or timeout + while (status != WL_CONNECTED && status != WL_NO_SSID_AVAIL && status != WL_CONNECT_FAILED && + (millis() - startTime) <= connectTimeout) { + delay(10); + status = WiFi.status(); + } + + IPAddress ip; + switch (status) { + case WL_CONNECTED: + LT_IM(WIFI, "Connecting done"); + LT_DM(WIFI, "SSID: %s", WiFi.SSID().c_str()); + // TODO fix this after implementing IP format for printf() + ip = WiFi.localIP(); + LT_DM(WIFI, "IP: %u.%u.%u.%u", ip[0], ip[1], ip[2], ip[3]); + LT_DM(WIFI, "MAC: %s", WiFi.BSSIDstr().c_str()); + LT_DM(WIFI, "Channel: %d", WiFi.channel()); + break; + case WL_NO_SSID_AVAIL: + LT_EM(WIFI, "Connecting failed; AP not found"); + break; + case WL_CONNECT_FAILED: + LT_EM(WIFI, "Connecting failed"); + break; + default: + LT_EM(WIFI, "Connecting failed (%d)", status); + break; + } + } else { + LT_EM(WIFI, "No matching network found!"); + } + } else { + // start scan + LT_VM(WIFI, "Delete old wifi config..."); + WiFi.disconnect(); + + LT_DM(WIFI, "Start scan"); + // scan wifi async mode + WiFi.scanNetworks(true); + } + + return status; +} + +#endif // LT_ARD_HAS_WIFI diff --git a/cores/common/arduino/libraries/ext/WiFiMulti/WiFiMulti.h b/cores/common/arduino/libraries/ext/WiFiMulti/WiFiMulti.h new file mode 100644 index 000000000..4a8815e0c --- /dev/null +++ b/cores/common/arduino/libraries/ext/WiFiMulti/WiFiMulti.h @@ -0,0 +1,47 @@ +/** + * + * @file ESP8266WiFiMulti.h + * @date 16.05.2015 + * @author Markus Sattler + * + * Copyright (c) 2015 Markus Sattler. All rights reserved. + * This file is part of the esp8266 core for Arduino environment. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#pragma once + +#include "WiFi.h" +#include + +typedef struct { + char *ssid; + char *passphrase; +} WifiAPlist_t; + +class WiFiMulti { + public: + WiFiMulti(); + ~WiFiMulti(); + + bool addAP(const char *ssid, const char *passphrase = NULL); + + uint8_t run(uint32_t connectTimeout = 10000); + + private: + std::vector APlist; +}; diff --git a/cores/common/arduino/libraries/ext/base64/base64.cpp b/cores/common/arduino/libraries/ext/base64/base64.cpp new file mode 100644 index 000000000..1fc144e26 --- /dev/null +++ b/cores/common/arduino/libraries/ext/base64/base64.cpp @@ -0,0 +1,64 @@ +/** + * base64.cpp + * + * Created on: 09.12.2015 + * + * Copyright (c) 2015 Markus Sattler. All rights reserved. + * This file is part of the ESP31B core for Arduino. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * + */ + +#include "Arduino.h" +extern "C" { +#include "libb64/cdecode.h" +#include "libb64/cencode.h" +} +#include "base64.h" + +/** + * convert input data to base64 + * @param data const uint8_t * + * @param length size_t + * @return String + */ +String base64::encode(const uint8_t * data, size_t length) +{ + size_t size = base64_encode_expected_len(length) + 1; + char * buffer = (char *) malloc(size); + if(buffer) { + base64_encodestate _state; + base64_init_encodestate(&_state); + int len = base64_encode_block((const char *) &data[0], length, &buffer[0], &_state); + len = base64_encode_blockend((buffer + len), &_state); + + String base64 = String(buffer); + free(buffer); + return base64; + } + return String("-FAIL-"); +} + +/** + * convert input data to base64 + * @param text const String& + * @return String + */ +String base64::encode(const String& text) +{ + return base64::encode((uint8_t *) text.c_str(), text.length()); +} + diff --git a/cores/common/arduino/libraries/ext/base64/base64.h b/cores/common/arduino/libraries/ext/base64/base64.h new file mode 100644 index 000000000..5d88cf49c --- /dev/null +++ b/cores/common/arduino/libraries/ext/base64/base64.h @@ -0,0 +1,9 @@ +#pragma once + +#include + +class base64 { + public: + static String encode(const uint8_t *data, size_t length); + static String encode(const String &text); +}; diff --git a/cores/common/arduino/libraries/ext/base64/libb64/AUTHORS b/cores/common/arduino/libraries/ext/base64/libb64/AUTHORS new file mode 100644 index 000000000..af6873756 --- /dev/null +++ b/cores/common/arduino/libraries/ext/base64/libb64/AUTHORS @@ -0,0 +1,7 @@ +libb64: Base64 Encoding/Decoding Routines +====================================== + +Authors: +------- + +Chris Venter chris.venter@gmail.com http://rocketpod.blogspot.com diff --git a/cores/common/arduino/libraries/ext/base64/libb64/LICENSE b/cores/common/arduino/libraries/ext/base64/libb64/LICENSE new file mode 100644 index 000000000..a6b56069e --- /dev/null +++ b/cores/common/arduino/libraries/ext/base64/libb64/LICENSE @@ -0,0 +1,29 @@ +Copyright-Only Dedication (based on United States law) +or Public Domain Certification + +The person or persons who have associated work with this document (the +"Dedicator" or "Certifier") hereby either (a) certifies that, to the best of +his knowledge, the work of authorship identified is in the public domain of the +country from which the work is published, or (b) hereby dedicates whatever +copyright the dedicators holds in the work of authorship identified below (the +"Work") to the public domain. A certifier, moreover, dedicates any copyright +interest he may have in the associated work, and for these purposes, is +described as a "dedicator" below. + +A certifier has taken reasonable steps to verify the copyright status of this +work. Certifier recognizes that his good faith efforts may not shield him from +liability if in fact the work certified is not in the public domain. + +Dedicator makes this dedication for the benefit of the public at large and to +the detriment of the Dedicator's heirs and successors. Dedicator intends this +dedication to be an overt act of relinquishment in perpetuity of all present +and future rights under copyright law, whether vested or contingent, in the +Work. Dedicator understands that such relinquishment of all rights includes +the relinquishment of all rights to enforce (by lawsuit or otherwise) those +copyrights in the Work. + +Dedicator recognizes that, once placed in the public domain, the Work may be +freely reproduced, distributed, transmitted, used, modified, built upon, or +otherwise exploited by anyone for any purpose, commercial or non-commercial, +and in any way, including by methods that have not yet been invented or +conceived. \ No newline at end of file diff --git a/cores/common/arduino/libraries/ext/base64/libb64/cdecode.c b/cores/common/arduino/libraries/ext/base64/libb64/cdecode.c new file mode 100644 index 000000000..47592b02b --- /dev/null +++ b/cores/common/arduino/libraries/ext/base64/libb64/cdecode.c @@ -0,0 +1,99 @@ +/* +cdecoder.c - c source to a base64 decoding algorithm implementation + +This is part of the libb64 project, and has been placed in the public domain. +For details, see http://sourceforge.net/projects/libb64 +*/ + +#include "cdecode.h" +#include + +static int base64_decode_value_signed(int8_t value_in){ + static const int8_t decoding[] = {62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-2,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51}; + static const int8_t decoding_size = sizeof(decoding); + value_in -= 43; + if (value_in < 0 || value_in >= decoding_size) return -1; + return decoding[(int)value_in]; +} + +void base64_init_decodestate(base64_decodestate* state_in){ + state_in->step = step_a; + state_in->plainchar = 0; +} + +static int base64_decode_block_signed(const int8_t* code_in, const int length_in, int8_t* plaintext_out, base64_decodestate* state_in){ + const int8_t* codechar = code_in; + int8_t* plainchar = plaintext_out; + int8_t fragment; + + *plainchar = state_in->plainchar; + + switch (state_in->step){ + while (1){ + case step_a: + do { + if (codechar == code_in+length_in){ + state_in->step = step_a; + state_in->plainchar = *plainchar; + return plainchar - plaintext_out; + } + fragment = (int8_t)base64_decode_value_signed(*codechar++); + } while (fragment < 0); + *plainchar = (fragment & 0x03f) << 2; + case step_b: + do { + if (codechar == code_in+length_in){ + state_in->step = step_b; + state_in->plainchar = *plainchar; + return plainchar - plaintext_out; + } + fragment = (int8_t)base64_decode_value_signed(*codechar++); + } while (fragment < 0); + *plainchar++ |= (fragment & 0x030) >> 4; + *plainchar = (fragment & 0x00f) << 4; + case step_c: + do { + if (codechar == code_in+length_in){ + state_in->step = step_c; + state_in->plainchar = *plainchar; + return plainchar - plaintext_out; + } + fragment = (int8_t)base64_decode_value_signed(*codechar++); + } while (fragment < 0); + *plainchar++ |= (fragment & 0x03c) >> 2; + *plainchar = (fragment & 0x003) << 6; + case step_d: + do { + if (codechar == code_in+length_in){ + state_in->step = step_d; + state_in->plainchar = *plainchar; + return plainchar - plaintext_out; + } + fragment = (int8_t)base64_decode_value_signed(*codechar++); + } while (fragment < 0); + *plainchar++ |= (fragment & 0x03f); + } + } + /* control should not reach here */ + return plainchar - plaintext_out; +} + +static int base64_decode_chars_signed(const int8_t* code_in, const int length_in, int8_t* plaintext_out){ + base64_decodestate _state; + base64_init_decodestate(&_state); + int len = base64_decode_block_signed(code_in, length_in, plaintext_out, &_state); + if(len > 0) plaintext_out[len] = 0; + return len; +} + +int base64_decode_value(char value_in){ + return base64_decode_value_signed(*((int8_t *) &value_in)); +} + +int base64_decode_block(const char* code_in, const int length_in, char* plaintext_out, base64_decodestate* state_in){ + return base64_decode_block_signed((int8_t *) code_in, length_in, (int8_t *) plaintext_out, state_in); +} + +int base64_decode_chars(const char* code_in, const int length_in, char* plaintext_out){ + return base64_decode_chars_signed((int8_t *) code_in, length_in, (int8_t *) plaintext_out); +} diff --git a/cores/common/arduino/libraries/ext/base64/libb64/cdecode.h b/cores/common/arduino/libraries/ext/base64/libb64/cdecode.h new file mode 100644 index 000000000..44f114f69 --- /dev/null +++ b/cores/common/arduino/libraries/ext/base64/libb64/cdecode.h @@ -0,0 +1,38 @@ +/* +cdecode.h - c header for a base64 decoding algorithm + +This is part of the libb64 project, and has been placed in the public domain. +For details, see http://sourceforge.net/projects/libb64 +*/ + +#ifndef BASE64_CDECODE_H +#define BASE64_CDECODE_H + +#define base64_decode_expected_len(n) ((n * 3) / 4) + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + step_a, step_b, step_c, step_d +} base64_decodestep; + +typedef struct { + base64_decodestep step; + char plainchar; +} base64_decodestate; + +void base64_init_decodestate(base64_decodestate* state_in); + +int base64_decode_value(char value_in); + +int base64_decode_block(const char* code_in, const int length_in, char* plaintext_out, base64_decodestate* state_in); + +int base64_decode_chars(const char* code_in, const int length_in, char* plaintext_out); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif /* BASE64_CDECODE_H */ diff --git a/cores/common/arduino/libraries/ext/base64/libb64/cencode.c b/cores/common/arduino/libraries/ext/base64/libb64/cencode.c new file mode 100644 index 000000000..48a0d30b7 --- /dev/null +++ b/cores/common/arduino/libraries/ext/base64/libb64/cencode.c @@ -0,0 +1,102 @@ +/* +cencoder.c - c source to a base64 encoding algorithm implementation + +This is part of the libb64 project, and has been placed in the public domain. +For details, see http://sourceforge.net/projects/libb64 +*/ + +#include "cencode.h" + +void base64_init_encodestate(base64_encodestate* state_in) +{ + state_in->step = step_A; + state_in->result = 0; +} + +char base64_encode_value(char value_in) +{ + static const char* encoding = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + if (value_in > 63) { + return '='; + } + return encoding[(int)value_in]; +} + +int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, base64_encodestate* state_in) +{ + const char* plainchar = plaintext_in; + const char* const plaintextend = plaintext_in + length_in; + char* codechar = code_out; + char result; + char fragment; + + result = state_in->result; + + switch (state_in->step) { + while (1) { + case step_A: + if (plainchar == plaintextend) { + state_in->result = result; + state_in->step = step_A; + return codechar - code_out; + } + fragment = *plainchar++; + result = (fragment & 0x0fc) >> 2; + *codechar++ = base64_encode_value(result); + result = (fragment & 0x003) << 4; + case step_B: + if (plainchar == plaintextend) { + state_in->result = result; + state_in->step = step_B; + return codechar - code_out; + } + fragment = *plainchar++; + result |= (fragment & 0x0f0) >> 4; + *codechar++ = base64_encode_value(result); + result = (fragment & 0x00f) << 2; + case step_C: + if (plainchar == plaintextend) { + state_in->result = result; + state_in->step = step_C; + return codechar - code_out; + } + fragment = *plainchar++; + result |= (fragment & 0x0c0) >> 6; + *codechar++ = base64_encode_value(result); + result = (fragment & 0x03f) >> 0; + *codechar++ = base64_encode_value(result); + } + } + /* control should not reach here */ + return codechar - code_out; +} + +int base64_encode_blockend(char* code_out, base64_encodestate* state_in) +{ + char* codechar = code_out; + + switch (state_in->step) { + case step_B: + *codechar++ = base64_encode_value(state_in->result); + *codechar++ = '='; + *codechar++ = '='; + break; + case step_C: + *codechar++ = base64_encode_value(state_in->result); + *codechar++ = '='; + break; + case step_A: + break; + } + *codechar = 0x00; + + return codechar - code_out; +} + +int base64_encode_chars(const char* plaintext_in, int length_in, char* code_out) +{ + base64_encodestate _state; + base64_init_encodestate(&_state); + int len = base64_encode_block(plaintext_in, length_in, code_out, &_state); + return len + base64_encode_blockend((code_out + len), &_state); +} diff --git a/cores/common/arduino/libraries/ext/base64/libb64/cencode.h b/cores/common/arduino/libraries/ext/base64/libb64/cencode.h new file mode 100644 index 000000000..51bb3f3dd --- /dev/null +++ b/cores/common/arduino/libraries/ext/base64/libb64/cencode.h @@ -0,0 +1,41 @@ +/* +cencode.h - c header for a base64 encoding algorithm + +This is part of the libb64 project, and has been placed in the public domain. +For details, see http://sourceforge.net/projects/libb64 +*/ + +#ifndef BASE64_CENCODE_H +#define BASE64_CENCODE_H + +#define base64_encode_expected_len(n) ((((4 * n) / 3) + 3) & ~3) + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + step_A, step_B, step_C +} base64_encodestep; + +typedef struct { + base64_encodestep step; + char result; + int stepcount; +} base64_encodestate; + +void base64_init_encodestate(base64_encodestate* state_in); + +char base64_encode_value(char value_in); + +int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, base64_encodestate* state_in); + +int base64_encode_blockend(char* code_out, base64_encodestate* state_in); + +int base64_encode_chars(const char* plaintext_in, int length_in, char* code_out); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif /* BASE64_CENCODE_H */ diff --git a/cores/common/arduino/libraries/ext/cbuf/cbuf.cpp b/cores/common/arduino/libraries/ext/cbuf/cbuf.cpp new file mode 100644 index 000000000..ef7370a8a --- /dev/null +++ b/cores/common/arduino/libraries/ext/cbuf/cbuf.cpp @@ -0,0 +1,196 @@ +/* + cbuf.cpp - Circular buffer implementation + Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. + This file is part of the esp8266 core for Arduino environment. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include "cbuf.h" + +cbuf::cbuf(size_t size) : + next(NULL), _size(size+1), _buf(new char[size+1]), _bufend(_buf + size + 1), _begin(_buf), _end(_begin) +{ +} + +cbuf::~cbuf() +{ + delete[] _buf; +} + +size_t cbuf::resizeAdd(size_t addSize) +{ + return resize(_size + addSize); +} + +size_t cbuf::resize(size_t newSize) +{ + + size_t bytes_available = available(); + newSize += 1; + // not lose any data + // if data can be lost use remove or flush before resize + if((newSize < bytes_available) || (newSize == _size)) { + return _size; + } + + char *newbuf = new char[newSize]; + char *oldbuf = _buf; + + if(!newbuf) { + return _size; + } + + if(_buf) { + read(newbuf, bytes_available); + memset((newbuf + bytes_available), 0x00, (newSize - bytes_available)); + } + + _begin = newbuf; + _end = newbuf + bytes_available; + _bufend = newbuf + newSize; + _size = newSize; + + _buf = newbuf; + delete[] oldbuf; + + return _size; +} + +size_t cbuf::available() const +{ + if(_end >= _begin) { + return _end - _begin; + } + return _size - (_begin - _end); +} + +size_t cbuf::size() +{ + return _size; +} + +size_t cbuf::room() const +{ + if(_end >= _begin) { + return _size - (_end - _begin) - 1; + } + return _begin - _end - 1; +} + +int cbuf::peek() +{ + if(empty()) { + return -1; + } + + return static_cast(*_begin); +} + +size_t cbuf::peek(char *dst, size_t size) +{ + size_t bytes_available = available(); + size_t size_to_read = (size < bytes_available) ? size : bytes_available; + size_t size_read = size_to_read; + char * begin = _begin; + if(_end < _begin && size_to_read > (size_t) (_bufend - _begin)) { + size_t top_size = _bufend - _begin; + memcpy(dst, _begin, top_size); + begin = _buf; + size_to_read -= top_size; + dst += top_size; + } + memcpy(dst, begin, size_to_read); + return size_read; +} + +int cbuf::read() +{ + if(empty()) { + return -1; + } + + char result = *_begin; + _begin = wrap_if_bufend(_begin + 1); + return static_cast(result); +} + +size_t cbuf::read(char* dst, size_t size) +{ + size_t bytes_available = available(); + size_t size_to_read = (size < bytes_available) ? size : bytes_available; + size_t size_read = size_to_read; + if(_end < _begin && size_to_read > (size_t) (_bufend - _begin)) { + size_t top_size = _bufend - _begin; + memcpy(dst, _begin, top_size); + _begin = _buf; + size_to_read -= top_size; + dst += top_size; + } + memcpy(dst, _begin, size_to_read); + _begin = wrap_if_bufend(_begin + size_to_read); + return size_read; +} + +size_t cbuf::write(char c) +{ + if(full()) { + return 0; + } + + *_end = c; + _end = wrap_if_bufend(_end + 1); + return 1; +} + +size_t cbuf::write(const char* src, size_t size) +{ + size_t bytes_available = room(); + size_t size_to_write = (size < bytes_available) ? size : bytes_available; + size_t size_written = size_to_write; + if(_end >= _begin && size_to_write > (size_t) (_bufend - _end)) { + size_t top_size = _bufend - _end; + memcpy(_end, src, top_size); + _end = _buf; + size_to_write -= top_size; + src += top_size; + } + memcpy(_end, src, size_to_write); + _end = wrap_if_bufend(_end + size_to_write); + return size_written; +} + +void cbuf::flush() +{ + _begin = _buf; + _end = _buf; +} + +size_t cbuf::remove(size_t size) +{ + size_t bytes_available = available(); + if(size >= bytes_available) { + flush(); + return 0; + } + size_t size_to_remove = (size < bytes_available) ? size : bytes_available; + if(_end < _begin && size_to_remove > (size_t) (_bufend - _begin)) { + size_t top_size = _bufend - _begin; + _begin = _buf; + size_to_remove -= top_size; + } + _begin = wrap_if_bufend(_begin + size_to_remove); + return available(); +} diff --git a/cores/common/arduino/libraries/ext/cbuf/cbuf.h b/cores/common/arduino/libraries/ext/cbuf/cbuf.h new file mode 100644 index 000000000..490352e32 --- /dev/null +++ b/cores/common/arduino/libraries/ext/cbuf/cbuf.h @@ -0,0 +1,79 @@ +/* + cbuf.h - Circular buffer implementation + Copyright (c) 2014 Ivan Grokhotkov. All rights reserved. + This file is part of the esp8266 core for Arduino environment. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#ifndef __cbuf_h +#define __cbuf_h + +#include +#include +#include + +class cbuf +{ +public: + cbuf(size_t size); + ~cbuf(); + + size_t resizeAdd(size_t addSize); + size_t resize(size_t newSize); + size_t available() const; + size_t size(); + + size_t room() const; + + inline bool empty() const + { + return _begin == _end; + } + + inline bool full() const + { + return wrap_if_bufend(_end + 1) == _begin; + } + + int peek(); + size_t peek(char *dst, size_t size); + + int read(); + size_t read(char* dst, size_t size); + + size_t write(char c); + size_t write(const char* src, size_t size); + + void flush(); + size_t remove(size_t size); + + cbuf *next; + +protected: + inline char* wrap_if_bufend(char* ptr) const + { + return (ptr == _bufend) ? _buf : ptr; + } + + size_t _size; + char* _buf; + const char* _bufend; + char* _begin; + char* _end; + +}; + +#endif//__cbuf_h diff --git a/cores/common/arduino/libraries/inline/ESP/ESP.h b/cores/common/arduino/libraries/inline/ESP/ESP.h new file mode 100644 index 000000000..b2095ebb1 --- /dev/null +++ b/cores/common/arduino/libraries/inline/ESP/ESP.h @@ -0,0 +1,157 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-20.() */ + +#include + +#ifdef __cplusplus + +/** + * @brief ESP Arduino Core compatibility class. + * + * This class only consists of inline functions, which + * wrap the LibreTiny C API (lt_api.h). Refer to the docs of the C API + * for more information. + * + * The class is accessible using the `ESP` global object. + */ +class EspClass { + public: + /** + * @brief Enable the hardware watchdog. + * + * @param timeout watchdog timeout, milliseconds + * @return whether the chip has a hardware watchdog + */ + inline void wdtEnable(uint32_t timeout_ms = 0) { lt_wdt_enable(timeout_ms); } + + /** + * @brief Disable the hardware watchdog. + */ + inline void wdtDisable() { lt_wdt_disable(); } + + /** + * @brief Feed/reset the hardware watchdog timer. + */ + inline void wdtFeed() { lt_wdt_feed(); } + + /** + * @brief Reboot the CPU. + */ + inline void reset() { lt_reboot(); } + + /** + * @brief Reboot the CPU. + */ + inline void restart() { lt_reboot(); } + + /** + * @brief Reboot the CPU and stay in download mode (if possible). + * + * @return whether download-mode reboot is possible + */ + inline void rebootIntoUartDownloadMode() { lt_reboot_download_mode(); } + + inline uint16_t getVcc() { return 3300; } + + /** + * @brief Get CPU ID based on the last three octets of MAC address. + * Note: the number is 24-bit (with the MSB being zero). + * The 3rd-to-last octet is least-significant, the last octet is most-significant. + */ + inline uint32_t getChipId() { return lt_cpu_get_mac_id(); } + + /** + * @brief Get free heap size. + */ + inline uint32_t getFreeHeap() { return lt_heap_get_free(); } + + /** + * @brief Get largest block of heap that can be allocated at once. + */ + inline uint16_t getMaxFreeBlockSize() { return lt_heap_get_max_alloc(); } + + /** @copydoc LT_VERSION_STR() */ + inline const char *getSdkVersion() { return LT_VERSION_STR; } + + /** @copydoc LT_VERSION_STR() */ + inline String getCoreVersion() { return LT_VERSION_STR; } + + /** @copydoc LT_BANNER_STR() */ + inline String getFullVersion() { return LT_BANNER_STR; } + + inline uint8_t getBootVersion() { return 0; } + + inline uint8_t getBootMode() { return 0; } + + /** + * @brief Get CPU frequency in MHz. + */ + inline uint8_t getCpuFreqMHz() { return lt_cpu_get_freq_mhz(); } + + /** + * @brief Flash chip ID structure. + */ + inline uint32_t getFlashChipId() { + lt_flash_id_t id = lt_flash_get_id(); + return id.manufacturer_id << 16 | id.chip_id << 7 | id.chip_size_id; + } + + /** + * @brief Flash chip ID structure. + */ + inline uint8_t getFlashChipVendorId() { return lt_flash_get_id().manufacturer_id; } + + /** + * @brief Get flash chip total size. + * + * The default implementation uses the least significant + * byte of the chip ID to determine the size. + */ + inline uint32_t getFlashChipRealSize() { return lt_flash_get_size(); } + + /** @copydoc lt_flash_get_size() */ + inline uint32_t getFlashChipSize() { return lt_flash_get_size(); } + + inline uint32_t getFlashChipMode() { return 0xFF; } + + /** @copydoc lt_flash_get_size() */ + inline uint32_t getFlashChipSizeByChipId() { return lt_flash_get_size(); } + + /** @copydoc lt_flash_erase_block() */ + inline bool flashEraseSector(uint32_t sector) { return lt_flash_erase_block(sector); } + + /** @copydoc lt_flash_write() */ + inline bool flashWrite(uint32_t address, const uint8_t *data, size_t size) { + return lt_flash_write(address, data, size) == size; + } + + /** @copydoc lt_flash_read() */ + inline bool flashRead(uint32_t address, uint8_t *data, size_t size) { + return lt_flash_read(address, data, size) == size; + } + + /** @copydoc lt_get_reboot_reason_name() */ + inline String getResetReason() { return lt_get_reboot_reason_name(lt_get_reboot_reason()); } + + /** @copydoc lt_get_reboot_reason_name() */ + inline String getResetInfo() { return lt_get_reboot_reason_name(lt_get_reboot_reason()); } + + /** @copydoc lt_rand_bytes() */ + inline uint8_t *random(uint8_t *resultArray, const size_t outputSizeBytes) { + lt_rand_bytes(resultArray, (size_t)outputSizeBytes); + return resultArray; + } + + /** @copydoc lt_rand_bytes() */ + inline uint32_t random() { + uint32_t i; + lt_rand_bytes((uint8_t *)&i, 4); + return i; + } + + /** @copydoc lt_cpu_get_cycle_count() */ + inline uint32_t getCycleCount() { return lt_cpu_get_cycle_count(); } +}; + +extern EspClass ESP; + +#endif diff --git a/cores/common/arduino/libraries/inline/Flash/Flash.h b/cores/common/arduino/libraries/inline/Flash/Flash.h new file mode 100644 index 000000000..ded1b36f8 --- /dev/null +++ b/cores/common/arduino/libraries/inline/Flash/Flash.h @@ -0,0 +1,64 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-24. */ + +#pragma once + +#include + +#ifdef __cplusplus + +class FlashClass { + public: + /** + * @brief Flash chip ID structure. + */ + inline FlashId getChipId() { return lt_flash_get_id(); } + + /** + * @brief Get flash chip total size. + * + * The default implementation uses the least significant + * byte of the chip ID to determine the size. + */ + inline uint32_t getSize() { return lt_flash_get_size(); } + + /** + * @brief Erase a single block of flash (usually 4 KiB). + * + * @param offset offset of the block (in bytes); must be multiple of the flash chip's block size + * @return whether erasing was successful + */ + inline bool eraseSector(uint32_t offset) { + // + return lt_flash_erase_block(offset); + } + + /** + * @brief Read data from the flash. + * + * @param offset starting offset (in bytes) + * @param data pointer to where to store the data + * @param length length of data to read + * @return length of data successfully read (should equal 'length') + */ + inline bool readBlock(uint32_t offset, uint8_t *data, size_t length) { + // + return lt_flash_read(offset, data, length) == length; + } + + /** + * @brief Write data to the flash. + * + * @param offset starting offset (in bytes) + * @param data pointer to data to write + * @param length length of data to write + * @return length of data successfully written (should equal 'length') + */ + inline bool writeBlock(uint32_t offset, const uint8_t *data, size_t length) { + // + return lt_flash_write(offset, data, length) == length; + } +}; + +extern FlashClass Flash; + +#endif diff --git a/cores/common/arduino/libraries/inline/LT/LT.h b/cores/common/arduino/libraries/inline/LT/LT.h new file mode 100644 index 000000000..9def2feee --- /dev/null +++ b/cores/common/arduino/libraries/inline/LT/LT.h @@ -0,0 +1,151 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-06. */ + +#pragma once + +#include +#include +#include +#include + +#ifdef __cplusplus + +#define ChipFamily lt_cpu_family_t +#define ChipType lt_cpu_model_t +#define ResetReason lt_reboot_reason_t +#define FlashId lt_flash_id_t + +/** + * @brief Main LibreTiny API class. + * + * Since v1.0.0, this class only consists of inline functions, which + * wrap the LibreTiny C API (lt_api.h). Refer to the docs of the C API + * for more information. + * + * The class is accessible using the `LT` global object. + */ +class LibreTiny { + public: /* lt_cpu.h */ + /** + * @brief Get CPU family ID (as lt_cpu_family_t enum member). + */ + inline ChipFamily getChipFamily() { return lt_cpu_get_family(); } + + /** + * @brief Get CPU family name as string. + */ + inline const char *getChipFamilyName() { return lt_cpu_get_family_name(); } + + /** + * @brief Get CPU model ID (as lt_cpu_model_t enum member). + */ + inline ChipType getChipType() { return lt_cpu_get_model(); } + + /** + * @brief Get CPU model name as string (uppercase). + */ + inline const char *getChipModel() { return lt_cpu_get_model_name(); } + + /** + * @brief Get CPU ID based on the last three octets of MAC address. + * Note: the number is 24-bit (with the MSB being zero). + * The 3rd-to-last octet is least-significant, the last octet is most-significant. + */ + inline uint32_t getChipId() { return lt_cpu_get_mac_id(); } + + /** + * @brief Get CPU core count. + */ + inline uint8_t getChipCores() { return lt_cpu_get_core_count(); } + + /** + * @brief Get CPU core type name as string. + */ + inline const char *getChipCoreType() { return lt_cpu_get_core_type(); } + + /** + * @brief Get CPU frequency in Hz. + */ + inline uint32_t getCpuFreq() { return lt_cpu_get_freq(); } + + /** + * @brief Get CPU frequency in MHz. + */ + inline uint32_t getCpuFreqMHz() { return lt_cpu_get_freq_mhz(); } + + /** + * @brief Get CPU cycle count. + */ + inline uint32_t getCycleCount() { return lt_cpu_get_cycle_count(); } + + public: /* lt_device.h */ + /** + * @brief Reset reason enumeration. + */ + inline const char *getVersion() { return lt_get_version(); } + + /** + * @brief Get board code. + */ + inline const char *getBoard() { return lt_get_board_code(); } + + /** + * @brief Get device friendly name in format "LT--". + * Can be used as hostname. + */ + inline const char *getDeviceName() { return lt_get_device_name(); } + + /** + * @brief Reboot the CPU. + */ + inline void restart() { lt_reboot(); } + + /** + * @brief Reboot the CPU and stay in download mode (if possible). + * + * @return whether download-mode reboot is possible + */ + inline void restartDownloadMode() { lt_reboot_download_mode(); } + + /** + * @brief Get the reason of last chip reboot. + */ + inline ResetReason getResetReason() { return lt_get_reboot_reason(); } + + /** @copydoc lt_get_reboot_reason_name() */ + inline const char *getResetReasonName(ResetReason reason = lt_get_reboot_reason()) { + return lt_get_reboot_reason_name(reason); + } + + /** @copydoc lt_gpio_recover(); */ + inline void gpioRecover() { lt_gpio_recover(); } + + public: /* lt_flash.h */ + /** @copydoc lt_flash_get_id() */ + inline FlashId getFlashChipId() { return lt_flash_get_id(); } + + /** @copydoc lt_flash_get_size() */ + inline uint32_t getFlashChipSize() { return lt_flash_get_size(); } + + public: /* lt_mem.h */ + /** @copydoc lt_ram_get_size() */ + inline uint32_t getRamSize() { return lt_ram_get_size(); } + + /** @copydoc lt_heap_get_size() */ + inline uint32_t getHeapSize() { return lt_heap_get_size(); } + + /** @copydoc lt_heap_get_free() */ + inline uint32_t getFreeHeap() { return lt_heap_get_free(); } + + /** @copydoc lt_heap_get_min_free() */ + inline uint32_t getMinFreeHeap() { return lt_heap_get_min_free(); } + + /** @copydoc lt_heap_get_max_alloc() */ + inline uint32_t getMaxAllocHeap() { return lt_heap_get_max_alloc(); } + + /** @copydoc lt_heap_get_max_alloc() */ + inline uint32_t getMaxFreeBlockSize() { return lt_heap_get_max_alloc(); } +}; + +extern LibreTiny LT; + +#endif diff --git a/cores/common/arduino/libraries/inline/OTA/OTA.h b/cores/common/arduino/libraries/inline/OTA/OTA.h new file mode 100644 index 000000000..6068858e4 --- /dev/null +++ b/cores/common/arduino/libraries/inline/OTA/OTA.h @@ -0,0 +1,77 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-10. */ + +#pragma once + +#include + +#ifdef __cplusplus + +/** + * @brief Over-the-Air updates helper class. + * + * This class only consists of inline functions, which + * wrap the LibreTiny C API (lt_api.h). Refer to the docs of the C API + * for more information. + * + * The class is accessible using the `OTA` global object. + */ +class LibreTinyOTA { + public: /* lt_ota.h */ + /** + * @brief Get OTA type of the device's chip. + */ + inline lt_ota_type_t getType() { return lt_ota_get_type(); } + + /** + * @brief Check if the specified OTA image is valid. + * + * @param index OTA index to check; 0 for single-OTA chips, 1 or 2 for dual-OTA chips + * @return true if index is valid for the chip's OTA type, and there is a valid image; false otherwise + */ + inline bool isValid(uint8_t index) { return lt_ota_is_valid(index); } + + /** + * @brief Check if OTA rollback is possible (switching the stored index to another partition). + * + * Note that this is not the same as "switching" OTA with revert=true. + * + * @return true if 2nd image is valid and the chip is dual-OTA; false otherwise + */ + inline bool canRollback() { return lt_ota_can_rollback(); } + + /** + * @brief Get the currently running firmware's OTA index. + * + * @return OTA index if dual-OTA is supported, 0 otherwise + */ + inline uint8_t getCurrentIndex() { return lt_ota_dual_get_current(); } + + /** + * @brief Read the currently active OTA index, i.e. the one that will boot upon restart. + * + * @return OTA index if dual-OTA is supported, 0 otherwise + */ + inline uint8_t getStoredIndex() { return lt_ota_dual_get_stored(); } + + /** + * @brief Check which UF2 OTA scheme should be used for applying firmware updates. + * + * @return OTA scheme of the target partition + */ + inline uf2_ota_scheme_t getUF2Scheme() { return lt_ota_get_uf2_scheme(); } + + /** + * @brief Try to switch OTA index to the other image. For single-OTA chips, only check if the upgrade image is valid. + * + * This can be used to "activate" the upgrade after flashing. + * + * @param revert switch if (and only if) the other image is already marked as active (i.e. + * switch back to the running image) + * @return false if the second image (or upgrade image) is not valid; false if writing failed; true otherwise + */ + inline bool switchImage(bool revert = false) { return lt_ota_switch(revert); } +}; + +extern LibreTinyOTA OTA; + +#endif diff --git a/cores/common/arduino/libraries/inline/Singletons.cpp b/cores/common/arduino/libraries/inline/Singletons.cpp new file mode 100644 index 000000000..1d0d2d6c9 --- /dev/null +++ b/cores/common/arduino/libraries/inline/Singletons.cpp @@ -0,0 +1,11 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-10. */ + +#include + +#include + +LibreTiny LT; +LibreTinyOTA OTA; +LibreTinyWDT WDT; +EspClass ESP; +FlashClass Flash; diff --git a/cores/common/arduino/libraries/inline/WDT/WDT.h b/cores/common/arduino/libraries/inline/WDT/WDT.h new file mode 100644 index 000000000..049762299 --- /dev/null +++ b/cores/common/arduino/libraries/inline/WDT/WDT.h @@ -0,0 +1,41 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-10. */ + +#pragma once + +#include + +#ifdef __cplusplus + +/** + * @brief Watchdog control class. + * + * This class only consists of inline functions, which + * wrap the LibreTiny C API (lt_api.h). Refer to the docs of the C API + * for more information. + * + * The class is accessible using the `WDT` global object. + */ +class LibreTinyWDT { + public: /* lt_wdt.h */ + /** + * @brief Enable the hardware watchdog. + * + * @param timeout watchdog timeout, milliseconds + * @return whether the chip has a hardware watchdog + */ + inline bool enable(uint32_t timeout = 10000) { return lt_wdt_enable(timeout); } + + /** + * @brief Disable the hardware watchdog. + */ + inline void disable() { lt_wdt_disable(); } + + /** + * @brief Feed/reset the hardware watchdog timer. + */ + inline void feed() { lt_wdt_feed(); } +}; + +extern LibreTinyWDT WDT; + +#endif diff --git a/cores/common/arduino/src/Arduino.h b/cores/common/arduino/src/Arduino.h new file mode 100644 index 000000000..4688e28ff --- /dev/null +++ b/cores/common/arduino/src/Arduino.h @@ -0,0 +1,61 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-14. */ + +#pragma once + +// LibreTiny C API (with C standard libraries) +#include + +// Additional C libraries +#include +#include + +// C++ standard libraries +#ifdef __cplusplus +#include +#include +using ::round; +using std::abs; +using std::isinf; +using std::isnan; +using std::max; +using std::min; +#endif + +// Arduino Core and LT class +#include +#ifdef __cplusplus +#include +using namespace arduino; +#endif + +// Include family-specific code +#include + +// Additional Wiring headers +#include "wiring_compat.h" +#include "wiring_custom.h" + +// FreeRTOS kernel +#include +#include + +// Define available serial ports +#if defined(__cplusplus) && LT_ARD_HAS_SERIAL +#include + +#if HAS_SERIAL_CLASS +#if LT_HW_UART0 +extern SerialClass Serial0; +#endif +#if LT_HW_UART1 +extern SerialClass Serial1; +#endif +#if LT_HW_UART2 +extern SerialClass Serial2; +#endif +#endif + +#define SerialN(x) Serial##x +#define SerialM(x) SerialN(x) +#define Serial SerialM(LT_UART_DEFAULT_SERIAL) +#endif diff --git a/cores/common/arduino/src/Events.cpp b/cores/common/arduino/src/Events.cpp new file mode 100644 index 000000000..3f6d44cfb --- /dev/null +++ b/cores/common/arduino/src/Events.cpp @@ -0,0 +1,5 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-05-17. */ + +#include "Events.h" + +uint16_t EventHandler_s::lastId = 1; diff --git a/cores/common/arduino/src/Events.h b/cores/common/arduino/src/Events.h new file mode 100644 index 000000000..096603913 --- /dev/null +++ b/cores/common/arduino/src/Events.h @@ -0,0 +1,117 @@ +/* + ESP8266WiFiGeneric.h - esp8266 Wifi support. + Based on WiFi.h from Ardiono WiFi shield library. + Copyright (c) 2011-2014 Arduino. All right reserved. + Modified by Ivan Grokhotkov, December 2014 + Reworked by Markus Sattler, December 2015 + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#pragma once + +#include +#include +#include + +typedef enum { + ARDUINO_EVENT_WIFI_READY = 0, /**< ESP32 WiFi ready */ + ARDUINO_EVENT_WIFI_SCAN_DONE, /**< ESP32 finish scanning AP */ + ARDUINO_EVENT_WIFI_STA_START, /**< ESP32 station start */ + ARDUINO_EVENT_WIFI_STA_STOP, /**< ESP32 station stop */ + ARDUINO_EVENT_WIFI_STA_CONNECTED, /**< ESP32 station connected to AP */ + ARDUINO_EVENT_WIFI_STA_DISCONNECTED, /**< ESP32 station disconnected from AP */ + ARDUINO_EVENT_WIFI_STA_AUTHMODE_CHANGE, /**< the auth mode of AP connected by ESP32 station changed */ + ARDUINO_EVENT_WIFI_STA_GOT_IP, + ARDUINO_EVENT_WIFI_STA_GOT_IP6, + ARDUINO_EVENT_WIFI_STA_LOST_IP, + ARDUINO_EVENT_WIFI_AP_START, /**< ESP32 soft-AP start */ + ARDUINO_EVENT_WIFI_AP_STOP, /**< ESP32 soft-AP stop */ + ARDUINO_EVENT_WIFI_AP_STACONNECTED, /**< a station connected to ESP32 soft-AP */ + ARDUINO_EVENT_WIFI_AP_STADISCONNECTED, /**< a station disconnected from ESP32 soft-AP */ + ARDUINO_EVENT_WIFI_AP_STAIPASSIGNED, + ARDUINO_EVENT_WIFI_AP_PROBEREQRECVED, /**< Receive probe request packet in soft-AP interface */ + ARDUINO_EVENT_WIFI_AP_GOT_IP6, + ARDUINO_EVENT_WIFI_FTM_REPORT, /**< Receive report of FTM procedure */ + ARDUINO_EVENT_ETH_START, + ARDUINO_EVENT_ETH_STOP, + ARDUINO_EVENT_ETH_CONNECTED, + ARDUINO_EVENT_ETH_DISCONNECTED, + ARDUINO_EVENT_ETH_GOT_IP, + ARDUINO_EVENT_ETH_GOT_IP6, + ARDUINO_EVENT_WPS_ER_SUCCESS, /**< ESP32 station wps succeeds in enrollee mode */ + ARDUINO_EVENT_WPS_ER_FAILED, /**< ESP32 station wps fails in enrollee mode */ + ARDUINO_EVENT_WPS_ER_TIMEOUT, /**< ESP32 station wps timeout in enrollee mode */ + ARDUINO_EVENT_WPS_ER_PIN, /**< ESP32 station wps pin code in enrollee mode */ + ARDUINO_EVENT_WPS_ER_PBC_OVERLAP, /**< ESP32 station wps overlap in enrollee mode */ + ARDUINO_EVENT_SC_SCAN_DONE, + ARDUINO_EVENT_SC_FOUND_CHANNEL, + ARDUINO_EVENT_SC_GOT_SSID_PSWD, + ARDUINO_EVENT_SC_SEND_ACK_DONE, + ARDUINO_EVENT_PROV_INIT, + ARDUINO_EVENT_PROV_DEINIT, + ARDUINO_EVENT_PROV_START, + ARDUINO_EVENT_PROV_END, + ARDUINO_EVENT_PROV_CRED_RECV, + ARDUINO_EVENT_PROV_CRED_FAIL, + ARDUINO_EVENT_PROV_CRED_SUCCESS, + ARDUINO_EVENT_MAX +} arduino_event_id_t; + +typedef union { + wifi_event_sta_scan_done_t wifi_scan_done; + wifi_event_sta_authmode_change_t wifi_sta_authmode_change; + wifi_event_sta_connected_t wifi_sta_connected; + wifi_event_sta_disconnected_t wifi_sta_disconnected; + wifi_event_sta_wps_er_pin_t wps_er_pin; + wifi_event_sta_wps_fail_reason_t wps_fail_reason; + wifi_event_ap_probe_req_rx_t wifi_ap_probereqrecved; + wifi_event_ap_staconnected_t wifi_ap_staconnected; + wifi_event_ap_stadisconnected_t wifi_ap_stadisconnected; + wifi_event_ftm_report_t wifi_ftm_report; + ip_event_ap_staipassigned_t wifi_ap_staipassigned; + ip_event_got_ip_t got_ip; + ip_event_got_ip6_t got_ip6; + // smartconfig_event_got_ssid_pswd_t sc_got_ssid_pswd; + // esp_eth_handle_t eth_connected; + // wifi_sta_config_t prov_cred_recv; + // wifi_prov_sta_fail_reason_t prov_fail_reason; +} arduino_event_info_t; + +typedef struct { + arduino_event_id_t event_id; + arduino_event_info_t event_info; +} arduino_event_t; + +#define EventId arduino_event_id_t +#define EventId_t arduino_event_id_t +#define EventInfo arduino_event_info_t +#define EventInfo_t arduino_event_info_t +#define Event_t arduino_event_t + +typedef void (*EventCb)(EventId event); +typedef std::function EventFuncCb; +typedef void (*EventSysCb)(Event_t *event); + +typedef struct EventHandler_s { + static uint16_t lastId; + uint16_t id; + EventCb cb; + EventFuncCb fcb; + EventSysCb scb; + EventId eventId; + + EventHandler_s() : id(lastId++), cb(NULL), fcb(NULL), scb(NULL) {} +} EventHandler; diff --git a/cores/common/arduino/src/HardwareI2C.h b/cores/common/arduino/src/HardwareI2C.h new file mode 100644 index 000000000..9c0479d56 --- /dev/null +++ b/cores/common/arduino/src/HardwareI2C.h @@ -0,0 +1,66 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-05-09. */ + +#include + +class HardwareI2C : public Stream { + protected: + int8_t _sda = -1; + int8_t _scl = -1; + uint32_t _freq = 0; + + void (*onRequestCallback)(void); + void (*onReceiveCallback)(int); + + public: + bool begin() { + return begin(_sda, _scl, _freq); + } + + bool begin(uint8_t address) { + return begin(address, _sda, _scl, _freq); + } + + virtual bool setPins(int8_t sda, int8_t scl) = 0; + + virtual bool begin(int8_t sda, int8_t scl, uint32_t frequency = 0) = 0; + virtual bool begin(uint8_t address, int8_t sda, int8_t scl, uint32_t frequency = 0) = 0; + virtual bool end() = 0; + + virtual bool setClock(uint32_t freq) = 0; + + virtual void beginTransmission(uint8_t address) = 0; + virtual uint8_t endTransmission(bool stopBit) = 0; + + virtual size_t requestFrom(uint8_t address, size_t len, bool stopBit) = 0; + + virtual size_t write(const uint8_t *data, size_t len) = 0; + + virtual int available() = 0; + virtual int read() = 0; + virtual int peek() = 0; + virtual void flush() = 0; + + uint32_t getClock() { + return _freq; + } + + uint8_t endTransmission() { + return endTransmission(true); + } + + size_t requestFrom(uint8_t address, size_t len) { + return requestFrom(address, len, true); + } + + virtual size_t write(uint8_t data) { + return write(&data, 1); + } + + void onReceive(void (*cb)(int)) { + onReceiveCallback = cb; + } + + void onRequest(void (*cb)(void)) { + onRequestCallback = cb; + } +}; diff --git a/cores/common/arduino/src/common/abi.cpp b/cores/common/arduino/src/common/abi.cpp new file mode 100644 index 000000000..b1b8e68ad --- /dev/null +++ b/cores/common/arduino/src/common/abi.cpp @@ -0,0 +1,36 @@ +/* + Copyright (c) 2014 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include + +extern "C" void __cxa_pure_virtual(void) __attribute__((__noreturn__)); +extern "C" void __cxa_deleted_virtual(void) __attribute__((__noreturn__)); + +void __cxa_pure_virtual(void) { + // We might want to write some diagnostics to uart in this case + // std::terminate(); + while (1) + ; +} + +void __cxa_deleted_virtual(void) { + // We might want to write some diagnostics to uart in this case + // std::terminate(); + while (1) + ; +} diff --git a/cores/common/arduino/src/common/dtostrf.c b/cores/common/arduino/src/common/dtostrf.c new file mode 100644 index 000000000..7f64023fa --- /dev/null +++ b/cores/common/arduino/src/common/dtostrf.c @@ -0,0 +1,28 @@ +/* + dtostrf - Emulation for dtostrf function from avr-libc + Copyright (c) 2013 Arduino. All rights reserved. + Written by Cristian Maglie + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include + +char *dtostrf(double val, signed char width, unsigned char prec, char *sout) { + char fmt[20]; + sprintf(fmt, "%%%d.%df", width, prec); + sprintf(sout, fmt, val); + return sout; +} diff --git a/cores/common/arduino/src/common/serial_event.cpp b/cores/common/arduino/src/common/serial_event.cpp new file mode 100644 index 000000000..85a0822cd --- /dev/null +++ b/cores/common/arduino/src/common/serial_event.cpp @@ -0,0 +1,11 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-19. */ + +#include + +void serialEvent() __attribute__((weak)); +bool Serial_available() __attribute__((weak)); + +void serialEventRun(void) { + if (Serial_available && serialEvent && Serial_available()) + serialEvent(); +} diff --git a/cores/common/arduino/src/compat/ESPmDNS.h b/cores/common/arduino/src/compat/ESPmDNS.h new file mode 100644 index 000000000..858016756 --- /dev/null +++ b/cores/common/arduino/src/compat/ESPmDNS.h @@ -0,0 +1,5 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-05-23. */ + +#pragma once + +#include "mDNS.h" diff --git a/cores/common/arduino/src/compat/FS.h b/cores/common/arduino/src/compat/FS.h new file mode 100644 index 000000000..4751126b0 --- /dev/null +++ b/cores/common/arduino/src/compat/FS.h @@ -0,0 +1,5 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-30. */ + +#pragma once + +#include diff --git a/cores/common/arduino/src/compat/FSImpl.h b/cores/common/arduino/src/compat/FSImpl.h new file mode 100644 index 000000000..fc53bc352 --- /dev/null +++ b/cores/common/arduino/src/compat/FSImpl.h @@ -0,0 +1,3 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-30. */ + +// nop diff --git a/cores/common/arduino/src/compat/WiFiAP.h b/cores/common/arduino/src/compat/WiFiAP.h new file mode 100644 index 000000000..7ecef0bd9 --- /dev/null +++ b/cores/common/arduino/src/compat/WiFiAP.h @@ -0,0 +1,7 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-26. */ + +#pragma once + +// ESP32 WiFi examples use WiFiAP.h include + +#include diff --git a/cores/common/arduino/src/compat/md5.h b/cores/common/arduino/src/compat/md5.h new file mode 100644 index 000000000..63b9c8a18 --- /dev/null +++ b/cores/common/arduino/src/compat/md5.h @@ -0,0 +1,6 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-04. */ + +#pragma once + +// lowercase "md5.h" to allow including actual MD5.h on case-sensitive OSes +#include diff --git a/cores/common/arduino/src/compat/pgmspace.h b/cores/common/arduino/src/compat/pgmspace.h new file mode 100644 index 000000000..503ccd4ee --- /dev/null +++ b/cores/common/arduino/src/compat/pgmspace.h @@ -0,0 +1,5 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-30. */ + +#pragma once + +#include diff --git a/cores/common/arduino/src/compat/vfs_api.h b/cores/common/arduino/src/compat/vfs_api.h new file mode 100644 index 000000000..fc53bc352 --- /dev/null +++ b/cores/common/arduino/src/compat/vfs_api.h @@ -0,0 +1,3 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-30. */ + +// nop diff --git a/cores/common/arduino/src/main.c b/cores/common/arduino/src/main.c new file mode 100644 index 000000000..80f72eb84 --- /dev/null +++ b/cores/common/arduino/src/main.c @@ -0,0 +1,27 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-02-27. */ + +#include + +int main() { + // initialize Arduino framework + lt_init_arduino(); + // start the main task and OS kernel + if (!startMainTask()) { + LT_F("Couldn't start the main task"); + return 1; + } + return 0; +} + +/** + * @brief Main setup() and loop() task. + * Not to be called directly. + */ +void mainTask(const void *arg) { + setup(); + + for (;;) { + loop(); + yield(); + } +} diff --git a/cores/common/arduino/src/posix/time.c b/cores/common/arduino/src/posix/time.c new file mode 100644 index 000000000..991dbbc2d --- /dev/null +++ b/cores/common/arduino/src/posix/time.c @@ -0,0 +1,50 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-09-03. */ + +#include +#include + +static uint32_t reset_epoch = 0; // epoch corresponding to millis() == 0 +static uint32_t reset_millis = 0; // millis() when epoch reset was performed + +int __wrap_gettimeofday(struct timeval *tv, void *tz) { + if (millis() < reset_millis) { + // the clock overflowed + reset_epoch += UINT32_MAX / 1000; + reset_millis = millis(); + } + if (!tv) { + errno = EINVAL; + return -1; + } + unsigned long m = millis(); + tv->tv_sec = reset_epoch + (m / 1000); + tv->tv_usec = (m % 1000) * 1000; + return 0; +} + +int __wrap_settimeofday(const struct timeval *tv, const struct timezone *tz) { + if (!tv) { + errno = EINVAL; + return -1; + } + unsigned long m = millis(); + reset_epoch = tv->tv_sec - (m / 1000); + reset_millis = m; + return 0; +} + +int gettimeofday(struct timeval *tv, void *tz) { + return __wrap_gettimeofday(tv, tz); +} + +int settimeofday(const struct timeval *tv, const struct timezone *tz) { + return __wrap_settimeofday(tv, tz); +} + +int _gettimeofday(struct timeval *tv, void *tz) { + return __wrap_gettimeofday(tv, tz); +} + +int _settimeofday(const struct timeval *tv, const struct timezone *tz) { + return __wrap_settimeofday(tv, tz); +} diff --git a/cores/common/arduino/src/wiring/wiring.c b/cores/common/arduino/src/wiring/wiring.c new file mode 100644 index 000000000..f96fa62a9 --- /dev/null +++ b/cores/common/arduino/src/wiring/wiring.c @@ -0,0 +1,22 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-05-24. */ + +#include + +#if LT_HAS_FREERTOS + +__attribute__((weak)) void delay(uint32_t ms) { + vTaskDelay(pdMS_TO_TICKS(ms)); +} + +__attribute__((weak)) void yield() { + runPeriodicTasks(); + vTaskDelay(1); + taskYIELD(); + lt_wdt_feed(); +} + +#else + +__attribute__((weak)) void yield() {} + +#endif diff --git a/cores/common/arduino/src/wiring/wiring_compat.cpp b/cores/common/arduino/src/wiring/wiring_compat.cpp new file mode 100644 index 000000000..72549b3bb --- /dev/null +++ b/cores/common/arduino/src/wiring/wiring_compat.cpp @@ -0,0 +1,9 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-04. */ + +#include "wiring_compat.h" + +String ipToString(const IPAddress &ip) { + char szRet[16]; + sprintf(szRet, "%hhu.%hhu.%hhu.%hhu", ip[0], ip[1], ip[2], ip[3]); + return String(szRet); +} diff --git a/cores/common/arduino/src/wiring/wiring_compat.h b/cores/common/arduino/src/wiring/wiring_compat.h new file mode 100644 index 000000000..811c6de8d --- /dev/null +++ b/cores/common/arduino/src/wiring/wiring_compat.h @@ -0,0 +1,42 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-04. */ + +#pragma once + +#include + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +// Definitions for error constants. +#define esp_err_t int +#define ESP_OK 0 /*!< esp_err_t value indicating success (no error) */ +#define ESP_FAIL -1 /*!< Generic esp_err_t code indicating failure */ + +// ArduinoCore-API doesn't define these anymore +#define FPSTR(pstr_pointer) (reinterpret_cast(pstr_pointer)) +#define PGM_VOID_P const void * +#define vsnprintf_P vsnprintf +#define OUTPUT_OPEN_DRAIN OUTPUT_OPENDRAIN +#define attachInterruptArg attachInterruptParam +#define voidFuncPtrArg voidFuncPtrParam + +// Additional Arduino compatibility macros +#define round(x) ((x) >= 0 ? (long)((x) + 0.5) : (long)((x)-0.5)) +#define digitalPinToInterrupt(pin) (pin) + +// FreeRTOS utilities +#define xTaskCreateUniversal(pxTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask, xCoreID) \ + xTaskCreate(pxTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask) +#define xTaskCreatePinnedToCore xTaskCreateUniversal + +// Default values from sdkconfig.h +#define CONFIG_LWIP_MAX_ACTIVE_TCP 16 + +#ifdef __cplusplus +String ipToString(const IPAddress &ip); +#endif + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/cores/common/arduino/src/wiring/wiring_custom.c b/cores/common/arduino/src/wiring/wiring_custom.c new file mode 100644 index 000000000..31bd58265 --- /dev/null +++ b/cores/common/arduino/src/wiring/wiring_custom.c @@ -0,0 +1,145 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-20. */ + +#include "wiring_private.h" + +#if LT_HAS_FREERTOS +#include +#endif + +int _analogReadResolution = 10; // 0-1023 +int _analogWriteResolution = 8; // 0-255 +int _analogWritePeriod = 20000; // 50 Hz + +static unsigned long periodicTasks[] = {0, 0}; + +/** + * @brief Run periodic tasks, like printing free heap or checking millis() overflow. + * + * This is called during delaying operations, like yield() or delay(). + */ +void runPeriodicTasks() { +#if LT_LOG_HEAP + if (millis() - periodicTasks[0] > 1000) { + LT_HEAP_I(); + periodicTasks[0] = millis(); + } +#endif +#if LT_USE_TIME + if (millis() - periodicTasks[1] > 10000) { + gettimeofday(NULL, NULL); + periodicTasks[1] = millis(); + } +#endif +} + +/** + * @brief Disable modes specified by 'mask'. + */ +void pinModeRemove(pin_size_t pinNumber, uint32_t mask) { + PinInfo *pin = pinInfo(pinNumber); + if (!pin) + return; + pinRemoveMode(pin, mask); + if (pin->enabled == PIN_NONE && mask == PIN_MODE_ALL) + pinRemoveData(pin); +} + +/** + * @brief Get PinInfo struct for the specified number. + * Returns NULL if pin number is invalid. + */ +PinInfo *pinInfo(pin_size_t pinNumber) { + if (pinNumber < 0 || pinNumber > PINS_GPIO_MAX) + return NULL; + return lt_arduino_pin_gpio_map[pinNumber]; +} + +/** + * @brief Get PinInfo struct for the specified index. + * Returns NULL if pin index is invalid. + */ +PinInfo *pinByIndex(uint32_t index) { + if (index < 0 || index >= PINS_COUNT) + return NULL; + return &(lt_arduino_pin_info_list[index]); +} + +/** + * @brief Find PinInfo struct by GPIO number. + * Returns NULL if not found. + */ +PinInfo *pinByGpio(uint32_t gpio) { + for (uint32_t i = 0; i < PINS_COUNT; i++) { + if (lt_arduino_pin_info_list[i].gpio == gpio) + return &(lt_arduino_pin_info_list[i]); + } + return NULL; +} + +/** + * @brief Get index of PinInfo in the global pin info table. + */ +uint32_t pinIndex(PinInfo *pin) { + return pin - lt_arduino_pin_info_list; +} + +/** + * @brief Check if pin supports all features represented by 'mask'. + */ +bool pinSupported(PinInfo *pin, uint32_t mask) { + return (pin->supported & mask) == mask; +} + +/** + * @brief Check if pin has all features represented by 'mask' enabled. + */ +bool pinEnabled(PinInfo *pin, uint32_t mask) { + return (pin->enabled & mask) == mask; +} + +/** + * @brief Read voltage from ADC and return a value between 0 and + * the current reading resolution. + */ +int analogRead(pin_size_t pinNumber) { + float voltage = analogReadVoltage(pinNumber); + float maxVoltage = analogReadMaxVoltage(pinNumber); + uint16_t ret = round((1 << _analogReadResolution) * voltage / maxVoltage); + if (ret >= (1 << _analogReadResolution)) + ret = (1 << _analogReadResolution) - 1; + return ret; +} + +/** + * @brief Set resolution of values (in bits) returned by analogRead(). + * Defaults to 10 bit (0-1023). + */ +void analogReadResolution(int res) { + _analogReadResolution = res; +} + +/** + * @brief Set resolution of values (in bits) expected by analogWrite(). + * Defaults to 8 bit (0-255). + */ +void analogWriteResolution(int res) { + _analogWriteResolution = res; +} + +/** + * @brief Set PWM output frequency (in Hz). + * Defaults to 50 Hz (20,000 uS). + */ +void analogWriteFrequency(int hz) { + _analogWritePeriod = 1E6 / hz; +} + +/** + * @brief Set PWM output frequency (cycle period) in microseconds. + * Defaults to 20,000 uS (50 Hz). + */ +void analogWritePeriod(int us) { + _analogWritePeriod = us; +} + +__attribute__((weak)) void analogReference(uint8_t mode) {} diff --git a/cores/common/arduino/src/wiring/wiring_custom.h b/cores/common/arduino/src/wiring/wiring_custom.h new file mode 100644 index 000000000..7be9b6b83 --- /dev/null +++ b/cores/common/arduino/src/wiring/wiring_custom.h @@ -0,0 +1,100 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-06. */ + +#pragma once + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define PIN_NONE (1 << 0) +#define PIN_GPIO (1 << 1) +#define PIN_IRQ (1 << 2) +#define PIN_PWM (1 << 3) +#define PIN_ADC (1 << 4) +#define PIN_DAC (1 << 5) +#define PIN_I2C (1 << 6) +#define PIN_I2S (1 << 7) +#define PIN_JTAG (1 << 8) +#define PIN_SPI (1 << 9) +#define PIN_SWD (1 << 10) +#define PIN_UART (1 << 11) + +#define PIN_MODE_ALL 0xFFFFFFFF + +typedef struct PinData_s PinData; + +typedef struct { + /** + * @brief GPIO name in the family SDK. + */ + uint32_t gpio; + /** + * @brief Supported pin functions. + */ + uint32_t supported; + /** + * @brief Enabled pin functions. Used values are family-specific. + */ + uint32_t enabled; + /** + * @brief Pin data (direction, IRQ level, etc.). The structure is family-specific. + */ + PinData *data; +} PinInfo; + +extern PinInfo lt_arduino_pin_info_list[PINS_COUNT]; +extern PinInfo *lt_arduino_pin_gpio_map[PINS_GPIO_MAX + 1]; + +// Custom Wiring methods + +/** + * @brief Run mainTask & start OS kernel (family-defined). + * Return false if an error occured; else do not return and + * and keep the OS kernel running. + */ +bool startMainTask(void); + +void mainTask(const void *arg); // implemented in main.cpp +void runPeriodicTasks(); // implemented in wiring_custom.c + +void pinModeRemove(pin_size_t pinNumber, uint32_t mask); +PinInfo *pinInfo(pin_size_t pinNumber); +PinInfo *pinByIndex(uint32_t index); +PinInfo *pinByGpio(uint32_t gpio); +uint32_t pinIndex(PinInfo *pin); +bool pinSupported(PinInfo *pin, uint32_t mask); +bool pinEnabled(PinInfo *pin, uint32_t mask); +void pinRemoveMode(PinInfo *pin, uint32_t mask); + +/** + * @brief Deinitialize the pin, by removing all enabled modes. + */ +inline void pinModeNone(pin_size_t pinNumber) { + pinModeRemove(pinNumber, PIN_MODE_ALL); +} + +int analogRead(pin_size_t pinNumber); +void analogReadResolution(int res); +void analogWriteResolution(int res); +void analogWriteFrequency(int hz); +void analogWritePeriod(int us); + +extern int _analogReadResolution; +extern int _analogWriteResolution; +extern int _analogWritePeriod; + +/** + * @brief Read voltage from analog input (in millivolts). + */ +uint16_t analogReadVoltage(pin_size_t pinNumber); + +/** + * @brief Get max reading voltage for the specified pin (millivolts). + */ +uint16_t analogReadMaxVoltage(pin_size_t pinNumber); + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/cores/common/arduino/src/wiring/wiring_irq.c b/cores/common/arduino/src/wiring/wiring_irq.c new file mode 100644 index 000000000..f8efc37c8 --- /dev/null +++ b/cores/common/arduino/src/wiring/wiring_irq.c @@ -0,0 +1,7 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-05-24. */ + +#include + +void attachInterrupt(pin_size_t interruptNumber, voidFuncPtr callback, PinStatus mode) { + attachInterruptParam(interruptNumber, (voidFuncPtrParam)callback, mode, NULL); +} diff --git a/cores/common/arduino/src/wiring/wiring_math.cpp b/cores/common/arduino/src/wiring/wiring_math.cpp new file mode 100644 index 000000000..e48753114 --- /dev/null +++ b/cores/common/arduino/src/wiring/wiring_math.cpp @@ -0,0 +1,43 @@ +/* + Copyright (c) 2014 Arduino. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include + +void randomSeed(uint32_t dwSeed) { + if (dwSeed != 0) { + srand(dwSeed); + } +} + +long random(long howbig) { + if (howbig == 0) { + return 0; + } + + return rand() % howbig; +} + +long random(long howsmall, long howbig) { + if (howsmall >= howbig) { + return howsmall; + } + + long diff = howbig - howsmall; + + return random(diff) + howsmall; +} diff --git a/cores/common/arduino/src/wiring/wiring_private.c b/cores/common/arduino/src/wiring/wiring_private.c new file mode 100644 index 000000000..0810d805e --- /dev/null +++ b/cores/common/arduino/src/wiring/wiring_private.c @@ -0,0 +1,25 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-05-24. */ + +#include "wiring_private.h" + +#if __has_include() +/** + * @brief Allocate and return a PinData structure (family-specific). + */ +PinData *pinData(PinInfo *pin) { + if (pin->data == NULL) { + pin->data = calloc(1, sizeof(PinData)); + } + return (PinData *)pin->data; +} + +/** + * @brief Deallocate the PinData structure. + */ +void pinRemoveData(PinInfo *pin) { + if (pin->data != NULL) { + free(pin->data); + } + pin->data = NULL; +} +#endif diff --git a/cores/common/arduino/src/wiring/wiring_private.h b/cores/common/arduino/src/wiring/wiring_private.h new file mode 100644 index 000000000..5d0b9c358 --- /dev/null +++ b/cores/common/arduino/src/wiring/wiring_private.h @@ -0,0 +1,64 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-05-24. */ + +#pragma once + +#include + +#if __has_include() +#include +#endif + +#if __has_include() +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +PinData *pinData(PinInfo *pin); +void pinRemoveData(PinInfo *pin); + +inline void pinEnable(PinInfo *pin, uint32_t mask) { + pin->enabled |= mask; +} + +inline void pinDisable(PinInfo *pin, uint32_t mask) { + pin->enabled &= ~mask; +} + +#define pinCheckGetInfo(pinNumber, mask, ret) \ + PinInfo *pin = pinInfo(pinNumber); \ + if (!pin) \ + return ret; \ + if (!pinSupported(pin, mask)) \ + return ret; + +#define pinCheckGetData(pinNumber, mask, ret) \ + PinInfo *pin = pinInfo(pinNumber); \ + if (!pin) \ + return ret; \ + if (!pinSupported(pin, mask)) \ + return ret; \ + PinData *data = pinData(pin); + +#define pinIsOutput(pin, data) (pinEnabled(pin, PIN_GPIO) && (data->gpioMode ^ 0b101) < 5) +#define pinIsInput(pin, data) (pinEnabled(pin, PIN_GPIO) && (data->gpioMode ^ 0b101) > 4) + +#define pinSetOutputPull(pin, data, pinNumber, status) \ + do { \ + if (!pinIsOutput(pin, data)) { \ + pinMode(pinNumber, INPUT_PULLDOWN ^ !!status); \ + return; \ + } \ + } while (0); + +#define pinSetInputMode(pin, data, pinNumber) \ + do { \ + if (!pinIsInput(pin, data)) \ + pinMode(pinNumber, INPUT); \ + } while (0); + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/cores/common/arduino/src/wiring/wiring_shift.c b/cores/common/arduino/src/wiring/wiring_shift.c new file mode 100644 index 000000000..d215d682d --- /dev/null +++ b/cores/common/arduino/src/wiring/wiring_shift.c @@ -0,0 +1,54 @@ +/* + Copyright (c) 2014 Arduino. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include +#include + +uint8_t shiftIn(pin_size_t ulDataPin, pin_size_t ulClockPin, BitOrder ulBitOrder) { + uint8_t value = 0; + uint8_t i; + + for (i = 0; i < 8; ++i) { + digitalWrite(ulClockPin, HIGH); + + if (ulBitOrder == LSBFIRST) { + value |= digitalRead(ulDataPin) << i; + } else { + value |= digitalRead(ulDataPin) << (7 - i); + } + + digitalWrite(ulClockPin, LOW); + } + + return value; +} + +void shiftOut(pin_size_t ulDataPin, pin_size_t ulClockPin, BitOrder ulBitOrder, uint8_t ulVal) { + uint8_t i; + + for (i = 0; i < 8; i++) { + if (ulBitOrder == LSBFIRST) { + digitalWrite(ulDataPin, !!(ulVal & (1 << i))); + } else { + digitalWrite(ulDataPin, !!(ulVal & (1 << (7 - i)))); + } + + digitalWrite(ulClockPin, HIGH); + digitalWrite(ulClockPin, LOW); + } +} diff --git a/cores/common/base/api/lt_cpu.c b/cores/common/base/api/lt_cpu.c new file mode 100644 index 000000000..56aa518e8 --- /dev/null +++ b/cores/common/base/api/lt_cpu.c @@ -0,0 +1,58 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-29. */ + +#include "lt_cpu.h" + +#if LT_HAS_FREERTOS +#include +#include +#endif + +lt_cpu_family_t lt_cpu_get_family() { + return FAMILY; +} + +const char *lt_cpu_get_family_name() { + return STRINGIFY_MACRO(FAMILY) + 2; +} + +__attribute__((weak)) lt_cpu_model_t lt_cpu_get_model() { + return MCU; +} + +const char *lt_cpu_get_model_name() { + return STRINGIFY_MACRO(MCU); +} + +const char *lt_cpu_get_model_code() { + return STRINGIFY_MACRO(MCULC); +} + +__attribute__((weak)) uint32_t lt_cpu_get_unique_id() { + return lt_cpu_get_mac_id(); +} + +__attribute__((weak)) uint32_t lt_cpu_get_mac_id() { + uint8_t mac[6]; + lt_get_device_mac(mac); + return (mac[3] << 0) | (mac[4] << 8) | (mac[5] << 16); +} + +__attribute__((weak)) uint8_t lt_cpu_get_core_count() { + return 1; +} + +#if LT_HAS_FREERTOS +__attribute__((weak)) uint32_t lt_cpu_get_freq() { + return configCPU_CLOCK_HZ; +} +#endif + +uint32_t lt_cpu_get_freq_mhz() { + return lt_cpu_get_freq() / 1000000; +} + +#if LT_HAS_FREERTOS +__attribute__((weak)) uint32_t lt_cpu_get_cycle_count() { + return xTaskGetTickCount() * (configCPU_CLOCK_HZ / configTICK_RATE_HZ); +} +#endif diff --git a/cores/common/base/api/lt_cpu.h b/cores/common/base/api/lt_cpu.h new file mode 100644 index 000000000..f2c6b80c2 --- /dev/null +++ b/cores/common/base/api/lt_cpu.h @@ -0,0 +1,68 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-09. */ + +#pragma once + +#include + +/** + * @brief Get CPU family ID (as lt_cpu_family_t enum member). + */ +lt_cpu_family_t lt_cpu_get_family(); + +/** + * @brief Get CPU family name as string. + */ +const char *lt_cpu_get_family_name(); + +/** + * @brief Get CPU model ID (as lt_cpu_model_t enum member). + */ +lt_cpu_model_t lt_cpu_get_model(); + +/** + * @brief Get CPU model name as string (uppercase). + */ +const char *lt_cpu_get_model_name(); + +/** + * @brief Get CPU model name as string (lowercase). + */ +const char *lt_cpu_get_model_code(); + +/** + * @brief Get CPU unique ID. This may be based on MAC, eFuse, etc. (family-specific). + * Note: the number is 24-bit (with the MSB being zero). + */ +uint32_t lt_cpu_get_unique_id(); + +/** + * @brief Get CPU ID based on the last three octets of MAC address. + * Note: the number is 24-bit (with the MSB being zero). + * The 3rd-to-last octet is least-significant, the last octet is most-significant. + */ +uint32_t lt_cpu_get_mac_id(); + +/** + * @brief Get CPU core count. + */ +uint8_t lt_cpu_get_core_count(); + +/** + * @brief Get CPU core type name as string. + */ +const char *lt_cpu_get_core_type(); + +/** + * @brief Get CPU frequency in Hz. + */ +uint32_t lt_cpu_get_freq(); + +/** + * @brief Get CPU frequency in MHz. + */ +uint32_t lt_cpu_get_freq_mhz(); + +/** + * @brief Get CPU cycle count. + */ +uint32_t lt_cpu_get_cycle_count(); diff --git a/cores/common/base/api/lt_device.c b/cores/common/base/api/lt_device.c new file mode 100644 index 000000000..af8cd6875 --- /dev/null +++ b/cores/common/base/api/lt_device.c @@ -0,0 +1,84 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-29. */ + +#include "lt_device.h" + +static char *device_name = NULL; + +const char *lt_get_version() { + return LT_VERSION_STR; +} + +const char *lt_get_board_code() { + return LT_BOARD_STR; +} + +const char *lt_get_device_name() { + if (device_name) + return device_name; + uint32_t chip_id = lt_cpu_get_mac_id(); + uint8_t *id = (uint8_t *)&chip_id; + + const char *model = lt_cpu_get_model_code(); + uint8_t model_len = strlen(model); + device_name = (char *)malloc(3 + model_len + 1 + 6 + 1); + + sprintf(device_name, "LT-%s-%02x%02x%02x", model, id[0], id[1], id[2]); + return device_name; +} + +__attribute__((weak)) void lt_reboot() { + // The Watchdog Way + lt_wdt_enable(1L); + while (1) {} +} + +__attribute__((weak)) bool lt_reboot_wdt() { + if (!lt_wdt_enable(1L)) + return false; + while (1) {} +} + +__attribute__((weak)) bool lt_reboot_download_mode() { + return false; +} + +__attribute__((weak)) lt_reboot_reason_t lt_get_reboot_reason() { + return REBOOT_REASON_UNKNOWN; +} + +const char *lt_get_reboot_reason_name(lt_reboot_reason_t reason) { + if (!reason) + reason = lt_get_reboot_reason(); + switch (reason) { + case REBOOT_REASON_POWER: + return "Power-On"; + case REBOOT_REASON_BROWNOUT: + return "Brownout"; + case REBOOT_REASON_HARDWARE: + return "HW Reboot"; + case REBOOT_REASON_SOFTWARE: + return "SW Reboot"; + case REBOOT_REASON_WATCHDOG: + return "WDT Reset"; + case REBOOT_REASON_CRASH: + return "Crash"; + case REBOOT_REASON_SLEEP_GPIO: + return "Sleep Wakeup (GPIO)"; + case REBOOT_REASON_SLEEP_RTC: + return "Sleep Wakeup (RTC)"; + case REBOOT_REASON_SLEEP_USB: + return "Sleep Wakeup (USB)"; + case REBOOT_REASON_DEBUGGER: + return "Debugger"; + default: + return "Unknown"; + } +} + +__attribute__((weak)) bool lt_set_debug_mode(lt_debug_mode_t mode) { + return false; +} + +__attribute__((weak)) void lt_gpio_recover() { + lt_set_debug_mode(DEBUG_MODE_OFF); +} diff --git a/cores/common/base/api/lt_device.h b/cores/common/base/api/lt_device.h new file mode 100644 index 000000000..7e1c4df76 --- /dev/null +++ b/cores/common/base/api/lt_device.h @@ -0,0 +1,115 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-09. */ + +#pragma once + +#include + +#define RESET_REASON_UNKNOWN REBOOT_REASON_UNKNOWN +#define RESET_REASON_POWER REBOOT_REASON_POWER +#define RESET_REASON_BROWNOUT REBOOT_REASON_BROWNOUT +#define RESET_REASON_HARDWARE REBOOT_REASON_HARDWARE +#define RESET_REASON_SOFTWARE REBOOT_REASON_SOFTWARE +#define RESET_REASON_WATCHDOG REBOOT_REASON_WATCHDOG +#define RESET_REASON_CRASH REBOOT_REASON_CRASH +#define RESET_REASON_SLEEP_GPIO REBOOT_REASON_SLEEP_GPIO +#define RESET_REASON_SLEEP_RTC REBOOT_REASON_SLEEP_RTC +#define RESET_REASON_SLEEP_USB REBOOT_REASON_SLEEP_USB +#define RESET_REASON_MAX REBOOT_REASON_MAX + +/** + * @brief Reset reason enumeration. + */ +typedef enum { + REBOOT_REASON_UNKNOWN = 1, + REBOOT_REASON_POWER = 2, + REBOOT_REASON_BROWNOUT = 3, + REBOOT_REASON_HARDWARE = 4, + REBOOT_REASON_SOFTWARE = 5, + REBOOT_REASON_WATCHDOG = 6, + REBOOT_REASON_CRASH = 7, + REBOOT_REASON_SLEEP_GPIO = 8, + REBOOT_REASON_SLEEP_RTC = 9, + REBOOT_REASON_SLEEP_USB = 10, + REBOOT_REASON_DEBUGGER = 11, + REBOOT_REASON_MAX = 12, +} lt_reboot_reason_t; + +// RESET_REASON_SLEEP deprecated, kept for compatibility +#define RESET_REASON_SLEEP REBOOT_REASON_SLEEP_GPIO +#define REBOOT_REASON_SLEEP REBOOT_REASON_SLEEP_GPIO + +/** + * @brief Debugging mode enumeration. + */ +typedef enum { + DEBUG_MODE_OFF = 0, + DEBUG_MODE_JTAG = 1, + DEBUG_MODE_SWD = 2, +} lt_debug_mode_t; + +/** + * @brief Get LibreTiny version string. + */ +const char *lt_get_version(); + +/** + * @brief Get board code. + */ +const char *lt_get_board_code(); + +/** + * @brief Get device friendly name in format "LT--". + * Can be used as hostname. + */ +const char *lt_get_device_name(); + +/** + * @brief Read device's *default* MAC address into 'mac' array. + * This can be used even without Wi-Fi enabled, and will ignore + * user-changed Wi-Fi MAC (if changing is possible). + */ +void lt_get_device_mac(uint8_t *mac); + +/** + * @brief Reboot the CPU. + */ +void lt_reboot(); + +/** + * @brief Reboot the CPU with a watchdog timeout (if possible). + * + * @return whether WDT reboot is possible + */ +bool lt_reboot_wdt(); + +/** + * @brief Reboot the CPU and stay in download mode (if possible). + * + * @return whether download-mode reboot is possible + */ +bool lt_reboot_download_mode(); + +/** + * @brief Get the reason of last chip reboot. + */ +lt_reboot_reason_t lt_get_reboot_reason(); + +/** + * @brief Get a textual representation of a reboot reason. + * + * @param reason value to convert to text, pass 0 to read from lt_reboot_get_reason() + */ +const char *lt_get_reboot_reason_name(lt_reboot_reason_t reason); + +/** + * @brief Set debugger mode (JTAG, SWD or OFF). + * + * @return whether the mode is supported, and setting it was successful + */ +bool lt_set_debug_mode(lt_debug_mode_t mode); + +/** + * @brief Reconfigure GPIO pins used for debugging + * (SWD/JTAG), so that they can be used as normal I/O. + */ +void lt_gpio_recover(); diff --git a/cores/common/base/api/lt_flash.c b/cores/common/base/api/lt_flash.c new file mode 100644 index 000000000..b97c5d53b --- /dev/null +++ b/cores/common/base/api/lt_flash.c @@ -0,0 +1,39 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-29. */ + +#include "lt_flash.h" + +#include + +__attribute__((weak)) uint32_t lt_flash_get_size() { + lt_flash_id_t id = lt_flash_get_id(); + if (id.chip_size_id >= 0x14 && id.chip_size_id <= 0x19) { + return (1 << id.chip_size_id); + } +#ifdef FLASH_LENGTH + return FLASH_LENGTH; +#else + return 0; +#endif +} + +bool lt_flash_erase(uint32_t offset, size_t length) { + return fal_partition_erase(fal_root_part, offset, length) >= 0; +} + +bool lt_flash_erase_block(uint32_t offset) { + return fal_partition_erase(fal_root_part, offset, 1) >= 0; +} + +uint32_t lt_flash_read(uint32_t offset, uint8_t *data, size_t length) { + int ret = fal_partition_read(fal_root_part, offset, data, length); + if (ret == -1) + return 0; + return ret; +} + +uint32_t lt_flash_write(uint32_t offset, const uint8_t *data, size_t length) { + int ret = fal_partition_write(fal_root_part, offset, data, length); + if (ret == -1) + return 0; + return ret; +} diff --git a/cores/common/base/api/lt_flash.h b/cores/common/base/api/lt_flash.h new file mode 100644 index 000000000..6aba88392 --- /dev/null +++ b/cores/common/base/api/lt_flash.h @@ -0,0 +1,64 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-09. */ + +#pragma once + +#include + +/** + * @brief Flash chip ID structure. + */ +typedef struct { + uint8_t manufacturer_id; + uint8_t chip_id; + uint8_t chip_size_id; +} lt_flash_id_t; + +/** + * @brief Read flash chip ID and return a lt_flash_id_t struct. + */ +lt_flash_id_t lt_flash_get_id(); + +/** + * @brief Get flash chip total size. + * + * The default implementation uses the least significant + * byte of the chip ID to determine the size. + */ +uint32_t lt_flash_get_size(); + +/** + * @brief Erase flash area. Flash can only be erased in blocks (usually 4 KiB). + * + * @param offset starting offset to erase (in bytes); must be multiple of the flash chip's block size + * @param length length of data to erase (in bytes); will be rounded up to block size + * @return whether erasing was successful + */ +bool lt_flash_erase(uint32_t offset, size_t length); + +/** + * @brief Erase a single block of flash (usually 4 KiB). + * + * @param offset offset of the block (in bytes); must be multiple of the flash chip's block size + * @return whether erasing was successful + */ +bool lt_flash_erase_block(uint32_t offset); + +/** + * @brief Read data from the flash. + * + * @param offset starting offset (in bytes) + * @param data pointer to where to store the data + * @param length length of data to read + * @return length of data successfully read (should equal 'length') + */ +uint32_t lt_flash_read(uint32_t offset, uint8_t *data, size_t length); + +/** + * @brief Write data to the flash. + * + * @param offset starting offset (in bytes) + * @param data pointer to data to write + * @param length length of data to write + * @return length of data successfully written (should equal 'length') + */ +uint32_t lt_flash_write(uint32_t offset, const uint8_t *data, size_t length); diff --git a/cores/common/base/api/lt_init.h b/cores/common/base/api/lt_init.h new file mode 100644 index 000000000..07827792f --- /dev/null +++ b/cores/common/base/api/lt_init.h @@ -0,0 +1,26 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-02-27. */ + +#pragma once + +#include + +/** + * @brief Initialize the family core (optional). + * This method is family-specific; the family core can do whatever it wants to. + * This method is empty if not implemented, and shouldn't be called manually. + */ +void lt_init_family() __attribute__((weak)); + +/** + * @brief Initialize the board (variant). + * This method is empty if not implemented (which is usually the case), + * and shouldn't be called manually. + */ +void lt_init_variant() __attribute__((weak)); + +/** + * @brief Initialize the family's Arduino core (optional). + * This method is family-specific; the family core can do whatever it wants to. + * This method is empty if not implemented, and shouldn't be called manually. + */ +void lt_init_arduino() __attribute__((weak)); diff --git a/cores/common/base/api/lt_mem.c b/cores/common/base/api/lt_mem.c new file mode 100644 index 000000000..eae8685d9 --- /dev/null +++ b/cores/common/base/api/lt_mem.c @@ -0,0 +1,26 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-29. */ + +#include "lt_mem.h" + +#if LT_HAS_FREERTOS +#include +#include +#endif + +#if LT_HAS_FREERTOS +__attribute__((weak)) uint32_t lt_heap_get_size() { + return configTOTAL_HEAP_SIZE; +} + +__attribute__((weak)) uint32_t lt_heap_get_free() { + return xPortGetFreeHeapSize(); +} + +__attribute__((weak)) uint32_t lt_heap_get_min_free() { + return xPortGetMinimumEverFreeHeapSize(); +} +#endif + +__attribute__((weak)) uint32_t lt_heap_get_max_alloc() { + return 0; +} diff --git a/cores/common/base/api/lt_mem.h b/cores/common/base/api/lt_mem.h new file mode 100644 index 000000000..b19838240 --- /dev/null +++ b/cores/common/base/api/lt_mem.h @@ -0,0 +1,30 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-09. */ + +#pragma once + +#include + +/** + * @brief Get total RAM size. + */ +uint32_t lt_ram_get_size(); + +/** + * @brief Get total heap size. + */ +uint32_t lt_heap_get_size(); + +/** + * @brief Get free heap size. + */ +uint32_t lt_heap_get_free(); + +/** + * @brief Get lowest level of free heap memory. + */ +uint32_t lt_heap_get_min_free(); + +/** + * @brief Get largest block of heap that can be allocated at once. + */ +uint32_t lt_heap_get_max_alloc(); diff --git a/cores/common/base/api/lt_ota.c b/cores/common/base/api/lt_ota.c new file mode 100644 index 000000000..7eb27e2a4 --- /dev/null +++ b/cores/common/base/api/lt_ota.c @@ -0,0 +1,156 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-29. */ + +#include "lt_ota.h" + +#include + +static inline size_t lt_ota_buf_left(lt_ota_ctx_t *ctx) { + return ctx->buf + UF2_BLOCK_SIZE - ctx->buf_pos; +} + +static inline size_t lt_ota_buf_size(lt_ota_ctx_t *ctx) { + return ctx->buf_pos - ctx->buf; +} + +void lt_ota_begin(lt_ota_ctx_t *ctx, size_t size) { + if (!ctx) + return; + + memset(ctx, 0, sizeof(lt_ota_ctx_t)); + uf2_ctx_init(&ctx->uf2, lt_ota_get_uf2_scheme(), lt_cpu_get_family()); + uf2_info_init(&ctx->info); + ctx->buf_pos = ctx->buf; + ctx->bytes_total = size; + ctx->running = true; + + lt_ota_set_write_protect(&ctx->uf2); + + LT_DM(OTA, "begin(%u, ...) / OTA curr: %u, scheme: %u", size, lt_ota_dual_get_current(), lt_ota_get_uf2_scheme()); +} + +bool lt_ota_end(lt_ota_ctx_t *ctx) { + if (!ctx || !ctx->running) + return true; + + uf2_ctx_free(&ctx->uf2); + uf2_info_free(&ctx->info); + ctx->running = false; + + if (ctx->bytes_written && ctx->bytes_written == ctx->bytes_total) { + // try to activate the 2nd image + return lt_ota_switch(/* revert= */ false); + } + + // activation not attempted (update aborted) + return true; +} + +__attribute__((weak)) void lt_ota_set_write_protect(uf2_ota_t *uf2) {} + +size_t lt_ota_write(lt_ota_ctx_t *ctx, const uint8_t *data, size_t len) { + if (!ctx || !ctx->running) + return 0; + + // write until buffer space is available + size_t written = 0; + uint16_t to_write; // 1..512 + while (len && (to_write = MIN((uint16_t)len, lt_ota_buf_left(ctx)))) { + LT_VM(OTA, "Writing %u to buffer (%u/512)", len, lt_ota_buf_size(ctx)); + + uf2_block_t *block = NULL; + if (to_write == UF2_BLOCK_SIZE) { + // data has a complete block; don't use the buffer + block = (uf2_block_t *)data; + } else { + // data has a part of a block; append it to the buffer + memcpy(ctx->buf_pos, data, to_write); + ctx->buf_pos += to_write; + if (lt_ota_buf_size(ctx) == UF2_BLOCK_SIZE) { + // the block is complete now + block = (uf2_block_t *)ctx->buf; + } + } + + // write if a block is ready + if (block && lt_ota_write_block(ctx, block) == false) + // return on errors + return written; + data += to_write; + len -= to_write; + written += to_write; + } + return written; +} + +bool lt_ota_write_block(lt_ota_ctx_t *ctx, uf2_block_t *block) { + ctx->error = uf2_check_block(&ctx->uf2, block); + if (ctx->error > UF2_ERR_IGNORE) + // block is invalid + return false; + + if (!ctx->bytes_written) { + // parse header block to allow retrieving firmware info + ctx->error = uf2_parse_header(&ctx->uf2, block, &ctx->info); + if (ctx->error != UF2_ERR_OK) + return false; + + LT_IM( + OTA, + "%s v%s - LT v%s @ %s", + ctx->info.fw_name, + ctx->info.fw_version, + ctx->info.lt_version, + ctx->info.board + ); + + if (ctx->bytes_total == 0) { + // set total update size from block count info + ctx->bytes_total = block->block_count * UF2_BLOCK_SIZE; + } else if (ctx->bytes_total != block->block_count * UF2_BLOCK_SIZE) { + // given update size does not match the block count + LT_EM( + OTA, + "Image size wrong; got %u, calculated %llu", + ctx->bytes_total, + block->block_count * UF2_BLOCK_SIZE + ); + return false; + } + } else if (ctx->error == UF2_ERR_OK) { + // write data blocks normally + ctx->error = uf2_write(&ctx->uf2, block); + if (ctx->error > UF2_ERR_IGNORE) + // block writing failed + return false; + } + + // increment total writing progress + ctx->bytes_written += UF2_BLOCK_SIZE; + // call progress callback + if (ctx->callback) + ctx->callback(ctx->callback_param); + // reset the buffer as it's used already + if (lt_ota_buf_size(ctx) == UF2_BLOCK_SIZE) + ctx->buf_pos = ctx->buf; + + return true; +} + +bool lt_ota_can_rollback() { + if (lt_ota_get_type() != OTA_TYPE_DUAL) + return false; + uint8_t current = lt_ota_dual_get_current(); + if (current == 0) + return false; + return lt_ota_is_valid(current ^ 0b11); +} + +uf2_ota_scheme_t lt_ota_get_uf2_scheme() { + if (lt_ota_get_type() == OTA_TYPE_SINGLE) + return UF2_SCHEME_DEVICE_SINGLE; + uint8_t current = lt_ota_dual_get_current(); + if (current == 0) + return UF2_SCHEME_DEVICE_DUAL_1; + // UF2_SCHEME_DEVICE_DUAL_1 or UF2_SCHEME_DEVICE_DUAL_2 + return (uf2_ota_scheme_t)(current ^ 0b11); +} diff --git a/cores/common/base/api/lt_ota.h b/cores/common/base/api/lt_ota.h new file mode 100644 index 000000000..e86bf8632 --- /dev/null +++ b/cores/common/base/api/lt_ota.h @@ -0,0 +1,135 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-09. */ + +#pragma once + +#include +#include + +/** + * @brief Chip's OTA type enumeration. + */ +typedef enum { + OTA_TYPE_SINGLE = 0, + OTA_TYPE_DUAL = 1, + OTA_TYPE_FILE = 2, +} lt_ota_type_t; + +/** + * @brief OTA update process context. + */ +typedef struct { + uf2_ota_t uf2; + uf2_info_t info; + uint8_t buf[UF2_BLOCK_SIZE]; // block data buffer + uint8_t *buf_pos; // buffer writing position + uint32_t bytes_written; // update progress + uint32_t bytes_total; // total update size + uf2_err_t error; // LT OTA/uf2ota error code + bool running; // whether update has begun + void (*callback)(void *param); // progress callback + void *callback_param; // callback argument +} lt_ota_ctx_t; + +/** + * @brief Initialize the update context to begin OTA process. + * + * @param ctx OTA context + * @param size length of the update file; 0 if unknown + */ +void lt_ota_begin(lt_ota_ctx_t *ctx, size_t size); + +/** + * @brief Finish the update process. If the update has been written completely, + * try to activate the target image. Free allocated internal structures, regardless + * of the activation result. + * + * @param ctx OTA context + * @return false if activation was attempted and not successful; true otherwise + */ +bool lt_ota_end(lt_ota_ctx_t *ctx); + +/** + * @brief Set family-specific, write-protected flash areas in the OTA update context. + * This shouldn't be called manually, as it's done by lt_ota_begin(). + * + * @param uf2 uf2ota context + */ +void lt_ota_set_write_protect(uf2_ota_t *uf2); + +/** + * @brief Process a chunk of data. + * + * Data is written to the buffer, unless a full UF2 block is already available, + * in which case it's also processed by UF2OTA and written to flash. + * + * It's advised to write in 512-byte chunks (or its multiples). + * + * @param ctx OTA context + * @param data chunk of bytes to process + * @param len size of the chunk + * @return number of bytes correctly processed; should equal 'len' in case of no errors + */ +size_t lt_ota_write(lt_ota_ctx_t *ctx, const uint8_t *data, size_t len); + +/** + * @brief Try to write the block. In case of UF2 errors, error code is set in the context. + * Note: use lt_ota_write() instead. This is for internal usage only. + * + * @param block UF2 block to check and write; cannot be NULL + * @return whether no error has occurred + */ +bool lt_ota_write_block(lt_ota_ctx_t *ctx, uf2_block_t *block); + +/** + * @brief Get OTA type of the device's chip. + */ +lt_ota_type_t lt_ota_get_type(); + +/** + * @brief Check if the specified OTA image is valid. + * + * @param index OTA index to check; 0 for single-OTA chips, 1 or 2 for dual-OTA chips + * @return true if index is valid for the chip's OTA type, and there is a valid image; false otherwise + */ +bool lt_ota_is_valid(uint8_t index); + +/** + * @brief Check if OTA rollback is possible (switching the stored index to another partition). + * + * Note that this is not the same as "switching" OTA with revert=true. + * + * @return true if 2nd image is valid and the chip is dual-OTA; false otherwise + */ +bool lt_ota_can_rollback(); + +/** + * @brief Get the currently running firmware's OTA index. + * + * @return OTA index if dual-OTA is supported, 0 otherwise + */ +uint8_t lt_ota_dual_get_current(); + +/** + * @brief Read the currently active OTA index, i.e. the one that will boot upon restart. + * + * @return OTA index if dual-OTA is supported, 0 otherwise + */ +uint8_t lt_ota_dual_get_stored(); + +/** + * @brief Check which UF2 OTA scheme should be used for applying firmware updates. + * + * @return OTA scheme of the target partition + */ +uf2_ota_scheme_t lt_ota_get_uf2_scheme(); + +/** + * @brief Try to switch OTA index to the other image. For single-OTA chips, only check if the upgrade image is valid. + * + * This can be used to "activate" the upgrade after flashing. + * + * @param revert switch if (and only if) the other image is already marked as active (i.e. + * switch back to the running image) + * @return false if the second image (or upgrade image) is not valid; false if writing failed; true otherwise + */ +bool lt_ota_switch(bool revert); diff --git a/cores/common/base/api/lt_sleep.c b/cores/common/base/api/lt_sleep.c new file mode 100644 index 000000000..f8b47480c --- /dev/null +++ b/cores/common/base/api/lt_sleep.c @@ -0,0 +1,11 @@ +/* Copyright (c) Peter Sarkozi 2023-06-17. */ + +#include "lt_sleep.h" + +__attribute__((weak)) void lt_deep_sleep_config_gpio(uint32_t gpio_index_map, bool on_high); + +__attribute__((weak)) void lt_deep_sleep_unset_gpio(uint32_t gpio_index_map); + +__attribute__((weak)) void lt_deep_sleep_config_timer(uint32_t sleep_duration); + +__attribute__((weak)) void lt_deep_sleep_enter(); diff --git a/cores/common/base/api/lt_sleep.h b/cores/common/base/api/lt_sleep.h new file mode 100644 index 000000000..2ccf0aa50 --- /dev/null +++ b/cores/common/base/api/lt_sleep.h @@ -0,0 +1,31 @@ +/* Copyright (c) Peter Sarkozi 2023-06-17. */ + +#pragma once + +#include + +/** + * @brief Enable GPIO Wakeup from Deep Sleep. + * + * @param gpio_index_map bitMap of the pins we should wake up on + * @param on_high whether to wake up on High or Low state + */ +void lt_deep_sleep_config_gpio(uint32_t gpio_index_map, bool on_high); + +/** + * @brief Disable GPIO Wakeup on given pins + * + * @param gpio_index_map bitMap of the pins we should disable wake up on + */ +void lt_deep_sleep_unset_gpio(uint32_t gpio_index_map); + +/** + * @brief Set a sleep timer to wake up the device + * @param sleep_duration the time in milliseconds to sleep + */ +void lt_deep_sleep_config_timer(uint32_t sleep_duration); + +/** + * @brief Start deep sleep + */ +void lt_deep_sleep_enter(); diff --git a/cores/common/base/api/lt_utils.c b/cores/common/base/api/lt_utils.c new file mode 100644 index 000000000..e4d571e2f --- /dev/null +++ b/cores/common/base/api/lt_utils.c @@ -0,0 +1,74 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-29. */ + +#include "lt_utils.h" + +void lt_rand_bytes(uint8_t *buf, size_t len) { + int *data = (int *)buf; + size_t i; + for (i = 0; len >= sizeof(int); len -= sizeof(int)) { + data[i++] = rand(); + } + if (len) { + int rem = rand(); + unsigned char *pRem = (unsigned char *)&rem; + memcpy(buf + i * sizeof(int), pRem, len); + } +} + +void hexdump(const uint8_t *buf, size_t len, uint32_t offset, uint8_t width) { + uint16_t pos = 0; + while (pos < len) { + // print hex offset + printf("%06lx ", offset + pos); + // calculate current line width + uint8_t lineWidth = MIN(width, len - pos); + // print hexadecimal representation + for (uint8_t i = 0; i < lineWidth; i++) { + if (i % 8 == 0) { + printf(" "); + } + printf("%02x ", buf[pos + i]); + } + // print ascii representation + printf(" |"); + for (uint8_t i = 0; i < lineWidth; i++) { + char c = buf[pos + i]; + putchar((c >= 0x20 && c <= 0x7f) ? c : '.'); + } + puts("|\r"); + pos += lineWidth; + } +} + +char *lt_btox(const uint8_t *src, int len, char *dest) { + // https://stackoverflow.com/a/53966346 + const char hex[] = "0123456789abcdef"; + len *= 2; + dest[len] = '\0'; + while (--len >= 0) + dest[len] = hex[(src[len >> 1] >> ((1 - (len & 1)) << 2)) & 0xF]; + return dest; +} + +uint8_t *lt_xtob(const char *src, int len, uint8_t *dest) { + // https://gist.github.com/vi/dd3b5569af8a26b97c8e20ae06e804cb + + // mapping of ASCII characters to hex values + // (16-byte swapped to reduce XOR 0x10 operation) + const uint8_t mapping[] = { + 0x00, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00, // @ABCDEFG + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // HIJKLMNO + 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, // 01234567 + 0x08, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 89:;<=>? + }; + + int j = 0; + uint8_t idx0; + uint8_t idx1; + for (int i = 0; i < len; i += 2) { + idx0 = ((uint8_t)src[i + 0] & 0x1F); + idx1 = ((uint8_t)src[i + 1] & 0x1F); + dest[j++] = (mapping[idx0] << 4) | (mapping[idx1] << 0); + } + return dest; +} diff --git a/cores/common/base/api/lt_utils.h b/cores/common/base/api/lt_utils.h new file mode 100644 index 000000000..ab942bb48 --- /dev/null +++ b/cores/common/base/api/lt_utils.h @@ -0,0 +1,67 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-02-27. */ + +#pragma once + +#include + +// https://stackoverflow.com/a/3437484 +#define MAX(a, b) \ + ({ \ + __typeof__(a) _a = (a); \ + __typeof__(b) _b = (b); \ + _a > _b ? _a : _b; \ + }) +#define MIN(a, b) \ + ({ \ + __typeof__(a) _a = (a); \ + __typeof__(b) _b = (b); \ + _a < _b ? _a : _b; \ + }) + +/** + * @brief Generate random bytes using rand(). + * + * @param buf destination pointer + * @param len how many bytes to generate + */ +void lt_rand_bytes(uint8_t *buf, size_t len); + +/** + * @brief Print data pointed to by buf in hexdump-like format (hex+ASCII). + * + * @param buf source pointer + * @param len how many bytes to print + * @param offset increment printed offset by this value + * @param width how many bytes on a line + */ +void hexdump( + const uint8_t *buf, + size_t len, +#ifdef __cplusplus + uint32_t offset = 0, + uint8_t width = 16 +#else + uint32_t offset, + uint8_t width +#endif +); + +/** + * @brief Convert a byte array to hexadecimal string. + * + * @param src source byte array + * @param len source length (bytes) + * @param dest destination string + * @return destination string + */ +char *lt_btox(const uint8_t *src, int len, char *dest); + +/** + * @brief Convert a hexadecimal string to byte array. + * + * @param src source string + * @param len source length (chars) + * @param dest destination byte array + * @return destination byte array + */ +uint8_t *lt_xtob(const char *src, int len, uint8_t *dest); diff --git a/cores/common/base/api/lt_wdt.c b/cores/common/base/api/lt_wdt.c new file mode 100644 index 000000000..a33788024 --- /dev/null +++ b/cores/common/base/api/lt_wdt.c @@ -0,0 +1,11 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-29. */ + +#include "lt_wdt.h" + +__attribute__((weak)) bool lt_wdt_enable(uint32_t timeout) { + return false; +} + +__attribute__((weak)) void lt_wdt_disable() {} + +__attribute__((weak)) void lt_wdt_feed() {} diff --git a/cores/common/base/api/lt_wdt.h b/cores/common/base/api/lt_wdt.h new file mode 100644 index 000000000..af48fd40d --- /dev/null +++ b/cores/common/base/api/lt_wdt.h @@ -0,0 +1,23 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-09. */ + +#pragma once + +#include + +/** + * @brief Enable the hardware watchdog. + * + * @param timeout watchdog timeout, milliseconds + * @return whether the chip has a hardware watchdog + */ +bool lt_wdt_enable(uint32_t timeout); + +/** + * @brief Disable the hardware watchdog. + */ +void lt_wdt_disable(); + +/** + * @brief Feed/reset the hardware watchdog timer. + */ +void lt_wdt_feed(); diff --git a/cores/common/base/compat/certs.h b/cores/common/base/compat/certs.h new file mode 100644 index 000000000..13d0266cb --- /dev/null +++ b/cores/common/base/compat/certs.h @@ -0,0 +1,5 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-13. */ + +#pragma once + +#include diff --git a/cores/common/base/compat/err.h b/cores/common/base/compat/err.h new file mode 100644 index 000000000..99eb55962 --- /dev/null +++ b/cores/common/base/compat/err.h @@ -0,0 +1,5 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-05-22. */ + +#pragma once + +#include diff --git a/cores/common/base/compat/lwip/lwip_timers.h b/cores/common/base/compat/lwip/lwip_timers.h new file mode 100644 index 000000000..b2a2774fd --- /dev/null +++ b/cores/common/base/compat/lwip/lwip_timers.h @@ -0,0 +1,5 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-05-22. */ + +#pragma once + +#include diff --git a/cores/common/base/compat/netdb.h b/cores/common/base/compat/netdb.h new file mode 100644 index 000000000..75a707b06 --- /dev/null +++ b/cores/common/base/compat/netdb.h @@ -0,0 +1,5 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-13. */ + +#pragma once + +#include diff --git a/cores/common/base/compat/netif.h b/cores/common/base/compat/netif.h new file mode 100644 index 000000000..7f2d421f6 --- /dev/null +++ b/cores/common/base/compat/netif.h @@ -0,0 +1,5 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-07-20. */ + +#pragma once + +#include diff --git a/cores/common/base/compat/sockets.h b/cores/common/base/compat/sockets.h new file mode 100644 index 000000000..3f34b7604 --- /dev/null +++ b/cores/common/base/compat/sockets.h @@ -0,0 +1,5 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-05-23. */ + +#pragma once + +#include diff --git a/cores/common/base/compat/sys.h b/cores/common/base/compat/sys.h new file mode 100644 index 000000000..7a8cd6dae --- /dev/null +++ b/cores/common/base/compat/sys.h @@ -0,0 +1,5 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-05-22. */ + +#pragma once + +#include diff --git a/cores/common/base/compat/tcpip.h b/cores/common/base/compat/tcpip.h new file mode 100644 index 000000000..9809214b7 --- /dev/null +++ b/cores/common/base/compat/tcpip.h @@ -0,0 +1,5 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-05-22. */ + +#pragma once + +#include diff --git a/cores/common/base/compat/udp.h b/cores/common/base/compat/udp.h new file mode 100644 index 000000000..280996b80 --- /dev/null +++ b/cores/common/base/compat/udp.h @@ -0,0 +1,11 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-05-23. */ + +#pragma once + +#include + +// this is included only by wifi_simple_config.c +// which uses lwip_ntohl without parentheses +// so the #define from lwip/def.h doesn't work +#undef lwip_ntohl +#define lwip_ntohl lwip_htonl diff --git a/cores/common/base/config/fal_cfg.h b/cores/common/base/config/fal_cfg.h new file mode 100644 index 000000000..43775bc5c --- /dev/null +++ b/cores/common/base/config/fal_cfg.h @@ -0,0 +1,47 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-05-24. */ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +inline void printf_nop(const char *fmt, ...) {} + +#define FAL_PRINTF printf_nop +#define FAL_DEBUG 0 + +// Flash device configuration +extern const struct fal_flash_dev flash0; + +#ifdef __cplusplus +} // extern "C" +#endif + +#define FAL_FLASH_DEV_NAME "flash0" + +#define FAL_FLASH_DEV_TABLE \ + { &flash0, } + +#define FAL_DEV_NAME_MAX 16 // no need for 24 chars (default) + +// Partition table +#define FAL_PART_HAS_TABLE_CFG + +#define FAL_PART_TABLE_ITEM(part_lower, part_upper) \ + { \ + .magic_word = FAL_PART_MAGIC_WORD, /* magic word */ \ + .name = #part_lower, /* lowercase name as string */ \ + .flash_name = FAL_FLASH_DEV_NAME, /* flash device name */ \ + .offset = FLASH_##part_upper##_OFFSET, /* partition offset macro as uppercase string */ \ + .len = FLASH_##part_upper##_LENGTH, /* partition length macro as uppercase string */ \ + }, + +// for fal_partition_t +#include + +/** + * @brief "Root" partition entry, representing the entire flash. + * Declared and initialized in lt_main.c. + */ +extern fal_partition_t fal_root_part; diff --git a/cores/common/base/config/fdb_cfg.h b/cores/common/base/config/fdb_cfg.h new file mode 100644 index 000000000..680428a8f --- /dev/null +++ b/cores/common/base/config/fdb_cfg.h @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2020, Armink, + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#ifndef _FDB_CFG_H_ +#define _FDB_CFG_H_ + +/* using KVDB feature */ +#define FDB_USING_KVDB + +#ifdef FDB_USING_KVDB +/* Auto update KV to latest default when current KVDB version number is changed. @see fdb_kvdb.ver_num */ +// #define FDB_KV_AUTO_UPDATE +#endif + +/* using TSDB (Time series database) feature */ +// #define FDB_USING_TSDB + +/* Using FAL storage mode */ +#define FDB_USING_FAL_MODE + +#ifdef FDB_USING_FAL_MODE +/* the flash write granularity, unit: bit + * only support 1(nor flash)/ 8(stm32f2/f4)/ 32(stm32f1) */ +#define FDB_WRITE_GRAN 8 +#endif + +/* Using file storage mode by LIBC file API, like fopen/fread/fwrte/fclose */ +// #define FDB_USING_FILE_LIBC_MODE + +/* Using file storage mode by POSIX file API, like open/read/write/close */ +// #define FDB_USING_FILE_POSIX_MODE + +/* MCU Endian Configuration, default is Little Endian Order. */ +// #define FDB_BIG_ENDIAN + +#if LT_DEBUG_FDB +#include +#include +#define FDB_PRINT(...) __wrap_printf(__VA_ARGS__) +#define FDB_DEBUG_ENABLE +#else +#define FDB_PRINT(...) +#endif + +#endif /* _FDB_CFG_H_ */ diff --git a/cores/common/base/config/lwipopts.h b/cores/common/base/config/lwipopts.h new file mode 100644 index 000000000..2557d02c8 --- /dev/null +++ b/cores/common/base/config/lwipopts.h @@ -0,0 +1,95 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-08-26. */ + +#pragma once + +#define LWIP_TIMEVAL_PRIVATE 0 +#define LWIP_NETIF_HOSTNAME 1 // to support hostname changing +#define LWIP_SO_RCVBUF 1 // for ioctl(FIONREAD) + +#define LWIP_MDNS_RESPONDER 1 +#define MDNS_MAX_SERVICES 10 + +#include_next "lwipopts.h" + +#include + +// set lwIP debugging options according to LT config +#if LT_DEBUG_LWIP +#undef LWIP_DEBUG +#define LWIP_DEBUG 1 +// make lwIP use printf() library +#include +#undef LWIP_PLATFORM_DIAG +// clang-format off +#define LWIP_PLATFORM_DIAG(x) do { printf x; } while (0) +// clang-format on +#endif + +#if LT_DEBUG_LWIP_ASSERT +#undef LWIP_NOASSERT +#undef LWIP_PLATFORM_ASSERT +// clang-format off +#define LWIP_PLATFORM_ASSERT(x) do { printf("ASSERT \"%s\" - %s:%d\n", x, __FILE__, __LINE__); while (1) {}; } while (0) +// clang-format on +#endif + +// lwIP version as a decimal number, with 2 digits for each part (major, minor, patch) +#define LWIP_VERSION_SIMPLE (LWIP_VERSION_MAJOR * 10000 + LWIP_VERSION_MINOR * 100 + LWIP_VERSION_REVISION) + +// remove family-defined debugging options (use lwIP defaults, or user-defined) +#undef ETHARP_DEBUG +#undef NETIF_DEBUG +#undef PBUF_DEBUG +#undef API_LIB_DEBUG +#undef API_MSG_DEBUG +#undef SOCKETS_DEBUG +#undef ICMP_DEBUG +#undef IGMP_DEBUG +#undef INET_DEBUG +#undef IP_DEBUG +#undef IP_REASS_DEBUG +#undef RAW_DEBUG +#undef MEM_DEBUG +#undef MEMP_DEBUG +#undef SYS_DEBUG +#undef TIMERS_DEBUG +#undef TCP_DEBUG +#undef TCP_INPUT_DEBUG +#undef TCP_FR_DEBUG +#undef TCP_RTO_DEBUG +#undef TCP_CWND_DEBUG +#undef TCP_WND_DEBUG +#undef TCP_OUTPUT_DEBUG +#undef TCP_RST_DEBUG +#undef TCP_QLEN_DEBUG +#undef UDP_DEBUG +#undef TCPIP_DEBUG +#undef SLIP_DEBUG +#undef DHCP_DEBUG +#undef AUTOIP_DEBUG +#undef DNS_DEBUG +#undef IP6_DEBUG +#undef MDNS_DEBUG + +#undef LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS +#undef LWIP_PROVIDE_ERRNO + +/** Set this to 1 to support DNS names (or IP address strings) to set sntp servers + * One server address/name can be defined as default if SNTP_SERVER_DNS == 1: + * \#define SNTP_SERVER_ADDRESS "pool.ntp.org" + */ +#define SNTP_SERVER_DNS 1 + +#define SNTP_SET_SYSTEM_TIME_US(sec, us) \ + do { \ + struct timeval tv = {.tv_sec = sec, .tv_usec = us}; \ + settimeofday(&tv, NULL); \ + } while (0); + +#define SNTP_GET_SYSTEM_TIME(sec, us) \ + do { \ + struct timeval tv = {.tv_sec = 0, .tv_usec = 0}; \ + gettimeofday(&tv, NULL); \ + (sec) = tv.tv_sec; \ + (us) = tv.tv_usec; \ + } while (0); diff --git a/cores/common/base/config/printf_config.h b/cores/common/base/config/printf_config.h new file mode 100644 index 000000000..2588c06d1 --- /dev/null +++ b/cores/common/base/config/printf_config.h @@ -0,0 +1,155 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-19. */ + +#pragma once + +#include + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +#define PRINTF_HAS_DISABLE 1 + +// make printf.c define wrapper functions +#define printf_ __wrap_printf +#define sprintf_ __wrap_sprintf +#define vsprintf_ __wrap_vsprintf +#define snprintf_ __wrap_snprintf +#define vsnprintf_ __wrap_vsnprintf +#define vprintf_ __wrap_vprintf + +// declare putchar() method with custom output port +void putchar_p(char c, unsigned long port); + +#define WRAP_DISABLE_DEF(name) \ + extern void __wrap_##name##_disable(); \ + extern void __wrap_##name##_enable(); \ + extern void __wrap_##name##_set(unsigned char disabled); \ + extern unsigned char __wrap_##name##_get(); + +#if !LT_UART_SILENT_ENABLED || LT_UART_SILENT_ALL + +#define WRAP_DISABLE_DECL(name) \ + void __wrap_##name##_disable() {} \ + void __wrap_##name##_enable() {} \ + void __wrap_##name##_set(unsigned char disabled) {} \ + unsigned char __wrap_##name##_get() { \ + return LT_UART_SILENT_ALL; \ + } + +#define WRAP_DISABLE_CHECK(name) \ + { \ + if (LT_UART_SILENT_ALL) \ + return 0; \ + } + +#else // LT_UART_SILENT_ENABLED && !LT_UART_SILENT_ALL + +#define WRAP_DISABLE_DECL(name) \ + static unsigned char __wrap_##name##_disabled = 0; \ + void __wrap_##name##_disable() { \ + __wrap_##name##_disabled = 1; \ + } \ + void __wrap_##name##_enable() { \ + __wrap_##name##_disabled = 0; \ + } \ + void __wrap_##name##_set(unsigned char disabled) { \ + __wrap_##name##_disabled = disabled; \ + } \ + unsigned char __wrap_##name##_get() { \ + return __wrap_##name##_disabled; \ + } + +#define WRAP_DISABLE_CHECK(name) \ + { \ + if (__wrap_##name##_disabled) \ + return 0; \ + } + +#endif // LT_UART_SILENT_ENABLED && !LT_UART_SILENT_ALL + +#if !LT_UART_SILENT_ENABLED + +#define WRAP_PRINTF(name) \ + WRAP_DISABLE_DECL(name) \ + int __wrap_##name(const char *format, ...) { \ + va_list va; \ + va_start(va, format); \ + const int ret = vprintf(format, va); \ + va_end(va); \ + return ret; \ + } + +#define WRAP_VPRINTF(name) \ + WRAP_DISABLE_DECL(name) \ + int __wrap_##name(const char *format, va_list arg) { \ + return vprintf(format, arg); \ + } + +#elif LT_UART_SILENT_ALL + +#define WRAP_PRINTF(name) \ + WRAP_DISABLE_DECL(name) \ + int __wrap_##name(const char *format, ...) { \ + return 0; \ + } + +#define WRAP_VPRINTF(name) \ + WRAP_DISABLE_DECL(name) \ + int __wrap_##name(const char *format, va_list arg) { \ + return 0; \ + } + +#else // !LT_UART_SILENT_ENABLED || !LT_UART_SILENT_ALL + +#define WRAP_PRINTF(name) \ + WRAP_DISABLE_DECL(name) \ + int __wrap_##name(const char *format, ...) { \ + WRAP_DISABLE_CHECK(name); \ + va_list va; \ + va_start(va, format); \ + const int ret = vprintf(format, va); \ + va_end(va); \ + return ret; \ + } + +#define WRAP_VPRINTF(name) \ + WRAP_DISABLE_DECL(name) \ + int __wrap_##name(const char *format, va_list arg) { \ + WRAP_DISABLE_CHECK(name); \ + return vprintf(format, arg); \ + } + +#endif // !LT_UART_SILENT_ENABLED || !LT_UART_SILENT_ALL + +#define WRAP_SPRINTF(name) \ + int __wrap_##name(char *s, const char *format, ...) { \ + va_list va; \ + va_start(va, format); \ + const int ret = vsprintf(s, format, va); \ + va_end(va); \ + return ret; \ + } + +#define WRAP_SNPRINTF(name) \ + int __wrap_##name(char *s, size_t count, const char *format, ...) { \ + va_list va; \ + va_start(va, format); \ + const int ret = vsnprintf(s, count, format, va); \ + va_end(va); \ + return ret; \ + } + +#define WRAP_VSPRINTF(name) \ + int __wrap_##name(char *s, const char *format, va_list arg) { \ + return vsprintf(s, format, arg); \ + } + +#define WRAP_VSNPRINTF(name) \ + int __wrap_##name(char *s, size_t count, const char *format, va_list arg) { \ + return vsnprintf(s, count, format, arg); \ + } + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/cores/common/base/fixups/errno.h b/cores/common/base/fixups/errno.h new file mode 100644 index 000000000..20ef3dfde --- /dev/null +++ b/cores/common/base/fixups/errno.h @@ -0,0 +1,22 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-13. */ + +#pragma once + +// This is an attempt to bring at least some order to , as +// it's generally a source of problems everywhere. +// The idea is that all units will try to import this errno.h first, +// which means it won't use lwIP's error codes. +// The code below was moved from realtek-ambz/fixups during +// porting of BK72XX SDK, when the errno stroke again. + +// There are two different errno's: +// - first is just an int +// - second is a macro that calls __errno() +// Here the first option is ensured in the entire project. +#include // use system __errno() & error codes +#undef errno // undefine __errno() macro +extern int errno; // use a global errno variable +#define errno errno // for #ifdef errno in lwIP + +// make sure lwIP never defines its own error codes +#undef LWIP_PROVIDE_ERRNO diff --git a/cores/common/base/fixups/lwip/errno.h b/cores/common/base/fixups/lwip/errno.h new file mode 100644 index 000000000..75e45b667 --- /dev/null +++ b/cores/common/base/fixups/lwip/errno.h @@ -0,0 +1,5 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-13. */ + +#pragma once + +#include "../errno.h" diff --git a/cores/common/base/fixups/malloc.c b/cores/common/base/fixups/malloc.c new file mode 100644 index 000000000..a0e11bb98 --- /dev/null +++ b/cores/common/base/fixups/malloc.c @@ -0,0 +1,88 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-03. */ + +// Generic implementation of malloc() family wrappers for FreeRTOS + +#if LT_HAS_FREERTOS + +#include +#include +#include + +#include + +// no such thing in FreeRTOS, but present on most vendor SDKs +extern void *LT_REALLOC_FUNC(void *pv, size_t xWantedSize); + +void *__wrap_malloc(size_t size) { + return pvPortMalloc(size); +} + +void *__wrap_calloc(size_t num, size_t size) { + void *ptr; + if (num == 0 || size == 0) + num = size = 1; + ptr = pvPortMalloc(num * size); + if (ptr) + memset(ptr, 0, num * size); + return ptr; +} + +void *__wrap_realloc(void *ptr, size_t new_size) { +#if LT_REMALLOC + void *nptr = pvPortMalloc(new_size); + if (nptr) { + memcpy(nptr, ptr, new_size); + vPortFree(ptr); + } + return nptr; +#else + return LT_REALLOC_FUNC(ptr, new_size); +#endif +} + +void __wrap_free(void *ptr) { + vPortFree(ptr); +} + +// Mind the 'reent' parameter - do NOT define these as linker aliases! + +void *__wrap__malloc_r(void *reent, size_t size) { + return pvPortMalloc(size); +} + +void *__wrap__calloc_r(void *reent, size_t num, size_t size) { + void *ptr; + if (num == 0 || size == 0) + num = size = 1; + ptr = pvPortMalloc(num * size); + if (ptr) + memset(ptr, 0, num * size); + return ptr; +} + +void *__wrap__realloc_r(void *reent, void *ptr, size_t new_size) { +#if LT_REMALLOC + void *nptr = pvPortMalloc(new_size); + if (nptr) { + memcpy(nptr, ptr, new_size); + vPortFree(ptr); + } + return nptr; +#else + return LT_REALLOC_FUNC(ptr, new_size); +#endif +} + +void __wrap__free_r(void *reent, void *ptr) { + vPortFree(ptr); +} + +#endif + +// Additionally, define zalloc() as a shorthand to calloc() - some implementation use it + +void *__wrap_zalloc(size_t size) { + return __wrap_calloc(1, size); +} + +__attribute__((alias("__wrap_zalloc"), weak)) void *zalloc(size_t size); diff --git a/cores/common/base/libretiny.h b/cores/common/base/libretiny.h new file mode 100644 index 000000000..1d394e9e5 --- /dev/null +++ b/cores/common/base/libretiny.h @@ -0,0 +1,50 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-28. */ + +#pragma once + +// C standard libraries +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// LibreTiny version macros +#ifndef LT_VERSION +#define LT_VERSION 1.0.0 +#endif +#ifndef LT_BOARD +#define LT_BOARD unknown +#endif +#define STRINGIFY(x) #x +#define STRINGIFY_MACRO(x) STRINGIFY(x) +#define LT_VERSION_STR STRINGIFY_MACRO(LT_VERSION) +#define LT_BOARD_STR STRINGIFY_MACRO(LT_BOARD) +#define GCC_VERSION_STR \ + STRINGIFY_MACRO(__GNUC__) "." STRINGIFY_MACRO(__GNUC_MINOR__) "." STRINGIFY_MACRO(__GNUC_PATCHLEVEL__) +#define LT_BANNER_STR \ + "LibreTiny v" LT_VERSION_STR " on " LT_BOARD_STR ", compiled at " __DATE__ " " __TIME__ ", GCC " GCC_VERSION_STR \ + " (-O" STRINGIFY_MACRO(__OPTIMIZE_LEVEL__) ")" + +// Functional macros +#define LT_BANNER() LT_LOG(LT_LEVEL_INFO, __FUNCTION__, __LINE__, LT_BANNER_STR) + +// Types & macros +#include "lt_config.h" // platform configuration options +#include "lt_types.h" // types & enums +// Family-specific macros +#include +// Board variant (pin definitions) +#include LT_VARIANT_H +// APIs +#include "lt_api.h" // main API function definitions +#include "lt_logger.h" // UART logger utility +#include "lt_pins.h" // additional pin macros +#include "lt_posix_api.h" // POSIX compat functions +// printf silencing methods +#include diff --git a/cores/common/base/lt_api.h b/cores/common/base/lt_api.h new file mode 100644 index 000000000..4741ccea3 --- /dev/null +++ b/cores/common/base/lt_api.h @@ -0,0 +1,25 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-09. */ + +#pragma once + +// This file collects all LibreTiny C API includes. +// The functions are implemented in api/*.c units, which are located +// in the common core, and in the family cores. + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +#include "api/lt_cpu.h" +#include "api/lt_device.h" +#include "api/lt_flash.h" +#include "api/lt_init.h" +#include "api/lt_mem.h" +#include "api/lt_ota.h" +#include "api/lt_sleep.h" +#include "api/lt_utils.h" +#include "api/lt_wdt.h" + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/cores/common/base/lt_config.h b/cores/common/base/lt_config.h new file mode 100644 index 000000000..75d861101 --- /dev/null +++ b/cores/common/base/lt_config.h @@ -0,0 +1,132 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-28. */ + +#pragma once + +// see docs/API Configuration + +// Loglevels +#define LT_LEVEL_VERBOSE LT_LEVEL_TRACE +#define LT_LEVEL_TRACE 0 +#define LT_LEVEL_DEBUG 1 +#define LT_LEVEL_INFO 2 +#define LT_LEVEL_WARN 3 +#define LT_LEVEL_ERROR 4 +#define LT_LEVEL_FATAL 5 +#define LT_LEVEL_NONE 6 + +// Logger enabled/disabled +#ifndef LT_LOGGER +#define LT_LOGGER 1 +#endif + +// Logger format options +#ifndef LT_LOGGER_TIMESTAMP +#define LT_LOGGER_TIMESTAMP 1 +#endif + +#ifndef LT_LOGGER_CALLER +#define LT_LOGGER_CALLER 0 +#endif + +#ifndef LT_LOGGER_TASK +#define LT_LOGGER_TASK 0 +#endif + +#ifndef LT_LOGGER_COLOR +#define LT_LOGGER_COLOR 0 +#endif + +#ifndef LT_PRINTF_BROKEN +#define LT_PRINTF_BROKEN 0 +#endif + +// Global loglevel +#ifndef LT_LOGLEVEL +#define LT_LOGLEVEL LT_LEVEL_INFO +#endif + +#if !LT_LOGGER +#undef LT_LOGLEVEL +#define LT_LOGLEVEL LT_LEVEL_NONE +#endif + +// Free heap size debugging +#ifndef LT_LOG_HEAP +#define LT_LOG_HEAP 0 +#endif + +// Debug errno values using LT_ERRNO() +#ifndef LT_LOG_ERRNO +#define LT_LOG_ERRNO 0 +#endif + +// Serial output options +#ifndef LT_UART_SILENT_ENABLED +#define LT_UART_SILENT_ENABLED 1 +#endif + +#ifndef LT_UART_SILENT_ALL +#define LT_UART_SILENT_ALL 0 +#endif + +#ifndef LT_UART_DEFAULT_LOGGER +#define LT_UART_DEFAULT_LOGGER LT_UART_DEFAULT_PORT +#endif + +#ifndef LT_UART_DEFAULT_SERIAL +#define LT_UART_DEFAULT_SERIAL LT_UART_DEFAULT_PORT +#endif + +// Misc options +#ifndef LT_USE_TIME +#define LT_USE_TIME 0 +#endif + +#ifndef LT_MICROS_HIGH_RES // NOTE: this is also defined in fixups/clock_rtos.c +#define LT_MICROS_HIGH_RES 1 +#endif + +#ifndef LT_AUTO_DOWNLOAD_REBOOT +#define LT_AUTO_DOWNLOAD_REBOOT 1 +#endif + +// Per-module logging output - applies to all loglevels +#ifndef LT_DEBUG_ALL +#define LT_DEBUG_ALL 0 +#endif + +#ifndef LT_DEBUG_WIFI +#define LT_DEBUG_WIFI 1 +#endif + +#ifndef LT_DEBUG_CLIENT +#define LT_DEBUG_CLIENT LT_DEBUG_ALL +#endif + +#ifndef LT_DEBUG_SERVER +#define LT_DEBUG_SERVER LT_DEBUG_ALL +#endif + +#ifndef LT_DEBUG_SSL +#define LT_DEBUG_SSL LT_DEBUG_ALL +#endif + +#ifndef LT_DEBUG_OTA +#define LT_DEBUG_OTA 1 +#endif + +#ifndef LT_DEBUG_FDB +#define LT_DEBUG_FDB 0 +#endif + +#ifndef LT_DEBUG_MDNS +#define LT_DEBUG_MDNS LT_DEBUG_ALL +#endif + +#ifndef LT_DEBUG_LWIP +#define LT_DEBUG_LWIP 0 +#endif + +#ifndef LT_DEBUG_LWIP_ASSERT +#define LT_DEBUG_LWIP_ASSERT 0 +#endif diff --git a/cores/common/base/lt_logger.c b/cores/common/base/lt_logger.c new file mode 100644 index 000000000..8b8018629 --- /dev/null +++ b/cores/common/base/lt_logger.c @@ -0,0 +1,178 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-28. */ + +#include "lt_logger.h" + +#if __has_include() +#include +#endif + +#if LT_HAS_PRINTF +#include +#include +#else +#include +#endif + +#if (LT_LOGGER_TIMESTAMP || LT_LOGGER_TASK) && LT_HAS_FREERTOS +#include +#include +#endif + +#define COLOR_FMT "\e[0;30m" +#define COLOR_BLACK 0x00 +#define COLOR_RED 0x01 +#define COLOR_GREEN 0x02 +#define COLOR_YELLOW 0x03 +#define COLOR_BLUE 0x04 +#define COLOR_MAGENTA 0x05 +#define COLOR_CYAN 0x06 +#define COLOR_WHITE 0x07 +#define COLOR_BRIGHT_BLACK 0x10 +#define COLOR_BRIGHT_RED 0x11 +#define COLOR_BRIGHT_GREEN 0x12 +#define COLOR_BRIGHT_YELLOW 0x13 +#define COLOR_BRIGHT_BLUE 0x14 +#define COLOR_BRIGHT_MAGENTA 0x15 +#define COLOR_BRIGHT_CYAN 0x16 +#define COLOR_BRIGHT_WHITE 0x17 + +#ifdef LT_UART_DEFAULT_PORT +static uint32_t uart_port = LT_UART_DEFAULT_LOGGER; +#else +static uint32_t uart_port = 0; +#endif +static const char levels[] = {'V', 'D', 'I', 'W', 'E', 'F'}; + +#if LT_LOGGER_COLOR +static const uint8_t colors[] = { + COLOR_BRIGHT_CYAN, + COLOR_BRIGHT_BLUE, + COLOR_BRIGHT_GREEN, + COLOR_BRIGHT_YELLOW, + COLOR_BRIGHT_RED, + COLOR_BRIGHT_MAGENTA, +}; +#endif + +#if LIBRETINY_ARDUINO +unsigned long millis(void); +#endif + +#if LT_LOGGER_CALLER +void lt_log(const uint8_t level, const char *caller, const unsigned short line, const char *format, ...) { +#else +void lt_log(const uint8_t level, const char *format, ...) { +#endif + + if (uart_port == 0xFF) + return; + +#if LT_LOGGER_TIMESTAMP +#if LIBRETINY_ARDUINO + float seconds = millis() / 1000.0f; +#elif LT_HAS_FREERTOS + float seconds = xTaskGetTickCount() * portTICK_PERIOD_MS / 1000.0f; +#else + float seconds = 0; +#endif +#if LT_PRINTF_BROKEN + char zero[4] = "\x00\x30\x30"; + if (seconds == 0.0f) + zero[0] = '0'; +#endif +#endif + +#if LT_LOGGER_TASK && LT_HAS_FREERTOS + char task_colon = ':'; + TaskHandle_t task = xTaskGetCurrentTaskHandle(); + char *task_name = pcTaskGetTaskName(task); + if (!task) { + task_name = ""; + task_colon = '-'; + } +#endif + +#if LT_LOGGER_COLOR + char c_bright = '0' + (colors[level] >> 4); + char c_value = '0' + (colors[level] & 0x7); +#endif + +#if LT_HAS_PRINTF + fctprintf( + (void (*)(char, void *))putchar_p, + (void *)uart_port, +#else + printf( +#endif + // format: +#if LT_LOGGER_COLOR + "\e[%c;3%cm" +#endif + "%c " +#if LT_LOGGER_TIMESTAMP +#if LT_PRINTF_BROKEN + "[%11.3f%s] " +#else + "[%11.3f] " +#endif +#endif +#if LT_LOGGER_COLOR + "\e[0m" +#endif +#if LT_LOGGER_CALLER + "%s():%hu: " +#endif +#if LT_LOGGER_TASK && LT_HAS_FREERTOS + "%s%c " +#endif + , + // arguments: +#if LT_LOGGER_COLOR + c_bright, // whether text is bright + c_value, // text color +#endif + levels[level] +#if LT_LOGGER_TIMESTAMP + , + seconds // float +#if LT_PRINTF_BROKEN + , + zero // append missing zeroes if printf "%11.3f" prints "0." +#endif +#endif +#if LT_LOGGER_CALLER + , + caller, + line +#endif +#if LT_LOGGER_TASK && LT_HAS_FREERTOS + , + task_name, + task_colon // printing outside of tasks +#endif + ); + +#if LT_HAS_PRINTF + va_list va_args; + va_start(va_args, format); + vfctprintf((void (*)(char, void *))putchar_p, (void *)uart_port, format, va_args); + va_end(va_args); + putchar_p('\r', uart_port); + putchar_p('\n', uart_port); +#else + va_list va_args; + va_start(va_args, format); + vprintf(format, va_args); + va_end(va_args); + putchar('\r'); + putchar('\n'); +#endif +} + +void lt_log_set_port(uint8_t port) { + uart_port = port; +} + +void lt_log_disable() { + uart_port = 0xFF; +} diff --git a/cores/common/base/lt_logger.h b/cores/common/base/lt_logger.h new file mode 100644 index 000000000..0af8f5f94 --- /dev/null +++ b/cores/common/base/lt_logger.h @@ -0,0 +1,177 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-28. */ + +#pragma once + +#include + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +#if LT_LOGGER_CALLER +#define LT_LOG(level, caller, line, ...) lt_log(level, caller, line, __VA_ARGS__) +#define LT_LOGM(level, module, caller, line, ...) \ + do { \ + if (LT_DEBUG_##module) { \ + lt_log(level, caller, line, #module ": " __VA_ARGS__); \ + } \ + } while (0) +void lt_log(const uint8_t level, const char *caller, const unsigned short line, const char *format, ...) + __attribute__((format(printf, 4, 5))); +#else +#define LT_LOG(level, caller, line, ...) lt_log(level, __VA_ARGS__) +#define LT_LOGM(level, module, caller, line, ...) \ + do { \ + if (LT_DEBUG_##module) { \ + lt_log(level, #module ": " __VA_ARGS__); \ + } \ + } while (0) +void lt_log(const uint8_t level, const char *format, ...) __attribute__((format(printf, 2, 3))); +#endif + +/** + * @brief Change log output port. + * + * @param port UART port index - can be 0, 1 or 2 + */ +void lt_log_set_port(uint8_t port); + +/** + * @brief Disable LT logger. Enable it back using lt_log_set_port(LT_UART_DEFAULT_LOGGER). + */ +void lt_log_disable(); + +#if LT_LEVEL_TRACE >= LT_LOGLEVEL +#define LT_T(...) LT_LOG(LT_LEVEL_TRACE, __FUNCTION__, __LINE__, __VA_ARGS__) +#define LT_V(...) LT_LOG(LT_LEVEL_TRACE, __FUNCTION__, __LINE__, __VA_ARGS__) +#define LT_TM(module, ...) LT_LOGM(LT_LEVEL_TRACE, module, __FUNCTION__, __LINE__, __VA_ARGS__) +#define LT_VM(module, ...) LT_LOGM(LT_LEVEL_TRACE, module, __FUNCTION__, __LINE__, __VA_ARGS__) +#else +#define LT_T(...) +#define LT_V(...) +#define LT_TM(...) +#define LT_VM(...) +#endif + +#if LT_LEVEL_DEBUG >= LT_LOGLEVEL +#define LT_D(...) LT_LOG(LT_LEVEL_DEBUG, __FUNCTION__, __LINE__, __VA_ARGS__) +#define LT_DM(module, ...) LT_LOGM(LT_LEVEL_DEBUG, module, __FUNCTION__, __LINE__, __VA_ARGS__) +#else +#define LT_D(...) +#define LT_DM(...) +#endif + +#if LT_LEVEL_INFO >= LT_LOGLEVEL +#define LT_I(...) LT_LOG(LT_LEVEL_INFO, __FUNCTION__, __LINE__, __VA_ARGS__) +#define LT_IM(module, ...) LT_LOGM(LT_LEVEL_INFO, module, __FUNCTION__, __LINE__, __VA_ARGS__) +#else +#define LT_I(...) +#define LT_IM(...) +#endif + +#if LT_LEVEL_WARN >= LT_LOGLEVEL +#define LT_W(...) LT_LOG(LT_LEVEL_WARN, __FUNCTION__, __LINE__, __VA_ARGS__) +#define LT_WM(module, ...) LT_LOGM(LT_LEVEL_WARN, module, __FUNCTION__, __LINE__, __VA_ARGS__) +#else +#define LT_W(...) +#define LT_WM(...) +#endif + +#if LT_LEVEL_ERROR >= LT_LOGLEVEL +#define LT_E(...) LT_LOG(LT_LEVEL_ERROR, __FUNCTION__, __LINE__, __VA_ARGS__) +#define LT_EM(module, ...) LT_LOGM(LT_LEVEL_ERROR, module, __FUNCTION__, __LINE__, __VA_ARGS__) +#else +#define LT_E(...) +#define LT_EM(...) +#endif + +#if LT_LEVEL_FATAL >= LT_LOGLEVEL +#define LT_F(...) LT_LOG(LT_LEVEL_FATAL, __FUNCTION__, __LINE__, __VA_ARGS__) +#define LT_FM(module, ...) LT_LOGM(LT_LEVEL_FATAL, module, __FUNCTION__, __LINE__, __VA_ARGS__) +#else +#define LT_F(...) +#define LT_FM(...) +#endif + +#if LT_LOG_HEAP && LT_HAS_FREERTOS +#define LT_HEAP_I() LT_I("Free heap: %u", LT_HEAP_FUNC()); +#else +#define LT_HEAP_I() +#endif + +// ESP32 compat +#define log_printf(...) LT_I(__VA_ARGS__) +#define log_v(...) LT_V(__VA_ARGS__) +#define log_d(...) LT_D(__VA_ARGS__) +#define log_i(...) LT_I(__VA_ARGS__) +#define log_w(...) LT_W(__VA_ARGS__) +#define log_e(...) LT_E(__VA_ARGS__) +#define log_n(...) LT_E(__VA_ARGS__) +#define isr_log_v(...) LT_V(__VA_ARGS__) +#define isr_log_d(...) LT_D(__VA_ARGS__) +#define isr_log_i(...) LT_I(__VA_ARGS__) +#define isr_log_w(...) LT_W(__VA_ARGS__) +#define isr_log_e(...) LT_E(__VA_ARGS__) +#define isr_log_n(...) LT_E(__VA_ARGS__) +#define ESP_LOGV(...) LT_V(__VA_ARGS__) +#define ESP_LOGD(...) LT_D(__VA_ARGS__) +#define ESP_LOGI(...) LT_I(__VA_ARGS__) +#define ESP_LOGW(...) LT_W(__VA_ARGS__) +#define ESP_LOGE(...) LT_E(__VA_ARGS__) +#define ESP_EARLY_LOGV(...) LT_V(__VA_ARGS__) +#define ESP_EARLY_LOGD(...) LT_D(__VA_ARGS__) +#define ESP_EARLY_LOGI(...) LT_I(__VA_ARGS__) +#define ESP_EARLY_LOGW(...) LT_W(__VA_ARGS__) +#define ESP_EARLY_LOGE(...) LT_E(__VA_ARGS__) +#define ets_printf(...) LT_I(__VA_ARGS__) +#define ETS_PRINTF(...) LT_I(__VA_ARGS__) + +#define LT_RET(ret) \ + LT_E("ret=%d", ret); \ + return ret; + +#define LT_RET_NZ(ret) \ + if (ret) { \ + LT_E("ret=%d", ret); \ + return ret; \ + } +#define LT_RET_LZ(ret) \ + if (ret < 0) { \ + LT_E("ret=%d", ret); \ + return ret; \ + } +#define LT_RET_LEZ(ret) \ + if (ret <= 0) { \ + LT_E("ret=%d", ret); \ + return ret; \ + } + +#define LT_ERRNO_NZ(ret) \ + if (ret) { \ + LT_E("errno=%d, ret=%d", errno, ret); \ + return ret; \ + } +#define LT_ERRNO_LZ(ret) \ + if (ret < 0) { \ + LT_E("errno=%d, ret=%d", errno, ret); \ + return ret; \ + } +#define LT_ERRNO_LEZ(ret) \ + if (ret <= 0) { \ + LT_E("errno=%d, ret=%d", errno, ret); \ + return ret; \ + } + +#if LT_LOG_ERRNO +#define LT_ERRNO() \ + if (errno) { \ + LT_E("errno=%d", errno); \ + errno = 0; \ + } +#else +#define LT_ERRNO() +#endif + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/cores/common/base/lt_main.c b/cores/common/base/lt_main.c new file mode 100644 index 000000000..c66eefe31 --- /dev/null +++ b/cores/common/base/lt_main.c @@ -0,0 +1,31 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-19. */ + +#include + +#include + +fal_partition_t fal_root_part = NULL; + +// Initialize C library +void __libc_init_array(void); +// Main app entrypoint +int main(void); + +int lt_main(void) { + // early initialize the family and variant + lt_init_family(); + lt_init_variant(); + // print a startup banner + LT_BANNER(); + // initialize C library + __libc_init_array(); + // inform about the reset reason + LT_I("Reset reason: %s", lt_get_reboot_reason_name(0)); + // initialize FAL + fal_init(); + // provide root partition + fal_root_part = (fal_partition_t)fal_partition_find("root"); + + // run the application + return main(); +} diff --git a/cores/common/base/lt_pins.h b/cores/common/base/lt_pins.h new file mode 100644 index 000000000..7e9f626e5 --- /dev/null +++ b/cores/common/base/lt_pins.h @@ -0,0 +1,69 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-06-21. */ + +#include LT_VARIANT_H + +#define PIN_INVALID 255 + +#define LT_HW_UART0 HAS_SERIAL0 +#define LT_HW_UART1 HAS_SERIAL1 +#define LT_HW_UART2 HAS_SERIAL2 +#define LT_HW_I2C0 HAS_WIRE0 +#define LT_HW_I2C1 HAS_WIRE1 +#define LT_HW_I2C2 HAS_WIRE2 +#define LT_HW_SPI0 HAS_SPI0 +#define LT_HW_SPI1 HAS_SPI1 +#define LT_HW_SPI2 HAS_SPI2 + +#if LT_HW_UART0 +#ifndef PIN_SERIAL0_RX +#define PIN_SERIAL0_RX PIN_INVALID +#endif +#ifndef PIN_SERIAL0_TX +#define PIN_SERIAL0_TX PIN_INVALID +#endif +#endif + +#if LT_HW_UART1 +#ifndef PIN_SERIAL1_RX +#define PIN_SERIAL1_RX PIN_INVALID +#endif +#ifndef PIN_SERIAL1_TX +#define PIN_SERIAL1_TX PIN_INVALID +#endif +#endif + +#if LT_HW_UART2 +#ifndef PIN_SERIAL2_RX +#define PIN_SERIAL2_RX PIN_INVALID +#endif +#ifndef PIN_SERIAL2_TX +#define PIN_SERIAL2_TX PIN_INVALID +#endif +#endif + +#if LT_HW_I2C0 +#ifndef PIN_WIRE0_SDA +#define PIN_WIRE0_SDA PIN_INVALID +#endif +#ifndef PIN_WIRE0_SCL +#define PIN_WIRE0_SCL PIN_INVALID +#endif +#endif + +#if LT_HW_I2C1 +#ifndef PIN_WIRE1_SDA +#define PIN_WIRE1_SDA PIN_INVALID +#endif +#ifndef PIN_WIRE1_SCL +#define PIN_WIRE1_SCL PIN_INVALID +#endif +#endif + +#if LT_HW_I2C2 +#ifndef PIN_WIRE2_SDA +#define PIN_WIRE2_SDA PIN_INVALID +#endif +#ifndef PIN_WIRE2_SCL +#define PIN_WIRE2_SCL PIN_INVALID +#endif +#endif diff --git a/cores/common/base/lt_posix_api.h b/cores/common/base/lt_posix_api.h new file mode 100644 index 000000000..e703029e2 --- /dev/null +++ b/cores/common/base/lt_posix_api.h @@ -0,0 +1,9 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-05-16. */ + +#include +#include + +extern char *strdup(const char *); +extern int strcasecmp(const char *s1, const char *s2); +extern int strncasecmp(const char *s1, const char *s2, size_t n); +extern char *strptime(const char *buf, const char *fmt, struct tm *tm); diff --git a/cores/common/base/lt_types.h b/cores/common/base/lt_types.h new file mode 100644 index 000000000..a8a4870c4 --- /dev/null +++ b/cores/common/base/lt_types.h @@ -0,0 +1,47 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-05-28. */ + +#pragma once + +#include + +#define CPU_MODEL(family, chip_id) (((family >> 24) << 8) | chip_id) +#define CPU_MODEL_ENUM(family, chip_id) (lt_cpu_model_t) CPU_MODEL(family, chip_id) + +typedef enum { + F_RTL8710A = 0x9FFFD543, // Realtek Ameba1 + F_RTL8710B = 0x22E0D6FC, // Realtek AmebaZ (realtek-ambz) + F_RTL8720C = 0xE08F7564, // Realtek AmebaZ2 + F_RTL8720D = 0x3379CFE2, // Realtek AmebaD + F_BK7231Q = 0xAFE81D49, // Beken 7231Q + F_BK7231T = 0x675A40B0, // Beken 7231T + F_BK7231N = 0x7B3EF230, // Beken 7231N + F_BK7251 = 0x6A82CC42, // Beken 7251/7252 + F_BL60X = 0xDE1270B7, // Boufallo 602 +} lt_cpu_family_t; + +typedef enum { + // Realtek AmebaZ + // IDs copied from rtl8710b_efuse.h + RTL8710BL = CPU_MODEL(F_RTL8710B, 0xE0), // ??? + RTL8710BN = CPU_MODEL(F_RTL8710B, 0xFF), // CHIPID_8710BN / QFN32 + RTL8710BU = CPU_MODEL(F_RTL8710B, 0xFE), // CHIPID_8710BU / QFN48 + RTL8710BX = CPU_MODEL(F_RTL8710B, 0xF6), // found on an actual RTL8710BX + RTL8710L0 = CPU_MODEL(F_RTL8710B, 0xFB), // CHIPID_8710BN_L0 / QFN32 + RTL8711BN = CPU_MODEL(F_RTL8710B, 0xFD), // CHIPID_8711BN / QFN48 + RTL8711BU = CPU_MODEL(F_RTL8710B, 0xFC), // CHIPID_8711BG / QFN68 + MX1290 = RTL8710BN, + MX1290V2 = RTL8710BX, + W302 = RTL8710BN, + // Realtek AmebaZ2 (chip_id << 2 | flash_mode) + RTL8720CM = CPU_MODEL(F_RTL8720C, 0xEC), // 0xFB << 2 | 0 + RTL8720CF = CPU_MODEL(F_RTL8720C, 0xED), // 0xFB << 2 | 1 + RTL8720CX = RTL8720CM, + // Beken 72XX + BK7231Q = CPU_MODEL(F_BK7231Q, 0x31), // *SCTRL_CHIP_ID = 0x7231 + BK7231T = CPU_MODEL(F_BK7231T, 0x1A), // *SCTRL_CHIP_ID = 0x7231a + BK7231N = CPU_MODEL(F_BK7231N, 0x1C), // *SCTRL_CHIP_ID = 0x7231c + BK7252 = CPU_MODEL(F_BK7251, 0x00), // TODO + BL2028N = BK7231N, + BK7231S = BK7231T, + BK7231U = BK7231T, +} lt_cpu_model_t; diff --git a/cores/common/base/posix/itoa.c b/cores/common/base/posix/itoa.c new file mode 100644 index 000000000..0493f8b0a --- /dev/null +++ b/cores/common/base/posix/itoa.c @@ -0,0 +1,111 @@ +/* + Copyright (c) 2014 Arduino LLC. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +char *ltoa(long value, char *string, int radix) { + char tmp[33]; + char *tp = tmp; + long i; + unsigned long v; + int sign; + char *sp; + + if (string == NULL) { + return 0; + } + + if (radix > 36 || radix <= 1) { + return 0; + } + + sign = (radix == 10 && value < 0); + if (sign) { + v = -value; + } else { + v = (unsigned long)value; + } + + while (v || tp == tmp) { + i = v % radix; + v = v / radix; + if (i < 10) + *tp++ = i + '0'; + else + *tp++ = i + 'a' - 10; + } + + sp = string; + + if (sign) + *sp++ = '-'; + while (tp > tmp) + *sp++ = *--tp; + *sp = 0; + + return string; +} + +char *ultoa(unsigned long value, char *string, int radix) { + char tmp[33]; + char *tp = tmp; + long i; + unsigned long v = value; + char *sp; + + if (string == NULL) { + return 0; + } + + if (radix > 36 || radix <= 1) { + return 0; + } + + while (v || tp == tmp) { + i = v % radix; + v = v / radix; + if (i < 10) + *tp++ = i + '0'; + else + *tp++ = i + 'a' - 10; + } + + sp = string; + + while (tp > tmp) + *sp++ = *--tp; + *sp = 0; + + return string; +} + +char *itoa(int value, char *string, int radix) { + return ltoa(value, string, radix); +} + +char *utoa(unsigned int value, char *string, int radix) { + return ultoa(value, string, radix); +} + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/cores/common/base/posix/strcasecmp.c b/cores/common/base/posix/strcasecmp.c new file mode 100644 index 000000000..1ce98dae5 --- /dev/null +++ b/cores/common/base/posix/strcasecmp.c @@ -0,0 +1,97 @@ +/* $OpenBSD: strcasecmp.c,v 1.6 2005/08/08 08:05:37 espie Exp $ */ +/* + * Copyright (c) 1987, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ +#include +typedef unsigned char u_char; +/* + * This array is designed for mapping upper and lower case letter + * together for a case independent comparison. The mappings are + * based upon ascii character sequences. + */ +static const u_char charmap[] = { + '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', + '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', + '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027', + '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037', + '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047', + '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057', + '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067', + '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077', + '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', + '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', + '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', + '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137', + '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147', + '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', + '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', + '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177', + '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207', + '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', + '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', + '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237', + '\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247', + '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257', + '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267', + '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277', + '\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307', + '\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317', + '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327', + '\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337', + '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', + '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', + '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', + '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377', +}; +int +strcasecmp(const char *s1, const char *s2) +{ + const u_char *cm = charmap; + const u_char *us1 = (const u_char *)s1; + const u_char *us2 = (const u_char *)s2; + while (cm[*us1] == cm[*us2++]) + if (*us1++ == '\0') + return (0); + return (cm[*us1] - cm[*--us2]); +} +int +strncasecmp(const char *s1, const char *s2, size_t n) +{ + if (n != 0) { + const u_char *cm = charmap; + const u_char *us1 = (const u_char *)s1; + const u_char *us2 = (const u_char *)s2; + do { + if (cm[*us1] != cm[*us2++]) + return (cm[*us1] - cm[*--us2]); + if (*us1++ == '\0') + break; + } while (--n != 0); + } + return (0); +} diff --git a/cores/common/base/posix/strdup.c b/cores/common/base/posix/strdup.c new file mode 100644 index 000000000..db165699d --- /dev/null +++ b/cores/common/base/posix/strdup.c @@ -0,0 +1,13 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-05-16. */ + +#include +#include +#include + +__attribute__((weak)) char *strdup(const char *s) { + size_t len = strlen(s) + 1; + void *newp = malloc(len); + if (newp == NULL) + return NULL; + return (char *)memcpy(newp, s, len); +} diff --git a/cores/common/base/posix/strptime.c b/cores/common/base/posix/strptime.c new file mode 100644 index 000000000..f41f55f24 --- /dev/null +++ b/cores/common/base/posix/strptime.c @@ -0,0 +1,197 @@ +#include +#include +#include +#include +#include +#include +#include + +char *strptime(const char *restrict s, const char *restrict f, struct tm *restrict tm) +{ + int i, w, neg, adj, min, range, *dest, dummy; + const char *ex; + size_t len; + int want_century = 0, century = 0; + while (*f) { + if (*f != '%') { + if (isspace(*f)) for (; *s && isspace(*s); s++); + else if (*s != *f) return 0; + else s++; + f++; + continue; + } + f++; + if (*f == '+') f++; + if (isdigit(*f)) w=strtoul(f, (void *)&f, 10); + else w=-1; + adj=0; + switch (*f++) { + case 'a': case 'A': + dest = &tm->tm_wday; + min = ABDAY_1; + range = 7; + goto symbolic_range; + case 'b': case 'B': case 'h': + dest = &tm->tm_mon; + min = ABMON_1; + range = 12; + goto symbolic_range; + case 'c': + s = strptime(s, nl_langinfo(D_T_FMT), tm); + if (!s) return 0; + break; + case 'C': + dest = ¢ury; + if (w<0) w=2; + want_century |= 2; + goto numeric_digits; + case 'd': case 'e': + dest = &tm->tm_mday; + min = 1; + range = 31; + goto numeric_range; + case 'D': + s = strptime(s, "%m/%d/%y", tm); + if (!s) return 0; + break; + case 'H': + dest = &tm->tm_hour; + min = 0; + range = 24; + goto numeric_range; + case 'I': + dest = &tm->tm_hour; + min = 1; + range = 12; + goto numeric_range; + case 'j': + dest = &tm->tm_yday; + min = 1; + range = 366; + goto numeric_range; + case 'm': + dest = &tm->tm_mon; + min = 1; + range = 12; + adj = 1; + goto numeric_range; + case 'M': + dest = &tm->tm_min; + min = 0; + range = 60; + goto numeric_range; + case 'n': case 't': + for (; *s && isspace(*s); s++); + break; + case 'p': + ex = nl_langinfo(AM_STR); + len = strlen(ex); + if (!strncasecmp(s, ex, len)) { + tm->tm_hour %= 12; + break; + } + ex = nl_langinfo(PM_STR); + len = strlen(ex); + if (!strncasecmp(s, ex, len)) { + tm->tm_hour %= 12; + tm->tm_hour += 12; + break; + } + return 0; + case 'r': + s = strptime(s, nl_langinfo(T_FMT_AMPM), tm); + if (!s) return 0; + break; + case 'R': + s = strptime(s, "%H:%M", tm); + if (!s) return 0; + break; + case 'S': + dest = &tm->tm_sec; + min = 0; + range = 61; + goto numeric_range; + case 'T': + s = strptime(s, "%H:%M:%S", tm); + if (!s) return 0; + break; + case 'U': + case 'W': + /* Throw away result, for now. (FIXME?) */ + dest = &dummy; + min = 0; + range = 54; + goto numeric_range; + case 'w': + dest = &tm->tm_wday; + min = 0; + range = 7; + goto numeric_range; + case 'x': + s = strptime(s, nl_langinfo(D_FMT), tm); + if (!s) return 0; + break; + case 'X': + s = strptime(s, nl_langinfo(T_FMT), tm); + if (!s) return 0; + break; + case 'y': + dest = &tm->tm_year; + w = 2; + want_century |= 1; + goto numeric_digits; + case 'Y': + dest = &tm->tm_year; + if (w<0) w=4; + adj = 1900; + want_century = 0; + goto numeric_digits; + case '%': + if (*s++ != '%') return 0; + break; + default: + return 0; + numeric_range: + if (!isdigit(*s)) return 0; + *dest = 0; + for (i=1; i<=min+range && isdigit(*s); i*=10) + *dest = *dest * 10 + *s++ - '0'; + if (*dest - min >= (unsigned)range) return 0; + *dest -= adj; + switch((char *)dest - (char *)tm) { + case offsetof(struct tm, tm_yday): + ; + } + goto update; + numeric_digits: + neg = 0; + if (*s == '+') s++; + else if (*s == '-') neg=1, s++; + if (!isdigit(*s)) return 0; + for (*dest=i=0; i=0; i--) { + ex = nl_langinfo(min+i); + len = strlen(ex); + if (strncasecmp(s, ex, len)) continue; + s += len; + *dest = i % range; + break; + } + if (i<0) return 0; + goto update; + update: + //FIXME + ; + } + } + if (want_century) { + if (want_century & 2) tm->tm_year += century * 100 - 1900; + else if (tm->tm_year <= 68) tm->tm_year += 100; + } + return (char *)s; +} diff --git a/cores/common/base/wraps/putchar.c b/cores/common/base/wraps/putchar.c new file mode 100644 index 000000000..5c1499d7e --- /dev/null +++ b/cores/common/base/wraps/putchar.c @@ -0,0 +1,9 @@ +// https://github.com/embeddedartistry/libc/blob/master/src/stdio/putchar.c + +#include +#include + +int __wrap_putchar(int c) { + putchar_((char)c); + return c; +} diff --git a/cores/common/base/wraps/puts.c b/cores/common/base/wraps/puts.c new file mode 100644 index 000000000..e04f05035 --- /dev/null +++ b/cores/common/base/wraps/puts.c @@ -0,0 +1,21 @@ +// https://github.com/embeddedartistry/libc/blob/master/src/stdio/puts.c + +#include +#include + +int __wrap_puts(const char *str) { + int r = 0; + + for (const char *c = str; *c != 0; c++) { + putchar_((int)*c); + r++; + } + + // puts adds a newline + if (r) { + putchar_('\n'); + r++; + } + + return r ? r : EOF; +} diff --git a/cores/realtek-amb/arduino/libraries/SoftwareSerial/SoftwareSerial.cpp b/cores/realtek-amb/arduino/libraries/SoftwareSerial/SoftwareSerial.cpp new file mode 100644 index 000000000..1176126a5 --- /dev/null +++ b/cores/realtek-amb/arduino/libraries/SoftwareSerial/SoftwareSerial.cpp @@ -0,0 +1,100 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-07-03. */ + +#if LT_RTL8710B + +#include +#include + +#define TIMER_MAX 3 +#define OBJ ((gtimer_t *)this->param) + +static uint32_t timNum[TIMER_MAX] = {TIMER1, TIMER2, TIMER3}; +static gtimer_t *timObj[TIMER_MAX] = {NULL, NULL, NULL}; + +static void callback(SoftSerial *data) { + SoftData *tx = &data->tx; + + switch (tx->state) { + case SS_IDLE: + goto finish; + + case SS_END: + case SS_START: + if (!tx->buf->available()) + goto finish; + tx->byte = tx->buf->read_char(); + digitalWrite(tx->pin, LOW); + tx->state = SS_DATA0; + return; + + case SS_STOP: + digitalWrite(tx->pin, HIGH); + break; + + default: + digitalWrite(tx->pin, (tx->byte & 0x1) ^ data->invert); + tx->byte /= 2; + break; + } + + tx->state = (SoftState)(tx->state + 1); + return; + +finish: + gtimer_stop((gtimer_t *)data->param); + data->tx.state = SS_IDLE; + return; +} + +void SoftwareSerial::begin(unsigned long baudrate, uint16_t config) { + if (data.rx.buf || data.tx.buf) + return; + + uint8_t i; + for (i = 0; i < TIMER_MAX; i++) { + if (timObj[i] == NULL) + break; + } + if (i == TIMER_MAX) { + LT_E("No more timers for SoftwareSerial"); + return; + } + + pinMode(data.tx.pin, OUTPUT); + digitalWrite(data.tx.pin, HIGH); + + data.rx.buf = new RingBuffer(); + data.tx.buf = new RingBuffer(); + data.rx.state = SS_IDLE; + data.tx.state = SS_IDLE; + + uint32_t us = 1E6 / baudrate; + + timObj[i] = (gtimer_t *)malloc(sizeof(gtimer_t)); + param = data.param = data.tx.param = timObj[i]; + gtimer_init(OBJ, timNum[i]); + OBJ->is_periodcal = true; + OBJ->handler = (void *)callback; + OBJ->hid = (uint32_t)&data; + gtimer_reload(OBJ, us); +} + +void SoftwareSerial::end() { + if (!(bool)this) + return; + gtimer_stop(OBJ); + gtimer_deinit(OBJ); + free(OBJ); + delete data.rx.buf; + delete data.tx.buf; +} + +void SoftwareSerial::startTx() { + gtimer_start(OBJ); +} + +void SoftwareSerial::endTx() { + gtimer_stop(OBJ); +} + +#endif diff --git a/cores/realtek-amb/arduino/libraries/WiFi/WiFi.cpp b/cores/realtek-amb/arduino/libraries/WiFi/WiFi.cpp new file mode 100644 index 000000000..8a9514efc --- /dev/null +++ b/cores/realtek-amb/arduino/libraries/WiFi/WiFi.cpp @@ -0,0 +1,36 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-25. */ + +#include "WiFiPrivate.h" + +rtw_wifi_setting_t wifi_setting; + +WiFiClass::WiFiClass() { + data = (WiFiData *)calloc(1, sizeof(WiFiData)); + + DATA->scanSem = xSemaphoreCreateBinary(); +} + +WiFiClass::~WiFiClass() { + vSemaphoreDelete(DATA->scanSem); + free(data); + data = NULL; +} + +WiFiAuthMode securityTypeToAuthMode(uint8_t type) { + // the value reported in rtw_scan_result is rtw_encryption_t, even though it's rtw_security_t in the header file + switch (type) { + case RTW_ENCRYPTION_OPEN: + return WIFI_AUTH_OPEN; + case RTW_ENCRYPTION_WEP40: + case RTW_ENCRYPTION_WEP104: + return WIFI_AUTH_WEP; + case RTW_ENCRYPTION_WPA_TKIP: + case RTW_ENCRYPTION_WPA_AES: + return WIFI_AUTH_WPA_PSK; + case RTW_ENCRYPTION_WPA2_TKIP: + case RTW_ENCRYPTION_WPA2_AES: + case RTW_ENCRYPTION_WPA2_MIXED: + return WIFI_AUTH_WPA2_PSK; + } + return WIFI_AUTH_INVALID; +} diff --git a/cores/realtek-amb/arduino/libraries/WiFi/WiFiAP.cpp b/cores/realtek-amb/arduino/libraries/WiFi/WiFiAP.cpp new file mode 100644 index 000000000..871d60a71 --- /dev/null +++ b/cores/realtek-amb/arduino/libraries/WiFi/WiFiAP.cpp @@ -0,0 +1,148 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-25. */ + +#include "WiFiPrivate.h" + +typedef struct { + int count; + rtw_mac_t mac_list[AP_STA_NUM]; +} client_info_t; + +bool WiFiClass::softAP(const char *ssid, const char *passphrase, int channel, bool ssidHidden, int maxClients) { + if (!enableAP(true)) + return WL_CONNECT_FAILED; + if (!validate(ssid, passphrase)) + return WL_CONNECT_FAILED; + + LT_HEAP_I(); + vTaskDelay(20); + + WiFiNetworkInfo &info = DATA->ap; + if (info.ssid != ssid) + // free network info, if not called from restoreAPConfig() + resetNetworkInfo(info); + + if (info.ssid != ssid) + info.ssid = strdup(ssid); + info.ssidHidden = ssidHidden; + info.channel = channel; + info.auth = RTW_SECURITY_OPEN; + + if (passphrase) { + if (info.password != passphrase) + info.password = strdup(passphrase); + info.auth = RTW_SECURITY_WPA2_AES_PSK; + } + + dhcps_deinit(); + + LT_IM(WIFI, "Creating SoftAP %s", ssid); + + int ret; + if (!ssidHidden) { + ret = wifi_start_ap( + info.ssid, + (rtw_security_t)info.auth, + info.password, + strlen(info.ssid), + strlen(info.password), + info.channel + ); + } else { + ret = wifi_start_ap_with_hidden_ssid( + info.ssid, + (rtw_security_t)info.auth, + info.password, + strlen(info.ssid), + strlen(info.password), + info.channel + ); + } + + if (ret < 0) { + LT_EM(WIFI, "SoftAP failed; ret=%d", ret); + return false; + } + + uint8_t timeout = 20; + unsigned char essid[33]; + + const char *ifname = NETNAME_AP; + struct netif *ifs = NETIF_RTW_AP; + + while (1) { + if (wext_get_ssid(ifname, essid) > 0) { + if (strcmp((const char *)essid, info.ssid) == 0) + break; + } + + if (!timeout) + return false; + + vTaskDelay(1 * configTICK_RATE_HZ); + timeout--; + } + + wifi_indication(WIFI_EVENT_CONNECT, NULL, ARDUINO_EVENT_WIFI_AP_START, -2); + + dhcps_init(ifs); + dns_server_deinit(); + return true; +} + +bool WiFiClass::softAPConfig(IPAddress localIP, IPAddress gateway, IPAddress subnet) { + if (!enableAP(true)) + return false; + WiFiNetworkInfo &info = DATA->ap; + struct netif *ifs = NETIF_RTW_AP; + struct ip_addr ipaddr, netmask, gw; + ipaddr.addr = info.localIP = localIP; + netmask.addr = info.subnet = subnet; + gw.addr = info.gateway = gateway; + netif_set_addr(ifs, &ipaddr, &netmask, &gw); + return true; +} + +bool WiFiClass::softAPdisconnect(bool wifiOff) { + return enableAP(false); +} + +uint8_t WiFiClass::softAPgetStationNum() { + // the struct is at wifi_conf.c:2576 + client_info_t info; + info.count = AP_STA_NUM; + wifi_get_associated_client_list(&info, sizeof(info)); + return info.count; +} + +IPAddress WiFiClass::softAPIP() { + return netif_ip_addr4(NETIF_RTW_AP)->addr; +} + +IPAddress WiFiClass::softAPSubnetMask() { + return netif_ip_netmask4(NETIF_RTW_AP)->addr; +} + +const char *WiFiClass::softAPgetHostname() { + return netif_get_hostname(NETIF_RTW_AP); +} + +bool WiFiClass::softAPsetHostname(const char *hostname) { + netif_set_hostname(NETIF_RTW_AP, (char *)hostname); + return true; +} + +uint8_t *WiFiClass::softAPmacAddress(uint8_t *mac) { + memcpy(mac, NETIF_RTW_AP->hwaddr, ETH_ALEN); + return mac; +} + +String WiFiClass::softAPmacAddress(void) { + uint8_t mac[ETH_ALEN]; + softAPmacAddress(mac); + return macToString(mac); +} + +const String WiFiClass::softAPSSID(void) { + wext_get_ssid(NETNAME_AP, wifi_setting.ssid); + return (char *)wifi_setting.ssid; +} diff --git a/cores/realtek-amb/arduino/libraries/WiFi/WiFiEvents.cpp b/cores/realtek-amb/arduino/libraries/WiFi/WiFiEvents.cpp new file mode 100644 index 000000000..b0c5263dd --- /dev/null +++ b/cores/realtek-amb/arduino/libraries/WiFi/WiFiEvents.cpp @@ -0,0 +1,208 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-05-16. */ + +#include "WiFiPrivate.h" + +#include + +#define WIFI_EVENT_MAX_ROW 3 + +static xQueueHandle wifiEventQueueHandle = NULL; +static xTaskHandle wifiEventTaskHandle = NULL; + +// C code to support SDK-defined events (in wifi_conf.c) +extern "C" { +// SDK events +static event_list_elem_t event_callback_list[WIFI_EVENT_MAX][WIFI_EVENT_MAX_ROW]; + +typedef struct { + rtw_event_indicate_t event; + char *buf; + int buf_len; + int flags; +} rtw_event_t; + +// reset callbacks +void init_event_callback_list() { + memset(event_callback_list, 0, sizeof(event_callback_list)); +} + +// dummy +int wifi_manager_init() { + return 0; +} + +void wifi_reg_event_handler(unsigned int event_cmds, rtw_event_handler_t handler_func, void *handler_user_data) { + int i = 0, j = 0; + if (event_cmds < WIFI_EVENT_MAX) { + for (i = 0; i < WIFI_EVENT_MAX_ROW; i++) { + if (event_callback_list[event_cmds][i].handler == NULL) { + for (j = 0; j < WIFI_EVENT_MAX_ROW; j++) { + if (event_callback_list[event_cmds][j].handler == handler_func) { + return; + } + } + event_callback_list[event_cmds][i].handler = handler_func; + event_callback_list[event_cmds][i].handler_user_data = handler_user_data; + return; + } + } + } +} + +void wifi_unreg_event_handler(unsigned int event_cmds, rtw_event_handler_t handler_func) { + int i; + if (event_cmds < WIFI_EVENT_MAX) { + for (i = 0; i < WIFI_EVENT_MAX_ROW; i++) { + if (event_callback_list[event_cmds][i].handler == handler_func) { + event_callback_list[event_cmds][i].handler = NULL; + event_callback_list[event_cmds][i].handler_user_data = NULL; + return; + } + } + } +} +} // extern "C" + +// TODO queue handling is apparently done all wrong here +// (passing pointers to pointers in xQueueSend/xQueueReceive) + +// function called by wext_wlan_indicate +void wifi_indication(rtw_event_indicate_t event, char *buf, int buf_len, int flags) { + if (event >= WIFI_EVENT_MAX) + return; + if (wifiEventQueueHandle && wifiEventTaskHandle) { + rtw_event_t *ev = (rtw_event_t *)malloc(sizeof(rtw_event_t)); + if (buf_len > 0) { + // copy data to allow freeing from calling scopes + char *bufCopy = (char *)malloc(buf_len); + memcpy(bufCopy, buf, buf_len); + ev->buf = bufCopy; + } else { + ev->buf = NULL; + } + ev->event = event; + ev->buf_len = buf_len; + ev->flags = flags; + xQueueSend(wifiEventQueueHandle, &ev, portMAX_DELAY); + } else { + handleRtwEvent(event, buf, buf_len, flags); + } +} + +static void wifiEventTask(void *arg) { + rtw_event_t *data = NULL; + for (;;) { + if (xQueueReceive(wifiEventQueueHandle, &data, portMAX_DELAY) == pdTRUE) { + handleRtwEvent(data->event, data->buf, data->buf_len, data->flags); + if (data->buf) { + // free memory allocated in wifi_indication + free(data->buf); + } + free(data); + } + } +} + +void startWifiTask() { + if (!wifiEventQueueHandle) { + LT_HEAP_I(); + wifiEventQueueHandle = xQueueCreate(32, sizeof(rtw_event_t *)); + LT_HEAP_I(); + } + if (!wifiEventTaskHandle) { + LT_HEAP_I(); + xTaskCreate(wifiEventTask, "wifievent", 512, NULL, 4, &wifiEventTaskHandle); + LT_HEAP_I(); + } +} + +void handleRtwEvent(uint16_t event, char *data, int len, int flags) { + if (!pWiFi) + return; // failsafe + if (flags == -2) { + // already an Arduino event, just pass it + EventId eventId = (EventId)len; + EventInfo *eventInfo = (EventInfo *)data; + pWiFi->postEvent(eventId, *eventInfo); + free(eventInfo); + return; + } + + // send to SDK listeners + for (uint8_t i = 0; i < WIFI_EVENT_MAX_ROW; i++) { + rtw_event_handler_t handler = event_callback_list[event][i].handler; + if (!handler) + continue; + handler(data, len, flags, event_callback_list[event][i].handler_user_data); + } + + if (pWiFi == NULL) + return; + + EventId eventId; + EventInfo eventInfo; + String ssid; + + memset(&eventInfo, 0, sizeof(EventInfo)); + + switch (event) { + case WIFI_EVENT_DISCONNECT: + case WIFI_EVENT_RECONNECTION_FAIL: + eventId = ARDUINO_EVENT_WIFI_STA_DISCONNECTED; + eventInfo.wifi_sta_disconnected.ssid_len = 0; + eventInfo.wifi_sta_disconnected.reason = WIFI_REASON_UNSPECIFIED; + if (event == WIFI_EVENT_RECONNECTION_FAIL) + eventInfo.wifi_sta_disconnected.reason = WIFI_REASON_CONNECTION_FAIL; + break; + + case WIFI_EVENT_FOURWAY_HANDSHAKE_DONE: + eventId = ARDUINO_EVENT_WIFI_STA_CONNECTED; + ssid = pWiFi->SSID(); + eventInfo.wifi_sta_connected.ssid_len = ssid.length(); + eventInfo.wifi_sta_connected.channel = pWiFi->channel(); + eventInfo.wifi_sta_connected.authmode = pWiFi->getEncryption(); + memcpy(eventInfo.wifi_sta_connected.ssid, ssid.c_str(), eventInfo.wifi_sta_connected.ssid_len + 1); + memcpy(eventInfo.wifi_sta_connected.bssid, pWiFi->BSSID(), 6); + break; + + case WIFI_EVENT_SCAN_DONE: + eventId = ARDUINO_EVENT_WIFI_SCAN_DONE; + eventInfo.wifi_scan_done.status = 0; + if (pWiFi->scan) + eventInfo.wifi_scan_done.number = pWiFi->scan->count; + eventInfo.wifi_scan_done.scan_id = 0; + break; + + case WIFI_EVENT_STA_ASSOC: + // data(124) has MAC at 0x0A + if (len != 124) + return; + eventId = ARDUINO_EVENT_WIFI_AP_STACONNECTED; + memcpy(eventInfo.wifi_ap_staconnected.mac, (const char *)data + 10, 6); + break; + + case WIFI_EVENT_STA_DISASSOC: + // data(6) is MAC + eventId = ARDUINO_EVENT_WIFI_AP_STADISCONNECTED; + memcpy(eventInfo.wifi_ap_stadisconnected.mac, (const char *)data, 6); + break; + + // case WIFI_EVENT_CONNECT: + // case WIFI_EVENT_SCAN_RESULT_REPORT: + // case WIFI_EVENT_SEND_ACTION_DONE: + // case WIFI_EVENT_RX_MGNT: + // case WIFI_EVENT_STA_WPS_START: + // case WIFI_EVENT_WPS_FINISH: + // case WIFI_EVENT_EAPOL_START: + // case WIFI_EVENT_EAPOL_RECVD: + // case WIFI_EVENT_NO_NETWORK: + // case WIFI_EVENT_BEACON_AFTER_DHCP: + // case WIFI_EVENT_IP_CHANGED: + // case WIFI_EVENT_ICV_ERROR: + // case WIFI_EVENT_CHALLENGE_FAIL: + default: + return; + } + + pWiFi->postEvent(eventId, eventInfo); +} diff --git a/cores/realtek-amb/arduino/libraries/WiFi/WiFiGeneric.cpp b/cores/realtek-amb/arduino/libraries/WiFi/WiFiGeneric.cpp new file mode 100644 index 000000000..8448e1beb --- /dev/null +++ b/cores/realtek-amb/arduino/libraries/WiFi/WiFiGeneric.cpp @@ -0,0 +1,234 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-25. */ + +#include "WiFiPrivate.h" + +int32_t WiFiClass::channel() { + int channel = 0; + wifi_get_channel(&channel); + return channel; +} + +bool WiFiClass::modePriv(WiFiMode mode, WiFiModeAction sta, WiFiModeAction ap) { + DIAG_PRINTF_DISABLE(); + startWifiTask(); + + if (!DATA->initialized) { + // initialize wifi first + LT_IM(WIFI, "Initializing LwIP"); + LwIP_Init(); + DATA->initialized = true; + } + LT_HEAP_I(); + WiFiMode currentMode = getMode(); + WiFiNetworkInfo &staInfo = DATA->sta; + WiFiNetworkInfo &apInfo = DATA->ap; + bool reenableSTA = false; + bool reenableAP = false; + + if (mode == WIFI_MODE_APSTA) { + if (currentMode == WIFI_MODE_STA) { + // adding AP mode doesn't seem to work fine: + // - STA -> AP+STA + LT_DM(WIFI, "STA was enabled: %s", staInfo.ssid); + reenableSTA = true; + } + if (currentMode == WIFI_MODE_AP) { + // restart AP mode later, as wifi has to be stopped first: + // - AP -> AP+STA + LT_DM(WIFI, "AP was enabled: %s", apInfo.ssid); + reenableAP = true; + } + } + + if (reenableSTA || reenableAP || mode == WIFI_MODE_NULL || currentMode == WIFI_MODE_AP || + currentMode && mode == WIFI_MODE_AP) { + // must stop wifi first: + // - STA -> NULL + // - STA -> AP + // - STA -> AP+STA + // - AP -> NULL + // - AP -> STA + // - AP -> AP+STA + // - AP+STA -> NULL + // - AP+STA -> AP + LT_DM(WIFI, "Stopping WiFi to change mode"); + if (wifi_off() != RTW_SUCCESS) { + LT_EM(WIFI, "Error while changing mode(%u)", mode); + goto error; + } + rltk_wlan_deinit_fastly(); + rltk_wlan_rf_off(); + init_event_callback_list(); + vTaskDelay(20); + currentMode = getMode(); + } + + if (currentMode == WIFI_MODE_NULL && mode != WIFI_MODE_NULL) { + // wifi is not running, enable it the usual way: + // - NULL -> STA + // - NULL -> AP + // - NULL -> AP+STA + if (wifi_on((rtw_mode_t)mode) != RTW_SUCCESS) { + LT_EM(WIFI, "Error while changing mode(%u)", mode); + goto error; + } + } else { + // just enable/disable wlan1: + // - STA -> AP+STA - unused (wifi reset required) + // - AP+STA -> STA + wifi_mode = mode; + /* if (ap == WLMODE_ENABLE) { + LT_DM(WIFI, "Mode: %s ENABLE", WLAN1_NAME); + rltk_wlan_init(WLAN1_IDX, RTW_MODE_AP); + rltk_wlan_start(WLAN1_IDX); + uint32_t timeout = 20; + while (1) { + if (rltk_wlan_running(WLAN1_IDX)) { + wifi_set_country_code(); + break; + } + if (timeout == 0) { + LT_EM(WIFI, "Error while changing mode(%u)", mode); + goto error; + } + vTaskDelay(1 * configTICK_RATE_HZ); + timeout--; + } + netif_set_up(WLAN1_NETIF); + netif_set_link_up(WLAN1_NETIF); + } */ + if (ap == WLMODE_DISABLE) { + LT_DM(WIFI, "Mode: %s DISABLE", WLAN1_NAME); + netif_set_link_down(WLAN1_NETIF); + netif_set_down(WLAN1_NETIF); +#if !LT_RTL8720C + rltk_stop_softap(WLAN1_NAME); +#else + rltk_suspend_softap(WLAN1_NAME); +#endif + rltk_wlan_init(WLAN1_IDX, RTW_MODE_NONE); + wext_set_mode(WLAN1_NAME, IW_MODE_INFRA); + } + vTaskDelay(50); + } + + if (mode & WIFI_MODE_AP) { + // indicate that the interface is an AP + // use NETNAME_AP to retrieve the actual iface name (wlan0/wlan1) + // (this is determined by STA bit being set in wifi_mode) + wext_set_mode(NETNAME_AP, IW_MODE_MASTER); + } + + if (sta == WLMODE_DISABLE) { + // mark that STA mode has been disabled manually + free(staInfo.ssid); + staInfo.ssid = NULL; + } + if (ap == WLMODE_DISABLE) { + // mark that AP mode has been disabled manually + free(apInfo.ssid); + apInfo.ssid = NULL; + } + + // force checking WiFi mode again (which will update wifi_mode) + getMode(); + + if (reenableSTA) { + // restart STA mode from previously used config (if set) + if (!restoreSTAConfig(staInfo)) + LT_EM(WIFI, "Couldn't restore STA mode: %s", staInfo.ssid); + } + if (reenableAP) { + // restart AP mode from previously used config (if set) + if (!restoreAPConfig(apInfo)) + LT_EM(WIFI, "Couldn't restore AP mode: %s", apInfo.ssid); + } + + // send STA start/stop events and AP stop event (start is handled in softAP()) + if (sta == WLMODE_ENABLE) { + wifi_indication(WIFI_EVENT_CONNECT, NULL, ARDUINO_EVENT_WIFI_STA_START, -2); + } else if (sta == WLMODE_DISABLE) { + wifi_indication(WIFI_EVENT_CONNECT, NULL, ARDUINO_EVENT_WIFI_STA_STOP, -2); + } + if (ap == WLMODE_DISABLE) { + wifi_indication(WIFI_EVENT_CONNECT, NULL, ARDUINO_EVENT_WIFI_AP_STOP, -2); + } + + LT_HEAP_I(); + DIAG_PRINTF_ENABLE(); + return true; + +error: + DIAG_PRINTF_ENABLE(); + return false; +} + +WiFiMode WiFiClass::getMode() { + if (!DATA->initialized) + return WIFI_MODE_NULL; + uint8_t wlan0_state = rltk_wlan_running(WLAN0_IDX); + uint8_t wlan1_state = rltk_wlan_running(WLAN1_IDX); + wifi_mode = (wifi_mode_t)wlan0_state; + + LT_DM(WIFI, "WLAN: %s=%u, %s=%u", WLAN0_NAME, wlan0_state, WLAN1_NAME, wlan1_state); + + if (wlan1_state) { + if (netif_is_up(WLAN1_NETIF)) + wifi_mode = (wifi_mode_t)(WIFI_MODE_AP | wlan0_state); + } else { + wifi_mode = (wifi_mode_t)(wlan0_state); + int mode = 0; + // check wlan0 mode to determine if it's an AP + if (wlan0_state) + wext_get_mode(WLAN0_NAME, &mode); + if (mode == IW_MODE_MASTER) + wifi_mode = (wifi_mode_t)(wifi_mode << 1); + } + + return wifi_mode; +} + +WiFiStatus WiFiClass::status() { + if (rltk_wlan_is_connected_to_ap() == 0) { + return WL_CONNECTED; + } else { + return WL_DISCONNECTED; + } +} + +bool WiFiClass::setSleep(bool enable) { + LT_DM(WIFI, "WiFi sleep mode %u", enable); + if (enable) { + if (wifi_enable_powersave() != RTW_SUCCESS) + return false; + } else { + if (wifi_disable_powersave() != RTW_SUCCESS) + return false; + } + DATA->sleep = enable; + return true; +} + +bool WiFiClass::getSleep() { + return DATA->sleep; +} + +bool WiFiClass::setTxPower(int power) { + return false; // wifi_set_txpower(power) == RTW_SUCCESS; +} + +int WiFiClass::getTxPower() { + return 0; + int power = 0; + wifi_get_txpower(&power); + return power; +} + +IPAddress WiFiClass::hostByName(const char *hostname) { + ip_addr_t ip; + int ret = netconn_gethostbyname(hostname, &ip); + if (ret == ERR_OK) { + return ip.addr; + } + return IPAddress(); +} diff --git a/cores/realtek-amb/arduino/libraries/WiFi/WiFiPrivate.h b/cores/realtek-amb/arduino/libraries/WiFi/WiFiPrivate.h new file mode 100644 index 000000000..99745a259 --- /dev/null +++ b/cores/realtek-amb/arduino/libraries/WiFi/WiFiPrivate.h @@ -0,0 +1,99 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-25. */ + +#pragma once + +#include +#include + +extern "C" { + +// copy defines from PIO builder (for IDE to understand) +#define LWIP_TIMEVAL_PRIVATE 0 +#define LWIP_NETIF_HOSTNAME 1 +#define LWIP_SO_RCVBUF 1 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +extern struct netif xnetif[NET_IF_NUM]; + +// dhcps.c +extern void dns_server_init(struct netif *pnetif); +extern void dns_server_deinit(void); + +// wifi_util.c +#if !LT_RTL8720C +extern void rltk_stop_softap(const char *ifname); +#endif +extern void rltk_suspend_softap(const char *ifname); +extern void rltk_suspend_softap_beacon(const char *ifname); + +} // extern "C" + +// WiFi.cpp +extern rtw_wifi_setting_t wifi_setting; +extern wifi_mode_t wifi_mode; +extern WiFiAuthMode securityTypeToAuthMode(uint8_t type); +// WiFiEvents.cpp +extern void startWifiTask(); +extern void handleRtwEvent(uint16_t event, char *data, int len, int flags); + +#define WLAN0_NETIF &xnetif[RTW_STA_INTERFACE] +#define WLAN1_NETIF &xnetif[RTW_AP_INTERFACE] + +#define NETIF_RTW_STA WLAN0_NETIF +#define NETIF_RTW_AP (wifi_mode & WIFI_MODE_STA ? WLAN1_NETIF : WLAN0_NETIF) + +#define NETNAME_STA WLAN0_NAME +#define NETNAME_AP (wifi_mode & WIFI_MODE_STA ? WLAN1_NAME : WLAN0_NAME) + +typedef struct { + bool initialized; + bool sleep; + SemaphoreHandle_t scanSem; + WiFiNetworkInfo sta; + WiFiNetworkInfo ap; +} WiFiData; + +#define DATA ((WiFiData *)data) +#define pDATA ((WiFiData *)pWiFi->data) +#define cDATA ((WiFiData *)cls->data) + +#if LT_RTL8710B // Realtek AmebaZ +#define DIAG_PRINTF_ENABLE() \ + do { \ + __wrap_rtl_printf_enable(); \ + __wrap_DiagPrintf_enable(); \ + } while (0); +#define DIAG_PRINTF_DISABLE() \ + do { \ + __wrap_rtl_printf_disable(); \ + __wrap_DiagPrintf_disable(); \ + } while (0); + +#elif LT_RTL8720C // Realtek AmebaZ2 +#define DIAG_PRINTF_ENABLE() \ + do { \ + __wrap_rt_printf_enable(); \ + __wrap_rt_log_printf_enable(); \ + } while (0); +#define DIAG_PRINTF_DISABLE() \ + do { \ + __wrap_rt_printf_disable(); \ + __wrap_rt_log_printf_disable(); \ + } while (0); + +#else +#define DIAG_PRINTF_ENABLE() +#define DIAG_PRINTF_DISABLE() + +#endif diff --git a/cores/realtek-amb/arduino/libraries/WiFi/WiFiSTA.cpp b/cores/realtek-amb/arduino/libraries/WiFi/WiFiSTA.cpp new file mode 100644 index 000000000..f5164cec7 --- /dev/null +++ b/cores/realtek-amb/arduino/libraries/WiFi/WiFiSTA.cpp @@ -0,0 +1,224 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-25. */ + +#include "WiFiPrivate.h" + +WiFiStatus +WiFiClass::begin(const char *ssid, const char *passphrase, int32_t channel, const uint8_t *bssid, bool connect) { + if (!enableSTA(true)) + return WL_CONNECT_FAILED; + if (!validate(ssid, passphrase)) + return WL_CONNECT_FAILED; + + LT_HEAP_I(); + + WiFiNetworkInfo &info = DATA->sta; + if (info.ssid != ssid) + // free network info, if not called from restoreSTAConfig() + resetNetworkInfo(info); + + if (info.ssid != ssid) + info.ssid = strdup(ssid); + info.channel = channel; + info.auth = RTW_SECURITY_OPEN; + + if (passphrase) { + if (info.password != passphrase) + info.password = strdup(passphrase); + info.auth = RTW_SECURITY_WPA2_AES_PSK; + } + + if (reconnect(bssid)) + return WL_CONNECTED; + else + return WL_CONNECT_FAILED; +} + +bool WiFiClass::config(IPAddress localIP, IPAddress gateway, IPAddress subnet, IPAddress dns1, IPAddress dns2) { + if (!enableSTA(true)) + return false; + WiFiNetworkInfo &info = DATA->sta; + + struct ip_addr d1, d2; + d1.addr = info.dns1 = dns1; + d2.addr = info.dns2 = dns2; + if (d1.addr) + dns_setserver(0, &d1); + if (d2.addr) + dns_setserver(0, &d2); + + if (!localIP[0]) { + info.localIP = 0; + LwIP_DHCP(0, DHCP_START); + return true; + } + struct netif *ifs = NETIF_RTW_STA; + struct ip_addr ipaddr, netmask, gw; + ipaddr.addr = info.localIP = localIP; + netmask.addr = info.subnet = subnet; + gw.addr = info.gateway = gateway; + netif_set_addr(ifs, &ipaddr, &netmask, &gw); + LwIP_DHCP(0, DHCP_STOP); + return true; +} + +bool WiFiClass::reconnect(const uint8_t *bssid) { + int ret; + uint8_t dhcpRet; + WiFiNetworkInfo &info = DATA->sta; + + LT_IM(WIFI, "Connecting to %s (bssid=%p)", info.ssid, bssid); + DIAG_PRINTF_DISABLE(); + + wext_set_ssid(WLAN0_NAME, (uint8_t *)"-", 1); + + if (!bssid) { + ret = wifi_connect( + info.ssid, + (rtw_security_t)info.auth, + info.password, + strlen(info.ssid), + strlen(info.password), + -1, + NULL + ); + } else { + if (info.bssid != bssid) { + free(info.bssid); + info.bssid = (uint8_t *)malloc(ETH_ALEN); + memcpy(info.bssid, bssid, ETH_ALEN); + } + ret = wifi_connect_bssid( + (unsigned char *)bssid, + info.ssid, + (rtw_security_t)info.auth, + info.password, + ETH_ALEN, + strlen(info.ssid), + strlen(info.password), + -1, + NULL + ); + } + + if (ret == RTW_SUCCESS) { + dhcpRet = LwIP_DHCP(0, DHCP_START); + if (dhcpRet == DHCP_ADDRESS_ASSIGNED) { + LT_HEAP_I(); + EventInfo *eventInfo = (EventInfo *)calloc(1, sizeof(EventInfo)); + eventInfo->got_ip.if_index = 0; + eventInfo->got_ip.esp_netif = NULL; + eventInfo->got_ip.ip_info.ip.addr = localIP(); + eventInfo->got_ip.ip_info.gw.addr = gatewayIP(); + eventInfo->got_ip.ip_info.netmask.addr = subnetMask(); + eventInfo->got_ip.ip_changed = true; + // pass the event through the queue + wifi_indication(WIFI_EVENT_CONNECT, (char *)eventInfo, ARDUINO_EVENT_WIFI_STA_GOT_IP, -2); + // free memory as wifi_indication creates a copy + free(eventInfo); + DIAG_PRINTF_ENABLE(); + return true; + } + LT_EM(WIFI, "DHCP failed; dhcpRet=%d", dhcpRet); + wifi_disconnect(); + goto error; + } + LT_EM(WIFI, "Connection failed; ret=%d", ret); +error: + DIAG_PRINTF_ENABLE(); + return false; +} + +bool WiFiClass::disconnect(bool wifiOff) { + free(DATA->sta.ssid); + DATA->sta.ssid = NULL; + int ret = wifi_disconnect(); + if (wifiOff) + enableSTA(false); + return ret == RTW_SUCCESS; +} + +bool WiFiClass::setAutoReconnect(bool autoReconnect) { + return wifi_set_autoreconnect(autoReconnect) == RTW_SUCCESS; +} + +bool WiFiClass::getAutoReconnect() { + bool autoReconnect; + wifi_get_autoreconnect((uint8_t *)&autoReconnect); + return autoReconnect; +} + +IPAddress WiFiClass::localIP() { + if (!wifi_mode) + return IPAddress(); + return netif_ip_addr4(NETIF_RTW_STA)->addr; +} + +uint8_t *WiFiClass::macAddress(uint8_t *mac) { + if ((getMode() & WIFI_MODE_STA) == 0) { + lt_get_device_mac(mac); + return mac; + } + memcpy(mac, NETIF_RTW_STA.hwaddr, ETH_ALEN); + return mac; +} + +IPAddress WiFiClass::subnetMask() { + return netif_ip_netmask4(NETIF_RTW_STA)->addr; +} + +IPAddress WiFiClass::gatewayIP() { + return netif_ip_gw4(NETIF_RTW_STA)->addr; +} + +IPAddress WiFiClass::dnsIP(uint8_t dns_no) { + return dns_getserver(0)->addr; +} + +IPAddress WiFiClass::broadcastIP() { + return LwIP_GetBC(NETIF_RTW_STA); +} + +const char *WiFiClass::getHostname() { + return netif_get_hostname(NETIF_RTW_STA); +} + +bool WiFiClass::setHostname(const char *hostname) { + netif_set_hostname(NETIF_RTW_STA, (char *)hostname); + return true; +} + +bool WiFiClass::setMacAddress(const uint8_t *mac) { + return wifi_set_mac_address((char *)mac) == RTW_SUCCESS; +} + +const String WiFiClass::SSID() { + if (!isConnected()) + return ""; + wifi_get_setting(NETNAME_STA, &wifi_setting); + return (char *)wifi_setting.ssid; +} + +const String WiFiClass::psk() { + if (!isConnected() || !DATA->sta.password) + return ""; + return DATA->sta.password; +} + +uint8_t *WiFiClass::BSSID() { + WiFiNetworkInfo &info = DATA->sta; + if (!info.bssid) + info.bssid = (uint8_t *)malloc(ETH_ALEN); + wext_get_bssid(NETNAME_STA, info.bssid); + return info.bssid; +} + +int8_t WiFiClass::RSSI() { + int rssi = 0; + wifi_get_rssi(&rssi); + return rssi; +} + +WiFiAuthMode WiFiClass::getEncryption() { + wifi_get_setting(NETNAME_STA, &wifi_setting); + return securityTypeToAuthMode(wifi_setting.security_type); +} diff --git a/cores/realtek-amb/arduino/libraries/WiFi/WiFiScan.cpp b/cores/realtek-amb/arduino/libraries/WiFi/WiFiScan.cpp new file mode 100644 index 000000000..52d1cdafc --- /dev/null +++ b/cores/realtek-amb/arduino/libraries/WiFi/WiFiScan.cpp @@ -0,0 +1,60 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-25. */ + +#include "WiFiPrivate.h" + +static rtw_result_t scanHandler(rtw_scan_handler_result_t *result) { + WiFiClass *cls = (WiFiClass *)result->user_data; + WiFiScanData *scan = cls->scan; + if (!scan) + return RTW_SUCCESS; + + if (result->scan_complete == RTW_TRUE) { + scan->running = false; + xSemaphoreGive(cDATA->scanSem); + return RTW_SUCCESS; + } + + rtw_scan_result_t *net = &result->ap_details; + net->SSID.val[net->SSID.len] = '\0'; + + if (!net->SSID.len) + return RTW_SUCCESS; + + uint8_t last = scan->count + 1; + if (cls->scanAlloc(last) < last) { + return RTW_SUCCESS; + } + last--; + + scan->ap[last].ssid = strdup((char *)net->SSID.val); + scan->ap[last].auth = securityTypeToAuthMode(net->security); + scan->ap[last].rssi = net->signal_strength; + scan->ap[last].channel = net->channel; + memcpy(scan->ap[last].bssid.addr, net->BSSID.octet, ETH_ALEN); + + return RTW_SUCCESS; +} + +int16_t WiFiClass::scanNetworks(bool async, bool showHidden, bool passive, uint32_t maxMsPerChannel, uint8_t channel) { + if (scan && scan->running) + return WIFI_SCAN_RUNNING; + if (getMode() == WIFI_MODE_NULL) + enableSTA(true); + scanDelete(); + scanInit(); + + LT_IM(WIFI, "Starting WiFi scan"); + + if (wifi_scan_networks(scanHandler, this) != RTW_SUCCESS) + return WIFI_SCAN_FAILED; + + scan->running = true; + + if (!async) { + LT_IM(WIFI, "Waiting for results"); + xSemaphoreTake(DATA->scanSem, 1); // reset the semaphore quickly + xSemaphoreTake(DATA->scanSem, pdMS_TO_TICKS(maxMsPerChannel * 20)); + return scan->count; + } + return WIFI_SCAN_RUNNING; +} diff --git a/cores/realtek-amb/arduino/libraries/Wire/Wire.cpp b/cores/realtek-amb/arduino/libraries/Wire/Wire.cpp new file mode 100644 index 000000000..09c7f252e --- /dev/null +++ b/cores/realtek-amb/arduino/libraries/Wire/Wire.cpp @@ -0,0 +1,197 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-05-08. */ + +#if LT_RTL8710B + +#include "Wire.h" + +#include + +extern "C" { +extern int i2c_write_timeout(i2c_t *obj, int address, char *data, int length, int stop, int timeout_ms); +} + +#ifdef PIN_WIRE0_SDA +// Wire object associated to I2C0 interface. +TwoWire Wire(PIN_WIRE0_SDA, PIN_WIRE0_SCL); +#endif + +#if defined(PIN_WIRE0_SDA) && defined(PIN_WIRE1_SDA) +// Wire object associated to I2C1 interface. +TwoWire Wire1(PIN_WIRE1_SDA, PIN_WIRE1_SCL); +#endif + +#if !defined(PIN_WIRE0_SDA) && defined(PIN_WIRE1_SDA) +// Wire object associated to I2C1 interface. The board doesn't support I2C0. +TwoWire Wire(PIN_WIRE1_SDA, PIN_WIRE1_SCL); +#endif + +TwoWire::TwoWire() { + _timeout = 50; +} + +TwoWire::TwoWire(int8_t sda, int8_t scl) { + _timeout = 50; + _sda = sda; + _scl = scl; +} + +TwoWire::~TwoWire() {} + +bool TwoWire::setPins(int8_t sda, int8_t scl) { + // return true when changing pins on initialized I2C + if (_inSetPins) + return true; + // check if pins are provided + if (sda == -1 || scl == -1) + return false; + // set private pins + _sda = sda; + _scl = scl; + sda = pinInfo(sda)->gpio; + scl = pinInfo(scl)->gpio; + + // check if pins are valid + if ((sda == PA_4 || sda == PA_19 || sda == PA_30) && (scl == PA_1 || scl == PA_22 || scl == PA_29)) { + // I2C index 0 + _idx = 0; + } else if ((sda == PA_27 || sda == PA_2 || sda == PA_23) && (scl == PA_28 || scl == PA_3 || scl == PA_18)) { + // I2C index 1 + _idx = 1; + } else { + return false; + } + + // restart I2C if changing pins + // this will never be called from begin() + if (_i2c) { + _inSetPins = true; + end(); + begin(); + _inSetPins = false; + } + return true; +} + +bool TwoWire::begin(int8_t sda, int8_t scl, uint32_t frequency) { + if (_i2c) + return true; + // set private i2c pins + if (!setPins(sda, scl)) + return false; + // use default frequency + if (!frequency) + frequency = WIRE_DEFAULT_FREQ; + + _i2c = new i2c_t; + i2c_init(_i2c, (PinName)pinInfo(_sda)->gpio, (PinName)pinInfo(_scl)->gpio); + i2c_frequency(_i2c, frequency); + _freq = frequency; + return true; +} + +bool TwoWire::begin(uint8_t address, int8_t sda, int8_t scl, uint32_t frequency) { + if (_i2c) + return true; + // init master bus first, return if failed (wrong pins) + if (!begin(sda, scl, frequency)) + return false; + + i2c_slave_address(_i2c, _idx, address, 0xff); + i2c_slave_mode(_i2c, true); + return true; +} + +bool TwoWire::end() { + i2c_reset(_i2c); + delete _i2c; + _i2c = NULL; + return true; +} + +bool TwoWire::setClock(uint32_t freq) { + if (_i2c) { + i2c_frequency(_i2c, freq); + } + _freq = freq; + return true; +} + +void TwoWire::beginTransmission(uint8_t address) { + _txAddr = address; + _txBuf.clear(); +} + +// Errors: +// 0 : Success +// 1 : Data too long +// 2 : NACK on transmit of address +// 3 : NACK on transmit of data +// 4 : Other error +uint8_t TwoWire::endTransmission(bool stopBit) { + if (!_i2c || !_txAddr) + return 4; + char *buf = (char *)malloc(_txBuf.available()); + uint8_t i = 0; + while (_txBuf.available()) { + buf[i++] = _txBuf.read_char(); + } + int len = i2c_write_timeout(_i2c, _txAddr, buf, i, stopBit, _timeout); + free(buf); + _txAddr = 0; + if (len == -1) + return 2; // slave not available (if tx length == 0) + if (len != i) + return 3; // less bytes written + return 0; +} + +size_t TwoWire::requestFrom(uint8_t address, size_t len, bool stopBit) { + if (!len) + return 0; + + if (len > SERIAL_BUFFER_SIZE) + len = SERIAL_BUFFER_SIZE; + + _rxBuf.clear(); + + char *buf = (char *)malloc(_txBuf.available()); + i2c_read(_i2c, address, buf, len, stopBit); + uint8_t i = 0; + while (len) { + _rxBuf.store_char(buf[i++]); + len--; + } + free(buf); + return len; +} + +size_t TwoWire::write(uint8_t data) { + if (!_txAddr || _txBuf.isFull()) + return 0; + _txBuf.store_char(data); + return 1; +} + +size_t TwoWire::write(const uint8_t *data, size_t len) { + for (size_t i = 0; i < len; i++) { + if (!write(data[i])) + return i; + } + return len; +} + +int TwoWire::available() { + return _rxBuf.available(); +} + +int TwoWire::read() { + return _rxBuf.read_char(); +} + +int TwoWire::peek() { + return _rxBuf.peek(); +} + +void TwoWire::flush() {} + +#endif diff --git a/cores/realtek-amb/arduino/libraries/Wire/Wire.h b/cores/realtek-amb/arduino/libraries/Wire/Wire.h new file mode 100644 index 000000000..bc48214c3 --- /dev/null +++ b/cores/realtek-amb/arduino/libraries/Wire/Wire.h @@ -0,0 +1,68 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-05-08. */ + +#pragma once + +#include +#include +#include + +#if !defined(PIN_WIRE0_SDA) && defined(PIN_WIRE1_SDA) +#define Wire1 Wire +#endif + +#define WIRE_HAS_END 1 +#define WIRE_DEFAULT_FREQ 100000 + +struct i2c_s; +typedef struct i2c_s i2c_t; + +using arduino::RingBuffer; + +class TwoWire : public HardwareI2C { + private: + i2c_t *_i2c = NULL; + uint8_t _idx = 0; + + RingBuffer _rxBuf; + RingBuffer _txBuf; + uint8_t _txAddr = 0; + bool _inSetPins = false; + + public: + TwoWire(); + TwoWire(int8_t sda, int8_t scl); + ~TwoWire(); + + bool setPins(int8_t sda, int8_t scl); + + bool begin(int8_t sda, int8_t scl, uint32_t frequency = 0); + bool begin(uint8_t address, int8_t sda, int8_t scl, uint32_t frequency = 0); + bool end(); + + bool setClock(uint32_t freq); + + void beginTransmission(uint8_t address); + uint8_t endTransmission(bool stopBit); + + size_t requestFrom(uint8_t address, size_t len, bool stopBit); + size_t write(uint8_t data); + size_t write(const uint8_t *data, size_t len); + + int available(); + int read(); + int peek(); + void flush(); + + using HardwareI2C::begin; + using HardwareI2C::endTransmission; + using HardwareI2C::requestFrom; + using HardwareI2C::write; + using Print::write; +}; + +#ifdef PIN_WIRE0_SDA +extern TwoWire Wire; +#endif +#ifdef PIN_WIRE1_SDA +extern TwoWire Wire1; +#endif diff --git a/cores/realtek-amb/arduino/src/ArduinoFamily.h b/cores/realtek-amb/arduino/src/ArduinoFamily.h new file mode 100644 index 000000000..a59c171ed --- /dev/null +++ b/cores/realtek-amb/arduino/src/ArduinoFamily.h @@ -0,0 +1,27 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-02. */ + +#pragma once + +// Provide GPIO names to variant.cpp files +#define LT_VARIANT_INCLUDE "sdk_private.h" + +#include + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +extern uint32_t SystemCoreClock; +extern void vPortClearInterruptMask(uint32_t ulNewMaskValue); +extern uint32_t ulPortSetInterruptMask(void); + +#define clockCyclesPerMicrosecond() (SystemCoreClock / 1000000L) +#define clockCyclesToMicroseconds(a) (a * 1000L / (SystemCoreClock / 1000L)) +#define microsecondsToClockCycles(a) (a * (SystemCoreClock / 1000000L)) + +#define interrupts() vPortClearInterruptMask(0) +#define noInterrupts() ulPortSetInterruptMask() + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/cores/realtek-amb/arduino/src/api/lt_cpu.c b/cores/realtek-amb/arduino/src/api/lt_cpu.c new file mode 100644 index 000000000..bfc1f49a6 --- /dev/null +++ b/cores/realtek-amb/arduino/src/api/lt_cpu.c @@ -0,0 +1,8 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-10. */ + +#include +#include + +uint32_t lt_cpu_get_cycle_count() { + return microsecondsToClockCycles(micros()); +} diff --git a/cores/realtek-amb/arduino/src/lt_defs.h b/cores/realtek-amb/arduino/src/lt_defs.h new file mode 100644 index 000000000..948ea5612 --- /dev/null +++ b/cores/realtek-amb/arduino/src/lt_defs.h @@ -0,0 +1,8 @@ +#pragma once + +#error "Don't include this file directly" + +#define LT_ARD_HAS_WIFI 1 +#define LT_ARD_HAS_SOFTSERIAL 1 + +#define ARDUINO_AMEBA diff --git a/cores/realtek-amb/arduino/src/main.cpp b/cores/realtek-amb/arduino/src/main.cpp new file mode 100644 index 000000000..4fcc21ff6 --- /dev/null +++ b/cores/realtek-amb/arduino/src/main.cpp @@ -0,0 +1,31 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-19. */ + +#include +#include + +extern "C" { + +osThreadId main_tid = 0; + +#if LT_AUTO_DOWNLOAD_REBOOT && LT_ARD_HAS_SERIAL && LT_HW_UART2 +void lt_init_arduino() { + // initialize auto-download-reboot parser + Serial2.begin(115200); +} +#endif + +bool startMainTask() { + osThreadDef(mainTask, osPriorityRealtime, 1, 4096 * 4); + main_tid = osThreadCreate(osThread(mainTask), NULL); + osKernelStart(); + return true; +} + +void wait_for_debug() { + while (((CoreDebug->DHCSR) & CoreDebug_DHCSR_C_DEBUGEN_Msk) == 0) { + asm("nop"); + } + delay(1000); +} + +} // extern "C" diff --git a/cores/realtek-amb/arduino/src/wiring.c b/cores/realtek-amb/arduino/src/wiring.c new file mode 100644 index 000000000..bb0fc6bfa --- /dev/null +++ b/cores/realtek-amb/arduino/src/wiring.c @@ -0,0 +1,72 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-23. */ + +#include "wiring_private.h" + +#ifndef portNVIC_SYSTICK_CURRENT_VALUE_REG +#define portNVIC_SYSTICK_CURRENT_VALUE_REG (*((volatile uint32_t *)0xe000e018)) +#endif + +void delayMicroseconds(unsigned int us) { + int i; + uint32_t t0, tn; + int dfactor = 20 * us - 10 + (81 * us / 100); + + if (us > 100) { + t0 = micros(); + do { + tn = micros(); + } while (tn >= t0 && tn < (t0 + us - 1)); + } else { + for (i = 0; i < dfactor; i++) { + asm("nop"); + } + } +} + +unsigned long millis(void) { + return (__get_IPSR() == 0) ? xTaskGetTickCount() : xTaskGetTickCountFromISR(); +} + +unsigned long micros(void) { + uint32_t tick1, tick2; + uint32_t us; + uint32_t tick_per_us = F_CPU / 1000; + + if (__get_IPSR() == 0) { + tick1 = xTaskGetTickCount(); + us = portNVIC_SYSTICK_CURRENT_VALUE_REG; + tick2 = xTaskGetTickCount(); + } else { + tick1 = xTaskGetTickCountFromISR(); + us = portNVIC_SYSTICK_CURRENT_VALUE_REG; + tick2 = xTaskGetTickCountFromISR(); + } + + if (tick1 == tick2) { + return tick1 * 1000 - us * 1000 / tick_per_us; + } else if ((us * 1000 / tick_per_us) < 500) { + return tick1 * 1000 - us * 1000 / tick_per_us; + } else { + return tick1 * 1000; + } +} + +void pinRemoveMode(PinInfo *pin, uint32_t mask) { + PinData *data = pinData(pin); + if ((mask & PIN_GPIO) && (pin->enabled & PIN_GPIO)) { + gpio_deinit(data->gpio); + free(data->gpio); + pinDisable(pin, PIN_GPIO); + } + if ((mask & PIN_IRQ) && (pin->enabled & PIN_IRQ)) { + data->irqHandler = NULL; + gpio_irq_free(data->irq); + free(data->irq); + pinDisable(pin, PIN_IRQ); + } + if ((mask & PIN_PWM) && (pin->enabled & PIN_PWM)) { + pwmout_free(data->pwm); + free(data->pwm); + pinDisable(pin, PIN_PWM); + } +} diff --git a/cores/realtek-amb/arduino/src/wiring_analog.c b/cores/realtek-amb/arduino/src/wiring_analog.c new file mode 100644 index 000000000..68b7f8307 --- /dev/null +++ b/cores/realtek-amb/arduino/src/wiring_analog.c @@ -0,0 +1,80 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-20. */ + +#include "wiring_private.h" + +/* ADC */ +static analogin_t adc1; +static analogin_t adc2; +static analogin_t adc3; + +static bool g_adc_enabled[] = {false, false, false}; +// from realtek_amebaz_va0_example/example_sources/adc_vbat/src/main.c +#define AD2MV(ad, offset, gain) (((ad >> 4) - offset) * 1000 / gain) + +// TODO implement custom ADC calibration + +uint16_t analogReadVoltage(pin_size_t pinNumber) { + uint16_t ret = 0; + switch (pinNumber) { +#ifdef PIN_ADC2 + case PIN_ADC2: + if (g_adc_enabled[1] == false) { + analogin_init(&adc2, AD_2); + g_adc_enabled[1] = true; + } + ret = analogin_read_u16(&adc2); + // AD_1 - 0.0V-5.0V + return AD2MV(ret, 0x496, 0xBA); +#endif +#ifdef PIN_ADC1 + case PIN_ADC1: + if (g_adc_enabled[0] == false) { + analogin_init(&adc1, AD_1); + g_adc_enabled[0] = true; + } + ret = analogin_read_u16(&adc1); + break; +#endif +#ifdef PIN_ADC3 + case PIN_ADC3: + if (g_adc_enabled[2] == false) { + analogin_init(&adc3, AD_3); + g_adc_enabled[2] = true; + } + ret = analogin_read_u16(&adc3); + break; +#endif + default: + return 0; + } + + // AD_0, AD_2 - 0.0V-3.3V + return AD2MV(ret, 0x418, 0x342); +} + +uint16_t analogReadMaxVoltage(pin_size_t pinNumber) { +#ifdef PIN_A1 + if (pinNumber == PIN_A1) + return 5000; +#endif + return 3300; +} + +void analogWrite(pin_size_t pinNumber, int value) { + pinCheckGetData(pinNumber, PIN_PWM, ); + + // GPIO can't be used together with PWM + pinRemoveMode(pin, PIN_GPIO | PIN_IRQ); + + pwmout_t *pwm = data->pwm; + if (!pwm) { + // allocate memory if pin not used before + data->pwm = pwm = malloc(sizeof(pwmout_t)); + pwmout_init(pwm, pin->gpio); + pwmout_period_us(pwm, _analogWritePeriod); + pinEnable(pin, PIN_PWM); + } + + float percent = value * 1.0 / (1 << _analogWriteResolution); + pwmout_write(pwm, percent); +} diff --git a/cores/realtek-amb/arduino/src/wiring_data.h b/cores/realtek-amb/arduino/src/wiring_data.h new file mode 100644 index 000000000..1f0038f57 --- /dev/null +++ b/cores/realtek-amb/arduino/src/wiring_data.h @@ -0,0 +1,24 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-05-24. */ + +#pragma once + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +struct PinData_s { + gpio_t *gpio; + gpio_irq_t *irq; + pwmout_t *pwm; + PinMode gpioMode; + PinStatus irqMode; + void *irqHandler; + void *irqParam; +}; + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/cores/realtek-amb/arduino/src/wiring_digital.c b/cores/realtek-amb/arduino/src/wiring_digital.c new file mode 100644 index 000000000..1eb2f9c6c --- /dev/null +++ b/cores/realtek-amb/arduino/src/wiring_digital.c @@ -0,0 +1,71 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-23. */ + +#include "wiring_private.h" + +void pinMode(pin_size_t pinNumber, PinMode pinMode) { + pinCheckGetData(pinNumber, PIN_GPIO, ); + + if (pinEnabled(pin, PIN_GPIO) && data->gpioMode == pinMode) + return; + +#if LT_RTL8720C + // apparently IRQ can't be used with any kind of pull-up/down + // TODO verify if it can be used on AmebaZ + pinRemoveMode(pin, PIN_PWM | PIN_IRQ); +#else + // GPIO can't be used together with PWM + pinRemoveMode(pin, PIN_PWM); +#endif + + gpio_t *gpio = data->gpio; + if (!gpio) { + // allocate memory if pin not used before + data->gpio = gpio = malloc(sizeof(gpio_t)); + gpio_init(gpio, pin->gpio); + pinEnable(pin, PIN_GPIO); + } + + PinDirection dir; + PinModeRTL mode; + + switch (pinMode) { + case INPUT: + dir = PIN_INPUT; + mode = PullNone; + break; + case INPUT_PULLDOWN: + dir = PIN_INPUT; + mode = PullDown; + break; + case INPUT_PULLUP: + dir = PIN_INPUT; + mode = PullUp; + break; + case OUTPUT: + dir = PIN_OUTPUT; + mode = PullNone; + break; + case OUTPUT_OPENDRAIN: + dir = PIN_OUTPUT; + mode = OpenDrain; + break; + default: + return; + } + data->gpioMode = pinMode; + + gpio_dir(gpio, dir); + gpio_mode(gpio, mode); +} + +void digitalWrite(pin_size_t pinNumber, PinStatus status) { + pinCheckGetData(pinNumber, PIN_GPIO, ); + pinSetOutputPull(pin, data, pinNumber, status); + gpio_write(data->gpio, !!status); +} + +PinStatus digitalRead(pin_size_t pinNumber) { + pinCheckGetData(pinNumber, PIN_GPIO, LOW); + pinSetInputMode(pin, data, pinNumber); + return gpio_read(data->gpio); +} diff --git a/cores/realtek-amb/arduino/src/wiring_irq.c b/cores/realtek-amb/arduino/src/wiring_irq.c new file mode 100644 index 000000000..f387fccca --- /dev/null +++ b/cores/realtek-amb/arduino/src/wiring_irq.c @@ -0,0 +1,79 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-23. */ + +#include "wiring_private.h" + +static void gpioIrqHandler(uint32_t id, gpio_irq_event event) { + // id is pin data + PinData *data = (PinData *)id; + if (!data->irqHandler) + return; + if (!data->irqParam) + ((voidFuncPtr)data->irqHandler)(); + else + ((voidFuncPtrParam)data->irqHandler)(data->irqParam); +} + +void attachInterruptParam(pin_size_t interruptNumber, voidFuncPtrParam callback, PinStatus mode, void *param) { + pinCheckGetData(interruptNumber, PIN_IRQ, ); + + data->irqHandler = callback; + data->irqParam = param; + + if (pinEnabled(pin, PIN_IRQ) && data->irqMode == mode) + return; + +#if LT_RTL8720C + // apparently IRQ can't be used with any kind of pull-up/down + // TODO verify if it can be used on AmebaZ + pinRemoveMode(pin, PIN_PWM | PIN_GPIO); +#else + // GPIO can't be used together with PWM + pinRemoveMode(pin, PIN_PWM); +#endif + + gpio_irq_t *irq = data->irq; + if (!irq) { + // allocate memory if pin not used before + data->irq = irq = malloc(sizeof(gpio_irq_t)); + if (gpio_irq_init(irq, pin->gpio, gpioIrqHandler, (uint32_t)data) != 0) { + LT_W("IRQ init failed"); + free(data->irq); + data->irq = NULL; + return; + } + pinEnable(pin, PIN_IRQ); + } + + gpio_irq_event event; + switch (mode) { + case LOW: + event = IRQ_LOW; + break; + case HIGH: + event = IRQ_HIGH; + break; + case FALLING: + event = IRQ_FALL; + break; + case RISING: + event = IRQ_RISE; + break; + case CHANGE: +#if LT_RTL8720C + event = IRQ_FALL_RISE; +#else + LT_W("CHANGE interrupts not supported"); +#endif + break; + default: + return; + } + data->irqMode = mode; + + gpio_irq_set(irq, event, 1); + gpio_irq_enable(irq); +} + +void detachInterrupt(pin_size_t interruptNumber) { + pinModeRemove(interruptNumber, PIN_IRQ); +} diff --git a/cores/realtek-amb/arduino/src/wiring_pulse.c b/cores/realtek-amb/arduino/src/wiring_pulse.c new file mode 100644 index 000000000..9fcd794da --- /dev/null +++ b/cores/realtek-amb/arduino/src/wiring_pulse.c @@ -0,0 +1,76 @@ +/* + Copyright (c) 2011 Arduino. All right reserved. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +*/ + +#include "wiring_private.h" + +/* Measures the length (in microseconds) of a pulse on the pin; state is HIGH + * or LOW, the type of pulse to measure. Works on pulses from 2-3 microseconds + * to 3 minutes in length, but must be called at least a few dozen microseconds + * before the start of the pulse. */ +extern unsigned long pulseIn(uint8_t pinNumber, uint8_t state, unsigned long timeout) { + // cache the port and bit of the pin in order to speed up the + // pulse width measuring loop and achieve finer resolution. calling + // digitalRead() instead yields much coarser resolution. + PinInfo *pin = pinInfo(pinNumber); + if (pin == NULL) + return 0; + uint32_t index = pinIndex(pin); + + uint32_t start_ticks, cur_ticks; + + if (pin->gpio == NC) + return 0; + + /* Handle */ + if (!pinEnabled(pin, PIN_GPIO)) { + return 0; + } + PinData *data = pinData(pin); + gpio_t *pGpio_t = data->gpio; + + // wait for any previous pulse to end + start_ticks = us_ticker_read(); + while (gpio_read(pGpio_t) == state) { + cur_ticks = us_ticker_read(); + if (cur_ticks - start_ticks > timeout) + return 0; + } + + // wait for the pulse to start + while (gpio_read(pGpio_t) != state) { + cur_ticks = us_ticker_read(); + if (cur_ticks - start_ticks > timeout) + return 0; + } + + // wait for the pulse to stop + start_ticks = us_ticker_read(); + while (gpio_read(pGpio_t) == state) { + cur_ticks = us_ticker_read(); + if (cur_ticks - start_ticks > timeout) + return 0; + } + + cur_ticks = us_ticker_read(); + + // convert the reading to microseconds. The loop has been determined + // to be 52 clock cycles long and have about 16 clocks between the edge + // and the start of the loop. There will be some error introduced by + // the interrupt handlers. + return cur_ticks - start_ticks; +} diff --git a/cores/realtek-amb/base/api/lt_flash.c b/cores/realtek-amb/base/api/lt_flash.c new file mode 100644 index 000000000..df7c40939 --- /dev/null +++ b/cores/realtek-amb/base/api/lt_flash.c @@ -0,0 +1,14 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-05-23. */ + +#include +#include + +lt_flash_id_t lt_flash_get_id() { + lt_flash_id_t id; + uint8_t idBytes[3]; + flash_read_id(<_flash_obj, idBytes, 3); + id.manufacturer_id = idBytes[0]; + id.chip_id = idBytes[1]; + id.chip_size_id = idBytes[2]; + return id; +} diff --git a/cores/realtek-amb/base/api/lt_wdt.c b/cores/realtek-amb/base/api/lt_wdt.c new file mode 100644 index 000000000..4adac4210 --- /dev/null +++ b/cores/realtek-amb/base/api/lt_wdt.c @@ -0,0 +1,18 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-05-23. */ + +#include +#include + +bool lt_wdt_enable(uint32_t timeout) { + watchdog_init(timeout); + watchdog_start(); + return true; +} + +void lt_wdt_disable() { + watchdog_stop(); +} + +void lt_wdt_feed() { + watchdog_refresh(); +} diff --git a/cores/realtek-amb/base/config/build_info.h b/cores/realtek-amb/base/config/build_info.h new file mode 100644 index 000000000..d2ff95a07 --- /dev/null +++ b/cores/realtek-amb/base/config/build_info.h @@ -0,0 +1,18 @@ +#pragma once + +#define RTL_FW_COMPILE_TIME "2020/01/01-00:00:00" +#define RTL_FW_COMPILE_DATE "20200101" +#define UTS_VERSION "2020/01/01-00:00:00" +#define RTL8195AFW_COMPILE_TIME "2020/01/01-00:00:00" +#define RTL8195AFW_COMPILE_DATE "2020/01/01" +#define RTL8195AFW_COMPILE_BY "root" +#define RTL8195AFW_COMPILE_HOST "localhost" +#define RTL8195AFW_COMPILE_DOMAIN "localhost" +#define RTL8195AFW_COMPILER "gcc" +#define RTL195AFW_COMPILER "gcc" +#define RTL8710CFW_COMPILE_TIME "2020/01/01-00:00:00" +#define RTL8710CFW_COMPILE_DATE "20200101" +#define RTL8710CFW_COMPILE_BY "root" +#define RTL8710CFW_COMPILE_HOST "localhost" +#define RTL8710CFW_COMPILE_DOMAIN "localhost" +#define RTL8710CFW_COMPILER "gcc" diff --git a/cores/realtek-amb/base/config/lwipopts.h b/cores/realtek-amb/base/config/lwipopts.h new file mode 100644 index 000000000..fae78d468 --- /dev/null +++ b/cores/realtek-amb/base/config/lwipopts.h @@ -0,0 +1,33 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-07-20. */ + +#pragma once + +#include_next "lwipopts.h" + +#if (!defined(LWIP_IPV4) || LWIP_IPV4) && !LWIP_IPV6 +#define ip_addr ip4_addr // LwIP 2.0.x compatibility +#define ip_addr_t ip4_addr_t // LwIP 2.0.x compatibility +#endif +#if !LWIP_IPV4 && LWIP_IPV6 +#define ip_addr ip6_addr // LwIP 2.0.x compatibility +#define ip_addr_t ip6_addr_t // LwIP 2.0.x compatibility +#endif +#define in_addr_t u32_t +#define IN_ADDR_T_DEFINED 1 + +#ifndef INT_MAX +#define INT_MAX 2147483647 // for RECV_BUFSIZE_DEFAULT +#endif + +// - 2022-05-23 set LWIP_NUM_NETIF_CLIENT_DATA to 1 +#define LWIP_NUM_NETIF_CLIENT_DATA 1 +#define LWIP_NETIF_EXT_STATUS_CALLBACK 1 +// - 2022-05-23 set MEMP_NUM_UDP_PCB to 7 +#undef MEMP_NUM_UDP_PCB +#define MEMP_NUM_UDP_PCB 7 + +// LWIP_COMPAT_MUTEX cannot prevent priority inversion. It is recommended to implement priority-aware mutexes. (Define +// LWIP_COMPAT_MUTEX_ALLOWED to disable this error.) +#define LWIP_COMPAT_MUTEX_ALLOWED 1 + +#define LWIP_TCPIP_TIMEOUT 1 diff --git a/cores/realtek-amb/base/config/main.h b/cores/realtek-amb/base/config/main.h new file mode 100644 index 000000000..dde552cc9 --- /dev/null +++ b/cores/realtek-amb/base/config/main.h @@ -0,0 +1,45 @@ +#pragma once + +#include + +void wlan_network(); + +// clang-format off +#define WEP40_KEY { 0x12, 0x34, 0x56, 0x78, 0x90 } +// clang-format on + +#define CONFIG_WLAN 1 +#define SERIAL_DEBUG_RX 1 +#define STA_MODE_SSID "ap" +#define AP_MODE_SSID "wlan_ap_ssid" +#define AP_DEFAULT_CH 6 +#define WLAN0_NAME "wlan0" +#define WLAN1_NAME "wlan1" +#define WPA_PASSPHRASE "1234567890" +#define ATVER_1 1 +#define ATVER_2 2 +#define ATCMD_VER ATVER_1 +#define IP_ADDR0 192 +#define IP_ADDR1 168 +#define IP_ADDR2 1 +#define IP_ADDR3 80 +#define NETMASK_ADDR0 255 +#define NETMASK_ADDR1 255 +#define NETMASK_ADDR2 255 +#define NETMASK_ADDR3 0 +#define GW_ADDR0 192 +#define GW_ADDR1 168 +#define GW_ADDR2 1 +#define GW_ADDR3 1 +#define AP_IP_ADDR0 192 +#define AP_IP_ADDR1 168 +#define AP_IP_ADDR2 43 +#define AP_IP_ADDR3 1 +#define AP_NETMASK_ADDR0 255 +#define AP_NETMASK_ADDR1 255 +#define AP_NETMASK_ADDR2 255 +#define AP_NETMASK_ADDR3 0 +#define AP_GW_ADDR0 192 +#define AP_GW_ADDR1 168 +#define AP_GW_ADDR2 43 +#define AP_GW_ADDR3 1 diff --git a/cores/realtek-amb/base/fixups/basic_types.h b/cores/realtek-amb/base/fixups/basic_types.h new file mode 100644 index 000000000..c9a7f104b --- /dev/null +++ b/cores/realtek-amb/base/fixups/basic_types.h @@ -0,0 +1,19 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-02. */ + +// fix conflicting declaration with ArduinoCore-API +#ifdef ARDUINO +#define boolean boolean_rtl +#endif + +#include + +// the SDK declares bool if not defined before +// which conflicts with C++ built-in bool +// so it's either -fpermissive or this: +#ifndef bool +#define bool bool +#endif + +#include_next "basic_types.h" + +#undef boolean diff --git a/cores/realtek-amb/base/fixups/cmsis_ipsr.c b/cores/realtek-amb/base/fixups/cmsis_ipsr.c new file mode 100644 index 000000000..7819c32ba --- /dev/null +++ b/cores/realtek-amb/base/fixups/cmsis_ipsr.c @@ -0,0 +1,11 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-22. */ + +#include + +// for some reason, cmsis_os.c does not link properly when this method is inlined in core_cmFunc.h +// (or I am too stupid to understand this) +__attribute__((weak)) uint32_t __get_IPSR() { + uint32_t result; + asm volatile("MRS %0, ipsr" : "=r"(result)); + return result; +} diff --git a/cores/realtek-amb/base/fixups/machine/endian.h b/cores/realtek-amb/base/fixups/machine/endian.h new file mode 100644 index 000000000..e81cb6244 --- /dev/null +++ b/cores/realtek-amb/base/fixups/machine/endian.h @@ -0,0 +1,21 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-12. */ + +#include_next + +#pragma once + +// GCC versions newer than 5.x.x specify the LITTLE_ENDIAN macro +// as an alias to _LITTLE_ENDIAN (which in turn holds the actual numeric value). +// Realtek's rtl8711b_crypto.h redefines _LITTLE_ENDIAN as a macro without +// any value, which makes comparisons like '#if BYTE_ORDER == LITTLE_ENDIAN' impossible. + +#if __GNUC__ > 5 +#undef _LITTLE_ENDIAN +#undef _BIG_ENDIAN +#undef LITTLE_ENDIAN +#undef BIG_ENDIAN +#undef BYTE_ORDER +#define LITTLE_ENDIAN 1234 +#define BIG_ENDIAN 4321 +#define BYTE_ORDER LITTLE_ENDIAN +#endif diff --git a/cores/realtek-amb/base/fixups/platform/platform_stdlib.h b/cores/realtek-amb/base/fixups/platform/platform_stdlib.h new file mode 100644 index 000000000..795004fc6 --- /dev/null +++ b/cores/realtek-amb/base/fixups/platform/platform_stdlib.h @@ -0,0 +1,3 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-14. */ + +#include "../platform_stdlib.h" diff --git a/cores/realtek-amb/base/fixups/platform_stdlib.h b/cores/realtek-amb/base/fixups/platform_stdlib.h new file mode 100644 index 000000000..170a1abc2 --- /dev/null +++ b/cores/realtek-amb/base/fixups/platform_stdlib.h @@ -0,0 +1,26 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-14. */ + +#pragma once + +// platform_stdlib.h in amb1_sdk includes some stdlib headers, +// as well as Realtek's stdlib replacement headers. It also defines +// some macros to map stdlib functions to SDK functions, so it's +// generally just not needed at all. + +// This is also the only file that publicly includes strproc.h and memproc.h, +// so this fixup resolves all these issues. + +#include /* va_list */ +#include +#include +#include + +#include "basic_types.h" // fixup: replaces typedef boolean for Arduino compatibility +#if __has_include() +#include // fixup: redirects to stdlib +#endif +#if __has_include() +#include "strproc.h" // fixup: redirects to stdlib +#endif + +#include "diag.h" diff --git a/cores/realtek-amb/base/fixups/section_config.h b/cores/realtek-amb/base/fixups/section_config.h new file mode 100644 index 000000000..fb968c802 --- /dev/null +++ b/cores/realtek-amb/base/fixups/section_config.h @@ -0,0 +1,6 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-02. */ + +// section_config.h is in the same directory as basic_types.h +// make the former include a fixup instead +#include "basic_types.h" +#include_next "section_config.h" diff --git a/cores/realtek-amb/base/fixups/wifi_mode.c b/cores/realtek-amb/base/fixups/wifi_mode.c new file mode 100644 index 000000000..4d5dd1bb1 --- /dev/null +++ b/cores/realtek-amb/base/fixups/wifi_mode.c @@ -0,0 +1,6 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-22. */ + +#include + +// wifi_mode is declared in atcmd_wifi.c, which is a part of the built-in trash console +rtw_mode_t wifi_mode = RTW_MODE_NONE; diff --git a/cores/realtek-amb/base/lt_defs.h b/cores/realtek-amb/base/lt_defs.h new file mode 100644 index 000000000..1b387c654 --- /dev/null +++ b/cores/realtek-amb/base/lt_defs.h @@ -0,0 +1,10 @@ +#pragma once + +#error "Don't include this file directly" + +#define LT_HAS_FLASH 1 +#define LT_HW_WATCHDOG 1 +#define LT_HW_WIFI 1 + +#define LT_HEAP_FUNC xPortGetFreeHeapSize +#define LT_REALLOC_FUNC pvPortReAlloc diff --git a/cores/realtek-amb/base/port/fal_flash_ambz_port.c b/cores/realtek-amb/base/port/fal_flash_ambz_port.c new file mode 100644 index 000000000..9cf5f0a33 --- /dev/null +++ b/cores/realtek-amb/base/port/fal_flash_ambz_port.c @@ -0,0 +1,41 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-05-24. */ + +#include +#include + +#include + +#define FLASH_ERASE_MIN_SIZE (4 * 1024) + +flash_t lt_flash_obj; + +static int init() { + flash_get_status(<_flash_obj); + return 0; +} + +static int read(long offset, uint8_t *buf, size_t size) { + return size * flash_stream_read(<_flash_obj, offset, size, buf); +} + +static int write(long offset, const uint8_t *buf, size_t size) { + return size * flash_stream_write(<_flash_obj, offset, size, (uint8_t *)buf); +} + +static int erase(long offset, size_t size) { + offset &= ~(FLASH_ERASE_MIN_SIZE - 1); + size = ((size - 1) / FLASH_ERASE_MIN_SIZE) + 1; + for (uint16_t i = 0; i < size; i++) { + flash_erase_sector(<_flash_obj, offset + i * FLASH_ERASE_MIN_SIZE); + } + return size * FLASH_ERASE_MIN_SIZE; +} + +const struct fal_flash_dev flash0 = { + .name = FAL_FLASH_DEV_NAME, + .addr = 0x0, + .len = FLASH_LENGTH, + .blk_size = FLASH_ERASE_MIN_SIZE, + .ops = {init, read, write, erase}, + .write_gran = 1, +}; diff --git a/cores/realtek-amb/base/sdk_private.h b/cores/realtek-amb/base/sdk_private.h new file mode 100644 index 000000000..1a4f5dfe4 --- /dev/null +++ b/cores/realtek-amb/base/sdk_private.h @@ -0,0 +1,92 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-05-06. */ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +// note: this is *not* replacing any stdlib functions :) +#include + +// fix conflicts with Arduino's PinMode enum +#define PinMode PinModeRTL +// remove log_printf() if included before sdk_private.h +#undef log_printf + +// CMSIS & Realtek APIs +#if LT_RTL8710B +#include +#include +#include +#endif +#if LT_RTL8720C +#include +#include +#include +#endif + +#include +#undef malloc +#undef free +#undef calloc + +// mbed APIs +#include +#undef MBED_GPIO_API_H // ..no comment +#include + +#include +#include +#include +#if LT_RTL8720C +#include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// other SDK APIs +#if __has_include() +#include +#endif + +// remove previously defined workarounds +#undef PinMode + +// undefine ROM stdio in favor of printf() library (wrappers) +#undef printf +#undef sprintf +#undef vsprintf +#undef snprintf +#undef vsnprintf +#undef vprintf +#include +// conflict with lt_logger.h +#undef log_printf + +// moved from syscalls.h +#define _close __rtl_close +#define _fstat __rtl_fstat +#define _isatty __rtl_isatty +#define _lseek __rtl_lseek +#define _open __rtl_open +#define _read __rtl_read +#define _write __rtl_write +#define _sbrk __rtl_sbrk + +extern flash_t lt_flash_obj; + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/cores/realtek-ambz/arduino/libraries/Serial/Serial.cpp b/cores/realtek-ambz/arduino/libraries/Serial/Serial.cpp new file mode 100644 index 000000000..6f5d8e310 --- /dev/null +++ b/cores/realtek-ambz/arduino/libraries/Serial/Serial.cpp @@ -0,0 +1,135 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-07-03. */ + +#include "SerialPrivate.h" + +#if LT_HW_UART0 +SerialClass Serial0(0, PIN_SERIAL0_RX, PIN_SERIAL0_TX); +#endif +#if LT_HW_UART1 +SerialClass Serial1(1, PIN_SERIAL1_RX, PIN_SERIAL1_TX); +#endif +#if LT_HW_UART2 +SerialClass Serial2(2, PIN_SERIAL2_RX, PIN_SERIAL2_TX); +#endif + +static UART_TypeDef *PORT_UART[3] = {UART0_DEV, UART1_DEV, UART2_DEV}; +static const IRQn PORT_IRQ[3] = {UART0_IRQ, UART1_IRQ, UART_LOG_IRQ}; + +static uint32_t callback(void *param) { + UART_TypeDef *uart = pdUART; + + uint32_t intcr = uart->DLH_INTCR; + uart->DLH_INTCR = 0; + + uint8_t c; + while (UART_Readable(uart)) { + UART_CharGet(uart, &c); +#if LT_AUTO_DOWNLOAD_REBOOT && defined(LT_UART_ADR_PATTERN) && PIN_SERIAL2_RX != PIN_INVALID + // parse UART protocol commands on UART2 + if (uart == UART2_DEV) + SerialClass::adrParse(c); +#endif + pdBUF.store_char(c); + } + + uart->DLH_INTCR = intcr; + return 0; +} + +void SerialClass::begin(unsigned long baudrate, uint16_t config) { + if (!this->data) { + this->data = new SerialData(); + this->buf = &BUF; + DATA->uart = PORT_UART[this->port]; + DATA->irq = PORT_IRQ[this->port]; + + switch ((uint32_t)DATA->uart) { + case UART0_REG_BASE: + RCC_PeriphClockCmd(APBPeriph_UART0, APBPeriph_UART0_CLOCK, ENABLE); + break; + case UART1_REG_BASE: + RCC_PeriphClockCmd(APBPeriph_UART1, APBPeriph_UART1_CLOCK, ENABLE); + break; + } + + if (this->tx != PIN_INVALID) { + Pinmux_Config(this->tx, PINMUX_FUNCTION_UART); + } + if (this->rx != PIN_INVALID) { + Pinmux_Config(this->rx, PINMUX_FUNCTION_UART); + PAD_PullCtrl(this->rx, GPIO_PuPd_UP); + } + } + + if (this->baudrate != baudrate || this->config != config) + this->configure(baudrate, config); + + if (this->rx != PIN_INVALID) { + VECTOR_IrqUnRegister(DATA->irq); + VECTOR_IrqRegister(callback, DATA->irq, (uint32_t)this->data, 10); + VECTOR_IrqEn(DATA->irq, 10); + UART_RxCmd(UART, ENABLE); + UART_INTConfig(UART, RUART_IER_ERBI, ENABLE); + } +} + +void SerialClass::configure(unsigned long baudrate, uint16_t config) { + if (!this->data) + return; + + // RUART_WLS_7BITS / RUART_WLS_8BITS + uint8_t dataWidth = (config & SERIAL_DATA_MASK) == SERIAL_DATA_8; + // RUART_PARITY_DISABLE / RUART_PARITY_ENABLE + uint8_t parity = (config & SERIAL_PARITY_MASK) != SERIAL_PARITY_NONE; + // RUART_ODD_PARITY / RUART_EVEN_PARITY + uint8_t parityType = (config & SERIAL_PARITY_MASK) == SERIAL_PARITY_EVEN; + // RUART_STOP_BIT_1 / RUART_STOP_BIT_2 + uint8_t stopBits = (config & SERIAL_STOP_BIT_MASK) == SERIAL_STOP_BIT_2; + + UART_InitTypeDef cfg; + UART_StructInit(&cfg); + cfg.WordLen = dataWidth; + cfg.Parity = parity; + cfg.ParityType = parityType; + cfg.StopBit = stopBits; + UART_Init(UART, &cfg); + UART_SetBaud(UART, baudrate); + + this->baudrate = baudrate; + this->config = config; +} + +void SerialClass::end() { + if (!this->data) + return; + + UART_INTConfig(UART, RUART_IER_ERBI, DISABLE); + UART_RxCmd(UART, DISABLE); + VECTOR_IrqDis(DATA->irq); + VECTOR_IrqUnRegister(DATA->irq); + UART_DeInit(UART); + + if (UART == UART2_DEV) { + // restore command line mode + DIAG_UartReInit((IRQ_FUN)UartLogIrqHandle); + } + + delete DATA; + this->data = NULL; + this->buf = NULL; + this->baudrate = 0; +} + +void SerialClass::flush() { + if (!this->data) + return; + UART_WaitBusy(UART, 10); +} + +size_t SerialClass::write(uint8_t c) { + if (!this->data) + return 0; + while (UART_Writable(UART) == 0) {} + UART_CharPut(UART, c); + return 1; +} diff --git a/cores/realtek-ambz/arduino/libraries/Serial/SerialPrivate.h b/cores/realtek-ambz/arduino/libraries/Serial/SerialPrivate.h new file mode 100644 index 000000000..315113531 --- /dev/null +++ b/cores/realtek-ambz/arduino/libraries/Serial/SerialPrivate.h @@ -0,0 +1,19 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-05-23. */ + +#pragma once + +#include +#include + +typedef struct { + UART_TypeDef *uart; + IRQn irq; + RingBuffer buf; +} SerialData; + +#define DATA ((SerialData *)data) +#define pDATA ((SerialData *)param) +#define BUF (DATA->buf) +#define pdBUF (pDATA->buf) +#define UART (DATA->uart) +#define pdUART (pDATA->uart) diff --git a/cores/realtek-ambz/arduino/src/lt_defs.h b/cores/realtek-ambz/arduino/src/lt_defs.h new file mode 100644 index 000000000..a3ea2d6ff --- /dev/null +++ b/cores/realtek-ambz/arduino/src/lt_defs.h @@ -0,0 +1,6 @@ +#pragma once + +#error "Don't include this file directly" + +#define LT_ARD_HAS_SERIAL 1 +#define LT_ARD_MD5_MBEDTLS 1 diff --git a/cores/realtek-ambz/base/api/lt_cpu.c b/cores/realtek-ambz/base/api/lt_cpu.c new file mode 100644 index 000000000..eb346cf26 --- /dev/null +++ b/cores/realtek-ambz/base/api/lt_cpu.c @@ -0,0 +1,34 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-02-27. */ + +#include +#include + +lt_cpu_model_t lt_cpu_get_model() { + uint8_t chipId; + EFUSE_OneByteReadROM(9902, 0xF8, &chipId, L25EOUTVOLTAGE); + return CPU_MODEL_ENUM(FAMILY, chipId); +} + +uint32_t lt_cpu_get_mac_id() { + uint32_t chipId = 0; + uint8_t *id = (uint8_t *)&chipId; + // 9902 was extracted from ROM disassembly, probably not needed + /* EFUSE_OneByteReadROM(9902, 0x3B, id + 0, L25EOUTVOLTAGE); + EFUSE_OneByteReadROM(9902, 0x3C, id + 1, L25EOUTVOLTAGE); + EFUSE_OneByteReadROM(9902, 0x3D, id + 2, L25EOUTVOLTAGE); */ + // new method, based on EFUSE logical map + uint8_t *efuse = (uint8_t *)malloc(512); + // TODO do what EFUSE_LogicalMapRead() does, and read only the used data + EFUSE_LogicalMap_Read(efuse); + memcpy(id, efuse + 0x11A + 3, 3); + free(efuse); + return chipId; +} + +const char *lt_cpu_get_core_type() { + return "ARM Cortex-M4F (ARMv7E-M)"; +} + +uint32_t lt_cpu_get_freq() { + return CPU_ClkGet(false); +} diff --git a/cores/realtek-ambz/base/api/lt_device.c b/cores/realtek-ambz/base/api/lt_device.c new file mode 100644 index 000000000..19511d71d --- /dev/null +++ b/cores/realtek-ambz/base/api/lt_device.c @@ -0,0 +1,39 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-02-27. */ + +#include +#include + +void lt_get_device_mac(uint8_t *mac) { + uint8_t *efuse = (uint8_t *)malloc(512); + EFUSE_LogicalMap_Read(efuse); + memcpy(mac, efuse + 0x11A, 6); + free(efuse); +} + +bool lt_reboot_download_mode() { + // mww 0x40000138 0x8 + HAL_WRITE32(SYSTEM_CTRL_BASE, REG_SYS_NORESET_FF, 0x08); + // reboot it the ugly way + sys_reset(); + while (1) {} + return true; +} + +bool lt_set_debug_mode(lt_debug_mode_t mode) { + uint32_t *swd; + switch (mode) { + case DEBUG_MODE_OFF: + sys_jtag_off(); + Pinmux_Config(PA_14, PINMUX_FUNCTION_GPIO); + Pinmux_Config(PA_15, PINMUX_FUNCTION_GPIO); + return true; + case DEBUG_MODE_SWD: + Pinmux_Config(PA_14, PINMUX_FUNCTION_SWD); + Pinmux_Config(PA_15, PINMUX_FUNCTION_SWD); + uint32_t *swd = (uint32_t *)0x400000A4; + *swd |= 0x1000; + return true; + default: + return false; + } +} diff --git a/cores/realtek-ambz/base/api/lt_flash.c b/cores/realtek-ambz/base/api/lt_flash.c new file mode 100644 index 000000000..73438795e --- /dev/null +++ b/cores/realtek-ambz/base/api/lt_flash.c @@ -0,0 +1,14 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-02-27. */ + +#include +#include + +lt_flash_id_t lt_flash_get_id() { + lt_flash_id_t id; + uint8_t idBytes[3]; + flash_read_id(NULL, idBytes, 3); + id.manufacturer_id = idBytes[0]; + id.chip_id = idBytes[1]; + id.chip_size_id = idBytes[2]; + return id; +} diff --git a/cores/realtek-ambz/base/api/lt_init.c b/cores/realtek-ambz/base/api/lt_init.c new file mode 100644 index 000000000..c9c0167d7 --- /dev/null +++ b/cores/realtek-ambz/base/api/lt_init.c @@ -0,0 +1,16 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-02-27. */ + +#include +#include + +extern uint32_t GlobalDebugEnable; +extern uint16_t GlobalDebugLevel; +extern uint8_t GlobalPrivateLog; +extern uint8_t lt_uart_port; + +void lt_init_family() { + // make the SDK less verbose by default + GlobalDebugEnable = 0; + GlobalPrivateLog = 0; + lt_uart_port = LT_UART_DEFAULT_PORT; +} diff --git a/cores/realtek-ambz/base/api/lt_mem.c b/cores/realtek-ambz/base/api/lt_mem.c new file mode 100644 index 000000000..c3e5a4a08 --- /dev/null +++ b/cores/realtek-ambz/base/api/lt_mem.c @@ -0,0 +1,8 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-02-27. */ + +#include +#include + +uint32_t lt_ram_get_size() { + return 256 * 1024; +} diff --git a/cores/realtek-ambz/base/api/lt_ota.c b/cores/realtek-ambz/base/api/lt_ota.c new file mode 100644 index 000000000..7ed571025 --- /dev/null +++ b/cores/realtek-ambz/base/api/lt_ota.c @@ -0,0 +1,78 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-02-27. */ + +#include +#include + +lt_ota_type_t lt_ota_get_type() { + return OTA_TYPE_DUAL; +} + +bool lt_ota_is_valid(uint8_t index) { + uint32_t offset; + switch (index) { + case 1: + offset = FLASH_OTA1_OFFSET; + break; + case 2: + offset = FLASH_OTA2_OFFSET; + break; + default: + return false; + } + uint8_t *address = (uint8_t *)(SPI_FLASH_BASE + offset); + return memcmp(address, "81958711", 8) == 0; +} + +uint8_t lt_ota_dual_get_current() { + // RTL8710B is XIP, so check the code offset in flash + uint32_t addr = (uint32_t)lt_log; + uint32_t offs = addr - SPI_FLASH_BASE; + return offs > FLASH_OTA2_OFFSET ? 2 : 1; +} + +uint8_t lt_ota_dual_get_stored() { + uint32_t *ota_address = (uint32_t *)0x8009000; + if (*ota_address == 0xFFFFFFFF) + return 1; + uint32_t ota_counter = *((uint32_t *)0x8009004); + // even count of zero-bits means OTA1, odd count means OTA2 + // this allows to switch OTA images by simply clearing next bits, + // without needing to erase the flash + uint8_t count = 0; + for (uint8_t i = 0; i < 32; i++) { + if ((ota_counter & (1 << i)) == 0) + count++; + } + return 1 + (count % 2); +} + +bool lt_ota_switch(bool revert) { + uint8_t current = lt_ota_dual_get_current(); + uint8_t stored = lt_ota_dual_get_stored(); + if ((current == stored) == revert) + return true; + + if (!lt_ota_is_valid(stored ^ 0b11)) + return false; + + // - read current OTA switch value from 0x9004 + // - reset OTA switch to 0xFFFFFFFE if it's 0x0 + // - else check first non-zero bit of OTA switch + // - write OTA switch with first non-zero bit cleared + + uint32_t value = HAL_READ32(SPI_FLASH_BASE, FLASH_SYSTEM_OFFSET + 4); + if (value == 0) { + uint8_t *system = (uint8_t *)malloc(64); + lt_flash_read(FLASH_SYSTEM_OFFSET, system, 64); + // reset OTA switch + ((uint32_t *)system)[1] = -2; + lt_flash_erase_block(FLASH_SYSTEM_OFFSET); + return lt_flash_write(FLASH_SYSTEM_OFFSET, system, 64); + } + + // clear first non-zero bit + value <<= 1; + // write OTA switch to flash + flash_write_word(NULL, FLASH_SYSTEM_OFFSET + 4, value); + return true; +} diff --git a/cores/realtek-ambz/base/config/FreeRTOSConfig.h b/cores/realtek-ambz/base/config/FreeRTOSConfig.h new file mode 100644 index 000000000..4a377c8e1 --- /dev/null +++ b/cores/realtek-ambz/base/config/FreeRTOSConfig.h @@ -0,0 +1,8 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-02. */ + +#pragma once + +#include_next "FreeRTOSConfig.h" + +#undef configTOTAL_HEAP_SIZE +#define configTOTAL_HEAP_SIZE ((size_t)(160 * 1024)) diff --git a/cores/realtek-ambz/base/config/platform_opts.h b/cores/realtek-ambz/base/config/platform_opts.h new file mode 100644 index 000000000..8469f3e62 --- /dev/null +++ b/cores/realtek-ambz/base/config/platform_opts.h @@ -0,0 +1,14 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-02. */ + +#pragma once + +#include_next "platform_opts.h" + +// - 2022-05-18 include lwip/init.h +#include + +// - 2022-05-08 change CONFIG_USE_POLARSSL to CONFIG_USE_MBEDTLS +#undef CONFIG_USE_POLARSSL +#undef CONFIG_USE_MBEDTLS +#define CONFIG_USE_POLARSSL 0 +#define CONFIG_USE_MBEDTLS 1 diff --git a/cores/realtek-ambz/base/fixups/app_start_patch.c b/cores/realtek-ambz/base/fixups/app_start_patch.c new file mode 100644 index 000000000..0778a5000 --- /dev/null +++ b/cores/realtek-ambz/base/fixups/app_start_patch.c @@ -0,0 +1,118 @@ +/* + * Routines to access hardware + * + * Copyright (c) 2013 Realtek Semiconductor Corp. + * + * This module is a confidential and proprietary property of RealTek and + * possession or use of this module requires written permission of RealTek. + */ + +// NOTE: this file has the default main() function removed. + +#include "ameba_soc.h" +#include "build_info.h" + +#if (defined(CONFIG_POST_SIM)) +void Simulation_Init(void); +#endif + +#if defined(CONFIG_WIFI_NORMAL) && defined(CONFIG_NETWORK) +extern void init_rom_wlan_ram_map(void); +extern VOID wlan_network(VOID); +#endif + +#ifdef CONFIG_MBED_ENABLED +extern void __libc_fini_array (void); +extern void __libc_init_array (void); +extern void SVC_Handler (void); +extern void PendSV_Handler (void); +extern void SysTick_Handler (void); + +void APP_StartMbed(void) +{ + InterruptForOSInit((VOID*)SVC_Handler, + (VOID*)PendSV_Handler, + (VOID*)SysTick_Handler); + __asm ( + "ldr r0, =SystemInit\n" + "blx r0\n" + "ldr r0, =_start\n" + "bx r0\n" + ); + + for(;;); + +} +#endif + +void APP_InitTrace(void) +{ + u32 debug[4]; + +#if (defined(CONFIG_POST_SIM) || defined(CONFIG_CP)) + return; +#endif + + debug[LEVEL_ERROR] = BIT(MODULE_BOOT); + debug[LEVEL_WARN] = 0x0; + debug[LEVEL_INFO] = BIT(MODULE_BOOT); + debug[LEVEL_TRACE] = 0x0; + +#ifdef CONFIG_DEBUG_ERR_MSG + debug[LEVEL_ERROR] = 0xFFFFFFFF; +#endif +#ifdef CONFIG_DEBUG_WARN_MSG + debug[LEVEL_WARN] = 0xFFFFFFFF; +#endif +#ifdef CONFIG_DEBUG_INFO_MSG + debug[LEVEL_INFO] = 0xFFFFFFFF; +#endif + + LOG_MASK(debug); + + DBG_PRINTF(MODULE_BOOT, LEVEL_INFO, "APP_InitTrace: %x:%x:%x:%x\n",debug[0], debug[1], debug[2], debug[3]); + DBG_PRINTF(MODULE_BOOT, LEVEL_ERROR, "APP_InitTrace: %x:%x:%x:%x\n",debug[0], debug[1], debug[2], debug[3]); + +} + +extern void lt_main(void); + +// The Main App entry point +void APP_Start(void) +{ +#if CONFIG_SOC_PS_MODULE + SOCPS_InitSYSIRQ(); +#endif + +#ifdef CONFIG_KERNEL +#ifdef PLATFORM_FREERTOS + InterruptForOSInit((VOID*)vPortSVCHandler, + (VOID*)xPortPendSVHandler, + (VOID*)xPortSysTickHandler); +#endif +#endif + +#ifdef CONFIG_MBED_ENABLED + APP_StartMbed(); +#else + +#if 0//def CONFIG_APP_DEMO +#ifdef PLATFORM_FREERTOS + xTaskCreate( (TaskFunction_t)main, "MAIN_APP__TASK", (2048 /4), (void *)NULL, (tskIDLE_PRIORITY + 1), NULL); + vTaskStartScheduler(); +#endif +#else +#if defined ( __ICCARM__ ) + __iar_cstart_call_ctors(NULL); +#endif + // force SP align to 8 byte not 4 byte (initial SP is 4 byte align) + __asm( + "mov r0, sp\n" + "bic r0, r0, #7\n" + "mov sp, r0\n" + ); + + lt_main(); +#endif // end of #if CONFIG_APP_DEMO +#endif // end of else of "#ifdef CONFIG_MBED_ENABLED" +} diff --git a/cores/realtek-ambz/base/fixups/cmsis.h b/cores/realtek-ambz/base/fixups/cmsis.h new file mode 100644 index 000000000..13c6af5ba --- /dev/null +++ b/cores/realtek-ambz/base/fixups/cmsis.h @@ -0,0 +1,50 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-12. */ + +// Fix for PeripheralNames.h producing errors on GCC newer than 5.x.x. +// The struct pointer casts are replaced with register addresses, which fixes compilation. +// On older versions, this change doesn't make any difference. +// MBED_PERIPHERALNAMES_H is defined in the SDK builder, to eliminate PeripheralNames.h completely. + +#include_next "cmsis.h" + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + UART_0 = (int)UART0_REG_BASE, + UART_1 = (int)UART1_REG_BASE, + UART_2 = (int)UART2_REG_BASE, +} UARTName; + +typedef enum { + ADC0_0 = 0, + ADC0_1, + ADC0_2, + ADC0_3 +} ADCName; + +typedef enum { + SPI_0 = (int)SPI0_REG_BASE, + SPI_1 = (int)SPI1_REG_BASE, +} SPIName; + +typedef enum { + I2C_0 = (int)I2C0_REG_BASE, + I2C_1 = (int)I2C1_REG_BASE, +} I2CName; + +typedef enum { + PWM_0 = 1, + PWM_1, + PWM_2, + PWM_3, + PWM_4, + PWM_5 +} PWMName; + +#ifdef __cplusplus +} +#endif diff --git a/cores/realtek-ambz/base/fixups/hal_crypto.h b/cores/realtek-ambz/base/fixups/hal_crypto.h new file mode 100644 index 000000000..bfd9bed72 --- /dev/null +++ b/cores/realtek-ambz/base/fixups/hal_crypto.h @@ -0,0 +1,12 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-14. */ + +#include_next "hal_crypto.h" + +#pragma once + +// mbedTLS (ssl_tls.c) uses S1 and S2 as variable name +// rtl8710b_pinmux.h defines them as integer values +#if defined(CONFIG_SSL_RSA) && defined(RTL_HW_CRYPTO) && defined(S1) +#undef S1 +#undef S2 +#endif diff --git a/cores/realtek-ambz/base/fixups/lib_rtlstd_patch.a b/cores/realtek-ambz/base/fixups/lib_rtlstd_patch.a new file mode 100644 index 0000000000000000000000000000000000000000..66632af8a625a629dd32775cc641ddf581236699 GIT binary patch literal 13516 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 Y2pj~?VO>9_?L8!cO!t&?c{pVM4e0z=`Tzg` literal 0 HcmV?d00001 diff --git a/cores/realtek-ambz/base/fixups/lib_rtlstd_patch/index.html b/cores/realtek-ambz/base/fixups/lib_rtlstd_patch/index.html new file mode 100644 index 000000000..453211449 --- /dev/null +++ b/cores/realtek-ambz/base/fixups/lib_rtlstd_patch/index.html @@ -0,0 +1,2298 @@ + + + + + + + + + + + + + + + + + + + + lib_rtlstd_patch.a - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

lib_rtlstd_patch.a

+
arm-none-eabi-gcc-ar xo lib_rtlstd.a
+rm rtl_eabi_cast_ram.o
+arm-none-eabi-objcopy --strip-debug --strip-unneeded ram_libc.o
+arm-none-eabi-objcopy --strip-debug --strip-unneeded ram_libgloss_retarget.o
+arm-none-eabi-objcopy --strip-debug --strip-unneeded rtl_math_ram.o
+arm-none-eabi-gcc-ar qs lib_rtlstd_patch.a *.o
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/cores/realtek-ambz/base/fixups/log_uart.c b/cores/realtek-ambz/base/fixups/log_uart.c new file mode 100644 index 000000000..ce85bc69f --- /dev/null +++ b/cores/realtek-ambz/base/fixups/log_uart.c @@ -0,0 +1,30 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-04-22. */ + +#include +#include + +// usage: +// extern int LOGUART_SetBaud(uint32_t BaudRate); + +int LOGUART_SetBaud(uint32_t BaudRate) +{ + UART_INTConfig(UART2_DEV, RUART_IER_ERBI | RUART_IER_ELSI, DISABLE); + UART_RxCmd(UART2_DEV, DISABLE); + + UART_SetBaud(UART2_DEV, BaudRate); + + UART_INTConfig(UART2_DEV, RUART_IER_ERBI | RUART_IER_ELSI, ENABLE); + UART_RxCmd(UART2_DEV, ENABLE); + + return 1; +} + +void LOGUART_SetBaud_FromFlash(void) +{ + // useless, nop +} + +void ReRegisterPlatformLogUart(void) +{ + // useless, nop +} diff --git a/cores/realtek-ambz/base/fixups/memproc.h b/cores/realtek-ambz/base/fixups/memproc.h new file mode 100644 index 000000000..4f0718b72 --- /dev/null +++ b/cores/realtek-ambz/base/fixups/memproc.h @@ -0,0 +1,9 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-14. */ + +#pragma once + +#include + +#define _memcmp memcmp +#define _memcpy memcpy +#define _memset memset diff --git a/cores/realtek-ambz/base/fixups/net_sockets.c b/cores/realtek-ambz/base/fixups/net_sockets.c new file mode 100644 index 000000000..34f67e2a2 --- /dev/null +++ b/cores/realtek-ambz/base/fixups/net_sockets.c @@ -0,0 +1,739 @@ +/* + * TCP/IP or UDP/IP networking functions + * + * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved + * SPDX-License-Identifier: Apache-2.0 + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may + * not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * This file is part of mbed TLS (https://tls.mbed.org) + */ + +#if !defined(MBEDTLS_CONFIG_FILE) +#include "mbedtls/config.h" +#else +#include MBEDTLS_CONFIG_FILE +#endif + +#if defined(MBEDTLS_NET_C) + +/* +#if !defined(unix) && !defined(__unix__) && !defined(__unix) && \ + !defined(__APPLE__) && !defined(_WIN32) +#error "This module only works on Unix and Windows, see MBEDTLS_NET_C in config.h" +#endif +*/ + +#if defined(MBEDTLS_PLATFORM_C) +#include "mbedtls/platform.h" +#else +#include +#endif + +#include "mbedtls/net_sockets.h" + +#include + +#if (defined(_WIN32) || defined(_WIN32_WCE)) && !defined(EFIX64) && \ + !defined(EFI32) + +#ifdef _WIN32_WINNT +#undef _WIN32_WINNT +#endif +/* Enables getaddrinfo() & Co */ +#define _WIN32_WINNT 0x0501 +#include + +#include +#include + +#if defined(_MSC_VER) +#if defined(_WIN32_WCE) +#pragma comment( lib, "ws2.lib" ) +#else +#pragma comment( lib, "ws2_32.lib" ) +#endif +#endif /* _MSC_VER */ + +#define read(fd,buf,len) recv(fd,(char*)buf,(int) len,0) +#define write(fd,buf,len) send(fd,(char*)buf,(int) len,0) +#define close(fd) closesocket(fd) + +static int wsa_init_done = 0; + +#elif defined(__ICCARM__) || defined(__CC_ARM) || defined ( __GNUC__ ) + +#include "lwip/sockets.h" +#include "lwip/inet.h" +#if LWIP_DNS +#include "lwip/netdb.h" +#endif +#include + +#define net_htons(n) htons(n) +#define net_htonl(n) htonl(n) + +#else /* ( _WIN32 || _WIN32_WCE ) && !EFIX64 && !EFI32 */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif /* ( _WIN32 || _WIN32_WCE ) && !EFIX64 && !EFI32 */ + +/* Some MS functions want int and MSVC warns if we pass size_t, + * but the standard fucntions use socklen_t, so cast only for MSVC */ +#if defined(_MSC_VER) +#define MSVC_INT_CAST (int) +#else +#define MSVC_INT_CAST +#endif + +#include + +#include + +#include + +/* + * Prepare for using the sockets interface + */ +static int net_prepare( void ) +{ +#if ( defined(_WIN32) || defined(_WIN32_WCE) ) && !defined(EFIX64) && \ + !defined(EFI32) + WSADATA wsaData; + + if( wsa_init_done == 0 ) + { + if( WSAStartup( MAKEWORD(2,0), &wsaData ) != 0 ) + return( MBEDTLS_ERR_NET_SOCKET_FAILED ); + + wsa_init_done = 1; + } +#else +#if !defined(EFIX64) && !defined(EFI32) && !defined(__ICCARM__) && !defined(__CC_ARM) && !defined ( __GNUC__ ) + signal( SIGPIPE, SIG_IGN ); +#endif +#endif + return( 0 ); +} + +/* + * Initialize a context + */ +void mbedtls_net_init( mbedtls_net_context *ctx ) +{ + ctx->fd = -1; +} + +/* + * Initiate a TCP connection with host:port and the given protocol + */ +int mbedtls_net_connect( mbedtls_net_context *ctx, const char *host, const char *port, int proto ) +{ +#if defined(MBEDTLS_HAVE_IPV6) + int ret; + struct addrinfo hints, *addr_list, *cur; + + if( ( ret = net_prepare() ) != 0 ) + return( ret ); + + /* Do name resolution with both IPv6 and IPv4 */ + memset( &hints, 0, sizeof( hints ) ); + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = proto == MBEDTLS_NET_PROTO_UDP ? SOCK_DGRAM : SOCK_STREAM; + hints.ai_protocol = proto == MBEDTLS_NET_PROTO_UDP ? IPPROTO_UDP : IPPROTO_TCP; + + if( getaddrinfo( host, port, &hints, &addr_list ) != 0 ) + return( MBEDTLS_ERR_NET_UNKNOWN_HOST ); + + /* Try the sockaddrs until a connection succeeds */ + ret = MBEDTLS_ERR_NET_UNKNOWN_HOST; + for( cur = addr_list; cur != NULL; cur = cur->ai_next ) + { + ctx->fd = (int) socket( cur->ai_family, cur->ai_socktype, + cur->ai_protocol ); + if( ctx->fd < 0 ) + { + ret = MBEDTLS_ERR_NET_SOCKET_FAILED; + continue; + } + + if( connect( ctx->fd, cur->ai_addr, MSVC_INT_CAST cur->ai_addrlen ) == 0 ) + { + ret = 0; + break; + } + + close( ctx->fd ); + ret = MBEDTLS_ERR_NET_CONNECT_FAILED; + } + + freeaddrinfo( addr_list ); + + return( ret ); +#else + /* Legacy IPv4-only version */ + + int ret; + int type, protocol; + struct sockaddr_in server_addr; +#if LWIP_DNS + struct hostent *server_host; +#endif + if( ( ret = net_prepare() ) != 0 ) + return( ret ); + + type = ( proto == MBEDTLS_NET_PROTO_UDP ) ? SOCK_DGRAM : SOCK_STREAM; + protocol = ( proto == MBEDTLS_NET_PROTO_UDP ) ? IPPROTO_UDP : IPPROTO_TCP; + +#if LWIP_DNS + if( ( server_host = gethostbyname( host ) ) == NULL ) + return( MBEDTLS_ERR_NET_UNKNOWN_HOST ); + + if( ( ctx->fd = (int) socket( AF_INET, type, protocol ) ) < 0 ) + return( MBEDTLS_ERR_NET_SOCKET_FAILED ); + + memcpy( (void *) &server_addr.sin_addr, + (void *) server_host->h_addr, + server_host->h_length ); +#else + if( ( ctx->fd = (int) socket( AF_INET, type, protocol ) ) < 0 ) + return( MBEDTLS_ERR_NET_SOCKET_FAILED ); + + server_addr.sin_len = sizeof(server_addr); + server_addr.sin_addr.s_addr = inet_addr(host); +#endif + + server_addr.sin_family = AF_INET; + server_addr.sin_port = net_htons( atoi(port) ); + + if( connect( ctx->fd, (struct sockaddr *) &server_addr, + sizeof( server_addr ) ) < 0 ) + { + close( ctx->fd ); + return( MBEDTLS_ERR_NET_CONNECT_FAILED ); + } + + return( 0 ); +#endif /* MBEDTLS_HAVE_IPV6 */ +} + +/* + * Create a listening socket on bind_ip:port + */ +int mbedtls_net_bind( mbedtls_net_context *ctx, const char *bind_ip, const char *port, int proto ) +{ +#if defined(MBEDTLS_HAVE_IPV6) + int n, ret; + struct addrinfo hints, *addr_list, *cur; + + if( ( ret = net_prepare() ) != 0 ) + return( ret ); + + /* Bind to IPv6 and/or IPv4, but only in the desired protocol */ + memset( &hints, 0, sizeof( hints ) ); + hints.ai_family = AF_UNSPEC; + hints.ai_socktype = proto == MBEDTLS_NET_PROTO_UDP ? SOCK_DGRAM : SOCK_STREAM; + hints.ai_protocol = proto == MBEDTLS_NET_PROTO_UDP ? IPPROTO_UDP : IPPROTO_TCP; + if( bind_ip == NULL ) + hints.ai_flags = AI_PASSIVE; + + if( getaddrinfo( bind_ip, port, &hints, &addr_list ) != 0 ) + return( MBEDTLS_ERR_NET_UNKNOWN_HOST ); + + /* Try the sockaddrs until a binding succeeds */ + ret = MBEDTLS_ERR_NET_UNKNOWN_HOST; + for( cur = addr_list; cur != NULL; cur = cur->ai_next ) + { + ctx->fd = (int) socket( cur->ai_family, cur->ai_socktype, + cur->ai_protocol ); + if( ctx->fd < 0 ) + { + ret = MBEDTLS_ERR_NET_SOCKET_FAILED; + continue; + } + + n = 1; + if( setsockopt( ctx->fd, SOL_SOCKET, SO_REUSEADDR, + (const char *) &n, sizeof( n ) ) != 0 ) + { + close( ctx->fd ); + ret = MBEDTLS_ERR_NET_SOCKET_FAILED; + continue; + } + + if( bind( ctx->fd, cur->ai_addr, MSVC_INT_CAST cur->ai_addrlen ) != 0 ) + { + close( ctx->fd ); + ret = MBEDTLS_ERR_NET_BIND_FAILED; + continue; + } + + /* Listen only makes sense for TCP */ + if( proto == MBEDTLS_NET_PROTO_TCP ) + { + if( listen( ctx->fd, MBEDTLS_NET_LISTEN_BACKLOG ) != 0 ) + { + close( ctx->fd ); + ret = MBEDTLS_ERR_NET_LISTEN_FAILED; + continue; + } + } + + /* I we ever get there, it's a success */ + ret = 0; + break; + } + + freeaddrinfo( addr_list ); + + return( ret ); +#else + /* Legacy IPv4-only version */ + + int ret, n, c[4]; + int type, protocol; + struct sockaddr_in server_addr; + + if( ( ret = net_prepare() ) != 0 ) + return( ret ); + + type = ( proto == MBEDTLS_NET_PROTO_UDP ) ? SOCK_DGRAM : SOCK_STREAM; + protocol = ( proto == MBEDTLS_NET_PROTO_UDP ) ? IPPROTO_UDP : IPPROTO_TCP; + + if( ( ctx->fd = (int) socket( AF_INET, type, protocol ) ) < 0 ) + return( MBEDTLS_ERR_NET_SOCKET_FAILED ); + + n = 1; + setsockopt( ctx->fd, SOL_SOCKET, SO_REUSEADDR, + (const char *) &n, sizeof( n ) ); + + server_addr.sin_addr.s_addr = net_htonl( INADDR_ANY ); + server_addr.sin_family = AF_INET; + server_addr.sin_port = net_htons( atoi(port) ); + + if( bind_ip != NULL ) + { + memset( c, 0, sizeof( c ) ); + sscanf( bind_ip, "%d.%d.%d.%d", &c[0], &c[1], &c[2], &c[3] ); + + for( n = 0; n < 4; n++ ) + if( c[n] < 0 || c[n] > 255 ) + break; + + if( n == 4 ) + server_addr.sin_addr.s_addr = net_htonl( + ( (uint32_t) c[0] << 24 ) | + ( (uint32_t) c[1] << 16 ) | + ( (uint32_t) c[2] << 8 ) | + ( (uint32_t) c[3] ) ); + } + + if( bind( ctx->fd, (struct sockaddr *) &server_addr, + sizeof( server_addr ) ) < 0 ) + { + close( ctx->fd ); + return( MBEDTLS_ERR_NET_BIND_FAILED ); + } + + /* Listen only makes sense for TCP */ + if( proto == MBEDTLS_NET_PROTO_TCP ) + { + if( listen( ctx->fd, MBEDTLS_NET_LISTEN_BACKLOG ) != 0 ) + { + close( ctx->fd ); + return( MBEDTLS_ERR_NET_LISTEN_FAILED ); + } + } + + return( 0 ); +#endif /* MBEDTLS_HAVE_IPV6 */ +} + +#if ( defined(_WIN32) || defined(_WIN32_WCE) ) && !defined(EFIX64) && \ + !defined(EFI32) +/* + * Check if the requested operation would be blocking on a non-blocking socket + * and thus 'failed' with a negative return value. + */ +static int net_would_block( const mbedtls_net_context *ctx ) +{ + ((void) ctx); + return( WSAGetLastError() == WSAEWOULDBLOCK ); +} +#else +/* + * Check if the requested operation would be blocking on a non-blocking socket + * and thus 'failed' with a negative return value. + * + * Note: on a blocking socket this function always returns 0! + */ +static int net_would_block( const mbedtls_net_context *ctx ) +{ + /* + * Never return 'WOULD BLOCK' on a non-blocking socket + */ + if( ( fcntl( ctx->fd, F_GETFL , 0 ) & O_NONBLOCK ) != O_NONBLOCK ) + return( 0 ); + + switch( errno ) + { +#if defined EAGAIN + case EAGAIN: +#endif +#if defined EWOULDBLOCK && EWOULDBLOCK != EAGAIN + case EWOULDBLOCK: +#endif + return( 1 ); + } + return( 0 ); +} +#endif /* ( _WIN32 || _WIN32_WCE ) && !EFIX64 && !EFI32 */ + +/* + * Accept a connection from a remote client + */ +int mbedtls_net_accept( mbedtls_net_context *bind_ctx, + mbedtls_net_context *client_ctx, + void *client_ip, size_t buf_size, size_t *ip_len ) +{ + int ret; + int type; + +#if defined(MBEDTLS_HAVE_IPV6) + struct sockaddr_storage client_addr; +#else + struct sockaddr_in client_addr; +#endif + +#if defined(__socklen_t_defined) || defined(_SOCKLEN_T) || \ + defined(_SOCKLEN_T_DECLARED) || defined(__DEFINED_socklen_t) + socklen_t n = (socklen_t) sizeof( client_addr ); + socklen_t type_len = (socklen_t) sizeof( type ); +#else + int n = (int) sizeof( client_addr ); + int type_len = (int) sizeof( type ); +#endif + + /* Is this a TCP or UDP socket? */ + if( getsockopt( bind_ctx->fd, SOL_SOCKET, SO_TYPE, + (void *) &type, &type_len ) != 0 || + ( type != SOCK_STREAM && type != SOCK_DGRAM ) ) + { + return( MBEDTLS_ERR_NET_ACCEPT_FAILED ); + } + + if( type == SOCK_STREAM ) + { + /* TCP: actual accept() */ + ret = client_ctx->fd = (int) accept( bind_ctx->fd, + (struct sockaddr *) &client_addr, &n ); + } + else + { + /* UDP: wait for a message, but keep it in the queue */ + char buf[1] = { 0 }; + + ret = (int) recvfrom( bind_ctx->fd, buf, sizeof( buf ), MSG_PEEK, + (struct sockaddr *) &client_addr, &n ); + +#if defined(_WIN32) + if( ret == SOCKET_ERROR && + WSAGetLastError() == WSAEMSGSIZE ) + { + /* We know buf is too small, thanks, just peeking here */ + ret = 0; + } +#endif + } + + if( ret < 0 ) + { + if( net_would_block( bind_ctx ) != 0 ) + return( MBEDTLS_ERR_SSL_WANT_READ ); + + return( MBEDTLS_ERR_NET_ACCEPT_FAILED ); + } + + /* UDP: hijack the listening socket to communicate with the client, + * then bind a new socket to accept new connections */ + if( type != SOCK_STREAM ) + { +#if defined(MBEDTLS_HAVE_IPV6) + struct sockaddr_storage local_addr; +#else + struct sockaddr_in local_addr; +#endif + + int one = 1; + + if( connect( bind_ctx->fd, (struct sockaddr *) &client_addr, n ) != 0 ) + return( MBEDTLS_ERR_NET_ACCEPT_FAILED ); + + client_ctx->fd = bind_ctx->fd; + bind_ctx->fd = -1; /* In case we exit early */ + +#if defined(MBEDTLS_HAVE_IPV6) + n = sizeof( struct sockaddr_storage ); + if( getsockname( client_ctx->fd, + (struct sockaddr *) &local_addr, &n ) != 0 || + ( bind_ctx->fd = (int) socket( local_addr.ss_family, + SOCK_DGRAM, IPPROTO_UDP ) ) < 0 || + setsockopt( bind_ctx->fd, SOL_SOCKET, SO_REUSEADDR, + (const char *) &one, sizeof( one ) ) != 0 ) + { + return( MBEDTLS_ERR_NET_SOCKET_FAILED ); + } +#else + n = sizeof( struct sockaddr_in ); + if( getsockname( client_ctx->fd, + (struct sockaddr *) &local_addr, &n ) != 0 || + ( bind_ctx->fd = (int) socket( local_addr.sin_family, + SOCK_DGRAM, IPPROTO_UDP ) ) < 0 || + setsockopt( bind_ctx->fd, SOL_SOCKET, SO_REUSEADDR, + (const char *) &one, sizeof( one ) ) != 0 ) + { + return( MBEDTLS_ERR_NET_SOCKET_FAILED ); + } +#endif + + if( bind( bind_ctx->fd, (struct sockaddr *) &local_addr, n ) != 0 ) + { + return( MBEDTLS_ERR_NET_BIND_FAILED ); + } + } + + if( client_ip != NULL ) + { +#if defined(MBEDTLS_HAVE_IPV6) + if( client_addr.ss_family == AF_INET ) + { + struct sockaddr_in *addr4 = (struct sockaddr_in *) &client_addr; + *ip_len = sizeof( addr4->sin_addr.s_addr ); + + if( buf_size < *ip_len ) + return( MBEDTLS_ERR_NET_BUFFER_TOO_SMALL ); + + memcpy( client_ip, &addr4->sin_addr.s_addr, *ip_len ); + } + else + { + struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *) &client_addr; + *ip_len = sizeof( addr6->sin6_addr.s6_addr ); + + if( buf_size < *ip_len ) + return( MBEDTLS_ERR_NET_BUFFER_TOO_SMALL ); + + memcpy( client_ip, &addr6->sin6_addr.s6_addr, *ip_len ); + } +#else + *ip_len = sizeof( client_addr.sin_addr.s_addr ); + + if( buf_size < *ip_len ) + return( MBEDTLS_ERR_NET_BUFFER_TOO_SMALL ); + + memcpy( client_ip, &client_addr.sin_addr.s_addr, *ip_len ); +#endif /* MBEDTLS_HAVE_IPV6 */ + } + + return( 0 ); +} + +/* + * Set the socket blocking or non-blocking + */ +int mbedtls_net_set_block( mbedtls_net_context *ctx ) +{ +#if ( defined(_WIN32) || defined(_WIN32_WCE) || defined(__ICCARM__) || defined(__CC_ARM) || defined ( __GNUC__ ) ) && !defined(EFIX64) && \ + !defined(EFI32) + unsigned long n = 0; + return( ioctlsocket( ctx->fd, FIONBIO, &n ) ); +#else + return( fcntl( ctx->fd, F_SETFL, fcntl( ctx->fd, F_GETFL ) & ~O_NONBLOCK ) ); +#endif +} + +int mbedtls_net_set_nonblock( mbedtls_net_context *ctx ) +{ +#if ( defined(_WIN32) || defined(_WIN32_WCE) || defined(__ICCARM__) || defined(__CC_ARM) || defined ( __GNUC__ ) ) && !defined(EFIX64) && \ + !defined(EFI32) + unsigned long n = 1; + return( ioctlsocket( ctx->fd, FIONBIO, &n ) ); +#else + return( fcntl( ctx->fd, F_SETFL, fcntl( ctx->fd, F_GETFL ) | O_NONBLOCK ) ); +#endif +} + +/* + * Portable usleep helper + */ +void mbedtls_net_usleep( unsigned long usec ) +{ +#if defined(_WIN32) + Sleep( ( usec + 999 ) / 1000 ); +#else + struct timeval tv; + tv.tv_sec = usec / 1000000; +#if defined(__unix__) || defined(__unix) || \ + ( defined(__APPLE__) && defined(__MACH__) ) + tv.tv_usec = (suseconds_t) usec % 1000000; +#else + tv.tv_usec = usec % 1000000; +#endif + select( 0, NULL, NULL, NULL, &tv ); +#endif +} + +/* + * Read at most 'len' characters + */ +int mbedtls_net_recv( void *ctx, unsigned char *buf, size_t len ) +{ + int ret; + int fd = ((mbedtls_net_context *) ctx)->fd; + + if( fd < 0 ) + return( MBEDTLS_ERR_NET_INVALID_CONTEXT ); + + ret = (int) read( fd, buf, len ); + + if( ret < 0 ) + { + if( net_would_block( ctx ) != 0 ) + return( MBEDTLS_ERR_SSL_WANT_READ ); + +#if ( defined(_WIN32) || defined(_WIN32_WCE) ) && !defined(EFIX64) && \ + !defined(EFI32) + if( WSAGetLastError() == WSAECONNRESET ) + return( MBEDTLS_ERR_NET_CONN_RESET ); +#else +#ifdef ERRNO + if( errno == EPIPE || errno == ECONNRESET ) + return( MBEDTLS_ERR_NET_CONN_RESET ); + + if( errno == EINTR ) + return( MBEDTLS_ERR_SSL_WANT_READ ); +#endif +#endif + return( MBEDTLS_ERR_NET_RECV_FAILED ); + } + + return( ret ); +} + +/* + * Read at most 'len' characters, blocking for at most 'timeout' ms + */ +int mbedtls_net_recv_timeout( void *ctx, unsigned char *buf, size_t len, + uint32_t timeout ) +{ + int ret; + struct timeval tv; + fd_set read_fds; + int fd = ((mbedtls_net_context *) ctx)->fd; + + if( fd < 0 ) + return( MBEDTLS_ERR_NET_INVALID_CONTEXT ); + + FD_ZERO( &read_fds ); + FD_SET( fd, &read_fds ); + + tv.tv_sec = timeout / 1000; + tv.tv_usec = ( timeout % 1000 ) * 1000; + + ret = select( fd + 1, &read_fds, NULL, NULL, timeout == 0 ? NULL : &tv ); + + /* Zero fds ready means we timed out */ + if( ret == 0 ) + return( MBEDTLS_ERR_SSL_TIMEOUT ); + + if( ret < 0 ) + { +#if ( defined(_WIN32) || defined(_WIN32_WCE) ) && !defined(EFIX64) && \ + !defined(EFI32) + if( WSAGetLastError() == WSAEINTR ) + return( MBEDTLS_ERR_SSL_WANT_READ ); +#else +#ifdef ERRNO + if( errno == EINTR ) + return( MBEDTLS_ERR_SSL_WANT_READ ); +#endif +#endif + return( MBEDTLS_ERR_NET_RECV_FAILED ); + } + + /* This call will not block */ + return( mbedtls_net_recv( ctx, buf, len ) ); +} + +/* + * Write at most 'len' characters + */ +int mbedtls_net_send( void *ctx, const unsigned char *buf, size_t len ) +{ + int ret; + int fd = ((mbedtls_net_context *) ctx)->fd; + + if( fd < 0 ) + return( MBEDTLS_ERR_NET_INVALID_CONTEXT ); + + ret = (int) write( fd, buf, len ); + + if( ret < 0 ) + { + if( net_would_block( ctx ) != 0 ) + return( MBEDTLS_ERR_SSL_WANT_WRITE ); + +#if ( defined(_WIN32) || defined(_WIN32_WCE) ) && !defined(EFIX64) && \ + !defined(EFI32) + if( WSAGetLastError() == WSAECONNRESET ) + return( MBEDTLS_ERR_NET_CONN_RESET ); +#else +#ifdef ERRNO + if( errno == EPIPE || errno == ECONNRESET ) + return( MBEDTLS_ERR_NET_CONN_RESET ); + + if( errno == EINTR ) + return( MBEDTLS_ERR_SSL_WANT_WRITE ); +#endif +#endif + return( MBEDTLS_ERR_NET_SEND_FAILED ); + } + + return( ret ); +} + +/* + * Gracefully close the connection + */ +void mbedtls_net_free( mbedtls_net_context *ctx ) +{ + if( ctx->fd == -1 ) + return; + + shutdown( ctx->fd, 2 ); + close( ctx->fd ); + + ctx->fd = -1; +} + +#endif /* MBEDTLS_NET_C */ diff --git a/cores/realtek-ambz/base/fixups/strproc.h b/cores/realtek-ambz/base/fixups/strproc.h new file mode 100644 index 000000000..6a2b5c9b8 --- /dev/null +++ b/cores/realtek-ambz/base/fixups/strproc.h @@ -0,0 +1,8 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-14. */ + +#pragma once + +#include + +#define _strcpy strcpy +#define _strlen strlen diff --git a/cores/realtek-ambz/base/lt_defs.h b/cores/realtek-ambz/base/lt_defs.h new file mode 100644 index 000000000..a8f13449e --- /dev/null +++ b/cores/realtek-ambz/base/lt_defs.h @@ -0,0 +1,10 @@ +#pragma once + +#error "Don't include this file directly" + +#define LT_HAS_FREERTOS 1 +#define LT_HAS_LWIP 1 +#define LT_HAS_LWIP2 1 +#define LT_HAS_MBEDTLS 1 +#define LT_HAS_OTA 1 +#define LT_HAS_PRINTF 1 diff --git a/cores/realtek-ambz/base/lt_family.h b/cores/realtek-ambz/base/lt_family.h new file mode 100644 index 000000000..205b9c80a --- /dev/null +++ b/cores/realtek-ambz/base/lt_family.h @@ -0,0 +1,28 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-02. */ + +#pragma once + +#include + +// Choose the main UART output port +#ifndef LT_UART_DEFAULT_PORT +#if LT_HW_UART2 +#define LT_UART_DEFAULT_PORT 2 +#elif LT_HW_UART0 +#define LT_UART_DEFAULT_PORT 0 +#elif LT_HW_UART1 +#define LT_UART_DEFAULT_PORT 1 +#else +#error "No serial port is available" +#endif +#endif + +// clang-format off +// Auto-download-reboot detection pattern +// Family ID, big-endian +#define LT_UART_ADR_PATTERN 0x55, 0xAA, \ + (FAMILY >> 24) & 0xFF, \ + (FAMILY >> 16) & 0xFF, \ + (FAMILY >> 8) & 0xFF, \ + (FAMILY >> 0) & 0xFF +// clang-format on diff --git a/cores/realtek-ambz/base/port/printf.c b/cores/realtek-ambz/base/port/printf.c new file mode 100644 index 000000000..01815cc77 --- /dev/null +++ b/cores/realtek-ambz/base/port/printf.c @@ -0,0 +1,44 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-19. */ + +#include + +#include + +#define LOG_UART_REG_BASE 0x40003000 +#define UART0_REG_BASE 0x40040000 +#define UART1_REG_BASE 0x40040400 +#define UART2_REG_BASE LOG_UART_REG_BASE + +extern uint32_t UART_Writable(void *UARTx); +extern void UART_CharPut(void *UARTx, uint8_t TxData); + +static void *uart_dev[3] = { + (void *)UART0_REG_BASE, + (void *)UART1_REG_BASE, + (void *)LOG_UART_REG_BASE, +}; + +uint8_t lt_uart_port = 2; + +void putchar_(char c) { + putchar_p(c, lt_uart_port); +} + +void putchar_p(char c, unsigned long port) { + while (UART_Writable(uart_dev[port]) == 0) {} + UART_CharPut(uart_dev[port], c); +} + +WRAP_PRINTF(rtl_printf); +WRAP_SPRINTF(rtl_sprintf); +WRAP_SNPRINTF(rtl_snprintf); +WRAP_VSNPRINTF(rtl_vsnprintf); +WRAP_VSNPRINTF(rtl_vsnprintf_r); +WRAP_VPRINTF(rtl_vprintf); +WRAP_PRINTF(DiagPrintf); +WRAP_SPRINTF(DiagSPrintf); +WRAP_SNPRINTF(DiagSnPrintf); +WRAP_PRINTF(prvDiagPrintf); +WRAP_SPRINTF(prvDiagSPrintf); +WRAP_VSPRINTF(VSprintf); +WRAP_PRINTF(LOG_PRINTF); diff --git a/cores/realtek-ambz/base/port/printf_port.h b/cores/realtek-ambz/base/port/printf_port.h new file mode 100644 index 000000000..74d770e1e --- /dev/null +++ b/cores/realtek-ambz/base/port/printf_port.h @@ -0,0 +1,18 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-20. */ + +#pragma once + +#include + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +WRAP_DISABLE_DEF(rtl_printf); +WRAP_DISABLE_DEF(DiagPrintf); +WRAP_DISABLE_DEF(prvDiagPrintf); +WRAP_DISABLE_DEF(LOG_PRINTF); + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/cores/realtek-ambz/base/sdk_extern.h b/cores/realtek-ambz/base/sdk_extern.h new file mode 100644 index 000000000..131f623f3 --- /dev/null +++ b/cores/realtek-ambz/base/sdk_extern.h @@ -0,0 +1,17 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-05-23. */ + +#pragma once + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +int LOGUART_SetBaud(uint32_t BaudRate); // from fixups/log_uart.c +void DumpForOneBytes(void *addr, int cnt); // cnt max 0x70! + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/cores/realtek-ambz/base/wraps/stdlib.c b/cores/realtek-ambz/base/wraps/stdlib.c new file mode 100644 index 000000000..20e785ccf --- /dev/null +++ b/cores/realtek-ambz/base/wraps/stdlib.c @@ -0,0 +1,115 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-14. */ + +#include + +#define ROM __attribute__((long_call)) + +ROM int prvAtoi(const char *str); +ROM long simple_strtol(const char *str, char **str_end, int base); +ROM unsigned long simple_strtoul(const char *str, char **str_end, int base); +ROM int Rand(); +ROM char *__rtl_strcat_v1_00(char *dest, const char *src); +ROM char *_strcpy(char *dest, const char *src); +ROM char *__rtl_strncat_v1_00(char *dest, const char *src, size_t count); +ROM char *_strncpy(char *dest, const char *src, size_t count); +ROM char *_strchr(const char *str, int ch); +ROM int prvStrCmp(const char *lhs, const char *rhs); +ROM size_t prvStrLen(const char *str); +ROM int _strncmp(const char *lhs, const char *rhs, size_t count); +ROM char *_strpbrk(const char *dest, const char *breakset); +ROM char *prvStrStr(const char *str, const char *substr); +ROM char *prvStrtok(char *str, const char *delim); +ROM void *__rtl_memchr_v1_00(const void *ptr, int ch, size_t count); +ROM int _memcmp(const void *lhs, const void *rhs, size_t count); +ROM void *_memcpy(void *dest, const void *src, size_t count); +ROM void *__rtl_memmove_v1_00(void *dest, const void *src, size_t count); +ROM void *_memset(void *dest, int ch, size_t count); +ROM char *_strsep(char **stringp, const char *delim); + +int __wrap_atoi(const char *str) { + return prvAtoi(str); +} + +long __wrap_atol(const char *str) { + return simple_strtol(str, NULL, 10); +} + +long __wrap_strtol(const char *str, char **str_end, int base) { + return simple_strtol(str, str_end, base); +} + +unsigned long __wrap_strtoul(const char *str, char **str_end, int base) { + return simple_strtoul(str, str_end, base); +} + +int __wrap_rand() { + return Rand(); +} + +char *__wrap_strcat(char *dest, const char *src) { + return __rtl_strcat_v1_00(dest, src); +} + +char *__wrap_strcpy(char *dest, const char *src) { + return _strcpy(dest, src); +} + +char *__wrap_strncat(char *dest, const char *src, size_t count) { + return __rtl_strncat_v1_00(dest, src, count); +} + +char *__wrap_strncpy(char *dest, const char *src, size_t count) { + return _strncpy(dest, src, count); +} + +char *__wrap_strchr(const char *str, int ch) { + return _strchr(str, ch); +} + +int __wrap_strcmp(const char *lhs, const char *rhs) { + return prvStrCmp(lhs, rhs); +} + +size_t __wrap_strlen(const char *str) { + return prvStrLen(str); +} + +int __wrap_strncmp(const char *lhs, const char *rhs, size_t count) { + return _strncmp(lhs, rhs, count); +} + +char *__wrap_strpbrk(const char *dest, const char *breakset) { + return _strpbrk(dest, breakset); +} + +char *__wrap_strstr(const char *str, const char *substr) { + return prvStrStr(str, substr); +} + +char *__wrap_strtok(char *str, const char *delim) { + return prvStrtok(str, delim); +} + +void *__wrap_memchr(const void *ptr, int ch, size_t count) { + return __rtl_memchr_v1_00(ptr, ch, count); +} + +int __wrap_memcmp(const void *lhs, const void *rhs, size_t count) { + return _memcmp(lhs, rhs, count); +} + +void *__wrap_memcpy(void *dest, const void *src, size_t count) { + return _memcpy(dest, src, count); +} + +void *__wrap_memmove(void *dest, const void *src, size_t count) { + return __rtl_memmove_v1_00(dest, src, count); +} + +void *__wrap_memset(void *dest, int ch, size_t count) { + return _memset(dest, ch, count); +} + +char *__wrap_strsep(char **stringp, const char *delim) { + return _strsep(stringp, delim); +} diff --git a/cores/realtek-ambz/misc/amebaz.cfg b/cores/realtek-ambz/misc/amebaz.cfg new file mode 100644 index 000000000..cd7aac6a2 --- /dev/null +++ b/cores/realtek-ambz/misc/amebaz.cfg @@ -0,0 +1,59 @@ +# Main file for AmebaZ series Cortex-M3 parts +# +# !!!!!! +# + +set CHIPNAME rtl8711b +set CHIPSERIES amebaz + +transport select swd + +# Adapt based on what transport is active. +source [find target/swj-dp.tcl] + +if { [info exists CHIPNAME] } { + set _CHIPNAME $CHIPNAME +} else { + error "CHIPNAME not set. Please do not include amebaz.cfg directly." +} + +if { [info exists CHIPSERIES] } { + # Validate chip series is supported + if { $CHIPSERIES != "amebaz" } { + error "Unsupported chip series specified." + } + set _CHIPSERIES $CHIPSERIES +} else { + error "CHIPSERIES not set. Please do not include amebaz.cfg directly." +} + +if { [info exists CPUTAPID] } { + # Allow user override + set _CPUTAPID $CPUTAPID +} else { + # Amebaz use a Cortex M4 core. + if { $_CHIPSERIES == "amebaz" } { + set _CPUTAPID 0x2ba01477 + } +} + +swj_newdap $_CHIPNAME cpu -irlen 4 -expected-id $_CPUTAPID + +set _TARGETNAME $_CHIPNAME.cpu +dap create $_CHIPNAME.dap -chain-position $_CHIPNAME.cpu + +set _ENDIAN little + +target create $_TARGETNAME cortex_m -endian $_ENDIAN -dap $_CHIPNAME.dap + +adapter speed 1000 +adapter srst delay 200 + +# AmebaZ (Cortex M4 core) support SYSRESETREQ +if {![using_hla]} { + # if srst is not fitted use SYSRESETREQ to + # perform a soft reset + cortex_m reset_config sysresetreq +} + +$_TARGETNAME configure -event reset-init {amebaz_init} diff --git a/cores/realtek-ambz/misc/boot_all_10C7.bin b/cores/realtek-ambz/misc/boot_all_10C7.bin new file mode 100644 index 0000000000000000000000000000000000000000..db3b9b20a066aae2a4a82802b4728cce7c760528 GIT binary patch literal 4120 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 B7=Qo( literal 0 HcmV?d00001 diff --git a/cores/realtek-ambz/misc/boot_all_77F7.bin b/cores/realtek-ambz/misc/boot_all_77F7.bin new file mode 100644 index 0000000000000000000000000000000000000000..5160f9111c1aebc3226deace0acbdc2fcb966163 GIT binary patch literal 4620 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 TuqdE)qsI)rH&LXuo7ev@o?mm1 literal 0 HcmV?d00001 diff --git a/cores/realtek-ambz/misc/export-rom_symbol_v01.txt b/cores/realtek-ambz/misc/export-rom_symbol_v01.txt new file mode 100644 index 000000000..5ab1c0cf7 --- /dev/null +++ b/cores/realtek-ambz/misc/export-rom_symbol_v01.txt @@ -0,0 +1,1427 @@ +SECTIONS +{ + __vectors_table = 0x0; + Reset_Handler = 0x101; + NMI_Handler = 0x115; + HardFault_Handler = 0x119; + MemManage_Handler = 0x12d; + BusFault_Handler = 0x131; + UsageFault_Handler = 0x135; + VSprintf = 0x201; + DiagPrintf = 0x4dd; + DiagSPrintf = 0x509; + DiagSnPrintf = 0x535; + prvDiagPrintf = 0x7ed; + prvDiagSPrintf = 0x821; + UARTIMG_Write = 0x855; + UARTIMG_Download = 0x901; + _memcmp = 0x991; + _memcpy = 0x9c5; + _memset = 0xa7d; + DumpForOneBytes = 0xae9; + CmdRomHelp = 0xc69; + CmdDumpWord = 0xccd; + CmdWriteWord = 0xd7d; + CmdFlash = 0xdd1; + CmdEfuse = 0x12c1; + CmdDumpByte = 0x1775; + CmdDumpHalfWord = 0x17c9; + CmdWriteByte = 0x1881; + SramReadWriteCpy = 0x18c1; + SramReadWriteTest = 0x19f9; + CmdSRamTest = 0x1ac9; + GetRomCmdNum = 0x1b59; + Rand = 0x1b5d; + Rand_Arc4 = 0x1bdd; + RandBytes_Get = 0x1c0d; + Isspace = 0x1c59; + Strtoul = 0x1c6d; + ArrayInitialize = 0x1d15; + GetArgc = 0x1d29; + GetArgv = 0x1d55; + UartLogCmdExecute = 0x1db1; + UartLogShowBackSpace = 0x1e49; + UartLogRecallOldCmd = 0x1e7d; + UartLogHistoryCmd = 0x1eb1; + UartLogCmdChk = 0x1f2d; + UartLogIrqHandle = 0x2035; + RtlConsolInit = 0x2101; + RtlConsolTaskRom = 0x218d; + RtlExitConsol = 0x21b9; + RtlConsolRom = 0x2205; + BKUP_Write = 0x2249; + BKUP_Read = 0x226d; + BKUP_Set = 0x228d; + BKUP_Clear = 0x22b9; + NCO32K_Init = 0x22e9; + EXT32K_Cmd = 0x2349; + NCO8M_Init = 0x2365; + NCO8M_Cmd = 0x23bd; + ISO_Set = 0x23d9; + PLL0_Set = 0x23f1; + PLL1_Set = 0x2409; + PLL2_Set = 0x2421; + PLL3_Set = 0x2439; + XTAL0_Set = 0x2451; + XTAL1_Set = 0x2469; + XTAL2_Set = 0x2481; + XTAL_ClkGet = 0x2499; + CPU_ClkSet = 0x24b1; + CPU_ClkGet = 0x24c5; + OSC32K_Calibration = 0x24e5; + OSC32K_Cmd = 0x25f9; + OSC8M_Get = 0x2631; + rtl_cryptoEngine_SrcDesc_Show = 0x2641; + rtl_cryptoEngine_info = 0x27f1; + rtl_cryptoEngine_init = 0x2949; + rtl_crypto_md5_init = 0x2975; + rtl_crypto_md5_process = 0x29b1; + rtl_crypto_md5 = 0x2a09; + rtl_crypto_sha1_init = 0x2a2d; + rtl_crypto_sha1_process = 0x2a69; + rtl_crypto_sha1 = 0x2a9d; + rtl_crypto_sha2_init = 0x2ac1; + rtl_crypto_sha2_process = 0x2b15; + rtl_crypto_sha2 = 0x2b4d; + rtl_crypto_hmac_md5_init = 0x2b71; + rtl_crypto_hmac_md5_process = 0x2bd1; + rtl_crypto_hmac_md5 = 0x2c0d; + rtl_crypto_hmac_sha1_init = 0x2c31; + rtl_crypto_hmac_sha1_process = 0x2c91; + rtl_crypto_hmac_sha1 = 0x2cc9; + rtl_crypto_hmac_sha2_init = 0x2ced; + rtl_crypto_hmac_sha2_process = 0x2d65; + rtl_crypto_hmac_sha2 = 0x2da1; + rtl_crypto_aes_cbc_init = 0x2dc5; + rtl_crypto_aes_cbc_encrypt = 0x2dfd; + rtl_crypto_aes_cbc_decrypt = 0x2e45; + rtl_crypto_aes_ecb_init = 0x2e8d; + rtl_crypto_aes_ecb_encrypt = 0x2ec5; + rtl_crypto_aes_ecb_decrypt = 0x2ef5; + rtl_crypto_aes_ctr_init = 0x2f25; + rtl_crypto_aes_ctr_encrypt = 0x2f5d; + rtl_crypto_aes_ctr_decrypt = 0x2f99; + rtl_crypto_3des_cbc_init = 0x2fd5; + rtl_crypto_3des_cbc_encrypt = 0x300d; + rtl_crypto_3des_cbc_decrypt = 0x3055; + rtl_crypto_3des_ecb_init = 0x309d; + rtl_crypto_3des_ecb_encrypt = 0x30d5; + rtl_crypto_3des_ecb_decrypt = 0x311d; + rtl_crypto_des_cbc_init = 0x3165; + rtl_crypto_des_cbc_encrypt = 0x319d; + rtl_crypto_des_cbc_decrypt = 0x31f5; + rtl_crypto_des_ecb_init = 0x324d; + rtl_crypto_des_ecb_encrypt = 0x3285; + rtl_crypto_des_ecb_decrypt = 0x32dd; + SYSTIMER_Init = 0x3335; + SYSTIMER_TickGet = 0x33a1; + SYSTIMER_GetPassTime = 0x33c1; + DelayNop = 0x3401; + DelayUs = 0x3411; + DelayMs = 0x346d; + USOC_DongleSpecialCmd = 0x3481; + USOC_DongleCmd = 0x35d9; + USOC_DongleIsr = 0x35f9; + USOC_SIE_INTConfig = 0x3621; + USOC_SIE_INTClear = 0x3639; + USOC_PHY_Write = 0x3645; + USOC_PHY_Read = 0x3679; + USOC_PHY_Autoload = 0x36c1; + USOC_DongleInit = 0x37a5; + EFUSE_USER_Read = 0x386d; + EFUSE_USER1_Read = 0x3971; + EFUSE_USER2_Read = 0x397d; + EFUSE_USER3_Read = 0x3989; + EFUSE_RemainLength = 0x3995; + EFUSE_USER_Write = 0x3a21; + EFUSE_USER1_Write = 0x3bb1; + EFUSE_USER2_Write = 0x3bc1; + EFUSE_USER3_Write = 0x3bd1; + EFUSE_OTP_Read1B = 0x3be1; + EFUSE_OTP_Write1B = 0x3c01; + EFUSE_OTP_Read32B = 0x3c21; + EFUSE_OTP_Write32B = 0x3c4d; + EFUSE_RDP_EN = 0x3cad; + EFUSE_RDP_KEY = 0x3ccd; + EFUSE_OTF_KEY = 0x3cf9; + EFUSE_JTAG_OFF = 0x3d25; + PAD_DrvStrength = 0x3d45; + PAD_PullCtrl = 0x3d75; + Pinmux_Config = 0x3dc5; + Pinmux_ConfigGet = 0x3dfd; + Pinmux_Deinit = 0x3e19; + PINMUX_UART0_Ctrl = 0x3e39; + PINMUX_UART1_Ctrl = 0x3e81; + PINMUX_UARTLOG_Ctrl = 0x3ea9; + PINMUX_SPI0_Ctrl = 0x3ef9; + PINMUX_SPI1_Ctrl = 0x3f8d; + PINMUX_SPIF_Ctrl = 0x400d; + PINMUX_I2C0_Ctrl = 0x406d; + PINMUX_I2C1_Ctrl = 0x40e1; + PINMUX_SDIOD_Ctrl = 0x4151; + PINMUX_I2S0_Ctrl = 0x41e5; + PINMUX_SWD_Ctrl = 0x4265; + PINMUX_SWD_OFF = 0x42b5; + PINMUX_SWD_REG = 0x42d9; + PINMUX_Ctrl = 0x42fd; + SOCPS_BackupCPUClk = 0x4391; + SOCPS_RestoreCPUClk = 0x43b1; + SOCPS_BootFromPS = 0x43d1; + SOCPS_TrapPin = 0x43f1; + SOCPS_ANACKSel = 0x4411; + SOCPS_CLKCal = 0x442d; + SOCPS_SetWakeEvent = 0x4485; + SOCPS_ClearWakeEvent = 0x449d; + SOCPS_WakePinsCtrl = 0x44a9; + SOCPS_WakePinCtrl = 0x44d9; + SOCPS_WakePinClear = 0x4529; + SOCPS_GetANATimerParam = 0x4539; + SOCPS_SetANATimer = 0x4575; + SOCPS_SetReguWakepin = 0x45dd; + SOCPS_SetReguTimer = 0x4605; + SOCPS_PWROption = 0x46d9; + SOCPS_PWROptionExt = 0x46e5; + SOCPS_PWRMode = 0x46f9; + SOCPS_SNZMode = 0x4721; + SOCPS_DeepStandby = 0x473d; + SOCPS_DeepSleep = 0x4791; + SDIO_StructInit = 0x47d5; + SDIO_Init = 0x47f1; + SDIO_INTClear = 0x486d; + SDIO_INTConfig = 0x487d; + SDIO_RPWM1_Get = 0x4895; + SDIO_RPWM2_Get = 0x48a1; + SDIO_CPWM1_Set = 0x48ad; + SDIO_CPWM2_Set = 0x48c1; + SDIO_RXBD_RPTR_Get = 0x48dd; + SDIO_RXBD_WPTR_Set = 0x48e9; + SDIO_TXBD_WPTR_Get = 0x48f5; + SDIO_TXBD_RPTR_Set = 0x4901; + SDIO_DMA_Reset = 0x490d; + BOOT_ROM_Simulation = 0x4919; + USOC_BOOT_TXBD_Proc = 0x491d; + USOC_BOOT_Init = 0x4a3d; + USB_Boot_ROM = 0x4aa9; + USOC_CH_Cmd = 0x4b59; + USOC_Cmd = 0x4bb1; + USOC_PHY_Cmd = 0x4bf5; + USOC_MODE_Cfg = 0x4c09; + USOC_TXBD_SWIDX_Cfg = 0x4c25; + USOC_TXBD_SWIDX_Get = 0x4c2d; + USOC_TXBD_HWIDX_Get = 0x4c35; + USOC_RXBD_HWIDX_Get = 0x4c3d; + USOC_RXBD_SWIDX_Cfg = 0x4c45; + USOC_RXBD_SWIDX_Get = 0x4c4d; + USOC_StructInit = 0x4c55; + USOC_Init = 0x4c85; + USOC_SW_RST = 0x4d7d; + USOC_INTCfg = 0x4d91; + USOC_INTClr = 0x4d95; + USOC_INTGet = 0x4d9d; + USOC_MIT_Cfg = 0x4da1; + USOC_TXSTUCK_Cfg = 0x4dc5; + USOC_RXSTUCK_Cfg = 0x4de9; + USOC_POWER_On = 0x4e0d; + ADC_RXGDMA_Init = 0x4e9d; + ADC_SetAudio = 0x4f45; + ADC_SetAnalog = 0x4f61; + ADC_Cmd = 0x4fbd; + ADC_INTConfig = 0x5031; + ADC_SetOneShot = 0x5049; + ADC_SetComp = 0x50fd; + ADC_INTClear = 0x517d; + ADC_INTClearPendingBits = 0x5189; + ADC_GetISR = 0x5195; + ADC_Read = 0x51a1; + ADC_ReceiveBuf = 0x51ad; + ADC_InitStruct = 0x5205; + ADC_Init = 0x524d; + BOOT_ROM_ShowBuildInfo = 0x52ed; + BOOT_ROM_OTFCheck = 0x5335; + BOOT_ROM_InitFlash = 0x5345; + BOOT_ROM_FromFlash = 0x5405; + BOOT_ROM_InitUsb = 0x5511; + BOOT_ROM_Process = 0x553d; + BOOT_ROM_InitDebugFlg = 0x5605; + HalResetVsr = 0x5639; + Cache_Enable = 0x5811; + Cache_Flush = 0x5831; + Cache_Debug = 0x5851; + CRYPTO_AlignToBe32 = 0x58bd; + CRYPTO_MemDump = 0x58d5; + CRYPTO_GetAESKey = 0x599d; + CRYPTO_SetAESKey = 0x5cb5; + CRYPTO_SetSecurityMode = 0x5d29; + CRYPTO_Init = 0x5f5d; + CRYPTO_DeInit = 0x60b9; + CRYPTO_Reset = 0x6101; + CRYPTO_Process = 0x6129; + CRYPTO_CipherInit = 0x6a11; + CRYPTO_CipherEncrypt = 0x6a35; + CRYPTO_CipherDecrypt = 0x6a61; + CRYPTO_SetCheckSumEn = 0x6a95; + CRYPTO_GetCheckSumData = 0x6ab1; + LOGUART_StructInit = 0x6abd; + LOGUART_Init = 0x6ad5; + LOGUART_PutChar = 0x6b15; + LOGUART_GetChar = 0x6b49; + LOGUART_GetIMR = 0x6b65; + LOGUART_SetIMR = 0x6b71; + LOGUART_WaitBusy = 0x6b7d; + DIAG_UartInit = 0x6b9d; + DIAG_UartReInit = 0x6c25; + EFUSE_PowerSwitchROM = 0x6c49; + EFUSE_OneByteReadROM = 0x6d65; + EFUSE_OneByteWriteROM = 0x6e0d; + EFUSE_PG_Packet = 0x6e29; + EFUSE_LogicalMap_Read = 0x7091; + EFUSE_LogicalMap_Write = 0x71f5; + FLASH_SetSpiMode = 0x73dd; + FLASH_RxCmd = 0x7465; + FLASH_WaitBusy = 0x74cd; + FLASH_RxData = 0x754d; + FLASH_TxCmd = 0x75cd; + FLASH_WriteEn = 0x763d; + FLASH_TxData12B = 0x7661; + FLASH_SetStatus = 0x7735; + FLASH_Erase = 0x7755; + FLASH_DeepPowerDown = 0x77f5; + FLASH_SetStatusBits = 0x784d; + FLASH_Calibration = 0x791d; + FLASH_StructInit_Micron = 0x7a65; + FLASH_StructInit_MXIC = 0x7af5; + FLASH_StructInit_GD = 0x7b81; + FLASH_StructInit = 0x7c11; + FLASH_Init = 0x7ca1; + FLASH_ClockDiv = 0x7d15; + FLASH_CalibrationInit = 0x7d99; + FLASH_Calibration500MPSCmd = 0x7db1; + FLASH_CalibrationPhase = 0x7dcd; + FLASH_CalibrationPhaseIdx = 0x7e59; + FLASH_CalibrationNewCmd = 0x7e6d; + FLASH_CalibrationNew = 0x7ea9; + GDMA_StructInit = 0x80dd; + GDMA_SetLLP = 0x80f9; + GDMA_ClearINTPendingBit = 0x8191; + GDMA_ClearINT = 0x81d5; + GDMA_INTConfig = 0x8211; + GDMA_Cmd = 0x8259; + GDMA_Init = 0x828d; + GDMA_ChCleanAutoReload = 0x83c1; + GDMA_SetSrcAddr = 0x83f9; + GDMA_GetSrcAddr = 0x8411; + GDMA_GetDstAddr = 0x8429; + GDMA_SetDstAddr = 0x843d; + GDMA_SetBlkSize = 0x8459; + GDMA_GetBlkSize = 0x8489; + GDMA_ChnlRegister = 0x84a1; + GDMA_ChnlUnRegister = 0x8529; + GDMA_ChnlAlloc = 0x8591; + GDMA_ChnlFree = 0x8615; + GPIO_INTMode = 0x864d; + GPIO_INTConfig = 0x86e5; + GPIO_INTHandler = 0x8725; + GPIO_Direction = 0x8771; + GPIO_Init = 0x87a1; + GPIO_DeInit = 0x886d; + GPIO_ReadDataBit = 0x88c9; + GPIO_WriteBit = 0x88ed; + GPIO_PortDirection = 0x891d; + GPIO_PortRead = 0x893d; + GPIO_PortWrite = 0x894d; + GPIO_UserRegIrq = 0x8969; + I2C_StructInit = 0x899d; + I2C_SetSpeed = 0x89e5; + I2C_SetSlaveAddress = 0x8b3d; + I2C_CheckFlagState = 0x8b79; + I2C_INTConfig = 0x8bad; + I2C_ClearINT = 0x8be5; + I2C_ClearAllINT = 0x8c85; + I2C_Init = 0x8cad; + I2C_GetRawINT = 0x8dc9; + I2C_GetINT = 0x8df1; + I2C_MasterSendNullData = 0x8e19; + I2C_MasterSend = 0x8e65; + I2C_SlaveSend = 0x8ead; + I2C_ReceiveData = 0x8ed9; + I2C_MasterWrite = 0x8f05; + I2C_MasterReadDW = 0x8f89; + I2C_MasterRead = 0x9019; + I2C_SlaveWrite = 0x9089; + I2C_SlaveRead = 0x90f1; + I2C_MasterRepeatRead = 0x9141; + I2C_Cmd = 0x91c1; + I2C_PinMuxInit = 0x91fd; + I2C_PinMuxDeInit = 0x9255; + I2C_DMAControl = 0x92ad; + I2C_DmaMode1Config = 0x92e9; + I2C_DmaMode2Config = 0x9331; + I2C_TXGDMA_Init = 0x9375; + I2C_RXGDMA_Init = 0x9459; + I2C_Sleep_Cmd = 0x9521; + I2C_WakeUp = 0x95a1; + I2S_StructInit = 0x95e9; + I2S_Cmd = 0x9611; + I2S_TxDmaCmd = 0x962d; + I2S_RxDmaCmd = 0x9641; + I2S_INTConfig = 0x9655; + I2S_INTClear = 0x965d; + I2S_INTClearAll = 0x9665; + I2S_Init = 0x9671; + I2S_ISRGet = 0x97a9; + I2S_SetRate = 0x97b5; + I2S_SetWordLen = 0x9811; + I2S_SetChNum = 0x9839; + I2S_SetPageNum = 0x9861; + I2S_SetPageSize = 0x9895; + I2S_GetPageSize = 0x98a9; + I2S_SetDirection = 0x98b5; + I2S_SetDMABuf = 0x98dd; + I2S_TxPageBusy = 0x9905; + I2S_GetTxPage = 0x9911; + I2S_GetRxPage = 0x991d; + I2S_SetTxPageAddr = 0x9929; + I2S_GetTxPageAddr = 0x9939; + I2S_SetRxPageAddr = 0x9949; + I2S_GetRxPageAddr = 0x9959; + I2S_TxPageDMA_EN = 0x9969; + I2S_RxPageDMA_EN = 0x998d; + io_assert_failed = 0x99d9; + OTF_init = 0x99fd; + OTF_Cmd = 0x9a79; + OTF_Mask = 0x9a8d; + KEY_Request = 0x9add; + RDP_EN_Request = 0x9b21; + RCC_PeriphClockCmd = 0x9b65; + FUNC_HCI_COM = 0x9c95; + RTC_ByteToBcd2 = 0x9cad; + RTC_Bcd2ToByte = 0x9cc9; + RTC_ClokSource = 0x9cdd; + RTC_EnterInitMode = 0x9d19; + RTC_ExitInitMode = 0x9d51; + RTC_WaitForSynchro = 0x9d61; + RTC_BypassShadowCmd = 0x9da9; + RTC_StructInit = 0x9dd9; + RTC_Init = 0x9de5; + RTC_TimeStructInit = 0x9e7d; + RTC_SetTime = 0x9e8d; + RTC_GetTime = 0x9ff9; + RTC_SetAlarm = 0xa051; + RTC_AlarmStructInit = 0xa211; + RTC_GetAlarm = 0xa231; + RTC_AlarmCmd = 0xa2a1; + RTC_AlarmClear = 0xa2f5; + RTC_DayLightSavingConfig = 0xa305; + RTC_GetStoreOperation = 0xa355; + RTC_OutputConfig = 0xa365; + RTC_SmoothCalibConfig = 0xa39d; + SDIO_IsTimeout = 0xa459; + SDIOB_Init = 0xa481; + SDIOB_INTConfig = 0xa575; + SDIOB_DeInit = 0xa591; + SDIOB_H2C_WriteMem = 0xa5d9; + SDIOB_H2C_SetMem = 0xa605; + SDIOB_H2C_DataHandle = 0xa631; + SDIOB_H2C_DataReady = 0xa73d; + SDIOB_IRQ_Handler_BH = 0xa80d; + SDIOB_H2C_Task = 0xa8c9; + SDIO_Boot_Up = 0xa8e5; + SPI_DmaInit = 0xa91d; + SPI_DataHandle = 0xa9d1; + SPI_Boot_DmaRxIrqHandle = 0xaa01; + SPI_Boot_ROM = 0xaa5d; + SSI_StructInit = 0xabbd; + SSI_Cmd = 0xabf5; + SSI_INTConfig = 0xac09; + SSI_SetSclkPolarity = 0xac19; + SSI_SetSclkPhase = 0xac3d; + SSI_SetDataFrameSize = 0xac61; + SSI_SetReadLen = 0xac81; + SSI_SetBaudDiv = 0xacb1; + SSI_SetBaud = 0xaccd; + SSI_SetDmaEnable = 0xad2d; + SSI_SetDmaLevel = 0xad41; + SSI_SetIsrClean = 0xad49; + SSI_WriteData = 0xad65; + SSI_SetRxFifoLevel = 0xad6d; + SSI_SetTxFifoLevel = 0xad71; + SSI_ReadData = 0xad75; + SSI_GetRxCount = 0xad79; + SSI_GetTxCount = 0xad81; + SSI_GetStatus = 0xad89; + SSI_Writeable = 0xad8d; + SSI_Readable = 0xad9d; + SSI_GetDataFrameSize = 0xadad; + SSI_TXGDMA_Init = 0xadb9; + SSI_RXGDMA_Init = 0xaef9; + SSI_ReceiveData = 0xb021; + SSI_SendData = 0xb0b9; + SSI_Busy = 0xb165; + SSI_SetSlaveEnable = 0xb175; + SSI_Init = 0xb1ad; + SSI_GetIsr = 0xb235; + SSI_GetRawIsr = 0xb239; + SSI_GetSlaveEnable = 0xb23d; + SSI_PinmuxInit = 0xb241; + SSI_PinmuxDeInit = 0xb2a9; + SYSCFG0_Get = 0xb311; + SYSCFG0_CUTVersion = 0xb31d; + SYSCFG0_BDOption = 0xb32d; + SYSCFG1_Get = 0xb33d; + SYSCFG1_AutoLoadDone = 0xb349; + SYSCFG1_TRP_LDOMode = 0xb359; + SYSCFG1_TRP_UARTImage = 0xb369; + SYSCFG1_TRP_ICFG = 0xb37d; + SYSCFG2_Get = 0xb389; + SYSCFG2_ROMINFO_Get = 0xb395; + SYSCFG2_ROMINFO_Set = 0xb3a1; + RTIM_TimeBaseStructInit = 0xb3b5; + RTIM_Cmd = 0xb3cd; + RTIM_GetCount = 0xb42d; + RTIM_UpdateDisableConfig = 0xb475; + RTIM_ARRPreloadConfig = 0xb4c5; + RTIM_UpdateRequestConfig = 0xb515; + RTIM_PrescalerConfig = 0xb575; + RTIM_GenerateEvent = 0xb5a1; + RTIM_ChangePeriod = 0xb5f9; + RTIM_Reset = 0xb64d; + RTIM_CCStructInit = 0xb68d; + RTIM_CCxInit = 0xb6a1; + RTIM_CCRxMode = 0xb749; + RTIM_CCRxSet = 0xb785; + RTIM_CCRxGet = 0xb7dd; + RTIM_OCxPreloadConfig = 0xb80d; + RTIM_CCxPolarityConfig = 0xb85d; + RTIM_CCxCmd = 0xb8ad; + RTIM_SetOnePulseOutputMode = 0xb901; + RTIM_DMACmd = 0xb959; + RTIM_TXGDMA_Init = 0xb9a9; + RTIM_RXGDMA_Init = 0xba5d; + RTIM_INTConfig = 0xbb3d; + RTIM_INTClear = 0xbba9; + RTIM_TimeBaseInit = 0xbbed; + RTIM_DeInit = 0xbced; + RTIM_INTClearPendingBit = 0xbd41; + RTIM_GetFlagStatus = 0xbd81; + RTIM_GetINTStatus = 0xbded; + UART_DeInit = 0xbe61; + UART_StructInit = 0xbe69; + UART_BaudParaGet = 0xbe81; + UART_BaudParaGetFull = 0xbec9; + UART_SetBaud = 0xbf01; + UART_SetBaudExt = 0xbf71; + UART_SetRxLevel = 0xbfc1; + UART_RxCmd = 0xbfe9; + UART_Writable = 0xbffd; + UART_Readable = 0xc005; + UART_CharPut = 0xc00d; + UART_CharGet = 0xc011; + UART_ReceiveData = 0xc019; + UART_SendData = 0xc041; + UART_ReceiveDataTO = 0xc069; + UART_SendDataTO = 0xc0a9; + UART_RxByteCntClear = 0xc0e9; + UART_RxByteCntGet = 0xc0f5; + UART_BreakCtl = 0xc0fd; + UART_ClearRxFifo = 0xc111; + UART_Init = 0xc135; + UART_ClearTxFifo = 0xc1d1; + UART_INTConfig = 0xc1dd; + UART_IntStatus = 0xc1ed; + UART_ModemStatusGet = 0xc1f1; + UART_LineStatusGet = 0xc1f5; + UART_WaitBusy = 0xc1f9; + UART_PinMuxInit = 0xc221; + UART_PinMuxDeinit = 0xc289; + UART_TXDMAConfig = 0xc2f1; + UART_RXDMAConfig = 0xc301; + UART_TXDMACmd = 0xc315; + UART_RXDMACmd = 0xc329; + UART_TXGDMA_Init = 0xc33d; + UART_RXGDMA_Init = 0xc425; + UART_LPRxStructInit = 0xc501; + UART_LPRxInit = 0xc50d; + UART_LPRxBaudSet = 0xc575; + UART_LPRxMonitorCmd = 0xc5f1; + UART_LPRxpathSet = 0xc62d; + UART_LPRxIPClockSet = 0xc641; + UART_LPRxCmd = 0xc6b1; + UART_LPRxMonBaudCtrlRegGet = 0xc6c5; + UART_LPRxMonitorSatusGet = 0xc6c9; + UART_IrDAStructInit = 0xc6cd; + UART_IrDAInit = 0xc6e5; + UART_IrDACmd = 0xc7bd; + INT_SysOn = 0xc7d1; + INT_Wdg = 0xc811; + INT_Timer0 = 0xc855; + INT_Timer1 = 0xc899; + INT_Timer2 = 0xc8dd; + INT_Timer3 = 0xc921; + INT_SPI0 = 0xc965; + INT_GPIO = 0xc9a9; + INT_Uart0 = 0xc9ed; + INT_SPIFlash = 0xca31; + INT_Uart1 = 0xca75; + INT_Timer4 = 0xcab9; + INT_I2S0 = 0xcafd; + INT_Timer5 = 0xcb41; + INT_WlDma = 0xcb85; + INT_WlProtocol = 0xcbc9; + INT_IPSEC = 0xcc0d; + INT_SPI1 = 0xcc51; + INT_Peripheral = 0xcc95; + INT_Gdma0Ch0 = 0xccd9; + INT_Gdma0Ch1 = 0xcd1d; + INT_Gdma0Ch2 = 0xcd61; + INT_Gdma0Ch3 = 0xcda5; + INT_Gdma0Ch4 = 0xcde9; + INT_Gdma0Ch5 = 0xce2d; + INT_I2C0 = 0xce71; + INT_I2C1 = 0xceb5; + INT_Uartlog = 0xcef9; + INT_ADC = 0xcf3d; + INT_RDP = 0xcf81; + INT_RTC = 0xcfc5; + INT_Gdma1Ch0 = 0xd009; + INT_Gdma1Ch1 = 0xd051; + INT_Gdma1Ch2 = 0xd099; + INT_Gdma1Ch3 = 0xd0e1; + INT_Gdma1Ch4 = 0xd129; + INT_Gdma1Ch5 = 0xd171; + INT_USB = 0xd1b9; + INT_RXI300 = 0xd201; + INT_USB_SIE = 0xd249; + INT_SdioD = 0xd291; + INT_NMI = 0xd2d1; + INT_HardFault = 0xd305; + INT_MemManage = 0xd4b5; + INT_BusFault = 0xd4d5; + INT_UsageFault = 0xd4f5; + VECTOR_TableInit = 0xd515; + VECTOR_TableInitForOS = 0xd6c5; + VECTOR_IrqRegister = 0xd6d5; + VECTOR_IrqUnRegister = 0xd6f9; + VECTOR_IrqEn = 0xd715; + VECTOR_IrqDis = 0xd765; + WDG_Scalar = 0xd7a1; + WDG_Init = 0xd7e1; + WDG_IrqClear = 0xd7fd; + WDG_IrqInit = 0xd80d; + WDG_Cmd = 0xd83d; + WDG_Refresh = 0xd85d; + _strncpy = 0xd86d; + _strcpy = 0xd889; + prvStrCpy = 0xd899; + _strlen = 0xd8b1; + _strnlen = 0xd8c9; + prvStrLen = 0xd8fd; + _strcmp = 0xd919; + _strncmp = 0xd939; + prvStrCmp = 0xd985; + StrUpr = 0xd9b5; + prvAtoi = 0xd9d1; + prvStrtok = 0xda29; + prvStrStr = 0xda81; + _strsep = 0xdab9; + skip_spaces = 0xdaf5; + skip_atoi = 0xdb11; + _parse_integer_fixup_radix = 0xdb49; + _parse_integer = 0xdb9d; + simple_strtoull = 0xdc01; + simple_strtoll = 0xdc21; + simple_strtoul = 0xdc41; + simple_strtol = 0xdc49; + _vsscanf = 0xdc61; + _sscanf = 0xe1c9; + div_u64 = 0xe1e5; + div_s64 = 0xe1ed; + div_u64_rem = 0xe1f5; + div_s64_rem = 0xe205; + _strpbrk = 0xe215; + _strchr = 0xe241; + COMMPORT_GET_T = 0xe259; + COMMPORT_CLEAN_RX = 0xe289; + xModemDebugInit = 0xe2a5; + xModemDebug = 0xe2dd; + xModemInquiry = 0xe315; + xModemGetFirst = 0xe339; + xModemGetOthers = 0xe45d; + xModemRxFrame = 0xe691; + xModemHandshake = 0xe6d5; + xModemRxBuffer = 0xe945; + xmodem_log_close = 0xe9f5; + xmodem_log_open = 0xea01; + xmodem_uart_init = 0xea39; + xmodem_uart_deinit = 0xeb25; + xmodem_uart_port_init = 0xeb35; + xmodem_uart_port_deinit = 0xeb99; + xmodem_uart_readable = 0xebdd; + xmodem_uart_writable = 0xebf5; + xmodem_uart_getc = 0xec0d; + xmodem_uart_putc = 0xec35; + xmodem_uart_putdata = 0xec49; + aes_set_key = 0xec65; + aes_encrypt = 0xf021; + aes_decrypt = 0x10171; + AES_WRAP = 0x112b1; + AES_UnWRAP = 0x113fd; + crc32_get = 0x11549; + arc4_byte = 0x1157d; + rt_arc4_init = 0x115a5; + rt_arc4_crypt = 0x115e9; + rt_md5_init = 0x11df5; + rt_md5_append = 0x11e25; + rt_md5_final = 0x11ec9; + rt_md5_hmac = 0x11f21; + RC4 = 0x12061; + RC4_set_key = 0x1238d; + ROM_WIFI_ReadPowerValue = 0x1246d; + ROM_WIFI_EfuseParseTxPowerInfo = 0x1251d; + ROM_WIFI_8051Reset = 0x125c5; + ROM_WIFI_FWDownloadEnable = 0x125dd; + ROM_WIFI_BlockWrite = 0x12619; + ROM_WIFI_PageWrite = 0x12661; + ROM_WIFI_FillDummy = 0x12685; + ROM_WIFI_WriteFW = 0x126b1; + ROM_WIFI_FWFreeToGo = 0x1275d; + ROM_WIFI_InitLLTTable = 0x127f9; + ROM_WIFI_GetChnlGroup = 0x12879; + ROM_WIFI_BWMapping = 0x129f1; + ROM_WIFI_SCMapping = 0x12a19; + ROM_WIFI_FillTxdescSectype = 0x12a99; + ROM_WIFI_FillFakeTxdesc = 0x12ab9; + ROM_WIFI_32K_Cmd = 0x12b91; + ROM_WIFI_DISCONNECT = 0x12bc1; + ROM_WIFI_SET_TSF = 0x12bfd; + ROM_WIFI_BCN_FUNC = 0x12ca5; + ROM_WIFI_BSSID_SET = 0x12ccd; + ROM_WIFI_MACADDR_SET = 0x12d09; + ROM_WIFI_EnableInterrupt = 0x12d39; + ROM_WIFI_DisableInterrupt = 0x12d4d; + ROM_WIFI_RESUME_TxBeacon = 0x12d61; + ROM_WIFI_STOP_TXBeacon = 0x12d91; + ROM_WIFI_BCN_Interval = 0x12dc1; + ROM_WIFI_BCN_FUNC_Enable = 0x12dcd; + ROM_WIFI_INIT_BeaconParameters = 0x12de5; + ROM_WIFI_MEDIA_STATUS1 = 0x12e35; + ROM_WIFI_MEDIA_STATUS = 0x12e4d; + ROM_WIFI_SetBrateCfg = 0x12e61; + ROM_WIFI_BASIC_RATE = 0x12f69; + ROM_WIFI_CHECK_BSSID = 0x12fc9; + ROM_WIFI_RESP_SIFS = 0x12fe9; + ROM_WIFI_CAM_WRITE = 0x13001; + ROM_WIFI_ACM_CTRL = 0x13021; + ROM_WIFI_FIFO_CLEARN_UP = 0x13051; + ROM_WIFI_CHECK_TXBUF = 0x130b9; + ROM_WIFI_BCN_VALID = 0x130fd; + ROM_WIFI_PROMISC_Cmd = 0x13119; + ROM_WIFI_SetOpmodeAP = 0x13189; + ROM_WIFI_ReadChipVersion = 0x132a9; + ROM_WIFI_DumpChipInfo = 0x1330d; + ROM_WIFI_InitLxDma = 0x135b1; + ROM_WIFI_InitQueueReservedPage = 0x13671; + ROM_WIFI_InitTxBufferBoundary = 0x136f1; + ROM_WIFI_InitNormalChipRegPriority = 0x1373d; + ROM_WIFI_InitPageBoundary = 0x13789; + ROM_WIFI_InitTransferPageSize = 0x13795; + ROM_WIFI_InitDriverInfoSize = 0x137a1; + ROM_WIFI_InitNetworkType = 0x137ad; + ROM_WIFI_InitRCR = 0x137c5; + ROM_WIFI_InitAdaptiveCtrl = 0x13805; + ROM_WIFI_InitSIFS = 0x1383d; + ROM_WIFI_InitEDCA = 0x13865; + ROM_WIFI_InitRateFallback = 0x138a1; + ROM_WIFI_InitRetryFunction = 0x138c9; + ROM_WIFI_InitOperationMode = 0x138e5; + ROM_WIFI_InitBurstPktLen = 0x138f9; + phy_CalculateBitShift = 0x13905; + PHY_SetBBReg_8711B = 0x1391d; + PHY_QueryBBReg_8711B = 0x13921; + ROM_odm_QueryRxPwrPercentage = 0x13925; + ROM_odm_EVMdbToPercentage = 0x13931; + ROM_odm_SignalScaleMapping_8711B = 0x13935; + ROM_odm_FalseAlarmCounterStatistics = 0x13a11; + ROM_odm_SetEDCCAThreshold = 0x13d39; + ROM_odm_SetTRxMux = 0x13d61; + ROM_odm_SetCrystalCap = 0x13d89; + ROM_odm_GetDefaultCrytaltalCap = 0x13ded; + ROM_ODM_CfoTrackingReset = 0x13dfd; + ROM_odm_CfoTrackingFlow = 0x13e21; + rtw_get_bit_value_from_ieee_value = 0x14045; + rtw_is_cckrates_included = 0x14071; + rtw_is_cckratesonly_included = 0x140a5; + rtw_check_network_type = 0x140cd; + rtw_set_fixed_ie = 0x14155; + rtw_set_ie = 0x14175; + rtw_get_ie = 0x141a1; + rtw_set_supported_rate = 0x141b5; + rtw_get_rateset_len = 0x14229; + rtw_get_wpa_ie = 0x14245; + rtw_get_wpa2_ie = 0x142d1; + rtw_get_wpa_cipher_suite = 0x142e5; + rtw_get_wpa2_cipher_suite = 0x1434d; + rtw_parse_wpa_ie = 0x143b5; + rtw_parse_wpa2_ie = 0x14481; + rtw_get_sec_ie = 0x14535; + rtw_get_wps_ie = 0x145e5; + rtw_get_wps_attr = 0x14659; + rtw_get_wps_attr_content = 0x146f1; + rtw_ieee802_11_parse_elems = 0x14739; + str_2char2num = 0x14909; + key_2char2num = 0x14925; + convert_ip_addr = 0x1493d; + rom_psk_PasswordHash = 0x14a21; + rom_psk_CalcGTK = 0x14a59; + rom_psk_CalcPTK = 0x14ae9; + _htons_rom = 0x14bdd; + _ntohs_rom = 0x14be5; + _htonl_rom = 0x14bed; + _ntohl_rom = 0x14bf1; + Message_ReplayCounter_OC2LI = 0x14bf5; + Message_EqualReplayCounter = 0x14c35; + Message_SmallerEqualReplayCounter = 0x14c6d; + Message_LargerReplayCounter = 0x14cad; + Message_setReplayCounter = 0x14ce5; + INCLargeInteger = 0x14d15; + INCOctet16_INTEGER = 0x14d25; + INCOctet32_INTEGER = 0x14d8d; + SetEAPOL_KEYIV = 0x14df5; + CheckMIC = 0x14e89; + CalcMIC = 0x14f29; + DecWPA2KeyData_rom = 0x14f9d; + DecGTK = 0x15055; + GetRandomBuffer = 0x15119; + GenNonce = 0x15181; + ClientConstructEAPOL_2Of4Way = 0x151c5; + ClientConstructEAPOL_4Of4Way = 0x152cd; + ClientConstructEAPOL_2Of2Way = 0x1537d; + ClientConstructEAPOL_MICOf2Way = 0x15459; + psk_strip_rsn_pairwise = 0x1552d; + psk_strip_wpa_pairwise = 0x155c1; + wep_80211_encrypt = 0x1587d; + wep_80211_decrypt = 0x158e1; + tkip_micappendbyte = 0x15975; + rtw_secmicsetkey = 0x159b9; + rtw_secmicappend = 0x159f9; + rtw_secgetmic = 0x15a15; + rtw_seccalctkipmic = 0x15a89; + tkip_phase1 = 0x15b7d; + tkip_phase2 = 0x15ce5; + tkip_80211_encrypt = 0x15f01; + tkip_80211_decrypt = 0x15f91; + aes1_encrypt = 0x16055; + aesccmp_construct_mic_iv = 0x1625d; + aesccmp_construct_mic_header1 = 0x162b1; + aesccmp_construct_mic_header2 = 0x16321; + aesccmp_construct_ctr_preload = 0x163a5; + aes_80211_encrypt = 0x16429; + aes_80211_decrypt = 0x167f9; + cckrates_included = 0x16c39; + cckratesonly_included = 0x16c7d; + networktype_to_raid_ex_rom = 0x16ca9; + judge_network_type_rom = 0x16cf5; + ratetbl_val_2wifirate = 0x16d89; + is_basicrate_rom = 0x16d9d; + ratetbl2rateset_rom = 0x16dd5; + get_rate_set_rom = 0x16e3d; + UpdateBrateTbl_rom = 0x16e71; + UpdateBrateTblForSoftAP = 0x16ec9; + write_cam_rom = 0x16f0d; + HT_caps_handler_rom = 0x16fc1; + wifirate2_ratetbl_inx = 0x17015; + update_basic_rate = 0x170bd; + update_supported_rate = 0x170f5; + update_MCS_rate = 0x17125; + get_highest_rate_idx = 0x17131; + _sha1_process_message_block = 0x1714d; + _sha1_pad_message = 0x172d1; + rt_sha1_init = 0x1736d; + rt_sha1_update = 0x173b1; + rt_sha1_finish = 0x17429; + rt_hmac_sha1 = 0x17489; + rom_aes_128_cbc_encrypt = 0x175e5; + rom_aes_128_cbc_decrypt = 0x17669; + rom_rijndaelKeySetupEnc = 0x176ed; + rom_aes_decrypt_init = 0x177c1; + rom_aes_internal_decrypt = 0x17899; + rom_aes_decrypt_deinit = 0x17bdd; + rom_aes_encrypt_init = 0x17be9; + rom_aes_internal_encrypt = 0x17c01; + rom_aes_encrypt_deinit = 0x17f81; + bignum_init = 0x1963d; + bignum_deinit = 0x19665; + bignum_get_unsigned_bin_len = 0x19685; + bignum_get_unsigned_bin = 0x19689; + bignum_set_unsigned_bin = 0x19741; + bignum_cmp = 0x197f9; + bignum_cmp_d = 0x197fd; + bignum_add = 0x19825; + bignum_sub = 0x19835; + bignum_mul = 0x19845; + bignum_exptmod = 0x19855; + WPS_realloc = 0x19879; + os_zalloc = 0x198bd; + rom_hmac_sha256_vector = 0x198e1; + rom_hmac_sha256 = 0x199e1; + rom_sha256_vector = 0x19b3d; + CRYPTO_chacha_20 = 0x19d45; + rom_ed25519_gen_keypair = 0x1a1bd; + rom_ed25519_gen_signature = 0x1a1c1; + rom_ed25519_verify_signature = 0x1a1d9; + rom_ed25519_ge_double_scalarmult_vartime = 0x1c4c9; + rom_ed25519_ge_frombytes_negate_vartime = 0x1c8c1; + rom_ed25519_ge_p3_tobytes = 0x1d43d; + rom_ed25519_ge_scalarmult_base = 0x1d489; + rom_ed25519_ge_tobytes = 0x1d64d; + rom_ed25519_crypto_sign_seed_keypair = 0x1d699; + rom_ed25519_crypto_sign_verify_detached = 0x1d6f1; + rom_ed25519_sc_muladd = 0x1d9e5; + rom_ed25519_sc_reduce = 0x24175; + rom_ed25519_crypto_sign_detached = 0x26c25; + CRYPTO_poly1305_init = 0x270dd; + CRYPTO_poly1305_update = 0x271b5; + CRYPTO_poly1305_finish = 0x27245; + rom_sha512_starts = 0x28511; + rom_sha512_update = 0x28659; + rom_sha512_finish = 0x28661; + rom_sha512 = 0x288a9; + rom_sha512_hmac_starts = 0x288e1; + rom_sha512_hmac_update = 0x289a5; + rom_sha512_hmac_finish = 0x289ad; + rom_sha512_hmac_reset = 0x289fd; + rom_sha512_hmac = 0x28a19; + rom_sha512_hkdf = 0x28a51; + aes_test_alignment_detection = 0x28b59; + aes_mode_reset = 0x28bbd; + aes_ecb_encrypt = 0x28bc9; + aes_ecb_decrypt = 0x28c05; + aes_cbc_encrypt = 0x28c41; + aes_cbc_decrypt = 0x28dad; + aes_cfb_encrypt = 0x28f49; + aes_cfb_decrypt = 0x2920d; + aes_ofb_crypt = 0x294d5; + aes_ctr_crypt = 0x29769; + aes_encrypt_key128 = 0x29a79; + aes_encrypt_key192 = 0x29a95; + aes_encrypt_key256 = 0x29ab1; + aes_encrypt_key = 0x29ad1; + aes_decrypt_key128 = 0x29b41; + aes_decrypt_key192 = 0x29b5d; + aes_decrypt_key256 = 0x29b79; + aes_decrypt_key = 0x29b99; + aes_init = 0x29c09; + curve25519_donna = 0x2a939; + __rtl_dtoa_r_v1_00 = 0x2b7f1; + __rtl_ltoa_v1_00 = 0x2c7f9; + __rtl_ultoa_v1_00 = 0x2c885; + __rtl_dtoi_v1_00 = 0x2c8ed; + __rtl_dtoi64_v1_00 = 0x2c96d; + __rtl_dtoui_v1_00 = 0x2ca09; + __rtl_ftol_v1_00 = 0x2ca11; + __rtl_itof_v1_00 = 0x2ca75; + __rtl_itod_v1_00 = 0x2cb05; + __rtl_i64tod_v1_00 = 0x2cb71; + __rtl_uitod_v1_00 = 0x2cc4d; + __rtl_ftod_v1_00 = 0x2cd29; + __rtl_dtof_v1_00 = 0x2cde1; + __rtl_uitof_v1_00 = 0x2ce75; + __rtl_fadd_v1_00 = 0x2cf59; + __rtl_fsub_v1_00 = 0x2d259; + __rtl_fmul_v1_00 = 0x2d565; + __rtl_fdiv_v1_00 = 0x2d695; + __rtl_dadd_v1_00 = 0x2d809; + __rtl_dsub_v1_00 = 0x2de49; + __rtl_dmul_v1_00 = 0x2e4a1; + __rtl_ddiv_v1_00 = 0x2e7dd; + __rtl_dcmpeq_v1_00 = 0x2ed71; + __rtl_dcmplt_v1_00 = 0x2eded; + __rtl_dcmpgt_v1_00 = 0x2ee85; + __rtl_dcmple_v1_00 = 0x2ef95; + __rtl_fcmplt_v1_00 = 0x2f0a9; + __rtl_fcmpgt_v1_00 = 0x2f105; + __rtl_fpclassifyd = 0x2f1ad; + __rtl_close_v1_00 = 0x2f205; + __rtl_fstat_v1_00 = 0x2f219; + __rtl_isatty_v1_00 = 0x2f22d; + __rtl_lseek_v1_00 = 0x2f23d; + __rtl_open_v1_00 = 0x2f251; + __rtl_read_v1_00 = 0x2f265; + __rtl_write_v1_00 = 0x2f279; + __rtl_sbrk_v1_00 = 0x2f28d; + __rom_mallocr_init_v1_00 = 0x2f29d; + __rtl_free_r_v1_00 = 0x2f309; + __rtl_malloc_r_v1_00 = 0x2f521; + __rtl_realloc_r_v1_00 = 0x2f9f5; + __rtl_memalign_r_v1_00 = 0x2fdb5; + __rtl_valloc_r_v1_00 = 0x2fe81; + __rtl_pvalloc_r_v1_00 = 0x2fe8d; + __rtl_calloc_r_v1_00 = 0x2fea1; + __rtl_cfree_r_v1_00 = 0x2ff05; + __rtl_cos_f32_v1_00 = 0x2ff15; + __rtl_sin_f32_v1_00 = 0x300e9; + __rtl_fabs_v1_00 = 0x302ad; + __rtl_fabsf_v1_00 = 0x302b5; + __rtl_memchr_v1_00 = 0x302bd; + __rtl_memcmp_v1_00 = 0x30351; + __rtl_memcpy_v1_00 = 0x303b5; + __rtl_memmove_v1_00 = 0x3045d; + __rtl_memset_v1_00 = 0x30525; + __rtl_Balloc_v1_00 = 0x3061d; + __rtl_Bfree_v1_00 = 0x3066d; + __rtl_i2b_v1_00 = 0x30681; + __rtl_multadd_v1_00 = 0x30695; + __rtl_mult_v1_00 = 0x30721; + __rtl_pow5mult_v1_00 = 0x30855; + __rtl_hi0bits_v1_00 = 0x308f5; + __rtl_d2b_v1_00 = 0x30935; + __rtl_lshift_v1_00 = 0x309ed; + __rtl_cmp_v1_00 = 0x30a99; + __rtl_diff_v1_00 = 0x30ae1; + __rtl_sread_v1_00 = 0x30bb5; + __rtl_seofread_v1_00 = 0x30c01; + __rtl_swrite_v1_00 = 0x30c05; + __rtl_sseek_v1_00 = 0x30c75; + __rtl_sclose_v1_00 = 0x30cc1; + __rtl_sbrk_r_v1_00 = 0x30ced; + __rtl_strcat_v1_00 = 0x30d15; + __rtl_strchr_v1_00 = 0x30d59; + __rtl_strcmp_v1_00 = 0x30e25; + __rtl_strcpy_v1_00 = 0x30e99; + __rtl_strlen_v1_00 = 0x30ee5; + __rtl_strncat_v1_00 = 0x30f39; + __rtl_strncmp_v1_00 = 0x30f95; + __rtl_strncpy_v1_00 = 0x3102d; + __rtl_strsep_v1_00 = 0x31095; + __rtl_strstr_v1_00 = 0x3136d; + __rtl_strtok_v1_00 = 0x315a5; + __rtl__strtok_r_v1_00 = 0x315b5; + __rtl_strtok_r_v1_00 = 0x31619; + __rtl_fflush_r_v1_00 = 0x31ae9; + __rtl_vfprintf_r_v1_00 = 0x31f99; + polarssl_aes_init = 0x335b9; + aes_free = 0x335c9; + aes_setkey_enc = 0x335dd; + aes_setkey_dec = 0x33829; + aes_crypt_ecb = 0x339a1; + aes_crypt_cbc = 0x343d1; + aes_crypt_cfb128 = 0x34649; + aes_crypt_cfb8 = 0x346c9; + aes_crypt_ctr = 0x3474d; + arc4_init = 0x347b1; + arc4_free = 0x347bd; + arc4_setup = 0x347d1; + arc4_crypt = 0x3481d; + asn1_get_len = 0x34861; + asn1_get_tag = 0x34901; + asn1_get_bool = 0x34929; + asn1_get_int = 0x3495d; + asn1_get_mpi = 0x349a9; + asn1_get_bitstring = 0x349d1; + asn1_get_bitstring_null = 0x34a19; + asn1_get_sequence_of = 0x34a4d; + asn1_get_alg = 0x34ad1; + asn1_get_alg_null = 0x34b65; + asn1_free_named_data = 0x34ba5; + asn1_free_named_data_list = 0x34bcd; + asn1_find_named_data = 0x34bf5; + asn1_write_len = 0x34c25; + asn1_write_tag = 0x34c8d; + asn1_write_raw_buffer = 0x34ca9; + asn1_write_mpi = 0x34ccd; + asn1_write_null = 0x34d41; + asn1_write_oid = 0x34d6d; + asn1_write_algorithm_identifier = 0x34dc5; + asn1_write_bool = 0x34e21; + asn1_write_int = 0x34e65; + asn1_write_printable_string = 0x34ecd; + asn1_write_ia5_string = 0x34f25; + asn1_write_bitstring = 0x34f7d; + asn1_write_octet_string = 0x34fe5; + asn1_store_named_data = 0x3503d; + base64_encode = 0x35111; + base64_decode = 0x3523d; + mpi_init = 0x35e09; + mpi_free = 0x35e19; + mpi_grow = 0x35e55; + mpi_shrink = 0x35e79; + mpi_copy = 0x35f21; + mpi_swap = 0x35fa1; + mpi_safe_cond_assign = 0x35fcd; + mpi_safe_cond_swap = 0x36069; + mpi_lset = 0x3610d; + mpi_get_bit = 0x3614d; + mpi_set_bit = 0x3616d; + mpi_lsb = 0x361d5; + mpi_msb = 0x36215; + mpi_size = 0x36261; + mpi_read_binary = 0x3626d; + mpi_write_binary = 0x362f9; + mpi_shift_l = 0x36341; + mpi_shift_r = 0x363f1; + mpi_cmp_abs = 0x36475; + mpi_cmp_mpi = 0x36619; + mpi_cmp_int = 0x366f1; + mpi_add_abs = 0x3671d; + mpi_sub_abs = 0x3680d; + mpi_add_mpi = 0x3689d; + mpi_sub_mpi = 0x368ed; + mpi_add_int = 0x3693d; + mpi_sub_int = 0x36969; + mpi_mul_mpi = 0x36995; + mpi_read_string = 0x36ac5; + mpi_mul_int = 0x36c45; + mpi_div_mpi = 0x36c61; + mpi_div_int = 0x370ed; + mpi_mod_mpi = 0x37119; + mpi_mod_int = 0x3717d; + mpi_write_string = 0x3722d; + mpi_exp_mod = 0x37395; + mpi_gcd = 0x37915; + mpi_fill_random = 0x37a39; + mpi_inv_mod = 0x37c4d; + mpi_is_prime = 0x37f15; + mpi_gen_prime = 0x37f71; + ctr_drbg_free = 0x38285; + ctr_drbg_set_prediction_resistance = 0x382a1; + ctr_drbg_set_entropy_len = 0x382a5; + ctr_drbg_set_reseed_interval = 0x382a9; + ctr_drbg_update = 0x382ad; + ctr_drbg_reseed = 0x382c9; + ctr_drbg_init_entropy_len = 0x38341; + ctr_drbg_init = 0x38399; + ctr_drbg_random_with_add = 0x383ad; + ctr_drbg_random = 0x38469; + des_init = 0x388a5; + des_free = 0x388b1; + des3_init = 0x388c5; + des3_free = 0x388d5; + des_key_set_parity = 0x388e9; + des_key_check_key_parity = 0x38909; + des_key_check_weak = 0x38939; + des_setkey_enc = 0x38965; + des_setkey_dec = 0x3898d; + des3_set2key_enc = 0x389d9; + des3_set2key_dec = 0x38a25; + des3_set3key_enc = 0x38a71; + des3_set3key_dec = 0x38ab1; + des_crypt_ecb = 0x38af1; + des_crypt_cbc = 0x38d09; + des3_crypt_ecb = 0x38f99; + des3_crypt_cbc = 0x39401; + dhm_init = 0x39729; + dhm_read_params = 0x39731; + dhm_make_params = 0x3978d; + dhm_read_public = 0x398c1; + dhm_make_public = 0x398e9; + dhm_calc_secret = 0x399ad; + dhm_free = 0x39ba1; + dhm_parse_dhm = 0x39c01; + ecdh_gen_public = 0x39cc5; + ecdh_compute_shared = 0x39cc9; + ecdh_init = 0x39d2d; + ecdh_free = 0x39d39; + ecdh_make_params = 0x39d81; + ecdh_read_params = 0x39e05; + ecdh_get_params = 0x39e2d; + ecdh_make_public = 0x39e79; + ecdh_read_public = 0x39ed1; + ecdh_calc_secret = 0x39f01; + ecdsa_sign = 0x3a041; + ecdsa_sign_det = 0x3a1c5; + ecdsa_verify = 0x3a2a9; + ecdsa_write_signature = 0x3a431; + ecdsa_write_signature_det = 0x3a46d; + ecdsa_read_signature = 0x3a4a5; + ecdsa_genkey = 0x3a531; + ecdsa_init = 0x3a565; + ecdsa_free = 0x3a591; + ecdsa_from_keypair = 0x3a5bd; + ecp_curve_list = 0x3aee5; + ecp_curve_info_from_grp_id = 0x3aeed; + ecp_curve_info_from_tls_id = 0x3af0d; + ecp_curve_info_from_name = 0x3af31; + ecp_point_init = 0x3af61; + ecp_group_init = 0x3af81; + ecp_keypair_init = 0x3af8d; + ecp_point_free = 0x3afb1; + ecp_group_free = 0x3afd1; + ecp_keypair_free = 0x3b03d; + ecp_copy = 0x3b05d; + ecp_group_copy = 0x3b08d; + ecp_set_zero = 0x3b095; + ecp_is_zero = 0x3ba61; + ecp_point_read_string = 0x3ba75; + ecp_point_write_binary = 0x3baa5; + ecp_point_read_binary = 0x3bb4d; + ecp_tls_read_point = 0x3bbc1; + ecp_tls_write_point = 0x3bbf5; + ecp_group_read_string = 0x3bc25; + ecp_tls_read_group = 0x3bc95; + ecp_tls_write_group = 0x3bcf1; + ecp_add = 0x3bd39; + ecp_sub = 0x3bd65; + ecp_check_pubkey = 0x3bddd; + ecp_check_privkey = 0x3bf8d; + ecp_mul = 0x3bff5; + ecp_gen_keypair = 0x3c565; + ecp_gen_key = 0x3c669; + ecp_use_known_dp = 0x3d741; + hmac_drbg_update = 0x3daa9; + hmac_drbg_init_buf = 0x3db41; + hmac_drbg_reseed = 0x3db91; + hmac_drbg_init = 0x3dc09; + hmac_drbg_set_prediction_resistance = 0x3dc81; + hmac_drbg_set_entropy_len = 0x3dc85; + hmac_drbg_set_reseed_interval = 0x3dc89; + hmac_drbg_random_with_add = 0x3dc8d; + hmac_drbg_random = 0x3dd4d; + hmac_drbg_free = 0x3dd61; + md_list = 0x3dd7d; + md_info_from_string = 0x3dd85; + md_info_from_type = 0x3de59; + md_init = 0x3de9d; + md_free = 0x3dea5; + md_init_ctx = 0x3dec5; + md_free_ctx = 0x3defd; + md_starts = 0x3df09; + md_update = 0x3df29; + md_finish = 0x3df49; + md = 0x3df69; + md_file = 0x3df89; + md_hmac_starts = 0x3dfa1; + md_hmac_update = 0x3dfc1; + md_hmac_finish = 0x3dfe1; + md_hmac_reset = 0x3e001; + md_hmac = 0x3e021; + md_process = 0x3e049; + md5_init = 0x3e301; + md5_free = 0x3e309; + md5_starts = 0x3e31d; + md5_process = 0x3e34d; + md5_update = 0x3ed51; + md5_finish = 0x3ed59; + md5 = 0x3ee11; + md5_hmac_starts = 0x3ee75; + md5_hmac_update = 0x3ef51; + md5_hmac_finish = 0x3ef59; + md5_hmac_reset = 0x3efbd; + md5_hmac = 0x3eff1; + oid_get_attr_short_name = 0x3f071; + oid_get_x509_ext_type = 0x3f0b1; + oid_get_extended_key_usage = 0x3f0f1; + oid_get_sig_alg_desc = 0x3f131; + oid_get_sig_alg = 0x3f149; + oid_get_oid_by_sig_alg = 0x3f169; + oid_get_pk_alg = 0x3f1a1; + oid_get_oid_by_pk_alg = 0x3f1e1; + oid_get_ec_grp = 0x3f219; + oid_get_oid_by_ec_grp = 0x3f259; + oid_get_cipher_alg = 0x3f291; + oid_get_md_alg = 0x3f2d1; + oid_get_oid_by_md = 0x3f311; + oid_get_pkcs12_pbe_alg = 0x3f349; + oid_get_numeric_string = 0x3f391; + pem_init = 0x3f649; + pem_read_buffer = 0x3f651; + pem_free = 0x3f955; + pem_write_buffer = 0x3f97d; + pk_init = 0x3fa81; + pk_free = 0x3fa8d; + pk_info_from_type = 0x3faad; + pk_init_ctx = 0x3fae1; + pk_init_ctx_rsa_alt = 0x3fb11; + pk_can_do = 0x3fb69; + pk_verify = 0x3fb79; + pk_verify_ext = 0x3fbc9; + pk_sign = 0x3fc8d; + pk_decrypt = 0x3fce9; + pk_encrypt = 0x3fd15; + pk_get_size = 0x3fd41; + pk_debug = 0x3fd51; + pk_get_name = 0x3fd79; + pk_get_type = 0x3fd8d; + pk_write_pubkey = 0x40181; + pk_write_pubkey_der = 0x40201; + pk_write_key_der = 0x402dd; + pk_write_pubkey_pem = 0x404f5; + pk_write_key_pem = 0x40545; + rsa_init = 0x4065d; + rsa_set_padding = 0x40679; + rsa_check_pubkey = 0x40685; + rsa_check_privkey = 0x406e1; + rsa_public = 0x409a5; + rsa_private = 0x40a25; + rsa_rsaes_oaep_encrypt = 0x40c29; + rsa_rsaes_pkcs1_v15_encrypt = 0x40d31; + rsa_pkcs1_encrypt = 0x40e19; + rsa_rsaes_oaep_decrypt = 0x40e59; + rsa_rsaes_pkcs1_v15_decrypt = 0x40fbd; + rsa_pkcs1_decrypt = 0x410c1; + rsa_rsassa_pss_sign = 0x4110d; + rsa_rsassa_pkcs1_v15_sign = 0x41271; + rsa_pkcs1_sign = 0x41389; + rsa_rsassa_pss_verify_ext = 0x413c9; + rsa_rsassa_pss_verify = 0x41575; + rsa_rsassa_pkcs1_v15_verify = 0x415a5; + rsa_pkcs1_verify = 0x41709; + rsa_free = 0x41765; + rsa_gen_key = 0x417d5; + rsa_copy = 0x4198d; + sha1_init = 0x41a9d; + sha1_free = 0x41aa5; + sha1_starts = 0x41ab9; + sha1_process = 0x41aed; + sha1_update = 0x42e15; + sha1_finish = 0x42e1d; + sha1 = 0x42ee5; + sha1_hmac_starts = 0x42f51; + sha1_hmac_update = 0x43039; + sha1_hmac_finish = 0x43041; + sha1_hmac_reset = 0x430b5; + sha1_hmac = 0x430f1; + sha256_init = 0x43139; + sha256_free = 0x43141; + sha256_starts = 0x43155; + sha256_process = 0x431e5; + sha256_update = 0x4513d; + sha256_finish = 0x45145; + sha256 = 0x4524d; + sha256_hmac_starts = 0x45325; + sha256_hmac_update = 0x45475; + sha256_hmac_finish = 0x4547d; + sha256_hmac_reset = 0x45569; + sha256_hmac = 0x45601; + sha512_init = 0x45651; + sha512_free = 0x4565d; + sha512_starts = 0x45671; + sha512_process = 0x457b9; + sha512_update = 0x46879; + sha512_finish = 0x46881; + sha512 = 0x46ac9; + sha512_hmac_starts = 0x46b11; + sha512_hmac_update = 0x46bd9; + sha512_hmac_finish = 0x46be1; + sha512_hmac_reset = 0x46c35; + sha512_hmac = 0x46c51; + UartLogRomCmdTable = 0x46ca0; + XTAL_CLK = 0x46e10; + CpkClkTbl_FPAG = 0x46e50; + CpkClkTbl_ASIC = 0x46e68; + ROM_IMG1_VALID_PATTEN = 0x46e90; + __AES_rcon = 0x46e98; + __AES_Te4 = 0x46ec0; + SpicCalibrationPattern = 0x472c0; + NEW_CALIBREATION_DIV = 0x472c8; + NEW_CALIBREATION_DATA = 0x472e4; + GDMA_IrqNum = 0x47344; + I2C_DEV_TABLE = 0x47350; + spi_clk_pin = 0x47370; + SPI_DEV_TABLE = 0x47374; + PWM_GDMA_HSx = 0x47394; + TIM_DMA_CCx = 0x473ac; + TIM_IT_CCx = 0x473c4; + TIMx = 0x473dc; + TIMx_irq = 0x473f4; + BAUDRATE_TABLE_40M = 0x4740c; + UART_DEV_TABLE = 0x475bc; + RTW_WPA_OUI_TYPE = 0x4b270; + WPA_CIPHER_SUITE_NONE = 0x4b274; + WPA_CIPHER_SUITE_WEP40 = 0x4b278; + WPA_CIPHER_SUITE_TKIP = 0x4b27c; + WPA_CIPHER_SUITE_CCMP = 0x4b280; + WPA_CIPHER_SUITE_WEP104 = 0x4b284; + RSN_CIPHER_SUITE_NONE = 0x4b288; + RSN_CIPHER_SUITE_WEP40 = 0x4b28c; + RSN_CIPHER_SUITE_TKIP = 0x4b290; + RSN_CIPHER_SUITE_CCMP = 0x4b294; + RSN_CIPHER_SUITE_WEP104 = 0x4b298; + RSN_AUTH_KEY_MGMT_PSK_OVER_802_1X = 0x4b2a8; + RSN_AUTH_KEY_MGMT_UNSPEC_802_1X = 0x4b2ac; + RSN_VERSION_BSD = 0x4b2b0; + rom_e_rtw_msgp_str_ = 0x4b2b4; + rtw_basic_rate_mix = 0x4b9a8; + rtw_basic_rate_ofdm = 0x4b9b0; + rtw_basic_rate_cck = 0x4b9b4; + REALTEK_96B_IE = 0x4b9b8; + AIRGOCAP_OUI = 0x4b9c0; + REALTEK_OUI = 0x4b9c4; + RALINK_OUI = 0x4b9c8; + MARVELL_OUI = 0x4b9cc; + CISCO_OUI = 0x4b9d0; + BROADCOM_OUI3 = 0x4b9d4; + BROADCOM_OUI2 = 0x4b9d8; + BROADCOM_OUI1 = 0x4b9dc; + ARTHEROS_OUI2 = 0x4b9e0; + ARTHEROS_OUI1 = 0x4b9e4; + rom_wps_rcons = 0x4b9e8; + rom_wps_Te0 = 0x4b9f4; + rom_wps_Td4s = 0x4bdf4; + rom_wps_Td0 = 0x4bef4; + sha512_info = 0x5850c; + sha384_info = 0x5854c; + sha256_info = 0x5858c; + sha224_info = 0x585cc; + sha1_info = 0x5860c; + md5_info = 0x5864c; + rsa_alt_info = 0x58d28; + ecdsa_info = 0x58d54; + eckeydh_info = 0x58d80; + eckey_info = 0x58dac; + rsa_info = 0x58dd8; + __rom_bss_start__ = 0x10000000; + NewVectorTable = 0x10000000; + UserIrqFunTable = 0x10000100; + UserIrqDataTable = 0x10000200; + ConfigDebugClose = 0x10000300; + CfgSysDebugWarn = 0x10000304; + CfgSysDebugInfo = 0x10000308; + CfgSysDebugErr = 0x1000030c; + ConfigDebugWarn = 0x10000310; + ConfigDebugInfo = 0x10000314; + ConfigDebugErr = 0x10000318; + sector_addr = 0x1000031c; + _rtl_impure_ptr = 0x10000338; + ArgvArray = 0x1000033c; + pUartLogCtl = 0x10000364; + UartLogBuf = 0x10000368; + UartLogCtl = 0x100003e8; + UartLogHistoryBuf = 0x10000408; + NCO32K_Enable = 0x10000684; + g_rtl_cipherEngine = 0x100006a0; + DONGLE_InitStruct = 0x10000ba0; + EFUSE_MAP = 0x10000ba4; + USOC_BOOT_TXBD = 0x10000da4; + USOC_BOOT_RXBD = 0x10000db4; + USB_RXBuff = 0x10000dc4; + USB_TXBuff = 0x10000dcc; + ADC_AnaparAd = 0x10000dd4; + flash_init_para = 0x10000dec; + NEW_CALIBREATION_END = 0x10000e44; + GDMA_Reg = 0x10000e4c; + PortA_IrqHandler = 0x10000e50; + PortA_IrqData = 0x10000ed0; + IC_FS_SCL_HCNT_TRIM = 0x10000f50; + IC_FS_SCL_LCNT_TRIM = 0x10000f54; + I2C_SLAVEWRITE_PATCH = 0x10000f58; + i2s_cur_tx_page = 0x10000f5c; + i2s_cur_rx_page = 0x10000f60; + i2s_page_num = 0x10000f64; + i2s_txpage_entry = 0x10000f68; + i2s_rxpage_entry = 0x10000f78; + TXBDAddrAligned = 0x10000f88; + H2C_Buff = 0x10000f90; + SPI_RECV_Buff = 0x10000f94; + spi_boot_recv_done = 0x10000f98; + UART_StateRx = 0x10000f9c; + UART_StateTx = 0x10000fa8; + xMCtrl = 0x10000fb8; + XComUARTx = 0x10000fc4; + FalseAlmCnt = 0x10000fc8; + ROMInfo = 0x10001008; + DM_CfoTrack = 0x10001020; + rom_wlan_ram_map = 0x10001048; + rom_libgloss_ram_map = 0x10001050; + __rtl_errno = 0x100014b4; + rom_ssl_ram_map = 0x100014b8; + __rom_bss_end__ = 0x100014f8; +} \ No newline at end of file diff --git a/cores/realtek-ambz/misc/rlx8711B-symbol-v02-img2_xip1.template.ld b/cores/realtek-ambz/misc/rlx8711B-symbol-v02-img2_xip1.template.ld new file mode 100644 index 000000000..035809875 --- /dev/null +++ b/cores/realtek-ambz/misc/rlx8711B-symbol-v02-img2_xip1.template.ld @@ -0,0 +1,222 @@ + + +ENTRY(Reset_Handler) + +INCLUDE "export-rom_symbol_v01.txt" + +GROUP ( + libgcc.a + libc.a + libg.a + libm.a + libnosys.a +) + +MEMORY +{ + ROM (rx) : ORIGIN = 0x00000000, LENGTH = 0x80000 /* ROM: 512k */ + ROMBSS_RAM (rw) : ORIGIN = 0x10000000, LENGTH = 0x2000 /* ROM BSS RAM: 8K */ + BOOTLOADER_RAM (rwx) : ORIGIN = 0x10002000, LENGTH = 0x3000 /* BOOT Loader RAM: 12K */ + BD_RAM (rwx) : ORIGIN = 0x10005000, LENGTH = 0x38000 /* MAIN RAM: 224k */ + ROM_BSS_RAM (rwx) : ORIGIN = 0x1003D000, LENGTH = 0x1000 /* ROM BSS RAM: 4K */ + MSP_RAM (wx) : ORIGIN = 0x1003E000, LENGTH = 0x1000 /* MSP RAM: 4k */ + RDP_RAM (wx) : ORIGIN = 0x1003F000, LENGTH = 0xFF0 /* RDP RAM: 4k-0x10 */ + + XIPBOOT (rx) : ORIGIN = 0x08000000+0x20, LENGTH = 0x04000-0x20 /* XIPBOOT: 16k, 32 Bytes resvd for header*/ + XIPSYS (r) : ORIGIN = 0x08009000, LENGTH = 0x1000 /* XIPSYS: 4K system data in flash */ + XIPCAL (r) : ORIGIN = 0x0800A000, LENGTH = 0x1000 /* XIPCAL: 4K calibration data in flash */ + XIP1 (rx) : ORIGIN = 0x08000000+0x20+${FLASH_OTA1_OFFSET}, LENGTH = ${FLASH_OTA1_LENGTH}-0x20 /* XIP1, 32 Bytes resvd for header */ + XIP2 (rx) : ORIGIN = 0x08000000+0x20+${FLASH_OTA2_OFFSET}, LENGTH = ${FLASH_OTA2_LENGTH}-0x20 /* XIP2, 32 Bytes resvd for header */ +} + + + +SECTIONS +{ + .rom.text : { } > ROM + .rom.rodata : { } > ROM + .ARM.exidx : + { + __exidx_start = .; + *(.ARM.exidx*) + *(.gnu.linkonce.armexidx.*) + __exidx_end = .; + } > ROM + .hal.rom.bss : { } > ROMBSS_RAM + + /* image1 entry, this section should in RAM and fixed address for ROM */ + .ram_image1.entry : + { + __ram_image1_text_start__ = .; + __ram_start_table_start__ = .; + KEEP(*(SORT(.image1.entry.data*))) + __ram_start_table_end__ = .; + + __image1_validate_code__ = .; + KEEP(*(.image1.validate.rodata*)) + KEEP(*(.image1.export.symb*)) + } > BOOTLOADER_RAM + + /* Add . to assign the start address of the section */ + /* to prevent the change of the start address by ld doing section alignment */ + .ram_image1.text . : + { + /* image1 text */ + *(.boot.ram.text*) + *(.boot.rodata*) + } > BOOTLOADER_RAM + + .ram_image1.data . : + { + __ram_image1_data_start__ = .; + KEEP(*(.boot.ram.data*)) + __ram_image1_data_end__ = .; + + __ram_image1_text_end__ = .; + } > BOOTLOADER_RAM + + .ram_image1.bss . : + { + __image1_bss_start__ = .; + KEEP(*(.boot.ram.bss*)) + KEEP(*(.boot.ram.end.bss*)) + __image1_bss_end__ = .; + } > BOOTLOADER_RAM + + .ram_image2.entry : + { + __ram_image2_text_start__ = .; + __image2_entry_func__ = .; + KEEP(*(SORT(.image2.entry.data*))) + + __image2_validate_code__ = .; + KEEP(*(.image2.validate.rodata*)) + + } > BD_RAM + + .ram_image2.text : + { + KEEP(*(.image2.ram.text*)) + } > BD_RAM + + .ram_image2.data : + { + __data_start__ = .; + *(.data*) + __data_end__ = .; + __ram_image2_text_end__ = .; + . = ALIGN(16); + } > BD_RAM + + .ram_image2.bss : + { + __bss_start__ = .; + *(.bss*) + *(COMMON) + } > BD_RAM + + .ram_image2.skb.bss : + { + *(.bdsram.data*) + __bss_end__ = .; + } > BD_RAM + + .ram_heap.data : + { + *(.bfsram.data*) + } > BD_RAM + + . = ALIGN(8); + PROVIDE(heap_start = .); + PROVIDE(heap_end = 0x1003CFFF); + PROVIDE(heap_len = heap_end - heap_start); + + .rom.bss : + { + *(.heap.stdlib*) + } > ROM_BSS_RAM + + .ram_rdp.text : + { + __rom_top_4k_start_ = .; + __rdp_text_start__ = .; + KEEP(*(.rdp.ram.text*)) + KEEP(*(.rdp.ram.data*)) + __rdp_text_end__ = .; + . = ALIGN(16); + + } > RDP_RAM + + .xip_image1.text : + { + __flash_boot_text_start__ = .; + + *(.flashboot.text*) + + __flash_boot_text_end__ = .; + + . = ALIGN(16); + } > XIPBOOT + + .xip_image2.text : + { + __flash_text_start__ = .; + + *(.img2_custom_signature*) + *(.text) + *(.text*) + *(.rodata) + *(.rodata*) + *(.debug_trace*) + + /* https://www.embedded.com/building-bare-metal-arm-systems-with-gnu-part-3/ */ + KEEP(*crtbegin.o(.ctors)) + KEEP(*(EXCLUDE_FILE (*ctrend.o) .ctors)) + KEEP(*(SORT(.ctors.*))) + KEEP(*crtend.o(.ctors)) + KEEP(*crtbegin.o(.dtors)) + KEEP(*(EXCLUDE_FILE (*crtend.o) .dtors)) + KEEP(*(SORT(.dtors.*))) + KEEP(*crtend.o(.dtors)) + *(.rodata .rodata.* .gnu.linkonce.r.*) + + /* Add This for C++ support */ + /* ambd_arduino/Arduino_package/hardware/variants/rtl8720dn_bw16/linker_scripts/gcc/rlx8721d_img2_is_arduino.ld */ + . = ALIGN(4); + __preinit_array_start = .; + KEEP(*(.preinit_array)) + __preinit_array_end = .; + . = ALIGN(4); + __init_array_start = .; + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + __init_array_end = .; + . = ALIGN(4); + __fini_array_start = .; + KEEP(*(SORT(.fini_array.*))) + KEEP(*(.fini_array)) + __fini_array_end = .; + /*-----------------*/ + + . = ALIGN (4); + __cmd_table_start__ = .; + KEEP(*(.cmd.table.data*)) + __cmd_table_end__ = .; + + /* https://community.silabs.com/s/article/understand-the-gnu-linker-script-of-cortex-m4?language=en_US */ + KEEP(*(.init)) + KEEP(*(.fini)) + *(.init) + *(.fini) + + __flash_text_end__ = .; + + . = ALIGN (16); + } > XIP1 +} + +SECTIONS +{ + /* Bootloader symbol list */ + boot_export_symbol = 0x10002020; +} diff --git a/cores/realtek-ambz/misc/rlx8711B-symbol-v02-img2_xip2.template.ld b/cores/realtek-ambz/misc/rlx8711B-symbol-v02-img2_xip2.template.ld new file mode 100644 index 000000000..c2cd4d480 --- /dev/null +++ b/cores/realtek-ambz/misc/rlx8711B-symbol-v02-img2_xip2.template.ld @@ -0,0 +1,222 @@ + + +ENTRY(Reset_Handler) + +INCLUDE "export-rom_symbol_v01.txt" + +GROUP ( + libgcc.a + libc.a + libg.a + libm.a + libnosys.a +) + +MEMORY +{ + ROM (rx) : ORIGIN = 0x00000000, LENGTH = 0x80000 /* ROM: 512k */ + ROMBSS_RAM (rw) : ORIGIN = 0x10000000, LENGTH = 0x2000 /* ROM BSS RAM: 8K */ + BOOTLOADER_RAM (rwx) : ORIGIN = 0x10002000, LENGTH = 0x3000 /* BOOT Loader RAM: 12K */ + BD_RAM (rwx) : ORIGIN = 0x10005000, LENGTH = 0x38000 /* MAIN RAM: 224k */ + ROM_BSS_RAM (rwx) : ORIGIN = 0x1003D000, LENGTH = 0x1000 /* ROM BSS RAM: 4K */ + MSP_RAM (wx) : ORIGIN = 0x1003E000, LENGTH = 0x1000 /* MSP RAM: 4k */ + RDP_RAM (wx) : ORIGIN = 0x1003F000, LENGTH = 0xFF0 /* RDP RAM: 4k-0x10 */ + + XIPBOOT (rx) : ORIGIN = 0x08000000+0x20, LENGTH = 0x04000-0x20 /* XIPBOOT: 16k, 32 Bytes resvd for header*/ + XIPSYS (r) : ORIGIN = 0x08009000, LENGTH = 0x1000 /* XIPSYS: 4K system data in flash */ + XIPCAL (r) : ORIGIN = 0x0800A000, LENGTH = 0x1000 /* XIPCAL: 4K calibration data in flash */ + XIP1 (rx) : ORIGIN = 0x08000000+0x20+${FLASH_OTA1_OFFSET}, LENGTH = ${FLASH_OTA1_LENGTH}-0x20 /* XIP1, 32 Bytes resvd for header */ + XIP2 (rx) : ORIGIN = 0x08000000+0x20+${FLASH_OTA2_OFFSET}, LENGTH = ${FLASH_OTA2_LENGTH}-0x20 /* XIP2, 32 Bytes resvd for header */ +} + + + +SECTIONS +{ + .rom.text : { } > ROM + .rom.rodata : { } > ROM + .ARM.exidx : + { + __exidx_start = .; + *(.ARM.exidx*) + *(.gnu.linkonce.armexidx.*) + __exidx_end = .; + } > ROM + .hal.rom.bss : { } > ROMBSS_RAM + + /* image1 entry, this section should in RAM and fixed address for ROM */ + .ram_image1.entry : + { + __ram_image1_text_start__ = .; + __ram_start_table_start__ = .; + KEEP(*(SORT(.image1.entry.data*))) + __ram_start_table_end__ = .; + + __image1_validate_code__ = .; + KEEP(*(.image1.validate.rodata*)) + KEEP(*(.image1.export.symb*)) + } > BOOTLOADER_RAM + + /* Add . to assign the start address of the section */ + /* to prevent the change of the start address by ld doing section alignment */ + .ram_image1.text . : + { + /* image1 text */ + *(.boot.ram.text*) + *(.boot.rodata*) + } > BOOTLOADER_RAM + + .ram_image1.data . : + { + __ram_image1_data_start__ = .; + KEEP(*(.boot.ram.data*)) + __ram_image1_data_end__ = .; + + __ram_image1_text_end__ = .; + } > BOOTLOADER_RAM + + .ram_image1.bss . : + { + __image1_bss_start__ = .; + KEEP(*(.boot.ram.bss*)) + KEEP(*(.boot.ram.end.bss*)) + __image1_bss_end__ = .; + } > BOOTLOADER_RAM + + .ram_image2.entry : + { + __ram_image2_text_start__ = .; + __image2_entry_func__ = .; + KEEP(*(SORT(.image2.entry.data*))) + + __image2_validate_code__ = .; + KEEP(*(.image2.validate.rodata*)) + + } > BD_RAM + + .ram_image2.text : + { + KEEP(*(.image2.ram.text*)) + } > BD_RAM + + .ram_image2.data : + { + __data_start__ = .; + *(.data*) + __data_end__ = .; + __ram_image2_text_end__ = .; + . = ALIGN(16); + } > BD_RAM + + .ram_image2.bss : + { + __bss_start__ = .; + *(.bss*) + *(COMMON) + } > BD_RAM + + .ram_image2.skb.bss : + { + *(.bdsram.data*) + __bss_end__ = .; + } > BD_RAM + + .ram_heap.data : + { + *(.bfsram.data*) + } > BD_RAM + + . = ALIGN(8); + PROVIDE(heap_start = .); + PROVIDE(heap_end = 0x1003CFFF); + PROVIDE(heap_len = heap_end - heap_start); + + .rom.bss : + { + *(.heap.stdlib*) + } > ROM_BSS_RAM + + .ram_rdp.text : + { + __rom_top_4k_start_ = .; + __rdp_text_start__ = .; + KEEP(*(.rdp.ram.text*)) + KEEP(*(.rdp.ram.data*)) + __rdp_text_end__ = .; + . = ALIGN(16); + + } > RDP_RAM + + .xip_image1.text : + { + __flash_boot_text_start__ = .; + + *(.flashboot.text*) + + __flash_boot_text_end__ = .; + + . = ALIGN(16); + } > XIPBOOT + + .xip_image2.text : + { + __flash_text_start__ = .; + + *(.img2_custom_signature*) + *(.text) + *(.text*) + *(.rodata) + *(.rodata*) + *(.debug_trace*) + + /* https://www.embedded.com/building-bare-metal-arm-systems-with-gnu-part-3/ */ + KEEP(*crtbegin.o(.ctors)) + KEEP(*(EXCLUDE_FILE (*ctrend.o) .ctors)) + KEEP(*(SORT(.ctors.*))) + KEEP(*crtend.o(.ctors)) + KEEP(*crtbegin.o(.dtors)) + KEEP(*(EXCLUDE_FILE (*crtend.o) .dtors)) + KEEP(*(SORT(.dtors.*))) + KEEP(*crtend.o(.dtors)) + *(.rodata .rodata.* .gnu.linkonce.r.*) + + /* Add This for C++ support */ + /* ambd_arduino/Arduino_package/hardware/variants/rtl8720dn_bw16/linker_scripts/gcc/rlx8721d_img2_is_arduino.ld */ + . = ALIGN(4); + __preinit_array_start = .; + KEEP(*(.preinit_array)) + __preinit_array_end = .; + . = ALIGN(4); + __init_array_start = .; + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + __init_array_end = .; + . = ALIGN(4); + __fini_array_start = .; + KEEP(*(SORT(.fini_array.*))) + KEEP(*(.fini_array)) + __fini_array_end = .; + /*-----------------*/ + + . = ALIGN (4); + __cmd_table_start__ = .; + KEEP(*(.cmd.table.data*)) + __cmd_table_end__ = .; + + /* https://community.silabs.com/s/article/understand-the-gnu-linker-script-of-cortex-m4?language=en_US */ + KEEP(*(.init)) + KEEP(*(.fini)) + *(.init) + *(.fini) + + __flash_text_end__ = .; + + . = ALIGN (16); + } > XIP2 +} + +SECTIONS +{ + /* Bootloader symbol list */ + boot_export_symbol = 0x10002020; +} diff --git a/cores/realtek-ambz2/arduino/libraries/Serial/Serial.cpp b/cores/realtek-ambz2/arduino/libraries/Serial/Serial.cpp new file mode 100644 index 000000000..9fb18d66c --- /dev/null +++ b/cores/realtek-ambz2/arduino/libraries/Serial/Serial.cpp @@ -0,0 +1,102 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-05-24. */ + +#include "SerialPrivate.h" + +#if LT_HW_UART0 +SerialClass Serial0(0, PIN_SERIAL0_RX, PIN_SERIAL0_TX); +#endif +#if LT_HW_UART1 +SerialClass Serial1(1, PIN_SERIAL1_RX, PIN_SERIAL1_TX); +#endif +#if LT_HW_UART2 +SerialClass Serial2(2, PIN_SERIAL2_RX, PIN_SERIAL2_TX); +#endif + +static void callback(uint32_t param, uint32_t event) { + if (event != RxIrq) + return; + hal_uart_adapter_t *uart = pdUART; + + uint8_t c; + while (hal_uart_rgetc(uart, (char *)&c)) { +#if LT_AUTO_DOWNLOAD_REBOOT && defined(LT_UART_ADR_PATTERN) && PIN_SERIAL2_RX != PIN_INVALID + // parse UART protocol commands on UART2 + if (uart->base_addr == UART2) + SerialClass::adrParse(c); +#endif + pdBUF.store_char(c); + } +} + +void SerialClass::begin(unsigned long baudrate, uint16_t config) { + if (!this->data) { + this->data = new SerialData(); + this->buf = &BUF; + + if (this->port == 2) { + DATA->uart = &log_uart; + } else { + UART = new hal_uart_adapter_t(); + // TODO handle PIN_INVALID + hal_uart_init(UART, this->tx, this->rx, NULL); + } + + if (this->rx != PIN_INVALID) { + hal_uart_enter_critical(); + hal_uart_rxind_hook(UART, callback, (uint32_t)this->data, RxIrq); + UART->base_addr->ier_b.erbi = 1; + UART->base_addr->ier_b.etbei = 0; + hal_uart_exit_critical(); + } + } + + if (this->baudrate != baudrate || this->config != config) + this->configure(baudrate, config); +} + +void SerialClass::configure(unsigned long baudrate, uint16_t config) { + if (!this->data) + return; + + uint8_t dataWidth = (config & SERIAL_DATA_MASK) == SERIAL_DATA_7 ? 7 : 8; + uint8_t parity = (config & SERIAL_PARITY_MASK) ^ 0b11; + uint8_t stopBits = (config & SERIAL_STOP_BIT_MASK) == SERIAL_STOP_BIT_2 ? 2 : 1; + + hal_uart_set_baudrate(UART, baudrate); + hal_uart_set_format(UART, dataWidth, parity, stopBits); + + this->baudrate = baudrate; + this->config = config; +} + +void SerialClass::end() { + if (!this->data) + return; + + if (this->port == 2) { + UART->base_addr->ier_b.erbi = 0; + hal_uart_rxind_hook(UART, NULL, 0, RxIrq); + } else { + hal_uart_deinit(UART); + delete UART; + } + + delete DATA; + this->data = NULL; + this->buf = NULL; + this->baudrate = 0; +} + +void SerialClass::flush() { + if (!this->data) + return; + while (UART->base_addr->tflvr_b.tx_fifo_lv != 0) {} +} + +size_t SerialClass::write(uint8_t c) { + if (!this->data) + return 0; + while (!hal_uart_writeable(UART)) {} + hal_uart_putc(UART, c); + return 1; +} diff --git a/cores/realtek-ambz2/arduino/libraries/Serial/SerialPrivate.h b/cores/realtek-ambz2/arduino/libraries/Serial/SerialPrivate.h new file mode 100644 index 000000000..6fb1ec947 --- /dev/null +++ b/cores/realtek-ambz2/arduino/libraries/Serial/SerialPrivate.h @@ -0,0 +1,18 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-05-24. */ + +#pragma once + +#include +#include + +typedef struct { + hal_uart_adapter_t *uart; + RingBuffer buf; +} SerialData; + +#define DATA ((SerialData *)data) +#define pDATA ((SerialData *)param) +#define BUF (DATA->buf) +#define pdBUF (pDATA->buf) +#define UART (DATA->uart) +#define pdUART (pDATA->uart) diff --git a/cores/realtek-ambz2/arduino/src/lt_defs.h b/cores/realtek-ambz2/arduino/src/lt_defs.h new file mode 100644 index 000000000..f6cceb071 --- /dev/null +++ b/cores/realtek-ambz2/arduino/src/lt_defs.h @@ -0,0 +1,9 @@ +#pragma once + +#error "Don't include this file directly" + +#define LT_ARD_HAS_SERIAL 1 +#define LT_ARD_HAS_SOFTSERIAL 0 +#define LT_ARD_HAS_WIFI 1 +#define LT_ARD_HAS_WIRE 0 +#define LT_ARD_MD5_MBEDTLS 1 diff --git a/cores/realtek-ambz2/base/api/lt_cpu.c b/cores/realtek-ambz2/base/api/lt_cpu.c new file mode 100644 index 000000000..7f9c1ef14 --- /dev/null +++ b/cores/realtek-ambz2/base/api/lt_cpu.c @@ -0,0 +1,21 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-05-22. */ + +#include +#include + +lt_cpu_model_t lt_cpu_get_model() { + uint32_t *addr = (uint32_t *)0x40000038; + uint8_t flash_mode = (addr[0] >> 5) & 0b11; + uint32_t chip_id = 0; + hal_get_chip_id(&chip_id); + chip_id <<= 2; + return CPU_MODEL_ENUM(FAMILY, (chip_id & 0xFF) | flash_mode); +} + +const char *lt_cpu_get_core_type() { + return "ARM Cortex-M33 (ARMv8-M)"; +} + +uint32_t lt_cpu_get_freq() { + return hal_syson_query_sys_clk(); +} diff --git a/cores/realtek-ambz2/base/api/lt_device.c b/cores/realtek-ambz2/base/api/lt_device.c new file mode 100644 index 000000000..5cfff7e30 --- /dev/null +++ b/cores/realtek-ambz2/base/api/lt_device.c @@ -0,0 +1,61 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-05-22. */ + +#include +#include + +void lt_get_device_mac(uint8_t *mac) { + efuse_logical_read(0x11A, 6, mac); +} + +void lt_reboot() { + sys_cpu_reset(); + while (1) {} +} + +bool lt_reboot_download_mode() { + sys_uart_download_mode(); + while (1) {} + return true; +} + +lt_reboot_reason_t lt_get_reboot_reason() { + hal_reset_reason_t reason = -1; + rtl8710c_reset_reason_get(&reason); + switch (reason) { + case HAL_RESET_REASON_POWER_ON: + return REBOOT_REASON_POWER; + case HAL_RESET_REASON_SOFTWARE: + return REBOOT_REASON_SOFTWARE; + case HAL_RESET_REASON_WATCHDOG: + return REBOOT_REASON_WATCHDOG; + case HAL_RESET_REASON_JTAG: + return REBOOT_REASON_DEBUGGER; + default: + return REBOOT_REASON_UNKNOWN; + } +} + +bool lt_set_debug_mode(lt_debug_mode_t mode) { + switch (mode) { + case DEBUG_MODE_OFF: + if (hal_misc_jtag_pin_ctrl(0) != HAL_OK) + return false; + if (hal_misc_swd_pin_ctrl(0) != HAL_OK) + return false; + return true; + case DEBUG_MODE_JTAG: + if (hal_misc_swd_pin_ctrl(0) != HAL_OK) + return false; + if (hal_misc_jtag_pin_ctrl(1) != HAL_OK) + return false; + return true; + case DEBUG_MODE_SWD: + if (hal_misc_jtag_pin_ctrl(0) != HAL_OK) + return false; + if (hal_misc_swd_pin_ctrl(1) != HAL_OK) + return false; + return true; + default: + return false; + } +} diff --git a/cores/realtek-ambz2/base/api/lt_init.c b/cores/realtek-ambz2/base/api/lt_init.c new file mode 100644 index 000000000..f83ce88a7 --- /dev/null +++ b/cores/realtek-ambz2/base/api/lt_init.c @@ -0,0 +1,14 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-05-22. */ + +#include +#include + +extern uint8_t lt_uart_port; + +void lt_init_family() { + // make the SDK less verbose by default + ConfigDebugErr = _DBG_MISC_ | _DBG_FAULT_ | _DBG_BOOT_; + ConfigDebugWarn = 0; + ConfigDebugInfo = 0; + lt_uart_port = LT_UART_DEFAULT_PORT; +} diff --git a/cores/realtek-ambz2/base/api/lt_mem.c b/cores/realtek-ambz2/base/api/lt_mem.c new file mode 100644 index 000000000..b079d4c14 --- /dev/null +++ b/cores/realtek-ambz2/base/api/lt_mem.c @@ -0,0 +1,8 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-05-22. */ + +#include +#include + +uint32_t lt_ram_get_size() { + return 256 * 1024; +} diff --git a/cores/realtek-ambz2/base/api/lt_ota.c b/cores/realtek-ambz2/base/api/lt_ota.c new file mode 100644 index 000000000..d96af85d1 --- /dev/null +++ b/cores/realtek-ambz2/base/api/lt_ota.c @@ -0,0 +1,24 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-05-22. */ + +#include +#include + +lt_ota_type_t lt_ota_get_type() { + return OTA_TYPE_DUAL; +} + +bool lt_ota_is_valid(uint8_t index) { + return false; +} + +uint8_t lt_ota_dual_get_current() { + return 0; +} + +uint8_t lt_ota_dual_get_stored() { + return 0; +} + +bool lt_ota_switch(bool revert) { + return false; +} diff --git a/cores/realtek-ambz2/base/config/lwipopts.h b/cores/realtek-ambz2/base/config/lwipopts.h new file mode 100644 index 000000000..642ba3529 --- /dev/null +++ b/cores/realtek-ambz2/base/config/lwipopts.h @@ -0,0 +1,10 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-05-27. */ + +#pragma once + +// lwipopts.h defines `unsigned int sys_now()`, while lwip/sys.h defines `u32_t sys_now()` +// since u32_t is unsigned long, these are incompatible +#define sys_now sys_now_dummy +#include_next "lwipopts.h" +#undef sys_now +extern unsigned long sys_now(void); diff --git a/cores/realtek-ambz2/base/config/platform_conf.h b/cores/realtek-ambz2/base/config/platform_conf.h new file mode 100644 index 000000000..fbf831f0b --- /dev/null +++ b/cores/realtek-ambz2/base/config/platform_conf.h @@ -0,0 +1,22 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-05-23. */ + +#pragma once + +#include_next "platform_conf.h" + +#undef CONFIG_DEBUG_LOG +#undef CONFIG_DEBUG_ERROR +#undef CONFIG_DEBUG_WARN +#undef CONFIG_DEBUG_INFO +#define CONFIG_DEBUG_LOG 0 +#define CONFIG_DEBUG_ERROR 0 +#define CONFIG_DEBUG_WARN 0 +#define CONFIG_DEBUG_INFO 0 + +// diag.h doesn't define this if CONFIG_DEBUG_LOG is 0 +#define DBG_SCE_ERR(...) +#define DBG_SCE_WARN(...) +#define DBG_SCE_INFO(...) + +// ...? +#define CONFIG_ADC_EN diff --git a/cores/realtek-ambz2/base/config/platform_opts.h b/cores/realtek-ambz2/base/config/platform_opts.h new file mode 100644 index 000000000..95f84c411 --- /dev/null +++ b/cores/realtek-ambz2/base/config/platform_opts.h @@ -0,0 +1,9 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-05-25. */ + +#pragma once + +#include_next "platform_opts.h" + +// this needs example_wlan_fast_connect.c +#undef CONFIG_EXAMPLE_WLAN_FAST_CONNECT +#undef CONFIG_FAST_DHCP diff --git a/cores/realtek-ambz2/base/fixups/cmd_shell.c b/cores/realtek-ambz2/base/fixups/cmd_shell.c new file mode 100644 index 000000000..622802c7e --- /dev/null +++ b/cores/realtek-ambz2/base/fixups/cmd_shell.c @@ -0,0 +1,7 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-04-12. */ + +extern void lt_main(); + +void shell_cmd_init() { + lt_main(); +} diff --git a/cores/realtek-ambz2/base/fixups/cmsis.h b/cores/realtek-ambz2/base/fixups/cmsis.h new file mode 100644 index 000000000..112417652 --- /dev/null +++ b/cores/realtek-ambz2/base/fixups/cmsis.h @@ -0,0 +1,10 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-05-23. */ + +// use platform_conf.h from realtek-ambz2/base/config +#include +// use basic_types.h from realtek-amb/base/fixups +#include +// use basic_types.h from realtek-ambz2/base/fixups +#include "diag.h" + +#include_next "cmsis.h" diff --git a/cores/realtek-ambz2/base/fixups/diag.h b/cores/realtek-ambz2/base/fixups/diag.h new file mode 100644 index 000000000..96e30da90 --- /dev/null +++ b/cores/realtek-ambz2/base/fixups/diag.h @@ -0,0 +1,19 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-05-23. */ + +// remove component/soc/realtek/8710c/app/rtl_printf/include/rt_printf.h +// replace with #defines below +#ifndef _RT_PRINTF__H +#define _RT_PRINTF__H +#endif + +#undef log_printf +#include_next "diag.h" +#undef log_printf + +#define rt_printf(...) __wrap_rt_printf(__VA_ARGS__) +#define rt_printfl(...) __wrap_rt_printf(__VA_ARGS__) +#define rt_sprintf(...) __wrap_rt_sprintf(__VA_ARGS__) +#define rt_sprintfl(...) __wrap_rt_sprintf(__VA_ARGS__) +#define rt_snprintf(...) __wrap_rt_snprintf(__VA_ARGS__) +#define rt_snprintfl(...) __wrap_rt_snprintf(__VA_ARGS__) +#define rt_log_printf(...) __wrap_rt_log_printf(__VA_ARGS__) diff --git a/cores/realtek-ambz2/base/fixups/hal_flash.h b/cores/realtek-ambz2/base/fixups/hal_flash.h new file mode 100644 index 000000000..ebbf1f70c --- /dev/null +++ b/cores/realtek-ambz2/base/fixups/hal_flash.h @@ -0,0 +1,13 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-05-31. */ + +// - flash_api.c and flash_api_ext.c are both compiled in libambz2_sdk.a +// - the former declares weak functions 'flash_resource_lock' and 'flash_resource_unlock', +// while the latter actually implements them +// - for some reason, the linker resolves the weak functions only, +// and doesn't include them in the final binary + +#include_next "hal_flash.h" + +// try to remove the weak attribute +#undef __weak +#define __weak diff --git a/cores/realtek-ambz2/base/fixups/memory.c b/cores/realtek-ambz2/base/fixups/memory.c new file mode 100644 index 000000000..373037c4e --- /dev/null +++ b/cores/realtek-ambz2/base/fixups/memory.c @@ -0,0 +1,32 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-03. */ + +#include +#include +#include +#include + +#include +#include +#include + +int __wrap_memcmp(const void *av, const void *bv, size_t len) { + return utility_stubs.memcmp(av, bv, len); +} + +void *__wrap_memcpy(void *s1, const void *s2, size_t n) { + return utility_stubs.memcpy(s1, s2, n); +} + +void *__wrap_memmove(void *destaddr, const void *sourceaddr, unsigned length) { + return utility_stubs.memmove(destaddr, sourceaddr, length); +} + +void *__wrap_memset(void *dst0, int val, size_t length) { + return utility_stubs.memset(dst0, val, length); +} + +#if (CHIP_VER >= CHIP_B_CUT) +int __wrap_memcmp_s(const void *av, const void *bv, size_t len) { + return utility_stubs.memcmp_s(av, bv, len); +} +#endif diff --git a/cores/realtek-ambz2/base/fixups/memory.h b/cores/realtek-ambz2/base/fixups/memory.h new file mode 100644 index 000000000..be63e14f2 --- /dev/null +++ b/cores/realtek-ambz2/base/fixups/memory.h @@ -0,0 +1,17 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-03. */ + +#pragma once + +// Remove SDK definitions of memory utilities. +// Include stdlib versions instead. +// Wrapper functions for the removed prototypes are provided in memory.c. + +#include +#include +#include + +// Map SDK functions so that they point to stdlib again +#define rt_memcmp memcmp +#define rt_memcpy memcpy +#define rt_memmove memmove +#define rt_memset memset diff --git a/cores/realtek-ambz2/base/fixups/rtl8710c_freertos_pmu.h b/cores/realtek-ambz2/base/fixups/rtl8710c_freertos_pmu.h new file mode 100644 index 000000000..ab014d880 --- /dev/null +++ b/cores/realtek-ambz2/base/fixups/rtl8710c_freertos_pmu.h @@ -0,0 +1,11 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-05-23. */ + +#include + +// rtl8710c_freertos_pmu.h needs the u32/u16/u8 integer typedefs, +// so it relies on the caller (freertos_pmu.c) to provide these, +// which relies on FreeRTOS.h to include FreeRTOSConfig.h, +// which relies on diag.h included to get printf() functions, +// which just happens to include basic_types.h as well, +// and that's what makes the whole thing even compile +#include_next "rtl8710c_freertos_pmu.h" diff --git a/cores/realtek-ambz2/base/fixups/strproc.c b/cores/realtek-ambz2/base/fixups/strproc.c new file mode 100644 index 000000000..3feac7663 --- /dev/null +++ b/cores/realtek-ambz2/base/fixups/strproc.c @@ -0,0 +1,168 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-03. */ + +#include +#include +#include +#include +#include + +typedef struct strproc_func_stubs_s { + char *(*strcat)(char *dest, const char *src); + char *(*strchr)(const char *s, int c); + int (*strcmp)(const char *cs, const char *ct); + int (*strncmp)(const char *cs, const char *ct, size_t count); + int (*strnicmp)(const char *s1, const char *s2, size_t len); + char *(*strcpy)(char *dest, const char *src); + char *(*strncpy)(char *dest, const char *src, size_t count); + size_t (*strlcpy)(char *dst, const char *src, size_t s); + size_t (*strlen)(const char *s); + size_t (*strnlen)(const char *s, size_t count); + char *(*strncat)(char *dest, const char *src, size_t count); + char *(*strpbrk)(const char *cs, const char *ct); + size_t (*strspn)(const char *s, const char *accept); + char *(*strstr)(const char *s1, const char *s2); + char *(*strtok)(char *s, const char *ct); + size_t (*strxfrm)(char *dest, const char *src, size_t n); + char *(*strsep)(char **s, const char *ct); + double (*strtod)(const char *str, char **endptr); + float (*strtof)(const char *str, char **endptr); + long double (*strtold)(const char *str, char **endptr); + long (*strtol)(const char *nptr, char **endptr, int base); + long long (*strtoll)(const char *nptr, char **endptr, int base); + unsigned long (*strtoul)(const char *nptr, char **endptr, int base); + unsigned long long (*strtoull)(const char *nptr, char **endptr, int base); + int (*atoi)(const char *num); + unsigned int (*atoui)(const char *num); + long (*atol)(const char *num); + unsigned long (*atoul)(const char *num); + unsigned long long (*atoull)(const char *num); + double (*atof)(const char *str); + + uint32_t reserved[16]; // reserved space for next ROM code version function table extending. +} strproc_func_stubs_t; + +extern const strproc_func_stubs_t strproc_stubs; + +// Wrappers + +char *__wrap_strcat(char *dest, const char *src) { + return strproc_stubs.strcat(dest, src); +} + +char *__wrap_strchr(const char *s, int c) { + return strproc_stubs.strchr(s, c); +} + +int __wrap_strcmp(const char *cs, const char *ct) { + return strproc_stubs.strcmp(cs, ct); +} + +int __wrap_strncmp(const char *cs, const char *ct, size_t count) { + return strproc_stubs.strncmp(cs, ct, count); +} + +char *__wrap_strcpy(char *dest, const char *src) { + return strproc_stubs.strcpy(dest, src); +} + +char *__wrap_strncpy(char *dest, const char *src, size_t count) { + return strproc_stubs.strncpy(dest, src, count); +} + +size_t __wrap_strlen(const char *s) { + return strproc_stubs.strlen(s); +} + +char *__wrap_strncat(char *dest, const char *src, size_t count) { + return strproc_stubs.strncat(dest, src, count); +} + +char *__wrap_strpbrk(const char *cs, const char *ct) { + return strproc_stubs.strpbrk(cs, ct); +} + +size_t __wrap_strspn(const char *s, const char *accept) { + return strproc_stubs.strspn(s, accept); +} + +char *__wrap_strstr(const char *s1, const char *s2) { + return strproc_stubs.strstr(s1, s2); +} + +char *__wrap_strtok(char *s, const char *ct) { + return strproc_stubs.strtok(s, ct); +} + +size_t __wrap_strxfrm(char *dest, const char *src, size_t n) { + return strproc_stubs.strxfrm(dest, src, n); +} + +double __wrap_strtod(const char *str, char **endptr) { + return strproc_stubs.strtod(str, endptr); +} + +float __wrap_strtof(const char *str, char **endptr) { + return strproc_stubs.strtof(str, endptr); +} + +long double __wrap_strtold(const char *str, char **endptr) { + return strproc_stubs.strtold(str, endptr); +} + +double __wrap_atof(const char *str) { + return strproc_stubs.atof(str); +} + +long __wrap_strtol(const char *nptr, char **endptr, int base) { + return strproc_stubs.strtol(nptr, endptr, base); +} + +long long __wrap_strtoll(const char *nptr, char **endptr, int base) { + return strproc_stubs.strtoll(nptr, endptr, base); +} + +unsigned long __wrap_strtoul(const char *nptr, char **endptr, int base) { + return strproc_stubs.strtoul(nptr, endptr, base); +} + +unsigned long long __wrap_strtoull(const char *nptr, char **endptr, int base) { + return strproc_stubs.strtoull(nptr, endptr, base); +} + +int __wrap_atoi(const char *num) { + return strproc_stubs.atoi(num); +} + +long __wrap_atol(const char *num) { + return strproc_stubs.atol(num); +} + +// Standalone functions + +unsigned long atoul(const char *num) { + return strproc_stubs.atoul(num); +} + +unsigned long long atoull(const char *num) { + return strproc_stubs.atoull(num); +} + +unsigned int atoui(const char *num) { + return strproc_stubs.atoui(num); +} + +__attribute__((weak)) size_t strnlen(const char *s, size_t count) { + return strproc_stubs.strnlen(s, count); +} + +size_t strlcpy(char *dst, const char *src, size_t s) { + return strproc_stubs.strlcpy(dst, src, s); +} + +int strnicmp(const char *s1, const char *s2, size_t len) { + return strproc_stubs.strnicmp(s1, s2, len); +} + +__attribute__((weak)) char *strsep(char **s, const char *ct) { + return strproc_stubs.strsep(s, ct); +} diff --git a/cores/realtek-ambz2/base/fixups/strproc.h b/cores/realtek-ambz2/base/fixups/strproc.h new file mode 100644 index 000000000..aaa619f5b --- /dev/null +++ b/cores/realtek-ambz2/base/fixups/strproc.h @@ -0,0 +1,22 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-03. */ + +#pragma once + +// Remove SDK definitions of string processing methods. +// Include stdlib versions instead. +// Wrapper functions for the removed prototypes are provided in strproc.c. + +#include +#include +#include +#include + +// These functions aren't part of stdlib. + +unsigned long atoul(const char *num); +unsigned long long atoull(const char *num); +unsigned int atoui(const char *num); +size_t strnlen(const char *s, size_t count); +size_t strlcpy(char *dst, const char *src, size_t s); +int strnicmp(const char *s1, const char *s2, size_t len); +char *strsep(char **s, const char *ct); diff --git a/cores/realtek-ambz2/base/fixups/time64.h b/cores/realtek-ambz2/base/fixups/time64.h new file mode 100644 index 000000000..42c879781 --- /dev/null +++ b/cores/realtek-ambz2/base/fixups/time64.h @@ -0,0 +1,8 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-07-21. */ + +#pragma once + +#include_next "time64.h" + +// GCC 10.3.1 does not provide these structs by default +#include diff --git a/cores/realtek-ambz2/base/fixups/utility.h b/cores/realtek-ambz2/base/fixups/utility.h new file mode 100644 index 000000000..f66be93a4 --- /dev/null +++ b/cores/realtek-ambz2/base/fixups/utility.h @@ -0,0 +1,6 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-03. */ + +#pragma once + +// proxy because we're not using soc/realtek/8710c/misc/utilities/include as it contains ctype.h +#include diff --git a/cores/realtek-ambz2/base/fixups/wireless.h b/cores/realtek-ambz2/base/fixups/wireless.h new file mode 100644 index 000000000..c9915859b --- /dev/null +++ b/cores/realtek-ambz2/base/fixups/wireless.h @@ -0,0 +1,5 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-05-27. */ + +#undef IFNAMSIZ + +#include_next "wireless.h" diff --git a/cores/realtek-ambz2/base/lt_defs.h b/cores/realtek-ambz2/base/lt_defs.h new file mode 100644 index 000000000..4868572f3 --- /dev/null +++ b/cores/realtek-ambz2/base/lt_defs.h @@ -0,0 +1,10 @@ +#pragma once + +#error "Don't include this file directly" + +#define LT_HAS_FREERTOS 1 +#define LT_HAS_LWIP 1 +#define LT_HAS_LWIP2 1 +#define LT_HAS_MBEDTLS 1 +#define LT_HAS_PRINTF 1 +#define LT_HW_BLE 1 diff --git a/cores/realtek-ambz2/base/lt_family.h b/cores/realtek-ambz2/base/lt_family.h new file mode 100644 index 000000000..a574f6cda --- /dev/null +++ b/cores/realtek-ambz2/base/lt_family.h @@ -0,0 +1,22 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-03-02. */ + +#pragma once + +#include + +// Choose the main UART output port +#ifndef LT_UART_DEFAULT_PORT +#if LT_HW_UART2 +#define LT_UART_DEFAULT_PORT 2 +#elif LT_HW_UART0 +#define LT_UART_DEFAULT_PORT 0 +#elif LT_HW_UART1 +#define LT_UART_DEFAULT_PORT 1 +#else +#error "No serial port is available" +#endif +#endif + +// Auto-download-reboot detection pattern +// "ping" command for BootROM +#define LT_UART_ADR_PATTERN 'p', 'i', 'n', 'g', '\n' diff --git a/cores/realtek-ambz2/base/port/printf.c b/cores/realtek-ambz2/base/port/printf.c new file mode 100644 index 000000000..d15178060 --- /dev/null +++ b/cores/realtek-ambz2/base/port/printf.c @@ -0,0 +1,29 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-04-12. */ + +#include +#include + +#include + +static UART0_Type *uart_dev[4] = { + UART0, + UART1, + UART2, + UART3, +}; + +uint8_t lt_uart_port = 2; + +void putchar_(char c) { + putchar_p(c, lt_uart_port); +} + +void putchar_p(char c, unsigned long port) { + while (uart_dev[port]->tflvr_b.tx_fifo_lv >= Uart_Tx_FIFO_Size) {} + uart_dev[port]->thr = c; +} + +WRAP_PRINTF(rt_printf); +WRAP_SPRINTF(rt_sprintf); +WRAP_SNPRINTF(rt_snprintf); +WRAP_PRINTF(rt_log_printf); diff --git a/cores/realtek-ambz2/base/port/printf_port.h b/cores/realtek-ambz2/base/port/printf_port.h new file mode 100644 index 000000000..4c65b6cb2 --- /dev/null +++ b/cores/realtek-ambz2/base/port/printf_port.h @@ -0,0 +1,16 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-06-20. */ + +#pragma once + +#include + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +WRAP_DISABLE_DEF(rt_printf); +WRAP_DISABLE_DEF(rt_log_printf); + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/cores/realtek-ambz2/base/sdk_extern.h b/cores/realtek-ambz2/base/sdk_extern.h new file mode 100644 index 000000000..e5d5c1ad5 --- /dev/null +++ b/cores/realtek-ambz2/base/sdk_extern.h @@ -0,0 +1,28 @@ +/* Copyright (c) Kuba Szczodrzyński 2023-05-23. */ + +#pragma once + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif // __cplusplus + +// SDK +extern hal_uart_adapter_t log_uart; +void software_reset(); +void sys_swd_off(); +void sys_uart_download_mode(); +void sys_download_mode(uint8_t mode); + +// blobs +bool Hal_GetPhyEfuseMACAddr(uint32_t xFFFFE5BB, uint8_t *buf); +bool rtw_efuse_map_read(uint32_t xFFFFE5BB, uint32_t offset, uint32_t length, uint8_t *buf); +uint32_t efuse_OneByteRead(uint32_t x33300000, uint32_t addr, uint8_t *buf, uint32_t ldo); +uint32_t EFUSERead8(uint32_t x33300000, uint32_t addr, uint8_t *buf, uint32_t ldo); +uint32_t hal_get_chip_id(uint32_t *id); + +#ifdef __cplusplus +} // extern "C" +#endif diff --git a/cores/realtek-ambz2/misc/rtl8710c_ram.ld b/cores/realtek-ambz2/misc/rtl8710c_ram.ld new file mode 100644 index 000000000..7dbe1334d --- /dev/null +++ b/cores/realtek-ambz2/misc/rtl8710c_ram.ld @@ -0,0 +1,395 @@ +/* Linker script to configure memory regions. */ + +/* LibreTiny changes: + - added .ARM.exidx section + - added .ARM.extab + - added missing C++ support +*/ + +/* !! the include symbole may failed if the symbol file name is too long!! */ +INCLUDE "romsym_is.so" + +MEMORY +{ + /* The vector table, it must start with 256 bytes aligned address */ + VECTORS_RAM (rwx) : ORIGIN = 0x10000000, LENGTH = 0x100000A0 - 0x10000000 + + /* 0x100000A0 ~ 0x10000480 reserved for ROM code */ + + /* RAM functions entry table */ + RAM_FUN_TABLE (rwx) : ORIGIN = 0x10000480, LENGTH = 0x100004F0 - 0x10000480 + + /* RAM image Signature */ + RAM_IMG_SIGN (rwx) : ORIGIN = 0x100004F0, LENGTH = 0x10000500 - 0x100004F0 + + /* Internal RAM for program data & text */ + DTCM_RAM (wrx) : ORIGIN = 0x10000500, LENGTH = 0x1003FA00 - 0x10000500 + + /* 0x1003FE70 - 0x1003FA00 is reserved for ROM(NS) code */ + + /* External PSRAM for text, rodata & data */ + PSRAM (rwx) : ORIGIN = 0x60000000, LENGTH = 0x60400000 - 0x60000000 + BTRACE (rx) : ORIGIN = 0x00800000, LENGTH = 0x00C00000 - 0x00800000 /* Bluetooth Trace */ + /* Flash memory for XIP */ + /* XIP image must start with 64K(0x10000) aligned address */ + /* XIP Chiper section: TEXT/RODATA in this section can be encrypted (decrypt by SCE) */ + XIP_FLASH_C (rx) : ORIGIN = 0x9B000000, LENGTH = 0x9B800000 - 0x9B000000 + /* XIP Plantext section: RODATA in this section will not be encrypted */ + XIP_FLASH_P (rx) : ORIGIN = 0x9B800000, LENGTH = 0x9BFF0000 - 0x9B800000 +} + +/* Library configurations */ +GROUP(libgcc.a libc.a libm.a libnosys.a) + +/* Linker script to place sections and symbol values. Should be used together + * with other linker script that defines memory regions FLASH and RAM. + * It references following symbols, which must be defined in code: + * Reset_Handler : Entry of reset handler + * + * It defines following symbols, which code can use without definition: + * __exidx_start + * __exidx_end + * __copy_table_start__ + * __copy_table_end__ + * __zero_table_start__ + * __zero_table_end__ + * __etext + * __data_start__ + * __preinit_array_start + * __preinit_array_end + * __init_array_start + * __init_array_end + * __fini_array_start + * __fini_array_end + * __data_end__ + * __bss_start__ + * __bss_end__ + * __end__ + * end + * __HeapLimit + * __StackLimit + * __StackTop + * __stack + * __Vectors_End + * __Vectors_Size + */ +_start_addr = 0x1000; +ENTRY(_start_addr) +__eram_end__ = ORIGIN(PSRAM) + LENGTH(PSRAM); +__psram_start__ = ORIGIN(PSRAM); +__psram_end__ = ORIGIN(PSRAM) + LENGTH(PSRAM); + +SECTIONS +{ + .ram.vector : + { + . = ALIGN(256); + __ram_vector_start__ = .; + KEEP(*(.ram_vector_table)) + __ram_vector_end__ = .; + . = ALIGN(4); + } > VECTORS_RAM + + .ram.func.table : + { + . = ALIGN(32); + __ram_start_table_start__ = .; + KEEP(*(SORT(.start.ram.data*))) + __ram_start_table_end__ = .; + + } > RAM_FUN_TABLE + + .ram.img.signature : + { + __ram_img_signature__ = .; + KEEP(*(.start.ram.sign*)) + } > RAM_IMG_SIGN + + .psram.data : AT (__psram_etext) + { + . = ALIGN(16); + __psram_etext = .; + __psram_data_start__ = .; + + *(.psram.data*) + + __psram_data_end__ = .; + + } > PSRAM + + .bluetooth_trace.text : + { + __btrace_start__ = .; + *(.BTTRACE) + __btrace_end__ = .; + } > BTRACE + + .data : + { + . = ALIGN(16); + __etext = .; + __fw_img_start__ = .; + __data_start__ = .; + *(vtable) + *(.sram.data*) + *(.data*) + + KEEP(*(.jcr*)) + . = ALIGN(4); + /* All data end */ + __data_end__ = .; + } > DTCM_RAM + + .xip_c_reserved : + { + /* XIP image section must start with 64K aligned address, reserve 0x140 for image header */ + . += 0x140; + /* If the XIP is the 1st sub-image, then we should reserve 0xE0 bytes meore for OTA Sign. and 6 Public Key */ + /*. += 0xE0; */ + } > XIP_FLASH_C + + .xip_p_reserved : + { + /* XIP image section must start with 64K aligned address, reserve 0x140 for image header */ + . += 0x140; + /* If the XIP is the 1st sub-image, then we should reserve 0xE0 bytes meore for OTA Sign. and 6 Public Key */ + /*. += 0xE0; */ + } > XIP_FLASH_P + + .psram.code_text : + { + . = ALIGN(16); + __psram_code_text_start__ = .; + + *(.psram.text*) + + __psram_code_text_end__ = .; + } > PSRAM + + .psram.code_rodata : + { + . = ALIGN(16); + __psram_code_rodata_start__ = .; + + *(.psram.rodata*) + + . = ALIGN(4); + __psram_code_rodata_end__ = .; + } > PSRAM + + .psram.bss : + { + . = ALIGN(16); + __psram_bss_start__ = .; + + *(.psram.bss*) + + __psram_bss_end__ = .; + + . = ALIGN(32); + __eram_bss_end__ = .; + } > PSRAM + + .ram.code_text : + { + . = ALIGN(32); + __ram_entry_text_start__ = .; + *(.ram_entry_func.text*) + __ram_entry_text_end__ = .; + + . = ALIGN(32); + __ram_code_text_start__ = .; + + /* SPI flash controller related code should be located in SRAM, never locates them in XIP */ + *hal_spic*.o(.text*) + *hal_flash*.o(.text*) + + /* LPDDR controller related code should be located in SRAM, never locates them in LPDDR */ + *hal_lpcram*.o(.text*) + + *ram_start*.o(.text*) + *hal_power_mode*.o(.text*) + *hal_sys_ctrl*.o(.text*) + *rtl8710c_pinmux_patch*.o(.text*) + *hal_syson*.o(.text*) + *hal_pinmux*.o(.text*) + *hal_efuse*.o(.text*) + *sys_irq*.o(.text*) + + *(.lpddr.text*) + *(.sram.text*) + . = ALIGN(4); + __ram_code_text_end__ = .; + } > DTCM_RAM + + .ram.code_rodata : + { + . = ALIGN(16); + __ram_code_rodata_start__ = .; + + /* SPI flash controller related code should be located in SRAM, never locates them in XIP */ + *hal_spic*.o(.rodata*) + *hal_flash*.o(.rodata*) + + /* LPDDR controller related code should be located in SRAM, never locates them in LPDDR */ + *hal_lpcram*.o(.rodata*) + + *ram_start*.o(.rodata*) + *hal_power_mode*.o(.rodata*) + *hal_sys_ctrl*.o(.rodata*) + *rtl8710c_pinmux_patch*.o(.rodata*) + *hal_syson*.o(.rodata*) + *hal_pinmux*.o(.rodata*) + *hal_efuse*.o(.rodata*) + *sys_irq*.o(.rodata*) + + . = ALIGN(4); + __ram_code_rodata_end__ = .; + } > DTCM_RAM + + .xip.code_c : + { + /* For xip encrypted section ram image signature */ + KEEP(*(.xip.ram.sign.s)) + /* code and RO data in this section will be encrypted */ + . = ALIGN(16); + __xip_code_text_start__ = .; + + *(.xip.text*) + + *(.text*) + + /* put RO data sections need to be encrypted here */ + *(.xip.sec_rodata*) + + __xip_code_text_end__ = .; + } > XIP_FLASH_C + + .xip.code_p : + { + /* code and RO data in this section will NOT be encrypted */ + /* put DMA RO data here */ + __xip_code_rodata_start__ = .; + + *(.xip.rodata*) + + *(.rodata*) + *(.rodata.str1*) + + /* https://www.embedded.com/building-bare-metal-arm-systems-with-gnu-part-3/ */ + KEEP(*crtbegin.o(.ctors)) + KEEP(*(EXCLUDE_FILE (*ctrend.o) .ctors)) + KEEP(*(SORT(.ctors.*))) + KEEP(*crtend.o(.ctors)) + KEEP(*crtbegin.o(.dtors)) + KEEP(*(EXCLUDE_FILE (*crtend.o) .dtors)) + KEEP(*(SORT(.dtors.*))) + KEEP(*crtend.o(.dtors)) + *(.rodata .rodata.* .gnu.linkonce.r.*) + + /* Add This for C++ support */ + /* ambd_arduino/Arduino_package/hardware/variants/rtl8720dn_bw16/linker_scripts/gcc/rlx8721d_img2_is_arduino.ld */ + . = ALIGN(4); + __preinit_array_start = .; + KEEP(*(.preinit_array)) + __preinit_array_end = .; + . = ALIGN(4); + __init_array_start = .; + KEEP(*(SORT(.init_array.*))) + KEEP(*(.init_array)) + __init_array_end = .; + . = ALIGN(4); + __fini_array_start = .; + KEEP(*(SORT(.fini_array.*))) + KEEP(*(.fini_array)) + __fini_array_end = .; + /*-----------------*/ + + /* https://community.silabs.com/s/article/understand-the-gnu-linker-script-of-cortex-m4?language=en_US */ + KEEP(*(.init)) + KEEP(*(.fini)) + *(.init) + *(.fini) + + . = ALIGN(4); + __xip_code_rodata_end__ = .; + } > XIP_FLASH_P + + /* Add This for C++ support */ + .ARM.extab : + { + *(.ARM.extab* .gnu.linkonce.armextab.*) + } > XIP_FLASH_P + + .ARM.exidx : + { + __exidx_start = .; + *(.ARM.exidx*) + *(.gnu.linkonce.armexidx.*) + __exidx_end = .; + } > XIP_FLASH_P + + .system_restore_data : + { + /* data in this section will not be initialed by ram_start() */ + /* some of them will be initialed by boot loader */ + . = ALIGN(32); + *(.sys_restore.bss*) + *(.ram.bss.noinit*) + } > DTCM_RAM + + .bss : + { + . = ALIGN(16); + __bss_start__ = .; + *(.sram.bss*) + *(.bss*) + *(COMMON) + } > DTCM_RAM + + .non_secure.bss : + { + . = ALIGN(16); + __ns_bss_start__ = .; + *(.nonsecure.bss*) + + . = ALIGN(4); + __ns_bss_end__ = .; + + . = ALIGN(32); + __bss_end__ = .; + } > DTCM_RAM + + .heap (COPY): + { + __HeapBase = .; + __end__ = .; + end = __end__; + KEEP(*(.heap*)) + __HeapLimit = .; + } > DTCM_RAM + + /* .stack_dummy section doesn't contains any symbols. It is only + * used for linker to calculate size of stack sections, and assign + * values to stack symbols later */ + .stack_dummy (COPY): + { + KEEP(*(.stack*)) + } > DTCM_RAM + + /* Set stack top to end of RAM, and stack limit move down by + * size of stack_dummy section */ + __StackTop = ORIGIN(DTCM_RAM) + LENGTH(DTCM_RAM); + __StackLimit = __StackTop - SIZEOF(.stack_dummy); + PROVIDE(__stack = __StackTop); + PROVIDE(__sram_end__ = __StackLimit); + + /* Check if data + heap + stack exceeds RAM limit */ + ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack") + ASSERT(__bss_start__ >= __ram_code_text_end__, "sram heap will overwrite sram text") + ASSERT(__bss_start__ >= __ram_code_rodata_end__, "sram heap will overwrite sram rodata") + ASSERT(__bss_start__ >= __data_end__, "sram heap will overwrite sram data") + ASSERT(__psram_bss_start__ >= __psram_code_text_end__, "psram heap will overwrite psram text") + ASSERT(__psram_bss_start__ >= __psram_code_rodata_end__, "psram heap will overwrite psram rodata") + ASSERT(__psram_bss_start__ >= __psram_data_end__, "psram heap will overwrite psram data") +} diff --git a/docs/CNAME b/docs/CNAME new file mode 100644 index 000000000..906056bee --- /dev/null +++ b/docs/CNAME @@ -0,0 +1 @@ +docs.libretiny.eu diff --git a/docs/TODO/index.html b/docs/TODO/index.html new file mode 100644 index 000000000..cc6c9f0a1 --- /dev/null +++ b/docs/TODO/index.html @@ -0,0 +1,2537 @@ + + + + + + + + + + + + + + + + + + + + + + + + 📓 TODO - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

TODO list

+

General

+

Environment stability

+

Do not publish any SDK functions, macros, defines and includes. Define only what's needed in LT's public headers (like Arduino.h). Everything else is taken from sdk_extern.h or WVariant.h (TODO decide whether to keep WV public / make both private / get rid of WV and use sdk_extern only). Private headers are included by LT's .cpp units (maybe a dedicated private header that would include sdk_extern + Arduino.h).

+

Developers wanting to use SDK functions need to include them.

+

Explicit is better than implicit.

+
    +
  • consider moving to C++17 (GNU)? or any newer than C++11
  • +
  • wrap all memory management functions (malloc, calloc, free, memset, etc.) and their vendor SDK counterparts to use FreeRTOS instead
      +
    • pretty much done for ambz and ambz2, Beken is yet left to do (os_malloc() etc.)
    • +
    +
  • +
  • remove all network protocol client/server implementations from SDKs (mDNS, HTTP, DNS, etc.)
  • +
+

New families

+
    +
  • BL602
  • +
  • RTL8710A
  • +
  • RTL8720C
  • +
  • RTL8720D
  • +
  • W600 and/or W800
  • +
  • LN8825
  • +
  • BK7231Q
  • +
  • host-native family
  • +
+

Tools

+
    +
  • write OpenOCD flashers, using uf2ota library + FAL for partitions (in ltchiptool repository)
  • +
+

Development

+
    +
  • write Contributor's Guide
  • +
  • export LT cores in an Arduino IDE-compatible format (automatically - GitHub Actions)
  • +
  • consider using precompiled SDK blobs for improved build speed (especially on e.g. Raspberry Pi)
  • +
+

Serial

+
    +
  • configuration of RX/TX pins
  • +
  • SoftwareSerial library - receiving + Beken family
  • +
+

Other

+
    +
  • implement Wire on BK, refactor the API and class
  • +
  • watchdog API
  • +
  • Preferences library
  • +
  • test/fix IPv6 on different families
  • +
  • what is PowerManagement at all? probably useless -> remove
  • +
+

BK7231

+
    +
  • fix WiFi on BK7231N, test other functionality
  • +
  • fix SSL (mbedTLS)
  • +
  • I2C (Wire)
  • +
  • SPI
  • +
  • BLE
  • +
+

RTL8710B

+
    +
  • take all stdio functions from stdio.h
  • +
  • rewrite most of Wiring (it was copied from ambd_arduino, and is ugly)
  • +
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/boards_tuya_all.json b/docs/boards_tuya_all.json new file mode 100644 index 000000000..290f6d0a0 --- /dev/null +++ b/docs/boards_tuya_all.json @@ -0,0 +1,768 @@ +{ + "wb": { + "wb1s": { + "mcu": "bk7231t", + "flash": 2097152, + "ram": 262144, + "pins_total": 18, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "wb1s", + "datasheet_id": "K9duevbj3ol4x" + }, + "wb2l": { + "mcu": "bk7231t", + "flash": 2097152, + "ram": 262144, + "pins_total": 7, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "wb2l-datasheet", + "datasheet_id": "K9duegc9bualu" + }, + "wb2s": { + "mcu": "bk7231t", + "flash": 2097152, + "ram": 262144, + "pins_total": 11, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "wb2s-module-datasheet", + "datasheet_id": "K9ghecl7kc479" + }, + "wb3l": { + "mcu": "bk7231t", + "flash": 2097152, + "ram": 262144, + "pins_total": 18, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "wb3l-module-datasheet", + "datasheet_id": "K9duiggw2v8sp" + }, + "wb3s": { + "mcu": "bk7231t", + "flash": 2097152, + "ram": 262144, + "pins_total": 22, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "wb3s-module-datasheet", + "datasheet_id": "K9dx20n6hz5n4" + }, + "wb8p": { + "mcu": "bk7231t", + "flash": 2097152, + "ram": 262144, + "pins_total": 10, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "wb8p-module-datasheet", + "datasheet_id": "K9fwx4f89tvzd" + }, + "wblc5": { + "mcu": "bk7231t", + "flash": 2097152, + "ram": 262144, + "pins_total": 15, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "wblc5-module-datasheet", + "datasheet_id": "K9duilns1f3gi" + }, + "wblc9": { + "mcu": "bk7231t", + "flash": 2097152, + "ram": 262144, + "pins_total": 8, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "wblc9-module-datasheet", + "datasheet_id": "K9hgglry2jp5h" + } + }, + "wbr": { + "wbr1": { + "mcu": "rtl8720cf", + "flash": 2097152, + "ram": 262144, + "pins_total": 18, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "wbr1d-module-datasheet", + "datasheet_id": "K9duko5tg2vjw" + }, + "wbr1d": { + "mcu": "rtl8720dn", + "flash": 4194304, + "ram": 524288, + "pins_total": 18, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "wbr1d-module-datasheet", + "datasheet_id": "K9duko5tg2vjw" + }, + "wbr2": { + "mcu": "rtl8720cf", + "flash": 2097152, + "ram": 262144, + "pins_total": 11, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "wbr2l-module-datasheet", + "datasheet_id": "K9rw73glq0mkp" + }, + "wbr2d": { + "mcu": "rtl8720dn", + "flash": 4194304, + "ram": 524288, + "pins_total": 11, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "wbr2d-module-datasheet", + "datasheet_id": "K9dujwcg2yr8i" + }, + "wbr2l": { + "mcu": "rtl8720cf", + "flash": 2097152, + "ram": 262144, + "pins_total": 7, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "wbr2l-module-datasheet", + "datasheet_id": "K9rw73glq0mkp" + }, + "wbr3": { + "mcu": "rtl8720cf", + "flash": 2097152, + "ram": 262144, + "pins_total": 16, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "wbr3n-datasheet", + "datasheet_id": "K9qskxwpcqyaq" + }, + "wbr3d": { + "mcu": "rtl8720dn", + "flash": 4194304, + "ram": 524288, + "pins_total": 16, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "wbr3d-module-datasheet", + "datasheet_id": "K9dukbbnmuw4h" + }, + "wbr3l": { + "mcu": "rtl8720cf", + "flash": 2097152, + "ram": 262144, + "pins_total": 18, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "wbr3l-module-datasheet", + "datasheet_id": "K9fte9kq2vq6t" + }, + "wbr3n": { + "mcu": "rtl8720cs", + "flash": 4194304, + "ram": 524288, + "pins_total": 16, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "wbr3n-datasheet", + "datasheet_id": "K9qskxwpcqyaq" + }, + "wbr3s": { + "mcu": "rtl8720cf", + "flash": 2097152, + "ram": 262144, + "pins_total": 22, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "wbr3s-module-datasheet", + "datasheet_id": "K9qrt2je8wqxo" + }, + "wbr3t": { + "mcu": "rtl8720dn", + "flash": 4194304, + "ram": 524288, + "pins_total": 16, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "wbr3t-module-datasheet", + "datasheet_id": "K9qs708w94ox8" + }, + "wbrg1": { + "mcu": "rtl8720csm", + "flash": 8388608, + "ram": 4194304, + "pins_total": 25, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "wbrg1-module-datasheet", + "datasheet_id": "Ka015vo8tfztz" + }, + "wbru": { + "mcu": "rtl8720cf", + "flash": 2097152, + "ram": 262144, + "pins_total": 21, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "wbru-module-datasheet", + "datasheet_id": "Kai1h5xb3dp98" + } + }, + "cb": { + "cb1s": { + "mcu": "bk7231n", + "flash": 2097152, + "ram": 262144, + "pins_total": 18, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "cb1s-module-datasheet", + "datasheet_id": "Kaij1abmwyjq2" + }, + "cb2l": { + "mcu": "bk7231n", + "flash": 2097152, + "ram": 262144, + "pins_total": 7, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "cb2l-module-datasheet", + "datasheet_id": "Kai2eku1m3pyl" + }, + "cb2s": { + "mcu": "bk7231n", + "flash": 2097152, + "ram": 262144, + "pins_total": 11, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "cb2s-module-datasheet", + "datasheet_id": "Kafgfsa2aaypq" + }, + "cb3l": { + "mcu": "bk7231n", + "flash": 2097152, + "ram": 262144, + "pins_total": 18, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "cb3l-module-datasheet", + "datasheet_id": "Kai51ngmrh3qm" + }, + "cb3s": { + "mcu": "bk7231n", + "flash": 2097152, + "ram": 262144, + "pins_total": 22, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "cb3s", + "datasheet_id": "Kai94mec0s076" + }, + "cb3se": { + "mcu": "bk7231n", + "flash": 2097152, + "ram": 262144, + "pins_total": 22, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "CB3SE-Module-Datasheet", + "datasheet_id": "Kanoiluul7nl2" + }, + "cb8p": { + "mcu": "bk7231n", + "flash": 2097152, + "ram": 262144, + "pins_total": 10, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "cb8p-module-datasheet", + "datasheet_id": "Kahvig14r1yk9" + }, + "cblc5": { + "mcu": "bk7231n", + "flash": 2097152, + "ram": 262144, + "pins_total": 15, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "cblc5-module-datasheet", + "datasheet_id": "Ka07iqyusq1wm" + }, + "cblc9": { + "mcu": "bk7231n", + "flash": 2097152, + "ram": 262144, + "pins_total": 8, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "cblc9-module-datasheet", + "datasheet_id": "Ka42cqnj9r0i5" + }, + "cbu": { + "mcu": "bk7231n", + "flash": 2097152, + "ram": 262144, + "pins_total": 21, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "cbu-module-datasheet", + "datasheet_id": "Ka07pykl5dk4u" + } + }, + "cr": { + "cr2s": { + "mcu": "rtl8720cm", + "flash": 4194304, + "ram": 4194304, + "pins_total": 11, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "cr2s-module-datasheet", + "datasheet_id": "Kaawygkszksio" + }, + "cr3l": { + "mcu": "rtl8720cm", + "flash": 4194304, + "ram": 4194304, + "pins_total": 18, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "cr3l-module-datasheet", + "datasheet_id": "Ka3gl6ria8f1t" + }, + "crg1": { + "mcu": "rtl8720cm", + "flash": 4194304, + "ram": 4194304, + "pins_total": 25, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "CRG1-Module-Datasheet", + "datasheet_id": "Kbtesqh678sbe" + } + }, + "tcs905": { + "tcs905-3s": { + "mcu": "bk7231n", + "flash": 2097152, + "ram": 262144, + "pins_total": 22, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "TCS905-3S-Module-Datasheet", + "datasheet_id": "Kc5xc8hhigndh" + }, + "tcs905-u": { + "mcu": "bk7231n", + "flash": 2097152, + "ram": 262144, + "pins_total": 21, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "TCS905-U-module-datasheet", + "datasheet_id": "Kc5x1p35fs5zf" + } + }, + "t2": { + "t2-u": { + "mcu": "bk7231n", + "flash": 2097152, + "ram": 262144, + "pins_total": 21, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "T2-U-module-datasheet", + "datasheet_id": "Kce1tncb80ldq" + } + }, + "t1": { + "t1-2s": { + "mcu": "t1a", + "flash": 1048576, + "ram": 294912, + "pins_total": 11, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "T1-2S-module-datasheet", + "datasheet_id": "Kcl2d5xjy1rly" + } + }, + "axy": { + "axy2s": { + "mcu": "ecr6600", + "flash": 2097152, + "ram": 524288, + "pins_total": 11, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "AXY2S", + "datasheet_id": "Kb1aztk507fxf" + }, + "axy3l": { + "mcu": "ecr6600", + "flash": 2097152, + "ram": 524288, + "pins_total": 18, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "AXY3L", + "datasheet_id": "Kb1ald9k8myha" + }, + "axy3s": { + "mcu": "ecr6600", + "flash": 2097152, + "ram": 524288, + "pins_total": 22, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "AXY3S", + "datasheet_id": "Kb19flkv2adcc" + }, + "axyu": { + "mcu": "ecr6600", + "flash": 2097152, + "ram": 524288, + "pins_total": 21, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "AXYU", + "datasheet_id": "Kb0rwbv5b7aiy" + } + }, + "wt": { + "wt3": { + "mcu": "bk7231n", + "flash": 2097152, + "ram": 262144, + "pins_total": 16, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "WT3-Module-Datasheet", + "datasheet_id": "Kbogc3ps2rn8i" + } + }, + "wl": { + "wl2h-u": { + "mcu": "ln882h", + "flash": 0, + "ram": 303104, + "pins_total": 21, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "WL2H-U-Module-Datasheet", + "datasheet_id": "Kbohlj8eg19u5" + } + }, + "wx": { + "wxu": { + "mcu": "t103c-hl", + "flash": 2097152, + "ram": 327680, + "pins_total": 21, + "connectivity": [ + "wifi", + "ble" + ], + "datasheet_name": "wxu-module-datasheet", + "datasheet_id": "Kc2xk9qlk04so" + } + }, + "wr": { + "wr1": { + "mcu": "rtl8710bn", + "flash": 1048576, + "ram": 262144, + "pins_total": 18, + "connectivity": [ + "wifi" + ], + "datasheet_name": "wifiwr1module", + "datasheet_id": "K9605tc0k90t3" + }, + "wr1e": { + "mcu": "rtl8710bn", + "flash": 2097152, + "ram": 262144, + "pins_total": 18, + "connectivity": [ + "wifi" + ], + "datasheet_name": "wr1e", + "datasheet_id": "K96smbbeycxtf" + }, + "wr2": { + "mcu": "rtl8710bn", + "flash": 2097152, + "ram": 262144, + "pins_total": 11, + "connectivity": [ + "wifi" + ], + "datasheet_name": "wifiwr2lmodule", + "datasheet_id": "K9605tnbj7gva" + }, + "wr2e": { + "mcu": "rtl8710bn", + "flash": 2097152, + "ram": 262144, + "pins_total": 11, + "connectivity": [ + "wifi" + ], + "datasheet_name": "wr2e", + "datasheet_id": "K97scnsjhue4h" + }, + "wr2l": { + "mcu": "rtl8710bx", + "flash": 2097152, + "ram": 262144, + "pins_total": 7, + "connectivity": [ + "wifi" + ], + "datasheet_name": "wifiwr2lmodule", + "datasheet_id": "K9605tnbj7gva" + }, + "wr2le": { + "mcu": "rtl8710bx", + "flash": 2097152, + "ram": 262144, + "pins_total": 7, + "connectivity": [ + "wifi" + ], + "datasheet_name": "wr2le", + "datasheet_id": "K9eio9y9e8i8c" + }, + "wr3": { + "mcu": "rtl8710bn", + "flash": 2097152, + "ram": 262144, + "pins_total": 16, + "connectivity": [ + "wifi" + ], + "datasheet_name": "wr3le", + "datasheet_id": "K986l7a1ha8tm" + }, + "wr3e": { + "mcu": "rtl8710bn", + "flash": 2097152, + "ram": 262144, + "pins_total": 16, + "connectivity": [ + "wifi" + ], + "datasheet_name": "wr3e-module-datasheet", + "datasheet_id": "K9elwlqbfosbc" + }, + "wr3l": { + "mcu": "rtl8710bx", + "flash": 2097152, + "ram": 262144, + "pins_total": 18, + "connectivity": [ + "wifi" + ], + "datasheet_name": "wr3le", + "datasheet_id": "K986l7a1ha8tm" + }, + "wr3le": { + "mcu": "rtl8710bx", + "flash": 2097152, + "ram": 262144, + "pins_total": 18, + "connectivity": [ + "wifi" + ], + "datasheet_name": "wr3le", + "datasheet_id": "K986l7a1ha8tm" + }, + "wr3n": { + "mcu": "rtl8710bn", + "flash": 2097152, + "ram": 262144, + "pins_total": 16, + "connectivity": [ + "wifi" + ], + "datasheet_name": "wr3n-datasheet", + "datasheet_id": "K98zdx31ztdge" + }, + "wr4": { + "mcu": "rtl8710bn", + "flash": 1048576, + "ram": 262144, + "pins_total": 16, + "connectivity": [ + "wifi" + ], + "datasheet_name": "wifiwr4module", + "datasheet_id": "K9605tvu78p3e" + }, + "wr5e": { + "mcu": "rtl8710bn", + "flash": 2097152, + "ram": 262144, + "pins_total": 15, + "connectivity": [ + "wifi" + ], + "datasheet_name": "wr5e", + "datasheet_id": "K986r9pxqxa8i" + }, + "wr6": { + "mcu": "rtl8710bn", + "flash": 2097152, + "ram": 262144, + "pins_total": 14, + "connectivity": [ + "wifi" + ], + "datasheet_name": "wr6h-module-datasheet", + "datasheet_id": "K9pork8eeowgl" + }, + "wr6-h": { + "mcu": "rtl8710bn", + "flash": 2097152, + "ram": 262144, + "pins_total": 14, + "connectivity": [ + "wifi" + ], + "datasheet_name": "wr6h-module-datasheet", + "datasheet_id": "K9pork8eeowgl" + }, + "wrg1": { + "mcu": "rtl8711am", + "flash": 4194304, + "ram": 2097152, + "pins_total": 25, + "connectivity": [ + "wifi" + ], + "datasheet_name": "wrg1-datasheet", + "datasheet_id": "K97rig6mscj8e" + } + }, + "xr": { + "xr1": { + "mcu": "xr809", + "flash": 2097152, + "ram": 393216, + "pins_total": 18, + "connectivity": [ + "wifi", + "rfid" + ], + "datasheet_name": "xr1ipex-module-datasheet", + "datasheet_id": "K9razqu9gqele" + }, + "xr3": { + "mcu": "xr809", + "flash": 2097152, + "ram": 393216, + "pins_total": 16, + "connectivity": [ + "wifi", + "rfid" + ], + "datasheet_name": "xr3-datasheet", + "datasheet_id": "K98s9168qi49g" + } + } +} \ No newline at end of file diff --git a/docs/contrib/lt-api-functions/index.html b/docs/contrib/lt-api-functions/index.html new file mode 100644 index 000000000..81f3a1a22 --- /dev/null +++ b/docs/contrib/lt-api-functions/index.html @@ -0,0 +1,2718 @@ + + + + + + + + + + + + + + + + + + + + Lt api functions - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeFunctionCommonWeakFamily
const char *lt_cpu_get_core_type()✔️
voidlt_deep_sleep_config_timer()✔️
voidlt_deep_sleep_enter()✔️
voidlt_deep_sleep_unset_gpio()✔️
lt_flash_id_tlt_flash_get_id()✔️
voidlt_get_device_mac()✔️
voidlt_init_arduino()✔️
voidlt_init_family()✔️
voidlt_init_variant()✔️
uint8_tlt_ota_dual_get_current()✔️
uint8_tlt_ota_dual_get_stored()✔️
lt_ota_type_tlt_ota_get_type()✔️
boollt_ota_is_valid()✔️
boollt_ota_switch()✔️
uint32_tlt_ram_get_size()✔️
boollt_wdt_enable()✔️
uint8_tlt_cpu_get_core_count()✔️
uint32_tlt_cpu_get_cycle_count()✔️
uint32_tlt_cpu_get_freq()✔️
uint32_tlt_cpu_get_mac_id()✔️
lt_cpu_model_tlt_cpu_get_model()✔️
uint32_tlt_cpu_get_unique_id()✔️
voidlt_deep_sleep_config_gpio()✔️
uint32_tlt_flash_get_size()✔️
lt_reboot_reason_tlt_get_reboot_reason()✔️
voidlt_gpio_recover()✔️
uint32_tlt_heap_get_free()✔️
uint32_tlt_heap_get_max_alloc()✔️
uint32_tlt_heap_get_min_free()✔️
uint32_tlt_heap_get_size()✔️
voidlt_ota_set_write_protect()✔️
voidlt_reboot()✔️
boollt_reboot_download_mode()✔️
boollt_reboot_wdt()✔️
boollt_set_debug_mode()✔️
voidlt_wdt_disable()✔️
voidlt_wdt_feed()✔️
voidhexdump()✔️
char *lt_btox()✔️
lt_cpu_family_tlt_cpu_get_family()✔️
const char *lt_cpu_get_family_name()✔️
uint32_tlt_cpu_get_freq_mhz()✔️
const char *lt_cpu_get_model_code()✔️
const char *lt_cpu_get_model_name()✔️
boollt_flash_erase()✔️
boollt_flash_erase_block()✔️
uint32_tlt_flash_read()✔️
uint32_tlt_flash_write()✔️
const char *lt_get_board_code()✔️
const char *lt_get_device_name()✔️
const char *lt_get_reboot_reason_name()✔️
const char *lt_get_version()✔️
voidlt_ota_begin()✔️
boollt_ota_can_rollback()✔️
boollt_ota_end()✔️
uf2_ota_scheme_tlt_ota_get_uf2_scheme()✔️
size_tlt_ota_write()✔️
boollt_ota_write_block()✔️
voidlt_rand_bytes()✔️
uint8_t *lt_xtob()✔️
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/contrib/lt-api/index.html b/docs/contrib/lt-api/index.html new file mode 100644 index 000000000..5ae2bb875 --- /dev/null +++ b/docs/contrib/lt-api/index.html @@ -0,0 +1,2751 @@ + + + + + + + + + + + + + + + + + + + + + + + + API functions guide - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

API functions guide

+

The LibreTiny C API functions are split between three types: common, weak and family.

+
    +
  • Common functions are implemented in the base, common core and are the same between all families.
  • +
  • Weak functions are provided in the common core, but can (and sometimes should) be overridden by family cores. They sometimes provide usable default implementations (which can be overriden to provide e.g. a better way to do something), otherwise they're empty (e.g. if a family doesn't support such a feature).
  • +
  • Family functions are not provided in the common core and have to be implemented in the family core.
  • +
+

A quick outline of all available functions and their types:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeFunctionCommonWeakFamily
const char *lt_cpu_get_core_type()✔️
voidlt_deep_sleep_config_timer()✔️
voidlt_deep_sleep_enter()✔️
voidlt_deep_sleep_unset_gpio()✔️
lt_flash_id_tlt_flash_get_id()✔️
voidlt_get_device_mac()✔️
voidlt_init_arduino()✔️
voidlt_init_family()✔️
voidlt_init_variant()✔️
uint8_tlt_ota_dual_get_current()✔️
uint8_tlt_ota_dual_get_stored()✔️
lt_ota_type_tlt_ota_get_type()✔️
boollt_ota_is_valid()✔️
boollt_ota_switch()✔️
uint32_tlt_ram_get_size()✔️
boollt_wdt_enable()✔️
uint8_tlt_cpu_get_core_count()✔️
uint32_tlt_cpu_get_cycle_count()✔️
uint32_tlt_cpu_get_freq()✔️
uint32_tlt_cpu_get_mac_id()✔️
lt_cpu_model_tlt_cpu_get_model()✔️
uint32_tlt_cpu_get_unique_id()✔️
voidlt_deep_sleep_config_gpio()✔️
uint32_tlt_flash_get_size()✔️
lt_reboot_reason_tlt_get_reboot_reason()✔️
voidlt_gpio_recover()✔️
uint32_tlt_heap_get_free()✔️
uint32_tlt_heap_get_max_alloc()✔️
uint32_tlt_heap_get_min_free()✔️
uint32_tlt_heap_get_size()✔️
voidlt_ota_set_write_protect()✔️
voidlt_reboot()✔️
boollt_reboot_download_mode()✔️
boollt_reboot_wdt()✔️
boollt_set_debug_mode()✔️
voidlt_wdt_disable()✔️
voidlt_wdt_feed()✔️
voidhexdump()✔️
char *lt_btox()✔️
lt_cpu_family_tlt_cpu_get_family()✔️
const char *lt_cpu_get_family_name()✔️
uint32_tlt_cpu_get_freq_mhz()✔️
const char *lt_cpu_get_model_code()✔️
const char *lt_cpu_get_model_name()✔️
boollt_flash_erase()✔️
boollt_flash_erase_block()✔️
uint32_tlt_flash_read()✔️
uint32_tlt_flash_write()✔️
const char *lt_get_board_code()✔️
const char *lt_get_device_name()✔️
const char *lt_get_reboot_reason_name()✔️
const char *lt_get_version()✔️
voidlt_ota_begin()✔️
boollt_ota_can_rollback()✔️
boollt_ota_end()✔️
uf2_ota_scheme_tlt_ota_get_uf2_scheme()✔️
size_tlt_ota_write()✔️
boollt_ota_write_block()✔️
voidlt_rand_bytes()✔️
uint8_t *lt_xtob()✔️
+ + + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/contrib/ota/index.html b/docs/contrib/ota/index.html new file mode 100644 index 000000000..9963e574a --- /dev/null +++ b/docs/contrib/ota/index.html @@ -0,0 +1,2547 @@ + + + + + + + + + + + + + + + + + + + + + + + + ✈️ OTA format - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

UF2-based OTA

+

LibreTiny's OTA updating is based on Microsoft's UF2 specification. Some aspects of the process, such as OTA1/2 support and target partition selection, have been customized with extension tags.

+
+

Note

+

Just like in UF2, all values in this format are little-endian.

+
+

Firmware images

+

UF2 files may contain multiple firmware images that are to be flashed, i.e. main firmware + bootloader + some config partition.

+

Some CPUs support dual-OTA schemes: firmware runs from one image, while the other one is reserved for updated firmware. After applying the update, a reboot causes to run the other image instead.

+

Each firmware image may be either applicable:

+
    +
  1. only when flashing OTA1 (part;file;;)
  2. +
  3. only when flashing OTA2 (;;part;file)
  4. +
  5. for both schemes to a single partition (part;file)
  6. +
  7. for both schemes but different partitions (part1;file;part2;file)
  8. +
  9. for both schemes but with a different binary (part;file1;part;file2)
  10. +
  11. for both schemes, with different binaries and target partitions (part1;file1;part2;file2)
  12. +
+

* part means partition here

+

** values in parentheses show the input format to use for uf2ota.py

+

For easier understanding, these update types will be referred to in this document using the numbers.

+

Extension tags

+

Standard tags are used: VERSION, DEVICE and DEVICE_ID.

+

Additionally, custom tags are defined:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameIDTypeDescription
OTA_VERSION0x5D57D0int 8-bitformat version (for simple compatibility checks)
BOARD0xCA25C8stringboard name / code (lowercase)
FIRMWARE0x00DE43stringfirmware description / name
BUILD_DATE0x822F30int 32-bitbuild date/time as Unix timestamp
LT_VERSION0x59563DsemverLT version
LT_PART_10x805946stringOTA1 partition name
LT_PART_20xA1E4D7stringOTA2 partition name
LT_HAS_OTA10xBBD965bool 8-bitimage has any data for OTA1
LT_HAS_OTA20x92280Ebool 8-bitimage has any data for OTA2
LT_BINPATCH0xB948DEbytesbinary patch to convert OTA1->OTA2
+

Update types

+

Single OTA scheme (1, 2)

+

Image is ignored if the OTA scheme does not match. UF2 has LT_PART_1 or LT_PART_2 set to target partition name. The other partition tag is present, but empty (0 bytes).

+
08 46 59 80 6f 74 61 31 | .FY.ota1 | LT_PART_1
+04 d7 e4 a1             | ....     | LT_PART_2
+
+

Dual-OTA/single-file scheme (3, 4)

+

One image is used for both OTA schemes. UF2 has LT_PART_1 and LT_PART_2 tags set. For type 3 these two tags contain the same partition name.

+
08 46 59 80 6f 74 61 31 | .FY.ota1 | LT_PART_1
+08 d7 e4 a1 6f 74 61 32 | ....ota2 | LT_PART_2
+
+

Dual-OTA/dual-file scheme (5, 6)

+

Just like types 3 and 4, UF2 has two partition tags set. For type 5 they have the same name.

+

The image stored in UF2 is meant for OTA1 scheme. There is an additional tag LT_BINPATCH present. In OTA1 flashing scheme, it is ignored.

+

Binary patching

+

OTA2 images are not stored directly, as that would needlessly double the UF2 file size. Instead, binary patching instructions, embedded into the extension tags area, allow the CPU to convert the OTA1 image from UF2 into OTA2 image.

+

There can be at most one binpatch tag in a UF2 block. It has the following format:

+
    +
  • opcode (1 byte) - operation type:
      +
    • DIFF32 (0xFE) - difference between 32-bit values
    • +
    +
  • +
  • length (1 byte) - data length
  • +
  • data (length bytes)
      +
    • for DIFF32:
        +
      • difference value (signed int 32-bit)
      • +
      • offset table (length-4 bytes)
      • +
      +
    • +
    +
  • +
+

The presented structure can be repeated in a single binpatch tag.

+

DIFF32

+

This method works by adding the difference value to a 32-bit integer. It allows to save the most space in OTA1/2 image scenarios, where the only different values are, for example, flash memory addresses. The offset table contains positions within the 256-byte block, to which the difference value should be mathematically added.

+

For a block like: +

000  72 71 73 61 76 65 00 00  5f 66 72 65 65 72 74 6f  |rqsave.._freerto|
+010  73 5f 6d 75 74 65 78 5f  67 65 74 5f 74 69 6d 65  |s_mutex_get_time|
+020  6f 75 74 00 5d a4 03 08  61 a4 03 08 85 a4 03 08  |out.]...a.......|
+030  5d a4 03 08 61 a4 03 08  85 a4 03 08 81 a9 03 08  |]...a...........|
+040  6d a9 03 08 7d a4 03 08  d9 a8 03 08 05 a7 03 08  |m...}...........|
+050  bd a4 03 08 ad a8 03 08  59 a7 03 08 9d a8 03 08  |........Y.......|
+060  01 a7 03 08 51 a8 03 08  21 aa 03 08 b9 a4 03 08  |....Q...!.......|
+070  85 a3 03 08 89 a3 03 08  4d a4 03 08 a1 a8 03 08  |........M.......|
+080  00 00 00 00 00 00 00 00  19 a8 03 08 c1 a4 03 08  |................|
+090  8d a8 03 08 ed a6 03 08  dd a7 03 08 ad a4 03 08  |................|
+0a0  9d a7 03 08 95 a4 03 08  81 a7 03 08 09 a7 03 08  |................|
+0b0  31 a7 03 08 d1 a6 03 08  dd a5 03 08 61 aa 03 08  |1...........a...|
+0c0  c5 a2 03 08 d5 a2 03 08  d9 a2 03 08 b1 a6 03 08  |................|
+0d0  65 aa 03 08 ad a6 03 08  a9 a6 03 08 8d a6 03 08  |e...............|
+0e0  e5 a2 03 08 e9 a2 03 08  1d a4 03 08 ed a3 03 08  |................|
+0f0  35 a4 03 08 05 a4 03 08  bd a3 03 08 8d a3 03 08  |5...............|
+

+

a DIFF32 patch containing: +

     fe 39 00 50 0c 00 24 28  2c 30 34 38 3c 40 44 48  |.9.P..$(,048<@DH|
+     4c 50 54 58 5c 60 64 68  6c 70 74 78 7c 88 8c 90  |LPTX\`dhlptx|...|
+     94 98 9c a0 a4 a8 ac b0  b4 b8 bc c0 c4 c8 cc d0  |................|
+     d4 d8 dc e0 e4 e8 ec f0  f4 f8 fc                 |...........     |
+

+

adds 0x000C5000 to 53 values, producing OTA2 output like this: +

000  72 71 73 61 76 65 00 00  5f 66 72 65 65 72 74 6f  |rqsave.._freerto|
+010  73 5f 6d 75 74 65 78 5f  67 65 74 5f 74 69 6d 65  |s_mutex_get_time|
+020  6f 75 74 00 5d f4 0f 08  61 f4 0f 08 85 f4 0f 08  |out.]...a.......|
+030  5d f4 0f 08 61 f4 0f 08  85 f4 0f 08 81 f9 0f 08  |]...a...........|
+040  6d f9 0f 08 7d f4 0f 08  d9 f8 0f 08 05 f7 0f 08  |m...}...........|
+050  bd f4 0f 08 ad f8 0f 08  59 f7 0f 08 9d f8 0f 08  |........Y.......|
+060  01 f7 0f 08 51 f8 0f 08  21 fa 0f 08 b9 f4 0f 08  |....Q...!.......|
+070  85 f3 0f 08 89 f3 0f 08  4d f4 0f 08 a1 f8 0f 08  |........M.......|
+080  00 00 00 00 00 00 00 00  19 f8 0f 08 c1 f4 0f 08  |................|
+090  8d f8 0f 08 ed f6 0f 08  dd f7 0f 08 ad f4 0f 08  |................|
+0a0  9d f7 0f 08 95 f4 0f 08  81 f7 0f 08 09 f7 0f 08  |................|
+0b0  31 f7 0f 08 d1 f6 0f 08  dd f5 0f 08 61 fa 0f 08  |1...........a...|
+0c0  c5 f2 0f 08 d5 f2 0f 08  d9 f2 0f 08 b1 f6 0f 08  |................|
+0d0  65 fa 0f 08 ad f6 0f 08  a9 f6 0f 08 8d f6 0f 08  |e...............|
+0e0  e5 f2 0f 08 e9 f2 0f 08  1d f4 0f 08 ed f3 0f 08  |................|
+0f0  35 f4 0f 08 05 f4 0f 08  bd f3 0f 08 8d f3 0f 08  |5...............|
+

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/contrib/ota/library/index.html b/docs/contrib/ota/library/index.html new file mode 100644 index 000000000..4fb14e092 --- /dev/null +++ b/docs/contrib/ota/library/index.html @@ -0,0 +1,2408 @@ + + + + + + + + + + + + + + + + + + + + + + + + uf2ota.h library - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

uf2ota library

+

uf2ota library allows to write a LibreTiny UF2 file to the flash, while parsing all the necessary tags. It manages the target partitions, compatibility checks, and works on top of the FAL provided by FlashDB.

+

Usage example

+
uint8_t target     = 1;          // target OTA scheme - 1 or 2
+uint32_t family    = F_RTL8710B; // chip's UF2 family ID
+uf2_ota_t *ctx     = uf2_ctx_init(target, family);
+uf2_info_t *info   = uf2_info_init(); // optional, for getting firmware info
+uf2_block_t *block = (uf2_block_t *)malloc(UF2_BLOCK_SIZE);
+uf2_err_t err;
+
+// ... // read the first header block (512 bytes) into *block
+
+// check the block for validity
+err = uf2_check_block(ctx, block);
+if (err > UF2_ERR_IGNORE)
+    // handle the error
+    return;
+
+// parse the header block
+// note: if you don't need info, you can skip this step and call uf2_write() directly
+err = uf2_parse_header(ctx, block, info);
+if (err)
+    // handle the error
+    return;
+
+while (/* have input data */) {
+
+    // ... // read the next block into *block
+
+    // check the block for validity
+    err = uf2_check_block(ctx, block);
+    if (err == UF2_ERR_IGNORE)
+        // skip this block
+        continue;
+    if (err)
+        // handle the error
+        return;
+
+    // write the block to flash
+    err = uf2_write(ctx, block);
+    if (err > UF2_ERR_IGNORE)
+        // handle the error
+        return;
+}
+
+// finish the update process
+
+// ... // activate your new OTA partition
+
+// cleanup
+free(ctx);
+free(block);
+uf2_info_free(info);
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/contrib/ota/uf2ota/index.html b/docs/contrib/ota/uf2ota/index.html new file mode 100644 index 000000000..174f52396 --- /dev/null +++ b/docs/contrib/ota/uf2ota/index.html @@ -0,0 +1,2362 @@ + + + + + + + + + + + + + + + + + + + + + + + + uf2ota.py tool - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

uf2ota.py

+

This is a tool for converting LibreTiny firmware images to UF2 format for OTA updates.

+
$ python uf2ota.py
+usage: uf2ota [-h] [--output OUTPUT] [--family FAMILY] [--board BOARD] [--version VERSION] [--fw FW] {info,dump,write} inputs [inputs ...]
+uf2ota: error: the following arguments are required: action, inputs
+
+

write

+

Generate a UF2 file from a firmware image or several images.

+
$ python uf2ota.py write --family RTL8710B --board wr3 --version 0.4.0 --fw esphome:2022.6.0-dev "ota1;xip1.bin;ota2;xip2.bin"
+
+$ ls -l out.uf2
+-rw-r--r-- 1 Kuba None 605696 May 28 14:35 out.uf2
+
+

inputs format

+

Format for inputs parameter is part;file[;part;file] (square brackets mean optional). First two (colon separated) values correspond to flashing OTA1 region, second two to OTA2.

+

Partition name can be suffixed by +offset, which causes writing the image file to the partition after some byte offset. Both files and/or partition names can be equal. Values can be empty (like part;file;; or ;;part;file) if OTA1/2 images are not present in this file.

+

When using two different firmware binaries, they need to have the same offset and be of the same size.

+

inputs parameter can be repeated in order to embed multiple files in the UF2. For example: +

"bootloader;boot.bin" "ota1;xip1.bin;ota2;xip2.bin" "config;config1.bin;config;config2.bin"
+
+will:

+
    +
  • flash the bootloader in both OTA schemes
  • +
  • flash xip1.bin or xip2.bin to ota1 or ota2 partitions
  • +
  • flash config1.bin or config2.bin to config partition
  • +
+

info

+

This command shows some basic parameters of a UF2 image.

+
$ python uf2ota.py info out.uf2
+Family: RTL8710B
+Tags:
+ - BOARD: wr3
+ - DEVICE_ID: 312d5ec5
+ - LT_VERSION: 0.4.0
+ - FIRMWARE: esphome
+ - VERSION: 2022.6.0-dev
+ - OTA_VERSION: 01
+ - DEVICE: LibreTiny
+ - LT_HAS_OTA1: 01
+ - LT_HAS_OTA2: 01
+ - LT_PART_1: ota1
+ - LT_PART_2: ota2
+ - LT_BINPATCH: fe0900500c009094989ca0
+Data chunks: 1182
+Total binary size: 302448
+
+

dump

+

Dump UF2 file (only LibreTiny format) into separate firmware binaries.

+
$ python uf2ota.py dump out.uf2
+
+$ ls -1 out.uf2_dump/
+esphome_2022.6.0-dev_lt0.4.0_wr3_1_ota1_0x0.bin
+esphome_2022.6.0-dev_lt0.4.0_wr3_2_ota2_0x0.bin
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/contrib/porting/index.html b/docs/contrib/porting/index.html new file mode 100644 index 000000000..f90dcac37 --- /dev/null +++ b/docs/contrib/porting/index.html @@ -0,0 +1,2508 @@ + + + + + + + + + + + + + + + + + + + + + + + + Porting new families - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Porting new families

+

This document briefly outlines what needs to be done, in order to port a new chip family to LibreTiny.

+

Base framework + builders

+

The base framework is the core part, that provides little functionality and a small HAL (over some things like OTA or sys control). It also includes a builder script for the vendor SDK.

+

Here's what has to be done to make that work:

+
    +
  1. Find vendor SDK - should be self-explanatory. We can't work without a working SDK (yet).
  2. +
  3. +

    Test vendor SDK - compile a sample program "as it was meant to be done".

    +
      +
    • Most SDKs provide some example programs (like Hello World, WiFi scanning, etc.) that can usually be compiled by running a single "make" command.
    • +
    • Sometimes you need to configure your environment in a weird and complicated way. For me, using Cygwin on Windows was usually enough, though.
    • +
    • You need to flash this to the chip as well. The SDK usually bundles some flashing tools.
    • +
    • This step is crucial to understand the vendor build system, and to have working binaries to compare out results against.
    • +
    +
  4. +
  5. +

    "Clean up" vendor SDK.

    +
      +
    • SDKs usually bundle entire compiler toolchains, which can take up hundreds of megabytes. We want to keep the downloaded PlatformIO packages as small as possible.
    • +
    • On existing families, GitHub Workflows produce the packages by removing some files and adding package.json to them. See framework-beken-bdk/.github/workflows/platformio-package.yml for an example.
    • +
    +
  6. +
  7. +

    Write base family and board definitions.

    +
      +
    • families.json needs to have the new family added to it.
    • +
    • platform.json needs to know the vendor SDK repository.
    • +
    • Add any boards and base JSONs to the boards/ directory. It's easiest to start with generic boards.
    • +
    • Use boardgen ltci to generate variant sources (.c and .h).
    • +
    +
  8. +
  9. +

    Add base core code.

    +
      +
    • lt_defs.h, lt_family.h and lt_api.c files need to be created, and initialized with (even empty) functions and definitions.
    • +
    • The list of family functions can be found here.
    • +
    • Make the SDK call lt_main() as the entrypoint. If needed, use fixups.
    • +
    +
  10. +
  11. +

    Write a binary manipulation tool.

    +
      +
    • While this step could be optional, as these tools are provided in the SDK, they're usually platform-specific (i.e. Windows-only) and use proprietary executables, with no source code nor documentation. This is unacceptable for LibreTiny, as we need to support multiple architectures & platforms (Windows, Linux, Raspberry Pi, etc.). Naturally, doing that in Python seems to be the best choice.
    • +
    • All binary tools are currently in ltchiptool/soc/.../binary.py. The elf2bin() function is what takes an .ELF file, and generates a set of binaries that can be flashed to the chip.
    • +
    • It's best to test if the generation is correct, by taking an .ELF compiled by vendor SDK, running it through ltchiptool and checking if the resulting binaries are identical.
    • +
    • Ghidra/IDA Pro is your friend here; you can decompile the SDK tools.
    • +
    +
  12. +
  13. +

    Write a flashing tool.

    +
      +
    • mostly the same as above. Refer to the existing tools for examples. It's useful to make the flasher class "standalone", i.e. a class that is then wrapped by ltchiptool, like in realtek-ambz2.
    • +
    +
  14. +
  15. +

    Write builder scripts.

    +
      +
    • builder/family/xxx.py files are builders, which contain all SDK sources and include paths. Write the script, based on the existing families, and any Makefiles or other scripts from the SDK.
    • +
    • Make sure not to make a mess in the CCFLAGS/CPPDEFINES, and only include what's needed there. Some flags are project-wide (family-independent) in builder/frameworks/base.py.
    • +
    • Use a pure PlatformIO project - not ESPHome!. Pass one of the generic boards you created before, and framework = base in platformio.ini. Generally, try to get the thing to compile.
    • +
    • Use a simple Hello World program - C, not C++. Only add main() function with a printf() and a while(1) loop.
    • +
    • I've noticed that using nano.specs instead of nosys.specs produces smaller binaries.
    • +
    +
  16. +
  17. +

    When you get it to link successfully, build a UF2 file.

    +
      +
    • UF2 packages are for flashing and for OTA.
    • +
    • Add UF2OTA to the env, to provide binaries that will go to the UF2. Some understanding of the chip's partition and flash layout will be needed.
    • +
    +
  18. +
  19. +

    Flash it, test if it works!

    +
      +
    • It probably won't. You may need to remove __libc_init_array() from cores/common/base/lt_api.c so that it doesn't crash. Most SDKs don't support C++ properly.
    • +
    +
  20. +
+

Making it actually work

+
    +
  1. +

    Write flashdb and printf ports.

    +
      +
    • The ports are in cores/.../base/port/. It's a simple flash access layer, and a character printing function. Not a lot of work, but it needs to be done first.
    • +
    +
  2. +
  3. +

    Add fixups so that string & memory stdlib functions are not from SDK.

    +
      +
    • Refer to stdlib.md to find functions that need to be wrapped.
    • +
    • SDK should not define them, you have to figure out a way to remove them from headers. Fixups can mess with includes and trick the SDK into using our own functions.
    • +
    +
  4. +
  5. +

    Clean up FreeRTOS.

    +
      +
    • FreeRTOS' headers usually include some SDK headers, which pull in a lot of macros and typedefs, which usually break lots of non-SDK code, which doesn't expect these macros.
    • +
    • library-freertos repo contains some FreeRTOS versions, adapted for SDKs. Basically, copy a clean (straight from FreeRTOS github) version to the repo, commit it. Then copy the version from SDK and compare the differences.
    • +
    • Try to make it look as "stock" as possible. Discard any formatting differences (and backports).
    • +
    • Annotate any parts that can't be removed with #ifdef FREERTOS_PORT_REALTEK_AMB1.
    • +
    • Put the FreeRTOS vendor-specific port in library-freertos-port.
    • +
    • Remove all FreeRTOS sources from builder scripts. Replace with:
    • +
    +
    env.Replace(FREERTOS_PORT=env["FAMILY_NAME"], FREERTOS_PORT_DEFINE="REALTEK_AMB1")
    +queue.AddExternalLibrary("freertos")
    +queue.AddExternalLibrary("freertos-port")
    +
    +
  6. +
  7. +

    Do the same with lwIP - later.

    +
  8. +
  9. +

    Write LibreTiny C APIs - in lt_api.c.

    +
  10. +
  11. +

    At this point, your Hello World code should work fine.

    +
  12. +
+

Porting Arduino Core - C++ support

+
    +
  1. +

    Add main.cpp and write wiring_*.c ports. GPIOs and stuff should work even without proper C++ support.

    +
  2. +
  3. +

    Port Serial library first. This should already show whether C++ works fine or if it doesn't. For example, calling Serial.println() refers to the virtual function Print::write, which will probably crash the chip if C++ is not being linked properly.

    +
  4. +
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/contrib/project-structure/index.html b/docs/contrib/project-structure/index.html new file mode 100644 index 000000000..f64bf0bbc --- /dev/null +++ b/docs/contrib/project-structure/index.html @@ -0,0 +1,2348 @@ + + + + + + + + + + + + + + + + + + + + + + + + 📁 Project structure - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Project structure

+
arduino/
+├─ <family name>/               Arduino Core for a specific SoC family
+│  ├─ cores/                        Wiring core files
+│  ├─ libraries/                    Supported built-in family libraries
+│  ├─ port/                     External library port units
+├─ libretiny/
+│  ├─ api/                      Library interfaces
+│  ├─ common/                   Units common to all families
+│  ├─ compat/                   Fixes for compatibility with ESP32 framework
+│  ├─ core/                     LibreTiny API for Arduino cores
+│  ├─ libraries/                Built-in family-independent libraries
+|  ├─ port/                     External library port units
+|  ├─ posix/                    POSIX-like C utility functions
+boards/
+├─ _base/                       Base board manifests
+├─ <board name>/                Board-specific code
+│  ├─ variant.cpp                   Arduino variant initialization
+│  ├─ variant.h                     Arduino variant pin configs
+├─ <board name>.json            PlatformIO board description
+builder/
+├─ frameworks/                  Framework builders for PlatformIO
+│  ├─ <family name>-sdk.py          Vanilla SDK build system
+│  ├─ <family name>-arduino.py      Arduino Core build system
+├─ libs/                        Builders for external libraries
+├─ utils/                       SCons utils used during the build
+├─ arduino-common.py            Builder to provide ArduinoCore-API and LibreTiny APIs
+├─ main.py                      Main PlatformIO builder
+docs/                           Project documentation, guides, tips, etc.
+platform/
+├─ <family name>/               Family-specific configurations
+│  ├─ bin/                          Binary blobs (bootloaders, etc.)
+│  ├─ fixups/                       Code fix-ups to replace SDK parts
+│  ├─ ld/                           Linker scripts
+│  ├─ openocd/                      OpenOCD configuration files
+tools/
+├─ <tool name>/                     Tools used during the build
+├─ util/                            Utilities used by CLI tools and the builders
+families.json                   List of supported device families
+platform.json                   PlatformIO manifest
+platform.py                     Custom PlatformIO script
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/contrib/stdlib/index.html b/docs/contrib/stdlib/index.html new file mode 100644 index 000000000..1f5145e43 --- /dev/null +++ b/docs/contrib/stdlib/index.html @@ -0,0 +1,2406 @@ + + + + + + + + + + + + + + + + + + + + + + + + C standard library - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

C stdlib

+

Usually, functions available in C standard library should not be defined by the SDK. Instead, they should be included using GCC's headers, and implemented by the libc or wrapped and implemented in the SDK.

+

The following functions should not be defined by the SDK. Their presence creates conflicts due to incompatibility with C library, so they should be removed or disabled, and replaced with wrappers.

+

Memory management functions must be wrapped and redirected to FreeRTOS. The necessary linker flags are already added for all families (in base.py), and a FreeRTOS implementation of the wrappers are provided in malloc.c in the common core. If the family doesn't use FreeRTOS, a separate implementation must be added.

+

Additionally, if the printf library is used in the chip family code, all other vendor-defined printf-like functions should be replaced with it.

+

Function prototypes taken from devdocs.io.

+
// stdlib.h / Dynamic memory management
+void *calloc(size_t num, size_t size);
+void *malloc(size_t size);
+void *realloc(void *ptr, size_t new_size);
+void free(void *ptr);
+// stdlib.h / Conversions to numeric formats
+double atof(const char *str);
+int atoi(const char *str);
+long atol(const char *str);
+long long atoll(const char *str);
+double strtod(const char *str, char **str_end);
+float strtof(const char *str, char **str_end);
+long strtol(const char *str, char **str_end, int base);
+long double strtold(const char *str, char **str_end);
+long long strtoll(const char *str, char **str_end, int base);
+unsigned long strtoul(const char *str, char **str_end, int base);
+unsigned long long strtoull(const char *str, char **str_end, int base);
+// stdlib.h / Random numbers
+int rand();
+
+// string.h / Character classification
+int isalnum(int ch);
+int isalpha(int ch);
+int islower(int ch);
+int isupper(int ch);
+int isdigit(int ch);
+int isxdigit(int ch);
+int iscntrl(int ch);
+int isgraph(int ch);
+int isspace(int ch);
+int isblank(int ch);
+int isprint(int ch);
+int ispunct(int ch);
+int tolower(int ch);
+int toupper(int ch);
+// string.h / String manipulation
+char *strcat(char *dest, const char *src);
+char *strcpy(char *dest, const char *src);
+char *strncat(char *dest, const char *src, size_t count);
+char *strncpy(char *dest, const char *src, size_t count);
+size_t strxfrm(char *dest, const char *src, size_t count);
+// string.h / String examination
+char *strchr(const char *str, int ch);
+int strcmp(const char *lhs, const char *rhs);
+size_t strcspn(const char *dest, const char *src);
+size_t strlen(const char *str);
+int strncmp(const char *lhs, const char *rhs, size_t count);
+char *strpbrk(const char *dest, const char *breakset);
+char *strrchr(const char *str, int ch);
+size_t strspn(const char *dest, const char *src);
+char *strstr(const char *str, const char *substr);
+char *strtok(char *str, const char *delim);
+// string.h / Character array manipulation
+void *memchr(const void *ptr, int ch, size_t count);
+int memcmp(const void *lhs, const void *rhs, size_t count);
+void *memcpy(void *dest, const void *src, size_t count);
+void *memmove(void *dest, const void *src, size_t count);
+void *memset(void *dest, int ch, size_t count);
+
+// stdio.h / Unformatted input/output
+int putc(int ch, FILE *stream);
+int putchar(int ch);
+int puts(const char *str);
+
+// stdio.h / Formatted input/output
+int printf(const char *format, ...);
+int sprintf(char *buffer, const char *format, ...);
+int snprintf(char *buffer, size_t bufsz, const char *format, ...);
+int vprintf(const char *format, va_list vlist);
+int vsprintf(char *buffer, const char *format, va_list vlist);
+int vsnprintf(char *buffer, size_t bufsz, const char *format, va_list vlist);
+
+// POSIX/BSD (from www.die.net)
+size_t strlcat(char *dst, const char *src, size_t size);
+size_t strlcpy(char *dst, const char *src, size_t size);
+size_t strnlen(const char *s, size_t maxlen);
+char *strsep(char **stringp, const char *delim);
+
+// Non-stdlib
+_calloc_r
+_free_r
+_malloc_r
+_realloc_r
+atoui
+atoul
+atoull
+strnicmp
+zalloc
+
+// Additional forbidden macros
+#define max(a, b)
+#define min(a, b)
+typedef bool boolean;
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/dev/config/index.html b/docs/dev/config/index.html new file mode 100644 index 000000000..06fbf3b89 --- /dev/null +++ b/docs/dev/config/index.html @@ -0,0 +1,2622 @@ + + + + + + + + + + + + + + + + + + + + + + + + 🔧 LT Configuration - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Configuration

+

Project options

+
platformio.ini
[env:my_board]
+# custom firmware name, present in UF2 output files
+# - default: project directory name
+custom_fw_name = my_firmware
+# custom firmware version
+# - default: current date in yy.mm.dd format
+custom_fw_version = 1.2.0
+
+# custom build options (#defines, NOT compiler flags)
+custom_options.lwip =
+    LWIP_IPV4 = 1
+custom_options.freertos =
+    configUSE_TICK_HOOK = 1
+
+# partition layout modification (not recommended, unless you know what you're doing)
+custom_flash.app = 0x12000
+
+# custom board JSON (overrides)
+# - path relative to the project directory; only values specified
+#     in the JSON will override the defaults
+#     (it's like using board_build.xxx but for more keys)
+custom_board = myboard.json
+
+# custom library versions (not recommended)
+custom_versions.lwip = 2.1.3
+custom_versions.beken_bdk = 2021.06.07
+
+

LibreTiny options

+
+

Note

+

See lt_config.h for most options and their defaults.

+
+

All options are configurable via C++ defines in PlatformIO project file. For example: +

platformio.ini
[env:my_board]
+build_flags =
+  -D LT_LOGLEVEL=LT_LEVEL_DEBUG
+

+
+

Tip

+

Values in parentheses represent the defaults for the config options.

+
+

Logger

+
    +
  • LT_LOGGER (1) - enable/disable LibreTiny logger globally; disabling this sets the loglevel to LT_LEVEL_NONE - the logger can't be enabled even by using lt_log_set_port()
  • +
  • +

    LT_LOGLEVEL - global LT loglevel:

    +
      +
    • LT_LEVEL_VERBOSE
    • +
    • LT_LEVEL_TRACE - same as LT_LEVEL_VERBOSE
    • +
    • LT_LEVEL_DEBUG
    • +
    • LT_LEVEL_INFO - default
    • +
    • LT_LEVEL_WARN
    • +
    • LT_LEVEL_ERROR
    • +
    • LT_LEVEL_FATAL
    • +
    • LT_LEVEL_NONE - disables everything
    • +
    +
  • +
  • +

    LT_LOGGER_TIMESTAMP (1) - print program runtime in printk-like format

    +
  • +
  • LT_LOGGER_CALLER (1) - print calling method name
  • +
  • LT_LOGGER_TASK (1) - print calling FreeRTOS task (if available)
  • +
  • LT_LOGGER_COLOR (0) - output ANSI terminal colors
  • +
  • LT_PRINTF_BROKEN (0) - whether printf outputs "0." for floats with value 0
  • +
  • LT_LOG_HEAP (0) - print free heap size using LT_HEAP_I(), and periodically every 1000 ms
  • +
  • LT_LOG_ERRNO (0) - print and clear errno value (if set) using LT_ERRNO()
  • +
+

Per-module logging & debugging

+

The following options enable library-specific logging output. They are effective for all loglevels - i.e. disabling LT_DEBUG_WIFI will disable WiFi debug messages, warnings, as well as errors.

+

To see debug messages from i.e. OTA, loglevel must also be changed.

+
    +
  • LT_DEBUG_ALL (0) - enable all following options by default (except for FDB and LWIP)
  • +
  • LT_DEBUG_WIFI (1) - WiFi (generic, STA, AP, scan, events, etc.)
  • +
  • LT_DEBUG_CLIENT (0) - TCP client
  • +
  • LT_DEBUG_SERVER (0) - TCP server
  • +
  • LT_DEBUG_SSL (0) - SSL clients
  • +
  • LT_DEBUG_OTA (1) - OTA updates (Update library)
  • +
  • LT_DEBUG_FDB (0) - FlashDB debugging (macros within the library)
  • +
  • LT_DEBUG_MDNS (0) - mDNS client library
  • +
  • LT_DEBUG_LWIP (0) - enables LWIP_DEBUG, provides LWIP_PLATFORM_DIAG; per-module options (i.e. TCP_DEBUG) are off by default and need to be enabled separately
  • +
  • LT_DEBUG_LWIP_ASSERT (0) - enables assertions within lwIP (doesn't need LT_DEBUG_LWIP)
  • +
+
+

Tip

+

Enabling LT_DEBUG_ALL doesn't mean that every debugging message will be printed. If loglevel is i.e. WARN, debug messages won't be visible anyway.

+

This can be used, for example, to enable only "important" messages: +

platformio.ini
[env:my_board]
+build_flags =
+  -D LT_LOGLEVEL=LT_LEVEL_WARN
+  -D LT_DEBUG_ALL=1 # will print only warnings and errors from all modules
+

+
+

Serial output

+

Options for controlling default UART log output.

+
    +
  • LT_UART_DEFAULT_PORT (unset) - default output port for all messages (SDK, LT logger, Serial class); can be 0, 1 or 2
  • +
  • LT_UART_DEFAULT_LOGGER (unset) - override default output port for LT logger only
  • +
  • LT_UART_DEFAULT_SERIAL (unset) - override default output port for Serial class (without a number)
  • +
  • LT_UART_SILENT_ENABLED (1) - enable auto-silencing of SDK "loggers"; this makes the serial output much more readable, but can hide some error messages
  • +
  • LT_UART_SILENT_ALL (0) - disable all SDK output (LT output and logger still work); since v1.0.0 this has no effect if LT_UART_SILENT_ENABLED is 0
  • +
+
+

Info

+

Values 0, 1 and 2 correspond to physical UART port numbers (refer to board pinout for the available ports).

+

Serial class instances (Serial0, Serial1, Serial2) use the respective port numbers for printing.

+

If LT_UART_DEFAULT_LOGGER is not set, it is chosen by the family code - whichever port is most appropriate (i.e. LOG_UART (2) on Realtek, RX2/TX2 on Beken).

+
+

Misc options

+
    +
  • LT_USE_TIME (0) - enables implementation of gettimeofday() and settimeofday(); checks for millis() overflows periodically
  • +
  • LT_MICROS_HIGH_RES (1) - count runtime microseconds using a high-resolution timer (if possible); disable if your application doesn't need micros()
  • +
  • LT_AUTO_DOWNLOAD_REBOOT (1) - automatically reboot into "download mode" after detecting a flashing protocol command; read more
  • +
+

Family configuration

+
+

Warning

+

These options are not meant for end-users. They're provided here as a reference for developers. Do not set these options manually.

+
+

These options are selectively set by all families, as part of the build process. They are used for enabling LT core API parts, if the family has support for it. Files named lt_defs.h, containing these options, are read by the PlatformIO builders (note: they're never included by C code).

+

Checking for option value should be done with #if (not with #ifdef!) - if it's not defined, it will evaluate to 0. Otherwise, it will use the defined value, either 0 or 1.

+
    +
  • family-/chip-specific hardware peripherals
      +
    • LT_HW_WIFI - WiFi supported on the chip
    • +
    • LT_HW_BT - Bluetooth Classic supported on the chip
    • +
    • LT_HW_BLE - Bluetooth Low Energy supported on the chip
    • +
    • LT_HW_WATCHDOG - watchdog available
    • +
    • LT_HW_DEEP_SLEEP - deep sleep possible
    • +
    +
  • +
  • board-specific peripherals (note: defined in lt_pins.h, depending on available pin numbers)
      +
    • LT_HW_UART# - UART number # available on the board
    • +
    • LT_HW_I2C# - I²C number # available on the board
    • +
    • LT_HW_SPI# - SPI number # available on the board
    • +
    +
  • +
  • family software options (SDK features, LT implementation status)
      +
    • LT_HAS_FREERTOS - FreeRTOS supported and used
    • +
    • LT_HAS_LWIP - LwIP in SDK (any version)
    • +
    • LT_HAS_LWIP2 - LwIP v2.0.0 or newer
    • +
    • LT_HAS_MBEDTLS - mbedTLS in SDK
    • +
    • LT_HAS_PRINTF - printf library implemented
    • +
    • LT_HAS_FLASH - FAL flash port implemented
    • +
    • LT_HAS_OTA - OTA implemented in base framework
    • +
    +
  • +
  • Arduino Core implementation status (only available and used along with Arduino framework)
      +
    • LT_ARD_HAS_SERIAL - Serial class implemented
    • +
    • LT_ARD_HAS_SOFTSERIAL - SoftwareSerial library implemented
    • +
    • LT_ARD_HAS_WIFI - WiFi library implemented
    • +
    • LT_ARD_HAS_WIRE - Wire (I²C) library implemented
    • +
    • LT_ARD_HAS_SPI - SPI library implemented
    • +
    • LT_ARD_MD5_MBEDTLS - use mbedTLS for MD5 library
    • +
    • LT_ARD_MD5_HOSTAPD - use hostapd for MD5 library
    • +
    +
  • +
  • misc options
      +
    • LT_HEAP_FUNC - function name used to get available heap size (for LT_HEAP_I())
    • +
    • LT_REALLOC_FUNC - function name used for realloc() call
    • +
    • LT_REMALLOC - use malloc() and memcpy() in realloc() call
    • +
    +
  • +
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/dev/libs-3rd-party/index.html b/docs/dev/libs-3rd-party/index.html new file mode 100644 index 000000000..445d4ef47 --- /dev/null +++ b/docs/dev/libs-3rd-party/index.html @@ -0,0 +1,2424 @@ + + + + + + + + + + + + + + + + + + + + + + + + External compatible libraries - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Libraries

+

A page outlining 3-rd some party libraries compatible with LibreTiny.

+
+

Note

+

To use some (most? (all?)) of these, a flag in platformio.ini is required to disable compatibility checks (because most libs are meant for ESP32/Arduino official framework): +

[env:my_board]
+lib_compat_mode = off
+

+
+

256dpi/MQTT

+

Tested with realtek-ambz. +

lib_deps = 256dpi/MQTT@^2.5.0
+

+

bbx10/DNSServer

+

Tested with beken-72xx. +

lib_deps = bbx10/DNSServer@^1.1.0
+
+This is the same library as in ESP32 Arduino Core.

+

esphome/AsyncTCP-esphome

+

Tested with beken-72xx and realtek-ambz. +

lib_deps = esphome/AsyncTCP-esphome@^2.0.0
+
+This is ESPHome's fork of the original library.

+

esphome/ESPAsyncWebServer-esphome

+

Tested with beken-72xx and realtek-ambz. +

lib_deps = esphome/ESPAsyncWebServer-esphome@^3.0.0
+
+This is ESPHome's fork of the original library.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/dev/lt-api/index.html b/docs/dev/lt-api/index.html new file mode 100644 index 000000000..b78304b19 --- /dev/null +++ b/docs/dev/lt-api/index.html @@ -0,0 +1,3580 @@ + + + + + + + + + + + + + + + + + + + + + + + + 📖 LibreTiny API - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

LibreTiny API

+

The LibreTiny API is divided in two parts:

+
    +
  • the C API, available in all families and frameworks
  • +
  • the C++ API, available in the Arduino framework only.
  • +
+

The C++ API is a thin wrapper around the C API (using classes with inline functions). +It's provided for less-experienced users, who are used to Arduino IDE's classes like ESP (and for backwards compatibility). +It's recommended to use the C API wherever possible.

+

C API

+

This API is available using:

+
    +
  • #include <libretiny.h>
  • +
  • #include <Arduino.h>
  • +
+

CPU

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
uint8_tlt_cpu_get_core_count ()
Get CPU core count.
const char *lt_cpu_get_core_type ()
Get CPU core type name as string.
uint32_tlt_cpu_get_cycle_count ()
Get CPU cycle count.
lt_cpu_family_tlt_cpu_get_family ()
Get CPU family ID (as lt_cpu_family_t enum member).
const char *lt_cpu_get_family_name ()
Get CPU family name as string.
uint32_tlt_cpu_get_freq ()
Get CPU frequency in Hz.
uint32_tlt_cpu_get_freq_mhz ()
Get CPU frequency in MHz.
uint32_tlt_cpu_get_mac_id ()
Get CPU ID based on the last three octets of MAC address. Note: the number is 24-bit (with the MSB being zero). The 3rd-to-last octet is least-significant, the last octet is most-significant.
lt_cpu_model_tlt_cpu_get_model ()
Get CPU model ID (as lt_cpu_model_t enum member).
const char *lt_cpu_get_model_code ()
Get CPU model name as string (lowercase).
const char *lt_cpu_get_model_name ()
Get CPU model name as string (uppercase).
uint32_tlt_cpu_get_unique_id ()
Get CPU unique ID. This may be based on MAC, eFuse, etc. (family-specific). Note: the number is 24-bit (with the MSB being zero).
+ + +

Device

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
const char *lt_get_board_code ()
Get board code.
voidlt_get_device_mac (uint8_t * mac)
Read device's default MAC address into 'mac' array. This can be used even without Wi-Fi enabled, and will ignore user-changed Wi-Fi MAC (if changing is possible).
const char *lt_get_device_name ()
Get device friendly name in format "LT-<chip model>-<MAC ID>". Can be used as hostname.
lt_reboot_reason_tlt_get_reboot_reason ()
Get the reason of last chip reboot.
const char *lt_get_reboot_reason_name (lt_reboot_reason_t reason)
Get a textual representation of a reboot reason.
const char *lt_get_version ()
Get LibreTiny version string.
voidlt_gpio_recover ()
Reconfigure GPIO pins used for debugging (SWD/JTAG), so that they can be used as normal I/O.
voidlt_reboot ()
Reboot the CPU.
boollt_reboot_download_mode ()
Reboot the CPU and stay in download mode (if possible).
boollt_reboot_wdt ()
Reboot the CPU with a watchdog timeout (if possible).
boollt_set_debug_mode (lt_debug_mode_t mode)
Set debugger mode (JTAG, SWD or OFF).
+

Macros

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
defineREBOOT_REASON_SLEEP REBOOT_REASON_SLEEP_GPIO
defineRESET_REASON_BROWNOUT REBOOT_REASON_BROWNOUT
defineRESET_REASON_CRASH REBOOT_REASON_CRASH
defineRESET_REASON_HARDWARE REBOOT_REASON_HARDWARE
defineRESET_REASON_MAX REBOOT_REASON_MAX
defineRESET_REASON_POWER REBOOT_REASON_POWER
defineRESET_REASON_SLEEP REBOOT_REASON_SLEEP_GPIO
defineRESET_REASON_SLEEP_GPIO REBOOT_REASON_SLEEP_GPIO
defineRESET_REASON_SLEEP_RTC REBOOT_REASON_SLEEP_RTC
defineRESET_REASON_SLEEP_USB REBOOT_REASON_SLEEP_USB
defineRESET_REASON_SOFTWARE REBOOT_REASON_SOFTWARE
defineRESET_REASON_UNKNOWN REBOOT_REASON_UNKNOWN
defineRESET_REASON_WATCHDOG REBOOT_REASON_WATCHDOG
+

Public Types Documentation

+

enum lt_debug_mode_t

+
enum lt_debug_mode_t {
+    DEBUG_MODE_OFF = 0,
+    DEBUG_MODE_JTAG = 1,
+    DEBUG_MODE_SWD = 2
+};
+
+

enum lt_reboot_reason_t

+
enum lt_reboot_reason_t {
+    REBOOT_REASON_UNKNOWN = 1,
+    REBOOT_REASON_POWER = 2,
+    REBOOT_REASON_BROWNOUT = 3,
+    REBOOT_REASON_HARDWARE = 4,
+    REBOOT_REASON_SOFTWARE = 5,
+    REBOOT_REASON_WATCHDOG = 6,
+    REBOOT_REASON_CRASH = 7,
+    REBOOT_REASON_SLEEP_GPIO = 8,
+    REBOOT_REASON_SLEEP_RTC = 9,
+    REBOOT_REASON_SLEEP_USB = 10,
+    REBOOT_REASON_DEBUGGER = 11,
+    REBOOT_REASON_MAX = 12
+};
+
+ + +

Flash

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
boollt_flash_erase (uint32_t offset, size_t length)
Erase flash area. Flash can only be erased in blocks (usually 4 KiB).
boollt_flash_erase_block (uint32_t offset)
Erase a single block of flash (usually 4 KiB).
lt_flash_id_tlt_flash_get_id ()
Read flash chip ID and return a lt_flash_id_t struct.
uint32_tlt_flash_get_size ()
Get flash chip total size.
uint32_tlt_flash_read (uint32_t offset, uint8_t * data, size_t length)
Read data from the flash.
uint32_tlt_flash_write (uint32_t offset, const uint8_t * data, size_t length)
Write data to the flash.
+ + +

Memory

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
uint32_tlt_heap_get_free ()
Get free heap size.
uint32_tlt_heap_get_max_alloc ()
Get largest block of heap that can be allocated at once.
uint32_tlt_heap_get_min_free ()
Get lowest level of free heap memory.
uint32_tlt_heap_get_size ()
Get total heap size.
uint32_tlt_ram_get_size ()
Get total RAM size.
+ + +

OTA

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
voidlt_ota_begin (lt_ota_ctx_t * ctx, size_t size)
Initialize the update context to begin OTA process.
boollt_ota_can_rollback ()
Check if OTA rollback is possible (switching the stored index to another partition).
uint8_tlt_ota_dual_get_current ()
Get the currently running firmware's OTA index.
uint8_tlt_ota_dual_get_stored ()
Read the currently active OTA index, i.e. the one that will boot upon restart.
boollt_ota_end (lt_ota_ctx_t * ctx)
Finish the update process. If the update has been written completely, try to activate the target image. Free allocated internal structures, regardless of the activation result.
lt_ota_type_tlt_ota_get_type ()
Get OTA type of the device's chip.
uf2_ota_scheme_tlt_ota_get_uf2_scheme ()
Check which UF2 OTA scheme should be used for applying firmware updates.
boollt_ota_is_valid (uint8_t index)
Check if the specified OTA image is valid.
voidlt_ota_set_write_protect (uf2_ota_t * uf2)
Set family-specific, write-protected flash areas in the OTA update context. This shouldn't be called manually, as it's done by lt_ota_begin().
boollt_ota_switch (bool revert)
Try to switch OTA index to the other image. For single-OTA chips, only check if the upgrade image is valid.
size_tlt_ota_write (lt_ota_ctx_t * ctx, const uint8_t * data, size_t len)
Process a chunk of data.
boollt_ota_write_block (lt_ota_ctx_t * ctx, uf2_block_t * block)
Try to write the block. In case of UF2 errors, error code is set in the context. Note: use lt_ota_write() instead. This is for internal usage only.
+

Public Types Documentation

+

enum lt_ota_type_t

+
enum lt_ota_type_t {
+    OTA_TYPE_SINGLE = 0,
+    OTA_TYPE_DUAL = 1,
+    OTA_TYPE_FILE = 2
+};
+
+ + +

Utilities

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
voidhexdump (const uint8_t * buf, size_t len, uint32_t offset=0, uint8_t width=16)
Print data pointed to by buf in hexdump-like format (hex+ASCII).
char *lt_btox (const uint8_t * src, int len, char * dest)
Convert a byte array to hexadecimal string.
voidlt_rand_bytes (uint8_t * buf, size_t len)
Generate random bytes using rand().
uint8_t *lt_xtob (const char * src, int len, uint8_t * dest)
Convert a hexadecimal string to byte array.
+ + +

Watchdog

+ + + + + + + + + + + + + + + + + + + + + + + +
TypeName
voidlt_wdt_disable ()
Disable the hardware watchdog.
boollt_wdt_enable (uint32_t timeout)
Enable the hardware watchdog.
voidlt_wdt_feed ()
Feed/reset the hardware watchdog timer.
+ + +

Logger

+ + + + + + + + + + + + + + + + + + + + + + + +
TypeName
voidlt_log (const uint8_t level, const char * format, ...)
voidlt_log_disable ()
Disable LT logger. Enable it back using lt_log_set_port(LT_UART_DEFAULT_LOGGER).
void voidlt_log_set_port (uint8_t port)
Change log output port.
+ + +

POSIX compatibility API

+

A small subset of POSIX functions, commonly present in other Arduino cores, is provided for compatibility.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
intstrcasecmp (const char * s1, const char * s2)
char *strdup (const char *)
intstrncasecmp (const char * s1, const char * s2, size_t n)
char *strptime (const char * buf, const char * fmt, struct tm * tm)
+ + +

C++ API

+

This API is available using:

+
    +
  • #include <Arduino.h>
  • +
+

LibreTiny

+ + +

Since v1.0.0, this class only consists of inline functions, which wrap the LibreTiny C API (lt_api.h). Refer to the docs of the C API for more information.

+

The class is accessible using the LT global object.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
const char *getBoard ()
Get board code.
const char *getChipCoreType ()
Get CPU core type name as string.
uint8_tgetChipCores ()
Get CPU core count.
ChipFamilygetChipFamily ()
Get CPU family ID (as lt_cpu_family_t enum member).
const char *getChipFamilyName ()
Get CPU family name as string.
uint32_tgetChipId ()
Get CPU ID based on the last three octets of MAC address. Note: the number is 24-bit (with the MSB being zero). The 3rd-to-last octet is least-significant, the last octet is most-significant.
const char *getChipModel ()
Get CPU model name as string (uppercase).
ChipTypegetChipType ()
Get CPU model ID (as lt_cpu_model_t enum member).
uint32_tgetCpuFreq ()
Get CPU frequency in Hz.
uint32_tgetCpuFreqMHz ()
Get CPU frequency in MHz.
uint32_tgetCycleCount ()
Get CPU cycle count.
const char *getDeviceName ()
Get device friendly name in format "LT-<chip model>-<MAC ID>". Can be used as hostname.
FlashIdgetFlashChipId ()
Read flash chip ID and return a lt_flash_id_t struct.
uint32_tgetFlashChipSize ()
Get flash chip total size.
uint32_tgetFreeHeap ()
Get free heap size.
uint32_tgetHeapSize ()
Get total heap size.
uint32_tgetMaxAllocHeap ()
Get largest block of heap that can be allocated at once.
uint32_tgetMaxFreeBlockSize ()
Get largest block of heap that can be allocated at once.
uint32_tgetMinFreeHeap ()
Get lowest level of free heap memory.
uint32_tgetRamSize ()
Get total RAM size.
ResetReasongetResetReason ()
Get the reason of last chip reboot.
const char *getResetReasonName (ResetReason reason=lt_get_reboot_reason())
Get a textual representation of a reboot reason.
const char *getVersion ()
Reset reason enumeration.
voidgpioRecover ()
Reconfigure GPIO pins used for debugging (SWD/JTAG), so that they can be used as normal I/O.
voidrestart ()
Reboot the CPU.
voidrestartDownloadMode ()
Reboot the CPU and stay in download mode (if possible).
+ + +

LibreTinyOTA

+ + +

This class only consists of inline functions, which wrap the LibreTiny C API (lt_api.h). Refer to the docs of the C API for more information.

+

The class is accessible using the OTA global object.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
boolcanRollback ()
Check if OTA rollback is possible (switching the stored index to another partition).
uint8_tgetCurrentIndex ()
Get the currently running firmware's OTA index.
uint8_tgetStoredIndex ()
Read the currently active OTA index, i.e. the one that will boot upon restart.
lt_ota_type_tgetType ()
Get OTA type of the device's chip.
uf2_ota_scheme_tgetUF2Scheme ()
Check which UF2 OTA scheme should be used for applying firmware updates.
boolisValid (uint8_t index)
Check if the specified OTA image is valid.
boolswitchImage (bool revert=false)
Try to switch OTA index to the other image. For single-OTA chips, only check if the upgrade image is valid.
+ + +

LibreTinyWDT

+ + +

This class only consists of inline functions, which wrap the LibreTiny C API (lt_api.h). Refer to the docs of the C API for more information.

+

The class is accessible using the WDT global object.

+ + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
voiddisable ()
Disable the hardware watchdog.
boolenable (uint32_t timeout=10000)
Enable the hardware watchdog.
voidfeed ()
Feed/reset the hardware watchdog timer.
+ + +

ESP (compatibility class)

+ + +

This class only consists of inline functions, which wrap the LibreTiny C API (lt_api.h). Refer to the docs of the C API for more information.

+

The class is accessible using the ESP global object.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
boolflashEraseSector (uint32_t sector)
Erase a single block of flash (usually 4 KiB).
boolflashRead (uint32_t address, uint8_t * data, size_t size)
Read data from the flash.
boolflashWrite (uint32_t address, const uint8_t * data, size_t size)
Write data to the flash.
uint8_tgetBootMode ()
uint8_tgetBootVersion ()
uint32_tgetChipId ()
Get CPU ID based on the last three octets of MAC address. Note: the number is 24-bit (with the MSB being zero). The 3rd-to-last octet is least-significant, the last octet is most-significant.
StringgetCoreVersion ()
uint8_tgetCpuFreqMHz ()
Get CPU frequency in MHz.
uint32_tgetCycleCount ()
Get CPU cycle count.
uint32_tgetFlashChipId ()
Flash chip ID structure.
uint32_tgetFlashChipMode ()
uint32_tgetFlashChipRealSize ()
Get flash chip total size.
uint32_tgetFlashChipSize ()
Get flash chip total size.
uint32_tgetFlashChipSizeByChipId ()
Get flash chip total size.
uint8_tgetFlashChipVendorId ()
Flash chip ID structure.
uint32_tgetFreeHeap ()
Get free heap size.
StringgetFullVersion ()
uint16_tgetMaxFreeBlockSize ()
Get largest block of heap that can be allocated at once.
StringgetResetInfo ()
Get a textual representation of a reboot reason.
StringgetResetReason ()
Get a textual representation of a reboot reason.
const char *getSdkVersion ()
uint16_tgetVcc ()
uint8_t *random (uint8_t * resultArray, const size_t outputSizeBytes)
Generate random bytes using rand().
uint32_trandom ()
Generate random bytes using rand().
voidrebootIntoUartDownloadMode ()
Reboot the CPU and stay in download mode (if possible).
voidreset ()
Reboot the CPU.
voidrestart ()
Reboot the CPU.
voidwdtDisable ()
Disable the hardware watchdog.
voidwdtEnable (uint32_t timeout_ms=0)
Enable the hardware watchdog.
voidwdtFeed ()
Feed/reset the hardware watchdog timer.
+ + +

Arduino custom API

+

These functions extend the standard Wiring (Arduino) library, to provide additional features.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
intanalogRead (pin_size_t pinNumber)
Read voltage from ADC and return a value between 0 and the current reading resolution.
uint16_tanalogReadMaxVoltage (pin_size_t pinNumber)
Get max reading voltage for the specified pin (millivolts).
voidanalogReadResolution (int res)
Set resolution of values (in bits) returned by analogRead(). Defaults to 10 bit (0-1023).
uint16_tanalogReadVoltage (pin_size_t pinNumber)
Read voltage from analog input (in millivolts).
voidanalogWriteFrequency (int hz)
Set PWM output frequency (in Hz). Defaults to 50 Hz (20,000 uS).
voidanalogWritePeriod (int us)
Set PWM output frequency (cycle period) in microseconds. Defaults to 20,000 uS (50 Hz).
voidanalogWriteResolution (int res)
Set resolution of values (in bits) expected by analogWrite(). Defaults to 8 bit (0-255).
voidmainTask (const void * arg)
Main setup() and loop() task. Not to be called directly.
PinInfo *pinByGpio (uint32_t gpio)
Find PinInfo struct by GPIO number. Returns NULL if not found.
PinInfo *pinByIndex (uint32_t index)
Get PinInfo struct for the specified index. Returns NULL if pin index is invalid.
boolpinEnabled (PinInfo * pin, uint32_t mask)
Check if pin has all features represented by 'mask' enabled.
uint32_tpinIndex (PinInfo * pin)
Get index of PinInfo in the global pin info table.
PinInfo *pinInfo (pin_size_t pinNumber)
Get PinInfo struct for the specified number. Returns NULL if pin number is invalid.
voidpinModeNone (pin_size_t pinNumber)
Deinitialize the pin, by removing all enabled modes.
voidpinModeRemove (pin_size_t pinNumber, uint32_t mask)
Disable modes specified by 'mask'.
voidpinRemoveMode (PinInfo * pin, uint32_t mask)
boolpinSupported (PinInfo * pin, uint32_t mask)
Check if pin supports all features represented by 'mask'.
voidrunPeriodicTasks ()
Run periodic tasks, like printing free heap or checking millis() overflow.
boolstartMainTask (void)
Run mainTask & start OS kernel (family-defined). Return false if an error occured; else do not return and and keep the OS kernel running.
+ + +

Arduino compatibility API

+

These functions and macros provide compatibility between LT and other Arduino cores, such as ESP32.

+ + + + + + + + + + + + + + + +
TypeName
StringipToString (const IPAddress & ip)
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
defineCONFIG_LWIP_MAX_ACTIVE_TCP 16
defineESP_FAIL -1
defineESP_OK 0
defineFPSTR (pstr_pointer) (reinterpret_cast<const __FlashStringHelper *>(pstr_pointer))
defineOUTPUT_OPEN_DRAIN OUTPUT_OPENDRAIN
definePGM_VOID_P const void *
defineattachInterruptArg attachInterruptParam
definedigitalPinToInterrupt (pin) (pin)
defineesp_err_t int
defineround (x) ((x) >= 0 ? (long)((x) + 0.5) : (long)((x)-0.5))
definevoidFuncPtrArg voidFuncPtrParam
definevsnprintf_P vsnprintf
definexTaskCreatePinnedToCore xTaskCreateUniversal
definexTaskCreateUniversal (pxTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask, xCoreID) xTaskCreate(pxTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask)
+ + +

Chip & family types

+ + +

enum lt_cpu_family_t

+
enum lt_cpu_family_t {
+    F_RTL8710A = 0x9FFFD543,
+    F_RTL8710B = 0x22E0D6FC,
+    F_RTL8720C = 0xE08F7564,
+    F_RTL8720D = 0x3379CFE2,
+    F_BK7231Q = 0xAFE81D49,
+    F_BK7231T = 0x675A40B0,
+    F_BK7231N = 0x7B3EF230,
+    F_BK7251 = 0x6A82CC42,
+    F_BL60X = 0xDE1270B7
+};
+
+

enum lt_cpu_model_t

+
enum lt_cpu_model_t {
+    RTL8710BL = CPU_MODEL(F_RTL8710B, 0xE0),
+    RTL8710BN = CPU_MODEL(F_RTL8710B, 0xFF),
+    RTL8710BU = CPU_MODEL(F_RTL8710B, 0xFE),
+    RTL8710BX = CPU_MODEL(F_RTL8710B, 0xF6),
+    RTL8710L0 = CPU_MODEL(F_RTL8710B, 0xFB),
+    RTL8711BN = CPU_MODEL(F_RTL8710B, 0xFD),
+    RTL8711BU = CPU_MODEL(F_RTL8710B, 0xFC),
+    MX1290 = RTL8710BN,
+    MX1290V2 = RTL8710BX,
+    W302 = RTL8710BN,
+    RTL8720CM = CPU_MODEL(F_RTL8720C, 0xEC),
+    RTL8720CF = CPU_MODEL(F_RTL8720C, 0xED),
+    RTL8720CX = RTL8720CM,
+    BK7231Q = CPU_MODEL(F_BK7231Q, 0x31),
+    BK7231T = CPU_MODEL(F_BK7231T, 0x1A),
+    BK7231N = CPU_MODEL(F_BK7231N, 0x1C),
+    BK7252 = CPU_MODEL(F_BK7251, 0x00),
+    BL2028N = BK7231N,
+    BK7231S = BK7231T,
+    BK7231U = BK7231T
+};
+
+ + + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/dev/migration_v1.0.0/index.html b/docs/dev/migration_v1.0.0/index.html new file mode 100644 index 000000000..3440e0f6a --- /dev/null +++ b/docs/dev/migration_v1.0.0/index.html @@ -0,0 +1,2420 @@ + + + + + + + + + + + + + + + + + + + + + + + + ⚠️ Migration guide - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Migration to v1.0.0

+

1.0.0 is the first major release of LT. Compared to previous versions, few things have changed which can impact developers using LT in PlatformIO (but shouldn't affect ESPHome users at all).

+

GPIO numbering

+

Pin numbers passed to pinMode()/digitalWrite()/etc. are now the raw GPIO numbers of the chip. Previously, one had to use D# numbering in these functions, so you have to migrate your code to use GPIO numbers instead.

+

To make the migration easier, you can simply change:

+
digitalWrite(1, LOW);
+
+

to:

+
digitalWrite(PIN_D1, LOW);
+// or
+digitalWrite(D1, LOW);
+
+

For more information, refer to GPIO instructions.

+

Environment stability

+

All public headers exported by LT are now stable between all chip families - this means that they're not including any code from the vendor SDK.

+

This change was made to prevent the SDK from introducing its own functions and macros, which often replace stdlib functions, or cause other compilation issues.

+

If your code is using vendor SDK functions, you'll have to import the appropriate headers yourself.

+

OTA (.uf2 packages)

+

The format of OTA packages has changed slightly, to reflect the OTA scheme naming change (described below). There's also a distinction between the flasher (PC flasher) and device (on-device OTA code) in the package.

+

New OTA packages are backwards-compatible (i.e. can be installed on devices running LT v0.x.x), but v1.0.0 will not accept older packages - it's not possible to rollback a device from v1.0.0 to v0.x.x with an old .uf2 file.

+

OTA scheme naming change

+

Previously, each chip family had a "has dual OTA" property, which was very confusing (even to me, the author of the code). A new scheme has been introduced:

+
    +
  • single OTA - devices with a separate "download" partition, which is used by the bootloader to flash the main application
  • +
  • dual OTA - devices with two separate application partitions, which can be updated directly by the application
  • +
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/flashing/SUMMARY/index.html b/docs/flashing/SUMMARY/index.html new file mode 100644 index 000000000..7ba5f95fd --- /dev/null +++ b/docs/flashing/SUMMARY/index.html @@ -0,0 +1,2294 @@ + + + + + + + + + + + + + + + + + + Flashing/dumping methods & guides - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + + + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/flashing/dumping/index.html b/docs/flashing/dumping/index.html new file mode 100644 index 000000000..f32e8cb6c --- /dev/null +++ b/docs/flashing/dumping/index.html @@ -0,0 +1,2309 @@ + + + + + + + + + + + + + + + + + + + + + + + + Dumping stock firmware - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dumping stock firmware

+

It is a good idea to dump the stock firmware (full flash contents) of your device before flashing custom firmware.

+

Currently, the easiest way to dump firmware is to use ltchiptool. Download/install the tool, and follow the guide.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/flashing/esphome/index.html b/docs/flashing/esphome/index.html new file mode 100644 index 000000000..7d7875cd0 --- /dev/null +++ b/docs/flashing/esphome/index.html @@ -0,0 +1,2508 @@ + + + + + + + + + + + + + + + + + + + + + + + + Flashing ESPHome - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

Flashing ESPHome

+
+

Tip

+

See the Cloudcutter video guide for a complete tutorial on flashing with Cloudcutter and installing LibreTiny-ESPHome. Includes Home Assistant Add-On setup.

+
+

ESPHome can be flashed in few different ways, depending on your needs.

+
+

Abstract

+

All binary files generated by ESPHome will be in .esphome/build/<yourdevice>/.pioenvs/<yourdevice>/. The methods described below may require you to get a file from that directory.

+

If you're using the GUI (ESPHome Dashboard) this path will be in your configs/ directory.

+

This path will be referred to as build directory.

+
+

Built-in flasher

+
+
+
+

The flasher program built-in LibreTiny is also available for ESPHome.

+
    +
  • use python -m esphome run yourdevice.yml to recompile AND upload the firmware
  • +
  • use python -m esphome upload yourdevice.yml to upload without recompiling
  • +
+

+ +The device needs to be connected to your PC with a UART-TTL adapter. Refer to chip connection guides to learn how to connect your device.

+ +

If your device is already running ESPHome, refer to the OTA guide below.

+
+
+

The built-in flasher is not yet available in the GUI. Here are your options:

+
    +
  • OTA, using the downloaded UF2 file (if you're already running ESPHome)
  • +
  • wired (also UF2), using ltchiptool
  • +
  • wirelessly, using tuya-cloudcutter
  • +
+

Read below for more details on each of these methods.

+
+
+
+

Over-the-Air (OTA)

+

This method requires having ESPHome already installed on your device.

+
    +
  • If you've added the Web Server component, navigate to the device's IP address (or .local name) in your web browser. Grab firmware.uf2 from the build directory and drop it on the "OTA Update" field.
  • +
  • You can also use ESPHome CLI to flash via OTA. Add a --device argument to the command, as such: python -m esphome upload yourdevice.yml --device yourdevice.local
  • +
+ +

Using ltchiptool (wired, via UART)

+

You can use the ltchiptool GUI or CLI to manually flash the firmware. Grab the firmware.uf2 file from the build directory. Then, follow the ltchiptool usage guide to flash it to the device.

+
+

Tip

+

The UF2 file may have a different name, depending on the project you're building. Usually it's best to grab the latest (sorted by date) file with UF2 extension from the build directory.

+
+ + + +

Converting devices with tuya-cloudcutter

+
+

Note

+

This currently applies to BK7231T and BK7231N only. tuya-cloudcutter can't be used for other chips.

+
+

Grab the image_bk7231x_app.ota.ug.bin file from the build directory - take care to choose the correct file. It must have "OTA" and "UG" in its name.

+

Next, refer to Using tuya-cloudcutter guide.

+ + + +

Migrating from OpenBeken (OTA)

+

OpenBeken is a custom, Tasmota-like firmware for non-ESP chips. Currently, this part of the guide applies to BK7231 only, as that's the only chip supported both by LT and OBK.

+

OBK is compatible with standard Beken OTA packages, but the web panel does a filename check to prevent chip type mismatch. Grab the image_bk7231t_app.ota.rbl file from build directory (note: without "UG" in the name!), rename it to something like OpenBK7231T_esphome.rbl (change T to N depending on the chip type), and drop it on the OTA panel.

+ + +

Migrating from ESPHome to OpenBeken

+

ESPHome is only compatible with UF2 OTA packages, which OpenBeken doesn't provide. You need to create an UF2 package manually, using ltchiptool (see ltchiptool#7 for more info). Grab an .RBL file from OpenBeken Releases page, and run this command:

+
ltchiptool uf2 write -b generic-bk7231n-qfn32-tuya -o OpenBeken.uf2 "OpenBK7231N_1.17.205.rbl=device:download"
+
+

This will create OpenBeken.uf2 file that you can upload on the ESPHome web server dashboard page. Pay attention to the chip selection - incorrectly built UF2 file may brick your device! Make sure to download the right .RBL file of OpenBeken, and to choose the correct board (-b) parameter.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/flashing/platformio/index.html b/docs/flashing/platformio/index.html new file mode 100644 index 000000000..7b60b3c82 --- /dev/null +++ b/docs/flashing/platformio/index.html @@ -0,0 +1,2392 @@ + + + + + + + + + + + + + + + + + + + + + + + + Flashing PlatformIO projects - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Flashing PlatformIO projects

+

PlatformIO projects developed with LibreTiny can be flashed just like any other PIO project.

+
+

Abstract

+

All binary files generated by PlatformIO will be in .pio/build/<my_board>/. The methods described below may require you to get a file from that directory.

+

This path will be referred to as build directory.

+
+

Built-in flasher

+

LibreTiny has a built-in firmware uploader, based on ltchiptool. Pressing Upload in PlatformIO IDE does all the work for you.

+

If you have more than one COM port, configure your PIO project first:

+
platformio.ini
[env:my_board]
+monitor_port = COM96
+upload_port = COM96
+
+ +

The device needs to be connected to your PC with a UART-TTL adapter. Refer to chip connection guides to learn how to connect your device.

+ + + +

Using ltchiptool (wired, via UART)

+

You can use the ltchiptool GUI or CLI to manually flash the firmware. Grab the firmware.uf2 file from the build directory. Then, follow the ltchiptool usage guide to flash it to the device.

+
+

Tip

+

The UF2 file may have a different name, depending on the project you're building. Usually it's best to grab the latest (sorted by date) file with UF2 extension from the build directory.

+
+ + + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/flashing/tools/adr/index.html b/docs/flashing/tools/adr/index.html new file mode 100644 index 000000000..45e2bb0b1 --- /dev/null +++ b/docs/flashing/tools/adr/index.html @@ -0,0 +1,2394 @@ + + + + + + + + + + + + + + + + + + + + + + + + Auto-download-reboot - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Auto-download-reboot

+

(CEN-less uploading)

+

This feature allows to upload code using UART, without needing to ground the CEN wire or power-cycle the device.

+

It is enabled by default (using the LT_AUTO_DOWNLOAD_REBOOT option). It works by listening to incoming UART data, and checking if it matches a command that the flashing program would send. If it does, a chip reboot is performed and the uploading process starts.

+
+

Note

+

ADR will only work if there's already a recent build of LibreTiny flashed to the device (and if the device doesn't bootloop or freeze immediately).

+
+

Beken 72xx

+

The code listens on UART1 for a link-check command (01 E0 FC 01 00). The baudrate configured on the serial port has to be 115200 - it is configured automatically upon booting, but ADR won't work anymore if you change the baudrate manually. Because BK72xx doesn't have a dedicated "persistent" download mode, a normal reboot is performed and the chip waits a few hundred milliseconds for another link-check command.

+

Realtek AmebaZ

+

This only works when using ltchiptool for flashing. Upon starting UART communication, the tool sends 55 AA 22 E0 D6 FC (0x55AA followed by the realtek-ambz family ID). After detecting that pattern, the chip proceeds to reboot into UART download mode (using lt_reboot_download_mode())

+

Realtek AmebaZ2

+

The code listens on UART2 for a ping\n command, that is sent by ltchiptool (and possibly by the vendor flasher, too). The device is then rebooted to download mode.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/flashing/tools/cloudcutter/index.html b/docs/flashing/tools/cloudcutter/index.html new file mode 100644 index 000000000..0ad8f8441 --- /dev/null +++ b/docs/flashing/tools/cloudcutter/index.html @@ -0,0 +1,2454 @@ + + + + + + + + + + + + + + + + + + + + + + + + Converting with tuya-cloudcutter - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Converting with tuya-cloudcutter

+
+

Tip

+

See the Cloudcutter video guide for a complete tutorial on flashing with Cloudcutter and installing LibreTiny-ESPHome. Includes Home Assistant Add-On setup.

+
+
+

Note

+

This currently applies to BK7231T and BK7231N only. tuya-cloudcutter can't be used for other chips.

+
+

tuya-cloudcutter is a tool that disconnects IoT devices from the Tuya cloud, while also allowing remote firmware flashing. This means you can flash ESPHome without even disassembling it.

+
+

Warning

+

This guide might be outdated. For an up-to-date guide, always refer to tuya-cloudcutter/INSTRUCTIONS.md.

+
+

If your device doesn't have a profile yet, it will probably not work. You can contribute by taking a device dump and posting it on cloudcutter's issues page.

+

Instructions

+

Preparation

+
    +
  1. Get a laptop (or a PC with Wi-Fi) with Linux and Docker installed. This was tested on Ubuntu 20.04, but you should be able to use another Debian-based distribution with NetworkManager.
      +
    • To install Docker, run sudo apt-get install docker.io. When it completes, run sudo adduser <your username> docker and reboot the machine.
    • +
    • This was also successfully performed on a VirtualBox VM, with a USB Wi-Fi adapter redirected to the VM.
    • +
    +
  2. +
  3. Install git, if you haven't already (sudo apt-get install git).
  4. +
  5. git clone https://github.com/tuya-cloudcutter/tuya-cloudcutter
  6. +
+

Firmware building

+
    +
  1. Compile ESPHome, or your custom firmware based on LibreTiny.
  2. +
  3. Get the firmware binary, named bk7231x_app.ota.ug.bin from the build directory (.pio/build/<board>/ or .esphome/build/<board>/.pioenvs/<board>/).
  4. +
  5. Put it in the custom-firmware directory of tuya-cloudcutter.
  6. +
+

Pairing and flashing

+
    +
  1. Run ./tuya-cloudcutter.sh from the cloudcutter directory.
  2. +
  3. Answer questions about the desired firmware file, the device vendor and profile.
  4. +
  5. Put the device to AP mode: (**)
      +
    • Bulbs (devices without buttons) usually need to be power-cycled a few times, until they start blinking slowly.
    • +
    • Switches, plugs, relays (devices with buttons) usually enable AP after pressing the button for a few seconds.
    • +
    • If the device (bulb or switch LED) is blinking quickly (~2 times per second), do the procedure again.
    • +
    +
  6. +
  7. Cloudcutter will scan for APs, connect to the device and send a payload to it.
  8. +
  9. The device will most likely hang (not respond). Reboot it again to AP mode (just like in step 9).
  10. +
  11. Cloudcutter will scan for APs again, configure the device to talk to it, then begin the OTA update.
  12. +
  13. After around 30 seconds, the device will boot new firmware 👏
  14. +
+

** Use a smartphone with the Wi-Fi screen open and scanning, so that you can see if AP mode got enabled.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/flashing/tools/ltchiptool/index.html b/docs/flashing/tools/ltchiptool/index.html new file mode 100644 index 000000000..d76477753 --- /dev/null +++ b/docs/flashing/tools/ltchiptool/index.html @@ -0,0 +1,2648 @@ + + + + + + + + + + + + + + + + + + + + + + + + ltchiptool GUI manual - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

ltchiptool

+

ltchiptool is a universal, easy-to-use GUI flashing/dumping tool for BK7231, RTL8710B and RTL8720C. It also contains some CLI utilities for binary firmware manipulation.

+
+

Code style: black +PyPI

+

GitHub release (latest by date including pre-releases)

+

+
+

Installation

+ +

CLI program

+

Install the package from PyPI, using pip install ltchiptool. Run the CLI using python -m ltchiptool or just ltchiptool.

+

GUI application

+
+Windows 7 and newer +

Download the latest release .EXE from the GitHub Releases page. Open the file, and you're ready to go!

+
+
+Windows (manual installation) +

Install the package from PyPI (including GUI extras), using pip install ltchiptool[gui]. Note that Python 3.10 or newer is required for the GUI. I recommend Python 3.10 since it has prebuilt wheels of wxPython, which doesn't require C++ build dependencies.

+
+
+Linux (Ubuntu) +

Install the package from PyPI, using pip install ltchiptool. Python 3.10 or newer is required.

+

Make sure you have wxPython installed. Install it from PyPI (if you have the necessary build dependencies), or refer to the wxPython Downloads page to install prebuilt wheels (recommended).

+

Next, open a terminal and run ltchiptool gui (or python -m ltchiptool gui).

+
+
+MacOS (untested) +

Install the package from PyPI, using pip install ltchiptool. Python 3.10 or newer is required.

+

Install wxPython from PyPI as well. Version 4.2.0 (latest at the time of writing) has some wheels for MacOS, so that should work.

+
+

GUI Usage

+

The main window is somewhat similar to NodeMCU PyFlasher. Available modes of operation are described below.

+

Dumping firmware

+

It is a good idea to dump the stock firmware (full flash contents) of your device before flashing custom firmware.

+
    +
  1. Choose the Read flash option. If you've previously chosen an input or output file, it will generate a dump filename based on the current timestamp and chip type. Otherwise, click Browse and choose the output file.
  2. +
  3. You need to pick the "family" of your chip (the chip model). If you choose the wrong option, the process will fail, but the device won't be bricked.
  4. +
  5. Now, connect the chip to your PC, according to the chip connection guides. Select the COM port that your UART adapter is using.
  6. +
  7. By default, the tool will attempt to read the entire flash chip (usually 2 MiB). Unless you know what you're doing, the default values don't need to be changed.
  8. +
  9. Hit Start. The tool will try to connect to the chip on the selected UART port. The black log window will print any warnings/errors. The dumping process should begin shortly.
  10. +
+

Flashing firmware

+

If you want to flash custom firmware, or restore stock firmware from a previously dumped file, follow the steps below.

+
+

Info

+

LibreTiny generates multiple firmware files in the build directory. You usually want to flash the .uf2 file, but since ltchiptool can detect file types, you can choose a different firmware file and it'll tell you if that works.

+
+
    +
  1. Choose Write flash. Click Browse and select a valid firmware file. The file type and chip type will be auto-detected, along with correct flash offset and length. No need to worry about overwriting the bootloader anymore!
  2. +
  3. Connect the chip to your PC, according to the chip connection guides. Select the COM port that your UART adapter is using.
  4. +
  5. Hit Start. The tool will try to connect to the chip on the selected UART port. The black log window will print any warnings/errors. The flashing process should begin shortly.
  6. +
+
+

Info

+

It's best to leave Auto-detect advanced parameters checked. If you're an experienced user and want to flash custom areas of the flash, uncheck the box and specify the parameters manually.

+

If the file you're selecting is Unrecognized or Not flashable, it's most likely not a valid firmware file. Refer to usage guides of the custom firmware project of choice, to find which file is meant for flashing.

+
+

CLI Usage

+

Flashing/dumping

+

This is for users, who are more experienced with using a terminal. There are three main commands used for flashing:

+
    +
  • ltchiptool flash file <FILE> - detect file type based on its contents (i.e. chip from which a dump was acquired), similar to Linux file command
  • +
  • ltchiptool flash read <FAMILY> <FILE> - make a full flash dump of the connected device; specifying the family is required
  • +
  • ltchiptool flash write <FILE> - upload a file to the device; detects file type automatically (just like the file command above)
  • +
+

Supported device families can be checked using ltchiptool list families command. In the commands above, you can use any of the family names (name/code/short name/etc).

+

The upload UART port and baud rate should be detected automatically. To override it, use -d COMx or -d /dev/ttyUSBx. To change the target baud rate, use -b 460800. +Note that the baud rate is changed after linking. Linking is performed using chip-default baud rate.

+

It's not required to specify chip family for writing files - ltchiptool tries to recognize contents of the file, and chooses the best settings automatically. +If you want to flash unrecognized/raw binaries (or fine-tune the flashing parameters), specify -f <FAMILY> and -s <START OFFSET>.

+

CLI Reference

+
+

Note

+

If you're here to learn how to flash or dump firmware files, use the instructions above.

+

The content below serves as a short documentation page for ltchiptool and is mostly meant for advanced users.

+
+
$ ltchiptool --help
+Usage: ltchiptool [OPTIONS] COMMAND [ARGS]...
+
+  Tools for working with LT-supported IoT chips
+
+Options:
+  -v, --verbose         Output debugging messages (repeat to output more)
+  -T, --traceback       Print complete exception traceback
+  -t, --timed           Prepend log lines with timing info
+  -r, --raw-log         Output logging messages with no additional styling
+  -i, --indent INTEGER  Indent log messages using graph lines
+  -V, --version         Show the version and exit.
+  -h, --help            Show this message and exit.
+
+Commands:
+  dump      Capture or process device dumps
+  elf2bin   Generate firmware binaries from ELF file
+  flash     Flashing tool - reading/writing
+  link2bin  Link code to binary format
+  list      List boards, families, etc.
+  soc       Run SoC-specific tools
+  uf2       Work with UF2 files
+
+

UF2 Example

+
$ ltchiptool uf2 info ./arduinotest_22.08.01_wb2l_BK7231T_lt0.8.0.uf2
+Family: BK7231T / Beken 7231T
+Tags:
+ - BOARD: wb2l
+ - DEVICE_ID: d80e20c2
+ - LT_VERSION: 0.8.0
+ - FIRMWARE: arduinotest
+ - VERSION: 22.08.01
+ - OTA_VERSION: 01
+ - DEVICE: LibreTiny
+ - BUILD_DATE: 6d08e862
+ - LT_HAS_OTA1: 01
+ - LT_HAS_OTA2: 00
+ - LT_PART_1: app
+ - LT_PART_2:
+Data chunks: 1871
+Total binary size: 478788
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/getting-started/gpio/index.html b/docs/getting-started/gpio/index.html new file mode 100644 index 000000000..a2092e3b6 --- /dev/null +++ b/docs/getting-started/gpio/index.html @@ -0,0 +1,2404 @@ + + + + + + + + + + + + + + + + + + + + + + + + ➡️ Info on accessing GPIOs - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

GPIO usage instructions

+
+

Note

+

This has changed since v1.0.0. Refer to the migration guide for more info.

+
+

GPIO pins can be accessed in a few ways:

+
    +
  • using the raw GPIO number of the chip
  • +
  • using the "function macro" of the pin
  • +
  • using Arduino digital pin numbers (D#, deprecated)
  • +
+

This applies both to Arduino code and ESPHome YAML configs.

+

GPIO numbers - Arduino only

+

The simplest form of GPIO access is by using raw pin numbers of the CPU (just like on ESP8266/ESP32). For example, to access GPIO6, write digitalRead(6).

+

Function macros - Arduino & ESPHome

+

If you go to a board documentation page (like this one - CB2S) you'll see a pinout drawing, containing various labels in small blocks. There's also a table below to make the pinout a bit more clear.

+

You can use any of these labels to access a particular pin. For example, to access GPIO6, which is also the PWM0 pin on CB2S, one can use:

+
    +
  • digitalRead(PIN_P6) (Arduino) or pin: P6 (ESPHome)
  • +
  • digitalRead(PIN_PWM0) (Arduino) or pin: PWM0 (ESPHome)
  • +
+

Arduino D# numbers (deprecated)

+

This method of accessing pins is deprecated since v1.0.0, and will (probably) be removed in the future. It's kept for legacy compatibility.

+

To access the previously mentioned GPIO6, use digitalRead(D2) or digitalRead(PIN_D2) or pin: D2. Note that the D# pin numbers are not consistent between boards (for example, on WB3S, GPIO6 is already D4).

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/getting-started/index.html b/docs/getting-started/index.html new file mode 100644 index 000000000..685265a02 --- /dev/null +++ b/docs/getting-started/index.html @@ -0,0 +1,2402 @@ + + + + + + + + + + + + + + + + + + + + + + + + 😊 Getting started - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Getting started

+

Using LibreTiny is simple, just like every other PlatformIO development platform.

+
    +
  1. Install PlatformIO
  2. +
  3. pio pkg install --platform libretiny
  4. +
+
+

Tip

+

See the Cloudcutter video guide for a complete tutorial on flashing with Cloudcutter and installing LibreTiny-ESPHome. Includes Home Assistant Add-On setup.

+

More information on Cloudcutter can be found in the Tuya Cloudcutter GitHub repository.

+
+

Board selection

+
    +
  1. Navigate to the supported boards & CPUs list.
  2. +
  3. Find the board your device has (usually, the model number is written on the silkscreen).
    +If your board isn't available yet, use one of the "Generic" boards that matches the CPU you your board has.
  4. +
  5. Click on the board name. A new page opens with information about the selected board name.
  6. +
  7. Scroll down to the "Usage" section of the page, and copy the configuration section that is relevant to your use case.
  8. +
+

Run community projects

+

LibreTiny was developed with popular community projects in mind.

+

There is an official ESPHome port available and integrated into the ESPHome project. No extra downloads or code compilations are needed to use ESPHome with LibreTiny-supported platforms.

+

Develop your own project

+

Developing your own embedded software that runs on LibreTiny-supported platforms.

+

To get started with LibreTiny on your chosen platform, create a new project using your preferred method.

+

There's a few ways to create a new PlatformIO Project. For example:

+
    +
  • using the PlatformIO IDE graphical interface (PIO Home -> Open -> New Project)
  • +
  • by running the pio project init command in your desired project directory
    +See the PlatformIO Core (CLI) documentation for information on pio project init and other command line usage.
  • +
+

Next, read one of the flashing guides to upload and run your project!

+

Config options (platformio.ini)

+

LibreTiny has a few configuration options that allow you to change its behavior or features. These can be defined, specified or changed in the platformio.ini configuration file for your project.

+

Refer to the LibreTiny Configuration manual for details.

+

GPIO usage - important change

+
+

Important

+

As of LibreTiny release v1.0.0, references to GPIO pins using their D# numbers has been deprecated and should no longer be used in new projects.

+

If your program is using Arduino I/O functions, please refer to the migration guide on how to modify your code accordingly.

+
+

Examples

+ + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/inc/find-board/index.html b/docs/inc/find-board/index.html new file mode 100644 index 000000000..a7f156f17 --- /dev/null +++ b/docs/inc/find-board/index.html @@ -0,0 +1,2284 @@ + + + + + + + + + + + + + + + + + + + + Find board - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

You need to know which board your device uses. Head to Supported Boards to find it. A good number of popular boards have their dedicated support and documentation pages in LibreTiny. Otherwise, you have to use one of the Generic boards that matches the CPU model of your device.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/inc/flashing-note/index.html b/docs/inc/flashing-note/index.html new file mode 100644 index 000000000..15a173c4d --- /dev/null +++ b/docs/inc/flashing-note/index.html @@ -0,0 +1,2288 @@ + + + + + + + + + + + + + + + + + + + + Flashing note - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +
+

Read this!

+

This is probably the most important part of the docs - flashing firmware to the chip.

+

This is why you're here. Please read this section carefully, and only then start flashing firmware.

+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/inc/ota-cloudcutter/index.html b/docs/inc/ota-cloudcutter/index.html new file mode 100644 index 000000000..22e24f055 --- /dev/null +++ b/docs/inc/ota-cloudcutter/index.html @@ -0,0 +1,2312 @@ + + + + + + + + + + + + + + + + + + + + Ota cloudcutter - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Ota cloudcutter

+ +

Converting devices with tuya-cloudcutter

+
+

Note

+

This currently applies to BK7231T and BK7231N only. tuya-cloudcutter can't be used for other chips.

+
+

Grab the image_bk7231x_app.ota.ug.bin file from the build directory - take care to choose the correct file. It must have "OTA" and "UG" in its name.

+

Next, refer to Using tuya-cloudcutter guide.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/inc/ota-openbeken/index.html b/docs/inc/ota-openbeken/index.html new file mode 100644 index 000000000..4bbad4c7f --- /dev/null +++ b/docs/inc/ota-openbeken/index.html @@ -0,0 +1,2308 @@ + + + + + + + + + + + + + + + + + + + + Ota openbeken - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Ota openbeken

+ +

Migrating from OpenBeken (OTA)

+

OpenBeken is a custom, Tasmota-like firmware for non-ESP chips. Currently, this part of the guide applies to BK7231 only, as that's the only chip supported both by LT and OBK.

+

OBK is compatible with standard Beken OTA packages, but the web panel does a filename check to prevent chip type mismatch. Grab the image_bk7231t_app.ota.rbl file from build directory (note: without "UG" in the name!), rename it to something like OpenBK7231T_esphome.rbl (change T to N depending on the chip type), and drop it on the OTA panel.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/inc/uart-adr/index.html b/docs/inc/uart-adr/index.html new file mode 100644 index 000000000..1af64dce9 --- /dev/null +++ b/docs/inc/uart-adr/index.html @@ -0,0 +1,2284 @@ + + + + + + + + + + + + + + + + + + + + Uart adr - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

If you have a recent version of LibreTiny already installed on the chip, you don't need to perform any steps to enter download mode. Instead, Auto-download-reboot will reboot the chip automatically, as soon as it notices the flasher program. This is enabled by default, so you don't have to configure anything.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/inc/uart-cen/index.html b/docs/inc/uart-cen/index.html new file mode 100644 index 000000000..50c6be883 --- /dev/null +++ b/docs/inc/uart-cen/index.html @@ -0,0 +1,2288 @@ + + + + + + + + + + + + + + + + + + + + Uart cen - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +
+

Note

+

"CEN" pin is the RESET pin - connecting it to GND will keep the chip in "reset" state. Disconnecting it will allow the chip to start back up.

+

If you're having issues with using CEN pin (or if it's not accessible on your device) you can toggle the 3.3V power instead. Removing power will keep it in "reset", and applying it back will start it again.

+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/inc/uart-info/index.html b/docs/inc/uart-info/index.html new file mode 100644 index 000000000..78d565754 --- /dev/null +++ b/docs/inc/uart-info/index.html @@ -0,0 +1,2284 @@ + + + + + + + + + + + + + + + + + + + + Uart info - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

The device needs to be connected to your PC with a UART-TTL adapter. Refer to chip connection guides to learn how to connect your device.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/inc/uart-ltchiptool/index.html b/docs/inc/uart-ltchiptool/index.html new file mode 100644 index 000000000..2bd59b3f2 --- /dev/null +++ b/docs/inc/uart-ltchiptool/index.html @@ -0,0 +1,2311 @@ + + + + + + + + + + + + + + + + + + + + Uart ltchiptool - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Uart ltchiptool

+ +

Using ltchiptool (wired, via UART)

+

You can use the ltchiptool GUI or CLI to manually flash the firmware. Grab the firmware.uf2 file from the build directory. Then, follow the ltchiptool usage guide to flash it to the device.

+
+

Tip

+

The UF2 file may have a different name, depending on the project you're building. Usually it's best to grab the latest (sorted by date) file with UF2 extension from the build directory.

+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/inc/uart-power/index.html b/docs/inc/uart-power/index.html new file mode 100644 index 000000000..603cbee1c --- /dev/null +++ b/docs/inc/uart-power/index.html @@ -0,0 +1,2288 @@ + + + + + + + + + + + + + + + + + + + + Uart power - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +
+

Important

+

Using a good, stable 3.3V power supply is crucial. Most flashing issues are caused by either voltage drops during intensive flash operations, or bad/loose wires. The UART adapter's 3.3V power regulator is usually not enough.

+

Instead, a regulated bench power supply, or a linear 1117-type regulator is recommended.

+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 000000000..3a9fca7ee --- /dev/null +++ b/docs/index.html @@ -0,0 +1,2294 @@ + + + + + + + + + + + + + + + + + + + + Documentation - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Documentation

+

This documentation is best suited for rendering with MkDocs. Some elements may not display correctly in the GitHub markdown reader.

+

Please visit https://docs.libretiny.eu/ for the full experience.

+

If you still want to read the docs on GitHub, visit SUMMARY.md.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/platform/SUMMARY/index.html b/docs/platform/SUMMARY/index.html new file mode 100644 index 000000000..8e8fc1444 --- /dev/null +++ b/docs/platform/SUMMARY/index.html @@ -0,0 +1,2290 @@ + + + + + + + + + + + + + + + + + + Flashing guides - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/platform/beken-72xx/index.html b/docs/platform/beken-72xx/index.html new file mode 100644 index 000000000..95b70a8ec --- /dev/null +++ b/docs/platform/beken-72xx/index.html @@ -0,0 +1,2687 @@ + + + + + + + + + + + + + + + + + + + + + + + + Beken BK72xx - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Beken 72xx

+

Introduction

+
+

Also read

+ +
+

Beken BK7231 is a family of Wi-Fi and BLE microcontrollers, of which most popular are BK7231N and BK7231T.

+

Features:

+
    +
  • ARM968E-S (ARMv5TE) CPU (120 MHz)
  • +
  • 256 KiB SRAM
  • +
  • built-in 2 MiB SPI flash with XiP
  • +
  • 802.11b/g/n Wi-Fi
  • +
+

Resources:

+ +

Finding your board

+ +

You need to know which board your device uses. Head to Supported Boards to find it. A good number of popular boards have their dedicated support and documentation pages in LibreTiny. Otherwise, you have to use one of the Generic boards that matches the CPU model of your device.

+ + +
+

Flashing

+ +
+

Read this!

+

This is probably the most important part of the docs - flashing firmware to the chip.

+

This is why you're here. Please read this section carefully, and only then start flashing firmware.

+
+ + +

BK7231 has two UART ports - UART2 (sometimes called LOG_UART) and UART1. The UART1 port is used for flashing (and external components, such as TuyaMCU) and has no text output. The UART2 port is used for log viewing only.

+

You need to find which pins correspond to UART1 TX and RX. If your board is supported, you'll find the pinout on its documentation page. Otherwise (and for generic boards), you'll have to find the pinout online.

+

For best experience, you should have two USB<->UART adapters plugged in:

+
    +
  • One for flashing, preferably a real FT232RL or a good alternative. This connects to UART1 of the chip.
  • +
  • One for log output - BK72xx outputs messages on a separate port. You can have a terminal session continuously open on this adapter. This connects to UART2 of the chip - but it's not necessary for flashing.
  • +
+

Wiring

+

Connect UART1 of the BK7231 to the USB-TTL adapter:

+ + + + + + + + + + + + + + + + + + + + + +
PCBK7231
RXTX1 (GPIO11 / P11)
TXRX1 (GPIO10 / P10)
GNDGND
+ +
+

Important

+

Using a good, stable 3.3V power supply is crucial. Most flashing issues are caused by either voltage drops during intensive flash operations, or bad/loose wires. The UART adapter's 3.3V power regulator is usually not enough.

+

Instead, a regulated bench power supply, or a linear 1117-type regulator is recommended.

+
+ + + +
+

Note

+

"CEN" pin is the RESET pin - connecting it to GND will keep the chip in "reset" state. Disconnecting it will allow the chip to start back up.

+

If you're having issues with using CEN pin (or if it's not accessible on your device) you can toggle the 3.3V power instead. Removing power will keep it in "reset", and applying it back will start it again.

+
+ + +

The download mode is entered when the chip communicates with the flasher program. Hence, the first step is running the flasher program (described below). While the program is trying to establish communication, the chip has to be rebooted. In order to do that, you need to bridge CEN pin to GND with a wire.

+

Keep in mind that BK7231T (not N) will exit the download mode when it can't communicate with the flasher (or when the flasher finishes its work). It's not possible to forcefully enter download mode without it.

+

After linking with the chip, the flasher program will begin writing (or reading) the firmware automatically. If that doesn't happen, try resetting the chip again until it works.

+

If you're getting a No response received (or similar) error, this means that:

+
    +
  • the power supply is too weak (read above)
  • +
  • you're resetting the chip too quickly, i.e. you resetted it after the program started communicating with it
  • +
+

Flashing

+

The recommended tool to flash (or dump firmware) is ltchiptool.

+

Read Using ltchiptool to learn the flashing procedure

+
+

Tip

+

BK7231N can't be software-bricked, because it has a ROM that contains the download mode. BK7231T doesn't contain it, so be careful with this one.

+

ltchiptool's Beken flashing program is based on bk7231tools. Refer to the guide for information how to use it, but keep in mind that using the ltchiptool GUI is probably just easier.

+
+
+

Auto-download-reboot

+ +

If you have a recent version of LibreTiny already installed on the chip, you don't need to perform any steps to enter download mode. Instead, Auto-download-reboot will reboot the chip automatically, as soon as it notices the flasher program. This is enabled by default, so you don't have to configure anything.

+ + +

Single UART adapter usage

+

If you only have a single adapter, or just want to use the UART1 (upload) port only, you can change the logging port of LibreTiny firmware.

+

Refer to Options & config (Serial output section). Set LT_UART_DEFAULT_PORT to 1, which will use UART1 for all output.

+

Firmware output files

+

These files are present in the build directory after successful compilation:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FileDescription
firmware.uf2UF2 package for UART and OTA upload
image_bk7231t_app.ota.rblBeken OTA package (e.g. OpenBeken)
image_bk7231t_app.ota.ug.binTuya OTA package (incl. Cloudcutter)
image_bk7231t_app.0x011000.rblApp partition - flashable at 0x11000
image_bk7231t_app.0x011000.crcEncrypted app image - not for flashing
image_bk7231t_app.0x129F0A.rblhRBL header - not for flashing
+

SPI flashing (unbricking BK7231T)

+

The bk7231_spi_flasher.py script can be used to put BK7231 in SPI flashing mode. Then, one can use flashrom to read/write the raw flash chip.

+

Other tools/guides

+

These tools are not recommended and are kept here for reference only. Don't use them, please.

+ +

Other info

+

There are many chip variations in this SoC family:

+
    +
  • BK7231 - marked BK7231QN40, so we're calling it "BK7231Q" to reduce confusion
  • +
  • BK7231T
  • +
  • BK7231N
  • +
  • BK7231S
  • +
  • BK7231U
  • +
+

The "officially existing" ones are BK7231Q, BK7231N and BK7231U. These are supported by Beken SDKs, such as bdk_freertos, although bk7231s_alios_sdk also existed at some point.

+
    +
  • BK7231N is substantially different than the other chips, so running T code on N (and vice versa) is not directly possible.
  • +
  • BK7231Q does not have eFuse and BLE
  • +
  • there are some references to U meaning USB support
  • +
  • T seems to be exclusive to Tuya boards (that would explain the name); in the T SDK from Tuya, CFG_SOC_NAME is set to SOC_BK7231U
  • +
  • T's bootloader greets with BK7231S_1.0.5 on UART
  • +
+

Regarding bdk_freertos:

+
    +
  • make allows selecting for which MCU the code should be compiled
  • +
  • make bk7231 doesn't compile at all
  • +
  • make bk7231u doesn't run on T with Tuya's bootloader (1.0.5), though it works just fine after replacing the bootloader with one of these included with bdk_freertos (1.0.8) (yes, even bk7231n bootloader)
  • +
  • after making a few changes to driver/entry and driver/intc (so it looks more like the code from T SDK) bdk_freertos runs just fine
  • +
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/platform/beken-72xx/keys/index.html b/docs/platform/beken-72xx/keys/index.html new file mode 100644 index 000000000..d3ee56f65 --- /dev/null +++ b/docs/platform/beken-72xx/keys/index.html @@ -0,0 +1,2433 @@ + + + + + + + + + + + + + + + + + + + + + + + + Finding encryption keys - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Finding encryption keys

+

Introduction

+
+

Tip

+

Before proceeding with this method, try using ltchiptool's Get chip info +function. It will read eFuse, which may reveal the raw encryption key. If you see all 00000000s, then the eFuse +is readout-protected and the key cannot be extracted in this simple way.

+
+

3-rd party firmware for Beken chips must be compiled with a flash encryption key matching the one programmed into +the chip. Incorrect keys will make the firmware unable to run.

+

The bk72xx-bootloader-dump firmware might make it easier +to find the encryption key of BK7231N/BK7231T chips.

+

The key is made of four 32-bit integers; the default key is usually 510fb093 a3cbeadc 5993a17e c7adeb03 +(used by Beken and Tuya on most devices), but devices with different keys have been recently discovered +(likely from other manufacturers).

+

If your device doesn't use the default keys (i.e. 3-rd party firmware doesn't boot up, or it hangs on bootloader logs), +you can try using this firmware file to extract the keys from the bootloader.

+

Why this works (and when it doesn't)

+

The bootloader has its own copy of the keys. It uses that to encrypt firmware on-the-fly when applying OTA updates.

+

Files downloaded during an OTA update are not encrypted using the main encryption keys, so the bootloader +must encrypt them before flashing to the app partition. This method works by flashing firmware directly to the +OTA partition. It is then unpacked and encrypted properly by the bootloader.

+

However, OTA update packages are encrypted using AES - for this method to work, the AES key must be known in advance.

+

Most of the time, a simple 0123456789ABCDEF key is used for OTA AES. We have seen manufacturers using different +keys - this method will not work in that case.

+

Additionally, OTA packages don't have to be encrypted - some bootloaders allow that, some don't. Using an +unencrypted package is worth trying if your device uses a non-standard OTA AES key.

+

Prerequisites

+
    +
  1. A working computer with a working UART flashing setup. The preferred flashing tool is +ltchiptool. You should have at least some prior experience with dumping +or flashing firmware.
  2. +
  3. A full factory firmware dump of the device you're working on. This is mostly in case something goes wrong, +but may also be necessary to read OTA partition offsets from.
  4. +
  5. A serial terminal (such as the ltchiptool-terminal plugin).
  6. +
+

To be continued

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/platform/realtek-amb/index.html b/docs/platform/realtek-amb/index.html new file mode 100644 index 000000000..ae87c301a --- /dev/null +++ b/docs/platform/realtek-amb/index.html @@ -0,0 +1,2573 @@ + + + + + + + + + + + + + + + + + + + + + + + + Realtek Ameba - info - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Realtek Ameba

+

The logic behind naming of Realtek chips and their series took me some time to figure out:

+ +

As such, there are numerous CPUs with the same numbers but different series. Different Ameba series are not compatible with each other, which makes them require different code and SDKs.

+
+

Realtek Ameba Series table +

+
Ameba series comparison table
+
+

Table from www.e-paper-display.com

+

(modified a bit)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Realtek P/NSeriesProtocolCPUFrequencySRAMUARTSPII2SADC/DAC
RTL8710BNAmeba ZWiFiARM M4125M256KB11NY/N
RTL8710BXAmeba ZWiFiARM M462.5M256KB11NY/N
RTL8710CXAmeba ZiiWiFiARM M4100M256KB31NN/N
RTL8710CMAmeba ZiiWiFiARM M4100M256K+4M31NN/N
RTL8720CNAmeba ZiiWiFi+BLE4.2ARM M4100M256KB21NN/N
RTL8720CFAmeba ZiiWiFi+BLE4.2ARM M4100M256KB21NN/N
RTL8720CMAmeba ZiiWiFi+BLE4.2ARM M4100M256KB21NN/N
RTL8720CSAmeba CSWiFi+BLE5 MeshM0+M4200M512KB22YY/Y
RTL8721CSMAmeba CSWiFi+BLE5 MeshM0+M4200M512K+4M32YY/Y
RTL8722CSMAmeba CSWiFi+BLE5 MeshM0+M4200M512K+4M42YY/Y
RTL8720DNAmeba D2.4G+5G+BLE5M0+M4200M512K21YY/Y
RTL8721DMAmeba D2.4G+5G+BLE5M0+M4200M512K+4M32YY/Y
RTL8722DMAmeba D2.4G+5G+BLE5M0+M4200M512K+4M42YY/Y
+

Other chips

+
    +
  • RTL8195AM
  • +
  • RTL8710AF (found in amb1_arduino)
  • +
  • RTL8711AM
  • +
  • RTL8710BN
  • +
  • RTL8710BX (found in Tuya product pages)
  • +
  • RTL8710B? (found in amb1_sdk)
  • +
  • RTL8711B? (found in amb1_sdk)
  • +
  • RTL8710CM
  • +
  • RTL8722CSM (found in ambd_arduino)
  • +
  • RTL8720DN (found in ambd_arduino)
  • +
  • RTL8721DM
  • +
  • RTL8722DM (found in ambd_arduino)
  • +
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/platform/realtek-ambz/debugging/index.html b/docs/platform/realtek-ambz/debugging/index.html new file mode 100644 index 000000000..4064911c7 --- /dev/null +++ b/docs/platform/realtek-ambz/debugging/index.html @@ -0,0 +1,2656 @@ + + + + + + + + + + + + + + + + + + + + + + + + Debugging - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Debugging

+

Debugging of Realtek Ameba chips is possible and was tested with OpenOCD running remotely on a Raspberry Pi.

+

(the following is applicable to Arduino framework, and was not tested with SDK framework)

+

LibreTiny has ready-to-use OpenOCD config files:

+ +

Local debugger

+

It should be possible to use PlatformIO's built-in debugging capabilities directly, when plugging an OpenOCD-compatible debugger into your PC. As there are no debugger interfaces built into these IoT boards, you need to specify your interface of choice in platformio.ini: +

[env:my_board]
+openocd_interface = <interface name>
+
+where <interface name> is for example raspberrypi2-native, stlink, etc.

+

Remote debugger

+

Using a Raspberry Pi is probably the easiest option (and cheapest, as everyone has a spare Pi laying around).

+

Connect your Realtek board to your Pi, as per Programming Microcontrollers using OpenOCD on a Raspberry Pi.

+

Check out RPi BCM2711 GPIOs to read more about BCM pin mappings.

+

TL;DR: Install OpenOCD. Conenct A14 to BCM GPIO#11, A15 to BCM GPIO#25. Remember to join GND together. Refer to boards/ for pinouts.

+
+

Note

+

On Raspberry Pi 4, additional config might be needed: +

bcm2835gpio peripheral_base 0xFE000000
+bcm2835gpio speed_coeffs 236181 60
+
+Save the lines to a .cfg file, and pass it to OpenOCD using -f file.cfg. +Read more here.

+
+

Start OpenOCD like this (you also need your config file in the working directory): +

sudo openocd -f interface/raspberrypi2-native.cfg -f amebaz.cfg -c "bindto 0.0.0.0"
+
+The bindto line is important, as it will allow remote connections.

+

Configure platformio.ini not to start local OpenOCD: +

[env:my_board]
+debug_tool = custom
+debug_port = 192.168.0.33:3333
+debug_server =
+
+Replace IP with your Pi's address.

+

Done, go to PlatformIO in VSCode (or whatever you're using) and click Start Debugging.

+

OpenOCD output

+

OpenOCD should show this if everything is connected properly: +

alpine:~$ sudo openocd -f interface/raspberrypi2-native.cfg -f amebaz.cfg -c "bindto 0.0.0.0"
+Open On-Chip Debugger 0.11.0
+Licensed under GNU GPL v2
+For bug reports, read
+        http://openocd.org/doc/doxygen/bugs.html
+BCM2835 GPIO nums: swclk = 11, swdio = 25
+
+Warn : Interface already configured, ignoring
+Info : Listening on port 6666 for tcl connections
+Info : Listening on port 4444 for telnet connections
+Info : BCM2835 GPIO JTAG/SWD bitbang driver
+Info : clock speed 1001 kHz
+Info : SWD DPIDR 0x2ba01477
+Info : rtl8711b.cpu: hardware has 6 breakpoints, 4 watchpoints
+Info : starting gdb server for rtl8711b.cpu on 3333
+Info : Listening on port 3333 for gdb connections
+

+

Auto reset

+

PlatformIO will reset your board by default when starting debugging. Sometimes this may not be desired. Also the current config is a bit buggy: VSCode thinks the board is halt, but it's actually running so you need to press continue for that first time.

+

To disable auto reset before and after debugging: +

[env:my_board]
+debug_init_cmds =
+  target extended-remote $DEBUG_PORT ; remove this line if you're debugging locally
+  $INIT_BREAK
+;   monitor reset halt
+  $LOAD_CMDS
+  monitor init
+;   monitor reset halt
+

+

Technical details

+

GDB is first configured with mem 0x8000000 0x8200000 ro in order to mark flash memory as read-only. This makes GDB use hardware breakpoints, as software BPs don't work on these boards.

+

More powerful playground

+
Microsoft Windows [Version 6.1.7601]
+
+Kuba@KUBA-PC C:\Users\Kuba
+# telnet 192.168.0.33 4444
+Open On-Chip Debugger
+> mdw 0x8000000
+0x08000000: 96969999
+
+> halt
+target halted due to debug-request, current mode: Thread
+xPSR: 0x61000000 pc: 0x0000b462 msp: 0x1003ef5c
+> reg
+===== arm v7m registers
+(0) r0 (/32): 0x035a9584
+(1) r1 (/32): 0x00000015
+[...]
+===== Cortex-M DWT registers
+
+> resume
+>
+
+

Useful OpenOCD commands

+

Run them in your power playground.

+

Soft reset

+

Doesn't even disconnect from WiFi (which confuses the code and makes it disconnect anyway). +

mww 0xE000ED0C 0x05FA0007
+

+

UART upload mode

+
mww 0x40000138 0x8
+mww 0xE000ED0C 0x05FA0007
+
+

Hard Fault

+
halt
+reg pc 0
+resume
+
+

ROM dump

+
> dump_image rom2.bin 0x0 0x80000
+dumped 524288 bytes in 14.041406s (36.464 KiB/s)
+
+

Flash dump

+
> dump_image flash.bin 0x8000000 0x200000
+dumped 2097152 bytes in 54.447296s (37.614 KiB/s)
+
+

Efuse dump

+

(or something that looks like it) +

> dump_image efuse.bin 0x40000000 0x400
+dumped 1024 bytes in 0.026813s (37.295 KiB/s)
+

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/platform/realtek-ambz/exception-decoder/index.html b/docs/platform/realtek-ambz/exception-decoder/index.html new file mode 100644 index 000000000..ee452f29d --- /dev/null +++ b/docs/platform/realtek-ambz/exception-decoder/index.html @@ -0,0 +1,2314 @@ + + + + + + + + + + + + + + + + + + + + + + + + Exception decoder - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Exception decoder

+

Configure built-in hard fault decoder in platformio.ini:

+
[env:my_board]
+monitor_speed = 115200
+monitor_filters = rtl_hard_fault_decoder
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/platform/realtek-ambz/index.html b/docs/platform/realtek-ambz/index.html new file mode 100644 index 000000000..a9c9f4ad9 --- /dev/null +++ b/docs/platform/realtek-ambz/index.html @@ -0,0 +1,2509 @@ + + + + + + + + + + + + + + + + + + + + + + + + Realtek AmebaZ - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Realtek AmebaZ

+

Introduction

+

Realtek AmebaZ is a family of Wi-Fi microcontrollers, primarily consisting of two chips - RTL8710BN and RTL8710BX.

+

RTL8710BX seems to be the same chip but clocked at 62.5 MHz (instead of 125 MHz for BN). However, it seems that firmware compiled for either of the chips can run on the other with no issues.

+

Features:

+
    +
  • ARM Cortex M4 CPU (up to 125 MHz)
  • +
  • 512 KiB ROM
  • +
  • 256 KiB SRAM
  • +
  • SPI flash interface with XiP
  • +
  • 802.11b/g/n Wi-Fi
  • +
+

Resources:

+ +

Finding your board

+ +

You need to know which board your device uses. Head to Supported Boards to find it. A good number of popular boards have their dedicated support and documentation pages in LibreTiny. Otherwise, you have to use one of the Generic boards that matches the CPU model of your device.

+ + +
+

Flashing

+

Realtek RTL8710B has two UART ports - UART2 (sometimes called LOG_UART) and UART0. The port used for flashing and viewing logs is UART2.

+

You need to find which pins correspond to UART2 TX and RX. If your board is supported, you'll find the pinout on its documentation page. Otherwise (and for generic boards), you'll have to find the pinout online.

+
+

Tip

+

You need a good USB<->UART adapter for the process. Some chips may not support 1.5M baud rate, +required by the ROM for the initial handshake. Widespread PL2303 is currently known not to work, +at least under Windows. FT232RL is verified to work reliably.

+
+

Wiring

+

Connect UART2 of the Realtek chip to the USB-TTL adapter:

+ + + + + + + + + + + + + + + + + + + + + +
PCRTL8710B
RXTX2 (Log_TX / PA30)
TXRX2 (Log_RX / PA29)
GNDGND
+ +
+

Important

+

Using a good, stable 3.3V power supply is crucial. Most flashing issues are caused by either voltage drops during intensive flash operations, or bad/loose wires. The UART adapter's 3.3V power regulator is usually not enough.

+

Instead, a regulated bench power supply, or a linear 1117-type regulator is recommended.

+
+ + +

In order to flash the chip, you need to enable download mode. This is done by resetting the chip while pulling down the TX2 pin.

+ +
+

Note

+

"CEN" pin is the RESET pin - connecting it to GND will keep the chip in "reset" state. Disconnecting it will allow the chip to start back up.

+

If you're having issues with using CEN pin (or if it's not accessible on your device) you can toggle the 3.3V power instead. Removing power will keep it in "reset", and applying it back will start it again.

+
+ + +

Do this, in order:

+
    +
  • connect CEN to GND
  • +
  • connect TX2 to GND
  • +
  • release CEN from GND
  • +
  • release TX2 from GND
  • +
+

To find out whether download mode is enabled, open a serial terminal (such as PuTTY) on your PC. You should see a few characters printed to the serial console every second (usually some kind of grey blocks, or other non-letter characters).

+

Note that you will not see any characters before you release TX2 from GND.

+

Partition layout

+

When you compile firmware for Realtek with LibreTiny (either ESPHome or other PlatformIO projects), you need to choose a board. Different Realtek boards have different partition layouts - the main difference is the OTA2 firmware address. Choosing a board with wrong address will make it harder to flash OTA updates.

+

Flashing over UART will update (set) the on-chip OTA address to match the firmware being flashed. OTA flashing will not update the address - so make sure to choose the correct board, and keep using the same board for OTA flashing.

+

Using incorrect boards may result in OTA updates having no effect, or (worst case) bricking the device completely.

+

Flashing

+

The recommended tool to flash (or dump firmware) is ltchiptool.

+

Read Using ltchiptool to learn the flashing procedure

+
+

Tip

+

Because the UART uploading code is programmed in the ROM of the chip, it can't be software-bricked, even if you damage the bootloader.

+
+
+

Auto-download-reboot

+ +

If you have a recent version of LibreTiny already installed on the chip, you don't need to perform any steps to enter download mode. Instead, Auto-download-reboot will reboot the chip automatically, as soon as it notices the flasher program. This is enabled by default, so you don't have to configure anything.

+ + +

Firmware output files

+

These files are present in the build directory after successful compilation:

+ + + + + + + + + + + + + + + + + + + + + +
FileDescription
firmware.uf2UF2 package for UART and OTA upload
image_ota1.0x00B000.binOTA 1 image, flashable to 0xB000
image_ota2.0x0D0000.binOTA 2 image, flashable to 0xD0000 (the address might be different)
+

Other tools/guides

+

These tools are not recommended and are kept here for reference only. Don't use them, please.

+ +

OTA1/2 files can be flashed using ImageTool_v2.3.1_AmebaZ(8710b). Browse and select one of the files and enter an appropriate address. Select COM port, press Open and then Download.

+

This method is not recommended, as it requires you to know the currently enabled OTA index (1 or 2). Flashing the wrong file will either not make any changes, or upload firmware which won't run.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/projects/esphome/index.html b/docs/projects/esphome/index.html new file mode 100644 index 000000000..67df08824 --- /dev/null +++ b/docs/projects/esphome/index.html @@ -0,0 +1,2645 @@ + + + + + + + + + + + + + + + + + + + + + + + + 💡 ESPHome setup guide - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

ESPHome

+
+

Tip

+

See the Cloudcutter video guide for a complete tutorial on flashing with Cloudcutter and installing LibreTiny-ESPHome. Includes Home Assistant Add-On setup.

+
+

LibreTiny is now natively supported by ESPHome in versions 2023.9.0 and later.

+

There are three basic ways to install and use ESPHome. You can choose the option that best suits you:

+
    +
  • ESPHome Dashboard (GUI) - for new users, might be an easy way to go; config management & compilation using web-based dashboard
  • +
  • command line (CLI) - for more experienced users; compilation using CLI commands, somewhat easier to troubleshoot
  • +
  • Home Assistant Add-On - using ESPHome in Home Assistant as an add-on
  • +
+
+

Important

+

If you have the LibreTiny-ESPHome add-on installed in Home Assistant, migrate your YAML files over to the official ESPHome add-on.

+

The standalone add-on is now deprecated - after migrating your configs, uninstall the old add-on.

+
+

Find your device's board

+

Go to Boards & CPU list, find your board (chip model), click on it and remember the Board code. This will be used later, during config creation.

+

If your board isn't listed, use one of the Generic boards, depending on the chip type of your device.

+

Download ESPHome

+
+
+
+

For this, you need Docker, Docker Compose and Python installed. After running the commands, you'll have a running ESPHome Dashboard interface that you can connect to.

+
    +
  1. Open a terminal/cmd.exe.
  2. +
  3. +

    Create a docker-compose.yml file in a directory of choice:

    +
    docker-compose.yml
    version: "3"
    +services:
    +  esphome:
    +    container_name: esphome
    +    image: ghcr.io/esphome/esphome:latest
    +    volumes:
    +      - ./configs:/config:rw # (1)!
    +      - /etc/localtime:/etc/localtime:ro
    +    restart: always
    +    privileged: false
    +    network_mode: host
    +
    +
      +
    1. You can change ./configs to another path, in which your ESPHome configs will be stored.
    2. +
    +
  4. +
  5. +

    Start the container using docker-compose up. You should be able to open the GUI on http://localhost:6052/.

    +
  6. +
+
+
+
+

Important

+

Read Getting started first - most importantly, the first part about installation.

+
+

Assuming you have PlatformIO, git and Python installed:

+
    +
  1. Open a terminal/cmd.exe
  2. +
  3. git clone https://github.com/esphome/esphome
  4. +
  5. cd into the newly created esphome directory.
  6. +
  7. Check if it works by typing python -m esphome
  8. +
+
+

Tip

+

You can alternately install ESPHome CLI using pip with pip install esphome

+
+
+
+
+

Create your device config

+
+
+
+
    +
  1. Open the GUI on http://localhost:6052/ (or a different IP address if you're running on a Pi).
  2. +
  3. Go through the wizard steps:
      +
    • New Device
    • +
    • Continue
    • +
    • enter name and WiFi details (first time only)
    • +
    • LibreTiny will not currently be listed as an option, choose any of the boards and you will overwrite them later
    • +
    • select Skip
    • +
    +
  4. +
  5. A new config file will be added. Press Edit and proceed to the next section.
  6. +
  7. Delete the entire generated configuration and replace it with the example configuration below or one generated by UPK2ESPHome.
  8. +
+
+
+
    +
  1. Create a YAML config file for your device. You can either:
      +
    • use python -m esphome wizard yourdevice.yml - type answers to the six questions the wizard asks, OR:
    • +
    • write a config file manually: +
      yourdevice.yml
      esphome:
      +  name: yourdevice
      +
      +bk72xx:  # adjust accordingly: bk72xx or rtl87xx
      +  board: cb2s  # THIS IS YOUR BOARD CODE
      +  framework:
      +    version: latest
      +
      +logger:
      +web_server:
      +captive_portal:
      +api:
      +ota:
      +
      +wifi:
      +  ssid: !secret wifi_ssid
      +  password: !secret wifi_password
      +  ap:
      +
    • +
    +
  2. +
+
+
+
+

Automatically generate config

+

Instead of adding components manually and writing everything from scratch, you can use UPK2ESPHome to generate a working config (for supported BK7231 devices only). If your device has a Cloudcutter profile, there's a high chance it can have a generated config.

+

Add components

+

Now, just like with standard ESPHome on ESP32/ESP8266, you need to add components for your device. Visit ESPHome homepage to learn about YAML configuration. If you want, you can upload an "empty" config first, and add actual components later.

+
+

Important

+

It's highly recommended to always include the web_server and captive_portal components - even in your first "empty" upload.

+

Adding these two components will safeguard you against accidentally soft-bricking the device, by e.g. entering invalid Wi-Fi credentials. The Web Server provides an easy way to flash a new image over-the-air, and the Captive Portal allows to easily open the Web Server on a fallback AP.

+
+

Build & upload

+
+
+
+

Close the config editor. Press the three dots icon and select Install. Choose Manual download and Modern format. The firmware will be compiled and a UF2 file will be downloaded automatically.

+
+
+

The command python -m esphome compile yourdevice.yml will compile ESPHome.

+
+
+
+

Now, refer to the flashing guide to learn how to upload ESPHome to your device. There's also info on using tuya-cloudcutter in that guide.

+

Advanced: LT configuration

+
+

Note

+

This part is for advanced users. You'll probably be fine with the default options.

+
+

All options from Options & config can be customized in the LibreTiny block:

+
yourdevice.yml
bk72xx:
+  framework:
+    version: latest
+  lt_config:
+    LT_LOG_HEAP: 1
+    LT_UART_DEFAULT_PORT: 2
+    LT_UART_SILENT_ALL: 0
+
+

(this is only an example)

+

Additionally, few options have their dedicated keys:

+
yourdevice.yml
bk72xx:
+  framework:
+    version: latest
+  # verbose/trace/debug/info/warn/error/fatal
+  loglevel: warn
+  # suppress chip's SDK log messages
+  # (same as LT_UART_SILENT_ALL above)
+  sdk_silent: true
+  # disable SWD/JTAG so that all GPIOs can be used
+  # set to false if you want to attach a debugger
+  gpio_recover: true
+
+

(these values are defaults)

+

Advanced: Using development versions with ESPHome

+

There are a two ways to use development versions of LibreTiny with ESPHome:

+
    +
  • version is a required field, and must match a specific format, it is recommended to use "0.0.0" for custom development
  • +
  • source must point to where your development version of LibreTiny resides.
  • +
+
+
+
+
bk72xx:
+  framework:
+    version: "0.0.0"
+    source: "https://github.com/libretiny-eu/libretiny"
+
+

Source can be post-fixed to checkout a specified branch or a Pull Request:

+
    +
  • Branch: add #branch_name (ex: source: "https://github.com/libretiny-eu/libretiny#experimental_branch_name")
  • +
  • Pull Requests: Pull requests currently require you to check out the source branch of the pull request. To get this information, visit the PR, click on the source branch, and copy their git address and apply the branch their PR uses (ex: https://github.com/pr_user/libretiny#pr_branch)
  • +
+
+
+

Check out with Git (recommended) or download and extract a copy of LibreTiny to your local file system running ESPHome.

+
bk72xx:
+  framework:
+    version: "0.0.0"
+    source: "/local_path_to_libretiny"
+
+
+
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 000000000..bcfd1cadf --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,8 @@ +mkdocs-material +mkdocs-same-dir +mkdocs-literate-nav==0.5.0 +mkdocs-section-index +mkdocs-include-markdown-plugin +mkdocs-git-revision-date-localized-plugin +-e git+https://github.com/libretiny-eu/mkdoxy#egg=mkdoxy +mkdocs-redirects diff --git a/docs/resources/SUMMARY/index.html b/docs/resources/SUMMARY/index.html new file mode 100644 index 000000000..dcf2a269a --- /dev/null +++ b/docs/resources/SUMMARY/index.html @@ -0,0 +1,2283 @@ + + + + + + + + + + + + + + + + + + SUMMARY - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/resources/beken-flash/index.html b/docs/resources/beken-flash/index.html new file mode 100644 index 000000000..0eee8f964 --- /dev/null +++ b/docs/resources/beken-flash/index.html @@ -0,0 +1,3283 @@ + + + + + + + + + + + + + + + + + + + + + + Beken Flash Chip List - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Beken Flash Chip List

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Chip IDLocationManufacturerDeviceSizeSR SizeLine ModeCMP PostProtect PostProtect MaskProtect AllProtect NoneProtect HalfUnprotect Last BlockQE Bit PostQE BitM ValueMode SelUnprotectProtectcwMsksblbSR ReadSR Write
00 00 00BDKnaDEFAULT4 MiB22020x1F0x000x000x000x000000x000x01
0B 40 14BDKxtx / XT25F08B1 MiB221420x1F0x1F0x000x0C0x101910xA00x01
0B 40 15HDP,BDKxtx / XT25F16B2 MiB221420x1F0x1F0x000x0D0x101910xA00x010x000x07BIT(14) or BFD(0x1f,2,5)2505 3501
0B 40 16HDP,BDKxtx / XT25F32B4 MiB221420x1F0x1F0x000x0E0x101910xA00x010x000x07BIT(14) or BFD(0x1f,2,5)2505 3501
0B 40 17HDP,BDKxtx / XT25F64B8 MiB221420x1F0x050x000x0E0x109910xA00x010x000x07BIT(14)or BFD(0x1f,2,5)2505 3501
0B 60 17HDPxtx / XT25Q64B8 MiB20x000x07BIT(14) or BFD(0x1f,2,5)2505 3501
0E 40 16BDKxtx / FT25H324 MiB221420x1F0x1F0x000x0E0x101910xA00x01
1C 31 13HDPxtx / PN25F04B512 KiB10x000x07BFD(0x0f,2,4)240501
1C 41 16HDPESMT25QH32A4 MiB10x000x07BFD(0xf,2,5)240501
1C 70 15HDP,BDKEN / ESMT25QH16B2 MiB12020x1F0x1F0x000x0d0x0d000xA50x010x000x07BFD(0xf,2,5)240501
1C 70 16BDKen25QH32B4 MiB12020x1F0x1F0x000x160x01B000xA50x01
20 40 16BDKxmc25QH32B4 MiB221420x1F0x1F0x000x0E0x101910xA00x01
51 40 13HDPGD25D40512 KiB10x000x07BFD(0x0f,2,3)230501
51 40 14HDPGD25D801 MiB10x000x07BFD(0x0f,2,3)230501
5E 40 14HDPxtx / PN25F08B1 MiB10x000x07BFD(0x0f,2,4)240501
85 60 13HDPPuya25Q40512 KiB20x000x07BIT(14) or BFD(0x1f,2,5)2505 3501
85 60 14HDPPuya25Q801 MiB20x000x07BIT(14) or BFD(0x1f,2,5)2505 3501
85 60 16HDPPuya25Q32H4 MiB20x000x07BIT(14) or BFD(0x1f,2,5)2505 3501
85 60 17HDPPuya25Q64H8 MiB20x000x07BIT(14) or BFD(0x1f,2,5)2505 3501
C2 23 14HDPWH25V8035F1 MiB20x000x07BIT(12) or BFD(0x1f,2,4)2505 1501
C2 23 15BDKmx25V16B2 MiB12020x0F0x0F0x000x0A0x00E610xA50x01
C2 23 15HDPWH25V1635F2 MiB20x000x07BIT(12) or BFD(0x1f,2,4)2505 1501
C8 40 13HDPGD25Q41B512 KiB10x000x07BIT(14) or BFD(0x1f,2,3)2305 3501
C8 40 14HDPGD25D801 MiB20x000x07BIT(14) or BFD(0x1f,2,5)2505 3501
C8 40 15HDP,BDKGD25Q162 MiB221420x1F0x1F0x000x0D0x101910xA00x010x000x07BIT(14) or BFD(0x1f,2,5)2505 3501
C8 40 16HDP,BDKGD25Q324 MiB12020x1F0x1F0x000x0E0x00E000xA00x010x000x07BIT(14) or BFD(0x1f,2,5)2505 3501
C8 65 15HDPGD25WQ16E2 MiB20x000x07BIT(14) or BFD(0x1f,2,5)2505 3501
C8 65 16HDPGD25WQ32E4 MiB20x000x07BIT(14) or BFD(0x1f,2,5)2505 3501
C8 65 17HDPGD25WQ64E8 MiB20x000x07BIT(14) or BFD(0x1f,2,5)2505 3501
CD 60 14HDPTH25Q80HB1 MiB20x000x07BIT(14) or BFD(0x1f,2,5)2505 3501
E0 40 13HDPBY / PN25Q40A512 KiB10x000x07BIT(14) or BFD(0x1f,2,3)2305 3501
E0 40 14HDPBY / PN25Q80A1 MiB10x000x07BIT(14) or BFD(0x1f,2,3)2305 3501
EB 60 15HDP,BDKzg / TH25Q16(H)B2 MiB221420x1F0x1F0x000x0D0x101910xA00x010x000x07BIT(14) or BFD(0x1f,2,5)2505 3501
EF 40 16BDKw25Q32BFJ4 MiB221420x1F0x1F0x000x000x101910xA00x01
EF 40 18HDPWB25Q128JV16 MiB20x000x07BIT(14) or BFD(0x1f,2,5)2505 3501
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/resources/documents/index.html b/docs/resources/documents/index.html new file mode 100644 index 000000000..595cced04 --- /dev/null +++ b/docs/resources/documents/index.html @@ -0,0 +1,2420 @@ + + + + + + + + + + + + + + + + + + + + + + + + Documents - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Documents

+

Realtek

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
CodeName
 From ambd_sdk
AN0004Realtek low power wi-fi mp user guide
AN0011Realtek wlan simple configuration
AN0012Realtek secure socket layer(ssl)
AN0025Realtek at command
AN0075Realtek Ameba-all at command v2.0
AN0096Realtek Ameba-all xmodem uart update firmware
AN0400Ameba-D Application Note
UM0150Realtek Ameba CoAP User Guide
UM0201Ameba Common BT Application User Manual EN
 Found elsewhere
AN0400Ameba-D Application Note_v3_watermark
AN0500Realtek Ameba-ZII application note
 Realtek Ameba-ZII datasheet v0.8
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/resources/tuya-pin-config/index.html b/docs/resources/tuya-pin-config/index.html new file mode 100644 index 000000000..507b5b461 --- /dev/null +++ b/docs/resources/tuya-pin-config/index.html @@ -0,0 +1,3453 @@ + + + + + + + + + + + + + + + + + + + + + + + + Tuya Pinout Config - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Tuya Pinout Config

+

Device configuration (user_param_key) can be extracted to JSON, using bk7231tools from a full firmware dump.

+

Also see:

+ +

Sources:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Key(s)MeaningPossible values
crcUPK data checksum
moduleTuya module usedCB3S / WB3S / CBU, etc.
categoryDevice type as a number0502 - CW light
0505 - RGBCW light
Jsonver
jv
"JSON" version
Common
netled_pin
netled1_pin
wfst_pin
Status LED for WiFi
netled_lv
netled1_lv
wfst_lv
Status LED Active Level0 - Active low
1 - Active high
netled_reuse
reset_pin + reset_lvReset Button Pin + Active Level
reset_tButton press time to reset the device3/5/6/9/10 seconds
iicsclI²C SCL Pin
iicsdaI²C SDA Pin
net_trig
net_type
wfct
Lights/bulbs
cmodColor Modergbcw / rgb / cw / c / rgbc
dmodLight driver type0 - PWM
1 - SM16726B
2 - SM2135E
3 - SM2135EH
4 - SM2135EJ
5 - BP1658CJ
6 - BP5758D
7 - SM2235/2335
cwtypeColor temperature driver0 - cool and warm white (CW)
1 - correlated color temperature (CCT)
onoffmodeOn/off gradient enabled0 / 1
pmemoryPower-off memory enabled0 / 1
defcolorDefault Colorc / r
defbrightDefault Brightness0%-100%
deftempDefault Color Temperature0-100 when defcolor is cool white
cwmaxpCold-Warm Max Power100-200 with a pitch of 10
brightmin, brightmaxMin/Max Brightness0%-100%
colormin, colormaxRGB Min/Max Brightness0%-100%
cwmin, cwmaxCold-Warm Min/Max Brightness0%-100%
colormaxpRGB Max Power0%-100%
colorpfunColor mixing power limit enabled0 / 1
brightstep
bristep
Brightness Step
hsvstep
rgbtUsed in prod.tests, not relevant
title20"title20/T20" supported0 / 1
Gamma correction
gmr, gmg, gmb
gmkr, gmkg, gmkb
gmwr, gmwg, gmwb
PWM Lights
r_pin + r_lvRed Channel Pin + Active Level
g_pin + g_lvGreen Channel Pin + Active Level
b_pin + b_lvBlue Channel Pin + Active Level
c_pin + c_lvCool White Pin + Active Level
w_pin + w_lvWarm White Pin + Active Level
pwmhzPWM Operating Frequency (Hz)
I²C Lights
dccur
ehccur
cjccur
Cold White Current
dwcur
ehwcur
cjwcur
Warm White Current
drgbcurRGB Current
campereMax current of SM2135 colored output10-45 with a pitch of 5 and defaults to 20
wampereMax current of SM2135 white output10-80 with a pitch of 5 and defaults to 30
iicrRed Channel Number0-5
iicgGreen Channel Number0-5
iicbBlue Channel Number0-5
iiccCold White Channel Number0-5
iicwWarm White Channel Number0-5
iicccurCold White Current0
iicwcurWarm White Current5
Sockets/switches
btX_pin + btX_lvButton X Pin + Active Level
btX_type
bt_type
Button X Trigger Type0 - level_trig
1 - edge_trig
rlX_pin + rlX_lvRelay X Pin + Active Level
rlX_type
rl_type
Relay X Type0 - Electric holding relay
1 - Magnetic holding relay
rl_onX_pin + rl_onX_lvRelay ON Pin + Active Level
rl_offX_pin + rl_offX_lvRelay OFF Pin + Active Level
rl1_dr_type
rl_drvtime
total_bt_pin + total_bt_lv
Power monitoring
ele_fun_enPower Monitoring Enabled0 / 1
chip_typePower Monitoring Chip Type0 - BL0937
1 - HLW8012
2 - HLW8032
4 - BL0942
ele_pinCF Pin
vi_pinCF1 Pin
sel_pin_pin + sel_pin_lvSEL Pin + Active LevelActive level is usually 1
lose_volUnder voltage threshold in V
over_curOvercurrent threshold in mA
over_volOvervoltage threshold in V
sample_resistorCurrent shunt resistor value1 - 1mΩ
2 - 2mΩ
vol_defSocket operating voltage0 - 220V
1 - 110V
work_voltageSocket operating voltage
Infrared
irfuncIR Function enabled0 / 1
infreIR Transmitter Pin
infrr
ir
IR Receiver Pin
irkXfun + irkXvalIR Key X Function + ValueX in 1..30
irnightt
irstep
wgmod, swgmod, scgmod
PIR
pirmod
pirfreqPWM Operating Frequency (Hz) for PIR1000
pirlduty100
pirmduty50
pirhduty0
pirin_pin + pirin_lvMotion reporting GPIO + Active Level
pirsense_pin + pirsense_lvPIR sensitivity (PWM) + Active Level
pirrange
pirwarn
Ambient light sensor
dayValue to compare against ADC readoutADC value range (0-3300)
duskValue to compare against ADC readoutADC value range (0-3300)
evenfallValue to compare against ADC readoutADC value range (0-3300)
eveningValue to compare against ADC readoutADC value range (0-3300)
nightValue to compare against ADC readoutADC value range (0-3300)
Key-controlled
key_pin + key_lvKey Pin + Active Level
kXpin_pin + kXpin_lv
kXdfunc, kXlfunc, kXsfunc
kXldir, kXsdir
keyccfg1, keyccfg2
keyfunc, keyglobefunc
keylt, keynumber
Pairing-related
wfcfgWi-Fi pairing configspcl / spcl_auto / prod / old / low
remdmode"light reset pairing mode"0 / 1
rstnumOn/off cycles to reset
rstcorLight color while connectingc / r
rstbrLight brightness while connecting10-100
rsttempLight temperature while connecting0-100
remdtimePairing mode timeoutseconds
wfptimeLight pairing timeminutes
cagtUsed in prod.tests, not relevantN/A
prodagainUsed in prod.tests, not relevant0 / 1
rstmodePairing related - not relevant
pairtPairing related - not relevant6-600
wtUsed in prod.tests, not relevantN/A
Other
buzzer_pwmBuzzer working PWM frequency
ismusic0 / 1
ledX_pin + ledX_lvLED X Pin + Active Level
led_pin + led_lvLED Pin + Active Level
Unknown
0err
1err
adclimit
aging
alarm1_time
alarm_t1
backlit_dp
backlit_select
bitseq
bleonoff
blindt
buzzer
cctseg
cd_flag2
cdsval
ch1_stat
ch_cddpidXX in 1..4
ch_dpidXX in 1..4
ch_flagXX in 1..4
ch_num
clean_t
cntdown1
ctrl_lv
ctrl_pin
customcode
cyc_dpid
dctrl_select
dimmod
dimt
dimval
door1_magt_lv
door1_magt_pin
door_alarm_st1
door_mag1
ffc_select
inch_dp
indep_cfgbt
init_conf
knum
ktime
leaderr
led_dp
lfunc
light_status_select
lock_dp
lockt
micpin
mixway
mutex
mxcl_led_m
netn_led
netnc
nety_led
netyc
nightbrig
nightcct
nightled
notdisturbDo not disturb (DND) mode enabled0 / 1
on_off_cnt
onoff1
onoff_clear_t
onoff_n
onoff_rst_m
onoff_rst_type
onoff_type
onofftime
owm
preheatt
rand_dpid
remote_add_dp
remote_list_dp
remote_select
resistor
reuse_led_m
rsthold
scenespct
series_ctrl
sfunc
standtime
starterr
step_rate
switch1
tempmix
tempstep
total_stat
tracetime1
trigdelay
trigmod
trl1_time
voice_ctrl1
voice_ctrl_set1
whiteseg
zero_select
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/script.js b/docs/script.js new file mode 100644 index 000000000..2845e5938 --- /dev/null +++ b/docs/script.js @@ -0,0 +1,6 @@ +document$.subscribe(function () { + var tables = document.querySelectorAll("article table:not([class])") + tables.forEach(function (table) { + new Tablesort(table) + }) +}) diff --git a/docs/scripts/__pycache__/markdown.cpython-310.pyc b/docs/scripts/__pycache__/markdown.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..7ed85f16b181b9930b93687272364e811d190f82 GIT binary patch literal 3498 zcmZ`*&2JmW6`z?MEq;)I(A9TojOw`j-a1<&?949&~8)d$ar$6%zY)_~vou_kQnVCSF=9F?=@u z`yanpWb7OIG5c}w;~AdhJqX1V4_Sxra!z9rijK4EaP}Efj*=%#$z!oARqi=!xZlE_ zHMo&4;~=8wy=dSmBf=% z?w+gis&FEAT~$=26SkXIw=h%o3o7SJ%r2>A%of#q>NfOuNUs?56?OL{w_CE>Dy?O$ z-%vGJ-%_j4tWC7{)O~2nQ(L>jo9ZoSm!`H>`?h)j?XtC{ouvAKszbA)9%4PhknO*& z9zlCs@sUQVchtMk+)p=CPCy_(1#%^!{5MlSU|p&E!u1 zovnw>X8jKbK~mofLcfl8tCz;jeLwPbEA>^q+1xg)?`(8b!_he`s|5)cqTv{s_~D+W z2bh>`4BKdVHx;61}Ph`mz;P|&flGXtPa7$nNae~ zfnJ{TbL4oYq0yg^?-Ji*WIOTmAxqYepr`Mj@mS7sJBAx0`7tuS;79FP1<}6Y zrAE%kxa&uj8l^Y#DrmnXj3g$z#& z4;BJWD_eJ~7!2U*K)`8!%-2|zt-^^5v2(@i7u-0ZA0dK-LBBzwMuMU>g<_m;OVLUR zQCa2v@&p7Xz9p`WO#QD?lMDU7`r!hcN&dYBQ*g}A07&sF`p7C^tuo6v<(>mrkMtVM zKn!_d+*TLlQI=VZZ$qaakhq5NR!b@Gz;6-jtC+XxvBo9uS0`v^OpH9x{@w!8F>#j_ zECJd$szZ!wgnF9Ft-VG&%+;#$7}S7F~zy)cMgy@|<7BCs->vEy0ev_cef zqTAn#Nk77$sXE2OFZ8>#)ngLG!x#m1YW@CLI}^b??GtqNEprVR^lwjC8BHzhOSMc% zbV=bDMU9;a>KW%^9I*?&gU}Fdx=!LLi6jrQl3!cRc^SIP?ZB zy9qJ3W0SN$BynxWJgo?yEma@FV8-Xs)Iy&iM?S-oP#I)CEA)l|dcxRaP1yy)r#@3q zM|G@ieqIA&U8njW;%#157G2NkCrMw2ew!8?e;f=b5*8JOZxjg>HE)EbYObRDqFL`drDi>Yl{LJK zzMF^&aao{fSv<8xqG;Z@ROvnrJ{=z=b9~_@WBH=PCz0q)gz5xc=2Lde|HcO5Q}&`Z zbkGi+W9VM2{6!4qFqiUEHo(Or6@%O{KNj?Biyf{U7WdiE{hEEv_i$QZr9#$7X|*A@ zX9hB3m>;-ja*#jEo!ef9BOiO7GHX>(E>4!hqLsz+WatbWmEY&s84Vf|xTsBk#D>mj z-@<5Lix~Uj#)TD~#T5^KcgkM^i7H~=&2sjXqi>aV76M2m_?$?h&c2Vddf^Uv=G;HU zp?E&3r+b)f2qQK=F#ON?Tus{>D}qw_9PdjluXY zbC4*{DQ0x+UDhEiq%xwzhvJl}jsjs3Oe}Pwac>R(T!nmE*S2*0V zBCv^OkJT;Al7+=u#}%eNsLuhR;=7R>h3%^>+q}WAc+;|h!k=zEpU;~1+Qy@Q1<`k! zgQlh{_uO`~ers!N7x^{)?HP&RkeJ6$U0GXk2ct&b6#b~zu{Sg0z->)6ncXq!7~x`= zq_|Dlnrjp@Mm{E!pVO>^8nVn8ryYkl!-L3AjHH(-_9B!S4KoN94Do1+)EjJQslg<4 z6fN@tzs=XU_`eiuyu_FBC0XG2p)Fy~_Pxqtb~L!At3l%~UGeBH>v^W+d7W7GLK>Gn z@37Yjvl&g4;iyctS@FD96vb&P4dN*AJiUx5dvh{Q5T!OZG#xnExnz%u59sHQNc@BZ z<*ojR#OEZY5u8#^* literal 0 HcmV?d00001 diff --git a/docs/scripts/__pycache__/write_boards.cpython-310.pyc b/docs/scripts/__pycache__/write_boards.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..79b4bb05331f18b4b8c93098870e0daf73ff1edb GIT binary patch literal 11176 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 None: + self.items = ["", ""] + self.output = join(dir, f"{name}.md") + + def write(self): + with open(self.output, "w", encoding="utf-8") as f: + f.write("\n".join(self.items)) + f.write("\n") + + def pad(self, s: str, i: int) -> str: + return s + " " * (i - len(s)) + + def add_heading(self, text: str, level: int = 1) -> "Markdown": + self.items.append(level * "#" + " " + text) + return self + + def get_link(self, text: str, href: str) -> str: + return f"[{text}]({href})" + + def get_img(self, alt: str, src: str) -> str: + return f"![{alt}]({src})" + + def add_link(self, text: str, href: str) -> "Markdown": + self.items.append(self.get_link(text, href)) + return self + + def add_img(self, alt: str, src: str) -> "Markdown": + self.items.append(self.get_img(alt, src)) + return self + + def add_text(self, *text: str) -> "Markdown": + self.items.append(" ".join(text)) + return self + + def add_styled(self, style: str, *text: str) -> "Markdown": + self.items.append(style + " ".join(text) + style) + return self + + def add_list(self, *items: str) -> "Markdown": + self.items.append("- " + "\n- ".join(items)) + return self + + def add_table(self, header: List[str], *rows: List[str]) -> "Markdown": + maxlen = [len(h) for h in header] + for row in rows: + for i, col in enumerate(row): + maxlen[i] = max(maxlen[i], len(col)) + lines = [] + header = [self.pad(h, maxlen[i]) for i, h in enumerate(header)] + line = " | ".join(header) + lines.append(line.rstrip()) + underline = ["-" * i for i in maxlen] + line = "-|-".join(underline) + lines.append(line.rstrip()) + for row in rows: + row += [""] * (len(header) - len(row)) + row = [self.pad(h, maxlen[i]) for i, h in enumerate(row)] + line = " | ".join(row) + lines.append(line.rstrip()) + self.items.append("\n".join(lines)) + return self diff --git a/docs/scripts/prepare_doxygen.py b/docs/scripts/prepare_doxygen.py new file mode 100644 index 000000000..b217af2df --- /dev/null +++ b/docs/scripts/prepare_doxygen.py @@ -0,0 +1,38 @@ +# Copyright (c) Kuba Szczodrzyński 2023-03-11. + +import re +from glob import glob +from os.path import dirname, join + +inputs_path = join(dirname(__file__), "..", "..", "cores/common/base/**/*.*") +outputs_path = join( + dirname(__file__), "..", "..", "cores/common/arduino/libraries/**/*.*" +) +inputs = glob(inputs_path, recursive=True) +outputs = glob(outputs_path, recursive=True) + +functions = {} + +for input in inputs: + with open(input, "r") as f: + code = f.read() + regex = r"\/\*\*(.+?)\*\/\n.+?\s\*?(\w+)\(.*?\);" + for match in re.finditer(regex, code, re.DOTALL): + functions[match[2]] = match[1] + +for output in outputs: + with open(output, "r") as f: + code = f.read() + regex = r"(\t*)\/\*\*.+?@copydoc (\w+)\(\)" + + def transform(match: re.Match): + docs: str = functions.get(match[2], None) + if not docs: + return match[0] + indent = "\n" + match[1] + docs = indent.join(docs.split("\n")) + return match[1] + "/** " + docs + + code = re.sub(regex, transform, code, re.DOTALL) + with open(output, "w") as f: + f.write(code) diff --git a/docs/scripts/write_apis.py b/docs/scripts/write_apis.py new file mode 100644 index 000000000..d1bf4de95 --- /dev/null +++ b/docs/scripts/write_apis.py @@ -0,0 +1,129 @@ +# Copyright (c) Kuba Szczodrzyński 2023-06-22. + +import re +from glob import glob +from os.path import dirname, join + +import colorama +from colorama import Fore, Style +from markdown import Markdown + +if __name__ == "__main__": + colorama.init() + + api_path = join(dirname(__file__), "..", "..", "cores/common/base/api/lt_*.*") + out_path = join(dirname(__file__), "..", "contrib") + + declaration = "" + implementation = "" + + for file in glob(api_path): + with open(file, "r") as f: + data = f.read() + if file.endswith(".h"): + declaration += data + elif file.endswith(".c"): + implementation += data + + block_comment_regex = r"\/\*[\d\D]+?\*\/" + line_comment_regex = r"\/\/.+?$" + macro_regex = r"#(?:[^\n\\]|\\\n)+$" + line_regex = r"\n+" + declaration = re.sub(block_comment_regex, "", declaration) + declaration = re.sub(line_comment_regex, "", declaration, flags=re.MULTILINE) + declaration = re.sub(macro_regex, "", declaration, flags=re.MULTILINE) + declaration = re.sub(line_regex, "\n", declaration) + implementation = re.sub(block_comment_regex, "", implementation) + implementation = re.sub(line_comment_regex, "", implementation, flags=re.MULTILINE) + implementation = re.sub(macro_regex, "", implementation, flags=re.MULTILINE) + implementation = re.sub(line_regex, "\n", implementation) + + declaration_regex = r"^([^\s][\d\w\s]+ \*?)([\S]+?)\(.*?\);$" + implementation_regex = r"^(__attribute__\(\(weak\)\) )?([\w\d* ]+?)([\w\d]+)\(.+?{" + + function_types = {} + decl_functions = set() + impl_functions = set() + weak_functions = set() + + for match in re.finditer( + pattern=declaration_regex, + string=declaration, + flags=re.DOTALL | re.MULTILINE, + ): + function_type = match[1].strip() + function_name = match[2].strip() + + if function_types.get(function_name, function_type) != function_type: + print( + Fore.YELLOW + + "WARNING: Wrong return type: " + + f"'{function_types[function_name]} {function_name}'" + + f"vs '{function_type} {function_name}'" + + Style.RESET_ALL + ) + + function_types[function_name] = function_type + decl_functions.add(function_name) + + for match in re.finditer( + pattern=implementation_regex, + string=implementation, + flags=re.DOTALL | re.MULTILINE, + ): + is_weak = match[1] + function_type = match[2].strip() + function_name = match[3].strip() + function_types[function_name] = function_type + + if function_types.get(function_name, function_type) != function_type: + print( + Fore.YELLOW + + "WARNING: Wrong return type: " + + f"'{function_types[function_name]} {function_name}'" + + f"vs '{function_type} {function_name}'" + + Style.RESET_ALL + ) + + function_types[function_name] = function_type + if is_weak: + weak_functions.add(function_name) + else: + impl_functions.add(function_name) + +for function in list(impl_functions): + if "static" in function_types[function]: + impl_functions.remove(function) + +common_functions = impl_functions.union(weak_functions) +family_functions = decl_functions - common_functions +undecl_functions = common_functions - decl_functions +if undecl_functions: + print(Fore.RED + "ERROR: Undeclared functions: " + ", ".join(undecl_functions)) + exit(1) + +md = Markdown(out_path, "lt-api-functions") +header = [ + "Type", + "Function", + "Common", + "Weak", + "Family", +] +rows = [] + +for function in ( + sorted(family_functions) + sorted(weak_functions) + sorted(impl_functions) +): + rows.append( + [ + f"`{function_types[function]}`", + f"{function}()", + "✔️" if function in impl_functions else "", + "✔️" if function in weak_functions else "", + "✔️" if function not in common_functions else "", + ] + ) + +md.add_table(header, *rows) +md.write() diff --git a/docs/scripts/write_boards.py b/docs/scripts/write_boards.py new file mode 100644 index 000000000..fa773e168 --- /dev/null +++ b/docs/scripts/write_boards.py @@ -0,0 +1,481 @@ +# Copyright (c) Kuba Szczodrzyński 2022-05-31. + +import os +import sys + +while os.getcwd() in sys.path: + sys.path.remove(os.getcwd()) + +import re +from os.path import dirname, isfile, join + +import colorama +from colorama import Fore, Style +from ltchiptool import Board, Family +from ltchiptool.util.fileio import readjson, readtext +from ltchiptool.util.misc import sizeof +from markdown import Markdown + +OUTPUT = join(dirname(__file__), "..", "status") + + +def load_chip_type_h() -> str: + code = readtext( + join( + dirname(__file__), + "..", + "..", + "cores", + "common", + "base", + "lt_types.h", + ) + ) + code = re.sub(r"//.+", "", code) + code = re.sub(r"/\*.+\*/", "", code) + return code + + +def parse_enum(code: str, name: str) -> dict[str, str]: + code = code.replace("\t", " ") + code = code.partition(f"{name};")[0] + code = code.rpartition("{")[2] + code = code.strip().strip("{}").strip() + code = [line.strip().strip(",").strip() for line in code.split("\n")] + code = filter(None, code) + code = [line.partition("=") for line in code] + code = {key.strip(): value.strip() for key, _, value in code} + return code + + +def get_families_json() -> dict[str, int]: + return { + family.short_name: family.id for family in Family.get_all() if family.is_chip + } + + +def get_mcus_boards(boards: list[Board], aliases: dict[str, str]) -> dict[str, str]: + out = {} + + def check_mcu(mcu_name, family_name): + if mcu_name in out and out[mcu_name] != family_name: + print( + Fore.RED + + f"ERROR: MCU '{mcu_name}' of board '{board.name}' belongs to multiple families: '{out[mcu_name]}' and '{family_name}'" + + Style.RESET_ALL, + file=sys.stderr, + ) + out[mcu_name] = family_name + + for board in boards: + mcu_name: str = board["build.mcu"].upper() + mcu_alias: str = board["doc.mcu"] + family_name: str = board.family.short_name + check_mcu(mcu_name, family_name) + if mcu_alias: + mcu_alias = mcu_alias.upper() + check_mcu(mcu_alias, family_name) + if mcu_alias not in aliases: + print( + Fore.RED + + f"ERROR: MCU alias '{mcu_alias}' of board '{board.name}' is not defined in enum" + + Style.RESET_ALL, + file=sys.stderr, + ) + elif aliases[mcu_alias] != mcu_name: + print( + Fore.RED + + f"ERROR: MCU alias '{mcu_alias}' of board '{board.name}' doesn't match real name '{mcu_name}'" + + Style.RESET_ALL, + file=sys.stderr, + ) + return out + + +def get_families_enum(code: str) -> dict[str, int]: + return { + family[2:]: int(family_id, 16) + for family, family_id in parse_enum(code, "lt_cpu_family_t").items() + } + + +def get_mcus_enum(code: str) -> tuple[dict[str, str], dict[str, str]]: + mcus = {} + aliases = {} + enum = parse_enum(code, "lt_cpu_model_t") + for mcu, mcu_id in enum.items(): + while mcu_id in enum: + aliases[mcu] = mcu_id + mcu_id = enum[mcu_id] + mcus[mcu] = mcu_id.split("(")[1].split(",")[0][2:] + return mcus, aliases + + +def get_readme_family_link(family: Family) -> str | None: + for f in family.inheritance[::-1]: + path = f"../platform/{f.name}/README.md" + if isfile(join(dirname(__file__), path)): + return path + return None + + +def get_readme_board_link(board: Board) -> str: + return f"../../boards/{board.name}/README.md" + + +def board_json_sort(tpl): + return tpl[1]["mcu"], tpl[0] + + +def board_obj_sort(board: Board): + generic = board.is_generic + vendor = board.vendor + if vendor == "N/A": + vendor = "\xff" + generic = False + return ( + not generic, # reverse + vendor, + board["build.mcu"], + board["mcu"], + board.name, + ) + + +def get_board_symbol(board: Board) -> str: + return board.symbol or board.generic_name or board.name.upper() + + +def write_chips(mcus: dict[str, Family], aliases: dict[str, str]): + md = Markdown(OUTPUT, "supported_chips") + chips = [] + clones = [] + for mcu, family in sorted(mcus.items()): + docs = get_readme_family_link(family) + target = chips + if mcu in aliases: + mcu = f"{mcu} ({aliases[mcu]})" + target = clones + if docs: + target.append(md.get_link(mcu, docs)) + else: + target.append(mcu) + md.add_list(*chips, *clones) + md.write() + + +def write_boards(boards: list[Board]): + md = Markdown(OUTPUT, "supported_boards") + header = [ + "Name", + "MCU", + "Flash", + "RAM", + "Pins*", + "Wi-Fi", + "BLE", + "ZigBee", + "Family name", + ] + rows = [] + + vendor_prev = "" + for board in boards: + # add board vendor as a row + vendor = board["vendor"] + if vendor_prev != vendor: + rows.append([f"**{vendor}**"]) + vendor_prev = vendor + # count total pin count & IO count + pins = "-" + pinout: dict[str, dict] = board["pcb.pinout"] + if pinout: + pinout = [pin for name, pin in pinout.items() if name.isnumeric()] + pins_total = len(pinout) + pins_io = sum(1 for pin in pinout if "ARD" in pin) + pins = f"{pins_total} ({pins_io} I/O)" + # format row values + symbol = get_board_symbol(board) + docs = get_readme_board_link(board) + board_url = f"[{symbol}]({docs})" + row = [ + board_url, + board["build.mcu"].upper(), + sizeof(board["upload.flash_size"]), + sizeof(board["upload.maximum_ram_size"]), + pins, + "✔️" if "wifi" in board["connectivity"] else "❌", + "✔️" if "ble" in board["connectivity"] else "❌", + "✔️" if "zigbee" in board["connectivity"] else "❌", + f"`{board.family.name}`", + ] + rows.append(row) + md.add_table(header, *rows) + md.write() + + +def write_unsupported_boards( + series: dict[str, dict[str, dict]], + name: str, + supported: list[str], + mcus: dict[str, Family], + generics: dict[str, list[Board]], +): + md = Markdown(OUTPUT, name) + header = [ + "Name", + "MCU", + "Flash", + "RAM", + "Pins", + "Wi-Fi", + "BLE", + "ZigBee", + ] + rows = [] + for series_name in sorted(series): + series_rows = [] + series_rows.append([f"**{series_name.upper()} Series**"]) + boards = series[series_name] + for board_name, board in sorted(boards.items(), key=board_json_sort): + if board_name in supported: + continue + board_text = board_name.upper() + mcu_text = mcu = board["mcu"].upper() + if mcu in generics: + generic = generics[mcu][0] + board_text += f' :material-information-outline:{{ title="You can use {generic.name} board instead" }}' + if mcu in mcus: + docs = get_readme_family_link(mcus[mcu]) + if docs: + mcu_text = md.get_link(mcu, docs) + row = [ + board_text, + mcu_text, + sizeof(board["flash"]) if board["flash"] else "?", + sizeof(board["ram"]) if board["ram"] else "?", + str(board["pins_total"]), + "✔️" if "wifi" in board["connectivity"] else "❌", + "✔️" if "ble" in board["connectivity"] else "❌", + "✔️" if "zigbee" in board["connectivity"] else "❌", + ] + series_rows.append(row) + if series_rows: + rows += series_rows + md.add_table(header, *rows) + md.write() + + +def write_families(supported: list[Family]): + md = Markdown(OUTPUT, "supported_families") + header = [ + "Title", + "Name", + "Code", + "Short name & ID", + "Supported?", + "Source SDK", + ] + rows = [] + + for family in Family.get_all(): + # TODO update the table to support parent-child relationship + if not family.is_chip: + continue + docs = get_readme_family_link(family) + row = [ + # Title + ( + "[{}]({})".format( + family.description, + docs, + ) + if docs + else family.description + ), + # Name + family.is_supported and f"`{family.name}`" or "`-`", + # Code + family.is_supported and f"`{family.code}`" or "`-`", + # Short name & ID + "`{}` (0x{:X})".format( + family.short_name, + family.id, + ), + # Arduino Core + ( + "✔️" + if family in supported + and family.is_supported + and family.has_arduino_core + else "❌" + ), + # Source SDK + ( + "[`{}`]({})".format( + family.target_package, + f"https://github.com/libretiny-eu/{family.target_package}", + ) + if family.target_package + else "-" + ), + ] + rows.append(row) + md.add_table(header, *rows) + md.write() + + +def write_boards_list(boards: list[Board]): + md = Markdown(join(dirname(__file__), ".."), join("..", "boards", "SUMMARY")) + items = [] + for board in boards: + symbol = get_board_symbol(board) + if board.is_generic: + symbol = board["name"] + items.append(f"[{symbol}](../boards/{board.name}/README.md)") + md.add_list(*items) + md.write() + + +if __name__ == "__main__": + colorama.init() + + boards = map(Board, Board.get_list()) + boards = sorted(boards, key=board_obj_sort) + code = load_chip_type_h() + + errors = False + + for board in boards: + if board.name != board["source"]: + print( + Fore.RED + + f"ERROR: Invalid build.variant of '{board['source']}': '{board.name}'" + + Style.RESET_ALL, + file=sys.stderr, + ) + errors = True + + families_json = get_families_json() + families_enum = get_families_enum(code) + families_json_keys = set(families_json.keys()) + families_enum_keys = set(families_enum.keys()) + mcus_enum, mcu_aliases = get_mcus_enum(code) + mcus_boards = get_mcus_boards(boards, mcu_aliases) + mcus_boards_keys = set(mcus_boards.keys()) + mcus_enum_keys = set(mcus_enum.keys()) + mcus_missing_in_boards = mcus_enum_keys - mcus_boards_keys + mcus_missing_in_enum = mcus_boards_keys - mcus_enum_keys + + # check if all families are defined in lt_types.h and families.json + if families_json_keys != families_enum_keys: + print( + Fore.RED + f"ERROR: Inconsistent lt_types.h vs families.json:", + file=sys.stderr, + ) + print( + "- Missing in JSON: " + ", ".join(families_enum_keys - families_json_keys), + file=sys.stderr, + ) + print( + "- Missing in enum: " + ", ".join(families_json_keys - families_enum_keys), + file=sys.stderr, + ) + print(Style.RESET_ALL, end="", file=sys.stderr) + errors = True + + # verify that family IDs match + for family in families_json_keys.union(families_enum_keys): + if ( + family in families_json + and family in families_enum + and families_json[family] != families_enum[family] + ): + print( + Fore.RED + + f"ERROR: Family ID mismatch for '{family}': 0x{families_json[family]:08X} vs 0x{families_enum[family]:08X}" + + Style.RESET_ALL, + file=sys.stderr, + ) + errors = True + + # warn if any enum MCUs are unused in boards + if mcus_missing_in_boards: + print( + Fore.YELLOW + + f"NOTICE: Unused MCUs: " + + ", ".join(mcus_missing_in_boards) + + Style.RESET_ALL + ) + + # fail if any board MCUs are undefined in enum + if mcus_missing_in_enum: + print( + Fore.RED + + f"ERROR: Undefined MCUs in lt_types.h: " + + ", ".join(mcus_missing_in_enum) + + Style.RESET_ALL, + file=sys.stderr, + ) + errors = True + + # check if all MCUs belong to the correct family + for mcu in mcus_boards_keys.union(mcus_enum_keys): + if ( + mcu in mcus_boards + and mcu in mcus_enum + and mcus_boards[mcu] != mcus_enum[mcu] + ): + print( + Fore.RED + + f"ERROR: MCU family mismatch for '{mcu}': '{mcus_boards[mcu]}' vs '{mcus_enum[mcu]}'" + + Style.RESET_ALL, + file=sys.stderr, + ) + errors = True + + if errors: + exit(1) + + # check all supported families by MCU presence in enum + families_supported = sorted(families_enum_keys.intersection(mcus_enum.values())) + families_supported = [Family.get(f) for f in families_supported] + # filter out MCUs of unsupported families + mcus_boards.update(mcus_enum) + mcus_all = {} + for mcu, family in mcus_boards.items(): + family = Family.get(family) + if family not in families_supported: + continue + mcus_all[mcu] = family + # remove boards of unsupported families + boards = [board for board in boards if board.family in families_supported] + + # find generic variants of boards + generics: dict[str, list[Board]] = {} + for board in boards: + if not board.is_generic: + continue + mcu: str = board["build.mcu"].upper() + if mcu not in generics: + generics[mcu] = [] + generics[mcu].append(board) + + write_chips(mcus_all, mcu_aliases) + write_boards(boards) + write_boards_list(boards) + write_families(families_supported) + + board_lists = [ + "boards_tuya_all", + ] + for name in board_lists: + file = join(dirname(__file__), "..", f"{name}.json") + data = readjson(file) + write_unsupported_boards( + series=data, + name=f"unsupported_{name}", + supported=[board.name for board in boards], + mcus=mcus_all, + generics=generics, + ) diff --git a/docs/status/supported/index.html b/docs/status/supported/index.html new file mode 100644 index 000000000..03f29cee3 --- /dev/null +++ b/docs/status/supported/index.html @@ -0,0 +1,3737 @@ + + + + + + + + + + + + + + + + + + + + + + + + 💻 Chips, boards, features - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Supported boards, modules and CPUs

+

Board list

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameMCUFlashRAMPins*Wi-FiBLEZigBeeFamily name
Generic
BK7231N (Tuya QFN32)BK7231N2 MiB256 KiB19 (19 I/O)✔️✔️beken-7231n
BK7231T (Tuya QFN32)BK7231T2 MiB256 KiB19 (19 I/O)✔️✔️beken-7231t
BK7252BK72524 MiB512 KiB38 (38 I/O)✔️✔️beken-7251
RTL8710BN (2M/468k)RTL8710BN2 MiB256 KiB18 (18 I/O)✔️realtek-ambz
RTL8710BN (2M/788k)RTL8710BN2 MiB256 KiB18 (18 I/O)✔️realtek-ambz
RTL8710BX (4M/980k)RTL8710BX4 MiB256 KiB17 (17 I/O)✔️realtek-ambz
RTL8720CF (2M/992k)RTL8720CF2 MiB256 KiB20 (20 I/O)✔️✔️realtek-ambz2
Ai-Thinker Co., Ltd.
BW12RTL8710BX2 MiB256 KiB16 (12 I/O)✔️realtek-ambz
BW15RTL8720CF2 MiB256 KiB16 (13 I/O)✔️✔️realtek-ambz2
Tuya Inc.
CB1SBK7231N2 MiB256 KiB18 (11 I/O)✔️✔️beken-7231n
CB2LBK7231N2 MiB256 KiB7 (5 I/O)✔️✔️beken-7231n
CB2SBK7231N2 MiB256 KiB11 (8 I/O)✔️✔️beken-7231n
CB3LBK7231N2 MiB256 KiB16 (12 I/O)✔️✔️beken-7231n
CB3SBK7231N2 MiB256 KiB22 (16 I/O)✔️✔️beken-7231n
CB3SEBK7231N2 MiB256 KiB22 (17 I/O)✔️✔️beken-7231n
CBLC5BK7231N2 MiB256 KiB6 (3 I/O)✔️✔️beken-7231n
CBUBK7231N2 MiB256 KiB21 (18 I/O)✔️✔️beken-7231n
WB2L-M1BK7231N2 MiB256 KiB7 (5 I/O)✔️✔️beken-7231n
WA2BK7231Q2 MiB256 KiB11 (8 I/O)✔️beken-7231q
WB1SBK7231T2 MiB256 KiB22 (12 I/O)✔️✔️beken-7231t
WB2LBK7231T2 MiB256 KiB7 (5 I/O)✔️✔️beken-7231t
WB2SBK7231T2 MiB256 KiB11 (8 I/O)✔️✔️beken-7231t
WB3LBK7231T2 MiB256 KiB21 (17 I/O)✔️✔️beken-7231t
WB3SBK7231T2 MiB256 KiB22 (16 I/O)✔️✔️beken-7231t
WBLC5BK7231T2 MiB256 KiB6 (3 I/O)✔️✔️beken-7231t
WR1RTL8710BN2 MiB256 KiB18 (11 I/O)✔️realtek-ambz
WR1ERTL8710BN2 MiB256 KiB18 (11 I/O)✔️realtek-ambz
WR2RTL8710BN2 MiB256 KiB11 (8 I/O)✔️realtek-ambz
WR2ERTL8710BN2 MiB256 KiB11 (8 I/O)✔️realtek-ambz
WR3RTL8710BN2 MiB256 KiB16 (12 I/O)✔️realtek-ambz
WR3ERTL8710BN2 MiB256 KiB16 (12 I/O)✔️realtek-ambz
WR3NRTL8710BN2 MiB256 KiB16 (10 I/O)✔️realtek-ambz
WR2LRTL8710BX2 MiB256 KiB7 (5 I/O)✔️realtek-ambz
WR2LERTL8710BX2 MiB256 KiB7 (5 I/O)✔️realtek-ambz
WR3LRTL8710BX2 MiB256 KiB16 (12 I/O)✔️realtek-ambz
WR3LERTL8710BX2 MiB256 KiB16 (12 I/O)✔️realtek-ambz
Unknown
LSC LMA35 NBK7231N2 MiB256 KiB22 (15 I/O)✔️✔️beken-7231n
LSC LMA35 TBK7231T2 MiB256 KiB22 (15 I/O)✔️✔️beken-7231t
T102-V1.1RTL8710BN2 MiB256 KiB11 (9 I/O)✔️realtek-ambz
T112-V1.1RTL8710BN2 MiB256 KiB14 (11 I/O)✔️realtek-ambz
T103-V1.0RTL8710BX2 MiB256 KiB16 (12 I/O)✔️realtek-ambz
+ + +

* I/O count includes GPIOs, ADCs, PWM outputs and UART, but doesn't count CEN/RST and power pins.

+

CPU list

+

Chips currently supported by the project:

+ + + + + + +

This list is not exhaustive, i.e. a similar chip (but different package) might work just fine, but there's no board definition for it yet. +If you have an unsupported chip, feel free to reach out using Issues or on the Discord server.

+

Families

+

A list of chip families currently supported by this project.

+
+

Note

+

The term family was chosen over platform, in order to reduce possible confusion between LibreTiny supported "platforms" and PlatformIO's "platform", as an entire package. Family is also more compatible with the UF2 term.

+
+

The following list corresponds to UF2 OTA format family names, and is also available as JSON. The IDs are also present in lt_types.h. You can view the family list by using ltchiptool list families.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TitleNameCodeShort name & IDSupported?Source SDK
Realtek Ameba1--RTL8710A (0x9FFFD543)-
Realtek AmebaZrealtek-ambzambzRTL8710B (0x22E0D6FC)✔️framework-realtek-amb1
Realtek AmebaZ2realtek-ambz2ambz2RTL8720C (0xE08F7564)✔️framework-realtek-ambz2
Realtek AmebaD--RTL8720D (0x3379CFE2)-
Beken 7231Qbeken-7231qbk7231qBK7231Q (0xAFE81D49)✔️framework-beken-bdk
Beken 7231Tbeken-7231tbk7231tBK7231T (0x675A40B0)✔️framework-beken-bdk
Beken 7231Nbeken-7231nbk7231nBK7231N (0x7B3EF230)✔️framework-beken-bdk
Beken 7251/7252beken-7251bk7251BK7251 (0x6A82CC42)✔️framework-beken-bdk
Boufallo BL602/BL604--BL60X (0xDE1270B7)-
+ + +

Feature support

+

If you notice a feature that you've tested, which works (or not) and doesn't match this table, feel free to submit an issue on GitHub.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 BK7231TBK7231NRTL8710BRTL8720CBK7231Q
Stability5/55/54/52/51/5
LibreTiny Core✔️✔️✔️✔️✔️
Wiring Core✔️✔️✔️✔️✔️
PERIPHERALS (Core)
UART I/O✔️✔️✔️✔️✔️
Flash I/O✔️✔️✔️
Deep sleep✔️
Watchdog timer✔️✔️✔️
PERIPHERALS (Wiring)
Digital I/O✔️✔️✔️
PWM✔️✔️✔️
Interrupts✔️✔️✔️
Analog input (ADC)✔️✔️✔️
Wire (I²C)
SPI
Serial✔️✔️✔️✔️
SoftwareSerial✔️
NETWORKING
Wi-Fi STA/AP/Mixed✔️✔️✔️
Wi-Fi Events✔️✔️✔️
OTA updates✔️✔️✔️
MDNS✔️✔️✔️
+

Symbols:

+
    +
  • ✔️ working
  • +
  • ❓ untested
  • +
  • ❗ broken
  • +
  • ❌ not implemented (yet?)
  • +
  • - not applicable
  • +
+

Unsupported boards

+

Tuya Inc.

+
+

Note

+

Only modules featuring at least Wi-Fi are included in the table. (TY)JW, (TY)WE and (TY)LC Series are omitted, as they contain Espressif chips.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameMCUFlashRAMPinsWi-FiBLEZigBee
AXY Series
AXY2SECR66002 MiB512 KiB11✔️✔️
AXY3LECR66002 MiB512 KiB18✔️✔️
AXY3SECR66002 MiB512 KiB22✔️✔️
AXYUECR66002 MiB512 KiB21✔️✔️
CB Series
CB8P BK7231N2 MiB256 KiB10✔️✔️
CBLC9 BK7231N2 MiB256 KiB8✔️✔️
CR Series
CR2SRTL8720CM4 MiB4 MiB11✔️✔️
CR3LRTL8720CM4 MiB4 MiB18✔️✔️
CRG1RTL8720CM4 MiB4 MiB25✔️✔️
T1 Series
T1-2ST1A1 MiB288 KiB11✔️✔️
T2 Series
T2-U BK7231N2 MiB256 KiB21✔️✔️
TCS905 Series
TCS905-3S BK7231N2 MiB256 KiB22✔️✔️
TCS905-U BK7231N2 MiB256 KiB21✔️✔️
WB Series
WB8P BK7231T2 MiB256 KiB10✔️✔️
WBLC9 BK7231T2 MiB256 KiB8✔️✔️
WBR Series
WBR1 RTL8720CF2 MiB256 KiB18✔️✔️
WBR2 RTL8720CF2 MiB256 KiB11✔️✔️
WBR2L RTL8720CF2 MiB256 KiB7✔️✔️
WBR3 RTL8720CF2 MiB256 KiB16✔️✔️
WBR3L RTL8720CF2 MiB256 KiB18✔️✔️
WBR3S RTL8720CF2 MiB256 KiB22✔️✔️
WBRU RTL8720CF2 MiB256 KiB21✔️✔️
WBR3NRTL8720CS4 MiB512 KiB16✔️✔️
WBRG1RTL8720CSM8 MiB4 MiB25✔️✔️
WBR1DRTL8720DN4 MiB512 KiB18✔️✔️
WBR2DRTL8720DN4 MiB512 KiB11✔️✔️
WBR3DRTL8720DN4 MiB512 KiB16✔️✔️
WBR3TRTL8720DN4 MiB512 KiB16✔️✔️
WL Series
WL2H-ULN882H?296 KiB21✔️✔️
WR Series
WR4 RTL8710BN1 MiB256 KiB16✔️
WR5E RTL8710BN2 MiB256 KiB15✔️
WR6 RTL8710BN2 MiB256 KiB14✔️
WR6-H RTL8710BN2 MiB256 KiB14✔️
WRG1RTL8711AM4 MiB2 MiB25✔️
WT Series
WT3 BK7231N2 MiB256 KiB16✔️✔️
WX Series
WXUT103C-HL2 MiB320 KiB21✔️✔️
XR Series
XR1XR8092 MiB384 KiB18✔️
XR3XR8092 MiB384 KiB16✔️
+ + + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/status/supported_boards/index.html b/docs/status/supported_boards/index.html new file mode 100644 index 000000000..0dba270c1 --- /dev/null +++ b/docs/status/supported_boards/index.html @@ -0,0 +1,2797 @@ + + + + + + + + + + + + + + + + + + + + Supported boards - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameMCUFlashRAMPins*Wi-FiBLEZigBeeFamily name
Generic
BK7231N (Tuya QFN32)BK7231N2 MiB256 KiB19 (19 I/O)✔️✔️beken-7231n
BK7231T (Tuya QFN32)BK7231T2 MiB256 KiB19 (19 I/O)✔️✔️beken-7231t
BK7252BK72524 MiB512 KiB38 (38 I/O)✔️✔️beken-7251
RTL8710BN (2M/468k)RTL8710BN2 MiB256 KiB18 (18 I/O)✔️realtek-ambz
RTL8710BN (2M/788k)RTL8710BN2 MiB256 KiB18 (18 I/O)✔️realtek-ambz
RTL8710BX (4M/980k)RTL8710BX4 MiB256 KiB17 (17 I/O)✔️realtek-ambz
RTL8720CF (2M/992k)RTL8720CF2 MiB256 KiB20 (20 I/O)✔️✔️realtek-ambz2
Ai-Thinker Co., Ltd.
BW12RTL8710BX2 MiB256 KiB16 (12 I/O)✔️realtek-ambz
BW15RTL8720CF2 MiB256 KiB16 (13 I/O)✔️✔️realtek-ambz2
Tuya Inc.
CB1SBK7231N2 MiB256 KiB18 (11 I/O)✔️✔️beken-7231n
CB2LBK7231N2 MiB256 KiB7 (5 I/O)✔️✔️beken-7231n
CB2SBK7231N2 MiB256 KiB11 (8 I/O)✔️✔️beken-7231n
CB3LBK7231N2 MiB256 KiB16 (12 I/O)✔️✔️beken-7231n
CB3SBK7231N2 MiB256 KiB22 (16 I/O)✔️✔️beken-7231n
CB3SEBK7231N2 MiB256 KiB22 (17 I/O)✔️✔️beken-7231n
CBLC5BK7231N2 MiB256 KiB6 (3 I/O)✔️✔️beken-7231n
CBUBK7231N2 MiB256 KiB21 (18 I/O)✔️✔️beken-7231n
WB2L-M1BK7231N2 MiB256 KiB7 (5 I/O)✔️✔️beken-7231n
WA2BK7231Q2 MiB256 KiB11 (8 I/O)✔️beken-7231q
WB1SBK7231T2 MiB256 KiB22 (12 I/O)✔️✔️beken-7231t
WB2LBK7231T2 MiB256 KiB7 (5 I/O)✔️✔️beken-7231t
WB2SBK7231T2 MiB256 KiB11 (8 I/O)✔️✔️beken-7231t
WB3LBK7231T2 MiB256 KiB21 (17 I/O)✔️✔️beken-7231t
WB3SBK7231T2 MiB256 KiB22 (16 I/O)✔️✔️beken-7231t
WBLC5BK7231T2 MiB256 KiB6 (3 I/O)✔️✔️beken-7231t
WR1RTL8710BN2 MiB256 KiB18 (11 I/O)✔️realtek-ambz
WR1ERTL8710BN2 MiB256 KiB18 (11 I/O)✔️realtek-ambz
WR2RTL8710BN2 MiB256 KiB11 (8 I/O)✔️realtek-ambz
WR2ERTL8710BN2 MiB256 KiB11 (8 I/O)✔️realtek-ambz
WR3RTL8710BN2 MiB256 KiB16 (12 I/O)✔️realtek-ambz
WR3ERTL8710BN2 MiB256 KiB16 (12 I/O)✔️realtek-ambz
WR3NRTL8710BN2 MiB256 KiB16 (10 I/O)✔️realtek-ambz
WR2LRTL8710BX2 MiB256 KiB7 (5 I/O)✔️realtek-ambz
WR2LERTL8710BX2 MiB256 KiB7 (5 I/O)✔️realtek-ambz
WR3LRTL8710BX2 MiB256 KiB16 (12 I/O)✔️realtek-ambz
WR3LERTL8710BX2 MiB256 KiB16 (12 I/O)✔️realtek-ambz
Unknown
LSC LMA35 NBK7231N2 MiB256 KiB22 (15 I/O)✔️✔️beken-7231n
LSC LMA35 TBK7231T2 MiB256 KiB22 (15 I/O)✔️✔️beken-7231t
T102-V1.1RTL8710BN2 MiB256 KiB11 (9 I/O)✔️realtek-ambz
T112-V1.1RTL8710BN2 MiB256 KiB14 (11 I/O)✔️realtek-ambz
T103-V1.0RTL8710BX2 MiB256 KiB16 (12 I/O)✔️realtek-ambz
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/status/supported_chips/index.html b/docs/status/supported_chips/index.html new file mode 100644 index 000000000..1070b923c --- /dev/null +++ b/docs/status/supported_chips/index.html @@ -0,0 +1,2307 @@ + + + + + + + + + + + + + + + + + + + + Supported chips - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + + + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/status/supported_families/index.html b/docs/status/supported_families/index.html new file mode 100644 index 000000000..6e8b59082 --- /dev/null +++ b/docs/status/supported_families/index.html @@ -0,0 +1,2371 @@ + + + + + + + + + + + + + + + + + + + + Supported families - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TitleNameCodeShort name & IDSupported?Source SDK
Realtek Ameba1--RTL8710A (0x9FFFD543)-
Realtek AmebaZrealtek-ambzambzRTL8710B (0x22E0D6FC)✔️framework-realtek-amb1
Realtek AmebaZ2realtek-ambz2ambz2RTL8720C (0xE08F7564)✔️framework-realtek-ambz2
Realtek AmebaD--RTL8720D (0x3379CFE2)-
Beken 7231Qbeken-7231qbk7231qBK7231Q (0xAFE81D49)✔️framework-beken-bdk
Beken 7231Tbeken-7231tbk7231tBK7231T (0x675A40B0)✔️framework-beken-bdk
Beken 7231Nbeken-7231nbk7231nBK7231N (0x7B3EF230)✔️framework-beken-bdk
Beken 7251/7252beken-7251bk7251BK7251 (0x6A82CC42)✔️framework-beken-bdk
Boufallo BL602/BL604--BL60X (0xDE1270B7)-
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/status/unsupported_boards_tuya_all/index.html b/docs/status/unsupported_boards_tuya_all/index.html new file mode 100644 index 000000000..74163ee32 --- /dev/null +++ b/docs/status/unsupported_boards_tuya_all/index.html @@ -0,0 +1,2811 @@ + + + + + + + + + + + + + + + + + + + + Unsupported boards tuya all - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameMCUFlashRAMPinsWi-FiBLEZigBee
AXY Series
AXY2SECR66002 MiB512 KiB11✔️✔️
AXY3LECR66002 MiB512 KiB18✔️✔️
AXY3SECR66002 MiB512 KiB22✔️✔️
AXYUECR66002 MiB512 KiB21✔️✔️
CB Series
CB8P BK7231N2 MiB256 KiB10✔️✔️
CBLC9 BK7231N2 MiB256 KiB8✔️✔️
CR Series
CR2SRTL8720CM4 MiB4 MiB11✔️✔️
CR3LRTL8720CM4 MiB4 MiB18✔️✔️
CRG1RTL8720CM4 MiB4 MiB25✔️✔️
T1 Series
T1-2ST1A1 MiB288 KiB11✔️✔️
T2 Series
T2-U BK7231N2 MiB256 KiB21✔️✔️
TCS905 Series
TCS905-3S BK7231N2 MiB256 KiB22✔️✔️
TCS905-U BK7231N2 MiB256 KiB21✔️✔️
WB Series
WB8P BK7231T2 MiB256 KiB10✔️✔️
WBLC9 BK7231T2 MiB256 KiB8✔️✔️
WBR Series
WBR1 RTL8720CF2 MiB256 KiB18✔️✔️
WBR2 RTL8720CF2 MiB256 KiB11✔️✔️
WBR2L RTL8720CF2 MiB256 KiB7✔️✔️
WBR3 RTL8720CF2 MiB256 KiB16✔️✔️
WBR3L RTL8720CF2 MiB256 KiB18✔️✔️
WBR3S RTL8720CF2 MiB256 KiB22✔️✔️
WBRU RTL8720CF2 MiB256 KiB21✔️✔️
WBR3NRTL8720CS4 MiB512 KiB16✔️✔️
WBRG1RTL8720CSM8 MiB4 MiB25✔️✔️
WBR1DRTL8720DN4 MiB512 KiB18✔️✔️
WBR2DRTL8720DN4 MiB512 KiB11✔️✔️
WBR3DRTL8720DN4 MiB512 KiB16✔️✔️
WBR3TRTL8720DN4 MiB512 KiB16✔️✔️
WL Series
WL2H-ULN882H?296 KiB21✔️✔️
WR Series
WR4 RTL8710BN1 MiB256 KiB16✔️
WR5E RTL8710BN2 MiB256 KiB15✔️
WR6 RTL8710BN2 MiB256 KiB14✔️
WR6-H RTL8710BN2 MiB256 KiB14✔️
WRG1RTL8711AM4 MiB2 MiB25✔️
WT Series
WT3 BK7231N2 MiB256 KiB16✔️✔️
WX Series
WXUT103C-HL2 MiB320 KiB21✔️✔️
XR Series
XR1XR8092 MiB384 KiB18✔️
XR3XR8092 MiB384 KiB16✔️
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/docs/style.css b/docs/style.css new file mode 100644 index 000000000..c21e408dd --- /dev/null +++ b/docs/style.css @@ -0,0 +1,32 @@ +/* from https://christianoliff.com/blog/styling-external-links-with-an-icon-in-css/ */ +article a[href^="http"]::after, +article a[href^="https://"]::after { + content: ""; + width: 14px; + height: 14px; + margin-left: 4px; + background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3m-2 16H5V5h7V3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7h-2v7Z'%3E%3C/path%3E%3C/svg%3E"); + background-position: center; + background-repeat: no-repeat; + background-size: contain; + display: inline-block; +} + +a[href^="https://docs.libretiny.eu"]::after, +a[href^="http://localhost"]::after, +a[href^="https://"].md-button::after, +div[align="center"] a[href^="https://"]::after { + display: none !important; +} + +/* ugly but it works ¯\_(ツ)_/¯ */ +a[href="SUMMARY/"], +a[href="../SUMMARY/"], +a[href="../../SUMMARY/"], +a[href="../../../SUMMARY/"], +a[href="../../../../SUMMARY/"], +a[href="../../../../../SUMMARY/"] +{ + height: 8px; + pointer-events: none; +} diff --git a/examples/PinScan/index.html b/examples/PinScan/index.html new file mode 100644 index 000000000..3782a0398 --- /dev/null +++ b/examples/PinScan/index.html @@ -0,0 +1,2578 @@ + + + + + + + + + + + + + + + + + + + + + + + + PinScan - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+ +
+ + + +
+
+ + + + + + + + +

PinScan

+

This example allows to quickly check all digital/analog pins of an IoT device.

+

By using a simple TUI (text user interface), you can check which I/O pins correspond to i.e. button presses, as well as write to one of the pins to see which LED lights up.

+
+

Warning

+

Messing with pins in a device can potentially damage some parts of it. Be careful when writing voltages to digital and PWM pins.

+
+

Uploading the example and opening up a terminal (e.g. PuTTY) presents this menu: +

LibreTiny v0.8.0, PinScan v1.0
+Board: cb2s
+I/O count: 11
+Digital I/O count: 11
+Analog input count: 1
+-------- UART2 --------
+Commands:
+        d - Check digital pins
+        a - Check analog pins
+        s - Select UART port
+        t - Toggle ANSI control codes
+        r - Reboot (for uploading)
+        q - Go back to menu, at any time
+        ? - Print help text, also for subcommands
+

+

The interface expects one-letter commands, without confirmation by Enter. The only part which expects an Enter keypress is inputting pin numbers and UART port numbers.

+

Pressing q at any time goes back to the main menu, terminating the current process.

+
+

Note

+

PinScan works best with a terminal supporting ANSI escape codes (PuTTY does), but this behavior can be disabled using t.

+
+

Switching to another UART port is possible (for example if the default port is on the pins you want to check) using s command. Do not change the port after using any I/O commands, as it won't work; reboot it using r before.

+

By setting USE_WIFI in main.h to 1, a Telnet server is enabled on port 23. This allows to test I/O pins without having physical, wired access to the device (i.e. using OTA). Make sure to specify correct WiFi credentials.

+
+

Tip

+

If your board isn't supported by LT yet, use one of the generic boards.

+

If your board doesn't even have a known pinout, use d/s commands of PinScan to ease the mapping of all board pins.

+
+

Digital pins

+
Digital I/O
+-------- UART2 --------
+Commands:
+        r - Realtime readout of all pins
+        o - Read one pin continuously
+        s - Manual Scan - toggle each pin
+        h - Write HIGH to a pin
+        l - Write LOW to a pin
+        p - Output using pull up/down (default)
+        w - Output using write low/high (less safe)
+
+

Realtime readout of all pins

+
 D0  D1  D2  D3  D4  D5  D6  D7  D8  D9 D10
+ LO  LO  HI  HI  HI  HI  LO  LO  --  --  LO
+
+

Screen contents will update when voltage on one of the pins changes. Pins marked with -- mean the currently used UART port (which can be changed using s command; after reboot).

+
+

TL;DR

+

Try pressing a button to see which pin changes.

+
+

Read one pin continuously

+

Enter the pin number, it will be probed until you press q.

+

Manual Scan - toggle each pin

+
 D0  D1  D2  D3  D4  D5  D6  D7  D8  D9 D10
+ HI  LO  LO  LO  LO  LO  LO  LO  --  --  LO
+
+

A pin will be toggled every 500ms, starting with D0. Type n to move to the next pin.

+
+

TL;DR

+

Go through the pins to see which lights up an LED.

+
+

Write HIGH/LOW to a pin

+

Self-explanatory.

+

Output using pull/write

+

Outputs can be toggled by using internal pull-up/pull-down resistors, or by simply writing a voltage. Writing is more current-efficient, but is also less safe if something else supplies different voltage to the pin.

+

This affects scan and write high/low commands.

+
+

TL;DR

+

Use write output mode (carefully) if there's an LED which doesn't light up with default pull mode.

+
+

Analog pins

+
Analog inputs
+-------- UART2 --------
+Commands:
+        r - Realtime readout of all pins
+        o - Read one pin once
+
+

Realtime readout of all pins

+

Read voltage (in millivolts) on all available analog pins, until q is pressed.

+

Read one pin once

+

No need to explain.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/PinScan/platformio.ini b/examples/PinScan/platformio.ini new file mode 100644 index 000000000..c1220b197 --- /dev/null +++ b/examples/PinScan/platformio.ini @@ -0,0 +1,12 @@ +[env] +platform = libretiny +framework = arduino + +[env:bk7231n] +board = generic-bk7231n-qfn32-tuya + +[env:bk7231t] +board = generic-bk7231t-qfn32-tuya + +[env:rtl8710b] +board = generic-rtl8710bn-2mb-788k diff --git a/examples/PinScan/src/analog.cpp b/examples/PinScan/src/analog.cpp new file mode 100644 index 000000000..1b4c9b81b --- /dev/null +++ b/examples/PinScan/src/analog.cpp @@ -0,0 +1,70 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-07-31. */ + +#include "pinscan.h" + +static unsigned long last = 0; + +static void readAnalog(uint8_t number, pin_size_t pin) { + stream->write("A"); + stream->write('0' + number); + stream->print(": "); + stream->print(analogReadVoltage(pin)); + stream->print(" mV\t"); +} + +void runAnalog() { + if (mode[1] == '\0') + return; + int pin = 0; + switch (mode[1]) { + case '?': + printHelp('a'); + break; + + case 'r': + if (millis() - last < DELAY_READ) + return; + last = millis(); + printAnsi(ANSI_LINE_START); +#ifdef PIN_A0 + readAnalog(0, PIN_A0); +#endif +#ifdef PIN_A1 + readAnalog(1, PIN_A1); +#endif +#ifdef PIN_A2 + readAnalog(2, PIN_A2); +#endif + if (!ansi) + stream->println(); + return; + + case 'o': + pin = inputPin(); + // clang-format off +#ifdef PIN_A0 + if (pin == 0) { + readAnalog(0, PIN_A0); + } else +#endif +#ifdef PIN_A1 + if (pin == 1) { + readAnalog(0, PIN_A0); + } else +#endif +#ifdef PIN_A2 + if (pin == 2) { + readAnalog(2, PIN_A2); + } else +#endif + // clang-format on + { + stream->print("Pin unavailable"); + } + stream->println(); + mode[1] = '?'; + ansiSkipErase = true; + return; + } + mode[1] = '\0'; +} diff --git a/examples/PinScan/src/digital.cpp b/examples/PinScan/src/digital.cpp new file mode 100644 index 000000000..653518e41 --- /dev/null +++ b/examples/PinScan/src/digital.cpp @@ -0,0 +1,210 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-07-31. */ + +#include "pinscan.h" + +#define PULL 0 +#define WRITE 1 + +static bool pins[NUM_DIGITAL_PINS] = {}; +static bool used[NUM_DIGITAL_PINS] = {}; +static bool active = false; +static int pin = -1; + +static unsigned long last = 0; +static bool outputMode = PULL; + +static void printPin(bool state) { + if (ansi) { + stream->print(state ? (ANSI_RED "HI" ANSI_RESET) : (ANSI_BLUE "LO" ANSI_RESET)); + } else { + stream->print(state ? "HI" : "LO"); + } +} + +static void printState() { + printAnsi(ANSI_TWO_LINES); + printAnsi(ANSI_ERASE_LINE); + for (pin_size_t i = 0; i < NUM_DIGITAL_PINS; i++) { + if (i < 10) + stream->write(' '); + stream->write('D'); + stream->print(i); + stream->write(' '); + } + stream->println(); + printAnsi(ANSI_ERASE_LINE); + for (pin_size_t i = 0; i < NUM_DIGITAL_PINS; i++) { + stream->write(' '); + if (used[i]) { + printPin(pins[i]); + } else { + stream->print("--"); + } + stream->write(' '); + } + stream->println(); +} + +static void irqHandler(void *ptr) { + bool *pin = (bool *)ptr; + pin_size_t i = pin - pins; + pins[i] = digitalRead(i); + // change interrupt level according to current state + PinStatus status = pins[i] ? FALLING : RISING; + attachInterruptParam(i, irqHandler, status, ptr); + printState(); +} + +static void digitalAllIrq() { +#if USE_WIFI + LT_I("Disabling logger"); + lt_log_disable(); + Serial.end(); +#endif + for (pin_size_t i = 0; i < NUM_DIGITAL_PINS; i++) { + if (pinSkip[0] == i || pinSkip[1] == i) { + used[i] = false; + continue; + } + pinMode(i, INPUT); + pins[i] = digitalRead(i); + used[i] = true; + // choose interrupt level according to current state + PinStatus status = pins[i] ? FALLING : RISING; + attachInterruptParam(i, irqHandler, status, pins + i); + } + active = true; +} + +static void digitalOut(pin_size_t pin, PinStatus state) { + if (outputMode == PULL) { + pinMode(pin, state ? INPUT_PULLUP : INPUT_PULLDOWN); + } else { + pinMode(pin, OUTPUT); + digitalWrite(pin, state); + } + pins[pin] = state; +} + +static int digitalAllLow() { + int first = -1; + for (pin_size_t i = 0; i < NUM_DIGITAL_PINS; i++) { + if (pinSkip[0] == i || pinSkip[1] == i) { + used[i] = false; + continue; + } + if (first == -1) + first = i; + digitalOut(i, LOW); + used[i] = true; + } + active = true; + return first; +} + +void digitalDetach() { + outputMode = PULL; + if (!active) + return; + for (pin_size_t i = 0; i < NUM_DIGITAL_PINS; i++) { + if (pinSkip[0] == i || pinSkip[1] == i) { + continue; + } + if (used[i]) + detachInterrupt(i); + used[i] = false; + pinMode(i, INPUT_PULLDOWN); + } + active = false; + pin = -1; +#if USE_WIFI + lt_log_set_port(LT_UART_DEFAULT_LOGGER); + Serial.begin(115200); + LT_I("Logger enabled"); +#endif +} + +void runDigital() { + if (mode[1] == '\0') + return; + switch (mode[1]) { + case '?': + printHelp('d'); + pin = -1; + break; + + case 'p': + outputMode = PULL; + stream->println("Will pull outputs UP/DOWN"); + mode[1] = '?'; + ansiSkipErase = true; + return; + case 'w': + outputMode = WRITE; + stream->println("Will write LOW/HIGH to outputs"); + mode[1] = '?'; + ansiSkipErase = true; + return; + + case 'r': + if (!active) { + digitalAllIrq(); + if (ansi) + printHelp('d'); + printAnsi("\n\n"); // reserve two lines for readouts + printState(); + } + return; + + case 'o': + if (pin == -1) { + pin = inputPin(); + pinMode(pin, INPUT); + } + printAnsi(ANSI_LINE_START); + stream->print("Pin D"); + stream->print(pin); + stream->print(" state: "); + printPin(digitalRead(pin)); + if (!ansi) + stream->println(); + return; + + case 's': + if (pin == -1) { + // choose the first pin + pin = digitalAllLow(); + if (ansi) + printHelp('d'); + printAnsi("\n\n"); // reserve two lines for readouts + printState(); + } + if (mode[2] == 'n') { + // go to next pin; leave the current as LOW + digitalOut(pin, LOW); + do { + if (++pin >= NUM_DIGITAL_PINS) + pin = 0; + } while (used[pin] == false); + printState(); + } + mode[2] = '\0'; + // toggle the pin every 500ms + if (millis() - last < 500) + return; + last = millis(); + digitalOut(pin, (PinStatus)!pins[pin]); + printState(); + return; + + case 'h': + case 'l': + pin = inputPin(); + digitalOut(pin, mode[1] == 'h' ? HIGH : LOW); + stream->println("OK"); + mode[1] = '?'; + ansiSkipErase = true; + return; + } + mode[1] = '\0'; +} diff --git a/examples/PinScan/src/help.cpp b/examples/PinScan/src/help.cpp new file mode 100644 index 000000000..e7e6aa881 --- /dev/null +++ b/examples/PinScan/src/help.cpp @@ -0,0 +1,67 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-07-31. */ + +#include "pinscan.h" + +void printHelp(uint8_t mode) { + printAnsiErase(); + switch (mode) { + case '\0': + stream->setTimeout(10000); + stream->println("LibreTiny v" LT_VERSION_STR ", PinScan v" EXAMPLE_VER); + stream->println("Board: " LT_BOARD_STR); + stream->print("I/O count: "); + stream->println(PINS_COUNT); + stream->print("Digital I/O count: "); + stream->println(NUM_DIGITAL_PINS); + stream->print("Analog input count: "); + stream->println(NUM_ANALOG_INPUTS); + break; + case 'd': + stream->println("Digital I/O"); + break; + case 'a': + stream->println("Analog inputs"); + break; + } + line(); + stream->println("Commands:"); + switch (mode) { + case '\0': + // clang-format off + stream->println( + TAB "d - Check digital pins" EOL + TAB "a - Check analog pins" EOL + // TAB "p - Check PWM outputs" EOL +#if !USE_WIFI + TAB "s - Select UART port" EOL +#endif + TAB "t - Toggle ANSI control codes" EOL + TAB "r - Reboot (for uploading)" EOL + TAB "q - Go back to menu, at any time" EOL + TAB "? - Print help text, also for subcommands" EOL + ); + // clang-format on + break; + case 'd': + // clang-format off + stream->println( + TAB "r - Realtime readout of all pins" EOL + TAB "o - Read one pin continuously" EOL + TAB "s - Manual Scan - toggle each pin" EOL + TAB "h - Write HIGH to a pin" EOL + TAB "l - Write LOW to a pin" EOL + TAB "p - Output using pull up/down (default)" EOL + TAB "w - Output using write low/high (less safe)" EOL + ); + // clang-format on + break; + case 'a': + // clang-format off + stream->println( + TAB "r - Realtime readout of all pins" EOL + TAB "o - Read one pin once" EOL + ); + // clang-format on + break; + } +} diff --git a/examples/PinScan/src/pinscan.cpp b/examples/PinScan/src/pinscan.cpp new file mode 100644 index 000000000..a50176d00 --- /dev/null +++ b/examples/PinScan/src/pinscan.cpp @@ -0,0 +1,185 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-07-31. */ + +#include "pinscan.h" + +#if USE_WIFI +#include +#include + +static WiFiMulti wm; +static WiFiServer server(23); +static WiFiClient client; +#endif + +Stream *stream = NULL; +uint8_t mode[] = {'?', '\0', '\0', '\0'}; +pin_size_t pinSkip[2] = {255, 255}; +int output = -1; + +static void parseMode(); + +void setup() { + Serial.begin(115200); +#if USE_WIFI + wm.addAP(WIFI_SSID, WIFI_PASS); + while (wm.run() != WL_CONNECTED) { + Serial.println("WiFi connection failed, retrying in 5s"); + delay(5000); + } + server.begin(); + server.setNoDelay(true); +#else + stream = &Serial; +#if LT_UART_DEFAULT_SERIAL == 0 + output = 0; + pinSkip[0] = PIN_SERIAL0_TX; + pinSkip[1] = PIN_SERIAL0_RX; +#elif LT_UART_DEFAULT_SERIAL == 1 + output = 1; + pinSkip[0] = PIN_SERIAL1_TX; + pinSkip[1] = PIN_SERIAL1_RX; +#elif LT_UART_DEFAULT_SERIAL == 2 + output = 2; + pinSkip[0] = PIN_SERIAL2_TX; + pinSkip[1] = PIN_SERIAL2_RX; +#endif +#endif +} + +void loop() { +#if USE_WIFI + while (wm.run() != WL_CONNECTED) { + Serial.println("WiFi connection dropped, retrying in 5s"); + delay(5000); + } + if (!stream) { + client = server.accept(); + if (client) { + stream = &client; + printHelp(); + } + } else if (!client.connected()) { + stream = NULL; + client.stop(); + client = WiFiClient(); + } +#endif + + if (stream && stream->available()) { + // put the char in first free mode item + bool modeSet = false; + for (uint8_t i = 0; i < sizeof(mode) / sizeof(uint8_t); i++) { + if (mode[i] == '\0') { + mode[i] = stream->read(); + // make the next mode show help screen + if (i < sizeof(mode) - 1) { + mode[++i] = '?'; + } + // clear the following items, if any + while (i < sizeof(mode) - 1) { + mode[++i] = '\0'; + } + modeSet = true; + break; + } + } + if (!modeSet) { + // no free mode items, reset everything + memset(mode, '\0', sizeof(mode)); + while (stream->available()) { + stream->read(); + } + } + // LT_I("New mode: %s", mode); + } + + // check for any 'q' keypresses + for (uint8_t i = 0; i < sizeof(mode) / sizeof(uint8_t); i++) { + if (mode[i] == 'q') { + if (mode[0] == 'd') + digitalDetach(); + memset(mode, '\0', sizeof(mode)); + mode[0] = '?'; + break; + } + } + + if (stream) + parseMode(); +} + +static void parseMode() { + if (mode[0] == '\0') + return; + int serial = 0; + switch (mode[0]) { + case '?': + printHelp(); + break; + case 'd': + runDigital(); + return; + case 'a': + runAnalog(); + return; + case 'r': + LT.restart(); + while (1) {} + return; + +#if !USE_WIFI + case 's': + stream->print("Choose output UART: "); + serial = stream->parseInt(); + stream->println(); + // clang-format off +#ifdef PIN_SERIAL0_TX + if (serial == 0) { + stream = &Serial0; + pinSkip[0] = PIN_SERIAL0_TX; + pinSkip[1] = PIN_SERIAL0_RX; + } else +#endif +#ifdef PIN_SERIAL1_TX + if (serial == 1) { + stream = &Serial1; + pinSkip[0] = PIN_SERIAL1_TX; + pinSkip[1] = PIN_SERIAL1_RX; + } else +#endif +#ifdef PIN_SERIAL2_TX + if (serial == 2) { + stream = &Serial2; + pinSkip[0] = PIN_SERIAL2_TX; + pinSkip[1] = PIN_SERIAL2_RX; + } else +#endif + // clang-format on + { + stream->print("Port unavailable"); + break; + } + output = serial; + ((SerialClass *)stream)->begin(115200); + stream->println(); + mode[0] = '?'; + return; +#endif + + case 't': + ansi = !ansi; + stream->print("ANSI control codes "); + if (ansi) { + stream->println("enabled"); + mode[0] = '?'; + ansiSkipErase = true; + return; + } else { + stream->println("disabled"); + } + break; + default: + break; + } + mode[0] = '\0'; +} diff --git a/examples/PinScan/src/pinscan.h b/examples/PinScan/src/pinscan.h new file mode 100644 index 000000000..c053204bd --- /dev/null +++ b/examples/PinScan/src/pinscan.h @@ -0,0 +1,39 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-07-31. */ + +#include + +#define USE_WIFI 0 // set up a WiFi telnet server +#define DELAY_READ 100 // interval for realtime readouts + +#define WIFI_SSID "MySSID" +#define WIFI_PASS "Secr3tPa$$w0rd" + +#define EXAMPLE_VER "1.0" + +#define EOL "\r\n" +#define TAB "\t" + +#define ANSI_ERASE "\x1B[2J" +#define ANSI_HOME "\x1B[H" +#define ANSI_LINE_START "\x1B[0G" +#define ANSI_TWO_LINES "\x1B[2F" +#define ANSI_ERASE_LINE "\x1B[0K" +#define ANSI_BLUE "\x1B[0;34m" +#define ANSI_RED "\x1B[0;31m" +#define ANSI_RESET "\x1B[0m" + +extern Stream *stream; +extern uint8_t mode[]; +extern pin_size_t pinSkip[2]; +extern int output; +extern bool ansi; +extern bool ansiSkipErase; + +extern void printHelp(uint8_t mode = '\0'); +extern void printAnsi(const char *str); +extern void printAnsiErase(); +extern void line(); +extern int inputPin(); +extern void runAnalog(); +extern void runDigital(); +extern void digitalDetach(); diff --git a/examples/PinScan/src/ui.cpp b/examples/PinScan/src/ui.cpp new file mode 100644 index 000000000..cb9b99847 --- /dev/null +++ b/examples/PinScan/src/ui.cpp @@ -0,0 +1,37 @@ +/* Copyright (c) Kuba Szczodrzyński 2022-07-31. */ + +#include "pinscan.h" + +bool ansi = true; +bool ansiSkipErase = false; + +void printAnsi(const char *str) { + if (ansi) + stream->print(str); +} + +void printAnsiErase() { + if (!ansiSkipErase) + printAnsi(ANSI_ERASE ANSI_HOME); + ansiSkipErase = false; +} + +void line() { + stream->print("--------"); + if (output == -1) { + stream->print("TELNET"); + } else { + stream->print(" UART"); + stream->print(output); + stream->write(' '); + } + stream->print("--------"); + stream->println(); +} + +int inputPin() { + stream->print("Enter pin number: "); + int pin = stream->parseInt(); + stream->println(); + return pin; +} diff --git a/examples/SUMMARY/index.html b/examples/SUMMARY/index.html new file mode 100644 index 000000000..111714a91 --- /dev/null +++ b/examples/SUMMARY/index.html @@ -0,0 +1,2289 @@ + + + + + + + + + + + + + + + + + + Examples - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + +

Examples

+ + + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/external-libs.json b/external-libs.json new file mode 100644 index 000000000..264e7ba39 --- /dev/null +++ b/external-libs.json @@ -0,0 +1,145 @@ +{ + "$schema": "./external-libs.schema.json", + "flashdb": { + "package": "library-flashdb", + "sources": [ + "+", + "+" + ], + "includes": [ + "+", + "+" + ] + }, + "printf": { + "package": "library-printf", + "sources": [ + "+" + ], + "includes": [ + "+" + ], + "flags": [ + "-Wno-maybe-uninitialized" + ], + "linkflags": [ + "-Wl,-wrap,printf", + "-Wl,-wrap,sprintf", + "-Wl,-wrap,vsprintf", + "-Wl,-wrap,snprintf", + "-Wl,-wrap,vsnprintf", + "-Wl,-wrap,vprintf", + "-Wl,-wrap,puts", + "-Wl,-wrap,putchar" + ], + "defines": { + "PRINTF_INCLUDE_CONFIG_H": "1" + } + }, + "uf2ota": { + "package": "library-uf2ota", + "sources": [ + "+" + ], + "includes": [ + "+" + ] + }, + "arduino-api": { + "package": "framework-arduino-api", + "sources": [ + "+", + "+", + "+", + "+", + "+", + "+" + ], + "includes": [ + "+<.>", + "+" + ] + }, + "freertos": { + "package": "library-freertos", + "sources": [ + "+" + ], + "includes": [ + "+" + ], + "defines": { + "FREERTOS_PORT_${FREERTOS_PORT_DEFINE}": "1" + } + }, + "freertos-port": { + "package": "library-freertos-port", + "sources": [ + "+<./$FREERTOS_PORT/*.c>" + ], + "includes": [ + "!<./$FREERTOS_PORT>" + ], + "defines": { + "FREERTOS_PORT_${FREERTOS_PORT_DEFINE}": "1" + } + }, + "lwip-amb1": { + "package": "library-lwip", + "sources": [ + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+" + ], + "includes": [ + "+", + "+", + "+", + "+" + ] + }, + "lwip-bdk": { + "package": "library-lwip", + "sources": [ + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+" + ], + "includes": [ + "+", + "+", + "+" + ] + }, + "lwip-ambz2": { + "package": "library-lwip", + "sources": [ + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+", + "+" + ], + "includes": [ + "+", + "+", + "+", + "+" + ] + } +} diff --git a/external-libs.schema.json b/external-libs.schema.json new file mode 100644 index 000000000..87fb8a346 --- /dev/null +++ b/external-libs.schema.json @@ -0,0 +1,65 @@ +{ + "type": "object", + "properties": { + "$schema": { + "type": "string" + } + }, + "patternProperties": { + "^[a-z0-9-_]+$": { + "type": "object", + "properties": { + "package": { + "type": "string", + "pattern": "^(tool|library|framework)-[a-z0-9-]+$" + }, + "sources": { + "type": "array", + "items": { + "type": "string", + "pattern": "^[!+-]<[$\\w/*.]+>$" + } + }, + "includes": { + "type": "array", + "items": { + "type": "string", + "pattern": "^[!+-]<[$\\w/*.]+>$" + } + }, + "flags": { + "type": "array", + "items": { + "type": "string", + "pattern": "^[^\\s]+$" + } + }, + "linkflags": { + "type": "array", + "items": { + "type": "string", + "pattern": "^[^\\s]+$" + } + }, + "defines": { + "type": "object", + "patternProperties": { + "^[A-Za-z0-9_]+$": { + "type": [ + "string", + "number" + ] + } + } + } + }, + "additionalProperties": false, + "required": [ + "package", + "sources", + "includes" + ] + } + }, + "additionalProperties": false +} diff --git a/families.json b/families.json new file mode 100644 index 000000000..f4d455a29 --- /dev/null +++ b/families.json @@ -0,0 +1,104 @@ +{ + "$schema": "./families.schema.json", + "realtek-amb": { + "parent": null, + "code": "amb", + "description": "Realtek Ameba" + }, + "realtek-amb1": { + "parent": "realtek-amb", + "code": "amb1", + "description": "Realtek Ameba1", + "id": "0x9FFFD543", + "short_name": "RTL8710A" + }, + "realtek-ambz": { + "parent": "realtek-amb", + "code": "ambz", + "description": "Realtek AmebaZ", + "id": "0x22E0D6FC", + "short_name": "RTL8710B", + "package": "framework-realtek-amb1" + }, + "realtek-ambz2": { + "parent": "realtek-amb", + "code": "ambz2", + "description": "Realtek AmebaZ2", + "id": "0xE08F7564", + "short_name": "RTL8720C", + "package": "framework-realtek-ambz2" + }, + "realtek-ambd": { + "parent": "realtek-amb", + "code": "ambd", + "description": "Realtek AmebaD", + "id": "0x3379CFE2", + "short_name": "RTL8720D" + }, + "beken-72xx": { + "parent": null, + "code": "bk72xx", + "description": "Beken 72xx" + }, + "beken-72xx-gen1": { + "parent": "beken-72xx", + "code": "bk72xxgen1", + "description": "Beken 72xx (ARM)", + "package": "framework-beken-bdk" + }, + "beken-72xx-gen2": { + "parent": "beken-72xx", + "code": "bk72xxgen2", + "description": "Beken 72xx (RISC-V & ARM)" + }, + "beken-7231": { + "parent": "beken-72xx-gen1", + "code": "bk7231", + "description": "Beken 7231" + }, + "beken-7231q": { + "parent": "beken-7231", + "code": "bk7231q", + "description": "Beken 7231Q", + "id": "0xAFE81D49", + "short_name": "BK7231Q" + }, + "beken-7231t": { + "parent": "beken-7231", + "code": "bk7231t", + "description": "Beken 7231T", + "id": "0x675A40B0", + "short_name": "BK7231T" + }, + "beken-7231n": { + "parent": "beken-72xx-gen1", + "description": "Beken 7231N", + "code": "bk7231n", + "id": "0x7B3EF230", + "short_name": "BK7231N" + }, + "beken-7251": { + "parent": "beken-72xx-gen1", + "code": "bk7251", + "description": "Beken 7251/7252", + "id": "0x6A82CC42", + "short_name": "BK7251" + }, + "boufallo-bl678": { + "parent": null, + "code": "bl678", + "description": "Boufallo BL6xx/BL7xx/BL8xx" + }, + "boufallo-bl60x": { + "parent": "boufallo-bl678", + "code": "bl60x", + "description": "Boufallo BL602/BL604", + "id": "0xDE1270B7", + "short_name": "BL60X" + }, + "winnermicro-iot": { + "parent": null, + "code": "wmiot", + "description": "WinnerMicro W60x/W800x" + } +} diff --git a/families.schema.json b/families.schema.json new file mode 100644 index 000000000..6c0f06007 --- /dev/null +++ b/families.schema.json @@ -0,0 +1,48 @@ +{ + "type": "object", + "properties": { + "$schema": { + "type": "string" + } + }, + "patternProperties": { + "^[a-z0-9-]+$": { + "type": "object", + "properties": { + "parent": { + "type": [ + "string", + "null" + ], + "pattern": "^[a-z0-9-]+$" + }, + "code": { + "type": "string", + "pattern": "^[a-z0-9]+$" + }, + "description": { + "type": "string" + }, + "id": { + "type": "string", + "pattern": "^0x[0-9A-F]{8}$" + }, + "short_name": { + "type": "string", + "pattern": "^[A-Z0-9]+$" + }, + "package": { + "type": "string", + "pattern": "^framework-[a-z0-9-]+$" + } + }, + "additionalProperties": false, + "required": [ + "parent", + "code", + "description" + ] + } + }, + "additionalProperties": false +} diff --git a/index.html b/index.html new file mode 100644 index 000000000..927873b62 --- /dev/null +++ b/index.html @@ -0,0 +1,2394 @@ + + + + + + + + + + + + + + + + + + + + + + LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

LibreTiny

+

(formerly LibreTuya)

+
+

GitHub Workflow Status +GitHub last commit

+

Code style: clang-format +Code style: black

+

Discord +PlatformIO Registry

+

RTL8710BN +BK7231

+
+

PlatformIO development platform for BK7231 and RTL8710 IoT chips.

+

The main goal of this project is to provide a usable build environment for IoT developers. While also providing vendor SDKs as PlatformIO cores, +the project focuses on developing working Arduino-compatible cores for supported families. The cores are inspired by Espressif's official core for ESP32, +which should make it easier to port/run existing ESP apps on less-common, unsupported IoT modules.

+

There's an ESPHome port based on LibreTiny, which supports BK7231 and RTL8710B chips.

+

Note: this project is work-in-progress.

+ +

License

+

See LICENSE. Project is licensed under MIT License.

+

Parts of the code may come from third parties, vendor SDKs or other open-source projects. +Most of these files are marked with appropriate copyright/author/license notices.

+

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/link/bk72xx-keys/index.html b/link/bk72xx-keys/index.html new file mode 100644 index 000000000..146ef9dfb --- /dev/null +++ b/link/bk72xx-keys/index.html @@ -0,0 +1,15 @@ + + + + + + Redirecting... + + + + + + +Redirecting... + + diff --git a/link/boards/index.html b/link/boards/index.html new file mode 100644 index 000000000..f0987797a --- /dev/null +++ b/link/boards/index.html @@ -0,0 +1,15 @@ + + + + + + Redirecting... + + + + + + +Redirecting... + + diff --git a/link/cloudcutter-digiblur/index.html b/link/cloudcutter-digiblur/index.html new file mode 100644 index 000000000..878ad405d --- /dev/null +++ b/link/cloudcutter-digiblur/index.html @@ -0,0 +1,15 @@ + + + + + + Redirecting... + + + + + + +Redirecting... + + diff --git a/link/cloudcutter-video/index.html b/link/cloudcutter-video/index.html new file mode 100644 index 000000000..47667b6fa --- /dev/null +++ b/link/cloudcutter-video/index.html @@ -0,0 +1,15 @@ + + + + + + Redirecting... + + + + + + +Redirecting... + + diff --git a/link/config-debug/index.html b/link/config-debug/index.html new file mode 100644 index 000000000..96136dec6 --- /dev/null +++ b/link/config-debug/index.html @@ -0,0 +1,15 @@ + + + + + + Redirecting... + + + + + + +Redirecting... + + diff --git a/link/config-serial/index.html b/link/config-serial/index.html new file mode 100644 index 000000000..e474d2519 --- /dev/null +++ b/link/config-serial/index.html @@ -0,0 +1,15 @@ + + + + + + Redirecting... + + + + + + +Redirecting... + + diff --git a/link/config/index.html b/link/config/index.html new file mode 100644 index 000000000..093a4ca0a --- /dev/null +++ b/link/config/index.html @@ -0,0 +1,15 @@ + + + + + + Redirecting... + + + + + + +Redirecting... + + diff --git a/link/flashing-beken-72xx/index.html b/link/flashing-beken-72xx/index.html new file mode 100644 index 000000000..c0c3cc214 --- /dev/null +++ b/link/flashing-beken-72xx/index.html @@ -0,0 +1,15 @@ + + + + + + Redirecting... + + + + + + +Redirecting... + + diff --git a/link/flashing-realtek-ambz/index.html b/link/flashing-realtek-ambz/index.html new file mode 100644 index 000000000..5254a0e0c --- /dev/null +++ b/link/flashing-realtek-ambz/index.html @@ -0,0 +1,15 @@ + + + + + + Redirecting... + + + + + + +Redirecting... + + diff --git a/link/gpio-access/index.html b/link/gpio-access/index.html new file mode 100644 index 000000000..a758c65cd --- /dev/null +++ b/link/gpio-access/index.html @@ -0,0 +1,15 @@ + + + + + + Redirecting... + + + + + + +Redirecting... + + diff --git a/link/kickstart/index.html b/link/kickstart/index.html new file mode 100644 index 000000000..865e5ceda --- /dev/null +++ b/link/kickstart/index.html @@ -0,0 +1,15 @@ + + + + + + Redirecting... + + + + + + +Redirecting... + + diff --git a/ltapi/_arduino_8h/index.html b/ltapi/_arduino_8h/index.html new file mode 100644 index 000000000..5eeede897 --- /dev/null +++ b/ltapi/_arduino_8h/index.html @@ -0,0 +1,2309 @@ + + + + + + + + + + + + + + + + + + + + File Arduino.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File Arduino.h

+

FileList > arduino > src > Arduino.h

+

Go to the source code of this file.

+
    +
  • #include <libretiny.h>
  • +
  • #include <sys/time.h>
  • +
  • #include <time.h>
  • +
  • #include <algorithm>
  • +
  • #include <cmath>
  • +
  • #include <api/ArduinoAPI.h>
  • +
  • #include <LT.h>
  • +
  • #include <ArduinoFamily.h>
  • +
  • #include "wiring_compat.h"
  • +
  • #include "wiring_custom.h"
  • +
  • #include <FreeRTOS.h>
  • +
  • #include <task.h>
  • +
+
+

The documentation for this class was generated from the following file cores/common/arduino/src/Arduino.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_arduino_8h_source/index.html b/ltapi/_arduino_8h_source/index.html new file mode 100644 index 000000000..4ce12146d --- /dev/null +++ b/ltapi/_arduino_8h_source/index.html @@ -0,0 +1,2355 @@ + + + + + + + + + + + + + + + + + + + + File Arduino.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File Arduino.h

+

File List > arduino > src > Arduino.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-06-14. */
+
+#pragma once
+
+// LibreTiny C API (with C standard libraries)
+#include <libretiny.h>
+
+// Additional C libraries
+#include <sys/time.h>
+#include <time.h>
+
+// C++ standard libraries
+#ifdef __cplusplus
+#include <algorithm>
+#include <cmath>
+using ::round;
+using std::abs;
+using std::isinf;
+using std::isnan;
+using std::max;
+using std::min;
+#endif
+
+// Arduino Core and LT class
+#include <api/ArduinoAPI.h>
+#ifdef __cplusplus
+#include <LT.h>
+using namespace arduino;
+#endif
+
+// Include family-specific code
+#include <ArduinoFamily.h>
+
+// Additional Wiring headers
+#include "wiring_compat.h"
+#include "wiring_custom.h"
+
+// FreeRTOS kernel
+#include <FreeRTOS.h>
+#include <task.h>
+
+// Define available serial ports
+#if defined(__cplusplus) && LT_ARD_HAS_SERIAL
+#include <Serial.h>
+
+#if HAS_SERIAL_CLASS
+#if LT_HW_UART0
+extern SerialClass Serial0;
+#endif
+#if LT_HW_UART1
+extern SerialClass Serial1;
+#endif
+#if LT_HW_UART2
+extern SerialClass Serial2;
+#endif
+#endif
+
+#define SerialN(x) Serial##x
+#define SerialM(x) SerialN(x)
+#define Serial     SerialM(LT_UART_DEFAULT_SERIAL)
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_e_s_p_8h/index.html b/ltapi/_e_s_p_8h/index.html new file mode 100644 index 000000000..1814c9a00 --- /dev/null +++ b/ltapi/_e_s_p_8h/index.html @@ -0,0 +1,2374 @@ + + + + + + + + + + + + + + + + + + + + File ESP.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File ESP.h

+

FileList > arduino > libraries > inline > ESP > ESP.h

+

Go to the source code of this file.

+
    +
  • #include <Arduino.h>
  • +
+

Classes

+ + + + + + + + + + + + + +
TypeName
classEspClass
ESP Arduino Core compatibility class.
+

Public Attributes

+ + + + + + + + + + + + + +
TypeName
EspClassESP
+

Public Attributes Documentation

+

variable ESP

+
EspClass ESP;
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/inline/ESP/ESP.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_e_s_p_8h_source/index.html b/ltapi/_e_s_p_8h_source/index.html new file mode 100644 index 000000000..9e0a451ba --- /dev/null +++ b/ltapi/_e_s_p_8h_source/index.html @@ -0,0 +1,2380 @@ + + + + + + + + + + + + + + + + + + + + File ESP.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File ESP.h

+

File List > arduino > libraries > inline > ESP > ESP.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2023-03-20.() */
+
+#include <Arduino.h>
+
+#ifdef __cplusplus
+
+class EspClass {
+  public:
+    inline void wdtEnable(uint32_t timeout_ms = 0) { lt_wdt_enable(timeout_ms); }
+
+    inline void wdtDisable() { lt_wdt_disable(); }
+
+    inline void wdtFeed() { lt_wdt_feed(); }
+
+    inline void reset() { lt_reboot(); }
+
+    inline void restart() { lt_reboot(); }
+
+    inline void rebootIntoUartDownloadMode() { lt_reboot_download_mode(); }
+
+    inline uint16_t getVcc() { return 3300; }
+
+    inline uint32_t getChipId() { return lt_cpu_get_mac_id(); }
+
+    inline uint32_t getFreeHeap() { return lt_heap_get_free(); }
+
+    inline uint16_t getMaxFreeBlockSize() { return lt_heap_get_max_alloc(); }
+
+    inline const char *getSdkVersion() { return LT_VERSION_STR; }
+
+    inline String getCoreVersion() { return LT_VERSION_STR; }
+
+    inline String getFullVersion() { return LT_BANNER_STR; }
+
+    inline uint8_t getBootVersion() { return 0; }
+
+    inline uint8_t getBootMode() { return 0; }
+
+    inline uint8_t getCpuFreqMHz() { return lt_cpu_get_freq_mhz(); }
+
+    inline uint32_t getFlashChipId() {
+        lt_flash_id_t id = lt_flash_get_id();
+        return id.manufacturer_id << 16 | id.chip_id << 7 | id.chip_size_id;
+    }
+
+    inline uint8_t getFlashChipVendorId() { return lt_flash_get_id().manufacturer_id; }
+
+    inline uint32_t getFlashChipRealSize() { return lt_flash_get_size(); }
+
+    inline uint32_t getFlashChipSize() { return lt_flash_get_size(); }
+
+    inline uint32_t getFlashChipMode() { return 0xFF; }
+
+    inline uint32_t getFlashChipSizeByChipId() { return lt_flash_get_size(); }
+
+    inline bool flashEraseSector(uint32_t sector) { return lt_flash_erase_block(sector); }
+
+    inline bool flashWrite(uint32_t address, const uint8_t *data, size_t size) {
+        return lt_flash_write(address, data, size) == size;
+    }
+
+    inline bool flashRead(uint32_t address, uint8_t *data, size_t size) {
+        return lt_flash_read(address, data, size) == size;
+    }
+
+    inline String getResetReason() { return lt_get_reboot_reason_name(lt_get_reboot_reason()); }
+
+    inline String getResetInfo() { return lt_get_reboot_reason_name(lt_get_reboot_reason()); }
+
+    inline uint8_t *random(uint8_t *resultArray, const size_t outputSizeBytes) {
+        lt_rand_bytes(resultArray, (size_t)outputSizeBytes);
+        return resultArray;
+    }
+
+    inline uint32_t random() {
+        uint32_t i;
+        lt_rand_bytes((uint8_t *)&i, 4);
+        return i;
+    }
+
+    inline uint32_t getCycleCount() { return lt_cpu_get_cycle_count(); }
+};
+
+extern EspClass ESP;
+
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_e_s_pm_d_n_s_8h/index.html b/ltapi/_e_s_pm_d_n_s_8h/index.html new file mode 100644 index 000000000..064fcd0dc --- /dev/null +++ b/ltapi/_e_s_pm_d_n_s_8h/index.html @@ -0,0 +1,2298 @@ + + + + + + + + + + + + + + + + + + + + File ESPmDNS.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_e_s_pm_d_n_s_8h_source/index.html b/ltapi/_e_s_pm_d_n_s_8h_source/index.html new file mode 100644 index 000000000..1f8f77295 --- /dev/null +++ b/ltapi/_e_s_pm_d_n_s_8h_source/index.html @@ -0,0 +1,2299 @@ + + + + + + + + + + + + + + + + + + + + File ESPmDNS.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_events_8cpp/index.html b/ltapi/_events_8cpp/index.html new file mode 100644 index 000000000..d8be05225 --- /dev/null +++ b/ltapi/_events_8cpp/index.html @@ -0,0 +1,2298 @@ + + + + + + + + + + + + + + + + + + + + File Events.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_events_8cpp_source/index.html b/ltapi/_events_8cpp_source/index.html new file mode 100644 index 000000000..bcae55543 --- /dev/null +++ b/ltapi/_events_8cpp_source/index.html @@ -0,0 +1,2299 @@ + + + + + + + + + + + + + + + + + + + + File Events.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_events_8h/index.html b/ltapi/_events_8h/index.html new file mode 100644 index 000000000..a9a3b24e7 --- /dev/null +++ b/ltapi/_events_8h/index.html @@ -0,0 +1,2594 @@ + + + + + + + + + + + + + + + + + + + + File Events.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

File Events.h

+

FileList > arduino > src > Events.h

+

Go to the source code of this file.

+
    +
  • #include <Arduino.h>
  • +
  • #include <WiFiEvents.h>
  • +
  • #include <functional>
  • +
+

Classes

+ + + + + + + + + + + + + + + + + +
TypeName
structEventHandler_s
structarduino_event_t
+

Public Types

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
typedef void(*EventCb
typedef std::function< void(EventId event, EventInfo info)>EventFuncCb
typedef struct EventHandler_sEventHandler
typedef void(*EventSysCb
enumarduino_event_id_t
unionarduino_event_info_t
+

Macros

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
defineEventId arduino_event_id_t
defineEventId_t arduino_event_id_t
defineEventInfo arduino_event_info_t
defineEventInfo_t arduino_event_info_t
defineEvent_t arduino_event_t
+

Public Types Documentation

+

typedef EventCb

+
typedef void(* EventCb) (EventId event);
+
+

typedef EventFuncCb

+
typedef std::function<void(EventId event, EventInfo info)> EventFuncCb;
+
+

typedef EventHandler

+
typedef struct EventHandler_s EventHandler;
+
+

typedef EventSysCb

+
typedef void(* EventSysCb) (Event_t *event);
+
+

enum arduino_event_id_t

+
enum arduino_event_id_t {
+    ARDUINO_EVENT_WIFI_READY = 0,
+    ARDUINO_EVENT_WIFI_SCAN_DONE,
+    ARDUINO_EVENT_WIFI_STA_START,
+    ARDUINO_EVENT_WIFI_STA_STOP,
+    ARDUINO_EVENT_WIFI_STA_CONNECTED,
+    ARDUINO_EVENT_WIFI_STA_DISCONNECTED,
+    ARDUINO_EVENT_WIFI_STA_AUTHMODE_CHANGE,
+    ARDUINO_EVENT_WIFI_STA_GOT_IP,
+    ARDUINO_EVENT_WIFI_STA_GOT_IP6,
+    ARDUINO_EVENT_WIFI_STA_LOST_IP,
+    ARDUINO_EVENT_WIFI_AP_START,
+    ARDUINO_EVENT_WIFI_AP_STOP,
+    ARDUINO_EVENT_WIFI_AP_STACONNECTED,
+    ARDUINO_EVENT_WIFI_AP_STADISCONNECTED,
+    ARDUINO_EVENT_WIFI_AP_STAIPASSIGNED,
+    ARDUINO_EVENT_WIFI_AP_PROBEREQRECVED,
+    ARDUINO_EVENT_WIFI_AP_GOT_IP6,
+    ARDUINO_EVENT_WIFI_FTM_REPORT,
+    ARDUINO_EVENT_ETH_START,
+    ARDUINO_EVENT_ETH_STOP,
+    ARDUINO_EVENT_ETH_CONNECTED,
+    ARDUINO_EVENT_ETH_DISCONNECTED,
+    ARDUINO_EVENT_ETH_GOT_IP,
+    ARDUINO_EVENT_ETH_GOT_IP6,
+    ARDUINO_EVENT_WPS_ER_SUCCESS,
+    ARDUINO_EVENT_WPS_ER_FAILED,
+    ARDUINO_EVENT_WPS_ER_TIMEOUT,
+    ARDUINO_EVENT_WPS_ER_PIN,
+    ARDUINO_EVENT_WPS_ER_PBC_OVERLAP,
+    ARDUINO_EVENT_SC_SCAN_DONE,
+    ARDUINO_EVENT_SC_FOUND_CHANNEL,
+    ARDUINO_EVENT_SC_GOT_SSID_PSWD,
+    ARDUINO_EVENT_SC_SEND_ACK_DONE,
+    ARDUINO_EVENT_PROV_INIT,
+    ARDUINO_EVENT_PROV_DEINIT,
+    ARDUINO_EVENT_PROV_START,
+    ARDUINO_EVENT_PROV_END,
+    ARDUINO_EVENT_PROV_CRED_RECV,
+    ARDUINO_EVENT_PROV_CRED_FAIL,
+    ARDUINO_EVENT_PROV_CRED_SUCCESS,
+    ARDUINO_EVENT_MAX
+};
+
+

union arduino_event_info_t

+

+
+

Macro Definition Documentation

+

define EventId

+
#define EventId arduino_event_id_t
+
+

define EventId_t

+
#define EventId_t arduino_event_id_t
+
+

define EventInfo

+
#define EventInfo arduino_event_info_t
+
+

define EventInfo_t

+
#define EventInfo_t arduino_event_info_t
+
+

define Event_t

+
#define Event_t arduino_event_t
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/src/Events.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_events_8h_source/index.html b/ltapi/_events_8h_source/index.html new file mode 100644 index 000000000..f21c964b1 --- /dev/null +++ b/ltapi/_events_8h_source/index.html @@ -0,0 +1,2411 @@ + + + + + + + + + + + + + + + + + + + + File Events.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File Events.h

+

File List > arduino > src > Events.h

+

Go to the documentation of this file.

+
/*
+ ESP8266WiFiGeneric.h - esp8266 Wifi support.
+ Based on WiFi.h from Ardiono WiFi shield library.
+ Copyright (c) 2011-2014 Arduino.  All right reserved.
+ Modified by Ivan Grokhotkov, December 2014
+ Reworked by Markus Sattler, December 2015
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#pragma once
+
+#include <Arduino.h>
+#include <WiFiEvents.h>
+#include <functional>
+
+typedef enum {
+    ARDUINO_EVENT_WIFI_READY = 0,           
+    ARDUINO_EVENT_WIFI_SCAN_DONE,           
+    ARDUINO_EVENT_WIFI_STA_START,           
+    ARDUINO_EVENT_WIFI_STA_STOP,            
+    ARDUINO_EVENT_WIFI_STA_CONNECTED,       
+    ARDUINO_EVENT_WIFI_STA_DISCONNECTED,    
+    ARDUINO_EVENT_WIFI_STA_AUTHMODE_CHANGE, 
+    ARDUINO_EVENT_WIFI_STA_GOT_IP,
+    ARDUINO_EVENT_WIFI_STA_GOT_IP6,
+    ARDUINO_EVENT_WIFI_STA_LOST_IP,
+    ARDUINO_EVENT_WIFI_AP_START,           
+    ARDUINO_EVENT_WIFI_AP_STOP,            
+    ARDUINO_EVENT_WIFI_AP_STACONNECTED,    
+    ARDUINO_EVENT_WIFI_AP_STADISCONNECTED, 
+    ARDUINO_EVENT_WIFI_AP_STAIPASSIGNED,
+    ARDUINO_EVENT_WIFI_AP_PROBEREQRECVED, 
+    ARDUINO_EVENT_WIFI_AP_GOT_IP6,
+    ARDUINO_EVENT_WIFI_FTM_REPORT, 
+    ARDUINO_EVENT_ETH_START,
+    ARDUINO_EVENT_ETH_STOP,
+    ARDUINO_EVENT_ETH_CONNECTED,
+    ARDUINO_EVENT_ETH_DISCONNECTED,
+    ARDUINO_EVENT_ETH_GOT_IP,
+    ARDUINO_EVENT_ETH_GOT_IP6,
+    ARDUINO_EVENT_WPS_ER_SUCCESS,     
+    ARDUINO_EVENT_WPS_ER_FAILED,      
+    ARDUINO_EVENT_WPS_ER_TIMEOUT,     
+    ARDUINO_EVENT_WPS_ER_PIN,         
+    ARDUINO_EVENT_WPS_ER_PBC_OVERLAP, 
+    ARDUINO_EVENT_SC_SCAN_DONE,
+    ARDUINO_EVENT_SC_FOUND_CHANNEL,
+    ARDUINO_EVENT_SC_GOT_SSID_PSWD,
+    ARDUINO_EVENT_SC_SEND_ACK_DONE,
+    ARDUINO_EVENT_PROV_INIT,
+    ARDUINO_EVENT_PROV_DEINIT,
+    ARDUINO_EVENT_PROV_START,
+    ARDUINO_EVENT_PROV_END,
+    ARDUINO_EVENT_PROV_CRED_RECV,
+    ARDUINO_EVENT_PROV_CRED_FAIL,
+    ARDUINO_EVENT_PROV_CRED_SUCCESS,
+    ARDUINO_EVENT_MAX
+} arduino_event_id_t;
+
+typedef union {
+    wifi_event_sta_scan_done_t wifi_scan_done;
+    wifi_event_sta_authmode_change_t wifi_sta_authmode_change;
+    wifi_event_sta_connected_t wifi_sta_connected;
+    wifi_event_sta_disconnected_t wifi_sta_disconnected;
+    wifi_event_sta_wps_er_pin_t wps_er_pin;
+    wifi_event_sta_wps_fail_reason_t wps_fail_reason;
+    wifi_event_ap_probe_req_rx_t wifi_ap_probereqrecved;
+    wifi_event_ap_staconnected_t wifi_ap_staconnected;
+    wifi_event_ap_stadisconnected_t wifi_ap_stadisconnected;
+    wifi_event_ftm_report_t wifi_ftm_report;
+    ip_event_ap_staipassigned_t wifi_ap_staipassigned;
+    ip_event_got_ip_t got_ip;
+    ip_event_got_ip6_t got_ip6;
+    // smartconfig_event_got_ssid_pswd_t sc_got_ssid_pswd;
+    // esp_eth_handle_t eth_connected;
+    // wifi_sta_config_t prov_cred_recv;
+    // wifi_prov_sta_fail_reason_t prov_fail_reason;
+} arduino_event_info_t;
+
+typedef struct {
+    arduino_event_id_t event_id;
+    arduino_event_info_t event_info;
+} arduino_event_t;
+
+#define EventId     arduino_event_id_t
+#define EventId_t   arduino_event_id_t
+#define EventInfo   arduino_event_info_t
+#define EventInfo_t arduino_event_info_t
+#define Event_t     arduino_event_t
+
+typedef void (*EventCb)(EventId event);
+typedef std::function<void(EventId event, EventInfo info)> EventFuncCb;
+typedef void (*EventSysCb)(Event_t *event);
+
+typedef struct EventHandler_s {
+    static uint16_t lastId;
+    uint16_t id;
+    EventCb cb;
+    EventFuncCb fcb;
+    EventSysCb scb;
+    EventId eventId;
+
+    EventHandler_s() : id(lastId++), cb(NULL), fcb(NULL), scb(NULL) {}
+} EventHandler;
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_f_s_8cpp/index.html b/ltapi/_f_s_8cpp/index.html new file mode 100644 index 000000000..a13244a17 --- /dev/null +++ b/ltapi/_f_s_8cpp/index.html @@ -0,0 +1,2298 @@ + + + + + + + + + + + + + + + + + + + + File FS.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_f_s_8cpp_source/index.html b/ltapi/_f_s_8cpp_source/index.html new file mode 100644 index 000000000..cea5f946d --- /dev/null +++ b/ltapi/_f_s_8cpp_source/index.html @@ -0,0 +1,2522 @@ + + + + + + + + + + + + + + + + + + + + File FS.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File FS.cpp

+

File List > arduino > libraries > common > FS > FS.cpp

+

Go to the documentation of this file.

+
/*
+ FS.cpp - file system wrapper
+ Copyright (c) 2015 Ivan Grokhotkov. All rights reserved.
+ This file is part of the esp8266 core for Arduino environment.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "FS.h"
+
+using namespace fs;
+
+size_t File::write(uint8_t c) {
+    if (!*this) {
+        return 0;
+    }
+    return _p->write(&c, 1);
+}
+
+time_t File::getLastWrite() {
+    if (!*this) {
+        return 0;
+    }
+    return _p->getLastWrite();
+}
+
+size_t File::write(const uint8_t *buf, size_t size) {
+    if (!*this) {
+        return 0;
+    }
+    return _p->write(buf, size);
+}
+
+int File::available() {
+    if (!*this) {
+        return false;
+    }
+    return _p->size() - _p->position();
+}
+
+int File::read() {
+    if (!*this) {
+        return -1;
+    }
+    uint8_t result;
+    if (_p->read(&result, 1) != 1) {
+        return -1;
+    }
+    return result;
+}
+
+size_t File::read(uint8_t *buf, size_t size) {
+    if (!*this) {
+        return -1;
+    }
+    return _p->read(buf, size);
+}
+
+int File::peek() {
+    if (!*this) {
+        return -1;
+    }
+    size_t curPos = _p->position();
+    int result    = read();
+    seek(curPos, SeekSet);
+    return result;
+}
+
+void File::flush() {
+    if (!*this) {
+        return;
+    }
+    _p->flush();
+}
+
+bool File::seek(uint32_t pos, SeekMode mode) {
+    if (!*this) {
+        return false;
+    }
+    return _p->seek(pos, mode);
+}
+
+size_t File::position() const {
+    if (!*this) {
+        return 0;
+    }
+    return _p->position();
+}
+
+size_t File::size() const {
+    if (!*this) {
+        return 0;
+    }
+    return _p->size();
+}
+
+bool File::setBufferSize(size_t size) {
+    if (!*this) {
+        return 0;
+    }
+    return _p->setBufferSize(size);
+}
+
+void File::close() {
+    if (_p) {
+        _p->close();
+        _p = nullptr;
+    }
+}
+
+File::operator bool() const {
+    return _p != nullptr && *_p != false;
+}
+
+const char *File::path() const {
+    if (!*this) {
+        return nullptr;
+    }
+    return _p->path();
+}
+
+const char *File::name() const {
+    if (!*this) {
+        return nullptr;
+    }
+    return _p->name();
+}
+
+// to implement
+boolean File::isDirectory(void) {
+    if (!*this) {
+        return false;
+    }
+    return _p->isDirectory();
+}
+
+File File::openNextFile(const char *mode) {
+    if (!*this) {
+        return File();
+    }
+    return _p->openNextFile(mode);
+}
+
+void File::rewindDirectory(void) {
+    if (!*this) {
+        return;
+    }
+    _p->rewindDirectory();
+}
+
+File FS::open(const String &path, const char *mode, const bool create) {
+    return open(path.c_str(), mode, create);
+}
+
+File FS::open(const char *path, const char *mode, const bool create) {
+    if (!_impl) {
+        return File();
+    }
+
+    return File(_impl->open(path, mode, create));
+}
+
+bool FS::exists(const char *path) {
+    if (!_impl) {
+        return false;
+    }
+    return _impl->exists(path);
+}
+
+bool FS::exists(const String &path) {
+    return exists(path.c_str());
+}
+
+bool FS::remove(const char *path) {
+    if (!_impl) {
+        return false;
+    }
+    return _impl->remove(path);
+}
+
+bool FS::remove(const String &path) {
+    return remove(path.c_str());
+}
+
+bool FS::rename(const char *pathFrom, const char *pathTo) {
+    if (!_impl) {
+        return false;
+    }
+    return _impl->rename(pathFrom, pathTo);
+}
+
+bool FS::rename(const String &pathFrom, const String &pathTo) {
+    return rename(pathFrom.c_str(), pathTo.c_str());
+}
+
+bool FS::mkdir(const char *path) {
+    if (!_impl) {
+        return false;
+    }
+    return _impl->mkdir(path);
+}
+
+bool FS::mkdir(const String &path) {
+    return mkdir(path.c_str());
+}
+
+bool FS::rmdir(const char *path) {
+    if (!_impl) {
+        return false;
+    }
+    return _impl->rmdir(path);
+}
+
+bool FS::rmdir(const String &path) {
+    return rmdir(path.c_str());
+}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_f_s_impl_8h/index.html b/ltapi/_f_s_impl_8h/index.html new file mode 100644 index 000000000..89152cf35 --- /dev/null +++ b/ltapi/_f_s_impl_8h/index.html @@ -0,0 +1,2295 @@ + + + + + + + + + + + + + + + + + + + + File FSImpl.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_f_s_impl_8h_source/index.html b/ltapi/_f_s_impl_8h_source/index.html new file mode 100644 index 000000000..c78477c69 --- /dev/null +++ b/ltapi/_f_s_impl_8h_source/index.html @@ -0,0 +1,2297 @@ + + + + + + + + + + + + + + + + + + + + File FSImpl.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_flash_8h/index.html b/ltapi/_flash_8h/index.html new file mode 100644 index 000000000..38745cf89 --- /dev/null +++ b/ltapi/_flash_8h/index.html @@ -0,0 +1,2374 @@ + + + + + + + + + + + + + + + + + + + + File Flash.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_flash_8h_source/index.html b/ltapi/_flash_8h_source/index.html new file mode 100644 index 000000000..9f3076c87 --- /dev/null +++ b/ltapi/_flash_8h_source/index.html @@ -0,0 +1,2327 @@ + + + + + + + + + + + + + + + + + + + + File Flash.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File Flash.h

+

File List > arduino > libraries > inline > Flash > Flash.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-04-24. */
+
+#pragma once
+
+#include <Arduino.h>
+
+#ifdef __cplusplus
+
+class FlashClass {
+  public:
+    inline FlashId getChipId() { return lt_flash_get_id(); }
+
+    inline uint32_t getSize() { return lt_flash_get_size(); }
+
+    inline bool eraseSector(uint32_t offset) {
+        //
+        return lt_flash_erase_block(offset);
+    }
+
+    inline bool readBlock(uint32_t offset, uint8_t *data, size_t length) {
+        //
+        return lt_flash_read(offset, data, length) == length;
+    }
+
+    inline bool writeBlock(uint32_t offset, const uint8_t *data, size_t length) {
+        //
+        return lt_flash_write(offset, data, length) == length;
+    }
+};
+
+extern FlashClass Flash;
+
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_h_t_t_p___method_8h/index.html b/ltapi/_h_t_t_p___method_8h/index.html new file mode 100644 index 000000000..661fdc07f --- /dev/null +++ b/ltapi/_h_t_t_p___method_8h/index.html @@ -0,0 +1,2443 @@ + + + + + + + + + + + + + + + + + + + + File HTTP\_Method.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File HTTP_Method.h

+

FileList > arduino > libraries > ext > WebServer > HTTP_Method.h

+

Go to the source code of this file.

+

Public Types

+ + + + + + + + + + + + + + + + + +
TypeName
typedef enum http_methodHTTPMethod
enumhttp_method
+

Macros

+ + + + + + + + + + + + + + + + + + + + + +
TypeName
defineHTTP_ANY (HTTPMethod)(255)
defineHTTP_METHOD_MAP (XX)
defineXX (num, name, string) HTTP_##name = num,
+

Public Types Documentation

+

typedef HTTPMethod

+
typedef enum http_method HTTPMethod;
+
+

enum http_method

+
enum http_method;
+
+

Macro Definition Documentation

+

define HTTP_ANY

+
#define HTTP_ANY (HTTPMethod)(255)
+
+

define HTTP_METHOD_MAP

+
#define HTTP_METHOD_MAP (
+    XX
+) 
+
+

define XX

+
#define XX (
+    num,
+    name,
+    string
+) HTTP_##name = num,
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/HTTP_Method.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_h_t_t_p___method_8h_source/index.html b/ltapi/_h_t_t_p___method_8h_source/index.html new file mode 100644 index 000000000..debd805f7 --- /dev/null +++ b/ltapi/_h_t_t_p___method_8h_source/index.html @@ -0,0 +1,2350 @@ + + + + + + + + + + + + + + + + + + + + File HTTP\_Method.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File HTTP_Method.h

+

File List > arduino > libraries > ext > WebServer > HTTP_Method.h

+

Go to the documentation of this file.

+
#pragma once
+
+/* Request Methods */
+#define HTTP_METHOD_MAP(XX)                                                                                            \
+    XX(0, DELETE, DELETE)                                                                                              \
+    XX(1, GET, GET)                                                                                                    \
+    XX(2, HEAD, HEAD)                                                                                                  \
+    XX(3, POST, POST)                                                                                                  \
+    XX(4, PUT, PUT)                                                                                                    \
+    /* pathological */                                                                                                 \
+    XX(5, CONNECT, CONNECT)                                                                                            \
+    XX(6, OPTIONS, OPTIONS)                                                                                            \
+    XX(7, TRACE, TRACE)                                                                                                \
+    /* WebDAV */                                                                                                       \
+    XX(8, COPY, COPY)                                                                                                  \
+    XX(9, LOCK, LOCK)                                                                                                  \
+    XX(10, MKCOL, MKCOL)                                                                                               \
+    XX(11, MOVE, MOVE)                                                                                                 \
+    XX(12, PROPFIND, PROPFIND)                                                                                         \
+    XX(13, PROPPATCH, PROPPATCH)                                                                                       \
+    XX(14, SEARCH, SEARCH)                                                                                             \
+    XX(15, UNLOCK, UNLOCK)                                                                                             \
+    XX(16, BIND, BIND)                                                                                                 \
+    XX(17, REBIND, REBIND)                                                                                             \
+    XX(18, UNBIND, UNBIND)                                                                                             \
+    XX(19, ACL, ACL)                                                                                                   \
+    /* subversion */                                                                                                   \
+    XX(20, REPORT, REPORT)                                                                                             \
+    XX(21, MKACTIVITY, MKACTIVITY)                                                                                     \
+    XX(22, CHECKOUT, CHECKOUT)                                                                                         \
+    XX(23, MERGE, MERGE)                                                                                               \
+    /* upnp */                                                                                                         \
+    XX(24, MSEARCH, M - SEARCH)                                                                                        \
+    XX(25, NOTIFY, NOTIFY)                                                                                             \
+    XX(26, SUBSCRIBE, SUBSCRIBE)                                                                                       \
+    XX(27, UNSUBSCRIBE, UNSUBSCRIBE)                                                                                   \
+    /* RFC-5789 */                                                                                                     \
+    XX(28, PATCH, PATCH)                                                                                               \
+    XX(29, PURGE, PURGE)                                                                                               \
+    /* CalDAV */                                                                                                       \
+    XX(30, MKCALENDAR, MKCALENDAR)                                                                                     \
+    /* RFC-2068, section 19.6.1.2 */                                                                                   \
+    XX(31, LINK, LINK)                                                                                                 \
+    XX(32, UNLINK, UNLINK)                                                                                             \
+    /* icecast */                                                                                                      \
+    XX(33, SOURCE, SOURCE)
+
+enum http_method {
+
+#define XX(num, name, string) HTTP_##name = num,
+    HTTP_METHOD_MAP(XX)
+#undef XX
+};
+
+typedef enum http_method HTTPMethod;
+#define HTTP_ANY (HTTPMethod)(255)
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_h_t_t_p_client_8cpp/index.html b/ltapi/_h_t_t_p_client_8cpp/index.html new file mode 100644 index 000000000..92ea35922 --- /dev/null +++ b/ltapi/_h_t_t_p_client_8cpp/index.html @@ -0,0 +1,2295 @@ + + + + + + + + + + + + + + + + + + + + File HTTPClient.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_h_t_t_p_client_8cpp_source/index.html b/ltapi/_h_t_t_p_client_8cpp_source/index.html new file mode 100644 index 000000000..64d4f3222 --- /dev/null +++ b/ltapi/_h_t_t_p_client_8cpp_source/index.html @@ -0,0 +1,3717 @@ + + + + + + + + + + + + + + + + + + + + File HTTPClient.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File HTTPClient.cpp

+

File List > arduino > libraries > ext > HTTPClient > HTTPClient.cpp

+

Go to the documentation of this file.

+
#if LT_ARD_HAS_WIFI
+
+#include <Arduino.h>
+
+#ifdef HTTPCLIENT_1_1_COMPATIBLE
+#include <WiFi.h>
+#include <WiFiClientSecure.h>
+#endif
+
+// #include <StreamString.h>
+#include <base64.h>
+
+#include "HTTPClient.h"
+
+#include <time.h>
+
+#ifdef HTTPCLIENT_1_1_COMPATIBLE
+class TransportTraits {
+  public:
+    virtual ~TransportTraits() {}
+
+    virtual std::unique_ptr<WiFiClient> create() {
+        return std::unique_ptr<WiFiClient>(new WiFiClient());
+    }
+
+    virtual bool verify(WiFiClient &client, const char *host) {
+        return true;
+    }
+};
+
+class TLSTraits : public TransportTraits {
+  public:
+    TLSTraits(const char *CAcert, const char *clicert = nullptr, const char *clikey = nullptr)
+        : _cacert(CAcert), _clicert(clicert), _clikey(clikey) {}
+
+    std::unique_ptr<WiFiClient> create() override {
+        return std::unique_ptr<WiFiClient>(new WiFiClientSecure());
+    }
+
+    bool verify(WiFiClient &client, const char *host) override {
+        WiFiClientSecure &wcs = static_cast<WiFiClientSecure &>(client);
+        if (_cacert == nullptr) {
+            wcs.setInsecure();
+        } else {
+            wcs.setCACert(_cacert);
+            wcs.setCertificate(_clicert);
+            wcs.setPrivateKey(_clikey);
+        }
+        return true;
+    }
+
+  protected:
+    const char *_cacert;
+    const char *_clicert;
+    const char *_clikey;
+};
+#endif // HTTPCLIENT_1_1_COMPATIBLE
+
+HTTPClient::HTTPClient() {}
+
+HTTPClient::~HTTPClient() {
+    if (_client) {
+        _client->stop();
+    }
+    if (_currentHeaders) {
+        delete[] _currentHeaders;
+    }
+    if (_tcpDeprecated) {
+        _tcpDeprecated.reset(nullptr);
+    }
+    if (_transportTraits) {
+        _transportTraits.reset(nullptr);
+    }
+}
+
+void HTTPClient::clear() {
+    _returnCode = 0;
+    _size       = -1;
+    _headers    = "";
+}
+
+bool HTTPClient::begin(WiFiClient &client, String url) {
+#ifdef HTTPCLIENT_1_1_COMPATIBLE
+    if (_tcpDeprecated) {
+        log_d("mix up of new and deprecated api");
+        _canReuse = false;
+        end();
+    }
+#endif
+
+    _client = &client;
+
+    // check for : (http: or https:)
+    int index = url.indexOf(':');
+    if (index < 0) {
+        log_d("failed to parse protocol");
+        return false;
+    }
+
+    String protocol = url.substring(0, index);
+    if (protocol != "http" && protocol != "https") {
+        log_d("unknown protocol '%s'", protocol.c_str());
+        return false;
+    }
+
+    _port   = (protocol == "https" ? 443 : 80);
+    _secure = (protocol == "https");
+    return beginInternal(url, protocol.c_str());
+}
+
+bool HTTPClient::begin(WiFiClient &client, String host, uint16_t port, String uri, bool https) {
+#ifdef HTTPCLIENT_1_1_COMPATIBLE
+    if (_tcpDeprecated) {
+        log_d("mix up of new and deprecated api");
+        _canReuse = false;
+        end();
+    }
+#endif
+
+    _client = &client;
+
+    clear();
+    _host     = host;
+    _port     = port;
+    _uri      = uri;
+    _protocol = (https ? "https" : "http");
+    _secure   = https;
+    return true;
+}
+
+#ifdef HTTPCLIENT_1_1_COMPATIBLE
+bool HTTPClient::begin(String url, const char *CAcert) {
+    if (_client && !_tcpDeprecated) {
+        log_d("mix up of new and deprecated api");
+        _canReuse = false;
+        end();
+    }
+
+    clear();
+    _port = 443;
+    if (!beginInternal(url, "https")) {
+        return false;
+    }
+    _secure          = true;
+    _transportTraits = TransportTraitsPtr(new TLSTraits(CAcert));
+    if (!_transportTraits) {
+        log_e("could not create transport traits");
+        return false;
+    }
+
+    return true;
+}
+
+bool HTTPClient::begin(String url) {
+    if (_client && !_tcpDeprecated) {
+        log_d("mix up of new and deprecated api");
+        _canReuse = false;
+        end();
+    }
+
+    clear();
+    _port = 80;
+    if (!beginInternal(url, "http")) {
+        return begin(url, (const char *)NULL);
+    }
+    _transportTraits = TransportTraitsPtr(new TransportTraits());
+    if (!_transportTraits) {
+        log_e("could not create transport traits");
+        return false;
+    }
+
+    return true;
+}
+#endif // HTTPCLIENT_1_1_COMPATIBLE
+
+bool HTTPClient::beginInternal(String url, const char *expectedProtocol) {
+    log_v("url: %s", url.c_str());
+
+    // check for : (http: or https:
+    int index = url.indexOf(':');
+    if (index < 0) {
+        log_e("failed to parse protocol");
+        return false;
+    }
+
+    _protocol = url.substring(0, index);
+    if (_protocol != expectedProtocol) {
+        log_d("unexpected protocol: %s, expected %s", _protocol.c_str(), expectedProtocol);
+        return false;
+    }
+
+    url.remove(0, (index + 3)); // remove http:// or https://
+
+    index = url.indexOf('/');
+    if (index == -1) {
+        index = url.length();
+        url += '/';
+    }
+    String host = url.substring(0, index);
+    url.remove(0, index); // remove host part
+
+    // get Authorization
+    index = host.indexOf('@');
+    if (index >= 0) {
+        // auth info
+        String auth = host.substring(0, index);
+        host.remove(0, index + 1); // remove auth part including @
+        _base64Authorization = base64::encode(auth);
+    }
+
+    // get port
+    index = host.indexOf(':');
+    String the_host;
+    if (index >= 0) {
+        the_host = host.substring(0, index); // hostname
+        host.remove(0, (index + 1));         // remove hostname + :
+        _port = host.toInt();                // get port
+    } else {
+        the_host = host;
+    }
+    if (_host != the_host && connected()) {
+        log_d("switching host from '%s' to '%s'. disconnecting first", _host.c_str(), the_host.c_str());
+        _canReuse = false;
+        disconnect(true);
+    }
+    _host = the_host;
+    _uri  = url;
+    log_d("protocol: %s, host: %s port: %d url: %s", _protocol.c_str(), _host.c_str(), _port, _uri.c_str());
+    return true;
+}
+
+#ifdef HTTPCLIENT_1_1_COMPATIBLE
+bool HTTPClient::begin(String host, uint16_t port, String uri) {
+    if (_client && !_tcpDeprecated) {
+        log_d("mix up of new and deprecated api");
+        _canReuse = false;
+        end();
+    }
+
+    clear();
+    _host            = host;
+    _port            = port;
+    _uri             = uri;
+    _transportTraits = TransportTraitsPtr(new TransportTraits());
+    log_d("host: %s port: %d uri: %s", host.c_str(), port, uri.c_str());
+    return true;
+}
+
+bool HTTPClient::begin(String host, uint16_t port, String uri, const char *CAcert) {
+    if (_client && !_tcpDeprecated) {
+        log_d("mix up of new and deprecated api");
+        _canReuse = false;
+        end();
+    }
+
+    clear();
+    _host = host;
+    _port = port;
+    _uri  = uri;
+
+    if (strlen(CAcert) == 0) {
+        return false;
+    }
+    _secure          = true;
+    _transportTraits = TransportTraitsPtr(new TLSTraits(CAcert));
+    return true;
+}
+
+bool HTTPClient::begin(
+    String host, uint16_t port, String uri, const char *CAcert, const char *cli_cert, const char *cli_key
+) {
+    if (_client && !_tcpDeprecated) {
+        log_d("mix up of new and deprecated api");
+        _canReuse = false;
+        end();
+    }
+
+    clear();
+    _host = host;
+    _port = port;
+    _uri  = uri;
+
+    if (strlen(CAcert) == 0) {
+        return false;
+    }
+    _secure          = true;
+    _transportTraits = TransportTraitsPtr(new TLSTraits(CAcert, cli_cert, cli_key));
+    return true;
+}
+#endif // HTTPCLIENT_1_1_COMPATIBLE
+
+void HTTPClient::end(void) {
+    disconnect(false);
+    clear();
+}
+
+void HTTPClient::disconnect(bool preserveClient) {
+    if (connected()) {
+        if (_client->available() > 0) {
+            log_d("still data in buffer (%d), clean up.\n", _client->available());
+            _client->flush();
+        }
+
+        if (_reuse && _canReuse) {
+            log_d("tcp keep open for reuse");
+        } else {
+            log_d("tcp stop");
+            _client->stop();
+            if (!preserveClient) {
+                _client = nullptr;
+#ifdef HTTPCLIENT_1_1_COMPATIBLE
+                if (_tcpDeprecated) {
+                    _transportTraits.reset(nullptr);
+                    _tcpDeprecated.reset(nullptr);
+                }
+#endif
+            }
+        }
+    } else {
+        log_d("tcp is closed\n");
+    }
+}
+
+bool HTTPClient::connected() {
+    if (_client) {
+        return ((_client->available() > 0) || _client->connected());
+    }
+    return false;
+}
+
+void HTTPClient::setReuse(bool reuse) {
+    _reuse = reuse;
+}
+
+void HTTPClient::setUserAgent(const String &userAgent) {
+    _userAgent = userAgent;
+}
+
+void HTTPClient::setAuthorization(const char *user, const char *password) {
+    if (user && password) {
+        String auth = user;
+        auth += ":";
+        auth += password;
+        _base64Authorization = base64::encode(auth);
+    }
+}
+
+void HTTPClient::setAuthorization(const char *auth) {
+    if (auth) {
+        _base64Authorization = auth;
+    }
+}
+
+void HTTPClient::setAuthorizationType(const char *authType) {
+    if (authType) {
+        _authorizationType = authType;
+    }
+}
+
+void HTTPClient::setConnectTimeout(int32_t connectTimeout) {
+    _connectTimeout = connectTimeout;
+}
+
+void HTTPClient::setTimeout(uint16_t timeout) {
+    _tcpTimeout = timeout;
+    if (connected()) {
+        _client->setTimeout((timeout + 500) / 1000);
+    }
+}
+
+void HTTPClient::useHTTP10(bool useHTTP10) {
+    _useHTTP10 = useHTTP10;
+    _reuse     = !useHTTP10;
+}
+
+int HTTPClient::GET() {
+    return sendRequest("GET");
+}
+
+int HTTPClient::POST(uint8_t *payload, size_t size) {
+    return sendRequest("POST", payload, size);
+}
+
+int HTTPClient::POST(String payload) {
+    return POST((uint8_t *)payload.c_str(), payload.length());
+}
+
+int HTTPClient::PATCH(uint8_t *payload, size_t size) {
+    return sendRequest("PATCH", payload, size);
+}
+
+int HTTPClient::PATCH(String payload) {
+    return PATCH((uint8_t *)payload.c_str(), payload.length());
+}
+
+int HTTPClient::PUT(uint8_t *payload, size_t size) {
+    return sendRequest("PUT", payload, size);
+}
+
+int HTTPClient::PUT(String payload) {
+    return PUT((uint8_t *)payload.c_str(), payload.length());
+}
+
+int HTTPClient::sendRequest(const char *type, String payload) {
+    return sendRequest(type, (uint8_t *)payload.c_str(), payload.length());
+}
+
+int HTTPClient::sendRequest(const char *type, uint8_t *payload, size_t size) {
+    int code;
+    bool redirect          = false;
+    uint16_t redirectCount = 0;
+    do {
+        // wipe out any existing headers from previous request
+        for (size_t i = 0; i < _headerKeysCount; i++) {
+            if (_currentHeaders[i].value.length() > 0) {
+                _currentHeaders[i].value = ""; // LT: changed from clear()
+            }
+        }
+
+        log_d("request type: '%s' redirCount: %d\n", type, redirectCount);
+
+        // connect to server
+        if (!connect()) {
+            return returnError(HTTPC_ERROR_CONNECTION_REFUSED);
+        }
+
+        if (payload && size > 0) {
+            addHeader(F("Content-Length"), String(size));
+        }
+
+        // add cookies to header, if present
+        String cookie_string;
+        if (generateCookieString(&cookie_string)) {
+            addHeader("Cookie", cookie_string);
+        }
+
+        // send Header
+        if (!sendHeader(type)) {
+            return returnError(HTTPC_ERROR_SEND_HEADER_FAILED);
+        }
+
+        // send Payload if needed
+        if (payload && size > 0) {
+            if (_client->write(&payload[0], size) != size) {
+                return returnError(HTTPC_ERROR_SEND_PAYLOAD_FAILED);
+            }
+        }
+
+        code = handleHeaderResponse();
+        log_d("sendRequest code=%d\n", code);
+
+        // Handle redirections as stated in RFC document:
+        // https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
+        //
+        // Implementing HTTP_CODE_FOUND as redirection with GET method,
+        // to follow most of existing user agent implementations.
+        //
+        redirect = false;
+        if (_followRedirects != HTTPC_DISABLE_FOLLOW_REDIRECTS && redirectCount < _redirectLimit &&
+            _location.length() > 0) {
+            switch (code) {
+                // redirecting using the same method
+                case HTTP_CODE_MOVED_PERMANENTLY:
+                case HTTP_CODE_TEMPORARY_REDIRECT: {
+                    if (
+                        // allow to force redirections on other methods
+                        // (the RFC require user to accept the redirection)
+                        _followRedirects == HTTPC_FORCE_FOLLOW_REDIRECTS ||
+                        // allow GET and HEAD methods without force
+                        !strcmp(type, "GET") ||
+                        !strcmp(type, "HEAD")
+                    ) {
+                        redirectCount += 1;
+                        log_d(
+                            "following redirect (the same method): '%s' redirCount: %d\n",
+                            _location.c_str(),
+                            redirectCount
+                        );
+                        if (!setURL(_location)) {
+                            log_d("failed setting URL for redirection\n");
+                            // no redirection
+                            break;
+                        }
+                        // redirect using the same request method and payload, diffrent URL
+                        redirect = true;
+                    }
+                    break;
+                }
+                // redirecting with method dropped to GET or HEAD
+                // note: it does not need `HTTPC_FORCE_FOLLOW_REDIRECTS` for any method
+                case HTTP_CODE_FOUND:
+                case HTTP_CODE_SEE_OTHER: {
+                    redirectCount += 1;
+                    log_d(
+                        "following redirect (dropped to GET/HEAD): '%s' redirCount: %d\n",
+                        _location.c_str(),
+                        redirectCount
+                    );
+                    if (!setURL(_location)) {
+                        log_d("failed setting URL for redirection\n");
+                        // no redirection
+                        break;
+                    }
+                    // redirect after changing method to GET/HEAD and dropping payload
+                    type     = "GET";
+                    payload  = nullptr;
+                    size     = 0;
+                    redirect = true;
+                    break;
+                }
+
+                default:
+                    break;
+            }
+        }
+
+    } while (redirect);
+    // handle Server Response (Header)
+    return returnError(code);
+}
+
+int HTTPClient::sendRequest(const char *type, Stream *stream, size_t size) {
+
+    if (!stream) {
+        return returnError(HTTPC_ERROR_NO_STREAM);
+    }
+
+    // connect to server
+    if (!connect()) {
+        return returnError(HTTPC_ERROR_CONNECTION_REFUSED);
+    }
+
+    if (size > 0) {
+        addHeader("Content-Length", String(size));
+    }
+
+    // add cookies to header, if present
+    String cookie_string;
+    if (generateCookieString(&cookie_string)) {
+        addHeader("Cookie", cookie_string);
+    }
+
+    // send Header
+    if (!sendHeader(type)) {
+        return returnError(HTTPC_ERROR_SEND_HEADER_FAILED);
+    }
+
+    int buff_size = HTTP_TCP_BUFFER_SIZE;
+
+    int len          = size;
+    int bytesWritten = 0;
+
+    if (len == 0) {
+        len = -1;
+    }
+
+    // if possible create smaller buffer then HTTP_TCP_BUFFER_SIZE
+    if ((len > 0) && (len < HTTP_TCP_BUFFER_SIZE)) {
+        buff_size = len;
+    }
+
+    // create buffer for read
+    uint8_t *buff = (uint8_t *)malloc(buff_size);
+
+    if (buff) {
+        // read all data from stream and send it to server
+        while (connected() && (stream->available() > -1) && (len > 0 || len == -1)) {
+
+            // get available data size
+            int sizeAvailable = stream->available();
+
+            if (sizeAvailable) {
+
+                int readBytes = sizeAvailable;
+
+                // read only the asked bytes
+                if (len > 0 && readBytes > len) {
+                    readBytes = len;
+                }
+
+                // not read more the buffer can handle
+                if (readBytes > buff_size) {
+                    readBytes = buff_size;
+                }
+
+                // read data
+                int bytesRead = stream->readBytes(buff, readBytes);
+
+                // write it to Stream
+                int bytesWrite = _client->write((const uint8_t *)buff, bytesRead);
+                bytesWritten += bytesWrite;
+
+                // are all Bytes a writen to stream ?
+                if (bytesWrite != bytesRead) {
+                    log_d("short write, asked for %d but got %d retry...", bytesRead, bytesWrite);
+
+                    // check for write error
+                    if (_client->getWriteError()) {
+                        log_d("stream write error %d", _client->getWriteError());
+
+                        // reset write error for retry
+                        _client->clearWriteError();
+                    }
+
+                    // some time for the stream
+                    delay(1);
+
+                    int leftBytes = (readBytes - bytesWrite);
+
+                    // retry to send the missed bytes
+                    bytesWrite = _client->write((const uint8_t *)(buff + bytesWrite), leftBytes);
+                    bytesWritten += bytesWrite;
+
+                    if (bytesWrite != leftBytes) {
+                        // failed again
+                        log_d("short write, asked for %d but got %d failed.", leftBytes, bytesWrite);
+                        free(buff);
+                        return returnError(HTTPC_ERROR_SEND_PAYLOAD_FAILED);
+                    }
+                }
+
+                // check for write error
+                if (_client->getWriteError()) {
+                    log_d("stream write error %d", _client->getWriteError());
+                    free(buff);
+                    return returnError(HTTPC_ERROR_SEND_PAYLOAD_FAILED);
+                }
+
+                // count bytes to read left
+                if (len > 0) {
+                    len -= readBytes;
+                }
+
+                delay(0);
+            } else {
+                delay(1);
+            }
+        }
+
+        free(buff);
+
+        if (size && (int)size != bytesWritten) {
+            log_d("Stream payload bytesWritten %d and size %d mismatch!.", bytesWritten, size);
+            log_d("ERROR SEND PAYLOAD FAILED!");
+            return returnError(HTTPC_ERROR_SEND_PAYLOAD_FAILED);
+        } else {
+            log_d("Stream payload written: %d", bytesWritten);
+        }
+
+    } else {
+        log_d("too less ram! need %d", HTTP_TCP_BUFFER_SIZE);
+        return returnError(HTTPC_ERROR_TOO_LESS_RAM);
+    }
+
+    // handle Server Response (Header)
+    return returnError(handleHeaderResponse());
+}
+
+int HTTPClient::getSize(void) {
+    return _size;
+}
+
+WiFiClient &HTTPClient::getStream(void) {
+    if (connected()) {
+        return *_client;
+    }
+
+    log_w("getStream: not connected");
+    static WiFiClient empty;
+    return empty;
+}
+
+WiFiClient *HTTPClient::getStreamPtr(void) {
+    if (connected()) {
+        return _client;
+    }
+
+    log_w("getStreamPtr: not connected");
+    return nullptr;
+}
+
+int HTTPClient::writeToStream(Stream *stream) {
+
+    if (!stream) {
+        return returnError(HTTPC_ERROR_NO_STREAM);
+    }
+
+    if (!connected()) {
+        return returnError(HTTPC_ERROR_NOT_CONNECTED);
+    }
+
+    // get length of document (is -1 when Server sends no Content-Length header)
+    int len = _size;
+    int ret = 0;
+
+    if (_transferEncoding == HTTPC_TE_IDENTITY) {
+        ret = writeToStreamDataBlock(stream, len);
+
+        // have we an error?
+        if (ret < 0) {
+            return returnError(ret);
+        }
+    } else if (_transferEncoding == HTTPC_TE_CHUNKED) {
+        int size = 0;
+        while (1) {
+            if (!connected()) {
+                return returnError(HTTPC_ERROR_CONNECTION_LOST);
+            }
+            String chunkHeader = _client->readStringUntil('\n');
+
+            if (chunkHeader.length() <= 0) {
+                return returnError(HTTPC_ERROR_READ_TIMEOUT);
+            }
+
+            chunkHeader.trim(); // remove \r
+
+            // read size of chunk
+            len = (uint32_t)strtol((const char *)chunkHeader.c_str(), NULL, 16);
+            size += len;
+            log_d(" read chunk len: %d", len);
+
+            // data left?
+            if (len > 0) {
+                int r = writeToStreamDataBlock(stream, len);
+                if (r < 0) {
+                    // error in writeToStreamDataBlock
+                    return returnError(r);
+                }
+                ret += r;
+            } else {
+
+                // if no length Header use global chunk size
+                if (_size <= 0) {
+                    _size = size;
+                }
+
+                // check if we have write all data out
+                if (ret != _size) {
+                    return returnError(HTTPC_ERROR_STREAM_WRITE);
+                }
+                break;
+            }
+
+            // read trailing \r\n at the end of the chunk
+            char buf[2];
+            auto trailing_seq_len = _client->readBytes((uint8_t *)buf, 2);
+            if (trailing_seq_len != 2 || buf[0] != '\r' || buf[1] != '\n') {
+                return returnError(HTTPC_ERROR_READ_TIMEOUT);
+            }
+
+            delay(0);
+        }
+    } else {
+        return returnError(HTTPC_ERROR_ENCODING);
+    }
+
+    //    end();
+    disconnect(true);
+    return ret;
+}
+
+/* String HTTPClient::getString(void) {
+    // _size can be -1 when Server sends no Content-Length header
+    if (_size > 0 || _size == -1) {
+        StreamString sstring;
+        // try to reserve needed memory (noop if _size == -1)
+        if (sstring.reserve((_size + 1))) {
+            writeToStream(&sstring);
+            return sstring;
+        } else {
+            log_d("not enough memory to reserve a string! need: %d", (_size + 1));
+        }
+    }
+
+    return "";
+} */
+
+String HTTPClient::errorToString(int error) {
+    switch (error) {
+        case HTTPC_ERROR_CONNECTION_REFUSED:
+            return F("connection refused");
+        case HTTPC_ERROR_SEND_HEADER_FAILED:
+            return F("send header failed");
+        case HTTPC_ERROR_SEND_PAYLOAD_FAILED:
+            return F("send payload failed");
+        case HTTPC_ERROR_NOT_CONNECTED:
+            return F("not connected");
+        case HTTPC_ERROR_CONNECTION_LOST:
+            return F("connection lost");
+        case HTTPC_ERROR_NO_STREAM:
+            return F("no stream");
+        case HTTPC_ERROR_NO_HTTP_SERVER:
+            return F("no HTTP server");
+        case HTTPC_ERROR_TOO_LESS_RAM:
+            return F("too less ram");
+        case HTTPC_ERROR_ENCODING:
+            return F("Transfer-Encoding not supported");
+        case HTTPC_ERROR_STREAM_WRITE:
+            return F("Stream write error");
+        case HTTPC_ERROR_READ_TIMEOUT:
+            return F("read Timeout");
+        default:
+            return String();
+    }
+}
+
+void HTTPClient::addHeader(const String &name, const String &value, bool first, bool replace) {
+    // not allow set of Header handled by code
+    if (!name.equalsIgnoreCase(F("Connection")) && !name.equalsIgnoreCase(F("User-Agent")) &&
+        !name.equalsIgnoreCase(F("Host")) &&
+        !(name.equalsIgnoreCase(F("Authorization")) && _base64Authorization.length())) {
+
+        String headerLine = name;
+        headerLine += ": ";
+
+        if (replace) {
+            int headerStart = _headers.indexOf(headerLine);
+            if (headerStart != -1 && (headerStart == 0 || _headers[headerStart - 1] == '\n')) {
+                int headerEnd = _headers.indexOf('\n', headerStart);
+                _headers      = _headers.substring(0, headerStart) + _headers.substring(headerEnd + 1);
+            }
+        }
+
+        headerLine += value;
+        headerLine += "\r\n";
+        if (first) {
+            _headers = headerLine + _headers;
+        } else {
+            _headers += headerLine;
+        }
+    }
+}
+
+void HTTPClient::collectHeaders(const char *headerKeys[], const size_t headerKeysCount) {
+    _headerKeysCount = headerKeysCount;
+    if (_currentHeaders) {
+        delete[] _currentHeaders;
+    }
+    _currentHeaders = new RequestArgument[_headerKeysCount];
+    for (size_t i = 0; i < _headerKeysCount; i++) {
+        _currentHeaders[i].key = headerKeys[i];
+    }
+}
+
+String HTTPClient::header(const char *name) {
+    for (size_t i = 0; i < _headerKeysCount; ++i) {
+        if (_currentHeaders[i].key == name) {
+            return _currentHeaders[i].value;
+        }
+    }
+    return String();
+}
+
+String HTTPClient::header(size_t i) {
+    if (i < _headerKeysCount) {
+        return _currentHeaders[i].value;
+    }
+    return String();
+}
+
+String HTTPClient::headerName(size_t i) {
+    if (i < _headerKeysCount) {
+        return _currentHeaders[i].key;
+    }
+    return String();
+}
+
+int HTTPClient::headers() {
+    return _headerKeysCount;
+}
+
+bool HTTPClient::hasHeader(const char *name) {
+    for (size_t i = 0; i < _headerKeysCount; ++i) {
+        if ((_currentHeaders[i].key == name) && (_currentHeaders[i].value.length() > 0)) {
+            return true;
+        }
+    }
+    return false;
+}
+
+bool HTTPClient::connect(void) {
+    if (connected()) {
+        if (_reuse) {
+            log_d("already connected, reusing connection");
+        } else {
+            log_d("already connected, try reuse!");
+        }
+        while (_client->available() > 0) {
+            _client->read();
+        }
+        return true;
+    }
+
+#ifdef HTTPCLIENT_1_1_COMPATIBLE
+    if (_transportTraits && !_client) {
+        _tcpDeprecated = _transportTraits->create();
+        if (!_tcpDeprecated) {
+            log_e("failed to create client");
+            return false;
+        }
+        _client = _tcpDeprecated.get();
+    }
+#endif
+
+    if (!_client) {
+        log_d("HTTPClient::begin was not called or returned error");
+        return false;
+    }
+#ifdef HTTPCLIENT_1_1_COMPATIBLE
+    if (_tcpDeprecated && !_transportTraits->verify(*_client, _host.c_str())) {
+        log_d("transport level verify failed");
+        _client->stop();
+        return false;
+    }
+#endif
+    if (!_client->connect(_host.c_str(), _port, _connectTimeout)) {
+        log_d("failed connect to %s:%u", _host.c_str(), _port);
+        return false;
+    }
+
+    // set Timeout for WiFiClient and for Stream::readBytesUntil() and Stream::readStringUntil()
+    _client->setTimeout((_tcpTimeout + 500) / 1000);
+
+    log_d(" connected to %s:%u", _host.c_str(), _port);
+
+    /*
+    #ifdef ESP8266
+        _client->setNoDelay(true);
+    #endif
+     */
+    return connected();
+}
+
+bool HTTPClient::sendHeader(const char *type) {
+    if (!connected()) {
+        return false;
+    }
+
+    String header = String(type) + " " + _uri + F(" HTTP/1.");
+
+    if (_useHTTP10) {
+        header += "0";
+    } else {
+        header += "1";
+    }
+
+    header += String(F("\r\nHost: ")) + _host;
+    if (_port != 80 && _port != 443) {
+        header += ':';
+        header += String(_port);
+    }
+    header += String(F("\r\nUser-Agent: ")) + _userAgent + F("\r\nConnection: ");
+
+    if (_reuse) {
+        header += F("keep-alive");
+    } else {
+        header += F("close");
+    }
+    header += "\r\n";
+
+    if (!_useHTTP10) {
+        header += F("Accept-Encoding: identity;q=1,chunked;q=0.1,*;q=0\r\n");
+    }
+
+    if (_base64Authorization.length()) {
+        _base64Authorization.replace("\n", "");
+        header += F("Authorization: ");
+        header += _authorizationType;
+        header += " ";
+        header += _base64Authorization;
+        header += "\r\n";
+    }
+
+    header += _headers + "\r\n";
+
+    return (_client->write((const uint8_t *)header.c_str(), header.length()) == header.length());
+}
+
+int HTTPClient::handleHeaderResponse() {
+
+    if (!connected()) {
+        return HTTPC_ERROR_NOT_CONNECTED;
+    }
+
+    _returnCode = 0;
+    _size       = -1;
+    _canReuse   = _reuse;
+
+    String transferEncoding;
+
+    _transferEncoding          = HTTPC_TE_IDENTITY;
+    unsigned long lastDataTime = millis();
+    bool firstLine             = true;
+    String date;
+
+    while (connected()) {
+        size_t len = _client->available();
+        if (len > 0) {
+            String headerLine = _client->readStringUntil('\n');
+            headerLine.trim(); // remove \r
+
+            lastDataTime = millis();
+
+            log_v("RX: '%s'", headerLine.c_str());
+
+            if (firstLine) {
+                firstLine = false;
+                if (_canReuse && headerLine.startsWith("HTTP/1.")) {
+                    _canReuse = (headerLine[sizeof "HTTP/1." - 1] != '0');
+                }
+                int codePos = headerLine.indexOf(' ') + 1;
+                _returnCode = headerLine.substring(codePos, headerLine.indexOf(' ', codePos)).toInt();
+            } else if (headerLine.indexOf(':')) {
+                String headerName  = headerLine.substring(0, headerLine.indexOf(':'));
+                String headerValue = headerLine.substring(headerLine.indexOf(':') + 1);
+                headerValue.trim();
+
+                if (headerName.equalsIgnoreCase("Date")) {
+                    date = headerValue;
+                }
+
+                if (headerName.equalsIgnoreCase("Content-Length")) {
+                    _size = headerValue.toInt();
+                }
+
+                if (_canReuse && headerName.equalsIgnoreCase("Connection")) {
+                    if (headerValue.indexOf("close") >= 0 && headerValue.indexOf("keep-alive") < 0) {
+                        _canReuse = false;
+                    }
+                }
+
+                if (headerName.equalsIgnoreCase("Transfer-Encoding")) {
+                    transferEncoding = headerValue;
+                }
+
+                if (headerName.equalsIgnoreCase("Location")) {
+                    _location = headerValue;
+                }
+
+                if (headerName.equalsIgnoreCase("Set-Cookie")) {
+                    setCookie(date, headerValue);
+                }
+
+                for (size_t i = 0; i < _headerKeysCount; i++) {
+                    if (_currentHeaders[i].key.equalsIgnoreCase(headerName)) {
+                        // Uncomment the following lines if you need to add support for multiple headers with the same
+                        // key: if (!_currentHeaders[i].value.isEmpty()) {
+                        //     // Existing value, append this one with a comma
+                        //     _currentHeaders[i].value += ',';
+                        //     _currentHeaders[i].value += headerValue;
+                        // } else {
+                        _currentHeaders[i].value = headerValue;
+                        // }
+                        break; // We found a match, stop looking
+                    }
+                }
+            }
+
+            if (headerLine == "") {
+                log_d("code: %d", _returnCode);
+
+                if (_size > 0) {
+                    log_d("size: %d", _size);
+                }
+
+                if (transferEncoding.length() > 0) {
+                    log_d("Transfer-Encoding: %s", transferEncoding.c_str());
+                    if (transferEncoding.equalsIgnoreCase("chunked")) {
+                        _transferEncoding = HTTPC_TE_CHUNKED;
+                    } else if (transferEncoding.equalsIgnoreCase("identity")) {
+                        _transferEncoding = HTTPC_TE_IDENTITY;
+                    } else {
+                        return HTTPC_ERROR_ENCODING;
+                    }
+                } else {
+                    _transferEncoding = HTTPC_TE_IDENTITY;
+                }
+
+                if (_returnCode) {
+                    return _returnCode;
+                } else {
+                    log_d("Remote host is not an HTTP Server!");
+                    return HTTPC_ERROR_NO_HTTP_SERVER;
+                }
+            }
+
+        } else {
+            if ((millis() - lastDataTime) > _tcpTimeout) {
+                return HTTPC_ERROR_READ_TIMEOUT;
+            }
+            delay(10);
+        }
+    }
+
+    return HTTPC_ERROR_CONNECTION_LOST;
+}
+
+int HTTPClient::writeToStreamDataBlock(Stream *stream, int size) {
+    int buff_size    = HTTP_TCP_BUFFER_SIZE;
+    int len          = size;
+    int bytesWritten = 0;
+
+    // if possible create smaller buffer then HTTP_TCP_BUFFER_SIZE
+    if ((len > 0) && (len < HTTP_TCP_BUFFER_SIZE)) {
+        buff_size = len;
+    }
+
+    // create buffer for read
+    uint8_t *buff = (uint8_t *)malloc(buff_size);
+
+    if (buff) {
+        // read all data from server
+        while (connected() && (len > 0 || len == -1)) {
+
+            // get available data size
+            size_t sizeAvailable = _client->available();
+
+            if (sizeAvailable) {
+
+                int readBytes = sizeAvailable;
+
+                // read only the asked bytes
+                if (len > 0 && readBytes > len) {
+                    readBytes = len;
+                }
+
+                // not read more the buffer can handle
+                if (readBytes > buff_size) {
+                    readBytes = buff_size;
+                }
+
+                // stop if no more reading
+                if (readBytes == 0)
+                    break;
+
+                // read data
+                int bytesRead = _client->readBytes(buff, readBytes);
+
+                // write it to Stream
+                int bytesWrite = stream->write(buff, bytesRead);
+                bytesWritten += bytesWrite;
+
+                // are all Bytes a writen to stream ?
+                if (bytesWrite != bytesRead) {
+                    log_d("short write asked for %d but got %d retry...", bytesRead, bytesWrite);
+
+                    // check for write error
+                    if (stream->getWriteError()) {
+                        log_d("stream write error %d", stream->getWriteError());
+
+                        // reset write error for retry
+                        stream->clearWriteError();
+                    }
+
+                    // some time for the stream
+                    delay(1);
+
+                    int leftBytes = (readBytes - bytesWrite);
+
+                    // retry to send the missed bytes
+                    bytesWrite = stream->write((buff + bytesWrite), leftBytes);
+                    bytesWritten += bytesWrite;
+
+                    if (bytesWrite != leftBytes) {
+                        // failed again
+                        log_w("short write asked for %d but got %d failed.", leftBytes, bytesWrite);
+                        free(buff);
+                        return HTTPC_ERROR_STREAM_WRITE;
+                    }
+                }
+
+                // check for write error
+                if (stream->getWriteError()) {
+                    log_w("stream write error %d", stream->getWriteError());
+                    free(buff);
+                    return HTTPC_ERROR_STREAM_WRITE;
+                }
+
+                // count bytes to read left
+                if (len > 0) {
+                    len -= readBytes;
+                }
+
+                delay(0);
+            } else {
+                delay(1);
+            }
+        }
+
+        free(buff);
+
+        log_d("connection closed or file end (written: %d).", bytesWritten);
+
+        if ((size > 0) && (size != bytesWritten)) {
+            log_d("bytesWritten %d and size %d mismatch!.", bytesWritten, size);
+            return HTTPC_ERROR_STREAM_WRITE;
+        }
+
+    } else {
+        log_w("too less ram! need %d", HTTP_TCP_BUFFER_SIZE);
+        return HTTPC_ERROR_TOO_LESS_RAM;
+    }
+
+    return bytesWritten;
+}
+
+int HTTPClient::returnError(int error) {
+    if (error < 0) {
+        log_w("error(%d): %s", error, errorToString(error).c_str());
+        if (connected()) {
+            log_d("tcp stop");
+            _client->stop();
+        }
+    }
+    return error;
+}
+
+void HTTPClient::setFollowRedirects(followRedirects_t follow) {
+    _followRedirects = follow;
+}
+
+void HTTPClient::setRedirectLimit(uint16_t limit) {
+    _redirectLimit = limit;
+}
+
+bool HTTPClient::setURL(const String &url) {
+    // if the new location is only a path then only update the URI
+    if (url && url[0] == '/') {
+        _uri = url;
+        clear();
+        return true;
+    }
+
+    if (!url.startsWith(_protocol + ':')) {
+        log_d("new URL not the same protocol, expected '%s', URL: '%s'\n", _protocol.c_str(), url.c_str());
+        return false;
+    }
+
+    // check if the port is specified
+    int indexPort = url.indexOf(':', 6); // find the first ':' excluding the one from the protocol
+    int indexURI  = url.indexOf('/', 7); // find where the URI starts to make sure the ':' is not part of it
+    if (indexPort == -1 || indexPort > indexURI) {
+        // the port is not specified
+        _port = (_protocol == "https" ? 443 : 80);
+    }
+
+    // disconnect but preserve _client.
+    // Also have to keep the connection otherwise it will free some of the memory used by _client
+    // and will blow up later when trying to do _client->available() or similar
+    _canReuse = true;
+    disconnect(true);
+    return beginInternal(url, _protocol.c_str());
+}
+
+const String &HTTPClient::getLocation(void) {
+    return _location;
+}
+
+void HTTPClient::setCookieJar(CookieJar *cookieJar) {
+    _cookieJar = cookieJar;
+}
+
+void HTTPClient::resetCookieJar() {
+    _cookieJar = nullptr;
+}
+
+void HTTPClient::clearAllCookies() {
+    if (_cookieJar)
+        _cookieJar->clear();
+}
+
+void HTTPClient::setCookie(String date, String headerValue) {
+    if (!_cookieJar) {
+        return;
+    }
+#define HTTP_TIME_PATTERN "%a, %d %b %Y %H:%M:%S"
+
+    Cookie cookie;
+    String value;
+    int pos1, pos2;
+
+    headerValue.toLowerCase();
+
+    struct tm tm;
+    strptime(date.c_str(), HTTP_TIME_PATTERN, &tm);
+    cookie.date = mktime(&tm);
+
+    pos1 = headerValue.indexOf('=');
+    pos2 = headerValue.indexOf(';');
+
+    if (pos1 >= 0 && pos2 > pos1) {
+        cookie.name  = headerValue.substring(0, pos1);
+        cookie.value = headerValue.substring(pos1 + 1, pos2);
+    } else {
+        return; // invalid cookie header
+    }
+
+    // expires
+    if (headerValue.indexOf("expires=") >= 0) {
+        pos1 = headerValue.indexOf("expires=") + strlen("expires=");
+        pos2 = headerValue.indexOf(';', pos1);
+
+        if (pos2 > pos1)
+            value = headerValue.substring(pos1, pos2);
+        else
+            value = headerValue.substring(pos1);
+
+        strptime(value.c_str(), HTTP_TIME_PATTERN, &tm);
+        cookie.expires.date  = mktime(&tm);
+        cookie.expires.valid = true;
+    }
+
+    // max-age
+    if (headerValue.indexOf("max-age=") >= 0) {
+        pos1 = headerValue.indexOf("max-age=") + strlen("max-age=");
+        pos2 = headerValue.indexOf(';', pos1);
+
+        if (pos2 > pos1)
+            value = headerValue.substring(pos1, pos2);
+        else
+            value = headerValue.substring(pos1);
+
+        cookie.max_age.duration = value.toInt();
+        cookie.max_age.valid    = true;
+    }
+
+    // domain
+    if (headerValue.indexOf("domain=") >= 0) {
+        pos1 = headerValue.indexOf("domain=") + strlen("domain=");
+        pos2 = headerValue.indexOf(';', pos1);
+
+        if (pos2 > pos1)
+            value = headerValue.substring(pos1, pos2);
+        else
+            value = headerValue.substring(pos1);
+
+        if (value.startsWith("."))
+            value.remove(0, 1);
+
+        if (_host.indexOf(value) >= 0) {
+            cookie.domain = value;
+        } else {
+            return; // server tries to set a cookie on a different domain; ignore it
+        }
+    } else {
+        pos1 = _host.lastIndexOf('.', _host.lastIndexOf('.') - 1);
+        if (pos1 >= 0)
+            cookie.domain = _host.substring(pos1 + 1);
+        else
+            cookie.domain = _host;
+    }
+
+    // path
+    if (headerValue.indexOf("path=") >= 0) {
+        pos1 = headerValue.indexOf("path=") + strlen("path=");
+        pos2 = headerValue.indexOf(';', pos1);
+
+        if (pos2 > pos1)
+            cookie.path = headerValue.substring(pos1, pos2);
+        else
+            cookie.path = headerValue.substring(pos1);
+    }
+
+    // HttpOnly
+    cookie.http_only = (headerValue.indexOf("httponly") >= 0);
+
+    // secure
+    cookie.secure = (headerValue.indexOf("secure") >= 0);
+
+    // overwrite or delete cookie in/from cookie jar
+    time_t now_local = time(NULL);
+    time_t now_gmt   = mktime(gmtime(&now_local));
+
+    bool found = false;
+
+    for (auto c = _cookieJar->begin(); c != _cookieJar->end(); ++c) {
+        if (c->domain == cookie.domain && c->name == cookie.name) {
+            // when evaluating, max-age takes precedence over expires if both are defined
+            if ((cookie.max_age.valid && ((cookie.date + cookie.max_age.duration) < now_gmt)) ||
+                cookie.max_age.duration <= 0 ||
+                (!cookie.max_age.valid && cookie.expires.valid && cookie.expires.date < now_gmt)) {
+                _cookieJar->erase(c);
+                c--;
+            } else {
+                *c = cookie;
+            }
+            found = true;
+        }
+    }
+
+    // add cookie to jar
+    if (!found && !(cookie.max_age.valid && cookie.max_age.duration <= 0))
+        _cookieJar->push_back(cookie);
+}
+
+bool HTTPClient::generateCookieString(String *cookieString) {
+    time_t now_local = time(NULL);
+    time_t now_gmt   = mktime(gmtime(&now_local));
+
+    *cookieString = "";
+    bool found    = false;
+
+    if (!_cookieJar) {
+        return false;
+    }
+    for (auto c = _cookieJar->begin(); c != _cookieJar->end(); ++c) {
+        if ((c->max_age.valid && ((c->date + c->max_age.duration) < now_gmt)) ||
+            (!c->max_age.valid && c->expires.valid && c->expires.date < now_gmt)) {
+            _cookieJar->erase(c);
+            c--;
+        } else if (_host.indexOf(c->domain) >= 0 && (!c->secure || _secure)) {
+            if (*cookieString == "")
+                *cookieString = c->name + "=" + c->value;
+            else
+                *cookieString += " ;" + c->name + "=" + c->value;
+            found = true;
+        }
+    }
+
+    return found;
+}
+
+#endif // LT_ARD_HAS_WIFI
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_h_t_t_p_client_8h/index.html b/ltapi/_h_t_t_p_client_8h/index.html new file mode 100644 index 000000000..ecc9a41d3 --- /dev/null +++ b/ltapi/_h_t_t_p_client_8h/index.html @@ -0,0 +1,2746 @@ + + + + + + + + + + + + + + + + + + + + File HTTPClient.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

File HTTPClient.h

+

FileList > arduino > libraries > ext > HTTPClient > HTTPClient.h

+

Go to the source code of this file.

+
    +
  • #include <Arduino.h>
  • +
  • #include <WiFiClient.h>
  • +
  • #include <WiFiClientSecure.h>
  • +
  • #include <memory>
  • +
  • #include <vector>
  • +
+

Classes

+ + + + + + + + + + + + + + + + + + + + + +
TypeName
structCookie
classHTTPClient
structRequestArgument
+

Public Types

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
typedef std::vector< Cookie >CookieJar
typedef std::unique_ptr< TransportTraits >TransportTraitsPtr
enumfollowRedirects_t
enumt_http_codes
HTTP codes see RFC7231.
enumtransferEncoding_t
+

Macros

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
defineHTTPCLIENT_1_1_COMPATIBLE
defineHTTPCLIENT_DEFAULT_TCP_TIMEOUT (5000)
Cookie jar support.
defineHTTPC_ERROR_CONNECTION_LOST (-5)
defineHTTPC_ERROR_CONNECTION_REFUSED (-1)
HTTP client errors.
defineHTTPC_ERROR_ENCODING (-9)
defineHTTPC_ERROR_NOT_CONNECTED (-4)
defineHTTPC_ERROR_NO_HTTP_SERVER (-7)
defineHTTPC_ERROR_NO_STREAM (-6)
defineHTTPC_ERROR_READ_TIMEOUT (-11)
defineHTTPC_ERROR_SEND_HEADER_FAILED (-2)
defineHTTPC_ERROR_SEND_PAYLOAD_FAILED (-3)
defineHTTPC_ERROR_STREAM_WRITE (-10)
defineHTTPC_ERROR_TOO_LESS_RAM (-8)
defineHTTP_TCP_BUFFER_SIZE (1460)
size for the stream handling
+

Public Types Documentation

+

typedef CookieJar

+
typedef std::vector<Cookie> CookieJar;
+
+

typedef TransportTraitsPtr

+
typedef std::unique_ptr<TransportTraits> TransportTraitsPtr;
+
+

enum followRedirects_t

+
enum followRedirects_t {
+    HTTPC_DISABLE_FOLLOW_REDIRECTS,
+    HTTPC_STRICT_FOLLOW_REDIRECTS,
+    HTTPC_FORCE_FOLLOW_REDIRECTS
+};
+
+

redirection follow mode. +* HTTPC_DISABLE_FOLLOW_REDIRECTS - no redirection will be followed. +* HTTPC_STRICT_FOLLOW_REDIRECTS - strict RFC2616, only requests using GET or HEAD methods will be redirected (using the same method), since the RFC requires end-user confirmation in other cases. +* HTTPC_FORCE_FOLLOW_REDIRECTS - all redirections will be followed, regardless of a used method. New request will use the same method, and they will include the same body data and the same headers. In the sense of the RFC, it's just like every redirection is confirmed.

+

enum t_http_codes

+
enum t_http_codes {
+    HTTP_CODE_CONTINUE = 100,
+    HTTP_CODE_SWITCHING_PROTOCOLS = 101,
+    HTTP_CODE_PROCESSING = 102,
+    HTTP_CODE_OK = 200,
+    HTTP_CODE_CREATED = 201,
+    HTTP_CODE_ACCEPTED = 202,
+    HTTP_CODE_NON_AUTHORITATIVE_INFORMATION = 203,
+    HTTP_CODE_NO_CONTENT = 204,
+    HTTP_CODE_RESET_CONTENT = 205,
+    HTTP_CODE_PARTIAL_CONTENT = 206,
+    HTTP_CODE_MULTI_STATUS = 207,
+    HTTP_CODE_ALREADY_REPORTED = 208,
+    HTTP_CODE_IM_USED = 226,
+    HTTP_CODE_MULTIPLE_CHOICES = 300,
+    HTTP_CODE_MOVED_PERMANENTLY = 301,
+    HTTP_CODE_FOUND = 302,
+    HTTP_CODE_SEE_OTHER = 303,
+    HTTP_CODE_NOT_MODIFIED = 304,
+    HTTP_CODE_USE_PROXY = 305,
+    HTTP_CODE_TEMPORARY_REDIRECT = 307,
+    HTTP_CODE_PERMANENT_REDIRECT = 308,
+    HTTP_CODE_BAD_REQUEST = 400,
+    HTTP_CODE_UNAUTHORIZED = 401,
+    HTTP_CODE_PAYMENT_REQUIRED = 402,
+    HTTP_CODE_FORBIDDEN = 403,
+    HTTP_CODE_NOT_FOUND = 404,
+    HTTP_CODE_METHOD_NOT_ALLOWED = 405,
+    HTTP_CODE_NOT_ACCEPTABLE = 406,
+    HTTP_CODE_PROXY_AUTHENTICATION_REQUIRED = 407,
+    HTTP_CODE_REQUEST_TIMEOUT = 408,
+    HTTP_CODE_CONFLICT = 409,
+    HTTP_CODE_GONE = 410,
+    HTTP_CODE_LENGTH_REQUIRED = 411,
+    HTTP_CODE_PRECONDITION_FAILED = 412,
+    HTTP_CODE_PAYLOAD_TOO_LARGE = 413,
+    HTTP_CODE_URI_TOO_LONG = 414,
+    HTTP_CODE_UNSUPPORTED_MEDIA_TYPE = 415,
+    HTTP_CODE_RANGE_NOT_SATISFIABLE = 416,
+    HTTP_CODE_EXPECTATION_FAILED = 417,
+    HTTP_CODE_MISDIRECTED_REQUEST = 421,
+    HTTP_CODE_UNPROCESSABLE_ENTITY = 422,
+    HTTP_CODE_LOCKED = 423,
+    HTTP_CODE_FAILED_DEPENDENCY = 424,
+    HTTP_CODE_UPGRADE_REQUIRED = 426,
+    HTTP_CODE_PRECONDITION_REQUIRED = 428,
+    HTTP_CODE_TOO_MANY_REQUESTS = 429,
+    HTTP_CODE_REQUEST_HEADER_FIELDS_TOO_LARGE = 431,
+    HTTP_CODE_INTERNAL_SERVER_ERROR = 500,
+    HTTP_CODE_NOT_IMPLEMENTED = 501,
+    HTTP_CODE_BAD_GATEWAY = 502,
+    HTTP_CODE_SERVICE_UNAVAILABLE = 503,
+    HTTP_CODE_GATEWAY_TIMEOUT = 504,
+    HTTP_CODE_HTTP_VERSION_NOT_SUPPORTED = 505,
+    HTTP_CODE_VARIANT_ALSO_NEGOTIATES = 506,
+    HTTP_CODE_INSUFFICIENT_STORAGE = 507,
+    HTTP_CODE_LOOP_DETECTED = 508,
+    HTTP_CODE_NOT_EXTENDED = 510,
+    HTTP_CODE_NETWORK_AUTHENTICATION_REQUIRED = 511
+};
+
+

enum transferEncoding_t

+
enum transferEncoding_t {
+    HTTPC_TE_IDENTITY,
+    HTTPC_TE_CHUNKED
+};
+
+

Macro Definition Documentation

+

define HTTPCLIENT_1_1_COMPATIBLE

+
#define HTTPCLIENT_1_1_COMPATIBLE 
+
+

HTTPClient.h

+

Created on: 02.11.2015

+

Copyright (c) 2015 Markus Sattler. All rights reserved. This file is part of the HTTPClient for Arduino. Port to ESP32 by Evandro Luis Copercini (2017), changed fingerprints to CA verification.

+

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

+

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

+

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

+

define HTTPCLIENT_DEFAULT_TCP_TIMEOUT

+
#define HTTPCLIENT_DEFAULT_TCP_TIMEOUT (5000)
+
+

define HTTPC_ERROR_CONNECTION_LOST

+
#define HTTPC_ERROR_CONNECTION_LOST (-5)
+
+

define HTTPC_ERROR_CONNECTION_REFUSED

+
#define HTTPC_ERROR_CONNECTION_REFUSED (-1)
+
+

define HTTPC_ERROR_ENCODING

+
#define HTTPC_ERROR_ENCODING (-9)
+
+

define HTTPC_ERROR_NOT_CONNECTED

+
#define HTTPC_ERROR_NOT_CONNECTED (-4)
+
+

define HTTPC_ERROR_NO_HTTP_SERVER

+
#define HTTPC_ERROR_NO_HTTP_SERVER (-7)
+
+

define HTTPC_ERROR_NO_STREAM

+
#define HTTPC_ERROR_NO_STREAM (-6)
+
+

define HTTPC_ERROR_READ_TIMEOUT

+
#define HTTPC_ERROR_READ_TIMEOUT (-11)
+
+

define HTTPC_ERROR_SEND_HEADER_FAILED

+
#define HTTPC_ERROR_SEND_HEADER_FAILED (-2)
+
+

define HTTPC_ERROR_SEND_PAYLOAD_FAILED

+
#define HTTPC_ERROR_SEND_PAYLOAD_FAILED (-3)
+
+

define HTTPC_ERROR_STREAM_WRITE

+
#define HTTPC_ERROR_STREAM_WRITE (-10)
+
+

define HTTPC_ERROR_TOO_LESS_RAM

+
#define HTTPC_ERROR_TOO_LESS_RAM (-8)
+
+

define HTTP_TCP_BUFFER_SIZE

+
#define HTTP_TCP_BUFFER_SIZE (1460)
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/HTTPClient/HTTPClient.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_h_t_t_p_client_8h_source/index.html b/ltapi/_h_t_t_p_client_8h_source/index.html new file mode 100644 index 000000000..818707bfd --- /dev/null +++ b/ltapi/_h_t_t_p_client_8h_source/index.html @@ -0,0 +1,2551 @@ + + + + + + + + + + + + + + + + + + + + File HTTPClient.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File HTTPClient.h

+

File List > arduino > libraries > ext > HTTPClient > HTTPClient.h

+

Go to the documentation of this file.

+
#ifndef HTTPClient_H_
+#define HTTPClient_H_
+
+#ifndef HTTPCLIENT_1_1_COMPATIBLE
+#define HTTPCLIENT_1_1_COMPATIBLE
+#endif
+
+#include <Arduino.h>
+#include <WiFiClient.h>
+#include <WiFiClientSecure.h>
+#include <memory>
+
+#include <vector>
+
+#define HTTPCLIENT_DEFAULT_TCP_TIMEOUT (5000)
+
+#define HTTPC_ERROR_CONNECTION_REFUSED  (-1)
+#define HTTPC_ERROR_SEND_HEADER_FAILED  (-2)
+#define HTTPC_ERROR_SEND_PAYLOAD_FAILED (-3)
+#define HTTPC_ERROR_NOT_CONNECTED       (-4)
+#define HTTPC_ERROR_CONNECTION_LOST     (-5)
+#define HTTPC_ERROR_NO_STREAM           (-6)
+#define HTTPC_ERROR_NO_HTTP_SERVER      (-7)
+#define HTTPC_ERROR_TOO_LESS_RAM        (-8)
+#define HTTPC_ERROR_ENCODING            (-9)
+#define HTTPC_ERROR_STREAM_WRITE        (-10)
+#define HTTPC_ERROR_READ_TIMEOUT        (-11)
+
+#define HTTP_TCP_BUFFER_SIZE (1460)
+
+typedef enum {
+    HTTP_CODE_CONTINUE                        = 100,
+    HTTP_CODE_SWITCHING_PROTOCOLS             = 101,
+    HTTP_CODE_PROCESSING                      = 102,
+    HTTP_CODE_OK                              = 200,
+    HTTP_CODE_CREATED                         = 201,
+    HTTP_CODE_ACCEPTED                        = 202,
+    HTTP_CODE_NON_AUTHORITATIVE_INFORMATION   = 203,
+    HTTP_CODE_NO_CONTENT                      = 204,
+    HTTP_CODE_RESET_CONTENT                   = 205,
+    HTTP_CODE_PARTIAL_CONTENT                 = 206,
+    HTTP_CODE_MULTI_STATUS                    = 207,
+    HTTP_CODE_ALREADY_REPORTED                = 208,
+    HTTP_CODE_IM_USED                         = 226,
+    HTTP_CODE_MULTIPLE_CHOICES                = 300,
+    HTTP_CODE_MOVED_PERMANENTLY               = 301,
+    HTTP_CODE_FOUND                           = 302,
+    HTTP_CODE_SEE_OTHER                       = 303,
+    HTTP_CODE_NOT_MODIFIED                    = 304,
+    HTTP_CODE_USE_PROXY                       = 305,
+    HTTP_CODE_TEMPORARY_REDIRECT              = 307,
+    HTTP_CODE_PERMANENT_REDIRECT              = 308,
+    HTTP_CODE_BAD_REQUEST                     = 400,
+    HTTP_CODE_UNAUTHORIZED                    = 401,
+    HTTP_CODE_PAYMENT_REQUIRED                = 402,
+    HTTP_CODE_FORBIDDEN                       = 403,
+    HTTP_CODE_NOT_FOUND                       = 404,
+    HTTP_CODE_METHOD_NOT_ALLOWED              = 405,
+    HTTP_CODE_NOT_ACCEPTABLE                  = 406,
+    HTTP_CODE_PROXY_AUTHENTICATION_REQUIRED   = 407,
+    HTTP_CODE_REQUEST_TIMEOUT                 = 408,
+    HTTP_CODE_CONFLICT                        = 409,
+    HTTP_CODE_GONE                            = 410,
+    HTTP_CODE_LENGTH_REQUIRED                 = 411,
+    HTTP_CODE_PRECONDITION_FAILED             = 412,
+    HTTP_CODE_PAYLOAD_TOO_LARGE               = 413,
+    HTTP_CODE_URI_TOO_LONG                    = 414,
+    HTTP_CODE_UNSUPPORTED_MEDIA_TYPE          = 415,
+    HTTP_CODE_RANGE_NOT_SATISFIABLE           = 416,
+    HTTP_CODE_EXPECTATION_FAILED              = 417,
+    HTTP_CODE_MISDIRECTED_REQUEST             = 421,
+    HTTP_CODE_UNPROCESSABLE_ENTITY            = 422,
+    HTTP_CODE_LOCKED                          = 423,
+    HTTP_CODE_FAILED_DEPENDENCY               = 424,
+    HTTP_CODE_UPGRADE_REQUIRED                = 426,
+    HTTP_CODE_PRECONDITION_REQUIRED           = 428,
+    HTTP_CODE_TOO_MANY_REQUESTS               = 429,
+    HTTP_CODE_REQUEST_HEADER_FIELDS_TOO_LARGE = 431,
+    HTTP_CODE_INTERNAL_SERVER_ERROR           = 500,
+    HTTP_CODE_NOT_IMPLEMENTED                 = 501,
+    HTTP_CODE_BAD_GATEWAY                     = 502,
+    HTTP_CODE_SERVICE_UNAVAILABLE             = 503,
+    HTTP_CODE_GATEWAY_TIMEOUT                 = 504,
+    HTTP_CODE_HTTP_VERSION_NOT_SUPPORTED      = 505,
+    HTTP_CODE_VARIANT_ALSO_NEGOTIATES         = 506,
+    HTTP_CODE_INSUFFICIENT_STORAGE            = 507,
+    HTTP_CODE_LOOP_DETECTED                   = 508,
+    HTTP_CODE_NOT_EXTENDED                    = 510,
+    HTTP_CODE_NETWORK_AUTHENTICATION_REQUIRED = 511
+} t_http_codes;
+
+typedef enum { HTTPC_TE_IDENTITY, HTTPC_TE_CHUNKED } transferEncoding_t;
+
+typedef enum {
+    HTTPC_DISABLE_FOLLOW_REDIRECTS,
+    HTTPC_STRICT_FOLLOW_REDIRECTS,
+    HTTPC_FORCE_FOLLOW_REDIRECTS
+} followRedirects_t;
+
+#ifdef HTTPCLIENT_1_1_COMPATIBLE
+class TransportTraits;
+typedef std::unique_ptr<TransportTraits> TransportTraitsPtr;
+#endif
+
+// cookie jar support
+typedef struct {
+    String host; // host which tries to set the cookie
+    time_t date; // timestamp of the response that set the cookie
+    String name;
+    String value;
+    String domain;
+    String path = "";
+
+    struct {
+        time_t date = 0;
+        bool valid  = false;
+    } expires;
+
+    struct {
+        time_t duration = 0;
+        bool valid      = false;
+    } max_age;
+
+    bool http_only = false;
+    bool secure    = false;
+} Cookie;
+
+typedef std::vector<Cookie> CookieJar;
+
+class HTTPClient {
+  public:
+    HTTPClient();
+    ~HTTPClient();
+
+    /*
+     * Since both begin() functions take a reference to client as a parameter, you need to
+     * ensure the client object lives the entire time of the HTTPClient
+     */
+    bool begin(WiFiClient &client, String url);
+    bool begin(WiFiClient &client, String host, uint16_t port, String uri = "/", bool https = false);
+
+#ifdef HTTPCLIENT_1_1_COMPATIBLE
+    bool begin(String url);
+    bool begin(String url, const char *CAcert);
+    bool begin(String host, uint16_t port, String uri = "/");
+    bool begin(String host, uint16_t port, String uri, const char *CAcert);
+    bool begin(String host, uint16_t port, String uri, const char *CAcert, const char *cli_cert, const char *cli_key);
+#endif
+
+    void end(void);
+
+    bool connected(void);
+
+    void setReuse(bool reuse); 
+    void setUserAgent(const String &userAgent);
+    void setAuthorization(const char *user, const char *password);
+    void setAuthorization(const char *auth);
+    void setAuthorizationType(const char *authType);
+    void setConnectTimeout(int32_t connectTimeout);
+    void setTimeout(uint16_t timeout);
+
+    // Redirections
+    void setFollowRedirects(followRedirects_t follow);
+    void setRedirectLimit(uint16_t limit); // max redirects to follow for a single request
+
+    bool setURL(const String &url);
+    void useHTTP10(bool usehttp10 = true);
+
+    int GET();
+    int PATCH(uint8_t *payload, size_t size);
+    int PATCH(String payload);
+    int POST(uint8_t *payload, size_t size);
+    int POST(String payload);
+    int PUT(uint8_t *payload, size_t size);
+    int PUT(String payload);
+    int sendRequest(const char *type, String payload);
+    int sendRequest(const char *type, uint8_t *payload = NULL, size_t size = 0);
+    int sendRequest(const char *type, Stream *stream, size_t size = 0);
+
+    void addHeader(const String &name, const String &value, bool first = false, bool replace = true);
+
+    void collectHeaders(const char *headerKeys[], const size_t headerKeysCount);
+    String header(const char *name);  // get request header value by name
+    String header(size_t i);          // get request header value by number
+    String headerName(size_t i);      // get request header name by number
+    int headers();                    // get header count
+    bool hasHeader(const char *name); // check if header exists
+
+    int getSize(void);
+    const String &getLocation(void);
+
+    WiFiClient &getStream(void);
+    WiFiClient *getStreamPtr(void);
+    int writeToStream(Stream *stream);
+    // String getString(void);
+
+    static String errorToString(int error);
+
+    void setCookieJar(CookieJar *cookieJar);
+    void resetCookieJar();
+    void clearAllCookies();
+
+  protected:
+    struct RequestArgument {
+        String key;
+        String value;
+    };
+
+    bool beginInternal(String url, const char *expectedProtocol);
+    void disconnect(bool preserveClient = false);
+    void clear();
+    int returnError(int error);
+    bool connect(void);
+    bool sendHeader(const char *type);
+    int handleHeaderResponse();
+    int writeToStreamDataBlock(Stream *stream, int len);
+
+    void setCookie(String date, String headerValue);
+    bool generateCookieString(String *cookieString);
+
+#ifdef HTTPCLIENT_1_1_COMPATIBLE
+    TransportTraitsPtr _transportTraits;
+    std::unique_ptr<WiFiClient> _tcpDeprecated;
+#endif
+
+    WiFiClient *_client = nullptr;
+
+    String _host;
+    uint16_t _port          = 0;
+    int32_t _connectTimeout = -1;
+    bool _reuse             = true;
+    uint16_t _tcpTimeout    = HTTPCLIENT_DEFAULT_TCP_TIMEOUT;
+    bool _useHTTP10         = false;
+    bool _secure            = false;
+
+    String _uri;
+    String _protocol;
+    String _headers;
+    String _userAgent = "ESP32HTTPClient";
+    String _base64Authorization;
+    String _authorizationType = "Basic";
+
+    RequestArgument *_currentHeaders = nullptr;
+    size_t _headerKeysCount          = 0;
+
+    int _returnCode                    = 0;
+    int _size                          = -1;
+    bool _canReuse                     = false;
+    followRedirects_t _followRedirects = HTTPC_DISABLE_FOLLOW_REDIRECTS;
+    uint16_t _redirectLimit            = 10;
+    String _location;
+    transferEncoding_t _transferEncoding = HTTPC_TE_IDENTITY;
+
+    CookieJar *_cookieJar = nullptr;
+};
+
+#endif /* HTTPClient_H_ */
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_hardware_i2_c_8h/index.html b/ltapi/_hardware_i2_c_8h/index.html new file mode 100644 index 000000000..e1b52f7b6 --- /dev/null +++ b/ltapi/_hardware_i2_c_8h/index.html @@ -0,0 +1,2328 @@ + + + + + + + + + + + + + + + + + + + + File HardwareI2C.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_hardware_i2_c_8h_source/index.html b/ltapi/_hardware_i2_c_8h_source/index.html new file mode 100644 index 000000000..adaf7d881 --- /dev/null +++ b/ltapi/_hardware_i2_c_8h_source/index.html @@ -0,0 +1,2360 @@ + + + + + + + + + + + + + + + + + + + + File HardwareI2C.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File HardwareI2C.h

+

File List > arduino > src > HardwareI2C.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-05-09. */
+
+#include <api/Stream.h>
+
+class HardwareI2C : public Stream {
+  protected:
+    int8_t _sda    = -1;
+    int8_t _scl    = -1;
+    uint32_t _freq = 0;
+
+    void (*onRequestCallback)(void);
+    void (*onReceiveCallback)(int);
+
+  public:
+    bool begin() {
+        return begin(_sda, _scl, _freq);
+    }
+
+    bool begin(uint8_t address) {
+        return begin(address, _sda, _scl, _freq);
+    }
+
+    virtual bool setPins(int8_t sda, int8_t scl) = 0;
+
+    virtual bool begin(int8_t sda, int8_t scl, uint32_t frequency = 0)                  = 0;
+    virtual bool begin(uint8_t address, int8_t sda, int8_t scl, uint32_t frequency = 0) = 0;
+    virtual bool end()                                                                  = 0;
+
+    virtual bool setClock(uint32_t freq) = 0;
+
+    virtual void beginTransmission(uint8_t address) = 0;
+    virtual uint8_t endTransmission(bool stopBit)   = 0;
+
+    virtual size_t requestFrom(uint8_t address, size_t len, bool stopBit) = 0;
+
+    virtual size_t write(const uint8_t *data, size_t len) = 0;
+
+    virtual int available() = 0;
+    virtual int read()      = 0;
+    virtual int peek()      = 0;
+    virtual void flush()    = 0;
+
+    uint32_t getClock() {
+        return _freq;
+    }
+
+    uint8_t endTransmission() {
+        return endTransmission(true);
+    }
+
+    size_t requestFrom(uint8_t address, size_t len) {
+        return requestFrom(address, len, true);
+    }
+
+    virtual size_t write(uint8_t data) {
+        return write(&data, 1);
+    }
+
+    void onReceive(void (*cb)(int)) {
+        onReceiveCallback = cb;
+    }
+
+    void onRequest(void (*cb)(void)) {
+        onRequestCallback = cb;
+    }
+};
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_i_pv6_address_8cpp/index.html b/ltapi/_i_pv6_address_8cpp/index.html new file mode 100644 index 000000000..37914382c --- /dev/null +++ b/ltapi/_i_pv6_address_8cpp/index.html @@ -0,0 +1,2300 @@ + + + + + + + + + + + + + + + + + + + + File IPv6Address.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_i_pv6_address_8cpp_source/index.html b/ltapi/_i_pv6_address_8cpp_source/index.html new file mode 100644 index 000000000..051c9fb01 --- /dev/null +++ b/ltapi/_i_pv6_address_8cpp_source/index.html @@ -0,0 +1,2393 @@ + + + + + + + + + + + + + + + + + + + + File IPv6Address.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File IPv6Address.cpp

+

File List > arduino > libraries > common > IPv6Address > IPv6Address.cpp

+

Go to the documentation of this file.

+
/*
+ IPv6Address.cpp - Base class that provides IPv6Address
+ Copyright (c) 2011 Adrian McEwen.  All right reserved.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "IPv6Address.h"
+
+#include <Arduino.h>
+#include <api/Print.h>
+
+IPv6Address::IPv6Address() {
+    memset(_address.bytes, 0, sizeof(_address.bytes));
+}
+
+IPv6Address::IPv6Address(const uint8_t *address) {
+    memcpy(_address.bytes, address, sizeof(_address.bytes));
+}
+
+IPv6Address::IPv6Address(const uint32_t *address) {
+    memcpy(_address.bytes, (const uint8_t *)address, sizeof(_address.bytes));
+}
+
+IPv6Address &IPv6Address::operator=(const uint8_t *address) {
+    memcpy(_address.bytes, address, sizeof(_address.bytes));
+    return *this;
+}
+
+bool IPv6Address::operator==(const uint8_t *addr) const {
+    return memcmp(addr, _address.bytes, sizeof(_address.bytes)) == 0;
+}
+
+size_t IPv6Address::printTo(Print &p) const {
+    /* size_t n = 0;
+    for(int i = 0; i < 16; i+=2) {
+        if(i){
+            n += p.print(':');
+        }
+        n += p.printf("%02x", _address.bytes[i]);
+        n += p.printf("%02x", _address.bytes[i+1]);
+
+    }
+    return n; */
+    return 0;
+}
+
+String IPv6Address::toString() const {
+    char szRet[40];
+    sprintf(
+        szRet,
+        "%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x",
+        _address.bytes[0],
+        _address.bytes[1],
+        _address.bytes[2],
+        _address.bytes[3],
+        _address.bytes[4],
+        _address.bytes[5],
+        _address.bytes[6],
+        _address.bytes[7],
+        _address.bytes[8],
+        _address.bytes[9],
+        _address.bytes[10],
+        _address.bytes[11],
+        _address.bytes[12],
+        _address.bytes[13],
+        _address.bytes[14],
+        _address.bytes[15]
+    );
+    return String(szRet);
+}
+
+bool IPv6Address::fromString(const char *address) {
+    // format 0011:2233:4455:6677:8899:aabb:ccdd:eeff
+    if (strlen(address) != 39) {
+        return false;
+    }
+    char *pos = (char *)address;
+    size_t i  = 0;
+    for (i = 0; i < 16; i += 2) {
+        if (!sscanf(pos, "%2hhx", &_address.bytes[i]) || !sscanf(pos + 2, "%2hhx", &_address.bytes[i + 1])) {
+            return false;
+        }
+        pos += 5;
+    }
+    return true;
+}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_i_pv6_address_8h/index.html b/ltapi/_i_pv6_address_8h/index.html new file mode 100644 index 000000000..467d0ae8d --- /dev/null +++ b/ltapi/_i_pv6_address_8h/index.html @@ -0,0 +1,2352 @@ + + + + + + + + + + + + + + + + + + + + File IPv6Address.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_i_pv6_address_8h_source/index.html b/ltapi/_i_pv6_address_8h_source/index.html new file mode 100644 index 000000000..998c59c05 --- /dev/null +++ b/ltapi/_i_pv6_address_8h_source/index.html @@ -0,0 +1,2391 @@ + + + + + + + + + + + + + + + + + + + + File IPv6Address.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File IPv6Address.h

+

File List > arduino > libraries > common > IPv6Address > IPv6Address.h

+

Go to the documentation of this file.

+
/*
+ IPv6Address.h - Base class that provides IPv6Address
+ Copyright (c) 2011 Adrian McEwen.  All right reserved.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#pragma once
+
+#include <api/Print.h>
+#include <api/String.h>
+#include <stdint.h>
+
+// A class to make it easier to handle and pass around IP addresses
+
+namespace arduino {
+
+class IPv6Address : public Printable {
+  private:
+    union {
+        uint8_t bytes[16]; // IPv4 address
+        uint32_t dword[4];
+    } _address;
+
+    // Access the raw byte array containing the address.  Because this returns a pointer
+    // to the internal structure rather than a copy of the address this function should only
+    // be used when you know that the usage of the returned uint8_t* will be transient and not
+    // stored.
+    uint8_t *raw_address() {
+        return _address.bytes;
+    }
+
+  public:
+    // Constructors
+    IPv6Address();
+    IPv6Address(const uint8_t *address);
+    IPv6Address(const uint32_t *address);
+
+    virtual ~IPv6Address() {}
+
+    bool fromString(const char *address);
+
+    bool fromString(const String &address) {
+        return fromString(address.c_str());
+    }
+
+    operator const uint8_t *() const {
+        return _address.bytes;
+    }
+
+    operator const uint32_t *() const {
+        return _address.dword;
+    }
+
+    bool operator==(const IPv6Address &addr) const {
+        return (_address.dword[0] == addr._address.dword[0]) && (_address.dword[1] == addr._address.dword[1]) &&
+               (_address.dword[2] == addr._address.dword[2]) && (_address.dword[3] == addr._address.dword[3]);
+    }
+
+    bool operator==(const uint8_t *addr) const;
+
+    // Overloaded index operator to allow getting and setting individual octets of the address
+    uint8_t operator[](int index) const {
+        return _address.bytes[index];
+    }
+
+    uint8_t &operator[](int index) {
+        return _address.bytes[index];
+    }
+
+    // Overloaded copy operators to allow initialisation of IPv6Address objects from other types
+    IPv6Address &operator=(const uint8_t *address);
+
+    // TODO implement printTo()
+    virtual size_t printTo(Print &p) const;
+    String toString() const;
+
+    friend class UDP;
+    friend class Client;
+    friend class Server;
+};
+
+} // namespace arduino
+
+using arduino::IPv6Address;
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_l_t_8h/index.html b/ltapi/_l_t_8h/index.html new file mode 100644 index 000000000..bb9e1eb42 --- /dev/null +++ b/ltapi/_l_t_8h/index.html @@ -0,0 +1,2465 @@ + + + + + + + + + + + + + + + + + + + + File LT.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File LT.h

+

FileList > arduino > libraries > inline > LT > LT.h

+

Go to the source code of this file.

+
    +
  • #include <Arduino.h>
  • +
  • #include <ESP.h>
  • +
  • #include <OTA.h>
  • +
  • #include <WDT.h>
  • +
+

Classes

+ + + + + + + + + + + + + +
TypeName
classLibreTiny
Main LibreTiny API class.
+

Public Attributes

+ + + + + + + + + + + + + +
TypeName
LibreTinyLT
+

Macros

+ + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
defineChipFamily lt_cpu_family_t
defineChipType lt_cpu_model_t
defineFlashId lt_flash_id_t
defineResetReason lt_reboot_reason_t
+

Public Attributes Documentation

+

variable LT

+
LibreTiny LT;
+
+

Macro Definition Documentation

+

define ChipFamily

+
#define ChipFamily lt_cpu_family_t
+
+

define ChipType

+
#define ChipType lt_cpu_model_t
+
+

define FlashId

+
#define FlashId lt_flash_id_t
+
+

define ResetReason

+
#define ResetReason lt_reboot_reason_t
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/inline/LT/LT.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_l_t_8h_source/index.html b/ltapi/_l_t_8h_source/index.html new file mode 100644 index 000000000..f8731c4fc --- /dev/null +++ b/ltapi/_l_t_8h_source/index.html @@ -0,0 +1,2373 @@ + + + + + + + + + + + + + + + + + + + + File LT.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File LT.h

+

File List > arduino > libraries > inline > LT > LT.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-06-06. */
+
+#pragma once
+
+#include <Arduino.h>
+#include <ESP.h>
+#include <OTA.h>
+#include <WDT.h>
+
+#ifdef __cplusplus
+
+#define ChipFamily  lt_cpu_family_t
+#define ChipType    lt_cpu_model_t
+#define ResetReason lt_reboot_reason_t
+#define FlashId     lt_flash_id_t
+
+class LibreTiny {
+  public: /* lt_cpu.h */
+    inline ChipFamily getChipFamily() { return lt_cpu_get_family(); }
+
+    inline const char *getChipFamilyName() { return lt_cpu_get_family_name(); }
+
+    inline ChipType getChipType() { return lt_cpu_get_model(); }
+
+    inline const char *getChipModel() { return lt_cpu_get_model_name(); }
+
+    inline uint32_t getChipId() { return lt_cpu_get_mac_id(); }
+
+    inline uint8_t getChipCores() { return lt_cpu_get_core_count(); }
+
+    inline const char *getChipCoreType() { return lt_cpu_get_core_type(); }
+
+    inline uint32_t getCpuFreq() { return lt_cpu_get_freq(); }
+
+    inline uint32_t getCpuFreqMHz() { return lt_cpu_get_freq_mhz(); }
+
+    inline uint32_t getCycleCount() { return lt_cpu_get_cycle_count(); }
+
+  public: /* lt_device.h */
+    inline const char *getVersion() { return lt_get_version(); }
+
+    inline const char *getBoard() { return lt_get_board_code(); }
+
+    inline const char *getDeviceName() { return lt_get_device_name(); }
+
+    inline void restart() { lt_reboot(); }
+
+    inline void restartDownloadMode() { lt_reboot_download_mode(); }
+
+    inline ResetReason getResetReason() { return lt_get_reboot_reason(); }
+
+    inline const char *getResetReasonName(ResetReason reason = lt_get_reboot_reason()) {
+        return lt_get_reboot_reason_name(reason);
+    }
+
+    inline void gpioRecover() { lt_gpio_recover(); }
+
+  public: /* lt_flash.h */
+    inline FlashId getFlashChipId() { return lt_flash_get_id(); }
+
+    inline uint32_t getFlashChipSize() { return lt_flash_get_size(); }
+
+  public: /* lt_mem.h */
+    inline uint32_t getRamSize() { return lt_ram_get_size(); }
+
+    inline uint32_t getHeapSize() { return lt_heap_get_size(); }
+
+    inline uint32_t getFreeHeap() { return lt_heap_get_free(); }
+
+    inline uint32_t getMinFreeHeap() { return lt_heap_get_min_free(); }
+
+    inline uint32_t getMaxAllocHeap() { return lt_heap_get_max_alloc(); }
+
+    inline uint32_t getMaxFreeBlockSize() { return lt_heap_get_max_alloc(); }
+};
+
+extern LibreTiny LT;
+
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_lw_i_p_client_8cpp/index.html b/ltapi/_lw_i_p_client_8cpp/index.html new file mode 100644 index 000000000..5e8f11f84 --- /dev/null +++ b/ltapi/_lw_i_p_client_8cpp/index.html @@ -0,0 +1,2295 @@ + + + + + + + + + + + + + + + + + + + + File LwIPClient.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_lw_i_p_client_8cpp_source/index.html b/ltapi/_lw_i_p_client_8cpp_source/index.html new file mode 100644 index 000000000..8b27888fb --- /dev/null +++ b/ltapi/_lw_i_p_client_8cpp_source/index.html @@ -0,0 +1,2687 @@ + + + + + + + + + + + + + + + + + + + + File LwIPClient.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File LwIPClient.cpp

+

File List > arduino > libraries > common > WiFiClient > LwIPClient.cpp

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-04-26. */
+
+#if LT_ARD_HAS_WIFI && LT_HAS_LWIP
+
+#include "LwIPClient.h"
+
+#include <WiFi.h>
+
+#define MAX_SOCK_NUM                4
+#define WIFI_CLIENT_CONNECT_TIMEOUT 3000
+#define WIFI_CLIENT_READ_TIMEOUT    3000
+#define WIFI_CLIENT_WRITE_RETRY     10
+#define WIFI_CLIENT_SELECT_TIMEOUT  1000
+#define WIFI_CLIENT_FLUSH_BUF_SIZE  1024
+
+// disable #defines removing lwip_ prefix
+#undef LWIP_COMPAT_SOCKETS
+#define LWIP_COMPAT_SOCKETS 0
+
+extern "C" {
+
+#include <lwip/api.h>
+#include <lwip/dns.h>
+#include <lwip/err.h>
+#include <lwip/sockets.h>
+#include <sys/time.h>
+
+} // extern "C"
+
+class SocketHandle {
+  public:
+    int fd;
+
+    SocketHandle(int fd) : fd(fd) {}
+
+    ~SocketHandle() {
+        lwip_close(fd);
+    }
+};
+
+LwIPClient::LwIPClient() {
+    LT_VM(CLIENT, "LwIPClient()");
+    _connected = false;
+    _sock      = NULL;
+    _rxBuffer  = NULL;
+    _timeout   = WIFI_CLIENT_CONNECT_TIMEOUT;
+}
+
+LwIPClient::LwIPClient(int sock) {
+    LT_VM(CLIENT, "LwIPClient(%d)", sock);
+    _connected = true;
+    _sock      = std::make_shared<SocketHandle>(sock);
+    _rxBuffer  = std::make_shared<LwIPRxBuffer>(sock);
+    _timeout   = WIFI_CLIENT_CONNECT_TIMEOUT;
+}
+
+LwIPClient::~LwIPClient() {
+    LT_VM(CLIENT, "~LwIPClient()");
+    stop();
+}
+
+LwIPClient &LwIPClient::operator=(const LwIPClient &other) {
+    stop();
+    _connected = other._connected;
+    _sock      = other._sock;
+    _rxBuffer  = other._rxBuffer;
+    return *this;
+}
+
+bool IWiFiClient::operator==(const IWiFiClient &other) const {
+    return fd() == other.fd() && remoteIP() == other.remoteIP() && remotePort() == other.remotePort();
+}
+
+int LwIPClient::connect(IPAddress ip, uint16_t port) {
+    return connect(ip, port, _timeout);
+}
+
+int LwIPClient::connect(const char *host, uint16_t port) {
+    return connect(host, port, _timeout);
+}
+
+int LwIPClient::connect(const char *host, uint16_t port, int32_t timeout) {
+    IPAddress ip = WiFi.hostByName(host);
+    if (!ip)
+        return 0;
+    return connect(ip, port, timeout);
+}
+
+int LwIPClient::connect(IPAddress ip, uint16_t port, int32_t timeout) {
+    if (_connected)
+        stop();
+    int sock = lwip_socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
+    if (sock < 0) {
+        LT_DM(CLIENT, "socket failed");
+        return -1;
+    }
+
+    if (timeout <= 0)
+        timeout = _timeout; // use default when -1 passed as timeout
+
+    lwip_fcntl(sock, F_SETFL, lwip_fcntl(sock, F_GETFL, 0) | O_NONBLOCK);
+
+    LT_ERRNO();
+
+    struct sockaddr_in addr;
+    memset(&addr, 0, sizeof(addr));
+    addr.sin_family      = AF_INET;
+    addr.sin_addr.s_addr = ip;
+    addr.sin_port        = htons(port);
+    fd_set fdset;
+    struct timeval tv;
+    FD_ZERO(&fdset);
+    FD_SET(sock, &fdset);
+    tv.tv_sec  = 0;
+    tv.tv_usec = timeout * 1000; // millis -> micros
+
+    int res = lwip_connect(sock, (struct sockaddr *)&addr, sizeof(addr));
+    if (res < 0 && errno != EINPROGRESS) {
+        LT_EM(CLIENT, "Connect failed; errno=%d", errno);
+        lwip_close(sock);
+        return -1;
+    }
+
+    res = lwip_select(sock + 1, NULL, &fdset, NULL, timeout < 0 ? NULL : &tv);
+    if (res < 0) {
+        LT_EM(CLIENT, "Select failed; errno=%d", errno);
+        lwip_close(sock);
+        return 0;
+    }
+    if (res == 0) {
+        LT_EM(CLIENT, "Select timeout; errno=%d", errno);
+        lwip_close(sock);
+        return 0;
+    }
+
+    int sockerr;
+    socklen_t len = (socklen_t)sizeof(sockerr);
+    res           = lwip_getsockopt(sock, SOL_SOCKET, SO_ERROR, &sockerr, &len);
+
+    if (res < 0 || sockerr != 0) {
+        LT_EM(CLIENT, "Socket error; res=%d, sockerr=%d", res, sockerr);
+        lwip_close(sock);
+        return 0;
+    }
+
+    int enable = 1;
+    lwip_setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout));
+    lwip_setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, &timeout, sizeof(timeout));
+    lwip_setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, &enable, sizeof(enable));
+    lwip_setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, &enable, sizeof(enable));
+
+    LT_ERRNO();
+
+    lwip_fcntl(sock, F_SETFL, lwip_fcntl(sock, F_GETFL, 0) & ~O_NONBLOCK);
+
+    LT_ERRNO();
+
+    _connected = true;
+    _sock      = std::make_shared<SocketHandle>(sock);
+    _rxBuffer  = std::make_shared<LwIPRxBuffer>(sock);
+    return 1;
+}
+
+size_t LwIPClient::write(uint8_t data) {
+    return write(&data, 1);
+}
+
+size_t LwIPClient::write(Stream &stream) {
+    uint8_t *buf = (uint8_t *)malloc(1360);
+    if (!buf) {
+        return 0;
+    }
+    size_t toRead = 0, toWrite = 0, written = 0;
+    size_t available = stream.available();
+    while (available) {
+        toRead  = (available > 1360) ? 1360 : available;
+        toWrite = stream.readBytes(buf, toRead);
+        written += write(buf, toWrite);
+        available = stream.available();
+    }
+    free(buf);
+    return written;
+}
+
+size_t LwIPClient::write(const uint8_t *buf, size_t size) {
+    if (_sock < 0 || !_connected || !size) {
+        setWriteError();
+        return 0;
+    }
+
+    int retry   = WIFI_CLIENT_WRITE_RETRY;
+    int written = 0;
+    while (retry) {
+        fd_set fdset;
+        struct timeval tv;
+        FD_ZERO(&fdset);
+        FD_SET(fd(), &fdset);
+        tv.tv_sec  = 0;
+        tv.tv_usec = WIFI_CLIENT_SELECT_TIMEOUT * 1000;
+        retry--;
+
+        if (lwip_select(fd() + 1, NULL, &fdset, NULL, &tv) < 0) {
+            LT_WM(CLIENT, "Select failed; errno=%d", errno);
+            return 0;
+        }
+
+        if (FD_ISSET(fd(), &fdset)) {
+            int res = lwip_send(fd(), buf, size, MSG_DONTWAIT);
+            if (res > 0) {
+                written += res;
+                if (res >= size) {
+                    retry = 0;
+                } else {
+                    buf += res;
+                    size -= res;
+                    retry = WIFI_CLIENT_WRITE_RETRY;
+                }
+            } else if (res < 0 && errno != EAGAIN) {
+                LT_WM(CLIENT, "Send failed; errno=%d", errno);
+                setWriteError(res);
+                _connected = false;
+                retry      = 0;
+            } else {
+                // Try again
+            }
+        }
+    }
+    LT_DM(CLIENT, "wrote %d bytes", written);
+    return written;
+}
+
+int LwIPClient::available() {
+    if (!_connected || !_rxBuffer)
+        return 0;
+    int res = _rxBuffer->available();
+    if (_rxBuffer->failed()) {
+        LT_ERRNO();
+        stop();
+    }
+    return res;
+}
+
+int LwIPClient::fd() const {
+    if (!_sock)
+        return -1;
+    return _sock->fd;
+}
+
+int LwIPClient::socket() {
+    return fd();
+}
+
+int LwIPClient::setTimeout(uint32_t seconds) {
+    Client::setTimeout(seconds * 1000);
+    lwip_setsockopt(fd(), SOL_SOCKET, SO_RCVTIMEO, &_timeout, sizeof(_timeout));
+    return lwip_setsockopt(fd(), SOL_SOCKET, SO_SNDTIMEO, &_timeout, sizeof(_timeout));
+}
+
+int LwIPClient::read() {
+    uint8_t data;
+    int res = read(&data, 1);
+    if (res < 0)
+        return res;
+    if (res == 0)
+        return -1;
+    return data;
+}
+
+int LwIPClient::read(uint8_t *buf, size_t size) {
+    int res = -1;
+    if (_rxBuffer) {
+        res = _rxBuffer->read(buf, size);
+        if (_rxBuffer->failed()) {
+            stop();
+        }
+    }
+    return res;
+}
+
+int LwIPClient::peek() {
+    int res = -1;
+    if (_rxBuffer) {
+        res = _rxBuffer->peek();
+        if (_rxBuffer->failed()) {
+            stop();
+        }
+    }
+    return res;
+}
+
+void LwIPClient::flush() {
+    int res;
+    size_t len = available();
+    if (!len)
+        return;
+    uint8_t *buf = (uint8_t *)malloc(WIFI_CLIENT_FLUSH_BUF_SIZE);
+    if (!buf)
+        return;
+    while (len) {
+        res = lwip_recv(fd(), buf, LWIP_MIN(len, WIFI_CLIENT_FLUSH_BUF_SIZE), MSG_DONTWAIT);
+        if (res < 0) {
+            stop();
+            break;
+        }
+        len -= res;
+    }
+    free(buf);
+}
+
+void LwIPClient::stop() {
+    LT_VM(CLIENT, "Stopping TCP");
+    _connected = false;
+    _sock      = NULL;
+    _rxBuffer  = NULL;
+}
+
+uint8_t LwIPClient::connected() {
+    if (_connected) {
+        uint8_t dummy;
+        if (lwip_recv(fd(), &dummy, 0, MSG_DONTWAIT) <= 0) {
+            switch (errno) {
+                case EWOULDBLOCK:
+                case ENOENT: // caused by vfs
+                case 0:
+                    _connected = true;
+                    break;
+                case ENOTCONN:
+                case EPIPE:
+                case ECONNRESET:
+                case ECONNREFUSED:
+                case ECONNABORTED:
+                    LT_IM(CLIENT, "Connection closed; errno=%d", errno);
+                    _connected = false;
+                    break;
+                default:
+                    LT_WM(CLIENT, "Connection status unknown; errno=%d", errno);
+                    _connected = true;
+                    break;
+            }
+        }
+    }
+    return _connected;
+}
+
+IPAddress __attribute__((noinline)) getaddr(int sock, int (*func)(int, struct sockaddr *, socklen_t *)) {
+    struct sockaddr addr;
+    socklen_t len = sizeof(addr);
+    func(sock, &addr, &len);
+    struct sockaddr_in *s = (struct sockaddr_in *)&addr;
+    return IPAddress((uint32_t)(s->sin_addr.s_addr));
+}
+
+uint16_t __attribute__((noinline)) getport(int sock, int (*func)(int, struct sockaddr *, socklen_t *)) {
+    struct sockaddr addr;
+    socklen_t len = sizeof(addr);
+    func(sock, &addr, &len);
+    struct sockaddr_in *s = (struct sockaddr_in *)&addr;
+    return ntohs(s->sin_port);
+}
+
+IPAddress LwIPClient::remoteIP() const {
+    return getaddr(fd(), lwip_getpeername);
+}
+
+IPAddress LwIPClient::remoteIP(int fd) const {
+    return getaddr(fd, lwip_getpeername);
+}
+
+uint16_t LwIPClient::remotePort() const {
+    return getport(fd(), lwip_getpeername);
+}
+
+uint16_t LwIPClient::remotePort(int fd) const {
+    return getport(fd, lwip_getpeername);
+}
+
+IPAddress LwIPClient::localIP() const {
+    return getaddr(fd(), lwip_getsockname);
+}
+
+IPAddress LwIPClient::localIP(int fd) const {
+    return getaddr(fd, lwip_getsockname);
+}
+
+uint16_t LwIPClient::localPort() const {
+    return getport(fd(), lwip_getsockname);
+}
+
+uint16_t LwIPClient::localPort(int fd) const {
+    return getport(fd, lwip_getsockname);
+}
+
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_lw_i_p_client_8h/index.html b/ltapi/_lw_i_p_client_8h/index.html new file mode 100644 index 000000000..d2826647a --- /dev/null +++ b/ltapi/_lw_i_p_client_8h/index.html @@ -0,0 +1,2376 @@ + + + + + + + + + + + + + + + + + + + + File LwIPClient.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File LwIPClient.h

+

FileList > arduino > libraries > common > WiFiClient > LwIPClient.h

+

Go to the source code of this file.

+
    +
  • #include "WiFiClient.h"
  • +
  • #include "LwIPRxBuffer.h"
  • +
  • #include <memory>
  • +
+

Classes

+ + + + + + + + + + + + + +
TypeName
classLwIPClient
+

Public Types

+ + + + + + + + + + + + + +
TypeName
typedef LwIPClientWiFiClient
+

Public Types Documentation

+

typedef WiFiClient

+
typedef LwIPClient WiFiClient;
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiClient/LwIPClient.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_lw_i_p_client_8h_source/index.html b/ltapi/_lw_i_p_client_8h_source/index.html new file mode 100644 index 000000000..479a853c5 --- /dev/null +++ b/ltapi/_lw_i_p_client_8h_source/index.html @@ -0,0 +1,2356 @@ + + + + + + + + + + + + + + + + + + + + File LwIPClient.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File LwIPClient.h

+

File List > arduino > libraries > common > WiFiClient > LwIPClient.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-04-26. */
+
+#pragma once
+
+#if (LT_ARD_HAS_WIFI && LT_HAS_LWIP) || DOXYGEN
+
+#include "WiFiClient.h"
+
+#include "LwIPRxBuffer.h"
+#include <memory>
+
+class SocketHandle;
+
+class LwIPClient : public IWiFiClient {
+  private:
+    bool _connected;
+    std::shared_ptr<SocketHandle> _sock;
+    std::shared_ptr<LwIPRxBuffer> _rxBuffer;
+
+  public:
+    LwIPClient();
+    LwIPClient(int sock);
+    ~LwIPClient();
+
+    int connect(IPAddress ip, uint16_t port);
+    int connect(const char *host, uint16_t port);
+    int connect(IPAddress ip, uint16_t port, int32_t timeout);
+    int connect(const char *host, uint16_t port, int32_t timeout);
+
+    size_t write(uint8_t data);
+    size_t write(const uint8_t *buf, size_t size);
+    size_t write(Stream &stream);
+
+    int available();
+    int fd() const;
+    int socket();
+    int setTimeout(uint32_t seconds);
+
+    int read();
+    int read(uint8_t *buf, size_t size);
+    int peek();
+    void flush();
+    void stop();
+    uint8_t connected();
+
+    LwIPClient &operator=(const LwIPClient &other);
+
+    IPAddress remoteIP() const;
+    IPAddress remoteIP(int sock) const;
+    uint16_t remotePort() const;
+    uint16_t remotePort(int sock) const;
+    IPAddress localIP() const;
+    IPAddress localIP(int sock) const;
+    uint16_t localPort() const;
+    uint16_t localPort(int sock) const;
+
+    using Print::write;
+};
+
+typedef LwIPClient WiFiClient;
+
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_lw_i_p_rx_buffer_8cpp/index.html b/ltapi/_lw_i_p_rx_buffer_8cpp/index.html new file mode 100644 index 000000000..2f09c173a --- /dev/null +++ b/ltapi/_lw_i_p_rx_buffer_8cpp/index.html @@ -0,0 +1,2295 @@ + + + + + + + + + + + + + + + + + + + + File LwIPRxBuffer.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_lw_i_p_rx_buffer_8cpp_source/index.html b/ltapi/_lw_i_p_rx_buffer_8cpp_source/index.html new file mode 100644 index 000000000..c6945ef73 --- /dev/null +++ b/ltapi/_lw_i_p_rx_buffer_8cpp_source/index.html @@ -0,0 +1,2411 @@ + + + + + + + + + + + + + + + + + + + + File LwIPRxBuffer.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File LwIPRxBuffer.cpp

+

File List > arduino > libraries > common > WiFiClient > LwIPRxBuffer.cpp

+

Go to the documentation of this file.

+
#if LT_HAS_LWIP
+
+#include "LwIPRxBuffer.h"
+
+// disable #defines removing lwip_ prefix
+#undef LWIP_COMPAT_SOCKETS
+#define LWIP_COMPAT_SOCKETS 0
+
+extern "C" {
+
+#include <lwip/sockets.h>
+
+} // extern "C"
+
+size_t LwIPRxBuffer::r_available() {
+    if (_sock < 0) {
+        LT_DM(CLIENT, "_sock < 0");
+        return 0;
+    }
+    int count = 0; // must be of same size as in lwip_ioctl()
+    int res   = lwip_ioctl(_sock, FIONREAD, &count);
+    if (res < 0) {
+        LT_DM(CLIENT, "lwip_ioctl()=%d, errno=%d", res, errno);
+        _failed = true;
+        return 0;
+    }
+    return count;
+}
+
+size_t LwIPRxBuffer::fillBuffer() {
+    if (!_buffer) {
+        _buffer = (uint8_t *)malloc(_size);
+        if (!_buffer) {
+            LT_E("buffer alloc failed");
+            _failed = true;
+            return 0;
+        }
+    }
+    if (_fill && _pos == _fill) {
+        _fill = 0;
+        _pos  = 0;
+    }
+    if (!_buffer || _size <= _fill || !r_available()) {
+        return 0;
+    }
+    int res = lwip_recv(_sock, _buffer + _fill, _size - _fill, MSG_DONTWAIT);
+    if (res < 0) {
+        if (errno != EWOULDBLOCK) {
+            LT_ERRNO();
+            _failed = true;
+        }
+        return 0;
+    }
+    _fill += res;
+    return res;
+}
+
+LwIPRxBuffer::LwIPRxBuffer(int sock, size_t size)
+    : _size(size), _buffer(NULL), _pos(0), _fill(0), _sock(sock), _failed(false) {
+    //_buffer = (uint8_t *)malloc(_size);
+}
+
+LwIPRxBuffer::~LwIPRxBuffer() {
+    free(_buffer);
+}
+
+bool LwIPRxBuffer::failed() {
+    return _failed;
+}
+
+int LwIPRxBuffer::read(uint8_t *dst, size_t len) {
+    if (!dst || !len || (_pos == _fill && !fillBuffer())) {
+        return _failed ? -1 : 0;
+    }
+    size_t a = _fill - _pos;
+    if (len <= a || ((len - a) <= (_size - _fill) && fillBuffer() >= (len - a))) {
+        if (len == 1) {
+            *dst = _buffer[_pos];
+        } else {
+            memcpy(dst, _buffer + _pos, len);
+        }
+        _pos += len;
+        return len;
+    }
+    size_t left   = len;
+    size_t toRead = a;
+    uint8_t *buf  = dst;
+    memcpy(buf, _buffer + _pos, toRead);
+    _pos += toRead;
+    left -= toRead;
+    buf += toRead;
+    while (left) {
+        if (!fillBuffer()) {
+            return len - left;
+        }
+        a      = _fill - _pos;
+        toRead = (a > left) ? left : a;
+        memcpy(buf, _buffer + _pos, toRead);
+        _pos += toRead;
+        left -= toRead;
+        buf += toRead;
+    }
+    return len;
+}
+
+int LwIPRxBuffer::peek() {
+    if (_pos == _fill && !fillBuffer()) {
+        return -1;
+    }
+    return _buffer[_pos];
+}
+
+size_t LwIPRxBuffer::available() {
+    return _fill - _pos + r_available();
+}
+
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_lw_i_p_rx_buffer_8h/index.html b/ltapi/_lw_i_p_rx_buffer_8h/index.html new file mode 100644 index 000000000..011a11123 --- /dev/null +++ b/ltapi/_lw_i_p_rx_buffer_8h/index.html @@ -0,0 +1,2329 @@ + + + + + + + + + + + + + + + + + + + + File LwIPRxBuffer.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_lw_i_p_rx_buffer_8h_source/index.html b/ltapi/_lw_i_p_rx_buffer_8h_source/index.html new file mode 100644 index 000000000..b716c1bb8 --- /dev/null +++ b/ltapi/_lw_i_p_rx_buffer_8h_source/index.html @@ -0,0 +1,2318 @@ + + + + + + + + + + + + + + + + + + + + File LwIPRxBuffer.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File LwIPRxBuffer.h

+

File List > arduino > libraries > common > WiFiClient > LwIPRxBuffer.h

+

Go to the documentation of this file.

+
#pragma once
+
+#include <Arduino.h>
+#include <stdlib.h>
+
+class LwIPRxBuffer {
+  private:
+    size_t _size;
+    uint8_t *_buffer;
+    size_t _pos;
+    size_t _fill;
+    int _sock;
+    bool _failed;
+    size_t r_available();
+    size_t fillBuffer();
+
+  public:
+    LwIPRxBuffer(int sock, size_t size = 1436);
+    ~LwIPRxBuffer();
+    bool failed();
+    int read(uint8_t *dst, size_t len);
+    int peek();
+    size_t available();
+};
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_lw_i_p_server_8cpp/index.html b/ltapi/_lw_i_p_server_8cpp/index.html new file mode 100644 index 000000000..d95c81474 --- /dev/null +++ b/ltapi/_lw_i_p_server_8cpp/index.html @@ -0,0 +1,2295 @@ + + + + + + + + + + + + + + + + + + + + File LwIPServer.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_lw_i_p_server_8cpp_source/index.html b/ltapi/_lw_i_p_server_8cpp_source/index.html new file mode 100644 index 000000000..d37c8d174 --- /dev/null +++ b/ltapi/_lw_i_p_server_8cpp_source/index.html @@ -0,0 +1,2437 @@ + + + + + + + + + + + + + + + + + + + + File LwIPServer.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File LwIPServer.cpp

+

File List > arduino > libraries > common > WiFiServer > LwIPServer.cpp

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-04-26. */
+
+#if LT_ARD_HAS_WIFI && LT_HAS_LWIP
+
+#include "LwIPServer.h"
+
+// disable #defines removing lwip_ prefix
+#undef LWIP_COMPAT_SOCKETS
+#define LWIP_COMPAT_SOCKETS 0
+
+extern "C" {
+#include <lwip/api.h>
+// #include <lwip/dns.h>
+#include <lwip/err.h>
+#include <lwip/sockets.h>
+#include <sys/time.h>
+}
+
+LwIPServer::LwIPServer(uint32_t addr, uint16_t port, uint8_t maxClients)
+    : _sock(-1), _sockAccepted(-1), _addr(addr), _port(port), _maxClients(maxClients), _active(false), _noDelay(false) {
+}
+
+LwIPServer::operator bool() {
+    return _active;
+}
+
+bool LwIPServer::begin(uint16_t port, bool reuseAddr) {
+    if (_active)
+        return true;
+    if (port)
+        _port = port;
+
+    _sock = lwip_socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
+    if (_sock < 0) {
+        LT_EM(SERVER, "Socket failed; errno=%d", errno);
+        return false;
+    }
+
+    int enable = reuseAddr;
+    lwip_setsockopt(_sock, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(enable));
+
+    struct sockaddr_in addr;
+    addr.sin_family      = AF_INET;
+    addr.sin_addr.s_addr = _addr;
+    addr.sin_port        = htons(_port);
+
+    if (lwip_bind(_sock, (struct sockaddr *)&addr, sizeof(addr)) < 0) {
+        LT_EM(SERVER, "Bind failed; errno=%d", errno);
+        return false;
+    }
+
+    if (lwip_listen(_sock, _maxClients) < 0) {
+        LT_EM(SERVER, "Bind failed; errno=%d", errno);
+        return false;
+    }
+
+    uint8_t *addrB = (uint8_t *)&_addr;
+    LT_IM(SERVER, "Server running on %hhu.%hhu.%hhu.%hhu:%hu", addrB[0], addrB[1], addrB[2], addrB[3], _port);
+
+    lwip_fcntl(_sock, F_SETFL, O_NONBLOCK);
+    _active       = true;
+    _noDelay      = false;
+    _sockAccepted = -1;
+    return true;
+}
+
+void LwIPServer::end() {
+    if (_sock == -1)
+        return;
+    lwip_close(_sock);
+    _sock   = -1;
+    _active = -1;
+}
+
+WiFiClient LwIPServer::accept() {
+    if (!_active)
+        return WiFiClient();
+
+    int sock;
+    if (_sockAccepted >= 0) {
+        sock          = _sockAccepted;
+        _sockAccepted = -1;
+    } else {
+        struct sockaddr_in addr;
+        socklen_t len = sizeof(addr);
+        sock          = lwip_accept(_sock, (struct sockaddr *)&addr, &len);
+    }
+
+    if (sock >= 0) {
+        int enable = 1;
+        if (lwip_setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, &enable, sizeof(enable)) == ERR_OK) {
+            enable = _noDelay;
+            if (lwip_setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, &enable, sizeof(enable)) == ERR_OK) {
+                // HOTFIX: allow the TCP thread to receive data
+                // I'm not sure what's happening there, so this should probably be fixed properly.
+                // When a connection arrives, sometimes TCP hasn't received anything yet. This causes
+                // calling WiFiClient::connected() check for lwip_recv(), which returns EWOULDBLOCK
+                // as the client is still connected. The problem is that there's basically an infinite loop
+                // created: nowhere in that code is a yield()/delay() that would allow TCP thread to work
+                // and receive data, so LwIP still sees a connected client that sends nothing. At least
+                // that's what I understand. And any loop that doesn't call delay() seems to block the TCP
+                // stack completely and prevents it from even being pinged.
+                LT_DM(SERVER, "Got client");
+                delay(5);
+                return WiFiClient(sock);
+            }
+        }
+    }
+
+    return WiFiClient();
+}
+
+int LwIPServer::setTimeout(uint32_t seconds) {
+    struct timeval tv;
+    tv.tv_sec  = seconds;
+    tv.tv_usec = 0;
+    if (lwip_setsockopt(_sock, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv)) < 0)
+        return -1;
+    return lwip_setsockopt(_sock, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv));
+}
+
+void LwIPServer::setNoDelay(bool noDelay) {
+    _noDelay = noDelay;
+}
+
+bool LwIPServer::getNoDelay() {
+    return _noDelay;
+}
+
+bool LwIPServer::hasClient() {
+    if (_sockAccepted >= 0) {
+        return true;
+    }
+    struct sockaddr_in addr;
+    socklen_t len = sizeof(addr);
+    _sockAccepted = lwip_accept(_sock, (struct sockaddr *)&addr, &len);
+    if (_sockAccepted >= 0) {
+        return true;
+    }
+    return false;
+}
+
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_lw_i_p_server_8h/index.html b/ltapi/_lw_i_p_server_8h/index.html new file mode 100644 index 000000000..654875ca8 --- /dev/null +++ b/ltapi/_lw_i_p_server_8h/index.html @@ -0,0 +1,2374 @@ + + + + + + + + + + + + + + + + + + + + File LwIPServer.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File LwIPServer.h

+

FileList > arduino > libraries > common > WiFiServer > LwIPServer.h

+

Go to the source code of this file.

+
    +
  • #include "WiFiServer.h"
  • +
+

Classes

+ + + + + + + + + + + + + +
TypeName
classLwIPServer
+

Public Types

+ + + + + + + + + + + + + +
TypeName
typedef LwIPServerWiFiServer
+

Public Types Documentation

+

typedef WiFiServer

+
typedef LwIPServer WiFiServer;
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiServer/LwIPServer.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_lw_i_p_server_8h_source/index.html b/ltapi/_lw_i_p_server_8h_source/index.html new file mode 100644 index 000000000..ac31572e9 --- /dev/null +++ b/ltapi/_lw_i_p_server_8h_source/index.html @@ -0,0 +1,2344 @@ + + + + + + + + + + + + + + + + + + + + File LwIPServer.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File LwIPServer.h

+

File List > arduino > libraries > common > WiFiServer > LwIPServer.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-04-26. */
+
+#pragma once
+
+#if (LT_ARD_HAS_WIFI && LT_HAS_LWIP) || DOXYGEN
+
+#include "WiFiServer.h"
+
+class LwIPServer : public IWiFiServer<WiFiClient> {
+  private:
+    int _sock;
+    int _sockAccepted;
+    uint32_t _addr;
+    uint16_t _port;
+    uint8_t _maxClients;
+    bool _active;
+    bool _noDelay = false;
+
+  private:
+    LwIPServer(uint32_t addr, uint16_t port = 80, uint8_t maxClients = 4);
+
+  public:
+    LwIPServer(uint16_t port = 80, uint8_t maxClients = 4) : LwIPServer((uint32_t)0, port, maxClients) {}
+
+    LwIPServer(int port = 80, uint8_t maxClients = 4) : LwIPServer((uint32_t)0, port, maxClients) {}
+
+    LwIPServer(const IPAddress &addr, uint16_t port = 80, uint8_t maxClients = 4)
+        : LwIPServer((uint32_t)addr, port, maxClients) {}
+
+    operator bool();
+
+    bool begin(uint16_t port = 0, bool reuseAddr = true);
+    void end();
+    WiFiClient accept();
+
+    size_t write(const uint8_t *buffer, size_t size) {
+        return 0;
+    }
+
+    void stopAll() {}
+
+    int setTimeout(uint32_t seconds);
+    void setNoDelay(bool noDelay);
+    bool getNoDelay();
+    bool hasClient();
+};
+
+typedef LwIPServer WiFiServer;
+
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_lw_i_p_udp_8cpp/index.html b/ltapi/_lw_i_p_udp_8cpp/index.html new file mode 100644 index 000000000..795789c25 --- /dev/null +++ b/ltapi/_lw_i_p_udp_8cpp/index.html @@ -0,0 +1,2295 @@ + + + + + + + + + + + + + + + + + + + + File LwIPUdp.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_lw_i_p_udp_8cpp_source/index.html b/ltapi/_lw_i_p_udp_8cpp_source/index.html new file mode 100644 index 000000000..8970124e1 --- /dev/null +++ b/ltapi/_lw_i_p_udp_8cpp_source/index.html @@ -0,0 +1,2579 @@ + + + + + + + + + + + + + + + + + + + + File LwIPUdp.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File LwIPUdp.cpp

+

File List > arduino > libraries > common > WiFiUdp > LwIPUdp.cpp

+

Go to the documentation of this file.

+
/*
+  Udp.cpp - UDP class for Raspberry Pi
+  Copyright (c) 2016 Hristo Gochkov  All right reserved.
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License, or (at your option) any later version.
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+#if LT_ARD_HAS_WIFI && LT_HAS_LWIP
+
+#include "LwIPUdp.h"
+
+extern "C" {
+
+#include <lwip/netdb.h>
+#include <lwip/sockets.h>
+
+} // extern "C"
+
+#undef write
+#undef read
+
+LwIPUDP::LwIPUDP() : udp_server(-1), server_port(0), remote_port(0), tx_buffer(0), tx_buffer_len(0), rx_buffer(0) {}
+
+LwIPUDP::~LwIPUDP() {
+    stop();
+}
+
+uint8_t LwIPUDP::begin(IPAddress address, uint16_t port) {
+    stop();
+
+    server_port = port;
+
+    tx_buffer = new char[1460];
+    if (!tx_buffer) {
+        log_e("could not create tx buffer: %d", errno);
+        return 0;
+    }
+
+    if ((udp_server = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {
+        log_e("could not create socket: %d", errno);
+        return 0;
+    }
+
+    int yes = 1;
+    if (setsockopt(udp_server, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)) < 0) {
+        log_e("could not set socket option: %d", errno);
+        stop();
+        return 0;
+    }
+
+    struct sockaddr_in addr;
+    memset((char *)&addr, 0, sizeof(addr));
+    addr.sin_family      = AF_INET;
+    addr.sin_port        = htons(server_port);
+    addr.sin_addr.s_addr = (in_addr_t)address;
+    if (bind(udp_server, (struct sockaddr *)&addr, sizeof(addr)) == -1) {
+        log_e("could not bind socket: %d", errno);
+        stop();
+        return 0;
+    }
+    fcntl(udp_server, F_SETFL, O_NONBLOCK);
+    return 1;
+}
+
+uint8_t LwIPUDP::begin(uint16_t p) {
+    return begin(IPAddress((uint32_t)INADDR_ANY), p);
+}
+
+uint8_t LwIPUDP::beginMulticast(IPAddress a, uint16_t p) {
+    if (begin(IPAddress((uint32_t)INADDR_ANY), p)) {
+        if ((uint32_t)a != 0) {
+            struct ip_mreq mreq;
+            mreq.imr_multiaddr.s_addr = (in_addr_t)a;
+            mreq.imr_interface.s_addr = INADDR_ANY;
+            if (setsockopt(udp_server, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)) < 0) {
+                log_e("could not join igmp: %d", errno);
+                stop();
+                return 0;
+            }
+            multicast_ip = a;
+        }
+        return 1;
+    }
+    return 0;
+}
+
+void LwIPUDP::stop() {
+    if (tx_buffer) {
+        delete[] tx_buffer;
+        tx_buffer = NULL;
+    }
+    tx_buffer_len = 0;
+    if (rx_buffer) {
+        cbuf *b   = rx_buffer;
+        rx_buffer = NULL;
+        delete b;
+    }
+    if (udp_server == -1)
+        return;
+    if ((uint32_t)multicast_ip != 0) {
+        struct ip_mreq mreq;
+        mreq.imr_multiaddr.s_addr = (in_addr_t)multicast_ip;
+        mreq.imr_interface.s_addr = (in_addr_t)0;
+        setsockopt(udp_server, IPPROTO_IP, IP_DROP_MEMBERSHIP, &mreq, sizeof(mreq));
+        multicast_ip = IPAddress((uint32_t)INADDR_ANY);
+    }
+    close(udp_server);
+    udp_server = -1;
+}
+
+int LwIPUDP::beginMulticastPacket() {
+    if (!server_port || multicast_ip == IPAddress((uint32_t)INADDR_ANY))
+        return 0;
+    remote_ip   = multicast_ip;
+    remote_port = server_port;
+    return beginPacket();
+}
+
+int LwIPUDP::beginPacket() {
+    if (!remote_port)
+        return 0;
+
+    // allocate tx_buffer if is necessary
+    if (!tx_buffer) {
+        tx_buffer = new char[1460];
+        if (!tx_buffer) {
+            log_e("could not create tx buffer: %d", errno);
+            return 0;
+        }
+    }
+
+    tx_buffer_len = 0;
+
+    // check whereas socket is already open
+    if (udp_server != -1)
+        return 1;
+
+    if ((udp_server = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {
+        log_e("could not create socket: %d", errno);
+        return 0;
+    }
+
+    fcntl(udp_server, F_SETFL, O_NONBLOCK);
+
+    return 1;
+}
+
+int LwIPUDP::beginPacket(IPAddress ip, uint16_t port) {
+    remote_ip   = ip;
+    remote_port = port;
+    return beginPacket();
+}
+
+int LwIPUDP::beginPacket(const char *host, uint16_t port) {
+    struct hostent *server;
+    server = gethostbyname(host);
+    if (server == NULL) {
+        log_e("could not get host from dns: %d", errno);
+        return 0;
+    }
+    return beginPacket(IPAddress((const uint8_t *)(server->h_addr_list[0])), port);
+}
+
+int LwIPUDP::endPacket() {
+    struct sockaddr_in recipient;
+    recipient.sin_addr.s_addr = (uint32_t)remote_ip;
+    recipient.sin_family      = AF_INET;
+    recipient.sin_port        = htons(remote_port);
+    int sent = sendto(udp_server, tx_buffer, tx_buffer_len, 0, (struct sockaddr *)&recipient, sizeof(recipient));
+    if (sent < 0) {
+        log_e("could not send data: %d", errno);
+        return 0;
+    }
+    return 1;
+}
+
+size_t LwIPUDP::write(uint8_t data) {
+    if (tx_buffer_len == 1460) {
+        endPacket();
+        tx_buffer_len = 0;
+    }
+    tx_buffer[tx_buffer_len++] = data;
+    return 1;
+}
+
+size_t LwIPUDP::write(const uint8_t *buffer, size_t size) {
+    size_t i;
+    for (i = 0; i < size; i++)
+        write(buffer[i]);
+    return i;
+}
+
+int LwIPUDP::parsePacket() {
+    if (rx_buffer)
+        return 0;
+    struct sockaddr_in si_other;
+    int slen  = sizeof(si_other), len;
+    char *buf = new char[1460];
+    if (!buf) {
+        return 0;
+    }
+    if ((len = recvfrom(udp_server, buf, 1460, MSG_DONTWAIT, (struct sockaddr *)&si_other, (socklen_t *)&slen)) == -1) {
+        delete[] buf;
+        if (errno == EWOULDBLOCK) {
+            return 0;
+        }
+        log_e("could not receive data: %d", errno);
+        return 0;
+    }
+    remote_ip   = IPAddress(si_other.sin_addr.s_addr);
+    remote_port = ntohs(si_other.sin_port);
+    if (len > 0) {
+        rx_buffer = new cbuf(len);
+        rx_buffer->write(buf, len);
+    }
+    delete[] buf;
+    return len;
+}
+
+int LwIPUDP::available() {
+    if (!rx_buffer)
+        return 0;
+    return rx_buffer->available();
+}
+
+int LwIPUDP::read() {
+    if (!rx_buffer)
+        return -1;
+    int out = rx_buffer->read();
+    if (!rx_buffer->available()) {
+        cbuf *b   = rx_buffer;
+        rx_buffer = 0;
+        delete b;
+    }
+    return out;
+}
+
+int LwIPUDP::read(unsigned char *buffer, size_t len) {
+    return read((char *)buffer, len);
+}
+
+int LwIPUDP::read(char *buffer, size_t len) {
+    if (!rx_buffer)
+        return 0;
+    int out = rx_buffer->read(buffer, len);
+    if (!rx_buffer->available()) {
+        cbuf *b   = rx_buffer;
+        rx_buffer = 0;
+        delete b;
+    }
+    return out;
+}
+
+int LwIPUDP::peek() {
+    if (!rx_buffer)
+        return -1;
+    return rx_buffer->peek();
+}
+
+void LwIPUDP::flush() {
+    if (!rx_buffer)
+        return;
+    cbuf *b   = rx_buffer;
+    rx_buffer = 0;
+    delete b;
+}
+
+IPAddress LwIPUDP::remoteIP() {
+    return remote_ip;
+}
+
+uint16_t LwIPUDP::remotePort() {
+    return remote_port;
+}
+
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_lw_i_p_udp_8h/index.html b/ltapi/_lw_i_p_udp_8h/index.html new file mode 100644 index 000000000..d6960f64a --- /dev/null +++ b/ltapi/_lw_i_p_udp_8h/index.html @@ -0,0 +1,2375 @@ + + + + + + + + + + + + + + + + + + + + File LwIPUdp.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File LwIPUdp.h

+

FileList > arduino > libraries > common > WiFiUdp > LwIPUdp.h

+

Go to the source code of this file.

+
    +
  • #include "WiFiUdp.h"
  • +
  • #include <cbuf.h>
  • +
+

Classes

+ + + + + + + + + + + + + +
TypeName
classLwIPUDP
+

Public Types

+ + + + + + + + + + + + + +
TypeName
typedef LwIPUDPWiFiUDP
+

Public Types Documentation

+

typedef WiFiUDP

+
typedef LwIPUDP WiFiUDP;
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiUdp/LwIPUdp.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_lw_i_p_udp_8h_source/index.html b/ltapi/_lw_i_p_udp_8h_source/index.html new file mode 100644 index 000000000..5c4a1279a --- /dev/null +++ b/ltapi/_lw_i_p_udp_8h_source/index.html @@ -0,0 +1,2343 @@ + + + + + + + + + + + + + + + + + + + + File LwIPUdp.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File LwIPUdp.h

+

File List > arduino > libraries > common > WiFiUdp > LwIPUdp.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-09-10. */
+
+#pragma once
+
+#if (LT_ARD_HAS_WIFI && LT_HAS_LWIP) || DOXYGEN
+
+#include "WiFiUdp.h"
+
+#include <cbuf.h>
+
+class LwIPUDP : public IWiFiUDP {
+  private:
+    int udp_server;
+    IPAddress multicast_ip;
+    IPAddress remote_ip;
+    uint16_t server_port;
+    uint16_t remote_port;
+    char *tx_buffer;
+    size_t tx_buffer_len;
+    cbuf *rx_buffer;
+
+  public:
+    LwIPUDP();
+    ~LwIPUDP();
+    uint8_t begin(IPAddress ip, uint16_t port);
+    uint8_t begin(uint16_t port);
+    uint8_t beginMulticast(IPAddress ip, uint16_t port);
+    void stop();
+    int beginMulticastPacket();
+    int beginPacket();
+    int beginPacket(IPAddress ip, uint16_t port);
+    int beginPacket(const char *host, uint16_t port);
+    int endPacket();
+    size_t write(uint8_t);
+    size_t write(const uint8_t *buffer, size_t size);
+    int parsePacket();
+    int available();
+    int read();
+    int read(unsigned char *buffer, size_t len);
+    int read(char *buffer, size_t len);
+    int peek();
+    void flush();
+    IPAddress remoteIP();
+    uint16_t remotePort();
+};
+
+typedef LwIPUDP WiFiUDP;
+
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_lw_i_pm_d_n_s_8cpp/index.html b/ltapi/_lw_i_pm_d_n_s_8cpp/index.html new file mode 100644 index 000000000..65ba94b26 --- /dev/null +++ b/ltapi/_lw_i_pm_d_n_s_8cpp/index.html @@ -0,0 +1,2295 @@ + + + + + + + + + + + + + + + + + + + + File LwIPmDNS.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_lw_i_pm_d_n_s_8cpp_source/index.html b/ltapi/_lw_i_pm_d_n_s_8cpp_source/index.html new file mode 100644 index 000000000..845473e64 --- /dev/null +++ b/ltapi/_lw_i_pm_d_n_s_8cpp_source/index.html @@ -0,0 +1,2497 @@ + + + + + + + + + + + + + + + + + + + + File LwIPmDNS.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File LwIPmDNS.cpp

+

File List > arduino > libraries > common > mDNS > LwIPmDNS.cpp

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-05-23. */
+
+#if LT_HAS_LWIP2
+
+#include "mDNS.h"
+#include <vector>
+
+extern "C" {
+#include <errno.h>
+#include <lwip/apps/mdns.h>
+#include <lwip/igmp.h>
+#include <lwip/init.h>
+#include <lwip/netif.h>
+}
+
+#if LWIP_VERSION_SIMPLE < 20100 && defined(LWIP_NETIF_EXT_STATUS_CALLBACK)
+#warning "LWIP_NETIF_EXT_STATUS_CALLBACK not available before lwIP 2.1.0"
+#undef LWIP_NETIF_EXT_STATUS_CALLBACK
+#endif
+
+#if LWIP_MDNS_RESPONDER
+
+static std::vector<char *> services_name;
+static std::vector<char *> services;
+static std::vector<uint8_t> protos;
+static std::vector<uint16_t> ports;
+static std::vector<std::vector<char *>> records;
+
+static const char *hostName;
+#ifdef LWIP_NETIF_EXT_STATUS_CALLBACK
+NETIF_DECLARE_EXT_CALLBACK(netif_callback)
+#endif
+
+mDNS::mDNS() {}
+
+mDNS::~mDNS() {}
+
+static void mdnsTxtCallback(struct mdns_service *service, void *userdata) {
+    size_t index = (size_t)userdata;
+    if (index >= records.size())
+        return;
+
+    for (const auto record : records[index]) {
+        err_t err = mdns_resp_add_service_txtitem(service, record, strlen(record));
+        if (err != ERR_OK)
+            return;
+    }
+}
+
+static void mdnsStatusCallback(struct netif *netif, uint8_t result) {
+    LT_DM(MDNS, "Status: netif %u, status %u", netif->num, result);
+}
+
+#ifdef LWIP_NETIF_EXT_STATUS_CALLBACK
+static void addServices(struct netif *netif) {
+    for (uint8_t i = 0; i < services.size(); i++) {
+        LT_DM(
+            MDNS,
+            "Add service: netif %u / %s / %s / %u / %u",
+            netif->num,
+            services_name[i],
+            services[i],
+            protos[i],
+            ports[i]
+        );
+        mdns_resp_add_service(
+            netif,
+            services_name[i],
+            services[i],
+            (mdns_sd_proto)protos[i],
+            ports[i],
+            255,
+            mdnsTxtCallback,
+            reinterpret_cast<void *>(i) // index of newly added service
+        );
+    }
+}
+#endif
+
+static bool enableMDNS(struct netif *netif) {
+    if (netif_is_up(netif)) {
+        LT_DM(MDNS, "Starting mDNS on netif %u", netif->num);
+        if ((netif->flags & NETIF_FLAG_IGMP) == 0) {
+            netif->flags |= NETIF_FLAG_IGMP;
+            igmp_start(netif);
+            LT_DM(MDNS, "Added IGMP to netif %u", netif->num);
+        }
+        err_t ret = mdns_resp_add_netif(netif, hostName, 255);
+        if (ret == ERR_OK) {
+            LT_DM(MDNS, "mDNS started on netif %u, announcing it to network", netif->num);
+#if LWIP_VERSION_SIMPLE >= 20100
+            mdns_resp_announce(netif);
+#else
+#warning "lwIP version older than 2.1.0, mdns_resp_announce() unavailable"
+#endif
+            return true;
+        } else {
+            LT_DM(MDNS, "Cannot start mDNS on netif %u; ret=%d, errno=%d", netif->num, ret, errno);
+        }
+    }
+    return false;
+}
+
+#ifdef LWIP_NETIF_EXT_STATUS_CALLBACK
+static void
+mdns_netif_ext_status_callback(struct netif *netif, netif_nsc_reason_t reason, const netif_ext_callback_args_t *args) {
+    if (reason & LWIP_NSC_NETIF_REMOVED) {
+        LT_DM(MDNS, "Netif removed, stopping mDNS on netif %u", netif->num);
+        mdns_resp_remove_netif(netif);
+    } else if (reason & LWIP_NSC_STATUS_CHANGED) {
+        LT_DM(MDNS, "Netif changed, starting mDNS on netif %u", netif->num);
+        if (enableMDNS(netif) && services.size() > 0) {
+            LT_DM(MDNS, "Adding services to netif %u", netif->num);
+            addServices(netif);
+        }
+    }
+}
+#endif
+
+bool mDNS::begin(const char *hostname) {
+    hostName = strdup(hostname);
+    setInstanceName(hostname);
+#ifdef LWIP_NETIF_EXT_STATUS_CALLBACK
+    netif_add_ext_callback(&netif_callback, mdns_netif_ext_status_callback);
+#endif
+    LT_DM(MDNS, "Starting (%s)", hostname);
+#if LWIP_VERSION_MAJOR >= 2 && LWIP_VERSION_MINOR >= 1
+    mdns_resp_register_name_result_cb(mdnsStatusCallback);
+#endif
+    mdns_resp_init();
+    struct netif *netif;
+    for (netif = netif_list; netif != NULL; netif = netif->next) {
+        enableMDNS(netif);
+    }
+    return true;
+}
+
+void mDNS::end() {
+    struct netif *netif = netif_list;
+    while (netif != NULL) {
+        if (netif_is_up(netif))
+            mdns_resp_remove_netif(netif);
+        netif = netif->next;
+    }
+}
+
+bool mDNS::addServiceImpl(const char *name, const char *service, uint8_t proto, uint16_t port) {
+    bool added          = false;
+    struct netif *netif = netif_list;
+    while (netif != NULL) {
+        if (netif_is_up(netif)) {
+            // register TXT callback;
+            // pass service index as userdata parameter
+            LT_DM(MDNS, "Add service: netif %u / %s / %s / %u / %u", netif->num, name, service, proto, port);
+            mdns_resp_add_service(
+                netif,
+                name,
+                service,
+                (mdns_sd_proto)proto,
+                port,
+                255,
+                mdnsTxtCallback,
+                (void *)services.size() // index of newly added service
+            );
+            added = true;
+        }
+        netif = netif->next;
+    }
+
+    if (!added)
+        return false;
+
+    // add the service to TXT record arrays
+    services_name.push_back(strdup(name));
+    services.push_back(strdup(service));
+    protos.push_back(proto);
+    ports.push_back(port);
+    records.emplace_back();
+
+    return true;
+}
+
+bool mDNS::addServiceTxtImpl(const char *service, uint8_t proto, const char *item) {
+    int8_t index = -1;
+    for (uint8_t i = 0; i < services.size(); i++) {
+        // find a matching service
+        if (strcmp(services[i], service) == 0 && protos[i] == proto) {
+            index = i;
+            break;
+        }
+    }
+    if (index == -1)
+        return false;
+
+    records[index].push_back(strdup(item));
+    return true;
+}
+
+MDNSResponder MDNS;
+
+#endif
+
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_m_d5_hostapd_impl_8h/index.html b/ltapi/_m_d5_hostapd_impl_8h/index.html new file mode 100644 index 000000000..313a38a13 --- /dev/null +++ b/ltapi/_m_d5_hostapd_impl_8h/index.html @@ -0,0 +1,2371 @@ + + + + + + + + + + + + + + + + + + + + File MD5HostapdImpl.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File MD5HostapdImpl.h

+

FileList > arduino > libraries > common > MD5 > MD5HostapdImpl.h

+

Go to the source code of this file.

+

Classes

+ + + + + + + + + + + + + +
TypeName
structMD5Context
+

Macros

+ + + + + + + + + + + + + +
TypeName
defineLT_MD5_CTX_T struct MD5Context
+

Macro Definition Documentation

+

define LT_MD5_CTX_T

+
#define LT_MD5_CTX_T struct MD5Context
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/MD5/MD5HostapdImpl.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_m_d5_hostapd_impl_8h_source/index.html b/ltapi/_m_d5_hostapd_impl_8h_source/index.html new file mode 100644 index 000000000..9aabd86f2 --- /dev/null +++ b/ltapi/_m_d5_hostapd_impl_8h_source/index.html @@ -0,0 +1,2313 @@ + + + + + + + + + + + + + + + + + + + + File MD5HostapdImpl.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File MD5HostapdImpl.h

+

File List > arduino > libraries > common > MD5 > MD5HostapdImpl.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-07-12. */
+
+#pragma once
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct MD5Context {
+    unsigned long buf[4];
+    unsigned long bits[2];
+    unsigned char in[64];
+};
+
+#define LT_MD5_CTX_T struct MD5Context
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_m_d5_mbed_t_l_s_impl_8cpp/index.html b/ltapi/_m_d5_mbed_t_l_s_impl_8cpp/index.html new file mode 100644 index 000000000..43e3e0c66 --- /dev/null +++ b/ltapi/_m_d5_mbed_t_l_s_impl_8cpp/index.html @@ -0,0 +1,2295 @@ + + + + + + + + + + + + + + + + + + + + File MD5MbedTLSImpl.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_m_d5_mbed_t_l_s_impl_8cpp_source/index.html b/ltapi/_m_d5_mbed_t_l_s_impl_8cpp_source/index.html new file mode 100644 index 000000000..9e5ad17ec --- /dev/null +++ b/ltapi/_m_d5_mbed_t_l_s_impl_8cpp_source/index.html @@ -0,0 +1,2318 @@ + + + + + + + + + + + + + + + + + + + + File MD5MbedTLSImpl.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File MD5MbedTLSImpl.cpp

+

File List > arduino > libraries > common > MD5 > MD5MbedTLSImpl.cpp

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-07-11. */
+
+#if LT_ARD_MD5_MBEDTLS
+
+extern "C" {
+
+#include <mbedtls/md5.h>
+
+void MD5Init(mbedtls_md5_context *context) {
+    mbedtls_md5_init(context);
+    mbedtls_md5_starts(context);
+}
+
+void MD5Update(mbedtls_md5_context *context, const unsigned char *buf, unsigned len) {
+    mbedtls_md5_update(context, buf, len);
+}
+
+void MD5Final(unsigned char digest[16], mbedtls_md5_context *context) {
+    mbedtls_md5_finish(context, digest);
+}
+
+} // extern "C"
+
+#endif // LT_ARD_MD5_MBEDTLS
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_m_d5_mbed_t_l_s_impl_8h/index.html b/ltapi/_m_d5_mbed_t_l_s_impl_8h/index.html new file mode 100644 index 000000000..2b7f3be3e --- /dev/null +++ b/ltapi/_m_d5_mbed_t_l_s_impl_8h/index.html @@ -0,0 +1,2371 @@ + + + + + + + + + + + + + + + + + + + + File MD5MbedTLSImpl.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File MD5MbedTLSImpl.h

+

FileList > arduino > libraries > common > MD5 > MD5MbedTLSImpl.h

+

Go to the source code of this file.

+

Classes

+ + + + + + + + + + + + + +
TypeName
structmbedtls_md5_context
+

Macros

+ + + + + + + + + + + + + +
TypeName
defineLT_MD5_CTX_T mbedtls_md5_context
+

Macro Definition Documentation

+

define LT_MD5_CTX_T

+
#define LT_MD5_CTX_T mbedtls_md5_context
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/MD5/MD5MbedTLSImpl.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_m_d5_mbed_t_l_s_impl_8h_source/index.html b/ltapi/_m_d5_mbed_t_l_s_impl_8h_source/index.html new file mode 100644 index 000000000..9f7e19a92 --- /dev/null +++ b/ltapi/_m_d5_mbed_t_l_s_impl_8h_source/index.html @@ -0,0 +1,2313 @@ + + + + + + + + + + + + + + + + + + + + File MD5MbedTLSImpl.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File MD5MbedTLSImpl.h

+

File List > arduino > libraries > common > MD5 > MD5MbedTLSImpl.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-07-11. */
+
+#pragma once
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct {
+    unsigned long total[2];   
+    unsigned long state[4];   
+    unsigned char buffer[64]; 
+} mbedtls_md5_context;
+
+#define LT_MD5_CTX_T mbedtls_md5_context
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_mbed_t_l_s_client_8cpp/index.html b/ltapi/_mbed_t_l_s_client_8cpp/index.html new file mode 100644 index 000000000..aad337150 --- /dev/null +++ b/ltapi/_mbed_t_l_s_client_8cpp/index.html @@ -0,0 +1,2295 @@ + + + + + + + + + + + + + + + + + + + + File MbedTLSClient.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_mbed_t_l_s_client_8cpp_source/index.html b/ltapi/_mbed_t_l_s_client_8cpp_source/index.html new file mode 100644 index 000000000..f10e24d93 --- /dev/null +++ b/ltapi/_mbed_t_l_s_client_8cpp_source/index.html @@ -0,0 +1,2777 @@ + + + + + + + + + + + + + + + + + + + + File MbedTLSClient.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File MbedTLSClient.cpp

+

File List > arduino > libraries > common > WiFiClient > MbedTLSClient.cpp

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-04-30. */
+
+#if LT_ARD_HAS_WIFI && LT_HAS_MBEDTLS
+
+#include "MbedTLSClient.h"
+
+#include <WiFi.h>
+
+extern "C" {
+
+#include <mbedtls/debug.h>
+#include <mbedtls/net.h>
+#include <mbedtls/pk.h>
+#include <mbedtls/platform.h>
+#include <mbedtls/sha256.h>
+#include <mbedtls/ssl.h>
+
+#if LT_HAS_FREERTOS
+#include <FreeRTOS.h>
+#endif
+
+} // extern "C"
+
+#define _clientKeyC ((mbedtls_pk_context *)_clientKey)
+
+MbedTLSClient::MbedTLSClient() : WiFiClient() {
+    init(); // ensure the context is zero filled
+}
+
+MbedTLSClient::MbedTLSClient(int sock) : WiFiClient(sock) {
+    init(); // ensure the context is zero filled
+}
+
+MbedTLSClient::~MbedTLSClient() {
+    LT_VM(CLIENT, "~MbedTLSClient()");
+    stop();
+}
+
+void MbedTLSClient::stop() {
+    if (!_sslCtx)
+        return;
+    LT_VM(SSL, "Stopping SSL");
+
+    if (_sslCfg->ca_chain) {
+        mbedtls_x509_crt_free(_caCert);
+    }
+    if (_sslCfg->key_cert) {
+        mbedtls_x509_crt_free(_clientCert);
+        mbedtls_pk_free(_clientKeyC);
+    }
+    mbedtls_ssl_free(_sslCtx);
+    mbedtls_ssl_config_free(_sslCfg);
+
+    free(_sslCtx);
+    free(_sslCfg);
+    free(_caCert);
+    free(_clientCert);
+    free(_clientKey);
+    _sslCtx = NULL;
+
+    LT_HEAP_I();
+}
+
+void MbedTLSClient::init() {
+    if (!_sslCtx) {
+        _sslCtx     = (mbedtls_ssl_context *)malloc(sizeof(mbedtls_ssl_context));
+        _sslCfg     = (mbedtls_ssl_config *)malloc(sizeof(mbedtls_ssl_config));
+        _caCert     = (mbedtls_x509_crt *)malloc(sizeof(mbedtls_x509_crt));
+        _clientCert = (mbedtls_x509_crt *)malloc(sizeof(mbedtls_x509_crt));
+        _clientKey  = (mbedtls_pk_context *)malloc(sizeof(mbedtls_pk_context));
+    }
+    // Realtek AmbZ: init platform here to ensure HW crypto is initialized in ssl_init
+    mbedtls_platform_set_calloc_free(calloc, free);
+    mbedtls_ssl_init(_sslCtx);
+    mbedtls_ssl_config_init(_sslCfg);
+}
+
+int MbedTLSClient::connect(IPAddress ip, uint16_t port, int32_t timeout) {
+    return connect(ipToString(ip).c_str(), port, timeout);
+}
+
+int MbedTLSClient::connect(const char *host, uint16_t port, int32_t timeout) {
+    if (_pskIdentStr && _pskStr)
+        return connect(host, port, timeout, NULL, NULL, NULL, _pskIdentStr, _pskStr) == 0;
+    return connect(host, port, timeout, _caCertStr, _clientCertStr, _clientKeyStr, NULL, NULL) == 0;
+}
+
+int MbedTLSClient::connect(
+    IPAddress ip, uint16_t port, const char *rootCABuf, const char *clientCert, const char *clientKey
+) {
+    return connect(ipToString(ip).c_str(), port, 0, rootCABuf, clientCert, clientKey, NULL, NULL) == 0;
+}
+
+int MbedTLSClient::connect(
+    const char *host, uint16_t port, const char *rootCABuf, const char *clientCert, const char *clientKey
+) {
+    return connect(host, port, 0, rootCABuf, clientCert, clientKey, NULL, NULL) == 0;
+}
+
+int MbedTLSClient::connect(IPAddress ip, uint16_t port, const char *pskIdent, const char *psk) {
+    return connect(ipToString(ip).c_str(), port, 0, NULL, NULL, NULL, pskIdent, psk) == 0;
+}
+
+int MbedTLSClient::connect(const char *host, uint16_t port, const char *pskIdent, const char *psk) {
+    return connect(host, port, 0, NULL, NULL, NULL, pskIdent, psk) == 0;
+}
+
+static int ssl_random(void *data, unsigned char *output, size_t len) {
+    lt_rand_bytes((uint8_t *)output, len);
+    return 0;
+}
+
+void debug_cb(void *ctx, int level, const char *file, int line, const char *str) {
+    // do not print the trailing \n
+    uint16_t len = strlen(str);
+    char *msg    = (char *)str;
+    msg[len - 1] = '\0';
+    LT_IM(SSL, "%04d: |%d| %s", line, level, msg);
+}
+
+int MbedTLSClient::connect(
+    const char *host,
+    uint16_t port,
+    int32_t timeout,
+    const char *rootCABuf,
+    const char *clientCert,
+    const char *clientKey,
+    const char *pskIdent,
+    const char *psk
+) {
+    LT_HEAP_I();
+
+    if (!rootCABuf && !pskIdent && !psk && !_insecure && !_useRootCA)
+        return -1;
+
+    if (timeout <= 0)
+        timeout = _timeout; // use default when -1 passed as timeout
+
+    IPAddress addr = WiFi.hostByName(host);
+    if (!(uint32_t)addr)
+        return -1;
+
+    int ret = WiFiClient::connect(addr, port, timeout);
+    if (ret < 0) {
+        LT_EM(SSL, "SSL socket failed");
+        return ret;
+    }
+
+    char *uid = "lt-ssl"; // TODO
+
+    LT_VM(SSL, "Init SSL");
+    init();
+    LT_HEAP_I();
+
+    // mbedtls_debug_set_threshold(4);
+    // mbedtls_ssl_conf_dbg(&_sslCfg, debug_cb, NULL);
+
+    ret = mbedtls_ssl_config_defaults(
+        _sslCfg,
+        MBEDTLS_SSL_IS_CLIENT,
+        MBEDTLS_SSL_TRANSPORT_STREAM,
+        MBEDTLS_SSL_PRESET_DEFAULT
+    );
+    LT_RET_NZ(ret);
+
+#ifdef MBEDTLS_SSL_ALPN
+    if (_alpnProtocols) {
+        ret = mbedtls_ssl_conf_alpn_protocols(&_sslCfg, _alpnProtocols);
+        LT_RET_NZ(ret);
+    }
+#endif
+
+    if (_insecure) {
+        mbedtls_ssl_conf_authmode(_sslCfg, MBEDTLS_SSL_VERIFY_NONE);
+    } else if (rootCABuf) {
+        mbedtls_x509_crt_init(_caCert);
+        mbedtls_ssl_conf_authmode(_sslCfg, MBEDTLS_SSL_VERIFY_REQUIRED);
+        ret = mbedtls_x509_crt_parse(_caCert, (const unsigned char *)rootCABuf, strlen(rootCABuf) + 1);
+        mbedtls_ssl_conf_ca_chain(_sslCfg, _caCert, NULL);
+        if (ret < 0) {
+            mbedtls_x509_crt_free(_caCert);
+            LT_RET(ret);
+        }
+    } else if (_useRootCA) {
+        return -1; // not implemented
+    } else if (pskIdent && psk) {
+#ifdef MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED
+        uint16_t len = strlen(psk);
+        if ((len & 1) != 0 || len > 2 * MBEDTLS_PSK_MAX_LEN) {
+            LT_EM(SSL, "PSK length invalid");
+            return -1;
+        }
+        unsigned char pskBin[MBEDTLS_PSK_MAX_LEN] = {};
+        for (uint8_t i = 0; i < len; i++) {
+            uint8_t c = psk[i];
+            c |= 0b00100000; // make lowercase
+            c -= '0' * (c >= '0' && c <= '9');
+            c -= ('a' - 10) * (c >= 'a' && c <= 'z');
+            if (c > 0xf)
+                return -1;
+            pskBin[i / 2] |= c << (4 * ((i & 1) ^ 1));
+        }
+        ret = mbedtls_ssl_conf_psk(_sslCfg, pskBin, len / 2, (const unsigned char *)pskIdent, strlen(pskIdent));
+        LT_RET_NZ(ret);
+#else
+        return -1;
+#endif
+    } else {
+        return -1;
+    }
+
+    if (!_insecure && clientCert && clientKey) {
+        mbedtls_x509_crt_init(_clientCert);
+        mbedtls_pk_init(_clientKeyC);
+        LT_VM(SSL, "Loading client cert");
+        ret = mbedtls_x509_crt_parse(_clientCert, (const unsigned char *)clientCert, strlen(clientCert) + 1);
+        if (ret < 0) {
+            mbedtls_x509_crt_free(_clientCert);
+            LT_RET(ret);
+        }
+        LT_VM(SSL, "Loading private key");
+        ret = mbedtls_pk_parse_key(_clientKeyC, (const unsigned char *)clientKey, strlen(clientKey) + 1, NULL, 0);
+        if (ret < 0) {
+            mbedtls_x509_crt_free(_clientCert);
+            LT_RET(ret);
+        }
+        mbedtls_ssl_conf_own_cert(_sslCfg, _clientCert, _clientKeyC);
+    }
+
+    LT_VM(SSL, "Setting TLS hostname");
+    ret = mbedtls_ssl_set_hostname(_sslCtx, host);
+    LT_RET_NZ(ret);
+
+    mbedtls_ssl_conf_rng(_sslCfg, ssl_random, NULL);
+    ret = mbedtls_ssl_setup(_sslCtx, _sslCfg);
+    LT_RET_NZ(ret);
+
+    _sockTls = fd();
+    mbedtls_ssl_set_bio(_sslCtx, &_sockTls, mbedtls_net_send, mbedtls_net_recv, NULL);
+    mbedtls_net_set_nonblock((mbedtls_net_context *)&_sockTls);
+
+    LT_HEAP_I();
+
+    LT_VM(SSL, "SSL handshake");
+    if (_handshakeTimeout == 0)
+        _handshakeTimeout = timeout;
+    unsigned long start = millis();
+    while (ret = mbedtls_ssl_handshake(_sslCtx)) {
+        if (ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE) {
+            LT_RET(ret);
+        }
+        if ((millis() - start) > _handshakeTimeout) {
+            LT_EM(SSL, "SSL handshake timeout");
+            return -1;
+        }
+        delay(2);
+    }
+
+    LT_HEAP_I();
+
+    if (clientCert && clientKey) {
+        LT_DM(
+            SSL,
+            "Protocol %s, ciphersuite %s",
+            mbedtls_ssl_get_version(_sslCtx),
+            mbedtls_ssl_get_ciphersuite(_sslCtx)
+        );
+        ret = mbedtls_ssl_get_record_expansion(_sslCtx);
+        if (ret >= 0)
+            LT_DM(SSL, "Record expansion: %d", ret);
+        else {
+            LT_WM(SSL, "Record expansion unknown");
+        }
+    }
+
+    LT_VM(SSL, "Verifying certificate");
+    ret = mbedtls_ssl_get_verify_result(_sslCtx);
+    if (ret) {
+        char buf[512];
+        memset(buf, 0, sizeof(buf));
+        mbedtls_x509_crt_verify_info(buf, sizeof(buf), "  ! ", ret);
+        LT_EM(SSL, "Failed to verify peer certificate! Verification info: %s", buf);
+        return ret;
+    }
+
+    if (rootCABuf)
+        mbedtls_x509_crt_free(_caCert);
+    if (clientCert)
+        mbedtls_x509_crt_free(_clientCert);
+    if (clientKey != NULL)
+        mbedtls_pk_free(_clientKeyC);
+    return 0; // OK
+}
+
+size_t MbedTLSClient::write(const uint8_t *buf, size_t size) {
+    int ret = -1;
+    while ((ret = mbedtls_ssl_write(_sslCtx, buf, size)) <= 0) {
+        if (ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE && ret < 0) {
+            LT_RET(ret);
+        }
+        delay(2);
+    }
+    return ret;
+}
+
+int MbedTLSClient::available() {
+    bool peeked = _peeked >= 0;
+    if (!connected())
+        return peeked;
+
+    int ret = mbedtls_ssl_read(_sslCtx, NULL, 0);
+    if (ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE && ret < 0) {
+        stop();
+        return peeked ? peeked : ret;
+    }
+    return mbedtls_ssl_get_bytes_avail(_sslCtx) + peeked;
+}
+
+int MbedTLSClient::read(uint8_t *buf, size_t size) {
+    bool peeked = false;
+    int toRead  = available();
+    if ((!buf && size) || toRead <= 0)
+        return -1;
+    if (!size)
+        return 0;
+    if (_peeked >= 0) {
+        buf[0]  = _peeked;
+        _peeked = -1;
+        size--;
+        toRead--;
+        if (!size || !toRead)
+            return 1;
+        buf++;
+        peeked = true;
+    }
+
+    int ret = mbedtls_ssl_read(_sslCtx, buf, size);
+    if (ret < 0) {
+        stop();
+        return peeked ? peeked : ret;
+    }
+    return ret + peeked;
+}
+
+int MbedTLSClient::peek() {
+    if (_peeked >= 0)
+        return _peeked;
+    _peeked = timedRead();
+    return _peeked;
+}
+
+void MbedTLSClient::flush() {}
+
+int MbedTLSClient::lastError(char *buf, const size_t size) {
+    return 0; // TODO (?)
+}
+
+void MbedTLSClient::setInsecure() {
+    _caCertStr     = NULL;
+    _clientCertStr = NULL;
+    _clientKeyStr  = NULL;
+    _pskIdentStr   = NULL;
+    _pskStr        = NULL;
+    _insecure      = true;
+}
+
+// TODO only allocate _caCert, _clientCert and _clientKey when one
+// of the following functions is used
+
+void MbedTLSClient::setPreSharedKey(const char *pskIdent, const char *psk) {
+    _pskIdentStr = pskIdent;
+    _pskStr      = psk;
+}
+
+void MbedTLSClient::setCACert(const char *rootCA) {
+    _caCertStr = rootCA;
+}
+
+void MbedTLSClient::setCertificate(const char *clientCA) {
+    _clientCertStr = clientCA;
+}
+
+void MbedTLSClient::setPrivateKey(const char *privateKey) {
+    _clientKeyStr = privateKey;
+}
+
+char *streamToStr(Stream &stream, size_t size) {
+    char *buf = (char *)malloc(size + 1);
+    if (!buf)
+        return NULL;
+    if (size != stream.readBytes(buf, size)) {
+        free(buf);
+        return NULL;
+    }
+    buf[size] = '\0';
+    return buf;
+}
+
+bool MbedTLSClient::loadCACert(Stream &stream, size_t size) {
+    char *str = streamToStr(stream, size);
+    if (str) {
+        _caCertStr = str;
+        return true;
+    }
+    return false;
+}
+
+bool MbedTLSClient::loadCertificate(Stream &stream, size_t size) {
+    char *str = streamToStr(stream, size);
+    if (str) {
+        _clientCertStr = str;
+        return true;
+    }
+    return false;
+}
+
+bool MbedTLSClient::loadPrivateKey(Stream &stream, size_t size) {
+    char *str = streamToStr(stream, size);
+    if (str) {
+        _clientKeyStr = str;
+        return true;
+    }
+    return false;
+}
+
+bool MbedTLSClient::verify(const char *fingerprint, const char *domainName) {
+    uint8_t fpLocal[32] = {};
+    uint16_t len        = strlen(fingerprint);
+    uint8_t byte        = 0;
+    for (uint8_t i = 0; i < len; i++) {
+        uint8_t c = fingerprint[i];
+        while ((c == ' ' || c == ':') && i < len) {
+            c = fingerprint[++i];
+        }
+        c |= 0b00100000; // make lowercase
+        c -= '0' * (c >= '0' && c <= '9');
+        c -= ('a' - 10) * (c >= 'a' && c <= 'z');
+        if (c > 0xf)
+            return -1;
+        fpLocal[byte / 2] |= c << (4 * ((byte & 1) ^ 1));
+        byte++;
+        if (byte >= 64)
+            break;
+    }
+
+    uint8_t fpRemote[32];
+    if (!getFingerprintSHA256(fpRemote))
+        return false;
+
+    if (memcmp(fpLocal, fpRemote, 32)) {
+        LT_DM(SSL, "Fingerprints don't match");
+        return false;
+    }
+
+    if (!domainName)
+        return true;
+    // TODO domain name verification
+    return true;
+}
+
+void MbedTLSClient::setHandshakeTimeout(unsigned long handshakeTimeout) {
+    _handshakeTimeout = handshakeTimeout * 1000;
+}
+
+void MbedTLSClient::setAlpnProtocols(const char **alpnProtocols) {
+    _alpnProtocols = alpnProtocols;
+}
+
+bool MbedTLSClient::getFingerprintSHA256(uint8_t result[32]) {
+    const mbedtls_x509_crt *cert = mbedtls_ssl_get_peer_cert(_sslCtx);
+    if (!cert) {
+        LT_EM(SSL, "Failed to get peer certificate");
+        return false;
+    }
+    mbedtls_sha256_context shaCtx;
+    mbedtls_sha256_init(&shaCtx);
+    mbedtls_sha256_starts(&shaCtx, false);
+    mbedtls_sha256_update(&shaCtx, cert->raw.p, cert->raw.len);
+    mbedtls_sha256_finish(&shaCtx, result);
+    return true;
+}
+
+#endif // LT_ARD_HAS_WIFI && LT_HAS_MBEDTLS
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_mbed_t_l_s_client_8h/index.html b/ltapi/_mbed_t_l_s_client_8h/index.html new file mode 100644 index 000000000..e991b84a9 --- /dev/null +++ b/ltapi/_mbed_t_l_s_client_8h/index.html @@ -0,0 +1,2374 @@ + + + + + + + + + + + + + + + + + + + + File MbedTLSClient.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File MbedTLSClient.h

+

FileList > arduino > libraries > common > WiFiClient > MbedTLSClient.h

+

Go to the source code of this file.

+
    +
  • #include "WiFiClientSecure.h"
  • +
+

Classes

+ + + + + + + + + + + + + +
TypeName
classMbedTLSClient
+

Public Types

+ + + + + + + + + + + + + +
TypeName
typedef MbedTLSClientWiFiClientSecure
+

Public Types Documentation

+

typedef WiFiClientSecure

+
typedef MbedTLSClient WiFiClientSecure;
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiClient/MbedTLSClient.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_mbed_t_l_s_client_8h_source/index.html b/ltapi/_mbed_t_l_s_client_8h_source/index.html new file mode 100644 index 000000000..1cf88a18c --- /dev/null +++ b/ltapi/_mbed_t_l_s_client_8h_source/index.html @@ -0,0 +1,2382 @@ + + + + + + + + + + + + + + + + + + + + File MbedTLSClient.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File MbedTLSClient.h

+

File List > arduino > libraries > common > WiFiClient > MbedTLSClient.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-04-30. */
+
+#pragma once
+
+#if (LT_ARD_HAS_WIFI && LT_HAS_MBEDTLS) || DOXYGEN
+
+#include "WiFiClientSecure.h"
+
+struct mbedtls_ssl_context;
+struct mbedtls_ssl_config;
+struct mbedtls_x509_crt;
+
+class MbedTLSClient : public WiFiClient, public IWiFiClientSecure {
+  private:
+    mbedtls_ssl_context *_sslCtx = NULL;
+    mbedtls_ssl_config *_sslCfg;
+    mbedtls_x509_crt *_caCert;
+    mbedtls_x509_crt *_clientCert;
+    void *_clientKey;
+    uint32_t _handshakeTimeout = 0;
+
+    void init();
+    int _sockTls    = -1;
+    bool _insecure  = false;
+    bool _useRootCA = false;
+    int _peeked     = -1;
+
+    const char *_caCertStr;
+    const char *_clientCertStr;
+    const char *_clientKeyStr;
+    const char *_pskIdentStr;
+    const char *_pskStr;
+    const char **_alpnProtocols;
+
+    int connect(
+        const char *host,
+        uint16_t port,
+        int32_t timeout,
+        const char *rootCABuf,
+        const char *clientCert,
+        const char *clientKey,
+        const char *pskIdent,
+        const char *psk
+    );
+
+  public:
+    MbedTLSClient();
+    MbedTLSClient(int sock);
+    ~MbedTLSClient();
+
+    int connect(IPAddress ip, uint16_t port, int32_t timeout);
+    int connect(const char *host, uint16_t port, int32_t timeout);
+
+    int connect(IPAddress ip, uint16_t port, const char *rootCABuf, const char *clientCert, const char *clientKey);
+    int connect(const char *host, uint16_t port, const char *rootCABuf, const char *clientCert, const char *clientKey);
+    int connect(IPAddress ip, uint16_t port, const char *pskIdent, const char *psk);
+    int connect(const char *host, uint16_t port, const char *pskIdent, const char *psk);
+
+    size_t write(const uint8_t *buf, size_t size);
+
+    int available();
+
+    int read(uint8_t *buf, size_t size);
+    int peek();
+    void flush();
+    void stop();
+
+    int lastError(char *buf, const size_t size);
+    void setInsecure(); // Don't validate the chain, just accept whatever is given. VERY INSECURE!
+    void setPreSharedKey(const char *pskIdent, const char *psk); // psk in hex
+    void setCACert(const char *rootCA);
+    void setCertificate(const char *clientCA);
+    void setPrivateKey(const char *privateKey);
+    bool loadCACert(Stream &stream, size_t size);
+    bool loadCertificate(Stream &stream, size_t size);
+    bool loadPrivateKey(Stream &stream, size_t size);
+    bool verify(const char *fingerprint, const char *domainName);
+    void setHandshakeTimeout(unsigned long handshakeTimeout);
+    void setAlpnProtocols(const char **alpnProtocols);
+    bool getFingerprintSHA256(uint8_t result[32]);
+
+    using WiFiClient::connect;
+    using WiFiClient::read;
+};
+
+typedef MbedTLSClient WiFiClientSecure;
+
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_o_t_a_8h/index.html b/ltapi/_o_t_a_8h/index.html new file mode 100644 index 000000000..6344b5d04 --- /dev/null +++ b/ltapi/_o_t_a_8h/index.html @@ -0,0 +1,2374 @@ + + + + + + + + + + + + + + + + + + + + File OTA.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File OTA.h

+

FileList > arduino > libraries > inline > OTA > OTA.h

+

Go to the source code of this file.

+
    +
  • #include <Arduino.h>
  • +
+

Classes

+ + + + + + + + + + + + + +
TypeName
classLibreTinyOTA
Over-the-Air updates helper class.
+

Public Attributes

+ + + + + + + + + + + + + +
TypeName
LibreTinyOTAOTA
+

Public Attributes Documentation

+

variable OTA

+
LibreTinyOTA OTA;
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/inline/OTA/OTA.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_o_t_a_8h_source/index.html b/ltapi/_o_t_a_8h_source/index.html new file mode 100644 index 000000000..5120c5e9e --- /dev/null +++ b/ltapi/_o_t_a_8h_source/index.html @@ -0,0 +1,2322 @@ + + + + + + + + + + + + + + + + + + + + File OTA.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File OTA.h

+

File List > arduino > libraries > inline > OTA > OTA.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2023-03-10. */
+
+#pragma once
+
+#include <Arduino.h>
+
+#ifdef __cplusplus
+
+class LibreTinyOTA {
+  public: /* lt_ota.h */
+    inline lt_ota_type_t getType() { return lt_ota_get_type(); }
+
+    inline bool isValid(uint8_t index) { return lt_ota_is_valid(index); }
+
+    inline bool canRollback() { return lt_ota_can_rollback(); }
+
+    inline uint8_t getCurrentIndex() { return lt_ota_dual_get_current(); }
+
+    inline uint8_t getStoredIndex() { return lt_ota_dual_get_stored(); }
+
+    inline uf2_ota_scheme_t getUF2Scheme() { return lt_ota_get_uf2_scheme(); }
+
+    inline bool switchImage(bool revert = false) { return lt_ota_switch(revert); }
+};
+
+extern LibreTinyOTA OTA;
+
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_parsing_8cpp/index.html b/ltapi/_parsing_8cpp/index.html new file mode 100644 index 000000000..00cff7e86 --- /dev/null +++ b/ltapi/_parsing_8cpp/index.html @@ -0,0 +1,2295 @@ + + + + + + + + + + + + + + + + + + + + File Parsing.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_parsing_8cpp_source/index.html b/ltapi/_parsing_8cpp_source/index.html new file mode 100644 index 000000000..c36dda200 --- /dev/null +++ b/ltapi/_parsing_8cpp_source/index.html @@ -0,0 +1,2903 @@ + + + + + + + + + + + + + + + + + + + + File Parsing.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File Parsing.cpp

+

File List > arduino > libraries > ext > WebServer > Parsing.cpp

+

Go to the documentation of this file.

+
/*
+  Parsing.cpp - HTTP request parsing.
+
+  Copyright (c) 2015 Ivan Grokhotkov. All rights reserved.
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License, or (at your option) any later version.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+  Modified 8 May 2015 by Hristo Gochkov (proper post and file upload handling)
+*/
+
+#if LT_ARD_HAS_WIFI
+
+#include <Arduino.h>
+
+#include "WebServer.h"
+#include "WiFiClient.h"
+#include "WiFiServer.h"
+#include "detail/mimetable.h"
+
+#ifndef WEBSERVER_MAX_POST_ARGS
+#define WEBSERVER_MAX_POST_ARGS 32
+#endif
+
+#define __STR(a) #a
+#define _STR(a)  __STR(a)
+const char *_http_method_str[] = {
+#define XX(num, name, string) _STR(name),
+    HTTP_METHOD_MAP(XX)
+#undef XX
+};
+
+static const char Content_Type[] PROGMEM = "Content-Type";
+static const char filename[] PROGMEM     = "filename";
+
+static char *readBytesWithTimeout(WiFiClient &client, size_t maxLength, size_t &dataLength, int timeout_ms) {
+    char *buf  = nullptr;
+    dataLength = 0;
+    while (dataLength < maxLength) {
+        int tries = timeout_ms;
+        size_t newLength;
+        while (!(newLength = client.available()) && tries--)
+            delay(1);
+        if (!newLength) {
+            break;
+        }
+        if (!buf) {
+            buf = (char *)malloc(newLength + 1);
+            if (!buf) {
+                return nullptr;
+            }
+        } else {
+            char *newBuf = (char *)realloc(buf, dataLength + newLength + 1);
+            if (!newBuf) {
+                free(buf);
+                return nullptr;
+            }
+            buf = newBuf;
+        }
+        client.readBytes(buf + dataLength, newLength);
+        dataLength += newLength;
+        buf[dataLength] = '\0';
+    }
+    return buf;
+}
+
+bool WebServer::_parseRequest(WiFiClient &client) {
+    // Read the first line of HTTP request
+    String req = client.readStringUntil('\r');
+    client.readStringUntil('\n');
+    // reset header value
+    for (int i = 0; i < _headerKeysCount; ++i) {
+        _currentHeaders[i].value = String();
+    }
+
+    // First line of HTTP request looks like "GET /path HTTP/1.1"
+    // Retrieve the "/path" part by finding the spaces
+    int addr_start = req.indexOf(' ');
+    int addr_end   = req.indexOf(' ', addr_start + 1);
+    if (addr_start == -1 || addr_end == -1) {
+        log_e("Invalid request: %s", req.c_str());
+        return false;
+    }
+
+    String methodStr  = req.substring(0, addr_start);
+    String url        = req.substring(addr_start + 1, addr_end);
+    String versionEnd = req.substring(addr_end + 8);
+    _currentVersion   = atoi(versionEnd.c_str());
+    String searchStr  = "";
+    int hasSearch     = url.indexOf('?');
+    if (hasSearch != -1) {
+        searchStr = url.substring(hasSearch + 1);
+        url       = url.substring(0, hasSearch);
+    }
+    _currentUri = url;
+    _chunked    = false;
+
+    HTTPMethod method  = HTTP_ANY;
+    size_t num_methods = sizeof(_http_method_str) / sizeof(const char *);
+    for (size_t i = 0; i < num_methods; i++) {
+        if (methodStr == _http_method_str[i]) {
+            method = (HTTPMethod)i;
+            break;
+        }
+    }
+    if (method == HTTP_ANY) {
+        log_e("Unknown HTTP Method: %s", methodStr.c_str());
+        return false;
+    }
+    _currentMethod = method;
+
+    log_v("method: %s url: %s search: %s", methodStr.c_str(), url.c_str(), searchStr.c_str());
+
+    // attach handler
+    RequestHandler *handler;
+    for (handler = _firstHandler; handler; handler = handler->next()) {
+        if (handler->canHandle(_currentMethod, _currentUri))
+            break;
+    }
+    _currentHandler = handler;
+
+    String formData;
+    // below is needed only when POST type request
+    if (method == HTTP_POST || method == HTTP_PUT || method == HTTP_PATCH || method == HTTP_DELETE) {
+        String boundaryStr;
+        String headerName;
+        String headerValue;
+        bool isForm            = false;
+        bool isEncoded         = false;
+        uint32_t contentLength = 0;
+        // parse headers
+        while (1) {
+            req = client.readStringUntil('\r');
+            client.readStringUntil('\n');
+            if (req == "")
+                break; // no moar headers
+            int headerDiv = req.indexOf(':');
+            if (headerDiv == -1) {
+                break;
+            }
+            headerName  = req.substring(0, headerDiv);
+            headerValue = req.substring(headerDiv + 1);
+            headerValue.trim();
+            _collectHeader(headerName.c_str(), headerValue.c_str());
+
+            log_v("headerName: %s", headerName.c_str());
+            log_v("headerValue: %s", headerValue.c_str());
+
+            if (headerName.equalsIgnoreCase(FPSTR(Content_Type))) {
+                using namespace mime;
+                if (headerValue.startsWith(FPSTR(mimeTable[txt].mimeType))) {
+                    isForm = false;
+                } else if (headerValue.startsWith(F("application/x-www-form-urlencoded"))) {
+                    isForm    = false;
+                    isEncoded = true;
+                } else if (headerValue.startsWith(F("multipart/"))) {
+                    boundaryStr = headerValue.substring(headerValue.indexOf('=') + 1);
+                    boundaryStr.replace("\"", "");
+                    isForm = true;
+                }
+            } else if (headerName.equalsIgnoreCase(F("Content-Length"))) {
+                contentLength = headerValue.toInt();
+            } else if (headerName.equalsIgnoreCase(F("Host"))) {
+                _hostHeader = headerValue;
+            }
+        }
+
+        if (!isForm) {
+            size_t plainLength;
+            char *plainBuf = readBytesWithTimeout(client, contentLength, plainLength, HTTP_MAX_POST_WAIT);
+            if (plainLength < contentLength) {
+                free(plainBuf);
+                return false;
+            }
+            if (contentLength > 0) {
+                if (isEncoded) {
+                    // url encoded form
+                    if (searchStr != "")
+                        searchStr += '&';
+                    searchStr += plainBuf;
+                }
+                _parseArguments(searchStr);
+                if (!isEncoded) {
+                    // plain post json or other data
+                    RequestArgument &arg = _currentArgs[_currentArgCount++];
+                    arg.key              = F("plain");
+                    arg.value            = String(plainBuf);
+                }
+
+                log_v("Plain: %s", plainBuf);
+                free(plainBuf);
+            } else {
+                // No content - but we can still have arguments in the URL.
+                _parseArguments(searchStr);
+            }
+        }
+
+        if (isForm) {
+            _parseArguments(searchStr);
+            if (!_parseForm(client, boundaryStr, contentLength)) {
+                return false;
+            }
+        }
+    } else {
+        String headerName;
+        String headerValue;
+        // parse headers
+        while (1) {
+            req = client.readStringUntil('\r');
+            client.readStringUntil('\n');
+            if (req == "")
+                break; // no moar headers
+            int headerDiv = req.indexOf(':');
+            if (headerDiv == -1) {
+                break;
+            }
+            headerName  = req.substring(0, headerDiv);
+            headerValue = req.substring(headerDiv + 2);
+            _collectHeader(headerName.c_str(), headerValue.c_str());
+
+            log_v("headerName: %s", headerName.c_str());
+            log_v("headerValue: %s", headerValue.c_str());
+
+            if (headerName.equalsIgnoreCase("Host")) {
+                _hostHeader = headerValue;
+            }
+        }
+        _parseArguments(searchStr);
+    }
+    client.flush();
+
+    log_v("Request: %s", url.c_str());
+    log_v(" Arguments: %s", searchStr.c_str());
+
+    return true;
+}
+
+bool WebServer::_collectHeader(const char *headerName, const char *headerValue) {
+    for (int i = 0; i < _headerKeysCount; i++) {
+        if (_currentHeaders[i].key.equalsIgnoreCase(headerName)) {
+            _currentHeaders[i].value = headerValue;
+            return true;
+        }
+    }
+    return false;
+}
+
+void WebServer::_parseArguments(String data) {
+    log_v("args: %s", data.c_str());
+    if (_currentArgs)
+        delete[] _currentArgs;
+    _currentArgs = 0;
+    if (data.length() == 0) {
+        _currentArgCount = 0;
+        _currentArgs     = new RequestArgument[1];
+        return;
+    }
+    _currentArgCount = 1;
+
+    for (int i = 0; i < (int)data.length();) {
+        i = data.indexOf('&', i);
+        if (i == -1)
+            break;
+        ++i;
+        ++_currentArgCount;
+    }
+    log_v("args count: %d", _currentArgCount);
+
+    _currentArgs = new RequestArgument[_currentArgCount + 1];
+    int pos      = 0;
+    int iarg;
+    for (iarg = 0; iarg < _currentArgCount;) {
+        int equal_sign_index = data.indexOf('=', pos);
+        int next_arg_index   = data.indexOf('&', pos);
+        log_v("pos %d =@%d &@%d", pos, equal_sign_index, next_arg_index);
+        if ((equal_sign_index == -1) || ((equal_sign_index > next_arg_index) && (next_arg_index != -1))) {
+            log_e("arg missing value: %d", iarg);
+            if (next_arg_index == -1)
+                break;
+            pos = next_arg_index + 1;
+            continue;
+        }
+        RequestArgument &arg = _currentArgs[iarg];
+        arg.key              = urlDecode(data.substring(pos, equal_sign_index));
+        arg.value            = urlDecode(data.substring(equal_sign_index + 1, next_arg_index));
+        log_v("arg %d key: %s value: %s", iarg, arg.key.c_str(), arg.value.c_str());
+        ++iarg;
+        if (next_arg_index == -1)
+            break;
+        pos = next_arg_index + 1;
+    }
+    _currentArgCount = iarg;
+    log_v("args count: %d", _currentArgCount);
+}
+
+void WebServer::_uploadWriteByte(uint8_t b) {
+    if (_currentUpload->currentSize == HTTP_UPLOAD_BUFLEN) {
+        if (_currentHandler && _currentHandler->canUpload(_currentUri))
+            _currentHandler->upload(*this, _currentUri, *_currentUpload);
+        _currentUpload->totalSize += _currentUpload->currentSize;
+        _currentUpload->currentSize = 0;
+    }
+    _currentUpload->buf[_currentUpload->currentSize++] = b;
+}
+
+int WebServer::_uploadReadByte(WiFiClient &client) {
+    int res = client.read();
+    if (res < 0) {
+        // keep trying until you either read a valid byte or timeout
+        unsigned long startMillis  = millis();
+        long timeoutIntervalMillis = client.getTimeout();
+        boolean timedOut           = false;
+        for (;;) {
+            if (!client.connected())
+                return -1;
+            // loosely modeled after blinkWithoutDelay pattern
+            while (!timedOut && !client.available() && client.connected()) {
+                delay(2);
+                timedOut = millis() - startMillis >= timeoutIntervalMillis;
+            }
+
+            res = client.read();
+            if (res >= 0) {
+                return res; // exit on a valid read
+            }
+            // NOTE: it is possible to get here and have all of the following
+            //       assertions hold true
+            //
+            //       -- client.available() > 0
+            //       -- client.connected == true
+            //       -- res == -1
+            //
+            //       a simple retry strategy overcomes this which is to say the
+            //       assertion is not permanent, but the reason that this works
+            //       is elusive, and possibly indicative of a more subtle underlying
+            //       issue
+
+            timedOut = millis() - startMillis >= timeoutIntervalMillis;
+            if (timedOut) {
+                return res; // exit on a timeout
+            }
+        }
+    }
+
+    return res;
+}
+
+bool WebServer::_parseForm(WiFiClient &client, String boundary, uint32_t len) {
+    (void)len;
+    log_v("Parse Form: Boundary: %s Length: %d", boundary.c_str(), len);
+    String line;
+    int retry = 0;
+    do {
+        line = client.readStringUntil('\r');
+        ++retry;
+    } while (line.length() == 0 && retry < 3);
+
+    client.readStringUntil('\n');
+    // start reading the form
+    if (line == ("--" + boundary)) {
+        if (_postArgs)
+            delete[] _postArgs;
+        _postArgs    = new RequestArgument[WEBSERVER_MAX_POST_ARGS];
+        _postArgsLen = 0;
+        while (1) {
+            String argName;
+            String argValue;
+            String argType;
+            String argFilename;
+            bool argIsFile = false;
+
+            line = client.readStringUntil('\r');
+            client.readStringUntil('\n');
+            if (line.length() > 19 && line.substring(0, 19).equalsIgnoreCase(F("Content-Disposition"))) {
+                int nameStart = line.indexOf('=');
+                if (nameStart != -1) {
+                    argName   = line.substring(nameStart + 2);
+                    nameStart = argName.indexOf('=');
+                    if (nameStart == -1) {
+                        argName = argName.substring(0, argName.length() - 1);
+                    } else {
+                        argFilename = argName.substring(nameStart + 2, argName.length() - 1);
+                        argName     = argName.substring(0, argName.indexOf('"'));
+                        argIsFile   = true;
+                        log_v("PostArg FileName: %s", argFilename.c_str());
+                        // use GET to set the filename if uploading using blob
+                        if (argFilename == F("blob") && hasArg(FPSTR(filename)))
+                            argFilename = arg(FPSTR(filename));
+                    }
+                    log_v("PostArg Name: %s", argName.c_str());
+                    using namespace mime;
+                    argType = FPSTR(mimeTable[txt].mimeType);
+                    line    = client.readStringUntil('\r');
+                    client.readStringUntil('\n');
+                    if (line.length() > 12 && line.substring(0, 12).equalsIgnoreCase(FPSTR(Content_Type))) {
+                        argType = line.substring(line.indexOf(':') + 2);
+                        // skip next line
+                        client.readStringUntil('\r');
+                        client.readStringUntil('\n');
+                    }
+                    log_v("PostArg Type: %s", argType.c_str());
+                    if (!argIsFile) {
+                        while (1) {
+                            line = client.readStringUntil('\r');
+                            client.readStringUntil('\n');
+                            if (line.startsWith("--" + boundary))
+                                break;
+                            if (argValue.length() > 0)
+                                argValue += "\n";
+                            argValue += line;
+                        }
+                        log_v("PostArg Value: %s", argValue.c_str());
+
+                        RequestArgument &arg = _postArgs[_postArgsLen++];
+                        arg.key              = argName;
+                        arg.value            = argValue;
+
+                        if (line == ("--" + boundary + "--")) {
+                            log_v("Done Parsing POST");
+                            break;
+                        } else if (_postArgsLen >= WEBSERVER_MAX_POST_ARGS) {
+                            log_e("Too many PostArgs (max: %d) in request.", WEBSERVER_MAX_POST_ARGS);
+                            return false;
+                        }
+                    } else {
+                        _currentUpload.reset(new HTTPUpload());
+                        _currentUpload->status      = UPLOAD_FILE_START;
+                        _currentUpload->name        = argName;
+                        _currentUpload->filename    = argFilename;
+                        _currentUpload->type        = argType;
+                        _currentUpload->totalSize   = 0;
+                        _currentUpload->currentSize = 0;
+                        log_v(
+                            "Start File: %s Type: %s",
+                            _currentUpload->filename.c_str(),
+                            _currentUpload->type.c_str()
+                        );
+                        if (_currentHandler && _currentHandler->canUpload(_currentUri))
+                            _currentHandler->upload(*this, _currentUri, *_currentUpload);
+                        _currentUpload->status = UPLOAD_FILE_WRITE;
+                        int argByte            = _uploadReadByte(client);
+                    readfile:
+
+                        while (argByte != 0x0D) {
+                            if (argByte < 0)
+                                return _parseFormUploadAborted();
+                            _uploadWriteByte(argByte);
+                            argByte = _uploadReadByte(client);
+                        }
+
+                        argByte = _uploadReadByte(client);
+                        if (argByte < 0)
+                            return _parseFormUploadAborted();
+                        if (argByte == 0x0A) {
+                            argByte = _uploadReadByte(client);
+                            if (argByte < 0)
+                                return _parseFormUploadAborted();
+                            if ((char)argByte != '-') {
+                                // continue reading the file
+                                _uploadWriteByte(0x0D);
+                                _uploadWriteByte(0x0A);
+                                goto readfile;
+                            } else {
+                                argByte = _uploadReadByte(client);
+                                if (argByte < 0)
+                                    return _parseFormUploadAborted();
+                                if ((char)argByte != '-') {
+                                    // continue reading the file
+                                    _uploadWriteByte(0x0D);
+                                    _uploadWriteByte(0x0A);
+                                    _uploadWriteByte((uint8_t)('-'));
+                                    goto readfile;
+                                }
+                            }
+
+                            uint8_t endBuf[boundary.length()];
+                            uint32_t i = 0;
+                            while (i < boundary.length()) {
+                                argByte = _uploadReadByte(client);
+                                if (argByte < 0)
+                                    return _parseFormUploadAborted();
+                                if ((char)argByte == 0x0D) {
+                                    _uploadWriteByte(0x0D);
+                                    _uploadWriteByte(0x0A);
+                                    _uploadWriteByte((uint8_t)('-'));
+                                    _uploadWriteByte((uint8_t)('-'));
+                                    uint32_t j = 0;
+                                    while (j < i) {
+                                        _uploadWriteByte(endBuf[j++]);
+                                    }
+                                    goto readfile;
+                                }
+                                endBuf[i++] = (uint8_t)argByte;
+                            }
+
+                            if (strstr((const char *)endBuf, boundary.c_str()) != NULL) {
+                                if (_currentHandler && _currentHandler->canUpload(_currentUri))
+                                    _currentHandler->upload(*this, _currentUri, *_currentUpload);
+                                _currentUpload->totalSize += _currentUpload->currentSize;
+                                _currentUpload->status = UPLOAD_FILE_END;
+                                if (_currentHandler && _currentHandler->canUpload(_currentUri))
+                                    _currentHandler->upload(*this, _currentUri, *_currentUpload);
+                                log_v(
+                                    "End File: %s Type: %s Size: %d",
+                                    _currentUpload->filename.c_str(),
+                                    _currentUpload->type.c_str(),
+                                    _currentUpload->totalSize
+                                );
+                                line = client.readStringUntil(0x0D);
+                                client.readStringUntil(0x0A);
+                                if (line == "--") {
+                                    log_v("Done Parsing POST");
+                                    break;
+                                }
+                                continue;
+                            } else {
+                                _uploadWriteByte(0x0D);
+                                _uploadWriteByte(0x0A);
+                                _uploadWriteByte((uint8_t)('-'));
+                                _uploadWriteByte((uint8_t)('-'));
+                                uint32_t i = 0;
+                                while (i < boundary.length()) {
+                                    _uploadWriteByte(endBuf[i++]);
+                                }
+                                argByte = _uploadReadByte(client);
+                                goto readfile;
+                            }
+                        } else {
+                            _uploadWriteByte(0x0D);
+                            goto readfile;
+                        }
+                        break;
+                    }
+                }
+            }
+        }
+
+        int iarg;
+        int totalArgs = ((WEBSERVER_MAX_POST_ARGS - _postArgsLen) < _currentArgCount)
+                            ? (WEBSERVER_MAX_POST_ARGS - _postArgsLen)
+                            : _currentArgCount;
+        for (iarg = 0; iarg < totalArgs; iarg++) {
+            RequestArgument &arg = _postArgs[_postArgsLen++];
+            arg.key              = _currentArgs[iarg].key;
+            arg.value            = _currentArgs[iarg].value;
+        }
+        if (_currentArgs)
+            delete[] _currentArgs;
+        _currentArgs = new RequestArgument[_postArgsLen];
+        for (iarg = 0; iarg < _postArgsLen; iarg++) {
+            RequestArgument &arg = _currentArgs[iarg];
+            arg.key              = _postArgs[iarg].key;
+            arg.value            = _postArgs[iarg].value;
+        }
+        _currentArgCount = iarg;
+        if (_postArgs) {
+            delete[] _postArgs;
+            _postArgs    = nullptr;
+            _postArgsLen = 0;
+        }
+        return true;
+    }
+    log_e("Error: line: %s", line.c_str());
+    return false;
+}
+
+String WebServer::urlDecode(const String &text) {
+    String decoded   = "";
+    char temp[]      = "0x00";
+    unsigned int len = text.length();
+    unsigned int i   = 0;
+    while (i < len) {
+        char decodedChar;
+        char encodedChar = text.charAt(i++);
+        if ((encodedChar == '%') && (i + 1 < len)) {
+            temp[2] = text.charAt(i++);
+            temp[3] = text.charAt(i++);
+
+            decodedChar = strtol(temp, NULL, 16);
+        } else {
+            if (encodedChar == '+') {
+                decodedChar = ' ';
+            } else {
+                decodedChar = encodedChar; // normal ascii char
+            }
+        }
+        decoded += decodedChar;
+    }
+    return decoded;
+}
+
+bool WebServer::_parseFormUploadAborted() {
+    _currentUpload->status = UPLOAD_FILE_ABORTED;
+    if (_currentHandler && _currentHandler->canUpload(_currentUri))
+        _currentHandler->upload(*this, _currentUri, *_currentUpload);
+    return false;
+}
+
+#endif // LT_ARD_HAS_WIFI
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_preferences_8h/index.html b/ltapi/_preferences_8h/index.html new file mode 100644 index 000000000..cf83e1c11 --- /dev/null +++ b/ltapi/_preferences_8h/index.html @@ -0,0 +1,2389 @@ + + + + + + + + + + + + + + + + + + + + File Preferences.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File Preferences.h

+

FileList > arduino > libraries > common > Preferences > Preferences.h

+

Go to the source code of this file.

+
    +
  • #include <stdbool.h>
  • +
  • #include <stdint.h>
  • +
  • #include <stdlib.h>
  • +
  • #include <api/String.h>
  • +
+

Classes

+ + + + + + + + + + + + + +
TypeName
classIPreferences
+

Public Types

+ + + + + + + + + + + + + +
TypeName
enumPreferenceType
+

Public Types Documentation

+

enum PreferenceType

+
enum PreferenceType {
+    PT_I8,
+    PT_U8,
+    PT_I16,
+    PT_U16,
+    PT_I32,
+    PT_U32,
+    PT_I64,
+    PT_U64,
+    PT_STR,
+    PT_BLOB,
+    PT_INVALID
+};
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/Preferences/Preferences.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_preferences_8h_source/index.html b/ltapi/_preferences_8h_source/index.html new file mode 100644 index 000000000..155a28af4 --- /dev/null +++ b/ltapi/_preferences_8h_source/index.html @@ -0,0 +1,2379 @@ + + + + + + + + + + + + + + + + + + + + File Preferences.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File Preferences.h

+

File List > arduino > libraries > common > Preferences > Preferences.h

+

Go to the documentation of this file.

+
// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+#pragma once
+
+#include <stdbool.h>
+#include <stdint.h>
+#include <stdlib.h>
+
+#include <api/String.h>
+
+typedef enum {
+    PT_I8,
+    PT_U8,
+    PT_I16,
+    PT_U16,
+    PT_I32,
+    PT_U32,
+    PT_I64,
+    PT_U64,
+    PT_STR,
+    PT_BLOB,
+    PT_INVALID,
+} PreferenceType;
+
+class IPreferences {
+  public:
+    IPreferences() {}
+
+    ~IPreferences() {}
+
+    bool begin(const char *name, bool readOnly = false, const char *partition_label = NULL);
+    void end();
+
+    bool clear();
+    bool remove(const char *key);
+
+    size_t putChar(const char *key, int8_t value);
+    size_t putUChar(const char *key, uint8_t value);
+    size_t putShort(const char *key, int16_t value);
+    size_t putUShort(const char *key, uint16_t value);
+    size_t putInt(const char *key, int32_t value);
+    size_t putUInt(const char *key, uint32_t value);
+    size_t putLong(const char *key, int32_t value);
+    size_t putULong(const char *key, uint32_t value);
+    size_t putLong64(const char *key, int64_t value);
+    size_t putULong64(const char *key, uint64_t value);
+    size_t putFloat(const char *key, float_t value);
+    size_t putDouble(const char *key, double_t value);
+    size_t putBool(const char *key, bool value);
+    size_t putString(const char *key, const char *value);
+    size_t putString(const char *key, String value);
+    size_t putBytes(const char *key, const void *value, size_t len);
+
+    bool isKey(const char *key);
+    PreferenceType getType(const char *key);
+    int8_t getChar(const char *key, int8_t defaultValue = 0);
+    uint8_t getUChar(const char *key, uint8_t defaultValue = 0);
+    int16_t getShort(const char *key, int16_t defaultValue = 0);
+    uint16_t getUShort(const char *key, uint16_t defaultValue = 0);
+    int32_t getInt(const char *key, int32_t defaultValue = 0);
+    uint32_t getUInt(const char *key, uint32_t defaultValue = 0);
+    int32_t getLong(const char *key, int32_t defaultValue = 0);
+    uint32_t getULong(const char *key, uint32_t defaultValue = 0);
+    int64_t getLong64(const char *key, int64_t defaultValue = 0);
+    uint64_t getULong64(const char *key, uint64_t defaultValue = 0);
+    float_t getFloat(const char *key, float_t defaultValue = NAN);
+    double_t getDouble(const char *key, double_t defaultValue = NAN);
+    bool getBool(const char *key, bool defaultValue = false);
+    size_t getString(const char *key, char *value, size_t maxLen);
+    String getString(const char *key, String defaultValue = String());
+    size_t getBytesLength(const char *key);
+    size_t getBytes(const char *key, void *buf, size_t maxLen);
+    size_t freeEntries();
+};
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_request_handler_8h/index.html b/ltapi/_request_handler_8h/index.html new file mode 100644 index 000000000..142efcf62 --- /dev/null +++ b/ltapi/_request_handler_8h/index.html @@ -0,0 +1,2329 @@ + + + + + + + + + + + + + + + + + + + + File RequestHandler.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_request_handler_8h_source/index.html b/ltapi/_request_handler_8h_source/index.html new file mode 100644 index 000000000..acedad732 --- /dev/null +++ b/ltapi/_request_handler_8h_source/index.html @@ -0,0 +1,2347 @@ + + + + + + + + + + + + + + + + + + + + File RequestHandler.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File RequestHandler.h

+

File List > arduino > libraries > ext > WebServer > detail > RequestHandler.h

+

Go to the documentation of this file.

+
#pragma once
+
+#include <assert.h>
+#include <vector>
+
+class RequestHandler {
+  public:
+    virtual ~RequestHandler() {}
+
+    virtual bool canHandle(HTTPMethod method, String uri) {
+        (void)method;
+        (void)uri;
+        return false;
+    }
+
+    virtual bool canUpload(String uri) {
+        (void)uri;
+        return false;
+    }
+
+    virtual bool handle(WebServer &server, HTTPMethod requestMethod, String requestUri) {
+        (void)server;
+        (void)requestMethod;
+        (void)requestUri;
+        return false;
+    }
+
+    virtual void upload(WebServer &server, String requestUri, HTTPUpload &upload) {
+        (void)server;
+        (void)requestUri;
+        (void)upload;
+    }
+
+    RequestHandler *next() {
+        return _next;
+    }
+
+    void next(RequestHandler *r) {
+        _next = r;
+    }
+
+  private:
+    RequestHandler *_next = nullptr;
+
+  protected:
+    std::vector<String> pathArgs;
+
+  public:
+    const String &pathArg(unsigned int i) {
+        assert(i < pathArgs.size());
+        return pathArgs[i];
+    }
+};
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_request_handlers_impl_8h/index.html b/ltapi/_request_handlers_impl_8h/index.html new file mode 100644 index 000000000..4c9554131 --- /dev/null +++ b/ltapi/_request_handlers_impl_8h/index.html @@ -0,0 +1,2335 @@ + + + + + + + + + + + + + + + + + + + + File RequestHandlersImpl.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File RequestHandlersImpl.h

+

FileList > arduino > libraries > ext > WebServer > detail > RequestHandlersImpl.h

+

Go to the source code of this file.

+
    +
  • #include "RequestHandler.h"
  • +
  • #include "Uri.h"
  • +
  • #include "WString.h"
  • +
  • #include "mimetable.h"
  • +
+

Classes

+ + + + + + + + + + + + + + + + + +
TypeName
classFunctionRequestHandler
classStaticRequestHandler
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/detail/RequestHandlersImpl.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_request_handlers_impl_8h_source/index.html b/ltapi/_request_handlers_impl_8h_source/index.html new file mode 100644 index 000000000..b98dba16c --- /dev/null +++ b/ltapi/_request_handlers_impl_8h_source/index.html @@ -0,0 +1,2443 @@ + + + + + + + + + + + + + + + + + + + + File RequestHandlersImpl.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File RequestHandlersImpl.h

+

File List > arduino > libraries > ext > WebServer > detail > RequestHandlersImpl.h

+

Go to the documentation of this file.

+
#pragma once
+
+#include "RequestHandler.h"
+#include "Uri.h"
+#include "WString.h"
+#include "mimetable.h"
+
+using namespace mime;
+
+class FunctionRequestHandler : public RequestHandler {
+  public:
+    FunctionRequestHandler(
+        WebServer::THandlerFunction fn, WebServer::THandlerFunction ufn, const Uri &uri, HTTPMethod method
+    )
+        : _fn(fn), _ufn(ufn), _uri(uri.clone()), _method(method) {
+        _uri->initPathArgs(pathArgs);
+    }
+
+    ~FunctionRequestHandler() {
+        delete _uri;
+    }
+
+    bool canHandle(HTTPMethod requestMethod, String requestUri) override {
+        if (_method != HTTP_ANY && _method != requestMethod)
+            return false;
+
+        return _uri->canHandle(requestUri, pathArgs);
+    }
+
+    bool canUpload(String requestUri) override {
+        if (!_ufn || !canHandle(HTTP_POST, requestUri))
+            return false;
+
+        return true;
+    }
+
+    bool handle(WebServer &server, HTTPMethod requestMethod, String requestUri) override {
+        (void)server;
+        if (!canHandle(requestMethod, requestUri))
+            return false;
+
+        _fn();
+        return true;
+    }
+
+    void upload(WebServer &server, String requestUri, HTTPUpload &upload) override {
+        (void)server;
+        (void)upload;
+        if (canUpload(requestUri))
+            _ufn();
+    }
+
+  protected:
+    WebServer::THandlerFunction _fn;
+    WebServer::THandlerFunction _ufn;
+    Uri *_uri;
+    HTTPMethod _method;
+};
+
+class StaticRequestHandler : public RequestHandler {
+  public:
+    StaticRequestHandler(FS &fs, const char *path, const char *uri, const char *cache_header)
+        : _fs(fs), _uri(uri), _path(path), _cache_header(cache_header) {
+        File f  = fs.open(path);
+        _isFile = (f && (!f.isDirectory()));
+        log_v(
+            "StaticRequestHandler: path=%s uri=%s isFile=%d, cache_header=%s\r\n",
+            path,
+            uri,
+            _isFile,
+            cache_header ? cache_header : ""
+        ); // issue 5506 - cache_header can be nullptr
+        _baseUriLength = _uri.length();
+    }
+
+    bool canHandle(HTTPMethod requestMethod, String requestUri) override {
+        if (requestMethod != HTTP_GET)
+            return false;
+
+        if ((_isFile && requestUri != _uri) || !requestUri.startsWith(_uri))
+            return false;
+
+        return true;
+    }
+
+    bool handle(WebServer &server, HTTPMethod requestMethod, String requestUri) override {
+        if (!canHandle(requestMethod, requestUri))
+            return false;
+
+        log_v("StaticRequestHandler::handle: request=%s _uri=%s\r\n", requestUri.c_str(), _uri.c_str());
+
+        String path(_path);
+
+        if (!_isFile) {
+            // Base URI doesn't point to a file.
+            // If a directory is requested, look for index file.
+            if (requestUri.endsWith("/"))
+                requestUri += "index.htm";
+
+            // Append whatever follows this URI in request to get the file path.
+            path += requestUri.substring(_baseUriLength);
+        }
+        log_v("StaticRequestHandler::handle: path=%s, isFile=%d\r\n", path.c_str(), _isFile);
+
+        String contentType = getContentType(path);
+
+        // look for gz file, only if the original specified path is not a gz.  So part only works to send gzip via
+        // content encoding when a non compressed is asked for if you point the the path to gzip you will serve the gzip
+        // as content type "application/x-gzip", not text or javascript etc...
+        if (!path.endsWith(FPSTR(mimeTable[gz].endsWith)) && !_fs.exists(path)) {
+            String pathWithGz = path + FPSTR(mimeTable[gz].endsWith);
+            if (_fs.exists(pathWithGz))
+                path += FPSTR(mimeTable[gz].endsWith);
+        }
+
+        File f = _fs.open(path, "r");
+        if (!f || !f.available())
+            return false;
+
+        if (_cache_header.length() != 0)
+            server.sendHeader("Cache-Control", _cache_header);
+
+        server.streamFile(f, contentType);
+        return true;
+    }
+
+    static String getContentType(const String &path) {
+        char buff[sizeof(mimeTable[0].mimeType)];
+        // Check all entries but last one for match, return if found
+        for (size_t i = 0; i < sizeof(mimeTable) / sizeof(mimeTable[0]) - 1; i++) {
+            strcpy_P(buff, mimeTable[i].endsWith);
+            if (path.endsWith(buff)) {
+                strcpy_P(buff, mimeTable[i].mimeType);
+                return String(buff);
+            }
+        }
+        // Fall-through and just return default type
+        strcpy_P(buff, mimeTable[sizeof(mimeTable) / sizeof(mimeTable[0]) - 1].mimeType);
+        return String(buff);
+    }
+
+  protected:
+    FS _fs;
+    String _uri;
+    String _path;
+    String _cache_header;
+    bool _isFile;
+    size_t _baseUriLength;
+};
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_serial_8cpp/index.html b/ltapi/_serial_8cpp/index.html new file mode 100644 index 000000000..e4bcc6400 --- /dev/null +++ b/ltapi/_serial_8cpp/index.html @@ -0,0 +1,2298 @@ + + + + + + + + + + + + + + + + + + + + File Serial.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_serial_8cpp_source/index.html b/ltapi/_serial_8cpp_source/index.html new file mode 100644 index 000000000..02b56cf0d --- /dev/null +++ b/ltapi/_serial_8cpp_source/index.html @@ -0,0 +1,2330 @@ + + + + + + + + + + + + + + + + + + + + File Serial.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File Serial.cpp

+

File List > api > Serial > Serial.cpp

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2023-05-23. */
+
+#include "Serial.h"
+
+SerialClass::SerialClass(uint32_t port, pin_size_t rx, pin_size_t tx) {
+    this->port = port;
+    this->rx   = rx;
+    this->tx   = tx;
+    this->buf  = NULL;
+    this->data = NULL;
+}
+
+#if LT_AUTO_DOWNLOAD_REBOOT && defined(LT_UART_ADR_PATTERN)
+static uint8_t adrState = 0;
+static uint8_t adrCmd[] = {LT_UART_ADR_PATTERN};
+
+void SerialClass::adrParse(uint8_t c) {
+    adrState = (adrState + 1) * (c == adrCmd[adrState]);
+    if (adrState == sizeof(adrCmd) / sizeof(uint8_t)) {
+        LT_I("Auto download mode: rebooting");
+        LT.restartDownloadMode();
+    }
+}
+#endif
+
+int SerialClass::available() {
+    return this->buf ? this->buf->available() : 0;
+}
+
+int SerialClass::peek() {
+    return this->buf ? this->buf->peek() : -1;
+}
+
+int SerialClass::read() {
+    return this->buf ? this->buf->read_char() : -1;
+}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_serial_8h/index.html b/ltapi/_serial_8h/index.html new file mode 100644 index 000000000..fbddeeb55 --- /dev/null +++ b/ltapi/_serial_8h/index.html @@ -0,0 +1,2376 @@ + + + + + + + + + + + + + + + + + + + + File Serial.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File Serial.h

+

FileList > api > Serial > Serial.h

+

Go to the source code of this file.

+
    +
  • #include <Arduino.h>
  • +
  • #include <api/HardwareSerial.h>
  • +
  • #include <api/RingBuffer.h>
  • +
+

Classes

+ + + + + + + + + + + + + +
TypeName
classSerialClass
+

Macros

+ + + + + + + + + + + + + +
TypeName
defineHAS_SERIAL_CLASS 1
+

Macro Definition Documentation

+

define HAS_SERIAL_CLASS

+
#define HAS_SERIAL_CLASS 1
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/Serial/Serial.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_serial_8h_source/index.html b/ltapi/_serial_8h_source/index.html new file mode 100644 index 000000000..ec32799dd --- /dev/null +++ b/ltapi/_serial_8h_source/index.html @@ -0,0 +1,2351 @@ + + + + + + + + + + + + + + + + + + + + File Serial.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File Serial.h

+

File List > api > Serial > Serial.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-06-23. */
+
+#pragma once
+
+#include <Arduino.h>
+#include <api/HardwareSerial.h>
+#include <api/RingBuffer.h>
+
+using namespace arduino;
+
+class SerialClass : public HardwareSerial {
+  private:
+    uint32_t port;
+    pin_size_t rx;
+    pin_size_t tx;
+
+  public:
+    void *data;
+
+  private:
+    RingBuffer *buf;
+    uint32_t baudrate;
+    uint16_t config;
+
+  public:
+    SerialClass(uint32_t port, pin_size_t rx = PIN_INVALID, pin_size_t tx = PIN_INVALID);
+
+    inline void begin(unsigned long baudrate) {
+        begin(baudrate, SERIAL_8N1);
+    }
+
+    inline void configure(unsigned long baudrate) {
+        configure(baudrate, SERIAL_8N1);
+    }
+
+    void begin(unsigned long baudrate, uint16_t config);
+    void configure(unsigned long baudrate, uint16_t config);
+    void end();
+    int available();
+    int peek();
+    int read();
+    void flush();
+    size_t write(uint8_t c);
+
+    operator bool() {
+        return !!buf;
+    }
+
+  public:
+#if LT_AUTO_DOWNLOAD_REBOOT
+    static void adrParse(uint8_t c);
+#endif
+
+    using Print::write;
+};
+
+#define HAS_SERIAL_CLASS 1
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_singletons_8cpp/index.html b/ltapi/_singletons_8cpp/index.html new file mode 100644 index 000000000..ce9633bb4 --- /dev/null +++ b/ltapi/_singletons_8cpp/index.html @@ -0,0 +1,2409 @@ + + + + + + + + + + + + + + + + + + + + File Singletons.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File Singletons.cpp

+

FileList > arduino > libraries > inline > Singletons.cpp

+

Go to the source code of this file.

+
    +
  • #include <LT.h>
  • +
  • #include <Flash.h>
  • +
+

Public Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
EspClassESP
FlashClassFlash
LibreTinyLT
LibreTinyOTAOTA
LibreTinyWDTWDT
+

Public Attributes Documentation

+

variable ESP

+
EspClass ESP;
+
+

variable Flash

+
FlashClass Flash;
+
+

variable LT

+
LibreTiny LT;
+
+

variable OTA

+
LibreTinyOTA OTA;
+
+

variable WDT

+
LibreTinyWDT WDT;
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/inline/Singletons.cpp

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_singletons_8cpp_source/index.html b/ltapi/_singletons_8cpp_source/index.html new file mode 100644 index 000000000..64b959903 --- /dev/null +++ b/ltapi/_singletons_8cpp_source/index.html @@ -0,0 +1,2305 @@ + + + + + + + + + + + + + + + + + + + + File Singletons.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_software_serial_8cpp/index.html b/ltapi/_software_serial_8cpp/index.html new file mode 100644 index 000000000..980a7ad3d --- /dev/null +++ b/ltapi/_software_serial_8cpp/index.html @@ -0,0 +1,2298 @@ + + + + + + + + + + + + + + + + + + + + File SoftwareSerial.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_software_serial_8cpp_source/index.html b/ltapi/_software_serial_8cpp_source/index.html new file mode 100644 index 000000000..a5af219f8 --- /dev/null +++ b/ltapi/_software_serial_8cpp_source/index.html @@ -0,0 +1,2339 @@ + + + + + + + + + + + + + + + + + + + + File SoftwareSerial.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File SoftwareSerial.cpp

+

File List > api > SoftwareSerial > SoftwareSerial.cpp

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-07-03. */
+
+#include "SoftwareSerial.h"
+
+#if LT_ARD_HAS_SOFTSERIAL
+
+SoftwareSerial::SoftwareSerial(pin_size_t receivePin, pin_size_t transmitPin, bool inverted) {
+    data.rx.buf = NULL;
+    data.tx.buf = NULL;
+    data.rx.pin = receivePin;
+    data.tx.pin = transmitPin;
+    data.invert = inverted == true;
+}
+
+int SoftwareSerial::available() {
+    return data.rx.buf->available();
+}
+
+int SoftwareSerial::peek() {
+    return data.rx.buf->peek();
+}
+
+int SoftwareSerial::read() {
+    return data.rx.buf->read_char();
+}
+
+void SoftwareSerial::flush() {
+    while (data.rx.buf->available()) {
+        yield();
+    }
+}
+
+size_t SoftwareSerial::write(uint8_t c) {
+    while (data.tx.buf->isFull()) {
+        yield();
+    }
+    data.tx.buf->store_char(c);
+    if (data.tx.state == SS_IDLE) {
+        data.tx.state = SS_START;
+        this->startTx();
+    }
+    return 1;
+}
+
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_software_serial_8h/index.html b/ltapi/_software_serial_8h/index.html new file mode 100644 index 000000000..e459f6851 --- /dev/null +++ b/ltapi/_software_serial_8h/index.html @@ -0,0 +1,2397 @@ + + + + + + + + + + + + + + + + + + + + File SoftwareSerial.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File SoftwareSerial.h

+

FileList > api > SoftwareSerial > SoftwareSerial.h

+

Go to the source code of this file.

+
    +
  • #include <Arduino.h>
  • +
  • #include <api/HardwareSerial.h>
  • +
  • #include <api/RingBuffer.h>
  • +
+

Classes

+ + + + + + + + + + + + + + + + + + + + + +
TypeName
structSoftData
structSoftSerial
classSoftwareSerial
+

Public Types

+ + + + + + + + + + + + + +
TypeName
enumSoftState
+

Public Types Documentation

+

enum SoftState

+
enum SoftState {
+    SS_IDLE = 0,
+    SS_START,
+    SS_DATA0,
+    SS_DATA1,
+    SS_DATA2,
+    SS_DATA3,
+    SS_DATA4,
+    SS_DATA5,
+    SS_DATA6,
+    SS_DATA7,
+    SS_STOP,
+    SS_END
+};
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/SoftwareSerial/SoftwareSerial.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_software_serial_8h_source/index.html b/ltapi/_software_serial_8h_source/index.html new file mode 100644 index 000000000..3a51c18f7 --- /dev/null +++ b/ltapi/_software_serial_8h_source/index.html @@ -0,0 +1,2370 @@ + + + + + + + + + + + + + + + + + + + + File SoftwareSerial.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File SoftwareSerial.h

+

File List > api > SoftwareSerial > SoftwareSerial.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-07-03. */
+
+#pragma once
+
+#if LT_ARD_HAS_SOFTSERIAL || DOXYGEN
+
+#include <Arduino.h>
+#include <api/HardwareSerial.h>
+#include <api/RingBuffer.h>
+
+using namespace arduino;
+
+typedef enum {
+    SS_IDLE = 0,
+    SS_START,
+    SS_DATA0,
+    SS_DATA1,
+    SS_DATA2,
+    SS_DATA3,
+    SS_DATA4,
+    SS_DATA5,
+    SS_DATA6,
+    SS_DATA7,
+    SS_STOP,
+    SS_END,
+} SoftState;
+
+typedef struct {
+    SoftState state;
+    RingBuffer *buf;
+    uint8_t byte;
+    pin_size_t pin;
+    void *param;
+} SoftData;
+
+typedef struct {
+    SoftData rx;
+    SoftData tx;
+    uint8_t invert;
+    void *param;
+} SoftSerial;
+
+class SoftwareSerial : public HardwareSerial {
+  private:
+    SoftSerial data;
+    void *param;
+
+  public:
+    SoftwareSerial(pin_size_t receivePin, pin_size_t transmitPin, bool inverted = false);
+
+    inline void begin(unsigned long baudrate) {
+        begin(baudrate, SERIAL_8N1);
+    }
+
+    int available();
+    int peek();
+    int read();
+    void flush();
+    size_t write(uint8_t c);
+
+    operator bool() {
+        return data.rx.buf || data.tx.buf;
+    }
+
+  public: // Family needs to implement these methods only
+    void begin(unsigned long baudrate, uint16_t config);
+    void end();
+
+  private:
+    void startTx();
+    void endTx();
+
+    using Print::write;
+};
+
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_stream_string_8cpp/index.html b/ltapi/_stream_string_8cpp/index.html new file mode 100644 index 000000000..c3f1404d2 --- /dev/null +++ b/ltapi/_stream_string_8cpp/index.html @@ -0,0 +1,2299 @@ + + + + + + + + + + + + + + + + + + + + File StreamString.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_stream_string_8cpp_source/index.html b/ltapi/_stream_string_8cpp_source/index.html new file mode 100644 index 000000000..83000eebc --- /dev/null +++ b/ltapi/_stream_string_8cpp_source/index.html @@ -0,0 +1,2333 @@ + + + + + + + + + + + + + + + + + + + + File StreamString.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File StreamString.cpp

+

File List > arduino > libraries > ext > StreamString > StreamString.cpp

+

Go to the documentation of this file.

+
#include <Arduino.h>
+#include "StreamString.h"
+
+size_t StreamString::write(const uint8_t *data, size_t size) {
+    if(size && data) {
+        concat(data, size);
+        return size;
+    }
+    return 0;
+}
+
+size_t StreamString::write(uint8_t data) {
+    return concat((char) data);
+}
+
+int StreamString::available() {
+    return length();
+}
+
+int StreamString::read() {
+    if(length()) {
+        char c = charAt(0);
+        remove(0, 1);
+        return c;
+
+    }
+    return -1;
+}
+
+int StreamString::peek() {
+    if(length()) {
+        char c = charAt(0);
+        return c;
+    }
+    return -1;
+}
+
+void StreamString::flush() {
+}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_stream_string_8h/index.html b/ltapi/_stream_string_8h/index.html new file mode 100644 index 000000000..abf8d7874 --- /dev/null +++ b/ltapi/_stream_string_8h/index.html @@ -0,0 +1,2325 @@ + + + + + + + + + + + + + + + + + + + + File StreamString.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_stream_string_8h_source/index.html b/ltapi/_stream_string_8h_source/index.html new file mode 100644 index 000000000..40fbfc76e --- /dev/null +++ b/ltapi/_stream_string_8h_source/index.html @@ -0,0 +1,2312 @@ + + + + + + + + + + + + + + + + + + + + File StreamString.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File StreamString.h

+

File List > arduino > libraries > ext > StreamString > StreamString.h

+

Go to the documentation of this file.

+
#ifndef STREAMSTRING_H_
+#define STREAMSTRING_H_
+
+
+class StreamString: public Stream, public String
+{
+public:
+    size_t write(const uint8_t *buffer, size_t size) override;
+    size_t write(uint8_t data) override;
+
+    int available() override;
+    int read() override;
+    int peek() override;
+    void flush() override;
+};
+
+
+#endif /* STREAMSTRING_H_ */
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_update_8cpp/index.html b/ltapi/_update_8cpp/index.html new file mode 100644 index 000000000..df23c3f80 --- /dev/null +++ b/ltapi/_update_8cpp/index.html @@ -0,0 +1,2470 @@ + + + + + + + + + + + + + + + + + + + + File Update.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File Update.cpp

+

FileList > arduino > libraries > common > Update > Update.cpp

+

Go to the source code of this file.

+
    +
  • #include "Update.h"
  • +
+

Public Attributes

+ + + + + + + + + + + + + +
TypeName
UpdateClassUpdate
+

Public Static Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
const UpdateErrorerrorMap = = {
UPDATE_ERROR_OK,
UPDATE_ERROR_OK,
UPDATE_ERROR_MAGIC_BYTE,
UPDATE_ERROR_BAD_ARGUMENT,
UPDATE_ERROR_BAD_ARGUMENT,
UPDATE_ERROR_BAD_ARGUMENT,
UPDATE_ERROR_MAGIC_BYTE,
UPDATE_ERROR_NO_PARTITION,
UPDATE_ERROR_BAD_ARGUMENT,
UPDATE_ERROR_BAD_ARGUMENT,
UPDATE_ERROR_BAD_ARGUMENT,
UPDATE_ERROR_BAD_ARGUMENT,
UPDATE_ERROR_ERASE,
UPDATE_ERROR_WRITE,
UPDATE_ERROR_WRITE,
UPDATE_ERROR_WRITE,
UPDATE_ERROR_WRITE,
}
+

Public Attributes Documentation

+

variable Update

+
UpdateClass Update;
+
+

Public Static Attributes Documentation

+

variable errorMap

+
const UpdateError errorMap[];
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/Update/Update.cpp

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_update_8cpp_source/index.html b/ltapi/_update_8cpp_source/index.html new file mode 100644 index 000000000..61e6c3e9c --- /dev/null +++ b/ltapi/_update_8cpp_source/index.html @@ -0,0 +1,2467 @@ + + + + + + + + + + + + + + + + + + + + File Update.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File Update.cpp

+

File List > arduino > libraries > common > Update > Update.cpp

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-05-29. */
+
+#include "Update.h"
+
+static const UpdateError errorMap[] = {
+    UPDATE_ERROR_OK,           /* UF2_ERR_OK - no error */
+    UPDATE_ERROR_OK,           /* UF2_ERR_IGNORE - block should be ignored */
+    UPDATE_ERROR_MAGIC_BYTE,   /* UF2_ERR_MAGIC - wrong magic numbers */
+    UPDATE_ERROR_BAD_ARGUMENT, /* UF2_ERR_FAMILY - family ID mismatched */
+    UPDATE_ERROR_BAD_ARGUMENT, /* UF2_ERR_NOT_HEADER - block is not a header */
+    UPDATE_ERROR_BAD_ARGUMENT, /* UF2_ERR_OTA_VER - unknown/invalid OTA format version */
+    UPDATE_ERROR_MAGIC_BYTE,   /* UF2_ERR_OTA_WRONG - no data for current OTA scheme */
+    UPDATE_ERROR_NO_PARTITION, /* UF2_ERR_PART_404 - no partition with that name */
+    UPDATE_ERROR_BAD_ARGUMENT, /* UF2_ERR_PART_INVALID - invalid partition info tag */
+    UPDATE_ERROR_BAD_ARGUMENT, /* UF2_ERR_PART_UNSET - attempted to write without target partition */
+    UPDATE_ERROR_BAD_ARGUMENT, /* UF2_ERR_DATA_TOO_LONG - data too long - tags won't fit */
+    UPDATE_ERROR_BAD_ARGUMENT, /* UF2_ERR_SEQ_MISMATCH - sequence number mismatched */
+    UPDATE_ERROR_ERASE,        /* UF2_ERR_ERASE_FAILED - erasing flash failed */
+    UPDATE_ERROR_WRITE,        /* UF2_ERR_WRITE_FAILED - writing to flash failed */
+    UPDATE_ERROR_WRITE,        /* UF2_ERR_WRITE_LENGTH - wrote fewer data than requested */
+    UPDATE_ERROR_WRITE,        /* UF2_ERR_WRITE_PROTECT - target area is write-protected */
+    UPDATE_ERROR_WRITE,        /* UF2_ERR_ALLOC_FAILED - dynamic memory allocation failed */
+};
+
+bool UpdateClass::begin(
+    size_t size,
+    int command,
+    __attribute__((unused)) int ledPin,
+    __attribute__((unused)) uint8_t ledOn,
+    __attribute__((unused)) const char *label
+) {
+#if !LT_HAS_OTA
+    LT_E("OTA is not yet supported on this chip!");
+    this->errArd = UPDATE_ERROR_BAD_ARGUMENT;
+    return false;
+#endif
+    if (this->ctx) {
+        return false;
+    }
+    this->clearError();
+    if (size == 0) {
+        this->errArd = UPDATE_ERROR_SIZE;
+        return false;
+    }
+    if (command != U_FLASH) {
+        this->errArd = UPDATE_ERROR_BAD_ARGUMENT;
+        return false;
+    }
+    if (size == UPDATE_SIZE_UNKNOWN) {
+        size = 0;
+    }
+
+    this->ctx = static_cast<lt_ota_ctx_t *>(malloc(sizeof(lt_ota_ctx_t)));
+    lt_ota_begin(this->ctx, size);
+    this->ctx->callback       = reinterpret_cast<void (*)(void *)>(progressHandler);
+    this->ctx->callback_param = this;
+
+    this->md5Ctx = static_cast<LT_MD5_CTX_T *>(malloc(sizeof(LT_MD5_CTX_T)));
+    MD5Init(this->md5Ctx);
+
+    return true;
+}
+
+bool UpdateClass::end(bool evenIfRemaining) {
+    if (!this->ctx)
+        return false;
+
+    // update is running or finished; cleanup and end it
+    if (!isFinished() && !evenIfRemaining)
+        // abort if not finished
+        this->errArd = UPDATE_ERROR_ABORT;
+
+    if (!this->md5Digest)
+        this->md5Digest = static_cast<uint8_t *>(malloc(16));
+    MD5Final(this->md5Digest, this->md5Ctx);
+
+    this->cleanup(/* clearError= */ evenIfRemaining);
+    return !this->hasError();
+}
+
+void UpdateClass::cleanup(bool clearError) {
+    if (!this->ctx)
+        return;
+
+    if (!lt_ota_end(this->ctx)) {
+        // activating firmware failed
+        this->errArd = UPDATE_ERROR_ACTIVATE;
+        this->errUf2 = UF2_ERR_OK;
+    } else if (this->md5Digest && this->md5Expected && memcmp(this->md5Digest, this->md5Expected, 16) != 0) {
+        // MD5 doesn't match
+        this->errArd = UPDATE_ERROR_MD5;
+        this->errUf2 = UF2_ERR_OK;
+    } else if (clearError) {
+        // successful finish and activation, clear error codes
+        this->clearError();
+    } else if (this->ctx->error > UF2_ERR_IGNORE) {
+        // make error code based on UF2OTA code
+        this->errArd = errorMap[this->ctx->error];
+        this->errUf2 = this->ctx->error;
+    } else {
+        // only keep Arduino error code (set by the caller)
+        this->errUf2 = UF2_ERR_OK;
+    }
+
+#if LT_DEBUG_OTA
+    if (this->hasError())
+        this->printErrorContext();
+#endif
+
+    free(this->ctx);
+    this->ctx = nullptr;
+    free(this->md5Ctx);
+    this->md5Ctx = nullptr;
+    free(this->md5Digest);
+    this->md5Digest = nullptr;
+    free(this->md5Expected);
+    this->md5Expected = nullptr;
+}
+
+size_t UpdateClass::write(const uint8_t *data, size_t len) {
+    if (!this->ctx)
+        return 0;
+
+    MD5Update(this->md5Ctx, data, len);
+    size_t written = lt_ota_write(ctx, data, len);
+    if (written != len)
+        this->cleanup(/* clearError= */ false);
+    return written;
+}
+
+size_t UpdateClass::writeStream(Stream &data) {
+    if (!this->ctx)
+        return 0;
+
+    size_t written    = 0;
+    uint32_t lastData = millis();
+    // loop until the update is complete
+    while (remaining()) {
+        // check stream availability
+        auto available = data.available();
+        if (available <= 0) {
+            if (millis() - lastData > UPDATE_TIMEOUT_MS) {
+                // waited for data too long; abort with error
+                this->errArd = UPDATE_ERROR_STREAM;
+                this->cleanup(/* clearError= */ false);
+                return written;
+            }
+            continue;
+        }
+        // available > 0
+        lastData = millis();
+
+        // read data to fit in the remaining buffer space
+        auto bufSize = this->ctx->buf_pos - this->ctx->buf;
+        auto read    = data.readBytes(this->ctx->buf_pos, UF2_BLOCK_SIZE - bufSize);
+        // update MD5
+        MD5Update(this->md5Ctx, this->ctx->buf_pos, read);
+        // increment buffer writing head
+        this->ctx->buf_pos += read;
+        // process the block if complete
+        if (bufSize + read == UF2_BLOCK_SIZE)
+            lt_ota_write_block(this->ctx, reinterpret_cast<uf2_block_t *>(this->ctx->buf));
+        // abort on errors
+        if (hasError()) {
+            this->cleanup(/* clearError= */ false);
+            return written;
+        }
+        written += read;
+    }
+    return written;
+}
+
+UpdateClass Update;
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_update_8h/index.html b/ltapi/_update_8h/index.html new file mode 100644 index 000000000..8d6d5ed26 --- /dev/null +++ b/ltapi/_update_8h/index.html @@ -0,0 +1,2529 @@ + + + + + + + + + + + + + + + + + + + + File Update.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

File Update.h

+

FileList > arduino > libraries > common > Update > Update.h

+

Go to the source code of this file.

+
    +
  • #include <Arduino.h>
  • +
  • #include <MD5.h>
  • +
  • #include <functional>
  • +
  • #include <uf2ota/uf2ota.h>
  • +
+

Classes

+ + + + + + + + + + + + + +
TypeName
classUpdateClass
+

Public Types

+ + + + + + + + + + + + + + + + + +
TypeName
enumUpdateCommand
enumUpdateError
+

Public Attributes

+ + + + + + + + + + + + + +
TypeName
UpdateClassUpdate
+

Macros

+ + + + + + + + + + + + + + + + + + + + + +
TypeName
defineENCRYPTED_BLOCK_SIZE 16
defineUPDATE_SIZE_UNKNOWN 0xFFFFFFFF
defineUPDATE_TIMEOUT_MS 30 * 1000
+

Public Types Documentation

+

enum UpdateCommand

+
enum UpdateCommand {
+    U_FLASH = 0,
+    U_SPIFFS = 100,
+    U_AUTH = 200
+};
+
+

enum UpdateError

+
enum UpdateError {
+    UPDATE_ERROR_OK = 0,
+    UPDATE_ERROR_WRITE = 1,
+    UPDATE_ERROR_ERASE = 2,
+    UPDATE_ERROR_READ = 3,
+    UPDATE_ERROR_SPACE = 4,
+    UPDATE_ERROR_SIZE = 5,
+    UPDATE_ERROR_STREAM = 6,
+    UPDATE_ERROR_MD5 = 7,
+    UPDATE_ERROR_MAGIC_BYTE = 8,
+    UPDATE_ERROR_ACTIVATE = 9,
+    UPDATE_ERROR_NO_PARTITION = 10,
+    UPDATE_ERROR_BAD_ARGUMENT = 11,
+    UPDATE_ERROR_ABORT = 12
+};
+
+

Public Attributes Documentation

+

variable Update

+
UpdateClass Update;
+
+

Macro Definition Documentation

+

define ENCRYPTED_BLOCK_SIZE

+
#define ENCRYPTED_BLOCK_SIZE 16
+
+

define UPDATE_SIZE_UNKNOWN

+
#define UPDATE_SIZE_UNKNOWN 0xFFFFFFFF
+
+

define UPDATE_TIMEOUT_MS

+
#define UPDATE_TIMEOUT_MS 30 * 1000
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/Update/Update.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_update_8h_source/index.html b/ltapi/_update_8h_source/index.html new file mode 100644 index 000000000..11c5eccd9 --- /dev/null +++ b/ltapi/_update_8h_source/index.html @@ -0,0 +1,2434 @@ + + + + + + + + + + + + + + + + + + + + File Update.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File Update.h

+

File List > arduino > libraries > common > Update > Update.h

+

Go to the documentation of this file.

+
#pragma once
+
+#include <Arduino.h>
+#include <MD5.h>
+#include <functional>
+#include <uf2ota/uf2ota.h>
+
+typedef enum {
+    UPDATE_ERROR_OK           = 0,  
+    UPDATE_ERROR_WRITE        = 1,  
+    UPDATE_ERROR_ERASE        = 2,  
+    UPDATE_ERROR_READ         = 3,  
+    UPDATE_ERROR_SPACE        = 4,  
+    UPDATE_ERROR_SIZE         = 5,  
+    UPDATE_ERROR_STREAM       = 6,  
+    UPDATE_ERROR_MD5          = 7,  
+    UPDATE_ERROR_MAGIC_BYTE   = 8,  
+    UPDATE_ERROR_ACTIVATE     = 9,  
+    UPDATE_ERROR_NO_PARTITION = 10, 
+    UPDATE_ERROR_BAD_ARGUMENT = 11, 
+    UPDATE_ERROR_ABORT        = 12, 
+} UpdateError;
+
+typedef enum {
+    U_FLASH  = 0,
+    U_SPIFFS = 100,
+    U_AUTH   = 200,
+} UpdateCommand;
+
+#define UPDATE_SIZE_UNKNOWN 0xFFFFFFFF
+
+#define ENCRYPTED_BLOCK_SIZE 16
+
+#define UPDATE_TIMEOUT_MS 30 * 1000
+
+class UpdateClass {
+  public:
+    typedef std::function<void(size_t, size_t)> THandlerFunction_Progress;
+
+  public: /* Update.cpp */
+    bool begin(
+        size_t size       = UPDATE_SIZE_UNKNOWN,
+        int command       = U_FLASH,
+        int ledPin        = -1,
+        uint8_t ledOn     = LOW,
+        const char *label = nullptr
+    );
+    bool end(bool evenIfRemaining = false);
+
+    size_t write(const uint8_t *data, size_t len);
+    size_t writeStream(Stream &data);
+
+  private: /* Update.cpp */
+    void cleanup(bool clearError = false);
+
+  public: /* UpdateUtil.cpp */
+    UpdateClass &onProgress(THandlerFunction_Progress handler);
+    static bool canRollBack();
+    static bool rollBack();
+    bool setMD5(const char *md5);
+    String md5String();
+    void md5(uint8_t *result);
+    uint16_t getErrorCode() const;
+    bool hasError() const;
+    void clearError();
+    const char *errorString() const;
+    void printError(Print &out) const;
+
+  private: /* UpdateUtil.cpp */
+    static void progressHandler(UpdateClass *self);
+    void printErrorContext();
+
+  private:
+    lt_ota_ctx_t *ctx{nullptr};
+    uf2_err_t errUf2{UF2_ERR_OK};
+    UpdateError errArd{UPDATE_ERROR_OK};
+    THandlerFunction_Progress callback{nullptr};
+    LT_MD5_CTX_T *md5Ctx{nullptr};
+    uint8_t *md5Digest{nullptr};
+    uint8_t *md5Expected{nullptr};
+
+  public:
+    inline UpdateError getError() const {
+        return this->errArd;
+    }
+
+    inline uf2_err_t getUF2Error() const {
+        return this->ctx ? this->ctx->error : this->errUf2;
+    }
+
+    inline void abort() {
+        this->end();
+    }
+
+    inline bool isRunning() {
+        return this->ctx;
+    }
+
+    inline bool isFinished() {
+        return !(this->ctx && this->ctx->bytes_written != this->ctx->bytes_total);
+    }
+
+    inline size_t size() {
+        return this->ctx ? this->ctx->bytes_total : 0;
+    }
+
+    inline size_t progress() {
+        return this->ctx ? this->ctx->bytes_written : 0;
+    }
+
+    inline size_t remaining() {
+        return this->size() - this->progress();
+    }
+
+    inline const char *getFirmwareName() {
+        if (this->ctx)
+            return this->ctx->info.fw_name;
+        return nullptr;
+    }
+
+    inline const char *getFirmwareVersion() {
+        if (this->ctx)
+            return this->ctx->info.fw_version;
+        return nullptr;
+    }
+
+    inline const char *getLibreTinyVersion() {
+        if (this->ctx)
+            return this->ctx->info.lt_version;
+        return nullptr;
+    }
+
+    inline const char *getBoardName() {
+        if (this->ctx)
+            return this->ctx->info.board;
+        return nullptr;
+    }
+};
+
+extern UpdateClass Update;
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_update_util_8cpp/index.html b/ltapi/_update_util_8cpp/index.html new file mode 100644 index 000000000..110df51d5 --- /dev/null +++ b/ltapi/_update_util_8cpp/index.html @@ -0,0 +1,2510 @@ + + + + + + + + + + + + + + + + + + + + File UpdateUtil.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File UpdateUtil.cpp

+

FileList > arduino > libraries > common > Update > UpdateUtil.cpp

+

Go to the source code of this file.

+
    +
  • #include "Update.h"
  • +
  • #include <utility>
  • +
  • #include <fal.h>
  • +
+

Public Static Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
const char *errArdText = = {
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
"Bad Size Given",
"Stream Read Timeout",
"MD5 Check Failed",
nullptr,
"Could Not Activate The Firmware",
nullptr,
"Bad Argument",
"Aborted",
}
const char *errUf2Text = = {
nullptr,
nullptr,
"Bad Magic Number",
"Bad Family ID",
"Missing Header",
"Old OTA Format Found",
"Image Not Applicable",
"Partition Not Found",
"Partition Info Invalid",
"Partition Info Missing",
"Block Data Too Long",
"Bad Block Sequence Number",
"Flash Erase Failed",
"Flash Write Failed",
"Write Failed Length",
"Partition Write-Protected",
"Memory Alloc Failed",
}
charerrorStr
+

Public Static Attributes Documentation

+

variable errArdText

+
const char* errArdText[];
+
+

variable errUf2Text

+
const char* errUf2Text[];
+
+

variable errorStr

+
char errorStr[14];
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/Update/UpdateUtil.cpp

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_update_util_8cpp_source/index.html b/ltapi/_update_util_8cpp_source/index.html new file mode 100644 index 000000000..a891a9d12 --- /dev/null +++ b/ltapi/_update_util_8cpp_source/index.html @@ -0,0 +1,2450 @@ + + + + + + + + + + + + + + + + + + + + File UpdateUtil.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File UpdateUtil.cpp

+

File List > arduino > libraries > common > Update > UpdateUtil.cpp

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-05-30. */
+
+#include "Update.h"
+
+#include <utility>
+
+extern "C" {
+#include <fal.h>
+}
+
+static const char *errUf2Text[] = {
+    nullptr,                     // UF2_ERR_OK (0)
+    nullptr,                     // UF2_ERR_IGNORE (1)
+    "Bad Magic Number",          // UF2_ERR_MAGIC (2)
+    "Bad Family ID",             // UF2_ERR_FAMILY (3)
+    "Missing Header",            // UF2_ERR_NOT_HEADER (4)
+    "Old OTA Format Found",      // UF2_ERR_OTA_VER (5)
+    "Image Not Applicable",      // UF2_ERR_OTA_WRONG (6)
+    "Partition Not Found",       // UF2_ERR_PART_404 (7)
+    "Partition Info Invalid",    // UF2_ERR_PART_INVALID (8)
+    "Partition Info Missing",    // UF2_ERR_PART_UNSET (9)
+    "Block Data Too Long",       // UF2_ERR_DATA_TOO_LONG (10)
+    "Bad Block Sequence Number", // UF2_ERR_SEQ_MISMATCH (11)
+    "Flash Erase Failed",        // UF2_ERR_ERASE_FAILED (12)
+    "Flash Write Failed",        // UF2_ERR_WRITE_FAILED (13)
+    "Write Failed Length",       // UF2_ERR_WRITE_LENGTH (14)
+    "Partition Write-Protected", // UF2_ERR_WRITE_PROTECT (15)
+    "Memory Alloc Failed",       // UF2_ERR_ALLOC_FAILED (16)
+};
+
+static const char *errArdText[] = {
+    nullptr,                           // UPDATE_ERROR_OK (0)
+    nullptr,                           // UPDATE_ERROR_WRITE (1)
+    nullptr,                           // UPDATE_ERROR_ERASE (2)
+    nullptr,                           // UPDATE_ERROR_READ (3)
+    nullptr,                           // UPDATE_ERROR_SPACE (4)
+    "Bad Size Given",                  // UPDATE_ERROR_SIZE (5)
+    "Stream Read Timeout",             // UPDATE_ERROR_STREAM (6)
+    "MD5 Check Failed",                // UPDATE_ERROR_MD5 (7)
+    nullptr,                           // UPDATE_ERROR_MAGIC_BYTE (8)
+    "Could Not Activate The Firmware", // UPDATE_ERROR_ACTIVATE (9)
+    nullptr,                           // UPDATE_ERROR_NO_PARTITION (10)
+    "Bad Argument",                    // UPDATE_ERROR_BAD_ARGUMENT (11)
+    "Aborted",                         // UPDATE_ERROR_ABORT (12)
+};
+
+static char errorStr[14];
+
+UpdateClass &UpdateClass::onProgress(THandlerFunction_Progress handler) {
+    this->callback = std::move(handler);
+    return *this;
+}
+
+void UpdateClass::progressHandler(UpdateClass *self) {
+    if (self->callback)
+        self->callback(self->ctx->bytes_written, self->ctx->bytes_total);
+}
+
+bool UpdateClass::canRollBack() {
+    return lt_ota_can_rollback();
+}
+
+bool UpdateClass::rollBack() {
+    if (!lt_ota_can_rollback())
+        return false;
+    return lt_ota_switch(/* revert= */ false);
+}
+
+bool UpdateClass::setMD5(const char *md5) {
+    if (strlen(md5) != 32)
+        return false;
+    if (!this->md5Expected)
+        this->md5Expected = static_cast<uint8_t *>(malloc(16));
+    if (!this->md5Expected)
+        return false;
+    lt_xtob(md5, 32, this->md5Expected);
+    return true;
+}
+
+String UpdateClass::md5String() {
+    if (!this->md5Digest)
+        return "";
+    char out[32 + 1];
+    lt_btox(this->md5Digest, 16, out);
+    return String(out);
+}
+
+void UpdateClass::md5(uint8_t *result) {
+    if (!this->md5Digest) {
+        memset(result, '\0', 16);
+        return;
+    }
+    memcpy(result, this->md5Digest, 16);
+}
+
+uint16_t UpdateClass::getErrorCode() const {
+    return (this->getError() << 8) | this->getUF2Error();
+}
+
+bool UpdateClass::hasError() const {
+    return this->getError() != UPDATE_ERROR_OK || this->getUF2Error() > UF2_ERR_IGNORE;
+}
+
+void UpdateClass::clearError() {
+    this->errArd = UPDATE_ERROR_OK;
+    this->errUf2 = UF2_ERR_OK;
+    if (this->ctx)
+        this->ctx->error = UF2_ERR_OK;
+}
+
+const char *UpdateClass::errorString() const {
+    uint8_t err;
+    if ((err = this->getUF2Error()) > UF2_ERR_IGNORE)
+        return errUf2Text[err];
+    if ((err = this->getError()) != UPDATE_ERROR_OK)
+        return errArdText[err];
+    if (!this->hasError())
+        return "";
+    sprintf(errorStr, "ard=%u,uf2=%u", this->getError(), this->getUF2Error());
+    return errorStr;
+}
+
+void UpdateClass::printError(Print &out) const {
+    out.println(errorString());
+}
+
+void UpdateClass::printErrorContext() {
+#if LT_DEBUG_OTA
+    if (!this->ctx)
+        return;
+
+    LT_EM(OTA, "Error: %s", errorString());
+    if (errArd == UPDATE_ERROR_ABORT)
+        return;
+
+    LT_EM(OTA, "- written: %u of %u", this->ctx->bytes_written, this->ctx->bytes_total);
+    LT_EM(
+        OTA,
+        "- buf: size=%lld, left=%lld",
+        this->ctx->buf_pos - this->ctx->buf,
+        this->ctx->buf + UF2_BLOCK_SIZE - this->ctx->buf_pos
+    );
+    hexdump(this->ctx->buf, this->ctx->buf_pos - this->ctx->buf);
+
+    if (ctx)
+        LT_EM(
+            OTA,
+            "- ctx: seq=%u, part=%s",
+            this->ctx->uf2.seq - 1, // print last parsed block seq
+            this->ctx->uf2.part ? this->ctx->uf2.part->name : nullptr
+        );
+
+    auto *block = (uf2_block_t *)this->ctx->buf;
+    LT_EM(OTA, "- buf: seq=%u/%u, addr=%u, len=%u", block->block_seq, block->block_count, block->addr, block->len);
+#endif
+}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_uri_8h/index.html b/ltapi/_uri_8h/index.html new file mode 100644 index 000000000..8bdccb1e9 --- /dev/null +++ b/ltapi/_uri_8h/index.html @@ -0,0 +1,2329 @@ + + + + + + + + + + + + + + + + + + + + File Uri.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_uri_8h_source/index.html b/ltapi/_uri_8h_source/index.html new file mode 100644 index 000000000..e90f8386a --- /dev/null +++ b/ltapi/_uri_8h_source/index.html @@ -0,0 +1,2323 @@ + + + + + + + + + + + + + + + + + + + + File Uri.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File Uri.h

+

File List > arduino > libraries > ext > WebServer > Uri.h

+

Go to the documentation of this file.

+
#pragma once
+
+#include <Arduino.h>
+#include <vector>
+
+class Uri {
+
+  protected:
+    const String _uri;
+
+  public:
+    Uri(const char *uri) : _uri(uri) {}
+
+    Uri(const String &uri) : _uri(uri) {}
+
+    Uri(const __FlashStringHelper *uri) : _uri(String(uri)) {}
+
+    virtual ~Uri() {}
+
+    virtual Uri *clone() const {
+        return new Uri(_uri);
+    };
+
+    virtual void initPathArgs(__attribute__((unused)) std::vector<String> &pathArgs) {}
+
+    virtual bool canHandle(const String &requestUri, __attribute__((unused)) std::vector<String> &pathArgs) {
+        return _uri == requestUri;
+    }
+};
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_uri_braces_8h/index.html b/ltapi/_uri_braces_8h/index.html new file mode 100644 index 000000000..f6f0d5be0 --- /dev/null +++ b/ltapi/_uri_braces_8h/index.html @@ -0,0 +1,2328 @@ + + + + + + + + + + + + + + + + + + + + File UriBraces.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_uri_braces_8h_source/index.html b/ltapi/_uri_braces_8h_source/index.html new file mode 100644 index 000000000..594c2a6e8 --- /dev/null +++ b/ltapi/_uri_braces_8h_source/index.html @@ -0,0 +1,2355 @@ + + + + + + + + + + + + + + + + + + + + File UriBraces.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File UriBraces.h

+

File List > arduino > libraries > ext > WebServer > uri > UriBraces.h

+

Go to the documentation of this file.

+
#pragma once
+
+#include "Uri.h"
+
+class UriBraces : public Uri {
+
+  public:
+    explicit UriBraces(const char *uri) : Uri(uri){};
+    explicit UriBraces(const String &uri) : Uri(uri){};
+
+    Uri *clone() const override final {
+        return new UriBraces(_uri);
+    };
+
+    void initPathArgs(std::vector<String> &pathArgs) override final {
+        int numParams = 0, start = 0;
+        do {
+            start = _uri.indexOf("{}", start);
+            if (start > 0) {
+                numParams++;
+                start += 2;
+            }
+        } while (start > 0);
+        pathArgs.resize(numParams);
+    }
+
+    bool canHandle(const String &requestUri, std::vector<String> &pathArgs) override final {
+        if (Uri::canHandle(requestUri, pathArgs))
+            return true;
+
+        size_t uriLength             = _uri.length();
+        unsigned int pathArgIndex    = 0;
+        unsigned int requestUriIndex = 0;
+        for (unsigned int i = 0; i < uriLength; i++, requestUriIndex++) {
+            char uriChar        = _uri[i];
+            char requestUriChar = requestUri[requestUriIndex];
+
+            if (uriChar == requestUriChar)
+                continue;
+            if (uriChar != '{')
+                return false;
+
+            i += 2; // index of char after '}'
+            if (i >= uriLength) {
+                // there is no char after '}'
+                pathArgs[pathArgIndex] = requestUri.substring(requestUriIndex);
+                return pathArgs[pathArgIndex].indexOf("/") == -1; // path argument may not contain a '/'
+            } else {
+                char charEnd = _uri[i];
+                int uriIndex = requestUri.indexOf(charEnd, requestUriIndex);
+                if (uriIndex < 0)
+                    return false;
+                pathArgs[pathArgIndex] = requestUri.substring(requestUriIndex, uriIndex);
+                requestUriIndex        = (unsigned int)uriIndex;
+            }
+            pathArgIndex++;
+        }
+
+        return requestUriIndex >= requestUri.length();
+    }
+};
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_uri_glob_8h/index.html b/ltapi/_uri_glob_8h/index.html new file mode 100644 index 000000000..60200cf8c --- /dev/null +++ b/ltapi/_uri_glob_8h/index.html @@ -0,0 +1,2329 @@ + + + + + + + + + + + + + + + + + + + + File UriGlob.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_uri_glob_8h_source/index.html b/ltapi/_uri_glob_8h_source/index.html new file mode 100644 index 000000000..9c52b5910 --- /dev/null +++ b/ltapi/_uri_glob_8h_source/index.html @@ -0,0 +1,2313 @@ + + + + + + + + + + + + + + + + + + + + File UriGlob.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File UriGlob.h

+

File List > arduino > libraries > ext > WebServer > uri > UriGlob.h

+

Go to the documentation of this file.

+
#pragma once
+
+#include "Uri.h"
+#include <fnmatch.h>
+
+class UriGlob : public Uri {
+
+  public:
+    explicit UriGlob(const char *uri) : Uri(uri){};
+    explicit UriGlob(const String &uri) : Uri(uri){};
+
+    Uri *clone() const override final {
+        return new UriGlob(_uri);
+    };
+
+    bool canHandle(const String &requestUri, __attribute__((unused)) std::vector<String> &pathArgs) override final {
+        return fnmatch(_uri.c_str(), requestUri.c_str(), 0) == 0;
+    }
+};
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_uri_regex_8h/index.html b/ltapi/_uri_regex_8h/index.html new file mode 100644 index 000000000..2a84b4d88 --- /dev/null +++ b/ltapi/_uri_regex_8h/index.html @@ -0,0 +1,2329 @@ + + + + + + + + + + + + + + + + + + + + File UriRegex.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_uri_regex_8h_source/index.html b/ltapi/_uri_regex_8h_source/index.html new file mode 100644 index 000000000..3e02e1c83 --- /dev/null +++ b/ltapi/_uri_regex_8h_source/index.html @@ -0,0 +1,2335 @@ + + + + + + + + + + + + + + + + + + + + File UriRegex.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File UriRegex.h

+

File List > arduino > libraries > ext > WebServer > uri > UriRegex.h

+

Go to the documentation of this file.

+
#pragma once
+
+#include "Uri.h"
+#include <regex>
+
+class UriRegex : public Uri {
+
+  public:
+    explicit UriRegex(const char *uri) : Uri(uri){};
+    explicit UriRegex(const String &uri) : Uri(uri){};
+
+    Uri *clone() const override final {
+        return new UriRegex(_uri);
+    };
+
+    void initPathArgs(std::vector<String> &pathArgs) override final {
+        std::regex rgx((_uri + "|").c_str());
+        std::smatch matches;
+        std::string s{""};
+        std::regex_search(s, matches, rgx);
+        pathArgs.resize(matches.size() - 1);
+    }
+
+    bool canHandle(const String &requestUri, std::vector<String> &pathArgs) override final {
+        if (Uri::canHandle(requestUri, pathArgs))
+            return true;
+
+        unsigned int pathArgIndex = 0;
+        std::regex rgx(_uri.c_str());
+        std::smatch matches;
+        std::string s(requestUri.c_str());
+        if (std::regex_search(s, matches, rgx)) {
+            for (size_t i = 1; i < matches.size(); ++i) { // skip first
+                pathArgs[pathArgIndex] = String(matches[i].str().c_str());
+                pathArgIndex++;
+            }
+            return true;
+        }
+        return false;
+    }
+};
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_w_d_t_8h/index.html b/ltapi/_w_d_t_8h/index.html new file mode 100644 index 000000000..7e311a660 --- /dev/null +++ b/ltapi/_w_d_t_8h/index.html @@ -0,0 +1,2374 @@ + + + + + + + + + + + + + + + + + + + + File WDT.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File WDT.h

+

FileList > arduino > libraries > inline > WDT > WDT.h

+

Go to the source code of this file.

+
    +
  • #include <Arduino.h>
  • +
+

Classes

+ + + + + + + + + + + + + +
TypeName
classLibreTinyWDT
Watchdog control class.
+

Public Attributes

+ + + + + + + + + + + + + +
TypeName
LibreTinyWDTWDT
+

Public Attributes Documentation

+

variable WDT

+
LibreTinyWDT WDT;
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/inline/WDT/WDT.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_w_d_t_8h_source/index.html b/ltapi/_w_d_t_8h_source/index.html new file mode 100644 index 000000000..f2143f32b --- /dev/null +++ b/ltapi/_w_d_t_8h_source/index.html @@ -0,0 +1,2314 @@ + + + + + + + + + + + + + + + + + + + + File WDT.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File WDT.h

+

File List > arduino > libraries > inline > WDT > WDT.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2023-03-10. */
+
+#pragma once
+
+#include <Arduino.h>
+
+#ifdef __cplusplus
+
+class LibreTinyWDT {
+  public: /* lt_wdt.h */
+    inline bool enable(uint32_t timeout = 10000) { return lt_wdt_enable(timeout); }
+
+    inline void disable() { lt_wdt_disable(); }
+
+    inline void feed() { lt_wdt_feed(); }
+};
+
+extern LibreTinyWDT WDT;
+
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_web_server_8cpp/index.html b/ltapi/_web_server_8cpp/index.html new file mode 100644 index 000000000..53b95098f --- /dev/null +++ b/ltapi/_web_server_8cpp/index.html @@ -0,0 +1,2295 @@ + + + + + + + + + + + + + + + + + + + + File WebServer.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_web_server_8cpp_source/index.html b/ltapi/_web_server_8cpp_source/index.html new file mode 100644 index 000000000..05a335b77 --- /dev/null +++ b/ltapi/_web_server_8cpp_source/index.html @@ -0,0 +1,3015 @@ + + + + + + + + + + + + + + + + + + + + File WebServer.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File WebServer.cpp

+

File List > arduino > libraries > ext > WebServer > WebServer.cpp

+

Go to the documentation of this file.

+
/*
+  WebServer.cpp - Dead simple web-server.
+  Supports only one simultaneous client, knows how to handle GET and POST.
+
+  Copyright (c) 2014 Ivan Grokhotkov. All rights reserved.
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License, or (at your option) any later version.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+  Modified 8 May 2015 by Hristo Gochkov (proper post and file upload handling)
+*/
+
+#if LT_ARD_HAS_WIFI
+
+#include <Arduino.h>
+
+#include "FS.h"
+#include "WebServer.h"
+#include "WiFiClient.h"
+#include "WiFiServer.h"
+#include "detail/RequestHandlersImpl.h"
+// #include "mbedtls/md5.h"
+#include <libb64/cencode.h>
+
+static const char AUTHORIZATION_HEADER[]    = "Authorization";
+static const char qop_auth[] PROGMEM        = "qop=auth";
+static const char qop_auth_quoted[] PROGMEM = "qop=\"auth\"";
+static const char WWW_Authenticate[]        = "WWW-Authenticate";
+static const char Content_Length[]          = "Content-Length";
+
+WebServer::WebServer(IPAddress addr, int port)
+    : _corsEnabled(false), _server(addr, port), _currentMethod(HTTP_ANY), _currentVersion(0), _currentStatus(HC_NONE),
+      _statusChange(0), _nullDelay(true), _currentHandler(nullptr), _firstHandler(nullptr), _lastHandler(nullptr),
+      _currentArgCount(0), _currentArgs(nullptr), _postArgsLen(0), _postArgs(nullptr), _headerKeysCount(0),
+      _currentHeaders(nullptr), _contentLength(0), _chunked(false) {
+    log_v("WebServer::Webserver(addr=%s, port=%d)", ipToString(addr).c_str(), port);
+}
+
+WebServer::WebServer(int port)
+    : _corsEnabled(false), _server(port), _currentMethod(HTTP_ANY), _currentVersion(0), _currentStatus(HC_NONE),
+      _statusChange(0), _nullDelay(true), _currentHandler(nullptr), _firstHandler(nullptr), _lastHandler(nullptr),
+      _currentArgCount(0), _currentArgs(nullptr), _postArgsLen(0), _postArgs(nullptr), _headerKeysCount(0),
+      _currentHeaders(nullptr), _contentLength(0), _chunked(false) {
+    log_v("WebServer::Webserver(port=%d)", port);
+}
+
+WebServer::~WebServer() {
+    _server.close();
+    if (_currentHeaders)
+        delete[] _currentHeaders;
+    RequestHandler *handler = _firstHandler;
+    while (handler) {
+        RequestHandler *next = handler->next();
+        delete handler;
+        handler = next;
+    }
+}
+
+void WebServer::begin() {
+    close();
+    _server.begin();
+    _server.setNoDelay(true);
+}
+
+void WebServer::begin(uint16_t port) {
+    close();
+    _server.begin(port);
+    _server.setNoDelay(true);
+}
+
+String WebServer::_extractParam(String &authReq, const String &param, const char delimit) {
+    int _begin = authReq.indexOf(param);
+    if (_begin == -1)
+        return "";
+    return authReq.substring(_begin + param.length(), authReq.indexOf(delimit, _begin + param.length()));
+}
+
+static String md5str(String &in) {
+    /* char out[33] = {0};
+    mbedtls_md5_context _ctx;
+    uint8_t i;
+    uint8_t *_buf = (uint8_t *)malloc(16);
+    if (_buf == NULL)
+        return String(out);
+    memset(_buf, 0x00, 16);
+    mbedtls_md5_init(&_ctx);
+    mbedtls_md5_starts_ret(&_ctx);
+    mbedtls_md5_update_ret(&_ctx, (const uint8_t *)in.c_str(), in.length());
+    mbedtls_md5_finish_ret(&_ctx, _buf);
+    for (i = 0; i < 16; i++) {
+        sprintf(out + (i * 2), "%02x", _buf[i]);
+    }
+    out[32] = 0;
+    free(_buf);
+    return String(out); */
+    return "";
+}
+
+bool WebServer::authenticate(const char *username, const char *password) {
+    if (hasHeader(FPSTR(AUTHORIZATION_HEADER))) {
+        String authReq = header(FPSTR(AUTHORIZATION_HEADER));
+        if (authReq.startsWith(F("Basic"))) {
+            authReq = authReq.substring(6);
+            authReq.trim();
+            char toencodeLen = strlen(username) + strlen(password) + 1;
+            char *toencode   = new char[toencodeLen + 1];
+            if (toencode == NULL) {
+                authReq = "";
+                return false;
+            }
+            char *encoded = new char[base64_encode_expected_len(toencodeLen) + 1];
+            if (encoded == NULL) {
+                authReq = "";
+                delete[] toencode;
+                return false;
+            }
+            sprintf(toencode, "%s:%s", username, password);
+            if (base64_encode_chars(toencode, toencodeLen, encoded) > 0 && authReq.equals(encoded)) {
+                authReq = "";
+                delete[] toencode;
+                delete[] encoded;
+                return true;
+            }
+            delete[] toencode;
+            delete[] encoded;
+        } else if (authReq.startsWith(F("Digest"))) {
+            authReq = authReq.substring(7);
+            log_v("%s", authReq.c_str());
+            String _username = _extractParam(authReq, F("username=\""), '\"');
+            if (!_username.length() || _username != String(username)) {
+                authReq = "";
+                return false;
+            }
+            // extracting required parameters for RFC 2069 simpler Digest
+            String _realm    = _extractParam(authReq, F("realm=\""), '\"');
+            String _nonce    = _extractParam(authReq, F("nonce=\""), '\"');
+            String _uri      = _extractParam(authReq, F("uri=\""), '\"');
+            String _response = _extractParam(authReq, F("response=\""), '\"');
+            String _opaque   = _extractParam(authReq, F("opaque=\""), '\"');
+
+            if ((!_realm.length()) || (!_nonce.length()) || (!_uri.length()) || (!_response.length()) ||
+                (!_opaque.length())) {
+                authReq = "";
+                return false;
+            }
+            if ((_opaque != _sopaque) || (_nonce != _snonce) || (_realm != _srealm)) {
+                authReq = "";
+                return false;
+            }
+            // parameters for the RFC 2617 newer Digest
+            String _nc, _cnonce;
+            if (authReq.indexOf(FPSTR(qop_auth)) != -1 || authReq.indexOf(FPSTR(qop_auth_quoted)) != -1) {
+                _nc     = _extractParam(authReq, F("nc="), ',');
+                _cnonce = _extractParam(authReq, F("cnonce=\""), '\"');
+            }
+            String _H1 = md5str(String(username) + ':' + _realm + ':' + String(password));
+            log_v("Hash of user:realm:pass=%s", _H1.c_str());
+            String _H2 = "";
+            if (_currentMethod == HTTP_GET) {
+                _H2 = md5str(String(F("GET:")) + _uri);
+            } else if (_currentMethod == HTTP_POST) {
+                _H2 = md5str(String(F("POST:")) + _uri);
+            } else if (_currentMethod == HTTP_PUT) {
+                _H2 = md5str(String(F("PUT:")) + _uri);
+            } else if (_currentMethod == HTTP_DELETE) {
+                _H2 = md5str(String(F("DELETE:")) + _uri);
+            } else {
+                _H2 = md5str(String(F("GET:")) + _uri);
+            }
+            log_v("Hash of GET:uri=%s", _H2.c_str());
+            String _responsecheck = "";
+            if (authReq.indexOf(FPSTR(qop_auth)) != -1 || authReq.indexOf(FPSTR(qop_auth_quoted)) != -1) {
+                _responsecheck = md5str(_H1 + ':' + _nonce + ':' + _nc + ':' + _cnonce + F(":auth:") + _H2);
+            } else {
+                _responsecheck = md5str(_H1 + ':' + _nonce + ':' + _H2);
+            }
+            log_v("The Proper response=%s", _responsecheck.c_str());
+            if (_response == _responsecheck) {
+                authReq = "";
+                return true;
+            }
+        }
+        authReq = "";
+    }
+    return false;
+}
+
+String WebServer::_getRandomHexString() {
+    char buffer[33]; // buffer to hold 32 Hex Digit + /0
+    int i;
+    for (i = 0; i < 4; i++) {
+        sprintf(buffer + (i * 8), "%08x", rand());
+    }
+    return String(buffer);
+}
+
+void WebServer::requestAuthentication(HTTPAuthMethod mode, const char *realm, const String &authFailMsg) {
+    if (realm == NULL) {
+        _srealm = String(F("Login Required"));
+    } else {
+        _srealm = String(realm);
+    }
+    if (mode == BASIC_AUTH) {
+        sendHeader(String(FPSTR(WWW_Authenticate)), String(F("Basic realm=\"")) + _srealm + String(F("\"")));
+    } else {
+        _snonce  = _getRandomHexString();
+        _sopaque = _getRandomHexString();
+        sendHeader(
+            String(FPSTR(WWW_Authenticate)),
+            String(F("Digest realm=\"")) + _srealm + String(F("\", qop=\"auth\", nonce=\"")) + _snonce +
+                String(F("\", opaque=\"")) + _sopaque + String(F("\""))
+        );
+    }
+    using namespace mime;
+    send(401, String(FPSTR(mimeTable[html].mimeType)), authFailMsg);
+}
+
+void WebServer::on(const Uri &uri, WebServer::THandlerFunction handler) {
+    on(uri, HTTP_ANY, handler);
+}
+
+void WebServer::on(const Uri &uri, HTTPMethod method, WebServer::THandlerFunction fn) {
+    on(uri, method, fn, _fileUploadHandler);
+}
+
+void WebServer::on(const Uri &uri, HTTPMethod method, WebServer::THandlerFunction fn, WebServer::THandlerFunction ufn) {
+    _addRequestHandler(new FunctionRequestHandler(fn, ufn, uri, method));
+}
+
+void WebServer::addHandler(RequestHandler *handler) {
+    _addRequestHandler(handler);
+}
+
+void WebServer::_addRequestHandler(RequestHandler *handler) {
+    if (!_lastHandler) {
+        _firstHandler = handler;
+        _lastHandler  = handler;
+    } else {
+        _lastHandler->next(handler);
+        _lastHandler = handler;
+    }
+}
+
+void WebServer::serveStatic(const char *uri, FS &fs, const char *path, const char *cache_header) {
+    _addRequestHandler(new StaticRequestHandler(fs, path, uri, cache_header));
+}
+
+void WebServer::handleClient() {
+    if (_currentStatus == HC_NONE) {
+        WiFiClient client = _server.available();
+        if (!client) {
+            if (_nullDelay) {
+                delay(1);
+            }
+            return;
+        }
+
+        log_v("New client: client.localIP()=%s", ipToString(client.localIP()).c_str());
+
+        _currentClient = client;
+        _currentStatus = HC_WAIT_READ;
+        _statusChange  = millis();
+    }
+
+    bool keepCurrentClient = false;
+    bool callYield         = false;
+
+    if (_currentClient.connected()) {
+        switch (_currentStatus) {
+            case HC_NONE:
+                // No-op to avoid C++ compiler warning
+                break;
+            case HC_WAIT_READ:
+                // Wait for data from client to become available
+                if (_currentClient.available()) {
+                    if (_parseRequest(_currentClient)) {
+                        // because HTTP_MAX_SEND_WAIT is expressed in milliseconds,
+                        // it must be divided by 1000
+                        _currentClient.setTimeout(HTTP_MAX_SEND_WAIT / 1000);
+                        _contentLength = CONTENT_LENGTH_NOT_SET;
+                        _handleRequest();
+
+                        // Fix for issue with Chrome based browsers:
+                        // https://github.com/espressif/arduino-esp32/issues/3652
+                        //           if (_currentClient.connected()) {
+                        //             _currentStatus = HC_WAIT_CLOSE;
+                        //             _statusChange = millis();
+                        //             keepCurrentClient = true;
+                        //           }
+                    }
+                } else { // !_currentClient.available()
+                    if (millis() - _statusChange <= HTTP_MAX_DATA_WAIT) {
+                        keepCurrentClient = true;
+                    }
+                    callYield = true;
+                }
+                break;
+            case HC_WAIT_CLOSE:
+                // Wait for client to close the connection
+                if (millis() - _statusChange <= HTTP_MAX_CLOSE_WAIT) {
+                    keepCurrentClient = true;
+                    callYield         = true;
+                }
+        }
+    }
+
+    if (!keepCurrentClient) {
+        _currentClient = WiFiClient();
+        _currentStatus = HC_NONE;
+        _currentUpload.reset();
+    }
+
+    if (callYield) {
+        yield();
+    }
+}
+
+void WebServer::close() {
+    _server.close();
+    _currentStatus = HC_NONE;
+    if (!_headerKeysCount)
+        collectHeaders(0, 0);
+}
+
+void WebServer::stop() {
+    close();
+}
+
+void WebServer::sendHeader(const String &name, const String &value, bool first) {
+    String headerLine = name;
+    headerLine += F(": ");
+    headerLine += value;
+    headerLine += "\r\n";
+
+    if (first) {
+        _responseHeaders = headerLine + _responseHeaders;
+    } else {
+        _responseHeaders += headerLine;
+    }
+}
+
+void WebServer::setContentLength(const size_t contentLength) {
+    _contentLength = contentLength;
+}
+
+void WebServer::enableDelay(boolean value) {
+    _nullDelay = value;
+}
+
+void WebServer::enableCORS(boolean value) {
+    _corsEnabled = value;
+}
+
+void WebServer::enableCrossOrigin(boolean value) {
+    enableCORS(value);
+}
+
+void WebServer::_prepareHeader(String &response, int code, const char *content_type, size_t contentLength) {
+    response = String(F("HTTP/1.")) + String(_currentVersion) + ' ';
+    response += String(code);
+    response += ' ';
+    response += _responseCodeToString(code);
+    response += "\r\n";
+
+    using namespace mime;
+    if (!content_type)
+        content_type = mimeTable[html].mimeType;
+
+    sendHeader(String(F("Content-Type")), String(FPSTR(content_type)), true);
+    if (_contentLength == CONTENT_LENGTH_NOT_SET) {
+        sendHeader(String(FPSTR(Content_Length)), String(contentLength));
+    } else if (_contentLength != CONTENT_LENGTH_UNKNOWN) {
+        sendHeader(String(FPSTR(Content_Length)), String(_contentLength));
+    } else if (_contentLength == CONTENT_LENGTH_UNKNOWN && _currentVersion) { // HTTP/1.1 or above client
+        // let's do chunked
+        _chunked = true;
+        sendHeader(String(F("Accept-Ranges")), String(F("none")));
+        sendHeader(String(F("Transfer-Encoding")), String(F("chunked")));
+    }
+    if (_corsEnabled) {
+        sendHeader(String(FPSTR("Access-Control-Allow-Origin")), String("*"));
+        sendHeader(String(FPSTR("Access-Control-Allow-Methods")), String("*"));
+        sendHeader(String(FPSTR("Access-Control-Allow-Headers")), String("*"));
+    }
+    sendHeader(String(F("Connection")), String(F("close")));
+
+    response += _responseHeaders;
+    response += "\r\n";
+    _responseHeaders = "";
+}
+
+void WebServer::send(int code, const char *content_type, const String &content) {
+    String header;
+    // Can we asume the following?
+    // if(code == 200 && content.length() == 0 && _contentLength == CONTENT_LENGTH_NOT_SET)
+    //  _contentLength = CONTENT_LENGTH_UNKNOWN;
+    _prepareHeader(header, code, content_type, content.length());
+    _currentClientWrite(header.c_str(), header.length());
+    if (content.length())
+        sendContent(content);
+}
+
+void WebServer::send_P(int code, PGM_P content_type, PGM_P content) {
+    size_t contentLength = 0;
+
+    if (content != NULL) {
+        contentLength = strlen_P(content);
+    }
+
+    String header;
+    char type[64];
+    strncpy_P(type, (PGM_P)content_type, sizeof(type));
+    _prepareHeader(header, code, (const char *)type, contentLength);
+    _currentClientWrite(header.c_str(), header.length());
+    sendContent_P(content);
+}
+
+void WebServer::send_P(int code, PGM_P content_type, PGM_P content, size_t contentLength) {
+    String header;
+    char type[64];
+    strncpy_P(type, (PGM_P)content_type, sizeof(type));
+    _prepareHeader(header, code, (const char *)type, contentLength);
+    sendContent(header);
+    sendContent_P(content, contentLength);
+}
+
+void WebServer::send(int code, char *content_type, const String &content) {
+    send(code, (const char *)content_type, content);
+}
+
+void WebServer::send(int code, const String &content_type, const String &content) {
+    send(code, (const char *)content_type.c_str(), content);
+}
+
+void WebServer::sendContent(const String &content) {
+    sendContent(content.c_str(), content.length());
+}
+
+void WebServer::sendContent(const char *content, size_t contentLength) {
+    const char *footer = "\r\n";
+    if (_chunked) {
+        char *chunkSize = (char *)malloc(11);
+        if (chunkSize) {
+            sprintf(chunkSize, "%x%s", contentLength, footer);
+            _currentClientWrite(chunkSize, strlen(chunkSize));
+            free(chunkSize);
+        }
+    }
+    _currentClientWrite(content, contentLength);
+    if (_chunked) {
+        _currentClient.write(footer, 2);
+        if (contentLength == 0) {
+            _chunked = false;
+        }
+    }
+}
+
+void WebServer::sendContent_P(PGM_P content) {
+    sendContent_P(content, strlen_P(content));
+}
+
+void WebServer::sendContent_P(PGM_P content, size_t size) {
+    const char *footer = "\r\n";
+    if (_chunked) {
+        char *chunkSize = (char *)malloc(11);
+        if (chunkSize) {
+            sprintf(chunkSize, "%x%s", size, footer);
+            _currentClientWrite(chunkSize, strlen(chunkSize));
+            free(chunkSize);
+        }
+    }
+    _currentClientWrite_P(content, size);
+    if (_chunked) {
+        _currentClient.write(footer, 2);
+        if (size == 0) {
+            _chunked = false;
+        }
+    }
+}
+
+void WebServer::_streamFileCore(const size_t fileSize, const String &fileName, const String &contentType) {
+    using namespace mime;
+    setContentLength(fileSize);
+    if (fileName.endsWith(String(FPSTR(mimeTable[gz].endsWith))) &&
+        contentType != String(FPSTR(mimeTable[gz].mimeType)) &&
+        contentType != String(FPSTR(mimeTable[none].mimeType))) {
+        sendHeader(F("Content-Encoding"), F("gzip"));
+    }
+    send(200, contentType, "");
+}
+
+String WebServer::pathArg(unsigned int i) {
+    if (_currentHandler != nullptr)
+        return _currentHandler->pathArg(i);
+    return "";
+}
+
+String WebServer::arg(String name) {
+    for (int j = 0; j < _postArgsLen; ++j) {
+        if (_postArgs[j].key == name)
+            return _postArgs[j].value;
+    }
+    for (int i = 0; i < _currentArgCount; ++i) {
+        if (_currentArgs[i].key == name)
+            return _currentArgs[i].value;
+    }
+    return "";
+}
+
+String WebServer::arg(int i) {
+    if (i < _currentArgCount)
+        return _currentArgs[i].value;
+    return "";
+}
+
+String WebServer::argName(int i) {
+    if (i < _currentArgCount)
+        return _currentArgs[i].key;
+    return "";
+}
+
+int WebServer::args() {
+    return _currentArgCount;
+}
+
+bool WebServer::hasArg(String name) {
+    for (int j = 0; j < _postArgsLen; ++j) {
+        if (_postArgs[j].key == name)
+            return true;
+    }
+    for (int i = 0; i < _currentArgCount; ++i) {
+        if (_currentArgs[i].key == name)
+            return true;
+    }
+    return false;
+}
+
+String WebServer::header(String name) {
+    for (int i = 0; i < _headerKeysCount; ++i) {
+        if (_currentHeaders[i].key.equalsIgnoreCase(name))
+            return _currentHeaders[i].value;
+    }
+    return "";
+}
+
+void WebServer::collectHeaders(const char *headerKeys[], const size_t headerKeysCount) {
+    _headerKeysCount = headerKeysCount + 1;
+    if (_currentHeaders)
+        delete[] _currentHeaders;
+    _currentHeaders        = new RequestArgument[_headerKeysCount];
+    _currentHeaders[0].key = FPSTR(AUTHORIZATION_HEADER);
+    for (int i = 1; i < _headerKeysCount; i++) {
+        _currentHeaders[i].key = headerKeys[i - 1];
+    }
+}
+
+String WebServer::header(int i) {
+    if (i < _headerKeysCount)
+        return _currentHeaders[i].value;
+    return "";
+}
+
+String WebServer::headerName(int i) {
+    if (i < _headerKeysCount)
+        return _currentHeaders[i].key;
+    return "";
+}
+
+int WebServer::headers() {
+    return _headerKeysCount;
+}
+
+bool WebServer::hasHeader(String name) {
+    for (int i = 0; i < _headerKeysCount; ++i) {
+        if ((_currentHeaders[i].key.equalsIgnoreCase(name)) && (_currentHeaders[i].value.length() > 0))
+            return true;
+    }
+    return false;
+}
+
+String WebServer::hostHeader() {
+    return _hostHeader;
+}
+
+void WebServer::onFileUpload(THandlerFunction fn) {
+    _fileUploadHandler = fn;
+}
+
+void WebServer::onNotFound(THandlerFunction fn) {
+    _notFoundHandler = fn;
+}
+
+void WebServer::_handleRequest() {
+    bool handled = false;
+    if (!_currentHandler) {
+        log_e("request handler not found");
+    } else {
+        handled = _currentHandler->handle(*this, _currentMethod, _currentUri);
+        if (!handled) {
+            log_e("request handler failed to handle request");
+        }
+    }
+    if (!handled && _notFoundHandler) {
+        _notFoundHandler();
+        handled = true;
+    }
+    if (!handled) {
+        using namespace mime;
+        send(404, String(FPSTR(mimeTable[html].mimeType)), String(F("Not found: ")) + _currentUri);
+        handled = true;
+    }
+    if (handled) {
+        _finalizeResponse();
+    }
+    _currentUri = "";
+}
+
+void WebServer::_finalizeResponse() {
+    if (_chunked) {
+        sendContent("");
+    }
+}
+
+String WebServer::_responseCodeToString(int code) {
+    switch (code) {
+        case 100:
+            return F("Continue");
+        case 101:
+            return F("Switching Protocols");
+        case 200:
+            return F("OK");
+        case 201:
+            return F("Created");
+        case 202:
+            return F("Accepted");
+        case 203:
+            return F("Non-Authoritative Information");
+        case 204:
+            return F("No Content");
+        case 205:
+            return F("Reset Content");
+        case 206:
+            return F("Partial Content");
+        case 300:
+            return F("Multiple Choices");
+        case 301:
+            return F("Moved Permanently");
+        case 302:
+            return F("Found");
+        case 303:
+            return F("See Other");
+        case 304:
+            return F("Not Modified");
+        case 305:
+            return F("Use Proxy");
+        case 307:
+            return F("Temporary Redirect");
+        case 400:
+            return F("Bad Request");
+        case 401:
+            return F("Unauthorized");
+        case 402:
+            return F("Payment Required");
+        case 403:
+            return F("Forbidden");
+        case 404:
+            return F("Not Found");
+        case 405:
+            return F("Method Not Allowed");
+        case 406:
+            return F("Not Acceptable");
+        case 407:
+            return F("Proxy Authentication Required");
+        case 408:
+            return F("Request Time-out");
+        case 409:
+            return F("Conflict");
+        case 410:
+            return F("Gone");
+        case 411:
+            return F("Length Required");
+        case 412:
+            return F("Precondition Failed");
+        case 413:
+            return F("Request Entity Too Large");
+        case 414:
+            return F("Request-URI Too Large");
+        case 415:
+            return F("Unsupported Media Type");
+        case 416:
+            return F("Requested range not satisfiable");
+        case 417:
+            return F("Expectation Failed");
+        case 500:
+            return F("Internal Server Error");
+        case 501:
+            return F("Not Implemented");
+        case 502:
+            return F("Bad Gateway");
+        case 503:
+            return F("Service Unavailable");
+        case 504:
+            return F("Gateway Time-out");
+        case 505:
+            return F("HTTP Version not supported");
+        default:
+            return F("");
+    }
+}
+
+#endif // LT_ARD_HAS_WIFI
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_web_server_8h/index.html b/ltapi/_web_server_8h/index.html new file mode 100644 index 000000000..b60889439 --- /dev/null +++ b/ltapi/_web_server_8h/index.html @@ -0,0 +1,2589 @@ + + + + + + + + + + + + + + + + + + + + File WebServer.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

File WebServer.h

+

FileList > arduino > libraries > ext > WebServer > WebServer.h

+

Go to the source code of this file.

+
    +
  • #include "HTTP_Method.h"
  • +
  • #include "Uri.h"
  • +
  • #include <WiFi.h>
  • +
  • #include <functional>
  • +
  • #include <memory>
  • +
  • #include "detail/RequestHandler.h"
  • +
+

Namespaces

+ + + + + + + + + + + + + +
TypeName
namespacefs
+

Classes

+ + + + + + + + + + + + + + + + + +
TypeName
structHTTPUpload
classWebServer
+

Public Types

+ + + + + + + + + + + + + + + + + + + + + +
TypeName
enumHTTPAuthMethod
enumHTTPClientStatus
enumHTTPUploadStatus
+

Macros

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
defineCONTENT_LENGTH_NOT_SET ((size_t)-2)
defineCONTENT_LENGTH_UNKNOWN ((size_t)-1)
defineHTTP_DOWNLOAD_UNIT_SIZE 1436
defineHTTP_MAX_CLOSE_WAIT 2000
defineHTTP_MAX_DATA_WAIT 5000
defineHTTP_MAX_POST_WAIT 5000
defineHTTP_MAX_SEND_WAIT 5000
defineHTTP_UPLOAD_BUFLEN 1436
+

Public Types Documentation

+

enum HTTPAuthMethod

+
enum HTTPAuthMethod {
+    BASIC_AUTH,
+    DIGEST_AUTH
+};
+
+

enum HTTPClientStatus

+
enum HTTPClientStatus {
+    HC_NONE,
+    HC_WAIT_READ,
+    HC_WAIT_CLOSE
+};
+
+

enum HTTPUploadStatus

+
enum HTTPUploadStatus {
+    UPLOAD_FILE_START,
+    UPLOAD_FILE_WRITE,
+    UPLOAD_FILE_END,
+    UPLOAD_FILE_ABORTED
+};
+
+

Macro Definition Documentation

+

define CONTENT_LENGTH_NOT_SET

+
#define CONTENT_LENGTH_NOT_SET ((size_t)-2)
+
+

define CONTENT_LENGTH_UNKNOWN

+
#define CONTENT_LENGTH_UNKNOWN ((size_t)-1)
+
+

define HTTP_DOWNLOAD_UNIT_SIZE

+
#define HTTP_DOWNLOAD_UNIT_SIZE 1436
+
+

define HTTP_MAX_CLOSE_WAIT

+
#define HTTP_MAX_CLOSE_WAIT 2000
+
+

define HTTP_MAX_DATA_WAIT

+
#define HTTP_MAX_DATA_WAIT 5000
+
+

define HTTP_MAX_POST_WAIT

+
#define HTTP_MAX_POST_WAIT 5000
+
+

define HTTP_MAX_SEND_WAIT

+
#define HTTP_MAX_SEND_WAIT 5000
+
+

define HTTP_UPLOAD_BUFLEN

+
#define HTTP_UPLOAD_BUFLEN 1436
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/WebServer.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_web_server_8h_source/index.html b/ltapi/_web_server_8h_source/index.html new file mode 100644 index 000000000..61420b82f --- /dev/null +++ b/ltapi/_web_server_8h_source/index.html @@ -0,0 +1,2518 @@ + + + + + + + + + + + + + + + + + + + + File WebServer.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File WebServer.h

+

File List > arduino > libraries > ext > WebServer > WebServer.h

+

Go to the documentation of this file.

+
/*
+  WebServer.h - Dead simple web-server.
+  Supports only one simultaneous client, knows how to handle GET and POST.
+
+  Copyright (c) 2014 Ivan Grokhotkov. All rights reserved.
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License, or (at your option) any later version.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+  Modified 8 May 2015 by Hristo Gochkov (proper post and file upload handling)
+*/
+
+#pragma once
+
+#include "HTTP_Method.h"
+#include "Uri.h"
+#include <WiFi.h>
+#include <functional>
+#include <memory>
+
+enum HTTPUploadStatus { UPLOAD_FILE_START, UPLOAD_FILE_WRITE, UPLOAD_FILE_END, UPLOAD_FILE_ABORTED };
+
+enum HTTPClientStatus { HC_NONE, HC_WAIT_READ, HC_WAIT_CLOSE };
+
+enum HTTPAuthMethod { BASIC_AUTH, DIGEST_AUTH };
+
+#define HTTP_DOWNLOAD_UNIT_SIZE 1436
+
+#ifndef HTTP_UPLOAD_BUFLEN
+#define HTTP_UPLOAD_BUFLEN 1436
+#endif
+
+#define HTTP_MAX_DATA_WAIT  5000 // ms to wait for the client to send the request
+#define HTTP_MAX_POST_WAIT  5000 // ms to wait for POST data to arrive
+#define HTTP_MAX_SEND_WAIT  5000 // ms to wait for data chunk to be ACKed
+#define HTTP_MAX_CLOSE_WAIT 2000 // ms to wait for the client to close the connection
+
+#define CONTENT_LENGTH_UNKNOWN ((size_t)-1)
+#define CONTENT_LENGTH_NOT_SET ((size_t)-2)
+
+class WebServer;
+
+typedef struct {
+    HTTPUploadStatus status;
+    String filename;
+    String name;
+    String type;
+    size_t totalSize;   // file size
+    size_t currentSize; // size of data currently in buf
+    uint8_t buf[HTTP_UPLOAD_BUFLEN];
+} HTTPUpload;
+
+#include "detail/RequestHandler.h"
+
+namespace fs {
+class FS;
+}
+
+class WebServer {
+  public:
+    WebServer(IPAddress addr, int port = 80);
+    WebServer(int port = 80);
+    virtual ~WebServer();
+
+    virtual void begin();
+    virtual void begin(uint16_t port);
+    virtual void handleClient();
+
+    virtual void close();
+    void stop();
+
+    bool authenticate(const char *username, const char *password);
+    void requestAuthentication(
+        HTTPAuthMethod mode = BASIC_AUTH, const char *realm = NULL, const String &authFailMsg = String("")
+    );
+
+    typedef std::function<void(void)> THandlerFunction;
+    void on(const Uri &uri, THandlerFunction fn);
+    void on(const Uri &uri, HTTPMethod method, THandlerFunction fn);
+    void on(const Uri &uri, HTTPMethod method, THandlerFunction fn, THandlerFunction ufn); // ufn handles file uploads
+    void addHandler(RequestHandler *handler);
+    void serveStatic(const char *uri, fs::FS &fs, const char *path, const char *cache_header = NULL);
+    void onNotFound(THandlerFunction fn);    // called when handler is not assigned
+    void onFileUpload(THandlerFunction ufn); // handle file uploads
+
+    String uri() {
+        return _currentUri;
+    }
+
+    HTTPMethod method() {
+        return _currentMethod;
+    }
+
+    virtual WiFiClient client() {
+        return _currentClient;
+    }
+
+    HTTPUpload &upload() {
+        return *_currentUpload;
+    }
+
+    String pathArg(unsigned int i);                                              // get request path argument by number
+    String arg(String name);                                                     // get request argument value by name
+    String arg(int i);                                                           // get request argument value by number
+    String argName(int i);                                                       // get request argument name by number
+    int args();                                                                  // get arguments count
+    bool hasArg(String name);                                                    // check if argument exists
+    void collectHeaders(const char *headerKeys[], const size_t headerKeysCount); // set the request headers to collect
+    String header(String name);                                                  // get request header value by name
+    String header(int i);                                                        // get request header value by number
+    String headerName(int i);                                                    // get request header name by number
+    int headers();                                                               // get header count
+    bool hasHeader(String name);                                                 // check if header exists
+
+    String hostHeader(); // get request host header if available or empty String if not
+
+    // send response to the client
+    // code - HTTP response code, can be 200 or 404
+    // content_type - HTTP content type, like "text/plain" or "image/png"
+    // content - actual content body
+    void send(int code, const char *content_type = NULL, const String &content = String(""));
+    void send(int code, char *content_type, const String &content);
+    void send(int code, const String &content_type, const String &content);
+    void send_P(int code, PGM_P content_type, PGM_P content);
+    void send_P(int code, PGM_P content_type, PGM_P content, size_t contentLength);
+
+    void enableDelay(boolean value);
+    void enableCORS(boolean value = true);
+    void enableCrossOrigin(boolean value = true);
+
+    void setContentLength(const size_t contentLength);
+    void sendHeader(const String &name, const String &value, bool first = false);
+    void sendContent(const String &content);
+    void sendContent(const char *content, size_t contentLength);
+    void sendContent_P(PGM_P content);
+    void sendContent_P(PGM_P content, size_t size);
+
+    static String urlDecode(const String &text);
+
+    template <typename T>
+    size_t streamFile(T &file, const String &contentType) {
+        _streamFileCore(file.size(), file.name(), contentType);
+        return _currentClient.write(file);
+    }
+
+  protected:
+    virtual size_t _currentClientWrite(const char *b, size_t l) {
+        return _currentClient.write(b, l);
+    }
+
+    virtual size_t _currentClientWrite_P(PGM_P b, size_t l) {
+        return _currentClient.write_P(b, l);
+    }
+
+    void _addRequestHandler(RequestHandler *handler);
+    void _handleRequest();
+    void _finalizeResponse();
+    bool _parseRequest(WiFiClient &client);
+    void _parseArguments(String data);
+    static String _responseCodeToString(int code);
+    bool _parseForm(WiFiClient &client, String boundary, uint32_t len);
+    bool _parseFormUploadAborted();
+    void _uploadWriteByte(uint8_t b);
+    int _uploadReadByte(WiFiClient &client);
+    void _prepareHeader(String &response, int code, const char *content_type, size_t contentLength);
+    bool _collectHeader(const char *headerName, const char *headerValue);
+
+    void _streamFileCore(const size_t fileSize, const String &fileName, const String &contentType);
+
+    String _getRandomHexString();
+    // for extracting Auth parameters
+    String _extractParam(String &authReq, const String &param, const char delimit = '"');
+
+    struct RequestArgument {
+        String key;
+        String value;
+    };
+
+    boolean _corsEnabled;
+    WiFiServer _server;
+
+    WiFiClient _currentClient;
+    HTTPMethod _currentMethod;
+    String _currentUri;
+    uint8_t _currentVersion;
+    HTTPClientStatus _currentStatus;
+    unsigned long _statusChange;
+    boolean _nullDelay;
+
+    RequestHandler *_currentHandler;
+    RequestHandler *_firstHandler;
+    RequestHandler *_lastHandler;
+    THandlerFunction _notFoundHandler;
+    THandlerFunction _fileUploadHandler;
+
+    int _currentArgCount;
+    RequestArgument *_currentArgs;
+    int _postArgsLen;
+    RequestArgument *_postArgs;
+
+    std::unique_ptr<HTTPUpload> _currentUpload;
+
+    int _headerKeysCount;
+    RequestArgument *_currentHeaders;
+    size_t _contentLength;
+    String _responseHeaders;
+
+    String _hostHeader;
+    bool _chunked;
+
+    String _snonce; // Store noance and opaque for future comparison
+    String _sopaque;
+    String _srealm; // Store the Auth realm between Calls
+};
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_wi_fi_8cpp/index.html b/ltapi/_wi_fi_8cpp/index.html new file mode 100644 index 000000000..6a1931566 --- /dev/null +++ b/ltapi/_wi_fi_8cpp/index.html @@ -0,0 +1,2414 @@ + + + + + + + + + + + + + + + + + + + + File WiFi.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File WiFi.cpp

+

FileList > api > WiFi > WiFi.cpp

+

Go to the source code of this file.

+
    +
  • #include "WiFi.h"
  • +
+

Public Attributes

+ + + + + + + + + + + + + + + + + +
TypeName
WiFiClassWiFi
WiFiClass *pWiFi = = NULL
+

Public Functions

+ + + + + + + + + + + + + +
TypeName
__attribute__ ((weak))
+

Public Attributes Documentation

+

variable WiFi

+
WiFiClass WiFi;
+
+

variable pWiFi

+
WiFiClass* pWiFi;
+
+

Public Functions Documentation

+

function __attribute__

+
__attribute__ (
+    (weak)
+) 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFi.cpp

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_wi_fi_8cpp_source/index.html b/ltapi/_wi_fi_8cpp_source/index.html new file mode 100644 index 000000000..4f523cbe8 --- /dev/null +++ b/ltapi/_wi_fi_8cpp_source/index.html @@ -0,0 +1,2371 @@ + + + + + + + + + + + + + + + + + + + + File WiFi.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File WiFi.cpp

+

File List > api > WiFi > WiFi.cpp

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-04-25. */
+
+#include "WiFi.h"
+
+void WiFiClass::printDiag(Print &dest) {
+    dest.print("Mode: ");
+    dest.println(WiFiModeText[getMode()]);
+
+    dest.print("Status: ");
+    dest.println(WiFiStatusText[status()]);
+
+    if (getMode() & WIFI_MODE_STA) {
+        dest.println("-- Station --");
+        dest.print("SSID: ");
+        if (isConnected()) {
+            dest.println(SSID());
+            dest.print("Channel: ");
+            dest.println(channel());
+            dest.print("BSSID: ");
+            dest.println(BSSIDstr());
+            dest.print("RSSI: ");
+            dest.println(RSSI());
+            dest.print("Encryption: ");
+            dest.println(WiFiAuthModeText[getEncryption()]);
+            dest.print("IP: ");
+            dest.println(localIP());
+            dest.print("MAC: ");
+            dest.println(macAddress());
+            dest.print("Hostname: ");
+            dest.println(getHostname());
+        } else {
+            dest.println("disconnected");
+        }
+    }
+
+    if (getMode() & WIFI_MODE_AP) {
+        dest.println("-- Access Point --");
+        dest.print("SSID: ");
+        if (softAPSSID().length()) {
+            dest.println(softAPSSID());
+            dest.print("IP: ");
+            dest.println(softAPIP());
+            dest.print("MAC: ");
+            dest.println(softAPmacAddress());
+            dest.print("Hostname: ");
+            dest.println(softAPgetHostname());
+        } else {
+            dest.println("disconnected");
+        }
+    }
+}
+
+bool WiFiClass::validate(const char *ssid, const char *passphrase) {
+    if (!ssid || *ssid == 0x00 || strlen(ssid) > 32) {
+        LT_WM(WIFI, "SSID not specified or too long");
+        return false;
+    }
+    if (passphrase) {
+        uint16_t length = strlen(passphrase);
+        if (length < 8) {
+            LT_WM(WIFI, "Passphrase too short (%u)", length);
+            return false;
+        }
+        if (length > 63) {
+            LT_WM(WIFI, "Passphrase too long (%u)", length);
+            return false;
+        }
+    }
+    return true;
+}
+
+__attribute__((weak)) void WiFiClass::dataInitialize() {}
+
+__attribute__((weak)) void WiFiClass::dataFree() {}
+
+WiFiClass WiFi;
+WiFiClass *pWiFi = NULL;
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_wi_fi_8h/index.html b/ltapi/_wi_fi_8h/index.html new file mode 100644 index 000000000..3a5e75fa1 --- /dev/null +++ b/ltapi/_wi_fi_8h/index.html @@ -0,0 +1,2397 @@ + + + + + + + + + + + + + + + + + + + + File WiFi.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File WiFi.h

+

FileList > api > WiFi > WiFi.h

+

Go to the source code of this file.

+
    +
  • #include <Arduino.h>
  • +
  • #include <Events.h>
  • +
  • #include <api/IPAddress.h>
  • +
  • #include <api/IPv6Address.h>
  • +
  • #include <vector>
  • +
  • #include "WiFiType.h"
  • +
  • #include <WiFiClient.h>
  • +
  • #include <WiFiClientSecure.h>
  • +
  • #include <WiFiServer.h>
  • +
  • #include <WiFiUdp.h>
  • +
+

Classes

+ + + + + + + + + + + + + +
TypeName
classWiFiClass
+

Public Attributes

+ + + + + + + + + + + + + + + + + +
TypeName
WiFiClassWiFi
WiFiClass *pWiFi
+

Public Attributes Documentation

+

variable WiFi

+
WiFiClass WiFi;
+
+

variable pWiFi

+
WiFiClass* pWiFi;
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFi.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_wi_fi_8h_source/index.html b/ltapi/_wi_fi_8h_source/index.html new file mode 100644 index 000000000..01e64e74c --- /dev/null +++ b/ltapi/_wi_fi_8h_source/index.html @@ -0,0 +1,2495 @@ + + + + + + + + + + + + + + + + + + + + File WiFi.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File WiFi.h

+

File List > api > WiFi > WiFi.h

+

Go to the documentation of this file.

+
/*
+ WiFi.h - esp32 Wifi support.
+ Based on WiFi.h from Arduino WiFi shield library.
+ Copyright (c) 2011-2014 Arduino.  All right reserved.
+ Modified by Ivan Grokhotkov, December 2014
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#pragma once
+
+#include <Arduino.h>
+#include <Events.h>
+#include <api/IPAddress.h>
+#include <api/IPv6Address.h>
+#include <vector>
+
+#include "WiFiType.h"
+
+#include <WiFiClient.h>
+#include <WiFiClientSecure.h>
+#include <WiFiServer.h>
+#include <WiFiUdp.h>
+
+class WiFiClass {
+  public:
+    // must be public for WiFiEvents & WiFiScan static handlers
+    void *data;
+    WiFiScanData *scan = NULL;
+
+  public: /* WiFi.cpp */
+    WiFiClass();
+    ~WiFiClass();
+    void printDiag(Print &dest);
+    bool validate(const char *ssid, const char *passphrase);
+    void dataInitialize();
+    void dataFree();
+
+  public: /* WiFiGeneric.cpp */
+    bool mode(WiFiMode mode);
+    bool modePriv(WiFiMode mode, WiFiModeAction sta, WiFiModeAction ap);
+    WiFiMode getMode();
+    WiFiStatus status();
+
+    bool enableSTA(bool enable);
+    bool enableAP(bool enable);
+
+    bool setSleep(bool enable);
+    bool getSleep();
+
+    bool setTxPower(int power);
+    int getTxPower();
+
+    int hostByName(const char *hostname, IPAddress &aResult);
+    IPAddress hostByName(const char *hostname);
+
+    static IPAddress calculateNetworkID(IPAddress ip, IPAddress subnet);
+    static IPAddress calculateBroadcast(IPAddress ip, IPAddress subnet);
+    static uint8_t calculateSubnetCIDR(IPAddress subnetMask);
+    static String macToString(uint8_t *mac);
+
+    static void resetNetworkInfo(WiFiNetworkInfo &info);
+
+  private: /* WiFiGeneric.cpp */
+    bool restoreSTAConfig(const WiFiNetworkInfo &info);
+    bool restoreAPConfig(const WiFiNetworkInfo &info);
+
+  protected: /* WiFiEvents.cpp */
+    static std::vector<EventHandler> handlers;
+
+  public: /* WiFiEvents.cpp */
+    uint16_t onEvent(EventCb callback, EventId eventId = ARDUINO_EVENT_MAX);
+    uint16_t onEvent(EventFuncCb callback, EventId eventId = ARDUINO_EVENT_MAX);
+    uint16_t onEvent(EventSysCb callback, EventId eventId = ARDUINO_EVENT_MAX);
+    void removeEvent(EventCb callback, EventId eventId);
+    void removeEvent(EventSysCb callback, EventId eventId);
+    void removeEvent(uint16_t id);
+    static void postEvent(EventId eventId, EventInfo eventInfo);
+
+  public: /* WiFiSTA.cpp */
+    WiFiStatus begin(
+        const char *ssid,
+        const char *passphrase = NULL,
+        int32_t channel        = 0,
+        const uint8_t *bssid   = NULL,
+        bool connect           = true
+    );
+    WiFiStatus
+    begin(char *ssid, char *passphrase = NULL, int32_t channel = 0, const uint8_t *bssid = NULL, bool connect = true);
+
+    bool config(
+        IPAddress localIP,
+        IPAddress gateway,
+        IPAddress subnet,
+        IPAddress dns1 = (uint32_t)0x00000000,
+        IPAddress dns2 = (uint32_t)0x00000000
+    );
+
+    bool reconnect(const uint8_t *bssid = NULL);
+    bool disconnect(bool wifiOff = false);
+
+    bool isConnected();
+
+    bool setAutoReconnect(bool autoReconnect);
+    bool getAutoReconnect();
+
+    WiFiStatus waitForConnectResult(unsigned long timeout);
+
+    IPAddress localIP();
+    uint8_t *macAddress(uint8_t *mac);
+    String macAddress();
+    IPAddress subnetMask();
+    IPAddress gatewayIP();
+    IPAddress dnsIP(uint8_t dns_no = 0);
+    IPAddress broadcastIP();
+    IPAddress networkID();
+    uint8_t subnetCIDR();
+    bool enableIpV6();
+    IPv6Address localIPv6();
+    const char *getHostname();
+    bool setHostname(const char *hostname);
+    bool setMacAddress(const uint8_t *mac);
+
+    inline bool hostname(const String &aHostname) {
+        return setHostname(aHostname.c_str());
+    }
+
+    const String SSID();
+    const String psk();
+    uint8_t *BSSID();
+    String BSSIDstr();
+    int32_t channel();
+    int8_t RSSI();
+    WiFiAuthMode getEncryption();
+
+  public: /* WiFiScan.cpp */
+    int16_t scanNetworks(
+        bool async               = false,
+        bool showHidden          = false,
+        bool passive             = false,
+        uint32_t maxMsPerChannel = 300,
+        uint8_t channel          = 0
+    );
+    bool getNetworkInfo(
+        uint8_t networkItem,
+        String &ssid,
+        WiFiAuthMode &encryptionType,
+        int32_t &RSSI,
+        uint8_t *&BSSID,
+        int32_t &channel
+    );
+
+    int16_t scanComplete();
+    uint8_t scanAlloc(uint8_t count);
+    void scanInit();
+    void scanDelete();
+
+    String SSID(uint8_t networkItem);
+    WiFiAuthMode encryptionType(uint8_t networkItem);
+    int32_t RSSI(uint8_t networkItem);
+    uint8_t *BSSID(uint8_t networkItem);
+    String BSSIDstr(uint8_t networkItem);
+    int32_t channel(uint8_t networkItem);
+
+  public: /* WiFiAP.cpp */
+    bool softAP(
+        const char *ssid, const char *passphrase = NULL, int channel = 1, bool ssidHidden = false, int maxClients = 4
+    );
+    bool softAPConfig(IPAddress localIP, IPAddress gateway, IPAddress subnet);
+    bool softAPdisconnect(bool wifiOff = false);
+
+    uint8_t softAPgetStationNum();
+
+    IPAddress softAPIP();
+    IPAddress softAPBroadcastIP();
+    IPAddress softAPNetworkID();
+    uint8_t softAPSubnetCIDR();
+    IPAddress softAPSubnetMask();
+    bool softAPenableIpV6();
+    IPv6Address softAPIPv6();
+    const char *softAPgetHostname();
+    bool softAPsetHostname(const char *hostname);
+    uint8_t *softAPmacAddress(uint8_t *mac);
+    String softAPmacAddress(void);
+    const String softAPSSID(void);
+};
+
+extern WiFiClass WiFi;
+extern WiFiClass *pWiFi;
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_wi_fi_a_p_8cpp/index.html b/ltapi/_wi_fi_a_p_8cpp/index.html new file mode 100644 index 000000000..833640255 --- /dev/null +++ b/ltapi/_wi_fi_a_p_8cpp/index.html @@ -0,0 +1,2354 @@ + + + + + + + + + + + + + + + + + + + + File WiFiAP.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File WiFiAP.cpp

+

FileList > api > WiFi > WiFiAP.cpp

+

Go to the source code of this file.

+
    +
  • #include "WiFi.h"
  • +
+

Public Functions

+ + + + + + + + + + + + + +
TypeName
__attribute__ ((weak))
+

Public Functions Documentation

+

function __attribute__

+
__attribute__ (
+    (weak)
+) 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiAP.cpp

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_wi_fi_a_p_8cpp_source/index.html b/ltapi/_wi_fi_a_p_8cpp_source/index.html new file mode 100644 index 000000000..93d88ba38 --- /dev/null +++ b/ltapi/_wi_fi_a_p_8cpp_source/index.html @@ -0,0 +1,2317 @@ + + + + + + + + + + + + + + + + + + + + File WiFiAP.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File WiFiAP.cpp

+

File List > api > WiFi > WiFiAP.cpp

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-04-25. */
+
+#include "WiFi.h"
+
+IPAddress WiFiClass::softAPBroadcastIP() {
+    return calculateBroadcast(softAPIP(), softAPSubnetMask());
+}
+
+IPAddress WiFiClass::softAPNetworkID() {
+    return calculateNetworkID(softAPIP(), softAPSubnetMask());
+}
+
+uint8_t WiFiClass::softAPSubnetCIDR() {
+    return calculateSubnetCIDR(softAPSubnetMask());
+}
+
+__attribute__((weak)) bool WiFiClass::softAPenableIpV6() {
+    return false;
+}
+
+__attribute__((weak)) IPv6Address WiFiClass::softAPIPv6() {
+    return IPv6Address();
+}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_wi_fi_a_p_8h/index.html b/ltapi/_wi_fi_a_p_8h/index.html new file mode 100644 index 000000000..477d53db0 --- /dev/null +++ b/ltapi/_wi_fi_a_p_8h/index.html @@ -0,0 +1,2298 @@ + + + + + + + + + + + + + + + + + + + + File WiFiAP.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_wi_fi_a_p_8h_source/index.html b/ltapi/_wi_fi_a_p_8h_source/index.html new file mode 100644 index 000000000..cb8936925 --- /dev/null +++ b/ltapi/_wi_fi_a_p_8h_source/index.html @@ -0,0 +1,2301 @@ + + + + + + + + + + + + + + + + + + + + File WiFiAP.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_wi_fi_client_8h/index.html b/ltapi/_wi_fi_client_8h/index.html new file mode 100644 index 000000000..6671dccf3 --- /dev/null +++ b/ltapi/_wi_fi_client_8h/index.html @@ -0,0 +1,2329 @@ + + + + + + + + + + + + + + + + + + + + File WiFiClient.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_wi_fi_client_8h_source/index.html b/ltapi/_wi_fi_client_8h_source/index.html new file mode 100644 index 000000000..bc2eef2d3 --- /dev/null +++ b/ltapi/_wi_fi_client_8h_source/index.html @@ -0,0 +1,2372 @@ + + + + + + + + + + + + + + + + + + + + File WiFiClient.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File WiFiClient.h

+

File List > arduino > libraries > common > WiFiClient > WiFiClient.h

+

Go to the documentation of this file.

+
/*
+  Client.h - Base class that provides Client
+  Copyright (c) 2011 Adrian McEwen.  All right reserved.
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License, or (at your option) any later version.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+#pragma once
+
+#include <Arduino.h>
+#include <api/Client.h>
+
+class IWiFiClient : public Client {
+  public:
+    IWiFiClient() {}
+
+    IWiFiClient(int sock) {}
+
+    ~IWiFiClient() {}
+
+    virtual int connect(IPAddress ip, uint16_t port, int32_t timeout)     = 0;
+    virtual int connect(const char *host, uint16_t port, int32_t timeout) = 0;
+
+    virtual size_t write(Stream &stream) = 0;
+
+    size_t write_P(PGM_P buffer, size_t size) {
+        return write((const uint8_t *)buffer, size);
+    }
+
+    virtual int fd() const                   = 0;
+    virtual int socket()                     = 0;
+    virtual int setTimeout(uint32_t seconds) = 0;
+
+    bool operator==(const IWiFiClient &other) const;
+
+    operator bool() {
+        return connected();
+    }
+
+    virtual bool operator==(const bool value) {
+        return bool() == value;
+    }
+
+    virtual bool operator!=(const bool value) {
+        return bool() != value;
+    }
+
+    virtual bool operator!=(const IWiFiClient &other) {
+        return !this->operator==(other);
+    };
+
+    virtual IPAddress remoteIP() const          = 0;
+    virtual IPAddress remoteIP(int sock) const  = 0;
+    virtual uint16_t remotePort() const         = 0;
+    virtual uint16_t remotePort(int sock) const = 0;
+    virtual IPAddress localIP() const           = 0;
+    virtual IPAddress localIP(int sock) const   = 0;
+    virtual uint16_t localPort() const          = 0;
+    virtual uint16_t localPort(int sock) const  = 0;
+
+    using Print::write;
+};
+
+#if LT_ARD_HAS_WIFI && LT_HAS_LWIP
+#include "LwIPClient.h"
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_wi_fi_client_secure_8h/index.html b/ltapi/_wi_fi_client_secure_8h/index.html new file mode 100644 index 000000000..a296af005 --- /dev/null +++ b/ltapi/_wi_fi_client_secure_8h/index.html @@ -0,0 +1,2329 @@ + + + + + + + + + + + + + + + + + + + + File WiFiClientSecure.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_wi_fi_client_secure_8h_source/index.html b/ltapi/_wi_fi_client_secure_8h_source/index.html new file mode 100644 index 000000000..37c9e6c20 --- /dev/null +++ b/ltapi/_wi_fi_client_secure_8h_source/index.html @@ -0,0 +1,2347 @@ + + + + + + + + + + + + + + + + + + + + File WiFiClientSecure.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File WiFiClientSecure.h

+

File List > arduino > libraries > common > WiFiClient > WiFiClientSecure.h

+

Go to the documentation of this file.

+
/*
+  WiFiClientSecure.h - Base class that provides Client SSL to ESP32
+  Copyright (c) 2011 Adrian McEwen.  All right reserved.
+  Additions Copyright (C) 2017 Evandro Luis Copercini.
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License, or (at your option) any later version.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+#pragma once
+
+#include <Arduino.h>
+
+#include "WiFiClient.h"
+
+class IWiFiClientSecure {
+  public:
+    virtual int
+    connect(IPAddress ip, uint16_t port, const char *rootCABuf, const char *clientCert, const char *clientKey) = 0;
+    virtual int
+    connect(const char *host, uint16_t port, const char *rootCABuf, const char *clientCert, const char *clientKey) = 0;
+    virtual int connect(IPAddress ip, uint16_t port, const char *pskIdent, const char *psk)                        = 0;
+    virtual int connect(const char *host, uint16_t port, const char *pskIdent, const char *psk)                    = 0;
+
+    virtual int lastError(char *buf, const size_t size) = 0;
+    virtual void setInsecure() = 0; // Don't validate the chain, just accept whatever is given. VERY INSECURE!
+    virtual void setPreSharedKey(const char *pskIdent, const char *psk)  = 0; // psk in hex
+    virtual void setCACert(const char *rootCA)                           = 0;
+    virtual void setCertificate(const char *clientCA)                    = 0;
+    virtual void setPrivateKey(const char *privateKey)                   = 0;
+    virtual bool loadCACert(Stream &stream, size_t size)                 = 0;
+    virtual bool loadCertificate(Stream &stream, size_t size)            = 0;
+    virtual bool loadPrivateKey(Stream &stream, size_t size)             = 0;
+    virtual bool verify(const char *fingerprint, const char *domainName) = 0;
+    virtual void setHandshakeTimeout(unsigned long handshakeTimeout)     = 0;
+    virtual void setAlpnProtocols(const char **alpnProtocols)            = 0;
+    virtual bool getFingerprintSHA256(uint8_t result[32])                = 0;
+};
+
+#if LT_ARD_HAS_WIFI && LT_HAS_MBEDTLS
+#include "MbedTLSClient.h"
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_wi_fi_events_8cpp/index.html b/ltapi/_wi_fi_events_8cpp/index.html new file mode 100644 index 000000000..b0bf9f2df --- /dev/null +++ b/ltapi/_wi_fi_events_8cpp/index.html @@ -0,0 +1,2298 @@ + + + + + + + + + + + + + + + + + + + + File WiFiEvents.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_wi_fi_events_8cpp_source/index.html b/ltapi/_wi_fi_events_8cpp_source/index.html new file mode 100644 index 000000000..21645e0d9 --- /dev/null +++ b/ltapi/_wi_fi_events_8cpp_source/index.html @@ -0,0 +1,2378 @@ + + + + + + + + + + + + + + + + + + + + File WiFiEvents.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File WiFiEvents.cpp

+

File List > api > WiFi > WiFiEvents.cpp

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-05-17. */
+
+#include "WiFi.h"
+
+std::vector<EventHandler> WiFiClass::handlers;
+
+uint16_t WiFiClass::onEvent(EventCb callback, EventId eventId) {
+    if (!callback)
+        return 0;
+    EventHandler handler;
+    handler.cb      = callback;
+    handler.eventId = eventId;
+    handlers.push_back(handler);
+    return handler.id;
+}
+
+uint16_t WiFiClass::onEvent(EventFuncCb callback, EventId eventId) {
+    if (!callback)
+        return 0;
+    EventHandler handler;
+    handler.fcb     = callback;
+    handler.eventId = eventId;
+    handlers.push_back(handler);
+    return handler.id;
+}
+
+uint16_t WiFiClass::onEvent(EventSysCb callback, EventId eventId) {
+    if (!callback)
+        return 0;
+    EventHandler handler;
+    handler.scb     = callback;
+    handler.eventId = eventId;
+    handlers.push_back(handler);
+    return handler.id;
+}
+
+void WiFiClass::removeEvent(EventCb callback, EventId eventId) {
+    if (!callback)
+        return;
+    for (uint16_t i = 0; i < handlers.size(); i++) {
+        EventHandler handler = handlers[i];
+        if (handler.cb == callback && handler.eventId == eventId) {
+            handlers.erase(handlers.begin() + i);
+        }
+    }
+}
+
+void WiFiClass::removeEvent(EventSysCb callback, EventId eventId) {
+    if (!callback)
+        return;
+    for (uint16_t i = 0; i < handlers.size(); i++) {
+        EventHandler handler = handlers[i];
+        if (handler.scb == callback && handler.eventId == eventId) {
+            handlers.erase(handlers.begin() + i);
+        }
+    }
+}
+
+void WiFiClass::removeEvent(uint16_t id) {
+    for (uint16_t i = 0; i < handlers.size(); i++) {
+        EventHandler handler = handlers[i];
+        if (handler.id == id) {
+            handlers.erase(handlers.begin() + i);
+        }
+    }
+}
+
+void WiFiClass::postEvent(EventId eventId, EventInfo eventInfo) {
+    for (auto handler : handlers) {
+        if (handler.eventId != ARDUINO_EVENT_MAX && handler.eventId != eventId)
+            continue;
+        if (handler.cb) {
+            handler.cb(eventId);
+        } else if (handler.fcb) {
+            handler.fcb(eventId, eventInfo);
+        } else if (handler.scb) {
+            Event_t event = {
+                .event_id   = eventId,
+                .event_info = eventInfo,
+            };
+            handler.scb(&event);
+        }
+    }
+}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_wi_fi_events_8h/index.html b/ltapi/_wi_fi_events_8h/index.html new file mode 100644 index 000000000..c9e40000e --- /dev/null +++ b/ltapi/_wi_fi_events_8h/index.html @@ -0,0 +1,2625 @@ + + + + + + + + + + + + + + + + + + + + File WiFiEvents.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

File WiFiEvents.h

+

FileList > api > WiFi > WiFiEvents.h

+

Go to the source code of this file.

+
    +
  • #include "WiFiType.h"
  • +
+

Classes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
structesp_netif_ip6_info_t
IPV6 IP address information.
structesp_netif_ip_info_t
structip_event_ap_staipassigned_t
structip_event_got_ip6_t
structip_event_got_ip_t
structwifi_event_action_tx_status_t
structwifi_event_ap_probe_req_rx_t
structwifi_event_ap_staconnected_t
structwifi_event_ap_stadisconnected_t
structwifi_event_ftm_report_t
structwifi_event_roc_done_t
structwifi_event_sta_authmode_change_t
structwifi_event_sta_connected_t
structwifi_event_sta_disconnected_t
structwifi_event_sta_scan_done_t
structwifi_event_sta_wps_er_pin_t
structwifi_event_sta_wps_er_success_t
structwifi_ftm_report_entry_t
+

Public Types

+ + + + + + + + + + + + + + + + + +
TypeName
enumwifi_event_sta_wps_fail_reason_t
enumwifi_ftm_status_t
FTM operation status types.
+

Macros

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
defineMAX_PASSPHRASE_LEN 64
defineMAX_SSID_LEN 32
defineMAX_WPS_AP_CRED 3
defineWIFI_STATIS_ALL (-1)
defineWIFI_STATIS_BUFFER (1 << 0)
defineWIFI_STATIS_DIAG (1 << 3)
defineWIFI_STATIS_HW (1 << 2)
defineWIFI_STATIS_PS (1 << 4)
defineWIFI_STATIS_RXTX (1 << 1)
+

Public Types Documentation

+

enum wifi_event_sta_wps_fail_reason_t

+
enum wifi_event_sta_wps_fail_reason_t {
+    WPS_FAIL_REASON_NORMAL = 0,
+    WPS_FAIL_REASON_RECV_M2D,
+    WPS_FAIL_REASON_MAX
+};
+
+

Argument structure for WIFI_EVENT_STA_WPS_ER_FAILED event

+

enum wifi_ftm_status_t

+
enum wifi_ftm_status_t {
+    FTM_STATUS_SUCCESS = 0,
+    FTM_STATUS_UNSUPPORTED,
+    FTM_STATUS_CONF_REJECTED,
+    FTM_STATUS_NO_RESPONSE,
+    FTM_STATUS_FAIL
+};
+
+

Macro Definition Documentation

+

define MAX_PASSPHRASE_LEN

+
#define MAX_PASSPHRASE_LEN 64
+
+

define MAX_SSID_LEN

+
#define MAX_SSID_LEN 32
+
+

define MAX_WPS_AP_CRED

+
#define MAX_WPS_AP_CRED 3
+
+

define WIFI_STATIS_ALL

+
#define WIFI_STATIS_ALL (-1)
+
+

define WIFI_STATIS_BUFFER

+
#define WIFI_STATIS_BUFFER (1 << 0)
+
+

define WIFI_STATIS_DIAG

+
#define WIFI_STATIS_DIAG (1 << 3)
+
+

define WIFI_STATIS_HW

+
#define WIFI_STATIS_HW (1 << 2)
+
+

define WIFI_STATIS_PS

+
#define WIFI_STATIS_PS (1 << 4)
+
+

define WIFI_STATIS_RXTX

+
#define WIFI_STATIS_RXTX (1 << 1)
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_wi_fi_events_8h_source/index.html b/ltapi/_wi_fi_events_8h_source/index.html new file mode 100644 index 000000000..32953312b --- /dev/null +++ b/ltapi/_wi_fi_events_8h_source/index.html @@ -0,0 +1,2443 @@ + + + + + + + + + + + + + + + + + + + + File WiFiEvents.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File WiFiEvents.h

+

File List > api > WiFi > WiFiEvents.h

+

Go to the documentation of this file.

+
/*
+ * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+#pragma once
+
+#include "WiFiType.h"
+
+typedef struct {
+    uint32_t status; 
+    uint8_t number;  
+    uint8_t scan_id; 
+} wifi_event_sta_scan_done_t;
+
+typedef struct {
+    uint8_t ssid[32];          
+    uint8_t ssid_len;          
+    uint8_t bssid[6];          
+    uint8_t channel;           
+    wifi_auth_mode_t authmode; 
+} wifi_event_sta_connected_t;
+
+typedef struct {
+    uint8_t ssid[32]; 
+    uint8_t ssid_len; 
+    uint8_t bssid[6]; 
+    uint8_t reason;   
+} wifi_event_sta_disconnected_t;
+
+typedef struct {
+    wifi_auth_mode_t old_mode; 
+    wifi_auth_mode_t new_mode; 
+} wifi_event_sta_authmode_change_t;
+
+typedef struct {
+    uint8_t pin_code[8]; 
+} wifi_event_sta_wps_er_pin_t;
+
+typedef enum {
+    WPS_FAIL_REASON_NORMAL = 0, 
+    WPS_FAIL_REASON_RECV_M2D,   
+    WPS_FAIL_REASON_MAX
+} wifi_event_sta_wps_fail_reason_t;
+
+#define MAX_SSID_LEN       32
+#define MAX_PASSPHRASE_LEN 64
+#define MAX_WPS_AP_CRED    3
+
+typedef struct {
+    uint8_t ap_cred_cnt; 
+    struct {
+        uint8_t ssid[MAX_SSID_LEN];             
+        uint8_t passphrase[MAX_PASSPHRASE_LEN]; 
+    } ap_cred[MAX_WPS_AP_CRED];                 
+} wifi_event_sta_wps_er_success_t;
+
+typedef struct {
+    uint8_t mac[6];     
+    uint8_t aid;        
+    bool is_mesh_child; 
+} wifi_event_ap_staconnected_t;
+
+typedef struct {
+    uint8_t mac[6];     
+    uint8_t aid;        
+    bool is_mesh_child; 
+} wifi_event_ap_stadisconnected_t;
+
+typedef struct {
+    int rssi;       
+    uint8_t mac[6]; 
+} wifi_event_ap_probe_req_rx_t;
+
+typedef enum {
+    FTM_STATUS_SUCCESS = 0,   
+    FTM_STATUS_UNSUPPORTED,   
+    FTM_STATUS_CONF_REJECTED, 
+    FTM_STATUS_NO_RESPONSE,   
+    FTM_STATUS_FAIL,          
+} wifi_ftm_status_t;
+
+typedef struct {
+    uint8_t dlog_token; 
+    int8_t rssi;        
+    uint32_t rtt;       
+    uint64_t t1;        
+    uint64_t t2;        
+    uint64_t t3;        
+    uint64_t t4;        
+} wifi_ftm_report_entry_t;
+
+typedef struct {
+    uint8_t peer_mac[6];      
+    wifi_ftm_status_t status; 
+    uint32_t rtt_raw;         
+    uint32_t rtt_est;         
+    uint32_t dist_est;        
+    wifi_ftm_report_entry_t
+        *ftm_report_data;           
+    uint8_t ftm_report_num_entries; 
+} wifi_event_ftm_report_t;
+
+#define WIFI_STATIS_BUFFER (1 << 0)
+#define WIFI_STATIS_RXTX   (1 << 1)
+#define WIFI_STATIS_HW     (1 << 2)
+#define WIFI_STATIS_DIAG   (1 << 3)
+#define WIFI_STATIS_PS     (1 << 4)
+#define WIFI_STATIS_ALL    (-1)
+
+typedef struct {
+    int ifx;          
+    uint32_t context; 
+    uint8_t da[6];    
+    uint8_t status;   
+} wifi_event_action_tx_status_t;
+
+typedef struct {
+    uint32_t context; 
+} wifi_event_roc_done_t;
+
+typedef struct {
+    esp_ip4_addr_t ip;      
+    esp_ip4_addr_t netmask; 
+    esp_ip4_addr_t gw;      
+} esp_netif_ip_info_t;
+
+typedef struct {
+    esp_ip6_addr_t ip; 
+} esp_netif_ip6_info_t;
+
+typedef struct {
+    int if_index;                
+    void *esp_netif;             
+    esp_netif_ip_info_t ip_info; 
+    bool ip_changed;             
+} ip_event_got_ip_t;
+
+typedef struct {
+    int if_index;                  
+    void *esp_netif;               
+    esp_netif_ip6_info_t ip6_info; 
+    int ip_index;                  
+} ip_event_got_ip6_t;
+
+typedef struct {
+    esp_ip4_addr_t ip; 
+} ip_event_ap_staipassigned_t;
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_wi_fi_generic_8cpp/index.html b/ltapi/_wi_fi_generic_8cpp/index.html new file mode 100644 index 000000000..a21561f50 --- /dev/null +++ b/ltapi/_wi_fi_generic_8cpp/index.html @@ -0,0 +1,2354 @@ + + + + + + + + + + + + + + + + + + + + File WiFiGeneric.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File WiFiGeneric.cpp

+

FileList > api > WiFi > WiFiGeneric.cpp

+

Go to the source code of this file.

+
    +
  • #include "WiFi.h"
  • +
+

Public Functions

+ + + + + + + + + + + + + +
TypeName
__attribute__ ((weak))
+

Public Functions Documentation

+

function __attribute__

+
__attribute__ (
+    (weak)
+) 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiGeneric.cpp

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_wi_fi_generic_8cpp_source/index.html b/ltapi/_wi_fi_generic_8cpp_source/index.html new file mode 100644 index 000000000..722d7600c --- /dev/null +++ b/ltapi/_wi_fi_generic_8cpp_source/index.html @@ -0,0 +1,2448 @@ + + + + + + + + + + + + + + + + + + + + File WiFiGeneric.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File WiFiGeneric.cpp

+

File List > api > WiFi > WiFiGeneric.cpp

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-04-25. */
+
+#include "WiFi.h"
+
+#if LT_HAS_FREERTOS
+#include <FreeRTOS.h>
+#endif
+
+bool WiFiClass::mode(WiFiMode mode) {
+    // store a pointer to WiFi for WiFiEvents.cpp
+    pWiFi = this;
+
+    WiFiMode currentMode = getMode();
+    LT_DM(WIFI, "Mode changing %s -> %s", WiFiModeText[currentMode], WiFiModeText[mode]);
+    if (mode == currentMode)
+        return true;
+
+    // get mode changes as 0/1
+    WiFiModeAction sta = WiFiModeAction((mode & WIFI_MODE_STA) != (currentMode & WIFI_MODE_STA));
+    WiFiModeAction ap  = WiFiModeAction((mode & WIFI_MODE_AP) != (currentMode & WIFI_MODE_AP));
+    // change 0/1 to 1/2
+    sta = WiFiModeAction(sta + sta * !!(mode & WIFI_MODE_STA));
+    ap  = WiFiModeAction(ap + ap * !!(mode & WIFI_MODE_AP));
+    // initialize data structures if wifi is enabled
+    if (mode)
+        dataInitialize();
+    // actually change the mode
+    LT_HEAP_I();
+    if (!modePriv(mode, sta, ap))
+        return false;
+    if (getMode() != mode) {
+        LT_WM(WIFI, "Mode changed to %d (requested %d)", getMode(), mode);
+    }
+    return true;
+}
+
+bool WiFiClass::enableSTA(bool enable) {
+    WiFiMode currentMode = getMode();
+    if (((currentMode & WIFI_MODE_STA) != 0) != enable) {
+        return mode((WiFiMode)(currentMode ^ WIFI_MODE_STA));
+    }
+    return true;
+}
+
+bool WiFiClass::enableAP(bool enable) {
+    WiFiMode currentMode = getMode();
+    if (((currentMode & WIFI_MODE_AP) != 0) != enable) {
+        return mode((WiFiMode)(currentMode ^ WIFI_MODE_AP));
+    }
+    return true;
+}
+
+__attribute__((weak)) bool WiFiClass::setSleep(bool enable) {
+    return false;
+}
+
+__attribute__((weak)) bool WiFiClass::getSleep() {
+    return false;
+}
+
+__attribute__((weak)) bool WiFiClass::setTxPower(int power) {
+    return false;
+}
+
+__attribute__((weak)) int WiFiClass::getTxPower() {
+    return 0;
+}
+
+int WiFiClass::hostByName(const char *hostname, IPAddress &aResult) {
+    aResult = hostByName(hostname);
+    return true;
+}
+
+IPAddress WiFiClass::calculateNetworkID(IPAddress ip, IPAddress subnet) {
+    IPAddress networkID;
+
+    for (size_t i = 0; i < 4; i++)
+        networkID[i] = subnet[i] & ip[i];
+
+    return networkID;
+}
+
+IPAddress WiFiClass::calculateBroadcast(IPAddress ip, IPAddress subnet) {
+    IPAddress broadcastIp;
+
+    for (int i = 0; i < 4; i++)
+        broadcastIp[i] = ~subnet[i] | ip[i];
+
+    return broadcastIp;
+}
+
+uint8_t WiFiClass::calculateSubnetCIDR(IPAddress subnetMask) {
+    uint8_t CIDR = 0;
+
+    for (uint8_t i = 0; i < 4; i++) {
+        if (subnetMask[i] == 0x80) // 128
+            CIDR += 1;
+        else if (subnetMask[i] == 0xC0) // 192
+            CIDR += 2;
+        else if (subnetMask[i] == 0xE0) // 224
+            CIDR += 3;
+        else if (subnetMask[i] == 0xF0) // 242
+            CIDR += 4;
+        else if (subnetMask[i] == 0xF8) // 248
+            CIDR += 5;
+        else if (subnetMask[i] == 0xFC) // 252
+            CIDR += 6;
+        else if (subnetMask[i] == 0xFE) // 254
+            CIDR += 7;
+        else if (subnetMask[i] == 0xFF) // 255
+            CIDR += 8;
+    }
+
+    return CIDR;
+}
+
+String WiFiClass::macToString(uint8_t *mac) {
+    char macStr[18]; // 6*2 + 5*':' + '\0'
+    sprintf(macStr, "%02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
+    return macStr;
+}
+
+void WiFiClass::resetNetworkInfo(WiFiNetworkInfo &info) {
+    LT_VM(WIFI, "Resetting network info: %s", info.ssid);
+    free(info.ssid);
+    free(info.password);
+    free(info.bssid);
+    // wipe the structure, except IP addresses
+    memset(&info, 0x00, sizeof(WiFiNetworkInfo) - 5 * sizeof(uint32_t));
+}
+
+bool WiFiClass::restoreSTAConfig(const WiFiNetworkInfo &info) {
+    LT_DM(WIFI, "Restoring %s config: %s", "STA", info.ssid);
+    if (!info.ssid)
+        return false;
+    if (info.localIP) {
+        LT_DM(WIFI, "Restoring STA IP config");
+        if (!config(info.localIP, info.gateway, info.subnet, info.dns1, info.dns2))
+            return false;
+    }
+    return begin(info.ssid, info.password, info.channel, info.bssid);
+}
+
+bool WiFiClass::restoreAPConfig(const WiFiNetworkInfo &info) {
+    LT_DM(WIFI, "Restoring %s config: %s", "AP", info.ssid);
+    if (!info.ssid)
+        return false;
+    if (info.localIP) {
+        LT_DM(WIFI, "Restoring AP IP config");
+        if (!softAPConfig(info.localIP, info.gateway, info.subnet))
+            return false;
+    }
+    return softAP(info.ssid, info.password, info.channel, info.ssidHidden);
+}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_wi_fi_multi_8cpp/index.html b/ltapi/_wi_fi_multi_8cpp/index.html new file mode 100644 index 000000000..b7dff9081 --- /dev/null +++ b/ltapi/_wi_fi_multi_8cpp/index.html @@ -0,0 +1,2305 @@ + + + + + + + + + + + + + + + + + + + + File WiFiMulti.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File WiFiMulti.cpp

+

FileList > arduino > libraries > ext > WiFiMulti > WiFiMulti.cpp

+

Go to the source code of this file.

+

More...

+

Detailed Description

+

Date:

+

16.05.2015

+

Author:

+

Markus Sattler

+

Copyright (c) 2015 Markus Sattler. All rights reserved. This file is part of the esp8266 core for Arduino environment.

+

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

+

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

+

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WiFiMulti/WiFiMulti.cpp

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_wi_fi_multi_8cpp_source/index.html b/ltapi/_wi_fi_multi_8cpp_source/index.html new file mode 100644 index 000000000..9dccf4547 --- /dev/null +++ b/ltapi/_wi_fi_multi_8cpp_source/index.html @@ -0,0 +1,2517 @@ + + + + + + + + + + + + + + + + + + + + File WiFiMulti.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File WiFiMulti.cpp

+

File List > arduino > libraries > ext > WiFiMulti > WiFiMulti.cpp

+

Go to the documentation of this file.

+
#if LT_ARD_HAS_WIFI
+
+#include "WiFiMulti.h"
+#include <Arduino.h>
+#include <limits.h>
+#include <string.h>
+
+WiFiMulti::WiFiMulti() {}
+
+WiFiMulti::~WiFiMulti() {
+    for (uint32_t i = 0; i < APlist.size(); i++) {
+        WifiAPlist_t entry = APlist[i];
+        if (entry.ssid) {
+            free(entry.ssid);
+        }
+        if (entry.passphrase) {
+            free(entry.passphrase);
+        }
+    }
+    APlist.clear();
+}
+
+bool WiFiMulti::addAP(const char *ssid, const char *passphrase) {
+    WifiAPlist_t newAP;
+
+    if (!ssid || *ssid == 0x00 || strlen(ssid) > 31) {
+        // fail SSID too long or missing!
+        LT_EM(WIFI, "SSID missing or too long");
+        return false;
+    }
+
+    if (passphrase && strlen(passphrase) > 64) {
+        // fail passphrase too long!
+        LT_EM(WIFI, "Passphrase too long");
+        return false;
+    }
+
+    newAP.ssid = strdup(ssid);
+
+    if (!newAP.ssid) {
+        LT_EM(WIFI, "Fail newAP.ssid == 0");
+        return false;
+    }
+
+    if (passphrase && *passphrase != 0x00) {
+        newAP.passphrase = strdup(passphrase);
+        if (!newAP.passphrase) {
+            LT_EM(WIFI, "Fail newAP.passphrase == 0");
+            free(newAP.ssid);
+            return false;
+        }
+    } else {
+        newAP.passphrase = NULL;
+    }
+
+    APlist.push_back(newAP);
+    LT_VM(WIFI, "Add SSID: %s", newAP.ssid);
+    return true;
+}
+
+uint8_t WiFiMulti::run(uint32_t connectTimeout) {
+    int8_t scanResult;
+    uint8_t status = WiFi.status();
+    if (status == WL_CONNECTED) {
+        for (uint32_t x = 0; x < APlist.size(); x++) {
+            if (WiFi.SSID() == APlist[x].ssid) {
+                return status;
+            }
+        }
+        WiFi.disconnect(false);
+        delay(10);
+        status = WiFi.status();
+    }
+
+    scanResult = WiFi.scanNetworks();
+    if (scanResult == WIFI_SCAN_RUNNING) {
+        // scan is running
+        return WL_NO_SSID_AVAIL;
+    } else if (scanResult >= 0) {
+        // scan done analyze
+        WifiAPlist_t bestNetwork{NULL, NULL};
+        int bestNetworkDb = INT_MIN;
+        uint8_t bestBSSID[6];
+        int32_t bestChannel = 0;
+
+        LT_IM(WIFI, "Scan finished");
+
+        if (scanResult == 0) {
+            LT_IM(WIFI, "No networks found");
+        } else {
+            LT_IM(WIFI, "%d networks found", scanResult);
+            for (int8_t i = 0; i < scanResult; ++i) {
+
+                String ssid_scan;
+                int32_t rssi_scan;
+                WiFiAuthMode sec_scan;
+                uint8_t *BSSID_scan;
+                int32_t chan_scan;
+
+                WiFi.getNetworkInfo(i, ssid_scan, sec_scan, rssi_scan, BSSID_scan, chan_scan);
+
+                bool known = false;
+                for (uint32_t x = APlist.size(); x > 0; x--) {
+                    WifiAPlist_t entry = APlist[x - 1];
+
+                    if (ssid_scan == entry.ssid) { // SSID match
+                        known = true;
+                        if (rssi_scan > bestNetworkDb) { // best network
+                            if (sec_scan == WIFI_AUTH_OPEN ||
+                                entry.passphrase) { // check for passphrase if not open wlan
+                                bestNetworkDb = rssi_scan;
+                                bestChannel   = chan_scan;
+                                memcpy((void *)&bestNetwork, (void *)&entry, sizeof(bestNetwork));
+                                memcpy((void *)&bestBSSID, (void *)BSSID_scan, sizeof(bestBSSID));
+                            }
+                        }
+                        break;
+                    }
+                }
+
+                if (known) {
+                    LT_DM(
+                        WIFI,
+                        " --->   %d: [%d][%02X:%02X:%02X:%02X:%02X:%02X] %s (%d) %c",
+                        i,
+                        chan_scan,
+                        BSSID_scan[0],
+                        BSSID_scan[1],
+                        BSSID_scan[2],
+                        BSSID_scan[3],
+                        BSSID_scan[4],
+                        BSSID_scan[5],
+                        ssid_scan.c_str(),
+                        rssi_scan,
+                        (sec_scan == WIFI_AUTH_OPEN) ? ' ' : '*'
+                    );
+                } else {
+                    LT_DM(
+                        WIFI,
+                        "       %d: [%d][%02X:%02X:%02X:%02X:%02X:%02X] %s (%d) %c",
+                        i,
+                        chan_scan,
+                        BSSID_scan[0],
+                        BSSID_scan[1],
+                        BSSID_scan[2],
+                        BSSID_scan[3],
+                        BSSID_scan[4],
+                        BSSID_scan[5],
+                        ssid_scan.c_str(),
+                        rssi_scan,
+                        (sec_scan == WIFI_AUTH_OPEN) ? ' ' : '*'
+                    );
+                }
+            }
+        }
+
+        // clean up ram
+        WiFi.scanDelete();
+
+        if (bestNetwork.ssid) {
+            LT_IM(
+                WIFI,
+                "Connecting to BSSID: %02X:%02X:%02X:%02X:%02X:%02X SSID: %s Channel: %d (%d)",
+                bestBSSID[0],
+                bestBSSID[1],
+                bestBSSID[2],
+                bestBSSID[3],
+                bestBSSID[4],
+                bestBSSID[5],
+                bestNetwork.ssid,
+                bestChannel,
+                bestNetworkDb
+            );
+
+            WiFi.begin(bestNetwork.ssid, bestNetwork.passphrase, bestChannel, bestBSSID);
+            status = WiFi.status();
+
+            auto startTime = millis();
+            // wait for connection, fail, or timeout
+            while (status != WL_CONNECTED && status != WL_NO_SSID_AVAIL && status != WL_CONNECT_FAILED &&
+                   (millis() - startTime) <= connectTimeout) {
+                delay(10);
+                status = WiFi.status();
+            }
+
+            IPAddress ip;
+            switch (status) {
+                case WL_CONNECTED:
+                    LT_IM(WIFI, "Connecting done");
+                    LT_DM(WIFI, "SSID: %s", WiFi.SSID().c_str());
+                    // TODO fix this after implementing IP format for printf()
+                    ip = WiFi.localIP();
+                    LT_DM(WIFI, "IP: %u.%u.%u.%u", ip[0], ip[1], ip[2], ip[3]);
+                    LT_DM(WIFI, "MAC: %s", WiFi.BSSIDstr().c_str());
+                    LT_DM(WIFI, "Channel: %d", WiFi.channel());
+                    break;
+                case WL_NO_SSID_AVAIL:
+                    LT_EM(WIFI, "Connecting failed; AP not found");
+                    break;
+                case WL_CONNECT_FAILED:
+                    LT_EM(WIFI, "Connecting failed");
+                    break;
+                default:
+                    LT_EM(WIFI, "Connecting failed (%d)", status);
+                    break;
+            }
+        } else {
+            LT_EM(WIFI, "No matching network found!");
+        }
+    } else {
+        // start scan
+        LT_VM(WIFI, "Delete old wifi config...");
+        WiFi.disconnect();
+
+        LT_DM(WIFI, "Start scan");
+        // scan wifi async mode
+        WiFi.scanNetworks(true);
+    }
+
+    return status;
+}
+
+#endif // LT_ARD_HAS_WIFI
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_wi_fi_multi_8h/index.html b/ltapi/_wi_fi_multi_8h/index.html new file mode 100644 index 000000000..c77c99b69 --- /dev/null +++ b/ltapi/_wi_fi_multi_8h/index.html @@ -0,0 +1,2333 @@ + + + + + + + + + + + + + + + + + + + + File WiFiMulti.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_wi_fi_multi_8h_source/index.html b/ltapi/_wi_fi_multi_8h_source/index.html new file mode 100644 index 000000000..b7cbb4734 --- /dev/null +++ b/ltapi/_wi_fi_multi_8h_source/index.html @@ -0,0 +1,2316 @@ + + + + + + + + + + + + + + + + + + + + File WiFiMulti.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File WiFiMulti.h

+

File List > arduino > libraries > ext > WiFiMulti > WiFiMulti.h

+

Go to the documentation of this file.

+
#pragma once
+
+#include "WiFi.h"
+#include <vector>
+
+typedef struct {
+    char *ssid;
+    char *passphrase;
+} WifiAPlist_t;
+
+class WiFiMulti {
+  public:
+    WiFiMulti();
+    ~WiFiMulti();
+
+    bool addAP(const char *ssid, const char *passphrase = NULL);
+
+    uint8_t run(uint32_t connectTimeout = 10000);
+
+  private:
+    std::vector<WifiAPlist_t> APlist;
+};
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_wi_fi_s_t_a_8cpp/index.html b/ltapi/_wi_fi_s_t_a_8cpp/index.html new file mode 100644 index 000000000..fd43c1b40 --- /dev/null +++ b/ltapi/_wi_fi_s_t_a_8cpp/index.html @@ -0,0 +1,2354 @@ + + + + + + + + + + + + + + + + + + + + File WiFiSTA.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File WiFiSTA.cpp

+

FileList > api > WiFi > WiFiSTA.cpp

+

Go to the source code of this file.

+
    +
  • #include "WiFi.h"
  • +
+

Public Functions

+ + + + + + + + + + + + + +
TypeName
__attribute__ ((weak))
+

Public Functions Documentation

+

function __attribute__

+
__attribute__ (
+    (weak)
+) 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiSTA.cpp

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_wi_fi_s_t_a_8cpp_source/index.html b/ltapi/_wi_fi_s_t_a_8cpp_source/index.html new file mode 100644 index 000000000..7d4c34815 --- /dev/null +++ b/ltapi/_wi_fi_s_t_a_8cpp_source/index.html @@ -0,0 +1,2342 @@ + + + + + + + + + + + + + + + + + + + + File WiFiSTA.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File WiFiSTA.cpp

+

File List > api > WiFi > WiFiSTA.cpp

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-04-25. */
+
+#include "WiFi.h"
+
+WiFiStatus WiFiClass::begin(char *ssid, char *passphrase, int32_t channel, const uint8_t *bssid, bool connect) {
+    return begin((const char *)ssid, (const char *)passphrase, channel, bssid, connect);
+}
+
+bool WiFiClass::isConnected() {
+    return status() == WL_CONNECTED;
+}
+
+WiFiStatus WiFiClass::waitForConnectResult(unsigned long timeout) {
+    if ((getMode() & WIFI_MODE_STA) == 0) {
+        return WL_DISCONNECTED;
+    }
+    unsigned long start = millis();
+    while ((!status() || status() >= WL_DISCONNECTED) && (millis() - start) < timeout) {
+        delay(100);
+    }
+    return status();
+}
+
+String WiFiClass::macAddress(void) {
+    uint8_t mac[6];
+    macAddress(mac);
+    return macToString(mac);
+}
+
+IPAddress WiFiClass::networkID() {
+    return calculateNetworkID(gatewayIP(), subnetMask());
+}
+
+uint8_t WiFiClass::subnetCIDR() {
+    return calculateSubnetCIDR(subnetMask());
+}
+
+String WiFiClass::BSSIDstr() {
+    return macToString(BSSID());
+}
+
+__attribute__((weak)) bool WiFiClass::enableIpV6() {
+    return false;
+}
+
+__attribute__((weak)) IPv6Address WiFiClass::localIPv6() {
+    return IPv6Address();
+}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_wi_fi_scan_8cpp/index.html b/ltapi/_wi_fi_scan_8cpp/index.html new file mode 100644 index 000000000..4d8e4a26d --- /dev/null +++ b/ltapi/_wi_fi_scan_8cpp/index.html @@ -0,0 +1,2298 @@ + + + + + + + + + + + + + + + + + + + + File WiFiScan.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_wi_fi_scan_8cpp_source/index.html b/ltapi/_wi_fi_scan_8cpp_source/index.html new file mode 100644 index 000000000..f410911f0 --- /dev/null +++ b/ltapi/_wi_fi_scan_8cpp_source/index.html @@ -0,0 +1,2387 @@ + + + + + + + + + + + + + + + + + + + + File WiFiScan.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File WiFiScan.cpp

+

File List > api > WiFi > WiFiScan.cpp

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-04-25. */
+
+#include "WiFi.h"
+
+bool WiFiClass::getNetworkInfo(
+    uint8_t networkItem, String &ssid, WiFiAuthMode &encType, int32_t &rssi, uint8_t *&bssid, int32_t &channel
+) {
+    ssid    = SSID(networkItem);
+    encType = encryptionType(networkItem);
+    rssi    = RSSI(networkItem);
+    bssid   = BSSID(networkItem);
+    channel = this->channel(networkItem);
+    return true;
+}
+
+int16_t WiFiClass::scanComplete() {
+    if (!scan)
+        return 0;
+    if (scan->running)
+        return WIFI_SCAN_RUNNING;
+    return scan->count;
+}
+
+void WiFiClass::scanInit() {
+    if (scan)
+        return;
+    scan = (WiFiScanData *)calloc(1, sizeof(WiFiScanData));
+}
+
+void WiFiClass::scanDelete() {
+    if (!scan)
+        return;
+    for (uint8_t i = 0; i < scan->count; i++) {
+        free(scan->ap[i].ssid);
+    }
+    free(scan->ap);
+    free(scan);
+    scan = NULL;
+}
+
+uint8_t WiFiClass::scanAlloc(uint8_t count) {
+    if ((!scan->ap) || (count > scan->count)) {
+        auto newMem = (WiFiScanAP *)realloc(scan->ap, count * sizeof(WiFiScanAP));
+        if (!newMem) {
+            return scan->count;
+        }
+        scan->ap = newMem;
+    }
+    if (!scan->ap) {
+        scan->count = 0;
+        return 0;
+    }
+    if (count > scan->count) {
+        // clear only new entries
+        memset(scan->ap + scan->count, 0, sizeof(WiFiScanAP) * (count - scan->count));
+    }
+    scan->count = count;
+    return count;
+}
+
+String WiFiClass::SSID(uint8_t networkItem) {
+    if (!scan || networkItem >= scan->count)
+        return "";
+    return scan->ap[networkItem].ssid;
+}
+
+WiFiAuthMode WiFiClass::encryptionType(uint8_t networkItem) {
+    if (!scan || networkItem >= scan->count)
+        return WIFI_AUTH_INVALID;
+    return scan->ap[networkItem].auth;
+}
+
+int32_t WiFiClass::RSSI(uint8_t networkItem) {
+    if (!scan || networkItem >= scan->count)
+        return 0;
+    return scan->ap[networkItem].rssi;
+}
+
+uint8_t *WiFiClass::BSSID(uint8_t networkItem) {
+    if (!scan || networkItem >= scan->count)
+        return NULL;
+    return scan->ap[networkItem].bssid.addr;
+}
+
+String WiFiClass::BSSIDstr(uint8_t networkItem) {
+    return macToString(BSSID(networkItem));
+}
+
+int32_t WiFiClass::channel(uint8_t networkItem) {
+    if (!scan || networkItem >= scan->count)
+        return 0;
+    return scan->ap[networkItem].channel;
+}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_wi_fi_server_8h/index.html b/ltapi/_wi_fi_server_8h/index.html new file mode 100644 index 000000000..ae77f9b9b --- /dev/null +++ b/ltapi/_wi_fi_server_8h/index.html @@ -0,0 +1,2331 @@ + + + + + + + + + + + + + + + + + + + + File WiFiServer.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_wi_fi_server_8h_source/index.html b/ltapi/_wi_fi_server_8h_source/index.html new file mode 100644 index 000000000..240c9afa6 --- /dev/null +++ b/ltapi/_wi_fi_server_8h_source/index.html @@ -0,0 +1,2370 @@ + + + + + + + + + + + + + + + + + + + + File WiFiServer.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File WiFiServer.h

+

File List > arduino > libraries > common > WiFiServer > WiFiServer.h

+

Go to the documentation of this file.

+
/*
+  Server.h - Server class for Raspberry Pi
+  Copyright (c) 2016 Hristo Gochkov  All right reserved.
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License, or (at your option) any later version.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+#pragma once
+
+#include <Arduino.h>
+#include <api/Print.h>
+
+#include "WiFiClient.h"
+
+#include <type_traits>
+
+template <typename TWiFiClient, typename = std::enable_if<std::is_base_of<IWiFiClient, TWiFiClient>::value>>
+
+class IWiFiServer : public Print { // arduino::Server is useless anyway
+  public:
+    void listenOnLocalhost() {}
+
+    IWiFiServer(uint16_t port = 80, uint8_t maxClients = 4) {}
+
+    IWiFiServer(const IPAddress &addr, uint16_t port = 80, uint8_t maxClients = 4) {}
+
+    ~IWiFiServer() {
+        stop();
+    }
+
+    TWiFiClient available() {
+        return accept();
+    };
+
+    virtual operator bool() = 0;
+
+    virtual bool begin(uint16_t port = 0, bool reuseAddr = true) = 0;
+    virtual void end()                                           = 0;
+    virtual TWiFiClient accept()                                 = 0;
+
+    void close() {
+        end();
+    }
+
+    void stop() {
+        end();
+    }
+
+    virtual int setTimeout(uint32_t seconds) = 0;
+    virtual void stopAll()                   = 0;
+    virtual void setNoDelay(bool noDelay)    = 0;
+    virtual bool getNoDelay()                = 0;
+    virtual bool hasClient()                 = 0;
+
+    size_t write(uint8_t data) {
+        return write(&data, 1);
+    }
+
+    using Print::write;
+};
+
+#if LT_ARD_HAS_WIFI && LT_HAS_LWIP
+#include "LwIPServer.h"
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_wi_fi_type_8h/index.html b/ltapi/_wi_fi_type_8h/index.html new file mode 100644 index 000000000..11ae60b93 --- /dev/null +++ b/ltapi/_wi_fi_type_8h/index.html @@ -0,0 +1,2918 @@ + + + + + + + + + + + + + + + + + + + + File WiFiType.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

File WiFiType.h

+

FileList > api > WiFi > WiFiType.h

+

Go to the source code of this file.

+
    +
  • #include <Arduino.h>
  • +
+

Classes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
structWiFiMacAddr
structWiFiNetworkInfo
structWiFiScanAP
structWiFiScanData
structesp_ip4_addr
structesp_ip6_addr
+

Public Types

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
enumWiFiModeAction
typedef struct esp_ip4_addresp_ip4_addr_t
typedef struct esp_ip6_addresp_ip6_addr_t
enumwifi_auth_mode_t
enumwifi_err_reason_t
enumwifi_mode_t
enumwl_status_t
+

Public Static Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
const char *WiFiAuthModeText = = {
"Open",
"WEP",
"WPA PSK",
"WPA2 PSK",
"WPA/WPA2 PSK",
"WPA2 EAP",
"WPA3 PSK",
"WPA2/WPA3 PSK",
"WAPI PSK",
"WPA",
"WPA2",
"Auto",
}
const char *WiFiModeText = = {"NULL", "STA", "AP", "AP+STA"}
const char *WiFiStatusText = = {
"Idle",
"No SSID",
"Scan Completed",
"Connected",
"Connect failed",
"Connection lost",
"Disconnected",
}
+

Macros

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
defineWIFI_AP WIFI_MODE_AP
defineWIFI_AP_STA WIFI_MODE_APSTA
defineWIFI_OFF WIFI_MODE_NULL
defineWIFI_SCAN_FAILED (-2)
defineWIFI_SCAN_RUNNING (-1)
defineWIFI_STA WIFI_MODE_STA
defineWiFiAuthMode wifi_auth_mode_t
defineWiFiEventId_t uint16_t
defineWiFiEventInfo_t arduino_event_info_t
defineWiFiEvent_t arduino_event_id_t
defineWiFiMode wifi_mode_t
defineWiFiMode_t wifi_mode_t
defineWiFiStatus wl_status_t
+

Public Types Documentation

+

enum WiFiModeAction

+
enum WiFiModeAction {
+    WLMODE_NONE = 0,
+    WLMODE_DISABLE = 1,
+    WLMODE_ENABLE = 2
+};
+
+

typedef esp_ip4_addr_t

+
typedef struct esp_ip4_addr esp_ip4_addr_t;
+
+

typedef esp_ip6_addr_t

+
typedef struct esp_ip6_addr esp_ip6_addr_t;
+
+

enum wifi_auth_mode_t

+
enum wifi_auth_mode_t {
+    WIFI_AUTH_OPEN = 0,
+    WIFI_AUTH_WEP,
+    WIFI_AUTH_WPA_PSK,
+    WIFI_AUTH_WPA2_PSK,
+    WIFI_AUTH_WPA_WPA2_PSK,
+    WIFI_AUTH_WPA2_ENTERPRISE,
+    WIFI_AUTH_WPA3_PSK,
+    WIFI_AUTH_WPA2_WPA3_PSK,
+    WIFI_AUTH_WAPI_PSK,
+    WIFI_AUTH_WPA,
+    WIFI_AUTH_WPA2,
+    WIFI_AUTH_AUTO = 200,
+    WIFI_AUTH_INVALID = 255,
+    WIFI_AUTH_MAX
+};
+
+

enum wifi_err_reason_t

+
enum wifi_err_reason_t {
+    WIFI_REASON_UNSPECIFIED = 1,
+    WIFI_REASON_AUTH_EXPIRE = 2,
+    WIFI_REASON_AUTH_LEAVE = 3,
+    WIFI_REASON_ASSOC_EXPIRE = 4,
+    WIFI_REASON_ASSOC_TOOMANY = 5,
+    WIFI_REASON_NOT_AUTHED = 6,
+    WIFI_REASON_NOT_ASSOCED = 7,
+    WIFI_REASON_ASSOC_LEAVE = 8,
+    WIFI_REASON_ASSOC_NOT_AUTHED = 9,
+    WIFI_REASON_DISASSOC_PWRCAP_BAD = 10,
+    WIFI_REASON_DISASSOC_SUPCHAN_BAD = 11,
+    WIFI_REASON_BSS_TRANSITION_DISASSOC = 12,
+    WIFI_REASON_IE_INVALID = 13,
+    WIFI_REASON_MIC_FAILURE = 14,
+    WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT = 15,
+    WIFI_REASON_GROUP_KEY_UPDATE_TIMEOUT = 16,
+    WIFI_REASON_IE_IN_4WAY_DIFFERS = 17,
+    WIFI_REASON_GROUP_CIPHER_INVALID = 18,
+    WIFI_REASON_PAIRWISE_CIPHER_INVALID = 19,
+    WIFI_REASON_AKMP_INVALID = 20,
+    WIFI_REASON_UNSUPP_RSN_IE_VERSION = 21,
+    WIFI_REASON_INVALID_RSN_IE_CAP = 22,
+    WIFI_REASON_802_1X_AUTH_FAILED = 23,
+    WIFI_REASON_CIPHER_SUITE_REJECTED = 24,
+    WIFI_REASON_INVALID_PMKID = 53,
+    WIFI_REASON_BEACON_TIMEOUT = 200,
+    WIFI_REASON_NO_AP_FOUND = 201,
+    WIFI_REASON_AUTH_FAIL = 202,
+    WIFI_REASON_ASSOC_FAIL = 203,
+    WIFI_REASON_HANDSHAKE_TIMEOUT = 204,
+    WIFI_REASON_CONNECTION_FAIL = 205,
+    WIFI_REASON_AP_TSF_RESET = 206,
+    WIFI_REASON_ROAMING = 207
+};
+
+

enum wifi_mode_t

+
enum wifi_mode_t {
+    WIFI_MODE_NULL = 0,
+    WIFI_MODE_STA,
+    WIFI_MODE_AP,
+    WIFI_MODE_APSTA,
+    WIFI_MODE_MAX
+};
+
+

enum wl_status_t

+
enum wl_status_t {
+    WL_NO_SHIELD = 255,
+    WL_IDLE_STATUS = 0,
+    WL_NO_SSID_AVAIL = 1,
+    WL_SCAN_COMPLETED = 2,
+    WL_CONNECTED = 3,
+    WL_CONNECT_FAILED = 4,
+    WL_CONNECTION_LOST = 5,
+    WL_DISCONNECTED = 6
+};
+
+

Public Static Attributes Documentation

+

variable WiFiAuthModeText

+
const char* WiFiAuthModeText[];
+
+

variable WiFiModeText

+
const char* WiFiModeText[];
+
+

variable WiFiStatusText

+
const char* WiFiStatusText[];
+
+

Macro Definition Documentation

+

define WIFI_AP

+
#define WIFI_AP WIFI_MODE_AP
+
+

define WIFI_AP_STA

+
#define WIFI_AP_STA WIFI_MODE_APSTA
+
+

define WIFI_OFF

+
#define WIFI_OFF WIFI_MODE_NULL
+
+

define WIFI_SCAN_FAILED

+
#define WIFI_SCAN_FAILED (-2)
+
+

define WIFI_SCAN_RUNNING

+
#define WIFI_SCAN_RUNNING (-1)
+
+

define WIFI_STA

+
#define WIFI_STA WIFI_MODE_STA
+
+

define WiFiAuthMode

+
#define WiFiAuthMode wifi_auth_mode_t
+
+

define WiFiEventId_t

+
#define WiFiEventId_t uint16_t
+
+

define WiFiEventInfo_t

+
#define WiFiEventInfo_t arduino_event_info_t
+
+

define WiFiEvent_t

+
#define WiFiEvent_t arduino_event_id_t
+
+

define WiFiMode

+
#define WiFiMode wifi_mode_t
+
+

define WiFiMode_t

+
#define WiFiMode_t wifi_mode_t
+
+

define WiFiStatus

+
#define WiFiStatus wl_status_t
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiType.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_wi_fi_type_8h_source/index.html b/ltapi/_wi_fi_type_8h_source/index.html new file mode 100644 index 000000000..a9d75cea9 --- /dev/null +++ b/ltapi/_wi_fi_type_8h_source/index.html @@ -0,0 +1,2483 @@ + + + + + + + + + + + + + + + + + + + + File WiFiType.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File WiFiType.h

+

File List > api > WiFi > WiFiType.h

+

Go to the documentation of this file.

+
/*
+ ESP8266WiFiType.h - esp8266 Wifi support.
+ Copyright (c) 2011-2014 Arduino.  All right reserved.
+ Modified by Ivan Grokhotkov, December 2014
+ Reworked by Markus Sattler, December 2015
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#pragma once
+
+#include <Arduino.h>
+
+#define WIFI_SCAN_RUNNING (-1)
+#define WIFI_SCAN_FAILED  (-2)
+
+#define WiFiMode_t   wifi_mode_t
+#define WiFiMode     wifi_mode_t
+#define WiFiStatus   wl_status_t
+#define WiFiAuthMode wifi_auth_mode_t
+
+#define WIFI_OFF    WIFI_MODE_NULL
+#define WIFI_STA    WIFI_MODE_STA
+#define WIFI_AP     WIFI_MODE_AP
+#define WIFI_AP_STA WIFI_MODE_APSTA
+
+#define WiFiEvent_t     arduino_event_id_t
+#define WiFiEventInfo_t arduino_event_info_t
+#define WiFiEventId_t   uint16_t
+
+typedef struct {
+    uint8_t addr[6];
+} WiFiMacAddr;
+
+struct esp_ip6_addr {
+    uint32_t addr[4];
+    uint8_t zone;
+};
+
+struct esp_ip4_addr {
+    uint32_t addr;
+};
+
+typedef struct esp_ip4_addr esp_ip4_addr_t;
+typedef struct esp_ip6_addr esp_ip6_addr_t;
+
+typedef enum {
+    WIFI_MODE_NULL = 0, 
+    WIFI_MODE_STA,      
+    WIFI_MODE_AP,       
+    WIFI_MODE_APSTA,    
+    WIFI_MODE_MAX
+} wifi_mode_t;
+
+typedef enum {
+    WL_NO_SHIELD       = 255, // for compatibility with WiFi Shield library
+    WL_IDLE_STATUS     = 0,
+    WL_NO_SSID_AVAIL   = 1,
+    WL_SCAN_COMPLETED  = 2,
+    WL_CONNECTED       = 3,
+    WL_CONNECT_FAILED  = 4,
+    WL_CONNECTION_LOST = 5,
+    WL_DISCONNECTED    = 6,
+} wl_status_t;
+
+typedef enum {
+    WIFI_AUTH_OPEN = 0,        
+    WIFI_AUTH_WEP,             
+    WIFI_AUTH_WPA_PSK,         
+    WIFI_AUTH_WPA2_PSK,        
+    WIFI_AUTH_WPA_WPA2_PSK,    
+    WIFI_AUTH_WPA2_ENTERPRISE, 
+    WIFI_AUTH_WPA3_PSK,        
+    WIFI_AUTH_WPA2_WPA3_PSK,   
+    WIFI_AUTH_WAPI_PSK,        
+    WIFI_AUTH_WPA,
+    WIFI_AUTH_WPA2,
+    WIFI_AUTH_AUTO    = 200,
+    WIFI_AUTH_INVALID = 255,
+    WIFI_AUTH_MAX
+} wifi_auth_mode_t;
+
+typedef enum {
+    WIFI_REASON_UNSPECIFIED              = 1,
+    WIFI_REASON_AUTH_EXPIRE              = 2,
+    WIFI_REASON_AUTH_LEAVE               = 3,
+    WIFI_REASON_ASSOC_EXPIRE             = 4,
+    WIFI_REASON_ASSOC_TOOMANY            = 5,
+    WIFI_REASON_NOT_AUTHED               = 6,
+    WIFI_REASON_NOT_ASSOCED              = 7,
+    WIFI_REASON_ASSOC_LEAVE              = 8,
+    WIFI_REASON_ASSOC_NOT_AUTHED         = 9,
+    WIFI_REASON_DISASSOC_PWRCAP_BAD      = 10,
+    WIFI_REASON_DISASSOC_SUPCHAN_BAD     = 11,
+    WIFI_REASON_BSS_TRANSITION_DISASSOC  = 12,
+    WIFI_REASON_IE_INVALID               = 13,
+    WIFI_REASON_MIC_FAILURE              = 14,
+    WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT   = 15,
+    WIFI_REASON_GROUP_KEY_UPDATE_TIMEOUT = 16,
+    WIFI_REASON_IE_IN_4WAY_DIFFERS       = 17,
+    WIFI_REASON_GROUP_CIPHER_INVALID     = 18,
+    WIFI_REASON_PAIRWISE_CIPHER_INVALID  = 19,
+    WIFI_REASON_AKMP_INVALID             = 20,
+    WIFI_REASON_UNSUPP_RSN_IE_VERSION    = 21,
+    WIFI_REASON_INVALID_RSN_IE_CAP       = 22,
+    WIFI_REASON_802_1X_AUTH_FAILED       = 23,
+    WIFI_REASON_CIPHER_SUITE_REJECTED    = 24,
+    WIFI_REASON_INVALID_PMKID            = 53,
+    WIFI_REASON_BEACON_TIMEOUT           = 200,
+    WIFI_REASON_NO_AP_FOUND              = 201,
+    WIFI_REASON_AUTH_FAIL                = 202,
+    WIFI_REASON_ASSOC_FAIL               = 203,
+    WIFI_REASON_HANDSHAKE_TIMEOUT        = 204,
+    WIFI_REASON_CONNECTION_FAIL          = 205,
+    WIFI_REASON_AP_TSF_RESET             = 206,
+    WIFI_REASON_ROAMING                  = 207,
+} wifi_err_reason_t;
+
+typedef struct {
+    char *ssid;
+    char *password;
+    uint8_t *bssid;
+    bool ssidHidden;
+    int channel;
+    int auth;
+    uint32_t localIP;
+    uint32_t subnet;
+    uint32_t gateway;
+    uint32_t dns1;
+    uint32_t dns2;
+} WiFiNetworkInfo;
+
+typedef struct {
+    char *ssid;
+    WiFiAuthMode auth;
+    int32_t rssi;
+    WiFiMacAddr bssid;
+    int32_t channel;
+} WiFiScanAP;
+
+typedef struct {
+    bool running          = false;
+    unsigned long timeout = 0;
+    uint8_t count         = 0;
+    WiFiScanAP *ap        = NULL;
+} WiFiScanData;
+
+typedef enum {
+    WLMODE_NONE    = 0,
+    WLMODE_DISABLE = 1,
+    WLMODE_ENABLE  = 2,
+} WiFiModeAction;
+
+static const char *WiFiModeText[]   = {"NULL", "STA", "AP", "AP+STA"};
+static const char *WiFiStatusText[] = {
+    "Idle",
+    "No SSID",
+    "Scan Completed",
+    "Connected",
+    "Connect failed",
+    "Connection lost",
+    "Disconnected",
+};
+static const char *WiFiAuthModeText[] = {
+    "Open",
+    "WEP",
+    "WPA PSK",
+    "WPA2 PSK",
+    "WPA/WPA2 PSK",
+    "WPA2 EAP",
+    "WPA3 PSK",
+    "WPA2/WPA3 PSK",
+    "WAPI PSK",
+    "WPA",
+    "WPA2",
+    "Auto",
+};
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_wi_fi_udp_8h/index.html b/ltapi/_wi_fi_udp_8h/index.html new file mode 100644 index 000000000..c4b5e9649 --- /dev/null +++ b/ltapi/_wi_fi_udp_8h/index.html @@ -0,0 +1,2329 @@ + + + + + + + + + + + + + + + + + + + + File WiFiUdp.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/_wi_fi_udp_8h_source/index.html b/ltapi/_wi_fi_udp_8h_source/index.html new file mode 100644 index 000000000..ec17d5812 --- /dev/null +++ b/ltapi/_wi_fi_udp_8h_source/index.html @@ -0,0 +1,2330 @@ + + + + + + + + + + + + + + + + + + + + File WiFiUdp.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File WiFiUdp.h

+

File List > arduino > libraries > common > WiFiUdp > WiFiUdp.h

+

Go to the documentation of this file.

+
#pragma once
+
+#include <Arduino.h>
+#include <api/Udp.h>
+
+class IWiFiUDP : public UDP {
+  public:
+    IWiFiUDP() {}
+
+    ~IWiFiUDP() {}
+
+    virtual uint8_t begin(IPAddress ip, uint16_t port)          = 0;
+    virtual uint8_t begin(uint16_t port)                        = 0;
+    virtual uint8_t beginMulticast(IPAddress ip, uint16_t port) = 0;
+    virtual void stop()                                         = 0;
+    virtual int beginMulticastPacket()                          = 0;
+    virtual int beginPacket()                                   = 0;
+    virtual int beginPacket(IPAddress ip, uint16_t port)        = 0;
+    virtual int beginPacket(const char *host, uint16_t port)    = 0;
+    virtual int endPacket()                                     = 0;
+    virtual size_t write(uint8_t)                               = 0;
+    virtual size_t write(const uint8_t *buffer, size_t size)    = 0;
+    virtual int parsePacket()                                   = 0;
+    virtual int available()                                     = 0;
+    virtual int read()                                          = 0;
+    virtual int read(unsigned char *buffer, size_t len)         = 0;
+    virtual int read(char *buffer, size_t len)                  = 0;
+    virtual int peek()                                          = 0;
+    virtual void flush()                                        = 0;
+    virtual IPAddress remoteIP()                                = 0;
+    virtual uint16_t remotePort()                               = 0;
+};
+
+#if LT_ARD_HAS_WIFI && LT_HAS_LWIP
+#include "LwIPUdp.h"
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/abi_8cpp/index.html b/ltapi/abi_8cpp/index.html new file mode 100644 index 000000000..f30702e94 --- /dev/null +++ b/ltapi/abi_8cpp/index.html @@ -0,0 +1,2370 @@ + + + + + + + + + + + + + + + + + + + + File abi.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File abi.cpp

+

FileList > arduino > src > common > abi.cpp

+

Go to the source code of this file.

+
    +
  • #include <stdlib.h>
  • +
+

Public Functions

+ + + + + + + + + + + + + + + + + +
TypeName
void__cxa_deleted_virtual (void)
void__cxa_pure_virtual (void)
+

Public Functions Documentation

+

function __cxa_deleted_virtual

+
void __cxa_deleted_virtual (
+    void
+) 
+
+

function __cxa_pure_virtual

+
void __cxa_pure_virtual (
+    void
+) 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/src/common/abi.cpp

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/abi_8cpp_source/index.html b/ltapi/abi_8cpp_source/index.html new file mode 100644 index 000000000..a202d7b86 --- /dev/null +++ b/ltapi/abi_8cpp_source/index.html @@ -0,0 +1,2330 @@ + + + + + + + + + + + + + + + + + + + + File abi.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File abi.cpp

+

File List > arduino > src > common > abi.cpp

+

Go to the documentation of this file.

+
/*
+  Copyright (c) 2014 Arduino LLC.  All right reserved.
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License, or (at your option) any later version.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+  See the GNU Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+#include <stdlib.h>
+
+extern "C" void __cxa_pure_virtual(void) __attribute__((__noreturn__));
+extern "C" void __cxa_deleted_virtual(void) __attribute__((__noreturn__));
+
+void __cxa_pure_virtual(void) {
+    // We might want to write some diagnostics to uart in this case
+    // std::terminate();
+    while (1)
+        ;
+}
+
+void __cxa_deleted_virtual(void) {
+    // We might want to write some diagnostics to uart in this case
+    // std::terminate();
+    while (1)
+        ;
+}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/annotated/index.html b/ltapi/annotated/index.html new file mode 100644 index 000000000..268256220 --- /dev/null +++ b/ltapi/annotated/index.html @@ -0,0 +1,2378 @@ + + + + + + + + + + + + + + + + + + + + Class List - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Class List

+

Here are the classes, structs, unions and interfaces with brief descriptions:

+ + + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/api_2_i_pv6_address_8h/index.html b/ltapi/api_2_i_pv6_address_8h/index.html new file mode 100644 index 000000000..04b454d8a --- /dev/null +++ b/ltapi/api_2_i_pv6_address_8h/index.html @@ -0,0 +1,2298 @@ + + + + + + + + + + + + + + + + + + + + File IPv6Address.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File IPv6Address.h

+

FileList > api > IPv6Address.h

+

Go to the source code of this file.

+
    +
  • #include "../IPv6Address.h"
  • +
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/IPv6Address/api/IPv6Address.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/api_2_i_pv6_address_8h_source/index.html b/ltapi/api_2_i_pv6_address_8h_source/index.html new file mode 100644 index 000000000..32a6688a4 --- /dev/null +++ b/ltapi/api_2_i_pv6_address_8h_source/index.html @@ -0,0 +1,2299 @@ + + + + + + + + + + + + + + + + + + + + File IPv6Address.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/base64_8cpp/index.html b/ltapi/base64_8cpp/index.html new file mode 100644 index 000000000..8429624bf --- /dev/null +++ b/ltapi/base64_8cpp/index.html @@ -0,0 +1,2301 @@ + + + + + + + + + + + + + + + + + + + + File base64.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/base64_8cpp_source/index.html b/ltapi/base64_8cpp_source/index.html new file mode 100644 index 000000000..a47fdf84e --- /dev/null +++ b/ltapi/base64_8cpp_source/index.html @@ -0,0 +1,2322 @@ + + + + + + + + + + + + + + + + + + + + File base64.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File base64.cpp

+

File List > arduino > libraries > ext > base64 > base64.cpp

+

Go to the documentation of this file.

+
#include "Arduino.h"
+extern "C" {
+#include "libb64/cdecode.h"
+#include "libb64/cencode.h"
+}
+#include "base64.h"
+
+String base64::encode(const uint8_t * data, size_t length)
+{
+    size_t size = base64_encode_expected_len(length) + 1;
+    char * buffer = (char *) malloc(size);
+    if(buffer) {
+        base64_encodestate _state;
+        base64_init_encodestate(&_state);
+        int len = base64_encode_block((const char *) &data[0], length, &buffer[0], &_state);
+        len = base64_encode_blockend((buffer + len), &_state);
+
+        String base64 = String(buffer);
+        free(buffer);
+        return base64;
+    }
+    return String("-FAIL-");
+}
+
+String base64::encode(const String& text)
+{
+    return base64::encode((uint8_t *) text.c_str(), text.length());
+}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/base64_8h/index.html b/ltapi/base64_8h/index.html new file mode 100644 index 000000000..750b655f4 --- /dev/null +++ b/ltapi/base64_8h/index.html @@ -0,0 +1,2328 @@ + + + + + + + + + + + + + + + + + + + + File base64.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/base64_8h_source/index.html b/ltapi/base64_8h_source/index.html new file mode 100644 index 000000000..aab8002db --- /dev/null +++ b/ltapi/base64_8h_source/index.html @@ -0,0 +1,2303 @@ + + + + + + + + + + + + + + + + + + + + File base64.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/cbuf_8cpp/index.html b/ltapi/cbuf_8cpp/index.html new file mode 100644 index 000000000..3498eab0e --- /dev/null +++ b/ltapi/cbuf_8cpp/index.html @@ -0,0 +1,2298 @@ + + + + + + + + + + + + + + + + + + + + File cbuf.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/cbuf_8cpp_source/index.html b/ltapi/cbuf_8cpp_source/index.html new file mode 100644 index 000000000..a9604dbe3 --- /dev/null +++ b/ltapi/cbuf_8cpp_source/index.html @@ -0,0 +1,2490 @@ + + + + + + + + + + + + + + + + + + + + File cbuf.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File cbuf.cpp

+

File List > arduino > libraries > ext > cbuf > cbuf.cpp

+

Go to the documentation of this file.

+
/*
+ cbuf.cpp - Circular buffer implementation
+ Copyright (c) 2014 Ivan Grokhotkov. All rights reserved.
+ This file is part of the esp8266 core for Arduino environment.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#include "cbuf.h"
+
+cbuf::cbuf(size_t size) :
+    next(NULL), _size(size+1), _buf(new char[size+1]), _bufend(_buf + size + 1), _begin(_buf), _end(_begin)
+{
+}
+
+cbuf::~cbuf()
+{
+    delete[] _buf;
+}
+
+size_t cbuf::resizeAdd(size_t addSize)
+{
+    return resize(_size + addSize);
+}
+
+size_t cbuf::resize(size_t newSize)
+{
+
+    size_t bytes_available = available();
+    newSize += 1;
+    // not lose any data
+    // if data can be lost use remove or flush before resize
+    if((newSize < bytes_available) || (newSize == _size)) {
+        return _size;
+    }
+
+    char *newbuf = new char[newSize];
+    char *oldbuf = _buf;
+
+    if(!newbuf) {
+        return _size;
+    }
+
+    if(_buf) {
+        read(newbuf, bytes_available);
+        memset((newbuf + bytes_available), 0x00, (newSize - bytes_available));
+    }
+
+    _begin = newbuf;
+    _end = newbuf + bytes_available;
+    _bufend = newbuf + newSize;
+    _size = newSize;
+
+    _buf = newbuf;
+    delete[] oldbuf;
+
+    return _size;
+}
+
+size_t cbuf::available() const
+{
+    if(_end >= _begin) {
+        return _end - _begin;
+    }
+    return _size - (_begin - _end);
+}
+
+size_t cbuf::size()
+{
+    return _size;
+}
+
+size_t cbuf::room() const
+{
+    if(_end >= _begin) {
+        return _size - (_end - _begin) - 1;
+    }
+    return _begin - _end - 1;
+}
+
+int cbuf::peek()
+{
+    if(empty()) {
+        return -1;
+    }
+
+    return static_cast<int>(*_begin);
+}
+
+size_t cbuf::peek(char *dst, size_t size)
+{
+    size_t bytes_available = available();
+    size_t size_to_read = (size < bytes_available) ? size : bytes_available;
+    size_t size_read = size_to_read;
+    char * begin = _begin;
+    if(_end < _begin && size_to_read > (size_t) (_bufend - _begin)) {
+        size_t top_size = _bufend - _begin;
+        memcpy(dst, _begin, top_size);
+        begin = _buf;
+        size_to_read -= top_size;
+        dst += top_size;
+    }
+    memcpy(dst, begin, size_to_read);
+    return size_read;
+}
+
+int cbuf::read()
+{
+    if(empty()) {
+        return -1;
+    }
+
+    char result = *_begin;
+    _begin = wrap_if_bufend(_begin + 1);
+    return static_cast<int>(result);
+}
+
+size_t cbuf::read(char* dst, size_t size)
+{
+    size_t bytes_available = available();
+    size_t size_to_read = (size < bytes_available) ? size : bytes_available;
+    size_t size_read = size_to_read;
+    if(_end < _begin && size_to_read > (size_t) (_bufend - _begin)) {
+        size_t top_size = _bufend - _begin;
+        memcpy(dst, _begin, top_size);
+        _begin = _buf;
+        size_to_read -= top_size;
+        dst += top_size;
+    }
+    memcpy(dst, _begin, size_to_read);
+    _begin = wrap_if_bufend(_begin + size_to_read);
+    return size_read;
+}
+
+size_t cbuf::write(char c)
+{
+    if(full()) {
+        return 0;
+    }
+
+    *_end = c;
+    _end = wrap_if_bufend(_end + 1);
+    return 1;
+}
+
+size_t cbuf::write(const char* src, size_t size)
+{
+    size_t bytes_available = room();
+    size_t size_to_write = (size < bytes_available) ? size : bytes_available;
+    size_t size_written = size_to_write;
+    if(_end >= _begin && size_to_write > (size_t) (_bufend - _end)) {
+        size_t top_size = _bufend - _end;
+        memcpy(_end, src, top_size);
+        _end = _buf;
+        size_to_write -= top_size;
+        src += top_size;
+    }
+    memcpy(_end, src, size_to_write);
+    _end = wrap_if_bufend(_end + size_to_write);
+    return size_written;
+}
+
+void cbuf::flush()
+{
+    _begin = _buf;
+    _end = _buf;
+}
+
+size_t cbuf::remove(size_t size)
+{
+    size_t bytes_available = available();
+    if(size >= bytes_available) {
+        flush();
+        return 0;
+    }
+    size_t size_to_remove = (size < bytes_available) ? size : bytes_available;
+    if(_end < _begin && size_to_remove > (size_t) (_bufend - _begin)) {
+        size_t top_size = _bufend - _begin;
+        _begin = _buf;
+        size_to_remove -= top_size;
+    }
+    _begin = wrap_if_bufend(_begin + size_to_remove);
+    return available();
+}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/cbuf_8h/index.html b/ltapi/cbuf_8h/index.html new file mode 100644 index 000000000..3abffbbe3 --- /dev/null +++ b/ltapi/cbuf_8h/index.html @@ -0,0 +1,2330 @@ + + + + + + + + + + + + + + + + + + + + File cbuf.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/cbuf_8h_source/index.html b/ltapi/cbuf_8h_source/index.html new file mode 100644 index 000000000..476687141 --- /dev/null +++ b/ltapi/cbuf_8h_source/index.html @@ -0,0 +1,2373 @@ + + + + + + + + + + + + + + + + + + + + File cbuf.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File cbuf.h

+

File List > arduino > libraries > ext > cbuf > cbuf.h

+

Go to the documentation of this file.

+
/*
+ cbuf.h - Circular buffer implementation
+ Copyright (c) 2014 Ivan Grokhotkov. All rights reserved.
+ This file is part of the esp8266 core for Arduino environment.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#ifndef __cbuf_h
+#define __cbuf_h
+
+#include <stddef.h>
+#include <stdint.h>
+#include <string.h>
+
+class cbuf
+{
+public:
+    cbuf(size_t size);
+    ~cbuf();
+
+    size_t resizeAdd(size_t addSize);
+    size_t resize(size_t newSize);
+    size_t available() const;
+    size_t size();
+
+    size_t room() const;
+
+    inline bool empty() const
+    {
+        return _begin == _end;
+    }
+
+    inline bool full() const
+    {
+        return wrap_if_bufend(_end + 1) == _begin;
+    }
+
+    int peek();
+    size_t peek(char *dst, size_t size);
+
+    int read();
+    size_t read(char* dst, size_t size);
+
+    size_t write(char c);
+    size_t write(const char* src, size_t size);
+
+    void flush();
+    size_t remove(size_t size);
+
+    cbuf *next;
+
+protected:
+    inline char* wrap_if_bufend(char* ptr) const
+    {
+        return (ptr == _bufend) ? _buf : ptr;
+    }
+
+    size_t _size;
+    char* _buf;
+    const char* _bufend;
+    char* _begin;
+    char* _end;
+
+};
+
+#endif//__cbuf_h
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/cdecode_8c/index.html b/ltapi/cdecode_8c/index.html new file mode 100644 index 000000000..231d1c798 --- /dev/null +++ b/ltapi/cdecode_8c/index.html @@ -0,0 +1,2493 @@ + + + + + + + + + + + + + + + + + + + + File cdecode.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

File cdecode.c

+

FileList > arduino > libraries > ext > base64 > libb64 > cdecode.c

+

Go to the source code of this file.

+
    +
  • #include "cdecode.h"
  • +
  • #include <stdint.h>
  • +
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
intbase64_decode_block (const char * code_in, const int length_in, char * plaintext_out, base64_decodestate * state_in)
intbase64_decode_chars (const char * code_in, const int length_in, char * plaintext_out)
intbase64_decode_value (char value_in)
voidbase64_init_decodestate (base64_decodestate * state_in)
+

Public Static Functions

+ + + + + + + + + + + + + + + + + + + + + +
TypeName
intbase64_decode_block_signed (const int8_t * code_in, const int length_in, int8_t * plaintext_out, base64_decodestate * state_in)
intbase64_decode_chars_signed (const int8_t * code_in, const int length_in, int8_t * plaintext_out)
intbase64_decode_value_signed (int8_t value_in)
+

Public Functions Documentation

+

function base64_decode_block

+
int base64_decode_block (
+    const char * code_in,
+    const int length_in,
+    char * plaintext_out,
+    base64_decodestate * state_in
+) 
+
+

function base64_decode_chars

+
int base64_decode_chars (
+    const char * code_in,
+    const int length_in,
+    char * plaintext_out
+) 
+
+

function base64_decode_value

+
int base64_decode_value (
+    char value_in
+) 
+
+

function base64_init_decodestate

+
void base64_init_decodestate (
+    base64_decodestate * state_in
+) 
+
+

Public Static Functions Documentation

+

function base64_decode_block_signed

+
static int base64_decode_block_signed (
+    const int8_t * code_in,
+    const int length_in,
+    int8_t * plaintext_out,
+    base64_decodestate * state_in
+) 
+
+

function base64_decode_chars_signed

+
static int base64_decode_chars_signed (
+    const int8_t * code_in,
+    const int length_in,
+    int8_t * plaintext_out
+) 
+
+

function base64_decode_value_signed

+
static int base64_decode_value_signed (
+    int8_t value_in
+) 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/base64/libb64/cdecode.c

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/cdecode_8c_source/index.html b/ltapi/cdecode_8c_source/index.html new file mode 100644 index 000000000..372f3fce5 --- /dev/null +++ b/ltapi/cdecode_8c_source/index.html @@ -0,0 +1,2393 @@ + + + + + + + + + + + + + + + + + + + + File cdecode.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File cdecode.c

+

File List > arduino > libraries > ext > base64 > libb64 > cdecode.c

+

Go to the documentation of this file.

+
/*
+cdecoder.c - c source to a base64 decoding algorithm implementation
+
+This is part of the libb64 project, and has been placed in the public domain.
+For details, see http://sourceforge.net/projects/libb64
+*/
+
+#include "cdecode.h"
+#include <stdint.h>
+
+static int base64_decode_value_signed(int8_t value_in){
+  static const int8_t decoding[] = {62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-2,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51};
+  static const int8_t decoding_size = sizeof(decoding);
+  value_in -= 43;
+  if (value_in < 0 || value_in >= decoding_size) return -1;
+  return decoding[(int)value_in];
+}
+
+void base64_init_decodestate(base64_decodestate* state_in){
+  state_in->step = step_a;
+  state_in->plainchar = 0;
+}
+
+static int base64_decode_block_signed(const int8_t* code_in, const int length_in, int8_t* plaintext_out, base64_decodestate* state_in){
+  const int8_t* codechar = code_in;
+  int8_t* plainchar = plaintext_out;
+  int8_t fragment;
+
+  *plainchar = state_in->plainchar;
+
+  switch (state_in->step){
+    while (1){
+      case step_a:
+        do {
+          if (codechar == code_in+length_in){
+            state_in->step = step_a;
+            state_in->plainchar = *plainchar;
+            return plainchar - plaintext_out;
+          }
+          fragment = (int8_t)base64_decode_value_signed(*codechar++);
+        } while (fragment < 0);
+        *plainchar    = (fragment & 0x03f) << 2;
+      case step_b:
+        do {
+          if (codechar == code_in+length_in){
+            state_in->step = step_b;
+            state_in->plainchar = *plainchar;
+            return plainchar - plaintext_out;
+          }
+          fragment = (int8_t)base64_decode_value_signed(*codechar++);
+        } while (fragment < 0);
+        *plainchar++ |= (fragment & 0x030) >> 4;
+        *plainchar    = (fragment & 0x00f) << 4;
+      case step_c:
+        do {
+          if (codechar == code_in+length_in){
+            state_in->step = step_c;
+            state_in->plainchar = *plainchar;
+            return plainchar - plaintext_out;
+          }
+          fragment = (int8_t)base64_decode_value_signed(*codechar++);
+        } while (fragment < 0);
+        *plainchar++ |= (fragment & 0x03c) >> 2;
+        *plainchar    = (fragment & 0x003) << 6;
+      case step_d:
+        do {
+          if (codechar == code_in+length_in){
+            state_in->step = step_d;
+            state_in->plainchar = *plainchar;
+            return plainchar - plaintext_out;
+          }
+          fragment = (int8_t)base64_decode_value_signed(*codechar++);
+        } while (fragment < 0);
+        *plainchar++   |= (fragment & 0x03f);
+    }
+  }
+  /* control should not reach here */
+  return plainchar - plaintext_out;
+}
+
+static int base64_decode_chars_signed(const int8_t* code_in, const int length_in, int8_t* plaintext_out){
+  base64_decodestate _state;
+  base64_init_decodestate(&_state);
+  int len = base64_decode_block_signed(code_in, length_in, plaintext_out, &_state);
+  if(len > 0) plaintext_out[len] = 0;
+  return len;
+}
+
+int base64_decode_value(char value_in){
+  return base64_decode_value_signed(*((int8_t *) &value_in));
+}
+
+int base64_decode_block(const char* code_in, const int length_in, char* plaintext_out, base64_decodestate* state_in){
+  return base64_decode_block_signed((int8_t *) code_in, length_in, (int8_t *) plaintext_out, state_in);
+}
+
+int base64_decode_chars(const char* code_in, const int length_in, char* plaintext_out){
+  return base64_decode_chars_signed((int8_t *) code_in, length_in, (int8_t *) plaintext_out);
+}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/cdecode_8h/index.html b/ltapi/cdecode_8h/index.html new file mode 100644 index 000000000..0431f8404 --- /dev/null +++ b/ltapi/cdecode_8h/index.html @@ -0,0 +1,2525 @@ + + + + + + + + + + + + + + + + + + + + File cdecode.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

File cdecode.h

+

FileList > arduino > libraries > ext > base64 > libb64 > cdecode.h

+

Go to the source code of this file.

+

Classes

+ + + + + + + + + + + + + +
TypeName
structbase64_decodestate
+

Public Types

+ + + + + + + + + + + + + +
TypeName
enumbase64_decodestep
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
intbase64_decode_block (const char * code_in, const int length_in, char * plaintext_out, base64_decodestate * state_in)
intbase64_decode_chars (const char * code_in, const int length_in, char * plaintext_out)
intbase64_decode_value (char value_in)
voidbase64_init_decodestate (base64_decodestate * state_in)
+

Macros

+ + + + + + + + + + + + + +
TypeName
definebase64_decode_expected_len (n) ((n * 3) / 4)
+

Public Types Documentation

+

enum base64_decodestep

+
enum base64_decodestep {
+    step_a,
+    step_b,
+    step_c,
+    step_d
+};
+
+

Public Functions Documentation

+

function base64_decode_block

+
int base64_decode_block (
+    const char * code_in,
+    const int length_in,
+    char * plaintext_out,
+    base64_decodestate * state_in
+) 
+
+

function base64_decode_chars

+
int base64_decode_chars (
+    const char * code_in,
+    const int length_in,
+    char * plaintext_out
+) 
+
+

function base64_decode_value

+
int base64_decode_value (
+    char value_in
+) 
+
+

function base64_init_decodestate

+
void base64_init_decodestate (
+    base64_decodestate * state_in
+) 
+
+

Macro Definition Documentation

+

define base64_decode_expected_len

+
#define base64_decode_expected_len (
+    n
+) ((n * 3) / 4)
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/base64/libb64/cdecode.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/cdecode_8h_source/index.html b/ltapi/cdecode_8h_source/index.html new file mode 100644 index 000000000..695f4f629 --- /dev/null +++ b/ltapi/cdecode_8h_source/index.html @@ -0,0 +1,2332 @@ + + + + + + + + + + + + + + + + + + + + File cdecode.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File cdecode.h

+

File List > arduino > libraries > ext > base64 > libb64 > cdecode.h

+

Go to the documentation of this file.

+
/*
+cdecode.h - c header for a base64 decoding algorithm
+
+This is part of the libb64 project, and has been placed in the public domain.
+For details, see http://sourceforge.net/projects/libb64
+*/
+
+#ifndef BASE64_CDECODE_H
+#define BASE64_CDECODE_H
+
+#define base64_decode_expected_len(n) ((n * 3) / 4)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum {
+    step_a, step_b, step_c, step_d
+} base64_decodestep;
+
+typedef struct {
+    base64_decodestep step;
+    char plainchar;
+} base64_decodestate;
+
+void base64_init_decodestate(base64_decodestate* state_in);
+
+int base64_decode_value(char value_in);
+
+int base64_decode_block(const char* code_in, const int length_in, char* plaintext_out, base64_decodestate* state_in);
+
+int base64_decode_chars(const char* code_in, const int length_in, char* plaintext_out);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif /* BASE64_CDECODE_H */
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/cencode_8c/index.html b/ltapi/cencode_8c/index.html new file mode 100644 index 000000000..f148e6ca1 --- /dev/null +++ b/ltapi/cencode_8c/index.html @@ -0,0 +1,2424 @@ + + + + + + + + + + + + + + + + + + + + File cencode.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

File cencode.c

+

FileList > arduino > libraries > ext > base64 > libb64 > cencode.c

+

Go to the source code of this file.

+
    +
  • #include "cencode.h"
  • +
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
intbase64_encode_block (const char * plaintext_in, int length_in, char * code_out, base64_encodestate * state_in)
intbase64_encode_blockend (char * code_out, base64_encodestate * state_in)
intbase64_encode_chars (const char * plaintext_in, int length_in, char * code_out)
charbase64_encode_value (char value_in)
voidbase64_init_encodestate (base64_encodestate * state_in)
+

Public Functions Documentation

+

function base64_encode_block

+
int base64_encode_block (
+    const char * plaintext_in,
+    int length_in,
+    char * code_out,
+    base64_encodestate * state_in
+) 
+
+

function base64_encode_blockend

+
int base64_encode_blockend (
+    char * code_out,
+    base64_encodestate * state_in
+) 
+
+

function base64_encode_chars

+
int base64_encode_chars (
+    const char * plaintext_in,
+    int length_in,
+    char * code_out
+) 
+
+

function base64_encode_value

+
char base64_encode_value (
+    char value_in
+) 
+
+

function base64_init_encodestate

+
void base64_init_encodestate (
+    base64_encodestate * state_in
+) 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/base64/libb64/cencode.c

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/cencode_8c_source/index.html b/ltapi/cencode_8c_source/index.html new file mode 100644 index 000000000..12323e92a --- /dev/null +++ b/ltapi/cencode_8c_source/index.html @@ -0,0 +1,2396 @@ + + + + + + + + + + + + + + + + + + + + File cencode.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File cencode.c

+

File List > arduino > libraries > ext > base64 > libb64 > cencode.c

+

Go to the documentation of this file.

+
/*
+cencoder.c - c source to a base64 encoding algorithm implementation
+
+This is part of the libb64 project, and has been placed in the public domain.
+For details, see http://sourceforge.net/projects/libb64
+*/
+
+#include "cencode.h"
+
+void base64_init_encodestate(base64_encodestate* state_in)
+{
+    state_in->step = step_A;
+    state_in->result = 0;
+}
+
+char base64_encode_value(char value_in)
+{
+    static const char* encoding = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+    if (value_in > 63) {
+        return '=';
+    }
+    return encoding[(int)value_in];
+}
+
+int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, base64_encodestate* state_in)
+{
+    const char* plainchar = plaintext_in;
+    const char* const plaintextend = plaintext_in + length_in;
+    char* codechar = code_out;
+    char result;
+    char fragment;
+
+    result = state_in->result;
+
+    switch (state_in->step) {
+        while (1) {
+        case step_A:
+            if (plainchar == plaintextend) {
+                state_in->result = result;
+                state_in->step = step_A;
+                return codechar - code_out;
+            }
+            fragment = *plainchar++;
+            result = (fragment & 0x0fc) >> 2;
+            *codechar++ = base64_encode_value(result);
+            result = (fragment & 0x003) << 4;
+        case step_B:
+            if (plainchar == plaintextend) {
+                state_in->result = result;
+                state_in->step = step_B;
+                return codechar - code_out;
+            }
+            fragment = *plainchar++;
+            result |= (fragment & 0x0f0) >> 4;
+            *codechar++ = base64_encode_value(result);
+            result = (fragment & 0x00f) << 2;
+        case step_C:
+            if (plainchar == plaintextend) {
+                state_in->result = result;
+                state_in->step = step_C;
+                return codechar - code_out;
+            }
+            fragment = *plainchar++;
+            result |= (fragment & 0x0c0) >> 6;
+            *codechar++ = base64_encode_value(result);
+            result  = (fragment & 0x03f) >> 0;
+            *codechar++ = base64_encode_value(result);
+        }
+    }
+    /* control should not reach here */
+    return codechar - code_out;
+}
+
+int base64_encode_blockend(char* code_out, base64_encodestate* state_in)
+{
+    char* codechar = code_out;
+
+    switch (state_in->step) {
+    case step_B:
+        *codechar++ = base64_encode_value(state_in->result);
+        *codechar++ = '=';
+        *codechar++ = '=';
+        break;
+    case step_C:
+        *codechar++ = base64_encode_value(state_in->result);
+        *codechar++ = '=';
+        break;
+    case step_A:
+        break;
+    }
+    *codechar = 0x00;
+
+    return codechar - code_out;
+}
+
+int base64_encode_chars(const char* plaintext_in, int length_in, char* code_out)
+{
+    base64_encodestate _state;
+    base64_init_encodestate(&_state);
+    int len = base64_encode_block(plaintext_in, length_in, code_out, &_state);
+    return len + base64_encode_blockend((code_out + len), &_state);
+}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/cencode_8h/index.html b/ltapi/cencode_8h/index.html new file mode 100644 index 000000000..11720698f --- /dev/null +++ b/ltapi/cencode_8h/index.html @@ -0,0 +1,2541 @@ + + + + + + + + + + + + + + + + + + + + File cencode.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

File cencode.h

+

FileList > arduino > libraries > ext > base64 > libb64 > cencode.h

+

Go to the source code of this file.

+

Classes

+ + + + + + + + + + + + + +
TypeName
structbase64_encodestate
+

Public Types

+ + + + + + + + + + + + + +
TypeName
enumbase64_encodestep
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
intbase64_encode_block (const char * plaintext_in, int length_in, char * code_out, base64_encodestate * state_in)
intbase64_encode_blockend (char * code_out, base64_encodestate * state_in)
intbase64_encode_chars (const char * plaintext_in, int length_in, char * code_out)
charbase64_encode_value (char value_in)
voidbase64_init_encodestate (base64_encodestate * state_in)
+

Macros

+ + + + + + + + + + + + + +
TypeName
definebase64_encode_expected_len (n) ((((4 * n) / 3) + 3) & ~3)
+

Public Types Documentation

+

enum base64_encodestep

+
enum base64_encodestep {
+    step_A,
+    step_B,
+    step_C
+};
+
+

Public Functions Documentation

+

function base64_encode_block

+
int base64_encode_block (
+    const char * plaintext_in,
+    int length_in,
+    char * code_out,
+    base64_encodestate * state_in
+) 
+
+

function base64_encode_blockend

+
int base64_encode_blockend (
+    char * code_out,
+    base64_encodestate * state_in
+) 
+
+

function base64_encode_chars

+
int base64_encode_chars (
+    const char * plaintext_in,
+    int length_in,
+    char * code_out
+) 
+
+

function base64_encode_value

+
char base64_encode_value (
+    char value_in
+) 
+
+

function base64_init_encodestate

+
void base64_init_encodestate (
+    base64_encodestate * state_in
+) 
+
+

Macro Definition Documentation

+

define base64_encode_expected_len

+
#define base64_encode_expected_len (
+    n
+) ((((4 * n) / 3) + 3) & ~3)
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/base64/libb64/cencode.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/cencode_8h_source/index.html b/ltapi/cencode_8h_source/index.html new file mode 100644 index 000000000..a42f85f06 --- /dev/null +++ b/ltapi/cencode_8h_source/index.html @@ -0,0 +1,2335 @@ + + + + + + + + + + + + + + + + + + + + File cencode.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File cencode.h

+

File List > arduino > libraries > ext > base64 > libb64 > cencode.h

+

Go to the documentation of this file.

+
/*
+cencode.h - c header for a base64 encoding algorithm
+
+This is part of the libb64 project, and has been placed in the public domain.
+For details, see http://sourceforge.net/projects/libb64
+*/
+
+#ifndef BASE64_CENCODE_H
+#define BASE64_CENCODE_H
+
+#define base64_encode_expected_len(n) ((((4 * n) / 3) + 3) & ~3)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum {
+    step_A, step_B, step_C
+} base64_encodestep;
+
+typedef struct {
+    base64_encodestep step;
+    char result;
+    int stepcount;
+} base64_encodestate;
+
+void base64_init_encodestate(base64_encodestate* state_in);
+
+char base64_encode_value(char value_in);
+
+int base64_encode_block(const char* plaintext_in, int length_in, char* code_out, base64_encodestate* state_in);
+
+int base64_encode_blockend(char* code_out, base64_encodestate* state_in);
+
+int base64_encode_chars(const char* plaintext_in, int length_in, char* code_out);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif /* BASE64_CENCODE_H */
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/certs_8h/index.html b/ltapi/certs_8h/index.html new file mode 100644 index 000000000..be6ed888d --- /dev/null +++ b/ltapi/certs_8h/index.html @@ -0,0 +1,2298 @@ + + + + + + + + + + + + + + + + + + + + File certs.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/certs_8h_source/index.html b/ltapi/certs_8h_source/index.html new file mode 100644 index 000000000..ae7bd029d --- /dev/null +++ b/ltapi/certs_8h_source/index.html @@ -0,0 +1,2299 @@ + + + + + + + + + + + + + + + + + + + + File certs.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_esp_class/index.html b/ltapi/class_esp_class/index.html new file mode 100644 index 000000000..8f4822b97 --- /dev/null +++ b/ltapi/class_esp_class/index.html @@ -0,0 +1,2616 @@ + + + + + + + + + + + + + + + + + + + + Class EspClass - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Class EspClass

+

ClassList > EspClass

+

ESP Arduino Core compatibility class. More...

+
    +
  • #include <ESP.h>
  • +
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
boolflashEraseSector (uint32_t sector)
Erase a single block of flash (usually 4 KiB).
boolflashRead (uint32_t address, uint8_t * data, size_t size)
Read data from the flash.
boolflashWrite (uint32_t address, const uint8_t * data, size_t size)
Write data to the flash.
uint8_tgetBootMode ()
uint8_tgetBootVersion ()
uint32_tgetChipId ()
Get CPU ID based on the last three octets of MAC address. Note: the number is 24-bit (with the MSB being zero). The 3rd-to-last octet is least-significant, the last octet is most-significant.
StringgetCoreVersion ()
uint8_tgetCpuFreqMHz ()
Get CPU frequency in MHz.
uint32_tgetCycleCount ()
Get CPU cycle count.
uint32_tgetFlashChipId ()
Flash chip ID structure.
uint32_tgetFlashChipMode ()
uint32_tgetFlashChipRealSize ()
Get flash chip total size.
uint32_tgetFlashChipSize ()
Get flash chip total size.
uint32_tgetFlashChipSizeByChipId ()
Get flash chip total size.
uint8_tgetFlashChipVendorId ()
Flash chip ID structure.
uint32_tgetFreeHeap ()
Get free heap size.
StringgetFullVersion ()
uint16_tgetMaxFreeBlockSize ()
Get largest block of heap that can be allocated at once.
StringgetResetInfo ()
Get a textual representation of a reboot reason.
StringgetResetReason ()
Get a textual representation of a reboot reason.
const char *getSdkVersion ()
uint16_tgetVcc ()
uint8_t *random (uint8_t * resultArray, const size_t outputSizeBytes)
Generate random bytes using rand().
uint32_trandom ()
Generate random bytes using rand().
voidrebootIntoUartDownloadMode ()
Reboot the CPU and stay in download mode (if possible).
voidreset ()
Reboot the CPU.
voidrestart ()
Reboot the CPU.
voidwdtDisable ()
Disable the hardware watchdog.
voidwdtEnable (uint32_t timeout_ms=0)
Enable the hardware watchdog.
voidwdtFeed ()
Feed/reset the hardware watchdog timer.
+

Detailed Description

+

This class only consists of inline functions, which wrap the LibreTiny C API (lt_api.h). Refer to the docs of the C API for more information.

+

The class is accessible using the ESP global object.

+

Public Functions Documentation

+

function flashEraseSector

+

Erase a single block of flash (usually 4 KiB). +

inline bool EspClass::flashEraseSector (
+    uint32_t sector
+) 
+

+

Parameters:

+
    +
  • offset offset of the block (in bytes); must be multiple of the flash chip's block size
  • +
+

Returns:

+

whether erasing was successful

+

function flashRead

+

Read data from the flash. +

inline bool EspClass::flashRead (
+    uint32_t address,
+    uint8_t * data,
+    size_t size
+) 
+

+

Parameters:

+
    +
  • offset starting offset (in bytes)
  • +
  • data pointer to where to store the data
  • +
  • length length of data to read
  • +
+

Returns:

+

length of data successfully read (should equal 'length')

+

function flashWrite

+

Write data to the flash. +

inline bool EspClass::flashWrite (
+    uint32_t address,
+    const uint8_t * data,
+    size_t size
+) 
+

+

Parameters:

+
    +
  • offset starting offset (in bytes)
  • +
  • data pointer to data to write
  • +
  • length length of data to write
  • +
+

Returns:

+

length of data successfully written (should equal 'length')

+

function getBootMode

+
inline uint8_t EspClass::getBootMode () 
+
+

function getBootVersion

+
inline uint8_t EspClass::getBootVersion () 
+
+

function getChipId

+
inline uint32_t EspClass::getChipId () 
+
+

function getCoreVersion

+
inline String EspClass::getCoreVersion () 
+
+

function getCpuFreqMHz

+
inline uint8_t EspClass::getCpuFreqMHz () 
+
+

function getCycleCount

+
inline uint32_t EspClass::getCycleCount () 
+
+

function getFlashChipId

+
inline uint32_t EspClass::getFlashChipId () 
+
+

function getFlashChipMode

+
inline uint32_t EspClass::getFlashChipMode () 
+
+

function getFlashChipRealSize

+

Get flash chip total size. +

inline uint32_t EspClass::getFlashChipRealSize () 
+

+

The default implementation uses the least significant byte of the chip ID to determine the size.

+

function getFlashChipSize

+

Get flash chip total size. +

inline uint32_t EspClass::getFlashChipSize () 
+

+

The default implementation uses the least significant byte of the chip ID to determine the size.

+

function getFlashChipSizeByChipId

+

Get flash chip total size. +

inline uint32_t EspClass::getFlashChipSizeByChipId () 
+

+

The default implementation uses the least significant byte of the chip ID to determine the size.

+

function getFlashChipVendorId

+
inline uint8_t EspClass::getFlashChipVendorId () 
+
+

function getFreeHeap

+
inline uint32_t EspClass::getFreeHeap () 
+
+

function getFullVersion

+
inline String EspClass::getFullVersion () 
+
+

function getMaxFreeBlockSize

+
inline uint16_t EspClass::getMaxFreeBlockSize () 
+
+

function getResetInfo

+

Get a textual representation of a reboot reason. +

inline String EspClass::getResetInfo () 
+

+

Parameters:

+
    +
  • reason value to convert to text, pass 0 to read from lt_reboot_get_reason()
  • +
+

function getResetReason

+

Get a textual representation of a reboot reason. +

inline String EspClass::getResetReason () 
+

+

Parameters:

+
    +
  • reason value to convert to text, pass 0 to read from lt_reboot_get_reason()
  • +
+

function getSdkVersion

+
inline const char * EspClass::getSdkVersion () 
+
+

function getVcc

+
inline uint16_t EspClass::getVcc () 
+
+

function random [1/2]

+

Generate random bytes using rand(). +

inline uint8_t * EspClass::random (
+    uint8_t * resultArray,
+    const size_t outputSizeBytes
+) 
+

+

Parameters:

+
    +
  • buf destination pointer
  • +
  • len how many bytes to generate
  • +
+

function random [2/2]

+

Generate random bytes using rand(). +

inline uint32_t EspClass::random () 
+

+

Parameters:

+
    +
  • buf destination pointer
  • +
  • len how many bytes to generate
  • +
+

function rebootIntoUartDownloadMode

+

Reboot the CPU and stay in download mode (if possible). +

inline void EspClass::rebootIntoUartDownloadMode () 
+

+

Returns:

+

whether download-mode reboot is possible

+

function reset

+
inline void EspClass::reset () 
+
+

function restart

+
inline void EspClass::restart () 
+
+

function wdtDisable

+
inline void EspClass::wdtDisable () 
+
+

function wdtEnable

+

Enable the hardware watchdog. +

inline void EspClass::wdtEnable (
+    uint32_t timeout_ms=0
+) 
+

+

Parameters:

+
    +
  • timeout watchdog timeout, milliseconds
  • +
+

Returns:

+

whether the chip has a hardware watchdog

+

function wdtFeed

+
inline void EspClass::wdtFeed () 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/inline/ESP/ESP.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_flash_class/index.html b/ltapi/class_flash_class/index.html new file mode 100644 index 000000000..607b0d460 --- /dev/null +++ b/ltapi/class_flash_class/index.html @@ -0,0 +1,2538 @@ + + + + + + + + + + + + + + + + + + + + + + + + Flash - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Class FlashClass

+

ClassList > FlashClass

+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
booleraseSector (uint32_t offset)
Erase a single block of flash (usually 4 KiB).
FlashIdgetChipId ()
Flash chip ID structure.
uint32_tgetSize ()
Get flash chip total size.
boolreadBlock (uint32_t offset, uint8_t * data, size_t length)
Read data from the flash.
boolwriteBlock (uint32_t offset, const uint8_t * data, size_t length)
Write data to the flash.
+

Public Functions Documentation

+

function eraseSector

+

Erase a single block of flash (usually 4 KiB). +

inline bool FlashClass::eraseSector (
+    uint32_t offset
+) 
+

+

Parameters:

+
    +
  • offset offset of the block (in bytes); must be multiple of the flash chip's block size
  • +
+

Returns:

+

whether erasing was successful

+

function getChipId

+
inline FlashId FlashClass::getChipId () 
+
+

function getSize

+

Get flash chip total size. +

inline uint32_t FlashClass::getSize () 
+

+

The default implementation uses the least significant byte of the chip ID to determine the size.

+

function readBlock

+

Read data from the flash. +

inline bool FlashClass::readBlock (
+    uint32_t offset,
+    uint8_t * data,
+    size_t length
+) 
+

+

Parameters:

+
    +
  • offset starting offset (in bytes)
  • +
  • data pointer to where to store the data
  • +
  • length length of data to read
  • +
+

Returns:

+

length of data successfully read (should equal 'length')

+

function writeBlock

+

Write data to the flash. +

inline bool FlashClass::writeBlock (
+    uint32_t offset,
+    const uint8_t * data,
+    size_t length
+) 
+

+

Parameters:

+
    +
  • offset starting offset (in bytes)
  • +
  • data pointer to data to write
  • +
  • length length of data to write
  • +
+

Returns:

+

length of data successfully written (should equal 'length')

+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/inline/Flash/Flash.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_function_request_handler/index.html b/ltapi/class_function_request_handler/index.html new file mode 100644 index 000000000..578564e00 --- /dev/null +++ b/ltapi/class_function_request_handler/index.html @@ -0,0 +1,2603 @@ + + + + + + + + + + + + + + + + + + + + Class FunctionRequestHandler - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

Class FunctionRequestHandler

+

ClassList > FunctionRequestHandler

+

Inherits the following classes: RequestHandler

+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
FunctionRequestHandler (WebServer::THandlerFunction fn, WebServer::THandlerFunction ufn, const Uri & uri, HTTPMethod method)
virtual boolcanHandle (HTTPMethod requestMethod, String requestUri) override
virtual boolcanUpload (String requestUri) override
virtual boolhandle (WebServer & server, HTTPMethod requestMethod, String requestUri) override
virtual voidupload (WebServer & server, String requestUri, HTTPUpload & upload) override
~FunctionRequestHandler ()
+

Public Functions inherited from RequestHandler

+

See RequestHandler

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
virtual boolcanHandle (HTTPMethod method, String uri)
virtual boolcanUpload (String uri)
virtual boolhandle (WebServer & server, HTTPMethod requestMethod, String requestUri)
RequestHandler *next ()
voidnext (RequestHandler * r)
const String &pathArg (unsigned int i)
virtual voidupload (WebServer & server, String requestUri, HTTPUpload & upload)
virtual~RequestHandler ()
+

Protected Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
WebServer::THandlerFunction_fn
HTTPMethod_method
WebServer::THandlerFunction_ufn
Uri *_uri
+

Protected Attributes inherited from RequestHandler

+

See RequestHandler

+ + + + + + + + + + + + + +
TypeName
std::vector< String >pathArgs
+

Public Functions Documentation

+

function FunctionRequestHandler

+
inline FunctionRequestHandler::FunctionRequestHandler (
+    WebServer::THandlerFunction fn,
+    WebServer::THandlerFunction ufn,
+    const Uri & uri,
+    HTTPMethod method
+) 
+
+

function canHandle

+
inline virtual bool FunctionRequestHandler::canHandle (
+    HTTPMethod requestMethod,
+    String requestUri
+) override
+
+

Implements RequestHandler::canHandle

+

function canUpload

+
inline virtual bool FunctionRequestHandler::canUpload (
+    String requestUri
+) override
+
+

Implements RequestHandler::canUpload

+

function handle

+
inline virtual bool FunctionRequestHandler::handle (
+    WebServer & server,
+    HTTPMethod requestMethod,
+    String requestUri
+) override
+
+

Implements RequestHandler::handle

+

function upload

+
inline virtual void FunctionRequestHandler::upload (
+    WebServer & server,
+    String requestUri,
+    HTTPUpload & upload
+) override
+
+

Implements RequestHandler::upload

+

function ~FunctionRequestHandler

+
inline FunctionRequestHandler::~FunctionRequestHandler () 
+
+

Protected Attributes Documentation

+

variable _fn

+
WebServer::THandlerFunction FunctionRequestHandler::_fn;
+
+

variable _method

+
HTTPMethod FunctionRequestHandler::_method;
+
+

variable _ufn

+
WebServer::THandlerFunction FunctionRequestHandler::_ufn;
+
+

variable _uri

+
Uri* FunctionRequestHandler::_uri;
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/detail/RequestHandlersImpl.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_h_t_t_p_client/index.html b/ltapi/class_h_t_t_p_client/index.html new file mode 100644 index 000000000..45b63100f --- /dev/null +++ b/ltapi/class_h_t_t_p_client/index.html @@ -0,0 +1,4448 @@ + + + + + + + + + + + + + + + + + + + + + + + + HTTPClient - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Class HTTPClient

+

ClassList > HTTPClient

+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
intGET ()
request handling
HTTPClient ()
intPATCH (uint8_t * payload, size_t size)
intPATCH (String payload)
intPOST (uint8_t * payload, size_t size)
intPOST (String payload)
intPUT (uint8_t * payload, size_t size)
intPUT (String payload)
voidaddHeader (const String & name, const String & value, bool first=false, bool replace=true)
boolbegin (WiFiClient & client, String url)
boolbegin (WiFiClient & client, String host, uint16_t port, String uri="/", bool https=false)
boolbegin (String url)
boolbegin (String url, const char * CAcert)
boolbegin (String host, uint16_t port, String uri="/")
boolbegin (String host, uint16_t port, String uri, const char * CAcert)
boolbegin (String host, uint16_t port, String uri, const char * CAcert, const char * cli_cert, const char * cli_key)
voidclearAllCookies ()
voidcollectHeaders (const char * headerKeys, const size_t headerKeysCount)
Response handling.
boolconnected (void)
voidend (void)
const String &getLocation (void)
intgetSize (void)
WiFiClient &getStream (void)
WiFiClient *getStreamPtr (void)
boolhasHeader (const char * name)
Stringheader (const char * name)
Stringheader (size_t i)
StringheaderName (size_t i)
intheaders ()
voidresetCookieJar ()
intsendRequest (const char * type, String payload)
intsendRequest (const char * type, uint8_t * payload=NULL, size_t size=0)
intsendRequest (const char * type, Stream * stream, size_t size=0)
voidsetAuthorization (const char * user, const char * password)
voidsetAuthorization (const char * auth)
voidsetAuthorizationType (const char * authType)
voidsetConnectTimeout (int32_t connectTimeout)
voidsetCookieJar (CookieJar * cookieJar)
Cookie jar support.
voidsetFollowRedirects (followRedirects_t follow)
voidsetRedirectLimit (uint16_t limit)
voidsetReuse (bool reuse)
voidsetTimeout (uint16_t timeout)
boolsetURL (const String & url)
voidsetUserAgent (const String & userAgent)
keep-alive
voiduseHTTP10 (bool usehttp10=true)
intwriteToStream (Stream * stream)
~HTTPClient ()
+

Public Static Functions

+ + + + + + + + + + + + + +
TypeName
StringerrorToString (int error)
+

Protected Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
String_authorizationType = = "Basic"
String_base64Authorization
bool_canReuse = = false
WiFiClient *_client = = nullptr
int32_t_connectTimeout = = -1
CookieJar *_cookieJar = = nullptr
Cookie jar support.
RequestArgument *_currentHeaders = = nullptr
Response handling.
followRedirects_t_followRedirects = = HTTPC_DISABLE_FOLLOW_REDIRECTS
size_t_headerKeysCount = = 0
String_headers
String_host
request handling
String_location
uint16_t_port = = 0
String_protocol
uint16_t_redirectLimit = = 10
int_returnCode = = 0
bool_reuse = = true
bool_secure = = false
int_size = = -1
std::unique_ptr< WiFiClient >_tcpDeprecated
uint16_t_tcpTimeout = = HTTPCLIENT_DEFAULT_TCP_TIMEOUT
transferEncoding_t_transferEncoding = = HTTPC_TE_IDENTITY
TransportTraitsPtr_transportTraits
String_uri
bool_useHTTP10 = = false
String_userAgent = = "ESP32HTTPClient"
+

Protected Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
boolbeginInternal (String url, const char * expectedProtocol)
voidclear ()
boolconnect (void)
voiddisconnect (bool preserveClient=false)
boolgenerateCookieString (String * cookieString)
inthandleHeaderResponse ()
intreturnError (int error)
boolsendHeader (const char * type)
voidsetCookie (String date, String headerValue)
Cookie jar support.
intwriteToStreamDataBlock (Stream * stream, int len)
+

Public Functions Documentation

+

function GET

+
int HTTPClient::GET () 
+
+

function HTTPClient

+
HTTPClient::HTTPClient () 
+
+

function PATCH [1/2]

+
int HTTPClient::PATCH (
+    uint8_t * payload,
+    size_t size
+) 
+
+

function PATCH [2/2]

+
int HTTPClient::PATCH (
+    String payload
+) 
+
+

function POST [1/2]

+
int HTTPClient::POST (
+    uint8_t * payload,
+    size_t size
+) 
+
+

function POST [2/2]

+
int HTTPClient::POST (
+    String payload
+) 
+
+

function PUT [1/2]

+
int HTTPClient::PUT (
+    uint8_t * payload,
+    size_t size
+) 
+
+

function PUT [2/2]

+
int HTTPClient::PUT (
+    String payload
+) 
+
+

function addHeader

+
void HTTPClient::addHeader (
+    const String & name,
+    const String & value,
+    bool first=false,
+    bool replace=true
+) 
+
+

function begin [1/7]

+
bool HTTPClient::begin (
+    WiFiClient & client,
+    String url
+) 
+
+

function begin [2/7]

+
bool HTTPClient::begin (
+    WiFiClient & client,
+    String host,
+    uint16_t port,
+    String uri="/",
+    bool https=false
+) 
+
+

function begin [3/7]

+
bool HTTPClient::begin (
+    String url
+) 
+
+

function begin [4/7]

+
bool HTTPClient::begin (
+    String url,
+    const char * CAcert
+) 
+
+

function begin [5/7]

+
bool HTTPClient::begin (
+    String host,
+    uint16_t port,
+    String uri="/"
+) 
+
+

function begin [6/7]

+
bool HTTPClient::begin (
+    String host,
+    uint16_t port,
+    String uri,
+    const char * CAcert
+) 
+
+

function begin [7/7]

+
bool HTTPClient::begin (
+    String host,
+    uint16_t port,
+    String uri,
+    const char * CAcert,
+    const char * cli_cert,
+    const char * cli_key
+) 
+
+

function clearAllCookies

+
void HTTPClient::clearAllCookies () 
+
+

function collectHeaders

+
void HTTPClient::collectHeaders (
+    const char * headerKeys,
+    const size_t headerKeysCount
+) 
+
+

function connected

+
bool HTTPClient::connected (
+    void
+) 
+
+

function end

+
void HTTPClient::end (
+    void
+) 
+
+

function getLocation

+
const String & HTTPClient::getLocation (
+    void
+) 
+
+

function getSize

+
int HTTPClient::getSize (
+    void
+) 
+
+

function getStream

+
WiFiClient & HTTPClient::getStream (
+    void
+) 
+
+

function getStreamPtr

+
WiFiClient * HTTPClient::getStreamPtr (
+    void
+) 
+
+

function hasHeader

+
bool HTTPClient::hasHeader (
+    const char * name
+) 
+
+

function header [1/2]

+
String HTTPClient::header (
+    const char * name
+) 
+
+

function header [2/2]

+
String HTTPClient::header (
+    size_t i
+) 
+
+

function headerName

+
String HTTPClient::headerName (
+    size_t i
+) 
+
+

function headers

+
int HTTPClient::headers () 
+
+

function resetCookieJar

+
void HTTPClient::resetCookieJar () 
+
+

function sendRequest [1/3]

+
int HTTPClient::sendRequest (
+    const char * type,
+    String payload
+) 
+
+

function sendRequest [2/3]

+
int HTTPClient::sendRequest (
+    const char * type,
+    uint8_t * payload=NULL,
+    size_t size=0
+) 
+
+

function sendRequest [3/3]

+
int HTTPClient::sendRequest (
+    const char * type,
+    Stream * stream,
+    size_t size=0
+) 
+
+

function setAuthorization [1/2]

+
void HTTPClient::setAuthorization (
+    const char * user,
+    const char * password
+) 
+
+

function setAuthorization [2/2]

+
void HTTPClient::setAuthorization (
+    const char * auth
+) 
+
+

function setAuthorizationType

+
void HTTPClient::setAuthorizationType (
+    const char * authType
+) 
+
+

function setConnectTimeout

+
void HTTPClient::setConnectTimeout (
+    int32_t connectTimeout
+) 
+
+

function setCookieJar

+
void HTTPClient::setCookieJar (
+    CookieJar * cookieJar
+) 
+
+

function setFollowRedirects

+
void HTTPClient::setFollowRedirects (
+    followRedirects_t follow
+) 
+
+

function setRedirectLimit

+
void HTTPClient::setRedirectLimit (
+    uint16_t limit
+) 
+
+

function setReuse

+
void HTTPClient::setReuse (
+    bool reuse
+) 
+
+

function setTimeout

+
void HTTPClient::setTimeout (
+    uint16_t timeout
+) 
+
+

function setURL

+
bool HTTPClient::setURL (
+    const String & url
+) 
+
+

function setUserAgent

+
void HTTPClient::setUserAgent (
+    const String & userAgent
+) 
+
+

function useHTTP10

+
void HTTPClient::useHTTP10 (
+    bool usehttp10=true
+) 
+
+

function writeToStream

+
int HTTPClient::writeToStream (
+    Stream * stream
+) 
+
+

function ~HTTPClient

+
HTTPClient::~HTTPClient () 
+
+

Public Static Functions Documentation

+

function errorToString

+
static String HTTPClient::errorToString (
+    int error
+) 
+
+

Protected Attributes Documentation

+

variable _authorizationType

+
String HTTPClient::_authorizationType;
+
+

variable _base64Authorization

+
String HTTPClient::_base64Authorization;
+
+

variable _canReuse

+
bool HTTPClient::_canReuse;
+
+

variable _client

+
WiFiClient* HTTPClient::_client;
+
+

variable _connectTimeout

+
int32_t HTTPClient::_connectTimeout;
+
+

variable _cookieJar

+
CookieJar* HTTPClient::_cookieJar;
+
+

variable _currentHeaders

+
RequestArgument* HTTPClient::_currentHeaders;
+
+

variable _followRedirects

+
followRedirects_t HTTPClient::_followRedirects;
+
+

variable _headerKeysCount

+
size_t HTTPClient::_headerKeysCount;
+
+

variable _headers

+
String HTTPClient::_headers;
+
+

variable _host

+
String HTTPClient::_host;
+
+

variable _location

+
String HTTPClient::_location;
+
+

variable _port

+
uint16_t HTTPClient::_port;
+
+

variable _protocol

+
String HTTPClient::_protocol;
+
+

variable _redirectLimit

+
uint16_t HTTPClient::_redirectLimit;
+
+

variable _returnCode

+
int HTTPClient::_returnCode;
+
+

variable _reuse

+
bool HTTPClient::_reuse;
+
+

variable _secure

+
bool HTTPClient::_secure;
+
+

variable _size

+
int HTTPClient::_size;
+
+

variable _tcpDeprecated

+
std::unique_ptr<WiFiClient> HTTPClient::_tcpDeprecated;
+
+

variable _tcpTimeout

+
uint16_t HTTPClient::_tcpTimeout;
+
+

variable _transferEncoding

+
transferEncoding_t HTTPClient::_transferEncoding;
+
+

variable _transportTraits

+
TransportTraitsPtr HTTPClient::_transportTraits;
+
+

variable _uri

+
String HTTPClient::_uri;
+
+

variable _useHTTP10

+
bool HTTPClient::_useHTTP10;
+
+

variable _userAgent

+
String HTTPClient::_userAgent;
+
+

Protected Functions Documentation

+

function beginInternal

+
bool HTTPClient::beginInternal (
+    String url,
+    const char * expectedProtocol
+) 
+
+

function clear

+
void HTTPClient::clear () 
+
+

function connect

+
bool HTTPClient::connect (
+    void
+) 
+
+

function disconnect

+
void HTTPClient::disconnect (
+    bool preserveClient=false
+) 
+
+

function generateCookieString

+
bool HTTPClient::generateCookieString (
+    String * cookieString
+) 
+
+

function handleHeaderResponse

+
int HTTPClient::handleHeaderResponse () 
+
+

function returnError

+
int HTTPClient::returnError (
+    int error
+) 
+
+

function sendHeader

+
bool HTTPClient::sendHeader (
+    const char * type
+) 
+
+

function setCookie

+
void HTTPClient::setCookie (
+    String date,
+    String headerValue
+) 
+
+

function writeToStreamDataBlock

+
int HTTPClient::writeToStreamDataBlock (
+    Stream * stream,
+    int len
+) 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/HTTPClient/HTTPClient.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_hardware_i2_c/index.html b/ltapi/class_hardware_i2_c/index.html new file mode 100644 index 000000000..613b859b2 --- /dev/null +++ b/ltapi/class_hardware_i2_c/index.html @@ -0,0 +1,2767 @@ + + + + + + + + + + + + + + + + + + + + Class HardwareI2C - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

Class HardwareI2C

+

ClassList > HardwareI2C

+

Inherits the following classes: Stream

+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
virtual intavailable () = 0
boolbegin ()
boolbegin (uint8_t address)
virtual boolbegin (int8_t sda, int8_t scl, uint32_t frequency=0) = 0
virtual boolbegin (uint8_t address, int8_t sda, int8_t scl, uint32_t frequency=0) = 0
virtual voidbeginTransmission (uint8_t address) = 0
virtual boolend () = 0
virtual uint8_tendTransmission (bool stopBit) = 0
uint8_tendTransmission ()
virtual voidflush () = 0
uint32_tgetClock ()
voidonReceive (void(*)(int) cb)
voidonRequest (void(*)(void) cb)
virtual intpeek () = 0
virtual intread () = 0
virtual size_trequestFrom (uint8_t address, size_t len, bool stopBit) = 0
size_trequestFrom (uint8_t address, size_t len)
virtual boolsetClock (uint32_t freq) = 0
virtual boolsetPins (int8_t sda, int8_t scl) = 0
virtual size_twrite (const uint8_t * data, size_t len) = 0
virtual size_twrite (uint8_t data)
+

Protected Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
uint32_t_freq = = 0
int8_t_scl = = -1
int8_t_sda = = -1
void(*onReceiveCallback
void(*onRequestCallback
+

Public Functions Documentation

+

function available

+
virtual int HardwareI2C::available () = 0
+
+

function begin [1/4]

+
inline bool HardwareI2C::begin () 
+
+

function begin [2/4]

+
inline bool HardwareI2C::begin (
+    uint8_t address
+) 
+
+

function begin [3/4]

+
virtual bool HardwareI2C::begin (
+    int8_t sda,
+    int8_t scl,
+    uint32_t frequency=0
+) = 0
+
+

function begin [4/4]

+
virtual bool HardwareI2C::begin (
+    uint8_t address,
+    int8_t sda,
+    int8_t scl,
+    uint32_t frequency=0
+) = 0
+
+

function beginTransmission

+
virtual void HardwareI2C::beginTransmission (
+    uint8_t address
+) = 0
+
+

function end

+
virtual bool HardwareI2C::end () = 0
+
+

function endTransmission [1/2]

+
virtual uint8_t HardwareI2C::endTransmission (
+    bool stopBit
+) = 0
+
+

function endTransmission [2/2]

+
inline uint8_t HardwareI2C::endTransmission () 
+
+

function flush

+
virtual void HardwareI2C::flush () = 0
+
+

function getClock

+
inline uint32_t HardwareI2C::getClock () 
+
+

function onReceive

+
inline void HardwareI2C::onReceive (
+    void(*)(int) cb
+) 
+
+

function onRequest

+
inline void HardwareI2C::onRequest (
+    void(*)(void) cb
+) 
+
+

function peek

+
virtual int HardwareI2C::peek () = 0
+
+

function read

+
virtual int HardwareI2C::read () = 0
+
+

function requestFrom [1/2]

+
virtual size_t HardwareI2C::requestFrom (
+    uint8_t address,
+    size_t len,
+    bool stopBit
+) = 0
+
+

function requestFrom [2/2]

+
inline size_t HardwareI2C::requestFrom (
+    uint8_t address,
+    size_t len
+) 
+
+

function setClock

+
virtual bool HardwareI2C::setClock (
+    uint32_t freq
+) = 0
+
+

function setPins

+
virtual bool HardwareI2C::setPins (
+    int8_t sda,
+    int8_t scl
+) = 0
+
+

function write [1/2]

+
virtual size_t HardwareI2C::write (
+    const uint8_t * data,
+    size_t len
+) = 0
+
+

function write [2/2]

+
inline virtual size_t HardwareI2C::write (
+    uint8_t data
+) 
+
+

Protected Attributes Documentation

+

variable _freq

+
uint32_t HardwareI2C::_freq;
+
+

variable _scl

+
int8_t HardwareI2C::_scl;
+
+

variable _sda

+
int8_t HardwareI2C::_sda;
+
+

variable onReceiveCallback

+
void(* HardwareI2C::onReceiveCallback) (int);
+
+

variable onRequestCallback

+
void(* HardwareI2C::onRequestCallback) (void);
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/src/HardwareI2C.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_i_preferences/index.html b/ltapi/class_i_preferences/index.html new file mode 100644 index 000000000..79fcd4d6b --- /dev/null +++ b/ltapi/class_i_preferences/index.html @@ -0,0 +1,3033 @@ + + + + + + + + + + + + + + + + + + + + Class IPreferences - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Class IPreferences

+

ClassList > IPreferences

+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
IPreferences ()
boolbegin (const char * name, bool readOnly=false, const char * partition_label=NULL)
boolclear ()
voidend ()
size_tfreeEntries ()
boolgetBool (const char * key, bool defaultValue=false)
size_tgetBytes (const char * key, void * buf, size_t maxLen)
size_tgetBytesLength (const char * key)
int8_tgetChar (const char * key, int8_t defaultValue=0)
double_tgetDouble (const char * key, double_t defaultValue=NAN)
float_tgetFloat (const char * key, float_t defaultValue=NAN)
int32_tgetInt (const char * key, int32_t defaultValue=0)
int32_tgetLong (const char * key, int32_t defaultValue=0)
int64_tgetLong64 (const char * key, int64_t defaultValue=0)
int16_tgetShort (const char * key, int16_t defaultValue=0)
size_tgetString (const char * key, char * value, size_t maxLen)
StringgetString (const char * key, String defaultValue=String())
PreferenceTypegetType (const char * key)
uint8_tgetUChar (const char * key, uint8_t defaultValue=0)
uint32_tgetUInt (const char * key, uint32_t defaultValue=0)
uint32_tgetULong (const char * key, uint32_t defaultValue=0)
uint64_tgetULong64 (const char * key, uint64_t defaultValue=0)
uint16_tgetUShort (const char * key, uint16_t defaultValue=0)
boolisKey (const char * key)
size_tputBool (const char * key, bool value)
size_tputBytes (const char * key, const void * value, size_t len)
size_tputChar (const char * key, int8_t value)
size_tputDouble (const char * key, double_t value)
size_tputFloat (const char * key, float_t value)
size_tputInt (const char * key, int32_t value)
size_tputLong (const char * key, int32_t value)
size_tputLong64 (const char * key, int64_t value)
size_tputShort (const char * key, int16_t value)
size_tputString (const char * key, const char * value)
size_tputString (const char * key, String value)
size_tputUChar (const char * key, uint8_t value)
size_tputUInt (const char * key, uint32_t value)
size_tputULong (const char * key, uint32_t value)
size_tputULong64 (const char * key, uint64_t value)
size_tputUShort (const char * key, uint16_t value)
boolremove (const char * key)
~IPreferences ()
+

Public Functions Documentation

+

function IPreferences

+
inline IPreferences::IPreferences () 
+
+

function begin

+
bool IPreferences::begin (
+    const char * name,
+    bool readOnly=false,
+    const char * partition_label=NULL
+) 
+
+

function clear

+
bool IPreferences::clear () 
+
+

function end

+
void IPreferences::end () 
+
+

function freeEntries

+
size_t IPreferences::freeEntries () 
+
+

function getBool

+
bool IPreferences::getBool (
+    const char * key,
+    bool defaultValue=false
+) 
+
+

function getBytes

+
size_t IPreferences::getBytes (
+    const char * key,
+    void * buf,
+    size_t maxLen
+) 
+
+

function getBytesLength

+
size_t IPreferences::getBytesLength (
+    const char * key
+) 
+
+

function getChar

+
int8_t IPreferences::getChar (
+    const char * key,
+    int8_t defaultValue=0
+) 
+
+

function getDouble

+
double_t IPreferences::getDouble (
+    const char * key,
+    double_t defaultValue=NAN
+) 
+
+

function getFloat

+
float_t IPreferences::getFloat (
+    const char * key,
+    float_t defaultValue=NAN
+) 
+
+

function getInt

+
int32_t IPreferences::getInt (
+    const char * key,
+    int32_t defaultValue=0
+) 
+
+

function getLong

+
int32_t IPreferences::getLong (
+    const char * key,
+    int32_t defaultValue=0
+) 
+
+

function getLong64

+
int64_t IPreferences::getLong64 (
+    const char * key,
+    int64_t defaultValue=0
+) 
+
+

function getShort

+
int16_t IPreferences::getShort (
+    const char * key,
+    int16_t defaultValue=0
+) 
+
+

function getString [1/2]

+
size_t IPreferences::getString (
+    const char * key,
+    char * value,
+    size_t maxLen
+) 
+
+

function getString [2/2]

+
String IPreferences::getString (
+    const char * key,
+    String defaultValue=String()
+) 
+
+

function getType

+
PreferenceType IPreferences::getType (
+    const char * key
+) 
+
+

function getUChar

+
uint8_t IPreferences::getUChar (
+    const char * key,
+    uint8_t defaultValue=0
+) 
+
+

function getUInt

+
uint32_t IPreferences::getUInt (
+    const char * key,
+    uint32_t defaultValue=0
+) 
+
+

function getULong

+
uint32_t IPreferences::getULong (
+    const char * key,
+    uint32_t defaultValue=0
+) 
+
+

function getULong64

+
uint64_t IPreferences::getULong64 (
+    const char * key,
+    uint64_t defaultValue=0
+) 
+
+

function getUShort

+
uint16_t IPreferences::getUShort (
+    const char * key,
+    uint16_t defaultValue=0
+) 
+
+

function isKey

+
bool IPreferences::isKey (
+    const char * key
+) 
+
+

function putBool

+
size_t IPreferences::putBool (
+    const char * key,
+    bool value
+) 
+
+

function putBytes

+
size_t IPreferences::putBytes (
+    const char * key,
+    const void * value,
+    size_t len
+) 
+
+

function putChar

+
size_t IPreferences::putChar (
+    const char * key,
+    int8_t value
+) 
+
+

function putDouble

+
size_t IPreferences::putDouble (
+    const char * key,
+    double_t value
+) 
+
+

function putFloat

+
size_t IPreferences::putFloat (
+    const char * key,
+    float_t value
+) 
+
+

function putInt

+
size_t IPreferences::putInt (
+    const char * key,
+    int32_t value
+) 
+
+

function putLong

+
size_t IPreferences::putLong (
+    const char * key,
+    int32_t value
+) 
+
+

function putLong64

+
size_t IPreferences::putLong64 (
+    const char * key,
+    int64_t value
+) 
+
+

function putShort

+
size_t IPreferences::putShort (
+    const char * key,
+    int16_t value
+) 
+
+

function putString [1/2]

+
size_t IPreferences::putString (
+    const char * key,
+    const char * value
+) 
+
+

function putString [2/2]

+
size_t IPreferences::putString (
+    const char * key,
+    String value
+) 
+
+

function putUChar

+
size_t IPreferences::putUChar (
+    const char * key,
+    uint8_t value
+) 
+
+

function putUInt

+
size_t IPreferences::putUInt (
+    const char * key,
+    uint32_t value
+) 
+
+

function putULong

+
size_t IPreferences::putULong (
+    const char * key,
+    uint32_t value
+) 
+
+

function putULong64

+
size_t IPreferences::putULong64 (
+    const char * key,
+    uint64_t value
+) 
+
+

function putUShort

+
size_t IPreferences::putUShort (
+    const char * key,
+    uint16_t value
+) 
+
+

function remove

+
bool IPreferences::remove (
+    const char * key
+) 
+
+

function ~IPreferences

+
inline IPreferences::~IPreferences () 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/Preferences/Preferences.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_i_wi_fi_client/index.html b/ltapi/class_i_wi_fi_client/index.html new file mode 100644 index 000000000..6522be1ae --- /dev/null +++ b/ltapi/class_i_wi_fi_client/index.html @@ -0,0 +1,2914 @@ + + + + + + + + + + + + + + + + + + + + + + + + WiFiClient - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

Class IWiFiClient

+

ClassList > IWiFiClient

+

Inherits the following classes: Client

+

Inherited by the following classes: LwIPClient

+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
IWiFiClient ()
IWiFiClient (int sock)
virtual intconnect (IPAddress ip, uint16_t port, int32_t timeout) = 0
virtual intconnect (const char * host, uint16_t port, int32_t timeout) = 0
virtual intfd () const = 0
virtual IPAddresslocalIP () const = 0
virtual IPAddresslocalIP (int sock) const = 0
virtual uint16_tlocalPort () const = 0
virtual uint16_tlocalPort (int sock) const = 0
operator bool ()
virtual booloperator!= (const bool value)
virtual booloperator!= (const IWiFiClient & other)
booloperator== (const IWiFiClient & other) const
virtual booloperator== (const bool value)
virtual IPAddressremoteIP () const = 0
virtual IPAddressremoteIP (int sock) const = 0
virtual uint16_tremotePort () const = 0
virtual uint16_tremotePort (int sock) const = 0
virtual intsetTimeout (uint32_t seconds) = 0
virtual intsocket () = 0
virtual size_twrite (Stream & stream) = 0
size_twrite_P (PGM_P buffer, size_t size)
~IWiFiClient ()
+

Public Functions Documentation

+

function IWiFiClient [1/2]

+
inline IWiFiClient::IWiFiClient () 
+
+

function IWiFiClient [2/2]

+
inline IWiFiClient::IWiFiClient (
+    int sock
+) 
+
+

function connect [1/2]

+
virtual int IWiFiClient::connect (
+    IPAddress ip,
+    uint16_t port,
+    int32_t timeout
+) = 0
+
+

function connect [2/2]

+
virtual int IWiFiClient::connect (
+    const char * host,
+    uint16_t port,
+    int32_t timeout
+) = 0
+
+

function fd

+
virtual int IWiFiClient::fd () const = 0
+
+

function localIP [1/2]

+
virtual IPAddress IWiFiClient::localIP () const = 0
+
+

function localIP [2/2]

+
virtual IPAddress IWiFiClient::localIP (
+    int sock
+) const = 0
+
+

function localPort [1/2]

+
virtual uint16_t IWiFiClient::localPort () const = 0
+
+

function localPort [2/2]

+
virtual uint16_t IWiFiClient::localPort (
+    int sock
+) const = 0
+
+

function operator bool

+
inline IWiFiClient::operator bool () 
+
+

function operator!=

+
inline virtual bool IWiFiClient::operator!= (
+    const bool value
+) 
+
+

function operator!=

+
inline virtual bool IWiFiClient::operator!= (
+    const IWiFiClient & other
+) 
+
+

function operator==

+
bool IWiFiClient::operator== (
+    const IWiFiClient & other
+) const
+
+

function operator==

+
inline virtual bool IWiFiClient::operator== (
+    const bool value
+) 
+
+

function remoteIP [1/2]

+
virtual IPAddress IWiFiClient::remoteIP () const = 0
+
+

function remoteIP [2/2]

+
virtual IPAddress IWiFiClient::remoteIP (
+    int sock
+) const = 0
+
+

function remotePort [1/2]

+
virtual uint16_t IWiFiClient::remotePort () const = 0
+
+

function remotePort [2/2]

+
virtual uint16_t IWiFiClient::remotePort (
+    int sock
+) const = 0
+
+

function setTimeout

+
virtual int IWiFiClient::setTimeout (
+    uint32_t seconds
+) = 0
+
+

function socket

+
virtual int IWiFiClient::socket () = 0
+
+

function write

+
virtual size_t IWiFiClient::write (
+    Stream & stream
+) = 0
+
+

function write_P

+
inline size_t IWiFiClient::write_P (
+    PGM_P buffer,
+    size_t size
+) 
+
+

function ~IWiFiClient

+
inline IWiFiClient::~IWiFiClient () 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiClient/WiFiClient.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_i_wi_fi_client_secure/index.html b/ltapi/class_i_wi_fi_client_secure/index.html new file mode 100644 index 000000000..bfa8cdd74 --- /dev/null +++ b/ltapi/class_i_wi_fi_client_secure/index.html @@ -0,0 +1,2806 @@ + + + + + + + + + + + + + + + + + + + + + + + + WiFiClientSecure - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

Class IWiFiClientSecure

+

ClassList > IWiFiClientSecure

+

Inherited by the following classes: MbedTLSClient

+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
virtual intconnect (IPAddress ip, uint16_t port, const char * rootCABuf, const char * clientCert, const char * clientKey) = 0
virtual intconnect (const char * host, uint16_t port, const char * rootCABuf, const char * clientCert, const char * clientKey) = 0
virtual intconnect (IPAddress ip, uint16_t port, const char * pskIdent, const char * psk) = 0
virtual intconnect (const char * host, uint16_t port, const char * pskIdent, const char * psk) = 0
virtual boolgetFingerprintSHA256 (uint8_t result) = 0
virtual intlastError (char * buf, const size_t size) = 0
virtual boolloadCACert (Stream & stream, size_t size) = 0
virtual boolloadCertificate (Stream & stream, size_t size) = 0
virtual boolloadPrivateKey (Stream & stream, size_t size) = 0
virtual voidsetAlpnProtocols (const char ** alpnProtocols) = 0
virtual voidsetCACert (const char * rootCA) = 0
virtual voidsetCertificate (const char * clientCA) = 0
virtual voidsetHandshakeTimeout (unsigned long handshakeTimeout) = 0
virtual voidsetInsecure () = 0
virtual voidsetPreSharedKey (const char * pskIdent, const char * psk) = 0
virtual voidsetPrivateKey (const char * privateKey) = 0
virtual boolverify (const char * fingerprint, const char * domainName) = 0
+

Public Functions Documentation

+

function connect [1/4]

+
virtual int IWiFiClientSecure::connect (
+    IPAddress ip,
+    uint16_t port,
+    const char * rootCABuf,
+    const char * clientCert,
+    const char * clientKey
+) = 0
+
+

function connect [2/4]

+
virtual int IWiFiClientSecure::connect (
+    const char * host,
+    uint16_t port,
+    const char * rootCABuf,
+    const char * clientCert,
+    const char * clientKey
+) = 0
+
+

function connect [3/4]

+
virtual int IWiFiClientSecure::connect (
+    IPAddress ip,
+    uint16_t port,
+    const char * pskIdent,
+    const char * psk
+) = 0
+
+

function connect [4/4]

+
virtual int IWiFiClientSecure::connect (
+    const char * host,
+    uint16_t port,
+    const char * pskIdent,
+    const char * psk
+) = 0
+
+

function getFingerprintSHA256

+
virtual bool IWiFiClientSecure::getFingerprintSHA256 (
+    uint8_t result
+) = 0
+
+

function lastError

+
virtual int IWiFiClientSecure::lastError (
+    char * buf,
+    const size_t size
+) = 0
+
+

function loadCACert

+
virtual bool IWiFiClientSecure::loadCACert (
+    Stream & stream,
+    size_t size
+) = 0
+
+

function loadCertificate

+
virtual bool IWiFiClientSecure::loadCertificate (
+    Stream & stream,
+    size_t size
+) = 0
+
+

function loadPrivateKey

+
virtual bool IWiFiClientSecure::loadPrivateKey (
+    Stream & stream,
+    size_t size
+) = 0
+
+

function setAlpnProtocols

+
virtual void IWiFiClientSecure::setAlpnProtocols (
+    const char ** alpnProtocols
+) = 0
+
+

function setCACert

+
virtual void IWiFiClientSecure::setCACert (
+    const char * rootCA
+) = 0
+
+

function setCertificate

+
virtual void IWiFiClientSecure::setCertificate (
+    const char * clientCA
+) = 0
+
+

function setHandshakeTimeout

+
virtual void IWiFiClientSecure::setHandshakeTimeout (
+    unsigned long handshakeTimeout
+) = 0
+
+

function setInsecure

+
virtual void IWiFiClientSecure::setInsecure () = 0
+
+

function setPreSharedKey

+
virtual void IWiFiClientSecure::setPreSharedKey (
+    const char * pskIdent,
+    const char * psk
+) = 0
+
+

function setPrivateKey

+
virtual void IWiFiClientSecure::setPrivateKey (
+    const char * privateKey
+) = 0
+
+

function verify

+
virtual bool IWiFiClientSecure::verify (
+    const char * fingerprint,
+    const char * domainName
+) = 0
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiClient/WiFiClientSecure.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_i_wi_fi_server/index.html b/ltapi/class_i_wi_fi_server/index.html new file mode 100644 index 000000000..648c0053f --- /dev/null +++ b/ltapi/class_i_wi_fi_server/index.html @@ -0,0 +1,2771 @@ + + + + + + + + + + + + + + + + + + + + + + + + WiFiServer - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

Class IWiFiServer

+

template <typename TWiFiClient typename TWiFiClient, typename typename>

+

ClassList > IWiFiServer

+

Inherits the following classes: Print

+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
IWiFiServer (uint16_t port=80, uint8_t maxClients=4)
IWiFiServer (const IPAddress & addr, uint16_t port=80, uint8_t maxClients=4)
virtual TWiFiClientaccept () = 0
TWiFiClientavailable ()
virtual boolbegin (uint16_t port=0, bool reuseAddr=true) = 0
voidclose ()
virtual voidend () = 0
virtual boolgetNoDelay () = 0
virtual boolhasClient () = 0
voidlistenOnLocalhost ()
virtualoperator bool () = 0
virtual voidsetNoDelay (bool noDelay) = 0
virtual intsetTimeout (uint32_t seconds) = 0
voidstop ()
virtual voidstopAll () = 0
size_twrite (uint8_t data)
~IWiFiServer ()
+

Public Functions Documentation

+

function IWiFiServer [1/2]

+
inline IWiFiServer::IWiFiServer (
+    uint16_t port=80,
+    uint8_t maxClients=4
+) 
+
+

function IWiFiServer [2/2]

+
inline IWiFiServer::IWiFiServer (
+    const IPAddress & addr,
+    uint16_t port=80,
+    uint8_t maxClients=4
+) 
+
+

function accept

+
virtual TWiFiClient IWiFiServer::accept () = 0
+
+

function available

+
inline TWiFiClient IWiFiServer::available () 
+
+

function begin

+
virtual bool IWiFiServer::begin (
+    uint16_t port=0,
+    bool reuseAddr=true
+) = 0
+
+

function close

+
inline void IWiFiServer::close () 
+
+

function end

+
virtual void IWiFiServer::end () = 0
+
+

function getNoDelay

+
virtual bool IWiFiServer::getNoDelay () = 0
+
+

function hasClient

+
virtual bool IWiFiServer::hasClient () = 0
+
+

function listenOnLocalhost

+
inline void IWiFiServer::listenOnLocalhost () 
+
+

function operator bool

+
virtual IWiFiServer::operator bool () = 0
+
+

function setNoDelay

+
virtual void IWiFiServer::setNoDelay (
+    bool noDelay
+) = 0
+
+

function setTimeout

+
virtual int IWiFiServer::setTimeout (
+    uint32_t seconds
+) = 0
+
+

function stop

+
inline void IWiFiServer::stop () 
+
+

function stopAll

+
virtual void IWiFiServer::stopAll () = 0
+
+

function write

+
inline size_t IWiFiServer::write (
+    uint8_t data
+) 
+
+

function ~IWiFiServer

+
inline IWiFiServer::~IWiFiServer () 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiServer/WiFiServer.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_i_wi_fi_u_d_p/index.html b/ltapi/class_i_wi_fi_u_d_p/index.html new file mode 100644 index 000000000..dc2822628 --- /dev/null +++ b/ltapi/class_i_wi_fi_u_d_p/index.html @@ -0,0 +1,2885 @@ + + + + + + + + + + + + + + + + + + + + + + + + WiFiUDP - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

Class IWiFiUDP

+

ClassList > IWiFiUDP

+

Inherits the following classes: UDP

+

Inherited by the following classes: LwIPUDP

+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
IWiFiUDP ()
virtual intavailable () = 0
virtual uint8_tbegin (IPAddress ip, uint16_t port) = 0
virtual uint8_tbegin (uint16_t port) = 0
virtual uint8_tbeginMulticast (IPAddress ip, uint16_t port) = 0
virtual intbeginMulticastPacket () = 0
virtual intbeginPacket () = 0
virtual intbeginPacket (IPAddress ip, uint16_t port) = 0
virtual intbeginPacket (const char * host, uint16_t port) = 0
virtual intendPacket () = 0
virtual voidflush () = 0
virtual intparsePacket () = 0
virtual intpeek () = 0
virtual intread () = 0
virtual intread (unsigned char * buffer, size_t len) = 0
virtual intread (char * buffer, size_t len) = 0
virtual IPAddressremoteIP () = 0
virtual uint16_tremotePort () = 0
virtual voidstop () = 0
virtual size_twrite (uint8_t) = 0
virtual size_twrite (const uint8_t * buffer, size_t size) = 0
~IWiFiUDP ()
+

Public Functions Documentation

+

function IWiFiUDP

+
inline IWiFiUDP::IWiFiUDP () 
+
+

function available

+
virtual int IWiFiUDP::available () = 0
+
+

function begin [1/2]

+
virtual uint8_t IWiFiUDP::begin (
+    IPAddress ip,
+    uint16_t port
+) = 0
+
+

function begin [2/2]

+
virtual uint8_t IWiFiUDP::begin (
+    uint16_t port
+) = 0
+
+

function beginMulticast

+
virtual uint8_t IWiFiUDP::beginMulticast (
+    IPAddress ip,
+    uint16_t port
+) = 0
+
+

function beginMulticastPacket

+
virtual int IWiFiUDP::beginMulticastPacket () = 0
+
+

function beginPacket [1/3]

+
virtual int IWiFiUDP::beginPacket () = 0
+
+

function beginPacket [2/3]

+
virtual int IWiFiUDP::beginPacket (
+    IPAddress ip,
+    uint16_t port
+) = 0
+
+

function beginPacket [3/3]

+
virtual int IWiFiUDP::beginPacket (
+    const char * host,
+    uint16_t port
+) = 0
+
+

function endPacket

+
virtual int IWiFiUDP::endPacket () = 0
+
+

function flush

+
virtual void IWiFiUDP::flush () = 0
+
+

function parsePacket

+
virtual int IWiFiUDP::parsePacket () = 0
+
+

function peek

+
virtual int IWiFiUDP::peek () = 0
+
+

function read [1/3]

+
virtual int IWiFiUDP::read () = 0
+
+

function read [2/3]

+
virtual int IWiFiUDP::read (
+    unsigned char * buffer,
+    size_t len
+) = 0
+
+

function read [3/3]

+
virtual int IWiFiUDP::read (
+    char * buffer,
+    size_t len
+) = 0
+
+

function remoteIP

+
virtual IPAddress IWiFiUDP::remoteIP () = 0
+
+

function remotePort

+
virtual uint16_t IWiFiUDP::remotePort () = 0
+
+

function stop

+
virtual void IWiFiUDP::stop () = 0
+
+

function write [1/2]

+
virtual size_t IWiFiUDP::write (
+    uint8_t
+) = 0
+
+

function write [2/2]

+
virtual size_t IWiFiUDP::write (
+    const uint8_t * buffer,
+    size_t size
+) = 0
+
+

function ~IWiFiUDP

+
inline IWiFiUDP::~IWiFiUDP () 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiUdp/WiFiUdp.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_libre_tiny/index.html b/ltapi/class_libre_tiny/index.html new file mode 100644 index 000000000..a027f1a0e --- /dev/null +++ b/ltapi/class_libre_tiny/index.html @@ -0,0 +1,2522 @@ + + + + + + + + + + + + + + + + + + + + Class LibreTiny - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Class LibreTiny

+

ClassList > LibreTiny

+

Main LibreTiny API class.More...

+
    +
  • #include <LT.h>
  • +
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
const char *getBoard ()
Get board code.
const char *getChipCoreType ()
Get CPU core type name as string.
uint8_tgetChipCores ()
Get CPU core count.
ChipFamilygetChipFamily ()
Get CPU family ID (as lt_cpu_family_t enum member).
const char *getChipFamilyName ()
Get CPU family name as string.
uint32_tgetChipId ()
Get CPU ID based on the last three octets of MAC address. Note: the number is 24-bit (with the MSB being zero). The 3rd-to-last octet is least-significant, the last octet is most-significant.
const char *getChipModel ()
Get CPU model name as string (uppercase).
ChipTypegetChipType ()
Get CPU model ID (as lt_cpu_model_t enum member).
uint32_tgetCpuFreq ()
Get CPU frequency in Hz.
uint32_tgetCpuFreqMHz ()
Get CPU frequency in MHz.
uint32_tgetCycleCount ()
Get CPU cycle count.
const char *getDeviceName ()
Get device friendly name in format "LT-<chip model>-<MAC ID>". Can be used as hostname.
FlashIdgetFlashChipId ()
Read flash chip ID and return a lt_flash_id_t struct.
uint32_tgetFlashChipSize ()
Get flash chip total size.
uint32_tgetFreeHeap ()
Get free heap size.
uint32_tgetHeapSize ()
Get total heap size.
uint32_tgetMaxAllocHeap ()
Get largest block of heap that can be allocated at once.
uint32_tgetMaxFreeBlockSize ()
Get largest block of heap that can be allocated at once.
uint32_tgetMinFreeHeap ()
Get lowest level of free heap memory.
uint32_tgetRamSize ()
Get total RAM size.
ResetReasongetResetReason ()
Get the reason of last chip reboot.
const char *getResetReasonName (ResetReason reason=lt_get_reboot_reason())
Get a textual representation of a reboot reason.
const char *getVersion ()
Reset reason enumeration.
voidgpioRecover ()
Reconfigure GPIO pins used for debugging (SWD/JTAG), so that they can be used as normal I/O.
voidrestart ()
Reboot the CPU.
voidrestartDownloadMode ()
Reboot the CPU and stay in download mode (if possible).
+

Detailed Description

+

Since v1.0.0, this class only consists of inline functions, which wrap the LibreTiny C API (lt_api.h). Refer to the docs of the C API for more information.

+

The class is accessible using the LT global object.

+

Public Functions Documentation

+

function getBoard

+
inline const char * LibreTiny::getBoard () 
+
+

function getChipCoreType

+
inline const char * LibreTiny::getChipCoreType () 
+
+

function getChipCores

+
inline uint8_t LibreTiny::getChipCores () 
+
+

function getChipFamily

+
inline ChipFamily LibreTiny::getChipFamily () 
+
+

function getChipFamilyName

+
inline const char * LibreTiny::getChipFamilyName () 
+
+

function getChipId

+
inline uint32_t LibreTiny::getChipId () 
+
+

function getChipModel

+
inline const char * LibreTiny::getChipModel () 
+
+

function getChipType

+
inline ChipType LibreTiny::getChipType () 
+
+

function getCpuFreq

+
inline uint32_t LibreTiny::getCpuFreq () 
+
+

function getCpuFreqMHz

+
inline uint32_t LibreTiny::getCpuFreqMHz () 
+
+

function getCycleCount

+
inline uint32_t LibreTiny::getCycleCount () 
+
+

function getDeviceName

+
inline const char * LibreTiny::getDeviceName () 
+
+

function getFlashChipId

+
inline FlashId LibreTiny::getFlashChipId () 
+
+

function getFlashChipSize

+

Get flash chip total size. +

inline uint32_t LibreTiny::getFlashChipSize () 
+

+

The default implementation uses the least significant byte of the chip ID to determine the size.

+

function getFreeHeap

+
inline uint32_t LibreTiny::getFreeHeap () 
+
+

function getHeapSize

+
inline uint32_t LibreTiny::getHeapSize () 
+
+

function getMaxAllocHeap

+
inline uint32_t LibreTiny::getMaxAllocHeap () 
+
+

function getMaxFreeBlockSize

+
inline uint32_t LibreTiny::getMaxFreeBlockSize () 
+
+

function getMinFreeHeap

+
inline uint32_t LibreTiny::getMinFreeHeap () 
+
+

function getRamSize

+
inline uint32_t LibreTiny::getRamSize () 
+
+

function getResetReason

+
inline ResetReason LibreTiny::getResetReason () 
+
+

function getResetReasonName

+

Get a textual representation of a reboot reason. +

inline const char * LibreTiny::getResetReasonName (
+    ResetReason reason=lt_get_reboot_reason()
+) 
+

+

Parameters:

+
    +
  • reason value to convert to text, pass 0 to read from lt_reboot_get_reason()
  • +
+

function getVersion

+
inline const char * LibreTiny::getVersion () 
+
+

function gpioRecover

+
inline void LibreTiny::gpioRecover () 
+
+

function restart

+
inline void LibreTiny::restart () 
+
+

function restartDownloadMode

+

Reboot the CPU and stay in download mode (if possible). +

inline void LibreTiny::restartDownloadMode () 
+

+

Returns:

+

whether download-mode reboot is possible

+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/inline/LT/LT.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_libre_tiny_o_t_a/index.html b/ltapi/class_libre_tiny_o_t_a/index.html new file mode 100644 index 000000000..7cccaa001 --- /dev/null +++ b/ltapi/class_libre_tiny_o_t_a/index.html @@ -0,0 +1,2409 @@ + + + + + + + + + + + + + + + + + + + + Class LibreTinyOTA - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Class LibreTinyOTA

+

ClassList > LibreTinyOTA

+

Over-the-Air updates helper class. More...

+
    +
  • #include <OTA.h>
  • +
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
boolcanRollback ()
Check if OTA rollback is possible (switching the stored index to another partition).
uint8_tgetCurrentIndex ()
Get the currently running firmware's OTA index.
uint8_tgetStoredIndex ()
Read the currently active OTA index, i.e. the one that will boot upon restart.
lt_ota_type_tgetType ()
Get OTA type of the device's chip.
uf2_ota_scheme_tgetUF2Scheme ()
Check which UF2 OTA scheme should be used for applying firmware updates.
boolisValid (uint8_t index)
Check if the specified OTA image is valid.
boolswitchImage (bool revert=false)
Try to switch OTA index to the other image. For single-OTA chips, only check if the upgrade image is valid.
+

Detailed Description

+

This class only consists of inline functions, which wrap the LibreTiny C API (lt_api.h). Refer to the docs of the C API for more information.

+

The class is accessible using the OTA global object.

+

Public Functions Documentation

+

function canRollback

+

Check if OTA rollback is possible (switching the stored index to another partition). +

inline bool LibreTinyOTA::canRollback () 
+

+

Note that this is not the same as "switching" OTA with revert=true.

+

Returns:

+

true if 2nd image is valid and the chip is dual-OTA; false otherwise

+

function getCurrentIndex

+

Get the currently running firmware's OTA index. +

inline uint8_t LibreTinyOTA::getCurrentIndex () 
+

+

Returns:

+

OTA index if dual-OTA is supported, 0 otherwise

+

function getStoredIndex

+

Read the currently active OTA index, i.e. the one that will boot upon restart. +

inline uint8_t LibreTinyOTA::getStoredIndex () 
+

+

Returns:

+

OTA index if dual-OTA is supported, 0 otherwise

+

function getType

+
inline lt_ota_type_t LibreTinyOTA::getType () 
+
+

function getUF2Scheme

+

Check which UF2 OTA scheme should be used for applying firmware updates. +

inline uf2_ota_scheme_t LibreTinyOTA::getUF2Scheme () 
+

+

Returns:

+

OTA scheme of the target partition

+

function isValid

+

Check if the specified OTA image is valid. +

inline bool LibreTinyOTA::isValid (
+    uint8_t index
+) 
+

+

Parameters:

+
    +
  • index OTA index to check; 0 for single-OTA chips, 1 or 2 for dual-OTA chips
  • +
+

Returns:

+

true if index is valid for the chip's OTA type, and there is a valid image; false otherwise

+

function switchImage

+

Try to switch OTA index to the other image. For single-OTA chips, only check if the upgrade image is valid. +

inline bool LibreTinyOTA::switchImage (
+    bool revert=false
+) 
+

+

This can be used to "activate" the upgrade after flashing.

+

Parameters:

+
    +
  • revert switch if (and only if) the other image is already marked as active (i.e. switch back to the running image)
  • +
+

Returns:

+

false if the second image (or upgrade image) is not valid; false if writing failed; true otherwise

+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/inline/OTA/OTA.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_libre_tiny_w_d_t/index.html b/ltapi/class_libre_tiny_w_d_t/index.html new file mode 100644 index 000000000..a4585d56d --- /dev/null +++ b/ltapi/class_libre_tiny_w_d_t/index.html @@ -0,0 +1,2358 @@ + + + + + + + + + + + + + + + + + + + + Class LibreTinyWDT - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Class LibreTinyWDT

+

ClassList > LibreTinyWDT

+

Watchdog control class. More...

+
    +
  • #include <WDT.h>
  • +
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + +
TypeName
voiddisable ()
Disable the hardware watchdog.
boolenable (uint32_t timeout=10000)
Enable the hardware watchdog.
voidfeed ()
Feed/reset the hardware watchdog timer.
+

Detailed Description

+

This class only consists of inline functions, which wrap the LibreTiny C API (lt_api.h). Refer to the docs of the C API for more information.

+

The class is accessible using the WDT global object.

+

Public Functions Documentation

+

function disable

+
inline void LibreTinyWDT::disable () 
+
+

function enable

+

Enable the hardware watchdog. +

inline bool LibreTinyWDT::enable (
+    uint32_t timeout=10000
+) 
+

+

Parameters:

+
    +
  • timeout watchdog timeout, milliseconds
  • +
+

Returns:

+

whether the chip has a hardware watchdog

+

function feed

+
inline void LibreTinyWDT::feed () 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/inline/WDT/WDT.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_lw_i_p_client/index.html b/ltapi/class_lw_i_p_client/index.html new file mode 100644 index 000000000..045185276 --- /dev/null +++ b/ltapi/class_lw_i_p_client/index.html @@ -0,0 +1,2905 @@ + + + + + + + + + + + + + + + + + + + + Class LwIPClient - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

Class LwIPClient

+

ClassList > LwIPClient

+

Inherits the following classes: IWiFiClient

+

Inherited by the following classes: MbedTLSClient

+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
LwIPClient ()
LwIPClient (int sock)
intavailable ()
intconnect (IPAddress ip, uint16_t port)
intconnect (const char * host, uint16_t port)
virtual intconnect (IPAddress ip, uint16_t port, int32_t timeout)
virtual intconnect (const char * host, uint16_t port, int32_t timeout)
uint8_tconnected ()
virtual intfd () const
voidflush ()
virtual IPAddresslocalIP () const
virtual IPAddresslocalIP (int sock) const
virtual uint16_tlocalPort () const
virtual uint16_tlocalPort (int sock) const
LwIPClient &operator= (const LwIPClient & other)
intpeek ()
intread ()
intread (uint8_t * buf, size_t size)
virtual IPAddressremoteIP () const
virtual IPAddressremoteIP (int sock) const
virtual uint16_tremotePort () const
virtual uint16_tremotePort (int sock) const
virtual intsetTimeout (uint32_t seconds)
virtual intsocket ()
voidstop ()
size_twrite (uint8_t data)
size_twrite (const uint8_t * buf, size_t size)
virtual size_twrite (Stream & stream)
~LwIPClient ()
+

Public Functions inherited from IWiFiClient

+

See IWiFiClient

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
IWiFiClient ()
IWiFiClient (int sock)
virtual intconnect (IPAddress ip, uint16_t port, int32_t timeout) = 0
virtual intconnect (const char * host, uint16_t port, int32_t timeout) = 0
virtual intfd () const = 0
virtual IPAddresslocalIP () const = 0
virtual IPAddresslocalIP (int sock) const = 0
virtual uint16_tlocalPort () const = 0
virtual uint16_tlocalPort (int sock) const = 0
operator bool ()
virtual booloperator!= (const bool value)
virtual booloperator!= (const IWiFiClient & other)
booloperator== (const IWiFiClient & other) const
virtual booloperator== (const bool value)
virtual IPAddressremoteIP () const = 0
virtual IPAddressremoteIP (int sock) const = 0
virtual uint16_tremotePort () const = 0
virtual uint16_tremotePort (int sock) const = 0
virtual intsetTimeout (uint32_t seconds) = 0
virtual intsocket () = 0
virtual size_twrite (Stream & stream) = 0
size_twrite_P (PGM_P buffer, size_t size)
~IWiFiClient ()
+

Public Functions Documentation

+

function LwIPClient [1/2]

+
LwIPClient::LwIPClient () 
+
+

function LwIPClient [2/2]

+
LwIPClient::LwIPClient (
+    int sock
+) 
+
+

function available

+
int LwIPClient::available () 
+
+

function connect [1/4]

+
int LwIPClient::connect (
+    IPAddress ip,
+    uint16_t port
+) 
+
+

function connect [2/4]

+
int LwIPClient::connect (
+    const char * host,
+    uint16_t port
+) 
+
+

function connect [3/4]

+
virtual int LwIPClient::connect (
+    IPAddress ip,
+    uint16_t port,
+    int32_t timeout
+) 
+
+

Implements IWiFiClient::connect

+

function connect [4/4]

+
virtual int LwIPClient::connect (
+    const char * host,
+    uint16_t port,
+    int32_t timeout
+) 
+
+

Implements IWiFiClient::connect

+

function connected

+
uint8_t LwIPClient::connected () 
+
+

function fd

+
virtual int LwIPClient::fd () const
+
+

Implements IWiFiClient::fd

+

function flush

+
void LwIPClient::flush () 
+
+

function localIP [1/2]

+
virtual IPAddress LwIPClient::localIP () const
+
+

Implements IWiFiClient::localIP

+

function localIP [2/2]

+
virtual IPAddress LwIPClient::localIP (
+    int sock
+) const
+
+

Implements IWiFiClient::localIP

+

function localPort [1/2]

+
virtual uint16_t LwIPClient::localPort () const
+
+

Implements IWiFiClient::localPort

+

function localPort [2/2]

+
virtual uint16_t LwIPClient::localPort (
+    int sock
+) const
+
+

Implements IWiFiClient::localPort

+

function operator=

+
LwIPClient & LwIPClient::operator= (
+    const LwIPClient & other
+) 
+
+

function peek

+
int LwIPClient::peek () 
+
+

function read [1/2]

+
int LwIPClient::read () 
+
+

function read [2/2]

+
int LwIPClient::read (
+    uint8_t * buf,
+    size_t size
+) 
+
+

function remoteIP [1/2]

+
virtual IPAddress LwIPClient::remoteIP () const
+
+

Implements IWiFiClient::remoteIP

+

function remoteIP [2/2]

+
virtual IPAddress LwIPClient::remoteIP (
+    int sock
+) const
+
+

Implements IWiFiClient::remoteIP

+

function remotePort [1/2]

+
virtual uint16_t LwIPClient::remotePort () const
+
+

Implements IWiFiClient::remotePort

+

function remotePort [2/2]

+
virtual uint16_t LwIPClient::remotePort (
+    int sock
+) const
+
+

Implements IWiFiClient::remotePort

+

function setTimeout

+
virtual int LwIPClient::setTimeout (
+    uint32_t seconds
+) 
+
+

Implements IWiFiClient::setTimeout

+

function socket

+
virtual int LwIPClient::socket () 
+
+

Implements IWiFiClient::socket

+

function stop

+
void LwIPClient::stop () 
+
+

function write [1/3]

+
size_t LwIPClient::write (
+    uint8_t data
+) 
+
+

function write [2/3]

+
size_t LwIPClient::write (
+    const uint8_t * buf,
+    size_t size
+) 
+
+

function write [3/3]

+
virtual size_t LwIPClient::write (
+    Stream & stream
+) 
+
+

Implements IWiFiClient::write

+

function ~LwIPClient

+
LwIPClient::~LwIPClient () 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiClient/LwIPClient.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_lw_i_p_rx_buffer/index.html b/ltapi/class_lw_i_p_rx_buffer/index.html new file mode 100644 index 000000000..25ce5e7b6 --- /dev/null +++ b/ltapi/class_lw_i_p_rx_buffer/index.html @@ -0,0 +1,2424 @@ + + + + + + + + + + + + + + + + + + + + Class LwIPRxBuffer - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Class LwIPRxBuffer

+

ClassList > LwIPRxBuffer

+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
LwIPRxBuffer (int sock, size_t size=1436)
size_tavailable ()
boolfailed ()
intpeek ()
intread (uint8_t * dst, size_t len)
~LwIPRxBuffer ()
+

Public Functions Documentation

+

function LwIPRxBuffer

+
LwIPRxBuffer::LwIPRxBuffer (
+    int sock,
+    size_t size=1436
+) 
+
+

function available

+
size_t LwIPRxBuffer::available () 
+
+

function failed

+
bool LwIPRxBuffer::failed () 
+
+

function peek

+
int LwIPRxBuffer::peek () 
+
+

function read

+
int LwIPRxBuffer::read (
+    uint8_t * dst,
+    size_t len
+) 
+
+

function ~LwIPRxBuffer

+
LwIPRxBuffer::~LwIPRxBuffer () 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiClient/LwIPRxBuffer.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_lw_i_p_server/index.html b/ltapi/class_lw_i_p_server/index.html new file mode 100644 index 000000000..cf67bba2d --- /dev/null +++ b/ltapi/class_lw_i_p_server/index.html @@ -0,0 +1,2633 @@ + + + + + + + + + + + + + + + + + + + + Class LwIPServer - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

Class LwIPServer

+

ClassList > LwIPServer

+

Inherits the following classes: IWiFiServer

+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
LwIPServer (uint16_t port=80, uint8_t maxClients=4)
LwIPServer (int port=80, uint8_t maxClients=4)
LwIPServer (const IPAddress & addr, uint16_t port=80, uint8_t maxClients=4)
virtual WiFiClientaccept ()
virtual boolbegin (uint16_t port=0, bool reuseAddr=true)
virtual voidend ()
virtual boolgetNoDelay ()
virtual boolhasClient ()
virtualoperator bool ()
virtual voidsetNoDelay (bool noDelay)
virtual intsetTimeout (uint32_t seconds)
virtual voidstopAll ()
size_twrite (const uint8_t * buffer, size_t size)
+

Public Functions inherited from IWiFiServer

+

See IWiFiServer

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
IWiFiServer (uint16_t port=80, uint8_t maxClients=4)
IWiFiServer (const IPAddress & addr, uint16_t port=80, uint8_t maxClients=4)
virtual TWiFiClientaccept () = 0
TWiFiClientavailable ()
virtual boolbegin (uint16_t port=0, bool reuseAddr=true) = 0
voidclose ()
virtual voidend () = 0
virtual boolgetNoDelay () = 0
virtual boolhasClient () = 0
voidlistenOnLocalhost ()
virtualoperator bool () = 0
virtual voidsetNoDelay (bool noDelay) = 0
virtual intsetTimeout (uint32_t seconds) = 0
voidstop ()
virtual voidstopAll () = 0
size_twrite (uint8_t data)
~IWiFiServer ()
+

Public Functions Documentation

+

function LwIPServer [2/4]

+
inline LwIPServer::LwIPServer (
+    uint16_t port=80,
+    uint8_t maxClients=4
+) 
+
+

function LwIPServer [3/4]

+
inline LwIPServer::LwIPServer (
+    int port=80,
+    uint8_t maxClients=4
+) 
+
+

function LwIPServer [4/4]

+
inline LwIPServer::LwIPServer (
+    const IPAddress & addr,
+    uint16_t port=80,
+    uint8_t maxClients=4
+) 
+
+

function accept

+
virtual WiFiClient LwIPServer::accept () 
+
+

Implements IWiFiServer::accept

+

function begin

+
virtual bool LwIPServer::begin (
+    uint16_t port=0,
+    bool reuseAddr=true
+) 
+
+

Implements IWiFiServer::begin

+

function end

+
virtual void LwIPServer::end () 
+
+

Implements IWiFiServer::end

+

function getNoDelay

+
virtual bool LwIPServer::getNoDelay () 
+
+

Implements IWiFiServer::getNoDelay

+

function hasClient

+
virtual bool LwIPServer::hasClient () 
+
+

Implements IWiFiServer::hasClient

+

function operator bool

+
virtual LwIPServer::operator bool () 
+
+

Implements IWiFiServer::operator bool

+

function setNoDelay

+
virtual void LwIPServer::setNoDelay (
+    bool noDelay
+) 
+
+

Implements IWiFiServer::setNoDelay

+

function setTimeout

+
virtual int LwIPServer::setTimeout (
+    uint32_t seconds
+) 
+
+

Implements IWiFiServer::setTimeout

+

function stopAll

+
inline virtual void LwIPServer::stopAll () 
+
+

Implements IWiFiServer::stopAll

+

function write

+
inline size_t LwIPServer::write (
+    const uint8_t * buffer,
+    size_t size
+) 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiServer/LwIPServer.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_lw_i_p_u_d_p/index.html b/ltapi/class_lw_i_p_u_d_p/index.html new file mode 100644 index 000000000..9f466da92 --- /dev/null +++ b/ltapi/class_lw_i_p_u_d_p/index.html @@ -0,0 +1,2795 @@ + + + + + + + + + + + + + + + + + + + + Class LwIPUDP - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

Class LwIPUDP

+

ClassList > LwIPUDP

+

Inherits the following classes: IWiFiUDP

+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
LwIPUDP ()
virtual intavailable ()
virtual uint8_tbegin (IPAddress ip, uint16_t port)
virtual uint8_tbegin (uint16_t port)
virtual uint8_tbeginMulticast (IPAddress ip, uint16_t port)
virtual intbeginMulticastPacket ()
virtual intbeginPacket ()
virtual intbeginPacket (IPAddress ip, uint16_t port)
virtual intbeginPacket (const char * host, uint16_t port)
virtual intendPacket ()
virtual voidflush ()
virtual intparsePacket ()
virtual intpeek ()
virtual intread ()
virtual intread (unsigned char * buffer, size_t len)
virtual intread (char * buffer, size_t len)
virtual IPAddressremoteIP ()
virtual uint16_tremotePort ()
virtual voidstop ()
virtual size_twrite (uint8_t)
virtual size_twrite (const uint8_t * buffer, size_t size)
~LwIPUDP ()
+

Public Functions inherited from IWiFiUDP

+

See IWiFiUDP

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
IWiFiUDP ()
virtual intavailable () = 0
virtual uint8_tbegin (IPAddress ip, uint16_t port) = 0
virtual uint8_tbegin (uint16_t port) = 0
virtual uint8_tbeginMulticast (IPAddress ip, uint16_t port) = 0
virtual intbeginMulticastPacket () = 0
virtual intbeginPacket () = 0
virtual intbeginPacket (IPAddress ip, uint16_t port) = 0
virtual intbeginPacket (const char * host, uint16_t port) = 0
virtual intendPacket () = 0
virtual voidflush () = 0
virtual intparsePacket () = 0
virtual intpeek () = 0
virtual intread () = 0
virtual intread (unsigned char * buffer, size_t len) = 0
virtual intread (char * buffer, size_t len) = 0
virtual IPAddressremoteIP () = 0
virtual uint16_tremotePort () = 0
virtual voidstop () = 0
virtual size_twrite (uint8_t) = 0
virtual size_twrite (const uint8_t * buffer, size_t size) = 0
~IWiFiUDP ()
+

Public Functions Documentation

+

function LwIPUDP

+
LwIPUDP::LwIPUDP () 
+
+

function available

+
virtual int LwIPUDP::available () 
+
+

Implements IWiFiUDP::available

+

function begin [1/2]

+
virtual uint8_t LwIPUDP::begin (
+    IPAddress ip,
+    uint16_t port
+) 
+
+

Implements IWiFiUDP::begin

+

function begin [2/2]

+
virtual uint8_t LwIPUDP::begin (
+    uint16_t port
+) 
+
+

Implements IWiFiUDP::begin

+

function beginMulticast

+
virtual uint8_t LwIPUDP::beginMulticast (
+    IPAddress ip,
+    uint16_t port
+) 
+
+

Implements IWiFiUDP::beginMulticast

+

function beginMulticastPacket

+
virtual int LwIPUDP::beginMulticastPacket () 
+
+

Implements IWiFiUDP::beginMulticastPacket

+

function beginPacket [1/3]

+
virtual int LwIPUDP::beginPacket () 
+
+

Implements IWiFiUDP::beginPacket

+

function beginPacket [2/3]

+
virtual int LwIPUDP::beginPacket (
+    IPAddress ip,
+    uint16_t port
+) 
+
+

Implements IWiFiUDP::beginPacket

+

function beginPacket [3/3]

+
virtual int LwIPUDP::beginPacket (
+    const char * host,
+    uint16_t port
+) 
+
+

Implements IWiFiUDP::beginPacket

+

function endPacket

+
virtual int LwIPUDP::endPacket () 
+
+

Implements IWiFiUDP::endPacket

+

function flush

+
virtual void LwIPUDP::flush () 
+
+

Implements IWiFiUDP::flush

+

function parsePacket

+
virtual int LwIPUDP::parsePacket () 
+
+

Implements IWiFiUDP::parsePacket

+

function peek

+
virtual int LwIPUDP::peek () 
+
+

Implements IWiFiUDP::peek

+

function read [1/3]

+
virtual int LwIPUDP::read () 
+
+

Implements IWiFiUDP::read

+

function read [2/3]

+
virtual int LwIPUDP::read (
+    unsigned char * buffer,
+    size_t len
+) 
+
+

Implements IWiFiUDP::read

+

function read [3/3]

+
virtual int LwIPUDP::read (
+    char * buffer,
+    size_t len
+) 
+
+

Implements IWiFiUDP::read

+

function remoteIP

+
virtual IPAddress LwIPUDP::remoteIP () 
+
+

Implements IWiFiUDP::remoteIP

+

function remotePort

+
virtual uint16_t LwIPUDP::remotePort () 
+
+

Implements IWiFiUDP::remotePort

+

function stop

+
virtual void LwIPUDP::stop () 
+
+

Implements IWiFiUDP::stop

+

function write [1/2]

+
virtual size_t LwIPUDP::write (
+    uint8_t
+) 
+
+

Implements IWiFiUDP::write

+

function write [2/2]

+
virtual size_t LwIPUDP::write (
+    const uint8_t * buffer,
+    size_t size
+) 
+
+

Implements IWiFiUDP::write

+

function ~LwIPUDP

+
LwIPUDP::~LwIPUDP () 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiUdp/LwIPUdp.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_mbed_t_l_s_client/index.html b/ltapi/class_mbed_t_l_s_client/index.html new file mode 100644 index 000000000..23aa73f17 --- /dev/null +++ b/ltapi/class_mbed_t_l_s_client/index.html @@ -0,0 +1,3250 @@ + + + + + + + + + + + + + + + + + + + + Class MbedTLSClient - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Class MbedTLSClient

+

ClassList > MbedTLSClient

+

Inherits the following classes: LwIPClient, IWiFiClientSecure

+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
MbedTLSClient ()
MbedTLSClient (int sock)
intavailable ()
virtual intconnect (IPAddress ip, uint16_t port, int32_t timeout)
virtual intconnect (const char * host, uint16_t port, int32_t timeout)
virtual intconnect (IPAddress ip, uint16_t port, const char * rootCABuf, const char * clientCert, const char * clientKey)
virtual intconnect (const char * host, uint16_t port, const char * rootCABuf, const char * clientCert, const char * clientKey)
virtual intconnect (IPAddress ip, uint16_t port, const char * pskIdent, const char * psk)
virtual intconnect (const char * host, uint16_t port, const char * pskIdent, const char * psk)
intconnect (IPAddress ip, uint16_t port)
intconnect (const char * host, uint16_t port)
virtual intconnect (IPAddress ip, uint16_t port, int32_t timeout)
virtual intconnect (const char * host, uint16_t port, int32_t timeout)
voidflush ()
virtual boolgetFingerprintSHA256 (uint8_t result)
virtual intlastError (char * buf, const size_t size)
virtual boolloadCACert (Stream & stream, size_t size)
virtual boolloadCertificate (Stream & stream, size_t size)
virtual boolloadPrivateKey (Stream & stream, size_t size)
intpeek ()
intread (uint8_t * buf, size_t size)
intread ()
intread (uint8_t * buf, size_t size)
virtual voidsetAlpnProtocols (const char ** alpnProtocols)
virtual voidsetCACert (const char * rootCA)
virtual voidsetCertificate (const char * clientCA)
virtual voidsetHandshakeTimeout (unsigned long handshakeTimeout)
virtual voidsetInsecure ()
virtual voidsetPreSharedKey (const char * pskIdent, const char * psk)
virtual voidsetPrivateKey (const char * privateKey)
voidstop ()
virtual boolverify (const char * fingerprint, const char * domainName)
size_twrite (const uint8_t * buf, size_t size)
~MbedTLSClient ()
+

Public Functions inherited from LwIPClient

+

See LwIPClient

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
LwIPClient ()
LwIPClient (int sock)
intavailable ()
intconnect (IPAddress ip, uint16_t port)
intconnect (const char * host, uint16_t port)
virtual intconnect (IPAddress ip, uint16_t port, int32_t timeout)
virtual intconnect (const char * host, uint16_t port, int32_t timeout)
uint8_tconnected ()
virtual intfd () const
voidflush ()
virtual IPAddresslocalIP () const
virtual IPAddresslocalIP (int sock) const
virtual uint16_tlocalPort () const
virtual uint16_tlocalPort (int sock) const
LwIPClient &operator= (const LwIPClient & other)
intpeek ()
intread ()
intread (uint8_t * buf, size_t size)
virtual IPAddressremoteIP () const
virtual IPAddressremoteIP (int sock) const
virtual uint16_tremotePort () const
virtual uint16_tremotePort (int sock) const
virtual intsetTimeout (uint32_t seconds)
virtual intsocket ()
voidstop ()
size_twrite (uint8_t data)
size_twrite (const uint8_t * buf, size_t size)
virtual size_twrite (Stream & stream)
~LwIPClient ()
+

Public Functions inherited from IWiFiClient

+

See IWiFiClient

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
IWiFiClient ()
IWiFiClient (int sock)
virtual intconnect (IPAddress ip, uint16_t port, int32_t timeout) = 0
virtual intconnect (const char * host, uint16_t port, int32_t timeout) = 0
virtual intfd () const = 0
virtual IPAddresslocalIP () const = 0
virtual IPAddresslocalIP (int sock) const = 0
virtual uint16_tlocalPort () const = 0
virtual uint16_tlocalPort (int sock) const = 0
operator bool ()
virtual booloperator!= (const bool value)
virtual booloperator!= (const IWiFiClient & other)
booloperator== (const IWiFiClient & other) const
virtual booloperator== (const bool value)
virtual IPAddressremoteIP () const = 0
virtual IPAddressremoteIP (int sock) const = 0
virtual uint16_tremotePort () const = 0
virtual uint16_tremotePort (int sock) const = 0
virtual intsetTimeout (uint32_t seconds) = 0
virtual intsocket () = 0
virtual size_twrite (Stream & stream) = 0
size_twrite_P (PGM_P buffer, size_t size)
~IWiFiClient ()
+

Public Functions inherited from IWiFiClientSecure

+

See IWiFiClientSecure

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
virtual intconnect (IPAddress ip, uint16_t port, const char * rootCABuf, const char * clientCert, const char * clientKey) = 0
virtual intconnect (const char * host, uint16_t port, const char * rootCABuf, const char * clientCert, const char * clientKey) = 0
virtual intconnect (IPAddress ip, uint16_t port, const char * pskIdent, const char * psk) = 0
virtual intconnect (const char * host, uint16_t port, const char * pskIdent, const char * psk) = 0
virtual boolgetFingerprintSHA256 (uint8_t result) = 0
virtual intlastError (char * buf, const size_t size) = 0
virtual boolloadCACert (Stream & stream, size_t size) = 0
virtual boolloadCertificate (Stream & stream, size_t size) = 0
virtual boolloadPrivateKey (Stream & stream, size_t size) = 0
virtual voidsetAlpnProtocols (const char ** alpnProtocols) = 0
virtual voidsetCACert (const char * rootCA) = 0
virtual voidsetCertificate (const char * clientCA) = 0
virtual voidsetHandshakeTimeout (unsigned long handshakeTimeout) = 0
virtual voidsetInsecure () = 0
virtual voidsetPreSharedKey (const char * pskIdent, const char * psk) = 0
virtual voidsetPrivateKey (const char * privateKey) = 0
virtual boolverify (const char * fingerprint, const char * domainName) = 0
+

Public Functions Documentation

+

function MbedTLSClient [1/2]

+
MbedTLSClient::MbedTLSClient () 
+
+

function MbedTLSClient [2/2]

+
MbedTLSClient::MbedTLSClient (
+    int sock
+) 
+
+

function available

+
int MbedTLSClient::available () 
+
+

function connect [2/11]

+
virtual int MbedTLSClient::connect (
+    IPAddress ip,
+    uint16_t port,
+    int32_t timeout
+) 
+
+

Implements LwIPClient::connect

+

function connect [3/11]

+
virtual int MbedTLSClient::connect (
+    const char * host,
+    uint16_t port,
+    int32_t timeout
+) 
+
+

Implements LwIPClient::connect

+

function connect [4/11]

+
virtual int MbedTLSClient::connect (
+    IPAddress ip,
+    uint16_t port,
+    const char * rootCABuf,
+    const char * clientCert,
+    const char * clientKey
+) 
+
+

Implements IWiFiClientSecure::connect

+

function connect [5/11]

+
virtual int MbedTLSClient::connect (
+    const char * host,
+    uint16_t port,
+    const char * rootCABuf,
+    const char * clientCert,
+    const char * clientKey
+) 
+
+

Implements IWiFiClientSecure::connect

+

function connect [6/11]

+
virtual int MbedTLSClient::connect (
+    IPAddress ip,
+    uint16_t port,
+    const char * pskIdent,
+    const char * psk
+) 
+
+

Implements IWiFiClientSecure::connect

+

function connect [7/11]

+
virtual int MbedTLSClient::connect (
+    const char * host,
+    uint16_t port,
+    const char * pskIdent,
+    const char * psk
+) 
+
+

Implements IWiFiClientSecure::connect

+

function connect [8/11]

+
int MbedTLSClient::connect (
+    IPAddress ip,
+    uint16_t port
+) 
+
+

function connect [9/11]

+
int MbedTLSClient::connect (
+    const char * host,
+    uint16_t port
+) 
+
+

function connect [10/11]

+
virtual int MbedTLSClient::connect (
+    IPAddress ip,
+    uint16_t port,
+    int32_t timeout
+) 
+
+

Implements LwIPClient::connect

+

function connect [11/11]

+
virtual int MbedTLSClient::connect (
+    const char * host,
+    uint16_t port,
+    int32_t timeout
+) 
+
+

Implements LwIPClient::connect

+

function flush

+
void MbedTLSClient::flush () 
+
+

function getFingerprintSHA256

+
virtual bool MbedTLSClient::getFingerprintSHA256 (
+    uint8_t result
+) 
+
+

Implements IWiFiClientSecure::getFingerprintSHA256

+

function lastError

+
virtual int MbedTLSClient::lastError (
+    char * buf,
+    const size_t size
+) 
+
+

Implements IWiFiClientSecure::lastError

+

function loadCACert

+
virtual bool MbedTLSClient::loadCACert (
+    Stream & stream,
+    size_t size
+) 
+
+

Implements IWiFiClientSecure::loadCACert

+

function loadCertificate

+
virtual bool MbedTLSClient::loadCertificate (
+    Stream & stream,
+    size_t size
+) 
+
+

Implements IWiFiClientSecure::loadCertificate

+

function loadPrivateKey

+
virtual bool MbedTLSClient::loadPrivateKey (
+    Stream & stream,
+    size_t size
+) 
+
+

Implements IWiFiClientSecure::loadPrivateKey

+

function peek

+
int MbedTLSClient::peek () 
+
+

function read [1/3]

+
int MbedTLSClient::read (
+    uint8_t * buf,
+    size_t size
+) 
+
+

function read [2/3]

+
int MbedTLSClient::read () 
+
+

function read [3/3]

+
int MbedTLSClient::read (
+    uint8_t * buf,
+    size_t size
+) 
+
+

function setAlpnProtocols

+
virtual void MbedTLSClient::setAlpnProtocols (
+    const char ** alpnProtocols
+) 
+
+

Implements IWiFiClientSecure::setAlpnProtocols

+

function setCACert

+
virtual void MbedTLSClient::setCACert (
+    const char * rootCA
+) 
+
+

Implements IWiFiClientSecure::setCACert

+

function setCertificate

+
virtual void MbedTLSClient::setCertificate (
+    const char * clientCA
+) 
+
+

Implements IWiFiClientSecure::setCertificate

+

function setHandshakeTimeout

+
virtual void MbedTLSClient::setHandshakeTimeout (
+    unsigned long handshakeTimeout
+) 
+
+

Implements IWiFiClientSecure::setHandshakeTimeout

+

function setInsecure

+
virtual void MbedTLSClient::setInsecure () 
+
+

Implements IWiFiClientSecure::setInsecure

+

function setPreSharedKey

+
virtual void MbedTLSClient::setPreSharedKey (
+    const char * pskIdent,
+    const char * psk
+) 
+
+

Implements IWiFiClientSecure::setPreSharedKey

+

function setPrivateKey

+
virtual void MbedTLSClient::setPrivateKey (
+    const char * privateKey
+) 
+
+

Implements IWiFiClientSecure::setPrivateKey

+

function stop

+
void MbedTLSClient::stop () 
+
+

function verify

+
virtual bool MbedTLSClient::verify (
+    const char * fingerprint,
+    const char * domainName
+) 
+
+

Implements IWiFiClientSecure::verify

+

function write

+
size_t MbedTLSClient::write (
+    const uint8_t * buf,
+    size_t size
+) 
+
+

function ~MbedTLSClient

+
MbedTLSClient::~MbedTLSClient () 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiClient/MbedTLSClient.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_member_enums/index.html b/ltapi/class_member_enums/index.html new file mode 100644 index 000000000..70d1d1099 --- /dev/null +++ b/ltapi/class_member_enums/index.html @@ -0,0 +1,2291 @@ + + + + + + + + + + + + + + + + + + + + Class Member Enums - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Class Member Enums

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_member_functions/index.html b/ltapi/class_member_functions/index.html new file mode 100644 index 000000000..9c586c8c5 --- /dev/null +++ b/ltapi/class_member_functions/index.html @@ -0,0 +1,2967 @@ + + + + + + + + + + + + + + + + + + + + Class Member Functions - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Class Member Functions

+

a

+ +

b

+ +

c

+ +

d

+ +

e

+ +

f

+ +

g

+ +

h

+ +

i

+ +

l

+ +

m

+ +

n

+ +

o

+ +

p

+ +

q

+
    +
  • queryHost (mDNS)
  • +
  • queryService (mDNS)
  • +
+

r

+ +

s

+ +

t

+ +

u

+ +

v

+ +

w

+ +

~

+ +

_

+ + + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_member_typedefs/index.html b/ltapi/class_member_typedefs/index.html new file mode 100644 index 000000000..3bc783b6d --- /dev/null +++ b/ltapi/class_member_typedefs/index.html @@ -0,0 +1,2311 @@ + + + + + + + + + + + + + + + + + + + + Class Member Typedefs - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Class Member Typedefs

+

t

+ + + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_member_variables/index.html b/ltapi/class_member_variables/index.html new file mode 100644 index 000000000..01f8c2d60 --- /dev/null +++ b/ltapi/class_member_variables/index.html @@ -0,0 +1,2760 @@ + + + + + + + + + + + + + + + + + + + + Class Member Variables - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Class Member Variables

+

a

+ +

b

+ +

c

+ +

d

+ +

e

+ +

f

+ +

g

+ +

h

+ +

i

+ +

k

+ +

l

+ +

m

+ +

n

+ +

o

+ +

p

+ +

r

+ +

s

+ +

t

+ +

u

+ +

v

+ +

z

+ +

_

+ + + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_members/index.html b/ltapi/class_members/index.html new file mode 100644 index 000000000..d055caa25 --- /dev/null +++ b/ltapi/class_members/index.html @@ -0,0 +1,3222 @@ + + + + + + + + + + + + + + + + + + + + Class Members - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Class Members

+

a

+ +

b

+ +

c

+ +

d

+ +

e

+ +

f

+ +

g

+ +

h

+ +

i

+ +

k

+ +

l

+ +

m

+ +

n

+ +

o

+ +

p

+ +

q

+
    +
  • queryHost (mDNS)
  • +
  • queryService (mDNS)
  • +
+

r

+ +

s

+ +

t

+ +

u

+ +

v

+ +

w

+ +

z

+ +

~

+ +

_

+ + + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_request_handler/index.html b/ltapi/class_request_handler/index.html new file mode 100644 index 000000000..b681ac876 --- /dev/null +++ b/ltapi/class_request_handler/index.html @@ -0,0 +1,2510 @@ + + + + + + + + + + + + + + + + + + + + Class RequestHandler - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

Class RequestHandler

+

ClassList > RequestHandler

+

Inherited by the following classes: FunctionRequestHandler, StaticRequestHandler

+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
virtual boolcanHandle (HTTPMethod method, String uri)
virtual boolcanUpload (String uri)
virtual boolhandle (WebServer & server, HTTPMethod requestMethod, String requestUri)
RequestHandler *next ()
voidnext (RequestHandler * r)
const String &pathArg (unsigned int i)
virtual voidupload (WebServer & server, String requestUri, HTTPUpload & upload)
virtual~RequestHandler ()
+

Protected Attributes

+ + + + + + + + + + + + + +
TypeName
std::vector< String >pathArgs
+

Public Functions Documentation

+

function canHandle

+
inline virtual bool RequestHandler::canHandle (
+    HTTPMethod method,
+    String uri
+) 
+
+

function canUpload

+
inline virtual bool RequestHandler::canUpload (
+    String uri
+) 
+
+

function handle

+
inline virtual bool RequestHandler::handle (
+    WebServer & server,
+    HTTPMethod requestMethod,
+    String requestUri
+) 
+
+

function next [1/2]

+
inline RequestHandler * RequestHandler::next () 
+
+

function next [2/2]

+
inline void RequestHandler::next (
+    RequestHandler * r
+) 
+
+

function pathArg

+
inline const String & RequestHandler::pathArg (
+    unsigned int i
+) 
+
+

function upload

+
inline virtual void RequestHandler::upload (
+    WebServer & server,
+    String requestUri,
+    HTTPUpload & upload
+) 
+
+

function ~RequestHandler

+
inline virtual RequestHandler::~RequestHandler () 
+
+

Protected Attributes Documentation

+

variable pathArgs

+
std::vector<String> RequestHandler::pathArgs;
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/detail/RequestHandler.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_serial_class/index.html b/ltapi/class_serial_class/index.html new file mode 100644 index 000000000..1a413defc --- /dev/null +++ b/ltapi/class_serial_class/index.html @@ -0,0 +1,2565 @@ + + + + + + + + + + + + + + + + + + + + Class SerialClass - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

Class SerialClass

+

ClassList > SerialClass

+

Inherits the following classes: HardwareSerial

+

Public Attributes

+ + + + + + + + + + + + + +
TypeName
void *data
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
SerialClass (uint32_t port, pin_size_t rx=PIN_INVALID, pin_size_t tx=PIN_INVALID)
intavailable ()
voidbegin (unsigned long baudrate)
voidbegin (unsigned long baudrate, uint16_t config)
voidconfigure (unsigned long baudrate)
voidconfigure (unsigned long baudrate, uint16_t config)
voidend ()
voidflush ()
operator bool ()
intpeek ()
intread ()
size_twrite (uint8_t c)
+

Public Attributes Documentation

+

variable data

+
void* SerialClass::data;
+
+

Public Functions Documentation

+

function SerialClass

+
SerialClass::SerialClass (
+    uint32_t port,
+    pin_size_t rx=PIN_INVALID,
+    pin_size_t tx=PIN_INVALID
+) 
+
+

function available

+
int SerialClass::available () 
+
+

function begin [1/2]

+
inline void SerialClass::begin (
+    unsigned long baudrate
+) 
+
+

function begin [2/2]

+
void SerialClass::begin (
+    unsigned long baudrate,
+    uint16_t config
+) 
+
+

function configure [1/2]

+
inline void SerialClass::configure (
+    unsigned long baudrate
+) 
+
+

function configure [2/2]

+
void SerialClass::configure (
+    unsigned long baudrate,
+    uint16_t config
+) 
+
+

function end

+
void SerialClass::end () 
+
+

function flush

+
void SerialClass::flush () 
+
+

function operator bool

+
inline SerialClass::operator bool () 
+
+

function peek

+
int SerialClass::peek () 
+
+

function read

+
int SerialClass::read () 
+
+

function write

+
size_t SerialClass::write (
+    uint8_t c
+) 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/Serial/Serial.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_software_serial/index.html b/ltapi/class_software_serial/index.html new file mode 100644 index 000000000..1078c896d --- /dev/null +++ b/ltapi/class_software_serial/index.html @@ -0,0 +1,2618 @@ + + + + + + + + + + + + + + + + + + + + + + + + SoftwareSerial - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

Class SoftwareSerial

+

ClassList > SoftwareSerial

+

Inherits the following classes: HardwareSerial

+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
SoftwareSerial (pin_size_t receivePin, pin_size_t transmitPin, bool inverted=false)
intavailable ()
voidbegin (unsigned long baudrate)
voidbegin (unsigned long baudrate, uint16_t config)
voidend ()
voidflush ()
operator bool ()
intpeek ()
intread ()
size_twrite (uint8_t c)
+

Public Functions Documentation

+

function SoftwareSerial

+
SoftwareSerial::SoftwareSerial (
+    pin_size_t receivePin,
+    pin_size_t transmitPin,
+    bool inverted=false
+) 
+
+

function available

+
int SoftwareSerial::available () 
+
+

function begin [1/2]

+
inline void SoftwareSerial::begin (
+    unsigned long baudrate
+) 
+
+

function begin [2/2]

+
void SoftwareSerial::begin (
+    unsigned long baudrate,
+    uint16_t config
+) 
+
+

function end

+
void SoftwareSerial::end () 
+
+

function flush

+
void SoftwareSerial::flush () 
+
+

function operator bool

+
inline SoftwareSerial::operator bool () 
+
+

function peek

+
int SoftwareSerial::peek () 
+
+

function read

+
int SoftwareSerial::read () 
+
+

function write

+
size_t SoftwareSerial::write (
+    uint8_t c
+) 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/SoftwareSerial/SoftwareSerial.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_static_request_handler/index.html b/ltapi/class_static_request_handler/index.html new file mode 100644 index 000000000..91d098d62 --- /dev/null +++ b/ltapi/class_static_request_handler/index.html @@ -0,0 +1,2629 @@ + + + + + + + + + + + + + + + + + + + + Class StaticRequestHandler - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

Class StaticRequestHandler

+

ClassList > StaticRequestHandler

+

Inherits the following classes: RequestHandler

+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + +
TypeName
StaticRequestHandler (FS & fs, const char * path, const char * uri, const char * cache_header)
virtual boolcanHandle (HTTPMethod requestMethod, String requestUri) override
virtual boolhandle (WebServer & server, HTTPMethod requestMethod, String requestUri) override
+

Public Functions inherited from RequestHandler

+

See RequestHandler

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
virtual boolcanHandle (HTTPMethod method, String uri)
virtual boolcanUpload (String uri)
virtual boolhandle (WebServer & server, HTTPMethod requestMethod, String requestUri)
RequestHandler *next ()
voidnext (RequestHandler * r)
const String &pathArg (unsigned int i)
virtual voidupload (WebServer & server, String requestUri, HTTPUpload & upload)
virtual~RequestHandler ()
+

Public Static Functions

+ + + + + + + + + + + + + +
TypeName
StringgetContentType (const String & path)
+

Protected Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
size_t_baseUriLength
String_cache_header
FS_fs
bool_isFile
String_path
String_uri
+

Protected Attributes inherited from RequestHandler

+

See RequestHandler

+ + + + + + + + + + + + + +
TypeName
std::vector< String >pathArgs
+

Public Functions Documentation

+

function StaticRequestHandler

+
inline StaticRequestHandler::StaticRequestHandler (
+    FS & fs,
+    const char * path,
+    const char * uri,
+    const char * cache_header
+) 
+
+

function canHandle

+
inline virtual bool StaticRequestHandler::canHandle (
+    HTTPMethod requestMethod,
+    String requestUri
+) override
+
+

Implements RequestHandler::canHandle

+

function handle

+
inline virtual bool StaticRequestHandler::handle (
+    WebServer & server,
+    HTTPMethod requestMethod,
+    String requestUri
+) override
+
+

Implements RequestHandler::handle

+

Public Static Functions Documentation

+

function getContentType

+
static inline String StaticRequestHandler::getContentType (
+    const String & path
+) 
+
+

Protected Attributes Documentation

+

variable _baseUriLength

+
size_t StaticRequestHandler::_baseUriLength;
+
+

variable _cache_header

+
String StaticRequestHandler::_cache_header;
+
+

variable _fs

+
FS StaticRequestHandler::_fs;
+
+

variable _isFile

+
bool StaticRequestHandler::_isFile;
+
+

variable _path

+
String StaticRequestHandler::_path;
+
+

variable _uri

+
String StaticRequestHandler::_uri;
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/detail/RequestHandlersImpl.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_stream_string/index.html b/ltapi/class_stream_string/index.html new file mode 100644 index 000000000..8328a99d9 --- /dev/null +++ b/ltapi/class_stream_string/index.html @@ -0,0 +1,2433 @@ + + + + + + + + + + + + + + + + + + + + + + + + StreamString - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Class StreamString

+

ClassList > StreamString

+

More...

+
    +
  • #include <StreamString.h>
  • +
+

Inherits the following classes: Stream, String

+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
intavailable () override
voidflush () override
intpeek () override
intread () override
size_twrite (const uint8_t * buffer, size_t size) override
size_twrite (uint8_t data) override
+

Detailed Description

+

StreamString.h

+

Copyright (c) 2015 Markus Sattler. All rights reserved.

+

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

+

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

+

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

+

Public Functions Documentation

+

function available

+
int StreamString::available () override
+
+

function flush

+
void StreamString::flush () override
+
+

function peek

+
int StreamString::peek () override
+
+

function read

+
int StreamString::read () override
+
+

function write [1/2]

+
size_t StreamString::write (
+    const uint8_t * buffer,
+    size_t size
+) override
+
+

StreamString.cpp

+

Copyright (c) 2015 Markus Sattler. All rights reserved. This file is part of the esp8266 core for Arduino environment.

+

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

+

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

+

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

+

function write [2/2]

+
size_t StreamString::write (
+    uint8_t data
+) override
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/StreamString/StreamString.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_update_class/index.html b/ltapi/class_update_class/index.html new file mode 100644 index 000000000..1726d3ad7 --- /dev/null +++ b/ltapi/class_update_class/index.html @@ -0,0 +1,3153 @@ + + + + + + + + + + + + + + + + + + + + + + + + Update - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

Class UpdateClass

+

ClassList > UpdateClass

+

Public Types

+ + + + + + + + + + + + + +
TypeName
typedef std::function< void(size_t, size_t)>THandlerFunction_Progress
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
voidabort ()
Same as end() .
boolbegin (size_t size=UPDATE_SIZE_UNKNOWN, int command=U_FLASH, int ledPin=-1, uint8_t ledOn=LOW, const char * label=nullptr)
Initialize the update process.
voidclearError ()
Clear all errors. This is NOT recommended.
boolend (bool evenIfRemaining=false)
Finalize the update process. Check for errors and update completion, then activate the new firmware image.
const char *errorString () const
Get a textual description of the error.
const char *getBoardName ()
Get target board name from UF2 info.
UpdateErrorgetError () const
Get Arduino error code of the update.
uint16_tgetErrorCode () const
Get combined error code of the update.
const char *getFirmwareName ()
Get firmware name from UF2 info.
const char *getFirmwareVersion ()
Get firmware version from UF2 info.
const char *getLibreTinyVersion ()
Get LibreTiny version from UF2 info.
uf2_err_tgetUF2Error () const
Get UF2OTA error code of the update.
boolhasError () const
Check if any error has occurred (incl. aborting the update).
boolisFinished ()
Check if the update process hasn't been started or has been completed.
boolisRunning ()
Check if the update process has been started.
voidmd5 (uint8_t * result)
Get calculated MD5 digest of the firmware.
Stringmd5String ()
Return a hexadecimal string of calculated firmware MD5 sum.
UpdateClass &onProgress (THandlerFunction_Progress handler)
Set the callback invoked after writing data to flash.
voidprintError (Print & out) const
Print string error info to the stream.
size_tprogress ()
Return amount of bytes already written.
size_tremaining ()
Return amount of bytes remaining to write.
boolsetMD5 (const char * md5)
Set the expected MD5 of the firmware (hexadecimal string).
size_tsize ()
Return complete update image size.
size_twrite (const uint8_t * data, size_t len)
Write a chunk of data to the buffer or flash memory.
size_twriteStream (Stream & data)
Write all data remaining in the given stream.
+

Public Static Functions

+ + + + + + + + + + + + + + + + + +
TypeName
boolcanRollBack ()
Check if OTA rollback is possible (switching the stored index to another partition).
boolrollBack ()
Try to switch OTA index to the other image. For single-OTA chips, only check if the upgrade image is valid.
+

Public Types Documentation

+

typedef THandlerFunction_Progress

+
typedef std::function<void(size_t, size_t)> UpdateClass::THandlerFunction_Progress;
+
+

Public Functions Documentation

+

function abort

+
inline void UpdateClass::abort () 
+
+

function begin

+

Initialize the update process. +

bool UpdateClass::begin (
+    size_t size=UPDATE_SIZE_UNKNOWN,
+    int command=U_FLASH,
+    int ledPin=-1,
+    uint8_t ledOn=LOW,
+    const char * label=nullptr
+) 
+

+

Parameters:

+
    +
  • size total UF2 file size
  • +
  • command must be U_FLASH
  • +
+

Returns:

+

false if parameters are invalid or update is running, true otherwise

+

function clearError

+
void UpdateClass::clearError () 
+
+

function end

+

Finalize the update process. Check for errors and update completion, then activate the new firmware image. +

bool UpdateClass::end (
+    bool evenIfRemaining=false
+) 
+

+

Parameters:

+
    +
  • evenIfRemaining don't raise errors if still in progress
  • +
+

Returns:

+

false in case of errors or no update running; true otherwise

+

function errorString

+
const char * UpdateClass::errorString () const
+
+

function getBoardName

+
inline const char * UpdateClass::getBoardName () 
+
+

function getError

+
inline UpdateError UpdateClass::getError () const
+
+

function getErrorCode

+
uint16_t UpdateClass::getErrorCode () const
+
+

function getFirmwareName

+
inline const char * UpdateClass::getFirmwareName () 
+
+

function getFirmwareVersion

+
inline const char * UpdateClass::getFirmwareVersion () 
+
+

function getLibreTinyVersion

+
inline const char * UpdateClass::getLibreTinyVersion () 
+
+

function getUF2Error

+
inline uf2_err_t UpdateClass::getUF2Error () const
+
+

function hasError

+
bool UpdateClass::hasError () const
+
+

function isFinished

+
inline bool UpdateClass::isFinished () 
+
+

function isRunning

+
inline bool UpdateClass::isRunning () 
+
+

function md5

+
void UpdateClass::md5 (
+    uint8_t * result
+) 
+
+

function md5String

+
String UpdateClass::md5String () 
+
+

function onProgress

+
UpdateClass & UpdateClass::onProgress (
+    THandlerFunction_Progress handler
+) 
+
+

function printError

+
void UpdateClass::printError (
+    Print & out
+) const
+
+

function progress

+
inline size_t UpdateClass::progress () 
+
+

function remaining

+
inline size_t UpdateClass::remaining () 
+
+

function setMD5

+
bool UpdateClass::setMD5 (
+    const char * md5
+) 
+
+

function size

+
inline size_t UpdateClass::size () 
+
+

function write

+

Write a chunk of data to the buffer or flash memory. +

size_t UpdateClass::write (
+    const uint8_t * data,
+    size_t len
+) 
+

+

It's advised to write in 512-byte chunks (or its multiples).

+

Parameters:

+
    +
  • data chunk of data
  • +
  • len length of the chunk
  • +
+

Returns:

+

size_t amount of bytes written

+

function writeStream

+

Write all data remaining in the given stream. +

size_t UpdateClass::writeStream (
+    Stream & data
+) 
+

+

If the stream doesn't produce any data within UPDATE_TIMEOUT_MS, the update process will be aborted.

+

Parameters:

+
    +
  • data stream to read from
  • +
+

Returns:

+

size_t amount of bytes written

+

Public Static Functions Documentation

+

function canRollBack

+

Check if OTA rollback is possible (switching the stored index to another partition). +

static bool UpdateClass::canRollBack () 
+

+

Note that this is not the same as "switching" OTA with revert=true.

+

Returns:

+

true if 2nd image is valid and the chip is dual-OTA; false otherwise

+

function rollBack

+

Try to switch OTA index to the other image. For single-OTA chips, only check if the upgrade image is valid. +

static bool UpdateClass::rollBack () 
+

+

This can be used to "activate" the upgrade after flashing.

+

Parameters:

+
    +
  • revert switch if (and only if) the other image is already marked as active (i.e. switch back to the running image)
  • +
+

Returns:

+

false if the second image (or upgrade image) is not valid; false if writing failed; true otherwise

+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/Update/Update.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_uri/index.html b/ltapi/class_uri/index.html new file mode 100644 index 000000000..10b7b9240 --- /dev/null +++ b/ltapi/class_uri/index.html @@ -0,0 +1,2490 @@ + + + + + + + + + + + + + + + + + + + + Class Uri - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

Class Uri

+

ClassList > Uri

+

Inherited by the following classes: UriBraces, UriGlob, UriRegex

+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
Uri (const char * uri)
Uri (const String & uri)
Uri (const __FlashStringHelper * uri)
virtual boolcanHandle (const String & requestUri, __attribute__((unused)) std::vector< String > & pathArgs)
virtual Uri *clone () const
virtual voidinitPathArgs (__attribute__((unused)) std::vector< String > & pathArgs)
virtual~Uri ()
+

Protected Attributes

+ + + + + + + + + + + + + +
TypeName
const String_uri
+

Public Functions Documentation

+

function Uri [1/3]

+
inline Uri::Uri (
+    const char * uri
+) 
+
+

function Uri [2/3]

+
inline Uri::Uri (
+    const String & uri
+) 
+
+

function Uri [3/3]

+
inline Uri::Uri (
+    const __FlashStringHelper * uri
+) 
+
+

function canHandle

+
inline virtual bool Uri::canHandle (
+    const String & requestUri,
+    __attribute__((unused)) std::vector< String > & pathArgs
+) 
+
+

function clone

+
inline virtual Uri * Uri::clone () const
+
+

function initPathArgs

+
inline virtual void Uri::initPathArgs (
+    __attribute__((unused)) std::vector< String > & pathArgs
+) 
+
+

function ~Uri

+
inline virtual Uri::~Uri () 
+
+

Protected Attributes Documentation

+

variable _uri

+
const String Uri::_uri;
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/Uri.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_uri_braces/index.html b/ltapi/class_uri_braces/index.html new file mode 100644 index 000000000..565945d61 --- /dev/null +++ b/ltapi/class_uri_braces/index.html @@ -0,0 +1,2485 @@ + + + + + + + + + + + + + + + + + + + + Class UriBraces - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

Class UriBraces

+

ClassList > UriBraces

+

Inherits the following classes: Uri

+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
UriBraces (const char * uri)
UriBraces (const String & uri)
boolcanHandle (const String & requestUri, std::vector< String > & pathArgs) override
virtual Uri *clone () override const
voidinitPathArgs (std::vector< String > & pathArgs) override
+

Public Functions inherited from Uri

+

See Uri

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
Uri (const char * uri)
Uri (const String & uri)
Uri (const __FlashStringHelper * uri)
virtual boolcanHandle (const String & requestUri, __attribute__((unused)) std::vector< String > & pathArgs)
virtual Uri *clone () const
virtual voidinitPathArgs (__attribute__((unused)) std::vector< String > & pathArgs)
virtual~Uri ()
+

Protected Attributes inherited from Uri

+

See Uri

+ + + + + + + + + + + + + +
TypeName
const String_uri
+

Public Functions Documentation

+

function UriBraces [1/2]

+
inline explicit UriBraces::UriBraces (
+    const char * uri
+) 
+
+

function UriBraces [2/2]

+
inline explicit UriBraces::UriBraces (
+    const String & uri
+) 
+
+

function canHandle

+
inline bool UriBraces::canHandle (
+    const String & requestUri,
+    std::vector< String > & pathArgs
+) override
+
+

function clone

+
inline virtual Uri * UriBraces::clone () override const
+
+

Implements Uri::clone

+

function initPathArgs

+
inline void UriBraces::initPathArgs (
+    std::vector< String > & pathArgs
+) override
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/uri/UriBraces.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_uri_glob/index.html b/ltapi/class_uri_glob/index.html new file mode 100644 index 000000000..411f54179 --- /dev/null +++ b/ltapi/class_uri_glob/index.html @@ -0,0 +1,2470 @@ + + + + + + + + + + + + + + + + + + + + Class UriGlob - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

Class UriGlob

+

ClassList > UriGlob

+

Inherits the following classes: Uri

+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
UriGlob (const char * uri)
UriGlob (const String & uri)
virtual boolcanHandle (const String & requestUri, __attribute__((unused)) std::vector< String > & pathArgs) override
virtual Uri *clone () override const
+

Public Functions inherited from Uri

+

See Uri

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
Uri (const char * uri)
Uri (const String & uri)
Uri (const __FlashStringHelper * uri)
virtual boolcanHandle (const String & requestUri, __attribute__((unused)) std::vector< String > & pathArgs)
virtual Uri *clone () const
virtual voidinitPathArgs (__attribute__((unused)) std::vector< String > & pathArgs)
virtual~Uri ()
+

Protected Attributes inherited from Uri

+

See Uri

+ + + + + + + + + + + + + +
TypeName
const String_uri
+

Public Functions Documentation

+

function UriGlob [1/2]

+
inline explicit UriGlob::UriGlob (
+    const char * uri
+) 
+
+

function UriGlob [2/2]

+
inline explicit UriGlob::UriGlob (
+    const String & uri
+) 
+
+

function canHandle

+
inline virtual bool UriGlob::canHandle (
+    const String & requestUri,
+    __attribute__((unused)) std::vector< String > & pathArgs
+) override
+
+

Implements Uri::canHandle

+

function clone

+
inline virtual Uri * UriGlob::clone () override const
+
+

Implements Uri::clone

+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/uri/UriGlob.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_uri_regex/index.html b/ltapi/class_uri_regex/index.html new file mode 100644 index 000000000..0d1933f45 --- /dev/null +++ b/ltapi/class_uri_regex/index.html @@ -0,0 +1,2485 @@ + + + + + + + + + + + + + + + + + + + + Class UriRegex - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

Class UriRegex

+

ClassList > UriRegex

+

Inherits the following classes: Uri

+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
UriRegex (const char * uri)
UriRegex (const String & uri)
boolcanHandle (const String & requestUri, std::vector< String > & pathArgs) override
virtual Uri *clone () override const
voidinitPathArgs (std::vector< String > & pathArgs) override
+

Public Functions inherited from Uri

+

See Uri

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
Uri (const char * uri)
Uri (const String & uri)
Uri (const __FlashStringHelper * uri)
virtual boolcanHandle (const String & requestUri, __attribute__((unused)) std::vector< String > & pathArgs)
virtual Uri *clone () const
virtual voidinitPathArgs (__attribute__((unused)) std::vector< String > & pathArgs)
virtual~Uri ()
+

Protected Attributes inherited from Uri

+

See Uri

+ + + + + + + + + + + + + +
TypeName
const String_uri
+

Public Functions Documentation

+

function UriRegex [1/2]

+
inline explicit UriRegex::UriRegex (
+    const char * uri
+) 
+
+

function UriRegex [2/2]

+
inline explicit UriRegex::UriRegex (
+    const String & uri
+) 
+
+

function canHandle

+
inline bool UriRegex::canHandle (
+    const String & requestUri,
+    std::vector< String > & pathArgs
+) override
+
+

function clone

+
inline virtual Uri * UriRegex::clone () override const
+
+

Implements Uri::clone

+

function initPathArgs

+
inline void UriRegex::initPathArgs (
+    std::vector< String > & pathArgs
+) override
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/uri/UriRegex.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_web_server/index.html b/ltapi/class_web_server/index.html new file mode 100644 index 000000000..7ab4e4a6f --- /dev/null +++ b/ltapi/class_web_server/index.html @@ -0,0 +1,4817 @@ + + + + + + + + + + + + + + + + + + + + + + + + WebServer - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Class WebServer

+

ClassList > WebServer

+

Public Types

+ + + + + + + + + + + + + +
TypeName
typedef std::function< void(void)>THandlerFunction
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
WebServer (IPAddress addr, int port=80)
WebServer (int port=80)
voidaddHandler (RequestHandler * handler)
Stringarg (String name)
Stringarg (int i)
StringargName (int i)
intargs ()
boolauthenticate (const char * username, const char * password)
virtual voidbegin ()
virtual voidbegin (uint16_t port)
virtual WiFiClientclient ()
virtual voidclose ()
voidcollectHeaders (const char * headerKeys, const size_t headerKeysCount)
voidenableCORS (boolean value=true)
voidenableCrossOrigin (boolean value=true)
voidenableDelay (boolean value)
virtual voidhandleClient ()
boolhasArg (String name)
boolhasHeader (String name)
Stringheader (String name)
Stringheader (int i)
StringheaderName (int i)
intheaders ()
StringhostHeader ()
HTTPMethodmethod ()
voidon (const Uri & uri, THandlerFunction fn)
voidon (const Uri & uri, HTTPMethod method, THandlerFunction fn)
voidon (const Uri & uri, HTTPMethod method, THandlerFunction fn, THandlerFunction ufn)
voidonFileUpload (THandlerFunction ufn)
voidonNotFound (THandlerFunction fn)
StringpathArg (unsigned int i)
voidrequestAuthentication (HTTPAuthMethod mode=BASIC_AUTH, const char * realm=NULL, const String & authFailMsg=String(""))
voidsend (int code, const char * content_type=NULL, const String & content=String(""))
voidsend (int code, char * content_type, const String & content)
voidsend (int code, const String & content_type, const String & content)
voidsendContent (const String & content)
voidsendContent (const char * content, size_t contentLength)
voidsendContent_P (PGM_P content)
voidsendContent_P (PGM_P content, size_t size)
voidsendHeader (const String & name, const String & value, bool first=false)
voidsend_P (int code, PGM_P content_type, PGM_P content)
voidsend_P (int code, PGM_P content_type, PGM_P content, size_t contentLength)
voidserveStatic (const char * uri, fs::FS & fs, const char * path, const char * cache_header=NULL)
voidsetContentLength (const size_t contentLength)
voidstop ()
size_tstreamFile (T & file, const String & contentType)
HTTPUpload &upload ()
Stringuri ()
virtual~WebServer ()
+

Public Static Functions

+ + + + + + + + + + + + + +
TypeName
StringurlDecode (const String & text)
+

Protected Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
bool_chunked
size_t_contentLength
boolean_corsEnabled
int_currentArgCount
RequestArgument *_currentArgs
WiFiClient_currentClient
RequestHandler *_currentHandler
RequestArgument *_currentHeaders
HTTPMethod_currentMethod
HTTPClientStatus_currentStatus
std::unique_ptr< HTTPUpload >_currentUpload
String_currentUri
uint8_t_currentVersion
THandlerFunction_fileUploadHandler
RequestHandler *_firstHandler
int_headerKeysCount
String_hostHeader
RequestHandler *_lastHandler
THandlerFunction_notFoundHandler
boolean_nullDelay
RequestArgument *_postArgs
int_postArgsLen
String_responseHeaders
WiFiServer_server
String_snonce
String_sopaque
String_srealm
unsigned long_statusChange
+

Protected Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
void_addRequestHandler (RequestHandler * handler)
bool_collectHeader (const char * headerName, const char * headerValue)
virtual size_t_currentClientWrite (const char * b, size_t l)
virtual size_t_currentClientWrite_P (PGM_P b, size_t l)
String_extractParam (String & authReq, const String & param, const char delimit='"')
void_finalizeResponse ()
String_getRandomHexString ()
void_handleRequest ()
void_parseArguments (String data)
bool_parseForm (WiFiClient & client, String boundary, uint32_t len)
bool_parseFormUploadAborted ()
bool_parseRequest (WiFiClient & client)
void_prepareHeader (String & response, int code, const char * content_type, size_t contentLength)
void_streamFileCore (const size_t fileSize, const String & fileName, const String & contentType)
int_uploadReadByte (WiFiClient & client)
void_uploadWriteByte (uint8_t b)
+

Protected Static Functions

+ + + + + + + + + + + + + +
TypeName
String_responseCodeToString (int code)
+

Public Types Documentation

+

typedef THandlerFunction

+
typedef std::function<void(void)> WebServer::THandlerFunction;
+
+

Public Functions Documentation

+

function WebServer [1/2]

+
WebServer::WebServer (
+    IPAddress addr,
+    int port=80
+) 
+
+

function WebServer [2/2]

+
WebServer::WebServer (
+    int port=80
+) 
+
+

function addHandler

+
void WebServer::addHandler (
+    RequestHandler * handler
+) 
+
+

function arg [1/2]

+
String WebServer::arg (
+    String name
+) 
+
+

function arg [2/2]

+
String WebServer::arg (
+    int i
+) 
+
+

function argName

+
String WebServer::argName (
+    int i
+) 
+
+

function args

+
int WebServer::args () 
+
+

function authenticate

+
bool WebServer::authenticate (
+    const char * username,
+    const char * password
+) 
+
+

function begin [1/2]

+
virtual void WebServer::begin () 
+
+

function begin [2/2]

+
virtual void WebServer::begin (
+    uint16_t port
+) 
+
+

function client

+
inline virtual WiFiClient WebServer::client () 
+
+

function close

+
virtual void WebServer::close () 
+
+

function collectHeaders

+
void WebServer::collectHeaders (
+    const char * headerKeys,
+    const size_t headerKeysCount
+) 
+
+

function enableCORS

+
void WebServer::enableCORS (
+    boolean value=true
+) 
+
+

function enableCrossOrigin

+
void WebServer::enableCrossOrigin (
+    boolean value=true
+) 
+
+

function enableDelay

+
void WebServer::enableDelay (
+    boolean value
+) 
+
+

function handleClient

+
virtual void WebServer::handleClient () 
+
+

function hasArg

+
bool WebServer::hasArg (
+    String name
+) 
+
+

function hasHeader

+
bool WebServer::hasHeader (
+    String name
+) 
+
+

function header [1/2]

+
String WebServer::header (
+    String name
+) 
+
+

function header [2/2]

+
String WebServer::header (
+    int i
+) 
+
+

function headerName

+
String WebServer::headerName (
+    int i
+) 
+
+

function headers

+
int WebServer::headers () 
+
+

function hostHeader

+
String WebServer::hostHeader () 
+
+

function method

+
inline HTTPMethod WebServer::method () 
+
+

function on [1/3]

+
void WebServer::on (
+    const Uri & uri,
+    THandlerFunction fn
+) 
+
+

function on [2/3]

+
void WebServer::on (
+    const Uri & uri,
+    HTTPMethod method,
+    THandlerFunction fn
+) 
+
+

function on [3/3]

+
void WebServer::on (
+    const Uri & uri,
+    HTTPMethod method,
+    THandlerFunction fn,
+    THandlerFunction ufn
+) 
+
+

function onFileUpload

+
void WebServer::onFileUpload (
+    THandlerFunction ufn
+) 
+
+

function onNotFound

+
void WebServer::onNotFound (
+    THandlerFunction fn
+) 
+
+

function pathArg

+
String WebServer::pathArg (
+    unsigned int i
+) 
+
+

function requestAuthentication

+
void WebServer::requestAuthentication (
+    HTTPAuthMethod mode=BASIC_AUTH,
+    const char * realm=NULL,
+    const String & authFailMsg=String("")
+) 
+
+

function send [1/3]

+
void WebServer::send (
+    int code,
+    const char * content_type=NULL,
+    const String & content=String("")
+) 
+
+

function send [2/3]

+
void WebServer::send (
+    int code,
+    char * content_type,
+    const String & content
+) 
+
+

function send [3/3]

+
void WebServer::send (
+    int code,
+    const String & content_type,
+    const String & content
+) 
+
+

function sendContent [1/2]

+
void WebServer::sendContent (
+    const String & content
+) 
+
+

function sendContent [2/2]

+
void WebServer::sendContent (
+    const char * content,
+    size_t contentLength
+) 
+
+

function sendContent_P [1/2]

+
void WebServer::sendContent_P (
+    PGM_P content
+) 
+
+

function sendContent_P [2/2]

+
void WebServer::sendContent_P (
+    PGM_P content,
+    size_t size
+) 
+
+

function sendHeader

+
void WebServer::sendHeader (
+    const String & name,
+    const String & value,
+    bool first=false
+) 
+
+

function send_P [1/2]

+
void WebServer::send_P (
+    int code,
+    PGM_P content_type,
+    PGM_P content
+) 
+
+

function send_P [2/2]

+
void WebServer::send_P (
+    int code,
+    PGM_P content_type,
+    PGM_P content,
+    size_t contentLength
+) 
+
+

function serveStatic

+
void WebServer::serveStatic (
+    const char * uri,
+    fs::FS & fs,
+    const char * path,
+    const char * cache_header=NULL
+) 
+
+

function setContentLength

+
void WebServer::setContentLength (
+    const size_t contentLength
+) 
+
+

function stop

+
void WebServer::stop () 
+
+

function streamFile

+
template<typename T typename T>
+inline size_t WebServer::streamFile (
+    T & file,
+    const String & contentType
+) 
+
+

function upload

+
inline HTTPUpload & WebServer::upload () 
+
+

function uri

+
inline String WebServer::uri () 
+
+

function ~WebServer

+
virtual WebServer::~WebServer () 
+
+

Public Static Functions Documentation

+

function urlDecode

+
static String WebServer::urlDecode (
+    const String & text
+) 
+
+

Protected Attributes Documentation

+

variable _chunked

+
bool WebServer::_chunked;
+
+

variable _contentLength

+
size_t WebServer::_contentLength;
+
+

variable _corsEnabled

+
boolean WebServer::_corsEnabled;
+
+

variable _currentArgCount

+
int WebServer::_currentArgCount;
+
+

variable _currentArgs

+
RequestArgument* WebServer::_currentArgs;
+
+

variable _currentClient

+
WiFiClient WebServer::_currentClient;
+
+

variable _currentHandler

+
RequestHandler* WebServer::_currentHandler;
+
+

variable _currentHeaders

+
RequestArgument* WebServer::_currentHeaders;
+
+

variable _currentMethod

+
HTTPMethod WebServer::_currentMethod;
+
+

variable _currentStatus

+
HTTPClientStatus WebServer::_currentStatus;
+
+

variable _currentUpload

+
std::unique_ptr<HTTPUpload> WebServer::_currentUpload;
+
+

variable _currentUri

+
String WebServer::_currentUri;
+
+

variable _currentVersion

+
uint8_t WebServer::_currentVersion;
+
+

variable _fileUploadHandler

+
THandlerFunction WebServer::_fileUploadHandler;
+
+

variable _firstHandler

+
RequestHandler* WebServer::_firstHandler;
+
+

variable _headerKeysCount

+
int WebServer::_headerKeysCount;
+
+

variable _hostHeader

+
String WebServer::_hostHeader;
+
+

variable _lastHandler

+
RequestHandler* WebServer::_lastHandler;
+
+

variable _notFoundHandler

+
THandlerFunction WebServer::_notFoundHandler;
+
+

variable _nullDelay

+
boolean WebServer::_nullDelay;
+
+

variable _postArgs

+
RequestArgument* WebServer::_postArgs;
+
+

variable _postArgsLen

+
int WebServer::_postArgsLen;
+
+

variable _responseHeaders

+
String WebServer::_responseHeaders;
+
+

variable _server

+
WiFiServer WebServer::_server;
+
+

variable _snonce

+
String WebServer::_snonce;
+
+

variable _sopaque

+
String WebServer::_sopaque;
+
+

variable _srealm

+
String WebServer::_srealm;
+
+

variable _statusChange

+
unsigned long WebServer::_statusChange;
+
+

Protected Functions Documentation

+

function _addRequestHandler

+
void WebServer::_addRequestHandler (
+    RequestHandler * handler
+) 
+
+

function _collectHeader

+
bool WebServer::_collectHeader (
+    const char * headerName,
+    const char * headerValue
+) 
+
+

function _currentClientWrite

+
inline virtual size_t WebServer::_currentClientWrite (
+    const char * b,
+    size_t l
+) 
+
+

function _currentClientWrite_P

+
inline virtual size_t WebServer::_currentClientWrite_P (
+    PGM_P b,
+    size_t l
+) 
+
+

function _extractParam

+
String WebServer::_extractParam (
+    String & authReq,
+    const String & param,
+    const char delimit='"'
+) 
+
+

function _finalizeResponse

+
void WebServer::_finalizeResponse () 
+
+

function _getRandomHexString

+
String WebServer::_getRandomHexString () 
+
+

function _handleRequest

+
void WebServer::_handleRequest () 
+
+

function _parseArguments

+
void WebServer::_parseArguments (
+    String data
+) 
+
+

function _parseForm

+
bool WebServer::_parseForm (
+    WiFiClient & client,
+    String boundary,
+    uint32_t len
+) 
+
+

function _parseFormUploadAborted

+
bool WebServer::_parseFormUploadAborted () 
+
+

function _parseRequest

+
bool WebServer::_parseRequest (
+    WiFiClient & client
+) 
+
+

function _prepareHeader

+
void WebServer::_prepareHeader (
+    String & response,
+    int code,
+    const char * content_type,
+    size_t contentLength
+) 
+
+

function _streamFileCore

+
void WebServer::_streamFileCore (
+    const size_t fileSize,
+    const String & fileName,
+    const String & contentType
+) 
+
+

function _uploadReadByte

+
int WebServer::_uploadReadByte (
+    WiFiClient & client
+) 
+
+

function _uploadWriteByte

+
void WebServer::_uploadWriteByte (
+    uint8_t b
+) 
+
+

Protected Static Functions Documentation

+

function _responseCodeToString

+
static String WebServer::_responseCodeToString (
+    int code
+) 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/WebServer.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_wi_fi_class/index.html b/ltapi/class_wi_fi_class/index.html new file mode 100644 index 000000000..08784be61 --- /dev/null +++ b/ltapi/class_wi_fi_class/index.html @@ -0,0 +1,4623 @@ + + + + + + + + + + + + + + + + + + + + + + + + WiFi - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Class WiFiClass

+

ClassList > WiFiClass

+

Public Attributes

+ + + + + + + + + + + + + + + + + +
TypeName
void *data
WiFiScanData *scan = = NULL
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
uint8_t *BSSID ()
uint8_t *BSSID (uint8_t networkItem)
StringBSSIDstr ()
StringBSSIDstr (uint8_t networkItem)
int8_tRSSI ()
int32_tRSSI (uint8_t networkItem)
const StringSSID ()
StringSSID (uint8_t networkItem)
WiFiClass ()
WiFiStatusbegin (const char * ssid, const char * passphrase=NULL, int32_t channel=0, const uint8_t * bssid=NULL, bool connect=true)
WiFiStatusbegin (char * ssid, char * passphrase=NULL, int32_t channel=0, const uint8_t * bssid=NULL, bool connect=true)
IPAddressbroadcastIP ()
int32_tchannel ()
int32_tchannel (uint8_t networkItem)
boolconfig (IPAddress localIP, IPAddress gateway, IPAddress subnet, IPAddress dns1=(uint32_t) 0x00000000, IPAddress dns2=(uint32_t) 0x00000000)
voiddataFree ()
voiddataInitialize ()
booldisconnect (bool wifiOff=false)
IPAddressdnsIP (uint8_t dns_no=0)
boolenableAP (bool enable)
boolenableIpV6 ()
boolenableSTA (bool enable)
WiFiAuthModeencryptionType (uint8_t networkItem)
IPAddressgatewayIP ()
boolgetAutoReconnect ()
WiFiAuthModegetEncryption ()
const char *getHostname ()
WiFiModegetMode ()
boolgetNetworkInfo (uint8_t networkItem, String & ssid, WiFiAuthMode & encryptionType, int32_t & RSSI, uint8_t *& BSSID, int32_t & channel)
boolgetSleep ()
intgetTxPower ()
inthostByName (const char * hostname, IPAddress & aResult)
IPAddresshostByName (const char * hostname)
boolhostname (const String & aHostname)
boolisConnected ()
IPAddresslocalIP ()
IPv6AddresslocalIPv6 ()
uint8_t *macAddress (uint8_t * mac)
StringmacAddress ()
boolmode (WiFiMode mode)
boolmodePriv (WiFiMode mode, WiFiModeAction sta, WiFiModeAction ap)
IPAddressnetworkID ()
uint16_tonEvent (EventCb callback, EventId eventId=ARDUINO_EVENT_MAX)
uint16_tonEvent (EventFuncCb callback, EventId eventId=ARDUINO_EVENT_MAX)
uint16_tonEvent (EventSysCb callback, EventId eventId=ARDUINO_EVENT_MAX)
voidprintDiag (Print & dest)
const Stringpsk ()
boolreconnect (const uint8_t * bssid=NULL)
voidremoveEvent (EventCb callback, EventId eventId)
voidremoveEvent (EventSysCb callback, EventId eventId)
voidremoveEvent (uint16_t id)
uint8_tscanAlloc (uint8_t count)
int16_tscanComplete ()
voidscanDelete ()
voidscanInit ()
int16_tscanNetworks (bool async=false, bool showHidden=false, bool passive=false, uint32_t maxMsPerChannel=300, uint8_t channel=0)
boolsetAutoReconnect (bool autoReconnect)
boolsetHostname (const char * hostname)
boolsetMacAddress (const uint8_t * mac)
boolsetSleep (bool enable)
boolsetTxPower (int power)
boolsoftAP (const char * ssid, const char * passphrase=NULL, int channel=1, bool ssidHidden=false, int maxClients=4)
IPAddresssoftAPBroadcastIP ()
boolsoftAPConfig (IPAddress localIP, IPAddress gateway, IPAddress subnet)
IPAddresssoftAPIP ()
IPv6AddresssoftAPIPv6 ()
IPAddresssoftAPNetworkID ()
const StringsoftAPSSID (void)
uint8_tsoftAPSubnetCIDR ()
IPAddresssoftAPSubnetMask ()
boolsoftAPdisconnect (bool wifiOff=false)
boolsoftAPenableIpV6 ()
const char *softAPgetHostname ()
uint8_tsoftAPgetStationNum ()
uint8_t *softAPmacAddress (uint8_t * mac)
StringsoftAPmacAddress (void)
boolsoftAPsetHostname (const char * hostname)
WiFiStatusstatus ()
uint8_tsubnetCIDR ()
IPAddresssubnetMask ()
boolvalidate (const char * ssid, const char * passphrase)
WiFiStatuswaitForConnectResult (unsigned long timeout)
~WiFiClass ()
+

Public Static Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
IPAddresscalculateBroadcast (IPAddress ip, IPAddress subnet)
IPAddresscalculateNetworkID (IPAddress ip, IPAddress subnet)
uint8_tcalculateSubnetCIDR (IPAddress subnetMask)
StringmacToString (uint8_t * mac)
voidpostEvent (EventId eventId, EventInfo eventInfo)
voidresetNetworkInfo (WiFiNetworkInfo & info)
+

Protected Static Attributes

+ + + + + + + + + + + + + +
TypeName
std::vector< EventHandler >handlers
+

Public Attributes Documentation

+

variable data

+
void* WiFiClass::data;
+
+

variable scan

+
WiFiScanData* WiFiClass::scan;
+
+

Public Functions Documentation

+

function BSSID [1/2]

+
uint8_t * WiFiClass::BSSID () 
+
+

function BSSID [2/2]

+
uint8_t * WiFiClass::BSSID (
+    uint8_t networkItem
+) 
+
+

function BSSIDstr [1/2]

+
String WiFiClass::BSSIDstr () 
+
+

function BSSIDstr [2/2]

+
String WiFiClass::BSSIDstr (
+    uint8_t networkItem
+) 
+
+

function RSSI [1/2]

+
int8_t WiFiClass::RSSI () 
+
+

function RSSI [2/2]

+
int32_t WiFiClass::RSSI (
+    uint8_t networkItem
+) 
+
+

function SSID [1/2]

+
const String WiFiClass::SSID () 
+
+

function SSID [2/2]

+
String WiFiClass::SSID (
+    uint8_t networkItem
+) 
+
+

function WiFiClass

+
WiFiClass::WiFiClass () 
+
+

function begin [1/2]

+
WiFiStatus WiFiClass::begin (
+    const char * ssid,
+    const char * passphrase=NULL,
+    int32_t channel=0,
+    const uint8_t * bssid=NULL,
+    bool connect=true
+) 
+
+

function begin [2/2]

+
WiFiStatus WiFiClass::begin (
+    char * ssid,
+    char * passphrase=NULL,
+    int32_t channel=0,
+    const uint8_t * bssid=NULL,
+    bool connect=true
+) 
+
+

function broadcastIP

+
IPAddress WiFiClass::broadcastIP () 
+
+

function channel [1/2]

+
int32_t WiFiClass::channel () 
+
+

function channel [2/2]

+
int32_t WiFiClass::channel (
+    uint8_t networkItem
+) 
+
+

function config

+
bool WiFiClass::config (
+    IPAddress localIP,
+    IPAddress gateway,
+    IPAddress subnet,
+    IPAddress dns1=(uint32_t) 0x00000000,
+    IPAddress dns2=(uint32_t) 0x00000000
+) 
+
+

function dataFree

+
void WiFiClass::dataFree () 
+
+

function dataInitialize

+
void WiFiClass::dataInitialize () 
+
+

function disconnect

+
bool WiFiClass::disconnect (
+    bool wifiOff=false
+) 
+
+

function dnsIP

+
IPAddress WiFiClass::dnsIP (
+    uint8_t dns_no=0
+) 
+
+

function enableAP

+
bool WiFiClass::enableAP (
+    bool enable
+) 
+
+

function enableIpV6

+
bool WiFiClass::enableIpV6 () 
+
+

function enableSTA

+
bool WiFiClass::enableSTA (
+    bool enable
+) 
+
+

function encryptionType

+
WiFiAuthMode WiFiClass::encryptionType (
+    uint8_t networkItem
+) 
+
+

function gatewayIP

+
IPAddress WiFiClass::gatewayIP () 
+
+

function getAutoReconnect

+
bool WiFiClass::getAutoReconnect () 
+
+

function getEncryption

+
WiFiAuthMode WiFiClass::getEncryption () 
+
+

function getHostname

+
const char * WiFiClass::getHostname () 
+
+

function getMode

+
WiFiMode WiFiClass::getMode () 
+
+

function getNetworkInfo

+
bool WiFiClass::getNetworkInfo (
+    uint8_t networkItem,
+    String & ssid,
+    WiFiAuthMode & encryptionType,
+    int32_t & RSSI,
+    uint8_t *& BSSID,
+    int32_t & channel
+) 
+
+

function getSleep

+
bool WiFiClass::getSleep () 
+
+

function getTxPower

+
int WiFiClass::getTxPower () 
+
+

function hostByName [1/2]

+
int WiFiClass::hostByName (
+    const char * hostname,
+    IPAddress & aResult
+) 
+
+

function hostByName [2/2]

+
IPAddress WiFiClass::hostByName (
+    const char * hostname
+) 
+
+

function hostname

+
inline bool WiFiClass::hostname (
+    const String & aHostname
+) 
+
+

function isConnected

+
bool WiFiClass::isConnected () 
+
+

function localIP

+
IPAddress WiFiClass::localIP () 
+
+

function localIPv6

+
IPv6Address WiFiClass::localIPv6 () 
+
+

function macAddress [1/2]

+
uint8_t * WiFiClass::macAddress (
+    uint8_t * mac
+) 
+
+

function macAddress [2/2]

+
String WiFiClass::macAddress () 
+
+

function mode

+
bool WiFiClass::mode (
+    WiFiMode mode
+) 
+
+

function modePriv

+
bool WiFiClass::modePriv (
+    WiFiMode mode,
+    WiFiModeAction sta,
+    WiFiModeAction ap
+) 
+
+

function networkID

+
IPAddress WiFiClass::networkID () 
+
+

function onEvent [1/3]

+
uint16_t WiFiClass::onEvent (
+    EventCb callback,
+    EventId eventId=ARDUINO_EVENT_MAX
+) 
+
+

function onEvent [2/3]

+
uint16_t WiFiClass::onEvent (
+    EventFuncCb callback,
+    EventId eventId=ARDUINO_EVENT_MAX
+) 
+
+

function onEvent [3/3]

+
uint16_t WiFiClass::onEvent (
+    EventSysCb callback,
+    EventId eventId=ARDUINO_EVENT_MAX
+) 
+
+

function printDiag

+
void WiFiClass::printDiag (
+    Print & dest
+) 
+
+

function psk

+
const String WiFiClass::psk () 
+
+

function reconnect

+
bool WiFiClass::reconnect (
+    const uint8_t * bssid=NULL
+) 
+
+

function removeEvent [1/3]

+
void WiFiClass::removeEvent (
+    EventCb callback,
+    EventId eventId
+) 
+
+

function removeEvent [2/3]

+
void WiFiClass::removeEvent (
+    EventSysCb callback,
+    EventId eventId
+) 
+
+

function removeEvent [3/3]

+
void WiFiClass::removeEvent (
+    uint16_t id
+) 
+
+

function scanAlloc

+
uint8_t WiFiClass::scanAlloc (
+    uint8_t count
+) 
+
+

function scanComplete

+
int16_t WiFiClass::scanComplete () 
+
+

function scanDelete

+
void WiFiClass::scanDelete () 
+
+

function scanInit

+
void WiFiClass::scanInit () 
+
+

function scanNetworks

+
int16_t WiFiClass::scanNetworks (
+    bool async=false,
+    bool showHidden=false,
+    bool passive=false,
+    uint32_t maxMsPerChannel=300,
+    uint8_t channel=0
+) 
+
+

function setAutoReconnect

+
bool WiFiClass::setAutoReconnect (
+    bool autoReconnect
+) 
+
+

function setHostname

+
bool WiFiClass::setHostname (
+    const char * hostname
+) 
+
+

function setMacAddress

+
bool WiFiClass::setMacAddress (
+    const uint8_t * mac
+) 
+
+

function setSleep

+
bool WiFiClass::setSleep (
+    bool enable
+) 
+
+

function setTxPower

+
bool WiFiClass::setTxPower (
+    int power
+) 
+
+

function softAP

+
bool WiFiClass::softAP (
+    const char * ssid,
+    const char * passphrase=NULL,
+    int channel=1,
+    bool ssidHidden=false,
+    int maxClients=4
+) 
+
+

function softAPBroadcastIP

+
IPAddress WiFiClass::softAPBroadcastIP () 
+
+

function softAPConfig

+
bool WiFiClass::softAPConfig (
+    IPAddress localIP,
+    IPAddress gateway,
+    IPAddress subnet
+) 
+
+

function softAPIP

+
IPAddress WiFiClass::softAPIP () 
+
+

function softAPIPv6

+
IPv6Address WiFiClass::softAPIPv6 () 
+
+

function softAPNetworkID

+
IPAddress WiFiClass::softAPNetworkID () 
+
+

function softAPSSID

+
const String WiFiClass::softAPSSID (
+    void
+) 
+
+

function softAPSubnetCIDR

+
uint8_t WiFiClass::softAPSubnetCIDR () 
+
+

function softAPSubnetMask

+
IPAddress WiFiClass::softAPSubnetMask () 
+
+

function softAPdisconnect

+
bool WiFiClass::softAPdisconnect (
+    bool wifiOff=false
+) 
+
+

function softAPenableIpV6

+
bool WiFiClass::softAPenableIpV6 () 
+
+

function softAPgetHostname

+
const char * WiFiClass::softAPgetHostname () 
+
+

function softAPgetStationNum

+
uint8_t WiFiClass::softAPgetStationNum () 
+
+

function softAPmacAddress [1/2]

+
uint8_t * WiFiClass::softAPmacAddress (
+    uint8_t * mac
+) 
+
+

function softAPmacAddress [2/2]

+
String WiFiClass::softAPmacAddress (
+    void
+) 
+
+

function softAPsetHostname

+
bool WiFiClass::softAPsetHostname (
+    const char * hostname
+) 
+
+

function status

+
WiFiStatus WiFiClass::status () 
+
+

function subnetCIDR

+
uint8_t WiFiClass::subnetCIDR () 
+
+

function subnetMask

+
IPAddress WiFiClass::subnetMask () 
+
+

function validate

+
bool WiFiClass::validate (
+    const char * ssid,
+    const char * passphrase
+) 
+
+

function waitForConnectResult

+
WiFiStatus WiFiClass::waitForConnectResult (
+    unsigned long timeout
+) 
+
+

function ~WiFiClass

+
WiFiClass::~WiFiClass () 
+
+

Public Static Functions Documentation

+

function calculateBroadcast

+
static IPAddress WiFiClass::calculateBroadcast (
+    IPAddress ip,
+    IPAddress subnet
+) 
+
+

function calculateNetworkID

+
static IPAddress WiFiClass::calculateNetworkID (
+    IPAddress ip,
+    IPAddress subnet
+) 
+
+

function calculateSubnetCIDR

+
static uint8_t WiFiClass::calculateSubnetCIDR (
+    IPAddress subnetMask
+) 
+
+

function macToString

+
static String WiFiClass::macToString (
+    uint8_t * mac
+) 
+
+

function postEvent

+
static void WiFiClass::postEvent (
+    EventId eventId,
+    EventInfo eventInfo
+) 
+
+

function resetNetworkInfo

+
static void WiFiClass::resetNetworkInfo (
+    WiFiNetworkInfo & info
+) 
+
+

Protected Static Attributes Documentation

+

variable handlers

+
std::vector< EventHandler > WiFiClass::handlers;
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFi.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/class_wi_fi_multi/index.html b/ltapi/class_wi_fi_multi/index.html new file mode 100644 index 000000000..3301a697a --- /dev/null +++ b/ltapi/class_wi_fi_multi/index.html @@ -0,0 +1,2485 @@ + + + + + + + + + + + + + + + + + + + + + + + + WiFiMulti - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Class WiFiMulti

+

ClassList > WiFiMulti

+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
WiFiMulti ()
booladdAP (const char * ssid, const char * passphrase=NULL)
uint8_trun (uint32_t connectTimeout=10000)
~WiFiMulti ()
+

Public Functions Documentation

+

function WiFiMulti

+
WiFiMulti::WiFiMulti () 
+
+

function addAP

+
bool WiFiMulti::addAP (
+    const char * ssid,
+    const char * passphrase=NULL
+) 
+
+

function run

+
uint8_t WiFiMulti::run (
+    uint32_t connectTimeout=10000
+) 
+
+

function ~WiFiMulti

+
WiFiMulti::~WiFiMulti () 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WiFiMulti/WiFiMulti.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/classarduino_1_1_i_pv6_address/index.html b/ltapi/classarduino_1_1_i_pv6_address/index.html new file mode 100644 index 000000000..c414ba328 --- /dev/null +++ b/ltapi/classarduino_1_1_i_pv6_address/index.html @@ -0,0 +1,2910 @@ + + + + + + + + + + + + + + + + + + + + + + + + IPv6Address - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

Class arduino::IPv6Address

+

ClassList > arduino > IPv6Address

+

Inherits the following classes: Printable

+

Public Attributes

+ + + + + + + + + + + + + + + + + +
TypeName
uint8_tbytes
uint32_tdword
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
IPv6Address ()
IPv6Address (const uint8_t * address)
IPv6Address (const uint32_t * address)
boolfromString (const char * address)
boolfromString (const String & address)
operator const uint32_t * () const
operator const uint8_t * () const
IPv6Address &operator= (const uint8_t * address)
booloperator== (const IPv6Address & addr) const
booloperator== (const uint8_t * addr) const
uint8_toperator[] (int index) const
uint8_t &operator[] (int index)
virtual size_tprintTo (Print & p) const
StringtoString () const
virtual~IPv6Address ()
+

Public Attributes Documentation

+

variable bytes

+
uint8_t arduino::IPv6Address::bytes[16];
+
+

variable dword

+
uint32_t arduino::IPv6Address::dword[4];
+
+

Public Functions Documentation

+

function IPv6Address [1/3]

+
arduino::IPv6Address::IPv6Address () 
+
+

function IPv6Address [2/3]

+
arduino::IPv6Address::IPv6Address (
+    const uint8_t * address
+) 
+
+

function IPv6Address [3/3]

+
arduino::IPv6Address::IPv6Address (
+    const uint32_t * address
+) 
+
+

function fromString [1/2]

+
bool arduino::IPv6Address::fromString (
+    const char * address
+) 
+
+

function fromString [2/2]

+
inline bool arduino::IPv6Address::fromString (
+    const String & address
+) 
+
+

function operator const uint32_t *

+
inline arduino::IPv6Address::operator const uint32_t * () const
+
+

function operator const uint8_t *

+
inline arduino::IPv6Address::operator const uint8_t * () const
+
+

function operator=

+
IPv6Address & arduino::IPv6Address::operator= (
+    const uint8_t * address
+) 
+
+

function operator==

+
inline bool arduino::IPv6Address::operator== (
+    const IPv6Address & addr
+) const
+
+

function operator==

+
bool arduino::IPv6Address::operator== (
+    const uint8_t * addr
+) const
+
+

function operator[]

+
inline uint8_t arduino::IPv6Address::operator[] (
+    int index
+) const
+
+

function operator[]

+
inline uint8_t & arduino::IPv6Address::operator[] (
+    int index
+) 
+
+

function printTo

+
virtual size_t arduino::IPv6Address::printTo (
+    Print & p
+) const
+
+

function toString

+
String arduino::IPv6Address::toString () const
+
+

function ~IPv6Address

+
inline virtual arduino::IPv6Address::~IPv6Address () 
+
+

Friends Documentation

+

friend Client

+
class arduino::IPv6Address::Client (
+    Client
+) 
+
+

friend Server

+
class arduino::IPv6Address::Server (
+    Server
+) 
+
+

friend UDP

+
class arduino::IPv6Address::UDP (
+    UDP
+) 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/IPv6Address/IPv6Address.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/classbase64/index.html b/ltapi/classbase64/index.html new file mode 100644 index 000000000..5c3b53243 --- /dev/null +++ b/ltapi/classbase64/index.html @@ -0,0 +1,2387 @@ + + + + + + + + + + + + + + + + + + + + Class base64 - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Class base64

+

ClassList > base64

+

Public Static Functions

+ + + + + + + + + + + + + + + + + +
TypeName
Stringencode (const uint8_t * data, size_t length)
Stringencode (const String & text)
+

Public Static Functions Documentation

+

function encode [1/2]

+
static String base64::encode (
+    const uint8_t * data,
+    size_t length
+) 
+
+

base64.cpp

+

Created on: 09.12.2015

+

Copyright (c) 2015 Markus Sattler. All rights reserved. This file is part of the ESP31B core for Arduino.

+

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

+

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

+

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA convert input data to base64

+

Parameters:

+
    +
  • data const uint8_t *
  • +
  • length size_t
  • +
+

Returns:

+

String

+

function encode [2/2]

+
static String base64::encode (
+    const String & text
+) 
+
+

convert input data to base64

+

Parameters:

+
    +
  • text const String&
  • +
+

Returns:

+

String

+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/base64/base64.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/classcbuf/index.html b/ltapi/classcbuf/index.html new file mode 100644 index 000000000..c3b65de17 --- /dev/null +++ b/ltapi/classcbuf/index.html @@ -0,0 +1,2787 @@ + + + + + + + + + + + + + + + + + + + + Class cbuf - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

Class cbuf

+

ClassList > cbuf

+

Public Attributes

+ + + + + + + + + + + + + +
TypeName
cbuf *next
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
size_tavailable () const
cbuf (size_t size)
boolempty () const
voidflush ()
boolfull () const
intpeek ()
size_tpeek (char * dst, size_t size)
intread ()
size_tread (char * dst, size_t size)
size_tremove (size_t size)
size_tresize (size_t newSize)
size_tresizeAdd (size_t addSize)
size_troom () const
size_tsize ()
size_twrite (char c)
size_twrite (const char * src, size_t size)
~cbuf ()
+

Protected Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
char *_begin
char *_buf
const char *_bufend
char *_end
size_t_size
+

Protected Functions

+ + + + + + + + + + + + + +
TypeName
char *wrap_if_bufend (char * ptr) const
+

Public Attributes Documentation

+

variable next

+
cbuf* cbuf::next;
+
+

Public Functions Documentation

+

function available

+
size_t cbuf::available () const
+
+

function cbuf

+
cbuf::cbuf (
+    size_t size
+) 
+
+

function empty

+
inline bool cbuf::empty () const
+
+

function flush

+
void cbuf::flush () 
+
+

function full

+
inline bool cbuf::full () const
+
+

function peek [1/2]

+
int cbuf::peek () 
+
+

function peek [2/2]

+
size_t cbuf::peek (
+    char * dst,
+    size_t size
+) 
+
+

function read [1/2]

+
int cbuf::read () 
+
+

function read [2/2]

+
size_t cbuf::read (
+    char * dst,
+    size_t size
+) 
+
+

function remove

+
size_t cbuf::remove (
+    size_t size
+) 
+
+

function resize

+
size_t cbuf::resize (
+    size_t newSize
+) 
+
+

function resizeAdd

+
size_t cbuf::resizeAdd (
+    size_t addSize
+) 
+
+

function room

+
size_t cbuf::room () const
+
+

function size

+
size_t cbuf::size () 
+
+

function write [1/2]

+
size_t cbuf::write (
+    char c
+) 
+
+

function write [2/2]

+
size_t cbuf::write (
+    const char * src,
+    size_t size
+) 
+
+

function ~cbuf

+
cbuf::~cbuf () 
+
+

Protected Attributes Documentation

+

variable _begin

+
char* cbuf::_begin;
+
+

variable _buf

+
char* cbuf::_buf;
+
+

variable _bufend

+
const char* cbuf::_bufend;
+
+

variable _end

+
char* cbuf::_end;
+
+

variable _size

+
size_t cbuf::_size;
+
+

Protected Functions Documentation

+

function wrap_if_bufend

+
inline char * cbuf::wrap_if_bufend (
+    char * ptr
+) const
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/cbuf/cbuf.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/classes/index.html b/ltapi/classes/index.html new file mode 100644 index 000000000..f2cdecce7 --- /dev/null +++ b/ltapi/classes/index.html @@ -0,0 +1,2667 @@ + + + + + + + + + + + + + + + + + + + + + + + + Classes - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + + + + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/classfs_1_1_f_s/index.html b/ltapi/classfs_1_1_f_s/index.html new file mode 100644 index 000000000..7c4c828aa --- /dev/null +++ b/ltapi/classfs_1_1_f_s/index.html @@ -0,0 +1,2594 @@ + + + + + + + + + + + + + + + + + + + + Class fs::FS - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

Class fs::FS

+

ClassList > fs > FS

+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
FS (FSImplPtr impl)
boolexists (const char * path)
boolexists (const String & path)
boolmkdir (const char * path)
boolmkdir (const String & path)
Fileopen (const char * path, const char * mode=FILE_READ, const bool create=false)
Fileopen (const String & path, const char * mode=FILE_READ, const bool create=false)
boolremove (const char * path)
boolremove (const String & path)
boolrename (const char * pathFrom, const char * pathTo)
boolrename (const String & pathFrom, const String & pathTo)
boolrmdir (const char * path)
boolrmdir (const String & path)
+

Protected Attributes

+ + + + + + + + + + + + + +
TypeName
FSImplPtr_impl
+

Public Functions Documentation

+

function FS

+
inline fs::FS::FS (
+    FSImplPtr impl
+) 
+
+

function exists [1/2]

+
bool fs::FS::exists (
+    const char * path
+) 
+
+

function exists [2/2]

+
bool fs::FS::exists (
+    const String & path
+) 
+
+

function mkdir [1/2]

+
bool fs::FS::mkdir (
+    const char * path
+) 
+
+

function mkdir [2/2]

+
bool fs::FS::mkdir (
+    const String & path
+) 
+
+

function open [1/2]

+
File fs::FS::open (
+    const char * path,
+    const char * mode=FILE_READ,
+    const bool create=false
+) 
+
+

function open [2/2]

+
File fs::FS::open (
+    const String & path,
+    const char * mode=FILE_READ,
+    const bool create=false
+) 
+
+

function remove [1/2]

+
bool fs::FS::remove (
+    const char * path
+) 
+
+

function remove [2/2]

+
bool fs::FS::remove (
+    const String & path
+) 
+
+

function rename [1/2]

+
bool fs::FS::rename (
+    const char * pathFrom,
+    const char * pathTo
+) 
+
+

function rename [2/2]

+
bool fs::FS::rename (
+    const String & pathFrom,
+    const String & pathTo
+) 
+
+

function rmdir [1/2]

+
bool fs::FS::rmdir (
+    const char * path
+) 
+
+

function rmdir [2/2]

+
bool fs::FS::rmdir (
+    const String & path
+) 
+
+

Protected Attributes Documentation

+

variable _impl

+
FSImplPtr fs::FS::_impl;
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/FS/FS.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/classfs_1_1_f_s_impl/index.html b/ltapi/classfs_1_1_f_s_impl/index.html new file mode 100644 index 000000000..dadcfba7a --- /dev/null +++ b/ltapi/classfs_1_1_f_s_impl/index.html @@ -0,0 +1,2461 @@ + + + + + + + + + + + + + + + + + + + + Class fs::FSImpl - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Class fs::FSImpl

+

ClassList > fs > FSImpl

+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
FSImpl ()
virtual boolexists (const char * path) = 0
virtual boolmkdir (const char * path) = 0
virtual FileImplPtropen (const char * path, const char * mode, const bool create) = 0
virtual boolremove (const char * path) = 0
virtual boolrename (const char * pathFrom, const char * pathTo) = 0
virtual boolrmdir (const char * path) = 0
virtual~FSImpl ()
+

Public Functions Documentation

+

function FSImpl

+
inline fs::FSImpl::FSImpl () 
+
+

function exists

+
virtual bool fs::FSImpl::exists (
+    const char * path
+) = 0
+
+

function mkdir

+
virtual bool fs::FSImpl::mkdir (
+    const char * path
+) = 0
+
+

function open

+
virtual FileImplPtr fs::FSImpl::open (
+    const char * path,
+    const char * mode,
+    const bool create
+) = 0
+
+

function remove

+
virtual bool fs::FSImpl::remove (
+    const char * path
+) = 0
+
+

function rename

+
virtual bool fs::FSImpl::rename (
+    const char * pathFrom,
+    const char * pathTo
+) = 0
+
+

function rmdir

+
virtual bool fs::FSImpl::rmdir (
+    const char * path
+) = 0
+
+

function ~FSImpl

+
inline virtual fs::FSImpl::~FSImpl () 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/FS/FS.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/classfs_1_1_file/index.html b/ltapi/classfs_1_1_file/index.html new file mode 100644 index 000000000..0c1e86b2b --- /dev/null +++ b/ltapi/classfs_1_1_file/index.html @@ -0,0 +1,2715 @@ + + + + + + + + + + + + + + + + + + + + Class fs::File - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

Class fs::File

+

ClassList > fs > File

+

Inherits the following classes: Stream

+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
File (FileImplPtr p=FileImplPtr())
intavailable () override
voidclose ()
voidflush () override
time_tgetLastWrite ()
booleanisDirectory (void)
const char *name () const
FileopenNextFile (const char * mode=FILE_READ)
operator bool () const
const char *path () const
intpeek () override
size_tposition () const
intread () override
size_tread (uint8_t * buf, size_t size)
size_treadBytes (char * buffer, size_t length)
voidrewindDirectory (void)
boolseek (uint32_t pos, SeekMode mode)
boolseek (uint32_t pos)
boolsetBufferSize (size_t size)
size_tsize () const
size_twrite (uint8_t c) override
size_twrite (const uint8_t * buf, size_t size) override
+

Protected Attributes

+ + + + + + + + + + + + + +
TypeName
FileImplPtr_p
+

Public Functions Documentation

+

function File

+
inline fs::File::File (
+    FileImplPtr p=FileImplPtr()
+) 
+
+

function available

+
int fs::File::available () override
+
+

function close

+
void fs::File::close () 
+
+

function flush

+
void fs::File::flush () override
+
+

function getLastWrite

+
time_t fs::File::getLastWrite () 
+
+

function isDirectory

+
boolean fs::File::isDirectory (
+    void
+) 
+
+

function name

+
const char * fs::File::name () const
+
+

function openNextFile

+
File fs::File::openNextFile (
+    const char * mode=FILE_READ
+) 
+
+

function operator bool

+
fs::File::operator bool () const
+
+

function path

+
const char * fs::File::path () const
+
+

function peek

+
int fs::File::peek () override
+
+

function position

+
size_t fs::File::position () const
+
+

function read [1/2]

+
int fs::File::read () override
+
+

function read [2/2]

+
size_t fs::File::read (
+    uint8_t * buf,
+    size_t size
+) 
+
+

function readBytes

+
inline size_t fs::File::readBytes (
+    char * buffer,
+    size_t length
+) 
+
+

function rewindDirectory

+
void fs::File::rewindDirectory (
+    void
+) 
+
+

function seek [1/2]

+
bool fs::File::seek (
+    uint32_t pos,
+    SeekMode mode
+) 
+
+

function seek [2/2]

+
inline bool fs::File::seek (
+    uint32_t pos
+) 
+
+

function setBufferSize

+
bool fs::File::setBufferSize (
+    size_t size
+) 
+
+

function size

+
size_t fs::File::size () const
+
+

function write [1/2]

+
size_t fs::File::write (
+    uint8_t c
+) override
+
+

function write [2/2]

+
size_t fs::File::write (
+    const uint8_t * buf,
+    size_t size
+) override
+
+

Protected Attributes Documentation

+

variable _p

+
FileImplPtr fs::File::_p;
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/FS/FS.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/classfs_1_1_file_impl/index.html b/ltapi/classfs_1_1_file_impl/index.html new file mode 100644 index 000000000..8e1b0f151 --- /dev/null +++ b/ltapi/classfs_1_1_file_impl/index.html @@ -0,0 +1,2575 @@ + + + + + + + + + + + + + + + + + + + + Class fs::FileImpl - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

Class fs::FileImpl

+

ClassList > fs > FileImpl

+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
virtual voidclose () = 0
virtual voidflush () = 0
virtual time_tgetLastWrite () = 0
virtual booleanisDirectory (void) = 0
virtual const char *name () const = 0
virtual FileImplPtropenNextFile (const char * mode) = 0
virtualoperator bool () = 0
virtual const char *path () const = 0
virtual size_tposition () const = 0
virtual size_tread (uint8_t * buf, size_t size) = 0
virtual voidrewindDirectory (void) = 0
virtual boolseek (uint32_t pos, SeekMode mode) = 0
virtual boolsetBufferSize (size_t size) = 0
virtual size_tsize () const = 0
virtual size_twrite (const uint8_t * buf, size_t size) = 0
virtual~FileImpl ()
+

Public Functions Documentation

+

function close

+
virtual void fs::FileImpl::close () = 0
+
+

function flush

+
virtual void fs::FileImpl::flush () = 0
+
+

function getLastWrite

+
virtual time_t fs::FileImpl::getLastWrite () = 0
+
+

function isDirectory

+
virtual boolean fs::FileImpl::isDirectory (
+    void
+) = 0
+
+

function name

+
virtual const char * fs::FileImpl::name () const = 0
+
+

function openNextFile

+
virtual FileImplPtr fs::FileImpl::openNextFile (
+    const char * mode
+) = 0
+
+

function operator bool

+
virtual fs::FileImpl::operator bool () = 0
+
+

function path

+
virtual const char * fs::FileImpl::path () const = 0
+
+

function position

+
virtual size_t fs::FileImpl::position () const = 0
+
+

function read

+
virtual size_t fs::FileImpl::read (
+    uint8_t * buf,
+    size_t size
+) = 0
+
+

function rewindDirectory

+
virtual void fs::FileImpl::rewindDirectory (
+    void
+) = 0
+
+

function seek

+
virtual bool fs::FileImpl::seek (
+    uint32_t pos,
+    SeekMode mode
+) = 0
+
+

function setBufferSize

+
virtual bool fs::FileImpl::setBufferSize (
+    size_t size
+) = 0
+
+

function size

+
virtual size_t fs::FileImpl::size () const = 0
+
+

function write

+
virtual size_t fs::FileImpl::write (
+    const uint8_t * buf,
+    size_t size
+) = 0
+
+

function ~FileImpl

+
inline virtual fs::FileImpl::~FileImpl () 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/FS/FS.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/classm_d_n_s/index.html b/ltapi/classm_d_n_s/index.html new file mode 100644 index 000000000..04452d932 --- /dev/null +++ b/ltapi/classm_d_n_s/index.html @@ -0,0 +1,3059 @@ + + + + + + + + + + + + + + + + + + + + + + + + mDNS - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

Class mDNS

+

ClassList > mDNS

+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
IPAddressIP (int idx)
IPv6AddressIPv6 (int idx)
booladdService (char * service, char * proto, uint16_t port)
booladdService (const char * service, const char * proto, uint16_t port)
booladdService (String service, String proto, uint16_t port)
booladdServiceTxt (char * service, char * proto, char * key, char * value)
voidaddServiceTxt (const char * service, const char * proto, const char * key, const char * value)
voidaddServiceTxt (String service, String proto, String key, String value)
boolbegin (const char * hostname)
voidend ()
boolhasTxt (int idx, const char * key)
Stringhostname (int idx)
mDNS ()
intnumTxt (int idx)
uint16_tport (int idx)
IPAddressqueryHost (char * host, uint32_t timeout=2000)
IPAddressqueryHost (const char * host, uint32_t timeout=2000)
IPAddressqueryHost (String host, uint32_t timeout=2000)
intqueryService (char * service, char * proto)
intqueryService (const char * service, const char * proto)
intqueryService (String service, String proto)
voidsetInstanceName (const char * name)
voidsetInstanceName (String name)
voidsetInstanceName (char * name)
Stringtxt (int idx, const char * key)
Stringtxt (int idx, int txtIdx)
StringtxtKey (int idx, int txtIdx)
~mDNS ()
+

Public Functions Documentation

+

function IP

+
IPAddress mDNS::IP (
+    int idx
+) 
+
+

function IPv6

+
IPv6Address mDNS::IPv6 (
+    int idx
+) 
+
+

function addService [1/3]

+
bool mDNS::addService (
+    char * service,
+    char * proto,
+    uint16_t port
+) 
+
+

function addService [2/3]

+
inline bool mDNS::addService (
+    const char * service,
+    const char * proto,
+    uint16_t port
+) 
+
+

function addService [3/3]

+
inline bool mDNS::addService (
+    String service,
+    String proto,
+    uint16_t port
+) 
+
+

function addServiceTxt [1/3]

+
bool mDNS::addServiceTxt (
+    char * service,
+    char * proto,
+    char * key,
+    char * value
+) 
+
+

function addServiceTxt [2/3]

+
inline void mDNS::addServiceTxt (
+    const char * service,
+    const char * proto,
+    const char * key,
+    const char * value
+) 
+
+

function addServiceTxt [3/3]

+
inline void mDNS::addServiceTxt (
+    String service,
+    String proto,
+    String key,
+    String value
+) 
+
+

function begin

+
bool mDNS::begin (
+    const char * hostname
+) 
+
+

function end

+
void mDNS::end () 
+
+

function hasTxt

+
bool mDNS::hasTxt (
+    int idx,
+    const char * key
+) 
+
+

function hostname

+
String mDNS::hostname (
+    int idx
+) 
+
+

function mDNS

+
mDNS::mDNS () 
+
+

function numTxt

+
int mDNS::numTxt (
+    int idx
+) 
+
+

function port

+
uint16_t mDNS::port (
+    int idx
+) 
+
+

function queryHost [1/3]

+
IPAddress mDNS::queryHost (
+    char * host,
+    uint32_t timeout=2000
+) 
+
+

function queryHost [2/3]

+
inline IPAddress mDNS::queryHost (
+    const char * host,
+    uint32_t timeout=2000
+) 
+
+

function queryHost [3/3]

+
inline IPAddress mDNS::queryHost (
+    String host,
+    uint32_t timeout=2000
+) 
+
+

function queryService [1/3]

+
int mDNS::queryService (
+    char * service,
+    char * proto
+) 
+
+

function queryService [2/3]

+
inline int mDNS::queryService (
+    const char * service,
+    const char * proto
+) 
+
+

function queryService [3/3]

+
inline int mDNS::queryService (
+    String service,
+    String proto
+) 
+
+

function setInstanceName [1/3]

+
void mDNS::setInstanceName (
+    const char * name
+) 
+
+

function setInstanceName [2/3]

+
inline void mDNS::setInstanceName (
+    String name
+) 
+
+

function setInstanceName [3/3]

+
inline void mDNS::setInstanceName (
+    char * name
+) 
+
+

function txt [1/2]

+
String mDNS::txt (
+    int idx,
+    const char * key
+) 
+
+

function txt [2/2]

+
String mDNS::txt (
+    int idx,
+    int txtIdx
+) 
+
+

function txtKey

+
String mDNS::txtKey (
+    int idx,
+    int txtIdx
+) 
+
+

function ~mDNS

+
mDNS::~mDNS () 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/mDNS/mDNS.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_061390acc221bc2d9c9cb2f4362dac1d/index.html b/ltapi/dir_061390acc221bc2d9c9cb2f4362dac1d/index.html new file mode 100644 index 000000000..fbad7c959 --- /dev/null +++ b/ltapi/dir_061390acc221bc2d9c9cb2f4362dac1d/index.html @@ -0,0 +1,2328 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common

+

FileList > common

+

Directories

+ + + + + + + + + + + + + + + + + +
TypeName
dirarduino
dirbase
+
+

The documentation for this class was generated from the following file cores/common/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_07703e3b72c625f10ef9850082fac0e3/index.html b/ltapi/dir_07703e3b72c625f10ef9850082fac0e3/index.html new file mode 100644 index 000000000..8d4830654 --- /dev/null +++ b/ltapi/dir_07703e3b72c625f10ef9850082fac0e3/index.html @@ -0,0 +1,2324 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/base/fixups/lwip - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/base/fixups/lwip

+

FileList > base > fixups > lwip

+

Files

+ + + + + + + + + + + + + +
TypeName
fileerrno.h
+
+

The documentation for this class was generated from the following file cores/common/base/fixups/lwip/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_0a3ac6ff289d4ebfcd0c797d13f9a373/index.html b/ltapi/dir_0a3ac6ff289d4ebfcd0c797d13f9a373/index.html new file mode 100644 index 000000000..bb39ca18e --- /dev/null +++ b/ltapi/dir_0a3ac6ff289d4ebfcd0c797d13f9a373/index.html @@ -0,0 +1,2328 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/libraries/ext/StreamString - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/arduino/libraries/ext/StreamString

+

FileList > arduino > libraries > ext > StreamString

+

Files

+ + + + + + + + + + + + + + + + + +
TypeName
fileStreamString.cpp
fileStreamString.h
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/StreamString/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_0a5433a1da7b2b93282c1ad1558c5479/index.html b/ltapi/dir_0a5433a1da7b2b93282c1ad1558c5479/index.html new file mode 100644 index 000000000..9a5c83a85 --- /dev/null +++ b/ltapi/dir_0a5433a1da7b2b93282c1ad1558c5479/index.html @@ -0,0 +1,2324 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/libraries/common/IPv6Address/api - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/arduino/libraries/common/IPv6Address/api

+

FileList > api

+

Files

+ + + + + + + + + + + + + +
TypeName
fileIPv6Address.h
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/IPv6Address/api/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_0e053ac3caf93ca4495f626616698305/index.html b/ltapi/dir_0e053ac3caf93ca4495f626616698305/index.html new file mode 100644 index 000000000..853b4f5d3 --- /dev/null +++ b/ltapi/dir_0e053ac3caf93ca4495f626616698305/index.html @@ -0,0 +1,2350 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/libraries/common/IPv6Address - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/arduino/libraries/common/IPv6Address

+

FileList > arduino > libraries > common > IPv6Address

+

Files

+ + + + + + + + + + + + + + + + + +
TypeName
fileIPv6Address.cpp
fileIPv6Address.h
+

Directories

+ + + + + + + + + + + + + +
TypeName
dirapi
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/IPv6Address/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_117c171b5277df11652dc53a144cb684/index.html b/ltapi/dir_117c171b5277df11652dc53a144cb684/index.html new file mode 100644 index 000000000..7b4a61172 --- /dev/null +++ b/ltapi/dir_117c171b5277df11652dc53a144cb684/index.html @@ -0,0 +1,2336 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/base/config - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/base/config

+

FileList > base > config

+

Files

+ + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
filefal_cfg.h
filefdb_cfg.h
filelwipopts.h
fileprintf_config.h
+
+

The documentation for this class was generated from the following file cores/common/base/config/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_17709fc88a4f25e302be8aa6231cd94b/index.html b/ltapi/dir_17709fc88a4f25e302be8aa6231cd94b/index.html new file mode 100644 index 000000000..fb6c8f8c7 --- /dev/null +++ b/ltapi/dir_17709fc88a4f25e302be8aa6231cd94b/index.html @@ -0,0 +1,2350 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/base/fixups - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/base/fixups

+

FileList > base > fixups

+

Files

+ + + + + + + + + + + + + + + + + +
TypeName
fileerrno.h
filemalloc.c
+

Directories

+ + + + + + + + + + + + + +
TypeName
dirlwip
+
+

The documentation for this class was generated from the following file cores/common/base/fixups/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_1927ccce0cee954fb29eb9cedf1bc791/index.html b/ltapi/dir_1927ccce0cee954fb29eb9cedf1bc791/index.html new file mode 100644 index 000000000..2e4e7c2dd --- /dev/null +++ b/ltapi/dir_1927ccce0cee954fb29eb9cedf1bc791/index.html @@ -0,0 +1,2348 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/src/compat - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/arduino/src/compat

+

FileList > arduino > src > compat

+

Files

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
fileESPmDNS.h
fileFS.h
fileFSImpl.h
fileWiFiAP.h
filemd5.h
filepgmspace.h
filevfs_api.h
+
+

The documentation for this class was generated from the following file cores/common/arduino/src/compat/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_1f237d2cf3ecae9e1cbbfcb1aefdc1b7/index.html b/ltapi/dir_1f237d2cf3ecae9e1cbbfcb1aefdc1b7/index.html new file mode 100644 index 000000000..d865f2652 --- /dev/null +++ b/ltapi/dir_1f237d2cf3ecae9e1cbbfcb1aefdc1b7/index.html @@ -0,0 +1,2324 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/libraries/inline/OTA - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/arduino/libraries/inline/OTA

+

FileList > arduino > libraries > inline > OTA

+

Files

+ + + + + + + + + + + + + +
TypeName
fileOTA.h
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/inline/OTA/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_20c0973793fbdc84288fa19008185bd9/index.html b/ltapi/dir_20c0973793fbdc84288fa19008185bd9/index.html new file mode 100644 index 000000000..351a4252b --- /dev/null +++ b/ltapi/dir_20c0973793fbdc84288fa19008185bd9/index.html @@ -0,0 +1,2328 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/libraries/common/FS - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/arduino/libraries/common/FS

+

FileList > arduino > libraries > common > FS

+

Files

+ + + + + + + + + + + + + + + + + +
TypeName
fileFS.cpp
fileFS.h
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/FS/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_264b85d2860d8f7b79a05bde705c2149/index.html b/ltapi/dir_264b85d2860d8f7b79a05bde705c2149/index.html new file mode 100644 index 000000000..a8edd0c1c --- /dev/null +++ b/ltapi/dir_264b85d2860d8f7b79a05bde705c2149/index.html @@ -0,0 +1,2324 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/libraries/inline/LT - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/arduino/libraries/inline/LT

+

FileList > arduino > libraries > inline > LT

+

Files

+ + + + + + + + + + + + + +
TypeName
fileLT.h
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/inline/LT/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_2f50d07e877c964a6683aa974aacc5a9/index.html b/ltapi/dir_2f50d07e877c964a6683aa974aacc5a9/index.html new file mode 100644 index 000000000..068df0bb4 --- /dev/null +++ b/ltapi/dir_2f50d07e877c964a6683aa974aacc5a9/index.html @@ -0,0 +1,2324 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/libraries/inline/ESP - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/arduino/libraries/inline/ESP

+

FileList > arduino > libraries > inline > ESP

+

Files

+ + + + + + + + + + + + + +
TypeName
fileESP.h
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/inline/ESP/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_317cbb6bf43941e79ffdd996bee8e3bd/index.html b/ltapi/dir_317cbb6bf43941e79ffdd996bee8e3bd/index.html new file mode 100644 index 000000000..dc9d295a9 --- /dev/null +++ b/ltapi/dir_317cbb6bf43941e79ffdd996bee8e3bd/index.html @@ -0,0 +1,2328 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/libraries/ext/HTTPClient - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/arduino/libraries/ext/HTTPClient

+

FileList > arduino > libraries > ext > HTTPClient

+

Files

+ + + + + + + + + + + + + + + + + +
TypeName
fileHTTPClient.cpp
fileHTTPClient.h
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/HTTPClient/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_368b4a9ec74cf1c10b8199770b5e2c1b/index.html b/ltapi/dir_368b4a9ec74cf1c10b8199770b5e2c1b/index.html new file mode 100644 index 000000000..620dc9e1a --- /dev/null +++ b/ltapi/dir_368b4a9ec74cf1c10b8199770b5e2c1b/index.html @@ -0,0 +1,2336 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/libraries - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/arduino/libraries

+

FileList > arduino > libraries

+

Directories

+ + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
dirapi
dircommon
dirext
dirinline
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_466525e97edd1426939c6f6f1c4cc401/index.html b/ltapi/dir_466525e97edd1426939c6f6f1c4cc401/index.html new file mode 100644 index 000000000..4f1372719 --- /dev/null +++ b/ltapi/dir_466525e97edd1426939c6f6f1c4cc401/index.html @@ -0,0 +1,2328 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/libraries/ext/WiFiMulti - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/arduino/libraries/ext/WiFiMulti

+

FileList > arduino > libraries > ext > WiFiMulti

+

Files

+ + + + + + + + + + + + + + + + + +
TypeName
fileWiFiMulti.cpp
fileWiFiMulti.h
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WiFiMulti/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_51d9c9f08f6806a0f97badf342e5b4d7/index.html b/ltapi/dir_51d9c9f08f6806a0f97badf342e5b4d7/index.html new file mode 100644 index 000000000..c47efb1ae --- /dev/null +++ b/ltapi/dir_51d9c9f08f6806a0f97badf342e5b4d7/index.html @@ -0,0 +1,2324 @@ + + + + + + + + + + + + + + + + + + + + Dir cores - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores

+

FileList > cores

+

Directories

+ + + + + + + + + + + + + +
TypeName
dircommon
+
+

The documentation for this class was generated from the following file cores/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_540dc0be13f8284f6014d0451691d894/index.html b/ltapi/dir_540dc0be13f8284f6014d0451691d894/index.html new file mode 100644 index 000000000..bdfdaf3aa --- /dev/null +++ b/ltapi/dir_540dc0be13f8284f6014d0451691d894/index.html @@ -0,0 +1,2332 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/libraries/common/Update - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/arduino/libraries/common/Update

+

FileList > arduino > libraries > common > Update

+

Files

+ + + + + + + + + + + + + + + + + + + + + +
TypeName
fileUpdate.cpp
fileUpdate.h
fileUpdateUtil.cpp
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/Update/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_561e7e821afe2d99042aaa333fa070ac/index.html b/ltapi/dir_561e7e821afe2d99042aaa333fa070ac/index.html new file mode 100644 index 000000000..341860baf --- /dev/null +++ b/ltapi/dir_561e7e821afe2d99042aaa333fa070ac/index.html @@ -0,0 +1,2332 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/libraries/common/WiFiServer - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_5cec7dea66206196679083f825c4cd25/index.html b/ltapi/dir_5cec7dea66206196679083f825c4cd25/index.html new file mode 100644 index 000000000..ba189d284 --- /dev/null +++ b/ltapi/dir_5cec7dea66206196679083f825c4cd25/index.html @@ -0,0 +1,2332 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/libraries/common/mDNS - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/arduino/libraries/common/mDNS

+

FileList > arduino > libraries > common > mDNS

+

Files

+ + + + + + + + + + + + + + + + + + + + + +
TypeName
fileLwIPmDNS.cpp
filemDNS.cpp
filemDNS.h
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/mDNS/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_5e75bcdb2ffaceb01f94db1177614a08/index.html b/ltapi/dir_5e75bcdb2ffaceb01f94db1177614a08/index.html new file mode 100644 index 000000000..f8eccf442 --- /dev/null +++ b/ltapi/dir_5e75bcdb2ffaceb01f94db1177614a08/index.html @@ -0,0 +1,2328 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/libraries/api/Serial - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/arduino/libraries/api/Serial

+

FileList > api > Serial

+

Files

+ + + + + + + + + + + + + + + + + +
TypeName
fileSerial.cpp
fileSerial.h
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/Serial/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_5ea3aad773d57a5f23d4c7a2455c87eb/index.html b/ltapi/dir_5ea3aad773d57a5f23d4c7a2455c87eb/index.html new file mode 100644 index 000000000..b6f635524 --- /dev/null +++ b/ltapi/dir_5ea3aad773d57a5f23d4c7a2455c87eb/index.html @@ -0,0 +1,2344 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/libraries/ext - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_715308b29b364e222d2654a6be231c22/index.html b/ltapi/dir_715308b29b364e222d2654a6be231c22/index.html new file mode 100644 index 000000000..e6281d7bf --- /dev/null +++ b/ltapi/dir_715308b29b364e222d2654a6be231c22/index.html @@ -0,0 +1,2398 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/base - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/base

+

FileList > base

+

Files

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
filelibretiny.h
filelt_api.h
filelt_config.h
filelt_logger.c
filelt_logger.h
filelt_main.c
filelt_pins.h
filelt_posix_api.h
filelt_types.h
+

Directories

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
dirapi
dircompat
dirconfig
dirfixups
dirposix
dirwraps
+
+

The documentation for this class was generated from the following file cores/common/base/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_7b42ca4cd5530baa6d3cca740865775d/index.html b/ltapi/dir_7b42ca4cd5530baa6d3cca740865775d/index.html new file mode 100644 index 000000000..bc64a0c50 --- /dev/null +++ b/ltapi/dir_7b42ca4cd5530baa6d3cca740865775d/index.html @@ -0,0 +1,2360 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/src/wiring - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/arduino/src/wiring

+

FileList > arduino > src > wiring

+

Files

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
filewiring.c
filewiring_compat.cpp
filewiring_compat.h
filewiring_custom.c
filewiring_custom.h
filewiring_irq.c
filewiring_math.cpp
filewiring_private.c
filewiring_private.h
filewiring_shift.c
+
+

The documentation for this class was generated from the following file cores/common/arduino/src/wiring/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_7c3b5015b008a83a07f1017471251f6f/index.html b/ltapi/dir_7c3b5015b008a83a07f1017471251f6f/index.html new file mode 100644 index 000000000..75af2f6b9 --- /dev/null +++ b/ltapi/dir_7c3b5015b008a83a07f1017471251f6f/index.html @@ -0,0 +1,2324 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/src/posix - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/arduino/src/posix

+

FileList > arduino > src > posix

+

Files

+ + + + + + + + + + + + + +
TypeName
filetime.c
+
+

The documentation for this class was generated from the following file cores/common/arduino/src/posix/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_846e8f2c00731a5babdd912d0551347c/index.html b/ltapi/dir_846e8f2c00731a5babdd912d0551347c/index.html new file mode 100644 index 000000000..b12b1cc96 --- /dev/null +++ b/ltapi/dir_846e8f2c00731a5babdd912d0551347c/index.html @@ -0,0 +1,2336 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/base/posix - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/base/posix

+

FileList > base > posix

+

Files

+ + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
fileitoa.c
filestrcasecmp.c
filestrdup.c
filestrptime.c
+
+

The documentation for this class was generated from the following file cores/common/base/posix/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_84f0c24223fe15b4f2fbb2a476e54856/index.html b/ltapi/dir_84f0c24223fe15b4f2fbb2a476e54856/index.html new file mode 100644 index 000000000..7ee96ba63 --- /dev/null +++ b/ltapi/dir_84f0c24223fe15b4f2fbb2a476e54856/index.html @@ -0,0 +1,2336 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/libraries/ext/WebServer/detail - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_8526abab122814721f0f43c2acad511e/index.html b/ltapi/dir_8526abab122814721f0f43c2acad511e/index.html new file mode 100644 index 000000000..1e412f663 --- /dev/null +++ b/ltapi/dir_8526abab122814721f0f43c2acad511e/index.html @@ -0,0 +1,2336 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/libraries/ext/base64/libb64 - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/arduino/libraries/ext/base64/libb64

+

FileList > arduino > libraries > ext > base64 > libb64

+

Files

+ + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
filecdecode.c
filecdecode.h
filecencode.c
filecencode.h
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/base64/libb64/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_8a0a878499ba56a6674d17f5d719a3ab/index.html b/ltapi/dir_8a0a878499ba56a6674d17f5d719a3ab/index.html new file mode 100644 index 000000000..5ed037722 --- /dev/null +++ b/ltapi/dir_8a0a878499ba56a6674d17f5d719a3ab/index.html @@ -0,0 +1,2356 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/libraries/api/WiFi - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_8dc93de83995bf7a7f7c574b7e694258/index.html b/ltapi/dir_8dc93de83995bf7a7f7c574b7e694258/index.html new file mode 100644 index 000000000..7775ebb22 --- /dev/null +++ b/ltapi/dir_8dc93de83995bf7a7f7c574b7e694258/index.html @@ -0,0 +1,2324 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/base/compat/lwip - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/base/compat/lwip

+

FileList > base > compat > lwip

+

Files

+ + + + + + + + + + + + + +
TypeName
filelwip_timers.h
+
+

The documentation for this class was generated from the following file cores/common/base/compat/lwip/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_930634efd5dc4a957bbb6e685a3ccda1/index.html b/ltapi/dir_930634efd5dc4a957bbb6e685a3ccda1/index.html new file mode 100644 index 000000000..e6ccb5491 --- /dev/null +++ b/ltapi/dir_930634efd5dc4a957bbb6e685a3ccda1/index.html @@ -0,0 +1,2418 @@ + + + + + + + + + + + + + + + + + + + + + + + + C++ API - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/arduino/libraries/inline

+

FileList > arduino > libraries > inline

+

Files

+ + + + + + + + + + + + + +
TypeName
fileSingletons.cpp
+

Directories

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
dirESP
dirFlash
dirLT
dirOTA
dirWDT
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/inline/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_947f33558ea20e7a91b0d58d77bc396d/index.html b/ltapi/dir_947f33558ea20e7a91b0d58d77bc396d/index.html new file mode 100644 index 000000000..f1b7c974e --- /dev/null +++ b/ltapi/dir_947f33558ea20e7a91b0d58d77bc396d/index.html @@ -0,0 +1,2332 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/libraries/common/WiFiUdp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/arduino/libraries/common/WiFiUdp

+

FileList > arduino > libraries > common > WiFiUdp

+

Files

+ + + + + + + + + + + + + + + + + + + + + +
TypeName
fileLwIPUdp.cpp
fileLwIPUdp.h
fileWiFiUdp.h
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiUdp/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_94e03dba73a2283a03d5afbcd7ac96fd/index.html b/ltapi/dir_94e03dba73a2283a03d5afbcd7ac96fd/index.html new file mode 100644 index 000000000..79a11a9aa --- /dev/null +++ b/ltapi/dir_94e03dba73a2283a03d5afbcd7ac96fd/index.html @@ -0,0 +1,2328 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/libraries/api/SoftwareSerial - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/arduino/libraries/api/SoftwareSerial

+

FileList > api > SoftwareSerial

+

Files

+ + + + + + + + + + + + + + + + + +
TypeName
fileSoftwareSerial.cpp
fileSoftwareSerial.h
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/SoftwareSerial/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_a154785acb726885f254a47f397a1398/index.html b/ltapi/dir_a154785acb726885f254a47f397a1398/index.html new file mode 100644 index 000000000..ad84bb67d --- /dev/null +++ b/ltapi/dir_a154785acb726885f254a47f397a1398/index.html @@ -0,0 +1,2336 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/libraries/common/MD5 - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_ac62547f78cd9f887119f688c741ca23/index.html b/ltapi/dir_ac62547f78cd9f887119f688c741ca23/index.html new file mode 100644 index 000000000..d58ad10a6 --- /dev/null +++ b/ltapi/dir_ac62547f78cd9f887119f688c741ca23/index.html @@ -0,0 +1,2328 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/libraries/ext/cbuf - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/arduino/libraries/ext/cbuf

+

FileList > arduino > libraries > ext > cbuf

+

Files

+ + + + + + + + + + + + + + + + + +
TypeName
filecbuf.cpp
filecbuf.h
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/cbuf/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_b483440aeb16b525e6183721aad24145/index.html b/ltapi/dir_b483440aeb16b525e6183721aad24145/index.html new file mode 100644 index 000000000..8dda349ed --- /dev/null +++ b/ltapi/dir_b483440aeb16b525e6183721aad24145/index.html @@ -0,0 +1,2328 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/base/wraps - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/base/wraps

+

FileList > base > wraps

+

Files

+ + + + + + + + + + + + + + + + + +
TypeName
fileputchar.c
fileputs.c
+
+

The documentation for this class was generated from the following file cores/common/base/wraps/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_b638d0c61cb610adbc247035a3e10d3e/index.html b/ltapi/dir_b638d0c61cb610adbc247035a3e10d3e/index.html new file mode 100644 index 000000000..ed2d36a9b --- /dev/null +++ b/ltapi/dir_b638d0c61cb610adbc247035a3e10d3e/index.html @@ -0,0 +1,2328 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/arduino

+

FileList > arduino

+

Directories

+ + + + + + + + + + + + + + + + + +
TypeName
dirlibraries
dirsrc
+
+

The documentation for this class was generated from the following file cores/common/arduino/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_bd1e4bd763507df1c98830c76e327ffd/index.html b/ltapi/dir_bd1e4bd763507df1c98830c76e327ffd/index.html new file mode 100644 index 000000000..99af2be08 --- /dev/null +++ b/ltapi/dir_bd1e4bd763507df1c98830c76e327ffd/index.html @@ -0,0 +1,2324 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/libraries/inline/WDT - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/arduino/libraries/inline/WDT

+

FileList > arduino > libraries > inline > WDT

+

Files

+ + + + + + + + + + + + + +
TypeName
fileWDT.h
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/inline/WDT/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_bdd93a4e8b1efe1644b5e8d87982bdbf/index.html b/ltapi/dir_bdd93a4e8b1efe1644b5e8d87982bdbf/index.html new file mode 100644 index 000000000..805f1e1ab --- /dev/null +++ b/ltapi/dir_bdd93a4e8b1efe1644b5e8d87982bdbf/index.html @@ -0,0 +1,2332 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/src/common - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/arduino/src/common

+

FileList > arduino > src > common

+

Files

+ + + + + + + + + + + + + + + + + + + + + +
TypeName
fileabi.cpp
filedtostrf.c
fileserial_event.cpp
+
+

The documentation for this class was generated from the following file cores/common/arduino/src/common/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_c7e317b16142bccc961a83c0babf0065/index.html b/ltapi/dir_c7e317b16142bccc961a83c0babf0065/index.html new file mode 100644 index 000000000..ba455857a --- /dev/null +++ b/ltapi/dir_c7e317b16142bccc961a83c0babf0065/index.html @@ -0,0 +1,2437 @@ + + + + + + + + + + + + + + + + + + + + + + + + C API - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/base/api

+

FileList > api

+

Files

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
filelt_cpu.c
filelt_cpu.h
filelt_device.c
filelt_device.h
filelt_flash.c
filelt_flash.h
filelt_init.h
filelt_mem.c
filelt_mem.h
filelt_ota.c
filelt_ota.h
filelt_sleep.c
filelt_sleep.h
filelt_utils.c
filelt_utils.h
filelt_wdt.c
filelt_wdt.h
+
+

The documentation for this class was generated from the following file cores/common/base/api/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_cd39a9ca7156574bbf526216c63c01b5/index.html b/ltapi/dir_cd39a9ca7156574bbf526216c63c01b5/index.html new file mode 100644 index 000000000..7b6a95ce5 --- /dev/null +++ b/ltapi/dir_cd39a9ca7156574bbf526216c63c01b5/index.html @@ -0,0 +1,2374 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/src - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/arduino/src

+

FileList > arduino > src

+

Files

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
fileArduino.h
fileEvents.cpp
fileEvents.h
fileHardwareI2C.h
filemain.c
+

Directories

+ + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
dircommon
dircompat
dirposix
dirwiring
+
+

The documentation for this class was generated from the following file cores/common/arduino/src/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_d96db7fd7f8e0e902a4f4b8f7da27505/index.html b/ltapi/dir_d96db7fd7f8e0e902a4f4b8f7da27505/index.html new file mode 100644 index 000000000..3ab15a71e --- /dev/null +++ b/ltapi/dir_d96db7fd7f8e0e902a4f4b8f7da27505/index.html @@ -0,0 +1,2332 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/libraries/ext/WebServer/uri - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/arduino/libraries/ext/WebServer/uri

+

FileList > arduino > libraries > ext > WebServer > uri

+

Files

+ + + + + + + + + + + + + + + + + + + + + +
TypeName
fileUriBraces.h
fileUriGlob.h
fileUriRegex.h
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/uri/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_df2c4eb2fc0858b25d84c91a81f7ab75/index.html b/ltapi/dir_df2c4eb2fc0858b25d84c91a81f7ab75/index.html new file mode 100644 index 000000000..ad5ecf40a --- /dev/null +++ b/ltapi/dir_df2c4eb2fc0858b25d84c91a81f7ab75/index.html @@ -0,0 +1,2374 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/base/compat - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/base/compat

+

FileList > base > compat

+

Files

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
filecerts.h
fileerr.h
filenetdb.h
filenetif.h
filesockets.h
filesys.h
filetcpip.h
fileudp.h
+

Directories

+ + + + + + + + + + + + + +
TypeName
dirlwip
+
+

The documentation for this class was generated from the following file cores/common/base/compat/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_e15f2f53a75910fcd29e18d04ab3723d/index.html b/ltapi/dir_e15f2f53a75910fcd29e18d04ab3723d/index.html new file mode 100644 index 000000000..bc71f75b0 --- /dev/null +++ b/ltapi/dir_e15f2f53a75910fcd29e18d04ab3723d/index.html @@ -0,0 +1,2332 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/libraries/api - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/arduino/libraries/api

+

FileList > api

+

Directories

+ + + + + + + + + + + + + + + + + + + + + +
TypeName
dirSerial
dirSoftwareSerial
dirWiFi
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_e34b8d08ec2a080356b302de1e1a00cf/index.html b/ltapi/dir_e34b8d08ec2a080356b302de1e1a00cf/index.html new file mode 100644 index 000000000..4286bd934 --- /dev/null +++ b/ltapi/dir_e34b8d08ec2a080356b302de1e1a00cf/index.html @@ -0,0 +1,2324 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/libraries/common/Preferences - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/arduino/libraries/common/Preferences

+

FileList > arduino > libraries > common > Preferences

+

Files

+ + + + + + + + + + + + + +
TypeName
filePreferences.h
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/Preferences/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_e3ef11b23e60019cef556571ad08a868/index.html b/ltapi/dir_e3ef11b23e60019cef556571ad08a868/index.html new file mode 100644 index 000000000..10122c3d2 --- /dev/null +++ b/ltapi/dir_e3ef11b23e60019cef556571ad08a868/index.html @@ -0,0 +1,2324 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/libraries/inline/Flash - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/arduino/libraries/inline/Flash

+

FileList > arduino > libraries > inline > Flash

+

Files

+ + + + + + + + + + + + + +
TypeName
fileFlash.h
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/inline/Flash/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_e7aea143128db3d890560fea5ce624b6/index.html b/ltapi/dir_e7aea143128db3d890560fea5ce624b6/index.html new file mode 100644 index 000000000..4286ec48f --- /dev/null +++ b/ltapi/dir_e7aea143128db3d890560fea5ce624b6/index.html @@ -0,0 +1,2350 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/libraries/ext/base64 - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/arduino/libraries/ext/base64

+

FileList > arduino > libraries > ext > base64

+

Files

+ + + + + + + + + + + + + + + + + +
TypeName
filebase64.cpp
filebase64.h
+

Directories

+ + + + + + + + + + + + + +
TypeName
dirlibb64
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/base64/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_f12ca718858451d77068237cb7af4643/index.html b/ltapi/dir_f12ca718858451d77068237cb7af4643/index.html new file mode 100644 index 000000000..8dc11f631 --- /dev/null +++ b/ltapi/dir_f12ca718858451d77068237cb7af4643/index.html @@ -0,0 +1,2352 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/libraries/common/WiFiClient - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Dir cores/common/arduino/libraries/common/WiFiClient

+

FileList > arduino > libraries > common > WiFiClient

+

Files

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
fileLwIPClient.cpp
fileLwIPClient.h
fileLwIPRxBuffer.cpp
fileLwIPRxBuffer.h
fileMbedTLSClient.cpp
fileMbedTLSClient.h
fileWiFiClient.h
fileWiFiClientSecure.h
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiClient/

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_f2f13d16dd1b4421bdcca863af8fd41a/index.html b/ltapi/dir_f2f13d16dd1b4421bdcca863af8fd41a/index.html new file mode 100644 index 000000000..49c1938a7 --- /dev/null +++ b/ltapi/dir_f2f13d16dd1b4421bdcca863af8fd41a/index.html @@ -0,0 +1,2366 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/libraries/ext/WebServer - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dir_fbd007664e1d3c6800f6de85378c1012/index.html b/ltapi/dir_fbd007664e1d3c6800f6de85378c1012/index.html new file mode 100644 index 000000000..9c28de6bd --- /dev/null +++ b/ltapi/dir_fbd007664e1d3c6800f6de85378c1012/index.html @@ -0,0 +1,2356 @@ + + + + + + + + + + + + + + + + + + + + Dir cores/common/arduino/libraries/common - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dtostrf_8c/index.html b/ltapi/dtostrf_8c/index.html new file mode 100644 index 000000000..ed2b15a08 --- /dev/null +++ b/ltapi/dtostrf_8c/index.html @@ -0,0 +1,2357 @@ + + + + + + + + + + + + + + + + + + + + File dtostrf.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File dtostrf.c

+

FileList > arduino > src > common > dtostrf.c

+

Go to the source code of this file.

+
    +
  • #include <Arduino.h>
  • +
+

Public Functions

+ + + + + + + + + + + + + +
TypeName
char *dtostrf (double val, signed char width, unsigned char prec, char * sout)
+

Public Functions Documentation

+

function dtostrf

+
char * dtostrf (
+    double val,
+    signed char width,
+    unsigned char prec,
+    char * sout
+) 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/src/common/dtostrf.c

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/dtostrf_8c_source/index.html b/ltapi/dtostrf_8c_source/index.html new file mode 100644 index 000000000..466e7e298 --- /dev/null +++ b/ltapi/dtostrf_8c_source/index.html @@ -0,0 +1,2322 @@ + + + + + + + + + + + + + + + + + + + + File dtostrf.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File dtostrf.c

+

File List > arduino > src > common > dtostrf.c

+

Go to the documentation of this file.

+
/*
+  dtostrf - Emulation for dtostrf function from avr-libc
+  Copyright (c) 2013 Arduino.  All rights reserved.
+  Written by Cristian Maglie <c.maglie@arduino.cc>
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License, or (at your option) any later version.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+  Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+#include <Arduino.h>
+
+char *dtostrf(double val, signed char width, unsigned char prec, char *sout) {
+    char fmt[20];
+    sprintf(fmt, "%%%d.%df", width, prec);
+    sprintf(sout, fmt, val);
+    return sout;
+}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/err_8h/index.html b/ltapi/err_8h/index.html new file mode 100644 index 000000000..fb2538f90 --- /dev/null +++ b/ltapi/err_8h/index.html @@ -0,0 +1,2298 @@ + + + + + + + + + + + + + + + + + + + + File err.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/err_8h_source/index.html b/ltapi/err_8h_source/index.html new file mode 100644 index 000000000..11da80973 --- /dev/null +++ b/ltapi/err_8h_source/index.html @@ -0,0 +1,2299 @@ + + + + + + + + + + + + + + + + + + + + File err.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/errno_8h/index.html b/ltapi/errno_8h/index.html new file mode 100644 index 000000000..aab9edfcb --- /dev/null +++ b/ltapi/errno_8h/index.html @@ -0,0 +1,2398 @@ + + + + + + + + + + + + + + + + + + + + File errno.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File errno.h

+

FileList > base > fixups > errno.h

+

Go to the source code of this file.

+
    +
  • #include <sys/errno.h>
  • +
+

Public Attributes

+ + + + + + + + + + + + + +
TypeName
interrno
+

Macros

+ + + + + + + + + + + + + +
TypeName
defineerrno errno
+

Public Attributes Documentation

+

variable errno

+
int errno;
+
+

Macro Definition Documentation

+

define errno

+
#define errno errno
+
+
+

The documentation for this class was generated from the following file cores/common/base/fixups/errno.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/errno_8h_source/index.html b/ltapi/errno_8h_source/index.html new file mode 100644 index 000000000..cfe4b5e05 --- /dev/null +++ b/ltapi/errno_8h_source/index.html @@ -0,0 +1,2316 @@ + + + + + + + + + + + + + + + + + + + + File errno.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File errno.h

+

File List > base > fixups > errno.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-06-13. */
+
+#pragma once
+
+// This is an attempt to bring at least some order to <errno.h>, as
+// it's generally a source of problems everywhere.
+// The idea is that all units will try to import this errno.h first,
+// which means it won't use lwIP's error codes.
+// The code below was moved from realtek-ambz/fixups during
+// porting of BK72XX SDK, when the errno stroke again.
+
+// There are two different errno's:
+// - first is just an int
+// - second is a macro that calls __errno()
+// Here the first option is ensured in the entire project.
+#include <sys/errno.h> // use system __errno() & error codes
+#undef errno           // undefine __errno() macro
+extern int errno;      // use a global errno variable
+#define errno errno    // for #ifdef errno in lwIP
+
+// make sure lwIP never defines its own error codes
+#undef LWIP_PROVIDE_ERRNO
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/fal__cfg_8h/index.html b/ltapi/fal__cfg_8h/index.html new file mode 100644 index 000000000..6dd6de6db --- /dev/null +++ b/ltapi/fal__cfg_8h/index.html @@ -0,0 +1,2554 @@ + + + + + + + + + + + + + + + + + + + + File fal\_cfg.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

File fal_cfg.h

+

FileList > base > config > fal_cfg.h

+

Go to the source code of this file.

+
    +
  • #include <fal_def.h>
  • +
+

Public Attributes

+ + + + + + + + + + + + + + + + + +
TypeName
fal_partition_tfal_root_part
"Root" partition entry, representing the entire flash. Declared and initialized in lt_main.c.
const struct fal_flash_devflash0
+

Public Functions

+ + + + + + + + + + + + + +
TypeName
voidprintf_nop (const char * fmt, ...)
+

Macros

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
defineFAL_DEBUG 0
defineFAL_DEV_NAME_MAX 16
defineFAL_FLASH_DEV_NAME "flash0"
defineFAL_FLASH_DEV_TABLE { &flash0, }
defineFAL_PART_HAS_TABLE_CFG
defineFAL_PART_TABLE_ITEM (part_lower, part_upper)
defineFAL_PRINTF printf_nop
+

Public Attributes Documentation

+

variable fal_root_part

+
fal_partition_t fal_root_part;
+
+

variable flash0

+
const struct fal_flash_dev flash0;
+
+

Public Functions Documentation

+

function printf_nop

+
inline void printf_nop (
+    const char * fmt,
+    ...
+) 
+
+

Macro Definition Documentation

+

define FAL_DEBUG

+
#define FAL_DEBUG 0
+
+

define FAL_DEV_NAME_MAX

+
#define FAL_DEV_NAME_MAX 16
+
+

define FAL_FLASH_DEV_NAME

+
#define FAL_FLASH_DEV_NAME "flash0"
+
+

define FAL_FLASH_DEV_TABLE

+
#define FAL_FLASH_DEV_TABLE { &flash0, }
+
+

define FAL_PART_HAS_TABLE_CFG

+
#define FAL_PART_HAS_TABLE_CFG 
+
+

define FAL_PART_TABLE_ITEM

+
#define FAL_PART_TABLE_ITEM (
+    part_lower,
+    part_upper
+) {                                                                                                                  \
+        .magic_word = FAL_PART_MAGIC_WORD,         /* magic word */                                                    \
+        .name       = #part_lower,                 /* lowercase name as string */                                      \
+        .flash_name = FAL_FLASH_DEV_NAME,          /* flash device name */                                             \
+        .offset     = FLASH_##part_upper##_OFFSET, /* partition offset macro as uppercase string */                    \
+        .len        = FLASH_##part_upper##_LENGTH, /* partition length macro as uppercase string */                    \
+    },
+
+

define FAL_PRINTF

+
#define FAL_PRINTF printf_nop
+
+
+

The documentation for this class was generated from the following file cores/common/base/config/fal_cfg.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/fal__cfg_8h_source/index.html b/ltapi/fal__cfg_8h_source/index.html new file mode 100644 index 000000000..2172bdbb1 --- /dev/null +++ b/ltapi/fal__cfg_8h_source/index.html @@ -0,0 +1,2337 @@ + + + + + + + + + + + + + + + + + + + + File fal\_cfg.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File fal_cfg.h

+

File List > base > config > fal_cfg.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-05-24. */
+
+#pragma once
+
+#ifdef __cplusplus
+extern "C" {
+#endif // __cplusplus
+
+inline void printf_nop(const char *fmt, ...) {}
+
+#define FAL_PRINTF printf_nop
+#define FAL_DEBUG  0
+
+// Flash device configuration
+extern const struct fal_flash_dev flash0;
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#define FAL_FLASH_DEV_NAME "flash0"
+
+#define FAL_FLASH_DEV_TABLE                                                                                            \
+    { &flash0, }
+
+#define FAL_DEV_NAME_MAX 16 // no need for 24 chars (default)
+
+// Partition table
+#define FAL_PART_HAS_TABLE_CFG
+
+#define FAL_PART_TABLE_ITEM(part_lower, part_upper)                                                                    \
+    {                                                                                                                  \
+        .magic_word = FAL_PART_MAGIC_WORD,         /* magic word */                                                    \
+        .name       = #part_lower,                 /* lowercase name as string */                                      \
+        .flash_name = FAL_FLASH_DEV_NAME,          /* flash device name */                                             \
+        .offset     = FLASH_##part_upper##_OFFSET, /* partition offset macro as uppercase string */                    \
+        .len        = FLASH_##part_upper##_LENGTH, /* partition length macro as uppercase string */                    \
+    },
+
+// for fal_partition_t
+#include <fal_def.h>
+
+extern fal_partition_t fal_root_part;
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/fdb__cfg_8h/index.html b/ltapi/fdb__cfg_8h/index.html new file mode 100644 index 000000000..6c0634f66 --- /dev/null +++ b/ltapi/fdb__cfg_8h/index.html @@ -0,0 +1,2393 @@ + + + + + + + + + + + + + + + + + + + + File fdb\_cfg.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File fdb_cfg.h

+

FileList > base > config > fdb_cfg.h

+

Go to the source code of this file.

+

Macros

+ + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
defineFDB_PRINT (...)
defineFDB_USING_FAL_MODE
defineFDB_USING_KVDB
defineFDB_WRITE_GRAN 8
+

Macro Definition Documentation

+

define FDB_PRINT

+
#define FDB_PRINT (
+    ...
+) 
+
+

define FDB_USING_FAL_MODE

+
#define FDB_USING_FAL_MODE 
+
+

define FDB_USING_KVDB

+
#define FDB_USING_KVDB 
+
+

define FDB_WRITE_GRAN

+
#define FDB_WRITE_GRAN 8
+
+
+

The documentation for this class was generated from the following file cores/common/base/config/fdb_cfg.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/fdb__cfg_8h_source/index.html b/ltapi/fdb__cfg_8h_source/index.html new file mode 100644 index 000000000..acb6546af --- /dev/null +++ b/ltapi/fdb__cfg_8h_source/index.html @@ -0,0 +1,2342 @@ + + + + + + + + + + + + + + + + + + + + File fdb\_cfg.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File fdb_cfg.h

+

File List > base > config > fdb_cfg.h

+

Go to the documentation of this file.

+
/*
+ * Copyright (c) 2020, Armink, <armink.ztl@gmail.com>
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+#ifndef _FDB_CFG_H_
+#define _FDB_CFG_H_
+
+/* using KVDB feature */
+#define FDB_USING_KVDB
+
+#ifdef FDB_USING_KVDB
+/* Auto update KV to latest default when current KVDB version number is changed. @see fdb_kvdb.ver_num */
+// #define FDB_KV_AUTO_UPDATE
+#endif
+
+/* using TSDB (Time series database) feature */
+// #define FDB_USING_TSDB
+
+/* Using FAL storage mode */
+#define FDB_USING_FAL_MODE
+
+#ifdef FDB_USING_FAL_MODE
+/* the flash write granularity, unit: bit
+ * only support 1(nor flash)/ 8(stm32f2/f4)/ 32(stm32f1) */
+#define FDB_WRITE_GRAN 8
+#endif
+
+/* Using file storage mode by LIBC file API, like fopen/fread/fwrte/fclose */
+// #define FDB_USING_FILE_LIBC_MODE
+
+/* Using file storage mode by POSIX file API, like open/read/write/close */
+// #define FDB_USING_FILE_POSIX_MODE
+
+/* MCU Endian Configuration, default is Little Endian Order. */
+// #define FDB_BIG_ENDIAN
+
+#if LT_DEBUG_FDB
+#include <libretiny.h>
+#include <printf/printf.h>
+#define FDB_PRINT(...) __wrap_printf(__VA_ARGS__)
+#define FDB_DEBUG_ENABLE
+#else
+#define FDB_PRINT(...)
+#endif
+
+#endif /* _FDB_CFG_H_ */
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/files/index.html b/ltapi/files/index.html new file mode 100644 index 000000000..fdadf087a --- /dev/null +++ b/ltapi/files/index.html @@ -0,0 +1,2574 @@ + + + + + + + + + + + + + + + + + + + + + + + + File list - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File List

+

Here is a list of all files with brief descriptions:

+ + + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/functions/index.html b/ltapi/functions/index.html new file mode 100644 index 000000000..00feac0bd --- /dev/null +++ b/ltapi/functions/index.html @@ -0,0 +1,2718 @@ + + + + + + + + + + + + + + + + + + + + + + + + Functions - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Functions

+

a

+ +

b

+ +

d

+ +

e

+ +

g

+ +

h

+ +

i

+ +

l

+ +

m

+ +

p

+ +

r

+ +

s

+ +

u

+ +

_

+ + + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/hierarchy/index.html b/ltapi/hierarchy/index.html new file mode 100644 index 000000000..845d0637c --- /dev/null +++ b/ltapi/hierarchy/index.html @@ -0,0 +1,2401 @@ + + + + + + + + + + + + + + + + + + + + Class Hierarchy - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Class Hierarchy

+

This inheritance list is sorted roughly, but not completely, alphabetically:

+ + + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/itoa_8c/index.html b/ltapi/itoa_8c/index.html new file mode 100644 index 000000000..aa0079ac7 --- /dev/null +++ b/ltapi/itoa_8c/index.html @@ -0,0 +1,2410 @@ + + + + + + + + + + + + + + + + + + + + File itoa.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File itoa.c

+

FileList > base > posix > itoa.c

+

Go to the source code of this file.

+
    +
  • #include <string.h>
  • +
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
char *itoa (int value, char * string, int radix)
char *ltoa (long value, char * string, int radix)
char *ultoa (unsigned long value, char * string, int radix)
char *utoa (unsigned int value, char * string, int radix)
+

Public Functions Documentation

+

function itoa

+
char * itoa (
+    int value,
+    char * string,
+    int radix
+) 
+
+

function ltoa

+
char * ltoa (
+    long value,
+    char * string,
+    int radix
+) 
+
+

function ultoa

+
char * ultoa (
+    unsigned long value,
+    char * string,
+    int radix
+) 
+
+

function utoa

+
char * utoa (
+    unsigned int value,
+    char * string,
+    int radix
+) 
+
+
+

The documentation for this class was generated from the following file cores/common/base/posix/itoa.c

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/itoa_8c_source/index.html b/ltapi/itoa_8c_source/index.html new file mode 100644 index 000000000..cde19612c --- /dev/null +++ b/ltapi/itoa_8c_source/index.html @@ -0,0 +1,2405 @@ + + + + + + + + + + + + + + + + + + + + File itoa.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File itoa.c

+

File List > base > posix > itoa.c

+

Go to the documentation of this file.

+
/*
+  Copyright (c) 2014 Arduino LLC.  All right reserved.
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License, or (at your option) any later version.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+  See the GNU Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+char *ltoa(long value, char *string, int radix) {
+    char tmp[33];
+    char *tp = tmp;
+    long i;
+    unsigned long v;
+    int sign;
+    char *sp;
+
+    if (string == NULL) {
+        return 0;
+    }
+
+    if (radix > 36 || radix <= 1) {
+        return 0;
+    }
+
+    sign = (radix == 10 && value < 0);
+    if (sign) {
+        v = -value;
+    } else {
+        v = (unsigned long)value;
+    }
+
+    while (v || tp == tmp) {
+        i = v % radix;
+        v = v / radix;
+        if (i < 10)
+            *tp++ = i + '0';
+        else
+            *tp++ = i + 'a' - 10;
+    }
+
+    sp = string;
+
+    if (sign)
+        *sp++ = '-';
+    while (tp > tmp)
+        *sp++ = *--tp;
+    *sp = 0;
+
+    return string;
+}
+
+char *ultoa(unsigned long value, char *string, int radix) {
+    char tmp[33];
+    char *tp = tmp;
+    long i;
+    unsigned long v = value;
+    char *sp;
+
+    if (string == NULL) {
+        return 0;
+    }
+
+    if (radix > 36 || radix <= 1) {
+        return 0;
+    }
+
+    while (v || tp == tmp) {
+        i = v % radix;
+        v = v / radix;
+        if (i < 10)
+            *tp++ = i + '0';
+        else
+            *tp++ = i + 'a' - 10;
+    }
+
+    sp = string;
+
+    while (tp > tmp)
+        *sp++ = *--tp;
+    *sp = 0;
+
+    return string;
+}
+
+char *itoa(int value, char *string, int radix) {
+    return ltoa(value, string, radix);
+}
+
+char *utoa(unsigned int value, char *string, int radix) {
+    return ultoa(value, string, radix);
+}
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/libraries_2common_2_f_s_2_f_s_8h/index.html b/ltapi/libraries_2common_2_f_s_2_f_s_8h/index.html new file mode 100644 index 000000000..80a7ab9fe --- /dev/null +++ b/ltapi/libraries_2common_2_f_s_2_f_s_8h/index.html @@ -0,0 +1,2437 @@ + + + + + + + + + + + + + + + + + + + + File FS.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File FS.h

+

FileList > arduino > libraries > common > FS > FS.h

+

Go to the source code of this file.

+
    +
  • #include <Arduino.h>
  • +
  • #include <memory>
  • +
+

Namespaces

+ + + + + + + + + + + + + +
TypeName
namespacefs
+

Classes

+ + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
classFS
classFSImpl
classFile
classFileImpl
+

Macros

+ + + + + + + + + + + + + + + + + + + + + +
TypeName
defineFILE_APPEND "a"
defineFILE_READ "r"
defineFILE_WRITE "w"
+

Macro Definition Documentation

+

define FILE_APPEND

+
#define FILE_APPEND "a"
+
+

define FILE_READ

+
#define FILE_READ "r"
+
+

define FILE_WRITE

+
#define FILE_WRITE "w"
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/FS/FS.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/libraries_2common_2_f_s_2_f_s_8h_source/index.html b/ltapi/libraries_2common_2_f_s_2_f_s_8h_source/index.html new file mode 100644 index 000000000..5a43edec3 --- /dev/null +++ b/ltapi/libraries_2common_2_f_s_2_f_s_8h_source/index.html @@ -0,0 +1,2446 @@ + + + + + + + + + + + + + + + + + + + + File FS.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File FS.h

+

File List > arduino > libraries > common > FS > FS.h

+

Go to the documentation of this file.

+
/*
+ FS.h - file system wrapper
+ Copyright (c) 2015 Ivan Grokhotkov. All rights reserved.
+ This file is part of the esp8266 core for Arduino environment.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+ */
+
+#pragma once
+
+#include <Arduino.h>
+#include <memory>
+
+namespace fs {
+
+#define FILE_READ   "r"
+#define FILE_WRITE  "w"
+#define FILE_APPEND "a"
+
+class File;
+
+class FileImpl;
+typedef std::shared_ptr<FileImpl> FileImplPtr;
+class FSImpl;
+typedef std::shared_ptr<FSImpl> FSImplPtr;
+
+enum SeekMode { SeekSet = 0, SeekCur = 1, SeekEnd = 2 };
+
+class File : public Stream {
+  public:
+    File(FileImplPtr p = FileImplPtr()) : _p(p) {
+        _timeout = 0;
+    }
+
+    size_t write(uint8_t) override;
+    size_t write(const uint8_t *buf, size_t size) override;
+    int available() override;
+    int read() override;
+    int peek() override;
+    void flush() override;
+    size_t read(uint8_t *buf, size_t size);
+
+    size_t readBytes(char *buffer, size_t length) {
+        return read((uint8_t *)buffer, length);
+    }
+
+    bool seek(uint32_t pos, SeekMode mode);
+
+    bool seek(uint32_t pos) {
+        return seek(pos, SeekSet);
+    }
+
+    size_t position() const;
+    size_t size() const;
+    bool setBufferSize(size_t size);
+    void close();
+    operator bool() const;
+    time_t getLastWrite();
+    const char *path() const;
+    const char *name() const;
+
+    boolean isDirectory(void);
+    File openNextFile(const char *mode = FILE_READ);
+    void rewindDirectory(void);
+
+  protected:
+    FileImplPtr _p;
+};
+
+class FileImpl {
+  public:
+    virtual ~FileImpl() {}
+
+    virtual size_t write(const uint8_t *buf, size_t size) = 0;
+    virtual size_t read(uint8_t *buf, size_t size)        = 0;
+    virtual void flush()                                  = 0;
+    virtual bool seek(uint32_t pos, SeekMode mode)        = 0;
+    virtual size_t position() const                       = 0;
+    virtual size_t size() const                           = 0;
+    virtual bool setBufferSize(size_t size)               = 0;
+    virtual void close()                                  = 0;
+    virtual time_t getLastWrite()                         = 0;
+    virtual const char *path() const                      = 0;
+    virtual const char *name() const                      = 0;
+    virtual boolean isDirectory(void)                     = 0;
+    virtual FileImplPtr openNextFile(const char *mode)    = 0;
+    virtual void rewindDirectory(void)                    = 0;
+    virtual operator bool()                               = 0;
+};
+
+class FS {
+  public:
+    FS(FSImplPtr impl) : _impl(impl) {}
+
+    File open(const char *path, const char *mode = FILE_READ, const bool create = false);
+    File open(const String &path, const char *mode = FILE_READ, const bool create = false);
+
+    bool exists(const char *path);
+    bool exists(const String &path);
+
+    bool remove(const char *path);
+    bool remove(const String &path);
+
+    bool rename(const char *pathFrom, const char *pathTo);
+    bool rename(const String &pathFrom, const String &pathTo);
+
+    bool mkdir(const char *path);
+    bool mkdir(const String &path);
+
+    bool rmdir(const char *path);
+    bool rmdir(const String &path);
+
+  protected:
+    FSImplPtr _impl;
+};
+
+class FSImpl {
+  public:
+    FSImpl() {}
+
+    virtual ~FSImpl() {}
+
+    virtual FileImplPtr open(const char *path, const char *mode, const bool create) = 0;
+    virtual bool exists(const char *path)                                           = 0;
+    virtual bool rename(const char *pathFrom, const char *pathTo)                   = 0;
+    virtual bool remove(const char *path)                                           = 0;
+    virtual bool mkdir(const char *path)                                            = 0;
+    virtual bool rmdir(const char *path)                                            = 0;
+};
+
+} // namespace fs
+
+#ifndef FS_NO_GLOBALS
+using fs::File;
+using fs::FS;
+using fs::SeekCur;
+using fs::SeekEnd;
+using fs::SeekMode;
+using fs::SeekSet;
+#endif // FS_NO_GLOBALS
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/libraries_2common_2_m_d5_2_m_d5_8h/index.html b/ltapi/libraries_2common_2_m_d5_2_m_d5_8h/index.html new file mode 100644 index 000000000..1944e35f3 --- /dev/null +++ b/ltapi/libraries_2common_2_m_d5_2_m_d5_8h/index.html @@ -0,0 +1,2618 @@ + + + + + + + + + + + + + + + + + + + + + + + + MD5 - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File MD5.h

+

FileList > arduino > libraries > common > MD5 > MD5.h

+

Go to the source code of this file.

+
    +
  • #include <Arduino.h>
  • +
+

Public Types

+ + + + + + + + + + + + + +
TypeName
typedef LT_MD5_CTX_Tmd5_context_t
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + +
TypeName
voidMD5Final (unsigned char digest, LT_MD5_CTX_T * context)
voidMD5Init (LT_MD5_CTX_T * context)
voidMD5Update (LT_MD5_CTX_T * context, const unsigned char * buf, unsigned len)
+

Macros

+ + + + + + + + + + + + + +
TypeName
defineLT_MD5_CTX_T void
+

Public Types Documentation

+

typedef md5_context_t

+
typedef LT_MD5_CTX_T md5_context_t;
+
+

Public Functions Documentation

+

function MD5Final

+
void MD5Final (
+    unsigned char digest,
+    LT_MD5_CTX_T * context
+) 
+
+

function MD5Init

+
void MD5Init (
+    LT_MD5_CTX_T * context
+) 
+
+

function MD5Update

+
void MD5Update (
+    LT_MD5_CTX_T * context,
+    const unsigned char * buf,
+    unsigned len
+) 
+
+

Macro Definition Documentation

+

define LT_MD5_CTX_T

+
#define LT_MD5_CTX_T void
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/MD5/MD5.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/libraries_2common_2_m_d5_2_m_d5_8h_source/index.html b/ltapi/libraries_2common_2_m_d5_2_m_d5_8h_source/index.html new file mode 100644 index 000000000..585ffa072 --- /dev/null +++ b/ltapi/libraries_2common_2_m_d5_2_m_d5_8h_source/index.html @@ -0,0 +1,2327 @@ + + + + + + + + + + + + + + + + + + + + File MD5.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File MD5.h

+

File List > arduino > libraries > common > MD5 > MD5.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-06-03. */
+
+#pragma once
+
+#include <Arduino.h>
+
+// available built-in implementations
+#if LT_ARD_MD5_MBEDTLS
+#include "MD5MbedTLSImpl.h"
+#endif
+#if LT_ARD_MD5_HOSTAPD
+#include "MD5HostapdImpl.h"
+#endif
+
+// common API
+#ifdef __cplusplus
+extern "C" {
+#endif // __cplusplus
+
+#ifndef LT_MD5_CTX_T
+#define LT_MD5_CTX_T void
+#endif
+
+// for compatibility with ESP8266
+typedef LT_MD5_CTX_T md5_context_t;
+
+void MD5Init(LT_MD5_CTX_T *context);
+void MD5Update(LT_MD5_CTX_T *context, const unsigned char *buf, unsigned len);
+void MD5Final(unsigned char digest[16], LT_MD5_CTX_T *context);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/libretiny_8h/index.html b/ltapi/libretiny_8h/index.html new file mode 100644 index 000000000..2ed6ea6fe --- /dev/null +++ b/ltapi/libretiny_8h/index.html @@ -0,0 +1,2488 @@ + + + + + + + + + + + + + + + + + + + + File libretiny.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

File libretiny.h

+

FileList > base > libretiny.h

+

Go to the source code of this file.

+
    +
  • #include <errno.h>
  • +
  • #include <inttypes.h>
  • +
  • #include <math.h>
  • +
  • #include <stdarg.h>
  • +
  • #include <stdbool.h>
  • +
  • #include <stddef.h>
  • +
  • #include <stdint.h>
  • +
  • #include <stdio.h>
  • +
  • #include <stdlib.h>
  • +
  • #include <string.h>
  • +
  • #include "lt_config.h"
  • +
  • #include "lt_types.h"
  • +
  • #include <lt_family.h>
  • +
  • #include "lt_api.h"
  • +
  • #include "lt_logger.h"
  • +
  • #include "lt_pins.h"
  • +
  • #include "lt_posix_api.h"
  • +
  • #include <printf_port.h>
  • +
+

Macros

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
defineGCC_VERSION_STR STRINGIFY_MACRO(__GNUC__) "." STRINGIFY_MACRO(__GNUC_MINOR__) "." STRINGIFY_MACRO(__GNUC_PATCHLEVEL__)
defineLT_BANNER () LT_LOG(LT_LEVEL_INFO, __FUNCTION__, __LINE__, LT_BANNER_STR)
defineLT_BANNER_STR
defineLT_BOARD unknown
defineLT_BOARD_STR STRINGIFY_MACRO(LT_BOARD)
defineLT_VERSION 1.0.0
defineLT_VERSION_STR STRINGIFY_MACRO(LT_VERSION)
defineSTRINGIFY (x) #x
defineSTRINGIFY_MACRO (x) STRINGIFY(x)
+

Macro Definition Documentation

+

define GCC_VERSION_STR

+
#define GCC_VERSION_STR STRINGIFY_MACRO(__GNUC__) "." STRINGIFY_MACRO(__GNUC_MINOR__) "." STRINGIFY_MACRO(__GNUC_PATCHLEVEL__)
+
+

define LT_BANNER

+
#define LT_BANNER (
+
+) LT_LOG(LT_LEVEL_INFO, __FUNCTION__, __LINE__, LT_BANNER_STR)
+
+

define LT_BANNER_STR

+
#define LT_BANNER_STR "LibreTiny v" LT_VERSION_STR " on " LT_BOARD_STR ", compiled at " __DATE__ " " __TIME__ ", GCC " GCC_VERSION_STR   \
+    " (-O" STRINGIFY_MACRO(__OPTIMIZE_LEVEL__) ")"
+
+

define LT_BOARD

+
#define LT_BOARD unknown
+
+

define LT_BOARD_STR

+
#define LT_BOARD_STR STRINGIFY_MACRO(LT_BOARD)
+
+

define LT_VERSION

+
#define LT_VERSION 1.0.0
+
+

define LT_VERSION_STR

+
#define LT_VERSION_STR STRINGIFY_MACRO(LT_VERSION)
+
+

define STRINGIFY

+
#define STRINGIFY (
+    x
+) #x
+
+

define STRINGIFY_MACRO

+
#define STRINGIFY_MACRO (
+    x
+) STRINGIFY(x)
+
+
+

The documentation for this class was generated from the following file cores/common/base/libretiny.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/libretiny_8h_source/index.html b/ltapi/libretiny_8h_source/index.html new file mode 100644 index 000000000..a9028da37 --- /dev/null +++ b/ltapi/libretiny_8h_source/index.html @@ -0,0 +1,2344 @@ + + + + + + + + + + + + + + + + + + + + File libretiny.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File libretiny.h

+

File List > base > libretiny.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-04-28. */
+
+#pragma once
+
+// C standard libraries
+#include <errno.h>
+#include <inttypes.h>
+#include <math.h>
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+// LibreTiny version macros
+#ifndef LT_VERSION
+#define LT_VERSION 1.0.0
+#endif
+#ifndef LT_BOARD
+#define LT_BOARD unknown
+#endif
+#define STRINGIFY(x)       #x
+#define STRINGIFY_MACRO(x) STRINGIFY(x)
+#define LT_VERSION_STR     STRINGIFY_MACRO(LT_VERSION)
+#define LT_BOARD_STR       STRINGIFY_MACRO(LT_BOARD)
+#define GCC_VERSION_STR                                                                                                \
+    STRINGIFY_MACRO(__GNUC__) "." STRINGIFY_MACRO(__GNUC_MINOR__) "." STRINGIFY_MACRO(__GNUC_PATCHLEVEL__)
+#define LT_BANNER_STR                                                                                                  \
+    "LibreTiny v" LT_VERSION_STR " on " LT_BOARD_STR ", compiled at " __DATE__ " " __TIME__ ", GCC " GCC_VERSION_STR   \
+    " (-O" STRINGIFY_MACRO(__OPTIMIZE_LEVEL__) ")"
+
+// Functional macros
+#define LT_BANNER() LT_LOG(LT_LEVEL_INFO, __FUNCTION__, __LINE__, LT_BANNER_STR)
+
+// Types & macros
+#include "lt_config.h" // platform configuration options
+#include "lt_types.h"  // types & enums
+// Family-specific macros
+#include <lt_family.h>
+// Board variant (pin definitions)
+#include LT_VARIANT_H
+// APIs
+#include "lt_api.h"       // main API function definitions
+#include "lt_logger.h"    // UART logger utility
+#include "lt_pins.h"      // additional pin macros
+#include "lt_posix_api.h" // POSIX compat functions
+// printf silencing methods
+#include <printf_port.h>
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/links/index.html b/ltapi/links/index.html new file mode 100644 index 000000000..ff6b99ea6 --- /dev/null +++ b/ltapi/links/index.html @@ -0,0 +1,2804 @@ + + + + + + + + + + + + + + + + + + + + Links - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + + + + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__api_8h/index.html b/ltapi/lt__api_8h/index.html new file mode 100644 index 000000000..56d624d55 --- /dev/null +++ b/ltapi/lt__api_8h/index.html @@ -0,0 +1,2306 @@ + + + + + + + + + + + + + + + + + + + + File lt\_api.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_api.h

+

FileList > base > lt_api.h

+

Go to the source code of this file.

+
    +
  • #include "api/lt_cpu.h"
  • +
  • #include "api/lt_device.h"
  • +
  • #include "api/lt_flash.h"
  • +
  • #include "api/lt_init.h"
  • +
  • #include "api/lt_mem.h"
  • +
  • #include "api/lt_ota.h"
  • +
  • #include "api/lt_sleep.h"
  • +
  • #include "api/lt_utils.h"
  • +
  • #include "api/lt_wdt.h"
  • +
+
+

The documentation for this class was generated from the following file cores/common/base/lt_api.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__api_8h_source/index.html b/ltapi/lt__api_8h_source/index.html new file mode 100644 index 000000000..3f91b0cd8 --- /dev/null +++ b/ltapi/lt__api_8h_source/index.html @@ -0,0 +1,2319 @@ + + + + + + + + + + + + + + + + + + + + File lt\_api.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_api.h

+

File List > base > lt_api.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2023-03-09. */
+
+#pragma once
+
+// This file collects all LibreTiny C API includes.
+// The functions are implemented in api/*.c units, which are located
+// in the common core, and in the family cores.
+
+#ifdef __cplusplus
+extern "C" {
+#endif // __cplusplus
+
+#include "api/lt_cpu.h"
+#include "api/lt_device.h"
+#include "api/lt_flash.h"
+#include "api/lt_init.h"
+#include "api/lt_mem.h"
+#include "api/lt_ota.h"
+#include "api/lt_sleep.h"
+#include "api/lt_utils.h"
+#include "api/lt_wdt.h"
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__config_8h/index.html b/ltapi/lt__config_8h/index.html new file mode 100644 index 000000000..b3cdfcdfb --- /dev/null +++ b/ltapi/lt__config_8h/index.html @@ -0,0 +1,2811 @@ + + + + + + + + + + + + + + + + + + + + File lt\_config.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

File lt_config.h

+

FileList > base > lt_config.h

+

Go to the source code of this file.

+

Macros

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
defineLT_AUTO_DOWNLOAD_REBOOT 1
defineLT_DEBUG_ALL 0
defineLT_DEBUG_CLIENT LT_DEBUG_ALL
defineLT_DEBUG_FDB 0
defineLT_DEBUG_LWIP 0
defineLT_DEBUG_LWIP_ASSERT 0
defineLT_DEBUG_MDNS LT_DEBUG_ALL
defineLT_DEBUG_OTA 1
defineLT_DEBUG_SERVER LT_DEBUG_ALL
defineLT_DEBUG_SSL LT_DEBUG_ALL
defineLT_DEBUG_WIFI 1
defineLT_LEVEL_DEBUG 1
defineLT_LEVEL_ERROR 4
defineLT_LEVEL_FATAL 5
defineLT_LEVEL_INFO 2
defineLT_LEVEL_NONE 6
defineLT_LEVEL_TRACE 0
defineLT_LEVEL_VERBOSE LT_LEVEL_TRACE
defineLT_LEVEL_WARN 3
defineLT_LOGGER 1
defineLT_LOGGER_CALLER 0
defineLT_LOGGER_COLOR 0
defineLT_LOGGER_TASK 0
defineLT_LOGGER_TIMESTAMP 1
defineLT_LOGLEVEL LT_LEVEL_INFO
defineLT_LOG_ERRNO 0
defineLT_LOG_HEAP 0
defineLT_MICROS_HIGH_RES 1
defineLT_PRINTF_BROKEN 0
defineLT_UART_DEFAULT_LOGGER LT_UART_DEFAULT_PORT
defineLT_UART_DEFAULT_SERIAL LT_UART_DEFAULT_PORT
defineLT_UART_SILENT_ALL 0
defineLT_UART_SILENT_ENABLED 1
defineLT_USE_TIME 0
+

Macro Definition Documentation

+

define LT_AUTO_DOWNLOAD_REBOOT

+
#define LT_AUTO_DOWNLOAD_REBOOT 1
+
+

define LT_DEBUG_ALL

+
#define LT_DEBUG_ALL 0
+
+

define LT_DEBUG_CLIENT

+
#define LT_DEBUG_CLIENT LT_DEBUG_ALL
+
+

define LT_DEBUG_FDB

+
#define LT_DEBUG_FDB 0
+
+

define LT_DEBUG_LWIP

+
#define LT_DEBUG_LWIP 0
+
+

define LT_DEBUG_LWIP_ASSERT

+
#define LT_DEBUG_LWIP_ASSERT 0
+
+

define LT_DEBUG_MDNS

+
#define LT_DEBUG_MDNS LT_DEBUG_ALL
+
+

define LT_DEBUG_OTA

+
#define LT_DEBUG_OTA 1
+
+

define LT_DEBUG_SERVER

+
#define LT_DEBUG_SERVER LT_DEBUG_ALL
+
+

define LT_DEBUG_SSL

+
#define LT_DEBUG_SSL LT_DEBUG_ALL
+
+

define LT_DEBUG_WIFI

+
#define LT_DEBUG_WIFI 1
+
+

define LT_LEVEL_DEBUG

+
#define LT_LEVEL_DEBUG 1
+
+

define LT_LEVEL_ERROR

+
#define LT_LEVEL_ERROR 4
+
+

define LT_LEVEL_FATAL

+
#define LT_LEVEL_FATAL 5
+
+

define LT_LEVEL_INFO

+
#define LT_LEVEL_INFO 2
+
+

define LT_LEVEL_NONE

+
#define LT_LEVEL_NONE 6
+
+

define LT_LEVEL_TRACE

+
#define LT_LEVEL_TRACE 0
+
+

define LT_LEVEL_VERBOSE

+
#define LT_LEVEL_VERBOSE LT_LEVEL_TRACE
+
+

define LT_LEVEL_WARN

+
#define LT_LEVEL_WARN 3
+
+

define LT_LOGGER

+
#define LT_LOGGER 1
+
+

define LT_LOGGER_CALLER

+
#define LT_LOGGER_CALLER 0
+
+

define LT_LOGGER_COLOR

+
#define LT_LOGGER_COLOR 0
+
+

define LT_LOGGER_TASK

+
#define LT_LOGGER_TASK 0
+
+

define LT_LOGGER_TIMESTAMP

+
#define LT_LOGGER_TIMESTAMP 1
+
+

define LT_LOGLEVEL

+
#define LT_LOGLEVEL LT_LEVEL_INFO
+
+

define LT_LOG_ERRNO

+
#define LT_LOG_ERRNO 0
+
+

define LT_LOG_HEAP

+
#define LT_LOG_HEAP 0
+
+

define LT_MICROS_HIGH_RES

+
#define LT_MICROS_HIGH_RES 1
+
+

define LT_PRINTF_BROKEN

+
#define LT_PRINTF_BROKEN 0
+
+

define LT_UART_DEFAULT_LOGGER

+
#define LT_UART_DEFAULT_LOGGER LT_UART_DEFAULT_PORT
+
+

define LT_UART_DEFAULT_SERIAL

+
#define LT_UART_DEFAULT_SERIAL LT_UART_DEFAULT_PORT
+
+

define LT_UART_SILENT_ALL

+
#define LT_UART_SILENT_ALL 0
+
+

define LT_UART_SILENT_ENABLED

+
#define LT_UART_SILENT_ENABLED 1
+
+

define LT_USE_TIME

+
#define LT_USE_TIME 0
+
+
+

The documentation for this class was generated from the following file cores/common/base/lt_config.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__config_8h_source/index.html b/ltapi/lt__config_8h_source/index.html new file mode 100644 index 000000000..b65c1c7ac --- /dev/null +++ b/ltapi/lt__config_8h_source/index.html @@ -0,0 +1,2426 @@ + + + + + + + + + + + + + + + + + + + + File lt\_config.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_config.h

+

File List > base > lt_config.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-04-28. */
+
+#pragma once
+
+// see docs/API Configuration
+
+// Loglevels
+#define LT_LEVEL_VERBOSE LT_LEVEL_TRACE
+#define LT_LEVEL_TRACE   0
+#define LT_LEVEL_DEBUG   1
+#define LT_LEVEL_INFO    2
+#define LT_LEVEL_WARN    3
+#define LT_LEVEL_ERROR   4
+#define LT_LEVEL_FATAL   5
+#define LT_LEVEL_NONE    6
+
+// Logger enabled/disabled
+#ifndef LT_LOGGER
+#define LT_LOGGER 1
+#endif
+
+// Logger format options
+#ifndef LT_LOGGER_TIMESTAMP
+#define LT_LOGGER_TIMESTAMP 1
+#endif
+
+#ifndef LT_LOGGER_CALLER
+#define LT_LOGGER_CALLER 0
+#endif
+
+#ifndef LT_LOGGER_TASK
+#define LT_LOGGER_TASK 0
+#endif
+
+#ifndef LT_LOGGER_COLOR
+#define LT_LOGGER_COLOR 0
+#endif
+
+#ifndef LT_PRINTF_BROKEN
+#define LT_PRINTF_BROKEN 0
+#endif
+
+// Global loglevel
+#ifndef LT_LOGLEVEL
+#define LT_LOGLEVEL LT_LEVEL_INFO
+#endif
+
+#if !LT_LOGGER
+#undef LT_LOGLEVEL
+#define LT_LOGLEVEL LT_LEVEL_NONE
+#endif
+
+// Free heap size debugging
+#ifndef LT_LOG_HEAP
+#define LT_LOG_HEAP 0
+#endif
+
+// Debug errno values using LT_ERRNO()
+#ifndef LT_LOG_ERRNO
+#define LT_LOG_ERRNO 0
+#endif
+
+// Serial output options
+#ifndef LT_UART_SILENT_ENABLED
+#define LT_UART_SILENT_ENABLED 1
+#endif
+
+#ifndef LT_UART_SILENT_ALL
+#define LT_UART_SILENT_ALL 0
+#endif
+
+#ifndef LT_UART_DEFAULT_LOGGER
+#define LT_UART_DEFAULT_LOGGER LT_UART_DEFAULT_PORT
+#endif
+
+#ifndef LT_UART_DEFAULT_SERIAL
+#define LT_UART_DEFAULT_SERIAL LT_UART_DEFAULT_PORT
+#endif
+
+// Misc options
+#ifndef LT_USE_TIME
+#define LT_USE_TIME 0
+#endif
+
+#ifndef LT_MICROS_HIGH_RES // NOTE: this is also defined in fixups/clock_rtos.c
+#define LT_MICROS_HIGH_RES 1
+#endif
+
+#ifndef LT_AUTO_DOWNLOAD_REBOOT
+#define LT_AUTO_DOWNLOAD_REBOOT 1
+#endif
+
+// Per-module logging output - applies to all loglevels
+#ifndef LT_DEBUG_ALL
+#define LT_DEBUG_ALL 0
+#endif
+
+#ifndef LT_DEBUG_WIFI
+#define LT_DEBUG_WIFI 1
+#endif
+
+#ifndef LT_DEBUG_CLIENT
+#define LT_DEBUG_CLIENT LT_DEBUG_ALL
+#endif
+
+#ifndef LT_DEBUG_SERVER
+#define LT_DEBUG_SERVER LT_DEBUG_ALL
+#endif
+
+#ifndef LT_DEBUG_SSL
+#define LT_DEBUG_SSL LT_DEBUG_ALL
+#endif
+
+#ifndef LT_DEBUG_OTA
+#define LT_DEBUG_OTA 1
+#endif
+
+#ifndef LT_DEBUG_FDB
+#define LT_DEBUG_FDB 0
+#endif
+
+#ifndef LT_DEBUG_MDNS
+#define LT_DEBUG_MDNS LT_DEBUG_ALL
+#endif
+
+#ifndef LT_DEBUG_LWIP
+#define LT_DEBUG_LWIP 0
+#endif
+
+#ifndef LT_DEBUG_LWIP_ASSERT
+#define LT_DEBUG_LWIP_ASSERT 0
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__cpu_8c/index.html b/ltapi/lt__cpu_8c/index.html new file mode 100644 index 000000000..0bc497793 --- /dev/null +++ b/ltapi/lt__cpu_8c/index.html @@ -0,0 +1,2424 @@ + + + + + + + + + + + + + + + + + + + + File lt\_cpu.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

File lt_cpu.c

+

FileList > api > lt_cpu.c

+

Go to the source code of this file.

+
    +
  • #include "lt_cpu.h"
  • +
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
__attribute__ ((weak))
lt_cpu_family_tlt_cpu_get_family ()
Get CPU family ID (as lt_cpu_family_t enum member).
const char *lt_cpu_get_family_name ()
Get CPU family name as string.
uint32_tlt_cpu_get_freq_mhz ()
Get CPU frequency in MHz.
const char *lt_cpu_get_model_code ()
Get CPU model name as string (lowercase).
const char *lt_cpu_get_model_name ()
Get CPU model name as string (uppercase).
+

Public Functions Documentation

+

function __attribute__

+
__attribute__ (
+    (weak)
+) 
+
+

function lt_cpu_get_family

+
lt_cpu_family_t lt_cpu_get_family () 
+
+

function lt_cpu_get_family_name

+
const char * lt_cpu_get_family_name () 
+
+

function lt_cpu_get_freq_mhz

+
uint32_t lt_cpu_get_freq_mhz () 
+
+

function lt_cpu_get_model_code

+
const char * lt_cpu_get_model_code () 
+
+

function lt_cpu_get_model_name

+
const char * lt_cpu_get_model_name () 
+
+
+

The documentation for this class was generated from the following file cores/common/base/api/lt_cpu.c

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__cpu_8c_source/index.html b/ltapi/lt__cpu_8c_source/index.html new file mode 100644 index 000000000..652c9086f --- /dev/null +++ b/ltapi/lt__cpu_8c_source/index.html @@ -0,0 +1,2352 @@ + + + + + + + + + + + + + + + + + + + + File lt\_cpu.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_cpu.c

+

File List > api > lt_cpu.c

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-04-29. */
+
+#include "lt_cpu.h"
+
+#if LT_HAS_FREERTOS
+#include <FreeRTOS.h>
+#include <task.h>
+#endif
+
+lt_cpu_family_t lt_cpu_get_family() {
+    return FAMILY;
+}
+
+const char *lt_cpu_get_family_name() {
+    return STRINGIFY_MACRO(FAMILY) + 2;
+}
+
+__attribute__((weak)) lt_cpu_model_t lt_cpu_get_model() {
+    return MCU;
+}
+
+const char *lt_cpu_get_model_name() {
+    return STRINGIFY_MACRO(MCU);
+}
+
+const char *lt_cpu_get_model_code() {
+    return STRINGIFY_MACRO(MCULC);
+}
+
+__attribute__((weak)) uint32_t lt_cpu_get_unique_id() {
+    return lt_cpu_get_mac_id();
+}
+
+__attribute__((weak)) uint32_t lt_cpu_get_mac_id() {
+    uint8_t mac[6];
+    lt_get_device_mac(mac);
+    return (mac[3] << 0) | (mac[4] << 8) | (mac[5] << 16);
+}
+
+__attribute__((weak)) uint8_t lt_cpu_get_core_count() {
+    return 1;
+}
+
+#if LT_HAS_FREERTOS
+__attribute__((weak)) uint32_t lt_cpu_get_freq() {
+    return configCPU_CLOCK_HZ;
+}
+#endif
+
+uint32_t lt_cpu_get_freq_mhz() {
+    return lt_cpu_get_freq() / 1000000;
+}
+
+#if LT_HAS_FREERTOS
+__attribute__((weak)) uint32_t lt_cpu_get_cycle_count() {
+    return xTaskGetTickCount() * (configCPU_CLOCK_HZ / configTICK_RATE_HZ);
+}
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__cpu_8h/index.html b/ltapi/lt__cpu_8h/index.html new file mode 100644 index 000000000..bb0f3005e --- /dev/null +++ b/ltapi/lt__cpu_8h/index.html @@ -0,0 +1,2506 @@ + + + + + + + + + + + + + + + + + + + + File lt\_cpu.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

File lt_cpu.h

+

FileList > api > lt_cpu.h

+

Go to the source code of this file.

+
    +
  • #include <libretiny.h>
  • +
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
uint8_tlt_cpu_get_core_count ()
Get CPU core count.
const char *lt_cpu_get_core_type ()
Get CPU core type name as string.
uint32_tlt_cpu_get_cycle_count ()
Get CPU cycle count.
lt_cpu_family_tlt_cpu_get_family ()
Get CPU family ID (as lt_cpu_family_t enum member).
const char *lt_cpu_get_family_name ()
Get CPU family name as string.
uint32_tlt_cpu_get_freq ()
Get CPU frequency in Hz.
uint32_tlt_cpu_get_freq_mhz ()
Get CPU frequency in MHz.
uint32_tlt_cpu_get_mac_id ()
Get CPU ID based on the last three octets of MAC address. Note: the number is 24-bit (with the MSB being zero). The 3rd-to-last octet is least-significant, the last octet is most-significant.
lt_cpu_model_tlt_cpu_get_model ()
Get CPU model ID (as lt_cpu_model_t enum member).
const char *lt_cpu_get_model_code ()
Get CPU model name as string (lowercase).
const char *lt_cpu_get_model_name ()
Get CPU model name as string (uppercase).
uint32_tlt_cpu_get_unique_id ()
Get CPU unique ID. This may be based on MAC, eFuse, etc. (family-specific). Note: the number is 24-bit (with the MSB being zero).
+

Public Functions Documentation

+

function lt_cpu_get_core_count

+
uint8_t lt_cpu_get_core_count () 
+
+

function lt_cpu_get_core_type

+
const char * lt_cpu_get_core_type () 
+
+

function lt_cpu_get_cycle_count

+
uint32_t lt_cpu_get_cycle_count () 
+
+

function lt_cpu_get_family

+
lt_cpu_family_t lt_cpu_get_family () 
+
+

function lt_cpu_get_family_name

+
const char * lt_cpu_get_family_name () 
+
+

function lt_cpu_get_freq

+
uint32_t lt_cpu_get_freq () 
+
+

function lt_cpu_get_freq_mhz

+
uint32_t lt_cpu_get_freq_mhz () 
+
+

function lt_cpu_get_mac_id

+
uint32_t lt_cpu_get_mac_id () 
+
+

function lt_cpu_get_model

+
lt_cpu_model_t lt_cpu_get_model () 
+
+

function lt_cpu_get_model_code

+
const char * lt_cpu_get_model_code () 
+
+

function lt_cpu_get_model_name

+
const char * lt_cpu_get_model_name () 
+
+

function lt_cpu_get_unique_id

+
uint32_t lt_cpu_get_unique_id () 
+
+
+

The documentation for this class was generated from the following file cores/common/base/api/lt_cpu.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__cpu_8h_source/index.html b/ltapi/lt__cpu_8h_source/index.html new file mode 100644 index 000000000..dd336833c --- /dev/null +++ b/ltapi/lt__cpu_8h_source/index.html @@ -0,0 +1,2323 @@ + + + + + + + + + + + + + + + + + + + + File lt\_cpu.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_cpu.h

+

File List > api > lt_cpu.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2023-03-09. */
+
+#pragma once
+
+#include <libretiny.h>
+
+lt_cpu_family_t lt_cpu_get_family();
+
+const char *lt_cpu_get_family_name();
+
+lt_cpu_model_t lt_cpu_get_model();
+
+const char *lt_cpu_get_model_name();
+
+const char *lt_cpu_get_model_code();
+
+uint32_t lt_cpu_get_unique_id();
+
+uint32_t lt_cpu_get_mac_id();
+
+uint8_t lt_cpu_get_core_count();
+
+const char *lt_cpu_get_core_type();
+
+uint32_t lt_cpu_get_freq();
+
+uint32_t lt_cpu_get_freq_mhz();
+
+uint32_t lt_cpu_get_cycle_count();
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__device_8c/index.html b/ltapi/lt__device_8c/index.html new file mode 100644 index 000000000..c414adbc6 --- /dev/null +++ b/ltapi/lt__device_8c/index.html @@ -0,0 +1,2463 @@ + + + + + + + + + + + + + + + + + + + + File lt\_device.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

File lt_device.c

+

FileList > api > lt_device.c

+

Go to the source code of this file.

+
    +
  • #include "lt_device.h"
  • +
+

Public Static Attributes

+ + + + + + + + + + + + + +
TypeName
char *device_name = = NULL
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
__attribute__ ((weak))
const char *lt_get_board_code ()
Get board code.
const char *lt_get_device_name ()
Get device friendly name in format "LT-<chip model>-<MAC ID>". Can be used as hostname.
const char *lt_get_reboot_reason_name (lt_reboot_reason_t reason)
Get a textual representation of a reboot reason.
const char *lt_get_version ()
Get LibreTiny version string.
+

Public Static Attributes Documentation

+

variable device_name

+
char* device_name;
+
+

Public Functions Documentation

+

function __attribute__

+
__attribute__ (
+    (weak)
+) 
+
+

function lt_get_board_code

+
const char * lt_get_board_code () 
+
+

function lt_get_device_name

+
const char * lt_get_device_name () 
+
+

function lt_get_reboot_reason_name

+

Get a textual representation of a reboot reason. +

const char * lt_get_reboot_reason_name (
+    lt_reboot_reason_t reason
+) 
+

+

Parameters:

+
    +
  • reason value to convert to text, pass 0 to read from lt_reboot_get_reason()
  • +
+

function lt_get_version

+
const char * lt_get_version () 
+
+
+

The documentation for this class was generated from the following file cores/common/base/api/lt_device.c

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__device_8c_source/index.html b/ltapi/lt__device_8c_source/index.html new file mode 100644 index 000000000..086737309 --- /dev/null +++ b/ltapi/lt__device_8c_source/index.html @@ -0,0 +1,2378 @@ + + + + + + + + + + + + + + + + + + + + File lt\_device.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_device.c

+

File List > api > lt_device.c

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-04-29. */
+
+#include "lt_device.h"
+
+static char *device_name = NULL;
+
+const char *lt_get_version() {
+    return LT_VERSION_STR;
+}
+
+const char *lt_get_board_code() {
+    return LT_BOARD_STR;
+}
+
+const char *lt_get_device_name() {
+    if (device_name)
+        return device_name;
+    uint32_t chip_id = lt_cpu_get_mac_id();
+    uint8_t *id      = (uint8_t *)&chip_id;
+
+    const char *model = lt_cpu_get_model_code();
+    uint8_t model_len = strlen(model);
+    device_name       = (char *)malloc(3 + model_len + 1 + 6 + 1);
+
+    sprintf(device_name, "LT-%s-%02x%02x%02x", model, id[0], id[1], id[2]);
+    return device_name;
+}
+
+__attribute__((weak)) void lt_reboot() {
+    // The Watchdog Way
+    lt_wdt_enable(1L);
+    while (1) {}
+}
+
+__attribute__((weak)) bool lt_reboot_wdt() {
+    if (!lt_wdt_enable(1L))
+        return false;
+    while (1) {}
+}
+
+__attribute__((weak)) bool lt_reboot_download_mode() {
+    return false;
+}
+
+__attribute__((weak)) lt_reboot_reason_t lt_get_reboot_reason() {
+    return REBOOT_REASON_UNKNOWN;
+}
+
+const char *lt_get_reboot_reason_name(lt_reboot_reason_t reason) {
+    if (!reason)
+        reason = lt_get_reboot_reason();
+    switch (reason) {
+        case REBOOT_REASON_POWER:
+            return "Power-On";
+        case REBOOT_REASON_BROWNOUT:
+            return "Brownout";
+        case REBOOT_REASON_HARDWARE:
+            return "HW Reboot";
+        case REBOOT_REASON_SOFTWARE:
+            return "SW Reboot";
+        case REBOOT_REASON_WATCHDOG:
+            return "WDT Reset";
+        case REBOOT_REASON_CRASH:
+            return "Crash";
+        case REBOOT_REASON_SLEEP_GPIO:
+            return "Sleep Wakeup (GPIO)";
+        case REBOOT_REASON_SLEEP_RTC:
+            return "Sleep Wakeup (RTC)";
+        case REBOOT_REASON_SLEEP_USB:
+            return "Sleep Wakeup (USB)";
+        case REBOOT_REASON_DEBUGGER:
+            return "Debugger";
+        default:
+            return "Unknown";
+    }
+}
+
+__attribute__((weak)) bool lt_set_debug_mode(lt_debug_mode_t mode) {
+    return false;
+}
+
+__attribute__((weak)) void lt_gpio_recover() {
+    lt_set_debug_mode(DEBUG_MODE_OFF);
+}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__device_8h/index.html b/ltapi/lt__device_8h/index.html new file mode 100644 index 000000000..5db88c077 --- /dev/null +++ b/ltapi/lt__device_8h/index.html @@ -0,0 +1,2803 @@ + + + + + + + + + + + + + + + + + + + + File lt\_device.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

File lt_device.h

+

FileList > api > lt_device.h

+

Go to the source code of this file.

+
    +
  • #include <libretiny.h>
  • +
+

Public Types

+ + + + + + + + + + + + + + + + + +
TypeName
enumlt_debug_mode_t
Debugging mode enumeration.
enumlt_reboot_reason_t
Reset reason enumeration.
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
const char *lt_get_board_code ()
Get board code.
voidlt_get_device_mac (uint8_t * mac)
Read device's default MAC address into 'mac' array. This can be used even without Wi-Fi enabled, and will ignore user-changed Wi-Fi MAC (if changing is possible).
const char *lt_get_device_name ()
Get device friendly name in format "LT-<chip model>-<MAC ID>". Can be used as hostname.
lt_reboot_reason_tlt_get_reboot_reason ()
Get the reason of last chip reboot.
const char *lt_get_reboot_reason_name (lt_reboot_reason_t reason)
Get a textual representation of a reboot reason.
const char *lt_get_version ()
Get LibreTiny version string.
voidlt_gpio_recover ()
Reconfigure GPIO pins used for debugging (SWD/JTAG), so that they can be used as normal I/O.
voidlt_reboot ()
Reboot the CPU.
boollt_reboot_download_mode ()
Reboot the CPU and stay in download mode (if possible).
boollt_reboot_wdt ()
Reboot the CPU with a watchdog timeout (if possible).
boollt_set_debug_mode (lt_debug_mode_t mode)
Set debugger mode (JTAG, SWD or OFF).
+

Macros

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
defineREBOOT_REASON_SLEEP REBOOT_REASON_SLEEP_GPIO
defineRESET_REASON_BROWNOUT REBOOT_REASON_BROWNOUT
defineRESET_REASON_CRASH REBOOT_REASON_CRASH
defineRESET_REASON_HARDWARE REBOOT_REASON_HARDWARE
defineRESET_REASON_MAX REBOOT_REASON_MAX
defineRESET_REASON_POWER REBOOT_REASON_POWER
defineRESET_REASON_SLEEP REBOOT_REASON_SLEEP_GPIO
defineRESET_REASON_SLEEP_GPIO REBOOT_REASON_SLEEP_GPIO
defineRESET_REASON_SLEEP_RTC REBOOT_REASON_SLEEP_RTC
defineRESET_REASON_SLEEP_USB REBOOT_REASON_SLEEP_USB
defineRESET_REASON_SOFTWARE REBOOT_REASON_SOFTWARE
defineRESET_REASON_UNKNOWN REBOOT_REASON_UNKNOWN
defineRESET_REASON_WATCHDOG REBOOT_REASON_WATCHDOG
+

Public Types Documentation

+

enum lt_debug_mode_t

+
enum lt_debug_mode_t {
+    DEBUG_MODE_OFF = 0,
+    DEBUG_MODE_JTAG = 1,
+    DEBUG_MODE_SWD = 2
+};
+
+

enum lt_reboot_reason_t

+
enum lt_reboot_reason_t {
+    REBOOT_REASON_UNKNOWN = 1,
+    REBOOT_REASON_POWER = 2,
+    REBOOT_REASON_BROWNOUT = 3,
+    REBOOT_REASON_HARDWARE = 4,
+    REBOOT_REASON_SOFTWARE = 5,
+    REBOOT_REASON_WATCHDOG = 6,
+    REBOOT_REASON_CRASH = 7,
+    REBOOT_REASON_SLEEP_GPIO = 8,
+    REBOOT_REASON_SLEEP_RTC = 9,
+    REBOOT_REASON_SLEEP_USB = 10,
+    REBOOT_REASON_DEBUGGER = 11,
+    REBOOT_REASON_MAX = 12
+};
+
+

Public Functions Documentation

+

function lt_get_board_code

+
const char * lt_get_board_code () 
+
+

function lt_get_device_mac

+
void lt_get_device_mac (
+    uint8_t * mac
+) 
+
+

function lt_get_device_name

+
const char * lt_get_device_name () 
+
+

function lt_get_reboot_reason

+
lt_reboot_reason_t lt_get_reboot_reason () 
+
+

function lt_get_reboot_reason_name

+

Get a textual representation of a reboot reason. +

const char * lt_get_reboot_reason_name (
+    lt_reboot_reason_t reason
+) 
+

+

Parameters:

+
    +
  • reason value to convert to text, pass 0 to read from lt_reboot_get_reason()
  • +
+

function lt_get_version

+
const char * lt_get_version () 
+
+

function lt_gpio_recover

+
void lt_gpio_recover () 
+
+

function lt_reboot

+
void lt_reboot () 
+
+

function lt_reboot_download_mode

+

Reboot the CPU and stay in download mode (if possible). +

bool lt_reboot_download_mode () 
+

+

Returns:

+

whether download-mode reboot is possible

+

function lt_reboot_wdt

+

Reboot the CPU with a watchdog timeout (if possible). +

bool lt_reboot_wdt () 
+

+

Returns:

+

whether WDT reboot is possible

+

function lt_set_debug_mode

+

Set debugger mode (JTAG, SWD or OFF). +

bool lt_set_debug_mode (
+    lt_debug_mode_t mode
+) 
+

+

Returns:

+

whether the mode is supported, and setting it was successful

+

Macro Definition Documentation

+

define REBOOT_REASON_SLEEP

+
#define REBOOT_REASON_SLEEP REBOOT_REASON_SLEEP_GPIO
+
+

define RESET_REASON_BROWNOUT

+
#define RESET_REASON_BROWNOUT REBOOT_REASON_BROWNOUT
+
+

define RESET_REASON_CRASH

+
#define RESET_REASON_CRASH REBOOT_REASON_CRASH
+
+

define RESET_REASON_HARDWARE

+
#define RESET_REASON_HARDWARE REBOOT_REASON_HARDWARE
+
+

define RESET_REASON_MAX

+
#define RESET_REASON_MAX REBOOT_REASON_MAX
+
+

define RESET_REASON_POWER

+
#define RESET_REASON_POWER REBOOT_REASON_POWER
+
+

define RESET_REASON_SLEEP

+
#define RESET_REASON_SLEEP REBOOT_REASON_SLEEP_GPIO
+
+

define RESET_REASON_SLEEP_GPIO

+
#define RESET_REASON_SLEEP_GPIO REBOOT_REASON_SLEEP_GPIO
+
+

define RESET_REASON_SLEEP_RTC

+
#define RESET_REASON_SLEEP_RTC REBOOT_REASON_SLEEP_RTC
+
+

define RESET_REASON_SLEEP_USB

+
#define RESET_REASON_SLEEP_USB REBOOT_REASON_SLEEP_USB
+
+

define RESET_REASON_SOFTWARE

+
#define RESET_REASON_SOFTWARE REBOOT_REASON_SOFTWARE
+
+

define RESET_REASON_UNKNOWN

+
#define RESET_REASON_UNKNOWN REBOOT_REASON_UNKNOWN
+
+

define RESET_REASON_WATCHDOG

+
#define RESET_REASON_WATCHDOG REBOOT_REASON_WATCHDOG
+
+
+

The documentation for this class was generated from the following file cores/common/base/api/lt_device.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__device_8h_source/index.html b/ltapi/lt__device_8h_source/index.html new file mode 100644 index 000000000..521ffeea2 --- /dev/null +++ b/ltapi/lt__device_8h_source/index.html @@ -0,0 +1,2358 @@ + + + + + + + + + + + + + + + + + + + + File lt\_device.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_device.h

+

File List > api > lt_device.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2023-03-09. */
+
+#pragma once
+
+#include <libretiny.h>
+
+#define RESET_REASON_UNKNOWN    REBOOT_REASON_UNKNOWN
+#define RESET_REASON_POWER      REBOOT_REASON_POWER
+#define RESET_REASON_BROWNOUT   REBOOT_REASON_BROWNOUT
+#define RESET_REASON_HARDWARE   REBOOT_REASON_HARDWARE
+#define RESET_REASON_SOFTWARE   REBOOT_REASON_SOFTWARE
+#define RESET_REASON_WATCHDOG   REBOOT_REASON_WATCHDOG
+#define RESET_REASON_CRASH      REBOOT_REASON_CRASH
+#define RESET_REASON_SLEEP_GPIO REBOOT_REASON_SLEEP_GPIO
+#define RESET_REASON_SLEEP_RTC  REBOOT_REASON_SLEEP_RTC
+#define RESET_REASON_SLEEP_USB  REBOOT_REASON_SLEEP_USB
+#define RESET_REASON_MAX        REBOOT_REASON_MAX
+
+typedef enum {
+    REBOOT_REASON_UNKNOWN    = 1,
+    REBOOT_REASON_POWER      = 2,
+    REBOOT_REASON_BROWNOUT   = 3,
+    REBOOT_REASON_HARDWARE   = 4,
+    REBOOT_REASON_SOFTWARE   = 5,
+    REBOOT_REASON_WATCHDOG   = 6,
+    REBOOT_REASON_CRASH      = 7,
+    REBOOT_REASON_SLEEP_GPIO = 8,
+    REBOOT_REASON_SLEEP_RTC  = 9,
+    REBOOT_REASON_SLEEP_USB  = 10,
+    REBOOT_REASON_DEBUGGER   = 11,
+    REBOOT_REASON_MAX        = 12,
+} lt_reboot_reason_t;
+
+// RESET_REASON_SLEEP deprecated, kept for compatibility
+#define RESET_REASON_SLEEP  REBOOT_REASON_SLEEP_GPIO
+#define REBOOT_REASON_SLEEP REBOOT_REASON_SLEEP_GPIO
+
+typedef enum {
+    DEBUG_MODE_OFF  = 0,
+    DEBUG_MODE_JTAG = 1,
+    DEBUG_MODE_SWD  = 2,
+} lt_debug_mode_t;
+
+const char *lt_get_version();
+
+const char *lt_get_board_code();
+
+const char *lt_get_device_name();
+
+void lt_get_device_mac(uint8_t *mac);
+
+void lt_reboot();
+
+bool lt_reboot_wdt();
+
+bool lt_reboot_download_mode();
+
+lt_reboot_reason_t lt_get_reboot_reason();
+
+const char *lt_get_reboot_reason_name(lt_reboot_reason_t reason);
+
+bool lt_set_debug_mode(lt_debug_mode_t mode);
+
+void lt_gpio_recover();
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__flash_8c/index.html b/ltapi/lt__flash_8c/index.html new file mode 100644 index 000000000..415160d5b --- /dev/null +++ b/ltapi/lt__flash_8c/index.html @@ -0,0 +1,2457 @@ + + + + + + + + + + + + + + + + + + + + File lt\_flash.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+ +
+ + + +
+
+ + + + + + + + +

File lt_flash.c

+

FileList > api > lt_flash.c

+

Go to the source code of this file.

+
    +
  • #include "lt_flash.h"
  • +
  • #include <fal.h>
  • +
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
__attribute__ ((weak))
boollt_flash_erase (uint32_t offset, size_t length)
Erase flash area. Flash can only be erased in blocks (usually 4 KiB).
boollt_flash_erase_block (uint32_t offset)
Erase a single block of flash (usually 4 KiB).
uint32_tlt_flash_read (uint32_t offset, uint8_t * data, size_t length)
Read data from the flash.
uint32_tlt_flash_write (uint32_t offset, const uint8_t * data, size_t length)
Write data to the flash.
+

Public Functions Documentation

+

function __attribute__

+
__attribute__ (
+    (weak)
+) 
+
+

function lt_flash_erase

+

Erase flash area. Flash can only be erased in blocks (usually 4 KiB). +

bool lt_flash_erase (
+    uint32_t offset,
+    size_t length
+) 
+

+

Parameters:

+
    +
  • offset starting offset to erase (in bytes); must be multiple of the flash chip's block size
  • +
  • length length of data to erase (in bytes); will be rounded up to block size
  • +
+

Returns:

+

whether erasing was successful

+

function lt_flash_erase_block

+

Erase a single block of flash (usually 4 KiB). +

bool lt_flash_erase_block (
+    uint32_t offset
+) 
+

+

Parameters:

+
    +
  • offset offset of the block (in bytes); must be multiple of the flash chip's block size
  • +
+

Returns:

+

whether erasing was successful

+

function lt_flash_read

+

Read data from the flash. +

uint32_t lt_flash_read (
+    uint32_t offset,
+    uint8_t * data,
+    size_t length
+) 
+

+

Parameters:

+
    +
  • offset starting offset (in bytes)
  • +
  • data pointer to where to store the data
  • +
  • length length of data to read
  • +
+

Returns:

+

length of data successfully read (should equal 'length')

+

function lt_flash_write

+

Write data to the flash. +

uint32_t lt_flash_write (
+    uint32_t offset,
+    const uint8_t * data,
+    size_t length
+) 
+

+

Parameters:

+
    +
  • offset starting offset (in bytes)
  • +
  • data pointer to data to write
  • +
  • length length of data to write
  • +
+

Returns:

+

length of data successfully written (should equal 'length')

+
+

The documentation for this class was generated from the following file cores/common/base/api/lt_flash.c

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__flash_8c_source/index.html b/ltapi/lt__flash_8c_source/index.html new file mode 100644 index 000000000..15bf8e42f --- /dev/null +++ b/ltapi/lt__flash_8c_source/index.html @@ -0,0 +1,2333 @@ + + + + + + + + + + + + + + + + + + + + File lt\_flash.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_flash.c

+

File List > api > lt_flash.c

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-04-29. */
+
+#include "lt_flash.h"
+
+#include <fal.h>
+
+__attribute__((weak)) uint32_t lt_flash_get_size() {
+    lt_flash_id_t id = lt_flash_get_id();
+    if (id.chip_size_id >= 0x14 && id.chip_size_id <= 0x19) {
+        return (1 << id.chip_size_id);
+    }
+#ifdef FLASH_LENGTH
+    return FLASH_LENGTH;
+#else
+    return 0;
+#endif
+}
+
+bool lt_flash_erase(uint32_t offset, size_t length) {
+    return fal_partition_erase(fal_root_part, offset, length) >= 0;
+}
+
+bool lt_flash_erase_block(uint32_t offset) {
+    return fal_partition_erase(fal_root_part, offset, 1) >= 0;
+}
+
+uint32_t lt_flash_read(uint32_t offset, uint8_t *data, size_t length) {
+    int ret = fal_partition_read(fal_root_part, offset, data, length);
+    if (ret == -1)
+        return 0;
+    return ret;
+}
+
+uint32_t lt_flash_write(uint32_t offset, const uint8_t *data, size_t length) {
+    int ret = fal_partition_write(fal_root_part, offset, data, length);
+    if (ret == -1)
+        return 0;
+    return ret;
+}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__flash_8h/index.html b/ltapi/lt__flash_8h/index.html new file mode 100644 index 000000000..6795f3c0c --- /dev/null +++ b/ltapi/lt__flash_8h/index.html @@ -0,0 +1,2492 @@ + + + + + + + + + + + + + + + + + + + + File lt\_flash.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

File lt_flash.h

+

FileList > api > lt_flash.h

+

Go to the source code of this file.

+
    +
  • #include <libretiny.h>
  • +
+

Classes

+ + + + + + + + + + + + + +
TypeName
structlt_flash_id_t
Flash chip ID structure.
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
boollt_flash_erase (uint32_t offset, size_t length)
Erase flash area. Flash can only be erased in blocks (usually 4 KiB).
boollt_flash_erase_block (uint32_t offset)
Erase a single block of flash (usually 4 KiB).
lt_flash_id_tlt_flash_get_id ()
Read flash chip ID and return a lt_flash_id_t struct.
uint32_tlt_flash_get_size ()
Get flash chip total size.
uint32_tlt_flash_read (uint32_t offset, uint8_t * data, size_t length)
Read data from the flash.
uint32_tlt_flash_write (uint32_t offset, const uint8_t * data, size_t length)
Write data to the flash.
+

Public Functions Documentation

+

function lt_flash_erase

+

Erase flash area. Flash can only be erased in blocks (usually 4 KiB). +

bool lt_flash_erase (
+    uint32_t offset,
+    size_t length
+) 
+

+

Parameters:

+
    +
  • offset starting offset to erase (in bytes); must be multiple of the flash chip's block size
  • +
  • length length of data to erase (in bytes); will be rounded up to block size
  • +
+

Returns:

+

whether erasing was successful

+

function lt_flash_erase_block

+

Erase a single block of flash (usually 4 KiB). +

bool lt_flash_erase_block (
+    uint32_t offset
+) 
+

+

Parameters:

+
    +
  • offset offset of the block (in bytes); must be multiple of the flash chip's block size
  • +
+

Returns:

+

whether erasing was successful

+

function lt_flash_get_id

+
lt_flash_id_t lt_flash_get_id () 
+
+

function lt_flash_get_size

+

Get flash chip total size. +

uint32_t lt_flash_get_size () 
+

+

The default implementation uses the least significant byte of the chip ID to determine the size.

+

function lt_flash_read

+

Read data from the flash. +

uint32_t lt_flash_read (
+    uint32_t offset,
+    uint8_t * data,
+    size_t length
+) 
+

+

Parameters:

+
    +
  • offset starting offset (in bytes)
  • +
  • data pointer to where to store the data
  • +
  • length length of data to read
  • +
+

Returns:

+

length of data successfully read (should equal 'length')

+

function lt_flash_write

+

Write data to the flash. +

uint32_t lt_flash_write (
+    uint32_t offset,
+    const uint8_t * data,
+    size_t length
+) 
+

+

Parameters:

+
    +
  • offset starting offset (in bytes)
  • +
  • data pointer to data to write
  • +
  • length length of data to write
  • +
+

Returns:

+

length of data successfully written (should equal 'length')

+
+

The documentation for this class was generated from the following file cores/common/base/api/lt_flash.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__flash_8h_source/index.html b/ltapi/lt__flash_8h_source/index.html new file mode 100644 index 000000000..965eaee39 --- /dev/null +++ b/ltapi/lt__flash_8h_source/index.html @@ -0,0 +1,2317 @@ + + + + + + + + + + + + + + + + + + + + File lt\_flash.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_flash.h

+

File List > api > lt_flash.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2023-03-09. */
+
+#pragma once
+
+#include <libretiny.h>
+
+typedef struct {
+    uint8_t manufacturer_id;
+    uint8_t chip_id;
+    uint8_t chip_size_id;
+} lt_flash_id_t;
+
+lt_flash_id_t lt_flash_get_id();
+
+uint32_t lt_flash_get_size();
+
+bool lt_flash_erase(uint32_t offset, size_t length);
+
+bool lt_flash_erase_block(uint32_t offset);
+
+uint32_t lt_flash_read(uint32_t offset, uint8_t *data, size_t length);
+
+uint32_t lt_flash_write(uint32_t offset, const uint8_t *data, size_t length);
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__init_8h/index.html b/ltapi/lt__init_8h/index.html new file mode 100644 index 000000000..63acd3182 --- /dev/null +++ b/ltapi/lt__init_8h/index.html @@ -0,0 +1,2380 @@ + + + + + + + + + + + + + + + + + + + + File lt\_init.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_init.h

+

FileList > api > lt_init.h

+

Go to the source code of this file.

+
    +
  • #include <libretiny.h>
  • +
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + +
TypeName
voidlt_init_arduino ()
Initialize the family's Arduino core (optional). This method is family-specific; the family core can do whatever it wants to. This method is empty if not implemented, and shouldn't be called manually.
voidlt_init_family ()
Initialize the family core (optional). This method is family-specific; the family core can do whatever it wants to. This method is empty if not implemented, and shouldn't be called manually.
voidlt_init_variant ()
Initialize the board (variant). This method is empty if not implemented (which is usually the case), and shouldn't be called manually.
+

Public Functions Documentation

+

function lt_init_arduino

+
void lt_init_arduino () 
+
+

function lt_init_family

+
void lt_init_family () 
+
+

function lt_init_variant

+
void lt_init_variant () 
+
+
+

The documentation for this class was generated from the following file cores/common/base/api/lt_init.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__init_8h_source/index.html b/ltapi/lt__init_8h_source/index.html new file mode 100644 index 000000000..c6c78b399 --- /dev/null +++ b/ltapi/lt__init_8h_source/index.html @@ -0,0 +1,2305 @@ + + + + + + + + + + + + + + + + + + + + File lt\_init.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_init.h

+

File List > api > lt_init.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2023-02-27. */
+
+#pragma once
+
+#include <libretiny.h>
+
+void lt_init_family() __attribute__((weak));
+
+void lt_init_variant() __attribute__((weak));
+
+void lt_init_arduino() __attribute__((weak));
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__logger_8c/index.html b/ltapi/lt__logger_8c/index.html new file mode 100644 index 000000000..872788d1d --- /dev/null +++ b/ltapi/lt__logger_8c/index.html @@ -0,0 +1,2722 @@ + + + + + + + + + + + + + + + + + + + + File lt\_logger.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

File lt_logger.c

+

FileList > base > lt_logger.c

+

Go to the source code of this file.

+
    +
  • #include "lt_logger.h"
  • +
  • #include <stdio.h>
  • +
+

Public Static Attributes

+ + + + + + + + + + + + + + + + + +
TypeName
const charlevels = = {'V', 'D', 'I', 'W', 'E', 'F'}
uint32_tuart_port = = 0
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + +
TypeName
voidlt_log (const uint8_t level, const char * format, ...)
voidlt_log_disable ()
Disable LT logger. Enable it back using lt_log_set_port(LT_UART_DEFAULT_LOGGER).
voidlt_log_set_port (uint8_t port)
Change log output port.
+

Macros

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
defineCOLOR_BLACK 0x00
defineCOLOR_BLUE 0x04
defineCOLOR_BRIGHT_BLACK 0x10
defineCOLOR_BRIGHT_BLUE 0x14
defineCOLOR_BRIGHT_CYAN 0x16
defineCOLOR_BRIGHT_GREEN 0x12
defineCOLOR_BRIGHT_MAGENTA 0x15
defineCOLOR_BRIGHT_RED 0x11
defineCOLOR_BRIGHT_WHITE 0x17
defineCOLOR_BRIGHT_YELLOW 0x13
defineCOLOR_CYAN 0x06
defineCOLOR_FMT "e[0;30m"
defineCOLOR_GREEN 0x02
defineCOLOR_MAGENTA 0x05
defineCOLOR_RED 0x01
defineCOLOR_WHITE 0x07
defineCOLOR_YELLOW 0x03
+

Public Static Attributes Documentation

+

variable levels

+
const char levels[];
+
+

variable uart_port

+
uint32_t uart_port;
+
+

Public Functions Documentation

+

function lt_log

+
void lt_log (
+    const uint8_t level,
+    const char * format,
+    ...
+) 
+
+

function lt_log_disable

+
void lt_log_disable () 
+
+

function lt_log_set_port

+

Change log output port. +

void lt_log_set_port (
+    uint8_t port
+) 
+

+

Parameters:

+
    +
  • port UART port index - can be 0, 1 or 2
  • +
+

Macro Definition Documentation

+

define COLOR_BLACK

+
#define COLOR_BLACK 0x00
+
+

define COLOR_BLUE

+
#define COLOR_BLUE 0x04
+
+

define COLOR_BRIGHT_BLACK

+
#define COLOR_BRIGHT_BLACK 0x10
+
+

define COLOR_BRIGHT_BLUE

+
#define COLOR_BRIGHT_BLUE 0x14
+
+

define COLOR_BRIGHT_CYAN

+
#define COLOR_BRIGHT_CYAN 0x16
+
+

define COLOR_BRIGHT_GREEN

+
#define COLOR_BRIGHT_GREEN 0x12
+
+

define COLOR_BRIGHT_MAGENTA

+
#define COLOR_BRIGHT_MAGENTA 0x15
+
+

define COLOR_BRIGHT_RED

+
#define COLOR_BRIGHT_RED 0x11
+
+

define COLOR_BRIGHT_WHITE

+
#define COLOR_BRIGHT_WHITE 0x17
+
+

define COLOR_BRIGHT_YELLOW

+
#define COLOR_BRIGHT_YELLOW 0x13
+
+

define COLOR_CYAN

+
#define COLOR_CYAN 0x06
+
+

define COLOR_FMT

+
#define COLOR_FMT "\e[0;30m"
+
+

define COLOR_GREEN

+
#define COLOR_GREEN 0x02
+
+

define COLOR_MAGENTA

+
#define COLOR_MAGENTA 0x05
+
+

define COLOR_RED

+
#define COLOR_RED 0x01
+
+

define COLOR_WHITE

+
#define COLOR_WHITE 0x07
+
+

define COLOR_YELLOW

+
#define COLOR_YELLOW 0x03
+
+
+

The documentation for this class was generated from the following file cores/common/base/lt_logger.c

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__logger_8c_source/index.html b/ltapi/lt__logger_8c_source/index.html new file mode 100644 index 000000000..e89d67963 --- /dev/null +++ b/ltapi/lt__logger_8c_source/index.html @@ -0,0 +1,2472 @@ + + + + + + + + + + + + + + + + + + + + File lt\_logger.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_logger.c

+

File List > base > lt_logger.c

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-04-28. */
+
+#include "lt_logger.h"
+
+#if __has_include(<sdk_private.h>)
+#include <sdk_private.h>
+#endif
+
+#if LT_HAS_PRINTF
+#include <printf/printf.h>
+#include <printf_port.h>
+#else
+#include <stdio.h>
+#endif
+
+#if (LT_LOGGER_TIMESTAMP || LT_LOGGER_TASK) && LT_HAS_FREERTOS
+#include <FreeRTOS.h>
+#include <task.h>
+#endif
+
+#define COLOR_FMT            "\e[0;30m"
+#define COLOR_BLACK          0x00
+#define COLOR_RED            0x01
+#define COLOR_GREEN          0x02
+#define COLOR_YELLOW         0x03
+#define COLOR_BLUE           0x04
+#define COLOR_MAGENTA        0x05
+#define COLOR_CYAN           0x06
+#define COLOR_WHITE          0x07
+#define COLOR_BRIGHT_BLACK   0x10
+#define COLOR_BRIGHT_RED     0x11
+#define COLOR_BRIGHT_GREEN   0x12
+#define COLOR_BRIGHT_YELLOW  0x13
+#define COLOR_BRIGHT_BLUE    0x14
+#define COLOR_BRIGHT_MAGENTA 0x15
+#define COLOR_BRIGHT_CYAN    0x16
+#define COLOR_BRIGHT_WHITE   0x17
+
+#ifdef LT_UART_DEFAULT_PORT
+static uint32_t uart_port = LT_UART_DEFAULT_LOGGER;
+#else
+static uint32_t uart_port = 0;
+#endif
+static const char levels[] = {'V', 'D', 'I', 'W', 'E', 'F'};
+
+#if LT_LOGGER_COLOR
+static const uint8_t colors[] = {
+    COLOR_BRIGHT_CYAN,
+    COLOR_BRIGHT_BLUE,
+    COLOR_BRIGHT_GREEN,
+    COLOR_BRIGHT_YELLOW,
+    COLOR_BRIGHT_RED,
+    COLOR_BRIGHT_MAGENTA,
+};
+#endif
+
+#if LIBRETINY_ARDUINO
+unsigned long millis(void);
+#endif
+
+#if LT_LOGGER_CALLER
+void lt_log(const uint8_t level, const char *caller, const unsigned short line, const char *format, ...) {
+#else
+void lt_log(const uint8_t level, const char *format, ...) {
+#endif
+
+    if (uart_port == 0xFF)
+        return;
+
+#if LT_LOGGER_TIMESTAMP
+#if LIBRETINY_ARDUINO
+    float seconds = millis() / 1000.0f;
+#elif LT_HAS_FREERTOS
+    float seconds = xTaskGetTickCount() * portTICK_PERIOD_MS / 1000.0f;
+#else
+    float seconds = 0;
+#endif
+#if LT_PRINTF_BROKEN
+    char zero[4] = "\x00\x30\x30";
+    if (seconds == 0.0f)
+        zero[0] = '0';
+#endif
+#endif
+
+#if LT_LOGGER_TASK && LT_HAS_FREERTOS
+    char task_colon   = ':';
+    TaskHandle_t task = xTaskGetCurrentTaskHandle();
+    char *task_name   = pcTaskGetTaskName(task);
+    if (!task) {
+        task_name  = "";
+        task_colon = '-';
+    }
+#endif
+
+#if LT_LOGGER_COLOR
+    char c_bright = '0' + (colors[level] >> 4);
+    char c_value  = '0' + (colors[level] & 0x7);
+#endif
+
+#if LT_HAS_PRINTF
+    fctprintf(
+        (void (*)(char, void *))putchar_p,
+        (void *)uart_port,
+#else
+    printf(
+#endif
+    // format:
+#if LT_LOGGER_COLOR
+        "\e[%c;3%cm"
+#endif
+        "%c "
+#if LT_LOGGER_TIMESTAMP
+#if LT_PRINTF_BROKEN
+        "[%11.3f%s] "
+#else
+        "[%11.3f] "
+#endif
+#endif
+#if LT_LOGGER_COLOR
+        "\e[0m"
+#endif
+#if LT_LOGGER_CALLER
+        "%s():%hu: "
+#endif
+#if LT_LOGGER_TASK && LT_HAS_FREERTOS
+        "%s%c "
+#endif
+        ,
+    // arguments:
+#if LT_LOGGER_COLOR
+        c_bright, // whether text is bright
+        c_value,  // text color
+#endif
+        levels[level]
+#if LT_LOGGER_TIMESTAMP
+        ,
+        seconds // float
+#if LT_PRINTF_BROKEN
+        ,
+        zero // append missing zeroes if printf "%11.3f" prints "0."
+#endif
+#endif
+#if LT_LOGGER_CALLER
+        ,
+        caller,
+        line
+#endif
+#if LT_LOGGER_TASK && LT_HAS_FREERTOS
+        ,
+        task_name,
+        task_colon // printing outside of tasks
+#endif
+    );
+
+#if LT_HAS_PRINTF
+    va_list va_args;
+    va_start(va_args, format);
+    vfctprintf((void (*)(char, void *))putchar_p, (void *)uart_port, format, va_args);
+    va_end(va_args);
+    putchar_p('\r', uart_port);
+    putchar_p('\n', uart_port);
+#else
+    va_list va_args;
+    va_start(va_args, format);
+    vprintf(format, va_args);
+    va_end(va_args);
+    putchar('\r');
+    putchar('\n');
+#endif
+}
+
+void lt_log_set_port(uint8_t port) {
+    uart_port = port;
+}
+
+void lt_log_disable() {
+    uart_port = 0xFF;
+}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__logger_8h/index.html b/ltapi/lt__logger_8h/index.html new file mode 100644 index 000000000..25d85b06e --- /dev/null +++ b/ltapi/lt__logger_8h/index.html @@ -0,0 +1,3260 @@ + + + + + + + + + + + + + + + + + + + + File lt\_logger.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_logger.h

+

FileList > base > lt_logger.h

+

Go to the source code of this file.

+
    +
  • #include <libretiny.h>
  • +
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + +
TypeName
voidlt_log (const uint8_t level, const char * format, ...)
voidlt_log_disable ()
Disable LT logger. Enable it back using lt_log_set_port(LT_UART_DEFAULT_LOGGER).
void voidlt_log_set_port (uint8_t port)
Change log output port.
+

Macros

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
defineESP_EARLY_LOGD (...) LT_D(__VA_ARGS__)
defineESP_EARLY_LOGE (...) LT_E(__VA_ARGS__)
defineESP_EARLY_LOGI (...) LT_I(__VA_ARGS__)
defineESP_EARLY_LOGV (...) LT_V(__VA_ARGS__)
defineESP_EARLY_LOGW (...) LT_W(__VA_ARGS__)
defineESP_LOGD (...) LT_D(__VA_ARGS__)
defineESP_LOGE (...) LT_E(__VA_ARGS__)
defineESP_LOGI (...) LT_I(__VA_ARGS__)
defineESP_LOGV (...) LT_V(__VA_ARGS__)
defineESP_LOGW (...) LT_W(__VA_ARGS__)
defineETS_PRINTF (...) LT_I(__VA_ARGS__)
defineLT_D (...) LT_LOG(LT_LEVEL_DEBUG, __FUNCTION__, __LINE__, __VA_ARGS__)
defineLT_DM (module, ...) LT_LOGM(LT_LEVEL_DEBUG, module, __FUNCTION__, __LINE__, __VA_ARGS__)
defineLT_E (...) LT_LOG(LT_LEVEL_ERROR, __FUNCTION__, __LINE__, __VA_ARGS__)
defineLT_EM (module, ...) LT_LOGM(LT_LEVEL_ERROR, module, __FUNCTION__, __LINE__, __VA_ARGS__)
defineLT_ERRNO ()
defineLT_ERRNO_LEZ (ret)
defineLT_ERRNO_LZ (ret)
defineLT_ERRNO_NZ (ret)
defineLT_F (...) LT_LOG(LT_LEVEL_FATAL, __FUNCTION__, __LINE__, __VA_ARGS__)
defineLT_FM (module, ...) LT_LOGM(LT_LEVEL_FATAL, module, __FUNCTION__, __LINE__, __VA_ARGS__)
defineLT_HEAP_I ()
defineLT_I (...) LT_LOG(LT_LEVEL_INFO, __FUNCTION__, __LINE__, __VA_ARGS__)
defineLT_IM (module, ...) LT_LOGM(LT_LEVEL_INFO, module, __FUNCTION__, __LINE__, __VA_ARGS__)
defineLT_LOG (level, caller, line, ...) lt_log(level, __VA_ARGS__)
defineLT_LOGM (level, module, caller, line, ...)
defineLT_RET (ret)
defineLT_RET_LEZ (ret)
defineLT_RET_LZ (ret)
defineLT_RET_NZ (ret)
defineLT_T (...) LT_LOG(LT_LEVEL_TRACE, __FUNCTION__, __LINE__, __VA_ARGS__)
defineLT_TM (module, ...) LT_LOGM(LT_LEVEL_TRACE, module, __FUNCTION__, __LINE__, __VA_ARGS__)
defineLT_V (...) LT_LOG(LT_LEVEL_TRACE, __FUNCTION__, __LINE__, __VA_ARGS__)
defineLT_VM (module, ...) LT_LOGM(LT_LEVEL_TRACE, module, __FUNCTION__, __LINE__, __VA_ARGS__)
defineLT_W (...) LT_LOG(LT_LEVEL_WARN, __FUNCTION__, __LINE__, __VA_ARGS__)
defineLT_WM (module, ...) LT_LOGM(LT_LEVEL_WARN, module, __FUNCTION__, __LINE__, __VA_ARGS__)
defineets_printf (...) LT_I(__VA_ARGS__)
defineisr_log_d (...) LT_D(__VA_ARGS__)
defineisr_log_e (...) LT_E(__VA_ARGS__)
defineisr_log_i (...) LT_I(__VA_ARGS__)
defineisr_log_n (...) LT_E(__VA_ARGS__)
defineisr_log_v (...) LT_V(__VA_ARGS__)
defineisr_log_w (...) LT_W(__VA_ARGS__)
definelog_d (...) LT_D(__VA_ARGS__)
definelog_e (...) LT_E(__VA_ARGS__)
definelog_i (...) LT_I(__VA_ARGS__)
definelog_n (...) LT_E(__VA_ARGS__)
definelog_printf (...) LT_I(__VA_ARGS__)
definelog_v (...) LT_V(__VA_ARGS__)
definelog_w (...) LT_W(__VA_ARGS__)
+

Public Functions Documentation

+

function lt_log

+
void lt_log (
+    const uint8_t level,
+    const char * format,
+    ...
+) 
+
+

function lt_log_disable

+
void lt_log_disable () 
+
+

function lt_log_set_port

+

Change log output port. +

void void lt_log_set_port (
+    uint8_t port
+) 
+

+

Parameters:

+
    +
  • port UART port index - can be 0, 1 or 2
  • +
+

Macro Definition Documentation

+

define ESP_EARLY_LOGD

+
#define ESP_EARLY_LOGD (
+    ...
+) LT_D(__VA_ARGS__)
+
+

define ESP_EARLY_LOGE

+
#define ESP_EARLY_LOGE (
+    ...
+) LT_E(__VA_ARGS__)
+
+

define ESP_EARLY_LOGI

+
#define ESP_EARLY_LOGI (
+    ...
+) LT_I(__VA_ARGS__)
+
+

define ESP_EARLY_LOGV

+
#define ESP_EARLY_LOGV (
+    ...
+) LT_V(__VA_ARGS__)
+
+

define ESP_EARLY_LOGW

+
#define ESP_EARLY_LOGW (
+    ...
+) LT_W(__VA_ARGS__)
+
+

define ESP_LOGD

+
#define ESP_LOGD (
+    ...
+) LT_D(__VA_ARGS__)
+
+

define ESP_LOGE

+
#define ESP_LOGE (
+    ...
+) LT_E(__VA_ARGS__)
+
+

define ESP_LOGI

+
#define ESP_LOGI (
+    ...
+) LT_I(__VA_ARGS__)
+
+

define ESP_LOGV

+
#define ESP_LOGV (
+    ...
+) LT_V(__VA_ARGS__)
+
+

define ESP_LOGW

+
#define ESP_LOGW (
+    ...
+) LT_W(__VA_ARGS__)
+
+

define ETS_PRINTF

+
#define ETS_PRINTF (
+    ...
+) LT_I(__VA_ARGS__)
+
+

define LT_D

+
#define LT_D (
+    ...
+) LT_LOG(LT_LEVEL_DEBUG, __FUNCTION__, __LINE__, __VA_ARGS__)
+
+

define LT_DM

+
#define LT_DM (
+    module,
+    ...
+) LT_LOGM(LT_LEVEL_DEBUG, module, __FUNCTION__, __LINE__, __VA_ARGS__)
+
+

define LT_E

+
#define LT_E (
+    ...
+) LT_LOG(LT_LEVEL_ERROR, __FUNCTION__, __LINE__, __VA_ARGS__)
+
+

define LT_EM

+
#define LT_EM (
+    module,
+    ...
+) LT_LOGM(LT_LEVEL_ERROR, module, __FUNCTION__, __LINE__, __VA_ARGS__)
+
+

define LT_ERRNO

+
#define LT_ERRNO (
+
+) 
+
+

define LT_ERRNO_LEZ

+
#define LT_ERRNO_LEZ (
+    ret
+) if (ret <= 0) {                                                                                                    \
+        LT_E("errno=%d, ret=%d", errno, ret);                                                                          \
+        return ret;                                                                                                    \
+    }
+
+

define LT_ERRNO_LZ

+
#define LT_ERRNO_LZ (
+    ret
+) if (ret < 0) {                                                                                                     \
+        LT_E("errno=%d, ret=%d", errno, ret);                                                                          \
+        return ret;                                                                                                    \
+    }
+
+

define LT_ERRNO_NZ

+
#define LT_ERRNO_NZ (
+    ret
+) if (ret) {                                                                                                         \
+        LT_E("errno=%d, ret=%d", errno, ret);                                                                          \
+        return ret;                                                                                                    \
+    }
+
+

define LT_F

+
#define LT_F (
+    ...
+) LT_LOG(LT_LEVEL_FATAL, __FUNCTION__, __LINE__, __VA_ARGS__)
+
+

define LT_FM

+
#define LT_FM (
+    module,
+    ...
+) LT_LOGM(LT_LEVEL_FATAL, module, __FUNCTION__, __LINE__, __VA_ARGS__)
+
+

define LT_HEAP_I

+
#define LT_HEAP_I (
+
+) 
+
+

define LT_I

+
#define LT_I (
+    ...
+) LT_LOG(LT_LEVEL_INFO, __FUNCTION__, __LINE__, __VA_ARGS__)
+
+

define LT_IM

+
#define LT_IM (
+    module,
+    ...
+) LT_LOGM(LT_LEVEL_INFO, module, __FUNCTION__, __LINE__, __VA_ARGS__)
+
+

define LT_LOG

+
#define LT_LOG (
+    level,
+    caller,
+    line,
+    ...
+) lt_log(level, __VA_ARGS__)
+
+

define LT_LOGM

+
#define LT_LOGM (
+    level,
+    module,
+    caller,
+    line,
+    ...
+) do {                                                                                                               \
+        if (LT_DEBUG_##module) {                                                                                       \
+            lt_log(level, #module ": " __VA_ARGS__);                                                                   \
+        }                                                                                                              \
+    } while (0)
+
+

define LT_RET

+
#define LT_RET (
+    ret
+) LT_E("ret=%d", ret);                                                                                               \
+    return ret;
+
+

define LT_RET_LEZ

+
#define LT_RET_LEZ (
+    ret
+) if (ret <= 0) {                                                                                                    \
+        LT_E("ret=%d", ret);                                                                                           \
+        return ret;                                                                                                    \
+    }
+
+

define LT_RET_LZ

+
#define LT_RET_LZ (
+    ret
+) if (ret < 0) {                                                                                                     \
+        LT_E("ret=%d", ret);                                                                                           \
+        return ret;                                                                                                    \
+    }
+
+

define LT_RET_NZ

+
#define LT_RET_NZ (
+    ret
+) if (ret) {                                                                                                         \
+        LT_E("ret=%d", ret);                                                                                           \
+        return ret;                                                                                                    \
+    }
+
+

define LT_T

+
#define LT_T (
+    ...
+) LT_LOG(LT_LEVEL_TRACE, __FUNCTION__, __LINE__, __VA_ARGS__)
+
+

define LT_TM

+
#define LT_TM (
+    module,
+    ...
+) LT_LOGM(LT_LEVEL_TRACE, module, __FUNCTION__, __LINE__, __VA_ARGS__)
+
+

define LT_V

+
#define LT_V (
+    ...
+) LT_LOG(LT_LEVEL_TRACE, __FUNCTION__, __LINE__, __VA_ARGS__)
+
+

define LT_VM

+
#define LT_VM (
+    module,
+    ...
+) LT_LOGM(LT_LEVEL_TRACE, module, __FUNCTION__, __LINE__, __VA_ARGS__)
+
+

define LT_W

+
#define LT_W (
+    ...
+) LT_LOG(LT_LEVEL_WARN, __FUNCTION__, __LINE__, __VA_ARGS__)
+
+

define LT_WM

+
#define LT_WM (
+    module,
+    ...
+) LT_LOGM(LT_LEVEL_WARN, module, __FUNCTION__, __LINE__, __VA_ARGS__)
+
+

define ets_printf

+
#define ets_printf (
+    ...
+) LT_I(__VA_ARGS__)
+
+

define isr_log_d

+
#define isr_log_d (
+    ...
+) LT_D(__VA_ARGS__)
+
+

define isr_log_e

+
#define isr_log_e (
+    ...
+) LT_E(__VA_ARGS__)
+
+

define isr_log_i

+
#define isr_log_i (
+    ...
+) LT_I(__VA_ARGS__)
+
+

define isr_log_n

+
#define isr_log_n (
+    ...
+) LT_E(__VA_ARGS__)
+
+

define isr_log_v

+
#define isr_log_v (
+    ...
+) LT_V(__VA_ARGS__)
+
+

define isr_log_w

+
#define isr_log_w (
+    ...
+) LT_W(__VA_ARGS__)
+
+

define log_d

+
#define log_d (
+    ...
+) LT_D(__VA_ARGS__)
+
+

define log_e

+
#define log_e (
+    ...
+) LT_E(__VA_ARGS__)
+
+

define log_i

+
#define log_i (
+    ...
+) LT_I(__VA_ARGS__)
+
+

define log_n

+
#define log_n (
+    ...
+) LT_E(__VA_ARGS__)
+
+

define log_printf

+
#define log_printf (
+    ...
+) LT_I(__VA_ARGS__)
+
+

define log_v

+
#define log_v (
+    ...
+) LT_V(__VA_ARGS__)
+
+

define log_w

+
#define log_w (
+    ...
+) LT_W(__VA_ARGS__)
+
+
+

The documentation for this class was generated from the following file cores/common/base/lt_logger.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__logger_8h_source/index.html b/ltapi/lt__logger_8h_source/index.html new file mode 100644 index 000000000..9e4d0d5ab --- /dev/null +++ b/ltapi/lt__logger_8h_source/index.html @@ -0,0 +1,2463 @@ + + + + + + + + + + + + + + + + + + + + File lt\_logger.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_logger.h

+

File List > base > lt_logger.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-04-28. */
+
+#pragma once
+
+#include <libretiny.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif // __cplusplus
+
+#if LT_LOGGER_CALLER
+#define LT_LOG(level, caller, line, ...) lt_log(level, caller, line, __VA_ARGS__)
+#define LT_LOGM(level, module, caller, line, ...)                                                                      \
+    do {                                                                                                               \
+        if (LT_DEBUG_##module) {                                                                                       \
+            lt_log(level, caller, line, #module ": " __VA_ARGS__);                                                     \
+        }                                                                                                              \
+    } while (0)
+void lt_log(const uint8_t level, const char *caller, const unsigned short line, const char *format, ...)
+    __attribute__((format(printf, 4, 5)));
+#else
+#define LT_LOG(level, caller, line, ...) lt_log(level, __VA_ARGS__)
+#define LT_LOGM(level, module, caller, line, ...)                                                                      \
+    do {                                                                                                               \
+        if (LT_DEBUG_##module) {                                                                                       \
+            lt_log(level, #module ": " __VA_ARGS__);                                                                   \
+        }                                                                                                              \
+    } while (0)
+void lt_log(const uint8_t level, const char *format, ...) __attribute__((format(printf, 2, 3)));
+#endif
+
+void lt_log_set_port(uint8_t port);
+
+void lt_log_disable();
+
+#if LT_LEVEL_TRACE >= LT_LOGLEVEL
+#define LT_T(...)          LT_LOG(LT_LEVEL_TRACE, __FUNCTION__, __LINE__, __VA_ARGS__)
+#define LT_V(...)          LT_LOG(LT_LEVEL_TRACE, __FUNCTION__, __LINE__, __VA_ARGS__)
+#define LT_TM(module, ...) LT_LOGM(LT_LEVEL_TRACE, module, __FUNCTION__, __LINE__, __VA_ARGS__)
+#define LT_VM(module, ...) LT_LOGM(LT_LEVEL_TRACE, module, __FUNCTION__, __LINE__, __VA_ARGS__)
+#else
+#define LT_T(...)
+#define LT_V(...)
+#define LT_TM(...)
+#define LT_VM(...)
+#endif
+
+#if LT_LEVEL_DEBUG >= LT_LOGLEVEL
+#define LT_D(...)          LT_LOG(LT_LEVEL_DEBUG, __FUNCTION__, __LINE__, __VA_ARGS__)
+#define LT_DM(module, ...) LT_LOGM(LT_LEVEL_DEBUG, module, __FUNCTION__, __LINE__, __VA_ARGS__)
+#else
+#define LT_D(...)
+#define LT_DM(...)
+#endif
+
+#if LT_LEVEL_INFO >= LT_LOGLEVEL
+#define LT_I(...)          LT_LOG(LT_LEVEL_INFO, __FUNCTION__, __LINE__, __VA_ARGS__)
+#define LT_IM(module, ...) LT_LOGM(LT_LEVEL_INFO, module, __FUNCTION__, __LINE__, __VA_ARGS__)
+#else
+#define LT_I(...)
+#define LT_IM(...)
+#endif
+
+#if LT_LEVEL_WARN >= LT_LOGLEVEL
+#define LT_W(...)          LT_LOG(LT_LEVEL_WARN, __FUNCTION__, __LINE__, __VA_ARGS__)
+#define LT_WM(module, ...) LT_LOGM(LT_LEVEL_WARN, module, __FUNCTION__, __LINE__, __VA_ARGS__)
+#else
+#define LT_W(...)
+#define LT_WM(...)
+#endif
+
+#if LT_LEVEL_ERROR >= LT_LOGLEVEL
+#define LT_E(...)          LT_LOG(LT_LEVEL_ERROR, __FUNCTION__, __LINE__, __VA_ARGS__)
+#define LT_EM(module, ...) LT_LOGM(LT_LEVEL_ERROR, module, __FUNCTION__, __LINE__, __VA_ARGS__)
+#else
+#define LT_E(...)
+#define LT_EM(...)
+#endif
+
+#if LT_LEVEL_FATAL >= LT_LOGLEVEL
+#define LT_F(...)          LT_LOG(LT_LEVEL_FATAL, __FUNCTION__, __LINE__, __VA_ARGS__)
+#define LT_FM(module, ...) LT_LOGM(LT_LEVEL_FATAL, module, __FUNCTION__, __LINE__, __VA_ARGS__)
+#else
+#define LT_F(...)
+#define LT_FM(...)
+#endif
+
+#if LT_LOG_HEAP && LT_HAS_FREERTOS
+#define LT_HEAP_I() LT_I("Free heap: %u", LT_HEAP_FUNC());
+#else
+#define LT_HEAP_I()
+#endif
+
+// ESP32 compat
+#define log_printf(...)     LT_I(__VA_ARGS__)
+#define log_v(...)          LT_V(__VA_ARGS__)
+#define log_d(...)          LT_D(__VA_ARGS__)
+#define log_i(...)          LT_I(__VA_ARGS__)
+#define log_w(...)          LT_W(__VA_ARGS__)
+#define log_e(...)          LT_E(__VA_ARGS__)
+#define log_n(...)          LT_E(__VA_ARGS__)
+#define isr_log_v(...)      LT_V(__VA_ARGS__)
+#define isr_log_d(...)      LT_D(__VA_ARGS__)
+#define isr_log_i(...)      LT_I(__VA_ARGS__)
+#define isr_log_w(...)      LT_W(__VA_ARGS__)
+#define isr_log_e(...)      LT_E(__VA_ARGS__)
+#define isr_log_n(...)      LT_E(__VA_ARGS__)
+#define ESP_LOGV(...)       LT_V(__VA_ARGS__)
+#define ESP_LOGD(...)       LT_D(__VA_ARGS__)
+#define ESP_LOGI(...)       LT_I(__VA_ARGS__)
+#define ESP_LOGW(...)       LT_W(__VA_ARGS__)
+#define ESP_LOGE(...)       LT_E(__VA_ARGS__)
+#define ESP_EARLY_LOGV(...) LT_V(__VA_ARGS__)
+#define ESP_EARLY_LOGD(...) LT_D(__VA_ARGS__)
+#define ESP_EARLY_LOGI(...) LT_I(__VA_ARGS__)
+#define ESP_EARLY_LOGW(...) LT_W(__VA_ARGS__)
+#define ESP_EARLY_LOGE(...) LT_E(__VA_ARGS__)
+#define ets_printf(...)     LT_I(__VA_ARGS__)
+#define ETS_PRINTF(...)     LT_I(__VA_ARGS__)
+
+#define LT_RET(ret)                                                                                                    \
+    LT_E("ret=%d", ret);                                                                                               \
+    return ret;
+
+#define LT_RET_NZ(ret)                                                                                                 \
+    if (ret) {                                                                                                         \
+        LT_E("ret=%d", ret);                                                                                           \
+        return ret;                                                                                                    \
+    }
+#define LT_RET_LZ(ret)                                                                                                 \
+    if (ret < 0) {                                                                                                     \
+        LT_E("ret=%d", ret);                                                                                           \
+        return ret;                                                                                                    \
+    }
+#define LT_RET_LEZ(ret)                                                                                                \
+    if (ret <= 0) {                                                                                                    \
+        LT_E("ret=%d", ret);                                                                                           \
+        return ret;                                                                                                    \
+    }
+
+#define LT_ERRNO_NZ(ret)                                                                                               \
+    if (ret) {                                                                                                         \
+        LT_E("errno=%d, ret=%d", errno, ret);                                                                          \
+        return ret;                                                                                                    \
+    }
+#define LT_ERRNO_LZ(ret)                                                                                               \
+    if (ret < 0) {                                                                                                     \
+        LT_E("errno=%d, ret=%d", errno, ret);                                                                          \
+        return ret;                                                                                                    \
+    }
+#define LT_ERRNO_LEZ(ret)                                                                                              \
+    if (ret <= 0) {                                                                                                    \
+        LT_E("errno=%d, ret=%d", errno, ret);                                                                          \
+        return ret;                                                                                                    \
+    }
+
+#if LT_LOG_ERRNO
+#define LT_ERRNO()                                                                                                     \
+    if (errno) {                                                                                                       \
+        LT_E("errno=%d", errno);                                                                                       \
+        errno = 0;                                                                                                     \
+    }
+#else
+#define LT_ERRNO()
+#endif
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__main_8c/index.html b/ltapi/lt__main_8c/index.html new file mode 100644 index 000000000..2b7d227d4 --- /dev/null +++ b/ltapi/lt__main_8c/index.html @@ -0,0 +1,2433 @@ + + + + + + + + + + + + + + + + + + + + File lt\_main.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_main.c

+

FileList > base > lt_main.c

+

Go to the source code of this file.

+
    +
  • #include <libretiny.h>
  • +
  • #include <fal.h>
  • +
+

Public Attributes

+ + + + + + + + + + + + + +
TypeName
fal_partition_tfal_root_part = = NULL
"Root" partition entry, representing the entire flash. Declared and initialized in lt_main.c.
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + +
TypeName
void__libc_init_array (void)
intlt_main (void)
intmain (void)
+

Public Attributes Documentation

+

variable fal_root_part

+
fal_partition_t fal_root_part;
+
+

Public Functions Documentation

+

function __libc_init_array

+
void __libc_init_array (
+    void
+) 
+
+

function lt_main

+
int lt_main (
+    void
+) 
+
+

function main

+
int main (
+    void
+) 
+
+
+

The documentation for this class was generated from the following file cores/common/base/lt_main.c

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__main_8c_source/index.html b/ltapi/lt__main_8c_source/index.html new file mode 100644 index 000000000..cca0ed97e --- /dev/null +++ b/ltapi/lt__main_8c_source/index.html @@ -0,0 +1,2325 @@ + + + + + + + + + + + + + + + + + + + + File lt\_main.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_main.c

+

File List > base > lt_main.c

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-06-19. */
+
+#include <libretiny.h>
+
+#include <fal.h>
+
+fal_partition_t fal_root_part = NULL;
+
+// Initialize C library
+void __libc_init_array(void);
+// Main app entrypoint
+int main(void);
+
+int lt_main(void) {
+    // early initialize the family and variant
+    lt_init_family();
+    lt_init_variant();
+    // print a startup banner
+    LT_BANNER();
+    // initialize C library
+    __libc_init_array();
+    // inform about the reset reason
+    LT_I("Reset reason: %s", lt_get_reboot_reason_name(0));
+    // initialize FAL
+    fal_init();
+    // provide root partition
+    fal_root_part = (fal_partition_t)fal_partition_find("root");
+
+    // run the application
+    return main();
+}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__mem_8c/index.html b/ltapi/lt__mem_8c/index.html new file mode 100644 index 000000000..dbd5aceb3 --- /dev/null +++ b/ltapi/lt__mem_8c/index.html @@ -0,0 +1,2354 @@ + + + + + + + + + + + + + + + + + + + + File lt\_mem.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_mem.c

+

FileList > api > lt_mem.c

+

Go to the source code of this file.

+
    +
  • #include "lt_mem.h"
  • +
+

Public Functions

+ + + + + + + + + + + + + +
TypeName
__attribute__ ((weak))
+

Public Functions Documentation

+

function __attribute__

+
__attribute__ (
+    (weak)
+) 
+
+
+

The documentation for this class was generated from the following file cores/common/base/api/lt_mem.c

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__mem_8c_source/index.html b/ltapi/lt__mem_8c_source/index.html new file mode 100644 index 000000000..f39145313 --- /dev/null +++ b/ltapi/lt__mem_8c_source/index.html @@ -0,0 +1,2320 @@ + + + + + + + + + + + + + + + + + + + + File lt\_mem.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_mem.c

+

File List > api > lt_mem.c

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-04-29. */
+
+#include "lt_mem.h"
+
+#if LT_HAS_FREERTOS
+#include <FreeRTOS.h>
+#include <task.h>
+#endif
+
+#if LT_HAS_FREERTOS
+__attribute__((weak)) uint32_t lt_heap_get_size() {
+    return configTOTAL_HEAP_SIZE;
+}
+
+__attribute__((weak)) uint32_t lt_heap_get_free() {
+    return xPortGetFreeHeapSize();
+}
+
+__attribute__((weak)) uint32_t lt_heap_get_min_free() {
+    return xPortGetMinimumEverFreeHeapSize();
+}
+#endif
+
+__attribute__((weak)) uint32_t lt_heap_get_max_alloc() {
+    return 0;
+}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__mem_8h/index.html b/ltapi/lt__mem_8h/index.html new file mode 100644 index 000000000..029f79b6d --- /dev/null +++ b/ltapi/lt__mem_8h/index.html @@ -0,0 +1,2408 @@ + + + + + + + + + + + + + + + + + + + + File lt\_mem.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

File lt_mem.h

+

FileList > api > lt_mem.h

+

Go to the source code of this file.

+
    +
  • #include <libretiny.h>
  • +
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
uint32_tlt_heap_get_free ()
Get free heap size.
uint32_tlt_heap_get_max_alloc ()
Get largest block of heap that can be allocated at once.
uint32_tlt_heap_get_min_free ()
Get lowest level of free heap memory.
uint32_tlt_heap_get_size ()
Get total heap size.
uint32_tlt_ram_get_size ()
Get total RAM size.
+

Public Functions Documentation

+

function lt_heap_get_free

+
uint32_t lt_heap_get_free () 
+
+

function lt_heap_get_max_alloc

+
uint32_t lt_heap_get_max_alloc () 
+
+

function lt_heap_get_min_free

+
uint32_t lt_heap_get_min_free () 
+
+

function lt_heap_get_size

+
uint32_t lt_heap_get_size () 
+
+

function lt_ram_get_size

+
uint32_t lt_ram_get_size () 
+
+
+

The documentation for this class was generated from the following file cores/common/base/api/lt_mem.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__mem_8h_source/index.html b/ltapi/lt__mem_8h_source/index.html new file mode 100644 index 000000000..5a8a2bb30 --- /dev/null +++ b/ltapi/lt__mem_8h_source/index.html @@ -0,0 +1,2309 @@ + + + + + + + + + + + + + + + + + + + + File lt\_mem.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_mem.h

+

File List > api > lt_mem.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2023-03-09. */
+
+#pragma once
+
+#include <libretiny.h>
+
+uint32_t lt_ram_get_size();
+
+uint32_t lt_heap_get_size();
+
+uint32_t lt_heap_get_free();
+
+uint32_t lt_heap_get_min_free();
+
+uint32_t lt_heap_get_max_alloc();
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__ota_8c/index.html b/ltapi/lt__ota_8c/index.html new file mode 100644 index 000000000..5748787f4 --- /dev/null +++ b/ltapi/lt__ota_8c/index.html @@ -0,0 +1,2553 @@ + + + + + + + + + + + + + + + + + + + + File lt\_ota.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

File lt_ota.c

+

FileList > api > lt_ota.c

+

Go to the source code of this file.

+
    +
  • #include "lt_ota.h"
  • +
  • #include <uf2ota/uf2ota.h>
  • +
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
__attribute__ ((weak))
voidlt_ota_begin (lt_ota_ctx_t * ctx, size_t size)
Initialize the update context to begin OTA process.
boollt_ota_can_rollback ()
Check if OTA rollback is possible (switching the stored index to another partition).
boollt_ota_end (lt_ota_ctx_t * ctx)
Finish the update process. If the update has been written completely, try to activate the target image. Free allocated internal structures, regardless of the activation result.
uf2_ota_scheme_tlt_ota_get_uf2_scheme ()
Check which UF2 OTA scheme should be used for applying firmware updates.
size_tlt_ota_write (lt_ota_ctx_t * ctx, const uint8_t * data, size_t len)
Process a chunk of data.
boollt_ota_write_block (lt_ota_ctx_t * ctx, uf2_block_t * block)
Try to write the block. In case of UF2 errors, error code is set in the context. Note: use lt_ota_write() instead. This is for internal usage only.
+

Public Static Functions

+ + + + + + + + + + + + + + + + + +
TypeName
size_tlt_ota_buf_left (lt_ota_ctx_t * ctx)
size_tlt_ota_buf_size (lt_ota_ctx_t * ctx)
+

Public Functions Documentation

+

function __attribute__

+
__attribute__ (
+    (weak)
+) 
+
+

function lt_ota_begin

+

Initialize the update context to begin OTA process. +

void lt_ota_begin (
+    lt_ota_ctx_t * ctx,
+    size_t size
+) 
+

+

Parameters:

+
    +
  • ctx OTA context
  • +
  • size length of the update file; 0 if unknown
  • +
+

function lt_ota_can_rollback

+

Check if OTA rollback is possible (switching the stored index to another partition). +

bool lt_ota_can_rollback () 
+

+

Note that this is not the same as "switching" OTA with revert=true.

+

Returns:

+

true if 2nd image is valid and the chip is dual-OTA; false otherwise

+

function lt_ota_end

+

Finish the update process. If the update has been written completely, try to activate the target image. Free allocated internal structures, regardless of the activation result. +

bool lt_ota_end (
+    lt_ota_ctx_t * ctx
+) 
+

+

Parameters:

+
    +
  • ctx OTA context
  • +
+

Returns:

+

false if activation was attempted and not successful; true otherwise

+

function lt_ota_get_uf2_scheme

+

Check which UF2 OTA scheme should be used for applying firmware updates. +

uf2_ota_scheme_t lt_ota_get_uf2_scheme () 
+

+

Returns:

+

OTA scheme of the target partition

+

function lt_ota_write

+

Process a chunk of data. +

size_t lt_ota_write (
+    lt_ota_ctx_t * ctx,
+    const uint8_t * data,
+    size_t len
+) 
+

+

Data is written to the buffer, unless a full UF2 block is already available, in which case it's also processed by UF2OTA and written to flash.

+

It's advised to write in 512-byte chunks (or its multiples).

+

Parameters:

+
    +
  • ctx OTA context
  • +
  • data chunk of bytes to process
  • +
  • len size of the chunk
  • +
+

Returns:

+

number of bytes correctly processed; should equal 'len' in case of no errors

+

function lt_ota_write_block

+

Try to write the block. In case of UF2 errors, error code is set in the context. Note: use lt_ota_write() instead. This is for internal usage only. +

bool lt_ota_write_block (
+    lt_ota_ctx_t * ctx,
+    uf2_block_t * block
+) 
+

+

Parameters:

+
    +
  • block UF2 block to check and write; cannot be NULL
  • +
+

Returns:

+

whether no error has occurred

+

Public Static Functions Documentation

+

function lt_ota_buf_left

+
static inline size_t lt_ota_buf_left (
+    lt_ota_ctx_t * ctx
+) 
+
+

function lt_ota_buf_size

+
static inline size_t lt_ota_buf_size (
+    lt_ota_ctx_t * ctx
+) 
+
+
+

The documentation for this class was generated from the following file cores/common/base/api/lt_ota.c

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__ota_8c_source/index.html b/ltapi/lt__ota_8c_source/index.html new file mode 100644 index 000000000..67d83c870 --- /dev/null +++ b/ltapi/lt__ota_8c_source/index.html @@ -0,0 +1,2450 @@ + + + + + + + + + + + + + + + + + + + + File lt\_ota.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_ota.c

+

File List > api > lt_ota.c

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-04-29. */
+
+#include "lt_ota.h"
+
+#include <uf2ota/uf2ota.h>
+
+static inline size_t lt_ota_buf_left(lt_ota_ctx_t *ctx) {
+    return ctx->buf + UF2_BLOCK_SIZE - ctx->buf_pos;
+}
+
+static inline size_t lt_ota_buf_size(lt_ota_ctx_t *ctx) {
+    return ctx->buf_pos - ctx->buf;
+}
+
+void lt_ota_begin(lt_ota_ctx_t *ctx, size_t size) {
+    if (!ctx)
+        return;
+
+    memset(ctx, 0, sizeof(lt_ota_ctx_t));
+    uf2_ctx_init(&ctx->uf2, lt_ota_get_uf2_scheme(), lt_cpu_get_family());
+    uf2_info_init(&ctx->info);
+    ctx->buf_pos     = ctx->buf;
+    ctx->bytes_total = size;
+    ctx->running     = true;
+
+    lt_ota_set_write_protect(&ctx->uf2);
+
+    LT_DM(OTA, "begin(%u, ...) / OTA curr: %u, scheme: %u", size, lt_ota_dual_get_current(), lt_ota_get_uf2_scheme());
+}
+
+bool lt_ota_end(lt_ota_ctx_t *ctx) {
+    if (!ctx || !ctx->running)
+        return true;
+
+    uf2_ctx_free(&ctx->uf2);
+    uf2_info_free(&ctx->info);
+    ctx->running = false;
+
+    if (ctx->bytes_written && ctx->bytes_written == ctx->bytes_total) {
+        // try to activate the 2nd image
+        return lt_ota_switch(/* revert= */ false);
+    }
+
+    // activation not attempted (update aborted)
+    return true;
+}
+
+__attribute__((weak)) void lt_ota_set_write_protect(uf2_ota_t *uf2) {}
+
+size_t lt_ota_write(lt_ota_ctx_t *ctx, const uint8_t *data, size_t len) {
+    if (!ctx || !ctx->running)
+        return 0;
+
+    // write until buffer space is available
+    size_t written = 0;
+    uint16_t to_write; // 1..512
+    while (len && (to_write = MIN((uint16_t)len, lt_ota_buf_left(ctx)))) {
+        LT_VM(OTA, "Writing %u to buffer (%u/512)", len, lt_ota_buf_size(ctx));
+
+        uf2_block_t *block = NULL;
+        if (to_write == UF2_BLOCK_SIZE) {
+            // data has a complete block; don't use the buffer
+            block = (uf2_block_t *)data;
+        } else {
+            // data has a part of a block; append it to the buffer
+            memcpy(ctx->buf_pos, data, to_write);
+            ctx->buf_pos += to_write;
+            if (lt_ota_buf_size(ctx) == UF2_BLOCK_SIZE) {
+                // the block is complete now
+                block = (uf2_block_t *)ctx->buf;
+            }
+        }
+
+        // write if a block is ready
+        if (block && lt_ota_write_block(ctx, block) == false)
+            // return on errors
+            return written;
+        data += to_write;
+        len -= to_write;
+        written += to_write;
+    }
+    return written;
+}
+
+bool lt_ota_write_block(lt_ota_ctx_t *ctx, uf2_block_t *block) {
+    ctx->error = uf2_check_block(&ctx->uf2, block);
+    if (ctx->error > UF2_ERR_IGNORE)
+        // block is invalid
+        return false;
+
+    if (!ctx->bytes_written) {
+        // parse header block to allow retrieving firmware info
+        ctx->error = uf2_parse_header(&ctx->uf2, block, &ctx->info);
+        if (ctx->error != UF2_ERR_OK)
+            return false;
+
+        LT_IM(
+            OTA,
+            "%s v%s - LT v%s @ %s",
+            ctx->info.fw_name,
+            ctx->info.fw_version,
+            ctx->info.lt_version,
+            ctx->info.board
+        );
+
+        if (ctx->bytes_total == 0) {
+            // set total update size from block count info
+            ctx->bytes_total = block->block_count * UF2_BLOCK_SIZE;
+        } else if (ctx->bytes_total != block->block_count * UF2_BLOCK_SIZE) {
+            // given update size does not match the block count
+            LT_EM(
+                OTA,
+                "Image size wrong; got %u, calculated %llu",
+                ctx->bytes_total,
+                block->block_count * UF2_BLOCK_SIZE
+            );
+            return false;
+        }
+    } else if (ctx->error == UF2_ERR_OK) {
+        // write data blocks normally
+        ctx->error = uf2_write(&ctx->uf2, block);
+        if (ctx->error > UF2_ERR_IGNORE)
+            // block writing failed
+            return false;
+    }
+
+    // increment total writing progress
+    ctx->bytes_written += UF2_BLOCK_SIZE;
+    // call progress callback
+    if (ctx->callback)
+        ctx->callback(ctx->callback_param);
+    // reset the buffer as it's used already
+    if (lt_ota_buf_size(ctx) == UF2_BLOCK_SIZE)
+        ctx->buf_pos = ctx->buf;
+
+    return true;
+}
+
+bool lt_ota_can_rollback() {
+    if (lt_ota_get_type() != OTA_TYPE_DUAL)
+        return false;
+    uint8_t current = lt_ota_dual_get_current();
+    if (current == 0)
+        return false;
+    return lt_ota_is_valid(current ^ 0b11);
+}
+
+uf2_ota_scheme_t lt_ota_get_uf2_scheme() {
+    if (lt_ota_get_type() == OTA_TYPE_SINGLE)
+        return UF2_SCHEME_DEVICE_SINGLE;
+    uint8_t current = lt_ota_dual_get_current();
+    if (current == 0)
+        return UF2_SCHEME_DEVICE_DUAL_1;
+    // UF2_SCHEME_DEVICE_DUAL_1 or UF2_SCHEME_DEVICE_DUAL_2
+    return (uf2_ota_scheme_t)(current ^ 0b11);
+}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__ota_8h/index.html b/ltapi/lt__ota_8h/index.html new file mode 100644 index 000000000..0b73e7a2b --- /dev/null +++ b/ltapi/lt__ota_8h/index.html @@ -0,0 +1,2661 @@ + + + + + + + + + + + + + + + + + + + + File lt\_ota.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

File lt_ota.h

+

FileList > api > lt_ota.h

+

Go to the source code of this file.

+
    +
  • #include <libretiny.h>
  • +
  • #include <uf2ota/uf2types.h>
  • +
+

Classes

+ + + + + + + + + + + + + +
TypeName
structlt_ota_ctx_t
OTA update process context.
+

Public Types

+ + + + + + + + + + + + + +
TypeName
enumlt_ota_type_t
Chip's OTA type enumeration.
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
voidlt_ota_begin (lt_ota_ctx_t * ctx, size_t size)
Initialize the update context to begin OTA process.
boollt_ota_can_rollback ()
Check if OTA rollback is possible (switching the stored index to another partition).
uint8_tlt_ota_dual_get_current ()
Get the currently running firmware's OTA index.
uint8_tlt_ota_dual_get_stored ()
Read the currently active OTA index, i.e. the one that will boot upon restart.
boollt_ota_end (lt_ota_ctx_t * ctx)
Finish the update process. If the update has been written completely, try to activate the target image. Free allocated internal structures, regardless of the activation result.
lt_ota_type_tlt_ota_get_type ()
Get OTA type of the device's chip.
uf2_ota_scheme_tlt_ota_get_uf2_scheme ()
Check which UF2 OTA scheme should be used for applying firmware updates.
boollt_ota_is_valid (uint8_t index)
Check if the specified OTA image is valid.
voidlt_ota_set_write_protect (uf2_ota_t * uf2)
Set family-specific, write-protected flash areas in the OTA update context. This shouldn't be called manually, as it's done by lt_ota_begin().
boollt_ota_switch (bool revert)
Try to switch OTA index to the other image. For single-OTA chips, only check if the upgrade image is valid.
size_tlt_ota_write (lt_ota_ctx_t * ctx, const uint8_t * data, size_t len)
Process a chunk of data.
boollt_ota_write_block (lt_ota_ctx_t * ctx, uf2_block_t * block)
Try to write the block. In case of UF2 errors, error code is set in the context. Note: use lt_ota_write() instead. This is for internal usage only.
+

Public Types Documentation

+

enum lt_ota_type_t

+
enum lt_ota_type_t {
+    OTA_TYPE_SINGLE = 0,
+    OTA_TYPE_DUAL = 1,
+    OTA_TYPE_FILE = 2
+};
+
+

Public Functions Documentation

+

function lt_ota_begin

+

Initialize the update context to begin OTA process. +

void lt_ota_begin (
+    lt_ota_ctx_t * ctx,
+    size_t size
+) 
+

+

Parameters:

+
    +
  • ctx OTA context
  • +
  • size length of the update file; 0 if unknown
  • +
+

function lt_ota_can_rollback

+

Check if OTA rollback is possible (switching the stored index to another partition). +

bool lt_ota_can_rollback () 
+

+

Note that this is not the same as "switching" OTA with revert=true.

+

Returns:

+

true if 2nd image is valid and the chip is dual-OTA; false otherwise

+

function lt_ota_dual_get_current

+

Get the currently running firmware's OTA index. +

uint8_t lt_ota_dual_get_current () 
+

+

Returns:

+

OTA index if dual-OTA is supported, 0 otherwise

+

function lt_ota_dual_get_stored

+

Read the currently active OTA index, i.e. the one that will boot upon restart. +

uint8_t lt_ota_dual_get_stored () 
+

+

Returns:

+

OTA index if dual-OTA is supported, 0 otherwise

+

function lt_ota_end

+

Finish the update process. If the update has been written completely, try to activate the target image. Free allocated internal structures, regardless of the activation result. +

bool lt_ota_end (
+    lt_ota_ctx_t * ctx
+) 
+

+

Parameters:

+
    +
  • ctx OTA context
  • +
+

Returns:

+

false if activation was attempted and not successful; true otherwise

+

function lt_ota_get_type

+
lt_ota_type_t lt_ota_get_type () 
+
+

function lt_ota_get_uf2_scheme

+

Check which UF2 OTA scheme should be used for applying firmware updates. +

uf2_ota_scheme_t lt_ota_get_uf2_scheme () 
+

+

Returns:

+

OTA scheme of the target partition

+

function lt_ota_is_valid

+

Check if the specified OTA image is valid. +

bool lt_ota_is_valid (
+    uint8_t index
+) 
+

+

Parameters:

+
    +
  • index OTA index to check; 0 for single-OTA chips, 1 or 2 for dual-OTA chips
  • +
+

Returns:

+

true if index is valid for the chip's OTA type, and there is a valid image; false otherwise

+

function lt_ota_set_write_protect

+

Set family-specific, write-protected flash areas in the OTA update context. This shouldn't be called manually, as it's done by lt_ota_begin(). +

void lt_ota_set_write_protect (
+    uf2_ota_t * uf2
+) 
+

+

Parameters:

+
    +
  • uf2 uf2ota context
  • +
+

function lt_ota_switch

+

Try to switch OTA index to the other image. For single-OTA chips, only check if the upgrade image is valid. +

bool lt_ota_switch (
+    bool revert
+) 
+

+

This can be used to "activate" the upgrade after flashing.

+

Parameters:

+
    +
  • revert switch if (and only if) the other image is already marked as active (i.e. switch back to the running image)
  • +
+

Returns:

+

false if the second image (or upgrade image) is not valid; false if writing failed; true otherwise

+

function lt_ota_write

+

Process a chunk of data. +

size_t lt_ota_write (
+    lt_ota_ctx_t * ctx,
+    const uint8_t * data,
+    size_t len
+) 
+

+

Data is written to the buffer, unless a full UF2 block is already available, in which case it's also processed by UF2OTA and written to flash.

+

It's advised to write in 512-byte chunks (or its multiples).

+

Parameters:

+
    +
  • ctx OTA context
  • +
  • data chunk of bytes to process
  • +
  • len size of the chunk
  • +
+

Returns:

+

number of bytes correctly processed; should equal 'len' in case of no errors

+

function lt_ota_write_block

+

Try to write the block. In case of UF2 errors, error code is set in the context. Note: use lt_ota_write() instead. This is for internal usage only. +

bool lt_ota_write_block (
+    lt_ota_ctx_t * ctx,
+    uf2_block_t * block
+) 
+

+

Parameters:

+
    +
  • block UF2 block to check and write; cannot be NULL
  • +
+

Returns:

+

whether no error has occurred

+
+

The documentation for this class was generated from the following file cores/common/base/api/lt_ota.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__ota_8h_source/index.html b/ltapi/lt__ota_8h_source/index.html new file mode 100644 index 000000000..b11047433 --- /dev/null +++ b/ltapi/lt__ota_8h_source/index.html @@ -0,0 +1,2343 @@ + + + + + + + + + + + + + + + + + + + + File lt\_ota.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_ota.h

+

File List > api > lt_ota.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2023-03-09. */
+
+#pragma once
+
+#include <libretiny.h>
+#include <uf2ota/uf2types.h>
+
+typedef enum {
+    OTA_TYPE_SINGLE = 0,
+    OTA_TYPE_DUAL   = 1,
+    OTA_TYPE_FILE   = 2,
+} lt_ota_type_t;
+
+typedef struct {
+    uf2_ota_t uf2;
+    uf2_info_t info;
+    uint8_t buf[UF2_BLOCK_SIZE];   // block data buffer
+    uint8_t *buf_pos;              // buffer writing position
+    uint32_t bytes_written;        // update progress
+    uint32_t bytes_total;          // total update size
+    uf2_err_t error;               // LT OTA/uf2ota error code
+    bool running;                  // whether update has begun
+    void (*callback)(void *param); // progress callback
+    void *callback_param;          // callback argument
+} lt_ota_ctx_t;
+
+void lt_ota_begin(lt_ota_ctx_t *ctx, size_t size);
+
+bool lt_ota_end(lt_ota_ctx_t *ctx);
+
+void lt_ota_set_write_protect(uf2_ota_t *uf2);
+
+size_t lt_ota_write(lt_ota_ctx_t *ctx, const uint8_t *data, size_t len);
+
+bool lt_ota_write_block(lt_ota_ctx_t *ctx, uf2_block_t *block);
+
+lt_ota_type_t lt_ota_get_type();
+
+bool lt_ota_is_valid(uint8_t index);
+
+bool lt_ota_can_rollback();
+
+uint8_t lt_ota_dual_get_current();
+
+uint8_t lt_ota_dual_get_stored();
+
+uf2_ota_scheme_t lt_ota_get_uf2_scheme();
+
+bool lt_ota_switch(bool revert);
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__pins_8h/index.html b/ltapi/lt__pins_8h/index.html new file mode 100644 index 000000000..082c003ab --- /dev/null +++ b/ltapi/lt__pins_8h/index.html @@ -0,0 +1,2475 @@ + + + + + + + + + + + + + + + + + + + + File lt\_pins.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

File lt_pins.h

+

FileList > base > lt_pins.h

+

Go to the source code of this file.

+

Macros

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
defineLT_HW_I2C0 HAS_WIRE0
defineLT_HW_I2C1 HAS_WIRE1
defineLT_HW_I2C2 HAS_WIRE2
defineLT_HW_SPI0 HAS_SPI0
defineLT_HW_SPI1 HAS_SPI1
defineLT_HW_SPI2 HAS_SPI2
defineLT_HW_UART0 HAS_SERIAL0
defineLT_HW_UART1 HAS_SERIAL1
defineLT_HW_UART2 HAS_SERIAL2
definePIN_INVALID 255
+

Macro Definition Documentation

+

define LT_HW_I2C0

+
#define LT_HW_I2C0 HAS_WIRE0
+
+

define LT_HW_I2C1

+
#define LT_HW_I2C1 HAS_WIRE1
+
+

define LT_HW_I2C2

+
#define LT_HW_I2C2 HAS_WIRE2
+
+

define LT_HW_SPI0

+
#define LT_HW_SPI0 HAS_SPI0
+
+

define LT_HW_SPI1

+
#define LT_HW_SPI1 HAS_SPI1
+
+

define LT_HW_SPI2

+
#define LT_HW_SPI2 HAS_SPI2
+
+

define LT_HW_UART0

+
#define LT_HW_UART0 HAS_SERIAL0
+
+

define LT_HW_UART1

+
#define LT_HW_UART1 HAS_SERIAL1
+
+

define LT_HW_UART2

+
#define LT_HW_UART2 HAS_SERIAL2
+
+

define PIN_INVALID

+
#define PIN_INVALID 255
+
+
+

The documentation for this class was generated from the following file cores/common/base/lt_pins.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__pins_8h_source/index.html b/ltapi/lt__pins_8h_source/index.html new file mode 100644 index 000000000..6be497791 --- /dev/null +++ b/ltapi/lt__pins_8h_source/index.html @@ -0,0 +1,2363 @@ + + + + + + + + + + + + + + + + + + + + File lt\_pins.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_pins.h

+

File List > base > lt_pins.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2023-06-21. */
+
+#include LT_VARIANT_H
+
+#define PIN_INVALID 255
+
+#define LT_HW_UART0 HAS_SERIAL0
+#define LT_HW_UART1 HAS_SERIAL1
+#define LT_HW_UART2 HAS_SERIAL2
+#define LT_HW_I2C0  HAS_WIRE0
+#define LT_HW_I2C1  HAS_WIRE1
+#define LT_HW_I2C2  HAS_WIRE2
+#define LT_HW_SPI0  HAS_SPI0
+#define LT_HW_SPI1  HAS_SPI1
+#define LT_HW_SPI2  HAS_SPI2
+
+#if LT_HW_UART0
+#ifndef PIN_SERIAL0_RX
+#define PIN_SERIAL0_RX PIN_INVALID
+#endif
+#ifndef PIN_SERIAL0_TX
+#define PIN_SERIAL0_TX PIN_INVALID
+#endif
+#endif
+
+#if LT_HW_UART1
+#ifndef PIN_SERIAL1_RX
+#define PIN_SERIAL1_RX PIN_INVALID
+#endif
+#ifndef PIN_SERIAL1_TX
+#define PIN_SERIAL1_TX PIN_INVALID
+#endif
+#endif
+
+#if LT_HW_UART2
+#ifndef PIN_SERIAL2_RX
+#define PIN_SERIAL2_RX PIN_INVALID
+#endif
+#ifndef PIN_SERIAL2_TX
+#define PIN_SERIAL2_TX PIN_INVALID
+#endif
+#endif
+
+#if LT_HW_I2C0
+#ifndef PIN_WIRE0_SDA
+#define PIN_WIRE0_SDA PIN_INVALID
+#endif
+#ifndef PIN_WIRE0_SCL
+#define PIN_WIRE0_SCL PIN_INVALID
+#endif
+#endif
+
+#if LT_HW_I2C1
+#ifndef PIN_WIRE1_SDA
+#define PIN_WIRE1_SDA PIN_INVALID
+#endif
+#ifndef PIN_WIRE1_SCL
+#define PIN_WIRE1_SCL PIN_INVALID
+#endif
+#endif
+
+#if LT_HW_I2C2
+#ifndef PIN_WIRE2_SDA
+#define PIN_WIRE2_SDA PIN_INVALID
+#endif
+#ifndef PIN_WIRE2_SCL
+#define PIN_WIRE2_SCL PIN_INVALID
+#endif
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__posix__api_8h/index.html b/ltapi/lt__posix__api_8h/index.html new file mode 100644 index 000000000..7d4b95e6d --- /dev/null +++ b/ltapi/lt__posix__api_8h/index.html @@ -0,0 +1,2408 @@ + + + + + + + + + + + + + + + + + + + + File lt\_posix\_api.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_posix_api.h

+

FileList > base > lt_posix_api.h

+

Go to the source code of this file.

+
    +
  • #include <sys/time.h>
  • +
  • #include <time.h>
  • +
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
intstrcasecmp (const char * s1, const char * s2)
char *strdup (const char *)
intstrncasecmp (const char * s1, const char * s2, size_t n)
char *strptime (const char * buf, const char * fmt, struct tm * tm)
+

Public Functions Documentation

+

function strcasecmp

+
int strcasecmp (
+    const char * s1,
+    const char * s2
+) 
+
+

function strdup

+
char * strdup (
+    const char *
+) 
+
+

function strncasecmp

+
int strncasecmp (
+    const char * s1,
+    const char * s2,
+    size_t n
+) 
+
+

function strptime

+
char * strptime (
+    const char * buf,
+    const char * fmt,
+    struct tm * tm
+) 
+
+
+

The documentation for this class was generated from the following file cores/common/base/lt_posix_api.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__posix__api_8h_source/index.html b/ltapi/lt__posix__api_8h_source/index.html new file mode 100644 index 000000000..8960c5832 --- /dev/null +++ b/ltapi/lt__posix__api_8h_source/index.html @@ -0,0 +1,2303 @@ + + + + + + + + + + + + + + + + + + + + File lt\_posix\_api.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_posix_api.h

+

File List > base > lt_posix_api.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-05-16. */
+
+#include <sys/time.h>
+#include <time.h>
+
+extern char *strdup(const char *);
+extern int strcasecmp(const char *s1, const char *s2);
+extern int strncasecmp(const char *s1, const char *s2, size_t n);
+extern char *strptime(const char *buf, const char *fmt, struct tm *tm);
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__sleep_8c/index.html b/ltapi/lt__sleep_8c/index.html new file mode 100644 index 000000000..3aee992fe --- /dev/null +++ b/ltapi/lt__sleep_8c/index.html @@ -0,0 +1,2298 @@ + + + + + + + + + + + + + + + + + + + + File lt\_sleep.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__sleep_8c_source/index.html b/ltapi/lt__sleep_8c_source/index.html new file mode 100644 index 000000000..b0b78c822 --- /dev/null +++ b/ltapi/lt__sleep_8c_source/index.html @@ -0,0 +1,2305 @@ + + + + + + + + + + + + + + + + + + + + File lt\_sleep.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_sleep.c

+

File List > api > lt_sleep.c

+

Go to the documentation of this file.

+
/* Copyright (c) Peter Sarkozi 2023-06-17. */
+
+#include "lt_sleep.h"
+
+__attribute__((weak)) void lt_deep_sleep_config_gpio(uint32_t gpio_index_map, bool on_high);
+
+__attribute__((weak)) void lt_deep_sleep_unset_gpio(uint32_t gpio_index_map);
+
+__attribute__((weak)) void lt_deep_sleep_config_timer(uint32_t sleep_duration);
+
+__attribute__((weak)) void lt_deep_sleep_enter();
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__sleep_8h/index.html b/ltapi/lt__sleep_8h/index.html new file mode 100644 index 000000000..ea62b19ea --- /dev/null +++ b/ltapi/lt__sleep_8h/index.html @@ -0,0 +1,2417 @@ + + + + + + + + + + + + + + + + + + + + File lt\_sleep.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

File lt_sleep.h

+

FileList > api > lt_sleep.h

+

Go to the source code of this file.

+
    +
  • #include <libretiny.h>
  • +
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
voidlt_deep_sleep_config_gpio (uint32_t gpio_index_map, bool on_high)
Enable GPIO Wakeup from Deep Sleep.
voidlt_deep_sleep_config_timer (uint32_t sleep_duration)
Set a sleep timer to wake up the device.
voidlt_deep_sleep_enter ()
Start deep sleep.
voidlt_deep_sleep_unset_gpio (uint32_t gpio_index_map)
Disable GPIO Wakeup on given pins.
+

Public Functions Documentation

+

function lt_deep_sleep_config_gpio

+

Enable GPIO Wakeup from Deep Sleep. +

void lt_deep_sleep_config_gpio (
+    uint32_t gpio_index_map,
+    bool on_high
+) 
+

+

Parameters:

+
    +
  • gpio_index_map bitMap of the pins we should wake up on
  • +
  • on_high whether to wake up on High or Low state
  • +
+

function lt_deep_sleep_config_timer

+

Set a sleep timer to wake up the device. +

void lt_deep_sleep_config_timer (
+    uint32_t sleep_duration
+) 
+

+

Parameters:

+
    +
  • sleep_duration the time in milliseconds to sleep
  • +
+

function lt_deep_sleep_enter

+
void lt_deep_sleep_enter () 
+
+

function lt_deep_sleep_unset_gpio

+

Disable GPIO Wakeup on given pins. +

void lt_deep_sleep_unset_gpio (
+    uint32_t gpio_index_map
+) 
+

+

Parameters:

+
    +
  • gpio_index_map bitMap of the pins we should disable wake up on
  • +
+
+

The documentation for this class was generated from the following file cores/common/base/api/lt_sleep.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__sleep_8h_source/index.html b/ltapi/lt__sleep_8h_source/index.html new file mode 100644 index 000000000..723789904 --- /dev/null +++ b/ltapi/lt__sleep_8h_source/index.html @@ -0,0 +1,2307 @@ + + + + + + + + + + + + + + + + + + + + File lt\_sleep.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_sleep.h

+

File List > api > lt_sleep.h

+

Go to the documentation of this file.

+
/* Copyright (c) Peter Sarkozi 2023-06-17. */
+
+#pragma once
+
+#include <libretiny.h>
+
+void lt_deep_sleep_config_gpio(uint32_t gpio_index_map, bool on_high);
+
+void lt_deep_sleep_unset_gpio(uint32_t gpio_index_map);
+
+void lt_deep_sleep_config_timer(uint32_t sleep_duration);
+
+void lt_deep_sleep_enter();
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__types_8h/index.html b/ltapi/lt__types_8h/index.html new file mode 100644 index 000000000..b2be975c9 --- /dev/null +++ b/ltapi/lt__types_8h/index.html @@ -0,0 +1,2463 @@ + + + + + + + + + + + + + + + + + + + + File lt\_types.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_types.h

+

FileList > base > lt_types.h

+

Go to the source code of this file.

+
    +
  • #include <stdint.h>
  • +
+

Public Types

+ + + + + + + + + + + + + + + + + +
TypeName
enumlt_cpu_family_t
enumlt_cpu_model_t
+

Macros

+ + + + + + + + + + + + + + + + + +
TypeName
defineCPU_MODEL (family, chip_id) (((family >> 24) << 8) | chip_id)
defineCPU_MODEL_ENUM (family, chip_id) (lt_cpu_model_t) CPU_MODEL(family, chip_id)
+

Public Types Documentation

+

enum lt_cpu_family_t

+
enum lt_cpu_family_t {
+    F_RTL8710A = 0x9FFFD543,
+    F_RTL8710B = 0x22E0D6FC,
+    F_RTL8720C = 0xE08F7564,
+    F_RTL8720D = 0x3379CFE2,
+    F_BK7231Q = 0xAFE81D49,
+    F_BK7231T = 0x675A40B0,
+    F_BK7231N = 0x7B3EF230,
+    F_BK7251 = 0x6A82CC42,
+    F_BL60X = 0xDE1270B7
+};
+
+

enum lt_cpu_model_t

+
enum lt_cpu_model_t {
+    RTL8710BL = CPU_MODEL(F_RTL8710B, 0xE0),
+    RTL8710BN = CPU_MODEL(F_RTL8710B, 0xFF),
+    RTL8710BU = CPU_MODEL(F_RTL8710B, 0xFE),
+    RTL8710BX = CPU_MODEL(F_RTL8710B, 0xF6),
+    RTL8710L0 = CPU_MODEL(F_RTL8710B, 0xFB),
+    RTL8711BN = CPU_MODEL(F_RTL8710B, 0xFD),
+    RTL8711BU = CPU_MODEL(F_RTL8710B, 0xFC),
+    MX1290 = RTL8710BN,
+    MX1290V2 = RTL8710BX,
+    W302 = RTL8710BN,
+    RTL8720CM = CPU_MODEL(F_RTL8720C, 0xEC),
+    RTL8720CF = CPU_MODEL(F_RTL8720C, 0xED),
+    RTL8720CX = RTL8720CM,
+    BK7231Q = CPU_MODEL(F_BK7231Q, 0x31),
+    BK7231T = CPU_MODEL(F_BK7231T, 0x1A),
+    BK7231N = CPU_MODEL(F_BK7231N, 0x1C),
+    BK7252 = CPU_MODEL(F_BK7251, 0x00),
+    BL2028N = BK7231N,
+    BK7231S = BK7231T,
+    BK7231U = BK7231T
+};
+
+

Macro Definition Documentation

+

define CPU_MODEL

+
#define CPU_MODEL (
+    family,
+    chip_id
+) (((family >> 24) << 8) | chip_id)
+
+

define CPU_MODEL_ENUM

+
#define CPU_MODEL_ENUM (
+    family,
+    chip_id
+) (lt_cpu_model_t) CPU_MODEL(family, chip_id)
+
+
+

The documentation for this class was generated from the following file cores/common/base/lt_types.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__types_8h_source/index.html b/ltapi/lt__types_8h_source/index.html new file mode 100644 index 000000000..04838e375 --- /dev/null +++ b/ltapi/lt__types_8h_source/index.html @@ -0,0 +1,2341 @@ + + + + + + + + + + + + + + + + + + + + File lt\_types.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_types.h

+

File List > base > lt_types.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-05-28. */
+
+#pragma once
+
+#include <stdint.h>
+
+#define CPU_MODEL(family, chip_id)      (((family >> 24) << 8) | chip_id)
+#define CPU_MODEL_ENUM(family, chip_id) (lt_cpu_model_t) CPU_MODEL(family, chip_id)
+
+typedef enum {
+    F_RTL8710A = 0x9FFFD543, // Realtek Ameba1
+    F_RTL8710B = 0x22E0D6FC, // Realtek AmebaZ (realtek-ambz)
+    F_RTL8720C = 0xE08F7564, // Realtek AmebaZ2
+    F_RTL8720D = 0x3379CFE2, // Realtek AmebaD
+    F_BK7231Q  = 0xAFE81D49, // Beken 7231Q
+    F_BK7231T  = 0x675A40B0, // Beken 7231T
+    F_BK7231N  = 0x7B3EF230, // Beken 7231N
+    F_BK7251   = 0x6A82CC42, // Beken 7251/7252
+    F_BL60X    = 0xDE1270B7, // Boufallo 602
+} lt_cpu_family_t;
+
+typedef enum {
+    // Realtek AmebaZ
+    // IDs copied from rtl8710b_efuse.h
+    RTL8710BL = CPU_MODEL(F_RTL8710B, 0xE0), // ???
+    RTL8710BN = CPU_MODEL(F_RTL8710B, 0xFF), // CHIPID_8710BN / QFN32
+    RTL8710BU = CPU_MODEL(F_RTL8710B, 0xFE), // CHIPID_8710BU / QFN48
+    RTL8710BX = CPU_MODEL(F_RTL8710B, 0xF6), // found on an actual RTL8710BX
+    RTL8710L0 = CPU_MODEL(F_RTL8710B, 0xFB), // CHIPID_8710BN_L0 / QFN32
+    RTL8711BN = CPU_MODEL(F_RTL8710B, 0xFD), // CHIPID_8711BN / QFN48
+    RTL8711BU = CPU_MODEL(F_RTL8710B, 0xFC), // CHIPID_8711BG / QFN68
+    MX1290    = RTL8710BN,
+    MX1290V2  = RTL8710BX,
+    W302      = RTL8710BN,
+    // Realtek AmebaZ2 (chip_id << 2 | flash_mode)
+    RTL8720CM = CPU_MODEL(F_RTL8720C, 0xEC), // 0xFB << 2 | 0
+    RTL8720CF = CPU_MODEL(F_RTL8720C, 0xED), // 0xFB << 2 | 1
+    RTL8720CX = RTL8720CM,
+    // Beken 72XX
+    BK7231Q = CPU_MODEL(F_BK7231Q, 0x31), // *SCTRL_CHIP_ID = 0x7231
+    BK7231T = CPU_MODEL(F_BK7231T, 0x1A), // *SCTRL_CHIP_ID = 0x7231a
+    BK7231N = CPU_MODEL(F_BK7231N, 0x1C), // *SCTRL_CHIP_ID = 0x7231c
+    BK7252  = CPU_MODEL(F_BK7251, 0x00),  // TODO
+    BL2028N = BK7231N,
+    BK7231S = BK7231T,
+    BK7231U = BK7231T,
+} lt_cpu_model_t;
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__utils_8c/index.html b/ltapi/lt__utils_8c/index.html new file mode 100644 index 000000000..79e5f714e --- /dev/null +++ b/ltapi/lt__utils_8c/index.html @@ -0,0 +1,2442 @@ + + + + + + + + + + + + + + + + + + + + File lt\_utils.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_utils.c

+

FileList > api > lt_utils.c

+

Go to the source code of this file.

+
    +
  • #include "lt_utils.h"
  • +
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
voidhexdump (const uint8_t * buf, size_t len, uint32_t offset=0, uint8_t width=16)
Print data pointed to by buf in hexdump-like format (hex+ASCII).
char *lt_btox (const uint8_t * src, int len, char * dest)
Convert a byte array to hexadecimal string.
voidlt_rand_bytes (uint8_t * buf, size_t len)
Generate random bytes using rand().
uint8_t *lt_xtob (const char * src, int len, uint8_t * dest)
Convert a hexadecimal string to byte array.
+

Public Functions Documentation

+

function hexdump

+

Print data pointed to by buf in hexdump-like format (hex+ASCII). +

void hexdump (
+    const uint8_t * buf,
+    size_t len,
+    uint32_t offset=0,
+    uint8_t width=16
+) 
+

+

Parameters:

+
    +
  • buf source pointer
  • +
  • len how many bytes to print
  • +
  • offset increment printed offset by this value
  • +
  • width how many bytes on a line
  • +
+

function lt_btox

+

Convert a byte array to hexadecimal string. +

char * lt_btox (
+    const uint8_t * src,
+    int len,
+    char * dest
+) 
+

+

Parameters:

+
    +
  • src source byte array
  • +
  • len source length (bytes)
  • +
  • dest destination string
  • +
+

Returns:

+

destination string

+

function lt_rand_bytes

+

Generate random bytes using rand(). +

void lt_rand_bytes (
+    uint8_t * buf,
+    size_t len
+) 
+

+

Parameters:

+
    +
  • buf destination pointer
  • +
  • len how many bytes to generate
  • +
+

function lt_xtob

+

Convert a hexadecimal string to byte array. +

uint8_t * lt_xtob (
+    const char * src,
+    int len,
+    uint8_t * dest
+) 
+

+

Parameters:

+
    +
  • src source string
  • +
  • len source length (chars)
  • +
  • dest destination byte array
  • +
+

Returns:

+

destination byte array

+
+

The documentation for this class was generated from the following file cores/common/base/api/lt_utils.c

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__utils_8c_source/index.html b/ltapi/lt__utils_8c_source/index.html new file mode 100644 index 000000000..175e98be4 --- /dev/null +++ b/ltapi/lt__utils_8c_source/index.html @@ -0,0 +1,2368 @@ + + + + + + + + + + + + + + + + + + + + File lt\_utils.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_utils.c

+

File List > api > lt_utils.c

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-04-29. */
+
+#include "lt_utils.h"
+
+void lt_rand_bytes(uint8_t *buf, size_t len) {
+    int *data = (int *)buf;
+    size_t i;
+    for (i = 0; len >= sizeof(int); len -= sizeof(int)) {
+        data[i++] = rand();
+    }
+    if (len) {
+        int rem             = rand();
+        unsigned char *pRem = (unsigned char *)&rem;
+        memcpy(buf + i * sizeof(int), pRem, len);
+    }
+}
+
+void hexdump(const uint8_t *buf, size_t len, uint32_t offset, uint8_t width) {
+    uint16_t pos = 0;
+    while (pos < len) {
+        // print hex offset
+        printf("%06lx ", offset + pos);
+        // calculate current line width
+        uint8_t lineWidth = MIN(width, len - pos);
+        // print hexadecimal representation
+        for (uint8_t i = 0; i < lineWidth; i++) {
+            if (i % 8 == 0) {
+                printf(" ");
+            }
+            printf("%02x ", buf[pos + i]);
+        }
+        // print ascii representation
+        printf(" |");
+        for (uint8_t i = 0; i < lineWidth; i++) {
+            char c = buf[pos + i];
+            putchar((c >= 0x20 && c <= 0x7f) ? c : '.');
+        }
+        puts("|\r");
+        pos += lineWidth;
+    }
+}
+
+char *lt_btox(const uint8_t *src, int len, char *dest) {
+    // https://stackoverflow.com/a/53966346
+    const char hex[] = "0123456789abcdef";
+    len *= 2;
+    dest[len] = '\0';
+    while (--len >= 0)
+        dest[len] = hex[(src[len >> 1] >> ((1 - (len & 1)) << 2)) & 0xF];
+    return dest;
+}
+
+uint8_t *lt_xtob(const char *src, int len, uint8_t *dest) {
+    // https://gist.github.com/vi/dd3b5569af8a26b97c8e20ae06e804cb
+
+    // mapping of ASCII characters to hex values
+    // (16-byte swapped to reduce XOR 0x10 operation)
+    const uint8_t mapping[] = {
+        0x00, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00, // @ABCDEFG
+        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // HIJKLMNO
+        0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, // 01234567
+        0x08, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 89:;<=>?
+    };
+
+    int j = 0;
+    uint8_t idx0;
+    uint8_t idx1;
+    for (int i = 0; i < len; i += 2) {
+        idx0      = ((uint8_t)src[i + 0] & 0x1F);
+        idx1      = ((uint8_t)src[i + 1] & 0x1F);
+        dest[j++] = (mapping[idx0] << 4) | (mapping[idx1] << 0);
+    }
+    return dest;
+}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__utils_8h/index.html b/ltapi/lt__utils_8h/index.html new file mode 100644 index 000000000..c8f2fa788 --- /dev/null +++ b/ltapi/lt__utils_8h/index.html @@ -0,0 +1,2516 @@ + + + + + + + + + + + + + + + + + + + + File lt\_utils.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_utils.h

+

FileList > api > lt_utils.h

+

Go to the source code of this file.

+
    +
  • #include <libretiny.h>
  • +
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
voidhexdump (const uint8_t * buf, size_t len, uint32_t offset=0, uint8_t width=16)
Print data pointed to by buf in hexdump-like format (hex+ASCII).
char *lt_btox (const uint8_t * src, int len, char * dest)
Convert a byte array to hexadecimal string.
voidlt_rand_bytes (uint8_t * buf, size_t len)
Generate random bytes using rand().
uint8_t *lt_xtob (const char * src, int len, uint8_t * dest)
Convert a hexadecimal string to byte array.
+

Macros

+ + + + + + + + + + + + + + + + + +
TypeName
defineMAX (a, b)
defineMIN (a, b)
+

Public Functions Documentation

+

function hexdump

+

Print data pointed to by buf in hexdump-like format (hex+ASCII). +

void hexdump (
+    const uint8_t * buf,
+    size_t len,
+    uint32_t offset=0,
+    uint8_t width=16
+) 
+

+

Parameters:

+
    +
  • buf source pointer
  • +
  • len how many bytes to print
  • +
  • offset increment printed offset by this value
  • +
  • width how many bytes on a line
  • +
+

function lt_btox

+

Convert a byte array to hexadecimal string. +

char * lt_btox (
+    const uint8_t * src,
+    int len,
+    char * dest
+) 
+

+

Parameters:

+
    +
  • src source byte array
  • +
  • len source length (bytes)
  • +
  • dest destination string
  • +
+

Returns:

+

destination string

+

function lt_rand_bytes

+

Generate random bytes using rand(). +

void lt_rand_bytes (
+    uint8_t * buf,
+    size_t len
+) 
+

+

Parameters:

+
    +
  • buf destination pointer
  • +
  • len how many bytes to generate
  • +
+

function lt_xtob

+

Convert a hexadecimal string to byte array. +

uint8_t * lt_xtob (
+    const char * src,
+    int len,
+    uint8_t * dest
+) 
+

+

Parameters:

+
    +
  • src source string
  • +
  • len source length (chars)
  • +
  • dest destination byte array
  • +
+

Returns:

+

destination byte array

+

Macro Definition Documentation

+

define MAX

+
#define MAX (
+    a,
+    b
+) ({                                                                                                                 \
+        __typeof__(a) _a = (a);                                                                                        \
+        __typeof__(b) _b = (b);                                                                                        \
+        _a > _b ? _a : _b;                                                                                             \
+    })
+
+

define MIN

+
#define MIN (
+    a,
+    b
+) ({                                                                                                                 \
+        __typeof__(a) _a = (a);                                                                                        \
+        __typeof__(b) _b = (b);                                                                                        \
+        _a < _b ? _a : _b;                                                                                             \
+    })
+
+
+

The documentation for this class was generated from the following file cores/common/base/api/lt_utils.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__utils_8h_source/index.html b/ltapi/lt__utils_8h_source/index.html new file mode 100644 index 000000000..42dd1e626 --- /dev/null +++ b/ltapi/lt__utils_8h_source/index.html @@ -0,0 +1,2331 @@ + + + + + + + + + + + + + + + + + + + + File lt\_utils.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_utils.h

+

File List > api > lt_utils.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2023-02-27. */
+
+#pragma once
+
+#include <libretiny.h>
+
+// https://stackoverflow.com/a/3437484
+#define MAX(a, b)                                                                                                      \
+    ({                                                                                                                 \
+        __typeof__(a) _a = (a);                                                                                        \
+        __typeof__(b) _b = (b);                                                                                        \
+        _a > _b ? _a : _b;                                                                                             \
+    })
+#define MIN(a, b)                                                                                                      \
+    ({                                                                                                                 \
+        __typeof__(a) _a = (a);                                                                                        \
+        __typeof__(b) _b = (b);                                                                                        \
+        _a < _b ? _a : _b;                                                                                             \
+    })
+
+void lt_rand_bytes(uint8_t *buf, size_t len);
+
+void hexdump(
+    const uint8_t *buf,
+    size_t len,
+#ifdef __cplusplus
+    uint32_t offset = 0,
+    uint8_t width   = 16
+#else
+    uint32_t offset,
+    uint8_t width
+#endif
+);
+
+char *lt_btox(const uint8_t *src, int len, char *dest);
+
+uint8_t *lt_xtob(const char *src, int len, uint8_t *dest);
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__wdt_8c/index.html b/ltapi/lt__wdt_8c/index.html new file mode 100644 index 000000000..97374b1ed --- /dev/null +++ b/ltapi/lt__wdt_8c/index.html @@ -0,0 +1,2354 @@ + + + + + + + + + + + + + + + + + + + + File lt\_wdt.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_wdt.c

+

FileList > api > lt_wdt.c

+

Go to the source code of this file.

+
    +
  • #include "lt_wdt.h"
  • +
+

Public Functions

+ + + + + + + + + + + + + +
TypeName
__attribute__ ((weak))
+

Public Functions Documentation

+

function __attribute__

+
__attribute__ (
+    (weak)
+) 
+
+
+

The documentation for this class was generated from the following file cores/common/base/api/lt_wdt.c

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__wdt_8c_source/index.html b/ltapi/lt__wdt_8c_source/index.html new file mode 100644 index 000000000..6c9720b87 --- /dev/null +++ b/ltapi/lt__wdt_8c_source/index.html @@ -0,0 +1,2305 @@ + + + + + + + + + + + + + + + + + + + + File lt\_wdt.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_wdt.c

+

File List > api > lt_wdt.c

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-04-29. */
+
+#include "lt_wdt.h"
+
+__attribute__((weak)) bool lt_wdt_enable(uint32_t timeout) {
+    return false;
+}
+
+__attribute__((weak)) void lt_wdt_disable() {}
+
+__attribute__((weak)) void lt_wdt_feed() {}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__wdt_8h/index.html b/ltapi/lt__wdt_8h/index.html new file mode 100644 index 000000000..c8f305e10 --- /dev/null +++ b/ltapi/lt__wdt_8h/index.html @@ -0,0 +1,2389 @@ + + + + + + + + + + + + + + + + + + + + File lt\_wdt.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_wdt.h

+

FileList > api > lt_wdt.h

+

Go to the source code of this file.

+
    +
  • #include <libretiny.h>
  • +
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + +
TypeName
voidlt_wdt_disable ()
Disable the hardware watchdog.
boollt_wdt_enable (uint32_t timeout)
Enable the hardware watchdog.
voidlt_wdt_feed ()
Feed/reset the hardware watchdog timer.
+

Public Functions Documentation

+

function lt_wdt_disable

+
void lt_wdt_disable () 
+
+

function lt_wdt_enable

+

Enable the hardware watchdog. +

bool lt_wdt_enable (
+    uint32_t timeout
+) 
+

+

Parameters:

+
    +
  • timeout watchdog timeout, milliseconds
  • +
+

Returns:

+

whether the chip has a hardware watchdog

+

function lt_wdt_feed

+
void lt_wdt_feed () 
+
+
+

The documentation for this class was generated from the following file cores/common/base/api/lt_wdt.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lt__wdt_8h_source/index.html b/ltapi/lt__wdt_8h_source/index.html new file mode 100644 index 000000000..a2b4d15de --- /dev/null +++ b/ltapi/lt__wdt_8h_source/index.html @@ -0,0 +1,2305 @@ + + + + + + + + + + + + + + + + + + + + File lt\_wdt.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lt_wdt.h

+

File List > api > lt_wdt.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2023-03-09. */
+
+#pragma once
+
+#include <libretiny.h>
+
+bool lt_wdt_enable(uint32_t timeout);
+
+void lt_wdt_disable();
+
+void lt_wdt_feed();
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lwip_2errno_8h/index.html b/ltapi/lwip_2errno_8h/index.html new file mode 100644 index 000000000..531a0ee8f --- /dev/null +++ b/ltapi/lwip_2errno_8h/index.html @@ -0,0 +1,2298 @@ + + + + + + + + + + + + + + + + + + + + File errno.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lwip_2errno_8h_source/index.html b/ltapi/lwip_2errno_8h_source/index.html new file mode 100644 index 000000000..357d3cc8c --- /dev/null +++ b/ltapi/lwip_2errno_8h_source/index.html @@ -0,0 +1,2299 @@ + + + + + + + + + + + + + + + + + + + + File errno.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lwip__timers_8h/index.html b/ltapi/lwip__timers_8h/index.html new file mode 100644 index 000000000..18d7ce2ec --- /dev/null +++ b/ltapi/lwip__timers_8h/index.html @@ -0,0 +1,2298 @@ + + + + + + + + + + + + + + + + + + + + File lwip\_timers.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lwip__timers_8h_source/index.html b/ltapi/lwip__timers_8h_source/index.html new file mode 100644 index 000000000..417e42dcb --- /dev/null +++ b/ltapi/lwip__timers_8h_source/index.html @@ -0,0 +1,2299 @@ + + + + + + + + + + + + + + + + + + + + File lwip\_timers.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lwipopts_8h/index.html b/ltapi/lwipopts_8h/index.html new file mode 100644 index 000000000..a5f1e35e9 --- /dev/null +++ b/ltapi/lwipopts_8h/index.html @@ -0,0 +1,2479 @@ + + + + + + + + + + + + + + + + + + + + File lwipopts.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

File lwipopts.h

+

FileList > base > config > lwipopts.h

+

Go to the source code of this file.

+
    +
  • #include <sys/time.h>
  • +
+

Macros

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
defineLWIP_MDNS_RESPONDER 1
defineLWIP_NETIF_HOSTNAME 1
defineLWIP_SO_RCVBUF 1
defineLWIP_TIMEVAL_PRIVATE 0
defineLWIP_VERSION_SIMPLE (LWIP_VERSION_MAJOR * 10000 + LWIP_VERSION_MINOR * 100 + LWIP_VERSION_REVISION)
defineMDNS_MAX_SERVICES 10
defineSNTP_GET_SYSTEM_TIME (sec, us)
defineSNTP_SERVER_DNS 1
defineSNTP_SET_SYSTEM_TIME_US (sec, us)
+

Macro Definition Documentation

+

define LWIP_MDNS_RESPONDER

+
#define LWIP_MDNS_RESPONDER 1
+
+

define LWIP_NETIF_HOSTNAME

+
#define LWIP_NETIF_HOSTNAME 1
+
+

define LWIP_SO_RCVBUF

+
#define LWIP_SO_RCVBUF 1
+
+

define LWIP_TIMEVAL_PRIVATE

+
#define LWIP_TIMEVAL_PRIVATE 0
+
+

define LWIP_VERSION_SIMPLE

+
#define LWIP_VERSION_SIMPLE (LWIP_VERSION_MAJOR * 10000 + LWIP_VERSION_MINOR * 100 + LWIP_VERSION_REVISION)
+
+

define MDNS_MAX_SERVICES

+
#define MDNS_MAX_SERVICES 10
+
+

define SNTP_GET_SYSTEM_TIME

+
#define SNTP_GET_SYSTEM_TIME (
+    sec,
+    us
+) do {                                                                                                               \
+        struct timeval tv = {.tv_sec = 0, .tv_usec = 0};                                                               \
+        gettimeofday(&tv, NULL);                                                                                       \
+        (sec) = tv.tv_sec;                                                                                             \
+        (us)  = tv.tv_usec;                                                                                            \
+    } while (0);
+
+

define SNTP_SERVER_DNS

+
#define SNTP_SERVER_DNS 1
+
+

Set this to 1 to support DNS names (or IP address strings) to set sntp servers One server address/name can be defined as default if SNTP_SERVER_DNS == 1: #define SNTP_SERVER_ADDRESS "pool.ntp.org"

+

define SNTP_SET_SYSTEM_TIME_US

+
#define SNTP_SET_SYSTEM_TIME_US (
+    sec,
+    us
+) do {                                                                                                               \
+        struct timeval tv = {.tv_sec = sec, .tv_usec = us};                                                            \
+        settimeofday(&tv, NULL);                                                                                       \
+    } while (0);
+
+
+

The documentation for this class was generated from the following file cores/common/base/config/lwipopts.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/lwipopts_8h_source/index.html b/ltapi/lwipopts_8h_source/index.html new file mode 100644 index 000000000..f7ce348be --- /dev/null +++ b/ltapi/lwipopts_8h_source/index.html @@ -0,0 +1,2385 @@ + + + + + + + + + + + + + + + + + + + + File lwipopts.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File lwipopts.h

+

File List > base > config > lwipopts.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-08-26. */
+
+#pragma once
+
+#define LWIP_TIMEVAL_PRIVATE 0
+#define LWIP_NETIF_HOSTNAME  1 // to support hostname changing
+#define LWIP_SO_RCVBUF       1 // for ioctl(FIONREAD)
+
+#define LWIP_MDNS_RESPONDER 1
+#define MDNS_MAX_SERVICES   10
+
+#include_next "lwipopts.h"
+
+#include <sys/time.h>
+
+// set lwIP debugging options according to LT config
+#if LT_DEBUG_LWIP
+#undef LWIP_DEBUG
+#define LWIP_DEBUG 1
+// make lwIP use printf() library
+#include <stdio.h>
+#undef LWIP_PLATFORM_DIAG
+// clang-format off
+#define LWIP_PLATFORM_DIAG(x) do { printf x; } while (0)
+// clang-format on
+#endif
+
+#if LT_DEBUG_LWIP_ASSERT
+#undef LWIP_NOASSERT
+#undef LWIP_PLATFORM_ASSERT
+// clang-format off
+#define LWIP_PLATFORM_ASSERT(x) do { printf("ASSERT \"%s\" - %s:%d\n", x, __FILE__, __LINE__); while (1) {}; } while (0)
+// clang-format on
+#endif
+
+// lwIP version as a decimal number, with 2 digits for each part (major, minor, patch)
+#define LWIP_VERSION_SIMPLE (LWIP_VERSION_MAJOR * 10000 + LWIP_VERSION_MINOR * 100 + LWIP_VERSION_REVISION)
+
+// remove family-defined debugging options (use lwIP defaults, or user-defined)
+#undef ETHARP_DEBUG
+#undef NETIF_DEBUG
+#undef PBUF_DEBUG
+#undef API_LIB_DEBUG
+#undef API_MSG_DEBUG
+#undef SOCKETS_DEBUG
+#undef ICMP_DEBUG
+#undef IGMP_DEBUG
+#undef INET_DEBUG
+#undef IP_DEBUG
+#undef IP_REASS_DEBUG
+#undef RAW_DEBUG
+#undef MEM_DEBUG
+#undef MEMP_DEBUG
+#undef SYS_DEBUG
+#undef TIMERS_DEBUG
+#undef TCP_DEBUG
+#undef TCP_INPUT_DEBUG
+#undef TCP_FR_DEBUG
+#undef TCP_RTO_DEBUG
+#undef TCP_CWND_DEBUG
+#undef TCP_WND_DEBUG
+#undef TCP_OUTPUT_DEBUG
+#undef TCP_RST_DEBUG
+#undef TCP_QLEN_DEBUG
+#undef UDP_DEBUG
+#undef TCPIP_DEBUG
+#undef SLIP_DEBUG
+#undef DHCP_DEBUG
+#undef AUTOIP_DEBUG
+#undef DNS_DEBUG
+#undef IP6_DEBUG
+#undef MDNS_DEBUG
+
+#undef LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS
+#undef LWIP_PROVIDE_ERRNO
+
+#define SNTP_SERVER_DNS 1
+
+#define SNTP_SET_SYSTEM_TIME_US(sec, us)                                                                               \
+    do {                                                                                                               \
+        struct timeval tv = {.tv_sec = sec, .tv_usec = us};                                                            \
+        settimeofday(&tv, NULL);                                                                                       \
+    } while (0);
+
+#define SNTP_GET_SYSTEM_TIME(sec, us)                                                                                  \
+    do {                                                                                                               \
+        struct timeval tv = {.tv_sec = 0, .tv_usec = 0};                                                               \
+        gettimeofday(&tv, NULL);                                                                                       \
+        (sec) = tv.tv_sec;                                                                                             \
+        (us)  = tv.tv_usec;                                                                                            \
+    } while (0);
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/m_d_n_s_8cpp/index.html b/ltapi/m_d_n_s_8cpp/index.html new file mode 100644 index 000000000..f0650b394 --- /dev/null +++ b/ltapi/m_d_n_s_8cpp/index.html @@ -0,0 +1,2354 @@ + + + + + + + + + + + + + + + + + + + + File mDNS.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File mDNS.cpp

+

FileList > arduino > libraries > common > mDNS > mDNS.cpp

+

Go to the source code of this file.

+
    +
  • #include "mDNS.h"
  • +
+

Public Static Functions

+ + + + + + + + + + + + + +
TypeName
char *ensureUnderscore (const char * value)
+

Public Static Functions Documentation

+

function ensureUnderscore

+
static char * ensureUnderscore (
+    const char * value
+) 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/mDNS/mDNS.cpp

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/m_d_n_s_8cpp_source/index.html b/ltapi/m_d_n_s_8cpp_source/index.html new file mode 100644 index 000000000..5481fde4f --- /dev/null +++ b/ltapi/m_d_n_s_8cpp_source/index.html @@ -0,0 +1,2334 @@ + + + + + + + + + + + + + + + + + + + + File mDNS.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File mDNS.cpp

+

File List > arduino > libraries > common > mDNS > mDNS.cpp

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-08-26. */
+
+#include "mDNS.h"
+
+static char *ensureUnderscore(const char *value) {
+    uint8_t len  = strlen(value) + 1;
+    char *result = (char *)malloc(len);
+    result[0]    = '_';
+    strcpy(result + 1, value + (value[0] == '_'));
+    return result;
+}
+
+void mDNS::setInstanceName(const char *name) {
+    if (instanceName)
+        free(instanceName);
+    instanceName = strdup(name);
+}
+
+bool mDNS::addService(char *service, char *proto, uint16_t port) {
+    char *_service = ensureUnderscore(service);
+    uint8_t _proto = strncmp(proto + (proto[0] == '_'), "tcp", 3) == 0 ? MDNS_TCP : MDNS_UDP;
+
+    bool result = addServiceImpl(instanceName ? instanceName : "LT mDNS", _service, _proto, port);
+    free(_service);
+    return result;
+}
+
+bool mDNS::addServiceTxt(char *service, char *proto, char *key, char *value) {
+    char *_service = ensureUnderscore(service);
+    uint8_t _proto = strncmp(proto + (proto[0] == '_'), "tcp", 3) == 0 ? MDNS_TCP : MDNS_UDP;
+
+    uint8_t txt_len = strlen(key) + strlen(value) + 1;
+    char *txt       = (char *)malloc(txt_len + 1);
+    sprintf(txt, "%s=%s", key, value);
+
+    bool result = addServiceTxtImpl(_service, _proto, txt);
+    free(_service);
+    free(txt);
+    return result;
+}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/m_d_n_s_8h/index.html b/ltapi/m_d_n_s_8h/index.html new file mode 100644 index 000000000..60b099199 --- /dev/null +++ b/ltapi/m_d_n_s_8h/index.html @@ -0,0 +1,2481 @@ + + + + + + + + + + + + + + + + + + + + File mDNS.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File mDNS.h

+

FileList > arduino > libraries > common > mDNS > mDNS.h

+

Go to the source code of this file.

+
    +
  • #include <Arduino.h>
  • +
  • #include <api/IPv6Address.h>
  • +
+

Classes

+ + + + + + + + + + + + + +
TypeName
classmDNS
+

Public Types

+ + + + + + + + + + + + + +
TypeName
typedef mDNSMDNSResponder
+

Public Attributes

+ + + + + + + + + + + + + +
TypeName
MDNSResponderMDNS
+

Macros

+ + + + + + + + + + + + + + + + + +
TypeName
defineMDNS_TCP 1
defineMDNS_UDP 0
+

Public Types Documentation

+

typedef MDNSResponder

+
typedef mDNS MDNSResponder;
+
+

Public Attributes Documentation

+

variable MDNS

+
MDNSResponder MDNS;
+
+

Macro Definition Documentation

+

define MDNS_TCP

+
#define MDNS_TCP 1
+
+

define MDNS_UDP

+
#define MDNS_UDP 0
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/mDNS/mDNS.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/m_d_n_s_8h_source/index.html b/ltapi/m_d_n_s_8h_source/index.html new file mode 100644 index 000000000..968fb5cb0 --- /dev/null +++ b/ltapi/m_d_n_s_8h_source/index.html @@ -0,0 +1,2422 @@ + + + + + + + + + + + + + + + + + + + + File mDNS.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File mDNS.h

+

File List > arduino > libraries > common > mDNS > mDNS.h

+

Go to the documentation of this file.

+
/*
+ESP8266 Multicast DNS (port of CC3000 Multicast DNS library)
+Version 1.1
+Copyright (c) 2013 Tony DiCola (tony@tonydicola.com)
+ESP8266 port (c) 2015 Ivan Grokhotkov (ivan@esp8266.com)
+MDNS-SD Suport 2015 Hristo Gochkov (hristo@espressif.com)
+Extended MDNS-SD support 2016 Lars Englund (lars.englund@gmail.com)
+Rewritten for ESP32 by Hristo Gochkov (hristo@espressif.com)
+
+This is a simple implementation of multicast DNS query support for an Arduino
+running on ESP32 chip.
+
+Usage:
+- Include the ESP32 Multicast DNS library in the sketch.
+- Call the begin method in the sketch's setup and provide a domain name (without
+  the '.local' suffix, i.e. just provide 'foo' to resolve 'foo.local'), and the
+  Adafruit CC3000 class instance.  Optionally provide a time to live (in seconds)
+  for the DNS record--the default is 1 hour.
+- Call the update method in each iteration of the sketch's loop function.
+
+License (MIT license):
+  Permission is hereby granted, free of charge, to any person obtaining a copy
+  of this software and associated documentation files (the "Software"), to deal
+  in the Software without restriction, including without limitation the rights
+  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+  copies of the Software, and to permit persons to whom the Software is
+  furnished to do so, subject to the following conditions:
+
+  The above copyright notice and this permission notice shall be included in
+  all copies or substantial portions of the Software.
+
+  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+  THE SOFTWARE.
+
+*/
+
+#pragma once
+
+#include <Arduino.h>
+#include <api/IPv6Address.h>
+
+#define MDNS_UDP 0
+#define MDNS_TCP 1
+
+class mDNS {
+  private:
+    bool addServiceImpl(const char *name, const char *service, uint8_t proto, uint16_t port);
+    bool addServiceTxtImpl(const char *service, uint8_t proto, const char *item);
+
+    char *instanceName = NULL;
+
+  public:
+    mDNS();
+    ~mDNS();
+
+    bool begin(const char *hostname);
+    void end();
+
+    void setInstanceName(const char *name);
+    bool addService(char *service, char *proto, uint16_t port);
+    bool addServiceTxt(char *service, char *proto, char *key, char *value);
+    // void enableArduino(uint16_t port = 3232, bool auth = false);
+    // void disableArduino();
+    // void enableWorkstation(esp_interface_t interface = ESP_IF_WIFI_STA);
+    // void disableWorkstation();
+
+    IPAddress queryHost(char *host, uint32_t timeout = 2000);
+    int queryService(char *service, char *proto);
+
+    String hostname(int idx);
+    IPAddress IP(int idx);
+    IPv6Address IPv6(int idx);
+    uint16_t port(int idx);
+    int numTxt(int idx);
+    bool hasTxt(int idx, const char *key);
+    String txt(int idx, const char *key);
+    String txt(int idx, int txtIdx);
+    String txtKey(int idx, int txtIdx);
+
+    void setInstanceName(String name) {
+        setInstanceName(name.c_str());
+    }
+
+    void setInstanceName(char *name) {
+        setInstanceName((const char *)name);
+    }
+
+    bool addService(const char *service, const char *proto, uint16_t port) {
+        return addService((char *)service, (char *)proto, port);
+    }
+
+    bool addService(String service, String proto, uint16_t port) {
+        return addService(service.c_str(), proto.c_str(), port);
+    }
+
+    void addServiceTxt(const char *service, const char *proto, const char *key, const char *value) {
+        addServiceTxt((char *)service, (char *)proto, (char *)key, (char *)value);
+    }
+
+    void addServiceTxt(String service, String proto, String key, String value) {
+        addServiceTxt(service.c_str(), proto.c_str(), key.c_str(), value.c_str());
+    }
+
+    IPAddress queryHost(const char *host, uint32_t timeout = 2000) {
+        return queryHost((char *)host, timeout);
+    }
+
+    IPAddress queryHost(String host, uint32_t timeout = 2000) {
+        return queryHost(host.c_str(), timeout);
+    }
+
+    int queryService(const char *service, const char *proto) {
+        return queryService((char *)service, (char *)proto);
+    }
+
+    int queryService(String service, String proto) {
+        return queryService(service.c_str(), proto.c_str());
+    }
+};
+
+typedef mDNS MDNSResponder;
+
+extern MDNSResponder MDNS;
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/macros/index.html b/ltapi/macros/index.html new file mode 100644 index 000000000..d4062cac5 --- /dev/null +++ b/ltapi/macros/index.html @@ -0,0 +1,2940 @@ + + + + + + + + + + + + + + + + + + + + + + + + Macros - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Macros

+

a

+ +

b

+ +

c

+ +

d

+ +

e

+ +

f

+ +

g

+ +

h

+ +

i

+ +

l

+ +

m

+ +

o

+ +

p

+ +

r

+ +

s

+ +

u

+ +

v

+ +

w

+ +

x

+ + + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/main_8c/index.html b/ltapi/main_8c/index.html new file mode 100644 index 000000000..0caf6ad88 --- /dev/null +++ b/ltapi/main_8c/index.html @@ -0,0 +1,2368 @@ + + + + + + + + + + + + + + + + + + + + File main.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File main.c

+

FileList > arduino > src > main.c

+

Go to the source code of this file.

+
    +
  • #include <Arduino.h>
  • +
+

Public Functions

+ + + + + + + + + + + + + + + + + +
TypeName
intmain ()
voidmainTask (const void * arg)
Main setup() and loop() task. Not to be called directly.
+

Public Functions Documentation

+

function main

+
int main () 
+
+

function mainTask

+
void mainTask (
+    const void * arg
+) 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/src/main.c

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/main_8c_source/index.html b/ltapi/main_8c_source/index.html new file mode 100644 index 000000000..0ccf5fbec --- /dev/null +++ b/ltapi/main_8c_source/index.html @@ -0,0 +1,2317 @@ + + + + + + + + + + + + + + + + + + + + File main.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File main.c

+

File List > arduino > src > main.c

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2023-02-27. */
+
+#include <Arduino.h>
+
+int main() {
+    // initialize Arduino framework
+    lt_init_arduino();
+    // start the main task and OS kernel
+    if (!startMainTask()) {
+        LT_F("Couldn't start the main task");
+        return 1;
+    }
+    return 0;
+}
+
+void mainTask(const void *arg) {
+    setup();
+
+    for (;;) {
+        loop();
+        yield();
+    }
+}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/malloc_8c/index.html b/ltapi/malloc_8c/index.html new file mode 100644 index 000000000..afd33f16e --- /dev/null +++ b/ltapi/malloc_8c/index.html @@ -0,0 +1,2351 @@ + + + + + + + + + + + + + + + + + + + + File malloc.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File malloc.c

+

FileList > base > fixups > malloc.c

+

Go to the source code of this file.

+

Public Functions

+ + + + + + + + + + + + + +
TypeName
void *__wrap_zalloc (size_t size)
+

Public Functions Documentation

+

function __wrap_zalloc

+
void * __wrap_zalloc (
+    size_t size
+) 
+
+
+

The documentation for this class was generated from the following file cores/common/base/fixups/malloc.c

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/malloc_8c_source/index.html b/ltapi/malloc_8c_source/index.html new file mode 100644 index 000000000..6536a25ad --- /dev/null +++ b/ltapi/malloc_8c_source/index.html @@ -0,0 +1,2382 @@ + + + + + + + + + + + + + + + + + + + + File malloc.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File malloc.c

+

File List > base > fixups > malloc.c

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2023-03-03. */
+
+// Generic implementation of malloc() family wrappers for FreeRTOS
+
+#if LT_HAS_FREERTOS
+
+#include <stddef.h>
+#include <stdint.h>
+#include <string.h>
+
+#include <FreeRTOS.h>
+
+// no such thing in FreeRTOS, but present on most vendor SDKs
+extern void *LT_REALLOC_FUNC(void *pv, size_t xWantedSize);
+
+void *__wrap_malloc(size_t size) {
+    return pvPortMalloc(size);
+}
+
+void *__wrap_calloc(size_t num, size_t size) {
+    void *ptr;
+    if (num == 0 || size == 0)
+        num = size = 1;
+    ptr = pvPortMalloc(num * size);
+    if (ptr)
+        memset(ptr, 0, num * size);
+    return ptr;
+}
+
+void *__wrap_realloc(void *ptr, size_t new_size) {
+#if LT_REMALLOC
+    void *nptr = pvPortMalloc(new_size);
+    if (nptr) {
+        memcpy(nptr, ptr, new_size);
+        vPortFree(ptr);
+    }
+    return nptr;
+#else
+    return LT_REALLOC_FUNC(ptr, new_size);
+#endif
+}
+
+void __wrap_free(void *ptr) {
+    vPortFree(ptr);
+}
+
+// Mind the 'reent' parameter - do NOT define these as linker aliases!
+
+void *__wrap__malloc_r(void *reent, size_t size) {
+    return pvPortMalloc(size);
+}
+
+void *__wrap__calloc_r(void *reent, size_t num, size_t size) {
+    void *ptr;
+    if (num == 0 || size == 0)
+        num = size = 1;
+    ptr = pvPortMalloc(num * size);
+    if (ptr)
+        memset(ptr, 0, num * size);
+    return ptr;
+}
+
+void *__wrap__realloc_r(void *reent, void *ptr, size_t new_size) {
+#if LT_REMALLOC
+    void *nptr = pvPortMalloc(new_size);
+    if (nptr) {
+        memcpy(nptr, ptr, new_size);
+        vPortFree(ptr);
+    }
+    return nptr;
+#else
+    return LT_REALLOC_FUNC(ptr, new_size);
+#endif
+}
+
+void __wrap__free_r(void *reent, void *ptr) {
+    vPortFree(ptr);
+}
+
+#endif
+
+// Additionally, define zalloc() as a shorthand to calloc() - some implementation use it
+
+void *__wrap_zalloc(size_t size) {
+    return __wrap_calloc(1, size);
+}
+
+__attribute__((alias("__wrap_zalloc"), weak)) void *zalloc(size_t size);
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/mimetable_8cpp/index.html b/ltapi/mimetable_8cpp/index.html new file mode 100644 index 000000000..128a2dde7 --- /dev/null +++ b/ltapi/mimetable_8cpp/index.html @@ -0,0 +1,2329 @@ + + + + + + + + + + + + + + + + + + + + File mimetable.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/mimetable_8cpp_source/index.html b/ltapi/mimetable_8cpp_source/index.html new file mode 100644 index 000000000..9fb559c20 --- /dev/null +++ b/ltapi/mimetable_8cpp_source/index.html @@ -0,0 +1,2327 @@ + + + + + + + + + + + + + + + + + + + + File mimetable.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File mimetable.cpp

+

File List > arduino > libraries > ext > WebServer > detail > mimetable.cpp

+

Go to the documentation of this file.

+
#include "mimetable.h"
+#include "pgmspace.h"
+
+namespace mime {
+
+// Table of extension->MIME strings stored in PROGMEM, needs to be global due to GCC section typing rules
+const Entry mimeTable[maxType] = {
+    {".html",     "text/html"                    },
+    {".htm",         "text/html"                    },
+    {".css",         "text/css"                    },
+    {".txt",         "text/plain"                    },
+    {".js",     "application/javascript"        },
+    {".json",     "application/json"                },
+    {".png",         "image/png"                    },
+    {".gif",         "image/gif"                    },
+    {".jpg",         "image/jpeg"                    },
+    {".ico",         "image/x-icon"                },
+    {".svg",         "image/svg+xml"                },
+    {".ttf",         "application/x-font-ttf"        },
+    {".otf",         "application/x-font-opentype"  },
+    {".woff",     "application/font-woff"        },
+    {".woff2",     "application/font-woff2"    },
+    {".eot",         "application/vnd.ms-fontobject"},
+    {".sfnt",     "application/font-sfnt"        },
+    {".xml",         "text/xml"                    },
+    {".pdf",         "application/pdf"            },
+    {".zip",         "application/zip"            },
+    {".gz",     "application/x-gzip"            },
+    {".appcache", "text/cache-manifest"        },
+    {"",          "application/octet-stream"       }
+};
+
+} // namespace mime
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/mimetable_8h/index.html b/ltapi/mimetable_8h/index.html new file mode 100644 index 000000000..d43dcc98c --- /dev/null +++ b/ltapi/mimetable_8h/index.html @@ -0,0 +1,2347 @@ + + + + + + + + + + + + + + + + + + + + File mimetable.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/mimetable_8h_source/index.html b/ltapi/mimetable_8h_source/index.html new file mode 100644 index 000000000..3f034753c --- /dev/null +++ b/ltapi/mimetable_8h_source/index.html @@ -0,0 +1,2332 @@ + + + + + + + + + + + + + + + + + + + + File mimetable.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File mimetable.h

+

File List > arduino > libraries > ext > WebServer > detail > mimetable.h

+

Go to the documentation of this file.

+
#pragma once
+
+namespace mime {
+
+enum type {
+    html,
+    htm,
+    css,
+    txt,
+    js,
+    json,
+    png,
+    gif,
+    jpg,
+    ico,
+    svg,
+    ttf,
+    otf,
+    woff,
+    woff2,
+    eot,
+    sfnt,
+    xml,
+    pdf,
+    zip,
+    gz,
+    appcache,
+    none,
+    maxType
+};
+
+struct Entry {
+    const char endsWith[16];
+    const char mimeType[32];
+};
+
+extern const Entry mimeTable[maxType];
+} // namespace mime
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/modules/index.html b/ltapi/modules/index.html new file mode 100644 index 000000000..057492639 --- /dev/null +++ b/ltapi/modules/index.html @@ -0,0 +1,2292 @@ + + + + + + + + + + + + + + + + + + + + Modules - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Modules

+

Here is a list of all modules:

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/namespace_member_enums/index.html b/ltapi/namespace_member_enums/index.html new file mode 100644 index 000000000..1cbf68db6 --- /dev/null +++ b/ltapi/namespace_member_enums/index.html @@ -0,0 +1,2321 @@ + + + + + + + + + + + + + + + + + + + + Namespace Member Enums - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Namespace Member Enums

+

s

+
    +
  • SeekMode (fs)
  • +
+

t

+ + + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/namespace_member_functions/index.html b/ltapi/namespace_member_functions/index.html new file mode 100644 index 000000000..1f353b482 --- /dev/null +++ b/ltapi/namespace_member_functions/index.html @@ -0,0 +1,2291 @@ + + + + + + + + + + + + + + + + + + + + Namespace Member Functions - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Namespace Member Functions

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/namespace_member_typedefs/index.html b/ltapi/namespace_member_typedefs/index.html new file mode 100644 index 000000000..909ab1fe8 --- /dev/null +++ b/ltapi/namespace_member_typedefs/index.html @@ -0,0 +1,2311 @@ + + + + + + + + + + + + + + + + + + + + Namespace Member Typedefs - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Namespace Member Typedefs

+

f

+
    +
  • FSImplPtr (fs)
  • +
  • FileImplPtr (fs)
  • +
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/namespace_member_variables/index.html b/ltapi/namespace_member_variables/index.html new file mode 100644 index 000000000..2092228c6 --- /dev/null +++ b/ltapi/namespace_member_variables/index.html @@ -0,0 +1,2310 @@ + + + + + + + + + + + + + + + + + + + + Namespace Member Variables - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Namespace Member Variables

+

m

+
    +
  • mimeTable (mime)
  • +
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/namespace_members/index.html b/ltapi/namespace_members/index.html new file mode 100644 index 000000000..fd6d596d2 --- /dev/null +++ b/ltapi/namespace_members/index.html @@ -0,0 +1,2344 @@ + + + + + + + + + + + + + + + + + + + + Namespace Members - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Namespace Members

+

f

+
    +
  • FSImplPtr (fs)
  • +
  • FileImplPtr (fs)
  • +
+

m

+
    +
  • mimeTable (mime)
  • +
+

s

+
    +
  • SeekMode (fs)
  • +
+

t

+ + + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/namespacearduino/index.html b/ltapi/namespacearduino/index.html new file mode 100644 index 000000000..553c4840f --- /dev/null +++ b/ltapi/namespacearduino/index.html @@ -0,0 +1,2324 @@ + + + + + + + + + + + + + + + + + + + + Namespace arduino - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Namespace arduino

+

Namespace List > arduino

+

Classes

+ + + + + + + + + + + + + +
TypeName
classIPv6Address
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/IPv6Address/IPv6Address.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/namespacefs/index.html b/ltapi/namespacefs/index.html new file mode 100644 index 000000000..ff44ecd7b --- /dev/null +++ b/ltapi/namespacefs/index.html @@ -0,0 +1,2414 @@ + + + + + + + + + + + + + + + + + + + + Namespace fs - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Namespace fs

+

Namespace List > fs

+

Classes

+ + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
classFS
classFSImpl
classFile
classFileImpl
+

Public Types

+ + + + + + + + + + + + + + + + + + + + + +
TypeName
typedef std::shared_ptr< FSImpl >FSImplPtr
typedef std::shared_ptr< FileImpl >FileImplPtr
enumSeekMode
+

Public Types Documentation

+

typedef FSImplPtr

+
typedef std::shared_ptr<FSImpl> fs::FSImplPtr;
+
+

typedef FileImplPtr

+
typedef std::shared_ptr<FileImpl> fs::FileImplPtr;
+
+

enum SeekMode

+
enum fs::SeekMode {
+    SeekSet = 0,
+    SeekCur = 1,
+    SeekEnd = 2
+};
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/FS/FS.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/namespacemime/index.html b/ltapi/namespacemime/index.html new file mode 100644 index 000000000..bcaa3e815 --- /dev/null +++ b/ltapi/namespacemime/index.html @@ -0,0 +1,2537 @@ + + + + + + + + + + + + + + + + + + + + Namespace mime - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Namespace mime

+

Namespace List > mime

+

Classes

+ + + + + + + + + + + + + +
TypeName
structEntry
+

Public Types

+ + + + + + + + + + + + + +
TypeName
enumtype
+

Public Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
const EntrymimeTable = = {
{".html", "text/html" },
{".htm", "text/html" },
{".css", "text/css" },
{".txt", "text/plain" },
{".js", "application/javascript" },
{".json", "application/json" },
{".png", "image/png" },
{".gif", "image/gif" },
{".jpg", "image/jpeg" },
{".ico", "image/x-icon" },
{".svg", "image/svg+xml" },
{".ttf", "application/x-font-ttf" },
{".otf", "application/x-font-opentype" },
{".woff", "application/font-woff" },
{".woff2", "application/font-woff2" },
{".eot", "application/vnd.ms-fontobject"},
{".sfnt", "application/font-sfnt" },
{".xml", "text/xml" },
{".pdf", "application/pdf" },
{".zip", "application/zip" },
{".gz", "application/x-gzip" },
{".appcache", "text/cache-manifest" },
{"", "application/octet-stream" }
}
+

Public Types Documentation

+

enum type

+
enum mime::type {
+    html,
+    htm,
+    css,
+    txt,
+    js,
+    json,
+    png,
+    gif,
+    jpg,
+    ico,
+    svg,
+    ttf,
+    otf,
+    woff,
+    woff2,
+    eot,
+    sfnt,
+    xml,
+    pdf,
+    zip,
+    gz,
+    appcache,
+    none,
+    maxType
+};
+
+

Public Attributes Documentation

+

variable mimeTable

+
const Entry mime::mimeTable;
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/detail/mimetable.cpp

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/namespaces/index.html b/ltapi/namespaces/index.html new file mode 100644 index 000000000..ead9656d7 --- /dev/null +++ b/ltapi/namespaces/index.html @@ -0,0 +1,2297 @@ + + + + + + + + + + + + + + + + + + + + Namespace List - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Namespace List

+

Here is a list of all namespaces with brief descriptions:

+ + + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/netdb_8h/index.html b/ltapi/netdb_8h/index.html new file mode 100644 index 000000000..5f8ddea6b --- /dev/null +++ b/ltapi/netdb_8h/index.html @@ -0,0 +1,2298 @@ + + + + + + + + + + + + + + + + + + + + File netdb.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/netdb_8h_source/index.html b/ltapi/netdb_8h_source/index.html new file mode 100644 index 000000000..f3a61ae71 --- /dev/null +++ b/ltapi/netdb_8h_source/index.html @@ -0,0 +1,2299 @@ + + + + + + + + + + + + + + + + + + + + File netdb.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/netif_8h/index.html b/ltapi/netif_8h/index.html new file mode 100644 index 000000000..c6ed050f8 --- /dev/null +++ b/ltapi/netif_8h/index.html @@ -0,0 +1,2298 @@ + + + + + + + + + + + + + + + + + + + + File netif.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/netif_8h_source/index.html b/ltapi/netif_8h_source/index.html new file mode 100644 index 000000000..c8056aa11 --- /dev/null +++ b/ltapi/netif_8h_source/index.html @@ -0,0 +1,2299 @@ + + + + + + + + + + + + + + + + + + + + File netif.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/pages/index.html b/ltapi/pages/index.html new file mode 100644 index 000000000..095887220 --- /dev/null +++ b/ltapi/pages/index.html @@ -0,0 +1,2292 @@ + + + + + + + + + + + + + + + + + + + + Class List - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Class List

+

Here are the classes, structs, unions and interfaces with brief descriptions:

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/pgmspace_8h/index.html b/ltapi/pgmspace_8h/index.html new file mode 100644 index 000000000..134ed04d5 --- /dev/null +++ b/ltapi/pgmspace_8h/index.html @@ -0,0 +1,2298 @@ + + + + + + + + + + + + + + + + + + + + File pgmspace.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/pgmspace_8h_source/index.html b/ltapi/pgmspace_8h_source/index.html new file mode 100644 index 000000000..4cecc424c --- /dev/null +++ b/ltapi/pgmspace_8h_source/index.html @@ -0,0 +1,2299 @@ + + + + + + + + + + + + + + + + + + + + File pgmspace.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/printf__config_8h/index.html b/ltapi/printf__config_8h/index.html new file mode 100644 index 000000000..a5f8cb471 --- /dev/null +++ b/ltapi/printf__config_8h/index.html @@ -0,0 +1,2666 @@ + + + + + + + + + + + + + + + + + + + + File printf\_config.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

File printf_config.h

+

FileList > base > config > printf_config.h

+

Go to the source code of this file.

+
    +
  • #include <lt_config.h>
  • +
+

Public Functions

+ + + + + + + + + + + + + +
TypeName
voidputchar_p (char c, unsigned long port)
+

Macros

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
definePRINTF_HAS_DISABLE 1
defineWRAP_DISABLE_CHECK (name)
defineWRAP_DISABLE_DECL (name)
defineWRAP_DISABLE_DEF (name)
defineWRAP_PRINTF (name)
defineWRAP_SNPRINTF (name)
defineWRAP_SPRINTF (name)
defineWRAP_VPRINTF (name)
defineWRAP_VSNPRINTF (name)
defineWRAP_VSPRINTF (name)
defineprintf_ __wrap_printf
definesnprintf_ __wrap_snprintf
definesprintf_ __wrap_sprintf
definevprintf_ __wrap_vprintf
definevsnprintf_ __wrap_vsnprintf
definevsprintf_ __wrap_vsprintf
+

Public Functions Documentation

+

function putchar_p

+
void putchar_p (
+    char c,
+    unsigned long port
+) 
+
+

Macro Definition Documentation

+

define PRINTF_HAS_DISABLE

+
#define PRINTF_HAS_DISABLE 1
+
+

define WRAP_DISABLE_CHECK

+
#define WRAP_DISABLE_CHECK (
+    name
+) {                                                                                                                  \
+        if (LT_UART_SILENT_ALL)                                                                                        \
+            return 0;                                                                                                  \
+    }
+
+

define WRAP_DISABLE_DECL

+
#define WRAP_DISABLE_DECL (
+    name
+) void __wrap_##name##_disable() {}                                                                                  \
+    void __wrap_##name##_enable() {}                                                                                   \
+    void __wrap_##name##_set(unsigned char disabled) {}                                                                \
+    unsigned char __wrap_##name##_get() {                                                                              \
+        return LT_UART_SILENT_ALL;                                                                                     \
+    }
+
+

define WRAP_DISABLE_DEF

+
#define WRAP_DISABLE_DEF (
+    name
+) extern void __wrap_##name##_disable();                                                                             \
+    extern void __wrap_##name##_enable();                                                                              \
+    extern void __wrap_##name##_set(unsigned char disabled);                                                           \
+    extern unsigned char __wrap_##name##_get();
+
+

define WRAP_PRINTF

+
#define WRAP_PRINTF (
+    name
+) WRAP_DISABLE_DECL(name)                                                                                            \
+    int __wrap_##name(const char *format, ...) {                                                                       \
+        va_list va;                                                                                                    \
+        va_start(va, format);                                                                                          \
+        const int ret = vprintf(format, va);                                                                           \
+        va_end(va);                                                                                                    \
+        return ret;                                                                                                    \
+    }
+
+

define WRAP_SNPRINTF

+
#define WRAP_SNPRINTF (
+    name
+) int __wrap_##name(char *s, size_t count, const char *format, ...) {                                                \
+        va_list va;                                                                                                    \
+        va_start(va, format);                                                                                          \
+        const int ret = vsnprintf(s, count, format, va);                                                               \
+        va_end(va);                                                                                                    \
+        return ret;                                                                                                    \
+    }
+
+

define WRAP_SPRINTF

+
#define WRAP_SPRINTF (
+    name
+) int __wrap_##name(char *s, const char *format, ...) {                                                              \
+        va_list va;                                                                                                    \
+        va_start(va, format);                                                                                          \
+        const int ret = vsprintf(s, format, va);                                                                       \
+        va_end(va);                                                                                                    \
+        return ret;                                                                                                    \
+    }
+
+

define WRAP_VPRINTF

+
#define WRAP_VPRINTF (
+    name
+) WRAP_DISABLE_DECL(name)                                                                                            \
+    int __wrap_##name(const char *format, va_list arg) {                                                               \
+        return vprintf(format, arg);                                                                                   \
+    }
+
+

define WRAP_VSNPRINTF

+
#define WRAP_VSNPRINTF (
+    name
+) int __wrap_##name(char *s, size_t count, const char *format, va_list arg) {                                        \
+        return vsnprintf(s, count, format, arg);                                                                       \
+    }
+
+

define WRAP_VSPRINTF

+
#define WRAP_VSPRINTF (
+    name
+) int __wrap_##name(char *s, const char *format, va_list arg) {                                                      \
+        return vsprintf(s, format, arg);                                                                               \
+    }
+
+

define printf_

+
#define printf_ __wrap_printf
+
+

define snprintf_

+
#define snprintf_ __wrap_snprintf
+
+

define sprintf_

+
#define sprintf_ __wrap_sprintf
+
+

define vprintf_

+
#define vprintf_ __wrap_vprintf
+
+

define vsnprintf_

+
#define vsnprintf_ __wrap_vsnprintf
+
+

define vsprintf_

+
#define vsprintf_ __wrap_vsprintf
+
+
+

The documentation for this class was generated from the following file cores/common/base/config/printf_config.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/printf__config_8h_source/index.html b/ltapi/printf__config_8h_source/index.html new file mode 100644 index 000000000..86f680fc1 --- /dev/null +++ b/ltapi/printf__config_8h_source/index.html @@ -0,0 +1,2449 @@ + + + + + + + + + + + + + + + + + + + + File printf\_config.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File printf_config.h

+

File List > base > config > printf_config.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-06-19. */
+
+#pragma once
+
+#include <lt_config.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif // __cplusplus
+
+#define PRINTF_HAS_DISABLE 1
+
+// make printf.c define wrapper functions
+#define printf_    __wrap_printf
+#define sprintf_   __wrap_sprintf
+#define vsprintf_  __wrap_vsprintf
+#define snprintf_  __wrap_snprintf
+#define vsnprintf_ __wrap_vsnprintf
+#define vprintf_   __wrap_vprintf
+
+// declare putchar() method with custom output port
+void putchar_p(char c, unsigned long port);
+
+#define WRAP_DISABLE_DEF(name)                                                                                         \
+    extern void __wrap_##name##_disable();                                                                             \
+    extern void __wrap_##name##_enable();                                                                              \
+    extern void __wrap_##name##_set(unsigned char disabled);                                                           \
+    extern unsigned char __wrap_##name##_get();
+
+#if !LT_UART_SILENT_ENABLED || LT_UART_SILENT_ALL
+
+#define WRAP_DISABLE_DECL(name)                                                                                        \
+    void __wrap_##name##_disable() {}                                                                                  \
+    void __wrap_##name##_enable() {}                                                                                   \
+    void __wrap_##name##_set(unsigned char disabled) {}                                                                \
+    unsigned char __wrap_##name##_get() {                                                                              \
+        return LT_UART_SILENT_ALL;                                                                                     \
+    }
+
+#define WRAP_DISABLE_CHECK(name)                                                                                       \
+    {                                                                                                                  \
+        if (LT_UART_SILENT_ALL)                                                                                        \
+            return 0;                                                                                                  \
+    }
+
+#else // LT_UART_SILENT_ENABLED && !LT_UART_SILENT_ALL
+
+#define WRAP_DISABLE_DECL(name)                                                                                        \
+    static unsigned char __wrap_##name##_disabled = 0;                                                                 \
+    void __wrap_##name##_disable() {                                                                                   \
+        __wrap_##name##_disabled = 1;                                                                                  \
+    }                                                                                                                  \
+    void __wrap_##name##_enable() {                                                                                    \
+        __wrap_##name##_disabled = 0;                                                                                  \
+    }                                                                                                                  \
+    void __wrap_##name##_set(unsigned char disabled) {                                                                 \
+        __wrap_##name##_disabled = disabled;                                                                           \
+    }                                                                                                                  \
+    unsigned char __wrap_##name##_get() {                                                                              \
+        return __wrap_##name##_disabled;                                                                               \
+    }
+
+#define WRAP_DISABLE_CHECK(name)                                                                                       \
+    {                                                                                                                  \
+        if (__wrap_##name##_disabled)                                                                                  \
+            return 0;                                                                                                  \
+    }
+
+#endif // LT_UART_SILENT_ENABLED && !LT_UART_SILENT_ALL
+
+#if !LT_UART_SILENT_ENABLED
+
+#define WRAP_PRINTF(name)                                                                                              \
+    WRAP_DISABLE_DECL(name)                                                                                            \
+    int __wrap_##name(const char *format, ...) {                                                                       \
+        va_list va;                                                                                                    \
+        va_start(va, format);                                                                                          \
+        const int ret = vprintf(format, va);                                                                           \
+        va_end(va);                                                                                                    \
+        return ret;                                                                                                    \
+    }
+
+#define WRAP_VPRINTF(name)                                                                                             \
+    WRAP_DISABLE_DECL(name)                                                                                            \
+    int __wrap_##name(const char *format, va_list arg) {                                                               \
+        return vprintf(format, arg);                                                                                   \
+    }
+
+#elif LT_UART_SILENT_ALL
+
+#define WRAP_PRINTF(name)                                                                                              \
+    WRAP_DISABLE_DECL(name)                                                                                            \
+    int __wrap_##name(const char *format, ...) {                                                                       \
+        return 0;                                                                                                      \
+    }
+
+#define WRAP_VPRINTF(name)                                                                                             \
+    WRAP_DISABLE_DECL(name)                                                                                            \
+    int __wrap_##name(const char *format, va_list arg) {                                                               \
+        return 0;                                                                                                      \
+    }
+
+#else // !LT_UART_SILENT_ENABLED || !LT_UART_SILENT_ALL
+
+#define WRAP_PRINTF(name)                                                                                              \
+    WRAP_DISABLE_DECL(name)                                                                                            \
+    int __wrap_##name(const char *format, ...) {                                                                       \
+        WRAP_DISABLE_CHECK(name);                                                                                      \
+        va_list va;                                                                                                    \
+        va_start(va, format);                                                                                          \
+        const int ret = vprintf(format, va);                                                                           \
+        va_end(va);                                                                                                    \
+        return ret;                                                                                                    \
+    }
+
+#define WRAP_VPRINTF(name)                                                                                             \
+    WRAP_DISABLE_DECL(name)                                                                                            \
+    int __wrap_##name(const char *format, va_list arg) {                                                               \
+        WRAP_DISABLE_CHECK(name);                                                                                      \
+        return vprintf(format, arg);                                                                                   \
+    }
+
+#endif // !LT_UART_SILENT_ENABLED || !LT_UART_SILENT_ALL
+
+#define WRAP_SPRINTF(name)                                                                                             \
+    int __wrap_##name(char *s, const char *format, ...) {                                                              \
+        va_list va;                                                                                                    \
+        va_start(va, format);                                                                                          \
+        const int ret = vsprintf(s, format, va);                                                                       \
+        va_end(va);                                                                                                    \
+        return ret;                                                                                                    \
+    }
+
+#define WRAP_SNPRINTF(name)                                                                                            \
+    int __wrap_##name(char *s, size_t count, const char *format, ...) {                                                \
+        va_list va;                                                                                                    \
+        va_start(va, format);                                                                                          \
+        const int ret = vsnprintf(s, count, format, va);                                                               \
+        va_end(va);                                                                                                    \
+        return ret;                                                                                                    \
+    }
+
+#define WRAP_VSPRINTF(name)                                                                                            \
+    int __wrap_##name(char *s, const char *format, va_list arg) {                                                      \
+        return vsprintf(s, format, arg);                                                                               \
+    }
+
+#define WRAP_VSNPRINTF(name)                                                                                           \
+    int __wrap_##name(char *s, size_t count, const char *format, va_list arg) {                                        \
+        return vsnprintf(s, count, format, arg);                                                                       \
+    }
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/putchar_8c/index.html b/ltapi/putchar_8c/index.html new file mode 100644 index 000000000..4d1518ff8 --- /dev/null +++ b/ltapi/putchar_8c/index.html @@ -0,0 +1,2355 @@ + + + + + + + + + + + + + + + + + + + + File putchar.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File putchar.c

+

FileList > base > wraps > putchar.c

+

Go to the source code of this file.

+
    +
  • #include <printf/printf.h>
  • +
  • #include <stdio.h>
  • +
+

Public Functions

+ + + + + + + + + + + + + +
TypeName
int__wrap_putchar (int c)
+

Public Functions Documentation

+

function __wrap_putchar

+
int __wrap_putchar (
+    int c
+) 
+
+
+

The documentation for this class was generated from the following file cores/common/base/wraps/putchar.c

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/putchar_8c_source/index.html b/ltapi/putchar_8c_source/index.html new file mode 100644 index 000000000..858192d74 --- /dev/null +++ b/ltapi/putchar_8c_source/index.html @@ -0,0 +1,2303 @@ + + + + + + + + + + + + + + + + + + + + File putchar.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File putchar.c

+

File List > base > wraps > putchar.c

+

Go to the documentation of this file.

+
// https://github.com/embeddedartistry/libc/blob/master/src/stdio/putchar.c
+
+#include <printf/printf.h>
+#include <stdio.h>
+
+int __wrap_putchar(int c) {
+    putchar_((char)c);
+    return c;
+}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/puts_8c/index.html b/ltapi/puts_8c/index.html new file mode 100644 index 000000000..b49c19106 --- /dev/null +++ b/ltapi/puts_8c/index.html @@ -0,0 +1,2355 @@ + + + + + + + + + + + + + + + + + + + + File puts.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File puts.c

+

FileList > base > wraps > puts.c

+

Go to the source code of this file.

+
    +
  • #include <printf/printf.h>
  • +
  • #include <stdio.h>
  • +
+

Public Functions

+ + + + + + + + + + + + + +
TypeName
int__wrap_puts (const char * str)
+

Public Functions Documentation

+

function __wrap_puts

+
int __wrap_puts (
+    const char * str
+) 
+
+
+

The documentation for this class was generated from the following file cores/common/base/wraps/puts.c

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/puts_8c_source/index.html b/ltapi/puts_8c_source/index.html new file mode 100644 index 000000000..1311ddda7 --- /dev/null +++ b/ltapi/puts_8c_source/index.html @@ -0,0 +1,2315 @@ + + + + + + + + + + + + + + + + + + + + File puts.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File puts.c

+

File List > base > wraps > puts.c

+

Go to the documentation of this file.

+
// https://github.com/embeddedartistry/libc/blob/master/src/stdio/puts.c
+
+#include <printf/printf.h>
+#include <stdio.h>
+
+int __wrap_puts(const char *str) {
+    int r = 0;
+
+    for (const char *c = str; *c != 0; c++) {
+        putchar_((int)*c);
+        r++;
+    }
+
+    // puts adds a newline
+    if (r) {
+        putchar_('\n');
+        r++;
+    }
+
+    return r ? r : EOF;
+}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/serial__event_8cpp/index.html b/ltapi/serial__event_8cpp/index.html new file mode 100644 index 000000000..ab0b70bdd --- /dev/null +++ b/ltapi/serial__event_8cpp/index.html @@ -0,0 +1,2382 @@ + + + + + + + + + + + + + + + + + + + + File serial\_event.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File serial_event.cpp

+

FileList > arduino > src > common > serial_event.cpp

+

Go to the source code of this file.

+
    +
  • #include <Arduino.h>
  • +
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + +
TypeName
boolSerial_available ()
voidserialEvent ()
voidserialEventRun (void)
+

Public Functions Documentation

+

function Serial_available

+
bool Serial_available () 
+
+

function serialEvent

+
void serialEvent () 
+
+

function serialEventRun

+
void serialEventRun (
+    void
+) 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/src/common/serial_event.cpp

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/serial__event_8cpp_source/index.html b/ltapi/serial__event_8cpp_source/index.html new file mode 100644 index 000000000..2bf6e154d --- /dev/null +++ b/ltapi/serial__event_8cpp_source/index.html @@ -0,0 +1,2305 @@ + + + + + + + + + + + + + + + + + + + + File serial\_event.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File serial_event.cpp

+

File List > arduino > src > common > serial_event.cpp

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-06-19. */
+
+#include <Arduino.h>
+
+void serialEvent() __attribute__((weak));
+bool Serial_available() __attribute__((weak));
+
+void serialEventRun(void) {
+    if (Serial_available && serialEvent && Serial_available())
+        serialEvent();
+}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/sockets_8h/index.html b/ltapi/sockets_8h/index.html new file mode 100644 index 000000000..5ea7c01a1 --- /dev/null +++ b/ltapi/sockets_8h/index.html @@ -0,0 +1,2298 @@ + + + + + + + + + + + + + + + + + + + + File sockets.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/sockets_8h_source/index.html b/ltapi/sockets_8h_source/index.html new file mode 100644 index 000000000..b7d687bc6 --- /dev/null +++ b/ltapi/sockets_8h_source/index.html @@ -0,0 +1,2299 @@ + + + + + + + + + + + + + + + + + + + + File sockets.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/src_2compat_2_f_s_8h/index.html b/ltapi/src_2compat_2_f_s_8h/index.html new file mode 100644 index 000000000..986313c89 --- /dev/null +++ b/ltapi/src_2compat_2_f_s_8h/index.html @@ -0,0 +1,2298 @@ + + + + + + + + + + + + + + + + + + + + File FS.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/src_2compat_2_f_s_8h_source/index.html b/ltapi/src_2compat_2_f_s_8h_source/index.html new file mode 100644 index 000000000..6ab0c5629 --- /dev/null +++ b/ltapi/src_2compat_2_f_s_8h_source/index.html @@ -0,0 +1,2299 @@ + + + + + + + + + + + + + + + + + + + + File FS.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/src_2compat_2_m_d5_8h/index.html b/ltapi/src_2compat_2_m_d5_8h/index.html new file mode 100644 index 000000000..41560a317 --- /dev/null +++ b/ltapi/src_2compat_2_m_d5_8h/index.html @@ -0,0 +1,2298 @@ + + + + + + + + + + + + + + + + + + + + File md5.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/src_2compat_2_m_d5_8h_source/index.html b/ltapi/src_2compat_2_m_d5_8h_source/index.html new file mode 100644 index 000000000..99d8aca20 --- /dev/null +++ b/ltapi/src_2compat_2_m_d5_8h_source/index.html @@ -0,0 +1,2300 @@ + + + + + + + + + + + + + + + + + + + + File md5.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/strcasecmp_8c/index.html b/ltapi/strcasecmp_8c/index.html new file mode 100644 index 000000000..6420b191d --- /dev/null +++ b/ltapi/strcasecmp_8c/index.html @@ -0,0 +1,2465 @@ + + + + + + + + + + + + + + + + + + + + File strcasecmp.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+ +
+
+ + + +
+
+ + + + + + + + +

File strcasecmp.c

+

FileList > base > posix > strcasecmp.c

+

Go to the source code of this file.

+
    +
  • #include <string.h>
  • +
+

Public Types

+ + + + + + + + + + + + + +
TypeName
typedef unsigned charu_char
+

Public Static Attributes

+ + + + + + + + + + + + + +
TypeName
const u_charcharmap
+

Public Functions

+ + + + + + + + + + + + + + + + + +
TypeName
intstrcasecmp (const char * s1, const char * s2)
intstrncasecmp (const char * s1, const char * s2, size_t n)
+

Public Types Documentation

+

typedef u_char

+
typedef unsigned char u_char;
+
+

Public Static Attributes Documentation

+

variable charmap

+
const u_char charmap[];
+
+

Public Functions Documentation

+

function strcasecmp

+
int strcasecmp (
+    const char * s1,
+    const char * s2
+) 
+
+

function strncasecmp

+
int strncasecmp (
+    const char * s1,
+    const char * s2,
+    size_t n
+) 
+
+
+

The documentation for this class was generated from the following file cores/common/base/posix/strcasecmp.c

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/strcasecmp_8c_source/index.html b/ltapi/strcasecmp_8c_source/index.html new file mode 100644 index 000000000..6cb1d68cf --- /dev/null +++ b/ltapi/strcasecmp_8c_source/index.html @@ -0,0 +1,2391 @@ + + + + + + + + + + + + + + + + + + + + File strcasecmp.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File strcasecmp.c

+

File List > base > posix > strcasecmp.c

+

Go to the documentation of this file.

+
/*  $OpenBSD: strcasecmp.c,v 1.6 2005/08/08 08:05:37 espie Exp $    */
+/*
+ * Copyright (c) 1987, 1993
+ *  The Regents of the University of California.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ *    may be used to endorse or promote products derived from this software
+ *    without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+#include <string.h>
+typedef unsigned char u_char;
+/*
+ * This array is designed for mapping upper and lower case letter
+ * together for a case independent comparison.  The mappings are
+ * based upon ascii character sequences.
+ */
+static const u_char charmap[] = {
+    '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007',
+    '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017',
+    '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027',
+    '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037',
+    '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047',
+    '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057',
+    '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067',
+    '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077',
+    '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147',
+    '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157',
+    '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167',
+    '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137',
+    '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147',
+    '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157',
+    '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167',
+    '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177',
+    '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207',
+    '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217',
+    '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227',
+    '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237',
+    '\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247',
+    '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257',
+    '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267',
+    '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277',
+    '\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307',
+    '\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317',
+    '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327',
+    '\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337',
+    '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347',
+    '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357',
+    '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367',
+    '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377',
+};
+int
+strcasecmp(const char *s1, const char *s2)
+{
+    const u_char *cm = charmap;
+    const u_char *us1 = (const u_char *)s1;
+    const u_char *us2 = (const u_char *)s2;
+    while (cm[*us1] == cm[*us2++])
+        if (*us1++ == '\0')
+            return (0);
+    return (cm[*us1] - cm[*--us2]);
+}
+int
+strncasecmp(const char *s1, const char *s2, size_t n)
+{
+    if (n != 0) {
+        const u_char *cm = charmap;
+        const u_char *us1 = (const u_char *)s1;
+        const u_char *us2 = (const u_char *)s2;
+        do {
+            if (cm[*us1] != cm[*us2++])
+                return (cm[*us1] - cm[*--us2]);
+            if (*us1++ == '\0')
+                break;
+        } while (--n != 0);
+    }
+    return (0);
+}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/strdup_8c/index.html b/ltapi/strdup_8c/index.html new file mode 100644 index 000000000..c57f0199f --- /dev/null +++ b/ltapi/strdup_8c/index.html @@ -0,0 +1,2356 @@ + + + + + + + + + + + + + + + + + + + + File strdup.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File strdup.c

+

FileList > base > posix > strdup.c

+

Go to the source code of this file.

+
    +
  • #include <stddef.h>
  • +
  • #include <stdlib.h>
  • +
  • #include <string.h>
  • +
+

Public Functions

+ + + + + + + + + + + + + +
TypeName
__attribute__ ((weak))
+

Public Functions Documentation

+

function __attribute__

+
__attribute__ (
+    (weak)
+) 
+
+
+

The documentation for this class was generated from the following file cores/common/base/posix/strdup.c

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/strdup_8c_source/index.html b/ltapi/strdup_8c_source/index.html new file mode 100644 index 000000000..eb444081a --- /dev/null +++ b/ltapi/strdup_8c_source/index.html @@ -0,0 +1,2307 @@ + + + + + + + + + + + + + + + + + + + + File strdup.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File strdup.c

+

File List > base > posix > strdup.c

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-05-16. */
+
+#include <stddef.h>
+#include <stdlib.h>
+#include <string.h>
+
+__attribute__((weak)) char *strdup(const char *s) {
+    size_t len = strlen(s) + 1;
+    void *newp = malloc(len);
+    if (newp == NULL)
+        return NULL;
+    return (char *)memcpy(newp, s, len);
+}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/strptime_8c/index.html b/ltapi/strptime_8c/index.html new file mode 100644 index 000000000..305ba5777 --- /dev/null +++ b/ltapi/strptime_8c/index.html @@ -0,0 +1,2362 @@ + + + + + + + + + + + + + + + + + + + + File strptime.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File strptime.c

+

FileList > base > posix > strptime.c

+

Go to the source code of this file.

+
    +
  • #include <stdlib.h>
  • +
  • #include <langinfo.h>
  • +
  • #include <time.h>
  • +
  • #include <ctype.h>
  • +
  • #include <stddef.h>
  • +
  • #include <string.h>
  • +
  • #include <strings.h>
  • +
+

Public Functions

+ + + + + + + + + + + + + +
TypeName
char *strptime (const char *restrict s, const char *restrict f, struct tm *restrict tm)
+

Public Functions Documentation

+

function strptime

+
char * strptime (
+    const char *restrict s,
+    const char *restrict f,
+    struct tm *restrict tm
+) 
+
+
+

The documentation for this class was generated from the following file cores/common/base/posix/strptime.c

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/strptime_8c_source/index.html b/ltapi/strptime_8c_source/index.html new file mode 100644 index 000000000..6c80d93b5 --- /dev/null +++ b/ltapi/strptime_8c_source/index.html @@ -0,0 +1,2491 @@ + + + + + + + + + + + + + + + + + + + + File strptime.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File strptime.c

+

File List > base > posix > strptime.c

+

Go to the documentation of this file.

+
#include <stdlib.h>
+#include <langinfo.h>
+#include <time.h>
+#include <ctype.h>
+#include <stddef.h>
+#include <string.h>
+#include <strings.h>
+
+char *strptime(const char *restrict s, const char *restrict f, struct tm *restrict tm)
+{
+    int i, w, neg, adj, min, range, *dest, dummy;
+    const char *ex;
+    size_t len;
+    int want_century = 0, century = 0;
+    while (*f) {
+        if (*f != '%') {
+            if (isspace(*f)) for (; *s && isspace(*s); s++);
+            else if (*s != *f) return 0;
+            else s++;
+            f++;
+            continue;
+        }
+        f++;
+        if (*f == '+') f++;
+        if (isdigit(*f)) w=strtoul(f, (void *)&f, 10);
+        else w=-1;
+        adj=0;
+        switch (*f++) {
+        case 'a': case 'A':
+            dest = &tm->tm_wday;
+            min = ABDAY_1;
+            range = 7;
+            goto symbolic_range;
+        case 'b': case 'B': case 'h':
+            dest = &tm->tm_mon;
+            min = ABMON_1;
+            range = 12;
+            goto symbolic_range;
+        case 'c':
+            s = strptime(s, nl_langinfo(D_T_FMT), tm);
+            if (!s) return 0;
+            break;
+        case 'C':
+            dest = &century;
+            if (w<0) w=2;
+            want_century |= 2;
+            goto numeric_digits;
+        case 'd': case 'e':
+            dest = &tm->tm_mday;
+            min = 1;
+            range = 31;
+            goto numeric_range;
+        case 'D':
+            s = strptime(s, "%m/%d/%y", tm);
+            if (!s) return 0;
+            break;
+        case 'H':
+            dest = &tm->tm_hour;
+            min = 0;
+            range = 24;
+            goto numeric_range;
+        case 'I':
+            dest = &tm->tm_hour;
+            min = 1;
+            range = 12;
+            goto numeric_range;
+        case 'j':
+            dest = &tm->tm_yday;
+            min = 1;
+            range = 366;
+            goto numeric_range;
+        case 'm':
+            dest = &tm->tm_mon;
+            min = 1;
+            range = 12;
+            adj = 1;
+            goto numeric_range;
+        case 'M':
+            dest = &tm->tm_min;
+            min = 0;
+            range = 60;
+            goto numeric_range;
+        case 'n': case 't':
+            for (; *s && isspace(*s); s++);
+            break;
+        case 'p':
+            ex = nl_langinfo(AM_STR);
+            len = strlen(ex);
+            if (!strncasecmp(s, ex, len)) {
+                tm->tm_hour %= 12;
+                break;
+            }
+            ex = nl_langinfo(PM_STR);
+            len = strlen(ex);
+            if (!strncasecmp(s, ex, len)) {
+                tm->tm_hour %= 12;
+                tm->tm_hour += 12;
+                break;
+            }
+            return 0;
+        case 'r':
+            s = strptime(s, nl_langinfo(T_FMT_AMPM), tm);
+            if (!s) return 0;
+            break;
+        case 'R':
+            s = strptime(s, "%H:%M", tm);
+            if (!s) return 0;
+            break;
+        case 'S':
+            dest = &tm->tm_sec;
+            min = 0;
+            range = 61;
+            goto numeric_range;
+        case 'T':
+            s = strptime(s, "%H:%M:%S", tm);
+            if (!s) return 0;
+            break;
+        case 'U':
+        case 'W':
+            /* Throw away result, for now. (FIXME?) */
+            dest = &dummy;
+            min = 0;
+            range = 54;
+            goto numeric_range;
+        case 'w':
+            dest = &tm->tm_wday;
+            min = 0;
+            range = 7;
+            goto numeric_range;
+        case 'x':
+            s = strptime(s, nl_langinfo(D_FMT), tm);
+            if (!s) return 0;
+            break;
+        case 'X':
+            s = strptime(s, nl_langinfo(T_FMT), tm);
+            if (!s) return 0;
+            break;
+        case 'y':
+            dest = &tm->tm_year;
+            w = 2;
+            want_century |= 1;
+            goto numeric_digits;
+        case 'Y':
+            dest = &tm->tm_year;
+            if (w<0) w=4;
+            adj = 1900;
+            want_century = 0;
+            goto numeric_digits;
+        case '%':
+            if (*s++ != '%') return 0;
+            break;
+        default:
+            return 0;
+        numeric_range:
+            if (!isdigit(*s)) return 0;
+            *dest = 0;
+            for (i=1; i<=min+range && isdigit(*s); i*=10)
+                *dest = *dest * 10 + *s++ - '0';
+            if (*dest - min >= (unsigned)range) return 0;
+            *dest -= adj;
+            switch((char *)dest - (char *)tm) {
+            case offsetof(struct tm, tm_yday):
+                ;
+            }
+            goto update;
+        numeric_digits:
+            neg = 0;
+            if (*s == '+') s++;
+            else if (*s == '-') neg=1, s++;
+            if (!isdigit(*s)) return 0;
+            for (*dest=i=0; i<w && isdigit(*s); i++)
+                *dest = *dest * 10 + *s++ - '0';
+            if (neg) *dest = -*dest;
+            *dest -= adj;
+            goto update;
+        symbolic_range:
+            for (i=2*range-1; i>=0; i--) {
+                ex = nl_langinfo(min+i);
+                len = strlen(ex);
+                if (strncasecmp(s, ex, len)) continue;
+                s += len;
+                *dest = i % range;
+                break;
+            }
+            if (i<0) return 0;
+            goto update;
+        update:
+            //FIXME
+            ;
+        }
+    }
+    if (want_century) {
+        if (want_century & 2) tm->tm_year += century * 100 - 1900;
+        else if (tm->tm_year <= 68) tm->tm_year += 100;
+    }
+    return (char *)s;
+}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/struct_cookie/index.html b/ltapi/struct_cookie/index.html new file mode 100644 index 000000000..aa7e173ea --- /dev/null +++ b/ltapi/struct_cookie/index.html @@ -0,0 +1,2502 @@ + + + + + + + + + + + + + + + + + + + + Struct Cookie - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

Struct Cookie

+

ClassList > Cookie

+

Public Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
time_tdate = = 0
Stringdomain
time_tduration = = 0
struct Cookie::@2expires
Stringhost
boolhttp_only = = false
struct Cookie::@3max_age
Stringname
Stringpath = = ""
boolsecure = = false
boolvalid = = false
Stringvalue
+

Public Attributes Documentation

+

variable date

+
time_t Cookie::date;
+
+

variable domain

+
String Cookie::domain;
+
+

variable duration

+
time_t Cookie::duration;
+
+

variable expires

+
struct Cookie::@2 Cookie::expires;
+
+

variable host

+
String Cookie::host;
+
+

variable http_only

+
bool Cookie::http_only;
+
+

variable max_age

+
struct Cookie::@3 Cookie::max_age;
+
+

variable name

+
String Cookie::name;
+
+

variable path

+
String Cookie::path;
+
+

variable secure

+
bool Cookie::secure;
+
+

variable valid

+
bool Cookie::valid;
+
+

variable value

+
String Cookie::value;
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/HTTPClient/HTTPClient.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/struct_event_handler__s/index.html b/ltapi/struct_event_handler__s/index.html new file mode 100644 index 000000000..3a26a5b82 --- /dev/null +++ b/ltapi/struct_event_handler__s/index.html @@ -0,0 +1,2496 @@ + + + + + + + + + + + + + + + + + + + + Struct EventHandler\_s - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

Struct EventHandler_s

+

ClassList > EventHandler_s

+

Public Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
EventCbcb
EventIdeventId
EventFuncCbfcb
uint16_tid
EventSysCbscb
+

Public Static Attributes

+ + + + + + + + + + + + + +
TypeName
uint16_tlastId = = 1
+

Public Functions

+ + + + + + + + + + + + + +
TypeName
EventHandler_s ()
+

Public Attributes Documentation

+

variable cb

+
EventCb EventHandler_s::cb;
+
+

variable eventId

+
EventId EventHandler_s::eventId;
+
+

variable fcb

+
EventFuncCb EventHandler_s::fcb;
+
+

variable id

+
uint16_t EventHandler_s::id;
+
+

variable scb

+
EventSysCb EventHandler_s::scb;
+
+

Public Static Attributes Documentation

+

variable lastId

+
uint16_t EventHandler_s::lastId;
+
+

Public Functions Documentation

+

function EventHandler_s

+
inline EventHandler_s::EventHandler_s () 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/src/Events.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/struct_h_t_t_p_client_1_1_request_argument/index.html b/ltapi/struct_h_t_t_p_client_1_1_request_argument/index.html new file mode 100644 index 000000000..9129da1ff --- /dev/null +++ b/ltapi/struct_h_t_t_p_client_1_1_request_argument/index.html @@ -0,0 +1,2362 @@ + + + + + + + + + + + + + + + + + + + + Struct HTTPClient::RequestArgument - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct HTTPClient::RequestArgument

+

ClassList > HTTPClient > RequestArgument

+

Public Attributes

+ + + + + + + + + + + + + + + + + +
TypeName
Stringkey
Stringvalue
+

Public Attributes Documentation

+

variable key

+
String HTTPClient::RequestArgument::key;
+
+

variable value

+
String HTTPClient::RequestArgument::value;
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/HTTPClient/HTTPClient.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/struct_h_t_t_p_upload/index.html b/ltapi/struct_h_t_t_p_upload/index.html new file mode 100644 index 000000000..25b27d741 --- /dev/null +++ b/ltapi/struct_h_t_t_p_upload/index.html @@ -0,0 +1,2432 @@ + + + + + + + + + + + + + + + + + + + + Struct HTTPUpload - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct HTTPUpload

+

ClassList > HTTPUpload

+

Public Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
uint8_tbuf
size_tcurrentSize
Stringfilename
Stringname
HTTPUploadStatusstatus
size_ttotalSize
Stringtype
+

Public Attributes Documentation

+

variable buf

+
uint8_t HTTPUpload::buf[HTTP_UPLOAD_BUFLEN];
+
+

variable currentSize

+
size_t HTTPUpload::currentSize;
+
+

variable filename

+
String HTTPUpload::filename;
+
+

variable name

+
String HTTPUpload::name;
+
+

variable status

+
HTTPUploadStatus HTTPUpload::status;
+
+

variable totalSize

+
size_t HTTPUpload::totalSize;
+
+

variable type

+
String HTTPUpload::type;
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/WebServer.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/struct_m_d5_context/index.html b/ltapi/struct_m_d5_context/index.html new file mode 100644 index 000000000..f3cade2f0 --- /dev/null +++ b/ltapi/struct_m_d5_context/index.html @@ -0,0 +1,2376 @@ + + + + + + + + + + + + + + + + + + + + Struct MD5Context - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct MD5Context

+

ClassList > MD5Context

+

Public Attributes

+ + + + + + + + + + + + + + + + + + + + + +
TypeName
unsigned longbits
unsigned longbuf
unsigned charin
+

Public Attributes Documentation

+

variable bits

+
unsigned long MD5Context::bits[2];
+
+

variable buf

+
unsigned long MD5Context::buf[4];
+
+

variable in

+
unsigned char MD5Context::in[64];
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/MD5/MD5HostapdImpl.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/struct_pin_info/index.html b/ltapi/struct_pin_info/index.html new file mode 100644 index 000000000..77e13c415 --- /dev/null +++ b/ltapi/struct_pin_info/index.html @@ -0,0 +1,2390 @@ + + + + + + + + + + + + + + + + + + + + Struct PinInfo - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct PinInfo

+

ClassList > PinInfo

+

Public Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
PinData *data
Pin data (direction, IRQ level, etc.). The structure is family-specific.
uint32_tenabled
Enabled pin functions. Used values are family-specific.
uint32_tgpio
GPIO name in the family SDK.
uint32_tsupported
Supported pin functions.
+

Public Attributes Documentation

+

variable data

+
PinData* PinInfo::data;
+
+

variable enabled

+
uint32_t PinInfo::enabled;
+
+

variable gpio

+
uint32_t PinInfo::gpio;
+
+

variable supported

+
uint32_t PinInfo::supported;
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/src/wiring/wiring_custom.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/struct_soft_data/index.html b/ltapi/struct_soft_data/index.html new file mode 100644 index 000000000..9cb3ebfab --- /dev/null +++ b/ltapi/struct_soft_data/index.html @@ -0,0 +1,2404 @@ + + + + + + + + + + + + + + + + + + + + Struct SoftData - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct SoftData

+

ClassList > SoftData

+

Public Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
RingBuffer *buf
uint8_tbyte
void *param
pin_size_tpin
SoftStatestate
+

Public Attributes Documentation

+

variable buf

+
RingBuffer* SoftData::buf;
+
+

variable byte

+
uint8_t SoftData::byte;
+
+

variable param

+
void* SoftData::param;
+
+

variable pin

+
pin_size_t SoftData::pin;
+
+

variable state

+
SoftState SoftData::state;
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/SoftwareSerial/SoftwareSerial.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/struct_soft_serial/index.html b/ltapi/struct_soft_serial/index.html new file mode 100644 index 000000000..2028c300e --- /dev/null +++ b/ltapi/struct_soft_serial/index.html @@ -0,0 +1,2390 @@ + + + + + + + + + + + + + + + + + + + + Struct SoftSerial - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct SoftSerial

+

ClassList > SoftSerial

+

Public Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
uint8_tinvert
void *param
SoftDatarx
SoftDatatx
+

Public Attributes Documentation

+

variable invert

+
uint8_t SoftSerial::invert;
+
+

variable param

+
void* SoftSerial::param;
+
+

variable rx

+
SoftData SoftSerial::rx;
+
+

variable tx

+
SoftData SoftSerial::tx;
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/SoftwareSerial/SoftwareSerial.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/struct_web_server_1_1_request_argument/index.html b/ltapi/struct_web_server_1_1_request_argument/index.html new file mode 100644 index 000000000..8526b8712 --- /dev/null +++ b/ltapi/struct_web_server_1_1_request_argument/index.html @@ -0,0 +1,2362 @@ + + + + + + + + + + + + + + + + + + + + Struct WebServer::RequestArgument - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct WebServer::RequestArgument

+

ClassList > WebServer > RequestArgument

+

Public Attributes

+ + + + + + + + + + + + + + + + + +
TypeName
Stringkey
Stringvalue
+

Public Attributes Documentation

+

variable key

+
String WebServer::RequestArgument::key;
+
+

variable value

+
String WebServer::RequestArgument::value;
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/WebServer.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/struct_wi_fi_mac_addr/index.html b/ltapi/struct_wi_fi_mac_addr/index.html new file mode 100644 index 000000000..9daa7d2b8 --- /dev/null +++ b/ltapi/struct_wi_fi_mac_addr/index.html @@ -0,0 +1,2348 @@ + + + + + + + + + + + + + + + + + + + + Struct WiFiMacAddr - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct WiFiMacAddr

+

ClassList > WiFiMacAddr

+

Public Attributes

+ + + + + + + + + + + + + +
TypeName
uint8_taddr
+

Public Attributes Documentation

+

variable addr

+
uint8_t WiFiMacAddr::addr[6];
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiType.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/struct_wi_fi_network_info/index.html b/ltapi/struct_wi_fi_network_info/index.html new file mode 100644 index 000000000..4dc08fe23 --- /dev/null +++ b/ltapi/struct_wi_fi_network_info/index.html @@ -0,0 +1,2488 @@ + + + + + + + + + + + + + + + + + + + + Struct WiFiNetworkInfo - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+ +
+ + + +
+
+ + + + + + + + +

Struct WiFiNetworkInfo

+

ClassList > WiFiNetworkInfo

+

Public Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
intauth
uint8_t *bssid
intchannel
uint32_tdns1
uint32_tdns2
uint32_tgateway
uint32_tlocalIP
char *password
char *ssid
boolssidHidden
uint32_tsubnet
+

Public Attributes Documentation

+

variable auth

+
int WiFiNetworkInfo::auth;
+
+

variable bssid

+
uint8_t* WiFiNetworkInfo::bssid;
+
+

variable channel

+
int WiFiNetworkInfo::channel;
+
+

variable dns1

+
uint32_t WiFiNetworkInfo::dns1;
+
+

variable dns2

+
uint32_t WiFiNetworkInfo::dns2;
+
+

variable gateway

+
uint32_t WiFiNetworkInfo::gateway;
+
+

variable localIP

+
uint32_t WiFiNetworkInfo::localIP;
+
+

variable password

+
char* WiFiNetworkInfo::password;
+
+

variable ssid

+
char* WiFiNetworkInfo::ssid;
+
+

variable ssidHidden

+
bool WiFiNetworkInfo::ssidHidden;
+
+

variable subnet

+
uint32_t WiFiNetworkInfo::subnet;
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiType.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/struct_wi_fi_scan_a_p/index.html b/ltapi/struct_wi_fi_scan_a_p/index.html new file mode 100644 index 000000000..c978cef03 --- /dev/null +++ b/ltapi/struct_wi_fi_scan_a_p/index.html @@ -0,0 +1,2404 @@ + + + + + + + + + + + + + + + + + + + + Struct WiFiScanAP - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct WiFiScanAP

+

ClassList > WiFiScanAP

+

Public Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
WiFiAuthModeauth
WiFiMacAddrbssid
int32_tchannel
int32_trssi
char *ssid
+

Public Attributes Documentation

+

variable auth

+
WiFiAuthMode WiFiScanAP::auth;
+
+

variable bssid

+
WiFiMacAddr WiFiScanAP::bssid;
+
+

variable channel

+
int32_t WiFiScanAP::channel;
+
+

variable rssi

+
int32_t WiFiScanAP::rssi;
+
+

variable ssid

+
char* WiFiScanAP::ssid;
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiType.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/struct_wi_fi_scan_data/index.html b/ltapi/struct_wi_fi_scan_data/index.html new file mode 100644 index 000000000..1f023105f --- /dev/null +++ b/ltapi/struct_wi_fi_scan_data/index.html @@ -0,0 +1,2390 @@ + + + + + + + + + + + + + + + + + + + + Struct WiFiScanData - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct WiFiScanData

+

ClassList > WiFiScanData

+

Public Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
WiFiScanAP *ap = = NULL
uint8_tcount = = 0
boolrunning = = false
unsigned longtimeout = = 0
+

Public Attributes Documentation

+

variable ap

+
WiFiScanAP* WiFiScanData::ap;
+
+

variable count

+
uint8_t WiFiScanData::count;
+
+

variable running

+
bool WiFiScanData::running;
+
+

variable timeout

+
unsigned long WiFiScanData::timeout;
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiType.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/struct_wifi_a_plist__t/index.html b/ltapi/struct_wifi_a_plist__t/index.html new file mode 100644 index 000000000..c88ecf943 --- /dev/null +++ b/ltapi/struct_wifi_a_plist__t/index.html @@ -0,0 +1,2362 @@ + + + + + + + + + + + + + + + + + + + + Struct WifiAPlist\_t - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct WifiAPlist_t

+

ClassList > WifiAPlist_t

+

Public Attributes

+ + + + + + + + + + + + + + + + + +
TypeName
char *passphrase
char *ssid
+

Public Attributes Documentation

+

variable passphrase

+
char* WifiAPlist_t::passphrase;
+
+

variable ssid

+
char* WifiAPlist_t::ssid;
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WiFiMulti/WiFiMulti.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/structarduino__event__t/index.html b/ltapi/structarduino__event__t/index.html new file mode 100644 index 000000000..97ac2aa87 --- /dev/null +++ b/ltapi/structarduino__event__t/index.html @@ -0,0 +1,2362 @@ + + + + + + + + + + + + + + + + + + + + Struct arduino\_event\_t - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct arduino_event_t

+

ClassList > arduino_event_t

+

Public Attributes

+ + + + + + + + + + + + + + + + + +
TypeName
arduino_event_id_tevent_id
arduino_event_info_tevent_info
+

Public Attributes Documentation

+

variable event_id

+
arduino_event_id_t arduino_event_t::event_id;
+
+

variable event_info

+
arduino_event_info_t arduino_event_t::event_info;
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/src/Events.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/structbase64__decodestate/index.html b/ltapi/structbase64__decodestate/index.html new file mode 100644 index 000000000..9755ac5aa --- /dev/null +++ b/ltapi/structbase64__decodestate/index.html @@ -0,0 +1,2362 @@ + + + + + + + + + + + + + + + + + + + + Struct base64\_decodestate - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct base64_decodestate

+

ClassList > base64_decodestate

+

Public Attributes

+ + + + + + + + + + + + + + + + + +
TypeName
charplainchar
base64_decodestepstep
+

Public Attributes Documentation

+

variable plainchar

+
char base64_decodestate::plainchar;
+
+

variable step

+
base64_decodestep base64_decodestate::step;
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/base64/libb64/cdecode.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/structbase64__encodestate/index.html b/ltapi/structbase64__encodestate/index.html new file mode 100644 index 000000000..2a8de3164 --- /dev/null +++ b/ltapi/structbase64__encodestate/index.html @@ -0,0 +1,2376 @@ + + + + + + + + + + + + + + + + + + + + Struct base64\_encodestate - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct base64_encodestate

+

ClassList > base64_encodestate

+

Public Attributes

+ + + + + + + + + + + + + + + + + + + + + +
TypeName
charresult
base64_encodestepstep
intstepcount
+

Public Attributes Documentation

+

variable result

+
char base64_encodestate::result;
+
+

variable step

+
base64_encodestep base64_encodestate::step;
+
+

variable stepcount

+
int base64_encodestate::stepcount;
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/base64/libb64/cencode.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/structesp__ip4__addr/index.html b/ltapi/structesp__ip4__addr/index.html new file mode 100644 index 000000000..51374fa42 --- /dev/null +++ b/ltapi/structesp__ip4__addr/index.html @@ -0,0 +1,2348 @@ + + + + + + + + + + + + + + + + + + + + Struct esp\_ip4\_addr - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct esp_ip4_addr

+

ClassList > esp_ip4_addr

+

Public Attributes

+ + + + + + + + + + + + + +
TypeName
uint32_taddr
+

Public Attributes Documentation

+

variable addr

+
uint32_t esp_ip4_addr::addr;
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiType.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/structesp__ip6__addr/index.html b/ltapi/structesp__ip6__addr/index.html new file mode 100644 index 000000000..a894316da --- /dev/null +++ b/ltapi/structesp__ip6__addr/index.html @@ -0,0 +1,2362 @@ + + + + + + + + + + + + + + + + + + + + Struct esp\_ip6\_addr - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct esp_ip6_addr

+

ClassList > esp_ip6_addr

+

Public Attributes

+ + + + + + + + + + + + + + + + + +
TypeName
uint32_taddr
uint8_tzone
+

Public Attributes Documentation

+

variable addr

+
uint32_t esp_ip6_addr::addr[4];
+
+

variable zone

+
uint8_t esp_ip6_addr::zone;
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiType.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/structesp__netif__ip6__info__t/index.html b/ltapi/structesp__netif__ip6__info__t/index.html new file mode 100644 index 000000000..16883b073 --- /dev/null +++ b/ltapi/structesp__netif__ip6__info__t/index.html @@ -0,0 +1,2353 @@ + + + + + + + + + + + + + + + + + + + + Struct esp\_netif\_ip6\_info\_t - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct esp_netif_ip6_info_t

+

ClassList > esp_netif_ip6_info_t

+

IPV6 IP address information.

+
    +
  • #include <WiFiEvents.h>
  • +
+

Public Attributes

+ + + + + + + + + + + + + +
TypeName
esp_ip6_addr_tip
+

Public Attributes Documentation

+

variable ip

+
esp_ip6_addr_t esp_netif_ip6_info_t::ip;
+
+

Interface IPV6 address

+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/structesp__netif__ip__info__t/index.html b/ltapi/structesp__netif__ip__info__t/index.html new file mode 100644 index 000000000..75bbaffb1 --- /dev/null +++ b/ltapi/structesp__netif__ip__info__t/index.html @@ -0,0 +1,2351 @@ + + + + + + + + + + + + + + + + + + + + Struct esp\_netif\_ip\_info\_t - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct esp_netif_ip_info_t

+

ClassList > esp_netif_ip_info_t

+

More...

+
    +
  • #include <WiFiEvents.h>
  • +
+

Public Attributes

+ + + + + + + + + + + + + + + + + + + + + +
TypeName
esp_ip4_addr_tgw
esp_ip4_addr_tip
esp_ip4_addr_tnetmask
+

Detailed Description

+

Event structure for IP_EVENT_STA_GOT_IP, IP_EVENT_ETH_GOT_IP events

+

Public Attributes Documentation

+

variable gw

+
esp_ip4_addr_t esp_netif_ip_info_t::gw;
+
+

Interface IPV4 gateway address

+

variable ip

+
esp_ip4_addr_t esp_netif_ip_info_t::ip;
+
+

Interface IPV4 address

+

variable netmask

+
esp_ip4_addr_t esp_netif_ip_info_t::netmask;
+
+

Interface IPV4 netmask

+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/structip__event__ap__staipassigned__t/index.html b/ltapi/structip__event__ap__staipassigned__t/index.html new file mode 100644 index 000000000..279a2737c --- /dev/null +++ b/ltapi/structip__event__ap__staipassigned__t/index.html @@ -0,0 +1,2335 @@ + + + + + + + + + + + + + + + + + + + + Struct ip\_event\_ap\_staipassigned\_t - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct ip_event_ap_staipassigned_t

+

ClassList > ip_event_ap_staipassigned_t

+

More...

+
    +
  • #include <WiFiEvents.h>
  • +
+

Public Attributes

+ + + + + + + + + + + + + +
TypeName
esp_ip4_addr_tip
+

Detailed Description

+

Event structure for IP_EVENT_AP_STAIPASSIGNED event

+

Public Attributes Documentation

+

variable ip

+
esp_ip4_addr_t ip_event_ap_staipassigned_t::ip;
+
+

IP address which was assigned to the station

+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/structip__event__got__ip6__t/index.html b/ltapi/structip__event__got__ip6__t/index.html new file mode 100644 index 000000000..55961b7c5 --- /dev/null +++ b/ltapi/structip__event__got__ip6__t/index.html @@ -0,0 +1,2359 @@ + + + + + + + + + + + + + + + + + + + + Struct ip\_event\_got\_ip6\_t - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct ip_event_got_ip6_t

+

ClassList > ip_event_got_ip6_t

+

More...

+
    +
  • #include <WiFiEvents.h>
  • +
+

Public Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
void *esp_netif
intif_index
esp_netif_ip6_info_tip6_info
intip_index
+

Detailed Description

+

Event structure for IP_EVENT_GOT_IP6 event

+

Public Attributes Documentation

+

variable esp_netif

+
void* ip_event_got_ip6_t::esp_netif;
+
+

Pointer to corresponding esp-netif object

+

variable if_index

+
int ip_event_got_ip6_t::if_index;
+
+

Interface index for which the event is received (left for legacy compilation)

+

variable ip6_info

+
esp_netif_ip6_info_t ip_event_got_ip6_t::ip6_info;
+
+

IPv6 address of the interface

+

variable ip_index

+
int ip_event_got_ip6_t::ip_index;
+
+

IPv6 address index

+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/structip__event__got__ip__t/index.html b/ltapi/structip__event__got__ip__t/index.html new file mode 100644 index 000000000..b98a35683 --- /dev/null +++ b/ltapi/structip__event__got__ip__t/index.html @@ -0,0 +1,2394 @@ + + + + + + + + + + + + + + + + + + + + Struct ip\_event\_got\_ip\_t - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct ip_event_got_ip_t

+

ClassList > ip_event_got_ip_t

+

Public Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
void *esp_netif
intif_index
boolip_changed
esp_netif_ip_info_tip_info
+

Public Attributes Documentation

+

variable esp_netif

+
void* ip_event_got_ip_t::esp_netif;
+
+

Pointer to corresponding esp-netif object

+

variable if_index

+
int ip_event_got_ip_t::if_index;
+
+

Interface index for which the event is received (left for legacy compilation)

+

variable ip_changed

+
bool ip_event_got_ip_t::ip_changed;
+
+

Whether the assigned IP has changed or not

+

variable ip_info

+
esp_netif_ip_info_t ip_event_got_ip_t::ip_info;
+
+

IP address, netmask, gatway IP address

+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/structlt__flash__id__t/index.html b/ltapi/structlt__flash__id__t/index.html new file mode 100644 index 000000000..9afbbf672 --- /dev/null +++ b/ltapi/structlt__flash__id__t/index.html @@ -0,0 +1,2380 @@ + + + + + + + + + + + + + + + + + + + + Struct lt\_flash\_id\_t - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct lt_flash_id_t

+

ClassList > lt_flash_id_t

+

Flash chip ID structure.

+
    +
  • #include <lt_flash.h>
  • +
+

Public Attributes

+ + + + + + + + + + + + + + + + + + + + + +
TypeName
uint8_tchip_id
uint8_tchip_size_id
uint8_tmanufacturer_id
+

Public Attributes Documentation

+

variable chip_id

+
uint8_t lt_flash_id_t::chip_id;
+
+

variable chip_size_id

+
uint8_t lt_flash_id_t::chip_size_id;
+
+

variable manufacturer_id

+
uint8_t lt_flash_id_t::manufacturer_id;
+
+
+

The documentation for this class was generated from the following file cores/common/base/api/lt_flash.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/structlt__ota__ctx__t/index.html b/ltapi/structlt__ota__ctx__t/index.html new file mode 100644 index 000000000..2f0234f76 --- /dev/null +++ b/ltapi/structlt__ota__ctx__t/index.html @@ -0,0 +1,2478 @@ + + + + + + + + + + + + + + + + + + + + Struct lt\_ota\_ctx\_t - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

Struct lt_ota_ctx_t

+

ClassList > lt_ota_ctx_t

+

OTA update process context.

+
    +
  • #include <lt_ota.h>
  • +
+

Public Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
uint8_tbuf
uint8_t *buf_pos
uint32_tbytes_total
uint32_tbytes_written
void(*callback
void *callback_param
uf2_err_terror
uf2_info_tinfo
boolrunning
uf2_ota_tuf2
+

Public Attributes Documentation

+

variable buf

+
uint8_t lt_ota_ctx_t::buf[UF2_BLOCK_SIZE];
+
+

variable buf_pos

+
uint8_t* lt_ota_ctx_t::buf_pos;
+
+

variable bytes_total

+
uint32_t lt_ota_ctx_t::bytes_total;
+
+

variable bytes_written

+
uint32_t lt_ota_ctx_t::bytes_written;
+
+

variable callback

+
void(* lt_ota_ctx_t::callback) (void *param);
+
+

variable callback_param

+
void* lt_ota_ctx_t::callback_param;
+
+

variable error

+
uf2_err_t lt_ota_ctx_t::error;
+
+

variable info

+
uf2_info_t lt_ota_ctx_t::info;
+
+

variable running

+
bool lt_ota_ctx_t::running;
+
+

variable uf2

+
uf2_ota_t lt_ota_ctx_t::uf2;
+
+
+

The documentation for this class was generated from the following file cores/common/base/api/lt_ota.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/structmbedtls__md5__context/index.html b/ltapi/structmbedtls__md5__context/index.html new file mode 100644 index 000000000..9408f6d3c --- /dev/null +++ b/ltapi/structmbedtls__md5__context/index.html @@ -0,0 +1,2379 @@ + + + + + + + + + + + + + + + + + + + + Struct mbedtls\_md5\_context - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct mbedtls_md5_context

+

ClassList > mbedtls_md5_context

+

Public Attributes

+ + + + + + + + + + + + + + + + + + + + + +
TypeName
unsigned charbuffer
unsigned longstate
unsigned longtotal
+

Public Attributes Documentation

+

variable buffer

+
unsigned char mbedtls_md5_context::buffer[64];
+
+

data block being processed

+

variable state

+
unsigned long mbedtls_md5_context::state[4];
+
+

intermediate digest state

+

variable total

+
unsigned long mbedtls_md5_context::total[2];
+
+

number of bytes processed

+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/MD5/MD5MbedTLSImpl.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/structmime_1_1_entry/index.html b/ltapi/structmime_1_1_entry/index.html new file mode 100644 index 000000000..a7d6d44fe --- /dev/null +++ b/ltapi/structmime_1_1_entry/index.html @@ -0,0 +1,2362 @@ + + + + + + + + + + + + + + + + + + + + Struct mime::Entry - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct mime::Entry

+

ClassList > mime > Entry

+

Public Attributes

+ + + + + + + + + + + + + + + + + +
TypeName
const charendsWith
const charmimeType
+

Public Attributes Documentation

+

variable endsWith

+
const char mime::Entry::endsWith[16];
+
+

variable mimeType

+
const char mime::Entry::mimeType[32];
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/detail/mimetable.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/structwifi__event__action__tx__status__t/index.html b/ltapi/structwifi__event__action__tx__status__t/index.html new file mode 100644 index 000000000..14953344e --- /dev/null +++ b/ltapi/structwifi__event__action__tx__status__t/index.html @@ -0,0 +1,2359 @@ + + + + + + + + + + + + + + + + + + + + Struct wifi\_event\_action\_tx\_status\_t - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct wifi_event_action_tx_status_t

+

ClassList > wifi_event_action_tx_status_t

+

More...

+
    +
  • #include <WiFiEvents.h>
  • +
+

Public Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
uint32_tcontext
uint8_tda
intifx
uint8_tstatus
+

Detailed Description

+

Argument structure for WIFI_EVENT_ACTION_TX_STATUS event

+

Public Attributes Documentation

+

variable context

+
uint32_t wifi_event_action_tx_status_t::context;
+
+

Context to identify the request

+

variable da

+
uint8_t wifi_event_action_tx_status_t::da[6];
+
+

Destination MAC address

+

variable ifx

+
int wifi_event_action_tx_status_t::ifx;
+
+

WiFi interface to send request to

+

variable status

+
uint8_t wifi_event_action_tx_status_t::status;
+
+

Status of the operation

+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/structwifi__event__ap__probe__req__rx__t/index.html b/ltapi/structwifi__event__ap__probe__req__rx__t/index.html new file mode 100644 index 000000000..3a669c539 --- /dev/null +++ b/ltapi/structwifi__event__ap__probe__req__rx__t/index.html @@ -0,0 +1,2343 @@ + + + + + + + + + + + + + + + + + + + + Struct wifi\_event\_ap\_probe\_req\_rx\_t - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct wifi_event_ap_probe_req_rx_t

+

ClassList > wifi_event_ap_probe_req_rx_t

+

More...

+
    +
  • #include <WiFiEvents.h>
  • +
+

Public Attributes

+ + + + + + + + + + + + + + + + + +
TypeName
uint8_tmac
intrssi
+

Detailed Description

+

Argument structure for WIFI_EVENT_AP_PROBEREQRECVED event

+

Public Attributes Documentation

+

variable mac

+
uint8_t wifi_event_ap_probe_req_rx_t::mac[6];
+
+

MAC address of the station which send probe request

+

variable rssi

+
int wifi_event_ap_probe_req_rx_t::rssi;
+
+

Received probe request signal strength

+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/structwifi__event__ap__staconnected__t/index.html b/ltapi/structwifi__event__ap__staconnected__t/index.html new file mode 100644 index 000000000..f008e9e06 --- /dev/null +++ b/ltapi/structwifi__event__ap__staconnected__t/index.html @@ -0,0 +1,2351 @@ + + + + + + + + + + + + + + + + + + + + Struct wifi\_event\_ap\_staconnected\_t - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct wifi_event_ap_staconnected_t

+

ClassList > wifi_event_ap_staconnected_t

+

More...

+
    +
  • #include <WiFiEvents.h>
  • +
+

Public Attributes

+ + + + + + + + + + + + + + + + + + + + + +
TypeName
uint8_taid
boolis_mesh_child
uint8_tmac
+

Detailed Description

+

Argument structure for WIFI_EVENT_AP_STACONNECTED event

+

Public Attributes Documentation

+

variable aid

+
uint8_t wifi_event_ap_staconnected_t::aid;
+
+

the aid that ESP32 soft-AP gives to the station connected to

+

variable is_mesh_child

+
bool wifi_event_ap_staconnected_t::is_mesh_child;
+
+

flag to identify mesh child

+

variable mac

+
uint8_t wifi_event_ap_staconnected_t::mac[6];
+
+

MAC address of the station connected to ESP32 soft-AP

+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/structwifi__event__ap__stadisconnected__t/index.html b/ltapi/structwifi__event__ap__stadisconnected__t/index.html new file mode 100644 index 000000000..9bbe4fb51 --- /dev/null +++ b/ltapi/structwifi__event__ap__stadisconnected__t/index.html @@ -0,0 +1,2351 @@ + + + + + + + + + + + + + + + + + + + + Struct wifi\_event\_ap\_stadisconnected\_t - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct wifi_event_ap_stadisconnected_t

+

ClassList > wifi_event_ap_stadisconnected_t

+

More...

+
    +
  • #include <WiFiEvents.h>
  • +
+

Public Attributes

+ + + + + + + + + + + + + + + + + + + + + +
TypeName
uint8_taid
boolis_mesh_child
uint8_tmac
+

Detailed Description

+

Argument structure for WIFI_EVENT_AP_STADISCONNECTED event

+

Public Attributes Documentation

+

variable aid

+
uint8_t wifi_event_ap_stadisconnected_t::aid;
+
+

the aid that ESP32 soft-AP gave to the station disconnects to

+

variable is_mesh_child

+
bool wifi_event_ap_stadisconnected_t::is_mesh_child;
+
+

flag to identify mesh child

+

variable mac

+
uint8_t wifi_event_ap_stadisconnected_t::mac[6];
+
+

MAC address of the station disconnects to ESP32 soft-AP

+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/structwifi__event__ftm__report__t/index.html b/ltapi/structwifi__event__ftm__report__t/index.html new file mode 100644 index 000000000..bfac7a163 --- /dev/null +++ b/ltapi/structwifi__event__ftm__report__t/index.html @@ -0,0 +1,2383 @@ + + + + + + + + + + + + + + + + + + + + Struct wifi\_event\_ftm\_report\_t - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct wifi_event_ftm_report_t

+

ClassList > wifi_event_ftm_report_t

+

More...

+
    +
  • #include <WiFiEvents.h>
  • +
+

Public Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
uint32_tdist_est
wifi_ftm_report_entry_t *ftm_report_data
uint8_tftm_report_num_entries
uint8_tpeer_mac
uint32_trtt_est
uint32_trtt_raw
wifi_ftm_status_tstatus
+

Detailed Description

+

Argument structure for WIFI_EVENT_FTM_REPORT event

+

Public Attributes Documentation

+

variable dist_est

+
uint32_t wifi_event_ftm_report_t::dist_est;
+
+

Estimated one-way distance in Centi-Meters

+

variable ftm_report_data

+
wifi_ftm_report_entry_t* wifi_event_ftm_report_t::ftm_report_data;
+
+

Pointer to FTM Report with multiple entries, should be freed after use

+

variable ftm_report_num_entries

+
uint8_t wifi_event_ftm_report_t::ftm_report_num_entries;
+
+

Number of entries in the FTM Report data

+

variable peer_mac

+
uint8_t wifi_event_ftm_report_t::peer_mac[6];
+
+

MAC address of the FTM Peer

+

variable rtt_est

+
uint32_t wifi_event_ftm_report_t::rtt_est;
+
+

Estimated Round-Trip-Time with peer in Nano-Seconds

+

variable rtt_raw

+
uint32_t wifi_event_ftm_report_t::rtt_raw;
+
+

Raw average Round-Trip-Time with peer in Nano-Seconds

+

variable status

+
wifi_ftm_status_t wifi_event_ftm_report_t::status;
+
+

Status of the FTM operation

+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/structwifi__event__roc__done__t/index.html b/ltapi/structwifi__event__roc__done__t/index.html new file mode 100644 index 000000000..a80897610 --- /dev/null +++ b/ltapi/structwifi__event__roc__done__t/index.html @@ -0,0 +1,2335 @@ + + + + + + + + + + + + + + + + + + + + Struct wifi\_event\_roc\_done\_t - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct wifi_event_roc_done_t

+

ClassList > wifi_event_roc_done_t

+

More...

+
    +
  • #include <WiFiEvents.h>
  • +
+

Public Attributes

+ + + + + + + + + + + + + +
TypeName
uint32_tcontext
+

Detailed Description

+

Argument structure for WIFI_EVENT_ROC_DONE event

+

Public Attributes Documentation

+

variable context

+
uint32_t wifi_event_roc_done_t::context;
+
+

Context to identify the request

+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/structwifi__event__sta__authmode__change__t/index.html b/ltapi/structwifi__event__sta__authmode__change__t/index.html new file mode 100644 index 000000000..650d80f6d --- /dev/null +++ b/ltapi/structwifi__event__sta__authmode__change__t/index.html @@ -0,0 +1,2343 @@ + + + + + + + + + + + + + + + + + + + + Struct wifi\_event\_sta\_authmode\_change\_t - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct wifi_event_sta_authmode_change_t

+

ClassList > wifi_event_sta_authmode_change_t

+

More...

+
    +
  • #include <WiFiEvents.h>
  • +
+

Public Attributes

+ + + + + + + + + + + + + + + + + +
TypeName
wifi_auth_mode_tnew_mode
wifi_auth_mode_told_mode
+

Detailed Description

+

Argument structure for WIFI_EVENT_STA_AUTHMODE_CHANGE event

+

Public Attributes Documentation

+

variable new_mode

+
wifi_auth_mode_t wifi_event_sta_authmode_change_t::new_mode;
+
+

the new auth mode of AP

+

variable old_mode

+
wifi_auth_mode_t wifi_event_sta_authmode_change_t::old_mode;
+
+

the old auth mode of AP

+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/structwifi__event__sta__connected__t/index.html b/ltapi/structwifi__event__sta__connected__t/index.html new file mode 100644 index 000000000..2dc0bcc5b --- /dev/null +++ b/ltapi/structwifi__event__sta__connected__t/index.html @@ -0,0 +1,2367 @@ + + + + + + + + + + + + + + + + + + + + Struct wifi\_event\_sta\_connected\_t - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct wifi_event_sta_connected_t

+

ClassList > wifi_event_sta_connected_t

+

More...

+
    +
  • #include <WiFiEvents.h>
  • +
+

Public Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
wifi_auth_mode_tauthmode
uint8_tbssid
uint8_tchannel
uint8_tssid
uint8_tssid_len
+

Detailed Description

+

Argument structure for WIFI_EVENT_STA_CONNECTED event

+

Public Attributes Documentation

+

variable authmode

+
wifi_auth_mode_t wifi_event_sta_connected_t::authmode;
+
+

authentication mode used by AP

+

variable bssid

+
uint8_t wifi_event_sta_connected_t::bssid[6];
+
+

BSSID of connected AP

+

variable channel

+
uint8_t wifi_event_sta_connected_t::channel;
+
+

channel of connected AP

+

variable ssid

+
uint8_t wifi_event_sta_connected_t::ssid[32];
+
+

SSID of connected AP

+

variable ssid_len

+
uint8_t wifi_event_sta_connected_t::ssid_len;
+
+

SSID length of connected AP

+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/structwifi__event__sta__disconnected__t/index.html b/ltapi/structwifi__event__sta__disconnected__t/index.html new file mode 100644 index 000000000..03b679800 --- /dev/null +++ b/ltapi/structwifi__event__sta__disconnected__t/index.html @@ -0,0 +1,2359 @@ + + + + + + + + + + + + + + + + + + + + Struct wifi\_event\_sta\_disconnected\_t - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct wifi_event_sta_disconnected_t

+

ClassList > wifi_event_sta_disconnected_t

+

More...

+
    +
  • #include <WiFiEvents.h>
  • +
+

Public Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
uint8_tbssid
uint8_treason
uint8_tssid
uint8_tssid_len
+

Detailed Description

+

Argument structure for WIFI_EVENT_STA_DISCONNECTED event

+

Public Attributes Documentation

+

variable bssid

+
uint8_t wifi_event_sta_disconnected_t::bssid[6];
+
+

BSSID of disconnected AP

+

variable reason

+
uint8_t wifi_event_sta_disconnected_t::reason;
+
+

reason of disconnection

+

variable ssid

+
uint8_t wifi_event_sta_disconnected_t::ssid[32];
+
+

SSID of disconnected AP

+

variable ssid_len

+
uint8_t wifi_event_sta_disconnected_t::ssid_len;
+
+

SSID length of disconnected AP

+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/structwifi__event__sta__scan__done__t/index.html b/ltapi/structwifi__event__sta__scan__done__t/index.html new file mode 100644 index 000000000..6fe4a0ab9 --- /dev/null +++ b/ltapi/structwifi__event__sta__scan__done__t/index.html @@ -0,0 +1,2351 @@ + + + + + + + + + + + + + + + + + + + + Struct wifi\_event\_sta\_scan\_done\_t - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct wifi_event_sta_scan_done_t

+

ClassList > wifi_event_sta_scan_done_t

+

More...

+
    +
  • #include <WiFiEvents.h>
  • +
+

Public Attributes

+ + + + + + + + + + + + + + + + + + + + + +
TypeName
uint8_tnumber
uint8_tscan_id
uint32_tstatus
+

Detailed Description

+

Argument structure for WIFI_EVENT_SCAN_DONE event

+

Public Attributes Documentation

+

variable number

+
uint8_t wifi_event_sta_scan_done_t::number;
+
+

number of scan results

+

variable scan_id

+
uint8_t wifi_event_sta_scan_done_t::scan_id;
+
+

scan sequence number, used for block scan

+

variable status

+
uint32_t wifi_event_sta_scan_done_t::status;
+
+

status of scanning APs: 0 - success, 1 - failure

+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/structwifi__event__sta__wps__er__pin__t/index.html b/ltapi/structwifi__event__sta__wps__er__pin__t/index.html new file mode 100644 index 000000000..4b87c1d17 --- /dev/null +++ b/ltapi/structwifi__event__sta__wps__er__pin__t/index.html @@ -0,0 +1,2335 @@ + + + + + + + + + + + + + + + + + + + + Struct wifi\_event\_sta\_wps\_er\_pin\_t - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct wifi_event_sta_wps_er_pin_t

+

ClassList > wifi_event_sta_wps_er_pin_t

+

More...

+
    +
  • #include <WiFiEvents.h>
  • +
+

Public Attributes

+ + + + + + + + + + + + + +
TypeName
uint8_tpin_code
+

Detailed Description

+

Argument structure for WIFI_EVENT_STA_WPS_ER_PIN event

+

Public Attributes Documentation

+

variable pin_code

+
uint8_t wifi_event_sta_wps_er_pin_t::pin_code[8];
+
+

PIN code of station in enrollee mode

+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/structwifi__event__sta__wps__er__success__t/index.html b/ltapi/structwifi__event__sta__wps__er__success__t/index.html new file mode 100644 index 000000000..89218f2b0 --- /dev/null +++ b/ltapi/structwifi__event__sta__wps__er__success__t/index.html @@ -0,0 +1,2359 @@ + + + + + + + + + + + + + + + + + + + + Struct wifi\_event\_sta\_wps\_er\_success\_t - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct wifi_event_sta_wps_er_success_t

+

ClassList > wifi_event_sta_wps_er_success_t

+

More...

+
    +
  • #include <WiFiEvents.h>
  • +
+

Public Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
struct wifi_event_sta_wps_er_success_t::@0ap_cred
uint8_tap_cred_cnt
uint8_tpassphrase
uint8_tssid
+

Detailed Description

+

Argument structure for WIFI_EVENT_STA_WPS_ER_SUCCESS event

+

Public Attributes Documentation

+

variable ap_cred

+
struct wifi_event_sta_wps_er_success_t::@0 wifi_event_sta_wps_er_success_t::ap_cred[MAX_WPS_AP_CRED];
+
+

All AP credentials received from WPS handshake

+

variable ap_cred_cnt

+
uint8_t wifi_event_sta_wps_er_success_t::ap_cred_cnt;
+
+

Number of AP credentials received

+

variable passphrase

+
uint8_t wifi_event_sta_wps_er_success_t::passphrase[MAX_PASSPHRASE_LEN];
+
+

Passphrase for the AP

+

variable ssid

+
uint8_t wifi_event_sta_wps_er_success_t::ssid[MAX_SSID_LEN];
+
+

SSID of AP

+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/structwifi__ftm__report__entry__t/index.html b/ltapi/structwifi__ftm__report__entry__t/index.html new file mode 100644 index 000000000..081cafbff --- /dev/null +++ b/ltapi/structwifi__ftm__report__entry__t/index.html @@ -0,0 +1,2383 @@ + + + + + + + + + + + + + + + + + + + + Struct wifi\_ftm\_report\_entry\_t - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Struct wifi_ftm_report_entry_t

+

ClassList > wifi_ftm_report_entry_t

+

More...

+
    +
  • #include <WiFiEvents.h>
  • +
+

Public Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
uint8_tdlog_token
int8_trssi
uint32_trtt
uint64_tt1
uint64_tt2
uint64_tt3
uint64_tt4
+

Detailed Description

+

Argument structure for

+

Public Attributes Documentation

+

variable dlog_token

+
uint8_t wifi_ftm_report_entry_t::dlog_token;
+
+

Dialog Token of the FTM frame

+

variable rssi

+
int8_t wifi_ftm_report_entry_t::rssi;
+
+

RSSI of the FTM frame received

+

variable rtt

+
uint32_t wifi_ftm_report_entry_t::rtt;
+
+

Round Trip Time in pSec with a peer

+

variable t1

+
uint64_t wifi_ftm_report_entry_t::t1;
+
+

Time of departure of FTM frame from FTM Responder in pSec

+

variable t2

+
uint64_t wifi_ftm_report_entry_t::t2;
+
+

Time of arrival of FTM frame at FTM Initiator in pSec

+

variable t3

+
uint64_t wifi_ftm_report_entry_t::t3;
+
+

Time of departure of ACK from FTM Initiator in pSec

+

variable t4

+
uint64_t wifi_ftm_report_entry_t::t4;
+
+

Time of arrival of ACK at FTM Responder in pSec

+
+

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/sys_8h/index.html b/ltapi/sys_8h/index.html new file mode 100644 index 000000000..f7e552005 --- /dev/null +++ b/ltapi/sys_8h/index.html @@ -0,0 +1,2298 @@ + + + + + + + + + + + + + + + + + + + + File sys.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/sys_8h_source/index.html b/ltapi/sys_8h_source/index.html new file mode 100644 index 000000000..c23ab55e3 --- /dev/null +++ b/ltapi/sys_8h_source/index.html @@ -0,0 +1,2299 @@ + + + + + + + + + + + + + + + + + + + + File sys.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/tcpip_8h/index.html b/ltapi/tcpip_8h/index.html new file mode 100644 index 000000000..a4072df94 --- /dev/null +++ b/ltapi/tcpip_8h/index.html @@ -0,0 +1,2298 @@ + + + + + + + + + + + + + + + + + + + + File tcpip.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/tcpip_8h_source/index.html b/ltapi/tcpip_8h_source/index.html new file mode 100644 index 000000000..ca9f2bd1a --- /dev/null +++ b/ltapi/tcpip_8h_source/index.html @@ -0,0 +1,2299 @@ + + + + + + + + + + + + + + + + + + + + File tcpip.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/time_8c/index.html b/ltapi/time_8c/index.html new file mode 100644 index 000000000..e62764b4c --- /dev/null +++ b/ltapi/time_8c/index.html @@ -0,0 +1,2501 @@ + + + + + + + + + + + + + + + + + + + + File time.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

File time.c

+

FileList > arduino > src > posix > time.c

+

Go to the source code of this file.

+
    +
  • #include <Arduino.h>
  • +
  • #include <errno.h>
  • +
+

Public Static Attributes

+ + + + + + + + + + + + + + + + + +
TypeName
uint32_treset_epoch = = 0
uint32_treset_millis = = 0
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
int__wrap_gettimeofday (struct timeval * tv, void * tz)
int__wrap_settimeofday (const struct timeval * tv, const struct timezone * tz)
int_gettimeofday (struct timeval * tv, void * tz)
int_settimeofday (const struct timeval * tv, const struct timezone * tz)
intgettimeofday (struct timeval * tv, void * tz)
intsettimeofday (const struct timeval * tv, const struct timezone * tz)
+

Public Static Attributes Documentation

+

variable reset_epoch

+
uint32_t reset_epoch;
+
+

variable reset_millis

+
uint32_t reset_millis;
+
+

Public Functions Documentation

+

function __wrap_gettimeofday

+
int __wrap_gettimeofday (
+    struct timeval * tv,
+    void * tz
+) 
+
+

function __wrap_settimeofday

+
int __wrap_settimeofday (
+    const struct timeval * tv,
+    const struct timezone * tz
+) 
+
+

function _gettimeofday

+
int _gettimeofday (
+    struct timeval * tv,
+    void * tz
+) 
+
+

function _settimeofday

+
int _settimeofday (
+    const struct timeval * tv,
+    const struct timezone * tz
+) 
+
+

function gettimeofday

+
int gettimeofday (
+    struct timeval * tv,
+    void * tz
+) 
+
+

function settimeofday

+
int settimeofday (
+    const struct timeval * tv,
+    const struct timezone * tz
+) 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/src/posix/time.c

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/time_8c_source/index.html b/ltapi/time_8c_source/index.html new file mode 100644 index 000000000..5b9aad53c --- /dev/null +++ b/ltapi/time_8c_source/index.html @@ -0,0 +1,2344 @@ + + + + + + + + + + + + + + + + + + + + File time.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File time.c

+

File List > arduino > src > posix > time.c

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-09-03. */
+
+#include <Arduino.h>
+#include <errno.h>
+
+static uint32_t reset_epoch  = 0; // epoch corresponding to millis() == 0
+static uint32_t reset_millis = 0; // millis() when epoch reset was performed
+
+int __wrap_gettimeofday(struct timeval *tv, void *tz) {
+    if (millis() < reset_millis) {
+        // the clock overflowed
+        reset_epoch += UINT32_MAX / 1000;
+        reset_millis = millis();
+    }
+    if (!tv) {
+        errno = EINVAL;
+        return -1;
+    }
+    unsigned long m = millis();
+    tv->tv_sec      = reset_epoch + (m / 1000);
+    tv->tv_usec     = (m % 1000) * 1000;
+    return 0;
+}
+
+int __wrap_settimeofday(const struct timeval *tv, const struct timezone *tz) {
+    if (!tv) {
+        errno = EINVAL;
+        return -1;
+    }
+    unsigned long m = millis();
+    reset_epoch     = tv->tv_sec - (m / 1000);
+    reset_millis    = m;
+    return 0;
+}
+
+int gettimeofday(struct timeval *tv, void *tz) {
+    return __wrap_gettimeofday(tv, tz);
+}
+
+int settimeofday(const struct timeval *tv, const struct timezone *tz) {
+    return __wrap_settimeofday(tv, tz);
+}
+
+int _gettimeofday(struct timeval *tv, void *tz) {
+    return __wrap_gettimeofday(tv, tz);
+}
+
+int _settimeofday(const struct timeval *tv, const struct timezone *tz) {
+    return __wrap_settimeofday(tv, tz);
+}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/udp_8h/index.html b/ltapi/udp_8h/index.html new file mode 100644 index 000000000..efc61e5e9 --- /dev/null +++ b/ltapi/udp_8h/index.html @@ -0,0 +1,2352 @@ + + + + + + + + + + + + + + + + + + + + File udp.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File udp.h

+

FileList > base > compat > udp.h

+

Go to the source code of this file.

+
    +
  • #include <lwip/udp.h>
  • +
+

Macros

+ + + + + + + + + + + + + +
TypeName
definelwip_ntohl lwip_htonl
+

Macro Definition Documentation

+

define lwip_ntohl

+
#define lwip_ntohl lwip_htonl
+
+
+

The documentation for this class was generated from the following file cores/common/base/compat/udp.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/udp_8h_source/index.html b/ltapi/udp_8h_source/index.html new file mode 100644 index 000000000..07e99bc6f --- /dev/null +++ b/ltapi/udp_8h_source/index.html @@ -0,0 +1,2305 @@ + + + + + + + + + + + + + + + + + + + + File udp.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File udp.h

+

File List > base > compat > udp.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-05-23. */
+
+#pragma once
+
+#include <lwip/udp.h>
+
+// this is included only by wifi_simple_config.c
+// which uses lwip_ntohl without parentheses
+// so the #define from lwip/def.h doesn't work
+#undef lwip_ntohl
+#define lwip_ntohl lwip_htonl
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/unionarduino__event__info__t/index.html b/ltapi/unionarduino__event__info__t/index.html new file mode 100644 index 000000000..b87dde3eb --- /dev/null +++ b/ltapi/unionarduino__event__info__t/index.html @@ -0,0 +1,2516 @@ + + + + + + + + + + + + + + + + + + + + Union arduino\_event\_info\_t - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

Union arduino_event_info_t

+

ClassList > arduino_event_info_t

+

Public Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
ip_event_got_ip_tgot_ip
ip_event_got_ip6_tgot_ip6
wifi_event_ap_probe_req_rx_twifi_ap_probereqrecved
wifi_event_ap_staconnected_twifi_ap_staconnected
wifi_event_ap_stadisconnected_twifi_ap_stadisconnected
ip_event_ap_staipassigned_twifi_ap_staipassigned
wifi_event_ftm_report_twifi_ftm_report
wifi_event_sta_scan_done_twifi_scan_done
wifi_event_sta_authmode_change_twifi_sta_authmode_change
wifi_event_sta_connected_twifi_sta_connected
wifi_event_sta_disconnected_twifi_sta_disconnected
wifi_event_sta_wps_er_pin_twps_er_pin
wifi_event_sta_wps_fail_reason_twps_fail_reason
+

Public Attributes Documentation

+

variable got_ip

+
ip_event_got_ip_t arduino_event_info_t::got_ip;
+
+

variable got_ip6

+
ip_event_got_ip6_t arduino_event_info_t::got_ip6;
+
+

variable wifi_ap_probereqrecved

+
wifi_event_ap_probe_req_rx_t arduino_event_info_t::wifi_ap_probereqrecved;
+
+

variable wifi_ap_staconnected

+
wifi_event_ap_staconnected_t arduino_event_info_t::wifi_ap_staconnected;
+
+

variable wifi_ap_stadisconnected

+
wifi_event_ap_stadisconnected_t arduino_event_info_t::wifi_ap_stadisconnected;
+
+

variable wifi_ap_staipassigned

+
ip_event_ap_staipassigned_t arduino_event_info_t::wifi_ap_staipassigned;
+
+

variable wifi_ftm_report

+
wifi_event_ftm_report_t arduino_event_info_t::wifi_ftm_report;
+
+

variable wifi_scan_done

+
wifi_event_sta_scan_done_t arduino_event_info_t::wifi_scan_done;
+
+

variable wifi_sta_authmode_change

+
wifi_event_sta_authmode_change_t arduino_event_info_t::wifi_sta_authmode_change;
+
+

variable wifi_sta_connected

+
wifi_event_sta_connected_t arduino_event_info_t::wifi_sta_connected;
+
+

variable wifi_sta_disconnected

+
wifi_event_sta_disconnected_t arduino_event_info_t::wifi_sta_disconnected;
+
+

variable wps_er_pin

+
wifi_event_sta_wps_er_pin_t arduino_event_info_t::wps_er_pin;
+
+

variable wps_fail_reason

+
wifi_event_sta_wps_fail_reason_t arduino_event_info_t::wps_fail_reason;
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/src/Events.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/variables/index.html b/ltapi/variables/index.html new file mode 100644 index 000000000..031fb1452 --- /dev/null +++ b/ltapi/variables/index.html @@ -0,0 +1,2543 @@ + + + + + + + + + + + + + + + + + + + + Variables - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

Variables

+

a

+ +

b

+ +

c

+ +

d

+ +

e

+ +

f

+ +

h

+ +

l

+ +

m

+ +

o

+ +

p

+ +

r

+ +

s

+ +

t

+ +

u

+ +

w

+ +

_

+ + + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/vfs__api_8h/index.html b/ltapi/vfs__api_8h/index.html new file mode 100644 index 000000000..9a67c4a78 --- /dev/null +++ b/ltapi/vfs__api_8h/index.html @@ -0,0 +1,2295 @@ + + + + + + + + + + + + + + + + + + + + File vfs\_api.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/vfs__api_8h_source/index.html b/ltapi/vfs__api_8h_source/index.html new file mode 100644 index 000000000..9cedeeb26 --- /dev/null +++ b/ltapi/vfs__api_8h_source/index.html @@ -0,0 +1,2297 @@ + + + + + + + + + + + + + + + + + + + + File vfs\_api.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/wiring_8c/index.html b/ltapi/wiring_8c/index.html new file mode 100644 index 000000000..c88d50881 --- /dev/null +++ b/ltapi/wiring_8c/index.html @@ -0,0 +1,2354 @@ + + + + + + + + + + + + + + + + + + + + File wiring.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File wiring.c

+

FileList > arduino > src > wiring > wiring.c

+

Go to the source code of this file.

+
    +
  • #include <Arduino.h>
  • +
+

Public Functions

+ + + + + + + + + + + + + +
TypeName
__attribute__ ((weak))
+

Public Functions Documentation

+

function __attribute__

+
__attribute__ (
+    (weak)
+) 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/src/wiring/wiring.c

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/wiring_8c_source/index.html b/ltapi/wiring_8c_source/index.html new file mode 100644 index 000000000..4d2f7b380 --- /dev/null +++ b/ltapi/wiring_8c_source/index.html @@ -0,0 +1,2316 @@ + + + + + + + + + + + + + + + + + + + + File wiring.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File wiring.c

+

File List > arduino > src > wiring > wiring.c

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2023-05-24. */
+
+#include <Arduino.h>
+
+#if LT_HAS_FREERTOS
+
+__attribute__((weak)) void delay(uint32_t ms) {
+    vTaskDelay(pdMS_TO_TICKS(ms));
+}
+
+__attribute__((weak)) void yield() {
+    runPeriodicTasks();
+    vTaskDelay(1);
+    taskYIELD();
+    lt_wdt_feed();
+}
+
+#else
+
+__attribute__((weak)) void yield() {}
+
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/wiring__compat_8cpp/index.html b/ltapi/wiring__compat_8cpp/index.html new file mode 100644 index 000000000..06c3e6e3d --- /dev/null +++ b/ltapi/wiring__compat_8cpp/index.html @@ -0,0 +1,2354 @@ + + + + + + + + + + + + + + + + + + + + File wiring\_compat.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File wiring_compat.cpp

+

FileList > arduino > src > wiring > wiring_compat.cpp

+

Go to the source code of this file.

+
    +
  • #include "wiring_compat.h"
  • +
+

Public Functions

+ + + + + + + + + + + + + +
TypeName
StringipToString (const IPAddress & ip)
+

Public Functions Documentation

+

function ipToString

+
String ipToString (
+    const IPAddress & ip
+) 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/src/wiring/wiring_compat.cpp

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/wiring__compat_8cpp_source/index.html b/ltapi/wiring__compat_8cpp_source/index.html new file mode 100644 index 000000000..a48563fce --- /dev/null +++ b/ltapi/wiring__compat_8cpp_source/index.html @@ -0,0 +1,2303 @@ + + + + + + + + + + + + + + + + + + + + File wiring\_compat.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/wiring__compat_8h/index.html b/ltapi/wiring__compat_8h/index.html new file mode 100644 index 000000000..e386e36f3 --- /dev/null +++ b/ltapi/wiring__compat_8h/index.html @@ -0,0 +1,2598 @@ + + + + + + + + + + + + + + + + + + + + File wiring\_compat.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

File wiring_compat.h

+

FileList > arduino > src > wiring > wiring_compat.h

+

Go to the source code of this file.

+
    +
  • #include <Arduino.h>
  • +
+

Public Functions

+ + + + + + + + + + + + + +
TypeName
StringipToString (const IPAddress & ip)
+

Macros

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
defineCONFIG_LWIP_MAX_ACTIVE_TCP 16
defineESP_FAIL -1
defineESP_OK 0
defineFPSTR (pstr_pointer) (reinterpret_cast<const __FlashStringHelper *>(pstr_pointer))
defineOUTPUT_OPEN_DRAIN OUTPUT_OPENDRAIN
definePGM_VOID_P const void *
defineattachInterruptArg attachInterruptParam
definedigitalPinToInterrupt (pin) (pin)
defineesp_err_t int
defineround (x) ((x) >= 0 ? (long)((x) + 0.5) : (long)((x)-0.5))
definevoidFuncPtrArg voidFuncPtrParam
definevsnprintf_P vsnprintf
definexTaskCreatePinnedToCore xTaskCreateUniversal
definexTaskCreateUniversal (pxTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask, xCoreID) xTaskCreate(pxTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask)
+

Public Functions Documentation

+

function ipToString

+
String ipToString (
+    const IPAddress & ip
+) 
+
+

Macro Definition Documentation

+

define CONFIG_LWIP_MAX_ACTIVE_TCP

+
#define CONFIG_LWIP_MAX_ACTIVE_TCP 16
+
+

define ESP_FAIL

+
#define ESP_FAIL -1
+
+

Generic esp_err_t code indicating failure

+

define ESP_OK

+
#define ESP_OK 0
+
+

esp_err_t value indicating success (no error)

+

define FPSTR

+
#define FPSTR (
+    pstr_pointer
+) (reinterpret_cast<const __FlashStringHelper *>(pstr_pointer))
+
+

define OUTPUT_OPEN_DRAIN

+
#define OUTPUT_OPEN_DRAIN OUTPUT_OPENDRAIN
+
+

define PGM_VOID_P

+
#define PGM_VOID_P const void *
+
+

define attachInterruptArg

+
#define attachInterruptArg attachInterruptParam
+
+

define digitalPinToInterrupt

+
#define digitalPinToInterrupt (
+    pin
+) (pin)
+
+

define esp_err_t

+
#define esp_err_t int
+
+

define round

+
#define round (
+    x
+) ((x) >= 0 ? (long)((x) + 0.5) : (long)((x)-0.5))
+
+

define voidFuncPtrArg

+
#define voidFuncPtrArg voidFuncPtrParam
+
+

define vsnprintf_P

+
#define vsnprintf_P vsnprintf
+
+

define xTaskCreatePinnedToCore

+
#define xTaskCreatePinnedToCore xTaskCreateUniversal
+
+

define xTaskCreateUniversal

+
#define xTaskCreateUniversal (
+    pxTaskCode,
+    pcName,
+    usStackDepth,
+    pvParameters,
+    uxPriority,
+    pxCreatedTask,
+    xCoreID
+) xTaskCreate(pxTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask)
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/src/wiring/wiring_compat.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/wiring__compat_8h_source/index.html b/ltapi/wiring__compat_8h_source/index.html new file mode 100644 index 000000000..dde2e4b4d --- /dev/null +++ b/ltapi/wiring__compat_8h_source/index.html @@ -0,0 +1,2335 @@ + + + + + + + + + + + + + + + + + + + + File wiring\_compat.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File wiring_compat.h

+

File List > arduino > src > wiring > wiring_compat.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-06-04. */
+
+#pragma once
+
+#include <Arduino.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif // __cplusplus
+
+// Definitions for error constants.
+#define esp_err_t int
+#define ESP_OK    0  
+#define ESP_FAIL  -1 
+// ArduinoCore-API doesn't define these anymore
+#define FPSTR(pstr_pointer) (reinterpret_cast<const __FlashStringHelper *>(pstr_pointer))
+#define PGM_VOID_P          const void *
+#define vsnprintf_P         vsnprintf
+#define OUTPUT_OPEN_DRAIN   OUTPUT_OPENDRAIN
+#define attachInterruptArg  attachInterruptParam
+#define voidFuncPtrArg      voidFuncPtrParam
+
+// Additional Arduino compatibility macros
+#define round(x)                   ((x) >= 0 ? (long)((x) + 0.5) : (long)((x)-0.5))
+#define digitalPinToInterrupt(pin) (pin)
+
+// FreeRTOS utilities
+#define xTaskCreateUniversal(pxTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask, xCoreID)       \
+    xTaskCreate(pxTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask)
+#define xTaskCreatePinnedToCore xTaskCreateUniversal
+
+// Default values from sdkconfig.h
+#define CONFIG_LWIP_MAX_ACTIVE_TCP 16
+
+#ifdef __cplusplus
+String ipToString(const IPAddress &ip);
+#endif
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/wiring__custom_8c/index.html b/ltapi/wiring__custom_8c/index.html new file mode 100644 index 000000000..19bf5f24b --- /dev/null +++ b/ltapi/wiring__custom_8c/index.html @@ -0,0 +1,2685 @@ + + + + + + + + + + + + + + + + + + + + File wiring\_custom.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

File wiring_custom.c

+

FileList > arduino > src > wiring > wiring_custom.c

+

Go to the source code of this file.

+
    +
  • #include "wiring_private.h"
  • +
+

Public Attributes

+ + + + + + + + + + + + + + + + + + + + + +
TypeName
int_analogReadResolution = = 10
int_analogWritePeriod = = 20000
int_analogWriteResolution = = 8
+

Public Static Attributes

+ + + + + + + + + + + + + +
TypeName
unsigned longperiodicTasks = = {0, 0}
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
__attribute__ ((weak))
intanalogRead (pin_size_t pinNumber)
Read voltage from ADC and return a value between 0 and the current reading resolution.
voidanalogReadResolution (int res)
Set resolution of values (in bits) returned by analogRead(). Defaults to 10 bit (0-1023).
voidanalogWriteFrequency (int hz)
Set PWM output frequency (in Hz). Defaults to 50 Hz (20,000 uS).
voidanalogWritePeriod (int us)
Set PWM output frequency (cycle period) in microseconds. Defaults to 20,000 uS (50 Hz).
voidanalogWriteResolution (int res)
Set resolution of values (in bits) expected by analogWrite(). Defaults to 8 bit (0-255).
PinInfo *pinByGpio (uint32_t gpio)
Find PinInfo struct by GPIO number. Returns NULL if not found.
PinInfo *pinByIndex (uint32_t index)
Get PinInfo struct for the specified index. Returns NULL if pin index is invalid.
boolpinEnabled (PinInfo * pin, uint32_t mask)
Check if pin has all features represented by 'mask' enabled.
uint32_tpinIndex (PinInfo * pin)
Get index of PinInfo in the global pin info table.
PinInfo *pinInfo (pin_size_t pinNumber)
Get PinInfo struct for the specified number. Returns NULL if pin number is invalid.
voidpinModeRemove (pin_size_t pinNumber, uint32_t mask)
Disable modes specified by 'mask'.
boolpinSupported (PinInfo * pin, uint32_t mask)
Check if pin supports all features represented by 'mask'.
voidrunPeriodicTasks ()
Run periodic tasks, like printing free heap or checking millis() overflow.
+

Public Attributes Documentation

+

variable _analogReadResolution

+
int _analogReadResolution;
+
+

variable _analogWritePeriod

+
int _analogWritePeriod;
+
+

variable _analogWriteResolution

+
int _analogWriteResolution;
+
+

Public Static Attributes Documentation

+

variable periodicTasks

+
unsigned long periodicTasks[];
+
+

Public Functions Documentation

+

function __attribute__

+
__attribute__ (
+    (weak)
+) 
+
+

function analogRead

+
int analogRead (
+    pin_size_t pinNumber
+) 
+
+

function analogReadResolution

+
void analogReadResolution (
+    int res
+) 
+
+

function analogWriteFrequency

+
void analogWriteFrequency (
+    int hz
+) 
+
+

function analogWritePeriod

+
void analogWritePeriod (
+    int us
+) 
+
+

function analogWriteResolution

+
void analogWriteResolution (
+    int res
+) 
+
+

function pinByGpio

+
PinInfo * pinByGpio (
+    uint32_t gpio
+) 
+
+

function pinByIndex

+
PinInfo * pinByIndex (
+    uint32_t index
+) 
+
+

function pinEnabled

+
bool pinEnabled (
+    PinInfo * pin,
+    uint32_t mask
+) 
+
+

function pinIndex

+
uint32_t pinIndex (
+    PinInfo * pin
+) 
+
+

function pinInfo

+
PinInfo * pinInfo (
+    pin_size_t pinNumber
+) 
+
+

function pinModeRemove

+
void pinModeRemove (
+    pin_size_t pinNumber,
+    uint32_t mask
+) 
+
+

function pinSupported

+
bool pinSupported (
+    PinInfo * pin,
+    uint32_t mask
+) 
+
+

function runPeriodicTasks

+

Run periodic tasks, like printing free heap or checking millis() overflow. +

void runPeriodicTasks () 
+

+

This is called during delaying operations, like yield() or delay().

+
+

The documentation for this class was generated from the following file cores/common/arduino/src/wiring/wiring_custom.c

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/wiring__custom_8c_source/index.html b/ltapi/wiring__custom_8c_source/index.html new file mode 100644 index 000000000..fa203d43a --- /dev/null +++ b/ltapi/wiring__custom_8c_source/index.html @@ -0,0 +1,2390 @@ + + + + + + + + + + + + + + + + + + + + File wiring\_custom.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File wiring_custom.c

+

File List > arduino > src > wiring > wiring_custom.c

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-06-20. */
+
+#include "wiring_private.h"
+
+#if LT_HAS_FREERTOS
+#include <FreeRTOS.h>
+#endif
+
+int _analogReadResolution  = 10;    // 0-1023
+int _analogWriteResolution = 8;     // 0-255
+int _analogWritePeriod     = 20000; // 50 Hz
+
+static unsigned long periodicTasks[] = {0, 0};
+
+void runPeriodicTasks() {
+#if LT_LOG_HEAP
+    if (millis() - periodicTasks[0] > 1000) {
+        LT_HEAP_I();
+        periodicTasks[0] = millis();
+    }
+#endif
+#if LT_USE_TIME
+    if (millis() - periodicTasks[1] > 10000) {
+        gettimeofday(NULL, NULL);
+        periodicTasks[1] = millis();
+    }
+#endif
+}
+
+void pinModeRemove(pin_size_t pinNumber, uint32_t mask) {
+    PinInfo *pin = pinInfo(pinNumber);
+    if (!pin)
+        return;
+    pinRemoveMode(pin, mask);
+    if (pin->enabled == PIN_NONE && mask == PIN_MODE_ALL)
+        pinRemoveData(pin);
+}
+
+PinInfo *pinInfo(pin_size_t pinNumber) {
+    if (pinNumber < 0 || pinNumber > PINS_GPIO_MAX)
+        return NULL;
+    return lt_arduino_pin_gpio_map[pinNumber];
+}
+
+PinInfo *pinByIndex(uint32_t index) {
+    if (index < 0 || index >= PINS_COUNT)
+        return NULL;
+    return &(lt_arduino_pin_info_list[index]);
+}
+
+PinInfo *pinByGpio(uint32_t gpio) {
+    for (uint32_t i = 0; i < PINS_COUNT; i++) {
+        if (lt_arduino_pin_info_list[i].gpio == gpio)
+            return &(lt_arduino_pin_info_list[i]);
+    }
+    return NULL;
+}
+
+uint32_t pinIndex(PinInfo *pin) {
+    return pin - lt_arduino_pin_info_list;
+}
+
+bool pinSupported(PinInfo *pin, uint32_t mask) {
+    return (pin->supported & mask) == mask;
+}
+
+bool pinEnabled(PinInfo *pin, uint32_t mask) {
+    return (pin->enabled & mask) == mask;
+}
+
+int analogRead(pin_size_t pinNumber) {
+    float voltage    = analogReadVoltage(pinNumber);
+    float maxVoltage = analogReadMaxVoltage(pinNumber);
+    uint16_t ret     = round((1 << _analogReadResolution) * voltage / maxVoltage);
+    if (ret >= (1 << _analogReadResolution))
+        ret = (1 << _analogReadResolution) - 1;
+    return ret;
+}
+
+void analogReadResolution(int res) {
+    _analogReadResolution = res;
+}
+
+void analogWriteResolution(int res) {
+    _analogWriteResolution = res;
+}
+
+void analogWriteFrequency(int hz) {
+    _analogWritePeriod = 1E6 / hz;
+}
+
+void analogWritePeriod(int us) {
+    _analogWritePeriod = us;
+}
+
+__attribute__((weak)) void analogReference(uint8_t mode) {}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/wiring__custom_8h/index.html b/ltapi/wiring__custom_8h/index.html new file mode 100644 index 000000000..3c69bcce4 --- /dev/null +++ b/ltapi/wiring__custom_8h/index.html @@ -0,0 +1,3030 @@ + + + + + + + + + + + + + + + + + + + + File wiring\_custom.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File wiring_custom.h

+

FileList > arduino > src > wiring > wiring_custom.h

+

Go to the source code of this file.

+
    +
  • #include <Arduino.h>
  • +
+

Classes

+ + + + + + + + + + + + + +
TypeName
structPinInfo
+

Public Types

+ + + + + + + + + + + + + +
TypeName
typedef struct PinData_sPinData
+

Public Attributes

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
int_analogReadResolution
int_analogWritePeriod
int_analogWriteResolution
PinInfo *lt_arduino_pin_gpio_map
PinInfolt_arduino_pin_info_list
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
intanalogRead (pin_size_t pinNumber)
Read voltage from ADC and return a value between 0 and the current reading resolution.
uint16_tanalogReadMaxVoltage (pin_size_t pinNumber)
Get max reading voltage for the specified pin (millivolts).
voidanalogReadResolution (int res)
Set resolution of values (in bits) returned by analogRead(). Defaults to 10 bit (0-1023).
uint16_tanalogReadVoltage (pin_size_t pinNumber)
Read voltage from analog input (in millivolts).
voidanalogWriteFrequency (int hz)
Set PWM output frequency (in Hz). Defaults to 50 Hz (20,000 uS).
voidanalogWritePeriod (int us)
Set PWM output frequency (cycle period) in microseconds. Defaults to 20,000 uS (50 Hz).
voidanalogWriteResolution (int res)
Set resolution of values (in bits) expected by analogWrite(). Defaults to 8 bit (0-255).
voidmainTask (const void * arg)
Main setup() and loop() task. Not to be called directly.
PinInfo *pinByGpio (uint32_t gpio)
Find PinInfo struct by GPIO number. Returns NULL if not found.
PinInfo *pinByIndex (uint32_t index)
Get PinInfo struct for the specified index. Returns NULL if pin index is invalid.
boolpinEnabled (PinInfo * pin, uint32_t mask)
Check if pin has all features represented by 'mask' enabled.
uint32_tpinIndex (PinInfo * pin)
Get index of PinInfo in the global pin info table.
PinInfo *pinInfo (pin_size_t pinNumber)
Get PinInfo struct for the specified number. Returns NULL if pin number is invalid.
voidpinModeNone (pin_size_t pinNumber)
Deinitialize the pin, by removing all enabled modes.
voidpinModeRemove (pin_size_t pinNumber, uint32_t mask)
Disable modes specified by 'mask'.
voidpinRemoveMode (PinInfo * pin, uint32_t mask)
boolpinSupported (PinInfo * pin, uint32_t mask)
Check if pin supports all features represented by 'mask'.
voidrunPeriodicTasks ()
Run periodic tasks, like printing free heap or checking millis() overflow.
boolstartMainTask (void)
Run mainTask & start OS kernel (family-defined). Return false if an error occured; else do not return and and keep the OS kernel running.
+

Macros

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
definePIN_ADC (1 << 4)
definePIN_DAC (1 << 5)
definePIN_GPIO (1 << 1)
definePIN_I2C (1 << 6)
definePIN_I2S (1 << 7)
definePIN_IRQ (1 << 2)
definePIN_JTAG (1 << 8)
definePIN_MODE_ALL 0xFFFFFFFF
definePIN_NONE (1 << 0)
definePIN_PWM (1 << 3)
definePIN_SPI (1 << 9)
definePIN_SWD (1 << 10)
definePIN_UART (1 << 11)
+

Public Types Documentation

+

typedef PinData

+
typedef struct PinData_s PinData;
+
+

Public Attributes Documentation

+

variable _analogReadResolution

+
int _analogReadResolution;
+
+

variable _analogWritePeriod

+
int _analogWritePeriod;
+
+

variable _analogWriteResolution

+
int _analogWriteResolution;
+
+

variable lt_arduino_pin_gpio_map

+
PinInfo* lt_arduino_pin_gpio_map[PINS_GPIO_MAX+1];
+
+

variable lt_arduino_pin_info_list

+
PinInfo lt_arduino_pin_info_list[PINS_COUNT];
+
+

Public Functions Documentation

+

function analogRead

+
int analogRead (
+    pin_size_t pinNumber
+) 
+
+

function analogReadMaxVoltage

+
uint16_t analogReadMaxVoltage (
+    pin_size_t pinNumber
+) 
+
+

function analogReadResolution

+
void analogReadResolution (
+    int res
+) 
+
+

function analogReadVoltage

+
uint16_t analogReadVoltage (
+    pin_size_t pinNumber
+) 
+
+

function analogWriteFrequency

+
void analogWriteFrequency (
+    int hz
+) 
+
+

function analogWritePeriod

+
void analogWritePeriod (
+    int us
+) 
+
+

function analogWriteResolution

+
void analogWriteResolution (
+    int res
+) 
+
+

function mainTask

+
void mainTask (
+    const void * arg
+) 
+
+

function pinByGpio

+
PinInfo * pinByGpio (
+    uint32_t gpio
+) 
+
+

function pinByIndex

+
PinInfo * pinByIndex (
+    uint32_t index
+) 
+
+

function pinEnabled

+
bool pinEnabled (
+    PinInfo * pin,
+    uint32_t mask
+) 
+
+

function pinIndex

+
uint32_t pinIndex (
+    PinInfo * pin
+) 
+
+

function pinInfo

+
PinInfo * pinInfo (
+    pin_size_t pinNumber
+) 
+
+

function pinModeNone

+
inline void pinModeNone (
+    pin_size_t pinNumber
+) 
+
+

function pinModeRemove

+
void pinModeRemove (
+    pin_size_t pinNumber,
+    uint32_t mask
+) 
+
+

function pinRemoveMode

+
void pinRemoveMode (
+    PinInfo * pin,
+    uint32_t mask
+) 
+
+

function pinSupported

+
bool pinSupported (
+    PinInfo * pin,
+    uint32_t mask
+) 
+
+

function runPeriodicTasks

+

Run periodic tasks, like printing free heap or checking millis() overflow. +

void runPeriodicTasks () 
+

+

This is called during delaying operations, like yield() or delay().

+

function startMainTask

+
bool startMainTask (
+    void
+) 
+
+

Macro Definition Documentation

+

define PIN_ADC

+
#define PIN_ADC (1 << 4)
+
+

define PIN_DAC

+
#define PIN_DAC (1 << 5)
+
+

define PIN_GPIO

+
#define PIN_GPIO (1 << 1)
+
+

define PIN_I2C

+
#define PIN_I2C (1 << 6)
+
+

define PIN_I2S

+
#define PIN_I2S (1 << 7)
+
+

define PIN_IRQ

+
#define PIN_IRQ (1 << 2)
+
+

define PIN_JTAG

+
#define PIN_JTAG (1 << 8)
+
+

define PIN_MODE_ALL

+
#define PIN_MODE_ALL 0xFFFFFFFF
+
+

define PIN_NONE

+
#define PIN_NONE (1 << 0)
+
+

define PIN_PWM

+
#define PIN_PWM (1 << 3)
+
+

define PIN_SPI

+
#define PIN_SPI (1 << 9)
+
+

define PIN_SWD

+
#define PIN_SWD (1 << 10)
+
+

define PIN_UART

+
#define PIN_UART (1 << 11)
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/src/wiring/wiring_custom.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/wiring__custom_8h_source/index.html b/ltapi/wiring__custom_8h_source/index.html new file mode 100644 index 000000000..fccf30f28 --- /dev/null +++ b/ltapi/wiring__custom_8h_source/index.html @@ -0,0 +1,2368 @@ + + + + + + + + + + + + + + + + + + + + File wiring\_custom.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File wiring_custom.h

+

File List > arduino > src > wiring > wiring_custom.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2022-06-06. */
+
+#pragma once
+
+#include <Arduino.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define PIN_NONE (1 << 0)
+#define PIN_GPIO (1 << 1)
+#define PIN_IRQ  (1 << 2)
+#define PIN_PWM  (1 << 3)
+#define PIN_ADC  (1 << 4)
+#define PIN_DAC  (1 << 5)
+#define PIN_I2C  (1 << 6)
+#define PIN_I2S  (1 << 7)
+#define PIN_JTAG (1 << 8)
+#define PIN_SPI  (1 << 9)
+#define PIN_SWD  (1 << 10)
+#define PIN_UART (1 << 11)
+
+#define PIN_MODE_ALL 0xFFFFFFFF
+
+typedef struct PinData_s PinData;
+
+typedef struct {
+    uint32_t gpio;
+    uint32_t supported;
+    uint32_t enabled;
+    PinData *data;
+} PinInfo;
+
+extern PinInfo lt_arduino_pin_info_list[PINS_COUNT];
+extern PinInfo *lt_arduino_pin_gpio_map[PINS_GPIO_MAX + 1];
+
+// Custom Wiring methods
+
+bool startMainTask(void);
+
+void mainTask(const void *arg); // implemented in main.cpp
+void runPeriodicTasks();        // implemented in wiring_custom.c
+
+void pinModeRemove(pin_size_t pinNumber, uint32_t mask);
+PinInfo *pinInfo(pin_size_t pinNumber);
+PinInfo *pinByIndex(uint32_t index);
+PinInfo *pinByGpio(uint32_t gpio);
+uint32_t pinIndex(PinInfo *pin);
+bool pinSupported(PinInfo *pin, uint32_t mask);
+bool pinEnabled(PinInfo *pin, uint32_t mask);
+void pinRemoveMode(PinInfo *pin, uint32_t mask);
+
+inline void pinModeNone(pin_size_t pinNumber) {
+    pinModeRemove(pinNumber, PIN_MODE_ALL);
+}
+
+int analogRead(pin_size_t pinNumber);
+void analogReadResolution(int res);
+void analogWriteResolution(int res);
+void analogWriteFrequency(int hz);
+void analogWritePeriod(int us);
+
+extern int _analogReadResolution;
+extern int _analogWriteResolution;
+extern int _analogWritePeriod;
+
+uint16_t analogReadVoltage(pin_size_t pinNumber);
+
+uint16_t analogReadMaxVoltage(pin_size_t pinNumber);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/wiring__irq_8c/index.html b/ltapi/wiring__irq_8c/index.html new file mode 100644 index 000000000..709cfaa6a --- /dev/null +++ b/ltapi/wiring__irq_8c/index.html @@ -0,0 +1,2356 @@ + + + + + + + + + + + + + + + + + + + + File wiring\_irq.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File wiring_irq.c

+

FileList > arduino > src > wiring > wiring_irq.c

+

Go to the source code of this file.

+
    +
  • #include <Arduino.h>
  • +
+

Public Functions

+ + + + + + + + + + + + + +
TypeName
voidattachInterrupt (pin_size_t interruptNumber, voidFuncPtr callback, PinStatus mode)
+

Public Functions Documentation

+

function attachInterrupt

+
void attachInterrupt (
+    pin_size_t interruptNumber,
+    voidFuncPtr callback,
+    PinStatus mode
+) 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/src/wiring/wiring_irq.c

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/wiring__irq_8c_source/index.html b/ltapi/wiring__irq_8c_source/index.html new file mode 100644 index 000000000..2461050f9 --- /dev/null +++ b/ltapi/wiring__irq_8c_source/index.html @@ -0,0 +1,2301 @@ + + + + + + + + + + + + + + + + + + + + File wiring\_irq.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File wiring_irq.c

+

File List > arduino > src > wiring > wiring_irq.c

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2023-05-24. */
+
+#include <Arduino.h>
+
+void attachInterrupt(pin_size_t interruptNumber, voidFuncPtr callback, PinStatus mode) {
+    attachInterruptParam(interruptNumber, (voidFuncPtrParam)callback, mode, NULL);
+}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/wiring__math_8cpp/index.html b/ltapi/wiring__math_8cpp/index.html new file mode 100644 index 000000000..7995ee240 --- /dev/null +++ b/ltapi/wiring__math_8cpp/index.html @@ -0,0 +1,2387 @@ + + + + + + + + + + + + + + + + + + + + File wiring\_math.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File wiring_math.cpp

+

FileList > arduino > src > wiring > wiring_math.cpp

+

Go to the source code of this file.

+
    +
  • #include <Arduino.h>
  • +
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + +
TypeName
longrandom (long howbig)
longrandom (long howsmall, long howbig)
voidrandomSeed (uint32_t dwSeed)
+

Public Functions Documentation

+

function random

+
long random (
+    long howbig
+) 
+
+

function random

+
long random (
+    long howsmall,
+    long howbig
+) 
+
+

function randomSeed

+
void randomSeed (
+    uint32_t dwSeed
+) 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/src/wiring/wiring_math.cpp

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/wiring__math_8cpp_source/index.html b/ltapi/wiring__math_8cpp_source/index.html new file mode 100644 index 000000000..df5eb78a5 --- /dev/null +++ b/ltapi/wiring__math_8cpp_source/index.html @@ -0,0 +1,2337 @@ + + + + + + + + + + + + + + + + + + + + File wiring\_math.cpp - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File wiring_math.cpp

+

File List > arduino > src > wiring > wiring_math.cpp

+

Go to the documentation of this file.

+
/*
+  Copyright (c) 2014 Arduino.  All right reserved.
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License, or (at your option) any later version.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+  See the GNU Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+#include <Arduino.h>
+
+void randomSeed(uint32_t dwSeed) {
+    if (dwSeed != 0) {
+        srand(dwSeed);
+    }
+}
+
+long random(long howbig) {
+    if (howbig == 0) {
+        return 0;
+    }
+
+    return rand() % howbig;
+}
+
+long random(long howsmall, long howbig) {
+    if (howsmall >= howbig) {
+        return howsmall;
+    }
+
+    long diff = howbig - howsmall;
+
+    return random(diff) + howsmall;
+}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/wiring__private_8c/index.html b/ltapi/wiring__private_8c/index.html new file mode 100644 index 000000000..dd525fd61 --- /dev/null +++ b/ltapi/wiring__private_8c/index.html @@ -0,0 +1,2298 @@ + + + + + + + + + + + + + + + + + + + + File wiring\_private.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+ +
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/wiring__private_8c_source/index.html b/ltapi/wiring__private_8c_source/index.html new file mode 100644 index 000000000..75ecae23a --- /dev/null +++ b/ltapi/wiring__private_8c_source/index.html @@ -0,0 +1,2313 @@ + + + + + + + + + + + + + + + + + + + + File wiring\_private.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File wiring_private.c

+

File List > arduino > src > wiring > wiring_private.c

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2023-05-24. */
+
+#include "wiring_private.h"
+
+#if __has_include(<wiring_data.h>)
+PinData *pinData(PinInfo *pin) {
+    if (pin->data == NULL) {
+        pin->data = calloc(1, sizeof(PinData));
+    }
+    return (PinData *)pin->data;
+}
+
+void pinRemoveData(PinInfo *pin) {
+    if (pin->data != NULL) {
+        free(pin->data);
+    }
+    pin->data = NULL;
+}
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/wiring__private_8h/index.html b/ltapi/wiring__private_8h/index.html new file mode 100644 index 000000000..365e8ffef --- /dev/null +++ b/ltapi/wiring__private_8h/index.html @@ -0,0 +1,2560 @@ + + + + + + + + + + + + + + + + + + + + File wiring\_private.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + + + + + +
+
+ + + + + + + + +

File wiring_private.h

+

FileList > arduino > src > wiring > wiring_private.h

+

Go to the source code of this file.

+
    +
  • #include <Arduino.h>
  • +
+

Public Functions

+ + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
PinData *pinData (PinInfo * pin)
voidpinDisable (PinInfo * pin, uint32_t mask)
voidpinEnable (PinInfo * pin, uint32_t mask)
voidpinRemoveData (PinInfo * pin)
+

Macros

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeName
definepinCheckGetData (pinNumber, mask, ret)
definepinCheckGetInfo (pinNumber, mask, ret)
definepinIsInput (pin, data) (pinEnabled(pin, PIN_GPIO) && (data->gpioMode ^ 0b101) > 4)
definepinIsOutput (pin, data) (pinEnabled(pin, PIN_GPIO) && (data->gpioMode ^ 0b101) < 5)
definepinSetInputMode (pin, data, pinNumber)
definepinSetOutputPull (pin, data, pinNumber, status)
+

Public Functions Documentation

+

function pinData

+
PinData * pinData (
+    PinInfo * pin
+) 
+
+

function pinDisable

+
inline void pinDisable (
+    PinInfo * pin,
+    uint32_t mask
+) 
+
+

function pinEnable

+
inline void pinEnable (
+    PinInfo * pin,
+    uint32_t mask
+) 
+
+

function pinRemoveData

+
void pinRemoveData (
+    PinInfo * pin
+) 
+
+

Macro Definition Documentation

+

define pinCheckGetData

+
#define pinCheckGetData (
+    pinNumber,
+    mask,
+    ret
+) PinInfo *pin = pinInfo(pinNumber);                                                                                 \
+    if (!pin)                                                                                                          \
+        return ret;                                                                                                    \
+    if (!pinSupported(pin, mask))                                                                                      \
+        return ret;                                                                                                    \
+    PinData *data = pinData(pin);
+
+

define pinCheckGetInfo

+
#define pinCheckGetInfo (
+    pinNumber,
+    mask,
+    ret
+) PinInfo *pin = pinInfo(pinNumber);                                                                                 \
+    if (!pin)                                                                                                          \
+        return ret;                                                                                                    \
+    if (!pinSupported(pin, mask))                                                                                      \
+        return ret;
+
+

define pinIsInput

+
#define pinIsInput (
+    pin,
+    data
+) (pinEnabled(pin, PIN_GPIO) && (data->gpioMode ^ 0b101) > 4)
+
+

define pinIsOutput

+
#define pinIsOutput (
+    pin,
+    data
+) (pinEnabled(pin, PIN_GPIO) && (data->gpioMode ^ 0b101) < 5)
+
+

define pinSetInputMode

+
#define pinSetInputMode (
+    pin,
+    data,
+    pinNumber
+) do {                                                                                                               \
+        if (!pinIsInput(pin, data))                                                                                    \
+            pinMode(pinNumber, INPUT);                                                                                 \
+    } while (0);
+
+

define pinSetOutputPull

+
#define pinSetOutputPull (
+    pin,
+    data,
+    pinNumber,
+    status
+) do {                                                                                                               \
+        if (!pinIsOutput(pin, data)) {                                                                                 \
+            pinMode(pinNumber, INPUT_PULLDOWN ^ !!status);                                                             \
+            return;                                                                                                    \
+        }                                                                                                              \
+    } while (0);
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/src/wiring/wiring_private.h

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/wiring__private_8h_source/index.html b/ltapi/wiring__private_8h_source/index.html new file mode 100644 index 000000000..c00f388a2 --- /dev/null +++ b/ltapi/wiring__private_8h_source/index.html @@ -0,0 +1,2358 @@ + + + + + + + + + + + + + + + + + + + + File wiring\_private.h - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File wiring_private.h

+

File List > arduino > src > wiring > wiring_private.h

+

Go to the documentation of this file.

+
/* Copyright (c) Kuba Szczodrzyński 2023-05-24. */
+
+#pragma once
+
+#include <Arduino.h>
+
+#if __has_include(<sdk_private.h>)
+#include <sdk_private.h>
+#endif
+
+#if __has_include(<wiring_data.h>)
+#include <wiring_data.h>
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+PinData *pinData(PinInfo *pin);
+void pinRemoveData(PinInfo *pin);
+
+inline void pinEnable(PinInfo *pin, uint32_t mask) {
+    pin->enabled |= mask;
+}
+
+inline void pinDisable(PinInfo *pin, uint32_t mask) {
+    pin->enabled &= ~mask;
+}
+
+#define pinCheckGetInfo(pinNumber, mask, ret)                                                                          \
+    PinInfo *pin = pinInfo(pinNumber);                                                                                 \
+    if (!pin)                                                                                                          \
+        return ret;                                                                                                    \
+    if (!pinSupported(pin, mask))                                                                                      \
+        return ret;
+
+#define pinCheckGetData(pinNumber, mask, ret)                                                                          \
+    PinInfo *pin = pinInfo(pinNumber);                                                                                 \
+    if (!pin)                                                                                                          \
+        return ret;                                                                                                    \
+    if (!pinSupported(pin, mask))                                                                                      \
+        return ret;                                                                                                    \
+    PinData *data = pinData(pin);
+
+#define pinIsOutput(pin, data) (pinEnabled(pin, PIN_GPIO) && (data->gpioMode ^ 0b101) < 5)
+#define pinIsInput(pin, data)  (pinEnabled(pin, PIN_GPIO) && (data->gpioMode ^ 0b101) > 4)
+
+#define pinSetOutputPull(pin, data, pinNumber, status)                                                                 \
+    do {                                                                                                               \
+        if (!pinIsOutput(pin, data)) {                                                                                 \
+            pinMode(pinNumber, INPUT_PULLDOWN ^ !!status);                                                             \
+            return;                                                                                                    \
+        }                                                                                                              \
+    } while (0);
+
+#define pinSetInputMode(pin, data, pinNumber)                                                                          \
+    do {                                                                                                               \
+        if (!pinIsInput(pin, data))                                                                                    \
+            pinMode(pinNumber, INPUT);                                                                                 \
+    } while (0);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/wiring__shift_8c/index.html b/ltapi/wiring__shift_8c/index.html new file mode 100644 index 000000000..9e67b767f --- /dev/null +++ b/ltapi/wiring__shift_8c/index.html @@ -0,0 +1,2376 @@ + + + + + + + + + + + + + + + + + + + + File wiring\_shift.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File wiring_shift.c

+

FileList > arduino > src > wiring > wiring_shift.c

+

Go to the source code of this file.

+
    +
  • #include <Arduino.h>
  • +
  • #include <stdint.h>
  • +
+

Public Functions

+ + + + + + + + + + + + + + + + + +
TypeName
uint8_tshiftIn (pin_size_t ulDataPin, pin_size_t ulClockPin, BitOrder ulBitOrder)
voidshiftOut (pin_size_t ulDataPin, pin_size_t ulClockPin, BitOrder ulBitOrder, uint8_t ulVal)
+

Public Functions Documentation

+

function shiftIn

+
uint8_t shiftIn (
+    pin_size_t ulDataPin,
+    pin_size_t ulClockPin,
+    BitOrder ulBitOrder
+) 
+
+

function shiftOut

+
void shiftOut (
+    pin_size_t ulDataPin,
+    pin_size_t ulClockPin,
+    BitOrder ulBitOrder,
+    uint8_t ulVal
+) 
+
+
+

The documentation for this class was generated from the following file cores/common/arduino/src/wiring/wiring_shift.c

+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/ltapi/wiring__shift_8c_source/index.html b/ltapi/wiring__shift_8c_source/index.html new file mode 100644 index 000000000..e0847154d --- /dev/null +++ b/ltapi/wiring__shift_8c_source/index.html @@ -0,0 +1,2348 @@ + + + + + + + + + + + + + + + + + + + + File wiring\_shift.c - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

File wiring_shift.c

+

File List > arduino > src > wiring > wiring_shift.c

+

Go to the documentation of this file.

+
/*
+  Copyright (c) 2014 Arduino.  All right reserved.
+
+  This library is free software; you can redistribute it and/or
+  modify it under the terms of the GNU Lesser General Public
+  License as published by the Free Software Foundation; either
+  version 2.1 of the License, or (at your option) any later version.
+
+  This library is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+  See the GNU Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this library; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+#include <Arduino.h>
+#include <stdint.h>
+
+uint8_t shiftIn(pin_size_t ulDataPin, pin_size_t ulClockPin, BitOrder ulBitOrder) {
+    uint8_t value = 0;
+    uint8_t i;
+
+    for (i = 0; i < 8; ++i) {
+        digitalWrite(ulClockPin, HIGH);
+
+        if (ulBitOrder == LSBFIRST) {
+            value |= digitalRead(ulDataPin) << i;
+        } else {
+            value |= digitalRead(ulDataPin) << (7 - i);
+        }
+
+        digitalWrite(ulClockPin, LOW);
+    }
+
+    return value;
+}
+
+void shiftOut(pin_size_t ulDataPin, pin_size_t ulClockPin, BitOrder ulBitOrder, uint8_t ulVal) {
+    uint8_t i;
+
+    for (i = 0; i < 8; i++) {
+        if (ulBitOrder == LSBFIRST) {
+            digitalWrite(ulDataPin, !!(ulVal & (1 << i)));
+        } else {
+            digitalWrite(ulDataPin, !!(ulVal & (1 << (7 - i))));
+        }
+
+        digitalWrite(ulClockPin, HIGH);
+        digitalWrite(ulClockPin, LOW);
+    }
+}
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/monitor/filter_rtl_hard_fault.py b/monitor/filter_rtl_hard_fault.py new file mode 100644 index 000000000..a3be685f7 --- /dev/null +++ b/monitor/filter_rtl_hard_fault.py @@ -0,0 +1,138 @@ +# Copyright (c) 2014-present PlatformIO +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +import re +import subprocess +import sys + +from platformio.commands.device import DeviceMonitorFilter +from platformio.compat import PY2, WINDOWS, path_to_unicode +from platformio.project.exception import PlatformioException +from platformio.project.helpers import load_project_ide_data + +# By design, __init__ is called inside miniterm and we can't pass context to it. +# pylint: disable=attribute-defined-outside-init + + +class RtlHardFaultDecoder(DeviceMonitorFilter): + NAME = "rtl_hard_fault_decoder" + + def __call__(self): + self.buffer = "" + self.re = re.compile(r"^RTL8195A\[HAL\]: (LR|PC) = (0x[0-9a-fA-F]+)") + + self.firmware_path = None + self.addr2line_path = None + self.enabled = self.setup_paths() + + if self.config.get("env:" + self.environment, "build_type") != "debug": + print( + """ +Please build project in debug configuration to get more details about an exception. +See https://docs.platformio.org/page/projectconf/build_configurations.html + +""" + ) + + return self + + def setup_paths(self): + self.project_dir = path_to_unicode(os.path.abspath(self.project_dir)) + try: + data = load_project_ide_data(self.project_dir, self.environment) + self.firmware_path = data["prog_path"] + if not os.path.isfile(self.firmware_path): + sys.stderr.write( + "%s: firmware at %s does not exist, rebuild the project?\n" + % (self.__class__.__name__, self.firmware_path) + ) + return False + + cc_path = data.get("cc_path", "") + if "-gcc" in cc_path: + path = cc_path.replace("arm-none-eabi-gcc", "arm-none-eabi-addr2line") + print(path) + if os.path.isfile(path): + self.addr2line_path = path + return True + except PlatformioException as e: + sys.stderr.write( + "%s: disabling, exception while looking for addr2line: %s\n" + % (self.__class__.__name__, e) + ) + return False + sys.stderr.write( + "%s: disabling, failed to find addr2line.\n" % self.__class__.__name__ + ) + return False + + def rx(self, text): + if not self.enabled: + return text + + last = 0 + while True: + idx = text.find("\n", last) + if idx == -1: + if len(self.buffer) < 4096: + self.buffer += text[last:] + break + + line = text[last:idx] + if self.buffer: + line = self.buffer + line + self.buffer = "" + last = idx + 1 + + m = self.re.match(line.strip()) + if m is None: + continue + + trace = self.addr2line(m.group(2)) + if trace: + text = text[: idx + 1] + trace + text[idx + 1 :] + last += len(trace) + return text + + def addr2line(self, addr): + trace = "" + enc = "mbcs" if WINDOWS else "utf-8" + args = [self.addr2line_path, "-fipC", "-e", self.firmware_path] + if PY2: + args = [a.encode(enc) for a in args] + try: + if PY2: + addr = addr.encode(enc) + output = subprocess.check_output(args + [addr]).decode(enc).strip() + output = output.replace( + "\n", "\n " + ) # newlines happen with inlined methods + output = self.strip_project_dir(output) + output = output.replace("\\", "/") + trace += " %s in %s\n" % (addr, output) + except subprocess.CalledProcessError as e: + sys.stderr.write( + "%s: failed to call %s: %s\n" + % (self.__class__.__name__, self.addr2line_path, e) + ) + return trace + + def strip_project_dir(self, trace): + while True: + idx = trace.find(self.project_dir) + if idx == -1: + break + trace = trace[:idx] + trace[idx + len(self.project_dir) + 1 :] + return trace diff --git a/platform.json b/platform.json new file mode 100644 index 000000000..473df643e --- /dev/null +++ b/platform.json @@ -0,0 +1,121 @@ +{ + "name": "libretiny", + "title": "LibreTiny", + "description": "PlatformIO development platform for IoT modules", + "repository": { + "type": "git", + "url": "https://github.com/libretiny-eu/libretiny.git" + }, + "version": "1.5.0", + "frameworks": { + "base": { + "title": "Base Framework (SDK only)", + "script": "builder/frameworks/base.py" + }, + "arduino": { + "title": "Arduino Framework", + "script": "builder/frameworks/arduino.py" + } + }, + "packages": { + "framework-realtek-amb1": { + "type": "framework", + "optional": true, + "version": "https://github.com/libretiny-eu/framework-realtek-amb1#v2022.06.21", + "version_prefix": true, + "toolchains": { + "any": "gccarmnoneeabi@~1.100301.0" + }, + "libraries": { + "freertos": "8.1.2", + "lwip": { + "1.4.1": "1.4.1-amb1", + "2.0.0": "2.0.0-amb1", + "2.1.3": "2.1.3-amb1", + "default": "2.1.3-amb1" + } + } + }, + "framework-realtek-ambz2": { + "type": "framework", + "optional": true, + "version": "https://github.com/libretiny-eu/framework-realtek-ambz2#v2022.11.17", + "version_prefix": true, + "toolchains": { + "any": "gccarmnoneeabi@~1.100301.0" + }, + "libraries": { + "freertos": "10.0.1", + "lwip": { + "2.0.3": "2.0.3-ambz2", + "2.1.3": "2.1.3-ambz2", + "default": "2.1.3-ambz2" + } + } + }, + "framework-beken-bdk": { + "type": "framework", + "optional": true, + "version": "https://github.com/libretiny-eu/framework-beken-bdk#v2021.06.07", + "version_prefix": true, + "toolchains": { + "any": "gccarmnoneeabi@~1.100301.0" + }, + "libraries": { + "freertos": "9.0.0", + "lwip": { + "2.0.2": "2.0.2-bdk", + "2.1.0": "2.1.0-bdk", + "2.1.3": "2.1.3-bdk", + "default": "2.1.3-bdk" + } + } + }, + "framework-arduino-api": { + "type": "framework", + "optional": true, + "version": "https://github.com/libretiny-eu/ArduinoCore-API#2022.08.24" + }, + "library-lwip": { + "type": "framework", + "optional": true, + "base_url": "https://github.com/libretiny-eu/lwip" + }, + "library-freertos": { + "type": "framework", + "optional": true, + "base_url": "https://github.com/libretiny-eu/library-freertos" + }, + "library-freertos-port": { + "type": "framework", + "version": "https://github.com/libretiny-eu/library-freertos-port#2023.05.23" + }, + "library-flashdb": { + "type": "framework", + "version": "https://github.com/libretiny-eu/library-flashdb#1.2.0" + }, + "library-printf": { + "type": "framework", + "version": "https://github.com/libretiny-eu/library-printf#6.1.0" + }, + "library-uf2ota": { + "type": "framework", + "version": "https://github.com/libretiny-eu/library-uf2ota#5.0.0" + }, + "toolchain-gccarmnoneeabi": { + "type": "toolchain", + "optionalVersions": [ + "~1.40804.0", + "~1.50401.0", + "~1.90301.0", + "~1.100301.0" + ] + }, + "tool-openocd": { + "type": "uploader", + "optional": true, + "owner": "platformio", + "version": "~2.1100.0" + } + } +} diff --git a/search/search_index.json b/search/search_index.json new file mode 100644 index 000000000..dfde5ea18 --- /dev/null +++ b/search/search_index.json @@ -0,0 +1 @@ +{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"LibreTiny","text":"

(formerly LibreTuya)

PlatformIO development platform for BK7231 and RTL8710 IoT chips.

The main goal of this project is to provide a usable build environment for IoT developers. While also providing vendor SDKs as PlatformIO cores, the project focuses on developing working Arduino-compatible cores for supported families. The cores are inspired by Espressif's official core for ESP32, which should make it easier to port/run existing ESP apps on less-common, unsupported IoT modules.

There's an ESPHome port based on LibreTiny, which supports BK7231 and RTL8710B chips.

Note: this project is work-in-progress.

"},{"location":"#getting-started","title":"\u2b50 Getting started \u2b50","text":""},{"location":"#license","title":"License","text":"

See LICENSE. Project is licensed under MIT License.

Parts of the code may come from third parties, vendor SDKs or other open-source projects. Most of these files are marked with appropriate copyright/author/license notices.

THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

"},{"location":"SUMMARY/","title":"","text":"
  • Home
  • \ud83d\ude0a Getting started
    • \u27a1\ufe0f Info on accessing GPIOs
  • \ud83d\udcfa Cloudcutter & ESPHome video guide
  • \ud83d\udca1 ESPHome setup guide
  • \ud83d\uded6 ESPHome Hassio Add-On
  • \ud83d\udcf2 Flashing/dumping guide
  • \ud83d\udd0c How to flash/enter download mode?
  • \ud83d\udcbb Chips, boards, features
    • All boards
  • \ud83c\udf6a Chip family docs & info
    • Beken BK72xx
      • Finding encryption keys
    • Realtek Ameba - info
    • Realtek AmebaZ
      • Debugging
      • Exception decoder
  • \ud83d\udd27 LT Configuration
  • \ud83e\uddd1 Programmer's manual
    • \u26a0\ufe0f Migration guide
    • \ud83d\udd0b PlatformIO Examples
    • \ud83d\udcd6 LibreTiny API
      • C API
      • C++ API
    • \ud83d\udcda Arduino Libraries
      • SoftwareSerial
      • WiFi
      • Flash
      • IPv6Address
      • MD5
      • mDNS
      • Update
      • WiFiClient
      • WiFiClientSecure
      • WiFiServer
      • WiFiUDP
      • HTTPClient
      • StreamString
      • WebServer
      • WiFiMulti
      • External compatible libraries
    • Full documentation
      • Classes
      • Functions
      • Macros
      • File list
  • \ud83d\udc77 Contributor's manual (WIP)
    • Porting new families
    • API functions guide
    • C standard library
    • \ud83d\udcc1 Project structure
    • \u2708\ufe0f OTA format
      • uf2ota.py tool
      • uf2ota.h library
    • \ud83d\udcd3 TODO
  • \ud83d\udd17 Resources
"},{"location":"boards/SUMMARY/","title":"SUMMARY","text":"
  • Generic - BK7231N (Tuya QFN32)
  • Generic - BK7231T (Tuya QFN32)
  • Generic - BK7252
  • Generic - RTL8710BN (2M/468k)
  • Generic - RTL8710BN (2M/788k)
  • Generic - RTL8710BX (4M/980k)
  • Generic - RTL8720CF (2M/992k)
  • BW12
  • BW15
  • CB1S
  • CB2L
  • CB2S
  • CB3L
  • CB3S
  • CB3SE
  • CBLC5
  • CBU
  • WB2L-M1
  • WA2
  • WB1S
  • WB2L
  • WB2S
  • WB3L
  • WB3S
  • WBLC5
  • WR1
  • WR1E
  • WR2
  • WR2E
  • WR3
  • WR3E
  • WR3N
  • WR2L
  • WR2LE
  • WR3L
  • WR3LE
  • LSC LMA35 N
  • LSC LMA35 T
  • T102-V1.1
  • T112-V1.1
  • T103-V1.0
"},{"location":"boards/bw12/","title":"BW12","text":"

by Ai-Thinker Co., Ltd.

Product page

  • Info & flashing guide
  • Debugging
  • Vendor datasheet
Parameter Value Board code bw12 MCU RTL8710BX Manufacturer Realtek Series AmebaZ Frequency 62.5 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 11x GPIO, 6x PWM, 2x UART, 1x ADC Wi-Fi 802.11 b/g/n FCC ID 2ARI3-BW1X"},{"location":"boards/bw12/#usage","title":"Usage","text":"

Board code: bw12

In platformio.ini:

[env:bw12]\nplatform = libretiny\nboard = bw12\nframework = arduino\n

In ESPHome YAML:

rtl87xx:\n  board: bw12\n
"},{"location":"boards/bw12/#pinout","title":"Pinout","text":""},{"location":"boards/bw12/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other PA00 PWM2 PA05 PWM4 PA12 PWM3 PA14 PWM0 SWCLK PA15 PWM1 SWDIO PA18 RX0 SCL1 SCK0, SCK1 PA19, ADC1 SDA0 CS0, CS1 PA22 SCL0 MISO0, MISO1 PWM5 PA23 TX0 SDA1 MOSI0, MOSI1 PWM0 PA29 RX2 SCL0 PWM4 PA30 TX2 SDA0 PWM4"},{"location":"boards/bw12/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Boot XIP 0x000000 16 KiB / 0x4000 0x004000 Boot RAM 0x004000 16 KiB / 0x4000 0x008000 (reserved) 0x008000 4 KiB / 0x1000 0x009000 System Data 0x009000 4 KiB / 0x1000 0x00A000 Calibration 0x00A000 4 KiB / 0x1000 0x00B000 OTA1 Image 0x00B000 468 KiB / 0x75000 0x080000 OTA2 Image 0x080000 468 KiB / 0x75000 0x0F5000 Key-Value Store 0x0F5000 32 KiB / 0x8000 0x0FD000 User Data 0x0FD000 1 MiB / 0x102000 0x1FF000 RDP 0x1FF000 4 KiB / 0x1000 0x200000"},{"location":"boards/bw15/","title":"BW15","text":"

by Ai-Thinker Co., Ltd.

Product page

  • General info
  • Vendor datasheet
Parameter Value Board code bw15 MCU RTL8720CF Manufacturer Realtek Series AmebaZ2 Frequency 100 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 13x GPIO, 8x PWM, 3x UART Wi-Fi 802.11 b/g/n BLE v4.2 FCC ID 2AXVG-BW15"},{"location":"boards/bw15/#usage","title":"Usage","text":"

Board code: bw15

In platformio.ini:

[env:bw15]\nplatform = libretiny\nboard = bw15\nframework = arduino\n

In ESPHome YAML:

rtl87xx:\n  board: bw15\n
"},{"location":"boards/bw15/#pinout","title":"Pinout","text":""},{"location":"boards/bw15/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other PA00 RX1 PWM0 SWCLK, TCK PA01 TX1 PWM1 SWDIO, TMS PA02 RX1 SCL0 CS0 PWM2 TDO PA03 TX1 SDA0 SCK0 PWM3 TDI PA04 MOSI0 PWM4 tRST PA13 RX0 PWM7 PA14 TX0 PWM2 PA15 RX2 SCL0 CS0 PWM3 PA16 TX2 SDA0 SCK0 PWM4 PA17 PWM5 PA18 PWM6 PA19 SCL0 MOSI0 PWM7 PA20 SDA0 MISO0 PWM0"},{"location":"boards/bw15/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Partition Table 0x000000 4 KiB / 0x1000 0x001000 System Data 0x001000 4 KiB / 0x1000 0x002000 Calibration 0x002000 4 KiB / 0x1000 0x003000 (reserved) 0x003000 4 KiB / 0x1000 0x004000 Boot Image 0x004000 32 KiB / 0x8000 0x00C000 OTA1 Image 0x00C000 992 KiB / 0xF8000 0x104000 OTA2 Image 0x104000 992 KiB / 0xF8000 0x1FC000 Key-Value Store 0x1FC000 16 KiB / 0x4000 0x200000"},{"location":"boards/cb1s/","title":"CB1S Wi-Fi Module","text":"

by Tuya Inc.

Product page

  • Info & flashing guide
Parameter Value Board code cb1s MCU BK7231N Manufacturer Beken Series BK72XX Frequency 120 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 14x GPIO, 6x PWM, 2x UART, 1x ADC Wi-Fi 802.11 b/g/n Bluetooth BLE v5.1"},{"location":"boards/cb1s/#usage","title":"Usage","text":"

Board code: cb1s

In platformio.ini:

[env:cb1s]\nplatform = libretiny\nboard = cb1s\nframework = arduino\n

In ESPHome YAML:

bk72xx:\n  board: cb1s\n
"},{"location":"boards/cb1s/#pinout","title":"Pinout","text":""},{"location":"boards/cb1s/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other P0 TX2 SCL2 P1 RX2 SDA2 P6 PWM0 P7 PWM1 P8 PWM2 P9 PWM3 P10 RX1 P11 TX1 P20 SCL1 TCK P21 SDA1 TMS P22 TDI P23, ADC3 TDO P24 PWM4 P26 PWM5"},{"location":"boards/cb1s/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Bootloader 0x000000 68 KiB / 0x11000 0x011000 App Image 0x011000 1.1 MiB / 0x119000 0x12A000 OTA Image 0x12A000 664 KiB / 0xA6000 0x1D0000 Calibration 0x1D0000 4 KiB / 0x1000 0x1D1000 Network Data 0x1D1000 4 KiB / 0x1000 0x1D2000 TLV Store 0x1D2000 4 KiB / 0x1000 0x1D3000 Key-Value Store 0x1D3000 32 KiB / 0x8000 0x1DB000 User Data 0x1DB000 148 KiB / 0x25000 0x200000 Tuya Storage 0x1ED000 76 KiB / 0x13000 0x200000

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

"},{"location":"boards/cb2l/","title":"CB2L Wi-Fi Module","text":"

by Tuya Inc.

Product page

  • Info & flashing guide
Parameter Value Board code cb2l MCU BK7231N Manufacturer Beken Series BK72XX Frequency 120 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 9x GPIO, 5x PWM, 2x UART Wi-Fi 802.11 b/g/n Bluetooth BLE v5.1 FCC ID 2ANDL-CB2L"},{"location":"boards/cb2l/#usage","title":"Usage","text":"

Board code: cb2l

In platformio.ini:

[env:cb2l]\nplatform = libretiny\nboard = cb2l\nframework = arduino\n

In ESPHome YAML:

bk72xx:\n  board: cb2l\n
"},{"location":"boards/cb2l/#pinout","title":"Pinout","text":""},{"location":"boards/cb2l/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other P0 TX2 P6 PWM0 P7 PWM1 P8 PWM2 P10 RX1 P11 TX1 P21 P24 PWM4 P26 PWM5"},{"location":"boards/cb2l/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Bootloader 0x000000 68 KiB / 0x11000 0x011000 App Image 0x011000 1.1 MiB / 0x119000 0x12A000 OTA Image 0x12A000 664 KiB / 0xA6000 0x1D0000 Calibration 0x1D0000 4 KiB / 0x1000 0x1D1000 Network Data 0x1D1000 4 KiB / 0x1000 0x1D2000 TLV Store 0x1D2000 4 KiB / 0x1000 0x1D3000 Key-Value Store 0x1D3000 32 KiB / 0x8000 0x1DB000 User Data 0x1DB000 148 KiB / 0x25000 0x200000 Tuya Storage 0x1ED000 76 KiB / 0x13000 0x200000

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

"},{"location":"boards/cb2s/","title":"CB2S Wi-Fi Module","text":"

by Tuya Inc.

Product page

  • Info & flashing guide
Parameter Value Board code cb2s MCU BK7231N Manufacturer Beken Series BK72XX Frequency 120 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 11x GPIO, 5x PWM, 2x UART, 1x ADC Wi-Fi 802.11 b/g/n Bluetooth BLE v5.1 FCC ID 2ANDL-CB2S"},{"location":"boards/cb2s/#usage","title":"Usage","text":"

Board code: cb2s

In platformio.ini:

[env:cb2s]\nplatform = libretiny\nboard = cb2s\nframework = arduino\n

In ESPHome YAML:

bk72xx:\n  board: cb2s\n
"},{"location":"boards/cb2s/#pinout","title":"Pinout","text":""},{"location":"boards/cb2s/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other P0 TX2 SCL2 P1 RX2 SDA2 P6 PWM0 P7 PWM1 P8 PWM2 P10 RX1 P11 TX1 P21 SDA1 P23, ADC3 P24 PWM4 P26 PWM5"},{"location":"boards/cb2s/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Bootloader 0x000000 68 KiB / 0x11000 0x011000 App Image 0x011000 1.1 MiB / 0x119000 0x12A000 OTA Image 0x12A000 664 KiB / 0xA6000 0x1D0000 Calibration 0x1D0000 4 KiB / 0x1000 0x1D1000 Network Data 0x1D1000 4 KiB / 0x1000 0x1D2000 TLV Store 0x1D2000 4 KiB / 0x1000 0x1D3000 Key-Value Store 0x1D3000 32 KiB / 0x8000 0x1DB000 User Data 0x1DB000 148 KiB / 0x25000 0x200000 Tuya Storage 0x1ED000 76 KiB / 0x13000 0x200000

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

"},{"location":"boards/cb3l/","title":"CB3L Wi-Fi Module","text":"

by Tuya Inc.

Product page

  • Info & flashing guide
Parameter Value Board code cb3l MCU BK7231N Manufacturer Beken Series BK72XX Frequency 120 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 12x GPIO, 6x PWM, 2x UART, 1x ADC Wi-Fi 802.11 b/g/n Bluetooth BLE v5.1 FCC ID 2ANDL-CB3L"},{"location":"boards/cb3l/#usage","title":"Usage","text":"

Board code: cb3l

In platformio.ini:

[env:cb3l]\nplatform = libretiny\nboard = cb3l\nframework = arduino\n

In ESPHome YAML:

bk72xx:\n  board: cb3l\n
"},{"location":"boards/cb3l/#pinout","title":"Pinout","text":""},{"location":"boards/cb3l/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other P0 TX2 P6 PWM0 P7 PWM1 P8 PWM2 P9 PWM3 P10 RX1 P11 TX1 P14 P21 P23, ADC3 P24 PWM4 P26 PWM5"},{"location":"boards/cb3l/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Bootloader 0x000000 68 KiB / 0x11000 0x011000 App Image 0x011000 1.1 MiB / 0x119000 0x12A000 OTA Image 0x12A000 664 KiB / 0xA6000 0x1D0000 Calibration 0x1D0000 4 KiB / 0x1000 0x1D1000 Network Data 0x1D1000 4 KiB / 0x1000 0x1D2000 TLV Store 0x1D2000 4 KiB / 0x1000 0x1D3000 Key-Value Store 0x1D3000 32 KiB / 0x8000 0x1DB000 User Data 0x1DB000 148 KiB / 0x25000 0x200000 Tuya Storage 0x1ED000 76 KiB / 0x13000 0x200000

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

"},{"location":"boards/cb3s/","title":"CB3S Wi-Fi Module","text":"

by Tuya Inc.

Product page

  • Info & flashing guide
Parameter Value Board code cb3s MCU BK7231N Manufacturer Beken Series BK72XX Frequency 120 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 14x GPIO, 6x PWM, 2x UART, 1x ADC Wi-Fi 802.11 b/g/n Bluetooth BLE v5.1 FCC ID 2ANDL-CB3S"},{"location":"boards/cb3s/#usage","title":"Usage","text":"

Board code: cb3s

In platformio.ini:

[env:cb3s]\nplatform = libretiny\nboard = cb3s\nframework = arduino\n

In ESPHome YAML:

bk72xx:\n  board: cb3s\n
"},{"location":"boards/cb3s/#pinout","title":"Pinout","text":""},{"location":"boards/cb3s/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other P0 TX2 P6 PWM0 P7 PWM1 P8 PWM2 P9 PWM3 P10 RX1 P11 TX1 P14 P20 SCL1 TCK P21 SDA1 TMS P22 TDI P23, ADC3 TDO P24 PWM4 P26 PWM5"},{"location":"boards/cb3s/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Bootloader 0x000000 68 KiB / 0x11000 0x011000 App Image 0x011000 1.1 MiB / 0x119000 0x12A000 OTA Image 0x12A000 664 KiB / 0xA6000 0x1D0000 Calibration 0x1D0000 4 KiB / 0x1000 0x1D1000 Network Data 0x1D1000 4 KiB / 0x1000 0x1D2000 TLV Store 0x1D2000 4 KiB / 0x1000 0x1D3000 Key-Value Store 0x1D3000 32 KiB / 0x8000 0x1DB000 User Data 0x1DB000 148 KiB / 0x25000 0x200000 Tuya Storage 0x1ED000 76 KiB / 0x13000 0x200000

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

"},{"location":"boards/cb3se/","title":"CB3SE Wi-Fi Module","text":"

by Tuya Inc.

Product page

  • Info & flashing guide
Parameter Value Board code cb3se MCU BK7231N Manufacturer Beken Series BK72XX Frequency 120 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 17x GPIO, 6x PWM, 2x UART, 1x ADC Wi-Fi 802.11 b/g/n Bluetooth BLE v5.1 FCC ID 2ANDL-CB3SE"},{"location":"boards/cb3se/#usage","title":"Usage","text":"

Board code: cb3se

In platformio.ini:

[env:cb3se]\nplatform = libretiny\nboard = cb3se\nframework = arduino\n

In ESPHome YAML:

bk72xx:\n  board: cb3se\n
"},{"location":"boards/cb3se/#pinout","title":"Pinout","text":""},{"location":"boards/cb3se/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other P0 TX2 SCL2 P1 RX2 SDA2 P6 PWM0 P7 PWM1 P8 PWM2 P9 PWM3 P10 RX1 P11 TX1 P14 SCK P15 CS P16 MOSI P17 MISO P20 P22 P23, ADC3 P24 PWM4 P26 PWM5"},{"location":"boards/cb3se/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Bootloader 0x000000 68 KiB / 0x11000 0x011000 App Image 0x011000 1.1 MiB / 0x119000 0x12A000 OTA Image 0x12A000 664 KiB / 0xA6000 0x1D0000 Calibration 0x1D0000 4 KiB / 0x1000 0x1D1000 Network Data 0x1D1000 4 KiB / 0x1000 0x1D2000 TLV Store 0x1D2000 4 KiB / 0x1000 0x1D3000 Key-Value Store 0x1D3000 32 KiB / 0x8000 0x1DB000 User Data 0x1DB000 148 KiB / 0x25000 0x200000 Tuya Storage 0x1ED000 76 KiB / 0x13000 0x200000

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

"},{"location":"boards/cblc5/","title":"CBLC5 Wi-Fi Module","text":"

by Tuya Inc.

Product page

  • Info & flashing guide
Parameter Value Board code cblc5 MCU BK7231N Manufacturer Beken Series BK72XX Frequency 120 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 8x GPIO, 3x PWM, 2x UART Wi-Fi 802.11 b/g/n Bluetooth BLE v5.1"},{"location":"boards/cblc5/#usage","title":"Usage","text":"

Board code: cblc5

In platformio.ini:

[env:cblc5]\nplatform = libretiny\nboard = cblc5\nframework = arduino\n

In ESPHome YAML:

bk72xx:\n  board: cblc5\n
"},{"location":"boards/cblc5/#pinout","title":"Pinout","text":""},{"location":"boards/cblc5/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other P0 TX2 SCL2 P1 RX2 SDA2 P6 PWM0 P10 RX1 P11 TX1 P21 P24 PWM4 P26 PWM5"},{"location":"boards/cblc5/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Bootloader 0x000000 68 KiB / 0x11000 0x011000 App Image 0x011000 1.1 MiB / 0x119000 0x12A000 OTA Image 0x12A000 664 KiB / 0xA6000 0x1D0000 Calibration 0x1D0000 4 KiB / 0x1000 0x1D1000 Network Data 0x1D1000 4 KiB / 0x1000 0x1D2000 TLV Store 0x1D2000 4 KiB / 0x1000 0x1D3000 Key-Value Store 0x1D3000 32 KiB / 0x8000 0x1DB000 User Data 0x1DB000 148 KiB / 0x25000 0x200000 Tuya Storage 0x1ED000 76 KiB / 0x13000 0x200000

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

"},{"location":"boards/cbu/","title":"CBU Wi-Fi Module","text":"

by Tuya Inc.

Product page

  • Info & flashing guide
Parameter Value Board code cbu MCU BK7231N Manufacturer Beken Series BK72XX Frequency 120 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 19x GPIO, 6x PWM, 2x UART, 1x ADC Wi-Fi 802.11 b/g/n Bluetooth BLE v5.1 FCC ID 2ANDL-CBU"},{"location":"boards/cbu/#usage","title":"Usage","text":"

Board code: cbu

In platformio.ini:

[env:cbu]\nplatform = libretiny\nboard = cbu\nframework = arduino\n

In ESPHome YAML:

bk72xx:\n  board: cbu\n
"},{"location":"boards/cbu/#pinout","title":"Pinout","text":""},{"location":"boards/cbu/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other P0 TX2 SCL2 P1 RX2 SDA2 P6 PWM0 P7 PWM1 P8 PWM2 P9 PWM3 P10 RX1 P11 TX1 P14 SCK P15 CS P16 MOSI P17 MISO P20 SCL1 TCK P21 SDA1 TMS P22 TDI P23, ADC3 TDO P24 PWM4 P26 PWM5 P28"},{"location":"boards/cbu/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Bootloader 0x000000 68 KiB / 0x11000 0x011000 App Image 0x011000 1.1 MiB / 0x119000 0x12A000 OTA Image 0x12A000 664 KiB / 0xA6000 0x1D0000 Calibration 0x1D0000 4 KiB / 0x1000 0x1D1000 Network Data 0x1D1000 4 KiB / 0x1000 0x1D2000 TLV Store 0x1D2000 4 KiB / 0x1000 0x1D3000 Key-Value Store 0x1D3000 32 KiB / 0x8000 0x1DB000 User Data 0x1DB000 148 KiB / 0x25000 0x200000 Tuya Storage 0x1ED000 76 KiB / 0x13000 0x200000

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

"},{"location":"boards/generic-bk7231n-qfn32-tuya/","title":"Generic - BK7231N (Tuya QFN32)","text":"

by Generic

Product page

  • Info & flashing guide
Parameter Value Board code generic-bk7231n-qfn32-tuya MCU BK7231N Manufacturer Beken Series BK72XX Frequency 120 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 19x GPIO, 6x PWM, 2x UART, 1x ADC Wi-Fi 802.11 b/g/n Bluetooth BLE v5.1"},{"location":"boards/generic-bk7231n-qfn32-tuya/#usage","title":"Usage","text":"

Board code: generic-bk7231n-qfn32-tuya

In platformio.ini:

[env:generic-bk7231n-qfn32-tuya]\nplatform = libretiny\nboard = generic-bk7231n-qfn32-tuya\nframework = arduino\n

In ESPHome YAML:

bk72xx:\n  board: generic-bk7231n-qfn32-tuya\n
"},{"location":"boards/generic-bk7231n-qfn32-tuya/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other P0 TX2 SCL2 P1 RX2 SDA2 P6 PWM0 P7 PWM1 P8 PWM2 P9 PWM3 P10 RX1 P11 TX1 P14 SCK P15 CS P16 MOSI P17 MISO P20 SCL1 TCK P21 SDA1 TMS P22 TDI P23, ADC3 TDO P24 PWM4 P26 PWM5 P28"},{"location":"boards/generic-bk7231n-qfn32-tuya/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Bootloader 0x000000 68 KiB / 0x11000 0x011000 App Image 0x011000 1.1 MiB / 0x119000 0x12A000 OTA Image 0x12A000 664 KiB / 0xA6000 0x1D0000 Calibration 0x1D0000 4 KiB / 0x1000 0x1D1000 Network Data 0x1D1000 4 KiB / 0x1000 0x1D2000 TLV Store 0x1D2000 4 KiB / 0x1000 0x1D3000 Key-Value Store 0x1D3000 32 KiB / 0x8000 0x1DB000 User Data 0x1DB000 148 KiB / 0x25000 0x200000 Tuya Storage 0x1ED000 76 KiB / 0x13000 0x200000

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

"},{"location":"boards/generic-bk7231t-qfn32-tuya/","title":"Generic - BK7231T (Tuya QFN32)","text":"

by Generic

Product page

  • Info & flashing guide
Parameter Value Board code generic-bk7231t-qfn32-tuya MCU BK7231T Manufacturer Beken Series BK72XX Frequency 120 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 19x GPIO, 6x PWM, 2x UART, 1x ADC Wi-Fi 802.11 b/g/n Bluetooth BLE v4.2"},{"location":"boards/generic-bk7231t-qfn32-tuya/#usage","title":"Usage","text":"

Board code: generic-bk7231t-qfn32-tuya

In platformio.ini:

[env:generic-bk7231t-qfn32-tuya]\nplatform = libretiny\nboard = generic-bk7231t-qfn32-tuya\nframework = arduino\n

In ESPHome YAML:

bk72xx:\n  board: generic-bk7231t-qfn32-tuya\n
"},{"location":"boards/generic-bk7231t-qfn32-tuya/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other P0 TX2 SCL2 P1 RX2 SDA2 P6 PWM0 P7 PWM1 P8 PWM2 P9 PWM3 P10 RX1 P11 TX1 P14 SCK P15 CS P16 MOSI P17 MISO P20 SCL1 TCK P21 SDA1 TMS P22 TDI P23, ADC3 TDO P24 PWM4 P26 PWM5 P28"},{"location":"boards/generic-bk7231t-qfn32-tuya/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Bootloader 0x000000 68 KiB / 0x11000 0x011000 App Image 0x011000 1.1 MiB / 0x121000 0x132000 OTA Image 0x132000 664 KiB / 0xA6000 0x1D8000 Key-Value Store 0x1D8000 32 KiB / 0x8000 0x1E0000 Calibration 0x1E0000 4 KiB / 0x1000 0x1E1000 TLV Store 0x1E1000 4 KiB / 0x1000 0x1E2000 Network Data 0x1E2000 4 KiB / 0x1000 0x1E3000 User Data 0x1E3000 116 KiB / 0x1D000 0x200000 Tuya Storage 0x1ED000 76 KiB / 0x13000 0x200000

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

"},{"location":"boards/generic-bk7252/","title":"Generic - BK7252","text":"

by Generic

Product page

  • Info & flashing guide
Parameter Value Board code generic-bk7252 MCU BK7252 Manufacturer Beken Series BK72XX Frequency 180 MHz Flash size 4 MiB RAM size 512 KiB Voltage 3.0V - 3.6V I/O 38x GPIO, 4x PWM, 2x UART, 7x ADC Wi-Fi 802.11 b/g/n Bluetooth BLE v5.0"},{"location":"boards/generic-bk7252/#usage","title":"Usage","text":"

Board code: generic-bk7252

In platformio.ini:

[env:generic-bk7252]\nplatform = libretiny\nboard = generic-bk7252\nframework = arduino\n

In ESPHome YAML:

bk72xx:\n  board: generic-bk7252\n
"},{"location":"boards/generic-bk7252/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other P0 TX2 SCL2 P1 RX2 SDA2 P2, ADC4 P3, ADC5 P4, ADC1 P5, ADC2 P6 PWM0 P7 PWM1 P10 RX1 P11 TX1 P12, ADC6 CTS1 P13, ADC7 RTS1 P14 SCK P15 CS P16 MOSI P17 MISO P18 P19 P20 SCL1 TCK P21 SDA1 TMS P22 TDI P23, ADC3 TDO P24 PWM4 P25 P26 PWM5 P27 MCLK P28 P29 PCLK P30 HSYNC P31 VSYNC P32 PD0 P33 PD1 P34 PD2 P35 PD3 P36 PD4 P37 PD5 P38 PD6 P39 PD7"},{"location":"boards/generic-bk7252/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 4 MiB / 4,194,304 B / 0x400000

Hex values are in bytes.

Name Start Length End Bootloader 0x000000 68 KiB / 0x11000 0x011000 App Image 0x011000 1.7 MiB / 0x1BA000 0x1CB000 File System 0x1CB000 1.1 MiB / 0x119000 0x2E4000 Key-Value Store 0x2E4000 32 KiB / 0x8000 0x2EC000 OTA Image 0x2EC000 1.1 MiB / 0x112000 0x3FE000 Calibration 0x3FE000 4 KiB / 0x1000 0x3FF000 TLV Store 0x3FF000 4 KiB / 0x1000 0x400000

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

"},{"location":"boards/generic-rtl8710bn-2mb-468k/","title":"Generic - RTL8710BN (2M/468k)","text":"

by Generic

Product page

  • Info & flashing guide
  • Debugging
Parameter Value Board code generic-rtl8710bn-2mb-468k MCU RTL8710BN Manufacturer Realtek Series AmebaZ Frequency 125 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 17x GPIO, 6x PWM, 2x UART, 2x ADC Wi-Fi 802.11 b/g/n"},{"location":"boards/generic-rtl8710bn-2mb-468k/#usage","title":"Usage","text":"

Board code: generic-rtl8710bn-2mb-468k

In platformio.ini:

[env:generic-rtl8710bn-2mb-468k]\nplatform = libretiny\nboard = generic-rtl8710bn-2mb-468k\nframework = arduino\n

In ESPHome YAML:

rtl87xx:\n  board: generic-rtl8710bn-2mb-468k\n
"},{"location":"boards/generic-rtl8710bn-2mb-468k/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other PA00 PWM2 PA05 PWM4 PA06 FCS PA07 FD1 PA08 FD2 PA09 FD0 PA10 FSCK PA11 FD3 PA12 PWM3 PA14 PWM0 SWCLK PA15 PWM1 SWDIO PA18 RX0 SCL1 SCK0, SCK1 PA19, ADC1 CTS0 SDA0 CS0, CS1 PA22 RTS0 SCL0 MISO0, MISO1 PWM5 PA23 TX0 SDA1 MOSI0, MOSI1 PWM0 PA29 RX2 SCL0 PWM4 PA30 TX2 SDA0 PWM4"},{"location":"boards/generic-rtl8710bn-2mb-468k/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Boot XIP 0x000000 16 KiB / 0x4000 0x004000 Boot RAM 0x004000 16 KiB / 0x4000 0x008000 (reserved) 0x008000 4 KiB / 0x1000 0x009000 System Data 0x009000 4 KiB / 0x1000 0x00A000 Calibration 0x00A000 4 KiB / 0x1000 0x00B000 OTA1 Image 0x00B000 468 KiB / 0x75000 0x080000 OTA2 Image 0x080000 468 KiB / 0x75000 0x0F5000 Key-Value Store 0x0F5000 32 KiB / 0x8000 0x0FD000 User Data 0x0FD000 1 MiB / 0x102000 0x1FF000 RDP 0x1FF000 4 KiB / 0x1000 0x200000"},{"location":"boards/generic-rtl8710bn-2mb-788k/","title":"Generic - RTL8710BN (2M/788k)","text":"

by Generic

Product page

  • Info & flashing guide
  • Debugging
Parameter Value Board code generic-rtl8710bn-2mb-788k MCU RTL8710BN Manufacturer Realtek Series AmebaZ Frequency 125 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 17x GPIO, 6x PWM, 2x UART, 2x ADC Wi-Fi 802.11 b/g/n"},{"location":"boards/generic-rtl8710bn-2mb-788k/#usage","title":"Usage","text":"

Board code: generic-rtl8710bn-2mb-788k

In platformio.ini:

[env:generic-rtl8710bn-2mb-788k]\nplatform = libretiny\nboard = generic-rtl8710bn-2mb-788k\nframework = arduino\n

In ESPHome YAML:

rtl87xx:\n  board: generic-rtl8710bn-2mb-788k\n
"},{"location":"boards/generic-rtl8710bn-2mb-788k/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other PA00 PWM2 PA05 PWM4 PA06 FCS PA07 FD1 PA08 FD2 PA09 FD0 PA10 FSCK PA11 FD3 PA12 PWM3 PA14 PWM0 SWCLK PA15 PWM1 SWDIO PA18 RX0 SCL1 SCK0, SCK1 PA19, ADC1 CTS0 SDA0 CS0, CS1 PA22 RTS0 SCL0 MISO0, MISO1 PWM5 PA23 TX0 SDA1 MOSI0, MOSI1 PWM0 PA29 RX2 SCL0 PWM4 PA30 TX2 SDA0 PWM4"},{"location":"boards/generic-rtl8710bn-2mb-788k/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Boot XIP 0x000000 16 KiB / 0x4000 0x004000 Boot RAM 0x004000 16 KiB / 0x4000 0x008000 (reserved) 0x008000 4 KiB / 0x1000 0x009000 System Data 0x009000 4 KiB / 0x1000 0x00A000 Calibration 0x00A000 4 KiB / 0x1000 0x00B000 OTA1 Image 0x00B000 788 KiB / 0xC5000 0x0D0000 OTA2 Image 0x0D0000 788 KiB / 0xC5000 0x195000 Key-Value Store 0x195000 32 KiB / 0x8000 0x19D000 User Data 0x19D000 392 KiB / 0x62000 0x1FF000 RDP 0x1FF000 4 KiB / 0x1000 0x200000"},{"location":"boards/generic-rtl8710bx-4mb-980k/","title":"Generic - RTL8710BX (4M/980k)","text":"

by Generic

Product page

  • Info & flashing guide
  • Debugging
Parameter Value Board code generic-rtl8710bx-4mb-980k MCU RTL8710BX Manufacturer Realtek Series AmebaZ Frequency 62.5 MHz Flash size 4 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 17x GPIO, 6x PWM, 2x UART, 1x ADC Wi-Fi 802.11 b/g/n"},{"location":"boards/generic-rtl8710bx-4mb-980k/#usage","title":"Usage","text":"

Board code: generic-rtl8710bx-4mb-980k

In platformio.ini:

[env:generic-rtl8710bx-4mb-980k]\nplatform = libretiny\nboard = generic-rtl8710bx-4mb-980k\nframework = arduino\n

In ESPHome YAML:

rtl87xx:\n  board: generic-rtl8710bx-4mb-980k\n
"},{"location":"boards/generic-rtl8710bx-4mb-980k/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other PA00 PWM2 PA05 PWM4 PA06 FCS PA07 FD1 PA08 FD2 PA09 FD0 PA10 FSCK PA11 FD3 PA12 PWM3 PA14 PWM0 SWCLK PA15 PWM1 SWDIO PA18 RX0 SCL1 SCK0, SCK1 PA19, ADC1 CTS0 SDA0 CS0, CS1 PA22 RTS0 SCL0 MISO0, MISO1 PWM5 PA23 TX0 SDA1 MOSI0, MOSI1 PWM0 PA29 RX2 SCL0 PWM4 PA30 TX2 SDA0 PWM4"},{"location":"boards/generic-rtl8710bx-4mb-980k/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 4 MiB / 4,194,304 B / 0x400000

Hex values are in bytes.

Name Start Length End Boot XIP 0x000000 16 KiB / 0x4000 0x004000 Boot RAM 0x004000 16 KiB / 0x4000 0x008000 (reserved) 0x008000 4 KiB / 0x1000 0x009000 System Data 0x009000 4 KiB / 0x1000 0x00A000 Calibration 0x00A000 4 KiB / 0x1000 0x00B000 OTA1 Image 0x00B000 980 KiB / 0xF5000 0x100000 OTA2 Image 0x100000 980 KiB / 0xF5000 0x1F5000 Key-Value Store 0x1F5000 32 KiB / 0x8000 0x1FD000 User Data 0x1FD000 2 MiB / 0x202000 0x3FF000 RDP 0x1FF000 4 KiB / 0x1000 0x200000"},{"location":"boards/generic-rtl8710bx-4mb-980k/#information","title":"Information","text":"

This is a generic board definition for RTL8710BX with 4 MiB of flash. It has a bigger application partition size (980 KiB). The used bootloader is also different from the standard Tuya one.

It can be found in Ezviz T31 smart plug - bare chip soldered onto the manufacturer-made PCB. The plug is not Tuya/SmartLife-compatible and has a 25Q32CSIG flash chip. Refer to libretiny#23 for photos and more information.

Note that stock firmware seems to use smaller app images (0x80000 / 512 KiB). After 0x180000 some product-test data and device logs can be found. Because the OTA2 offset is 0x100000, the board definition was configured to use all available space.

"},{"location":"boards/generic-rtl8720cf-2mb-992k/","title":"Generic - RTL8720CF (2M/992k)","text":"

by Generic

Product page

  • General info
Parameter Value Board code generic-rtl8720cf-2mb-992k MCU RTL8720CF Manufacturer Realtek Series AmebaZ2 Frequency 100 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 20x GPIO, 8x PWM, 3x UART Wi-Fi 802.11 b/g/n BLE v4.2"},{"location":"boards/generic-rtl8720cf-2mb-992k/#usage","title":"Usage","text":"

Board code: generic-rtl8720cf-2mb-992k

In platformio.ini:

[env:generic-rtl8720cf-2mb-992k]\nplatform = libretiny\nboard = generic-rtl8720cf-2mb-992k\nframework = arduino\n

In ESPHome YAML:

rtl87xx:\n  board: generic-rtl8720cf-2mb-992k\n
"},{"location":"boards/generic-rtl8720cf-2mb-992k/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other PA00 RX1 PWM0 SWCLK, TCK PA01 TX1 PWM1 SWDIO, TMS PA02 RX1 SCL0 CS0 PWM2 TDO PA03 TX1 SDA0 SCK0 PWM3 TDI PA04 CTS1 MOSI0 PWM4 tRST PA07 CS0 PA08 SCK0 PA09 RTS0 MOSI0 PA10 CTS0 MISO0 PA11 TX0 SCL0 PWM0 PA12 RX0 SDA0 PWM1 PA13 RX0 PWM7 PA14 TX0 PWM2 PA15 RX2 SCL0 CS0 PWM3 PA16 TX2 SDA0 SCK0 PWM4 PA17 PWM5 PA18 PWM6 PA19 CTS2 SCL0 MOSI0 PWM7 PA20 RTS2 SDA0 MISO0 PWM0 PA23 PWM7"},{"location":"boards/generic-rtl8720cf-2mb-992k/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Partition Table 0x000000 4 KiB / 0x1000 0x001000 System Data 0x001000 4 KiB / 0x1000 0x002000 Calibration 0x002000 4 KiB / 0x1000 0x003000 (reserved) 0x003000 4 KiB / 0x1000 0x004000 Boot Image 0x004000 32 KiB / 0x8000 0x00C000 OTA1 Image 0x00C000 992 KiB / 0xF8000 0x104000 OTA2 Image 0x104000 992 KiB / 0xF8000 0x1FC000 Key-Value Store 0x1FC000 16 KiB / 0x4000 0x200000"},{"location":"boards/lsc-lma35/","title":"LSC LMA35 BK7231N","text":"

by Unknown

Product page

  • Info & flashing guide
Parameter Value Board code lsc-lma35 MCU BK7231N Manufacturer Beken Series BK72XX Frequency 120 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 15x GPIO, 6x PWM, 2x UART, 1x ADC Wi-Fi 802.11 b/g/n Bluetooth BLE v5.1"},{"location":"boards/lsc-lma35/#usage","title":"Usage","text":"

Board code: lsc-lma35

In platformio.ini:

[env:lsc-lma35]\nplatform = libretiny\nboard = lsc-lma35\nframework = arduino\n

In ESPHome YAML:

bk72xx:\n  board: lsc-lma35\n
"},{"location":"boards/lsc-lma35/#pinout","title":"Pinout","text":""},{"location":"boards/lsc-lma35/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other P0 TX2 SCL2 P1 RX2 SDA2 P6 PWM0 P7 PWM1 P8 PWM2 P9 PWM3 P10 RX1 P11 TX1 P14 P16 P21 P22 P23, ADC3 P24 PWM4 P26 PWM5"},{"location":"boards/lsc-lma35/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Bootloader 0x000000 68 KiB / 0x11000 0x011000 App Image 0x011000 1.1 MiB / 0x119000 0x12A000 OTA Image 0x12A000 664 KiB / 0xA6000 0x1D0000 Calibration 0x1D0000 4 KiB / 0x1000 0x1D1000 Network Data 0x1D1000 4 KiB / 0x1000 0x1D2000 TLV Store 0x1D2000 4 KiB / 0x1000 0x1D3000 Key-Value Store 0x1D3000 32 KiB / 0x8000 0x1DB000 User Data 0x1DB000 148 KiB / 0x25000 0x200000 Tuya Storage 0x1ED000 76 KiB / 0x13000 0x200000

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

"},{"location":"boards/lsc-lma35/#information","title":"Information","text":"

This board has no marking on the front side, only something that looks like PCB manufacturing info on the back; thus it was named based on these symbols.

It can be found in 'LSC Smart Connect Outdoor LED Strip', and is likely custom-made for this product.

The pinout was established by writing to and probing consecutive GPIOs, using the generic board definition.

Pins marked with '?' are currently unknown, with a possibility of being CEN. Pin 22 (P1/D14) is also not confirmed.

"},{"location":"boards/lsc-lma35-t/","title":"LSC LMA35 BK7231T","text":"

by Unknown

Product page

  • Info & flashing guide
Parameter Value Board code lsc-lma35-t MCU BK7231T Manufacturer Beken Series BK72XX Frequency 120 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 15x GPIO, 6x PWM, 2x UART, 1x ADC Wi-Fi 802.11 b/g/n Bluetooth BLE v4.2"},{"location":"boards/lsc-lma35-t/#usage","title":"Usage","text":"

Board code: lsc-lma35-t

In platformio.ini:

[env:lsc-lma35-t]\nplatform = libretiny\nboard = lsc-lma35-t\nframework = arduino\n

In ESPHome YAML:

bk72xx:\n  board: lsc-lma35-t\n
"},{"location":"boards/lsc-lma35-t/#pinout","title":"Pinout","text":""},{"location":"boards/lsc-lma35-t/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other P0 TX2 SCL2 P1 RX2 SDA2 P6 PWM0 P7 PWM1 P8 PWM2 P9 PWM3 P10 RX1 P11 TX1 P14 P16 P21 P22 P23, ADC3 P24 PWM4 P26 PWM5"},{"location":"boards/lsc-lma35-t/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Bootloader 0x000000 68 KiB / 0x11000 0x011000 App Image 0x011000 1.1 MiB / 0x121000 0x132000 OTA Image 0x132000 664 KiB / 0xA6000 0x1D8000 Key-Value Store 0x1D8000 32 KiB / 0x8000 0x1E0000 Calibration 0x1E0000 4 KiB / 0x1000 0x1E1000 TLV Store 0x1E1000 4 KiB / 0x1000 0x1E2000 Network Data 0x1E2000 4 KiB / 0x1000 0x1E3000 User Data 0x1E3000 116 KiB / 0x1D000 0x200000 Tuya Storage 0x1ED000 76 KiB / 0x13000 0x200000

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

"},{"location":"boards/lsc-lma35-t/#information","title":"Information","text":"

This board has no marking on the front side, only something that looks like PCB manufacturing info on the back; thus it was named based on these symbols.

It can be found in 'LSC Smart Connect Outdoor LED Strip', and is likely custom-made for this product.

The pinout was established by writing to and probing consecutive GPIOs, using the generic board definition.

Pins marked with '?' are currently unknown, with a possibility of being CEN. Pin 22 (P1/D14) is also not confirmed.

"},{"location":"boards/t102-v1.1/","title":"T102_V1.1","text":"

by Unknown

Product page

  • Info & flashing guide
  • Debugging
Parameter Value Board code t102-v1.1 MCU RTL8710BN (W302) Manufacturer Realtek Series AmebaZ Frequency 125 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 9x GPIO, 5x PWM, 2x UART Wi-Fi 802.11 b/g/n FCC ID 2AU7O-T102V11"},{"location":"boards/t102-v1.1/#usage","title":"Usage","text":"

Board code: t102-v1.1

In platformio.ini:

[env:t102-v1.1]\nplatform = libretiny\nboard = t102-v1.1\nframework = arduino\n

In ESPHome YAML:

rtl87xx:\n  board: t102-v1.1\n
"},{"location":"boards/t102-v1.1/#pinout","title":"Pinout","text":""},{"location":"boards/t102-v1.1/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other PA00 PWM2 PA05 PWM4 PA12 PWM3 PA14 PWM0 SWCLK PA15 PWM1 SWDIO PA18 RX0 SCL1 SCK0, SCK1 PA23 TX0 SDA1 MOSI0, MOSI1 PWM0 PA29 RX2 SCL0 PWM4 PA30 TX2 SDA0 PWM4"},{"location":"boards/t102-v1.1/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Boot XIP 0x000000 16 KiB / 0x4000 0x004000 Boot RAM 0x004000 16 KiB / 0x4000 0x008000 (reserved) 0x008000 4 KiB / 0x1000 0x009000 System Data 0x009000 4 KiB / 0x1000 0x00A000 Calibration 0x00A000 4 KiB / 0x1000 0x00B000 OTA1 Image 0x00B000 788 KiB / 0xC5000 0x0D0000 OTA2 Image 0x0D0000 788 KiB / 0xC5000 0x195000 Key-Value Store 0x195000 32 KiB / 0x8000 0x19D000 User Data 0x19D000 392 KiB / 0x62000 0x1FF000 RDP 0x1FF000 4 KiB / 0x1000 0x200000"},{"location":"boards/t103-v1.0/","title":"T103_V1.0","text":"

by Unknown

Product page

  • Info & flashing guide
  • Debugging
Parameter Value Board code t103-v1.0 MCU RTL8710BX Manufacturer Realtek Series AmebaZ Frequency 62.5 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 11x GPIO, 6x PWM, 2x UART, 2x ADC Wi-Fi 802.11 b/g/n FCC ID 2AU7O-T102V11"},{"location":"boards/t103-v1.0/#usage","title":"Usage","text":"

Board code: t103-v1.0

In platformio.ini:

[env:t103-v1.0]\nplatform = libretiny\nboard = t103-v1.0\nframework = arduino\n

In ESPHome YAML:

rtl87xx:\n  board: t103-v1.0\n
"},{"location":"boards/t103-v1.0/#pinout","title":"Pinout","text":""},{"location":"boards/t103-v1.0/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other PA00 PWM2 PA05 PWM4 PA12 PWM3 PA14 PWM0 SWCLK PA15 PWM1 SWDIO PA18 RX0 SCL1 SCK0, SCK1 PA19, ADC1 SDA0 CS0, CS1 PA22 SCL0 MISO0, MISO1 PWM5 PA23 TX0 SDA1 MOSI0, MOSI1 PWM0 PA29 RX2 SCL0 PWM4 PA30 TX2 SDA0 PWM4"},{"location":"boards/t103-v1.0/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Boot XIP 0x000000 16 KiB / 0x4000 0x004000 Boot RAM 0x004000 16 KiB / 0x4000 0x008000 (reserved) 0x008000 4 KiB / 0x1000 0x009000 System Data 0x009000 4 KiB / 0x1000 0x00A000 Calibration 0x00A000 4 KiB / 0x1000 0x00B000 OTA1 Image 0x00B000 788 KiB / 0xC5000 0x0D0000 OTA2 Image 0x0D0000 788 KiB / 0xC5000 0x195000 Key-Value Store 0x195000 32 KiB / 0x8000 0x19D000 User Data 0x19D000 392 KiB / 0x62000 0x1FF000 RDP 0x1FF000 4 KiB / 0x1000 0x200000"},{"location":"boards/t103-v1.0/#source","title":"Source","text":"

Pinout information sourced from teardown post by @p.kaczmarek2 from Elektroda.

"},{"location":"boards/t112-v1.1/","title":"T112_V1.1","text":"

by Unknown

Product page

  • Info & flashing guide
  • Debugging
Parameter Value Board code t112-v1.1 MCU RTL8710BN (W302) Manufacturer Realtek Series AmebaZ Frequency 125 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 11x GPIO, 6x PWM, 2x UART, 1x ADC Wi-Fi 802.11 b/g/n FCC ID 2AU7O-T102V11"},{"location":"boards/t112-v1.1/#usage","title":"Usage","text":"

Board code: t112-v1.1

In platformio.ini:

[env:t112-v1.1]\nplatform = libretiny\nboard = t112-v1.1\nframework = arduino\n

In ESPHome YAML:

rtl87xx:\n  board: t112-v1.1\n
"},{"location":"boards/t112-v1.1/#pinout","title":"Pinout","text":""},{"location":"boards/t112-v1.1/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other PA00 PWM2 PA05 PWM4 PA12 PWM3 PA14 PWM0 SWCLK PA15 PWM1 SWDIO PA18 RX0 SCL1 SCK0, SCK1 PA19, ADC1 SDA0 CS0, CS1 PA22 SCL0 MISO0, MISO1 PWM5 PA23 TX0 SDA1 MOSI0, MOSI1 PWM0 PA29 RX2 SCL0 PWM4 PA30 TX2 SDA0 PWM4"},{"location":"boards/t112-v1.1/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Boot XIP 0x000000 16 KiB / 0x4000 0x004000 Boot RAM 0x004000 16 KiB / 0x4000 0x008000 (reserved) 0x008000 4 KiB / 0x1000 0x009000 System Data 0x009000 4 KiB / 0x1000 0x00A000 Calibration 0x00A000 4 KiB / 0x1000 0x00B000 OTA1 Image 0x00B000 788 KiB / 0xC5000 0x0D0000 OTA2 Image 0x0D0000 788 KiB / 0xC5000 0x195000 Key-Value Store 0x195000 32 KiB / 0x8000 0x19D000 User Data 0x19D000 392 KiB / 0x62000 0x1FF000 RDP 0x1FF000 4 KiB / 0x1000 0x200000"},{"location":"boards/wa2/","title":"WA2 Wi-Fi Module","text":"

by Tuya Inc.

Product page

  • Info & flashing guide
Parameter Value Board code wa2 MCU BK7231Q Manufacturer Beken Series BK72XX Frequency 120 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 13x GPIO, 5x PWM, 2x UART, 2x ADC Wi-Fi 802.11 b/g/n"},{"location":"boards/wa2/#usage","title":"Usage","text":"

Board code: wa2

In platformio.ini:

[env:wa2]\nplatform = libretiny\nboard = wa2\nframework = arduino\n

In ESPHome YAML:

bk72xx:\n  board: wa2\n
"},{"location":"boards/wa2/#pinout","title":"Pinout","text":""},{"location":"boards/wa2/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other P0 TX2 SCL2 P4, ADC1 P6 PWM0 P7 PWM1 P8 PWM2 P10 RX1 P11 TX1 P18 PWM4 P19 PWM5 P20 SCL1 TCK P21 SDA1 TMS P22 TDI P23, ADC3 TDO"},{"location":"boards/wa2/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Bootloader 0x000000 68 KiB / 0x11000 0x011000 App Image 0x011000 1.1 MiB / 0x121000 0x132000 OTA Image 0x132000 664 KiB / 0xA6000 0x1D8000 Key-Value Store 0x1D8000 32 KiB / 0x8000 0x1E0000 Calibration 0x1E0000 4 KiB / 0x1000 0x1E1000 TLV Store 0x1E1000 4 KiB / 0x1000 0x1E2000 Network Data 0x1E2000 4 KiB / 0x1000 0x1E3000 User Data 0x1E3000 116 KiB / 0x1D000 0x200000

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

"},{"location":"boards/wb1s/","title":"WB1S Wi-Fi Module","text":"

by Tuya Inc.

Product page

  • Info & flashing guide
Parameter Value Board code wb1s MCU BK7231T Manufacturer Beken Series BK72XX Frequency 120 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 14x GPIO, 6x PWM, 2x UART, 1x ADC Wi-Fi 802.11 b/g/n Bluetooth BLE v4.2 FCC ID 2ANDL-WB1S"},{"location":"boards/wb1s/#usage","title":"Usage","text":"

Board code: wb1s

In platformio.ini:

[env:wb1s]\nplatform = libretiny\nboard = wb1s\nframework = arduino\n

In ESPHome YAML:

bk72xx:\n  board: wb1s\n
"},{"location":"boards/wb1s/#pinout","title":"Pinout","text":""},{"location":"boards/wb1s/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other P0 TX2 SCL2 P1 RX2 SDA2 P6 PWM0 P7 PWM1 P8 PWM2 P9 PWM3 P10 RX1 P11 TX1 P20 SCL1 TCK P21 SDA1 TMS P22 TDI P23, ADC3 TDO P24 PWM4 P26 PWM5"},{"location":"boards/wb1s/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Bootloader 0x000000 68 KiB / 0x11000 0x011000 App Image 0x011000 1.1 MiB / 0x121000 0x132000 OTA Image 0x132000 664 KiB / 0xA6000 0x1D8000 Key-Value Store 0x1D8000 32 KiB / 0x8000 0x1E0000 Calibration 0x1E0000 4 KiB / 0x1000 0x1E1000 TLV Store 0x1E1000 4 KiB / 0x1000 0x1E2000 Network Data 0x1E2000 4 KiB / 0x1000 0x1E3000 User Data 0x1E3000 116 KiB / 0x1D000 0x200000 Tuya Storage 0x1ED000 76 KiB / 0x13000 0x200000

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

"},{"location":"boards/wb2l/","title":"WB2L Wi-Fi Module","text":"

by Tuya Inc.

Product page

  • Info & flashing guide
Parameter Value Board code wb2l MCU BK7231T Manufacturer Beken Series BK72XX Frequency 120 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 13x GPIO, 5x PWM, 2x UART, 1x ADC Wi-Fi 802.11 b/g/n Bluetooth BLE v4.2 FCC ID 2ANDL-WB2L"},{"location":"boards/wb2l/#usage","title":"Usage","text":"

Board code: wb2l

In platformio.ini:

[env:wb2l]\nplatform = libretiny\nboard = wb2l\nframework = arduino\n

In ESPHome YAML:

bk72xx:\n  board: wb2l\n
"},{"location":"boards/wb2l/#pinout","title":"Pinout","text":""},{"location":"boards/wb2l/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other P0 TX2 SCL2 P1 RX2 SDA2 P6 PWM0 P7 PWM1 P8 PWM2 P10 RX1 P11 TX1 P20 SCL1 TCK P21 SDA1 TMS P22 TDI P23, ADC3 TDO P24 PWM4 P26 PWM5"},{"location":"boards/wb2l/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Bootloader 0x000000 68 KiB / 0x11000 0x011000 App Image 0x011000 1.1 MiB / 0x121000 0x132000 OTA Image 0x132000 664 KiB / 0xA6000 0x1D8000 Key-Value Store 0x1D8000 32 KiB / 0x8000 0x1E0000 Calibration 0x1E0000 4 KiB / 0x1000 0x1E1000 TLV Store 0x1E1000 4 KiB / 0x1000 0x1E2000 Network Data 0x1E2000 4 KiB / 0x1000 0x1E3000 User Data 0x1E3000 116 KiB / 0x1D000 0x200000 Tuya Storage 0x1ED000 76 KiB / 0x13000 0x200000

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

"},{"location":"boards/wb2l-m1/","title":"WB2L_M1 Wi-Fi Module","text":"

by Tuya Inc.

Product page

  • Info & flashing guide
Parameter Value Board code wb2l-m1 MCU BK7231N Manufacturer Beken Series BK72XX Frequency 120 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 13x GPIO, 5x PWM, 2x UART, 1x ADC Wi-Fi 802.11 b/g/n Bluetooth BLE v5.1"},{"location":"boards/wb2l-m1/#usage","title":"Usage","text":"

Board code: wb2l-m1

In platformio.ini:

[env:wb2l-m1]\nplatform = libretiny\nboard = wb2l-m1\nframework = arduino\n

In ESPHome YAML:

bk72xx:\n  board: wb2l-m1\n
"},{"location":"boards/wb2l-m1/#pinout","title":"Pinout","text":""},{"location":"boards/wb2l-m1/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other P0 TX2 SCL2 P1 RX2 SDA2 P6 PWM0 P7 PWM1 P8 PWM2 P10 RX1 P11 TX1 P20 SCL1 TCK P21 SDA1 TMS P22 TDI P23, ADC3 TDO P24 PWM4 P26 PWM5"},{"location":"boards/wb2l-m1/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Bootloader 0x000000 68 KiB / 0x11000 0x011000 App Image 0x011000 1.1 MiB / 0x119000 0x12A000 OTA Image 0x12A000 664 KiB / 0xA6000 0x1D0000 Calibration 0x1D0000 4 KiB / 0x1000 0x1D1000 Network Data 0x1D1000 4 KiB / 0x1000 0x1D2000 TLV Store 0x1D2000 4 KiB / 0x1000 0x1D3000 Key-Value Store 0x1D3000 32 KiB / 0x8000 0x1DB000 User Data 0x1DB000 148 KiB / 0x25000 0x200000 Tuya Storage 0x1ED000 76 KiB / 0x13000 0x200000

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

"},{"location":"boards/wb2s/","title":"WB2S Wi-Fi Module","text":"

by Tuya Inc.

Product page

  • Info & flashing guide
Parameter Value Board code wb2s MCU BK7231T Manufacturer Beken Series BK72XX Frequency 120 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 14x GPIO, 6x PWM, 2x UART, 1x ADC Wi-Fi 802.11 b/g/n Bluetooth BLE v4.2 FCC ID 2ANDL-WB2S"},{"location":"boards/wb2s/#usage","title":"Usage","text":"

Board code: wb2s

In platformio.ini:

[env:wb2s]\nplatform = libretiny\nboard = wb2s\nframework = arduino\n

In ESPHome YAML:

bk72xx:\n  board: wb2s\n
"},{"location":"boards/wb2s/#pinout","title":"Pinout","text":""},{"location":"boards/wb2s/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other P0 TX2 SCL2 P1 RX2 SDA2 P6 PWM0 P7 PWM1 P8 PWM2 P9 PWM3 P10 RX1 P11 TX1 P20 SCL1 TCK P21 SDA1 TMS P22 TDI P23, ADC3 TDO P24 PWM4 P26 PWM5"},{"location":"boards/wb2s/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Bootloader 0x000000 68 KiB / 0x11000 0x011000 App Image 0x011000 1.1 MiB / 0x121000 0x132000 OTA Image 0x132000 664 KiB / 0xA6000 0x1D8000 Key-Value Store 0x1D8000 32 KiB / 0x8000 0x1E0000 Calibration 0x1E0000 4 KiB / 0x1000 0x1E1000 TLV Store 0x1E1000 4 KiB / 0x1000 0x1E2000 Network Data 0x1E2000 4 KiB / 0x1000 0x1E3000 User Data 0x1E3000 116 KiB / 0x1D000 0x200000 Tuya Storage 0x1ED000 76 KiB / 0x13000 0x200000

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

"},{"location":"boards/wb3l/","title":"WB3L Wi-Fi Module","text":"

by Tuya Inc.

Product page

  • Info & flashing guide
Parameter Value Board code wb3l MCU BK7231T Manufacturer Beken Series BK72XX Frequency 120 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 16x GPIO, 6x PWM, 2x UART, 1x ADC Wi-Fi 802.11 b/g/n Bluetooth BLE v4.2 FCC ID 2ANDL-WB3L"},{"location":"boards/wb3l/#usage","title":"Usage","text":"

Board code: wb3l

In platformio.ini:

[env:wb3l]\nplatform = libretiny\nboard = wb3l\nframework = arduino\n

In ESPHome YAML:

bk72xx:\n  board: wb3l\n
"},{"location":"boards/wb3l/#pinout","title":"Pinout","text":""},{"location":"boards/wb3l/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other P0 TX2 SCL2 P1 RX2 SDA2 P6 PWM0 P7 PWM1 P8 PWM2 P9 PWM3 P10 RX1 P11 TX1 P14 SCK P16 MOSI P20 SCL1 TCK P21 SDA1 TMS P22 TDI P23, ADC3 TDO P24 PWM4 P26 PWM5"},{"location":"boards/wb3l/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Bootloader 0x000000 68 KiB / 0x11000 0x011000 App Image 0x011000 1.1 MiB / 0x121000 0x132000 OTA Image 0x132000 664 KiB / 0xA6000 0x1D8000 Key-Value Store 0x1D8000 32 KiB / 0x8000 0x1E0000 Calibration 0x1E0000 4 KiB / 0x1000 0x1E1000 TLV Store 0x1E1000 4 KiB / 0x1000 0x1E2000 Network Data 0x1E2000 4 KiB / 0x1000 0x1E3000 User Data 0x1E3000 116 KiB / 0x1D000 0x200000 Tuya Storage 0x1ED000 76 KiB / 0x13000 0x200000

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

"},{"location":"boards/wb3s/","title":"WB3S Wi-Fi Module","text":"

by Tuya Inc.

Product page

  • Info & flashing guide
Parameter Value Board code wb3s MCU BK7231T Manufacturer Beken Series BK72XX Frequency 120 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 15x GPIO, 6x PWM, 2x UART, 1x ADC Wi-Fi 802.11 b/g/n Bluetooth BLE v4.2 FCC ID 2ANDL-WB3S"},{"location":"boards/wb3s/#usage","title":"Usage","text":"

Board code: wb3s

In platformio.ini:

[env:wb3s]\nplatform = libretiny\nboard = wb3s\nframework = arduino\n

In ESPHome YAML:

bk72xx:\n  board: wb3s\n
"},{"location":"boards/wb3s/#pinout","title":"Pinout","text":""},{"location":"boards/wb3s/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other P0 TX2 SCL2 P1 RX2 SDA2 P6 PWM0 P7 PWM1 P8 PWM2 P9 PWM3 P10 RX1 P11 TX1 P14 P20 SCL1 TCK P21 SDA1 TMS P22 TDI P23, ADC3 TDO P24 PWM4 P26 PWM5"},{"location":"boards/wb3s/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Bootloader 0x000000 68 KiB / 0x11000 0x011000 App Image 0x011000 1.1 MiB / 0x121000 0x132000 OTA Image 0x132000 664 KiB / 0xA6000 0x1D8000 Key-Value Store 0x1D8000 32 KiB / 0x8000 0x1E0000 Calibration 0x1E0000 4 KiB / 0x1000 0x1E1000 TLV Store 0x1E1000 4 KiB / 0x1000 0x1E2000 Network Data 0x1E2000 4 KiB / 0x1000 0x1E3000 User Data 0x1E3000 116 KiB / 0x1D000 0x200000 Tuya Storage 0x1ED000 76 KiB / 0x13000 0x200000

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

"},{"location":"boards/wblc5/","title":"WBLC5 Wi-Fi Module","text":"

by Tuya Inc.

Product page

  • Info & flashing guide
Parameter Value Board code wblc5 MCU BK7231T Manufacturer Beken Series BK72XX Frequency 120 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 11x GPIO, 3x PWM, 2x UART, 1x ADC Wi-Fi 802.11 b/g/n Bluetooth BLE v4.2"},{"location":"boards/wblc5/#usage","title":"Usage","text":"

Board code: wblc5

In platformio.ini:

[env:wblc5]\nplatform = libretiny\nboard = wblc5\nframework = arduino\n

In ESPHome YAML:

bk72xx:\n  board: wblc5\n
"},{"location":"boards/wblc5/#pinout","title":"Pinout","text":""},{"location":"boards/wblc5/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other P0 TX2 SCL2 P1 RX2 SDA2 P6 PWM0 P10 RX1 P11 TX1 P20 SCL1 TCK P21 SDA1 TMS P22 TDI P23, ADC3 TDO P24 PWM4 P26 PWM5"},{"location":"boards/wblc5/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Bootloader 0x000000 68 KiB / 0x11000 0x011000 App Image 0x011000 1.1 MiB / 0x121000 0x132000 OTA Image 0x132000 664 KiB / 0xA6000 0x1D8000 Key-Value Store 0x1D8000 32 KiB / 0x8000 0x1E0000 Calibration 0x1E0000 4 KiB / 0x1000 0x1E1000 TLV Store 0x1E1000 4 KiB / 0x1000 0x1E2000 Network Data 0x1E2000 4 KiB / 0x1000 0x1E3000 User Data 0x1E3000 116 KiB / 0x1D000 0x200000 Tuya Storage 0x1ED000 76 KiB / 0x13000 0x200000

Bootloader and app partitions contain CRC16 sums every 32 bytes. That results in the actual flash offsets/sizes not aligned to sector boundaries. To simplify calculations, the values shown in the table (extracted from bootloader's partition table) were aligned to 4096 bytes.

"},{"location":"boards/wr1/","title":"WR1 Wi-Fi Module","text":"

by Tuya Inc.

Product page

  • Info & flashing guide
  • Debugging
Parameter Value Board code wr1 MCU RTL8710BN Manufacturer Realtek Series AmebaZ Frequency 125 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 10x GPIO, 5x PWM, 2x UART, 2x ADC Wi-Fi 802.11 b/g/n FCC ID 2ANDL-WR1"},{"location":"boards/wr1/#usage","title":"Usage","text":"

Board code: wr1

In platformio.ini:

[env:wr1]\nplatform = libretiny\nboard = wr1\nframework = arduino\n

In ESPHome YAML:

rtl87xx:\n  board: wr1\n
"},{"location":"boards/wr1/#pinout","title":"Pinout","text":""},{"location":"boards/wr1/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other PA00 PWM2 PA05 PWM4 PA14 PWM0 SWCLK PA15 PWM1 SWDIO PA18 RX0 SCL1 SCK0, SCK1 PA19, ADC1 SDA0 CS0, CS1 PA22 SCL0 MISO0, MISO1 PWM5 PA23 TX0 SDA1 MOSI0, MOSI1 PWM0 PA29 RX2 SCL0 PWM4 PA30 TX2 SDA0 PWM4"},{"location":"boards/wr1/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Boot XIP 0x000000 16 KiB / 0x4000 0x004000 Boot RAM 0x004000 16 KiB / 0x4000 0x008000 (reserved) 0x008000 4 KiB / 0x1000 0x009000 System Data 0x009000 4 KiB / 0x1000 0x00A000 Calibration 0x00A000 4 KiB / 0x1000 0x00B000 OTA1 Image 0x00B000 788 KiB / 0xC5000 0x0D0000 OTA2 Image 0x0D0000 788 KiB / 0xC5000 0x195000 Key-Value Store 0x195000 32 KiB / 0x8000 0x19D000 User Data 0x19D000 392 KiB / 0x62000 0x1FF000 RDP 0x1FF000 4 KiB / 0x1000 0x200000"},{"location":"boards/wr1e/","title":"WR1E Wi-Fi Module","text":"

by Tuya Inc.

Product page

  • Info & flashing guide
  • Debugging
Parameter Value Board code wr1e MCU RTL8710BN Manufacturer Realtek Series AmebaZ Frequency 125 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 10x GPIO, 5x PWM, 2x UART, 2x ADC Wi-Fi 802.11 b/g/n FCC ID 2ANDL-WR1E"},{"location":"boards/wr1e/#usage","title":"Usage","text":"

Board code: wr1e

In platformio.ini:

[env:wr1e]\nplatform = libretiny\nboard = wr1e\nframework = arduino\n

In ESPHome YAML:

rtl87xx:\n  board: wr1e\n
"},{"location":"boards/wr1e/#pinout","title":"Pinout","text":""},{"location":"boards/wr1e/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other PA05 PWM4 PA12 PWM3 PA14 PWM0 SWCLK PA15 PWM1 SWDIO PA18 RX0 SCL1 SCK0, SCK1 PA19, ADC1 SDA0 CS0, CS1 PA22 SCL0 MISO0, MISO1 PWM5 PA23 TX0 SDA1 MOSI0, MOSI1 PWM0 PA29 RX2 SCL0 PWM4 PA30 TX2 SDA0 PWM4"},{"location":"boards/wr1e/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Boot XIP 0x000000 16 KiB / 0x4000 0x004000 Boot RAM 0x004000 16 KiB / 0x4000 0x008000 (reserved) 0x008000 4 KiB / 0x1000 0x009000 System Data 0x009000 4 KiB / 0x1000 0x00A000 Calibration 0x00A000 4 KiB / 0x1000 0x00B000 OTA1 Image 0x00B000 788 KiB / 0xC5000 0x0D0000 OTA2 Image 0x0D0000 788 KiB / 0xC5000 0x195000 Key-Value Store 0x195000 32 KiB / 0x8000 0x19D000 User Data 0x19D000 392 KiB / 0x62000 0x1FF000 RDP 0x1FF000 4 KiB / 0x1000 0x200000"},{"location":"boards/wr2/","title":"WR2 Wi-Fi Module","text":"

by Tuya Inc.

Product page

  • Info & flashing guide
  • Debugging
Parameter Value Board code wr2 MCU RTL8710BN Manufacturer Realtek Series AmebaZ Frequency 125 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 9x GPIO, 5x PWM, 2x UART, 1x ADC Wi-Fi 802.11 b/g/n FCC ID 2ANDL-WR2"},{"location":"boards/wr2/#usage","title":"Usage","text":"

Board code: wr2

In platformio.ini:

[env:wr2]\nplatform = libretiny\nboard = wr2\nframework = arduino\n

In ESPHome YAML:

rtl87xx:\n  board: wr2\n
"},{"location":"boards/wr2/#pinout","title":"Pinout","text":""},{"location":"boards/wr2/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other PA00 PWM2 PA05 PWM4 PA12 PWM3 PA14 PWM0 SWCLK PA15 PWM1 SWDIO PA18 RX0 SCL1 SCK0, SCK1 PA23 TX0 SDA1 MOSI0, MOSI1 PWM0 PA29 RX2 SCL0 PWM4 PA30 TX2 SDA0 PWM4"},{"location":"boards/wr2/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Boot XIP 0x000000 16 KiB / 0x4000 0x004000 Boot RAM 0x004000 16 KiB / 0x4000 0x008000 (reserved) 0x008000 4 KiB / 0x1000 0x009000 System Data 0x009000 4 KiB / 0x1000 0x00A000 Calibration 0x00A000 4 KiB / 0x1000 0x00B000 OTA1 Image 0x00B000 788 KiB / 0xC5000 0x0D0000 OTA2 Image 0x0D0000 788 KiB / 0xC5000 0x195000 Key-Value Store 0x195000 32 KiB / 0x8000 0x19D000 User Data 0x19D000 392 KiB / 0x62000 0x1FF000 Tuya Storage 0x1EB000 84 KiB / 0x15000 0x200000 RDP 0x1FF000 4 KiB / 0x1000 0x200000"},{"location":"boards/wr2e/","title":"WR2E Wi-Fi Module","text":"

by Tuya Inc.

Product page

  • Info & flashing guide
  • Debugging
Parameter Value Board code wr2e MCU RTL8710BN Manufacturer Realtek Series AmebaZ Frequency 125 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 9x GPIO, 4x PWM, 2x UART, 2x ADC Wi-Fi 802.11 b/g/n FCC ID 2ANDL-WR2E"},{"location":"boards/wr2e/#usage","title":"Usage","text":"

Board code: wr2e

In platformio.ini:

[env:wr2e]\nplatform = libretiny\nboard = wr2e\nframework = arduino\n

In ESPHome YAML:

rtl87xx:\n  board: wr2e\n
"},{"location":"boards/wr2e/#pinout","title":"Pinout","text":""},{"location":"boards/wr2e/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other PA05 PWM4 PA12 PWM3 PA14 PWM0 SWCLK PA15 PWM1 SWDIO PA18 RX0 SCL1 SCK0, SCK1 PA19, ADC1 CS0, CS1 PA23 TX0 SDA1 MOSI0, MOSI1 PWM0 PA29 RX2 SCL0 PWM4 PA30 TX2 PWM4"},{"location":"boards/wr2e/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Boot XIP 0x000000 16 KiB / 0x4000 0x004000 Boot RAM 0x004000 16 KiB / 0x4000 0x008000 (reserved) 0x008000 4 KiB / 0x1000 0x009000 System Data 0x009000 4 KiB / 0x1000 0x00A000 Calibration 0x00A000 4 KiB / 0x1000 0x00B000 OTA1 Image 0x00B000 788 KiB / 0xC5000 0x0D0000 OTA2 Image 0x0D0000 788 KiB / 0xC5000 0x195000 Key-Value Store 0x195000 32 KiB / 0x8000 0x19D000 User Data 0x19D000 392 KiB / 0x62000 0x1FF000 Tuya Storage 0x1EB000 84 KiB / 0x15000 0x200000 RDP 0x1FF000 4 KiB / 0x1000 0x200000"},{"location":"boards/wr2l/","title":"WR2L Wi-Fi Module","text":"

by Tuya Inc.

Product page

  • Info & flashing guide
  • Debugging
Parameter Value Board code wr2l MCU RTL8710BX Manufacturer Realtek Series AmebaZ Frequency 62.5 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 5x GPIO, 4x PWM, 1x UART, 1x ADC Wi-Fi 802.11 b/g/n FCC ID 2ANDL-WR2L"},{"location":"boards/wr2l/#usage","title":"Usage","text":"

Board code: wr2l

In platformio.ini:

[env:wr2l]\nplatform = libretiny\nboard = wr2l\nframework = arduino\n

In ESPHome YAML:

rtl87xx:\n  board: wr2l\n
"},{"location":"boards/wr2l/#pinout","title":"Pinout","text":""},{"location":"boards/wr2l/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other PA05 PWM4 PA12 PWM3 PA14 PWM0 SWCLK PA15 PWM1 SWDIO PA19, ADC1"},{"location":"boards/wr2l/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Boot XIP 0x000000 16 KiB / 0x4000 0x004000 Boot RAM 0x004000 16 KiB / 0x4000 0x008000 (reserved) 0x008000 4 KiB / 0x1000 0x009000 System Data 0x009000 4 KiB / 0x1000 0x00A000 Calibration 0x00A000 4 KiB / 0x1000 0x00B000 OTA1 Image 0x00B000 788 KiB / 0xC5000 0x0D0000 OTA2 Image 0x0D0000 788 KiB / 0xC5000 0x195000 Key-Value Store 0x195000 32 KiB / 0x8000 0x19D000 User Data 0x19D000 392 KiB / 0x62000 0x1FF000 Tuya Storage 0x1EB000 84 KiB / 0x15000 0x200000 RDP 0x1FF000 4 KiB / 0x1000 0x200000"},{"location":"boards/wr2le/","title":"WR2LE Wi-Fi Module","text":"

by Tuya Inc.

Product page

  • Info & flashing guide
  • Debugging
Parameter Value Board code wr2le MCU RTL8710BX Manufacturer Realtek Series AmebaZ Frequency 62.5 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 5x GPIO, 5x PWM, 1x UART Wi-Fi 802.11 b/g/n"},{"location":"boards/wr2le/#usage","title":"Usage","text":"

Board code: wr2le

In platformio.ini:

[env:wr2le]\nplatform = libretiny\nboard = wr2le\nframework = arduino\n

In ESPHome YAML:

rtl87xx:\n  board: wr2le\n
"},{"location":"boards/wr2le/#pinout","title":"Pinout","text":""},{"location":"boards/wr2le/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other PA05 PWM4 PA12 PWM3 PA14 PWM0 SWCLK PA15 PWM1 SWDIO PA22 PWM5"},{"location":"boards/wr2le/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Boot XIP 0x000000 16 KiB / 0x4000 0x004000 Boot RAM 0x004000 16 KiB / 0x4000 0x008000 (reserved) 0x008000 4 KiB / 0x1000 0x009000 System Data 0x009000 4 KiB / 0x1000 0x00A000 Calibration 0x00A000 4 KiB / 0x1000 0x00B000 OTA1 Image 0x00B000 788 KiB / 0xC5000 0x0D0000 OTA2 Image 0x0D0000 788 KiB / 0xC5000 0x195000 Key-Value Store 0x195000 32 KiB / 0x8000 0x19D000 User Data 0x19D000 392 KiB / 0x62000 0x1FF000 Tuya Storage 0x1EB000 84 KiB / 0x15000 0x200000 RDP 0x1FF000 4 KiB / 0x1000 0x200000"},{"location":"boards/wr3/","title":"WR3 Wi-Fi Module","text":"

by Tuya Inc.

Product page

  • Info & flashing guide
  • Debugging
Parameter Value Board code wr3 MCU RTL8710BN Manufacturer Realtek Series AmebaZ Frequency 125 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 11x GPIO, 6x PWM, 2x UART, 2x ADC Wi-Fi 802.11 b/g/n FCC ID 2ANDL-WR3"},{"location":"boards/wr3/#usage","title":"Usage","text":"

Board code: wr3

In platformio.ini:

[env:wr3]\nplatform = libretiny\nboard = wr3\nframework = arduino\n

In ESPHome YAML:

rtl87xx:\n  board: wr3\n
"},{"location":"boards/wr3/#pinout","title":"Pinout","text":""},{"location":"boards/wr3/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other PA00 PWM2 PA05 PWM4 PA12 PWM3 PA14 PWM0 SWCLK PA15 PWM1 SWDIO PA18 RX0 SCL1 SCK0, SCK1 PA19, ADC1 SDA0 CS0, CS1 PA22 SCL0 MISO0, MISO1 PWM5 PA23 TX0 SDA1 MOSI0, MOSI1 PWM0 PA29 RX2 SCL0 PWM4 PA30 TX2 SDA0 PWM4"},{"location":"boards/wr3/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Boot XIP 0x000000 16 KiB / 0x4000 0x004000 Boot RAM 0x004000 16 KiB / 0x4000 0x008000 (reserved) 0x008000 4 KiB / 0x1000 0x009000 System Data 0x009000 4 KiB / 0x1000 0x00A000 Calibration 0x00A000 4 KiB / 0x1000 0x00B000 OTA1 Image 0x00B000 788 KiB / 0xC5000 0x0D0000 OTA2 Image 0x0D0000 788 KiB / 0xC5000 0x195000 Key-Value Store 0x195000 32 KiB / 0x8000 0x19D000 User Data 0x19D000 392 KiB / 0x62000 0x1FF000 Tuya Storage 0x1EB000 84 KiB / 0x15000 0x200000 RDP 0x1FF000 4 KiB / 0x1000 0x200000"},{"location":"boards/wr3e/","title":"WR3E Wi-Fi Module","text":"

by Tuya Inc.

Product page

  • Info & flashing guide
  • Debugging
Parameter Value Board code wr3e MCU RTL8710BN Manufacturer Realtek Series AmebaZ Frequency 125 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 11x GPIO, 6x PWM, 2x UART, 2x ADC Wi-Fi 802.11 b/g/n FCC ID 2ANDL-WR3E"},{"location":"boards/wr3e/#usage","title":"Usage","text":"

Board code: wr3e

In platformio.ini:

[env:wr3e]\nplatform = libretiny\nboard = wr3e\nframework = arduino\n

In ESPHome YAML:

rtl87xx:\n  board: wr3e\n
"},{"location":"boards/wr3e/#pinout","title":"Pinout","text":""},{"location":"boards/wr3e/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other PA00 PWM2 PA05 PWM4 PA12 PWM3 PA14 PWM0 SWCLK PA15 PWM1 SWDIO PA18 RX0 SCL1 SCK0, SCK1 PA19, ADC1 SDA0 CS0, CS1 PA22 SCL0 MISO0, MISO1 PWM5 PA23 TX0 SDA1 MOSI0, MOSI1 PWM0 PA29 RX2 SCL0 PWM4 PA30 TX2 SDA0 PWM4"},{"location":"boards/wr3e/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Boot XIP 0x000000 16 KiB / 0x4000 0x004000 Boot RAM 0x004000 16 KiB / 0x4000 0x008000 (reserved) 0x008000 4 KiB / 0x1000 0x009000 System Data 0x009000 4 KiB / 0x1000 0x00A000 Calibration 0x00A000 4 KiB / 0x1000 0x00B000 OTA1 Image 0x00B000 788 KiB / 0xC5000 0x0D0000 OTA2 Image 0x0D0000 788 KiB / 0xC5000 0x195000 Key-Value Store 0x195000 32 KiB / 0x8000 0x19D000 User Data 0x19D000 392 KiB / 0x62000 0x1FF000 Tuya Storage 0x1EB000 84 KiB / 0x15000 0x200000 RDP 0x1FF000 4 KiB / 0x1000 0x200000"},{"location":"boards/wr3l/","title":"WR3L Wi-Fi Module","text":"

by Tuya Inc.

Product page

  • Info & flashing guide
  • Debugging
Parameter Value Board code wr3l MCU RTL8710BX Manufacturer Realtek Series AmebaZ Frequency 62.5 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 11x GPIO, 6x PWM, 2x UART, 2x ADC Wi-Fi 802.11 b/g/n FCC ID 2ANDL-WR3L"},{"location":"boards/wr3l/#usage","title":"Usage","text":"

Board code: wr3l

In platformio.ini:

[env:wr3l]\nplatform = libretiny\nboard = wr3l\nframework = arduino\n

In ESPHome YAML:

rtl87xx:\n  board: wr3l\n
"},{"location":"boards/wr3l/#pinout","title":"Pinout","text":""},{"location":"boards/wr3l/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other PA00 PWM2 PA05 PWM4 PA12 PWM3 PA14 PWM0 SWCLK PA15 PWM1 SWDIO PA18 RX0 SCL1 SCK0, SCK1 PA19, ADC1 SDA0 CS0, CS1 PA22 SCL0 MISO0, MISO1 PWM5 PA23 TX0 SDA1 MOSI0, MOSI1 PWM0 PA29 RX2 SCL0 PWM4 PA30 TX2 SDA0 PWM4"},{"location":"boards/wr3l/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Boot XIP 0x000000 16 KiB / 0x4000 0x004000 Boot RAM 0x004000 16 KiB / 0x4000 0x008000 (reserved) 0x008000 4 KiB / 0x1000 0x009000 System Data 0x009000 4 KiB / 0x1000 0x00A000 Calibration 0x00A000 4 KiB / 0x1000 0x00B000 OTA1 Image 0x00B000 788 KiB / 0xC5000 0x0D0000 OTA2 Image 0x0D0000 788 KiB / 0xC5000 0x195000 Key-Value Store 0x195000 32 KiB / 0x8000 0x19D000 User Data 0x19D000 392 KiB / 0x62000 0x1FF000 Tuya Storage 0x1EB000 84 KiB / 0x15000 0x200000 RDP 0x1FF000 4 KiB / 0x1000 0x200000"},{"location":"boards/wr3le/","title":"WR3LE Wi-Fi Module","text":"

by Tuya Inc.

Product page

  • Info & flashing guide
  • Debugging
Parameter Value Board code wr3le MCU RTL8710BX Manufacturer Realtek Series AmebaZ Frequency 62.5 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 11x GPIO, 6x PWM, 2x UART, 2x ADC Wi-Fi 802.11 b/g/n FCC ID 2ANDL-WR3LE"},{"location":"boards/wr3le/#usage","title":"Usage","text":"

Board code: wr3le

In platformio.ini:

[env:wr3le]\nplatform = libretiny\nboard = wr3le\nframework = arduino\n

In ESPHome YAML:

rtl87xx:\n  board: wr3le\n
"},{"location":"boards/wr3le/#pinout","title":"Pinout","text":""},{"location":"boards/wr3le/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other PA00 PWM2 PA05 PWM4 PA12 PWM3 PA14 PWM0 SWCLK PA15 PWM1 SWDIO PA18 RX0 SCL1 SCK0, SCK1 PA19, ADC1 SDA0 CS0, CS1 PA22 SCL0 MISO0, MISO1 PWM5 PA23 TX0 SDA1 MOSI0, MOSI1 PWM0 PA29 RX2 SCL0 PWM4 PA30 TX2 SDA0 PWM4"},{"location":"boards/wr3le/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Boot XIP 0x000000 16 KiB / 0x4000 0x004000 Boot RAM 0x004000 16 KiB / 0x4000 0x008000 (reserved) 0x008000 4 KiB / 0x1000 0x009000 System Data 0x009000 4 KiB / 0x1000 0x00A000 Calibration 0x00A000 4 KiB / 0x1000 0x00B000 OTA1 Image 0x00B000 788 KiB / 0xC5000 0x0D0000 OTA2 Image 0x0D0000 788 KiB / 0xC5000 0x195000 Key-Value Store 0x195000 32 KiB / 0x8000 0x19D000 User Data 0x19D000 392 KiB / 0x62000 0x1FF000 Tuya Storage 0x1EB000 84 KiB / 0x15000 0x200000 RDP 0x1FF000 4 KiB / 0x1000 0x200000"},{"location":"boards/wr3n/","title":"WR3N Wi-Fi Module","text":"

by Tuya Inc.

Product page

  • Info & flashing guide
  • Debugging
Parameter Value Board code wr3n MCU RTL8710BN Manufacturer Realtek Series AmebaZ Frequency 125 MHz Flash size 2 MiB RAM size 256 KiB Voltage 3.0V - 3.6V I/O 9x GPIO, 5x PWM, 2x UART, 1x ADC Wi-Fi 802.11 b/g/n FCC ID 2ANDL-WR3N"},{"location":"boards/wr3n/#usage","title":"Usage","text":"

Board code: wr3n

In platformio.ini:

[env:wr3n]\nplatform = libretiny\nboard = wr3n\nframework = arduino\n

In ESPHome YAML:

rtl87xx:\n  board: wr3n\n
"},{"location":"boards/wr3n/#pinout","title":"Pinout","text":""},{"location":"boards/wr3n/#pin-functions","title":"Pin functions","text":"Name(s) UART I\u00b2C SPI PWM Other PA00 PWM2 PA05 PWM4 PA12 PWM3 PA14 PWM0 SWCLK PA15 PWM1 SWDIO PA18 RX0 SCL1 SCK0, SCK1 PA23 TX0 SDA1 MOSI0, MOSI1 PWM0 PA29 RX2 SCL0 PWM4 PA30 TX2 SDA0 PWM4"},{"location":"boards/wr3n/#flash-memory-map","title":"Flash memory map","text":"

Flash size: 2 MiB / 2,097,152 B / 0x200000

Hex values are in bytes.

Name Start Length End Boot XIP 0x000000 16 KiB / 0x4000 0x004000 Boot RAM 0x004000 16 KiB / 0x4000 0x008000 (reserved) 0x008000 4 KiB / 0x1000 0x009000 System Data 0x009000 4 KiB / 0x1000 0x00A000 Calibration 0x00A000 4 KiB / 0x1000 0x00B000 OTA1 Image 0x00B000 788 KiB / 0xC5000 0x0D0000 OTA2 Image 0x0D0000 788 KiB / 0xC5000 0x195000 Key-Value Store 0x195000 32 KiB / 0x8000 0x19D000 User Data 0x19D000 392 KiB / 0x62000 0x1FF000 Tuya Storage 0x1EB000 84 KiB / 0x15000 0x200000 RDP 0x1FF000 4 KiB / 0x1000 0x200000"},{"location":"cores/realtek-ambz/base/fixups/lib_rtlstd_patch/","title":"lib_rtlstd_patch.a","text":"
arm-none-eabi-gcc-ar xo lib_rtlstd.a\nrm rtl_eabi_cast_ram.o\narm-none-eabi-objcopy --strip-debug --strip-unneeded ram_libc.o\narm-none-eabi-objcopy --strip-debug --strip-unneeded ram_libgloss_retarget.o\narm-none-eabi-objcopy --strip-debug --strip-unneeded rtl_math_ram.o\narm-none-eabi-gcc-ar qs lib_rtlstd_patch.a *.o\n
"},{"location":"docs/","title":"Documentation","text":"

This documentation is best suited for rendering with MkDocs. Some elements may not display correctly in the GitHub markdown reader.

Please visit https://docs.libretiny.eu/ for the full experience.

If you still want to read the docs on GitHub, visit SUMMARY.md.

"},{"location":"docs/TODO/","title":"TODO list","text":""},{"location":"docs/TODO/#general","title":"General","text":""},{"location":"docs/TODO/#environment-stability","title":"Environment stability","text":"

Do not publish any SDK functions, macros, defines and includes. Define only what's needed in LT's public headers (like Arduino.h). Everything else is taken from sdk_extern.h or WVariant.h (TODO decide whether to keep WV public / make both private / get rid of WV and use sdk_extern only). Private headers are included by LT's .cpp units (maybe a dedicated private header that would include sdk_extern + Arduino.h).

Developers wanting to use SDK functions need to include them.

Explicit is better than implicit.

  • consider moving to C++17 (GNU)? or any newer than C++11
  • wrap all memory management functions (malloc, calloc, free, memset, etc.) and their vendor SDK counterparts to use FreeRTOS instead
    • pretty much done for ambz and ambz2, Beken is yet left to do (os_malloc() etc.)
  • remove all network protocol client/server implementations from SDKs (mDNS, HTTP, DNS, etc.)
"},{"location":"docs/TODO/#new-families","title":"New families","text":"
  • BL602
  • RTL8710A
  • RTL8720C
  • RTL8720D
  • W600 and/or W800
  • LN8825
  • BK7231Q
  • host-native family
"},{"location":"docs/TODO/#tools","title":"Tools","text":"
  • write OpenOCD flashers, using uf2ota library + FAL for partitions (in ltchiptool repository)
"},{"location":"docs/TODO/#development","title":"Development","text":"
  • write Contributor's Guide
  • export LT cores in an Arduino IDE-compatible format (automatically - GitHub Actions)
  • consider using precompiled SDK blobs for improved build speed (especially on e.g. Raspberry Pi)
"},{"location":"docs/TODO/#serial","title":"Serial","text":"
  • configuration of RX/TX pins
  • SoftwareSerial library - receiving + Beken family
"},{"location":"docs/TODO/#other","title":"Other","text":"
  • implement Wire on BK, refactor the API and class
  • watchdog API
  • Preferences library
  • test/fix IPv6 on different families
  • what is PowerManagement at all? probably useless -> remove
"},{"location":"docs/TODO/#bk7231","title":"BK7231","text":"
  • fix WiFi on BK7231N, test other functionality
  • fix SSL (mbedTLS)
  • I2C (Wire)
  • SPI
  • BLE
"},{"location":"docs/TODO/#rtl8710b","title":"RTL8710B","text":"
  • take all stdio functions from stdio.h
  • rewrite most of Wiring (it was copied from ambd_arduino, and is ugly)
"},{"location":"docs/contrib/lt-api-functions/","title":"Lt api functions","text":"Type Function Common Weak Family const char * lt_cpu_get_core_type() \u2714\ufe0f void lt_deep_sleep_config_timer() \u2714\ufe0f void lt_deep_sleep_enter() \u2714\ufe0f void lt_deep_sleep_unset_gpio() \u2714\ufe0f lt_flash_id_t lt_flash_get_id() \u2714\ufe0f void lt_get_device_mac() \u2714\ufe0f void lt_init_arduino() \u2714\ufe0f void lt_init_family() \u2714\ufe0f void lt_init_variant() \u2714\ufe0f uint8_t lt_ota_dual_get_current() \u2714\ufe0f uint8_t lt_ota_dual_get_stored() \u2714\ufe0f lt_ota_type_t lt_ota_get_type() \u2714\ufe0f bool lt_ota_is_valid() \u2714\ufe0f bool lt_ota_switch() \u2714\ufe0f uint32_t lt_ram_get_size() \u2714\ufe0f bool lt_wdt_enable() \u2714\ufe0f uint8_t lt_cpu_get_core_count() \u2714\ufe0f uint32_t lt_cpu_get_cycle_count() \u2714\ufe0f uint32_t lt_cpu_get_freq() \u2714\ufe0f uint32_t lt_cpu_get_mac_id() \u2714\ufe0f lt_cpu_model_t lt_cpu_get_model() \u2714\ufe0f uint32_t lt_cpu_get_unique_id() \u2714\ufe0f void lt_deep_sleep_config_gpio() \u2714\ufe0f uint32_t lt_flash_get_size() \u2714\ufe0f lt_reboot_reason_t lt_get_reboot_reason() \u2714\ufe0f void lt_gpio_recover() \u2714\ufe0f uint32_t lt_heap_get_free() \u2714\ufe0f uint32_t lt_heap_get_max_alloc() \u2714\ufe0f uint32_t lt_heap_get_min_free() \u2714\ufe0f uint32_t lt_heap_get_size() \u2714\ufe0f void lt_ota_set_write_protect() \u2714\ufe0f void lt_reboot() \u2714\ufe0f bool lt_reboot_download_mode() \u2714\ufe0f bool lt_reboot_wdt() \u2714\ufe0f bool lt_set_debug_mode() \u2714\ufe0f void lt_wdt_disable() \u2714\ufe0f void lt_wdt_feed() \u2714\ufe0f void hexdump() \u2714\ufe0f char * lt_btox() \u2714\ufe0f lt_cpu_family_t lt_cpu_get_family() \u2714\ufe0f const char * lt_cpu_get_family_name() \u2714\ufe0f uint32_t lt_cpu_get_freq_mhz() \u2714\ufe0f const char * lt_cpu_get_model_code() \u2714\ufe0f const char * lt_cpu_get_model_name() \u2714\ufe0f bool lt_flash_erase() \u2714\ufe0f bool lt_flash_erase_block() \u2714\ufe0f uint32_t lt_flash_read() \u2714\ufe0f uint32_t lt_flash_write() \u2714\ufe0f const char * lt_get_board_code() \u2714\ufe0f const char * lt_get_device_name() \u2714\ufe0f const char * lt_get_reboot_reason_name() \u2714\ufe0f const char * lt_get_version() \u2714\ufe0f void lt_ota_begin() \u2714\ufe0f bool lt_ota_can_rollback() \u2714\ufe0f bool lt_ota_end() \u2714\ufe0f uf2_ota_scheme_t lt_ota_get_uf2_scheme() \u2714\ufe0f size_t lt_ota_write() \u2714\ufe0f bool lt_ota_write_block() \u2714\ufe0f void lt_rand_bytes() \u2714\ufe0f uint8_t * lt_xtob() \u2714\ufe0f"},{"location":"docs/contrib/lt-api/","title":"API functions guide","text":"

The LibreTiny C API functions are split between three types: common, weak and family.

  • Common functions are implemented in the base, common core and are the same between all families.
  • Weak functions are provided in the common core, but can (and sometimes should) be overridden by family cores. They sometimes provide usable default implementations (which can be overriden to provide e.g. a better way to do something), otherwise they're empty (e.g. if a family doesn't support such a feature).
  • Family functions are not provided in the common core and have to be implemented in the family core.

A quick outline of all available functions and their types:

Type Function Common Weak Family const char * lt_cpu_get_core_type() \u2714\ufe0f void lt_deep_sleep_config_timer() \u2714\ufe0f void lt_deep_sleep_enter() \u2714\ufe0f void lt_deep_sleep_unset_gpio() \u2714\ufe0f lt_flash_id_t lt_flash_get_id() \u2714\ufe0f void lt_get_device_mac() \u2714\ufe0f void lt_init_arduino() \u2714\ufe0f void lt_init_family() \u2714\ufe0f void lt_init_variant() \u2714\ufe0f uint8_t lt_ota_dual_get_current() \u2714\ufe0f uint8_t lt_ota_dual_get_stored() \u2714\ufe0f lt_ota_type_t lt_ota_get_type() \u2714\ufe0f bool lt_ota_is_valid() \u2714\ufe0f bool lt_ota_switch() \u2714\ufe0f uint32_t lt_ram_get_size() \u2714\ufe0f bool lt_wdt_enable() \u2714\ufe0f uint8_t lt_cpu_get_core_count() \u2714\ufe0f uint32_t lt_cpu_get_cycle_count() \u2714\ufe0f uint32_t lt_cpu_get_freq() \u2714\ufe0f uint32_t lt_cpu_get_mac_id() \u2714\ufe0f lt_cpu_model_t lt_cpu_get_model() \u2714\ufe0f uint32_t lt_cpu_get_unique_id() \u2714\ufe0f void lt_deep_sleep_config_gpio() \u2714\ufe0f uint32_t lt_flash_get_size() \u2714\ufe0f lt_reboot_reason_t lt_get_reboot_reason() \u2714\ufe0f void lt_gpio_recover() \u2714\ufe0f uint32_t lt_heap_get_free() \u2714\ufe0f uint32_t lt_heap_get_max_alloc() \u2714\ufe0f uint32_t lt_heap_get_min_free() \u2714\ufe0f uint32_t lt_heap_get_size() \u2714\ufe0f void lt_ota_set_write_protect() \u2714\ufe0f void lt_reboot() \u2714\ufe0f bool lt_reboot_download_mode() \u2714\ufe0f bool lt_reboot_wdt() \u2714\ufe0f bool lt_set_debug_mode() \u2714\ufe0f void lt_wdt_disable() \u2714\ufe0f void lt_wdt_feed() \u2714\ufe0f void hexdump() \u2714\ufe0f char * lt_btox() \u2714\ufe0f lt_cpu_family_t lt_cpu_get_family() \u2714\ufe0f const char * lt_cpu_get_family_name() \u2714\ufe0f uint32_t lt_cpu_get_freq_mhz() \u2714\ufe0f const char * lt_cpu_get_model_code() \u2714\ufe0f const char * lt_cpu_get_model_name() \u2714\ufe0f bool lt_flash_erase() \u2714\ufe0f bool lt_flash_erase_block() \u2714\ufe0f uint32_t lt_flash_read() \u2714\ufe0f uint32_t lt_flash_write() \u2714\ufe0f const char * lt_get_board_code() \u2714\ufe0f const char * lt_get_device_name() \u2714\ufe0f const char * lt_get_reboot_reason_name() \u2714\ufe0f const char * lt_get_version() \u2714\ufe0f void lt_ota_begin() \u2714\ufe0f bool lt_ota_can_rollback() \u2714\ufe0f bool lt_ota_end() \u2714\ufe0f uf2_ota_scheme_t lt_ota_get_uf2_scheme() \u2714\ufe0f size_t lt_ota_write() \u2714\ufe0f bool lt_ota_write_block() \u2714\ufe0f void lt_rand_bytes() \u2714\ufe0f uint8_t * lt_xtob() \u2714\ufe0f"},{"location":"docs/contrib/porting/","title":"Porting new families","text":"

This document briefly outlines what needs to be done, in order to port a new chip family to LibreTiny.

"},{"location":"docs/contrib/porting/#base-framework-builders","title":"Base framework + builders","text":"

The base framework is the core part, that provides little functionality and a small HAL (over some things like OTA or sys control). It also includes a builder script for the vendor SDK.

Here's what has to be done to make that work:

  1. Find vendor SDK - should be self-explanatory. We can't work without a working SDK (yet).
  2. Test vendor SDK - compile a sample program \"as it was meant to be done\".

    • Most SDKs provide some example programs (like Hello World, WiFi scanning, etc.) that can usually be compiled by running a single \"make\" command.
    • Sometimes you need to configure your environment in a weird and complicated way. For me, using Cygwin on Windows was usually enough, though.
    • You need to flash this to the chip as well. The SDK usually bundles some flashing tools.
    • This step is crucial to understand the vendor build system, and to have working binaries to compare out results against.
  3. \"Clean up\" vendor SDK.

    • SDKs usually bundle entire compiler toolchains, which can take up hundreds of megabytes. We want to keep the downloaded PlatformIO packages as small as possible.
    • On existing families, GitHub Workflows produce the packages by removing some files and adding package.json to them. See framework-beken-bdk/.github/workflows/platformio-package.yml for an example.
  4. Write base family and board definitions.

    • families.json needs to have the new family added to it.
    • platform.json needs to know the vendor SDK repository.
    • Add any boards and base JSONs to the boards/ directory. It's easiest to start with generic boards.
    • Use boardgen ltci to generate variant sources (.c and .h).
  5. Add base core code.

    • lt_defs.h, lt_family.h and lt_api.c files need to be created, and initialized with (even empty) functions and definitions.
    • The list of family functions can be found here.
    • Make the SDK call lt_main() as the entrypoint. If needed, use fixups.
  6. Write a binary manipulation tool.

    • While this step could be optional, as these tools are provided in the SDK, they're usually platform-specific (i.e. Windows-only) and use proprietary executables, with no source code nor documentation. This is unacceptable for LibreTiny, as we need to support multiple architectures & platforms (Windows, Linux, Raspberry Pi, etc.). Naturally, doing that in Python seems to be the best choice.
    • All binary tools are currently in ltchiptool/soc/.../binary.py. The elf2bin() function is what takes an .ELF file, and generates a set of binaries that can be flashed to the chip.
    • It's best to test if the generation is correct, by taking an .ELF compiled by vendor SDK, running it through ltchiptool and checking if the resulting binaries are identical.
    • Ghidra/IDA Pro is your friend here; you can decompile the SDK tools.
  7. Write a flashing tool.

    • mostly the same as above. Refer to the existing tools for examples. It's useful to make the flasher class \"standalone\", i.e. a class that is then wrapped by ltchiptool, like in realtek-ambz2.
  8. Write builder scripts.

    • builder/family/xxx.py files are builders, which contain all SDK sources and include paths. Write the script, based on the existing families, and any Makefiles or other scripts from the SDK.
    • Make sure not to make a mess in the CCFLAGS/CPPDEFINES, and only include what's needed there. Some flags are project-wide (family-independent) in builder/frameworks/base.py.
    • Use a pure PlatformIO project - not ESPHome!. Pass one of the generic boards you created before, and framework = base in platformio.ini. Generally, try to get the thing to compile.
    • Use a simple Hello World program - C, not C++. Only add main() function with a printf() and a while(1) loop.
    • I've noticed that using nano.specs instead of nosys.specs produces smaller binaries.
  9. When you get it to link successfully, build a UF2 file.

    • UF2 packages are for flashing and for OTA.
    • Add UF2OTA to the env, to provide binaries that will go to the UF2. Some understanding of the chip's partition and flash layout will be needed.
  10. Flash it, test if it works!

    • It probably won't. You may need to remove __libc_init_array() from cores/common/base/lt_api.c so that it doesn't crash. Most SDKs don't support C++ properly.
"},{"location":"docs/contrib/porting/#making-it-actually-work","title":"Making it actually work","text":"
  1. Write flashdb and printf ports.

    • The ports are in cores/.../base/port/. It's a simple flash access layer, and a character printing function. Not a lot of work, but it needs to be done first.
  2. Add fixups so that string & memory stdlib functions are not from SDK.

    • Refer to stdlib.md to find functions that need to be wrapped.
    • SDK should not define them, you have to figure out a way to remove them from headers. Fixups can mess with includes and trick the SDK into using our own functions.
  3. Clean up FreeRTOS.

    • FreeRTOS' headers usually include some SDK headers, which pull in a lot of macros and typedefs, which usually break lots of non-SDK code, which doesn't expect these macros.
    • library-freertos repo contains some FreeRTOS versions, adapted for SDKs. Basically, copy a clean (straight from FreeRTOS github) version to the repo, commit it. Then copy the version from SDK and compare the differences.
    • Try to make it look as \"stock\" as possible. Discard any formatting differences (and backports).
    • Annotate any parts that can't be removed with #ifdef FREERTOS_PORT_REALTEK_AMB1.
    • Put the FreeRTOS vendor-specific port in library-freertos-port.
    • Remove all FreeRTOS sources from builder scripts. Replace with:
    env.Replace(FREERTOS_PORT=env[\"FAMILY_NAME\"], FREERTOS_PORT_DEFINE=\"REALTEK_AMB1\")\nqueue.AddExternalLibrary(\"freertos\")\nqueue.AddExternalLibrary(\"freertos-port\")\n
  4. Do the same with lwIP - later.

  5. Write LibreTiny C APIs - in lt_api.c.

  6. At this point, your Hello World code should work fine.

"},{"location":"docs/contrib/porting/#porting-arduino-core-c-support","title":"Porting Arduino Core - C++ support","text":"
  1. Add main.cpp and write wiring_*.c ports. GPIOs and stuff should work even without proper C++ support.

  2. Port Serial library first. This should already show whether C++ works fine or if it doesn't. For example, calling Serial.println() refers to the virtual function Print::write, which will probably crash the chip if C++ is not being linked properly.

"},{"location":"docs/contrib/project-structure/","title":"Project structure","text":"
arduino/\n\u251c\u2500 <family name>/               Arduino Core for a specific SoC family\n\u2502  \u251c\u2500 cores/                        Wiring core files\n\u2502  \u251c\u2500 libraries/                    Supported built-in family libraries\n\u2502  \u251c\u2500 port/                     External library port units\n\u251c\u2500 libretiny/\n\u2502  \u251c\u2500 api/                      Library interfaces\n\u2502  \u251c\u2500 common/                   Units common to all families\n\u2502  \u251c\u2500 compat/                   Fixes for compatibility with ESP32 framework\n\u2502  \u251c\u2500 core/                     LibreTiny API for Arduino cores\n\u2502  \u251c\u2500 libraries/                Built-in family-independent libraries\n|  \u251c\u2500 port/                     External library port units\n|  \u251c\u2500 posix/                    POSIX-like C utility functions\nboards/\n\u251c\u2500 _base/                       Base board manifests\n\u251c\u2500 <board name>/                Board-specific code\n\u2502  \u251c\u2500 variant.cpp                   Arduino variant initialization\n\u2502  \u251c\u2500 variant.h                     Arduino variant pin configs\n\u251c\u2500 <board name>.json            PlatformIO board description\nbuilder/\n\u251c\u2500 frameworks/                  Framework builders for PlatformIO\n\u2502  \u251c\u2500 <family name>-sdk.py          Vanilla SDK build system\n\u2502  \u251c\u2500 <family name>-arduino.py      Arduino Core build system\n\u251c\u2500 libs/                        Builders for external libraries\n\u251c\u2500 utils/                       SCons utils used during the build\n\u251c\u2500 arduino-common.py            Builder to provide ArduinoCore-API and LibreTiny APIs\n\u251c\u2500 main.py                      Main PlatformIO builder\ndocs/                           Project documentation, guides, tips, etc.\nplatform/\n\u251c\u2500 <family name>/               Family-specific configurations\n\u2502  \u251c\u2500 bin/                          Binary blobs (bootloaders, etc.)\n\u2502  \u251c\u2500 fixups/                       Code fix-ups to replace SDK parts\n\u2502  \u251c\u2500 ld/                           Linker scripts\n\u2502  \u251c\u2500 openocd/                      OpenOCD configuration files\ntools/\n\u251c\u2500 <tool name>/                     Tools used during the build\n\u251c\u2500 util/                            Utilities used by CLI tools and the builders\nfamilies.json                   List of supported device families\nplatform.json                   PlatformIO manifest\nplatform.py                     Custom PlatformIO script\n
"},{"location":"docs/contrib/stdlib/","title":"C stdlib","text":"

Usually, functions available in C standard library should not be defined by the SDK. Instead, they should be included using GCC's headers, and implemented by the libc or wrapped and implemented in the SDK.

The following functions should not be defined by the SDK. Their presence creates conflicts due to incompatibility with C library, so they should be removed or disabled, and replaced with wrappers.

Memory management functions must be wrapped and redirected to FreeRTOS. The necessary linker flags are already added for all families (in base.py), and a FreeRTOS implementation of the wrappers are provided in malloc.c in the common core. If the family doesn't use FreeRTOS, a separate implementation must be added.

Additionally, if the printf library is used in the chip family code, all other vendor-defined printf-like functions should be replaced with it.

Function prototypes taken from devdocs.io.

// stdlib.h / Dynamic memory management\nvoid *calloc(size_t num, size_t size);\nvoid *malloc(size_t size);\nvoid *realloc(void *ptr, size_t new_size);\nvoid free(void *ptr);\n// stdlib.h / Conversions to numeric formats\ndouble atof(const char *str);\nint atoi(const char *str);\nlong atol(const char *str);\nlong long atoll(const char *str);\ndouble strtod(const char *str, char **str_end);\nfloat strtof(const char *str, char **str_end);\nlong strtol(const char *str, char **str_end, int base);\nlong double strtold(const char *str, char **str_end);\nlong long strtoll(const char *str, char **str_end, int base);\nunsigned long strtoul(const char *str, char **str_end, int base);\nunsigned long long strtoull(const char *str, char **str_end, int base);\n// stdlib.h / Random numbers\nint rand();\n\n// string.h / Character classification\nint isalnum(int ch);\nint isalpha(int ch);\nint islower(int ch);\nint isupper(int ch);\nint isdigit(int ch);\nint isxdigit(int ch);\nint iscntrl(int ch);\nint isgraph(int ch);\nint isspace(int ch);\nint isblank(int ch);\nint isprint(int ch);\nint ispunct(int ch);\nint tolower(int ch);\nint toupper(int ch);\n// string.h / String manipulation\nchar *strcat(char *dest, const char *src);\nchar *strcpy(char *dest, const char *src);\nchar *strncat(char *dest, const char *src, size_t count);\nchar *strncpy(char *dest, const char *src, size_t count);\nsize_t strxfrm(char *dest, const char *src, size_t count);\n// string.h / String examination\nchar *strchr(const char *str, int ch);\nint strcmp(const char *lhs, const char *rhs);\nsize_t strcspn(const char *dest, const char *src);\nsize_t strlen(const char *str);\nint strncmp(const char *lhs, const char *rhs, size_t count);\nchar *strpbrk(const char *dest, const char *breakset);\nchar *strrchr(const char *str, int ch);\nsize_t strspn(const char *dest, const char *src);\nchar *strstr(const char *str, const char *substr);\nchar *strtok(char *str, const char *delim);\n// string.h / Character array manipulation\nvoid *memchr(const void *ptr, int ch, size_t count);\nint memcmp(const void *lhs, const void *rhs, size_t count);\nvoid *memcpy(void *dest, const void *src, size_t count);\nvoid *memmove(void *dest, const void *src, size_t count);\nvoid *memset(void *dest, int ch, size_t count);\n\n// stdio.h / Unformatted input/output\nint putc(int ch, FILE *stream);\nint putchar(int ch);\nint puts(const char *str);\n\n// stdio.h / Formatted input/output\nint printf(const char *format, ...);\nint sprintf(char *buffer, const char *format, ...);\nint snprintf(char *buffer, size_t bufsz, const char *format, ...);\nint vprintf(const char *format, va_list vlist);\nint vsprintf(char *buffer, const char *format, va_list vlist);\nint vsnprintf(char *buffer, size_t bufsz, const char *format, va_list vlist);\n\n// POSIX/BSD (from www.die.net)\nsize_t strlcat(char *dst, const char *src, size_t size);\nsize_t strlcpy(char *dst, const char *src, size_t size);\nsize_t strnlen(const char *s, size_t maxlen);\nchar *strsep(char **stringp, const char *delim);\n\n// Non-stdlib\n_calloc_r\n_free_r\n_malloc_r\n_realloc_r\natoui\natoul\natoull\nstrnicmp\nzalloc\n\n// Additional forbidden macros\n#define max(a, b)\n#define min(a, b)\ntypedef bool boolean;\n
"},{"location":"docs/contrib/ota/","title":"UF2-based OTA","text":"

LibreTiny's OTA updating is based on Microsoft's UF2 specification. Some aspects of the process, such as OTA1/2 support and target partition selection, have been customized with extension tags.

Note

Just like in UF2, all values in this format are little-endian.

"},{"location":"docs/contrib/ota/#firmware-images","title":"Firmware images","text":"

UF2 files may contain multiple firmware images that are to be flashed, i.e. main firmware + bootloader + some config partition.

Some CPUs support dual-OTA schemes: firmware runs from one image, while the other one is reserved for updated firmware. After applying the update, a reboot causes to run the other image instead.

Each firmware image may be either applicable:

  1. only when flashing OTA1 (part;file;;)
  2. only when flashing OTA2 (;;part;file)
  3. for both schemes to a single partition (part;file)
  4. for both schemes but different partitions (part1;file;part2;file)
  5. for both schemes but with a different binary (part;file1;part;file2)
  6. for both schemes, with different binaries and target partitions (part1;file1;part2;file2)

* part means partition here

** values in parentheses show the input format to use for uf2ota.py

For easier understanding, these update types will be referred to in this document using the numbers.

"},{"location":"docs/contrib/ota/#extension-tags","title":"Extension tags","text":"

Standard tags are used: VERSION, DEVICE and DEVICE_ID.

Additionally, custom tags are defined:

Name ID Type Description OTA_VERSION 0x5D57D0 int 8-bit format version (for simple compatibility checks) BOARD 0xCA25C8 string board name / code (lowercase) FIRMWARE 0x00DE43 string firmware description / name BUILD_DATE 0x822F30 int 32-bit build date/time as Unix timestamp LT_VERSION 0x59563D semver LT version LT_PART_1 0x805946 string OTA1 partition name LT_PART_2 0xA1E4D7 string OTA2 partition name LT_HAS_OTA1 0xBBD965 bool 8-bit image has any data for OTA1 LT_HAS_OTA2 0x92280E bool 8-bit image has any data for OTA2 LT_BINPATCH 0xB948DE bytes binary patch to convert OTA1->OTA2"},{"location":"docs/contrib/ota/#update-types","title":"Update types","text":""},{"location":"docs/contrib/ota/#single-ota-scheme-1-2","title":"Single OTA scheme (1, 2)","text":"

Image is ignored if the OTA scheme does not match. UF2 has LT_PART_1 or LT_PART_2 set to target partition name. The other partition tag is present, but empty (0 bytes).

08 46 59 80 6f 74 61 31 | .FY.ota1 | LT_PART_1\n04 d7 e4 a1             | ....     | LT_PART_2\n
"},{"location":"docs/contrib/ota/#dual-otasingle-file-scheme-3-4","title":"Dual-OTA/single-file scheme (3, 4)","text":"

One image is used for both OTA schemes. UF2 has LT_PART_1 and LT_PART_2 tags set. For type 3 these two tags contain the same partition name.

08 46 59 80 6f 74 61 31 | .FY.ota1 | LT_PART_1\n08 d7 e4 a1 6f 74 61 32 | ....ota2 | LT_PART_2\n
"},{"location":"docs/contrib/ota/#dual-otadual-file-scheme-5-6","title":"Dual-OTA/dual-file scheme (5, 6)","text":"

Just like types 3 and 4, UF2 has two partition tags set. For type 5 they have the same name.

The image stored in UF2 is meant for OTA1 scheme. There is an additional tag LT_BINPATCH present. In OTA1 flashing scheme, it is ignored.

"},{"location":"docs/contrib/ota/#binary-patching","title":"Binary patching","text":"

OTA2 images are not stored directly, as that would needlessly double the UF2 file size. Instead, binary patching instructions, embedded into the extension tags area, allow the CPU to convert the OTA1 image from UF2 into OTA2 image.

There can be at most one binpatch tag in a UF2 block. It has the following format:

  • opcode (1 byte) - operation type:
    • DIFF32 (0xFE) - difference between 32-bit values
  • length (1 byte) - data length
  • data (length bytes)
    • for DIFF32:
      • difference value (signed int 32-bit)
      • offset table (length-4 bytes)

The presented structure can be repeated in a single binpatch tag.

"},{"location":"docs/contrib/ota/#diff32","title":"DIFF32","text":"

This method works by adding the difference value to a 32-bit integer. It allows to save the most space in OTA1/2 image scenarios, where the only different values are, for example, flash memory addresses. The offset table contains positions within the 256-byte block, to which the difference value should be mathematically added.

For a block like:

000  72 71 73 61 76 65 00 00  5f 66 72 65 65 72 74 6f  |rqsave.._freerto|\n010  73 5f 6d 75 74 65 78 5f  67 65 74 5f 74 69 6d 65  |s_mutex_get_time|\n020  6f 75 74 00 5d a4 03 08  61 a4 03 08 85 a4 03 08  |out.]...a.......|\n030  5d a4 03 08 61 a4 03 08  85 a4 03 08 81 a9 03 08  |]...a...........|\n040  6d a9 03 08 7d a4 03 08  d9 a8 03 08 05 a7 03 08  |m...}...........|\n050  bd a4 03 08 ad a8 03 08  59 a7 03 08 9d a8 03 08  |........Y.......|\n060  01 a7 03 08 51 a8 03 08  21 aa 03 08 b9 a4 03 08  |....Q...!.......|\n070  85 a3 03 08 89 a3 03 08  4d a4 03 08 a1 a8 03 08  |........M.......|\n080  00 00 00 00 00 00 00 00  19 a8 03 08 c1 a4 03 08  |................|\n090  8d a8 03 08 ed a6 03 08  dd a7 03 08 ad a4 03 08  |................|\n0a0  9d a7 03 08 95 a4 03 08  81 a7 03 08 09 a7 03 08  |................|\n0b0  31 a7 03 08 d1 a6 03 08  dd a5 03 08 61 aa 03 08  |1...........a...|\n0c0  c5 a2 03 08 d5 a2 03 08  d9 a2 03 08 b1 a6 03 08  |................|\n0d0  65 aa 03 08 ad a6 03 08  a9 a6 03 08 8d a6 03 08  |e...............|\n0e0  e5 a2 03 08 e9 a2 03 08  1d a4 03 08 ed a3 03 08  |................|\n0f0  35 a4 03 08 05 a4 03 08  bd a3 03 08 8d a3 03 08  |5...............|\n

a DIFF32 patch containing:

     fe 39 00 50 0c 00 24 28  2c 30 34 38 3c 40 44 48  |.9.P..$(,048<@DH|\n     4c 50 54 58 5c 60 64 68  6c 70 74 78 7c 88 8c 90  |LPTX\\`dhlptx|...|\n     94 98 9c a0 a4 a8 ac b0  b4 b8 bc c0 c4 c8 cc d0  |................|\n     d4 d8 dc e0 e4 e8 ec f0  f4 f8 fc                 |...........     |\n

adds 0x000C5000 to 53 values, producing OTA2 output like this:

000  72 71 73 61 76 65 00 00  5f 66 72 65 65 72 74 6f  |rqsave.._freerto|\n010  73 5f 6d 75 74 65 78 5f  67 65 74 5f 74 69 6d 65  |s_mutex_get_time|\n020  6f 75 74 00 5d f4 0f 08  61 f4 0f 08 85 f4 0f 08  |out.]...a.......|\n030  5d f4 0f 08 61 f4 0f 08  85 f4 0f 08 81 f9 0f 08  |]...a...........|\n040  6d f9 0f 08 7d f4 0f 08  d9 f8 0f 08 05 f7 0f 08  |m...}...........|\n050  bd f4 0f 08 ad f8 0f 08  59 f7 0f 08 9d f8 0f 08  |........Y.......|\n060  01 f7 0f 08 51 f8 0f 08  21 fa 0f 08 b9 f4 0f 08  |....Q...!.......|\n070  85 f3 0f 08 89 f3 0f 08  4d f4 0f 08 a1 f8 0f 08  |........M.......|\n080  00 00 00 00 00 00 00 00  19 f8 0f 08 c1 f4 0f 08  |................|\n090  8d f8 0f 08 ed f6 0f 08  dd f7 0f 08 ad f4 0f 08  |................|\n0a0  9d f7 0f 08 95 f4 0f 08  81 f7 0f 08 09 f7 0f 08  |................|\n0b0  31 f7 0f 08 d1 f6 0f 08  dd f5 0f 08 61 fa 0f 08  |1...........a...|\n0c0  c5 f2 0f 08 d5 f2 0f 08  d9 f2 0f 08 b1 f6 0f 08  |................|\n0d0  65 fa 0f 08 ad f6 0f 08  a9 f6 0f 08 8d f6 0f 08  |e...............|\n0e0  e5 f2 0f 08 e9 f2 0f 08  1d f4 0f 08 ed f3 0f 08  |................|\n0f0  35 f4 0f 08 05 f4 0f 08  bd f3 0f 08 8d f3 0f 08  |5...............|\n

"},{"location":"docs/contrib/ota/library/","title":"uf2ota library","text":"

uf2ota library allows to write a LibreTiny UF2 file to the flash, while parsing all the necessary tags. It manages the target partitions, compatibility checks, and works on top of the FAL provided by FlashDB.

"},{"location":"docs/contrib/ota/library/#usage-example","title":"Usage example","text":"
uint8_t target     = 1;          // target OTA scheme - 1 or 2\nuint32_t family    = F_RTL8710B; // chip's UF2 family ID\nuf2_ota_t *ctx     = uf2_ctx_init(target, family);\nuf2_info_t *info   = uf2_info_init(); // optional, for getting firmware info\nuf2_block_t *block = (uf2_block_t *)malloc(UF2_BLOCK_SIZE);\nuf2_err_t err;\n\n// ... // read the first header block (512 bytes) into *block\n\n// check the block for validity\nerr = uf2_check_block(ctx, block);\nif (err > UF2_ERR_IGNORE)\n    // handle the error\n    return;\n\n// parse the header block\n// note: if you don't need info, you can skip this step and call uf2_write() directly\nerr = uf2_parse_header(ctx, block, info);\nif (err)\n    // handle the error\n    return;\n\nwhile (/* have input data */) {\n\n    // ... // read the next block into *block\n\n    // check the block for validity\n    err = uf2_check_block(ctx, block);\n    if (err == UF2_ERR_IGNORE)\n        // skip this block\n        continue;\n    if (err)\n        // handle the error\n        return;\n\n    // write the block to flash\n    err = uf2_write(ctx, block);\n    if (err > UF2_ERR_IGNORE)\n        // handle the error\n        return;\n}\n\n// finish the update process\n\n// ... // activate your new OTA partition\n\n// cleanup\nfree(ctx);\nfree(block);\nuf2_info_free(info);\n
"},{"location":"docs/contrib/ota/uf2ota/","title":"uf2ota.py","text":"

This is a tool for converting LibreTiny firmware images to UF2 format for OTA updates.

$ python uf2ota.py\nusage: uf2ota [-h] [--output OUTPUT] [--family FAMILY] [--board BOARD] [--version VERSION] [--fw FW] {info,dump,write} inputs [inputs ...]\nuf2ota: error: the following arguments are required: action, inputs\n
"},{"location":"docs/contrib/ota/uf2ota/#write","title":"write","text":"

Generate a UF2 file from a firmware image or several images.

$ python uf2ota.py write --family RTL8710B --board wr3 --version 0.4.0 --fw esphome:2022.6.0-dev \"ota1;xip1.bin;ota2;xip2.bin\"\n\n$ ls -l out.uf2\n-rw-r--r-- 1 Kuba None 605696 May 28 14:35 out.uf2\n
"},{"location":"docs/contrib/ota/uf2ota/#inputs-format","title":"inputs format","text":"

Format for inputs parameter is part;file[;part;file] (square brackets mean optional). First two (colon separated) values correspond to flashing OTA1 region, second two to OTA2.

Partition name can be suffixed by +offset, which causes writing the image file to the partition after some byte offset. Both files and/or partition names can be equal. Values can be empty (like part;file;; or ;;part;file) if OTA1/2 images are not present in this file.

When using two different firmware binaries, they need to have the same offset and be of the same size.

inputs parameter can be repeated in order to embed multiple files in the UF2. For example:

\"bootloader;boot.bin\" \"ota1;xip1.bin;ota2;xip2.bin\" \"config;config1.bin;config;config2.bin\"\n
will:

  • flash the bootloader in both OTA schemes
  • flash xip1.bin or xip2.bin to ota1 or ota2 partitions
  • flash config1.bin or config2.bin to config partition
"},{"location":"docs/contrib/ota/uf2ota/#info","title":"info","text":"

This command shows some basic parameters of a UF2 image.

$ python uf2ota.py info out.uf2\nFamily: RTL8710B\nTags:\n - BOARD: wr3\n - DEVICE_ID: 312d5ec5\n - LT_VERSION: 0.4.0\n - FIRMWARE: esphome\n - VERSION: 2022.6.0-dev\n - OTA_VERSION: 01\n - DEVICE: LibreTiny\n - LT_HAS_OTA1: 01\n - LT_HAS_OTA2: 01\n - LT_PART_1: ota1\n - LT_PART_2: ota2\n - LT_BINPATCH: fe0900500c009094989ca0\nData chunks: 1182\nTotal binary size: 302448\n
"},{"location":"docs/contrib/ota/uf2ota/#dump","title":"dump","text":"

Dump UF2 file (only LibreTiny format) into separate firmware binaries.

$ python uf2ota.py dump out.uf2\n\n$ ls -1 out.uf2_dump/\nesphome_2022.6.0-dev_lt0.4.0_wr3_1_ota1_0x0.bin\nesphome_2022.6.0-dev_lt0.4.0_wr3_2_ota2_0x0.bin\n
"},{"location":"docs/dev/config/","title":"Configuration","text":""},{"location":"docs/dev/config/#project-options","title":"Project options","text":"platformio.ini
[env:my_board]\n# custom firmware name, present in UF2 output files\n# - default: project directory name\ncustom_fw_name = my_firmware\n# custom firmware version\n# - default: current date in yy.mm.dd format\ncustom_fw_version = 1.2.0\n\n# custom build options (#defines, NOT compiler flags)\ncustom_options.lwip =\n    LWIP_IPV4 = 1\ncustom_options.freertos =\n    configUSE_TICK_HOOK = 1\n\n# partition layout modification (not recommended, unless you know what you're doing)\ncustom_flash.app = 0x12000\n\n# custom board JSON (overrides)\n# - path relative to the project directory; only values specified\n#     in the JSON will override the defaults\n#     (it's like using board_build.xxx but for more keys)\ncustom_board = myboard.json\n\n# custom library versions (not recommended)\ncustom_versions.lwip = 2.1.3\ncustom_versions.beken_bdk = 2021.06.07\n
"},{"location":"docs/dev/config/#libretiny-options","title":"LibreTiny options","text":"

Note

See lt_config.h for most options and their defaults.

All options are configurable via C++ defines in PlatformIO project file. For example: platformio.ini

[env:my_board]\nbuild_flags =\n  -D LT_LOGLEVEL=LT_LEVEL_DEBUG\n

Tip

Values in parentheses represent the defaults for the config options.

"},{"location":"docs/dev/config/#logger","title":"Logger","text":"
  • LT_LOGGER (1) - enable/disable LibreTiny logger globally; disabling this sets the loglevel to LT_LEVEL_NONE - the logger can't be enabled even by using lt_log_set_port()
  • LT_LOGLEVEL - global LT loglevel:

    • LT_LEVEL_VERBOSE
    • LT_LEVEL_TRACE - same as LT_LEVEL_VERBOSE
    • LT_LEVEL_DEBUG
    • LT_LEVEL_INFO - default
    • LT_LEVEL_WARN
    • LT_LEVEL_ERROR
    • LT_LEVEL_FATAL
    • LT_LEVEL_NONE - disables everything
  • LT_LOGGER_TIMESTAMP (1) - print program runtime in printk-like format

  • LT_LOGGER_CALLER (1) - print calling method name
  • LT_LOGGER_TASK (1) - print calling FreeRTOS task (if available)
  • LT_LOGGER_COLOR (0) - output ANSI terminal colors
  • LT_PRINTF_BROKEN (0) - whether printf outputs \"0.\" for floats with value 0
  • LT_LOG_HEAP (0) - print free heap size using LT_HEAP_I(), and periodically every 1000 ms
  • LT_LOG_ERRNO (0) - print and clear errno value (if set) using LT_ERRNO()
"},{"location":"docs/dev/config/#per-module-logging-debugging","title":"Per-module logging & debugging","text":"

The following options enable library-specific logging output. They are effective for all loglevels - i.e. disabling LT_DEBUG_WIFI will disable WiFi debug messages, warnings, as well as errors.

To see debug messages from i.e. OTA, loglevel must also be changed.

  • LT_DEBUG_ALL (0) - enable all following options by default (except for FDB and LWIP)
  • LT_DEBUG_WIFI (1) - WiFi (generic, STA, AP, scan, events, etc.)
  • LT_DEBUG_CLIENT (0) - TCP client
  • LT_DEBUG_SERVER (0) - TCP server
  • LT_DEBUG_SSL (0) - SSL clients
  • LT_DEBUG_OTA (1) - OTA updates (Update library)
  • LT_DEBUG_FDB (0) - FlashDB debugging (macros within the library)
  • LT_DEBUG_MDNS (0) - mDNS client library
  • LT_DEBUG_LWIP (0) - enables LWIP_DEBUG, provides LWIP_PLATFORM_DIAG; per-module options (i.e. TCP_DEBUG) are off by default and need to be enabled separately
  • LT_DEBUG_LWIP_ASSERT (0) - enables assertions within lwIP (doesn't need LT_DEBUG_LWIP)

Tip

Enabling LT_DEBUG_ALL doesn't mean that every debugging message will be printed. If loglevel is i.e. WARN, debug messages won't be visible anyway.

This can be used, for example, to enable only \"important\" messages: platformio.ini

[env:my_board]\nbuild_flags =\n  -D LT_LOGLEVEL=LT_LEVEL_WARN\n  -D LT_DEBUG_ALL=1 # will print only warnings and errors from all modules\n

"},{"location":"docs/dev/config/#serial-output","title":"Serial output","text":"

Options for controlling default UART log output.

  • LT_UART_DEFAULT_PORT (unset) - default output port for all messages (SDK, LT logger, Serial class); can be 0, 1 or 2
  • LT_UART_DEFAULT_LOGGER (unset) - override default output port for LT logger only
  • LT_UART_DEFAULT_SERIAL (unset) - override default output port for Serial class (without a number)
  • LT_UART_SILENT_ENABLED (1) - enable auto-silencing of SDK \"loggers\"; this makes the serial output much more readable, but can hide some error messages
  • LT_UART_SILENT_ALL (0) - disable all SDK output (LT output and logger still work); since v1.0.0 this has no effect if LT_UART_SILENT_ENABLED is 0

Info

Values 0, 1 and 2 correspond to physical UART port numbers (refer to board pinout for the available ports).

Serial class instances (Serial0, Serial1, Serial2) use the respective port numbers for printing.

If LT_UART_DEFAULT_LOGGER is not set, it is chosen by the family code - whichever port is most appropriate (i.e. LOG_UART (2) on Realtek, RX2/TX2 on Beken).

"},{"location":"docs/dev/config/#misc-options","title":"Misc options","text":"
  • LT_USE_TIME (0) - enables implementation of gettimeofday() and settimeofday(); checks for millis() overflows periodically
  • LT_MICROS_HIGH_RES (1) - count runtime microseconds using a high-resolution timer (if possible); disable if your application doesn't need micros()
  • LT_AUTO_DOWNLOAD_REBOOT (1) - automatically reboot into \"download mode\" after detecting a flashing protocol command; read more
"},{"location":"docs/dev/config/#family-configuration","title":"Family configuration","text":"

Warning

These options are not meant for end-users. They're provided here as a reference for developers. Do not set these options manually.

These options are selectively set by all families, as part of the build process. They are used for enabling LT core API parts, if the family has support for it. Files named lt_defs.h, containing these options, are read by the PlatformIO builders (note: they're never included by C code).

Checking for option value should be done with #if (not with #ifdef!) - if it's not defined, it will evaluate to 0. Otherwise, it will use the defined value, either 0 or 1.

  • family-/chip-specific hardware peripherals
    • LT_HW_WIFI - WiFi supported on the chip
    • LT_HW_BT - Bluetooth Classic supported on the chip
    • LT_HW_BLE - Bluetooth Low Energy supported on the chip
    • LT_HW_WATCHDOG - watchdog available
    • LT_HW_DEEP_SLEEP - deep sleep possible
  • board-specific peripherals (note: defined in lt_pins.h, depending on available pin numbers)
    • LT_HW_UART# - UART number # available on the board
    • LT_HW_I2C# - I\u00b2C number # available on the board
    • LT_HW_SPI# - SPI number # available on the board
  • family software options (SDK features, LT implementation status)
    • LT_HAS_FREERTOS - FreeRTOS supported and used
    • LT_HAS_LWIP - LwIP in SDK (any version)
    • LT_HAS_LWIP2 - LwIP v2.0.0 or newer
    • LT_HAS_MBEDTLS - mbedTLS in SDK
    • LT_HAS_PRINTF - printf library implemented
    • LT_HAS_FLASH - FAL flash port implemented
    • LT_HAS_OTA - OTA implemented in base framework
  • Arduino Core implementation status (only available and used along with Arduino framework)
    • LT_ARD_HAS_SERIAL - Serial class implemented
    • LT_ARD_HAS_SOFTSERIAL - SoftwareSerial library implemented
    • LT_ARD_HAS_WIFI - WiFi library implemented
    • LT_ARD_HAS_WIRE - Wire (I\u00b2C) library implemented
    • LT_ARD_HAS_SPI - SPI library implemented
    • LT_ARD_MD5_MBEDTLS - use mbedTLS for MD5 library
    • LT_ARD_MD5_HOSTAPD - use hostapd for MD5 library
  • misc options
    • LT_HEAP_FUNC - function name used to get available heap size (for LT_HEAP_I())
    • LT_REALLOC_FUNC - function name used for realloc() call
    • LT_REMALLOC - use malloc() and memcpy() in realloc() call
"},{"location":"docs/dev/libs-3rd-party/","title":"Libraries","text":"

A page outlining 3-rd some party libraries compatible with LibreTiny.

Note

To use some (most? (all?)) of these, a flag in platformio.ini is required to disable compatibility checks (because most libs are meant for ESP32/Arduino official framework):

[env:my_board]\nlib_compat_mode = off\n

"},{"location":"docs/dev/libs-3rd-party/#256dpimqtt","title":"256dpi/MQTT","text":"

Tested with realtek-ambz.

lib_deps = 256dpi/MQTT@^2.5.0\n

"},{"location":"docs/dev/libs-3rd-party/#bbx10dnsserver","title":"bbx10/DNSServer","text":"

Tested with beken-72xx.

lib_deps = bbx10/DNSServer@^1.1.0\n
This is the same library as in ESP32 Arduino Core.

"},{"location":"docs/dev/libs-3rd-party/#esphomeasynctcp-esphome","title":"esphome/AsyncTCP-esphome","text":"

Tested with beken-72xx and realtek-ambz.

lib_deps = esphome/AsyncTCP-esphome@^2.0.0\n
This is ESPHome's fork of the original library.

"},{"location":"docs/dev/libs-3rd-party/#esphomeespasyncwebserver-esphome","title":"esphome/ESPAsyncWebServer-esphome","text":"

Tested with beken-72xx and realtek-ambz.

lib_deps = esphome/ESPAsyncWebServer-esphome@^3.0.0\n
This is ESPHome's fork of the original library.

"},{"location":"docs/dev/lt-api/","title":"LibreTiny API","text":"

The LibreTiny API is divided in two parts:

  • the C API, available in all families and frameworks
  • the C++ API, available in the Arduino framework only.

The C++ API is a thin wrapper around the C API (using classes with inline functions). It's provided for less-experienced users, who are used to Arduino IDE's classes like ESP (and for backwards compatibility). It's recommended to use the C API wherever possible.

"},{"location":"docs/dev/lt-api/#c-api","title":"C API","text":"

This API is available using:

  • #include <libretiny.h>
  • #include <Arduino.h>
"},{"location":"docs/dev/lt-api/#cpu","title":"CPU","text":"Type Name uint8_t lt_cpu_get_core_count () Get CPU core count. const char * lt_cpu_get_core_type () Get CPU core type name as string. uint32_t lt_cpu_get_cycle_count () Get CPU cycle count. lt_cpu_family_t lt_cpu_get_family () Get CPU family ID (as lt_cpu_family_t enum member). const char * lt_cpu_get_family_name () Get CPU family name as string. uint32_t lt_cpu_get_freq () Get CPU frequency in Hz. uint32_t lt_cpu_get_freq_mhz () Get CPU frequency in MHz. uint32_t lt_cpu_get_mac_id () Get CPU ID based on the last three octets of MAC address. Note: the number is 24-bit (with the MSB being zero). The 3rd-to-last octet is least-significant, the last octet is most-significant. lt_cpu_model_t lt_cpu_get_model () Get CPU model ID (as lt_cpu_model_t enum member). const char * lt_cpu_get_model_code () Get CPU model name as string (lowercase). const char * lt_cpu_get_model_name () Get CPU model name as string (uppercase). uint32_t lt_cpu_get_unique_id () Get CPU unique ID. This may be based on MAC, eFuse, etc. (family-specific). Note: the number is 24-bit (with the MSB being zero)."},{"location":"docs/dev/lt-api/#device","title":"Device","text":"Type Name const char * lt_get_board_code () Get board code. void lt_get_device_mac (uint8_t * mac) Read device's default MAC address into 'mac' array. This can be used even without Wi-Fi enabled, and will ignore user-changed Wi-Fi MAC (if changing is possible). const char * lt_get_device_name () Get device friendly name in format \"LT-<chip model>-<MAC ID>\". Can be used as hostname. lt_reboot_reason_t lt_get_reboot_reason () Get the reason of last chip reboot. const char * lt_get_reboot_reason_name (lt_reboot_reason_t reason) Get a textual representation of a reboot reason. const char * lt_get_version () Get LibreTiny version string. void lt_gpio_recover () Reconfigure GPIO pins used for debugging (SWD/JTAG), so that they can be used as normal I/O. void lt_reboot () Reboot the CPU. bool lt_reboot_download_mode () Reboot the CPU and stay in download mode (if possible). bool lt_reboot_wdt () Reboot the CPU with a watchdog timeout (if possible). bool lt_set_debug_mode (lt_debug_mode_t mode) Set debugger mode (JTAG, SWD or OFF)."},{"location":"docs/dev/lt-api/#macros","title":"Macros","text":"Type Name define REBOOT_REASON_SLEEP REBOOT_REASON_SLEEP_GPIO define RESET_REASON_BROWNOUT REBOOT_REASON_BROWNOUT define RESET_REASON_CRASH REBOOT_REASON_CRASH define RESET_REASON_HARDWARE REBOOT_REASON_HARDWARE define RESET_REASON_MAX REBOOT_REASON_MAX define RESET_REASON_POWER REBOOT_REASON_POWER define RESET_REASON_SLEEP REBOOT_REASON_SLEEP_GPIO define RESET_REASON_SLEEP_GPIO REBOOT_REASON_SLEEP_GPIO define RESET_REASON_SLEEP_RTC REBOOT_REASON_SLEEP_RTC define RESET_REASON_SLEEP_USB REBOOT_REASON_SLEEP_USB define RESET_REASON_SOFTWARE REBOOT_REASON_SOFTWARE define RESET_REASON_UNKNOWN REBOOT_REASON_UNKNOWN define RESET_REASON_WATCHDOG REBOOT_REASON_WATCHDOG"},{"location":"docs/dev/lt-api/#public-types-documentation","title":"Public Types Documentation","text":""},{"location":"docs/dev/lt-api/#enum-lt_debug_mode_t","title":"enum lt_debug_mode_t","text":"
enum lt_debug_mode_t {\n    DEBUG_MODE_OFF = 0,\n    DEBUG_MODE_JTAG = 1,\n    DEBUG_MODE_SWD = 2\n};\n
"},{"location":"docs/dev/lt-api/#enum-lt_reboot_reason_t","title":"enum lt_reboot_reason_t","text":"
enum lt_reboot_reason_t {\n    REBOOT_REASON_UNKNOWN = 1,\n    REBOOT_REASON_POWER = 2,\n    REBOOT_REASON_BROWNOUT = 3,\n    REBOOT_REASON_HARDWARE = 4,\n    REBOOT_REASON_SOFTWARE = 5,\n    REBOOT_REASON_WATCHDOG = 6,\n    REBOOT_REASON_CRASH = 7,\n    REBOOT_REASON_SLEEP_GPIO = 8,\n    REBOOT_REASON_SLEEP_RTC = 9,\n    REBOOT_REASON_SLEEP_USB = 10,\n    REBOOT_REASON_DEBUGGER = 11,\n    REBOOT_REASON_MAX = 12\n};\n
"},{"location":"docs/dev/lt-api/#flash","title":"Flash","text":"Type Name bool lt_flash_erase (uint32_t offset, size_t length) Erase flash area. Flash can only be erased in blocks (usually 4 KiB). bool lt_flash_erase_block (uint32_t offset) Erase a single block of flash (usually 4 KiB). lt_flash_id_t lt_flash_get_id () Read flash chip ID and return a lt_flash_id_t struct. uint32_t lt_flash_get_size () Get flash chip total size. uint32_t lt_flash_read (uint32_t offset, uint8_t * data, size_t length) Read data from the flash. uint32_t lt_flash_write (uint32_t offset, const uint8_t * data, size_t length) Write data to the flash."},{"location":"docs/dev/lt-api/#memory","title":"Memory","text":"Type Name uint32_t lt_heap_get_free () Get free heap size. uint32_t lt_heap_get_max_alloc () Get largest block of heap that can be allocated at once. uint32_t lt_heap_get_min_free () Get lowest level of free heap memory. uint32_t lt_heap_get_size () Get total heap size. uint32_t lt_ram_get_size () Get total RAM size."},{"location":"docs/dev/lt-api/#ota","title":"OTA","text":"Type Name void lt_ota_begin (lt_ota_ctx_t * ctx, size_t size) Initialize the update context to begin OTA process. bool lt_ota_can_rollback () Check if OTA rollback is possible (switching the stored index to another partition). uint8_t lt_ota_dual_get_current () Get the currently running firmware's OTA index. uint8_t lt_ota_dual_get_stored () Read the currently active OTA index, i.e. the one that will boot upon restart. bool lt_ota_end (lt_ota_ctx_t * ctx) Finish the update process. If the update has been written completely, try to activate the target image. Free allocated internal structures, regardless of the activation result. lt_ota_type_t lt_ota_get_type () Get OTA type of the device's chip. uf2_ota_scheme_t lt_ota_get_uf2_scheme () Check which UF2 OTA scheme should be used for applying firmware updates. bool lt_ota_is_valid (uint8_t index) Check if the specified OTA image is valid. void lt_ota_set_write_protect (uf2_ota_t * uf2) Set family-specific, write-protected flash areas in the OTA update context. This shouldn't be called manually, as it's done by lt_ota_begin(). bool lt_ota_switch (bool revert) Try to switch OTA index to the other image. For single-OTA chips, only check if the upgrade image is valid. size_t lt_ota_write (lt_ota_ctx_t * ctx, const uint8_t * data, size_t len) Process a chunk of data. bool lt_ota_write_block (lt_ota_ctx_t * ctx, uf2_block_t * block) Try to write the block. In case of UF2 errors, error code is set in the context. Note: use lt_ota_write() instead. This is for internal usage only."},{"location":"docs/dev/lt-api/#public-types-documentation_1","title":"Public Types Documentation","text":""},{"location":"docs/dev/lt-api/#enum-lt_ota_type_t","title":"enum lt_ota_type_t","text":"
enum lt_ota_type_t {\n    OTA_TYPE_SINGLE = 0,\n    OTA_TYPE_DUAL = 1,\n    OTA_TYPE_FILE = 2\n};\n
"},{"location":"docs/dev/lt-api/#utilities","title":"Utilities","text":"Type Name void hexdump (const uint8_t * buf, size_t len, uint32_t offset=0, uint8_t width=16) Print data pointed to by buf in hexdump-like format (hex+ASCII). char * lt_btox (const uint8_t * src, int len, char * dest) Convert a byte array to hexadecimal string. void lt_rand_bytes (uint8_t * buf, size_t len) Generate random bytes using rand(). uint8_t * lt_xtob (const char * src, int len, uint8_t * dest) Convert a hexadecimal string to byte array."},{"location":"docs/dev/lt-api/#watchdog","title":"Watchdog","text":"Type Name void lt_wdt_disable () Disable the hardware watchdog. bool lt_wdt_enable (uint32_t timeout) Enable the hardware watchdog. void lt_wdt_feed () Feed/reset the hardware watchdog timer."},{"location":"docs/dev/lt-api/#logger","title":"Logger","text":"Type Name void lt_log (const uint8_t level, const char * format, ...) void lt_log_disable () Disable LT logger. Enable it back using lt_log_set_port(LT_UART_DEFAULT_LOGGER). void void lt_log_set_port (uint8_t port) Change log output port."},{"location":"docs/dev/lt-api/#posix-compatibility-api","title":"POSIX compatibility API","text":"

A small subset of POSIX functions, commonly present in other Arduino cores, is provided for compatibility.

Type Name int strcasecmp (const char * s1, const char * s2) char * strdup (const char *) int strncasecmp (const char * s1, const char * s2, size_t n) char * strptime (const char * buf, const char * fmt, struct tm * tm)"},{"location":"docs/dev/lt-api/#c-api_1","title":"C++ API","text":"

This API is available using:

  • #include <Arduino.h>
"},{"location":"docs/dev/lt-api/#libretiny","title":"LibreTiny","text":"

Since v1.0.0, this class only consists of inline functions, which wrap the LibreTiny C API (lt_api.h). Refer to the docs of the C API for more information.

The class is accessible using the LT global object.

Type Name const char * getBoard () Get board code. const char * getChipCoreType () Get CPU core type name as string. uint8_t getChipCores () Get CPU core count. ChipFamily getChipFamily () Get CPU family ID (as lt_cpu_family_t enum member). const char * getChipFamilyName () Get CPU family name as string. uint32_t getChipId () Get CPU ID based on the last three octets of MAC address. Note: the number is 24-bit (with the MSB being zero). The 3rd-to-last octet is least-significant, the last octet is most-significant. const char * getChipModel () Get CPU model name as string (uppercase). ChipType getChipType () Get CPU model ID (as lt_cpu_model_t enum member). uint32_t getCpuFreq () Get CPU frequency in Hz. uint32_t getCpuFreqMHz () Get CPU frequency in MHz. uint32_t getCycleCount () Get CPU cycle count. const char * getDeviceName () Get device friendly name in format \"LT-<chip model>-<MAC ID>\". Can be used as hostname. FlashId getFlashChipId () Read flash chip ID and return a lt_flash_id_t struct. uint32_t getFlashChipSize () Get flash chip total size. uint32_t getFreeHeap () Get free heap size. uint32_t getHeapSize () Get total heap size. uint32_t getMaxAllocHeap () Get largest block of heap that can be allocated at once. uint32_t getMaxFreeBlockSize () Get largest block of heap that can be allocated at once. uint32_t getMinFreeHeap () Get lowest level of free heap memory. uint32_t getRamSize () Get total RAM size. ResetReason getResetReason () Get the reason of last chip reboot. const char * getResetReasonName (ResetReason reason=lt_get_reboot_reason()) Get a textual representation of a reboot reason. const char * getVersion () Reset reason enumeration. void gpioRecover () Reconfigure GPIO pins used for debugging (SWD/JTAG), so that they can be used as normal I/O. void restart () Reboot the CPU. void restartDownloadMode () Reboot the CPU and stay in download mode (if possible)."},{"location":"docs/dev/lt-api/#libretinyota","title":"LibreTinyOTA","text":"

This class only consists of inline functions, which wrap the LibreTiny C API (lt_api.h). Refer to the docs of the C API for more information.

The class is accessible using the OTA global object.

Type Name bool canRollback () Check if OTA rollback is possible (switching the stored index to another partition). uint8_t getCurrentIndex () Get the currently running firmware's OTA index. uint8_t getStoredIndex () Read the currently active OTA index, i.e. the one that will boot upon restart. lt_ota_type_t getType () Get OTA type of the device's chip. uf2_ota_scheme_t getUF2Scheme () Check which UF2 OTA scheme should be used for applying firmware updates. bool isValid (uint8_t index) Check if the specified OTA image is valid. bool switchImage (bool revert=false) Try to switch OTA index to the other image. For single-OTA chips, only check if the upgrade image is valid."},{"location":"docs/dev/lt-api/#libretinywdt","title":"LibreTinyWDT","text":"

This class only consists of inline functions, which wrap the LibreTiny C API (lt_api.h). Refer to the docs of the C API for more information.

The class is accessible using the WDT global object.

Type Name void disable () Disable the hardware watchdog. bool enable (uint32_t timeout=10000) Enable the hardware watchdog. void feed () Feed/reset the hardware watchdog timer."},{"location":"docs/dev/lt-api/#esp-compatibility-class","title":"ESP (compatibility class)","text":"

This class only consists of inline functions, which wrap the LibreTiny C API (lt_api.h). Refer to the docs of the C API for more information.

The class is accessible using the ESP global object.

Type Name bool flashEraseSector (uint32_t sector) Erase a single block of flash (usually 4 KiB). bool flashRead (uint32_t address, uint8_t * data, size_t size) Read data from the flash. bool flashWrite (uint32_t address, const uint8_t * data, size_t size) Write data to the flash. uint8_t getBootMode () uint8_t getBootVersion () uint32_t getChipId () Get CPU ID based on the last three octets of MAC address. Note: the number is 24-bit (with the MSB being zero). The 3rd-to-last octet is least-significant, the last octet is most-significant. String getCoreVersion () uint8_t getCpuFreqMHz () Get CPU frequency in MHz. uint32_t getCycleCount () Get CPU cycle count. uint32_t getFlashChipId () Flash chip ID structure. uint32_t getFlashChipMode () uint32_t getFlashChipRealSize () Get flash chip total size. uint32_t getFlashChipSize () Get flash chip total size. uint32_t getFlashChipSizeByChipId () Get flash chip total size. uint8_t getFlashChipVendorId () Flash chip ID structure. uint32_t getFreeHeap () Get free heap size. String getFullVersion () uint16_t getMaxFreeBlockSize () Get largest block of heap that can be allocated at once. String getResetInfo () Get a textual representation of a reboot reason. String getResetReason () Get a textual representation of a reboot reason. const char * getSdkVersion () uint16_t getVcc () uint8_t * random (uint8_t * resultArray, const size_t outputSizeBytes) Generate random bytes using rand(). uint32_t random () Generate random bytes using rand(). void rebootIntoUartDownloadMode () Reboot the CPU and stay in download mode (if possible). void reset () Reboot the CPU. void restart () Reboot the CPU. void wdtDisable () Disable the hardware watchdog. void wdtEnable (uint32_t timeout_ms=0) Enable the hardware watchdog. void wdtFeed () Feed/reset the hardware watchdog timer."},{"location":"docs/dev/lt-api/#arduino-custom-api","title":"Arduino custom API","text":"

These functions extend the standard Wiring (Arduino) library, to provide additional features.

Type Name int analogRead (pin_size_t pinNumber) Read voltage from ADC and return a value between 0 and the current reading resolution. uint16_t analogReadMaxVoltage (pin_size_t pinNumber) Get max reading voltage for the specified pin (millivolts). void analogReadResolution (int res) Set resolution of values (in bits) returned by analogRead(). Defaults to 10 bit (0-1023). uint16_t analogReadVoltage (pin_size_t pinNumber) Read voltage from analog input (in millivolts). void analogWriteFrequency (int hz) Set PWM output frequency (in Hz). Defaults to 50 Hz (20,000 uS). void analogWritePeriod (int us) Set PWM output frequency (cycle period) in microseconds. Defaults to 20,000 uS (50 Hz). void analogWriteResolution (int res) Set resolution of values (in bits) expected by analogWrite(). Defaults to 8 bit (0-255). void mainTask (const void * arg) Main setup() and loop() task. Not to be called directly. PinInfo * pinByGpio (uint32_t gpio) Find PinInfo struct by GPIO number. Returns NULL if not found. PinInfo * pinByIndex (uint32_t index) Get PinInfo struct for the specified index. Returns NULL if pin index is invalid. bool pinEnabled (PinInfo * pin, uint32_t mask) Check if pin has all features represented by 'mask' enabled. uint32_t pinIndex (PinInfo * pin) Get index of PinInfo in the global pin info table. PinInfo * pinInfo (pin_size_t pinNumber) Get PinInfo struct for the specified number. Returns NULL if pin number is invalid. void pinModeNone (pin_size_t pinNumber) Deinitialize the pin, by removing all enabled modes. void pinModeRemove (pin_size_t pinNumber, uint32_t mask) Disable modes specified by 'mask'. void pinRemoveMode (PinInfo * pin, uint32_t mask) bool pinSupported (PinInfo * pin, uint32_t mask) Check if pin supports all features represented by 'mask'. void runPeriodicTasks () Run periodic tasks, like printing free heap or checking millis() overflow. bool startMainTask (void) Run mainTask & start OS kernel (family-defined). Return false if an error occured; else do not return and and keep the OS kernel running."},{"location":"docs/dev/lt-api/#arduino-compatibility-api","title":"Arduino compatibility API","text":"

These functions and macros provide compatibility between LT and other Arduino cores, such as ESP32.

Type Name String ipToString (const IPAddress & ip) Type Name define CONFIG_LWIP_MAX_ACTIVE_TCP 16 define ESP_FAIL -1 define ESP_OK 0 define FPSTR (pstr_pointer) (reinterpret_cast<const __FlashStringHelper *>(pstr_pointer)) define OUTPUT_OPEN_DRAIN OUTPUT_OPENDRAIN define PGM_VOID_P const void * define attachInterruptArg attachInterruptParam define digitalPinToInterrupt (pin) (pin) define esp_err_t int define round (x) ((x) >= 0 ? (long)((x) + 0.5) : (long)((x)-0.5)) define voidFuncPtrArg voidFuncPtrParam define vsnprintf_P vsnprintf define xTaskCreatePinnedToCore xTaskCreateUniversal define xTaskCreateUniversal (pxTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask, xCoreID) xTaskCreate(pxTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask)"},{"location":"docs/dev/lt-api/#chip-family-types","title":"Chip & family types","text":""},{"location":"docs/dev/lt-api/#enum-lt_cpu_family_t","title":"enum lt_cpu_family_t","text":"
enum lt_cpu_family_t {\n    F_RTL8710A = 0x9FFFD543,\n    F_RTL8710B = 0x22E0D6FC,\n    F_RTL8720C = 0xE08F7564,\n    F_RTL8720D = 0x3379CFE2,\n    F_BK7231Q = 0xAFE81D49,\n    F_BK7231T = 0x675A40B0,\n    F_BK7231N = 0x7B3EF230,\n    F_BK7251 = 0x6A82CC42,\n    F_BL60X = 0xDE1270B7\n};\n
"},{"location":"docs/dev/lt-api/#enum-lt_cpu_model_t","title":"enum lt_cpu_model_t","text":"
enum lt_cpu_model_t {\n    RTL8710BL = CPU_MODEL(F_RTL8710B, 0xE0),\n    RTL8710BN = CPU_MODEL(F_RTL8710B, 0xFF),\n    RTL8710BU = CPU_MODEL(F_RTL8710B, 0xFE),\n    RTL8710BX = CPU_MODEL(F_RTL8710B, 0xF6),\n    RTL8710L0 = CPU_MODEL(F_RTL8710B, 0xFB),\n    RTL8711BN = CPU_MODEL(F_RTL8710B, 0xFD),\n    RTL8711BU = CPU_MODEL(F_RTL8710B, 0xFC),\n    MX1290 = RTL8710BN,\n    MX1290V2 = RTL8710BX,\n    W302 = RTL8710BN,\n    RTL8720CM = CPU_MODEL(F_RTL8720C, 0xEC),\n    RTL8720CF = CPU_MODEL(F_RTL8720C, 0xED),\n    RTL8720CX = RTL8720CM,\n    BK7231Q = CPU_MODEL(F_BK7231Q, 0x31),\n    BK7231T = CPU_MODEL(F_BK7231T, 0x1A),\n    BK7231N = CPU_MODEL(F_BK7231N, 0x1C),\n    BK7252 = CPU_MODEL(F_BK7251, 0x00),\n    BL2028N = BK7231N,\n    BK7231S = BK7231T,\n    BK7231U = BK7231T\n};\n
"},{"location":"docs/dev/migration_v1.0.0/","title":"Migration to v1.0.0","text":"

1.0.0 is the first major release of LT. Compared to previous versions, few things have changed which can impact developers using LT in PlatformIO (but shouldn't affect ESPHome users at all).

"},{"location":"docs/dev/migration_v1.0.0/#gpio-numbering","title":"GPIO numbering","text":"

Pin numbers passed to pinMode()/digitalWrite()/etc. are now the raw GPIO numbers of the chip. Previously, one had to use D# numbering in these functions, so you have to migrate your code to use GPIO numbers instead.

To make the migration easier, you can simply change:

digitalWrite(1, LOW);\n

to:

digitalWrite(PIN_D1, LOW);\n// or\ndigitalWrite(D1, LOW);\n

For more information, refer to GPIO instructions.

"},{"location":"docs/dev/migration_v1.0.0/#environment-stability","title":"Environment stability","text":"

All public headers exported by LT are now stable between all chip families - this means that they're not including any code from the vendor SDK.

This change was made to prevent the SDK from introducing its own functions and macros, which often replace stdlib functions, or cause other compilation issues.

If your code is using vendor SDK functions, you'll have to import the appropriate headers yourself.

"},{"location":"docs/dev/migration_v1.0.0/#ota-uf2-packages","title":"OTA (.uf2 packages)","text":"

The format of OTA packages has changed slightly, to reflect the OTA scheme naming change (described below). There's also a distinction between the flasher (PC flasher) and device (on-device OTA code) in the package.

New OTA packages are backwards-compatible (i.e. can be installed on devices running LT v0.x.x), but v1.0.0 will not accept older packages - it's not possible to rollback a device from v1.0.0 to v0.x.x with an old .uf2 file.

"},{"location":"docs/dev/migration_v1.0.0/#ota-scheme-naming-change","title":"OTA scheme naming change","text":"

Previously, each chip family had a \"has dual OTA\" property, which was very confusing (even to me, the author of the code). A new scheme has been introduced:

  • single OTA - devices with a separate \"download\" partition, which is used by the bootloader to flash the main application
  • dual OTA - devices with two separate application partitions, which can be updated directly by the application
"},{"location":"docs/flashing/SUMMARY/","title":"Flashing/dumping methods & guides","text":"
  • ltchiptool GUI manual
  • Flashing PlatformIO projects
  • Flashing ESPHome
  • Dumping stock firmware
  • Converting with tuya-cloudcutter
  • Auto-download-reboot
"},{"location":"docs/flashing/dumping/","title":"Dumping stock firmware","text":"

It is a good idea to dump the stock firmware (full flash contents) of your device before flashing custom firmware.

Currently, the easiest way to dump firmware is to use ltchiptool. Download/install the tool, and follow the guide.

"},{"location":"docs/flashing/esphome/","title":"Flashing ESPHome","text":"

Tip

See the Cloudcutter video guide for a complete tutorial on flashing with Cloudcutter and installing LibreTiny-ESPHome. Includes Home Assistant Add-On setup.

ESPHome can be flashed in few different ways, depending on your needs.

Abstract

All binary files generated by ESPHome will be in .esphome/build/<yourdevice>/.pioenvs/<yourdevice>/. The methods described below may require you to get a file from that directory.

If you're using the GUI (ESPHome Dashboard) this path will be in your configs/ directory.

This path will be referred to as build directory.

"},{"location":"docs/flashing/esphome/#built-in-flasher","title":"Built-in flasher","text":"CLIGUI

The flasher program built-in LibreTiny is also available for ESPHome.

  • use python -m esphome run yourdevice.yml to recompile AND upload the firmware
  • use python -m esphome upload yourdevice.yml to upload without recompiling

The device needs to be connected to your PC with a UART-TTL adapter. Refer to chip connection guides to learn how to connect your device.

If your device is already running ESPHome, refer to the OTA guide below.

The built-in flasher is not yet available in the GUI. Here are your options:

  • OTA, using the downloaded UF2 file (if you're already running ESPHome)
  • wired (also UF2), using ltchiptool
  • wirelessly, using tuya-cloudcutter

Read below for more details on each of these methods.

"},{"location":"docs/flashing/esphome/#over-the-air-ota","title":"Over-the-Air (OTA)","text":"

This method requires having ESPHome already installed on your device.

  • If you've added the Web Server component, navigate to the device's IP address (or .local name) in your web browser. Grab firmware.uf2 from the build directory and drop it on the \"OTA Update\" field.
  • You can also use ESPHome CLI to flash via OTA. Add a --device argument to the command, as such: python -m esphome upload yourdevice.yml --device yourdevice.local
"},{"location":"docs/flashing/esphome/#using-ltchiptool-wired-via-uart","title":"Using ltchiptool (wired, via UART)","text":"

You can use the ltchiptool GUI or CLI to manually flash the firmware. Grab the firmware.uf2 file from the build directory. Then, follow the ltchiptool usage guide to flash it to the device.

Tip

The UF2 file may have a different name, depending on the project you're building. Usually it's best to grab the latest (sorted by date) file with UF2 extension from the build directory.

"},{"location":"docs/flashing/esphome/#converting-devices-with-tuya-cloudcutter","title":"Converting devices with tuya-cloudcutter","text":"

Note

This currently applies to BK7231T and BK7231N only. tuya-cloudcutter can't be used for other chips.

Grab the image_bk7231x_app.ota.ug.bin file from the build directory - take care to choose the correct file. It must have \"OTA\" and \"UG\" in its name.

Next, refer to Using tuya-cloudcutter guide.

"},{"location":"docs/flashing/esphome/#migrating-from-openbeken-ota","title":"Migrating from OpenBeken (OTA)","text":"

OpenBeken is a custom, Tasmota-like firmware for non-ESP chips. Currently, this part of the guide applies to BK7231 only, as that's the only chip supported both by LT and OBK.

OBK is compatible with standard Beken OTA packages, but the web panel does a filename check to prevent chip type mismatch. Grab the image_bk7231t_app.ota.rbl file from build directory (note: without \"UG\" in the name!), rename it to something like OpenBK7231T_esphome.rbl (change T to N depending on the chip type), and drop it on the OTA panel.

"},{"location":"docs/flashing/esphome/#migrating-from-esphome-to-openbeken","title":"Migrating from ESPHome to OpenBeken","text":"

ESPHome is only compatible with UF2 OTA packages, which OpenBeken doesn't provide. You need to create an UF2 package manually, using ltchiptool (see ltchiptool#7 for more info). Grab an .RBL file from OpenBeken Releases page, and run this command:

ltchiptool uf2 write -b generic-bk7231n-qfn32-tuya -o OpenBeken.uf2 \"OpenBK7231N_1.17.205.rbl=device:download\"\n

This will create OpenBeken.uf2 file that you can upload on the ESPHome web server dashboard page. Pay attention to the chip selection - incorrectly built UF2 file may brick your device! Make sure to download the right .RBL file of OpenBeken, and to choose the correct board (-b) parameter.

"},{"location":"docs/flashing/platformio/","title":"Flashing PlatformIO projects","text":"

PlatformIO projects developed with LibreTiny can be flashed just like any other PIO project.

Abstract

All binary files generated by PlatformIO will be in .pio/build/<my_board>/. The methods described below may require you to get a file from that directory.

This path will be referred to as build directory.

"},{"location":"docs/flashing/platformio/#built-in-flasher","title":"Built-in flasher","text":"

LibreTiny has a built-in firmware uploader, based on ltchiptool. Pressing Upload in PlatformIO IDE does all the work for you.

If you have more than one COM port, configure your PIO project first:

platformio.ini
[env:my_board]\nmonitor_port = COM96\nupload_port = COM96\n

The device needs to be connected to your PC with a UART-TTL adapter. Refer to chip connection guides to learn how to connect your device.

"},{"location":"docs/flashing/platformio/#using-ltchiptool-wired-via-uart","title":"Using ltchiptool (wired, via UART)","text":"

You can use the ltchiptool GUI or CLI to manually flash the firmware. Grab the firmware.uf2 file from the build directory. Then, follow the ltchiptool usage guide to flash it to the device.

Tip

The UF2 file may have a different name, depending on the project you're building. Usually it's best to grab the latest (sorted by date) file with UF2 extension from the build directory.

"},{"location":"docs/flashing/tools/adr/","title":"Auto-download-reboot","text":"

(CEN-less uploading)

This feature allows to upload code using UART, without needing to ground the CEN wire or power-cycle the device.

It is enabled by default (using the LT_AUTO_DOWNLOAD_REBOOT option). It works by listening to incoming UART data, and checking if it matches a command that the flashing program would send. If it does, a chip reboot is performed and the uploading process starts.

Note

ADR will only work if there's already a recent build of LibreTiny flashed to the device (and if the device doesn't bootloop or freeze immediately).

"},{"location":"docs/flashing/tools/adr/#beken-72xx","title":"Beken 72xx","text":"

The code listens on UART1 for a link-check command (01 E0 FC 01 00). The baudrate configured on the serial port has to be 115200 - it is configured automatically upon booting, but ADR won't work anymore if you change the baudrate manually. Because BK72xx doesn't have a dedicated \"persistent\" download mode, a normal reboot is performed and the chip waits a few hundred milliseconds for another link-check command.

"},{"location":"docs/flashing/tools/adr/#realtek-amebaz","title":"Realtek AmebaZ","text":"

This only works when using ltchiptool for flashing. Upon starting UART communication, the tool sends 55 AA 22 E0 D6 FC (0x55AA followed by the realtek-ambz family ID). After detecting that pattern, the chip proceeds to reboot into UART download mode (using lt_reboot_download_mode())

"},{"location":"docs/flashing/tools/adr/#realtek-amebaz2","title":"Realtek AmebaZ2","text":"

The code listens on UART2 for a ping\\n command, that is sent by ltchiptool (and possibly by the vendor flasher, too). The device is then rebooted to download mode.

"},{"location":"docs/flashing/tools/cloudcutter/","title":"Converting with tuya-cloudcutter","text":"

Tip

See the Cloudcutter video guide for a complete tutorial on flashing with Cloudcutter and installing LibreTiny-ESPHome. Includes Home Assistant Add-On setup.

Note

This currently applies to BK7231T and BK7231N only. tuya-cloudcutter can't be used for other chips.

tuya-cloudcutter is a tool that disconnects IoT devices from the Tuya cloud, while also allowing remote firmware flashing. This means you can flash ESPHome without even disassembling it.

Warning

This guide might be outdated. For an up-to-date guide, always refer to tuya-cloudcutter/INSTRUCTIONS.md.

If your device doesn't have a profile yet, it will probably not work. You can contribute by taking a device dump and posting it on cloudcutter's issues page.

"},{"location":"docs/flashing/tools/cloudcutter/#instructions","title":"Instructions","text":""},{"location":"docs/flashing/tools/cloudcutter/#preparation","title":"Preparation","text":"
  1. Get a laptop (or a PC with Wi-Fi) with Linux and Docker installed. This was tested on Ubuntu 20.04, but you should be able to use another Debian-based distribution with NetworkManager.
    • To install Docker, run sudo apt-get install docker.io. When it completes, run sudo adduser <your username> docker and reboot the machine.
    • This was also successfully performed on a VirtualBox VM, with a USB Wi-Fi adapter redirected to the VM.
  2. Install git, if you haven't already (sudo apt-get install git).
  3. git clone https://github.com/tuya-cloudcutter/tuya-cloudcutter
"},{"location":"docs/flashing/tools/cloudcutter/#firmware-building","title":"Firmware building","text":"
  1. Compile ESPHome, or your custom firmware based on LibreTiny.
  2. Get the firmware binary, named bk7231x_app.ota.ug.bin from the build directory (.pio/build/<board>/ or .esphome/build/<board>/.pioenvs/<board>/).
  3. Put it in the custom-firmware directory of tuya-cloudcutter.
"},{"location":"docs/flashing/tools/cloudcutter/#pairing-and-flashing","title":"Pairing and flashing","text":"
  1. Run ./tuya-cloudcutter.sh from the cloudcutter directory.
  2. Answer questions about the desired firmware file, the device vendor and profile.
  3. Put the device to AP mode: (**)
    • Bulbs (devices without buttons) usually need to be power-cycled a few times, until they start blinking slowly.
    • Switches, plugs, relays (devices with buttons) usually enable AP after pressing the button for a few seconds.
    • If the device (bulb or switch LED) is blinking quickly (~2 times per second), do the procedure again.
  4. Cloudcutter will scan for APs, connect to the device and send a payload to it.
  5. The device will most likely hang (not respond). Reboot it again to AP mode (just like in step 9).
  6. Cloudcutter will scan for APs again, configure the device to talk to it, then begin the OTA update.
  7. After around 30 seconds, the device will boot new firmware \ud83d\udc4f

** Use a smartphone with the Wi-Fi screen open and scanning, so that you can see if AP mode got enabled.

"},{"location":"docs/flashing/tools/ltchiptool/","title":"ltchiptool","text":"

ltchiptool is a universal, easy-to-use GUI flashing/dumping tool for BK7231, RTL8710B and RTL8720C. It also contains some CLI utilities for binary firmware manipulation.

"},{"location":"docs/flashing/tools/ltchiptool/#installation","title":"Installation","text":"

Download Windows GUI

"},{"location":"docs/flashing/tools/ltchiptool/#cli-program","title":"CLI program","text":"

Install the package from PyPI, using pip install ltchiptool. Run the CLI using python -m ltchiptool or just ltchiptool.

"},{"location":"docs/flashing/tools/ltchiptool/#gui-application","title":"GUI application","text":"Windows 7 and newer

Download the latest release .EXE from the GitHub Releases page. Open the file, and you're ready to go!

Windows (manual installation)

Install the package from PyPI (including GUI extras), using pip install ltchiptool[gui]. Note that Python 3.10 or newer is required for the GUI. I recommend Python 3.10 since it has prebuilt wheels of wxPython, which doesn't require C++ build dependencies.

Linux (Ubuntu)

Install the package from PyPI, using pip install ltchiptool. Python 3.10 or newer is required.

Make sure you have wxPython installed. Install it from PyPI (if you have the necessary build dependencies), or refer to the wxPython Downloads page to install prebuilt wheels (recommended).

Next, open a terminal and run ltchiptool gui (or python -m ltchiptool gui).

MacOS (untested)

Install the package from PyPI, using pip install ltchiptool. Python 3.10 or newer is required.

Install wxPython from PyPI as well. Version 4.2.0 (latest at the time of writing) has some wheels for MacOS, so that should work.

"},{"location":"docs/flashing/tools/ltchiptool/#gui-usage","title":"GUI Usage","text":"

The main window is somewhat similar to NodeMCU PyFlasher. Available modes of operation are described below.

"},{"location":"docs/flashing/tools/ltchiptool/#dumping-firmware","title":"Dumping firmware","text":"

It is a good idea to dump the stock firmware (full flash contents) of your device before flashing custom firmware.

  1. Choose the Read flash option. If you've previously chosen an input or output file, it will generate a dump filename based on the current timestamp and chip type. Otherwise, click Browse and choose the output file.
  2. You need to pick the \"family\" of your chip (the chip model). If you choose the wrong option, the process will fail, but the device won't be bricked.
  3. Now, connect the chip to your PC, according to the chip connection guides. Select the COM port that your UART adapter is using.
  4. By default, the tool will attempt to read the entire flash chip (usually 2 MiB). Unless you know what you're doing, the default values don't need to be changed.
  5. Hit Start. The tool will try to connect to the chip on the selected UART port. The black log window will print any warnings/errors. The dumping process should begin shortly.
"},{"location":"docs/flashing/tools/ltchiptool/#flashing-firmware","title":"Flashing firmware","text":"

If you want to flash custom firmware, or restore stock firmware from a previously dumped file, follow the steps below.

Info

LibreTiny generates multiple firmware files in the build directory. You usually want to flash the .uf2 file, but since ltchiptool can detect file types, you can choose a different firmware file and it'll tell you if that works.

  1. Choose Write flash. Click Browse and select a valid firmware file. The file type and chip type will be auto-detected, along with correct flash offset and length. No need to worry about overwriting the bootloader anymore!
  2. Connect the chip to your PC, according to the chip connection guides. Select the COM port that your UART adapter is using.
  3. Hit Start. The tool will try to connect to the chip on the selected UART port. The black log window will print any warnings/errors. The flashing process should begin shortly.

Info

It's best to leave Auto-detect advanced parameters checked. If you're an experienced user and want to flash custom areas of the flash, uncheck the box and specify the parameters manually.

If the file you're selecting is Unrecognized or Not flashable, it's most likely not a valid firmware file. Refer to usage guides of the custom firmware project of choice, to find which file is meant for flashing.

"},{"location":"docs/flashing/tools/ltchiptool/#cli-usage","title":"CLI Usage","text":""},{"location":"docs/flashing/tools/ltchiptool/#flashingdumping","title":"Flashing/dumping","text":"

This is for users, who are more experienced with using a terminal. There are three main commands used for flashing:

  • ltchiptool flash file <FILE> - detect file type based on its contents (i.e. chip from which a dump was acquired), similar to Linux file command
  • ltchiptool flash read <FAMILY> <FILE> - make a full flash dump of the connected device; specifying the family is required
  • ltchiptool flash write <FILE> - upload a file to the device; detects file type automatically (just like the file command above)

Supported device families can be checked using ltchiptool list families command. In the commands above, you can use any of the family names (name/code/short name/etc).

The upload UART port and baud rate should be detected automatically. To override it, use -d COMx or -d /dev/ttyUSBx. To change the target baud rate, use -b 460800. Note that the baud rate is changed after linking. Linking is performed using chip-default baud rate.

It's not required to specify chip family for writing files - ltchiptool tries to recognize contents of the file, and chooses the best settings automatically. If you want to flash unrecognized/raw binaries (or fine-tune the flashing parameters), specify -f <FAMILY> and -s <START OFFSET>.

"},{"location":"docs/flashing/tools/ltchiptool/#cli-reference","title":"CLI Reference","text":"

Note

If you're here to learn how to flash or dump firmware files, use the instructions above.

The content below serves as a short documentation page for ltchiptool and is mostly meant for advanced users.

$ ltchiptool --help\nUsage: ltchiptool [OPTIONS] COMMAND [ARGS]...\n\n  Tools for working with LT-supported IoT chips\n\nOptions:\n  -v, --verbose         Output debugging messages (repeat to output more)\n  -T, --traceback       Print complete exception traceback\n  -t, --timed           Prepend log lines with timing info\n  -r, --raw-log         Output logging messages with no additional styling\n  -i, --indent INTEGER  Indent log messages using graph lines\n  -V, --version         Show the version and exit.\n  -h, --help            Show this message and exit.\n\nCommands:\n  dump      Capture or process device dumps\n  elf2bin   Generate firmware binaries from ELF file\n  flash     Flashing tool - reading/writing\n  link2bin  Link code to binary format\n  list      List boards, families, etc.\n  soc       Run SoC-specific tools\n  uf2       Work with UF2 files\n
"},{"location":"docs/flashing/tools/ltchiptool/#uf2-example","title":"UF2 Example","text":"
$ ltchiptool uf2 info ./arduinotest_22.08.01_wb2l_BK7231T_lt0.8.0.uf2\nFamily: BK7231T / Beken 7231T\nTags:\n - BOARD: wb2l\n - DEVICE_ID: d80e20c2\n - LT_VERSION: 0.8.0\n - FIRMWARE: arduinotest\n - VERSION: 22.08.01\n - OTA_VERSION: 01\n - DEVICE: LibreTiny\n - BUILD_DATE: 6d08e862\n - LT_HAS_OTA1: 01\n - LT_HAS_OTA2: 00\n - LT_PART_1: app\n - LT_PART_2:\nData chunks: 1871\nTotal binary size: 478788\n
"},{"location":"docs/getting-started/","title":"Getting started","text":"

Using LibreTiny is simple, just like every other PlatformIO development platform.

  1. Install PlatformIO
  2. pio pkg install --platform libretiny

Tip

See the Cloudcutter video guide for a complete tutorial on flashing with Cloudcutter and installing LibreTiny-ESPHome. Includes Home Assistant Add-On setup.

More information on Cloudcutter can be found in the Tuya Cloudcutter GitHub repository.

"},{"location":"docs/getting-started/#board-selection","title":"Board selection","text":"
  1. Navigate to the supported boards & CPUs list.
  2. Find the board your device has (usually, the model number is written on the silkscreen). If your board isn't available yet, use one of the \"Generic\" boards that matches the CPU you your board has.
  3. Click on the board name. A new page opens with information about the selected board name.
  4. Scroll down to the \"Usage\" section of the page, and copy the configuration section that is relevant to your use case.
"},{"location":"docs/getting-started/#run-community-projects","title":"Run community projects","text":"

LibreTiny was developed with popular community projects in mind.

There is an official ESPHome port available and integrated into the ESPHome project. No extra downloads or code compilations are needed to use ESPHome with LibreTiny-supported platforms.

"},{"location":"docs/getting-started/#develop-your-own-project","title":"Develop your own project","text":"

Developing your own embedded software that runs on LibreTiny-supported platforms.

To get started with LibreTiny on your chosen platform, create a new project using your preferred method.

There's a few ways to create a new PlatformIO Project. For example:

  • using the PlatformIO IDE graphical interface (PIO Home -> Open -> New Project)
  • by running the pio project init command in your desired project directory See the PlatformIO Core (CLI) documentation for information on pio project init and other command line usage.

Next, read one of the flashing guides to upload and run your project!

"},{"location":"docs/getting-started/#config-options-platformioini","title":"Config options (platformio.ini)","text":"

LibreTiny has a few configuration options that allow you to change its behavior or features. These can be defined, specified or changed in the platformio.ini configuration file for your project.

Refer to the LibreTiny Configuration manual for details.

"},{"location":"docs/getting-started/#gpio-usage-important-change","title":"GPIO usage - important change","text":"

Important

As of LibreTiny release v1.0.0, references to GPIO pins using their D# numbers has been deprecated and should no longer be used in new projects.

If your program is using Arduino I/O functions, please refer to the migration guide on how to modify your code accordingly.

"},{"location":"docs/getting-started/#examples","title":"Examples","text":"
  • PinScan
"},{"location":"docs/getting-started/gpio/","title":"GPIO usage instructions","text":"

Note

This has changed since v1.0.0. Refer to the migration guide for more info.

GPIO pins can be accessed in a few ways:

  • using the raw GPIO number of the chip
  • using the \"function macro\" of the pin
  • using Arduino digital pin numbers (D#, deprecated)

This applies both to Arduino code and ESPHome YAML configs.

"},{"location":"docs/getting-started/gpio/#gpio-numbers-arduino-only","title":"GPIO numbers - Arduino only","text":"

The simplest form of GPIO access is by using raw pin numbers of the CPU (just like on ESP8266/ESP32). For example, to access GPIO6, write digitalRead(6).

"},{"location":"docs/getting-started/gpio/#function-macros-arduino-esphome","title":"Function macros - Arduino & ESPHome","text":"

If you go to a board documentation page (like this one - CB2S) you'll see a pinout drawing, containing various labels in small blocks. There's also a table below to make the pinout a bit more clear.

You can use any of these labels to access a particular pin. For example, to access GPIO6, which is also the PWM0 pin on CB2S, one can use:

  • digitalRead(PIN_P6) (Arduino) or pin: P6 (ESPHome)
  • digitalRead(PIN_PWM0) (Arduino) or pin: PWM0 (ESPHome)
"},{"location":"docs/getting-started/gpio/#arduino-d-numbers-deprecated","title":"Arduino D# numbers (deprecated)","text":"

This method of accessing pins is deprecated since v1.0.0, and will (probably) be removed in the future. It's kept for legacy compatibility.

To access the previously mentioned GPIO6, use digitalRead(D2) or digitalRead(PIN_D2) or pin: D2. Note that the D# pin numbers are not consistent between boards (for example, on WB3S, GPIO6 is already D4).

"},{"location":"docs/inc/find-board/","title":"Find board","text":"

You need to know which board your device uses. Head to Supported Boards to find it. A good number of popular boards have their dedicated support and documentation pages in LibreTiny. Otherwise, you have to use one of the Generic boards that matches the CPU model of your device.

"},{"location":"docs/inc/flashing-note/","title":"Flashing note","text":"

Read this!

This is probably the most important part of the docs - flashing firmware to the chip.

This is why you're here. Please read this section carefully, and only then start flashing firmware.

"},{"location":"docs/inc/ota-cloudcutter/","title":"Ota cloudcutter","text":""},{"location":"docs/inc/ota-cloudcutter/#converting-devices-with-tuya-cloudcutter","title":"Converting devices with tuya-cloudcutter","text":"

Note

This currently applies to BK7231T and BK7231N only. tuya-cloudcutter can't be used for other chips.

Grab the image_bk7231x_app.ota.ug.bin file from the build directory - take care to choose the correct file. It must have \"OTA\" and \"UG\" in its name.

Next, refer to Using tuya-cloudcutter guide.

"},{"location":"docs/inc/ota-openbeken/","title":"Ota openbeken","text":""},{"location":"docs/inc/ota-openbeken/#migrating-from-openbeken-ota","title":"Migrating from OpenBeken (OTA)","text":"

OpenBeken is a custom, Tasmota-like firmware for non-ESP chips. Currently, this part of the guide applies to BK7231 only, as that's the only chip supported both by LT and OBK.

OBK is compatible with standard Beken OTA packages, but the web panel does a filename check to prevent chip type mismatch. Grab the image_bk7231t_app.ota.rbl file from build directory (note: without \"UG\" in the name!), rename it to something like OpenBK7231T_esphome.rbl (change T to N depending on the chip type), and drop it on the OTA panel.

"},{"location":"docs/inc/uart-adr/","title":"Uart adr","text":"

If you have a recent version of LibreTiny already installed on the chip, you don't need to perform any steps to enter download mode. Instead, Auto-download-reboot will reboot the chip automatically, as soon as it notices the flasher program. This is enabled by default, so you don't have to configure anything.

"},{"location":"docs/inc/uart-cen/","title":"Uart cen","text":"

Note

\"CEN\" pin is the RESET pin - connecting it to GND will keep the chip in \"reset\" state. Disconnecting it will allow the chip to start back up.

If you're having issues with using CEN pin (or if it's not accessible on your device) you can toggle the 3.3V power instead. Removing power will keep it in \"reset\", and applying it back will start it again.

"},{"location":"docs/inc/uart-info/","title":"Uart info","text":"

The device needs to be connected to your PC with a UART-TTL adapter. Refer to chip connection guides to learn how to connect your device.

"},{"location":"docs/inc/uart-ltchiptool/","title":"Uart ltchiptool","text":""},{"location":"docs/inc/uart-ltchiptool/#using-ltchiptool-wired-via-uart","title":"Using ltchiptool (wired, via UART)","text":"

You can use the ltchiptool GUI or CLI to manually flash the firmware. Grab the firmware.uf2 file from the build directory. Then, follow the ltchiptool usage guide to flash it to the device.

Tip

The UF2 file may have a different name, depending on the project you're building. Usually it's best to grab the latest (sorted by date) file with UF2 extension from the build directory.

"},{"location":"docs/inc/uart-power/","title":"Uart power","text":"

Important

Using a good, stable 3.3V power supply is crucial. Most flashing issues are caused by either voltage drops during intensive flash operations, or bad/loose wires. The UART adapter's 3.3V power regulator is usually not enough.

Instead, a regulated bench power supply, or a linear 1117-type regulator is recommended.

"},{"location":"docs/platform/SUMMARY/","title":"Flashing guides","text":"
  • Beken BK72xx
  • Realtek RTL8710Bx
"},{"location":"docs/platform/beken-72xx/","title":"Beken 72xx","text":""},{"location":"docs/platform/beken-72xx/#introduction","title":"Introduction","text":"

Also read

  • Finding encryption keys - what to do if LibreTiny doesn't boot because of incorrect flash encryption keys

Beken BK7231 is a family of Wi-Fi and BLE microcontrollers, of which most popular are BK7231N and BK7231T.

Features:

  • ARM968E-S (ARMv5TE) CPU (120 MHz)
  • 256 KiB SRAM
  • built-in 2 MiB SPI flash with XiP
  • 802.11b/g/n Wi-Fi

Resources:

  • BK7231U Datasheet v0.71 (Machine-translated to English)
  • BL2028N Datasheet v1.0 (BL2028N is a \"clone\" of BK7231N)
  • BK72XX SDK User Manual 3.0.3 (Machine-translated to English)
  • BEKEN WiFi SDK API Reference 3.0.27 (Machine-translated to English)
  • Beken SDK documentation (online)
  • encrypt v0.3 source code (Encryption routines and FPGA code used on the chip)
  • ota_tools source code
  • BK7231 OpenOCD debugging (From Elektroda.pl user @xabean)
"},{"location":"docs/platform/beken-72xx/#finding-your-board","title":"Finding your board","text":"

You need to know which board your device uses. Head to Supported Boards to find it. A good number of popular boards have their dedicated support and documentation pages in LibreTiny. Otherwise, you have to use one of the Generic boards that matches the CPU model of your device.

"},{"location":"docs/platform/beken-72xx/#flashing","title":"Flashing","text":"

Read this!

This is probably the most important part of the docs - flashing firmware to the chip.

This is why you're here. Please read this section carefully, and only then start flashing firmware.

BK7231 has two UART ports - UART2 (sometimes called LOG_UART) and UART1. The UART1 port is used for flashing (and external components, such as TuyaMCU) and has no text output. The UART2 port is used for log viewing only.

You need to find which pins correspond to UART1 TX and RX. If your board is supported, you'll find the pinout on its documentation page. Otherwise (and for generic boards), you'll have to find the pinout online.

For best experience, you should have two USB<->UART adapters plugged in:

  • One for flashing, preferably a real FT232RL or a good alternative. This connects to UART1 of the chip.
  • One for log output - BK72xx outputs messages on a separate port. You can have a terminal session continuously open on this adapter. This connects to UART2 of the chip - but it's not necessary for flashing.
"},{"location":"docs/platform/beken-72xx/#wiring","title":"Wiring","text":"

Connect UART1 of the BK7231 to the USB-TTL adapter:

PC BK7231 RX TX1 (GPIO11 / P11) TX RX1 (GPIO10 / P10) GND GND

Important

Using a good, stable 3.3V power supply is crucial. Most flashing issues are caused by either voltage drops during intensive flash operations, or bad/loose wires. The UART adapter's 3.3V power regulator is usually not enough.

Instead, a regulated bench power supply, or a linear 1117-type regulator is recommended.

Note

\"CEN\" pin is the RESET pin - connecting it to GND will keep the chip in \"reset\" state. Disconnecting it will allow the chip to start back up.

If you're having issues with using CEN pin (or if it's not accessible on your device) you can toggle the 3.3V power instead. Removing power will keep it in \"reset\", and applying it back will start it again.

The download mode is entered when the chip communicates with the flasher program. Hence, the first step is running the flasher program (described below). While the program is trying to establish communication, the chip has to be rebooted. In order to do that, you need to bridge CEN pin to GND with a wire.

Keep in mind that BK7231T (not N) will exit the download mode when it can't communicate with the flasher (or when the flasher finishes its work). It's not possible to forcefully enter download mode without it.

After linking with the chip, the flasher program will begin writing (or reading) the firmware automatically. If that doesn't happen, try resetting the chip again until it works.

If you're getting a No response received (or similar) error, this means that:

  • the power supply is too weak (read above)
  • you're resetting the chip too quickly, i.e. you resetted it after the program started communicating with it
"},{"location":"docs/platform/beken-72xx/#flashing_1","title":"Flashing","text":"

The recommended tool to flash (or dump firmware) is ltchiptool.

Read Using ltchiptool to learn the flashing procedure

Tip

BK7231N can't be software-bricked, because it has a ROM that contains the download mode. BK7231T doesn't contain it, so be careful with this one.

ltchiptool's Beken flashing program is based on bk7231tools. Refer to the guide for information how to use it, but keep in mind that using the ltchiptool GUI is probably just easier.

"},{"location":"docs/platform/beken-72xx/#auto-download-reboot","title":"Auto-download-reboot","text":"

If you have a recent version of LibreTiny already installed on the chip, you don't need to perform any steps to enter download mode. Instead, Auto-download-reboot will reboot the chip automatically, as soon as it notices the flasher program. This is enabled by default, so you don't have to configure anything.

"},{"location":"docs/platform/beken-72xx/#single-uart-adapter-usage","title":"Single UART adapter usage","text":"

If you only have a single adapter, or just want to use the UART1 (upload) port only, you can change the logging port of LibreTiny firmware.

Refer to Options & config (Serial output section). Set LT_UART_DEFAULT_PORT to 1, which will use UART1 for all output.

"},{"location":"docs/platform/beken-72xx/#firmware-output-files","title":"Firmware output files","text":"

These files are present in the build directory after successful compilation:

File Description firmware.uf2 UF2 package for UART and OTA upload image_bk7231t_app.ota.rbl Beken OTA package (e.g. OpenBeken) image_bk7231t_app.ota.ug.bin Tuya OTA package (incl. Cloudcutter) image_bk7231t_app.0x011000.rbl App partition - flashable at 0x11000 image_bk7231t_app.0x011000.crc Encrypted app image - not for flashing image_bk7231t_app.0x129F0A.rblh RBL header - not for flashing"},{"location":"docs/platform/beken-72xx/#spi-flashing-unbricking-bk7231t","title":"SPI flashing (unbricking BK7231T)","text":"

The bk7231_spi_flasher.py script can be used to put BK7231 in SPI flashing mode. Then, one can use flashrom to read/write the raw flash chip.

"},{"location":"docs/platform/beken-72xx/#other-toolsguides","title":"Other tools/guides","text":"

These tools are not recommended and are kept here for reference only. Don't use them, please.

  • Flashing (Tuya manual)
  • BkWriter v1.6.0
  • hid_download_py
"},{"location":"docs/platform/beken-72xx/#other-info","title":"Other info","text":"

There are many chip variations in this SoC family:

  • BK7231 - marked BK7231QN40, so we're calling it \"BK7231Q\" to reduce confusion
  • BK7231T
  • BK7231N
  • BK7231S
  • BK7231U

The \"officially existing\" ones are BK7231Q, BK7231N and BK7231U. These are supported by Beken SDKs, such as bdk_freertos, although bk7231s_alios_sdk also existed at some point.

  • BK7231N is substantially different than the other chips, so running T code on N (and vice versa) is not directly possible.
  • BK7231Q does not have eFuse and BLE
  • there are some references to U meaning USB support
  • T seems to be exclusive to Tuya boards (that would explain the name); in the T SDK from Tuya, CFG_SOC_NAME is set to SOC_BK7231U
  • T's bootloader greets with BK7231S_1.0.5 on UART

Regarding bdk_freertos:

  • make allows selecting for which MCU the code should be compiled
  • make bk7231 doesn't compile at all
  • make bk7231u doesn't run on T with Tuya's bootloader (1.0.5), though it works just fine after replacing the bootloader with one of these included with bdk_freertos (1.0.8) (yes, even bk7231n bootloader)
  • after making a few changes to driver/entry and driver/intc (so it looks more like the code from T SDK) bdk_freertos runs just fine
"},{"location":"docs/platform/beken-72xx/keys/","title":"Finding encryption keys","text":""},{"location":"docs/platform/beken-72xx/keys/#introduction","title":"Introduction","text":"

Tip

Before proceeding with this method, try using ltchiptool's Get chip info function. It will read eFuse, which may reveal the raw encryption key. If you see all 00000000s, then the eFuse is readout-protected and the key cannot be extracted in this simple way.

3-rd party firmware for Beken chips must be compiled with a flash encryption key matching the one programmed into the chip. Incorrect keys will make the firmware unable to run.

The bk72xx-bootloader-dump firmware might make it easier to find the encryption key of BK7231N/BK7231T chips.

The key is made of four 32-bit integers; the default key is usually 510fb093 a3cbeadc 5993a17e c7adeb03 (used by Beken and Tuya on most devices), but devices with different keys have been recently discovered (likely from other manufacturers).

If your device doesn't use the default keys (i.e. 3-rd party firmware doesn't boot up, or it hangs on bootloader logs), you can try using this firmware file to extract the keys from the bootloader.

"},{"location":"docs/platform/beken-72xx/keys/#why-this-works-and-when-it-doesnt","title":"Why this works (and when it doesn't)","text":"

The bootloader has its own copy of the keys. It uses that to encrypt firmware on-the-fly when applying OTA updates.

Files downloaded during an OTA update are not encrypted using the main encryption keys, so the bootloader must encrypt them before flashing to the app partition. This method works by flashing firmware directly to the OTA partition. It is then unpacked and encrypted properly by the bootloader.

However, OTA update packages are encrypted using AES - for this method to work, the AES key must be known in advance.

Most of the time, a simple 0123456789ABCDEF key is used for OTA AES. We have seen manufacturers using different keys - this method will not work in that case.

Additionally, OTA packages don't have to be encrypted - some bootloaders allow that, some don't. Using an unencrypted package is worth trying if your device uses a non-standard OTA AES key.

"},{"location":"docs/platform/beken-72xx/keys/#prerequisites","title":"Prerequisites","text":"
  1. A working computer with a working UART flashing setup. The preferred flashing tool is ltchiptool. You should have at least some prior experience with dumping or flashing firmware.
  2. A full factory firmware dump of the device you're working on. This is mostly in case something goes wrong, but may also be necessary to read OTA partition offsets from.
  3. A serial terminal (such as the ltchiptool-terminal plugin).
"},{"location":"docs/platform/beken-72xx/keys/#to-be-continued","title":"To be continued","text":""},{"location":"docs/platform/realtek-amb/","title":"Realtek Ameba","text":"

The logic behind naming of Realtek chips and their series took me some time to figure out:

  • RTL8xxxA - Ameba1/Ameba Series
  • RTL8xxxB - AmebaZ Series
  • RTL8xxxC - AmebaZ2/ZII Series
  • RTL8xxxCS - Ameba CS Series
  • RTL8xxxD - AmebaD Series
  • Realtek product pages

As such, there are numerous CPUs with the same numbers but different series. Different Ameba series are not compatible with each other, which makes them require different code and SDKs.

Ameba series comparison table"},{"location":"docs/platform/realtek-amb/#table-from-wwwe-paper-displaycom","title":"Table from www.e-paper-display.com","text":"

(modified a bit)

Realtek P/N Series Protocol CPU Frequency SRAM UART SPI I2S ADC/DAC RTL8710BN Ameba Z WiFi ARM M4 125M 256KB 1 1 N Y/N RTL8710BX Ameba Z WiFi ARM M4 62.5M 256KB 1 1 N Y/N RTL8710CX Ameba Zii WiFi ARM M4 100M 256KB 3 1 N N/N RTL8710CM Ameba Zii WiFi ARM M4 100M 256K+4M 3 1 N N/N RTL8720CN Ameba Zii WiFi+BLE4.2 ARM M4 100M 256KB 2 1 N N/N RTL8720CF Ameba Zii WiFi+BLE4.2 ARM M4 100M 256KB 2 1 N N/N RTL8720CM Ameba Zii WiFi+BLE4.2 ARM M4 100M 256KB 2 1 N N/N RTL8720CS Ameba CS WiFi+BLE5 Mesh M0+M4 200M 512KB 2 2 Y Y/Y RTL8721CSM Ameba CS WiFi+BLE5 Mesh M0+M4 200M 512K+4M 3 2 Y Y/Y RTL8722CSM Ameba CS WiFi+BLE5 Mesh M0+M4 200M 512K+4M 4 2 Y Y/Y RTL8720DN Ameba D 2.4G+5G+BLE5 M0+M4 200M 512K 2 1 Y Y/Y RTL8721DM Ameba D 2.4G+5G+BLE5 M0+M4 200M 512K+4M 3 2 Y Y/Y RTL8722DM Ameba D 2.4G+5G+BLE5 M0+M4 200M 512K+4M 4 2 Y Y/Y"},{"location":"docs/platform/realtek-amb/#other-chips","title":"Other chips","text":"
  • RTL8195AM
  • RTL8710AF (found in amb1_arduino)
  • RTL8711AM
  • RTL8710BN
  • RTL8710BX (found in Tuya product pages)
  • RTL8710B? (found in amb1_sdk)
  • RTL8711B? (found in amb1_sdk)
  • RTL8710CM
  • RTL8722CSM (found in ambd_arduino)
  • RTL8720DN (found in ambd_arduino)
  • RTL8721DM
  • RTL8722DM (found in ambd_arduino)
"},{"location":"docs/platform/realtek-ambz/","title":"Realtek AmebaZ","text":""},{"location":"docs/platform/realtek-ambz/#introduction","title":"Introduction","text":"

Realtek AmebaZ is a family of Wi-Fi microcontrollers, primarily consisting of two chips - RTL8710BN and RTL8710BX.

RTL8710BX seems to be the same chip but clocked at 62.5 MHz (instead of 125 MHz for BN). However, it seems that firmware compiled for either of the chips can run on the other with no issues.

Features:

  • ARM Cortex M4 CPU (up to 125 MHz)
  • 512 KiB ROM
  • 256 KiB SRAM
  • SPI flash interface with XiP
  • 802.11b/g/n Wi-Fi

Resources:

  • Realtek Ameba-Z datasheet v3.4
  • Realtek product page
  • Realtek PDFs for Ameba1/AmebaZ
  • Ameba1/AmebaZ SDK
"},{"location":"docs/platform/realtek-ambz/#finding-your-board","title":"Finding your board","text":"

You need to know which board your device uses. Head to Supported Boards to find it. A good number of popular boards have their dedicated support and documentation pages in LibreTiny. Otherwise, you have to use one of the Generic boards that matches the CPU model of your device.

"},{"location":"docs/platform/realtek-ambz/#flashing","title":"Flashing","text":"

Realtek RTL8710B has two UART ports - UART2 (sometimes called LOG_UART) and UART0. The port used for flashing and viewing logs is UART2.

You need to find which pins correspond to UART2 TX and RX. If your board is supported, you'll find the pinout on its documentation page. Otherwise (and for generic boards), you'll have to find the pinout online.

Tip

You need a good USB<->UART adapter for the process. Some chips may not support 1.5M baud rate, required by the ROM for the initial handshake. Widespread PL2303 is currently known not to work, at least under Windows. FT232RL is verified to work reliably.

"},{"location":"docs/platform/realtek-ambz/#wiring","title":"Wiring","text":"

Connect UART2 of the Realtek chip to the USB-TTL adapter:

PC RTL8710B RX TX2 (Log_TX / PA30) TX RX2 (Log_RX / PA29) GND GND

Important

Using a good, stable 3.3V power supply is crucial. Most flashing issues are caused by either voltage drops during intensive flash operations, or bad/loose wires. The UART adapter's 3.3V power regulator is usually not enough.

Instead, a regulated bench power supply, or a linear 1117-type regulator is recommended.

In order to flash the chip, you need to enable download mode. This is done by resetting the chip while pulling down the TX2 pin.

Note

\"CEN\" pin is the RESET pin - connecting it to GND will keep the chip in \"reset\" state. Disconnecting it will allow the chip to start back up.

If you're having issues with using CEN pin (or if it's not accessible on your device) you can toggle the 3.3V power instead. Removing power will keep it in \"reset\", and applying it back will start it again.

Do this, in order:

  • connect CEN to GND
  • connect TX2 to GND
  • release CEN from GND
  • release TX2 from GND

To find out whether download mode is enabled, open a serial terminal (such as PuTTY) on your PC. You should see a few characters printed to the serial console every second (usually some kind of grey blocks, or other non-letter characters).

Note that you will not see any characters before you release TX2 from GND.

"},{"location":"docs/platform/realtek-ambz/#partition-layout","title":"Partition layout","text":"

When you compile firmware for Realtek with LibreTiny (either ESPHome or other PlatformIO projects), you need to choose a board. Different Realtek boards have different partition layouts - the main difference is the OTA2 firmware address. Choosing a board with wrong address will make it harder to flash OTA updates.

Flashing over UART will update (set) the on-chip OTA address to match the firmware being flashed. OTA flashing will not update the address - so make sure to choose the correct board, and keep using the same board for OTA flashing.

Using incorrect boards may result in OTA updates having no effect, or (worst case) bricking the device completely.

"},{"location":"docs/platform/realtek-ambz/#flashing_1","title":"Flashing","text":"

The recommended tool to flash (or dump firmware) is ltchiptool.

Read Using ltchiptool to learn the flashing procedure

Tip

Because the UART uploading code is programmed in the ROM of the chip, it can't be software-bricked, even if you damage the bootloader.

"},{"location":"docs/platform/realtek-ambz/#auto-download-reboot","title":"Auto-download-reboot","text":"

If you have a recent version of LibreTiny already installed on the chip, you don't need to perform any steps to enter download mode. Instead, Auto-download-reboot will reboot the chip automatically, as soon as it notices the flasher program. This is enabled by default, so you don't have to configure anything.

"},{"location":"docs/platform/realtek-ambz/#firmware-output-files","title":"Firmware output files","text":"

These files are present in the build directory after successful compilation:

File Description firmware.uf2 UF2 package for UART and OTA upload image_ota1.0x00B000.bin OTA 1 image, flashable to 0xB000 image_ota2.0x0D0000.bin OTA 2 image, flashable to 0xD0000 (the address might be different)"},{"location":"docs/platform/realtek-ambz/#other-toolsguides","title":"Other tools/guides","text":"

These tools are not recommended and are kept here for reference only. Don't use them, please.

  • Flashing (Tuya manual)
  • ImageTool (AmebaZ/AmebaD)
  • rtltool.py

OTA1/2 files can be flashed using ImageTool_v2.3.1_AmebaZ(8710b). Browse and select one of the files and enter an appropriate address. Select COM port, press Open and then Download.

This method is not recommended, as it requires you to know the currently enabled OTA index (1 or 2). Flashing the wrong file will either not make any changes, or upload firmware which won't run.

"},{"location":"docs/platform/realtek-ambz/debugging/","title":"Debugging","text":"

Debugging of Realtek Ameba chips is possible and was tested with OpenOCD running remotely on a Raspberry Pi.

(the following is applicable to Arduino framework, and was not tested with SDK framework)

LibreTiny has ready-to-use OpenOCD config files:

  • platform/realtek-ambz/openocd/amebaz.cfg
"},{"location":"docs/platform/realtek-ambz/debugging/#local-debugger","title":"Local debugger","text":"

It should be possible to use PlatformIO's built-in debugging capabilities directly, when plugging an OpenOCD-compatible debugger into your PC. As there are no debugger interfaces built into these IoT boards, you need to specify your interface of choice in platformio.ini:

[env:my_board]\nopenocd_interface = <interface name>\n
where <interface name> is for example raspberrypi2-native, stlink, etc.

"},{"location":"docs/platform/realtek-ambz/debugging/#remote-debugger","title":"Remote debugger","text":"

Using a Raspberry Pi is probably the easiest option (and cheapest, as everyone has a spare Pi laying around).

Connect your Realtek board to your Pi, as per Programming Microcontrollers using OpenOCD on a Raspberry Pi.

Check out RPi BCM2711 GPIOs to read more about BCM pin mappings.

TL;DR: Install OpenOCD. Conenct A14 to BCM GPIO#11, A15 to BCM GPIO#25. Remember to join GND together. Refer to boards/ for pinouts.

Note

On Raspberry Pi 4, additional config might be needed:

bcm2835gpio peripheral_base 0xFE000000\nbcm2835gpio speed_coeffs 236181 60\n
Save the lines to a .cfg file, and pass it to OpenOCD using -f file.cfg. Read more here.

Start OpenOCD like this (you also need your config file in the working directory):

sudo openocd -f interface/raspberrypi2-native.cfg -f amebaz.cfg -c \"bindto 0.0.0.0\"\n
The bindto line is important, as it will allow remote connections.

Configure platformio.ini not to start local OpenOCD:

[env:my_board]\ndebug_tool = custom\ndebug_port = 192.168.0.33:3333\ndebug_server =\n
Replace IP with your Pi's address.

Done, go to PlatformIO in VSCode (or whatever you're using) and click Start Debugging.

"},{"location":"docs/platform/realtek-ambz/debugging/#openocd-output","title":"OpenOCD output","text":"

OpenOCD should show this if everything is connected properly:

alpine:~$ sudo openocd -f interface/raspberrypi2-native.cfg -f amebaz.cfg -c \"bindto 0.0.0.0\"\nOpen On-Chip Debugger 0.11.0\nLicensed under GNU GPL v2\nFor bug reports, read\n        http://openocd.org/doc/doxygen/bugs.html\nBCM2835 GPIO nums: swclk = 11, swdio = 25\n\nWarn : Interface already configured, ignoring\nInfo : Listening on port 6666 for tcl connections\nInfo : Listening on port 4444 for telnet connections\nInfo : BCM2835 GPIO JTAG/SWD bitbang driver\nInfo : clock speed 1001 kHz\nInfo : SWD DPIDR 0x2ba01477\nInfo : rtl8711b.cpu: hardware has 6 breakpoints, 4 watchpoints\nInfo : starting gdb server for rtl8711b.cpu on 3333\nInfo : Listening on port 3333 for gdb connections\n

"},{"location":"docs/platform/realtek-ambz/debugging/#auto-reset","title":"Auto reset","text":"

PlatformIO will reset your board by default when starting debugging. Sometimes this may not be desired. Also the current config is a bit buggy: VSCode thinks the board is halt, but it's actually running so you need to press continue for that first time.

To disable auto reset before and after debugging:

[env:my_board]\ndebug_init_cmds =\n  target extended-remote $DEBUG_PORT ; remove this line if you're debugging locally\n  $INIT_BREAK\n;   monitor reset halt\n  $LOAD_CMDS\n  monitor init\n;   monitor reset halt\n

"},{"location":"docs/platform/realtek-ambz/debugging/#technical-details","title":"Technical details","text":"

GDB is first configured with mem 0x8000000 0x8200000 ro in order to mark flash memory as read-only. This makes GDB use hardware breakpoints, as software BPs don't work on these boards.

"},{"location":"docs/platform/realtek-ambz/debugging/#more-powerful-playground","title":"More powerful playground","text":"
Microsoft Windows [Version 6.1.7601]\n\nKuba@KUBA-PC C:\\Users\\Kuba\n# telnet 192.168.0.33 4444\nOpen On-Chip Debugger\n> mdw 0x8000000\n0x08000000: 96969999\n\n> halt\ntarget halted due to debug-request, current mode: Thread\nxPSR: 0x61000000 pc: 0x0000b462 msp: 0x1003ef5c\n> reg\n===== arm v7m registers\n(0) r0 (/32): 0x035a9584\n(1) r1 (/32): 0x00000015\n[...]\n===== Cortex-M DWT registers\n\n> resume\n>\n
"},{"location":"docs/platform/realtek-ambz/debugging/#useful-openocd-commands","title":"Useful OpenOCD commands","text":"

Run them in your power playground.

"},{"location":"docs/platform/realtek-ambz/debugging/#soft-reset","title":"Soft reset","text":"

Doesn't even disconnect from WiFi (which confuses the code and makes it disconnect anyway).

mww 0xE000ED0C 0x05FA0007\n

"},{"location":"docs/platform/realtek-ambz/debugging/#uart-upload-mode","title":"UART upload mode","text":"
mww 0x40000138 0x8\nmww 0xE000ED0C 0x05FA0007\n
"},{"location":"docs/platform/realtek-ambz/debugging/#hard-fault","title":"Hard Fault","text":"
halt\nreg pc 0\nresume\n
"},{"location":"docs/platform/realtek-ambz/debugging/#rom-dump","title":"ROM dump","text":"
> dump_image rom2.bin 0x0 0x80000\ndumped 524288 bytes in 14.041406s (36.464 KiB/s)\n
"},{"location":"docs/platform/realtek-ambz/debugging/#flash-dump","title":"Flash dump","text":"
> dump_image flash.bin 0x8000000 0x200000\ndumped 2097152 bytes in 54.447296s (37.614 KiB/s)\n
"},{"location":"docs/platform/realtek-ambz/debugging/#efuse-dump","title":"Efuse dump","text":"

(or something that looks like it)

> dump_image efuse.bin 0x40000000 0x400\ndumped 1024 bytes in 0.026813s (37.295 KiB/s)\n

"},{"location":"docs/platform/realtek-ambz/exception-decoder/","title":"Exception decoder","text":"

Configure built-in hard fault decoder in platformio.ini:

[env:my_board]\nmonitor_speed = 115200\nmonitor_filters = rtl_hard_fault_decoder\n
"},{"location":"docs/projects/esphome/","title":"ESPHome","text":"

Tip

See the Cloudcutter video guide for a complete tutorial on flashing with Cloudcutter and installing LibreTiny-ESPHome. Includes Home Assistant Add-On setup.

LibreTiny is now natively supported by ESPHome in versions 2023.9.0 and later.

There are three basic ways to install and use ESPHome. You can choose the option that best suits you:

  • ESPHome Dashboard (GUI) - for new users, might be an easy way to go; config management & compilation using web-based dashboard
  • command line (CLI) - for more experienced users; compilation using CLI commands, somewhat easier to troubleshoot
  • Home Assistant Add-On - using ESPHome in Home Assistant as an add-on

Important

If you have the LibreTiny-ESPHome add-on installed in Home Assistant, migrate your YAML files over to the official ESPHome add-on.

The standalone add-on is now deprecated - after migrating your configs, uninstall the old add-on.

"},{"location":"docs/projects/esphome/#find-your-devices-board","title":"Find your device's board","text":"

Go to Boards & CPU list, find your board (chip model), click on it and remember the Board code. This will be used later, during config creation.

If your board isn't listed, use one of the Generic boards, depending on the chip type of your device.

"},{"location":"docs/projects/esphome/#download-esphome","title":"Download ESPHome","text":"GUICLI

For this, you need Docker, Docker Compose and Python installed. After running the commands, you'll have a running ESPHome Dashboard interface that you can connect to.

  1. Open a terminal/cmd.exe.
  2. Create a docker-compose.yml file in a directory of choice:

    docker-compose.yml
    version: \"3\"\nservices:\n  esphome:\n    container_name: esphome\n    image: ghcr.io/esphome/esphome:latest\n    volumes:\n      - ./configs:/config:rw # (1)!\n      - /etc/localtime:/etc/localtime:ro\n    restart: always\n    privileged: false\n    network_mode: host\n
    1. You can change ./configs to another path, in which your ESPHome configs will be stored.
  3. Start the container using docker-compose up. You should be able to open the GUI on http://localhost:6052/.

Important

Read Getting started first - most importantly, the first part about installation.

Assuming you have PlatformIO, git and Python installed:

  1. Open a terminal/cmd.exe
  2. git clone https://github.com/esphome/esphome
  3. cd into the newly created esphome directory.
  4. Check if it works by typing python -m esphome

Tip

You can alternately install ESPHome CLI using pip with pip install esphome

"},{"location":"docs/projects/esphome/#create-your-device-config","title":"Create your device config","text":"GUICLI
  1. Open the GUI on http://localhost:6052/ (or a different IP address if you're running on a Pi).
  2. Go through the wizard steps:
    • New Device
    • Continue
    • enter name and WiFi details (first time only)
    • LibreTiny will not currently be listed as an option, choose any of the boards and you will overwrite them later
    • select Skip
  3. A new config file will be added. Press Edit and proceed to the next section.
  4. Delete the entire generated configuration and replace it with the example configuration below or one generated by UPK2ESPHome.
  1. Create a YAML config file for your device. You can either:
    • use python -m esphome wizard yourdevice.yml - type answers to the six questions the wizard asks, OR:
    • write a config file manually: yourdevice.yml
      esphome:\n  name: yourdevice\n\nbk72xx:  # adjust accordingly: bk72xx or rtl87xx\n  board: cb2s  # THIS IS YOUR BOARD CODE\n  framework:\n    version: latest\n\nlogger:\nweb_server:\ncaptive_portal:\napi:\nota:\n\nwifi:\n  ssid: !secret wifi_ssid\n  password: !secret wifi_password\n  ap:\n
"},{"location":"docs/projects/esphome/#automatically-generate-config","title":"Automatically generate config","text":"

Instead of adding components manually and writing everything from scratch, you can use UPK2ESPHome to generate a working config (for supported BK7231 devices only). If your device has a Cloudcutter profile, there's a high chance it can have a generated config.

"},{"location":"docs/projects/esphome/#add-components","title":"Add components","text":"

Now, just like with standard ESPHome on ESP32/ESP8266, you need to add components for your device. Visit ESPHome homepage to learn about YAML configuration. If you want, you can upload an \"empty\" config first, and add actual components later.

Important

It's highly recommended to always include the web_server and captive_portal components - even in your first \"empty\" upload.

Adding these two components will safeguard you against accidentally soft-bricking the device, by e.g. entering invalid Wi-Fi credentials. The Web Server provides an easy way to flash a new image over-the-air, and the Captive Portal allows to easily open the Web Server on a fallback AP.

"},{"location":"docs/projects/esphome/#build-upload","title":"Build & upload","text":"GUICLI

Close the config editor. Press the three dots icon and select Install. Choose Manual download and Modern format. The firmware will be compiled and a UF2 file will be downloaded automatically.

The command python -m esphome compile yourdevice.yml will compile ESPHome.

Now, refer to the flashing guide to learn how to upload ESPHome to your device. There's also info on using tuya-cloudcutter in that guide.

"},{"location":"docs/projects/esphome/#advanced-lt-configuration","title":"Advanced: LT configuration","text":"

Note

This part is for advanced users. You'll probably be fine with the default options.

All options from Options & config can be customized in the LibreTiny block:

yourdevice.yml
bk72xx:\n  framework:\n    version: latest\n  lt_config:\n    LT_LOG_HEAP: 1\n    LT_UART_DEFAULT_PORT: 2\n    LT_UART_SILENT_ALL: 0\n

(this is only an example)

Additionally, few options have their dedicated keys:

yourdevice.yml
bk72xx:\n  framework:\n    version: latest\n  # verbose/trace/debug/info/warn/error/fatal\n  loglevel: warn\n  # suppress chip's SDK log messages\n  # (same as LT_UART_SILENT_ALL above)\n  sdk_silent: true\n  # disable SWD/JTAG so that all GPIOs can be used\n  # set to false if you want to attach a debugger\n  gpio_recover: true\n

(these values are defaults)

"},{"location":"docs/projects/esphome/#advanced-using-development-versions-with-esphome","title":"Advanced: Using development versions with ESPHome","text":"

There are a two ways to use development versions of LibreTiny with ESPHome:

  • version is a required field, and must match a specific format, it is recommended to use \"0.0.0\" for custom development
  • source must point to where your development version of LibreTiny resides.
GitLocal
bk72xx:\n  framework:\n    version: \"0.0.0\"\n    source: \"https://github.com/libretiny-eu/libretiny\"\n

Source can be post-fixed to checkout a specified branch or a Pull Request:

  • Branch: add #branch_name (ex: source: \"https://github.com/libretiny-eu/libretiny#experimental_branch_name\")
  • Pull Requests: Pull requests currently require you to check out the source branch of the pull request. To get this information, visit the PR, click on the source branch, and copy their git address and apply the branch their PR uses (ex: https://github.com/pr_user/libretiny#pr_branch)

Check out with Git (recommended) or download and extract a copy of LibreTiny to your local file system running ESPHome.

bk72xx:\n  framework:\n    version: \"0.0.0\"\n    source: \"/local_path_to_libretiny\"\n
"},{"location":"docs/resources/SUMMARY/","title":"SUMMARY","text":"
  • Documents
  • Tuya Pinout Config
  • Beken Flash Chip List
"},{"location":"docs/resources/beken-flash/","title":"Beken Flash Chip List","text":"Chip ID Location Manufacturer Device Size SR Size Line Mode CMP Post Protect Post Protect Mask Protect All Protect None Protect Half Unprotect Last Block QE Bit Post QE Bit M Value Mode Sel Unprotect Protect cwMsk sb lb SR Read SR Write 00 00 00 BDK na DEFAULT 4 MiB 2 2 0 2 0x1F 0x00 0x00 0x00 0x000 0 0 0x00 0x01 0B 40 14 BDK xtx / XT 25F08B 1 MiB 2 2 14 2 0x1F 0x1F 0x00 0x0C 0x101 9 1 0xA0 0x01 0B 40 15 HDP,BDK xtx / XT 25F16B 2 MiB 2 2 14 2 0x1F 0x1F 0x00 0x0D 0x101 9 1 0xA0 0x01 0x00 0x07 BIT(14) or BFD(0x1f,2,5) 2 5 05 35 01 0B 40 16 HDP,BDK xtx / XT 25F32B 4 MiB 2 2 14 2 0x1F 0x1F 0x00 0x0E 0x101 9 1 0xA0 0x01 0x00 0x07 BIT(14) or BFD(0x1f,2,5) 2 5 05 35 01 0B 40 17 HDP,BDK xtx / XT 25F64B 8 MiB 2 2 14 2 0x1F 0x05 0x00 0x0E 0x109 9 1 0xA0 0x01 0x00 0x07 BIT(14)or BFD(0x1f,2,5) 2 5 05 35 01 0B 60 17 HDP xtx / XT 25Q64B 8 MiB 2 0x00 0x07 BIT(14) or BFD(0x1f,2,5) 2 5 05 35 01 0E 40 16 BDK xtx / FT 25H32 4 MiB 2 2 14 2 0x1F 0x1F 0x00 0x0E 0x101 9 1 0xA0 0x01 1C 31 13 HDP xtx / PN 25F04B 512 KiB 1 0x00 0x07 BFD(0x0f,2,4) 2 4 05 01 1C 41 16 HDP ESMT 25QH32A 4 MiB 1 0x00 0x07 BFD(0xf,2,5) 2 4 05 01 1C 70 15 HDP,BDK EN / ESMT 25QH16B 2 MiB 1 2 0 2 0x1F 0x1F 0x00 0x0d 0x0d 0 0 0xA5 0x01 0x00 0x07 BFD(0xf,2,5) 2 4 05 01 1C 70 16 BDK en 25QH32B 4 MiB 1 2 0 2 0x1F 0x1F 0x00 0x16 0x01B 0 0 0xA5 0x01 20 40 16 BDK xmc 25QH32B 4 MiB 2 2 14 2 0x1F 0x1F 0x00 0x0E 0x101 9 1 0xA0 0x01 51 40 13 HDP GD 25D40 512 KiB 1 0x00 0x07 BFD(0x0f,2,3) 2 3 05 01 51 40 14 HDP GD 25D80 1 MiB 1 0x00 0x07 BFD(0x0f,2,3) 2 3 05 01 5E 40 14 HDP xtx / PN 25F08B 1 MiB 1 0x00 0x07 BFD(0x0f,2,4) 2 4 05 01 85 60 13 HDP Puya 25Q40 512 KiB 2 0x00 0x07 BIT(14) or BFD(0x1f,2,5) 2 5 05 35 01 85 60 14 HDP Puya 25Q80 1 MiB 2 0x00 0x07 BIT(14) or BFD(0x1f,2,5) 2 5 05 35 01 85 60 16 HDP Puya 25Q32H 4 MiB 2 0x00 0x07 BIT(14) or BFD(0x1f,2,5) 2 5 05 35 01 85 60 17 HDP Puya 25Q64H 8 MiB 2 0x00 0x07 BIT(14) or BFD(0x1f,2,5) 2 5 05 35 01 C2 23 14 HDP WH 25V8035F 1 MiB 2 0x00 0x07 BIT(12) or BFD(0x1f,2,4) 2 5 05 15 01 C2 23 15 BDK mx 25V16B 2 MiB 1 2 0 2 0x0F 0x0F 0x00 0x0A 0x00E 6 1 0xA5 0x01 C2 23 15 HDP WH 25V1635F 2 MiB 2 0x00 0x07 BIT(12) or BFD(0x1f,2,4) 2 5 05 15 01 C8 40 13 HDP GD 25Q41B 512 KiB 1 0x00 0x07 BIT(14) or BFD(0x1f,2,3) 2 3 05 35 01 C8 40 14 HDP GD 25D80 1 MiB 2 0x00 0x07 BIT(14) or BFD(0x1f,2,5) 2 5 05 35 01 C8 40 15 HDP,BDK GD 25Q16 2 MiB 2 2 14 2 0x1F 0x1F 0x00 0x0D 0x101 9 1 0xA0 0x01 0x00 0x07 BIT(14) or BFD(0x1f,2,5) 2 5 05 35 01 C8 40 16 HDP,BDK GD 25Q32 4 MiB 1 2 0 2 0x1F 0x1F 0x00 0x0E 0x00E 0 0 0xA0 0x01 0x00 0x07 BIT(14) or BFD(0x1f,2,5) 2 5 05 35 01 C8 65 15 HDP GD 25WQ16E 2 MiB 2 0x00 0x07 BIT(14) or BFD(0x1f,2,5) 2 5 05 35 01 C8 65 16 HDP GD 25WQ32E 4 MiB 2 0x00 0x07 BIT(14) or BFD(0x1f,2,5) 2 5 05 35 01 C8 65 17 HDP GD 25WQ64E 8 MiB 2 0x00 0x07 BIT(14) or BFD(0x1f,2,5) 2 5 05 35 01 CD 60 14 HDP TH 25Q80HB 1 MiB 2 0x00 0x07 BIT(14) or BFD(0x1f,2,5) 2 5 05 35 01 E0 40 13 HDP BY / PN 25Q40A 512 KiB 1 0x00 0x07 BIT(14) or BFD(0x1f,2,3) 2 3 05 35 01 E0 40 14 HDP BY / PN 25Q80A 1 MiB 1 0x00 0x07 BIT(14) or BFD(0x1f,2,3) 2 3 05 35 01 EB 60 15 HDP,BDK zg / TH 25Q16(H)B 2 MiB 2 2 14 2 0x1F 0x1F 0x00 0x0D 0x101 9 1 0xA0 0x01 0x00 0x07 BIT(14) or BFD(0x1f,2,5) 2 5 05 35 01 EF 40 16 BDK w 25Q32BFJ 4 MiB 2 2 14 2 0x1F 0x1F 0x00 0x00 0x101 9 1 0xA0 0x01 EF 40 18 HDP WB 25Q128JV 16 MiB 2 0x00 0x07 BIT(14) or BFD(0x1f,2,5) 2 5 05 35 01"},{"location":"docs/resources/documents/","title":"Documents","text":""},{"location":"docs/resources/documents/#realtek","title":"Realtek","text":"Code Name From ambd_sdk AN0004 Realtek low power wi-fi mp user guide AN0011 Realtek wlan simple configuration AN0012 Realtek secure socket layer(ssl) AN0025 Realtek at command AN0075 Realtek Ameba-all at command v2.0 AN0096 Realtek Ameba-all xmodem uart update firmware AN0400 Ameba-D Application Note UM0150 Realtek Ameba CoAP User Guide UM0201 Ameba Common BT Application User Manual EN Found elsewhere AN0400 Ameba-D Application Note_v3_watermark AN0500 Realtek Ameba-ZII application note Realtek Ameba-ZII datasheet v0.8"},{"location":"docs/resources/tuya-pin-config/","title":"Tuya Pinout Config","text":"

Device configuration (user_param_key) can be extracted to JSON, using bk7231tools from a full firmware dump.

Also see:

  • UPK2ESPHome

Sources:

  • tuya_demo_light_pwm for Lights/bulbs
  • Original post by @blakadder on Discord channel #resources
Key(s) Meaning Possible values crc UPK data checksum module Tuya module used CB3S / WB3S / CBU, etc. category Device type as a number 0502 - CW light0505 - RGBCW light Jsonverjv \"JSON\" version Common netled_pinnetled1_pinwfst_pin Status LED for WiFi netled_lvnetled1_lvwfst_lv Status LED Active Level 0 - Active low1 - Active high netled_reuse reset_pin + reset_lv Reset Button Pin + Active Level reset_t Button press time to reset the device 3/5/6/9/10 seconds iicscl I\u00b2C SCL Pin iicsda I\u00b2C SDA Pin net_trig net_type wfct Lights/bulbs cmod Color Mode rgbcw / rgb / cw / c / rgbc dmod Light driver type 0 - PWM1 - SM16726B2 - SM2135E3 - SM2135EH4 - SM2135EJ5 - BP1658CJ6 - BP5758D7 - SM2235/2335 cwtype Color temperature driver 0 - cool and warm white (CW)1 - correlated color temperature (CCT) onoffmode On/off gradient enabled 0 / 1 pmemory Power-off memory enabled 0 / 1 defcolor Default Color c / r defbright Default Brightness 0%-100% deftemp Default Color Temperature 0-100 when defcolor is cool white cwmaxp Cold-Warm Max Power 100-200 with a pitch of 10 brightmin, brightmax Min/Max Brightness 0%-100% colormin, colormax RGB Min/Max Brightness 0%-100% cwmin, cwmax Cold-Warm Min/Max Brightness 0%-100% colormaxp RGB Max Power 0%-100% colorpfun Color mixing power limit enabled 0 / 1 brightstepbristep Brightness Step hsvstep rgbt Used in prod.tests, not relevant title20 \"title20/T20\" supported 0 / 1 Gamma correction gmr, gmg, gmb gmkr, gmkg, gmkb gmwr, gmwg, gmwb PWM Lights r_pin + r_lv Red Channel Pin + Active Level g_pin + g_lv Green Channel Pin + Active Level b_pin + b_lv Blue Channel Pin + Active Level c_pin + c_lv Cool White Pin + Active Level w_pin + w_lv Warm White Pin + Active Level pwmhz PWM Operating Frequency (Hz) I\u00b2C Lights dccurehccurcjccur Cold White Current dwcurehwcurcjwcur Warm White Current drgbcur RGB Current campere Max current of SM2135 colored output 10-45 with a pitch of 5 and defaults to 20 wampere Max current of SM2135 white output 10-80 with a pitch of 5 and defaults to 30 iicr Red Channel Number 0-5 iicg Green Channel Number 0-5 iicb Blue Channel Number 0-5 iicc Cold White Channel Number 0-5 iicw Warm White Channel Number 0-5 iicccur Cold White Current 0 iicwcur Warm White Current 5 Sockets/switches btX_pin + btX_lv Button X Pin + Active Level btX_typebt_type Button X Trigger Type 0 - level_trig1 - edge_trig rlX_pin + rlX_lv Relay X Pin + Active Level rlX_typerl_type Relay X Type 0 - Electric holding relay1 - Magnetic holding relay rl_onX_pin + rl_onX_lv Relay ON Pin + Active Level rl_offX_pin + rl_offX_lv Relay OFF Pin + Active Level rl1_dr_type rl_drvtime total_bt_pin + total_bt_lv Power monitoring ele_fun_en Power Monitoring Enabled 0 / 1 chip_type Power Monitoring Chip Type 0 - BL09371 - HLW80122 - HLW80324 - BL0942 ele_pin CF Pin vi_pin CF1 Pin sel_pin_pin + sel_pin_lv SEL Pin + Active Level Active level is usually 1 lose_vol Under voltage threshold in V over_cur Overcurrent threshold in mA over_vol Overvoltage threshold in V sample_resistor Current shunt resistor value 1 - 1m\u03a92 - 2m\u03a9 vol_def Socket operating voltage 0 - 220V1 - 110V work_voltage Socket operating voltage Infrared irfunc IR Function enabled 0 / 1 infre IR Transmitter Pin infrrir IR Receiver Pin irkXfun + irkXval IR Key X Function + Value X in 1..30 irnightt irstep wgmod, swgmod, scgmod PIR pirmod pirfreq PWM Operating Frequency (Hz) for PIR 1000 pirlduty 100 pirmduty 50 pirhduty 0 pirin_pin + pirin_lv Motion reporting GPIO + Active Level pirsense_pin + pirsense_lv PIR sensitivity (PWM) + Active Level pirrange pirwarn Ambient light sensor day Value to compare against ADC readout ADC value range (0-3300) dusk Value to compare against ADC readout ADC value range (0-3300) evenfall Value to compare against ADC readout ADC value range (0-3300) evening Value to compare against ADC readout ADC value range (0-3300) night Value to compare against ADC readout ADC value range (0-3300) Key-controlled key_pin + key_lv Key Pin + Active Level kXpin_pin + kXpin_lv kXdfunc, kXlfunc, kXsfunc kXldir, kXsdir keyccfg1, keyccfg2 keyfunc, keyglobefunc keylt, keynumber Pairing-related wfcfg Wi-Fi pairing config spcl / spcl_auto / prod / old / low remdmode \"light reset pairing mode\" 0 / 1 rstnum On/off cycles to reset rstcor Light color while connecting c / r rstbr Light brightness while connecting 10-100 rsttemp Light temperature while connecting 0-100 remdtime Pairing mode timeout seconds wfptime Light pairing time minutes cagt Used in prod.tests, not relevant N/A prodagain Used in prod.tests, not relevant 0 / 1 rstmode Pairing related - not relevant pairt Pairing related - not relevant 6-600 wt Used in prod.tests, not relevant N/A Other buzzer_pwm Buzzer working PWM frequency ismusic 0 / 1 ledX_pin + ledX_lv LED X Pin + Active Level led_pin + led_lv LED Pin + Active Level Unknown 0err 1err adclimit aging alarm1_time alarm_t1 backlit_dp backlit_select bitseq bleonoff blindt buzzer cctseg cd_flag2 cdsval ch1_stat ch_cddpidX X in 1..4 ch_dpidX X in 1..4 ch_flagX X in 1..4 ch_num clean_t cntdown1 ctrl_lv ctrl_pin customcode cyc_dpid dctrl_select dimmod dimt dimval door1_magt_lv door1_magt_pin door_alarm_st1 door_mag1 ffc_select inch_dp indep_cfgbt init_conf knum ktime leaderr led_dp lfunc light_status_select lock_dp lockt micpin mixway mutex mxcl_led_m netn_led netnc nety_led netyc nightbrig nightcct nightled notdisturb Do not disturb (DND) mode enabled 0 / 1 on_off_cnt onoff1 onoff_clear_t onoff_n onoff_rst_m onoff_rst_type onoff_type onofftime owm preheatt rand_dpid remote_add_dp remote_list_dp remote_select resistor reuse_led_m rsthold scenespct series_ctrl sfunc standtime starterr step_rate switch1 tempmix tempstep total_stat tracetime1 trigdelay trigmod trl1_time voice_ctrl1 voice_ctrl_set1 whiteseg zero_select"},{"location":"docs/status/supported/","title":"Supported boards, modules and CPUs","text":""},{"location":"docs/status/supported/#board-list","title":"Board list","text":"Name MCU Flash RAM Pins* Wi-Fi BLE ZigBee Family name Generic BK7231N (Tuya QFN32) BK7231N 2 MiB 256 KiB 19 (19 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231n BK7231T (Tuya QFN32) BK7231T 2 MiB 256 KiB 19 (19 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231t BK7252 BK7252 4 MiB 512 KiB 38 (38 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7251 RTL8710BN (2M/468k) RTL8710BN 2 MiB 256 KiB 18 (18 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz RTL8710BN (2M/788k) RTL8710BN 2 MiB 256 KiB 18 (18 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz RTL8710BX (4M/980k) RTL8710BX 4 MiB 256 KiB 17 (17 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz RTL8720CF (2M/992k) RTL8720CF 2 MiB 256 KiB 20 (20 I/O) \u2714\ufe0f \u2714\ufe0f \u274c realtek-ambz2 Ai-Thinker Co., Ltd. BW12 RTL8710BX 2 MiB 256 KiB 16 (12 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz BW15 RTL8720CF 2 MiB 256 KiB 16 (13 I/O) \u2714\ufe0f \u2714\ufe0f \u274c realtek-ambz2 Tuya Inc. CB1S BK7231N 2 MiB 256 KiB 18 (11 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231n CB2L BK7231N 2 MiB 256 KiB 7 (5 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231n CB2S BK7231N 2 MiB 256 KiB 11 (8 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231n CB3L BK7231N 2 MiB 256 KiB 16 (12 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231n CB3S BK7231N 2 MiB 256 KiB 22 (16 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231n CB3SE BK7231N 2 MiB 256 KiB 22 (17 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231n CBLC5 BK7231N 2 MiB 256 KiB 6 (3 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231n CBU BK7231N 2 MiB 256 KiB 21 (18 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231n WB2L-M1 BK7231N 2 MiB 256 KiB 7 (5 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231n WA2 BK7231Q 2 MiB 256 KiB 11 (8 I/O) \u2714\ufe0f \u274c \u274c beken-7231q WB1S BK7231T 2 MiB 256 KiB 22 (12 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231t WB2L BK7231T 2 MiB 256 KiB 7 (5 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231t WB2S BK7231T 2 MiB 256 KiB 11 (8 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231t WB3L BK7231T 2 MiB 256 KiB 21 (17 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231t WB3S BK7231T 2 MiB 256 KiB 22 (16 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231t WBLC5 BK7231T 2 MiB 256 KiB 6 (3 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231t WR1 RTL8710BN 2 MiB 256 KiB 18 (11 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz WR1E RTL8710BN 2 MiB 256 KiB 18 (11 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz WR2 RTL8710BN 2 MiB 256 KiB 11 (8 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz WR2E RTL8710BN 2 MiB 256 KiB 11 (8 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz WR3 RTL8710BN 2 MiB 256 KiB 16 (12 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz WR3E RTL8710BN 2 MiB 256 KiB 16 (12 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz WR3N RTL8710BN 2 MiB 256 KiB 16 (10 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz WR2L RTL8710BX 2 MiB 256 KiB 7 (5 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz WR2LE RTL8710BX 2 MiB 256 KiB 7 (5 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz WR3L RTL8710BX 2 MiB 256 KiB 16 (12 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz WR3LE RTL8710BX 2 MiB 256 KiB 16 (12 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz Unknown LSC LMA35 N BK7231N 2 MiB 256 KiB 22 (15 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231n LSC LMA35 T BK7231T 2 MiB 256 KiB 22 (15 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231t T102-V1.1 RTL8710BN 2 MiB 256 KiB 11 (9 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz T112-V1.1 RTL8710BN 2 MiB 256 KiB 14 (11 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz T103-V1.0 RTL8710BX 2 MiB 256 KiB 16 (12 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz

* I/O count includes GPIOs, ADCs, PWM outputs and UART, but doesn't count CEN/RST and power pins.

"},{"location":"docs/status/supported/#cpu-list","title":"CPU list","text":"

Chips currently supported by the project:

  • BK7231N
  • BK7231Q
  • BK7231T
  • BK7252
  • RTL8710BL
  • RTL8710BN
  • RTL8710BU
  • RTL8710BX
  • RTL8710L0
  • RTL8711BN
  • RTL8711BU
  • RTL8720CF
  • RTL8720CM
  • BK7231S (BK7231T)
  • BK7231U (BK7231T)
  • BL2028N (BK7231N)
  • MX1290 (RTL8710BN)
  • MX1290V2 (RTL8710BX)
  • RTL8720CX (RTL8720CM)
  • W302 (RTL8710BN)

This list is not exhaustive, i.e. a similar chip (but different package) might work just fine, but there's no board definition for it yet. If you have an unsupported chip, feel free to reach out using Issues or on the Discord server.

"},{"location":"docs/status/supported/#families","title":"Families","text":"

A list of chip families currently supported by this project.

Note

The term family was chosen over platform, in order to reduce possible confusion between LibreTiny supported \"platforms\" and PlatformIO's \"platform\", as an entire package. Family is also more compatible with the UF2 term.

The following list corresponds to UF2 OTA format family names, and is also available as JSON. The IDs are also present in lt_types.h. You can view the family list by using ltchiptool list families.

Title Name Code Short name & ID Supported? Source SDK Realtek Ameba1 - - RTL8710A (0x9FFFD543) \u274c - Realtek AmebaZ realtek-ambz ambz RTL8710B (0x22E0D6FC) \u2714\ufe0f framework-realtek-amb1 Realtek AmebaZ2 realtek-ambz2 ambz2 RTL8720C (0xE08F7564) \u2714\ufe0f framework-realtek-ambz2 Realtek AmebaD - - RTL8720D (0x3379CFE2) \u274c - Beken 7231Q beken-7231q bk7231q BK7231Q (0xAFE81D49) \u2714\ufe0f framework-beken-bdk Beken 7231T beken-7231t bk7231t BK7231T (0x675A40B0) \u2714\ufe0f framework-beken-bdk Beken 7231N beken-7231n bk7231n BK7231N (0x7B3EF230) \u2714\ufe0f framework-beken-bdk Beken 7251/7252 beken-7251 bk7251 BK7251 (0x6A82CC42) \u2714\ufe0f framework-beken-bdk Boufallo BL602/BL604 - - BL60X (0xDE1270B7) \u274c -"},{"location":"docs/status/supported/#feature-support","title":"Feature support","text":"

If you notice a feature that you've tested, which works (or not) and doesn't match this table, feel free to submit an issue on GitHub.

BK7231T BK7231N RTL8710B RTL8720C BK7231Q Stability 5/5 5/5 4/5 2/5 1/5 LibreTiny Core \u2714\ufe0f \u2714\ufe0f \u2714\ufe0f \u2714\ufe0f \u2714\ufe0f Wiring Core \u2714\ufe0f \u2714\ufe0f \u2714\ufe0f \u2714\ufe0f \u2714\ufe0f PERIPHERALS (Core) UART I/O \u2714\ufe0f \u2714\ufe0f \u2714\ufe0f \u2714\ufe0f \u2714\ufe0f Flash I/O \u2714\ufe0f \u2714\ufe0f \u2714\ufe0f \u2753 \u2753 Deep sleep \u2753 \u2714\ufe0f \u274c \u274c \u2753 Watchdog timer \u2714\ufe0f \u2714\ufe0f \u2714\ufe0f \u2753 \u2753 PERIPHERALS (Wiring) Digital I/O \u2714\ufe0f \u2714\ufe0f \u2714\ufe0f \u2753 \u2753 PWM \u2714\ufe0f \u2714\ufe0f \u2714\ufe0f \u2753 \u2753 Interrupts \u2714\ufe0f \u2714\ufe0f \u2714\ufe0f \u2753 \u2753 Analog input (ADC) \u2714\ufe0f \u2714\ufe0f \u2714\ufe0f \u2753 \u2753 Wire (I\u00b2C) \u274c \u274c \u2757 \u274c \u274c SPI \u274c \u274c \u274c \u274c \u274c Serial \u2714\ufe0f \u2714\ufe0f \u2714\ufe0f \u2714\ufe0f \u2753 SoftwareSerial \u274c \u274c \u2714\ufe0f \u274c \u274c NETWORKING Wi-Fi STA/AP/Mixed \u2714\ufe0f \u2714\ufe0f \u2714\ufe0f \u2753 \u274c Wi-Fi Events \u2714\ufe0f \u2714\ufe0f \u2714\ufe0f \u2753 \u274c OTA updates \u2714\ufe0f \u2714\ufe0f \u2714\ufe0f \u274c \u274c MDNS \u2714\ufe0f \u2714\ufe0f \u2714\ufe0f \u2753 \u2753

Symbols:

  • \u2714\ufe0f working
  • \u2753 untested
  • \u2757 broken
  • \u274c not implemented (yet?)
  • - not applicable
"},{"location":"docs/status/supported/#unsupported-boards","title":"Unsupported boards","text":""},{"location":"docs/status/supported/#tuya-inc","title":"Tuya Inc.","text":"

Note

Only modules featuring at least Wi-Fi are included in the table. (TY)JW, (TY)WE and (TY)LC Series are omitted, as they contain Espressif chips.

Name MCU Flash RAM Pins Wi-Fi BLE ZigBee AXY Series AXY2S ECR6600 2 MiB 512 KiB 11 \u2714\ufe0f \u2714\ufe0f \u274c AXY3L ECR6600 2 MiB 512 KiB 18 \u2714\ufe0f \u2714\ufe0f \u274c AXY3S ECR6600 2 MiB 512 KiB 22 \u2714\ufe0f \u2714\ufe0f \u274c AXYU ECR6600 2 MiB 512 KiB 21 \u2714\ufe0f \u2714\ufe0f \u274c CB Series CB8P BK7231N 2 MiB 256 KiB 10 \u2714\ufe0f \u2714\ufe0f \u274c CBLC9 BK7231N 2 MiB 256 KiB 8 \u2714\ufe0f \u2714\ufe0f \u274c CR Series CR2S RTL8720CM 4 MiB 4 MiB 11 \u2714\ufe0f \u2714\ufe0f \u274c CR3L RTL8720CM 4 MiB 4 MiB 18 \u2714\ufe0f \u2714\ufe0f \u274c CRG1 RTL8720CM 4 MiB 4 MiB 25 \u2714\ufe0f \u2714\ufe0f \u274c T1 Series T1-2S T1A 1 MiB 288 KiB 11 \u2714\ufe0f \u2714\ufe0f \u274c T2 Series T2-U BK7231N 2 MiB 256 KiB 21 \u2714\ufe0f \u2714\ufe0f \u274c TCS905 Series TCS905-3S BK7231N 2 MiB 256 KiB 22 \u2714\ufe0f \u2714\ufe0f \u274c TCS905-U BK7231N 2 MiB 256 KiB 21 \u2714\ufe0f \u2714\ufe0f \u274c WB Series WB8P BK7231T 2 MiB 256 KiB 10 \u2714\ufe0f \u2714\ufe0f \u274c WBLC9 BK7231T 2 MiB 256 KiB 8 \u2714\ufe0f \u2714\ufe0f \u274c WBR Series WBR1 RTL8720CF 2 MiB 256 KiB 18 \u2714\ufe0f \u2714\ufe0f \u274c WBR2 RTL8720CF 2 MiB 256 KiB 11 \u2714\ufe0f \u2714\ufe0f \u274c WBR2L RTL8720CF 2 MiB 256 KiB 7 \u2714\ufe0f \u2714\ufe0f \u274c WBR3 RTL8720CF 2 MiB 256 KiB 16 \u2714\ufe0f \u2714\ufe0f \u274c WBR3L RTL8720CF 2 MiB 256 KiB 18 \u2714\ufe0f \u2714\ufe0f \u274c WBR3S RTL8720CF 2 MiB 256 KiB 22 \u2714\ufe0f \u2714\ufe0f \u274c WBRU RTL8720CF 2 MiB 256 KiB 21 \u2714\ufe0f \u2714\ufe0f \u274c WBR3N RTL8720CS 4 MiB 512 KiB 16 \u2714\ufe0f \u2714\ufe0f \u274c WBRG1 RTL8720CSM 8 MiB 4 MiB 25 \u2714\ufe0f \u2714\ufe0f \u274c WBR1D RTL8720DN 4 MiB 512 KiB 18 \u2714\ufe0f \u2714\ufe0f \u274c WBR2D RTL8720DN 4 MiB 512 KiB 11 \u2714\ufe0f \u2714\ufe0f \u274c WBR3D RTL8720DN 4 MiB 512 KiB 16 \u2714\ufe0f \u2714\ufe0f \u274c WBR3T RTL8720DN 4 MiB 512 KiB 16 \u2714\ufe0f \u2714\ufe0f \u274c WL Series WL2H-U LN882H ? 296 KiB 21 \u2714\ufe0f \u2714\ufe0f \u274c WR Series WR4 RTL8710BN 1 MiB 256 KiB 16 \u2714\ufe0f \u274c \u274c WR5E RTL8710BN 2 MiB 256 KiB 15 \u2714\ufe0f \u274c \u274c WR6 RTL8710BN 2 MiB 256 KiB 14 \u2714\ufe0f \u274c \u274c WR6-H RTL8710BN 2 MiB 256 KiB 14 \u2714\ufe0f \u274c \u274c WRG1 RTL8711AM 4 MiB 2 MiB 25 \u2714\ufe0f \u274c \u274c WT Series WT3 BK7231N 2 MiB 256 KiB 16 \u2714\ufe0f \u2714\ufe0f \u274c WX Series WXU T103C-HL 2 MiB 320 KiB 21 \u2714\ufe0f \u2714\ufe0f \u274c XR Series XR1 XR809 2 MiB 384 KiB 18 \u2714\ufe0f \u274c \u274c XR3 XR809 2 MiB 384 KiB 16 \u2714\ufe0f \u274c \u274c"},{"location":"docs/status/supported_boards/","title":"Supported boards","text":"Name MCU Flash RAM Pins* Wi-Fi BLE ZigBee Family name Generic BK7231N (Tuya QFN32) BK7231N 2 MiB 256 KiB 19 (19 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231n BK7231T (Tuya QFN32) BK7231T 2 MiB 256 KiB 19 (19 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231t BK7252 BK7252 4 MiB 512 KiB 38 (38 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7251 RTL8710BN (2M/468k) RTL8710BN 2 MiB 256 KiB 18 (18 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz RTL8710BN (2M/788k) RTL8710BN 2 MiB 256 KiB 18 (18 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz RTL8710BX (4M/980k) RTL8710BX 4 MiB 256 KiB 17 (17 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz RTL8720CF (2M/992k) RTL8720CF 2 MiB 256 KiB 20 (20 I/O) \u2714\ufe0f \u2714\ufe0f \u274c realtek-ambz2 Ai-Thinker Co., Ltd. BW12 RTL8710BX 2 MiB 256 KiB 16 (12 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz BW15 RTL8720CF 2 MiB 256 KiB 16 (13 I/O) \u2714\ufe0f \u2714\ufe0f \u274c realtek-ambz2 Tuya Inc. CB1S BK7231N 2 MiB 256 KiB 18 (11 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231n CB2L BK7231N 2 MiB 256 KiB 7 (5 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231n CB2S BK7231N 2 MiB 256 KiB 11 (8 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231n CB3L BK7231N 2 MiB 256 KiB 16 (12 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231n CB3S BK7231N 2 MiB 256 KiB 22 (16 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231n CB3SE BK7231N 2 MiB 256 KiB 22 (17 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231n CBLC5 BK7231N 2 MiB 256 KiB 6 (3 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231n CBU BK7231N 2 MiB 256 KiB 21 (18 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231n WB2L-M1 BK7231N 2 MiB 256 KiB 7 (5 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231n WA2 BK7231Q 2 MiB 256 KiB 11 (8 I/O) \u2714\ufe0f \u274c \u274c beken-7231q WB1S BK7231T 2 MiB 256 KiB 22 (12 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231t WB2L BK7231T 2 MiB 256 KiB 7 (5 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231t WB2S BK7231T 2 MiB 256 KiB 11 (8 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231t WB3L BK7231T 2 MiB 256 KiB 21 (17 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231t WB3S BK7231T 2 MiB 256 KiB 22 (16 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231t WBLC5 BK7231T 2 MiB 256 KiB 6 (3 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231t WR1 RTL8710BN 2 MiB 256 KiB 18 (11 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz WR1E RTL8710BN 2 MiB 256 KiB 18 (11 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz WR2 RTL8710BN 2 MiB 256 KiB 11 (8 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz WR2E RTL8710BN 2 MiB 256 KiB 11 (8 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz WR3 RTL8710BN 2 MiB 256 KiB 16 (12 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz WR3E RTL8710BN 2 MiB 256 KiB 16 (12 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz WR3N RTL8710BN 2 MiB 256 KiB 16 (10 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz WR2L RTL8710BX 2 MiB 256 KiB 7 (5 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz WR2LE RTL8710BX 2 MiB 256 KiB 7 (5 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz WR3L RTL8710BX 2 MiB 256 KiB 16 (12 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz WR3LE RTL8710BX 2 MiB 256 KiB 16 (12 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz Unknown LSC LMA35 N BK7231N 2 MiB 256 KiB 22 (15 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231n LSC LMA35 T BK7231T 2 MiB 256 KiB 22 (15 I/O) \u2714\ufe0f \u2714\ufe0f \u274c beken-7231t T102-V1.1 RTL8710BN 2 MiB 256 KiB 11 (9 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz T112-V1.1 RTL8710BN 2 MiB 256 KiB 14 (11 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz T103-V1.0 RTL8710BX 2 MiB 256 KiB 16 (12 I/O) \u2714\ufe0f \u274c \u274c realtek-ambz"},{"location":"docs/status/supported_chips/","title":"Supported chips","text":"
  • BK7231N
  • BK7231Q
  • BK7231T
  • BK7252
  • RTL8710BL
  • RTL8710BN
  • RTL8710BU
  • RTL8710BX
  • RTL8710L0
  • RTL8711BN
  • RTL8711BU
  • RTL8720CF
  • RTL8720CM
  • BK7231S (BK7231T)
  • BK7231U (BK7231T)
  • BL2028N (BK7231N)
  • MX1290 (RTL8710BN)
  • MX1290V2 (RTL8710BX)
  • RTL8720CX (RTL8720CM)
  • W302 (RTL8710BN)
"},{"location":"docs/status/supported_families/","title":"Supported families","text":"Title Name Code Short name & ID Supported? Source SDK Realtek Ameba1 - - RTL8710A (0x9FFFD543) \u274c - Realtek AmebaZ realtek-ambz ambz RTL8710B (0x22E0D6FC) \u2714\ufe0f framework-realtek-amb1 Realtek AmebaZ2 realtek-ambz2 ambz2 RTL8720C (0xE08F7564) \u2714\ufe0f framework-realtek-ambz2 Realtek AmebaD - - RTL8720D (0x3379CFE2) \u274c - Beken 7231Q beken-7231q bk7231q BK7231Q (0xAFE81D49) \u2714\ufe0f framework-beken-bdk Beken 7231T beken-7231t bk7231t BK7231T (0x675A40B0) \u2714\ufe0f framework-beken-bdk Beken 7231N beken-7231n bk7231n BK7231N (0x7B3EF230) \u2714\ufe0f framework-beken-bdk Beken 7251/7252 beken-7251 bk7251 BK7251 (0x6A82CC42) \u2714\ufe0f framework-beken-bdk Boufallo BL602/BL604 - - BL60X (0xDE1270B7) \u274c -"},{"location":"docs/status/unsupported_boards_tuya_all/","title":"Unsupported boards tuya all","text":"Name MCU Flash RAM Pins Wi-Fi BLE ZigBee AXY Series AXY2S ECR6600 2 MiB 512 KiB 11 \u2714\ufe0f \u2714\ufe0f \u274c AXY3L ECR6600 2 MiB 512 KiB 18 \u2714\ufe0f \u2714\ufe0f \u274c AXY3S ECR6600 2 MiB 512 KiB 22 \u2714\ufe0f \u2714\ufe0f \u274c AXYU ECR6600 2 MiB 512 KiB 21 \u2714\ufe0f \u2714\ufe0f \u274c CB Series CB8P BK7231N 2 MiB 256 KiB 10 \u2714\ufe0f \u2714\ufe0f \u274c CBLC9 BK7231N 2 MiB 256 KiB 8 \u2714\ufe0f \u2714\ufe0f \u274c CR Series CR2S RTL8720CM 4 MiB 4 MiB 11 \u2714\ufe0f \u2714\ufe0f \u274c CR3L RTL8720CM 4 MiB 4 MiB 18 \u2714\ufe0f \u2714\ufe0f \u274c CRG1 RTL8720CM 4 MiB 4 MiB 25 \u2714\ufe0f \u2714\ufe0f \u274c T1 Series T1-2S T1A 1 MiB 288 KiB 11 \u2714\ufe0f \u2714\ufe0f \u274c T2 Series T2-U BK7231N 2 MiB 256 KiB 21 \u2714\ufe0f \u2714\ufe0f \u274c TCS905 Series TCS905-3S BK7231N 2 MiB 256 KiB 22 \u2714\ufe0f \u2714\ufe0f \u274c TCS905-U BK7231N 2 MiB 256 KiB 21 \u2714\ufe0f \u2714\ufe0f \u274c WB Series WB8P BK7231T 2 MiB 256 KiB 10 \u2714\ufe0f \u2714\ufe0f \u274c WBLC9 BK7231T 2 MiB 256 KiB 8 \u2714\ufe0f \u2714\ufe0f \u274c WBR Series WBR1 RTL8720CF 2 MiB 256 KiB 18 \u2714\ufe0f \u2714\ufe0f \u274c WBR2 RTL8720CF 2 MiB 256 KiB 11 \u2714\ufe0f \u2714\ufe0f \u274c WBR2L RTL8720CF 2 MiB 256 KiB 7 \u2714\ufe0f \u2714\ufe0f \u274c WBR3 RTL8720CF 2 MiB 256 KiB 16 \u2714\ufe0f \u2714\ufe0f \u274c WBR3L RTL8720CF 2 MiB 256 KiB 18 \u2714\ufe0f \u2714\ufe0f \u274c WBR3S RTL8720CF 2 MiB 256 KiB 22 \u2714\ufe0f \u2714\ufe0f \u274c WBRU RTL8720CF 2 MiB 256 KiB 21 \u2714\ufe0f \u2714\ufe0f \u274c WBR3N RTL8720CS 4 MiB 512 KiB 16 \u2714\ufe0f \u2714\ufe0f \u274c WBRG1 RTL8720CSM 8 MiB 4 MiB 25 \u2714\ufe0f \u2714\ufe0f \u274c WBR1D RTL8720DN 4 MiB 512 KiB 18 \u2714\ufe0f \u2714\ufe0f \u274c WBR2D RTL8720DN 4 MiB 512 KiB 11 \u2714\ufe0f \u2714\ufe0f \u274c WBR3D RTL8720DN 4 MiB 512 KiB 16 \u2714\ufe0f \u2714\ufe0f \u274c WBR3T RTL8720DN 4 MiB 512 KiB 16 \u2714\ufe0f \u2714\ufe0f \u274c WL Series WL2H-U LN882H ? 296 KiB 21 \u2714\ufe0f \u2714\ufe0f \u274c WR Series WR4 RTL8710BN 1 MiB 256 KiB 16 \u2714\ufe0f \u274c \u274c WR5E RTL8710BN 2 MiB 256 KiB 15 \u2714\ufe0f \u274c \u274c WR6 RTL8710BN 2 MiB 256 KiB 14 \u2714\ufe0f \u274c \u274c WR6-H RTL8710BN 2 MiB 256 KiB 14 \u2714\ufe0f \u274c \u274c WRG1 RTL8711AM 4 MiB 2 MiB 25 \u2714\ufe0f \u274c \u274c WT Series WT3 BK7231N 2 MiB 256 KiB 16 \u2714\ufe0f \u2714\ufe0f \u274c WX Series WXU T103C-HL 2 MiB 320 KiB 21 \u2714\ufe0f \u2714\ufe0f \u274c XR Series XR1 XR809 2 MiB 384 KiB 18 \u2714\ufe0f \u274c \u274c XR3 XR809 2 MiB 384 KiB 16 \u2714\ufe0f \u274c \u274c"},{"location":"examples/SUMMARY/","title":"Examples","text":"
  • PinScan
"},{"location":"examples/PinScan/","title":"PinScan","text":"

This example allows to quickly check all digital/analog pins of an IoT device.

By using a simple TUI (text user interface), you can check which I/O pins correspond to i.e. button presses, as well as write to one of the pins to see which LED lights up.

Warning

Messing with pins in a device can potentially damage some parts of it. Be careful when writing voltages to digital and PWM pins.

Uploading the example and opening up a terminal (e.g. PuTTY) presents this menu:

LibreTiny v0.8.0, PinScan v1.0\nBoard: cb2s\nI/O count: 11\nDigital I/O count: 11\nAnalog input count: 1\n-------- UART2 --------\nCommands:\n        d - Check digital pins\n        a - Check analog pins\n        s - Select UART port\n        t - Toggle ANSI control codes\n        r - Reboot (for uploading)\n        q - Go back to menu, at any time\n        ? - Print help text, also for subcommands\n

The interface expects one-letter commands, without confirmation by Enter. The only part which expects an Enter keypress is inputting pin numbers and UART port numbers.

Pressing q at any time goes back to the main menu, terminating the current process.

Note

PinScan works best with a terminal supporting ANSI escape codes (PuTTY does), but this behavior can be disabled using t.

Switching to another UART port is possible (for example if the default port is on the pins you want to check) using s command. Do not change the port after using any I/O commands, as it won't work; reboot it using r before.

By setting USE_WIFI in main.h to 1, a Telnet server is enabled on port 23. This allows to test I/O pins without having physical, wired access to the device (i.e. using OTA). Make sure to specify correct WiFi credentials.

Tip

If your board isn't supported by LT yet, use one of the generic boards.

If your board doesn't even have a known pinout, use d/s commands of PinScan to ease the mapping of all board pins.

"},{"location":"examples/PinScan/#digital-pins","title":"Digital pins","text":"
Digital I/O\n-------- UART2 --------\nCommands:\n        r - Realtime readout of all pins\n        o - Read one pin continuously\n        s - Manual Scan - toggle each pin\n        h - Write HIGH to a pin\n        l - Write LOW to a pin\n        p - Output using pull up/down (default)\n        w - Output using write low/high (less safe)\n
"},{"location":"examples/PinScan/#realtime-readout-of-all-pins","title":"Realtime readout of all pins","text":"
 D0  D1  D2  D3  D4  D5  D6  D7  D8  D9 D10\n LO  LO  HI  HI  HI  HI  LO  LO  --  --  LO\n

Screen contents will update when voltage on one of the pins changes. Pins marked with -- mean the currently used UART port (which can be changed using s command; after reboot).

TL;DR

Try pressing a button to see which pin changes.

"},{"location":"examples/PinScan/#read-one-pin-continuously","title":"Read one pin continuously","text":"

Enter the pin number, it will be probed until you press q.

"},{"location":"examples/PinScan/#manual-scan-toggle-each-pin","title":"Manual Scan - toggle each pin","text":"
 D0  D1  D2  D3  D4  D5  D6  D7  D8  D9 D10\n HI  LO  LO  LO  LO  LO  LO  LO  --  --  LO\n

A pin will be toggled every 500ms, starting with D0. Type n to move to the next pin.

TL;DR

Go through the pins to see which lights up an LED.

"},{"location":"examples/PinScan/#write-highlow-to-a-pin","title":"Write HIGH/LOW to a pin","text":"

Self-explanatory.

"},{"location":"examples/PinScan/#output-using-pullwrite","title":"Output using pull/write","text":"

Outputs can be toggled by using internal pull-up/pull-down resistors, or by simply writing a voltage. Writing is more current-efficient, but is also less safe if something else supplies different voltage to the pin.

This affects scan and write high/low commands.

TL;DR

Use write output mode (carefully) if there's an LED which doesn't light up with default pull mode.

"},{"location":"examples/PinScan/#analog-pins","title":"Analog pins","text":"
Analog inputs\n-------- UART2 --------\nCommands:\n        r - Realtime readout of all pins\n        o - Read one pin once\n
"},{"location":"examples/PinScan/#realtime-readout-of-all-pins_1","title":"Realtime readout of all pins","text":"

Read voltage (in millivolts) on all available analog pins, until q is pressed.

"},{"location":"examples/PinScan/#read-one-pin-once","title":"Read one pin once","text":"

No need to explain.

"},{"location":"src/mkdoxy/","title":"MkDoxy","text":""},{"location":"src/mkdoxy/#mkdoxy-mkdocs-doxygen-easy-documentation-with-code-snippets","title":"MkDoxy -> MkDocs + Doxygen. Easy documentation with code snippets.","text":""},{"location":"src/mkdoxy/#based-on-matusnovakdoxybook","title":"Based on matusnovak/doxybook","text":"

This python tool is extension for MkDocs. Extension will take your programme source code and runs Doxygen. Than converts exported XML into markdown and create new folder with full generated documentation. Next usage is by snippets inside documentation markdown.

"},{"location":"src/mkdoxy/#example-usage","title":"Example usage","text":"
  1. Generate class with name rb::MotorChangeBuilder

    ::: doxy.Class\n    name: rb::MotorChangeBuilder\n

  2. Generate method brake (MotorId id, uint16_t brakingPower) from class with name rb::MotorChangeBuilderA

    ::: doxy.Class.Method\n    name: rb::MotorChangeBuilder\n    method: brake (MotorId id, uint16_t brakingPower)\n

  3. Generate function with name readUltra (bool async)

    ::: doxy.Function\n    name: readUltra (bool async)\n

  4. Generate code snippet from file RBCXLeds.cpp

    ::: doxy.Code\n    file: RBCXLeds.cpp\n    start: 21\n    end: 35\n

"},{"location":"src/mkdoxy/#requirements","title":"Requirements","text":""},{"location":"src/mkdoxy/#apt","title":"Apt","text":"
  • python 3.6 or newer -> sudo apt install python3
  • Pip -> sudo apt install python3-pip
  • Git -> sudo apt install git
  • Doxygen -> sudo apt install doxygen
"},{"location":"src/mkdoxy/#pip","title":"Pip","text":"
  • Jinja2 -> pip install jinja2
  • Mkdocs -> pip install mkdocs
  • ruamel.yaml -> pip install ruamel.yaml
"},{"location":"src/mkdoxy/#optional","title":"Optional:","text":"
  • mkdocs-material -> pip install mkdocs-material
"},{"location":"src/mkdoxy/#installation","title":"Installation","text":"

Install using Python Pip: https://pypi.org/project/mkdocs-doxygen-snippets-plugin/

pip install mkdocs-doxygen-snippets-plugin\n

Or Install manually:

git clone https://github.com/JakubAndrysek/mkdocs-doxygen-snippets-plugin.git\ncd mkdocs-doxygen-snippets-plugin\npython setup.py install\n
"},{"location":"src/mkdoxy/#license","title":"License","text":"
MIT License\n\nCopyright (c) 2021 Kuba Andr\u00fdsek\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n
"},{"location":"src/mkdoxy/tests/files/docs/","title":"Snippets example","text":"Error: Did not exist project with name: esp
::: doxy.esp.Function\n    name: int testFnc(float a, char b)\n    details: True\n    implements: True\n
"},{"location":"src/mkdoxy/tests/files/docs/#source-code","title":"Source codeError: Did not exist project with name: esp","text":"
::: doxy.esp.Function\n    name: testFnc(float a, char b)\n    details: True\n    implements: True\n
::: doxy.esp.Class\n    name: rb::MotorChangeBuilder\n    description: True\n    include: True\n
"},{"location":"src/mkdoxy/tests/files/docs/#source-code_1","title":"Source codeError: Did not exist project with name: esp","text":"
::: doxy.esp.Class\n    name: rb::MotorChangeBuilder\n    description: True\n    include: True\n
::: doxy.esp.Class.Method\n    name: rb::MotorChangeBuilder\n    method: brake (MotorId id, uint16_t brakingPower)\n    details: False\n    include: True\n
"},{"location":"src/mkdoxy/tests/files/docs/#source-code_2","title":"Source codeError: Did not exist project with name: esp","text":"
::: doxy.esp.Class.Method\n    name: rb::MotorChangeBuilder\n    method: brake (MotorId id, uint16_t brakingPower)\n    details: False\n    include: True\n
::: doxy.esp.Class.list\n
"},{"location":"src/mkdoxy/tests/files/docs/#source-code_3","title":"Source codeError: Did not exist project with name: esp","text":"
::: doxy.esp.Class.list\n
::: doxy.esp.Class.index          \n
"},{"location":"src/mkdoxy/tests/files/docs/#source-code_4","title":"Source codeError: Did not exist project with name: esp","text":"
::: doxy.esp.Class.index\n
::: doxy.esp.Code\n    file: RBCXLeds.cpp\n
"},{"location":"src/mkdoxy/tests/files/docs/#source-code_5","title":"Source codeError: Did not exist project with name: esp","text":"
::: doxy.esp.Code\n    file: RBCXLeds.cpp\n
::: doxy.esp.Code\n    file: RBCXLeds.cpp\n    start: 21\n    end: 35\n    header: True\n
"},{"location":"src/mkdoxy/tests/files/docs/#source-code_6","title":"Source code","text":"
::: doxy.esp.Code\n    file: RBCXLeds.cpp\n    start: 21\n    end: 35\n    header: True\n
"},{"location":"src/mkdoxy/tests/files/src-animal/markdown-demo/","title":"Markdown test","text":"

I highly do not recommend to use markdown through Doxygen! The source markdown file will go through Doxygen to xml and then from xml through doxybook back into markdown. If you REALLY need to use markdown through Doxygen, it is here, but limited. IMHO, just write a simple shell script to copy the necessary markdown files into GitBook directly. Anyway, the markdown below is copied from here: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet and most of it works through doxybook.

"},{"location":"src/mkdoxy/tests/files/src-animal/markdown-demo/#headers","title":"Headers","text":"
# H1\n## H2\n### H3\n#### H4\n##### H5\n###### H6\n\nAlternatively, for H1 and H2, an underline-ish style:\n\nAlt-H1\n======\n\nAlt-H2\n------\n
"},{"location":"src/mkdoxy/tests/files/src-animal/markdown-demo/#h1","title":"H1","text":""},{"location":"src/mkdoxy/tests/files/src-animal/markdown-demo/#h2","title":"H2","text":""},{"location":"src/mkdoxy/tests/files/src-animal/markdown-demo/#h3","title":"H3","text":""},{"location":"src/mkdoxy/tests/files/src-animal/markdown-demo/#h4","title":"H4","text":""},{"location":"src/mkdoxy/tests/files/src-animal/markdown-demo/#h5","title":"H5","text":""},{"location":"src/mkdoxy/tests/files/src-animal/markdown-demo/#h6","title":"H6","text":"

Alternatively, for H1 and H2, an underline-ish style:

"},{"location":"src/mkdoxy/tests/files/src-animal/markdown-demo/#alt-h1","title":"Alt-H1","text":""},{"location":"src/mkdoxy/tests/files/src-animal/markdown-demo/#alt-h2","title":"Alt-H2","text":""},{"location":"src/mkdoxy/tests/files/src-animal/markdown-demo/#emphasis","title":"Emphasis","text":"
Emphasis, aka italics, with *asterisks* or _underscores_.\n\nStrong emphasis, aka bold, with **asterisks** or __underscores__.\n\nCombined emphasis with **asterisks and _underscores_**.\n\nStrikethrough uses two tildes. ~~Scratch this.~~\n

Emphasis, aka italics, with asterisks or underscores.

Strong emphasis, aka bold, with asterisks or underscores.

Combined emphasis with asterisks and underscores.

Strikethrough uses two tildes. ~~Scratch this.~~

"},{"location":"src/mkdoxy/tests/files/src-animal/markdown-demo/#lists","title":"Lists","text":"
1. First ordered list item\n2. Another item\n  * Unordered sub-list. \n1. Actual numbers don't matter, just that it's a number\n  1. Ordered sub-list\n4. And another item.\n\n   You can have properly indented paragraphs within list items. Notice the blank line above, and the leading spaces (at least one, but we'll use three here to also align the raw Markdown).\n\n   To have a line break without a paragraph, you will need to use two trailing spaces.\n   Note that this line is separate, but within the same paragraph.\n   (This is contrary to the typical GFM line break behaviour, where trailing spaces are not required.)\n\n* Unordered list can use asterisks\n- Or minuses\n+ Or pluses\n
  1. First ordered list item
  2. Another item
  3. Unordered sub-list.
  4. Actual numbers don't matter, just that it's a number
  5. Ordered sub-list
  6. And another item.

You can have properly indented paragraphs within list items. Notice the blank line above, and the leading spaces (at least one, but we'll use three here to also align the raw Markdown).

To have a line break without a paragraph, you will need to use two trailing spaces. Note that this line is separate, but within the same paragraph. (This is contrary to the typical GFM line break behaviour, where trailing spaces are not required.)

  • Unordered list can use asterisks
  • Or minuses
  • Or pluses
"},{"location":"src/mkdoxy/tests/files/src-animal/markdown-demo/#links","title":"Links","text":"
[I'm an inline-style link](https://www.google.com)\n\n[I'm an inline-style link with title](https://www.google.com \"Google's Homepage\")\n\n[I'm a reference-style link][Arbitrary case-insensitive reference text]\n\n[I'm a relative reference to a repository file](../blob/master/LICENSE)\n\n[You can use numbers for reference-style link definitions][1]\n\nOr leave it empty and use the [link text itself].\n\nURLs and URLs in angle brackets will automatically get turned into links. \nhttp://www.example.com or <http://www.example.com> and sometimes \nexample.com (but not on Github, for example).\n\nSome text to show that the reference links can follow later.\n\n[arbitrary case-insensitive reference text]: https://www.mozilla.org\n[1]: http://slashdot.org\n[link text itself]: http://www.reddit.com\n

I'm an inline-style link

I'm an inline-style link with title

I'm a reference-style link

I'm a relative reference to a repository file

You can use numbers for reference-style link definitions

Or leave it empty and use the link text itself.

URLs and URLs in angle brackets will automatically get turned into links. http://www.example.com or http://www.example.com and sometimes example.com (but not on Github, for example).

Some text to show that the reference links can follow later.

"},{"location":"src/mkdoxy/tests/files/src-animal/markdown-demo/#images","title":"Images","text":"
Here's our logo (hover to see the title text):\n\nInline-style: \n![alt text](https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png \"Logo Title Text 1\")\n\nReference-style: \n![alt text][logo]\n\n[logo]: https://github.com/adam-p/markdown-here/raw/master/src/common/images/icon48.png \"Logo Title Text 2\"\n

Here's our logo (hover to see the title text):

Inline-style:

Reference-style:

"},{"location":"src/mkdoxy/tests/files/src-animal/markdown-demo/#tables","title":"Tables","text":"
Colons can be used to align columns.\n\n| Tables        | Are           | Cool  |\n| ------------- |:-------------:| -----:|\n| col 3 is      | right-aligned | $1600 |\n| col 2 is      | centered      |   $12 |\n| zebra stripes | are neat      |    $1 |\n\nThere must be at least 3 dashes separating each header cell.\nThe outer pipes (|) are optional, and you don't need to make the \nraw Markdown line up prettily. You can also use inline Markdown.\n\nMarkdown | Less | Pretty\n--- | --- | ---\n*Still* | `renders` | **nicely**\n1 | 2 | 3\n

Colons can be used to align columns.

Tables Are Cool col 3 is right-aligned $1600 col 2 is centered $12 zebra stripes are neat $1

There must be at least 3 dashes separating each header cell. The outer pipes (|) are optional, and you don't need to make the raw Markdown line up prettily. You can also use inline Markdown.

Markdown Less Pretty Still renders nicely 1 2 3"},{"location":"src/mkdoxy/tests/files/src-animal/markdown-demo/#blockquotes","title":"Blockquotes","text":"
> Blockquotes are very handy in email to emulate reply text.\n> This line is part of the same quote.\n\nQuote break.\n\n> This is a very long line that will still be quoted properly when it wraps. Oh boy let's keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can *put* **Markdown** into a blockquote. \n

Blockquotes are very handy in email to emulate reply text. This line is part of the same quote.

Quote break.

This is a very long line that will still be quoted properly when it wraps. Oh boy let's keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can put Markdown into a blockquote.

"},{"location":"src/mkdoxy/tests/files/src-animal/markdown-demo/#inline-html","title":"Inline HTML","text":"
<dl>\n  <dt>Definition list</dt>\n  <dd>Is something people use sometimes.</dd>\n\n  <dt>Markdown in HTML</dt>\n  <dd>Does *not* work **very** well. Use HTML <em>tags</em>.</dd>\n</dl>\n
Definition list Is something people use sometimes. Markdown in HTML Does *not* work **very** well. Use HTML tags."},{"location":"ltapi/annotated/","title":"Class List","text":"

Here are the classes, structs, unions and interfaces with brief descriptions:

  • struct Cookie
  • class EspClass ESP Arduino Core compatibility class.
  • struct EventHandler_s
  • class FlashClass
  • class FunctionRequestHandler
  • class HTTPClient
  • struct RequestArgument
  • struct HTTPUpload
  • class HardwareI2C
  • class IPreferences
  • class IWiFiClient
  • class IWiFiClientSecure
  • class IWiFiServer
  • class IWiFiUDP
  • class LibreTiny Main LibreTiny API class.
  • class LibreTinyOTA Over-the-Air updates helper class.
  • class LibreTinyWDT Watchdog control class.
  • class LwIPClient
  • class LwIPRxBuffer
  • class LwIPServer
  • class LwIPUDP
  • struct MD5Context
  • class MbedTLSClient
  • struct PinInfo
  • class RequestHandler
  • class SerialClass
  • struct SoftData
  • struct SoftSerial
  • class SoftwareSerial
  • class StaticRequestHandler
  • class StreamString
  • class UpdateClass
  • class Uri
  • class UriBraces
  • class UriGlob
  • class UriRegex
  • class WebServer
  • struct RequestArgument
  • class WiFiClass
  • struct WiFiMacAddr
  • class WiFiMulti
  • struct WiFiNetworkInfo
  • struct WiFiScanAP
  • struct WiFiScanData
  • struct WifiAPlist_t
  • namespace arduino
  • class IPv6Address
  • union arduino_event_info_t
  • struct arduino_event_t
  • class base64
  • struct base64_decodestate
  • struct base64_encodestate
  • class cbuf
  • struct esp_ip4_addr
  • struct esp_ip6_addr
  • struct esp_netif_ip6_info_t IPV6 IP address information.
  • struct esp_netif_ip_info_t
  • namespace fs
  • class FS
  • class FSImpl
  • class File
  • class FileImpl
  • struct ip_event_ap_staipassigned_t
  • struct ip_event_got_ip6_t
  • struct ip_event_got_ip_t
  • struct lt_flash_id_t Flash chip ID structure.
  • struct lt_ota_ctx_t OTA update process context.
  • class mDNS
  • struct mbedtls_md5_context
  • namespace mime
  • struct Entry
  • struct wifi_event_action_tx_status_t
  • struct wifi_event_ap_probe_req_rx_t
  • struct wifi_event_ap_staconnected_t
  • struct wifi_event_ap_stadisconnected_t
  • struct wifi_event_ftm_report_t
  • struct wifi_event_roc_done_t
  • struct wifi_event_sta_authmode_change_t
  • struct wifi_event_sta_connected_t
  • struct wifi_event_sta_disconnected_t
  • struct wifi_event_sta_scan_done_t
  • struct wifi_event_sta_wps_er_pin_t
  • struct wifi_event_sta_wps_er_success_t
  • struct wifi_ftm_report_entry_t
"},{"location":"ltapi/files/","title":"File List","text":"

Here is a list of all files with brief descriptions:

  • dir cores
  • dir common
    • dir arduino
    • dir libraries
      • dir api
      • dir Serial
        • file Serial.cpp
        • file Serial.h
      • dir SoftwareSerial
        • file SoftwareSerial.cpp
        • file SoftwareSerial.h
      • dir WiFi
        • file WiFi.cpp
        • file WiFi.h
        • file WiFiAP.cpp
        • file WiFiEvents.cpp
        • file WiFiEvents.h
        • file WiFiGeneric.cpp
        • file WiFiSTA.cpp
        • file WiFiScan.cpp
        • file WiFiType.h
      • dir common
      • dir FS
        • file FS.cpp
        • file FS.h
      • dir IPv6Address
        • file IPv6Address.cpp
        • file IPv6Address.h
        • dir api
        • file IPv6Address.h
      • dir MD5
        • file MD5.h
        • file MD5HostapdImpl.h
        • file MD5MbedTLSImpl.cpp
        • file MD5MbedTLSImpl.h
      • dir Preferences
        • file Preferences.h
      • dir Update
        • file Update.cpp
        • file Update.h
        • file UpdateUtil.cpp
      • dir WiFiClient
        • file LwIPClient.cpp
        • file LwIPClient.h
        • file LwIPRxBuffer.cpp
        • file LwIPRxBuffer.h
        • file MbedTLSClient.cpp
        • file MbedTLSClient.h
        • file WiFiClient.h
        • file WiFiClientSecure.h
      • dir WiFiServer
        • file LwIPServer.cpp
        • file LwIPServer.h
        • file WiFiServer.h
      • dir WiFiUdp
        • file LwIPUdp.cpp
        • file LwIPUdp.h
        • file WiFiUdp.h
      • dir mDNS
        • file LwIPmDNS.cpp
        • file mDNS.cpp
        • file mDNS.h
      • dir ext
      • dir HTTPClient
        • file HTTPClient.cpp
        • file HTTPClient.h
      • dir StreamString
        • file StreamString.cpp
        • file StreamString.h
      • dir WebServer
        • file HTTP_Method.h
        • file Parsing.cpp
        • file Uri.h
        • file WebServer.cpp
        • file WebServer.h
        • dir detail
        • file RequestHandler.h
        • file RequestHandlersImpl.h
        • file mimetable.cpp
        • file mimetable.h
        • dir uri
        • file UriBraces.h
        • file UriGlob.h
        • file UriRegex.h
      • dir WiFiMulti
        • file WiFiMulti.cpp
        • file WiFiMulti.h
      • dir base64
        • file base64.cpp
        • file base64.h
        • dir libb64
        • file cdecode.c
        • file cdecode.h
        • file cencode.c
        • file cencode.h
      • dir cbuf
        • file cbuf.cpp
        • file cbuf.h
      • dir inline
      • file Singletons.cpp
      • dir ESP
        • file ESP.h
      • dir Flash
        • file Flash.h
      • dir LT
        • file LT.h
      • dir OTA
        • file OTA.h
      • dir WDT
        • file WDT.h
    • dir src
      • file Arduino.h
      • file Events.cpp
      • file Events.h
      • file HardwareI2C.h
      • dir common
      • file abi.cpp
      • file dtostrf.c
      • file serial_event.cpp
      • dir compat
      • file ESPmDNS.h
      • file FS.h
      • file FSImpl.h
      • file WiFiAP.h
      • file md5.h
      • file pgmspace.h
      • file vfs_api.h
      • dir posix
      • file time.c
      • dir wiring
      • file wiring.c
      • file wiring_compat.cpp
      • file wiring_compat.h
      • file wiring_custom.c
      • file wiring_custom.h
      • file wiring_irq.c
      • file wiring_math.cpp
      • file wiring_private.c
      • file wiring_private.h
      • file wiring_shift.c
      • file main.c
    • dir base
    • dir api
      • file lt_cpu.c
      • file lt_cpu.h
      • file lt_device.c
      • file lt_device.h
      • file lt_flash.c
      • file lt_flash.h
      • file lt_init.h
      • file lt_mem.c
      • file lt_mem.h
      • file lt_ota.c
      • file lt_ota.h
      • file lt_sleep.c
      • file lt_sleep.h
      • file lt_utils.c
      • file lt_utils.h
      • file lt_wdt.c
      • file lt_wdt.h
    • dir compat
      • file certs.h
      • dir lwip
      • file lwip_timers.h
      • file err.h
      • file netdb.h
      • file netif.h
      • file sockets.h
      • file sys.h
      • file tcpip.h
      • file udp.h
    • dir config
      • file fal_cfg.h
      • file fdb_cfg.h
      • file lwipopts.h
      • file printf_config.h
    • dir fixups
      • dir lwip
      • file errno.h
      • file errno.h
      • file malloc.c
    • dir posix
      • file itoa.c
      • file strcasecmp.c
      • file strdup.c
      • file strptime.c
    • dir wraps
      • file putchar.c
      • file puts.c
    • file libretiny.h
    • file lt_api.h
    • file lt_config.h
    • file lt_logger.c
    • file lt_logger.h
    • file lt_main.c
    • file lt_pins.h
    • file lt_posix_api.h
    • file lt_types.h
"},{"location":"ltapi/struct_cookie/","title":"Struct Cookie","text":"

ClassList > Cookie

"},{"location":"ltapi/struct_cookie/#public-attributes","title":"Public Attributes","text":"Type Name time_t date = = 0 String domain time_t duration = = 0 struct Cookie::@2 expires String host bool http_only = = false struct Cookie::@3 max_age String name String path = = \"\" bool secure = = false bool valid = = false String value"},{"location":"ltapi/struct_cookie/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/struct_cookie/#variable-date","title":"variable date","text":"
time_t Cookie::date;\n
"},{"location":"ltapi/struct_cookie/#variable-domain","title":"variable domain","text":"
String Cookie::domain;\n
"},{"location":"ltapi/struct_cookie/#variable-duration","title":"variable duration","text":"
time_t Cookie::duration;\n
"},{"location":"ltapi/struct_cookie/#variable-expires","title":"variable expires","text":"
struct Cookie::@2 Cookie::expires;\n
"},{"location":"ltapi/struct_cookie/#variable-host","title":"variable host","text":"
String Cookie::host;\n
"},{"location":"ltapi/struct_cookie/#variable-http_only","title":"variable http_only","text":"
bool Cookie::http_only;\n
"},{"location":"ltapi/struct_cookie/#variable-max_age","title":"variable max_age","text":"
struct Cookie::@3 Cookie::max_age;\n
"},{"location":"ltapi/struct_cookie/#variable-name","title":"variable name","text":"
String Cookie::name;\n
"},{"location":"ltapi/struct_cookie/#variable-path","title":"variable path","text":"
String Cookie::path;\n
"},{"location":"ltapi/struct_cookie/#variable-secure","title":"variable secure","text":"
bool Cookie::secure;\n
"},{"location":"ltapi/struct_cookie/#variable-valid","title":"variable valid","text":"
bool Cookie::valid;\n
"},{"location":"ltapi/struct_cookie/#variable-value","title":"variable value","text":"
String Cookie::value;\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/HTTPClient/HTTPClient.h

"},{"location":"ltapi/class_esp_class/","title":"Class EspClass","text":"

ClassList > EspClass

ESP Arduino Core compatibility class. More...

  • #include <ESP.h>
"},{"location":"ltapi/class_esp_class/#public-functions","title":"Public Functions","text":"Type Name bool flashEraseSector (uint32_t sector) Erase a single block of flash (usually 4 KiB). bool flashRead (uint32_t address, uint8_t * data, size_t size) Read data from the flash. bool flashWrite (uint32_t address, const uint8_t * data, size_t size) Write data to the flash. uint8_t getBootMode () uint8_t getBootVersion () uint32_t getChipId () Get CPU ID based on the last three octets of MAC address. Note: the number is 24-bit (with the MSB being zero). The 3rd-to-last octet is least-significant, the last octet is most-significant. String getCoreVersion () uint8_t getCpuFreqMHz () Get CPU frequency in MHz. uint32_t getCycleCount () Get CPU cycle count. uint32_t getFlashChipId () Flash chip ID structure. uint32_t getFlashChipMode () uint32_t getFlashChipRealSize () Get flash chip total size. uint32_t getFlashChipSize () Get flash chip total size. uint32_t getFlashChipSizeByChipId () Get flash chip total size. uint8_t getFlashChipVendorId () Flash chip ID structure. uint32_t getFreeHeap () Get free heap size. String getFullVersion () uint16_t getMaxFreeBlockSize () Get largest block of heap that can be allocated at once. String getResetInfo () Get a textual representation of a reboot reason. String getResetReason () Get a textual representation of a reboot reason. const char * getSdkVersion () uint16_t getVcc () uint8_t * random (uint8_t * resultArray, const size_t outputSizeBytes) Generate random bytes using rand(). uint32_t random () Generate random bytes using rand(). void rebootIntoUartDownloadMode () Reboot the CPU and stay in download mode (if possible). void reset () Reboot the CPU. void restart () Reboot the CPU. void wdtDisable () Disable the hardware watchdog. void wdtEnable (uint32_t timeout_ms=0) Enable the hardware watchdog. void wdtFeed () Feed/reset the hardware watchdog timer."},{"location":"ltapi/class_esp_class/#detailed-description","title":"Detailed Description","text":"

This class only consists of inline functions, which wrap the LibreTiny C API (lt_api.h). Refer to the docs of the C API for more information.

The class is accessible using the ESP global object.

"},{"location":"ltapi/class_esp_class/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/class_esp_class/#function-flasherasesector","title":"function flashEraseSector","text":"

Erase a single block of flash (usually 4 KiB).

inline bool EspClass::flashEraseSector (\n    uint32_t sector\n) \n

Parameters:

  • offset offset of the block (in bytes); must be multiple of the flash chip's block size

Returns:

whether erasing was successful

"},{"location":"ltapi/class_esp_class/#function-flashread","title":"function flashRead","text":"

Read data from the flash.

inline bool EspClass::flashRead (\n    uint32_t address,\n    uint8_t * data,\n    size_t size\n) \n

Parameters:

  • offset starting offset (in bytes)
  • data pointer to where to store the data
  • length length of data to read

Returns:

length of data successfully read (should equal 'length')

"},{"location":"ltapi/class_esp_class/#function-flashwrite","title":"function flashWrite","text":"

Write data to the flash.

inline bool EspClass::flashWrite (\n    uint32_t address,\n    const uint8_t * data,\n    size_t size\n) \n

Parameters:

  • offset starting offset (in bytes)
  • data pointer to data to write
  • length length of data to write

Returns:

length of data successfully written (should equal 'length')

"},{"location":"ltapi/class_esp_class/#function-getbootmode","title":"function getBootMode","text":"
inline uint8_t EspClass::getBootMode () \n
"},{"location":"ltapi/class_esp_class/#function-getbootversion","title":"function getBootVersion","text":"
inline uint8_t EspClass::getBootVersion () \n
"},{"location":"ltapi/class_esp_class/#function-getchipid","title":"function getChipId","text":"
inline uint32_t EspClass::getChipId () \n
"},{"location":"ltapi/class_esp_class/#function-getcoreversion","title":"function getCoreVersion","text":"
inline String EspClass::getCoreVersion () \n
"},{"location":"ltapi/class_esp_class/#function-getcpufreqmhz","title":"function getCpuFreqMHz","text":"
inline uint8_t EspClass::getCpuFreqMHz () \n
"},{"location":"ltapi/class_esp_class/#function-getcyclecount","title":"function getCycleCount","text":"
inline uint32_t EspClass::getCycleCount () \n
"},{"location":"ltapi/class_esp_class/#function-getflashchipid","title":"function getFlashChipId","text":"
inline uint32_t EspClass::getFlashChipId () \n
"},{"location":"ltapi/class_esp_class/#function-getflashchipmode","title":"function getFlashChipMode","text":"
inline uint32_t EspClass::getFlashChipMode () \n
"},{"location":"ltapi/class_esp_class/#function-getflashchiprealsize","title":"function getFlashChipRealSize","text":"

Get flash chip total size.

inline uint32_t EspClass::getFlashChipRealSize () \n

The default implementation uses the least significant byte of the chip ID to determine the size.

"},{"location":"ltapi/class_esp_class/#function-getflashchipsize","title":"function getFlashChipSize","text":"

Get flash chip total size.

inline uint32_t EspClass::getFlashChipSize () \n

The default implementation uses the least significant byte of the chip ID to determine the size.

"},{"location":"ltapi/class_esp_class/#function-getflashchipsizebychipid","title":"function getFlashChipSizeByChipId","text":"

Get flash chip total size.

inline uint32_t EspClass::getFlashChipSizeByChipId () \n

The default implementation uses the least significant byte of the chip ID to determine the size.

"},{"location":"ltapi/class_esp_class/#function-getflashchipvendorid","title":"function getFlashChipVendorId","text":"
inline uint8_t EspClass::getFlashChipVendorId () \n
"},{"location":"ltapi/class_esp_class/#function-getfreeheap","title":"function getFreeHeap","text":"
inline uint32_t EspClass::getFreeHeap () \n
"},{"location":"ltapi/class_esp_class/#function-getfullversion","title":"function getFullVersion","text":"
inline String EspClass::getFullVersion () \n
"},{"location":"ltapi/class_esp_class/#function-getmaxfreeblocksize","title":"function getMaxFreeBlockSize","text":"
inline uint16_t EspClass::getMaxFreeBlockSize () \n
"},{"location":"ltapi/class_esp_class/#function-getresetinfo","title":"function getResetInfo","text":"

Get a textual representation of a reboot reason.

inline String EspClass::getResetInfo () \n

Parameters:

  • reason value to convert to text, pass 0 to read from lt_reboot_get_reason()
"},{"location":"ltapi/class_esp_class/#function-getresetreason","title":"function getResetReason","text":"

Get a textual representation of a reboot reason.

inline String EspClass::getResetReason () \n

Parameters:

  • reason value to convert to text, pass 0 to read from lt_reboot_get_reason()
"},{"location":"ltapi/class_esp_class/#function-getsdkversion","title":"function getSdkVersion","text":"
inline const char * EspClass::getSdkVersion () \n
"},{"location":"ltapi/class_esp_class/#function-getvcc","title":"function getVcc","text":"
inline uint16_t EspClass::getVcc () \n
"},{"location":"ltapi/class_esp_class/#function-random-12","title":"function random [1/2]","text":"

Generate random bytes using rand().

inline uint8_t * EspClass::random (\n    uint8_t * resultArray,\n    const size_t outputSizeBytes\n) \n

Parameters:

  • buf destination pointer
  • len how many bytes to generate
"},{"location":"ltapi/class_esp_class/#function-random-22","title":"function random [2/2]","text":"

Generate random bytes using rand().

inline uint32_t EspClass::random () \n

Parameters:

  • buf destination pointer
  • len how many bytes to generate
"},{"location":"ltapi/class_esp_class/#function-rebootintouartdownloadmode","title":"function rebootIntoUartDownloadMode","text":"

Reboot the CPU and stay in download mode (if possible).

inline void EspClass::rebootIntoUartDownloadMode () \n

Returns:

whether download-mode reboot is possible

"},{"location":"ltapi/class_esp_class/#function-reset","title":"function reset","text":"
inline void EspClass::reset () \n
"},{"location":"ltapi/class_esp_class/#function-restart","title":"function restart","text":"
inline void EspClass::restart () \n
"},{"location":"ltapi/class_esp_class/#function-wdtdisable","title":"function wdtDisable","text":"
inline void EspClass::wdtDisable () \n
"},{"location":"ltapi/class_esp_class/#function-wdtenable","title":"function wdtEnable","text":"

Enable the hardware watchdog.

inline void EspClass::wdtEnable (\n    uint32_t timeout_ms=0\n) \n

Parameters:

  • timeout watchdog timeout, milliseconds

Returns:

whether the chip has a hardware watchdog

"},{"location":"ltapi/class_esp_class/#function-wdtfeed","title":"function wdtFeed","text":"
inline void EspClass::wdtFeed () \n

The documentation for this class was generated from the following file cores/common/arduino/libraries/inline/ESP/ESP.h

"},{"location":"ltapi/struct_event_handler__s/","title":"Struct EventHandler_s","text":"

ClassList > EventHandler_s

"},{"location":"ltapi/struct_event_handler__s/#public-attributes","title":"Public Attributes","text":"Type Name EventCb cb EventId eventId EventFuncCb fcb uint16_t id EventSysCb scb"},{"location":"ltapi/struct_event_handler__s/#public-static-attributes","title":"Public Static Attributes","text":"Type Name uint16_t lastId = = 1"},{"location":"ltapi/struct_event_handler__s/#public-functions","title":"Public Functions","text":"Type Name EventHandler_s ()"},{"location":"ltapi/struct_event_handler__s/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/struct_event_handler__s/#variable-cb","title":"variable cb","text":"
EventCb EventHandler_s::cb;\n
"},{"location":"ltapi/struct_event_handler__s/#variable-eventid","title":"variable eventId","text":"
EventId EventHandler_s::eventId;\n
"},{"location":"ltapi/struct_event_handler__s/#variable-fcb","title":"variable fcb","text":"
EventFuncCb EventHandler_s::fcb;\n
"},{"location":"ltapi/struct_event_handler__s/#variable-id","title":"variable id","text":"
uint16_t EventHandler_s::id;\n
"},{"location":"ltapi/struct_event_handler__s/#variable-scb","title":"variable scb","text":"
EventSysCb EventHandler_s::scb;\n
"},{"location":"ltapi/struct_event_handler__s/#public-static-attributes-documentation","title":"Public Static Attributes Documentation","text":""},{"location":"ltapi/struct_event_handler__s/#variable-lastid","title":"variable lastId","text":"
uint16_t EventHandler_s::lastId;\n
"},{"location":"ltapi/struct_event_handler__s/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/struct_event_handler__s/#function-eventhandler_s","title":"function EventHandler_s","text":"
inline EventHandler_s::EventHandler_s () \n

The documentation for this class was generated from the following file cores/common/arduino/src/Events.h

"},{"location":"ltapi/class_flash_class/","title":"Class FlashClass","text":"

ClassList > FlashClass

"},{"location":"ltapi/class_flash_class/#public-functions","title":"Public Functions","text":"Type Name bool eraseSector (uint32_t offset) Erase a single block of flash (usually 4 KiB). FlashId getChipId () Flash chip ID structure. uint32_t getSize () Get flash chip total size. bool readBlock (uint32_t offset, uint8_t * data, size_t length) Read data from the flash. bool writeBlock (uint32_t offset, const uint8_t * data, size_t length) Write data to the flash."},{"location":"ltapi/class_flash_class/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/class_flash_class/#function-erasesector","title":"function eraseSector","text":"

Erase a single block of flash (usually 4 KiB).

inline bool FlashClass::eraseSector (\n    uint32_t offset\n) \n

Parameters:

  • offset offset of the block (in bytes); must be multiple of the flash chip's block size

Returns:

whether erasing was successful

"},{"location":"ltapi/class_flash_class/#function-getchipid","title":"function getChipId","text":"
inline FlashId FlashClass::getChipId () \n
"},{"location":"ltapi/class_flash_class/#function-getsize","title":"function getSize","text":"

Get flash chip total size.

inline uint32_t FlashClass::getSize () \n

The default implementation uses the least significant byte of the chip ID to determine the size.

"},{"location":"ltapi/class_flash_class/#function-readblock","title":"function readBlock","text":"

Read data from the flash.

inline bool FlashClass::readBlock (\n    uint32_t offset,\n    uint8_t * data,\n    size_t length\n) \n

Parameters:

  • offset starting offset (in bytes)
  • data pointer to where to store the data
  • length length of data to read

Returns:

length of data successfully read (should equal 'length')

"},{"location":"ltapi/class_flash_class/#function-writeblock","title":"function writeBlock","text":"

Write data to the flash.

inline bool FlashClass::writeBlock (\n    uint32_t offset,\n    const uint8_t * data,\n    size_t length\n) \n

Parameters:

  • offset starting offset (in bytes)
  • data pointer to data to write
  • length length of data to write

Returns:

length of data successfully written (should equal 'length')

The documentation for this class was generated from the following file cores/common/arduino/libraries/inline/Flash/Flash.h

"},{"location":"ltapi/class_function_request_handler/","title":"Class FunctionRequestHandler","text":"

ClassList > FunctionRequestHandler

Inherits the following classes: RequestHandler

"},{"location":"ltapi/class_function_request_handler/#public-functions","title":"Public Functions","text":"Type Name FunctionRequestHandler (WebServer::THandlerFunction fn, WebServer::THandlerFunction ufn, const Uri & uri, HTTPMethod method) virtual bool canHandle (HTTPMethod requestMethod, String requestUri) override virtual bool canUpload (String requestUri) override virtual bool handle (WebServer & server, HTTPMethod requestMethod, String requestUri) override virtual void upload (WebServer & server, String requestUri, HTTPUpload & upload) override ~FunctionRequestHandler ()"},{"location":"ltapi/class_function_request_handler/#public-functions-inherited-from-requesthandler","title":"Public Functions inherited from RequestHandler","text":"

See RequestHandler

Type Name virtual bool canHandle (HTTPMethod method, String uri) virtual bool canUpload (String uri) virtual bool handle (WebServer & server, HTTPMethod requestMethod, String requestUri) RequestHandler * next () void next (RequestHandler * r) const String & pathArg (unsigned int i) virtual void upload (WebServer & server, String requestUri, HTTPUpload & upload) virtual ~RequestHandler ()"},{"location":"ltapi/class_function_request_handler/#protected-attributes","title":"Protected Attributes","text":"Type Name WebServer::THandlerFunction _fn HTTPMethod _method WebServer::THandlerFunction _ufn Uri * _uri"},{"location":"ltapi/class_function_request_handler/#protected-attributes-inherited-from-requesthandler","title":"Protected Attributes inherited from RequestHandler","text":"

See RequestHandler

Type Name std::vector< String > pathArgs"},{"location":"ltapi/class_function_request_handler/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/class_function_request_handler/#function-functionrequesthandler","title":"function FunctionRequestHandler","text":"
inline FunctionRequestHandler::FunctionRequestHandler (\n    WebServer::THandlerFunction fn,\n    WebServer::THandlerFunction ufn,\n    const Uri & uri,\n    HTTPMethod method\n) \n
"},{"location":"ltapi/class_function_request_handler/#function-canhandle","title":"function canHandle","text":"
inline virtual bool FunctionRequestHandler::canHandle (\n    HTTPMethod requestMethod,\n    String requestUri\n) override\n

Implements RequestHandler::canHandle

"},{"location":"ltapi/class_function_request_handler/#function-canupload","title":"function canUpload","text":"
inline virtual bool FunctionRequestHandler::canUpload (\n    String requestUri\n) override\n

Implements RequestHandler::canUpload

"},{"location":"ltapi/class_function_request_handler/#function-handle","title":"function handle","text":"
inline virtual bool FunctionRequestHandler::handle (\n    WebServer & server,\n    HTTPMethod requestMethod,\n    String requestUri\n) override\n

Implements RequestHandler::handle

"},{"location":"ltapi/class_function_request_handler/#function-upload","title":"function upload","text":"
inline virtual void FunctionRequestHandler::upload (\n    WebServer & server,\n    String requestUri,\n    HTTPUpload & upload\n) override\n

Implements RequestHandler::upload

"},{"location":"ltapi/class_function_request_handler/#function-functionrequesthandler_1","title":"function ~FunctionRequestHandler","text":"
inline FunctionRequestHandler::~FunctionRequestHandler () \n
"},{"location":"ltapi/class_function_request_handler/#protected-attributes-documentation","title":"Protected Attributes Documentation","text":""},{"location":"ltapi/class_function_request_handler/#variable-_fn","title":"variable _fn","text":"
WebServer::THandlerFunction FunctionRequestHandler::_fn;\n
"},{"location":"ltapi/class_function_request_handler/#variable-_method","title":"variable _method","text":"
HTTPMethod FunctionRequestHandler::_method;\n
"},{"location":"ltapi/class_function_request_handler/#variable-_ufn","title":"variable _ufn","text":"
WebServer::THandlerFunction FunctionRequestHandler::_ufn;\n
"},{"location":"ltapi/class_function_request_handler/#variable-_uri","title":"variable _uri","text":"
Uri* FunctionRequestHandler::_uri;\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/detail/RequestHandlersImpl.h

"},{"location":"ltapi/class_h_t_t_p_client/","title":"Class HTTPClient","text":"

ClassList > HTTPClient

"},{"location":"ltapi/class_h_t_t_p_client/#public-functions","title":"Public Functions","text":"Type Name int GET () request handling HTTPClient () int PATCH (uint8_t * payload, size_t size) int PATCH (String payload) int POST (uint8_t * payload, size_t size) int POST (String payload) int PUT (uint8_t * payload, size_t size) int PUT (String payload) void addHeader (const String & name, const String & value, bool first=false, bool replace=true) bool begin (WiFiClient & client, String url) bool begin (WiFiClient & client, String host, uint16_t port, String uri=\"/\", bool https=false) bool begin (String url) bool begin (String url, const char * CAcert) bool begin (String host, uint16_t port, String uri=\"/\") bool begin (String host, uint16_t port, String uri, const char * CAcert) bool begin (String host, uint16_t port, String uri, const char * CAcert, const char * cli_cert, const char * cli_key) void clearAllCookies () void collectHeaders (const char * headerKeys, const size_t headerKeysCount) Response handling. bool connected (void) void end (void) const String & getLocation (void) int getSize (void) WiFiClient & getStream (void) WiFiClient * getStreamPtr (void) bool hasHeader (const char * name) String header (const char * name) String header (size_t i) String headerName (size_t i) int headers () void resetCookieJar () int sendRequest (const char * type, String payload) int sendRequest (const char * type, uint8_t * payload=NULL, size_t size=0) int sendRequest (const char * type, Stream * stream, size_t size=0) void setAuthorization (const char * user, const char * password) void setAuthorization (const char * auth) void setAuthorizationType (const char * authType) void setConnectTimeout (int32_t connectTimeout) void setCookieJar (CookieJar * cookieJar) Cookie jar support. void setFollowRedirects (followRedirects_t follow) void setRedirectLimit (uint16_t limit) void setReuse (bool reuse) void setTimeout (uint16_t timeout) bool setURL (const String & url) void setUserAgent (const String & userAgent) keep-alive void useHTTP10 (bool usehttp10=true) int writeToStream (Stream * stream) ~HTTPClient ()"},{"location":"ltapi/class_h_t_t_p_client/#public-static-functions","title":"Public Static Functions","text":"Type Name String errorToString (int error)"},{"location":"ltapi/class_h_t_t_p_client/#protected-attributes","title":"Protected Attributes","text":"Type Name String _authorizationType = = \"Basic\" String _base64Authorization bool _canReuse = = false WiFiClient * _client = = nullptr int32_t _connectTimeout = = -1 CookieJar * _cookieJar = = nullptrCookie jar support. RequestArgument * _currentHeaders = = nullptrResponse handling. followRedirects_t _followRedirects = = HTTPC_DISABLE_FOLLOW_REDIRECTS size_t _headerKeysCount = = 0 String _headers String _host request handling String _location uint16_t _port = = 0 String _protocol uint16_t _redirectLimit = = 10 int _returnCode = = 0 bool _reuse = = true bool _secure = = false int _size = = -1 std::unique_ptr< WiFiClient > _tcpDeprecated uint16_t _tcpTimeout = = HTTPCLIENT_DEFAULT_TCP_TIMEOUT transferEncoding_t _transferEncoding = = HTTPC_TE_IDENTITY TransportTraitsPtr _transportTraits String _uri bool _useHTTP10 = = false String _userAgent = = \"ESP32HTTPClient\""},{"location":"ltapi/class_h_t_t_p_client/#protected-functions","title":"Protected Functions","text":"Type Name bool beginInternal (String url, const char * expectedProtocol) void clear () bool connect (void) void disconnect (bool preserveClient=false) bool generateCookieString (String * cookieString) int handleHeaderResponse () int returnError (int error) bool sendHeader (const char * type) void setCookie (String date, String headerValue) Cookie jar support. int writeToStreamDataBlock (Stream * stream, int len)"},{"location":"ltapi/class_h_t_t_p_client/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/class_h_t_t_p_client/#function-get","title":"function GET","text":"
int HTTPClient::GET () \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-httpclient","title":"function HTTPClient","text":"
HTTPClient::HTTPClient () \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-patch-12","title":"function PATCH [1/2]","text":"
int HTTPClient::PATCH (\n    uint8_t * payload,\n    size_t size\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-patch-22","title":"function PATCH [2/2]","text":"
int HTTPClient::PATCH (\n    String payload\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-post-12","title":"function POST [1/2]","text":"
int HTTPClient::POST (\n    uint8_t * payload,\n    size_t size\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-post-22","title":"function POST [2/2]","text":"
int HTTPClient::POST (\n    String payload\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-put-12","title":"function PUT [1/2]","text":"
int HTTPClient::PUT (\n    uint8_t * payload,\n    size_t size\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-put-22","title":"function PUT [2/2]","text":"
int HTTPClient::PUT (\n    String payload\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-addheader","title":"function addHeader","text":"
void HTTPClient::addHeader (\n    const String & name,\n    const String & value,\n    bool first=false,\n    bool replace=true\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-begin-17","title":"function begin [1/7]","text":"
bool HTTPClient::begin (\n    WiFiClient & client,\n    String url\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-begin-27","title":"function begin [2/7]","text":"
bool HTTPClient::begin (\n    WiFiClient & client,\n    String host,\n    uint16_t port,\n    String uri=\"/\",\n    bool https=false\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-begin-37","title":"function begin [3/7]","text":"
bool HTTPClient::begin (\n    String url\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-begin-47","title":"function begin [4/7]","text":"
bool HTTPClient::begin (\n    String url,\n    const char * CAcert\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-begin-57","title":"function begin [5/7]","text":"
bool HTTPClient::begin (\n    String host,\n    uint16_t port,\n    String uri=\"/\"\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-begin-67","title":"function begin [6/7]","text":"
bool HTTPClient::begin (\n    String host,\n    uint16_t port,\n    String uri,\n    const char * CAcert\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-begin-77","title":"function begin [7/7]","text":"
bool HTTPClient::begin (\n    String host,\n    uint16_t port,\n    String uri,\n    const char * CAcert,\n    const char * cli_cert,\n    const char * cli_key\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-clearallcookies","title":"function clearAllCookies","text":"
void HTTPClient::clearAllCookies () \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-collectheaders","title":"function collectHeaders","text":"
void HTTPClient::collectHeaders (\n    const char * headerKeys,\n    const size_t headerKeysCount\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-connected","title":"function connected","text":"
bool HTTPClient::connected (\n    void\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-end","title":"function end","text":"
void HTTPClient::end (\n    void\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-getlocation","title":"function getLocation","text":"
const String & HTTPClient::getLocation (\n    void\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-getsize","title":"function getSize","text":"
int HTTPClient::getSize (\n    void\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-getstream","title":"function getStream","text":"
WiFiClient & HTTPClient::getStream (\n    void\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-getstreamptr","title":"function getStreamPtr","text":"
WiFiClient * HTTPClient::getStreamPtr (\n    void\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-hasheader","title":"function hasHeader","text":"
bool HTTPClient::hasHeader (\n    const char * name\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-header-12","title":"function header [1/2]","text":"
String HTTPClient::header (\n    const char * name\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-header-22","title":"function header [2/2]","text":"
String HTTPClient::header (\n    size_t i\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-headername","title":"function headerName","text":"
String HTTPClient::headerName (\n    size_t i\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-headers","title":"function headers","text":"
int HTTPClient::headers () \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-resetcookiejar","title":"function resetCookieJar","text":"
void HTTPClient::resetCookieJar () \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-sendrequest-13","title":"function sendRequest [1/3]","text":"
int HTTPClient::sendRequest (\n    const char * type,\n    String payload\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-sendrequest-23","title":"function sendRequest [2/3]","text":"
int HTTPClient::sendRequest (\n    const char * type,\n    uint8_t * payload=NULL,\n    size_t size=0\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-sendrequest-33","title":"function sendRequest [3/3]","text":"
int HTTPClient::sendRequest (\n    const char * type,\n    Stream * stream,\n    size_t size=0\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-setauthorization-12","title":"function setAuthorization [1/2]","text":"
void HTTPClient::setAuthorization (\n    const char * user,\n    const char * password\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-setauthorization-22","title":"function setAuthorization [2/2]","text":"
void HTTPClient::setAuthorization (\n    const char * auth\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-setauthorizationtype","title":"function setAuthorizationType","text":"
void HTTPClient::setAuthorizationType (\n    const char * authType\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-setconnecttimeout","title":"function setConnectTimeout","text":"
void HTTPClient::setConnectTimeout (\n    int32_t connectTimeout\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-setcookiejar","title":"function setCookieJar","text":"
void HTTPClient::setCookieJar (\n    CookieJar * cookieJar\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-setfollowredirects","title":"function setFollowRedirects","text":"
void HTTPClient::setFollowRedirects (\n    followRedirects_t follow\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-setredirectlimit","title":"function setRedirectLimit","text":"
void HTTPClient::setRedirectLimit (\n    uint16_t limit\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-setreuse","title":"function setReuse","text":"
void HTTPClient::setReuse (\n    bool reuse\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-settimeout","title":"function setTimeout","text":"
void HTTPClient::setTimeout (\n    uint16_t timeout\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-seturl","title":"function setURL","text":"
bool HTTPClient::setURL (\n    const String & url\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-setuseragent","title":"function setUserAgent","text":"
void HTTPClient::setUserAgent (\n    const String & userAgent\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-usehttp10","title":"function useHTTP10","text":"
void HTTPClient::useHTTP10 (\n    bool usehttp10=true\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-writetostream","title":"function writeToStream","text":"
int HTTPClient::writeToStream (\n    Stream * stream\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-httpclient_1","title":"function ~HTTPClient","text":"
HTTPClient::~HTTPClient () \n
"},{"location":"ltapi/class_h_t_t_p_client/#public-static-functions-documentation","title":"Public Static Functions Documentation","text":""},{"location":"ltapi/class_h_t_t_p_client/#function-errortostring","title":"function errorToString","text":"
static String HTTPClient::errorToString (\n    int error\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#protected-attributes-documentation","title":"Protected Attributes Documentation","text":""},{"location":"ltapi/class_h_t_t_p_client/#variable-_authorizationtype","title":"variable _authorizationType","text":"
String HTTPClient::_authorizationType;\n
"},{"location":"ltapi/class_h_t_t_p_client/#variable-_base64authorization","title":"variable _base64Authorization","text":"
String HTTPClient::_base64Authorization;\n
"},{"location":"ltapi/class_h_t_t_p_client/#variable-_canreuse","title":"variable _canReuse","text":"
bool HTTPClient::_canReuse;\n
"},{"location":"ltapi/class_h_t_t_p_client/#variable-_client","title":"variable _client","text":"
WiFiClient* HTTPClient::_client;\n
"},{"location":"ltapi/class_h_t_t_p_client/#variable-_connecttimeout","title":"variable _connectTimeout","text":"
int32_t HTTPClient::_connectTimeout;\n
"},{"location":"ltapi/class_h_t_t_p_client/#variable-_cookiejar","title":"variable _cookieJar","text":"
CookieJar* HTTPClient::_cookieJar;\n
"},{"location":"ltapi/class_h_t_t_p_client/#variable-_currentheaders","title":"variable _currentHeaders","text":"
RequestArgument* HTTPClient::_currentHeaders;\n
"},{"location":"ltapi/class_h_t_t_p_client/#variable-_followredirects","title":"variable _followRedirects","text":"
followRedirects_t HTTPClient::_followRedirects;\n
"},{"location":"ltapi/class_h_t_t_p_client/#variable-_headerkeyscount","title":"variable _headerKeysCount","text":"
size_t HTTPClient::_headerKeysCount;\n
"},{"location":"ltapi/class_h_t_t_p_client/#variable-_headers","title":"variable _headers","text":"
String HTTPClient::_headers;\n
"},{"location":"ltapi/class_h_t_t_p_client/#variable-_host","title":"variable _host","text":"
String HTTPClient::_host;\n
"},{"location":"ltapi/class_h_t_t_p_client/#variable-_location","title":"variable _location","text":"
String HTTPClient::_location;\n
"},{"location":"ltapi/class_h_t_t_p_client/#variable-_port","title":"variable _port","text":"
uint16_t HTTPClient::_port;\n
"},{"location":"ltapi/class_h_t_t_p_client/#variable-_protocol","title":"variable _protocol","text":"
String HTTPClient::_protocol;\n
"},{"location":"ltapi/class_h_t_t_p_client/#variable-_redirectlimit","title":"variable _redirectLimit","text":"
uint16_t HTTPClient::_redirectLimit;\n
"},{"location":"ltapi/class_h_t_t_p_client/#variable-_returncode","title":"variable _returnCode","text":"
int HTTPClient::_returnCode;\n
"},{"location":"ltapi/class_h_t_t_p_client/#variable-_reuse","title":"variable _reuse","text":"
bool HTTPClient::_reuse;\n
"},{"location":"ltapi/class_h_t_t_p_client/#variable-_secure","title":"variable _secure","text":"
bool HTTPClient::_secure;\n
"},{"location":"ltapi/class_h_t_t_p_client/#variable-_size","title":"variable _size","text":"
int HTTPClient::_size;\n
"},{"location":"ltapi/class_h_t_t_p_client/#variable-_tcpdeprecated","title":"variable _tcpDeprecated","text":"
std::unique_ptr<WiFiClient> HTTPClient::_tcpDeprecated;\n
"},{"location":"ltapi/class_h_t_t_p_client/#variable-_tcptimeout","title":"variable _tcpTimeout","text":"
uint16_t HTTPClient::_tcpTimeout;\n
"},{"location":"ltapi/class_h_t_t_p_client/#variable-_transferencoding","title":"variable _transferEncoding","text":"
transferEncoding_t HTTPClient::_transferEncoding;\n
"},{"location":"ltapi/class_h_t_t_p_client/#variable-_transporttraits","title":"variable _transportTraits","text":"
TransportTraitsPtr HTTPClient::_transportTraits;\n
"},{"location":"ltapi/class_h_t_t_p_client/#variable-_uri","title":"variable _uri","text":"
String HTTPClient::_uri;\n
"},{"location":"ltapi/class_h_t_t_p_client/#variable-_usehttp10","title":"variable _useHTTP10","text":"
bool HTTPClient::_useHTTP10;\n
"},{"location":"ltapi/class_h_t_t_p_client/#variable-_useragent","title":"variable _userAgent","text":"
String HTTPClient::_userAgent;\n
"},{"location":"ltapi/class_h_t_t_p_client/#protected-functions-documentation","title":"Protected Functions Documentation","text":""},{"location":"ltapi/class_h_t_t_p_client/#function-begininternal","title":"function beginInternal","text":"
bool HTTPClient::beginInternal (\n    String url,\n    const char * expectedProtocol\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-clear","title":"function clear","text":"
void HTTPClient::clear () \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-connect","title":"function connect","text":"
bool HTTPClient::connect (\n    void\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-disconnect","title":"function disconnect","text":"
void HTTPClient::disconnect (\n    bool preserveClient=false\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-generatecookiestring","title":"function generateCookieString","text":"
bool HTTPClient::generateCookieString (\n    String * cookieString\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-handleheaderresponse","title":"function handleHeaderResponse","text":"
int HTTPClient::handleHeaderResponse () \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-returnerror","title":"function returnError","text":"
int HTTPClient::returnError (\n    int error\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-sendheader","title":"function sendHeader","text":"
bool HTTPClient::sendHeader (\n    const char * type\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-setcookie","title":"function setCookie","text":"
void HTTPClient::setCookie (\n    String date,\n    String headerValue\n) \n
"},{"location":"ltapi/class_h_t_t_p_client/#function-writetostreamdatablock","title":"function writeToStreamDataBlock","text":"
int HTTPClient::writeToStreamDataBlock (\n    Stream * stream,\n    int len\n) \n

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/HTTPClient/HTTPClient.h

"},{"location":"ltapi/struct_h_t_t_p_client_1_1_request_argument/","title":"Struct HTTPClient::RequestArgument","text":"

ClassList > HTTPClient > RequestArgument

"},{"location":"ltapi/struct_h_t_t_p_client_1_1_request_argument/#public-attributes","title":"Public Attributes","text":"Type Name String key String value"},{"location":"ltapi/struct_h_t_t_p_client_1_1_request_argument/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/struct_h_t_t_p_client_1_1_request_argument/#variable-key","title":"variable key","text":"
String HTTPClient::RequestArgument::key;\n
"},{"location":"ltapi/struct_h_t_t_p_client_1_1_request_argument/#variable-value","title":"variable value","text":"
String HTTPClient::RequestArgument::value;\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/HTTPClient/HTTPClient.h

"},{"location":"ltapi/struct_h_t_t_p_upload/","title":"Struct HTTPUpload","text":"

ClassList > HTTPUpload

"},{"location":"ltapi/struct_h_t_t_p_upload/#public-attributes","title":"Public Attributes","text":"Type Name uint8_t buf size_t currentSize String filename String name HTTPUploadStatus status size_t totalSize String type"},{"location":"ltapi/struct_h_t_t_p_upload/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/struct_h_t_t_p_upload/#variable-buf","title":"variable buf","text":"
uint8_t HTTPUpload::buf[HTTP_UPLOAD_BUFLEN];\n
"},{"location":"ltapi/struct_h_t_t_p_upload/#variable-currentsize","title":"variable currentSize","text":"
size_t HTTPUpload::currentSize;\n
"},{"location":"ltapi/struct_h_t_t_p_upload/#variable-filename","title":"variable filename","text":"
String HTTPUpload::filename;\n
"},{"location":"ltapi/struct_h_t_t_p_upload/#variable-name","title":"variable name","text":"
String HTTPUpload::name;\n
"},{"location":"ltapi/struct_h_t_t_p_upload/#variable-status","title":"variable status","text":"
HTTPUploadStatus HTTPUpload::status;\n
"},{"location":"ltapi/struct_h_t_t_p_upload/#variable-totalsize","title":"variable totalSize","text":"
size_t HTTPUpload::totalSize;\n
"},{"location":"ltapi/struct_h_t_t_p_upload/#variable-type","title":"variable type","text":"
String HTTPUpload::type;\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/WebServer.h

"},{"location":"ltapi/class_hardware_i2_c/","title":"Class HardwareI2C","text":"

ClassList > HardwareI2C

Inherits the following classes: Stream

"},{"location":"ltapi/class_hardware_i2_c/#public-functions","title":"Public Functions","text":"Type Name virtual int available () = 0 bool begin () bool begin (uint8_t address) virtual bool begin (int8_t sda, int8_t scl, uint32_t frequency=0) = 0 virtual bool begin (uint8_t address, int8_t sda, int8_t scl, uint32_t frequency=0) = 0 virtual void beginTransmission (uint8_t address) = 0 virtual bool end () = 0 virtual uint8_t endTransmission (bool stopBit) = 0 uint8_t endTransmission () virtual void flush () = 0 uint32_t getClock () void onReceive (void(*)(int) cb) void onRequest (void(*)(void) cb) virtual int peek () = 0 virtual int read () = 0 virtual size_t requestFrom (uint8_t address, size_t len, bool stopBit) = 0 size_t requestFrom (uint8_t address, size_t len) virtual bool setClock (uint32_t freq) = 0 virtual bool setPins (int8_t sda, int8_t scl) = 0 virtual size_t write (const uint8_t * data, size_t len) = 0 virtual size_t write (uint8_t data)"},{"location":"ltapi/class_hardware_i2_c/#protected-attributes","title":"Protected Attributes","text":"Type Name uint32_t _freq = = 0 int8_t _scl = = -1 int8_t _sda = = -1 void(* onReceiveCallback void(* onRequestCallback"},{"location":"ltapi/class_hardware_i2_c/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/class_hardware_i2_c/#function-available","title":"function available","text":"
virtual int HardwareI2C::available () = 0\n
"},{"location":"ltapi/class_hardware_i2_c/#function-begin-14","title":"function begin [1/4]","text":"
inline bool HardwareI2C::begin () \n
"},{"location":"ltapi/class_hardware_i2_c/#function-begin-24","title":"function begin [2/4]","text":"
inline bool HardwareI2C::begin (\n    uint8_t address\n) \n
"},{"location":"ltapi/class_hardware_i2_c/#function-begin-34","title":"function begin [3/4]","text":"
virtual bool HardwareI2C::begin (\n    int8_t sda,\n    int8_t scl,\n    uint32_t frequency=0\n) = 0\n
"},{"location":"ltapi/class_hardware_i2_c/#function-begin-44","title":"function begin [4/4]","text":"
virtual bool HardwareI2C::begin (\n    uint8_t address,\n    int8_t sda,\n    int8_t scl,\n    uint32_t frequency=0\n) = 0\n
"},{"location":"ltapi/class_hardware_i2_c/#function-begintransmission","title":"function beginTransmission","text":"
virtual void HardwareI2C::beginTransmission (\n    uint8_t address\n) = 0\n
"},{"location":"ltapi/class_hardware_i2_c/#function-end","title":"function end","text":"
virtual bool HardwareI2C::end () = 0\n
"},{"location":"ltapi/class_hardware_i2_c/#function-endtransmission-12","title":"function endTransmission [1/2]","text":"
virtual uint8_t HardwareI2C::endTransmission (\n    bool stopBit\n) = 0\n
"},{"location":"ltapi/class_hardware_i2_c/#function-endtransmission-22","title":"function endTransmission [2/2]","text":"
inline uint8_t HardwareI2C::endTransmission () \n
"},{"location":"ltapi/class_hardware_i2_c/#function-flush","title":"function flush","text":"
virtual void HardwareI2C::flush () = 0\n
"},{"location":"ltapi/class_hardware_i2_c/#function-getclock","title":"function getClock","text":"
inline uint32_t HardwareI2C::getClock () \n
"},{"location":"ltapi/class_hardware_i2_c/#function-onreceive","title":"function onReceive","text":"
inline void HardwareI2C::onReceive (\n    void(*)(int) cb\n) \n
"},{"location":"ltapi/class_hardware_i2_c/#function-onrequest","title":"function onRequest","text":"
inline void HardwareI2C::onRequest (\n    void(*)(void) cb\n) \n
"},{"location":"ltapi/class_hardware_i2_c/#function-peek","title":"function peek","text":"
virtual int HardwareI2C::peek () = 0\n
"},{"location":"ltapi/class_hardware_i2_c/#function-read","title":"function read","text":"
virtual int HardwareI2C::read () = 0\n
"},{"location":"ltapi/class_hardware_i2_c/#function-requestfrom-12","title":"function requestFrom [1/2]","text":"
virtual size_t HardwareI2C::requestFrom (\n    uint8_t address,\n    size_t len,\n    bool stopBit\n) = 0\n
"},{"location":"ltapi/class_hardware_i2_c/#function-requestfrom-22","title":"function requestFrom [2/2]","text":"
inline size_t HardwareI2C::requestFrom (\n    uint8_t address,\n    size_t len\n) \n
"},{"location":"ltapi/class_hardware_i2_c/#function-setclock","title":"function setClock","text":"
virtual bool HardwareI2C::setClock (\n    uint32_t freq\n) = 0\n
"},{"location":"ltapi/class_hardware_i2_c/#function-setpins","title":"function setPins","text":"
virtual bool HardwareI2C::setPins (\n    int8_t sda,\n    int8_t scl\n) = 0\n
"},{"location":"ltapi/class_hardware_i2_c/#function-write-12","title":"function write [1/2]","text":"
virtual size_t HardwareI2C::write (\n    const uint8_t * data,\n    size_t len\n) = 0\n
"},{"location":"ltapi/class_hardware_i2_c/#function-write-22","title":"function write [2/2]","text":"
inline virtual size_t HardwareI2C::write (\n    uint8_t data\n) \n
"},{"location":"ltapi/class_hardware_i2_c/#protected-attributes-documentation","title":"Protected Attributes Documentation","text":""},{"location":"ltapi/class_hardware_i2_c/#variable-_freq","title":"variable _freq","text":"
uint32_t HardwareI2C::_freq;\n
"},{"location":"ltapi/class_hardware_i2_c/#variable-_scl","title":"variable _scl","text":"
int8_t HardwareI2C::_scl;\n
"},{"location":"ltapi/class_hardware_i2_c/#variable-_sda","title":"variable _sda","text":"
int8_t HardwareI2C::_sda;\n
"},{"location":"ltapi/class_hardware_i2_c/#variable-onreceivecallback","title":"variable onReceiveCallback","text":"
void(* HardwareI2C::onReceiveCallback) (int);\n
"},{"location":"ltapi/class_hardware_i2_c/#variable-onrequestcallback","title":"variable onRequestCallback","text":"
void(* HardwareI2C::onRequestCallback) (void);\n

The documentation for this class was generated from the following file cores/common/arduino/src/HardwareI2C.h

"},{"location":"ltapi/class_i_preferences/","title":"Class IPreferences","text":"

ClassList > IPreferences

"},{"location":"ltapi/class_i_preferences/#public-functions","title":"Public Functions","text":"Type Name IPreferences () bool begin (const char * name, bool readOnly=false, const char * partition_label=NULL) bool clear () void end () size_t freeEntries () bool getBool (const char * key, bool defaultValue=false) size_t getBytes (const char * key, void * buf, size_t maxLen) size_t getBytesLength (const char * key) int8_t getChar (const char * key, int8_t defaultValue=0) double_t getDouble (const char * key, double_t defaultValue=NAN) float_t getFloat (const char * key, float_t defaultValue=NAN) int32_t getInt (const char * key, int32_t defaultValue=0) int32_t getLong (const char * key, int32_t defaultValue=0) int64_t getLong64 (const char * key, int64_t defaultValue=0) int16_t getShort (const char * key, int16_t defaultValue=0) size_t getString (const char * key, char * value, size_t maxLen) String getString (const char * key, String defaultValue=String()) PreferenceType getType (const char * key) uint8_t getUChar (const char * key, uint8_t defaultValue=0) uint32_t getUInt (const char * key, uint32_t defaultValue=0) uint32_t getULong (const char * key, uint32_t defaultValue=0) uint64_t getULong64 (const char * key, uint64_t defaultValue=0) uint16_t getUShort (const char * key, uint16_t defaultValue=0) bool isKey (const char * key) size_t putBool (const char * key, bool value) size_t putBytes (const char * key, const void * value, size_t len) size_t putChar (const char * key, int8_t value) size_t putDouble (const char * key, double_t value) size_t putFloat (const char * key, float_t value) size_t putInt (const char * key, int32_t value) size_t putLong (const char * key, int32_t value) size_t putLong64 (const char * key, int64_t value) size_t putShort (const char * key, int16_t value) size_t putString (const char * key, const char * value) size_t putString (const char * key, String value) size_t putUChar (const char * key, uint8_t value) size_t putUInt (const char * key, uint32_t value) size_t putULong (const char * key, uint32_t value) size_t putULong64 (const char * key, uint64_t value) size_t putUShort (const char * key, uint16_t value) bool remove (const char * key) ~IPreferences ()"},{"location":"ltapi/class_i_preferences/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/class_i_preferences/#function-ipreferences","title":"function IPreferences","text":"
inline IPreferences::IPreferences () \n
"},{"location":"ltapi/class_i_preferences/#function-begin","title":"function begin","text":"
bool IPreferences::begin (\n    const char * name,\n    bool readOnly=false,\n    const char * partition_label=NULL\n) \n
"},{"location":"ltapi/class_i_preferences/#function-clear","title":"function clear","text":"
bool IPreferences::clear () \n
"},{"location":"ltapi/class_i_preferences/#function-end","title":"function end","text":"
void IPreferences::end () \n
"},{"location":"ltapi/class_i_preferences/#function-freeentries","title":"function freeEntries","text":"
size_t IPreferences::freeEntries () \n
"},{"location":"ltapi/class_i_preferences/#function-getbool","title":"function getBool","text":"
bool IPreferences::getBool (\n    const char * key,\n    bool defaultValue=false\n) \n
"},{"location":"ltapi/class_i_preferences/#function-getbytes","title":"function getBytes","text":"
size_t IPreferences::getBytes (\n    const char * key,\n    void * buf,\n    size_t maxLen\n) \n
"},{"location":"ltapi/class_i_preferences/#function-getbyteslength","title":"function getBytesLength","text":"
size_t IPreferences::getBytesLength (\n    const char * key\n) \n
"},{"location":"ltapi/class_i_preferences/#function-getchar","title":"function getChar","text":"
int8_t IPreferences::getChar (\n    const char * key,\n    int8_t defaultValue=0\n) \n
"},{"location":"ltapi/class_i_preferences/#function-getdouble","title":"function getDouble","text":"
double_t IPreferences::getDouble (\n    const char * key,\n    double_t defaultValue=NAN\n) \n
"},{"location":"ltapi/class_i_preferences/#function-getfloat","title":"function getFloat","text":"
float_t IPreferences::getFloat (\n    const char * key,\n    float_t defaultValue=NAN\n) \n
"},{"location":"ltapi/class_i_preferences/#function-getint","title":"function getInt","text":"
int32_t IPreferences::getInt (\n    const char * key,\n    int32_t defaultValue=0\n) \n
"},{"location":"ltapi/class_i_preferences/#function-getlong","title":"function getLong","text":"
int32_t IPreferences::getLong (\n    const char * key,\n    int32_t defaultValue=0\n) \n
"},{"location":"ltapi/class_i_preferences/#function-getlong64","title":"function getLong64","text":"
int64_t IPreferences::getLong64 (\n    const char * key,\n    int64_t defaultValue=0\n) \n
"},{"location":"ltapi/class_i_preferences/#function-getshort","title":"function getShort","text":"
int16_t IPreferences::getShort (\n    const char * key,\n    int16_t defaultValue=0\n) \n
"},{"location":"ltapi/class_i_preferences/#function-getstring-12","title":"function getString [1/2]","text":"
size_t IPreferences::getString (\n    const char * key,\n    char * value,\n    size_t maxLen\n) \n
"},{"location":"ltapi/class_i_preferences/#function-getstring-22","title":"function getString [2/2]","text":"
String IPreferences::getString (\n    const char * key,\n    String defaultValue=String()\n) \n
"},{"location":"ltapi/class_i_preferences/#function-gettype","title":"function getType","text":"
PreferenceType IPreferences::getType (\n    const char * key\n) \n
"},{"location":"ltapi/class_i_preferences/#function-getuchar","title":"function getUChar","text":"
uint8_t IPreferences::getUChar (\n    const char * key,\n    uint8_t defaultValue=0\n) \n
"},{"location":"ltapi/class_i_preferences/#function-getuint","title":"function getUInt","text":"
uint32_t IPreferences::getUInt (\n    const char * key,\n    uint32_t defaultValue=0\n) \n
"},{"location":"ltapi/class_i_preferences/#function-getulong","title":"function getULong","text":"
uint32_t IPreferences::getULong (\n    const char * key,\n    uint32_t defaultValue=0\n) \n
"},{"location":"ltapi/class_i_preferences/#function-getulong64","title":"function getULong64","text":"
uint64_t IPreferences::getULong64 (\n    const char * key,\n    uint64_t defaultValue=0\n) \n
"},{"location":"ltapi/class_i_preferences/#function-getushort","title":"function getUShort","text":"
uint16_t IPreferences::getUShort (\n    const char * key,\n    uint16_t defaultValue=0\n) \n
"},{"location":"ltapi/class_i_preferences/#function-iskey","title":"function isKey","text":"
bool IPreferences::isKey (\n    const char * key\n) \n
"},{"location":"ltapi/class_i_preferences/#function-putbool","title":"function putBool","text":"
size_t IPreferences::putBool (\n    const char * key,\n    bool value\n) \n
"},{"location":"ltapi/class_i_preferences/#function-putbytes","title":"function putBytes","text":"
size_t IPreferences::putBytes (\n    const char * key,\n    const void * value,\n    size_t len\n) \n
"},{"location":"ltapi/class_i_preferences/#function-putchar","title":"function putChar","text":"
size_t IPreferences::putChar (\n    const char * key,\n    int8_t value\n) \n
"},{"location":"ltapi/class_i_preferences/#function-putdouble","title":"function putDouble","text":"
size_t IPreferences::putDouble (\n    const char * key,\n    double_t value\n) \n
"},{"location":"ltapi/class_i_preferences/#function-putfloat","title":"function putFloat","text":"
size_t IPreferences::putFloat (\n    const char * key,\n    float_t value\n) \n
"},{"location":"ltapi/class_i_preferences/#function-putint","title":"function putInt","text":"
size_t IPreferences::putInt (\n    const char * key,\n    int32_t value\n) \n
"},{"location":"ltapi/class_i_preferences/#function-putlong","title":"function putLong","text":"
size_t IPreferences::putLong (\n    const char * key,\n    int32_t value\n) \n
"},{"location":"ltapi/class_i_preferences/#function-putlong64","title":"function putLong64","text":"
size_t IPreferences::putLong64 (\n    const char * key,\n    int64_t value\n) \n
"},{"location":"ltapi/class_i_preferences/#function-putshort","title":"function putShort","text":"
size_t IPreferences::putShort (\n    const char * key,\n    int16_t value\n) \n
"},{"location":"ltapi/class_i_preferences/#function-putstring-12","title":"function putString [1/2]","text":"
size_t IPreferences::putString (\n    const char * key,\n    const char * value\n) \n
"},{"location":"ltapi/class_i_preferences/#function-putstring-22","title":"function putString [2/2]","text":"
size_t IPreferences::putString (\n    const char * key,\n    String value\n) \n
"},{"location":"ltapi/class_i_preferences/#function-putuchar","title":"function putUChar","text":"
size_t IPreferences::putUChar (\n    const char * key,\n    uint8_t value\n) \n
"},{"location":"ltapi/class_i_preferences/#function-putuint","title":"function putUInt","text":"
size_t IPreferences::putUInt (\n    const char * key,\n    uint32_t value\n) \n
"},{"location":"ltapi/class_i_preferences/#function-putulong","title":"function putULong","text":"
size_t IPreferences::putULong (\n    const char * key,\n    uint32_t value\n) \n
"},{"location":"ltapi/class_i_preferences/#function-putulong64","title":"function putULong64","text":"
size_t IPreferences::putULong64 (\n    const char * key,\n    uint64_t value\n) \n
"},{"location":"ltapi/class_i_preferences/#function-putushort","title":"function putUShort","text":"
size_t IPreferences::putUShort (\n    const char * key,\n    uint16_t value\n) \n
"},{"location":"ltapi/class_i_preferences/#function-remove","title":"function remove","text":"
bool IPreferences::remove (\n    const char * key\n) \n
"},{"location":"ltapi/class_i_preferences/#function-ipreferences_1","title":"function ~IPreferences","text":"
inline IPreferences::~IPreferences () \n

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/Preferences/Preferences.h

"},{"location":"ltapi/class_i_wi_fi_client/","title":"Class IWiFiClient","text":"

ClassList > IWiFiClient

Inherits the following classes: Client

Inherited by the following classes: LwIPClient

"},{"location":"ltapi/class_i_wi_fi_client/#public-functions","title":"Public Functions","text":"Type Name IWiFiClient () IWiFiClient (int sock) virtual int connect (IPAddress ip, uint16_t port, int32_t timeout) = 0 virtual int connect (const char * host, uint16_t port, int32_t timeout) = 0 virtual int fd () const = 0 virtual IPAddress localIP () const = 0 virtual IPAddress localIP (int sock) const = 0 virtual uint16_t localPort () const = 0 virtual uint16_t localPort (int sock) const = 0 operator bool () virtual bool operator!= (const bool value) virtual bool operator!= (const IWiFiClient & other) bool operator== (const IWiFiClient & other) const virtual bool operator== (const bool value) virtual IPAddress remoteIP () const = 0 virtual IPAddress remoteIP (int sock) const = 0 virtual uint16_t remotePort () const = 0 virtual uint16_t remotePort (int sock) const = 0 virtual int setTimeout (uint32_t seconds) = 0 virtual int socket () = 0 virtual size_t write (Stream & stream) = 0 size_t write_P (PGM_P buffer, size_t size) ~IWiFiClient ()"},{"location":"ltapi/class_i_wi_fi_client/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/class_i_wi_fi_client/#function-iwificlient-12","title":"function IWiFiClient [1/2]","text":"
inline IWiFiClient::IWiFiClient () \n
"},{"location":"ltapi/class_i_wi_fi_client/#function-iwificlient-22","title":"function IWiFiClient [2/2]","text":"
inline IWiFiClient::IWiFiClient (\n    int sock\n) \n
"},{"location":"ltapi/class_i_wi_fi_client/#function-connect-12","title":"function connect [1/2]","text":"
virtual int IWiFiClient::connect (\n    IPAddress ip,\n    uint16_t port,\n    int32_t timeout\n) = 0\n
"},{"location":"ltapi/class_i_wi_fi_client/#function-connect-22","title":"function connect [2/2]","text":"
virtual int IWiFiClient::connect (\n    const char * host,\n    uint16_t port,\n    int32_t timeout\n) = 0\n
"},{"location":"ltapi/class_i_wi_fi_client/#function-fd","title":"function fd","text":"
virtual int IWiFiClient::fd () const = 0\n
"},{"location":"ltapi/class_i_wi_fi_client/#function-localip-12","title":"function localIP [1/2]","text":"
virtual IPAddress IWiFiClient::localIP () const = 0\n
"},{"location":"ltapi/class_i_wi_fi_client/#function-localip-22","title":"function localIP [2/2]","text":"
virtual IPAddress IWiFiClient::localIP (\n    int sock\n) const = 0\n
"},{"location":"ltapi/class_i_wi_fi_client/#function-localport-12","title":"function localPort [1/2]","text":"
virtual uint16_t IWiFiClient::localPort () const = 0\n
"},{"location":"ltapi/class_i_wi_fi_client/#function-localport-22","title":"function localPort [2/2]","text":"
virtual uint16_t IWiFiClient::localPort (\n    int sock\n) const = 0\n
"},{"location":"ltapi/class_i_wi_fi_client/#function-operator-bool","title":"function operator bool","text":"
inline IWiFiClient::operator bool () \n
"},{"location":"ltapi/class_i_wi_fi_client/#function-operator","title":"function operator!=","text":"
inline virtual bool IWiFiClient::operator!= (\n    const bool value\n) \n
"},{"location":"ltapi/class_i_wi_fi_client/#function-operator_1","title":"function operator!=","text":"
inline virtual bool IWiFiClient::operator!= (\n    const IWiFiClient & other\n) \n
"},{"location":"ltapi/class_i_wi_fi_client/#function-operator_2","title":"function operator==","text":"
bool IWiFiClient::operator== (\n    const IWiFiClient & other\n) const\n
"},{"location":"ltapi/class_i_wi_fi_client/#function-operator_3","title":"function operator==","text":"
inline virtual bool IWiFiClient::operator== (\n    const bool value\n) \n
"},{"location":"ltapi/class_i_wi_fi_client/#function-remoteip-12","title":"function remoteIP [1/2]","text":"
virtual IPAddress IWiFiClient::remoteIP () const = 0\n
"},{"location":"ltapi/class_i_wi_fi_client/#function-remoteip-22","title":"function remoteIP [2/2]","text":"
virtual IPAddress IWiFiClient::remoteIP (\n    int sock\n) const = 0\n
"},{"location":"ltapi/class_i_wi_fi_client/#function-remoteport-12","title":"function remotePort [1/2]","text":"
virtual uint16_t IWiFiClient::remotePort () const = 0\n
"},{"location":"ltapi/class_i_wi_fi_client/#function-remoteport-22","title":"function remotePort [2/2]","text":"
virtual uint16_t IWiFiClient::remotePort (\n    int sock\n) const = 0\n
"},{"location":"ltapi/class_i_wi_fi_client/#function-settimeout","title":"function setTimeout","text":"
virtual int IWiFiClient::setTimeout (\n    uint32_t seconds\n) = 0\n
"},{"location":"ltapi/class_i_wi_fi_client/#function-socket","title":"function socket","text":"
virtual int IWiFiClient::socket () = 0\n
"},{"location":"ltapi/class_i_wi_fi_client/#function-write","title":"function write","text":"
virtual size_t IWiFiClient::write (\n    Stream & stream\n) = 0\n
"},{"location":"ltapi/class_i_wi_fi_client/#function-write_p","title":"function write_P","text":"
inline size_t IWiFiClient::write_P (\n    PGM_P buffer,\n    size_t size\n) \n
"},{"location":"ltapi/class_i_wi_fi_client/#function-iwificlient","title":"function ~IWiFiClient","text":"
inline IWiFiClient::~IWiFiClient () \n

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiClient/WiFiClient.h

"},{"location":"ltapi/class_i_wi_fi_client_secure/","title":"Class IWiFiClientSecure","text":"

ClassList > IWiFiClientSecure

Inherited by the following classes: MbedTLSClient

"},{"location":"ltapi/class_i_wi_fi_client_secure/#public-functions","title":"Public Functions","text":"Type Name virtual int connect (IPAddress ip, uint16_t port, const char * rootCABuf, const char * clientCert, const char * clientKey) = 0 virtual int connect (const char * host, uint16_t port, const char * rootCABuf, const char * clientCert, const char * clientKey) = 0 virtual int connect (IPAddress ip, uint16_t port, const char * pskIdent, const char * psk) = 0 virtual int connect (const char * host, uint16_t port, const char * pskIdent, const char * psk) = 0 virtual bool getFingerprintSHA256 (uint8_t result) = 0 virtual int lastError (char * buf, const size_t size) = 0 virtual bool loadCACert (Stream & stream, size_t size) = 0 virtual bool loadCertificate (Stream & stream, size_t size) = 0 virtual bool loadPrivateKey (Stream & stream, size_t size) = 0 virtual void setAlpnProtocols (const char ** alpnProtocols) = 0 virtual void setCACert (const char * rootCA) = 0 virtual void setCertificate (const char * clientCA) = 0 virtual void setHandshakeTimeout (unsigned long handshakeTimeout) = 0 virtual void setInsecure () = 0 virtual void setPreSharedKey (const char * pskIdent, const char * psk) = 0 virtual void setPrivateKey (const char * privateKey) = 0 virtual bool verify (const char * fingerprint, const char * domainName) = 0"},{"location":"ltapi/class_i_wi_fi_client_secure/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/class_i_wi_fi_client_secure/#function-connect-14","title":"function connect [1/4]","text":"
virtual int IWiFiClientSecure::connect (\n    IPAddress ip,\n    uint16_t port,\n    const char * rootCABuf,\n    const char * clientCert,\n    const char * clientKey\n) = 0\n
"},{"location":"ltapi/class_i_wi_fi_client_secure/#function-connect-24","title":"function connect [2/4]","text":"
virtual int IWiFiClientSecure::connect (\n    const char * host,\n    uint16_t port,\n    const char * rootCABuf,\n    const char * clientCert,\n    const char * clientKey\n) = 0\n
"},{"location":"ltapi/class_i_wi_fi_client_secure/#function-connect-34","title":"function connect [3/4]","text":"
virtual int IWiFiClientSecure::connect (\n    IPAddress ip,\n    uint16_t port,\n    const char * pskIdent,\n    const char * psk\n) = 0\n
"},{"location":"ltapi/class_i_wi_fi_client_secure/#function-connect-44","title":"function connect [4/4]","text":"
virtual int IWiFiClientSecure::connect (\n    const char * host,\n    uint16_t port,\n    const char * pskIdent,\n    const char * psk\n) = 0\n
"},{"location":"ltapi/class_i_wi_fi_client_secure/#function-getfingerprintsha256","title":"function getFingerprintSHA256","text":"
virtual bool IWiFiClientSecure::getFingerprintSHA256 (\n    uint8_t result\n) = 0\n
"},{"location":"ltapi/class_i_wi_fi_client_secure/#function-lasterror","title":"function lastError","text":"
virtual int IWiFiClientSecure::lastError (\n    char * buf,\n    const size_t size\n) = 0\n
"},{"location":"ltapi/class_i_wi_fi_client_secure/#function-loadcacert","title":"function loadCACert","text":"
virtual bool IWiFiClientSecure::loadCACert (\n    Stream & stream,\n    size_t size\n) = 0\n
"},{"location":"ltapi/class_i_wi_fi_client_secure/#function-loadcertificate","title":"function loadCertificate","text":"
virtual bool IWiFiClientSecure::loadCertificate (\n    Stream & stream,\n    size_t size\n) = 0\n
"},{"location":"ltapi/class_i_wi_fi_client_secure/#function-loadprivatekey","title":"function loadPrivateKey","text":"
virtual bool IWiFiClientSecure::loadPrivateKey (\n    Stream & stream,\n    size_t size\n) = 0\n
"},{"location":"ltapi/class_i_wi_fi_client_secure/#function-setalpnprotocols","title":"function setAlpnProtocols","text":"
virtual void IWiFiClientSecure::setAlpnProtocols (\n    const char ** alpnProtocols\n) = 0\n
"},{"location":"ltapi/class_i_wi_fi_client_secure/#function-setcacert","title":"function setCACert","text":"
virtual void IWiFiClientSecure::setCACert (\n    const char * rootCA\n) = 0\n
"},{"location":"ltapi/class_i_wi_fi_client_secure/#function-setcertificate","title":"function setCertificate","text":"
virtual void IWiFiClientSecure::setCertificate (\n    const char * clientCA\n) = 0\n
"},{"location":"ltapi/class_i_wi_fi_client_secure/#function-sethandshaketimeout","title":"function setHandshakeTimeout","text":"
virtual void IWiFiClientSecure::setHandshakeTimeout (\n    unsigned long handshakeTimeout\n) = 0\n
"},{"location":"ltapi/class_i_wi_fi_client_secure/#function-setinsecure","title":"function setInsecure","text":"
virtual void IWiFiClientSecure::setInsecure () = 0\n
"},{"location":"ltapi/class_i_wi_fi_client_secure/#function-setpresharedkey","title":"function setPreSharedKey","text":"
virtual void IWiFiClientSecure::setPreSharedKey (\n    const char * pskIdent,\n    const char * psk\n) = 0\n
"},{"location":"ltapi/class_i_wi_fi_client_secure/#function-setprivatekey","title":"function setPrivateKey","text":"
virtual void IWiFiClientSecure::setPrivateKey (\n    const char * privateKey\n) = 0\n
"},{"location":"ltapi/class_i_wi_fi_client_secure/#function-verify","title":"function verify","text":"
virtual bool IWiFiClientSecure::verify (\n    const char * fingerprint,\n    const char * domainName\n) = 0\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiClient/WiFiClientSecure.h

"},{"location":"ltapi/class_i_wi_fi_server/","title":"Class IWiFiServer","text":"

template <typename TWiFiClient typename TWiFiClient, typename typename>

ClassList > IWiFiServer

Inherits the following classes: Print

"},{"location":"ltapi/class_i_wi_fi_server/#public-functions","title":"Public Functions","text":"Type Name IWiFiServer (uint16_t port=80, uint8_t maxClients=4) IWiFiServer (const IPAddress & addr, uint16_t port=80, uint8_t maxClients=4) virtual TWiFiClient accept () = 0 TWiFiClient available () virtual bool begin (uint16_t port=0, bool reuseAddr=true) = 0 void close () virtual void end () = 0 virtual bool getNoDelay () = 0 virtual bool hasClient () = 0 void listenOnLocalhost () virtual operator bool () = 0 virtual void setNoDelay (bool noDelay) = 0 virtual int setTimeout (uint32_t seconds) = 0 void stop () virtual void stopAll () = 0 size_t write (uint8_t data) ~IWiFiServer ()"},{"location":"ltapi/class_i_wi_fi_server/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/class_i_wi_fi_server/#function-iwifiserver-12","title":"function IWiFiServer [1/2]","text":"
inline IWiFiServer::IWiFiServer (\n    uint16_t port=80,\n    uint8_t maxClients=4\n) \n
"},{"location":"ltapi/class_i_wi_fi_server/#function-iwifiserver-22","title":"function IWiFiServer [2/2]","text":"
inline IWiFiServer::IWiFiServer (\n    const IPAddress & addr,\n    uint16_t port=80,\n    uint8_t maxClients=4\n) \n
"},{"location":"ltapi/class_i_wi_fi_server/#function-accept","title":"function accept","text":"
virtual TWiFiClient IWiFiServer::accept () = 0\n
"},{"location":"ltapi/class_i_wi_fi_server/#function-available","title":"function available","text":"
inline TWiFiClient IWiFiServer::available () \n
"},{"location":"ltapi/class_i_wi_fi_server/#function-begin","title":"function begin","text":"
virtual bool IWiFiServer::begin (\n    uint16_t port=0,\n    bool reuseAddr=true\n) = 0\n
"},{"location":"ltapi/class_i_wi_fi_server/#function-close","title":"function close","text":"
inline void IWiFiServer::close () \n
"},{"location":"ltapi/class_i_wi_fi_server/#function-end","title":"function end","text":"
virtual void IWiFiServer::end () = 0\n
"},{"location":"ltapi/class_i_wi_fi_server/#function-getnodelay","title":"function getNoDelay","text":"
virtual bool IWiFiServer::getNoDelay () = 0\n
"},{"location":"ltapi/class_i_wi_fi_server/#function-hasclient","title":"function hasClient","text":"
virtual bool IWiFiServer::hasClient () = 0\n
"},{"location":"ltapi/class_i_wi_fi_server/#function-listenonlocalhost","title":"function listenOnLocalhost","text":"
inline void IWiFiServer::listenOnLocalhost () \n
"},{"location":"ltapi/class_i_wi_fi_server/#function-operator-bool","title":"function operator bool","text":"
virtual IWiFiServer::operator bool () = 0\n
"},{"location":"ltapi/class_i_wi_fi_server/#function-setnodelay","title":"function setNoDelay","text":"
virtual void IWiFiServer::setNoDelay (\n    bool noDelay\n) = 0\n
"},{"location":"ltapi/class_i_wi_fi_server/#function-settimeout","title":"function setTimeout","text":"
virtual int IWiFiServer::setTimeout (\n    uint32_t seconds\n) = 0\n
"},{"location":"ltapi/class_i_wi_fi_server/#function-stop","title":"function stop","text":"
inline void IWiFiServer::stop () \n
"},{"location":"ltapi/class_i_wi_fi_server/#function-stopall","title":"function stopAll","text":"
virtual void IWiFiServer::stopAll () = 0\n
"},{"location":"ltapi/class_i_wi_fi_server/#function-write","title":"function write","text":"
inline size_t IWiFiServer::write (\n    uint8_t data\n) \n
"},{"location":"ltapi/class_i_wi_fi_server/#function-iwifiserver","title":"function ~IWiFiServer","text":"
inline IWiFiServer::~IWiFiServer () \n

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiServer/WiFiServer.h

"},{"location":"ltapi/class_i_wi_fi_u_d_p/","title":"Class IWiFiUDP","text":"

ClassList > IWiFiUDP

Inherits the following classes: UDP

Inherited by the following classes: LwIPUDP

"},{"location":"ltapi/class_i_wi_fi_u_d_p/#public-functions","title":"Public Functions","text":"Type Name IWiFiUDP () virtual int available () = 0 virtual uint8_t begin (IPAddress ip, uint16_t port) = 0 virtual uint8_t begin (uint16_t port) = 0 virtual uint8_t beginMulticast (IPAddress ip, uint16_t port) = 0 virtual int beginMulticastPacket () = 0 virtual int beginPacket () = 0 virtual int beginPacket (IPAddress ip, uint16_t port) = 0 virtual int beginPacket (const char * host, uint16_t port) = 0 virtual int endPacket () = 0 virtual void flush () = 0 virtual int parsePacket () = 0 virtual int peek () = 0 virtual int read () = 0 virtual int read (unsigned char * buffer, size_t len) = 0 virtual int read (char * buffer, size_t len) = 0 virtual IPAddress remoteIP () = 0 virtual uint16_t remotePort () = 0 virtual void stop () = 0 virtual size_t write (uint8_t) = 0 virtual size_t write (const uint8_t * buffer, size_t size) = 0 ~IWiFiUDP ()"},{"location":"ltapi/class_i_wi_fi_u_d_p/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/class_i_wi_fi_u_d_p/#function-iwifiudp","title":"function IWiFiUDP","text":"
inline IWiFiUDP::IWiFiUDP () \n
"},{"location":"ltapi/class_i_wi_fi_u_d_p/#function-available","title":"function available","text":"
virtual int IWiFiUDP::available () = 0\n
"},{"location":"ltapi/class_i_wi_fi_u_d_p/#function-begin-12","title":"function begin [1/2]","text":"
virtual uint8_t IWiFiUDP::begin (\n    IPAddress ip,\n    uint16_t port\n) = 0\n
"},{"location":"ltapi/class_i_wi_fi_u_d_p/#function-begin-22","title":"function begin [2/2]","text":"
virtual uint8_t IWiFiUDP::begin (\n    uint16_t port\n) = 0\n
"},{"location":"ltapi/class_i_wi_fi_u_d_p/#function-beginmulticast","title":"function beginMulticast","text":"
virtual uint8_t IWiFiUDP::beginMulticast (\n    IPAddress ip,\n    uint16_t port\n) = 0\n
"},{"location":"ltapi/class_i_wi_fi_u_d_p/#function-beginmulticastpacket","title":"function beginMulticastPacket","text":"
virtual int IWiFiUDP::beginMulticastPacket () = 0\n
"},{"location":"ltapi/class_i_wi_fi_u_d_p/#function-beginpacket-13","title":"function beginPacket [1/3]","text":"
virtual int IWiFiUDP::beginPacket () = 0\n
"},{"location":"ltapi/class_i_wi_fi_u_d_p/#function-beginpacket-23","title":"function beginPacket [2/3]","text":"
virtual int IWiFiUDP::beginPacket (\n    IPAddress ip,\n    uint16_t port\n) = 0\n
"},{"location":"ltapi/class_i_wi_fi_u_d_p/#function-beginpacket-33","title":"function beginPacket [3/3]","text":"
virtual int IWiFiUDP::beginPacket (\n    const char * host,\n    uint16_t port\n) = 0\n
"},{"location":"ltapi/class_i_wi_fi_u_d_p/#function-endpacket","title":"function endPacket","text":"
virtual int IWiFiUDP::endPacket () = 0\n
"},{"location":"ltapi/class_i_wi_fi_u_d_p/#function-flush","title":"function flush","text":"
virtual void IWiFiUDP::flush () = 0\n
"},{"location":"ltapi/class_i_wi_fi_u_d_p/#function-parsepacket","title":"function parsePacket","text":"
virtual int IWiFiUDP::parsePacket () = 0\n
"},{"location":"ltapi/class_i_wi_fi_u_d_p/#function-peek","title":"function peek","text":"
virtual int IWiFiUDP::peek () = 0\n
"},{"location":"ltapi/class_i_wi_fi_u_d_p/#function-read-13","title":"function read [1/3]","text":"
virtual int IWiFiUDP::read () = 0\n
"},{"location":"ltapi/class_i_wi_fi_u_d_p/#function-read-23","title":"function read [2/3]","text":"
virtual int IWiFiUDP::read (\n    unsigned char * buffer,\n    size_t len\n) = 0\n
"},{"location":"ltapi/class_i_wi_fi_u_d_p/#function-read-33","title":"function read [3/3]","text":"
virtual int IWiFiUDP::read (\n    char * buffer,\n    size_t len\n) = 0\n
"},{"location":"ltapi/class_i_wi_fi_u_d_p/#function-remoteip","title":"function remoteIP","text":"
virtual IPAddress IWiFiUDP::remoteIP () = 0\n
"},{"location":"ltapi/class_i_wi_fi_u_d_p/#function-remoteport","title":"function remotePort","text":"
virtual uint16_t IWiFiUDP::remotePort () = 0\n
"},{"location":"ltapi/class_i_wi_fi_u_d_p/#function-stop","title":"function stop","text":"
virtual void IWiFiUDP::stop () = 0\n
"},{"location":"ltapi/class_i_wi_fi_u_d_p/#function-write-12","title":"function write [1/2]","text":"
virtual size_t IWiFiUDP::write (\n    uint8_t\n) = 0\n
"},{"location":"ltapi/class_i_wi_fi_u_d_p/#function-write-22","title":"function write [2/2]","text":"
virtual size_t IWiFiUDP::write (\n    const uint8_t * buffer,\n    size_t size\n) = 0\n
"},{"location":"ltapi/class_i_wi_fi_u_d_p/#function-iwifiudp_1","title":"function ~IWiFiUDP","text":"
inline IWiFiUDP::~IWiFiUDP () \n

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiUdp/WiFiUdp.h

"},{"location":"ltapi/class_libre_tiny/","title":"Class LibreTiny","text":"

ClassList > LibreTiny

Main LibreTiny API class.More...

  • #include <LT.h>
"},{"location":"ltapi/class_libre_tiny/#public-functions","title":"Public Functions","text":"Type Name const char * getBoard () Get board code. const char * getChipCoreType () Get CPU core type name as string. uint8_t getChipCores () Get CPU core count. ChipFamily getChipFamily () Get CPU family ID (as lt_cpu_family_t enum member). const char * getChipFamilyName () Get CPU family name as string. uint32_t getChipId () Get CPU ID based on the last three octets of MAC address. Note: the number is 24-bit (with the MSB being zero). The 3rd-to-last octet is least-significant, the last octet is most-significant. const char * getChipModel () Get CPU model name as string (uppercase). ChipType getChipType () Get CPU model ID (as lt_cpu_model_t enum member). uint32_t getCpuFreq () Get CPU frequency in Hz. uint32_t getCpuFreqMHz () Get CPU frequency in MHz. uint32_t getCycleCount () Get CPU cycle count. const char * getDeviceName () Get device friendly name in format \"LT-<chip model>-<MAC ID>\". Can be used as hostname. FlashId getFlashChipId () Read flash chip ID and return a lt_flash_id_t struct. uint32_t getFlashChipSize () Get flash chip total size. uint32_t getFreeHeap () Get free heap size. uint32_t getHeapSize () Get total heap size. uint32_t getMaxAllocHeap () Get largest block of heap that can be allocated at once. uint32_t getMaxFreeBlockSize () Get largest block of heap that can be allocated at once. uint32_t getMinFreeHeap () Get lowest level of free heap memory. uint32_t getRamSize () Get total RAM size. ResetReason getResetReason () Get the reason of last chip reboot. const char * getResetReasonName (ResetReason reason=lt_get_reboot_reason()) Get a textual representation of a reboot reason. const char * getVersion () Reset reason enumeration. void gpioRecover () Reconfigure GPIO pins used for debugging (SWD/JTAG), so that they can be used as normal I/O. void restart () Reboot the CPU. void restartDownloadMode () Reboot the CPU and stay in download mode (if possible)."},{"location":"ltapi/class_libre_tiny/#detailed-description","title":"Detailed Description","text":"

Since v1.0.0, this class only consists of inline functions, which wrap the LibreTiny C API (lt_api.h). Refer to the docs of the C API for more information.

The class is accessible using the LT global object.

"},{"location":"ltapi/class_libre_tiny/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/class_libre_tiny/#function-getboard","title":"function getBoard","text":"
inline const char * LibreTiny::getBoard () \n
"},{"location":"ltapi/class_libre_tiny/#function-getchipcoretype","title":"function getChipCoreType","text":"
inline const char * LibreTiny::getChipCoreType () \n
"},{"location":"ltapi/class_libre_tiny/#function-getchipcores","title":"function getChipCores","text":"
inline uint8_t LibreTiny::getChipCores () \n
"},{"location":"ltapi/class_libre_tiny/#function-getchipfamily","title":"function getChipFamily","text":"
inline ChipFamily LibreTiny::getChipFamily () \n
"},{"location":"ltapi/class_libre_tiny/#function-getchipfamilyname","title":"function getChipFamilyName","text":"
inline const char * LibreTiny::getChipFamilyName () \n
"},{"location":"ltapi/class_libre_tiny/#function-getchipid","title":"function getChipId","text":"
inline uint32_t LibreTiny::getChipId () \n
"},{"location":"ltapi/class_libre_tiny/#function-getchipmodel","title":"function getChipModel","text":"
inline const char * LibreTiny::getChipModel () \n
"},{"location":"ltapi/class_libre_tiny/#function-getchiptype","title":"function getChipType","text":"
inline ChipType LibreTiny::getChipType () \n
"},{"location":"ltapi/class_libre_tiny/#function-getcpufreq","title":"function getCpuFreq","text":"
inline uint32_t LibreTiny::getCpuFreq () \n
"},{"location":"ltapi/class_libre_tiny/#function-getcpufreqmhz","title":"function getCpuFreqMHz","text":"
inline uint32_t LibreTiny::getCpuFreqMHz () \n
"},{"location":"ltapi/class_libre_tiny/#function-getcyclecount","title":"function getCycleCount","text":"
inline uint32_t LibreTiny::getCycleCount () \n
"},{"location":"ltapi/class_libre_tiny/#function-getdevicename","title":"function getDeviceName","text":"
inline const char * LibreTiny::getDeviceName () \n
"},{"location":"ltapi/class_libre_tiny/#function-getflashchipid","title":"function getFlashChipId","text":"
inline FlashId LibreTiny::getFlashChipId () \n
"},{"location":"ltapi/class_libre_tiny/#function-getflashchipsize","title":"function getFlashChipSize","text":"

Get flash chip total size.

inline uint32_t LibreTiny::getFlashChipSize () \n

The default implementation uses the least significant byte of the chip ID to determine the size.

"},{"location":"ltapi/class_libre_tiny/#function-getfreeheap","title":"function getFreeHeap","text":"
inline uint32_t LibreTiny::getFreeHeap () \n
"},{"location":"ltapi/class_libre_tiny/#function-getheapsize","title":"function getHeapSize","text":"
inline uint32_t LibreTiny::getHeapSize () \n
"},{"location":"ltapi/class_libre_tiny/#function-getmaxallocheap","title":"function getMaxAllocHeap","text":"
inline uint32_t LibreTiny::getMaxAllocHeap () \n
"},{"location":"ltapi/class_libre_tiny/#function-getmaxfreeblocksize","title":"function getMaxFreeBlockSize","text":"
inline uint32_t LibreTiny::getMaxFreeBlockSize () \n
"},{"location":"ltapi/class_libre_tiny/#function-getminfreeheap","title":"function getMinFreeHeap","text":"
inline uint32_t LibreTiny::getMinFreeHeap () \n
"},{"location":"ltapi/class_libre_tiny/#function-getramsize","title":"function getRamSize","text":"
inline uint32_t LibreTiny::getRamSize () \n
"},{"location":"ltapi/class_libre_tiny/#function-getresetreason","title":"function getResetReason","text":"
inline ResetReason LibreTiny::getResetReason () \n
"},{"location":"ltapi/class_libre_tiny/#function-getresetreasonname","title":"function getResetReasonName","text":"

Get a textual representation of a reboot reason.

inline const char * LibreTiny::getResetReasonName (\n    ResetReason reason=lt_get_reboot_reason()\n) \n

Parameters:

  • reason value to convert to text, pass 0 to read from lt_reboot_get_reason()
"},{"location":"ltapi/class_libre_tiny/#function-getversion","title":"function getVersion","text":"
inline const char * LibreTiny::getVersion () \n
"},{"location":"ltapi/class_libre_tiny/#function-gpiorecover","title":"function gpioRecover","text":"
inline void LibreTiny::gpioRecover () \n
"},{"location":"ltapi/class_libre_tiny/#function-restart","title":"function restart","text":"
inline void LibreTiny::restart () \n
"},{"location":"ltapi/class_libre_tiny/#function-restartdownloadmode","title":"function restartDownloadMode","text":"

Reboot the CPU and stay in download mode (if possible).

inline void LibreTiny::restartDownloadMode () \n

Returns:

whether download-mode reboot is possible

The documentation for this class was generated from the following file cores/common/arduino/libraries/inline/LT/LT.h

"},{"location":"ltapi/class_libre_tiny_o_t_a/","title":"Class LibreTinyOTA","text":"

ClassList > LibreTinyOTA

Over-the-Air updates helper class. More...

  • #include <OTA.h>
"},{"location":"ltapi/class_libre_tiny_o_t_a/#public-functions","title":"Public Functions","text":"Type Name bool canRollback () Check if OTA rollback is possible (switching the stored index to another partition). uint8_t getCurrentIndex () Get the currently running firmware's OTA index. uint8_t getStoredIndex () Read the currently active OTA index, i.e. the one that will boot upon restart. lt_ota_type_t getType () Get OTA type of the device's chip. uf2_ota_scheme_t getUF2Scheme () Check which UF2 OTA scheme should be used for applying firmware updates. bool isValid (uint8_t index) Check if the specified OTA image is valid. bool switchImage (bool revert=false) Try to switch OTA index to the other image. For single-OTA chips, only check if the upgrade image is valid."},{"location":"ltapi/class_libre_tiny_o_t_a/#detailed-description","title":"Detailed Description","text":"

This class only consists of inline functions, which wrap the LibreTiny C API (lt_api.h). Refer to the docs of the C API for more information.

The class is accessible using the OTA global object.

"},{"location":"ltapi/class_libre_tiny_o_t_a/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/class_libre_tiny_o_t_a/#function-canrollback","title":"function canRollback","text":"

Check if OTA rollback is possible (switching the stored index to another partition).

inline bool LibreTinyOTA::canRollback () \n

Note that this is not the same as \"switching\" OTA with revert=true.

Returns:

true if 2nd image is valid and the chip is dual-OTA; false otherwise

"},{"location":"ltapi/class_libre_tiny_o_t_a/#function-getcurrentindex","title":"function getCurrentIndex","text":"

Get the currently running firmware's OTA index.

inline uint8_t LibreTinyOTA::getCurrentIndex () \n

Returns:

OTA index if dual-OTA is supported, 0 otherwise

"},{"location":"ltapi/class_libre_tiny_o_t_a/#function-getstoredindex","title":"function getStoredIndex","text":"

Read the currently active OTA index, i.e. the one that will boot upon restart.

inline uint8_t LibreTinyOTA::getStoredIndex () \n

Returns:

OTA index if dual-OTA is supported, 0 otherwise

"},{"location":"ltapi/class_libre_tiny_o_t_a/#function-gettype","title":"function getType","text":"
inline lt_ota_type_t LibreTinyOTA::getType () \n
"},{"location":"ltapi/class_libre_tiny_o_t_a/#function-getuf2scheme","title":"function getUF2Scheme","text":"

Check which UF2 OTA scheme should be used for applying firmware updates.

inline uf2_ota_scheme_t LibreTinyOTA::getUF2Scheme () \n

Returns:

OTA scheme of the target partition

"},{"location":"ltapi/class_libre_tiny_o_t_a/#function-isvalid","title":"function isValid","text":"

Check if the specified OTA image is valid.

inline bool LibreTinyOTA::isValid (\n    uint8_t index\n) \n

Parameters:

  • index OTA index to check; 0 for single-OTA chips, 1 or 2 for dual-OTA chips

Returns:

true if index is valid for the chip's OTA type, and there is a valid image; false otherwise

"},{"location":"ltapi/class_libre_tiny_o_t_a/#function-switchimage","title":"function switchImage","text":"

Try to switch OTA index to the other image. For single-OTA chips, only check if the upgrade image is valid.

inline bool LibreTinyOTA::switchImage (\n    bool revert=false\n) \n

This can be used to \"activate\" the upgrade after flashing.

Parameters:

  • revert switch if (and only if) the other image is already marked as active (i.e. switch back to the running image)

Returns:

false if the second image (or upgrade image) is not valid; false if writing failed; true otherwise

The documentation for this class was generated from the following file cores/common/arduino/libraries/inline/OTA/OTA.h

"},{"location":"ltapi/class_libre_tiny_w_d_t/","title":"Class LibreTinyWDT","text":"

ClassList > LibreTinyWDT

Watchdog control class. More...

  • #include <WDT.h>
"},{"location":"ltapi/class_libre_tiny_w_d_t/#public-functions","title":"Public Functions","text":"Type Name void disable () Disable the hardware watchdog. bool enable (uint32_t timeout=10000) Enable the hardware watchdog. void feed () Feed/reset the hardware watchdog timer."},{"location":"ltapi/class_libre_tiny_w_d_t/#detailed-description","title":"Detailed Description","text":"

This class only consists of inline functions, which wrap the LibreTiny C API (lt_api.h). Refer to the docs of the C API for more information.

The class is accessible using the WDT global object.

"},{"location":"ltapi/class_libre_tiny_w_d_t/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/class_libre_tiny_w_d_t/#function-disable","title":"function disable","text":"
inline void LibreTinyWDT::disable () \n
"},{"location":"ltapi/class_libre_tiny_w_d_t/#function-enable","title":"function enable","text":"

Enable the hardware watchdog.

inline bool LibreTinyWDT::enable (\n    uint32_t timeout=10000\n) \n

Parameters:

  • timeout watchdog timeout, milliseconds

Returns:

whether the chip has a hardware watchdog

"},{"location":"ltapi/class_libre_tiny_w_d_t/#function-feed","title":"function feed","text":"
inline void LibreTinyWDT::feed () \n

The documentation for this class was generated from the following file cores/common/arduino/libraries/inline/WDT/WDT.h

"},{"location":"ltapi/class_lw_i_p_client/","title":"Class LwIPClient","text":"

ClassList > LwIPClient

Inherits the following classes: IWiFiClient

Inherited by the following classes: MbedTLSClient

"},{"location":"ltapi/class_lw_i_p_client/#public-functions","title":"Public Functions","text":"Type Name LwIPClient () LwIPClient (int sock) int available () int connect (IPAddress ip, uint16_t port) int connect (const char * host, uint16_t port) virtual int connect (IPAddress ip, uint16_t port, int32_t timeout) virtual int connect (const char * host, uint16_t port, int32_t timeout) uint8_t connected () virtual int fd () const void flush () virtual IPAddress localIP () const virtual IPAddress localIP (int sock) const virtual uint16_t localPort () const virtual uint16_t localPort (int sock) const LwIPClient & operator= (const LwIPClient & other) int peek () int read () int read (uint8_t * buf, size_t size) virtual IPAddress remoteIP () const virtual IPAddress remoteIP (int sock) const virtual uint16_t remotePort () const virtual uint16_t remotePort (int sock) const virtual int setTimeout (uint32_t seconds) virtual int socket () void stop () size_t write (uint8_t data) size_t write (const uint8_t * buf, size_t size) virtual size_t write (Stream & stream) ~LwIPClient ()"},{"location":"ltapi/class_lw_i_p_client/#public-functions-inherited-from-iwificlient","title":"Public Functions inherited from IWiFiClient","text":"

See IWiFiClient

Type Name IWiFiClient () IWiFiClient (int sock) virtual int connect (IPAddress ip, uint16_t port, int32_t timeout) = 0 virtual int connect (const char * host, uint16_t port, int32_t timeout) = 0 virtual int fd () const = 0 virtual IPAddress localIP () const = 0 virtual IPAddress localIP (int sock) const = 0 virtual uint16_t localPort () const = 0 virtual uint16_t localPort (int sock) const = 0 operator bool () virtual bool operator!= (const bool value) virtual bool operator!= (const IWiFiClient & other) bool operator== (const IWiFiClient & other) const virtual bool operator== (const bool value) virtual IPAddress remoteIP () const = 0 virtual IPAddress remoteIP (int sock) const = 0 virtual uint16_t remotePort () const = 0 virtual uint16_t remotePort (int sock) const = 0 virtual int setTimeout (uint32_t seconds) = 0 virtual int socket () = 0 virtual size_t write (Stream & stream) = 0 size_t write_P (PGM_P buffer, size_t size) ~IWiFiClient ()"},{"location":"ltapi/class_lw_i_p_client/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/class_lw_i_p_client/#function-lwipclient-12","title":"function LwIPClient [1/2]","text":"
LwIPClient::LwIPClient () \n
"},{"location":"ltapi/class_lw_i_p_client/#function-lwipclient-22","title":"function LwIPClient [2/2]","text":"
LwIPClient::LwIPClient (\n    int sock\n) \n
"},{"location":"ltapi/class_lw_i_p_client/#function-available","title":"function available","text":"
int LwIPClient::available () \n
"},{"location":"ltapi/class_lw_i_p_client/#function-connect-14","title":"function connect [1/4]","text":"
int LwIPClient::connect (\n    IPAddress ip,\n    uint16_t port\n) \n
"},{"location":"ltapi/class_lw_i_p_client/#function-connect-24","title":"function connect [2/4]","text":"
int LwIPClient::connect (\n    const char * host,\n    uint16_t port\n) \n
"},{"location":"ltapi/class_lw_i_p_client/#function-connect-34","title":"function connect [3/4]","text":"
virtual int LwIPClient::connect (\n    IPAddress ip,\n    uint16_t port,\n    int32_t timeout\n) \n

Implements IWiFiClient::connect

"},{"location":"ltapi/class_lw_i_p_client/#function-connect-44","title":"function connect [4/4]","text":"
virtual int LwIPClient::connect (\n    const char * host,\n    uint16_t port,\n    int32_t timeout\n) \n

Implements IWiFiClient::connect

"},{"location":"ltapi/class_lw_i_p_client/#function-connected","title":"function connected","text":"
uint8_t LwIPClient::connected () \n
"},{"location":"ltapi/class_lw_i_p_client/#function-fd","title":"function fd","text":"
virtual int LwIPClient::fd () const\n

Implements IWiFiClient::fd

"},{"location":"ltapi/class_lw_i_p_client/#function-flush","title":"function flush","text":"
void LwIPClient::flush () \n
"},{"location":"ltapi/class_lw_i_p_client/#function-localip-12","title":"function localIP [1/2]","text":"
virtual IPAddress LwIPClient::localIP () const\n

Implements IWiFiClient::localIP

"},{"location":"ltapi/class_lw_i_p_client/#function-localip-22","title":"function localIP [2/2]","text":"
virtual IPAddress LwIPClient::localIP (\n    int sock\n) const\n

Implements IWiFiClient::localIP

"},{"location":"ltapi/class_lw_i_p_client/#function-localport-12","title":"function localPort [1/2]","text":"
virtual uint16_t LwIPClient::localPort () const\n

Implements IWiFiClient::localPort

"},{"location":"ltapi/class_lw_i_p_client/#function-localport-22","title":"function localPort [2/2]","text":"
virtual uint16_t LwIPClient::localPort (\n    int sock\n) const\n

Implements IWiFiClient::localPort

"},{"location":"ltapi/class_lw_i_p_client/#function-operator","title":"function operator=","text":"
LwIPClient & LwIPClient::operator= (\n    const LwIPClient & other\n) \n
"},{"location":"ltapi/class_lw_i_p_client/#function-peek","title":"function peek","text":"
int LwIPClient::peek () \n
"},{"location":"ltapi/class_lw_i_p_client/#function-read-12","title":"function read [1/2]","text":"
int LwIPClient::read () \n
"},{"location":"ltapi/class_lw_i_p_client/#function-read-22","title":"function read [2/2]","text":"
int LwIPClient::read (\n    uint8_t * buf,\n    size_t size\n) \n
"},{"location":"ltapi/class_lw_i_p_client/#function-remoteip-12","title":"function remoteIP [1/2]","text":"
virtual IPAddress LwIPClient::remoteIP () const\n

Implements IWiFiClient::remoteIP

"},{"location":"ltapi/class_lw_i_p_client/#function-remoteip-22","title":"function remoteIP [2/2]","text":"
virtual IPAddress LwIPClient::remoteIP (\n    int sock\n) const\n

Implements IWiFiClient::remoteIP

"},{"location":"ltapi/class_lw_i_p_client/#function-remoteport-12","title":"function remotePort [1/2]","text":"
virtual uint16_t LwIPClient::remotePort () const\n

Implements IWiFiClient::remotePort

"},{"location":"ltapi/class_lw_i_p_client/#function-remoteport-22","title":"function remotePort [2/2]","text":"
virtual uint16_t LwIPClient::remotePort (\n    int sock\n) const\n

Implements IWiFiClient::remotePort

"},{"location":"ltapi/class_lw_i_p_client/#function-settimeout","title":"function setTimeout","text":"
virtual int LwIPClient::setTimeout (\n    uint32_t seconds\n) \n

Implements IWiFiClient::setTimeout

"},{"location":"ltapi/class_lw_i_p_client/#function-socket","title":"function socket","text":"
virtual int LwIPClient::socket () \n

Implements IWiFiClient::socket

"},{"location":"ltapi/class_lw_i_p_client/#function-stop","title":"function stop","text":"
void LwIPClient::stop () \n
"},{"location":"ltapi/class_lw_i_p_client/#function-write-13","title":"function write [1/3]","text":"
size_t LwIPClient::write (\n    uint8_t data\n) \n
"},{"location":"ltapi/class_lw_i_p_client/#function-write-23","title":"function write [2/3]","text":"
size_t LwIPClient::write (\n    const uint8_t * buf,\n    size_t size\n) \n
"},{"location":"ltapi/class_lw_i_p_client/#function-write-33","title":"function write [3/3]","text":"
virtual size_t LwIPClient::write (\n    Stream & stream\n) \n

Implements IWiFiClient::write

"},{"location":"ltapi/class_lw_i_p_client/#function-lwipclient","title":"function ~LwIPClient","text":"
LwIPClient::~LwIPClient () \n

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiClient/LwIPClient.h

"},{"location":"ltapi/class_lw_i_p_rx_buffer/","title":"Class LwIPRxBuffer","text":"

ClassList > LwIPRxBuffer

"},{"location":"ltapi/class_lw_i_p_rx_buffer/#public-functions","title":"Public Functions","text":"Type Name LwIPRxBuffer (int sock, size_t size=1436) size_t available () bool failed () int peek () int read (uint8_t * dst, size_t len) ~LwIPRxBuffer ()"},{"location":"ltapi/class_lw_i_p_rx_buffer/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/class_lw_i_p_rx_buffer/#function-lwiprxbuffer","title":"function LwIPRxBuffer","text":"
LwIPRxBuffer::LwIPRxBuffer (\n    int sock,\n    size_t size=1436\n) \n
"},{"location":"ltapi/class_lw_i_p_rx_buffer/#function-available","title":"function available","text":"
size_t LwIPRxBuffer::available () \n
"},{"location":"ltapi/class_lw_i_p_rx_buffer/#function-failed","title":"function failed","text":"
bool LwIPRxBuffer::failed () \n
"},{"location":"ltapi/class_lw_i_p_rx_buffer/#function-peek","title":"function peek","text":"
int LwIPRxBuffer::peek () \n
"},{"location":"ltapi/class_lw_i_p_rx_buffer/#function-read","title":"function read","text":"
int LwIPRxBuffer::read (\n    uint8_t * dst,\n    size_t len\n) \n
"},{"location":"ltapi/class_lw_i_p_rx_buffer/#function-lwiprxbuffer_1","title":"function ~LwIPRxBuffer","text":"
LwIPRxBuffer::~LwIPRxBuffer () \n

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiClient/LwIPRxBuffer.h

"},{"location":"ltapi/class_lw_i_p_server/","title":"Class LwIPServer","text":"

ClassList > LwIPServer

Inherits the following classes: IWiFiServer

"},{"location":"ltapi/class_lw_i_p_server/#public-functions","title":"Public Functions","text":"Type Name LwIPServer (uint16_t port=80, uint8_t maxClients=4) LwIPServer (int port=80, uint8_t maxClients=4) LwIPServer (const IPAddress & addr, uint16_t port=80, uint8_t maxClients=4) virtual WiFiClient accept () virtual bool begin (uint16_t port=0, bool reuseAddr=true) virtual void end () virtual bool getNoDelay () virtual bool hasClient () virtual operator bool () virtual void setNoDelay (bool noDelay) virtual int setTimeout (uint32_t seconds) virtual void stopAll () size_t write (const uint8_t * buffer, size_t size)"},{"location":"ltapi/class_lw_i_p_server/#public-functions-inherited-from-iwifiserver","title":"Public Functions inherited from IWiFiServer","text":"

See IWiFiServer

Type Name IWiFiServer (uint16_t port=80, uint8_t maxClients=4) IWiFiServer (const IPAddress & addr, uint16_t port=80, uint8_t maxClients=4) virtual TWiFiClient accept () = 0 TWiFiClient available () virtual bool begin (uint16_t port=0, bool reuseAddr=true) = 0 void close () virtual void end () = 0 virtual bool getNoDelay () = 0 virtual bool hasClient () = 0 void listenOnLocalhost () virtual operator bool () = 0 virtual void setNoDelay (bool noDelay) = 0 virtual int setTimeout (uint32_t seconds) = 0 void stop () virtual void stopAll () = 0 size_t write (uint8_t data) ~IWiFiServer ()"},{"location":"ltapi/class_lw_i_p_server/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/class_lw_i_p_server/#function-lwipserver-24","title":"function LwIPServer [2/4]","text":"
inline LwIPServer::LwIPServer (\n    uint16_t port=80,\n    uint8_t maxClients=4\n) \n
"},{"location":"ltapi/class_lw_i_p_server/#function-lwipserver-34","title":"function LwIPServer [3/4]","text":"
inline LwIPServer::LwIPServer (\n    int port=80,\n    uint8_t maxClients=4\n) \n
"},{"location":"ltapi/class_lw_i_p_server/#function-lwipserver-44","title":"function LwIPServer [4/4]","text":"
inline LwIPServer::LwIPServer (\n    const IPAddress & addr,\n    uint16_t port=80,\n    uint8_t maxClients=4\n) \n
"},{"location":"ltapi/class_lw_i_p_server/#function-accept","title":"function accept","text":"
virtual WiFiClient LwIPServer::accept () \n

Implements IWiFiServer::accept

"},{"location":"ltapi/class_lw_i_p_server/#function-begin","title":"function begin","text":"
virtual bool LwIPServer::begin (\n    uint16_t port=0,\n    bool reuseAddr=true\n) \n

Implements IWiFiServer::begin

"},{"location":"ltapi/class_lw_i_p_server/#function-end","title":"function end","text":"
virtual void LwIPServer::end () \n

Implements IWiFiServer::end

"},{"location":"ltapi/class_lw_i_p_server/#function-getnodelay","title":"function getNoDelay","text":"
virtual bool LwIPServer::getNoDelay () \n

Implements IWiFiServer::getNoDelay

"},{"location":"ltapi/class_lw_i_p_server/#function-hasclient","title":"function hasClient","text":"
virtual bool LwIPServer::hasClient () \n

Implements IWiFiServer::hasClient

"},{"location":"ltapi/class_lw_i_p_server/#function-operator-bool","title":"function operator bool","text":"
virtual LwIPServer::operator bool () \n

Implements IWiFiServer::operator bool

"},{"location":"ltapi/class_lw_i_p_server/#function-setnodelay","title":"function setNoDelay","text":"
virtual void LwIPServer::setNoDelay (\n    bool noDelay\n) \n

Implements IWiFiServer::setNoDelay

"},{"location":"ltapi/class_lw_i_p_server/#function-settimeout","title":"function setTimeout","text":"
virtual int LwIPServer::setTimeout (\n    uint32_t seconds\n) \n

Implements IWiFiServer::setTimeout

"},{"location":"ltapi/class_lw_i_p_server/#function-stopall","title":"function stopAll","text":"
inline virtual void LwIPServer::stopAll () \n

Implements IWiFiServer::stopAll

"},{"location":"ltapi/class_lw_i_p_server/#function-write","title":"function write","text":"
inline size_t LwIPServer::write (\n    const uint8_t * buffer,\n    size_t size\n) \n

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiServer/LwIPServer.h

"},{"location":"ltapi/class_lw_i_p_u_d_p/","title":"Class LwIPUDP","text":"

ClassList > LwIPUDP

Inherits the following classes: IWiFiUDP

"},{"location":"ltapi/class_lw_i_p_u_d_p/#public-functions","title":"Public Functions","text":"Type Name LwIPUDP () virtual int available () virtual uint8_t begin (IPAddress ip, uint16_t port) virtual uint8_t begin (uint16_t port) virtual uint8_t beginMulticast (IPAddress ip, uint16_t port) virtual int beginMulticastPacket () virtual int beginPacket () virtual int beginPacket (IPAddress ip, uint16_t port) virtual int beginPacket (const char * host, uint16_t port) virtual int endPacket () virtual void flush () virtual int parsePacket () virtual int peek () virtual int read () virtual int read (unsigned char * buffer, size_t len) virtual int read (char * buffer, size_t len) virtual IPAddress remoteIP () virtual uint16_t remotePort () virtual void stop () virtual size_t write (uint8_t) virtual size_t write (const uint8_t * buffer, size_t size) ~LwIPUDP ()"},{"location":"ltapi/class_lw_i_p_u_d_p/#public-functions-inherited-from-iwifiudp","title":"Public Functions inherited from IWiFiUDP","text":"

See IWiFiUDP

Type Name IWiFiUDP () virtual int available () = 0 virtual uint8_t begin (IPAddress ip, uint16_t port) = 0 virtual uint8_t begin (uint16_t port) = 0 virtual uint8_t beginMulticast (IPAddress ip, uint16_t port) = 0 virtual int beginMulticastPacket () = 0 virtual int beginPacket () = 0 virtual int beginPacket (IPAddress ip, uint16_t port) = 0 virtual int beginPacket (const char * host, uint16_t port) = 0 virtual int endPacket () = 0 virtual void flush () = 0 virtual int parsePacket () = 0 virtual int peek () = 0 virtual int read () = 0 virtual int read (unsigned char * buffer, size_t len) = 0 virtual int read (char * buffer, size_t len) = 0 virtual IPAddress remoteIP () = 0 virtual uint16_t remotePort () = 0 virtual void stop () = 0 virtual size_t write (uint8_t) = 0 virtual size_t write (const uint8_t * buffer, size_t size) = 0 ~IWiFiUDP ()"},{"location":"ltapi/class_lw_i_p_u_d_p/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/class_lw_i_p_u_d_p/#function-lwipudp","title":"function LwIPUDP","text":"
LwIPUDP::LwIPUDP () \n
"},{"location":"ltapi/class_lw_i_p_u_d_p/#function-available","title":"function available","text":"
virtual int LwIPUDP::available () \n

Implements IWiFiUDP::available

"},{"location":"ltapi/class_lw_i_p_u_d_p/#function-begin-12","title":"function begin [1/2]","text":"
virtual uint8_t LwIPUDP::begin (\n    IPAddress ip,\n    uint16_t port\n) \n

Implements IWiFiUDP::begin

"},{"location":"ltapi/class_lw_i_p_u_d_p/#function-begin-22","title":"function begin [2/2]","text":"
virtual uint8_t LwIPUDP::begin (\n    uint16_t port\n) \n

Implements IWiFiUDP::begin

"},{"location":"ltapi/class_lw_i_p_u_d_p/#function-beginmulticast","title":"function beginMulticast","text":"
virtual uint8_t LwIPUDP::beginMulticast (\n    IPAddress ip,\n    uint16_t port\n) \n

Implements IWiFiUDP::beginMulticast

"},{"location":"ltapi/class_lw_i_p_u_d_p/#function-beginmulticastpacket","title":"function beginMulticastPacket","text":"
virtual int LwIPUDP::beginMulticastPacket () \n

Implements IWiFiUDP::beginMulticastPacket

"},{"location":"ltapi/class_lw_i_p_u_d_p/#function-beginpacket-13","title":"function beginPacket [1/3]","text":"
virtual int LwIPUDP::beginPacket () \n

Implements IWiFiUDP::beginPacket

"},{"location":"ltapi/class_lw_i_p_u_d_p/#function-beginpacket-23","title":"function beginPacket [2/3]","text":"
virtual int LwIPUDP::beginPacket (\n    IPAddress ip,\n    uint16_t port\n) \n

Implements IWiFiUDP::beginPacket

"},{"location":"ltapi/class_lw_i_p_u_d_p/#function-beginpacket-33","title":"function beginPacket [3/3]","text":"
virtual int LwIPUDP::beginPacket (\n    const char * host,\n    uint16_t port\n) \n

Implements IWiFiUDP::beginPacket

"},{"location":"ltapi/class_lw_i_p_u_d_p/#function-endpacket","title":"function endPacket","text":"
virtual int LwIPUDP::endPacket () \n

Implements IWiFiUDP::endPacket

"},{"location":"ltapi/class_lw_i_p_u_d_p/#function-flush","title":"function flush","text":"
virtual void LwIPUDP::flush () \n

Implements IWiFiUDP::flush

"},{"location":"ltapi/class_lw_i_p_u_d_p/#function-parsepacket","title":"function parsePacket","text":"
virtual int LwIPUDP::parsePacket () \n

Implements IWiFiUDP::parsePacket

"},{"location":"ltapi/class_lw_i_p_u_d_p/#function-peek","title":"function peek","text":"
virtual int LwIPUDP::peek () \n

Implements IWiFiUDP::peek

"},{"location":"ltapi/class_lw_i_p_u_d_p/#function-read-13","title":"function read [1/3]","text":"
virtual int LwIPUDP::read () \n

Implements IWiFiUDP::read

"},{"location":"ltapi/class_lw_i_p_u_d_p/#function-read-23","title":"function read [2/3]","text":"
virtual int LwIPUDP::read (\n    unsigned char * buffer,\n    size_t len\n) \n

Implements IWiFiUDP::read

"},{"location":"ltapi/class_lw_i_p_u_d_p/#function-read-33","title":"function read [3/3]","text":"
virtual int LwIPUDP::read (\n    char * buffer,\n    size_t len\n) \n

Implements IWiFiUDP::read

"},{"location":"ltapi/class_lw_i_p_u_d_p/#function-remoteip","title":"function remoteIP","text":"
virtual IPAddress LwIPUDP::remoteIP () \n

Implements IWiFiUDP::remoteIP

"},{"location":"ltapi/class_lw_i_p_u_d_p/#function-remoteport","title":"function remotePort","text":"
virtual uint16_t LwIPUDP::remotePort () \n

Implements IWiFiUDP::remotePort

"},{"location":"ltapi/class_lw_i_p_u_d_p/#function-stop","title":"function stop","text":"
virtual void LwIPUDP::stop () \n

Implements IWiFiUDP::stop

"},{"location":"ltapi/class_lw_i_p_u_d_p/#function-write-12","title":"function write [1/2]","text":"
virtual size_t LwIPUDP::write (\n    uint8_t\n) \n

Implements IWiFiUDP::write

"},{"location":"ltapi/class_lw_i_p_u_d_p/#function-write-22","title":"function write [2/2]","text":"
virtual size_t LwIPUDP::write (\n    const uint8_t * buffer,\n    size_t size\n) \n

Implements IWiFiUDP::write

"},{"location":"ltapi/class_lw_i_p_u_d_p/#function-lwipudp_1","title":"function ~LwIPUDP","text":"
LwIPUDP::~LwIPUDP () \n

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiUdp/LwIPUdp.h

"},{"location":"ltapi/struct_m_d5_context/","title":"Struct MD5Context","text":"

ClassList > MD5Context

"},{"location":"ltapi/struct_m_d5_context/#public-attributes","title":"Public Attributes","text":"Type Name unsigned long bits unsigned long buf unsigned char in"},{"location":"ltapi/struct_m_d5_context/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/struct_m_d5_context/#variable-bits","title":"variable bits","text":"
unsigned long MD5Context::bits[2];\n
"},{"location":"ltapi/struct_m_d5_context/#variable-buf","title":"variable buf","text":"
unsigned long MD5Context::buf[4];\n
"},{"location":"ltapi/struct_m_d5_context/#variable-in","title":"variable in","text":"
unsigned char MD5Context::in[64];\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/MD5/MD5HostapdImpl.h

"},{"location":"ltapi/class_mbed_t_l_s_client/","title":"Class MbedTLSClient","text":"

ClassList > MbedTLSClient

Inherits the following classes: LwIPClient, IWiFiClientSecure

"},{"location":"ltapi/class_mbed_t_l_s_client/#public-functions","title":"Public Functions","text":"Type Name MbedTLSClient () MbedTLSClient (int sock) int available () virtual int connect (IPAddress ip, uint16_t port, int32_t timeout) virtual int connect (const char * host, uint16_t port, int32_t timeout) virtual int connect (IPAddress ip, uint16_t port, const char * rootCABuf, const char * clientCert, const char * clientKey) virtual int connect (const char * host, uint16_t port, const char * rootCABuf, const char * clientCert, const char * clientKey) virtual int connect (IPAddress ip, uint16_t port, const char * pskIdent, const char * psk) virtual int connect (const char * host, uint16_t port, const char * pskIdent, const char * psk) int connect (IPAddress ip, uint16_t port) int connect (const char * host, uint16_t port) virtual int connect (IPAddress ip, uint16_t port, int32_t timeout) virtual int connect (const char * host, uint16_t port, int32_t timeout) void flush () virtual bool getFingerprintSHA256 (uint8_t result) virtual int lastError (char * buf, const size_t size) virtual bool loadCACert (Stream & stream, size_t size) virtual bool loadCertificate (Stream & stream, size_t size) virtual bool loadPrivateKey (Stream & stream, size_t size) int peek () int read (uint8_t * buf, size_t size) int read () int read (uint8_t * buf, size_t size) virtual void setAlpnProtocols (const char ** alpnProtocols) virtual void setCACert (const char * rootCA) virtual void setCertificate (const char * clientCA) virtual void setHandshakeTimeout (unsigned long handshakeTimeout) virtual void setInsecure () virtual void setPreSharedKey (const char * pskIdent, const char * psk) virtual void setPrivateKey (const char * privateKey) void stop () virtual bool verify (const char * fingerprint, const char * domainName) size_t write (const uint8_t * buf, size_t size) ~MbedTLSClient ()"},{"location":"ltapi/class_mbed_t_l_s_client/#public-functions-inherited-from-lwipclient","title":"Public Functions inherited from LwIPClient","text":"

See LwIPClient

Type Name LwIPClient () LwIPClient (int sock) int available () int connect (IPAddress ip, uint16_t port) int connect (const char * host, uint16_t port) virtual int connect (IPAddress ip, uint16_t port, int32_t timeout) virtual int connect (const char * host, uint16_t port, int32_t timeout) uint8_t connected () virtual int fd () const void flush () virtual IPAddress localIP () const virtual IPAddress localIP (int sock) const virtual uint16_t localPort () const virtual uint16_t localPort (int sock) const LwIPClient & operator= (const LwIPClient & other) int peek () int read () int read (uint8_t * buf, size_t size) virtual IPAddress remoteIP () const virtual IPAddress remoteIP (int sock) const virtual uint16_t remotePort () const virtual uint16_t remotePort (int sock) const virtual int setTimeout (uint32_t seconds) virtual int socket () void stop () size_t write (uint8_t data) size_t write (const uint8_t * buf, size_t size) virtual size_t write (Stream & stream) ~LwIPClient ()"},{"location":"ltapi/class_mbed_t_l_s_client/#public-functions-inherited-from-iwificlient","title":"Public Functions inherited from IWiFiClient","text":"

See IWiFiClient

Type Name IWiFiClient () IWiFiClient (int sock) virtual int connect (IPAddress ip, uint16_t port, int32_t timeout) = 0 virtual int connect (const char * host, uint16_t port, int32_t timeout) = 0 virtual int fd () const = 0 virtual IPAddress localIP () const = 0 virtual IPAddress localIP (int sock) const = 0 virtual uint16_t localPort () const = 0 virtual uint16_t localPort (int sock) const = 0 operator bool () virtual bool operator!= (const bool value) virtual bool operator!= (const IWiFiClient & other) bool operator== (const IWiFiClient & other) const virtual bool operator== (const bool value) virtual IPAddress remoteIP () const = 0 virtual IPAddress remoteIP (int sock) const = 0 virtual uint16_t remotePort () const = 0 virtual uint16_t remotePort (int sock) const = 0 virtual int setTimeout (uint32_t seconds) = 0 virtual int socket () = 0 virtual size_t write (Stream & stream) = 0 size_t write_P (PGM_P buffer, size_t size) ~IWiFiClient ()"},{"location":"ltapi/class_mbed_t_l_s_client/#public-functions-inherited-from-iwificlientsecure","title":"Public Functions inherited from IWiFiClientSecure","text":"

See IWiFiClientSecure

Type Name virtual int connect (IPAddress ip, uint16_t port, const char * rootCABuf, const char * clientCert, const char * clientKey) = 0 virtual int connect (const char * host, uint16_t port, const char * rootCABuf, const char * clientCert, const char * clientKey) = 0 virtual int connect (IPAddress ip, uint16_t port, const char * pskIdent, const char * psk) = 0 virtual int connect (const char * host, uint16_t port, const char * pskIdent, const char * psk) = 0 virtual bool getFingerprintSHA256 (uint8_t result) = 0 virtual int lastError (char * buf, const size_t size) = 0 virtual bool loadCACert (Stream & stream, size_t size) = 0 virtual bool loadCertificate (Stream & stream, size_t size) = 0 virtual bool loadPrivateKey (Stream & stream, size_t size) = 0 virtual void setAlpnProtocols (const char ** alpnProtocols) = 0 virtual void setCACert (const char * rootCA) = 0 virtual void setCertificate (const char * clientCA) = 0 virtual void setHandshakeTimeout (unsigned long handshakeTimeout) = 0 virtual void setInsecure () = 0 virtual void setPreSharedKey (const char * pskIdent, const char * psk) = 0 virtual void setPrivateKey (const char * privateKey) = 0 virtual bool verify (const char * fingerprint, const char * domainName) = 0"},{"location":"ltapi/class_mbed_t_l_s_client/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/class_mbed_t_l_s_client/#function-mbedtlsclient-12","title":"function MbedTLSClient [1/2]","text":"
MbedTLSClient::MbedTLSClient () \n
"},{"location":"ltapi/class_mbed_t_l_s_client/#function-mbedtlsclient-22","title":"function MbedTLSClient [2/2]","text":"
MbedTLSClient::MbedTLSClient (\n    int sock\n) \n
"},{"location":"ltapi/class_mbed_t_l_s_client/#function-available","title":"function available","text":"
int MbedTLSClient::available () \n
"},{"location":"ltapi/class_mbed_t_l_s_client/#function-connect-211","title":"function connect [2/11]","text":"
virtual int MbedTLSClient::connect (\n    IPAddress ip,\n    uint16_t port,\n    int32_t timeout\n) \n

Implements LwIPClient::connect

"},{"location":"ltapi/class_mbed_t_l_s_client/#function-connect-311","title":"function connect [3/11]","text":"
virtual int MbedTLSClient::connect (\n    const char * host,\n    uint16_t port,\n    int32_t timeout\n) \n

Implements LwIPClient::connect

"},{"location":"ltapi/class_mbed_t_l_s_client/#function-connect-411","title":"function connect [4/11]","text":"
virtual int MbedTLSClient::connect (\n    IPAddress ip,\n    uint16_t port,\n    const char * rootCABuf,\n    const char * clientCert,\n    const char * clientKey\n) \n

Implements IWiFiClientSecure::connect

"},{"location":"ltapi/class_mbed_t_l_s_client/#function-connect-511","title":"function connect [5/11]","text":"
virtual int MbedTLSClient::connect (\n    const char * host,\n    uint16_t port,\n    const char * rootCABuf,\n    const char * clientCert,\n    const char * clientKey\n) \n

Implements IWiFiClientSecure::connect

"},{"location":"ltapi/class_mbed_t_l_s_client/#function-connect-611","title":"function connect [6/11]","text":"
virtual int MbedTLSClient::connect (\n    IPAddress ip,\n    uint16_t port,\n    const char * pskIdent,\n    const char * psk\n) \n

Implements IWiFiClientSecure::connect

"},{"location":"ltapi/class_mbed_t_l_s_client/#function-connect-711","title":"function connect [7/11]","text":"
virtual int MbedTLSClient::connect (\n    const char * host,\n    uint16_t port,\n    const char * pskIdent,\n    const char * psk\n) \n

Implements IWiFiClientSecure::connect

"},{"location":"ltapi/class_mbed_t_l_s_client/#function-connect-811","title":"function connect [8/11]","text":"
int MbedTLSClient::connect (\n    IPAddress ip,\n    uint16_t port\n) \n
"},{"location":"ltapi/class_mbed_t_l_s_client/#function-connect-911","title":"function connect [9/11]","text":"
int MbedTLSClient::connect (\n    const char * host,\n    uint16_t port\n) \n
"},{"location":"ltapi/class_mbed_t_l_s_client/#function-connect-1011","title":"function connect [10/11]","text":"
virtual int MbedTLSClient::connect (\n    IPAddress ip,\n    uint16_t port,\n    int32_t timeout\n) \n

Implements LwIPClient::connect

"},{"location":"ltapi/class_mbed_t_l_s_client/#function-connect-1111","title":"function connect [11/11]","text":"
virtual int MbedTLSClient::connect (\n    const char * host,\n    uint16_t port,\n    int32_t timeout\n) \n

Implements LwIPClient::connect

"},{"location":"ltapi/class_mbed_t_l_s_client/#function-flush","title":"function flush","text":"
void MbedTLSClient::flush () \n
"},{"location":"ltapi/class_mbed_t_l_s_client/#function-getfingerprintsha256","title":"function getFingerprintSHA256","text":"
virtual bool MbedTLSClient::getFingerprintSHA256 (\n    uint8_t result\n) \n

Implements IWiFiClientSecure::getFingerprintSHA256

"},{"location":"ltapi/class_mbed_t_l_s_client/#function-lasterror","title":"function lastError","text":"
virtual int MbedTLSClient::lastError (\n    char * buf,\n    const size_t size\n) \n

Implements IWiFiClientSecure::lastError

"},{"location":"ltapi/class_mbed_t_l_s_client/#function-loadcacert","title":"function loadCACert","text":"
virtual bool MbedTLSClient::loadCACert (\n    Stream & stream,\n    size_t size\n) \n

Implements IWiFiClientSecure::loadCACert

"},{"location":"ltapi/class_mbed_t_l_s_client/#function-loadcertificate","title":"function loadCertificate","text":"
virtual bool MbedTLSClient::loadCertificate (\n    Stream & stream,\n    size_t size\n) \n

Implements IWiFiClientSecure::loadCertificate

"},{"location":"ltapi/class_mbed_t_l_s_client/#function-loadprivatekey","title":"function loadPrivateKey","text":"
virtual bool MbedTLSClient::loadPrivateKey (\n    Stream & stream,\n    size_t size\n) \n

Implements IWiFiClientSecure::loadPrivateKey

"},{"location":"ltapi/class_mbed_t_l_s_client/#function-peek","title":"function peek","text":"
int MbedTLSClient::peek () \n
"},{"location":"ltapi/class_mbed_t_l_s_client/#function-read-13","title":"function read [1/3]","text":"
int MbedTLSClient::read (\n    uint8_t * buf,\n    size_t size\n) \n
"},{"location":"ltapi/class_mbed_t_l_s_client/#function-read-23","title":"function read [2/3]","text":"
int MbedTLSClient::read () \n
"},{"location":"ltapi/class_mbed_t_l_s_client/#function-read-33","title":"function read [3/3]","text":"
int MbedTLSClient::read (\n    uint8_t * buf,\n    size_t size\n) \n
"},{"location":"ltapi/class_mbed_t_l_s_client/#function-setalpnprotocols","title":"function setAlpnProtocols","text":"
virtual void MbedTLSClient::setAlpnProtocols (\n    const char ** alpnProtocols\n) \n

Implements IWiFiClientSecure::setAlpnProtocols

"},{"location":"ltapi/class_mbed_t_l_s_client/#function-setcacert","title":"function setCACert","text":"
virtual void MbedTLSClient::setCACert (\n    const char * rootCA\n) \n

Implements IWiFiClientSecure::setCACert

"},{"location":"ltapi/class_mbed_t_l_s_client/#function-setcertificate","title":"function setCertificate","text":"
virtual void MbedTLSClient::setCertificate (\n    const char * clientCA\n) \n

Implements IWiFiClientSecure::setCertificate

"},{"location":"ltapi/class_mbed_t_l_s_client/#function-sethandshaketimeout","title":"function setHandshakeTimeout","text":"
virtual void MbedTLSClient::setHandshakeTimeout (\n    unsigned long handshakeTimeout\n) \n

Implements IWiFiClientSecure::setHandshakeTimeout

"},{"location":"ltapi/class_mbed_t_l_s_client/#function-setinsecure","title":"function setInsecure","text":"
virtual void MbedTLSClient::setInsecure () \n

Implements IWiFiClientSecure::setInsecure

"},{"location":"ltapi/class_mbed_t_l_s_client/#function-setpresharedkey","title":"function setPreSharedKey","text":"
virtual void MbedTLSClient::setPreSharedKey (\n    const char * pskIdent,\n    const char * psk\n) \n

Implements IWiFiClientSecure::setPreSharedKey

"},{"location":"ltapi/class_mbed_t_l_s_client/#function-setprivatekey","title":"function setPrivateKey","text":"
virtual void MbedTLSClient::setPrivateKey (\n    const char * privateKey\n) \n

Implements IWiFiClientSecure::setPrivateKey

"},{"location":"ltapi/class_mbed_t_l_s_client/#function-stop","title":"function stop","text":"
void MbedTLSClient::stop () \n
"},{"location":"ltapi/class_mbed_t_l_s_client/#function-verify","title":"function verify","text":"
virtual bool MbedTLSClient::verify (\n    const char * fingerprint,\n    const char * domainName\n) \n

Implements IWiFiClientSecure::verify

"},{"location":"ltapi/class_mbed_t_l_s_client/#function-write","title":"function write","text":"
size_t MbedTLSClient::write (\n    const uint8_t * buf,\n    size_t size\n) \n
"},{"location":"ltapi/class_mbed_t_l_s_client/#function-mbedtlsclient","title":"function ~MbedTLSClient","text":"
MbedTLSClient::~MbedTLSClient () \n

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiClient/MbedTLSClient.h

"},{"location":"ltapi/struct_pin_info/","title":"Struct PinInfo","text":"

ClassList > PinInfo

"},{"location":"ltapi/struct_pin_info/#public-attributes","title":"Public Attributes","text":"Type Name PinData * data Pin data (direction, IRQ level, etc.). The structure is family-specific. uint32_t enabled Enabled pin functions. Used values are family-specific. uint32_t gpio GPIO name in the family SDK. uint32_t supported Supported pin functions."},{"location":"ltapi/struct_pin_info/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/struct_pin_info/#variable-data","title":"variable data","text":"
PinData* PinInfo::data;\n
"},{"location":"ltapi/struct_pin_info/#variable-enabled","title":"variable enabled","text":"
uint32_t PinInfo::enabled;\n
"},{"location":"ltapi/struct_pin_info/#variable-gpio","title":"variable gpio","text":"
uint32_t PinInfo::gpio;\n
"},{"location":"ltapi/struct_pin_info/#variable-supported","title":"variable supported","text":"
uint32_t PinInfo::supported;\n

The documentation for this class was generated from the following file cores/common/arduino/src/wiring/wiring_custom.h

"},{"location":"ltapi/class_request_handler/","title":"Class RequestHandler","text":"

ClassList > RequestHandler

Inherited by the following classes: FunctionRequestHandler, StaticRequestHandler

"},{"location":"ltapi/class_request_handler/#public-functions","title":"Public Functions","text":"Type Name virtual bool canHandle (HTTPMethod method, String uri) virtual bool canUpload (String uri) virtual bool handle (WebServer & server, HTTPMethod requestMethod, String requestUri) RequestHandler * next () void next (RequestHandler * r) const String & pathArg (unsigned int i) virtual void upload (WebServer & server, String requestUri, HTTPUpload & upload) virtual ~RequestHandler ()"},{"location":"ltapi/class_request_handler/#protected-attributes","title":"Protected Attributes","text":"Type Name std::vector< String > pathArgs"},{"location":"ltapi/class_request_handler/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/class_request_handler/#function-canhandle","title":"function canHandle","text":"
inline virtual bool RequestHandler::canHandle (\n    HTTPMethod method,\n    String uri\n) \n
"},{"location":"ltapi/class_request_handler/#function-canupload","title":"function canUpload","text":"
inline virtual bool RequestHandler::canUpload (\n    String uri\n) \n
"},{"location":"ltapi/class_request_handler/#function-handle","title":"function handle","text":"
inline virtual bool RequestHandler::handle (\n    WebServer & server,\n    HTTPMethod requestMethod,\n    String requestUri\n) \n
"},{"location":"ltapi/class_request_handler/#function-next-12","title":"function next [1/2]","text":"
inline RequestHandler * RequestHandler::next () \n
"},{"location":"ltapi/class_request_handler/#function-next-22","title":"function next [2/2]","text":"
inline void RequestHandler::next (\n    RequestHandler * r\n) \n
"},{"location":"ltapi/class_request_handler/#function-patharg","title":"function pathArg","text":"
inline const String & RequestHandler::pathArg (\n    unsigned int i\n) \n
"},{"location":"ltapi/class_request_handler/#function-upload","title":"function upload","text":"
inline virtual void RequestHandler::upload (\n    WebServer & server,\n    String requestUri,\n    HTTPUpload & upload\n) \n
"},{"location":"ltapi/class_request_handler/#function-requesthandler","title":"function ~RequestHandler","text":"
inline virtual RequestHandler::~RequestHandler () \n
"},{"location":"ltapi/class_request_handler/#protected-attributes-documentation","title":"Protected Attributes Documentation","text":""},{"location":"ltapi/class_request_handler/#variable-pathargs","title":"variable pathArgs","text":"
std::vector<String> RequestHandler::pathArgs;\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/detail/RequestHandler.h

"},{"location":"ltapi/class_serial_class/","title":"Class SerialClass","text":"

ClassList > SerialClass

Inherits the following classes: HardwareSerial

"},{"location":"ltapi/class_serial_class/#public-attributes","title":"Public Attributes","text":"Type Name void * data"},{"location":"ltapi/class_serial_class/#public-functions","title":"Public Functions","text":"Type Name SerialClass (uint32_t port, pin_size_t rx=PIN_INVALID, pin_size_t tx=PIN_INVALID) int available () void begin (unsigned long baudrate) void begin (unsigned long baudrate, uint16_t config) void configure (unsigned long baudrate) void configure (unsigned long baudrate, uint16_t config) void end () void flush () operator bool () int peek () int read () size_t write (uint8_t c)"},{"location":"ltapi/class_serial_class/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/class_serial_class/#variable-data","title":"variable data","text":"
void* SerialClass::data;\n
"},{"location":"ltapi/class_serial_class/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/class_serial_class/#function-serialclass","title":"function SerialClass","text":"
SerialClass::SerialClass (\n    uint32_t port,\n    pin_size_t rx=PIN_INVALID,\n    pin_size_t tx=PIN_INVALID\n) \n
"},{"location":"ltapi/class_serial_class/#function-available","title":"function available","text":"
int SerialClass::available () \n
"},{"location":"ltapi/class_serial_class/#function-begin-12","title":"function begin [1/2]","text":"
inline void SerialClass::begin (\n    unsigned long baudrate\n) \n
"},{"location":"ltapi/class_serial_class/#function-begin-22","title":"function begin [2/2]","text":"
void SerialClass::begin (\n    unsigned long baudrate,\n    uint16_t config\n) \n
"},{"location":"ltapi/class_serial_class/#function-configure-12","title":"function configure [1/2]","text":"
inline void SerialClass::configure (\n    unsigned long baudrate\n) \n
"},{"location":"ltapi/class_serial_class/#function-configure-22","title":"function configure [2/2]","text":"
void SerialClass::configure (\n    unsigned long baudrate,\n    uint16_t config\n) \n
"},{"location":"ltapi/class_serial_class/#function-end","title":"function end","text":"
void SerialClass::end () \n
"},{"location":"ltapi/class_serial_class/#function-flush","title":"function flush","text":"
void SerialClass::flush () \n
"},{"location":"ltapi/class_serial_class/#function-operator-bool","title":"function operator bool","text":"
inline SerialClass::operator bool () \n
"},{"location":"ltapi/class_serial_class/#function-peek","title":"function peek","text":"
int SerialClass::peek () \n
"},{"location":"ltapi/class_serial_class/#function-read","title":"function read","text":"
int SerialClass::read () \n
"},{"location":"ltapi/class_serial_class/#function-write","title":"function write","text":"
size_t SerialClass::write (\n    uint8_t c\n) \n

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/Serial/Serial.h

"},{"location":"ltapi/struct_soft_data/","title":"Struct SoftData","text":"

ClassList > SoftData

"},{"location":"ltapi/struct_soft_data/#public-attributes","title":"Public Attributes","text":"Type Name RingBuffer * buf uint8_t byte void * param pin_size_t pin SoftState state"},{"location":"ltapi/struct_soft_data/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/struct_soft_data/#variable-buf","title":"variable buf","text":"
RingBuffer* SoftData::buf;\n
"},{"location":"ltapi/struct_soft_data/#variable-byte","title":"variable byte","text":"
uint8_t SoftData::byte;\n
"},{"location":"ltapi/struct_soft_data/#variable-param","title":"variable param","text":"
void* SoftData::param;\n
"},{"location":"ltapi/struct_soft_data/#variable-pin","title":"variable pin","text":"
pin_size_t SoftData::pin;\n
"},{"location":"ltapi/struct_soft_data/#variable-state","title":"variable state","text":"
SoftState SoftData::state;\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/SoftwareSerial/SoftwareSerial.h

"},{"location":"ltapi/struct_soft_serial/","title":"Struct SoftSerial","text":"

ClassList > SoftSerial

"},{"location":"ltapi/struct_soft_serial/#public-attributes","title":"Public Attributes","text":"Type Name uint8_t invert void * param SoftData rx SoftData tx"},{"location":"ltapi/struct_soft_serial/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/struct_soft_serial/#variable-invert","title":"variable invert","text":"
uint8_t SoftSerial::invert;\n
"},{"location":"ltapi/struct_soft_serial/#variable-param","title":"variable param","text":"
void* SoftSerial::param;\n
"},{"location":"ltapi/struct_soft_serial/#variable-rx","title":"variable rx","text":"
SoftData SoftSerial::rx;\n
"},{"location":"ltapi/struct_soft_serial/#variable-tx","title":"variable tx","text":"
SoftData SoftSerial::tx;\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/SoftwareSerial/SoftwareSerial.h

"},{"location":"ltapi/class_software_serial/","title":"Class SoftwareSerial","text":"

ClassList > SoftwareSerial

Inherits the following classes: HardwareSerial

"},{"location":"ltapi/class_software_serial/#public-functions","title":"Public Functions","text":"Type Name SoftwareSerial (pin_size_t receivePin, pin_size_t transmitPin, bool inverted=false) int available () void begin (unsigned long baudrate) void begin (unsigned long baudrate, uint16_t config) void end () void flush () operator bool () int peek () int read () size_t write (uint8_t c)"},{"location":"ltapi/class_software_serial/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/class_software_serial/#function-softwareserial","title":"function SoftwareSerial","text":"
SoftwareSerial::SoftwareSerial (\n    pin_size_t receivePin,\n    pin_size_t transmitPin,\n    bool inverted=false\n) \n
"},{"location":"ltapi/class_software_serial/#function-available","title":"function available","text":"
int SoftwareSerial::available () \n
"},{"location":"ltapi/class_software_serial/#function-begin-12","title":"function begin [1/2]","text":"
inline void SoftwareSerial::begin (\n    unsigned long baudrate\n) \n
"},{"location":"ltapi/class_software_serial/#function-begin-22","title":"function begin [2/2]","text":"
void SoftwareSerial::begin (\n    unsigned long baudrate,\n    uint16_t config\n) \n
"},{"location":"ltapi/class_software_serial/#function-end","title":"function end","text":"
void SoftwareSerial::end () \n
"},{"location":"ltapi/class_software_serial/#function-flush","title":"function flush","text":"
void SoftwareSerial::flush () \n
"},{"location":"ltapi/class_software_serial/#function-operator-bool","title":"function operator bool","text":"
inline SoftwareSerial::operator bool () \n
"},{"location":"ltapi/class_software_serial/#function-peek","title":"function peek","text":"
int SoftwareSerial::peek () \n
"},{"location":"ltapi/class_software_serial/#function-read","title":"function read","text":"
int SoftwareSerial::read () \n
"},{"location":"ltapi/class_software_serial/#function-write","title":"function write","text":"
size_t SoftwareSerial::write (\n    uint8_t c\n) \n

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/SoftwareSerial/SoftwareSerial.h

"},{"location":"ltapi/class_static_request_handler/","title":"Class StaticRequestHandler","text":"

ClassList > StaticRequestHandler

Inherits the following classes: RequestHandler

"},{"location":"ltapi/class_static_request_handler/#public-functions","title":"Public Functions","text":"Type Name StaticRequestHandler (FS & fs, const char * path, const char * uri, const char * cache_header) virtual bool canHandle (HTTPMethod requestMethod, String requestUri) override virtual bool handle (WebServer & server, HTTPMethod requestMethod, String requestUri) override"},{"location":"ltapi/class_static_request_handler/#public-functions-inherited-from-requesthandler","title":"Public Functions inherited from RequestHandler","text":"

See RequestHandler

Type Name virtual bool canHandle (HTTPMethod method, String uri) virtual bool canUpload (String uri) virtual bool handle (WebServer & server, HTTPMethod requestMethod, String requestUri) RequestHandler * next () void next (RequestHandler * r) const String & pathArg (unsigned int i) virtual void upload (WebServer & server, String requestUri, HTTPUpload & upload) virtual ~RequestHandler ()"},{"location":"ltapi/class_static_request_handler/#public-static-functions","title":"Public Static Functions","text":"Type Name String getContentType (const String & path)"},{"location":"ltapi/class_static_request_handler/#protected-attributes","title":"Protected Attributes","text":"Type Name size_t _baseUriLength String _cache_header FS _fs bool _isFile String _path String _uri"},{"location":"ltapi/class_static_request_handler/#protected-attributes-inherited-from-requesthandler","title":"Protected Attributes inherited from RequestHandler","text":"

See RequestHandler

Type Name std::vector< String > pathArgs"},{"location":"ltapi/class_static_request_handler/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/class_static_request_handler/#function-staticrequesthandler","title":"function StaticRequestHandler","text":"
inline StaticRequestHandler::StaticRequestHandler (\n    FS & fs,\n    const char * path,\n    const char * uri,\n    const char * cache_header\n) \n
"},{"location":"ltapi/class_static_request_handler/#function-canhandle","title":"function canHandle","text":"
inline virtual bool StaticRequestHandler::canHandle (\n    HTTPMethod requestMethod,\n    String requestUri\n) override\n

Implements RequestHandler::canHandle

"},{"location":"ltapi/class_static_request_handler/#function-handle","title":"function handle","text":"
inline virtual bool StaticRequestHandler::handle (\n    WebServer & server,\n    HTTPMethod requestMethod,\n    String requestUri\n) override\n

Implements RequestHandler::handle

"},{"location":"ltapi/class_static_request_handler/#public-static-functions-documentation","title":"Public Static Functions Documentation","text":""},{"location":"ltapi/class_static_request_handler/#function-getcontenttype","title":"function getContentType","text":"
static inline String StaticRequestHandler::getContentType (\n    const String & path\n) \n
"},{"location":"ltapi/class_static_request_handler/#protected-attributes-documentation","title":"Protected Attributes Documentation","text":""},{"location":"ltapi/class_static_request_handler/#variable-_baseurilength","title":"variable _baseUriLength","text":"
size_t StaticRequestHandler::_baseUriLength;\n
"},{"location":"ltapi/class_static_request_handler/#variable-_cache_header","title":"variable _cache_header","text":"
String StaticRequestHandler::_cache_header;\n
"},{"location":"ltapi/class_static_request_handler/#variable-_fs","title":"variable _fs","text":"
FS StaticRequestHandler::_fs;\n
"},{"location":"ltapi/class_static_request_handler/#variable-_isfile","title":"variable _isFile","text":"
bool StaticRequestHandler::_isFile;\n
"},{"location":"ltapi/class_static_request_handler/#variable-_path","title":"variable _path","text":"
String StaticRequestHandler::_path;\n
"},{"location":"ltapi/class_static_request_handler/#variable-_uri","title":"variable _uri","text":"
String StaticRequestHandler::_uri;\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/detail/RequestHandlersImpl.h

"},{"location":"ltapi/class_stream_string/","title":"Class StreamString","text":"

ClassList > StreamString

More...

  • #include <StreamString.h>

Inherits the following classes: Stream, String

"},{"location":"ltapi/class_stream_string/#public-functions","title":"Public Functions","text":"Type Name int available () override void flush () override int peek () override int read () override size_t write (const uint8_t * buffer, size_t size) override size_t write (uint8_t data) override"},{"location":"ltapi/class_stream_string/#detailed-description","title":"Detailed Description","text":"

StreamString.h

Copyright (c) 2015 Markus Sattler. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

"},{"location":"ltapi/class_stream_string/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/class_stream_string/#function-available","title":"function available","text":"
int StreamString::available () override\n
"},{"location":"ltapi/class_stream_string/#function-flush","title":"function flush","text":"
void StreamString::flush () override\n
"},{"location":"ltapi/class_stream_string/#function-peek","title":"function peek","text":"
int StreamString::peek () override\n
"},{"location":"ltapi/class_stream_string/#function-read","title":"function read","text":"
int StreamString::read () override\n
"},{"location":"ltapi/class_stream_string/#function-write-12","title":"function write [1/2]","text":"
size_t StreamString::write (\n    const uint8_t * buffer,\n    size_t size\n) override\n

StreamString.cpp

Copyright (c) 2015 Markus Sattler. All rights reserved. This file is part of the esp8266 core for Arduino environment.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

"},{"location":"ltapi/class_stream_string/#function-write-22","title":"function write [2/2]","text":"
size_t StreamString::write (\n    uint8_t data\n) override\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/StreamString/StreamString.h

"},{"location":"ltapi/class_update_class/","title":"Class UpdateClass","text":"

ClassList > UpdateClass

"},{"location":"ltapi/class_update_class/#public-types","title":"Public Types","text":"Type Name typedef std::function< void(size_t, size_t)> THandlerFunction_Progress"},{"location":"ltapi/class_update_class/#public-functions","title":"Public Functions","text":"Type Name void abort () Same as end() . bool begin (size_t size=UPDATE_SIZE_UNKNOWN, int command=U_FLASH, int ledPin=-1, uint8_t ledOn=LOW, const char * label=nullptr) Initialize the update process. void clearError () Clear all errors. This is NOT recommended. bool end (bool evenIfRemaining=false) Finalize the update process. Check for errors and update completion, then activate the new firmware image. const char * errorString () constGet a textual description of the error. const char * getBoardName () Get target board name from UF2 info. UpdateError getError () constGet Arduino error code of the update. uint16_t getErrorCode () constGet combined error code of the update. const char * getFirmwareName () Get firmware name from UF2 info. const char * getFirmwareVersion () Get firmware version from UF2 info. const char * getLibreTinyVersion () Get LibreTiny version from UF2 info. uf2_err_t getUF2Error () constGet UF2OTA error code of the update. bool hasError () constCheck if any error has occurred (incl. aborting the update). bool isFinished () Check if the update process hasn't been started or has been completed. bool isRunning () Check if the update process has been started. void md5 (uint8_t * result) Get calculated MD5 digest of the firmware. String md5String () Return a hexadecimal string of calculated firmware MD5 sum. UpdateClass & onProgress (THandlerFunction_Progress handler) Set the callback invoked after writing data to flash. void printError (Print & out) constPrint string error info to the stream. size_t progress () Return amount of bytes already written. size_t remaining () Return amount of bytes remaining to write. bool setMD5 (const char * md5) Set the expected MD5 of the firmware (hexadecimal string). size_t size () Return complete update image size. size_t write (const uint8_t * data, size_t len) Write a chunk of data to the buffer or flash memory. size_t writeStream (Stream & data) Write all data remaining in the given stream."},{"location":"ltapi/class_update_class/#public-static-functions","title":"Public Static Functions","text":"Type Name bool canRollBack () Check if OTA rollback is possible (switching the stored index to another partition). bool rollBack () Try to switch OTA index to the other image. For single-OTA chips, only check if the upgrade image is valid."},{"location":"ltapi/class_update_class/#public-types-documentation","title":"Public Types Documentation","text":""},{"location":"ltapi/class_update_class/#typedef-thandlerfunction_progress","title":"typedef THandlerFunction_Progress","text":"
typedef std::function<void(size_t, size_t)> UpdateClass::THandlerFunction_Progress;\n
"},{"location":"ltapi/class_update_class/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/class_update_class/#function-abort","title":"function abort","text":"
inline void UpdateClass::abort () \n
"},{"location":"ltapi/class_update_class/#function-begin","title":"function begin","text":"

Initialize the update process.

bool UpdateClass::begin (\n    size_t size=UPDATE_SIZE_UNKNOWN,\n    int command=U_FLASH,\n    int ledPin=-1,\n    uint8_t ledOn=LOW,\n    const char * label=nullptr\n) \n

Parameters:

  • size total UF2 file size
  • command must be U_FLASH

Returns:

false if parameters are invalid or update is running, true otherwise

"},{"location":"ltapi/class_update_class/#function-clearerror","title":"function clearError","text":"
void UpdateClass::clearError () \n
"},{"location":"ltapi/class_update_class/#function-end","title":"function end","text":"

Finalize the update process. Check for errors and update completion, then activate the new firmware image.

bool UpdateClass::end (\n    bool evenIfRemaining=false\n) \n

Parameters:

  • evenIfRemaining don't raise errors if still in progress

Returns:

false in case of errors or no update running; true otherwise

"},{"location":"ltapi/class_update_class/#function-errorstring","title":"function errorString","text":"
const char * UpdateClass::errorString () const\n
"},{"location":"ltapi/class_update_class/#function-getboardname","title":"function getBoardName","text":"
inline const char * UpdateClass::getBoardName () \n
"},{"location":"ltapi/class_update_class/#function-geterror","title":"function getError","text":"
inline UpdateError UpdateClass::getError () const\n
"},{"location":"ltapi/class_update_class/#function-geterrorcode","title":"function getErrorCode","text":"
uint16_t UpdateClass::getErrorCode () const\n
"},{"location":"ltapi/class_update_class/#function-getfirmwarename","title":"function getFirmwareName","text":"
inline const char * UpdateClass::getFirmwareName () \n
"},{"location":"ltapi/class_update_class/#function-getfirmwareversion","title":"function getFirmwareVersion","text":"
inline const char * UpdateClass::getFirmwareVersion () \n
"},{"location":"ltapi/class_update_class/#function-getlibretinyversion","title":"function getLibreTinyVersion","text":"
inline const char * UpdateClass::getLibreTinyVersion () \n
"},{"location":"ltapi/class_update_class/#function-getuf2error","title":"function getUF2Error","text":"
inline uf2_err_t UpdateClass::getUF2Error () const\n
"},{"location":"ltapi/class_update_class/#function-haserror","title":"function hasError","text":"
bool UpdateClass::hasError () const\n
"},{"location":"ltapi/class_update_class/#function-isfinished","title":"function isFinished","text":"
inline bool UpdateClass::isFinished () \n
"},{"location":"ltapi/class_update_class/#function-isrunning","title":"function isRunning","text":"
inline bool UpdateClass::isRunning () \n
"},{"location":"ltapi/class_update_class/#function-md5","title":"function md5","text":"
void UpdateClass::md5 (\n    uint8_t * result\n) \n
"},{"location":"ltapi/class_update_class/#function-md5string","title":"function md5String","text":"
String UpdateClass::md5String () \n
"},{"location":"ltapi/class_update_class/#function-onprogress","title":"function onProgress","text":"
UpdateClass & UpdateClass::onProgress (\n    THandlerFunction_Progress handler\n) \n
"},{"location":"ltapi/class_update_class/#function-printerror","title":"function printError","text":"
void UpdateClass::printError (\n    Print & out\n) const\n
"},{"location":"ltapi/class_update_class/#function-progress","title":"function progress","text":"
inline size_t UpdateClass::progress () \n
"},{"location":"ltapi/class_update_class/#function-remaining","title":"function remaining","text":"
inline size_t UpdateClass::remaining () \n
"},{"location":"ltapi/class_update_class/#function-setmd5","title":"function setMD5","text":"
bool UpdateClass::setMD5 (\n    const char * md5\n) \n
"},{"location":"ltapi/class_update_class/#function-size","title":"function size","text":"
inline size_t UpdateClass::size () \n
"},{"location":"ltapi/class_update_class/#function-write","title":"function write","text":"

Write a chunk of data to the buffer or flash memory.

size_t UpdateClass::write (\n    const uint8_t * data,\n    size_t len\n) \n

It's advised to write in 512-byte chunks (or its multiples).

Parameters:

  • data chunk of data
  • len length of the chunk

Returns:

size_t amount of bytes written

"},{"location":"ltapi/class_update_class/#function-writestream","title":"function writeStream","text":"

Write all data remaining in the given stream.

size_t UpdateClass::writeStream (\n    Stream & data\n) \n

If the stream doesn't produce any data within UPDATE_TIMEOUT_MS, the update process will be aborted.

Parameters:

  • data stream to read from

Returns:

size_t amount of bytes written

"},{"location":"ltapi/class_update_class/#public-static-functions-documentation","title":"Public Static Functions Documentation","text":""},{"location":"ltapi/class_update_class/#function-canrollback","title":"function canRollBack","text":"

Check if OTA rollback is possible (switching the stored index to another partition).

static bool UpdateClass::canRollBack () \n

Note that this is not the same as \"switching\" OTA with revert=true.

Returns:

true if 2nd image is valid and the chip is dual-OTA; false otherwise

"},{"location":"ltapi/class_update_class/#function-rollback","title":"function rollBack","text":"

Try to switch OTA index to the other image. For single-OTA chips, only check if the upgrade image is valid.

static bool UpdateClass::rollBack () \n

This can be used to \"activate\" the upgrade after flashing.

Parameters:

  • revert switch if (and only if) the other image is already marked as active (i.e. switch back to the running image)

Returns:

false if the second image (or upgrade image) is not valid; false if writing failed; true otherwise

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/Update/Update.h

"},{"location":"ltapi/class_uri/","title":"Class Uri","text":"

ClassList > Uri

Inherited by the following classes: UriBraces, UriGlob, UriRegex

"},{"location":"ltapi/class_uri/#public-functions","title":"Public Functions","text":"Type Name Uri (const char * uri) Uri (const String & uri) Uri (const __FlashStringHelper * uri) virtual bool canHandle (const String & requestUri, __attribute__((unused)) std::vector< String > & pathArgs) virtual Uri * clone () const virtual void initPathArgs (__attribute__((unused)) std::vector< String > & pathArgs) virtual ~Uri ()"},{"location":"ltapi/class_uri/#protected-attributes","title":"Protected Attributes","text":"Type Name const String _uri"},{"location":"ltapi/class_uri/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/class_uri/#function-uri-13","title":"function Uri [1/3]","text":"
inline Uri::Uri (\n    const char * uri\n) \n
"},{"location":"ltapi/class_uri/#function-uri-23","title":"function Uri [2/3]","text":"
inline Uri::Uri (\n    const String & uri\n) \n
"},{"location":"ltapi/class_uri/#function-uri-33","title":"function Uri [3/3]","text":"
inline Uri::Uri (\n    const __FlashStringHelper * uri\n) \n
"},{"location":"ltapi/class_uri/#function-canhandle","title":"function canHandle","text":"
inline virtual bool Uri::canHandle (\n    const String & requestUri,\n    __attribute__((unused)) std::vector< String > & pathArgs\n) \n
"},{"location":"ltapi/class_uri/#function-clone","title":"function clone","text":"
inline virtual Uri * Uri::clone () const\n
"},{"location":"ltapi/class_uri/#function-initpathargs","title":"function initPathArgs","text":"
inline virtual void Uri::initPathArgs (\n    __attribute__((unused)) std::vector< String > & pathArgs\n) \n
"},{"location":"ltapi/class_uri/#function-uri","title":"function ~Uri","text":"
inline virtual Uri::~Uri () \n
"},{"location":"ltapi/class_uri/#protected-attributes-documentation","title":"Protected Attributes Documentation","text":""},{"location":"ltapi/class_uri/#variable-_uri","title":"variable _uri","text":"
const String Uri::_uri;\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/Uri.h

"},{"location":"ltapi/class_uri_braces/","title":"Class UriBraces","text":"

ClassList > UriBraces

Inherits the following classes: Uri

"},{"location":"ltapi/class_uri_braces/#public-functions","title":"Public Functions","text":"Type Name UriBraces (const char * uri) UriBraces (const String & uri) bool canHandle (const String & requestUri, std::vector< String > & pathArgs) override virtual Uri * clone () override const void initPathArgs (std::vector< String > & pathArgs) override"},{"location":"ltapi/class_uri_braces/#public-functions-inherited-from-uri","title":"Public Functions inherited from Uri","text":"

See Uri

Type Name Uri (const char * uri) Uri (const String & uri) Uri (const __FlashStringHelper * uri) virtual bool canHandle (const String & requestUri, __attribute__((unused)) std::vector< String > & pathArgs) virtual Uri * clone () const virtual void initPathArgs (__attribute__((unused)) std::vector< String > & pathArgs) virtual ~Uri ()"},{"location":"ltapi/class_uri_braces/#protected-attributes-inherited-from-uri","title":"Protected Attributes inherited from Uri","text":"

See Uri

Type Name const String _uri"},{"location":"ltapi/class_uri_braces/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/class_uri_braces/#function-uribraces-12","title":"function UriBraces [1/2]","text":"
inline explicit UriBraces::UriBraces (\n    const char * uri\n) \n
"},{"location":"ltapi/class_uri_braces/#function-uribraces-22","title":"function UriBraces [2/2]","text":"
inline explicit UriBraces::UriBraces (\n    const String & uri\n) \n
"},{"location":"ltapi/class_uri_braces/#function-canhandle","title":"function canHandle","text":"
inline bool UriBraces::canHandle (\n    const String & requestUri,\n    std::vector< String > & pathArgs\n) override\n
"},{"location":"ltapi/class_uri_braces/#function-clone","title":"function clone","text":"
inline virtual Uri * UriBraces::clone () override const\n

Implements Uri::clone

"},{"location":"ltapi/class_uri_braces/#function-initpathargs","title":"function initPathArgs","text":"
inline void UriBraces::initPathArgs (\n    std::vector< String > & pathArgs\n) override\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/uri/UriBraces.h

"},{"location":"ltapi/class_uri_glob/","title":"Class UriGlob","text":"

ClassList > UriGlob

Inherits the following classes: Uri

"},{"location":"ltapi/class_uri_glob/#public-functions","title":"Public Functions","text":"Type Name UriGlob (const char * uri) UriGlob (const String & uri) virtual bool canHandle (const String & requestUri, __attribute__((unused)) std::vector< String > & pathArgs) override virtual Uri * clone () override const"},{"location":"ltapi/class_uri_glob/#public-functions-inherited-from-uri","title":"Public Functions inherited from Uri","text":"

See Uri

Type Name Uri (const char * uri) Uri (const String & uri) Uri (const __FlashStringHelper * uri) virtual bool canHandle (const String & requestUri, __attribute__((unused)) std::vector< String > & pathArgs) virtual Uri * clone () const virtual void initPathArgs (__attribute__((unused)) std::vector< String > & pathArgs) virtual ~Uri ()"},{"location":"ltapi/class_uri_glob/#protected-attributes-inherited-from-uri","title":"Protected Attributes inherited from Uri","text":"

See Uri

Type Name const String _uri"},{"location":"ltapi/class_uri_glob/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/class_uri_glob/#function-uriglob-12","title":"function UriGlob [1/2]","text":"
inline explicit UriGlob::UriGlob (\n    const char * uri\n) \n
"},{"location":"ltapi/class_uri_glob/#function-uriglob-22","title":"function UriGlob [2/2]","text":"
inline explicit UriGlob::UriGlob (\n    const String & uri\n) \n
"},{"location":"ltapi/class_uri_glob/#function-canhandle","title":"function canHandle","text":"
inline virtual bool UriGlob::canHandle (\n    const String & requestUri,\n    __attribute__((unused)) std::vector< String > & pathArgs\n) override\n

Implements Uri::canHandle

"},{"location":"ltapi/class_uri_glob/#function-clone","title":"function clone","text":"
inline virtual Uri * UriGlob::clone () override const\n

Implements Uri::clone

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/uri/UriGlob.h

"},{"location":"ltapi/class_uri_regex/","title":"Class UriRegex","text":"

ClassList > UriRegex

Inherits the following classes: Uri

"},{"location":"ltapi/class_uri_regex/#public-functions","title":"Public Functions","text":"Type Name UriRegex (const char * uri) UriRegex (const String & uri) bool canHandle (const String & requestUri, std::vector< String > & pathArgs) override virtual Uri * clone () override const void initPathArgs (std::vector< String > & pathArgs) override"},{"location":"ltapi/class_uri_regex/#public-functions-inherited-from-uri","title":"Public Functions inherited from Uri","text":"

See Uri

Type Name Uri (const char * uri) Uri (const String & uri) Uri (const __FlashStringHelper * uri) virtual bool canHandle (const String & requestUri, __attribute__((unused)) std::vector< String > & pathArgs) virtual Uri * clone () const virtual void initPathArgs (__attribute__((unused)) std::vector< String > & pathArgs) virtual ~Uri ()"},{"location":"ltapi/class_uri_regex/#protected-attributes-inherited-from-uri","title":"Protected Attributes inherited from Uri","text":"

See Uri

Type Name const String _uri"},{"location":"ltapi/class_uri_regex/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/class_uri_regex/#function-uriregex-12","title":"function UriRegex [1/2]","text":"
inline explicit UriRegex::UriRegex (\n    const char * uri\n) \n
"},{"location":"ltapi/class_uri_regex/#function-uriregex-22","title":"function UriRegex [2/2]","text":"
inline explicit UriRegex::UriRegex (\n    const String & uri\n) \n
"},{"location":"ltapi/class_uri_regex/#function-canhandle","title":"function canHandle","text":"
inline bool UriRegex::canHandle (\n    const String & requestUri,\n    std::vector< String > & pathArgs\n) override\n
"},{"location":"ltapi/class_uri_regex/#function-clone","title":"function clone","text":"
inline virtual Uri * UriRegex::clone () override const\n

Implements Uri::clone

"},{"location":"ltapi/class_uri_regex/#function-initpathargs","title":"function initPathArgs","text":"
inline void UriRegex::initPathArgs (\n    std::vector< String > & pathArgs\n) override\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/uri/UriRegex.h

"},{"location":"ltapi/class_web_server/","title":"Class WebServer","text":"

ClassList > WebServer

"},{"location":"ltapi/class_web_server/#public-types","title":"Public Types","text":"Type Name typedef std::function< void(void)> THandlerFunction"},{"location":"ltapi/class_web_server/#public-functions","title":"Public Functions","text":"Type Name WebServer (IPAddress addr, int port=80) WebServer (int port=80) void addHandler (RequestHandler * handler) String arg (String name) String arg (int i) String argName (int i) int args () bool authenticate (const char * username, const char * password) virtual void begin () virtual void begin (uint16_t port) virtual WiFiClient client () virtual void close () void collectHeaders (const char * headerKeys, const size_t headerKeysCount) void enableCORS (boolean value=true) void enableCrossOrigin (boolean value=true) void enableDelay (boolean value) virtual void handleClient () bool hasArg (String name) bool hasHeader (String name) String header (String name) String header (int i) String headerName (int i) int headers () String hostHeader () HTTPMethod method () void on (const Uri & uri, THandlerFunction fn) void on (const Uri & uri, HTTPMethod method, THandlerFunction fn) void on (const Uri & uri, HTTPMethod method, THandlerFunction fn, THandlerFunction ufn) void onFileUpload (THandlerFunction ufn) void onNotFound (THandlerFunction fn) String pathArg (unsigned int i) void requestAuthentication (HTTPAuthMethod mode=BASIC_AUTH, const char * realm=NULL, const String & authFailMsg=String(\"\")) void send (int code, const char * content_type=NULL, const String & content=String(\"\")) void send (int code, char * content_type, const String & content) void send (int code, const String & content_type, const String & content) void sendContent (const String & content) void sendContent (const char * content, size_t contentLength) void sendContent_P (PGM_P content) void sendContent_P (PGM_P content, size_t size) void sendHeader (const String & name, const String & value, bool first=false) void send_P (int code, PGM_P content_type, PGM_P content) void send_P (int code, PGM_P content_type, PGM_P content, size_t contentLength) void serveStatic (const char * uri, fs::FS & fs, const char * path, const char * cache_header=NULL) void setContentLength (const size_t contentLength) void stop () size_t streamFile (T & file, const String & contentType) HTTPUpload & upload () String uri () virtual ~WebServer ()"},{"location":"ltapi/class_web_server/#public-static-functions","title":"Public Static Functions","text":"Type Name String urlDecode (const String & text)"},{"location":"ltapi/class_web_server/#protected-attributes","title":"Protected Attributes","text":"Type Name bool _chunked size_t _contentLength boolean _corsEnabled int _currentArgCount RequestArgument * _currentArgs WiFiClient _currentClient RequestHandler * _currentHandler RequestArgument * _currentHeaders HTTPMethod _currentMethod HTTPClientStatus _currentStatus std::unique_ptr< HTTPUpload > _currentUpload String _currentUri uint8_t _currentVersion THandlerFunction _fileUploadHandler RequestHandler * _firstHandler int _headerKeysCount String _hostHeader RequestHandler * _lastHandler THandlerFunction _notFoundHandler boolean _nullDelay RequestArgument * _postArgs int _postArgsLen String _responseHeaders WiFiServer _server String _snonce String _sopaque String _srealm unsigned long _statusChange"},{"location":"ltapi/class_web_server/#protected-functions","title":"Protected Functions","text":"Type Name void _addRequestHandler (RequestHandler * handler) bool _collectHeader (const char * headerName, const char * headerValue) virtual size_t _currentClientWrite (const char * b, size_t l) virtual size_t _currentClientWrite_P (PGM_P b, size_t l) String _extractParam (String & authReq, const String & param, const char delimit='\"') void _finalizeResponse () String _getRandomHexString () void _handleRequest () void _parseArguments (String data) bool _parseForm (WiFiClient & client, String boundary, uint32_t len) bool _parseFormUploadAborted () bool _parseRequest (WiFiClient & client) void _prepareHeader (String & response, int code, const char * content_type, size_t contentLength) void _streamFileCore (const size_t fileSize, const String & fileName, const String & contentType) int _uploadReadByte (WiFiClient & client) void _uploadWriteByte (uint8_t b)"},{"location":"ltapi/class_web_server/#protected-static-functions","title":"Protected Static Functions","text":"Type Name String _responseCodeToString (int code)"},{"location":"ltapi/class_web_server/#public-types-documentation","title":"Public Types Documentation","text":""},{"location":"ltapi/class_web_server/#typedef-thandlerfunction","title":"typedef THandlerFunction","text":"
typedef std::function<void(void)> WebServer::THandlerFunction;\n
"},{"location":"ltapi/class_web_server/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/class_web_server/#function-webserver-12","title":"function WebServer [1/2]","text":"
WebServer::WebServer (\n    IPAddress addr,\n    int port=80\n) \n
"},{"location":"ltapi/class_web_server/#function-webserver-22","title":"function WebServer [2/2]","text":"
WebServer::WebServer (\n    int port=80\n) \n
"},{"location":"ltapi/class_web_server/#function-addhandler","title":"function addHandler","text":"
void WebServer::addHandler (\n    RequestHandler * handler\n) \n
"},{"location":"ltapi/class_web_server/#function-arg-12","title":"function arg [1/2]","text":"
String WebServer::arg (\n    String name\n) \n
"},{"location":"ltapi/class_web_server/#function-arg-22","title":"function arg [2/2]","text":"
String WebServer::arg (\n    int i\n) \n
"},{"location":"ltapi/class_web_server/#function-argname","title":"function argName","text":"
String WebServer::argName (\n    int i\n) \n
"},{"location":"ltapi/class_web_server/#function-args","title":"function args","text":"
int WebServer::args () \n
"},{"location":"ltapi/class_web_server/#function-authenticate","title":"function authenticate","text":"
bool WebServer::authenticate (\n    const char * username,\n    const char * password\n) \n
"},{"location":"ltapi/class_web_server/#function-begin-12","title":"function begin [1/2]","text":"
virtual void WebServer::begin () \n
"},{"location":"ltapi/class_web_server/#function-begin-22","title":"function begin [2/2]","text":"
virtual void WebServer::begin (\n    uint16_t port\n) \n
"},{"location":"ltapi/class_web_server/#function-client","title":"function client","text":"
inline virtual WiFiClient WebServer::client () \n
"},{"location":"ltapi/class_web_server/#function-close","title":"function close","text":"
virtual void WebServer::close () \n
"},{"location":"ltapi/class_web_server/#function-collectheaders","title":"function collectHeaders","text":"
void WebServer::collectHeaders (\n    const char * headerKeys,\n    const size_t headerKeysCount\n) \n
"},{"location":"ltapi/class_web_server/#function-enablecors","title":"function enableCORS","text":"
void WebServer::enableCORS (\n    boolean value=true\n) \n
"},{"location":"ltapi/class_web_server/#function-enablecrossorigin","title":"function enableCrossOrigin","text":"
void WebServer::enableCrossOrigin (\n    boolean value=true\n) \n
"},{"location":"ltapi/class_web_server/#function-enabledelay","title":"function enableDelay","text":"
void WebServer::enableDelay (\n    boolean value\n) \n
"},{"location":"ltapi/class_web_server/#function-handleclient","title":"function handleClient","text":"
virtual void WebServer::handleClient () \n
"},{"location":"ltapi/class_web_server/#function-hasarg","title":"function hasArg","text":"
bool WebServer::hasArg (\n    String name\n) \n
"},{"location":"ltapi/class_web_server/#function-hasheader","title":"function hasHeader","text":"
bool WebServer::hasHeader (\n    String name\n) \n
"},{"location":"ltapi/class_web_server/#function-header-12","title":"function header [1/2]","text":"
String WebServer::header (\n    String name\n) \n
"},{"location":"ltapi/class_web_server/#function-header-22","title":"function header [2/2]","text":"
String WebServer::header (\n    int i\n) \n
"},{"location":"ltapi/class_web_server/#function-headername","title":"function headerName","text":"
String WebServer::headerName (\n    int i\n) \n
"},{"location":"ltapi/class_web_server/#function-headers","title":"function headers","text":"
int WebServer::headers () \n
"},{"location":"ltapi/class_web_server/#function-hostheader","title":"function hostHeader","text":"
String WebServer::hostHeader () \n
"},{"location":"ltapi/class_web_server/#function-method","title":"function method","text":"
inline HTTPMethod WebServer::method () \n
"},{"location":"ltapi/class_web_server/#function-on-13","title":"function on [1/3]","text":"
void WebServer::on (\n    const Uri & uri,\n    THandlerFunction fn\n) \n
"},{"location":"ltapi/class_web_server/#function-on-23","title":"function on [2/3]","text":"
void WebServer::on (\n    const Uri & uri,\n    HTTPMethod method,\n    THandlerFunction fn\n) \n
"},{"location":"ltapi/class_web_server/#function-on-33","title":"function on [3/3]","text":"
void WebServer::on (\n    const Uri & uri,\n    HTTPMethod method,\n    THandlerFunction fn,\n    THandlerFunction ufn\n) \n
"},{"location":"ltapi/class_web_server/#function-onfileupload","title":"function onFileUpload","text":"
void WebServer::onFileUpload (\n    THandlerFunction ufn\n) \n
"},{"location":"ltapi/class_web_server/#function-onnotfound","title":"function onNotFound","text":"
void WebServer::onNotFound (\n    THandlerFunction fn\n) \n
"},{"location":"ltapi/class_web_server/#function-patharg","title":"function pathArg","text":"
String WebServer::pathArg (\n    unsigned int i\n) \n
"},{"location":"ltapi/class_web_server/#function-requestauthentication","title":"function requestAuthentication","text":"
void WebServer::requestAuthentication (\n    HTTPAuthMethod mode=BASIC_AUTH,\n    const char * realm=NULL,\n    const String & authFailMsg=String(\"\")\n) \n
"},{"location":"ltapi/class_web_server/#function-send-13","title":"function send [1/3]","text":"
void WebServer::send (\n    int code,\n    const char * content_type=NULL,\n    const String & content=String(\"\")\n) \n
"},{"location":"ltapi/class_web_server/#function-send-23","title":"function send [2/3]","text":"
void WebServer::send (\n    int code,\n    char * content_type,\n    const String & content\n) \n
"},{"location":"ltapi/class_web_server/#function-send-33","title":"function send [3/3]","text":"
void WebServer::send (\n    int code,\n    const String & content_type,\n    const String & content\n) \n
"},{"location":"ltapi/class_web_server/#function-sendcontent-12","title":"function sendContent [1/2]","text":"
void WebServer::sendContent (\n    const String & content\n) \n
"},{"location":"ltapi/class_web_server/#function-sendcontent-22","title":"function sendContent [2/2]","text":"
void WebServer::sendContent (\n    const char * content,\n    size_t contentLength\n) \n
"},{"location":"ltapi/class_web_server/#function-sendcontent_p-12","title":"function sendContent_P [1/2]","text":"
void WebServer::sendContent_P (\n    PGM_P content\n) \n
"},{"location":"ltapi/class_web_server/#function-sendcontent_p-22","title":"function sendContent_P [2/2]","text":"
void WebServer::sendContent_P (\n    PGM_P content,\n    size_t size\n) \n
"},{"location":"ltapi/class_web_server/#function-sendheader","title":"function sendHeader","text":"
void WebServer::sendHeader (\n    const String & name,\n    const String & value,\n    bool first=false\n) \n
"},{"location":"ltapi/class_web_server/#function-send_p-12","title":"function send_P [1/2]","text":"
void WebServer::send_P (\n    int code,\n    PGM_P content_type,\n    PGM_P content\n) \n
"},{"location":"ltapi/class_web_server/#function-send_p-22","title":"function send_P [2/2]","text":"
void WebServer::send_P (\n    int code,\n    PGM_P content_type,\n    PGM_P content,\n    size_t contentLength\n) \n
"},{"location":"ltapi/class_web_server/#function-servestatic","title":"function serveStatic","text":"
void WebServer::serveStatic (\n    const char * uri,\n    fs::FS & fs,\n    const char * path,\n    const char * cache_header=NULL\n) \n
"},{"location":"ltapi/class_web_server/#function-setcontentlength","title":"function setContentLength","text":"
void WebServer::setContentLength (\n    const size_t contentLength\n) \n
"},{"location":"ltapi/class_web_server/#function-stop","title":"function stop","text":"
void WebServer::stop () \n
"},{"location":"ltapi/class_web_server/#function-streamfile","title":"function streamFile","text":"
template<typename T typename T>\ninline size_t WebServer::streamFile (\n    T & file,\n    const String & contentType\n) \n
"},{"location":"ltapi/class_web_server/#function-upload","title":"function upload","text":"
inline HTTPUpload & WebServer::upload () \n
"},{"location":"ltapi/class_web_server/#function-uri","title":"function uri","text":"
inline String WebServer::uri () \n
"},{"location":"ltapi/class_web_server/#function-webserver","title":"function ~WebServer","text":"
virtual WebServer::~WebServer () \n
"},{"location":"ltapi/class_web_server/#public-static-functions-documentation","title":"Public Static Functions Documentation","text":""},{"location":"ltapi/class_web_server/#function-urldecode","title":"function urlDecode","text":"
static String WebServer::urlDecode (\n    const String & text\n) \n
"},{"location":"ltapi/class_web_server/#protected-attributes-documentation","title":"Protected Attributes Documentation","text":""},{"location":"ltapi/class_web_server/#variable-_chunked","title":"variable _chunked","text":"
bool WebServer::_chunked;\n
"},{"location":"ltapi/class_web_server/#variable-_contentlength","title":"variable _contentLength","text":"
size_t WebServer::_contentLength;\n
"},{"location":"ltapi/class_web_server/#variable-_corsenabled","title":"variable _corsEnabled","text":"
boolean WebServer::_corsEnabled;\n
"},{"location":"ltapi/class_web_server/#variable-_currentargcount","title":"variable _currentArgCount","text":"
int WebServer::_currentArgCount;\n
"},{"location":"ltapi/class_web_server/#variable-_currentargs","title":"variable _currentArgs","text":"
RequestArgument* WebServer::_currentArgs;\n
"},{"location":"ltapi/class_web_server/#variable-_currentclient","title":"variable _currentClient","text":"
WiFiClient WebServer::_currentClient;\n
"},{"location":"ltapi/class_web_server/#variable-_currenthandler","title":"variable _currentHandler","text":"
RequestHandler* WebServer::_currentHandler;\n
"},{"location":"ltapi/class_web_server/#variable-_currentheaders","title":"variable _currentHeaders","text":"
RequestArgument* WebServer::_currentHeaders;\n
"},{"location":"ltapi/class_web_server/#variable-_currentmethod","title":"variable _currentMethod","text":"
HTTPMethod WebServer::_currentMethod;\n
"},{"location":"ltapi/class_web_server/#variable-_currentstatus","title":"variable _currentStatus","text":"
HTTPClientStatus WebServer::_currentStatus;\n
"},{"location":"ltapi/class_web_server/#variable-_currentupload","title":"variable _currentUpload","text":"
std::unique_ptr<HTTPUpload> WebServer::_currentUpload;\n
"},{"location":"ltapi/class_web_server/#variable-_currenturi","title":"variable _currentUri","text":"
String WebServer::_currentUri;\n
"},{"location":"ltapi/class_web_server/#variable-_currentversion","title":"variable _currentVersion","text":"
uint8_t WebServer::_currentVersion;\n
"},{"location":"ltapi/class_web_server/#variable-_fileuploadhandler","title":"variable _fileUploadHandler","text":"
THandlerFunction WebServer::_fileUploadHandler;\n
"},{"location":"ltapi/class_web_server/#variable-_firsthandler","title":"variable _firstHandler","text":"
RequestHandler* WebServer::_firstHandler;\n
"},{"location":"ltapi/class_web_server/#variable-_headerkeyscount","title":"variable _headerKeysCount","text":"
int WebServer::_headerKeysCount;\n
"},{"location":"ltapi/class_web_server/#variable-_hostheader","title":"variable _hostHeader","text":"
String WebServer::_hostHeader;\n
"},{"location":"ltapi/class_web_server/#variable-_lasthandler","title":"variable _lastHandler","text":"
RequestHandler* WebServer::_lastHandler;\n
"},{"location":"ltapi/class_web_server/#variable-_notfoundhandler","title":"variable _notFoundHandler","text":"
THandlerFunction WebServer::_notFoundHandler;\n
"},{"location":"ltapi/class_web_server/#variable-_nulldelay","title":"variable _nullDelay","text":"
boolean WebServer::_nullDelay;\n
"},{"location":"ltapi/class_web_server/#variable-_postargs","title":"variable _postArgs","text":"
RequestArgument* WebServer::_postArgs;\n
"},{"location":"ltapi/class_web_server/#variable-_postargslen","title":"variable _postArgsLen","text":"
int WebServer::_postArgsLen;\n
"},{"location":"ltapi/class_web_server/#variable-_responseheaders","title":"variable _responseHeaders","text":"
String WebServer::_responseHeaders;\n
"},{"location":"ltapi/class_web_server/#variable-_server","title":"variable _server","text":"
WiFiServer WebServer::_server;\n
"},{"location":"ltapi/class_web_server/#variable-_snonce","title":"variable _snonce","text":"
String WebServer::_snonce;\n
"},{"location":"ltapi/class_web_server/#variable-_sopaque","title":"variable _sopaque","text":"
String WebServer::_sopaque;\n
"},{"location":"ltapi/class_web_server/#variable-_srealm","title":"variable _srealm","text":"
String WebServer::_srealm;\n
"},{"location":"ltapi/class_web_server/#variable-_statuschange","title":"variable _statusChange","text":"
unsigned long WebServer::_statusChange;\n
"},{"location":"ltapi/class_web_server/#protected-functions-documentation","title":"Protected Functions Documentation","text":""},{"location":"ltapi/class_web_server/#function-_addrequesthandler","title":"function _addRequestHandler","text":"
void WebServer::_addRequestHandler (\n    RequestHandler * handler\n) \n
"},{"location":"ltapi/class_web_server/#function-_collectheader","title":"function _collectHeader","text":"
bool WebServer::_collectHeader (\n    const char * headerName,\n    const char * headerValue\n) \n
"},{"location":"ltapi/class_web_server/#function-_currentclientwrite","title":"function _currentClientWrite","text":"
inline virtual size_t WebServer::_currentClientWrite (\n    const char * b,\n    size_t l\n) \n
"},{"location":"ltapi/class_web_server/#function-_currentclientwrite_p","title":"function _currentClientWrite_P","text":"
inline virtual size_t WebServer::_currentClientWrite_P (\n    PGM_P b,\n    size_t l\n) \n
"},{"location":"ltapi/class_web_server/#function-_extractparam","title":"function _extractParam","text":"
String WebServer::_extractParam (\n    String & authReq,\n    const String & param,\n    const char delimit='\"'\n) \n
"},{"location":"ltapi/class_web_server/#function-_finalizeresponse","title":"function _finalizeResponse","text":"
void WebServer::_finalizeResponse () \n
"},{"location":"ltapi/class_web_server/#function-_getrandomhexstring","title":"function _getRandomHexString","text":"
String WebServer::_getRandomHexString () \n
"},{"location":"ltapi/class_web_server/#function-_handlerequest","title":"function _handleRequest","text":"
void WebServer::_handleRequest () \n
"},{"location":"ltapi/class_web_server/#function-_parsearguments","title":"function _parseArguments","text":"
void WebServer::_parseArguments (\n    String data\n) \n
"},{"location":"ltapi/class_web_server/#function-_parseform","title":"function _parseForm","text":"
bool WebServer::_parseForm (\n    WiFiClient & client,\n    String boundary,\n    uint32_t len\n) \n
"},{"location":"ltapi/class_web_server/#function-_parseformuploadaborted","title":"function _parseFormUploadAborted","text":"
bool WebServer::_parseFormUploadAborted () \n
"},{"location":"ltapi/class_web_server/#function-_parserequest","title":"function _parseRequest","text":"
bool WebServer::_parseRequest (\n    WiFiClient & client\n) \n
"},{"location":"ltapi/class_web_server/#function-_prepareheader","title":"function _prepareHeader","text":"
void WebServer::_prepareHeader (\n    String & response,\n    int code,\n    const char * content_type,\n    size_t contentLength\n) \n
"},{"location":"ltapi/class_web_server/#function-_streamfilecore","title":"function _streamFileCore","text":"
void WebServer::_streamFileCore (\n    const size_t fileSize,\n    const String & fileName,\n    const String & contentType\n) \n
"},{"location":"ltapi/class_web_server/#function-_uploadreadbyte","title":"function _uploadReadByte","text":"
int WebServer::_uploadReadByte (\n    WiFiClient & client\n) \n
"},{"location":"ltapi/class_web_server/#function-_uploadwritebyte","title":"function _uploadWriteByte","text":"
void WebServer::_uploadWriteByte (\n    uint8_t b\n) \n
"},{"location":"ltapi/class_web_server/#protected-static-functions-documentation","title":"Protected Static Functions Documentation","text":""},{"location":"ltapi/class_web_server/#function-_responsecodetostring","title":"function _responseCodeToString","text":"
static String WebServer::_responseCodeToString (\n    int code\n) \n

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/WebServer.h

"},{"location":"ltapi/struct_web_server_1_1_request_argument/","title":"Struct WebServer::RequestArgument","text":"

ClassList > WebServer > RequestArgument

"},{"location":"ltapi/struct_web_server_1_1_request_argument/#public-attributes","title":"Public Attributes","text":"Type Name String key String value"},{"location":"ltapi/struct_web_server_1_1_request_argument/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/struct_web_server_1_1_request_argument/#variable-key","title":"variable key","text":"
String WebServer::RequestArgument::key;\n
"},{"location":"ltapi/struct_web_server_1_1_request_argument/#variable-value","title":"variable value","text":"
String WebServer::RequestArgument::value;\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/WebServer.h

"},{"location":"ltapi/class_wi_fi_class/","title":"Class WiFiClass","text":"

ClassList > WiFiClass

"},{"location":"ltapi/class_wi_fi_class/#public-attributes","title":"Public Attributes","text":"Type Name void * data WiFiScanData * scan = = NULL"},{"location":"ltapi/class_wi_fi_class/#public-functions","title":"Public Functions","text":"Type Name uint8_t * BSSID () uint8_t * BSSID (uint8_t networkItem) String BSSIDstr () String BSSIDstr (uint8_t networkItem) int8_t RSSI () int32_t RSSI (uint8_t networkItem) const String SSID () String SSID (uint8_t networkItem) WiFiClass () WiFiStatus begin (const char * ssid, const char * passphrase=NULL, int32_t channel=0, const uint8_t * bssid=NULL, bool connect=true) WiFiStatus begin (char * ssid, char * passphrase=NULL, int32_t channel=0, const uint8_t * bssid=NULL, bool connect=true) IPAddress broadcastIP () int32_t channel () int32_t channel (uint8_t networkItem) bool config (IPAddress localIP, IPAddress gateway, IPAddress subnet, IPAddress dns1=(uint32_t) 0x00000000, IPAddress dns2=(uint32_t) 0x00000000) void dataFree () void dataInitialize () bool disconnect (bool wifiOff=false) IPAddress dnsIP (uint8_t dns_no=0) bool enableAP (bool enable) bool enableIpV6 () bool enableSTA (bool enable) WiFiAuthMode encryptionType (uint8_t networkItem) IPAddress gatewayIP () bool getAutoReconnect () WiFiAuthMode getEncryption () const char * getHostname () WiFiMode getMode () bool getNetworkInfo (uint8_t networkItem, String & ssid, WiFiAuthMode & encryptionType, int32_t & RSSI, uint8_t *& BSSID, int32_t & channel) bool getSleep () int getTxPower () int hostByName (const char * hostname, IPAddress & aResult) IPAddress hostByName (const char * hostname) bool hostname (const String & aHostname) bool isConnected () IPAddress localIP () IPv6Address localIPv6 () uint8_t * macAddress (uint8_t * mac) String macAddress () bool mode (WiFiMode mode) bool modePriv (WiFiMode mode, WiFiModeAction sta, WiFiModeAction ap) IPAddress networkID () uint16_t onEvent (EventCb callback, EventId eventId=ARDUINO_EVENT_MAX) uint16_t onEvent (EventFuncCb callback, EventId eventId=ARDUINO_EVENT_MAX) uint16_t onEvent (EventSysCb callback, EventId eventId=ARDUINO_EVENT_MAX) void printDiag (Print & dest) const String psk () bool reconnect (const uint8_t * bssid=NULL) void removeEvent (EventCb callback, EventId eventId) void removeEvent (EventSysCb callback, EventId eventId) void removeEvent (uint16_t id) uint8_t scanAlloc (uint8_t count) int16_t scanComplete () void scanDelete () void scanInit () int16_t scanNetworks (bool async=false, bool showHidden=false, bool passive=false, uint32_t maxMsPerChannel=300, uint8_t channel=0) bool setAutoReconnect (bool autoReconnect) bool setHostname (const char * hostname) bool setMacAddress (const uint8_t * mac) bool setSleep (bool enable) bool setTxPower (int power) bool softAP (const char * ssid, const char * passphrase=NULL, int channel=1, bool ssidHidden=false, int maxClients=4) IPAddress softAPBroadcastIP () bool softAPConfig (IPAddress localIP, IPAddress gateway, IPAddress subnet) IPAddress softAPIP () IPv6Address softAPIPv6 () IPAddress softAPNetworkID () const String softAPSSID (void) uint8_t softAPSubnetCIDR () IPAddress softAPSubnetMask () bool softAPdisconnect (bool wifiOff=false) bool softAPenableIpV6 () const char * softAPgetHostname () uint8_t softAPgetStationNum () uint8_t * softAPmacAddress (uint8_t * mac) String softAPmacAddress (void) bool softAPsetHostname (const char * hostname) WiFiStatus status () uint8_t subnetCIDR () IPAddress subnetMask () bool validate (const char * ssid, const char * passphrase) WiFiStatus waitForConnectResult (unsigned long timeout) ~WiFiClass ()"},{"location":"ltapi/class_wi_fi_class/#public-static-functions","title":"Public Static Functions","text":"Type Name IPAddress calculateBroadcast (IPAddress ip, IPAddress subnet) IPAddress calculateNetworkID (IPAddress ip, IPAddress subnet) uint8_t calculateSubnetCIDR (IPAddress subnetMask) String macToString (uint8_t * mac) void postEvent (EventId eventId, EventInfo eventInfo) void resetNetworkInfo (WiFiNetworkInfo & info)"},{"location":"ltapi/class_wi_fi_class/#protected-static-attributes","title":"Protected Static Attributes","text":"Type Name std::vector< EventHandler > handlers"},{"location":"ltapi/class_wi_fi_class/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/class_wi_fi_class/#variable-data","title":"variable data","text":"
void* WiFiClass::data;\n
"},{"location":"ltapi/class_wi_fi_class/#variable-scan","title":"variable scan","text":"
WiFiScanData* WiFiClass::scan;\n
"},{"location":"ltapi/class_wi_fi_class/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/class_wi_fi_class/#function-bssid-12","title":"function BSSID [1/2]","text":"
uint8_t * WiFiClass::BSSID () \n
"},{"location":"ltapi/class_wi_fi_class/#function-bssid-22","title":"function BSSID [2/2]","text":"
uint8_t * WiFiClass::BSSID (\n    uint8_t networkItem\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-bssidstr-12","title":"function BSSIDstr [1/2]","text":"
String WiFiClass::BSSIDstr () \n
"},{"location":"ltapi/class_wi_fi_class/#function-bssidstr-22","title":"function BSSIDstr [2/2]","text":"
String WiFiClass::BSSIDstr (\n    uint8_t networkItem\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-rssi-12","title":"function RSSI [1/2]","text":"
int8_t WiFiClass::RSSI () \n
"},{"location":"ltapi/class_wi_fi_class/#function-rssi-22","title":"function RSSI [2/2]","text":"
int32_t WiFiClass::RSSI (\n    uint8_t networkItem\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-ssid-12","title":"function SSID [1/2]","text":"
const String WiFiClass::SSID () \n
"},{"location":"ltapi/class_wi_fi_class/#function-ssid-22","title":"function SSID [2/2]","text":"
String WiFiClass::SSID (\n    uint8_t networkItem\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-wificlass","title":"function WiFiClass","text":"
WiFiClass::WiFiClass () \n
"},{"location":"ltapi/class_wi_fi_class/#function-begin-12","title":"function begin [1/2]","text":"
WiFiStatus WiFiClass::begin (\n    const char * ssid,\n    const char * passphrase=NULL,\n    int32_t channel=0,\n    const uint8_t * bssid=NULL,\n    bool connect=true\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-begin-22","title":"function begin [2/2]","text":"
WiFiStatus WiFiClass::begin (\n    char * ssid,\n    char * passphrase=NULL,\n    int32_t channel=0,\n    const uint8_t * bssid=NULL,\n    bool connect=true\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-broadcastip","title":"function broadcastIP","text":"
IPAddress WiFiClass::broadcastIP () \n
"},{"location":"ltapi/class_wi_fi_class/#function-channel-12","title":"function channel [1/2]","text":"
int32_t WiFiClass::channel () \n
"},{"location":"ltapi/class_wi_fi_class/#function-channel-22","title":"function channel [2/2]","text":"
int32_t WiFiClass::channel (\n    uint8_t networkItem\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-config","title":"function config","text":"
bool WiFiClass::config (\n    IPAddress localIP,\n    IPAddress gateway,\n    IPAddress subnet,\n    IPAddress dns1=(uint32_t) 0x00000000,\n    IPAddress dns2=(uint32_t) 0x00000000\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-datafree","title":"function dataFree","text":"
void WiFiClass::dataFree () \n
"},{"location":"ltapi/class_wi_fi_class/#function-datainitialize","title":"function dataInitialize","text":"
void WiFiClass::dataInitialize () \n
"},{"location":"ltapi/class_wi_fi_class/#function-disconnect","title":"function disconnect","text":"
bool WiFiClass::disconnect (\n    bool wifiOff=false\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-dnsip","title":"function dnsIP","text":"
IPAddress WiFiClass::dnsIP (\n    uint8_t dns_no=0\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-enableap","title":"function enableAP","text":"
bool WiFiClass::enableAP (\n    bool enable\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-enableipv6","title":"function enableIpV6","text":"
bool WiFiClass::enableIpV6 () \n
"},{"location":"ltapi/class_wi_fi_class/#function-enablesta","title":"function enableSTA","text":"
bool WiFiClass::enableSTA (\n    bool enable\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-encryptiontype","title":"function encryptionType","text":"
WiFiAuthMode WiFiClass::encryptionType (\n    uint8_t networkItem\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-gatewayip","title":"function gatewayIP","text":"
IPAddress WiFiClass::gatewayIP () \n
"},{"location":"ltapi/class_wi_fi_class/#function-getautoreconnect","title":"function getAutoReconnect","text":"
bool WiFiClass::getAutoReconnect () \n
"},{"location":"ltapi/class_wi_fi_class/#function-getencryption","title":"function getEncryption","text":"
WiFiAuthMode WiFiClass::getEncryption () \n
"},{"location":"ltapi/class_wi_fi_class/#function-gethostname","title":"function getHostname","text":"
const char * WiFiClass::getHostname () \n
"},{"location":"ltapi/class_wi_fi_class/#function-getmode","title":"function getMode","text":"
WiFiMode WiFiClass::getMode () \n
"},{"location":"ltapi/class_wi_fi_class/#function-getnetworkinfo","title":"function getNetworkInfo","text":"
bool WiFiClass::getNetworkInfo (\n    uint8_t networkItem,\n    String & ssid,\n    WiFiAuthMode & encryptionType,\n    int32_t & RSSI,\n    uint8_t *& BSSID,\n    int32_t & channel\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-getsleep","title":"function getSleep","text":"
bool WiFiClass::getSleep () \n
"},{"location":"ltapi/class_wi_fi_class/#function-gettxpower","title":"function getTxPower","text":"
int WiFiClass::getTxPower () \n
"},{"location":"ltapi/class_wi_fi_class/#function-hostbyname-12","title":"function hostByName [1/2]","text":"
int WiFiClass::hostByName (\n    const char * hostname,\n    IPAddress & aResult\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-hostbyname-22","title":"function hostByName [2/2]","text":"
IPAddress WiFiClass::hostByName (\n    const char * hostname\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-hostname","title":"function hostname","text":"
inline bool WiFiClass::hostname (\n    const String & aHostname\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-isconnected","title":"function isConnected","text":"
bool WiFiClass::isConnected () \n
"},{"location":"ltapi/class_wi_fi_class/#function-localip","title":"function localIP","text":"
IPAddress WiFiClass::localIP () \n
"},{"location":"ltapi/class_wi_fi_class/#function-localipv6","title":"function localIPv6","text":"
IPv6Address WiFiClass::localIPv6 () \n
"},{"location":"ltapi/class_wi_fi_class/#function-macaddress-12","title":"function macAddress [1/2]","text":"
uint8_t * WiFiClass::macAddress (\n    uint8_t * mac\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-macaddress-22","title":"function macAddress [2/2]","text":"
String WiFiClass::macAddress () \n
"},{"location":"ltapi/class_wi_fi_class/#function-mode","title":"function mode","text":"
bool WiFiClass::mode (\n    WiFiMode mode\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-modepriv","title":"function modePriv","text":"
bool WiFiClass::modePriv (\n    WiFiMode mode,\n    WiFiModeAction sta,\n    WiFiModeAction ap\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-networkid","title":"function networkID","text":"
IPAddress WiFiClass::networkID () \n
"},{"location":"ltapi/class_wi_fi_class/#function-onevent-13","title":"function onEvent [1/3]","text":"
uint16_t WiFiClass::onEvent (\n    EventCb callback,\n    EventId eventId=ARDUINO_EVENT_MAX\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-onevent-23","title":"function onEvent [2/3]","text":"
uint16_t WiFiClass::onEvent (\n    EventFuncCb callback,\n    EventId eventId=ARDUINO_EVENT_MAX\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-onevent-33","title":"function onEvent [3/3]","text":"
uint16_t WiFiClass::onEvent (\n    EventSysCb callback,\n    EventId eventId=ARDUINO_EVENT_MAX\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-printdiag","title":"function printDiag","text":"
void WiFiClass::printDiag (\n    Print & dest\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-psk","title":"function psk","text":"
const String WiFiClass::psk () \n
"},{"location":"ltapi/class_wi_fi_class/#function-reconnect","title":"function reconnect","text":"
bool WiFiClass::reconnect (\n    const uint8_t * bssid=NULL\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-removeevent-13","title":"function removeEvent [1/3]","text":"
void WiFiClass::removeEvent (\n    EventCb callback,\n    EventId eventId\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-removeevent-23","title":"function removeEvent [2/3]","text":"
void WiFiClass::removeEvent (\n    EventSysCb callback,\n    EventId eventId\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-removeevent-33","title":"function removeEvent [3/3]","text":"
void WiFiClass::removeEvent (\n    uint16_t id\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-scanalloc","title":"function scanAlloc","text":"
uint8_t WiFiClass::scanAlloc (\n    uint8_t count\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-scancomplete","title":"function scanComplete","text":"
int16_t WiFiClass::scanComplete () \n
"},{"location":"ltapi/class_wi_fi_class/#function-scandelete","title":"function scanDelete","text":"
void WiFiClass::scanDelete () \n
"},{"location":"ltapi/class_wi_fi_class/#function-scaninit","title":"function scanInit","text":"
void WiFiClass::scanInit () \n
"},{"location":"ltapi/class_wi_fi_class/#function-scannetworks","title":"function scanNetworks","text":"
int16_t WiFiClass::scanNetworks (\n    bool async=false,\n    bool showHidden=false,\n    bool passive=false,\n    uint32_t maxMsPerChannel=300,\n    uint8_t channel=0\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-setautoreconnect","title":"function setAutoReconnect","text":"
bool WiFiClass::setAutoReconnect (\n    bool autoReconnect\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-sethostname","title":"function setHostname","text":"
bool WiFiClass::setHostname (\n    const char * hostname\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-setmacaddress","title":"function setMacAddress","text":"
bool WiFiClass::setMacAddress (\n    const uint8_t * mac\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-setsleep","title":"function setSleep","text":"
bool WiFiClass::setSleep (\n    bool enable\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-settxpower","title":"function setTxPower","text":"
bool WiFiClass::setTxPower (\n    int power\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-softap","title":"function softAP","text":"
bool WiFiClass::softAP (\n    const char * ssid,\n    const char * passphrase=NULL,\n    int channel=1,\n    bool ssidHidden=false,\n    int maxClients=4\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-softapbroadcastip","title":"function softAPBroadcastIP","text":"
IPAddress WiFiClass::softAPBroadcastIP () \n
"},{"location":"ltapi/class_wi_fi_class/#function-softapconfig","title":"function softAPConfig","text":"
bool WiFiClass::softAPConfig (\n    IPAddress localIP,\n    IPAddress gateway,\n    IPAddress subnet\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-softapip","title":"function softAPIP","text":"
IPAddress WiFiClass::softAPIP () \n
"},{"location":"ltapi/class_wi_fi_class/#function-softapipv6","title":"function softAPIPv6","text":"
IPv6Address WiFiClass::softAPIPv6 () \n
"},{"location":"ltapi/class_wi_fi_class/#function-softapnetworkid","title":"function softAPNetworkID","text":"
IPAddress WiFiClass::softAPNetworkID () \n
"},{"location":"ltapi/class_wi_fi_class/#function-softapssid","title":"function softAPSSID","text":"
const String WiFiClass::softAPSSID (\n    void\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-softapsubnetcidr","title":"function softAPSubnetCIDR","text":"
uint8_t WiFiClass::softAPSubnetCIDR () \n
"},{"location":"ltapi/class_wi_fi_class/#function-softapsubnetmask","title":"function softAPSubnetMask","text":"
IPAddress WiFiClass::softAPSubnetMask () \n
"},{"location":"ltapi/class_wi_fi_class/#function-softapdisconnect","title":"function softAPdisconnect","text":"
bool WiFiClass::softAPdisconnect (\n    bool wifiOff=false\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-softapenableipv6","title":"function softAPenableIpV6","text":"
bool WiFiClass::softAPenableIpV6 () \n
"},{"location":"ltapi/class_wi_fi_class/#function-softapgethostname","title":"function softAPgetHostname","text":"
const char * WiFiClass::softAPgetHostname () \n
"},{"location":"ltapi/class_wi_fi_class/#function-softapgetstationnum","title":"function softAPgetStationNum","text":"
uint8_t WiFiClass::softAPgetStationNum () \n
"},{"location":"ltapi/class_wi_fi_class/#function-softapmacaddress-12","title":"function softAPmacAddress [1/2]","text":"
uint8_t * WiFiClass::softAPmacAddress (\n    uint8_t * mac\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-softapmacaddress-22","title":"function softAPmacAddress [2/2]","text":"
String WiFiClass::softAPmacAddress (\n    void\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-softapsethostname","title":"function softAPsetHostname","text":"
bool WiFiClass::softAPsetHostname (\n    const char * hostname\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-status","title":"function status","text":"
WiFiStatus WiFiClass::status () \n
"},{"location":"ltapi/class_wi_fi_class/#function-subnetcidr","title":"function subnetCIDR","text":"
uint8_t WiFiClass::subnetCIDR () \n
"},{"location":"ltapi/class_wi_fi_class/#function-subnetmask","title":"function subnetMask","text":"
IPAddress WiFiClass::subnetMask () \n
"},{"location":"ltapi/class_wi_fi_class/#function-validate","title":"function validate","text":"
bool WiFiClass::validate (\n    const char * ssid,\n    const char * passphrase\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-waitforconnectresult","title":"function waitForConnectResult","text":"
WiFiStatus WiFiClass::waitForConnectResult (\n    unsigned long timeout\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-wificlass_1","title":"function ~WiFiClass","text":"
WiFiClass::~WiFiClass () \n
"},{"location":"ltapi/class_wi_fi_class/#public-static-functions-documentation","title":"Public Static Functions Documentation","text":""},{"location":"ltapi/class_wi_fi_class/#function-calculatebroadcast","title":"function calculateBroadcast","text":"
static IPAddress WiFiClass::calculateBroadcast (\n    IPAddress ip,\n    IPAddress subnet\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-calculatenetworkid","title":"function calculateNetworkID","text":"
static IPAddress WiFiClass::calculateNetworkID (\n    IPAddress ip,\n    IPAddress subnet\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-calculatesubnetcidr","title":"function calculateSubnetCIDR","text":"
static uint8_t WiFiClass::calculateSubnetCIDR (\n    IPAddress subnetMask\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-mactostring","title":"function macToString","text":"
static String WiFiClass::macToString (\n    uint8_t * mac\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-postevent","title":"function postEvent","text":"
static void WiFiClass::postEvent (\n    EventId eventId,\n    EventInfo eventInfo\n) \n
"},{"location":"ltapi/class_wi_fi_class/#function-resetnetworkinfo","title":"function resetNetworkInfo","text":"
static void WiFiClass::resetNetworkInfo (\n    WiFiNetworkInfo & info\n) \n
"},{"location":"ltapi/class_wi_fi_class/#protected-static-attributes-documentation","title":"Protected Static Attributes Documentation","text":""},{"location":"ltapi/class_wi_fi_class/#variable-handlers","title":"variable handlers","text":"
std::vector< EventHandler > WiFiClass::handlers;\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFi.h

"},{"location":"ltapi/struct_wi_fi_mac_addr/","title":"Struct WiFiMacAddr","text":"

ClassList > WiFiMacAddr

"},{"location":"ltapi/struct_wi_fi_mac_addr/#public-attributes","title":"Public Attributes","text":"Type Name uint8_t addr"},{"location":"ltapi/struct_wi_fi_mac_addr/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/struct_wi_fi_mac_addr/#variable-addr","title":"variable addr","text":"
uint8_t WiFiMacAddr::addr[6];\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiType.h

"},{"location":"ltapi/class_wi_fi_multi/","title":"Class WiFiMulti","text":"

ClassList > WiFiMulti

"},{"location":"ltapi/class_wi_fi_multi/#public-functions","title":"Public Functions","text":"Type Name WiFiMulti () bool addAP (const char * ssid, const char * passphrase=NULL) uint8_t run (uint32_t connectTimeout=10000) ~WiFiMulti ()"},{"location":"ltapi/class_wi_fi_multi/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/class_wi_fi_multi/#function-wifimulti","title":"function WiFiMulti","text":"
WiFiMulti::WiFiMulti () \n
"},{"location":"ltapi/class_wi_fi_multi/#function-addap","title":"function addAP","text":"
bool WiFiMulti::addAP (\n    const char * ssid,\n    const char * passphrase=NULL\n) \n
"},{"location":"ltapi/class_wi_fi_multi/#function-run","title":"function run","text":"
uint8_t WiFiMulti::run (\n    uint32_t connectTimeout=10000\n) \n
"},{"location":"ltapi/class_wi_fi_multi/#function-wifimulti_1","title":"function ~WiFiMulti","text":"
WiFiMulti::~WiFiMulti () \n

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WiFiMulti/WiFiMulti.h

"},{"location":"ltapi/struct_wi_fi_network_info/","title":"Struct WiFiNetworkInfo","text":"

ClassList > WiFiNetworkInfo

"},{"location":"ltapi/struct_wi_fi_network_info/#public-attributes","title":"Public Attributes","text":"Type Name int auth uint8_t * bssid int channel uint32_t dns1 uint32_t dns2 uint32_t gateway uint32_t localIP char * password char * ssid bool ssidHidden uint32_t subnet"},{"location":"ltapi/struct_wi_fi_network_info/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/struct_wi_fi_network_info/#variable-auth","title":"variable auth","text":"
int WiFiNetworkInfo::auth;\n
"},{"location":"ltapi/struct_wi_fi_network_info/#variable-bssid","title":"variable bssid","text":"
uint8_t* WiFiNetworkInfo::bssid;\n
"},{"location":"ltapi/struct_wi_fi_network_info/#variable-channel","title":"variable channel","text":"
int WiFiNetworkInfo::channel;\n
"},{"location":"ltapi/struct_wi_fi_network_info/#variable-dns1","title":"variable dns1","text":"
uint32_t WiFiNetworkInfo::dns1;\n
"},{"location":"ltapi/struct_wi_fi_network_info/#variable-dns2","title":"variable dns2","text":"
uint32_t WiFiNetworkInfo::dns2;\n
"},{"location":"ltapi/struct_wi_fi_network_info/#variable-gateway","title":"variable gateway","text":"
uint32_t WiFiNetworkInfo::gateway;\n
"},{"location":"ltapi/struct_wi_fi_network_info/#variable-localip","title":"variable localIP","text":"
uint32_t WiFiNetworkInfo::localIP;\n
"},{"location":"ltapi/struct_wi_fi_network_info/#variable-password","title":"variable password","text":"
char* WiFiNetworkInfo::password;\n
"},{"location":"ltapi/struct_wi_fi_network_info/#variable-ssid","title":"variable ssid","text":"
char* WiFiNetworkInfo::ssid;\n
"},{"location":"ltapi/struct_wi_fi_network_info/#variable-ssidhidden","title":"variable ssidHidden","text":"
bool WiFiNetworkInfo::ssidHidden;\n
"},{"location":"ltapi/struct_wi_fi_network_info/#variable-subnet","title":"variable subnet","text":"
uint32_t WiFiNetworkInfo::subnet;\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiType.h

"},{"location":"ltapi/struct_wi_fi_scan_a_p/","title":"Struct WiFiScanAP","text":"

ClassList > WiFiScanAP

"},{"location":"ltapi/struct_wi_fi_scan_a_p/#public-attributes","title":"Public Attributes","text":"Type Name WiFiAuthMode auth WiFiMacAddr bssid int32_t channel int32_t rssi char * ssid"},{"location":"ltapi/struct_wi_fi_scan_a_p/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/struct_wi_fi_scan_a_p/#variable-auth","title":"variable auth","text":"
WiFiAuthMode WiFiScanAP::auth;\n
"},{"location":"ltapi/struct_wi_fi_scan_a_p/#variable-bssid","title":"variable bssid","text":"
WiFiMacAddr WiFiScanAP::bssid;\n
"},{"location":"ltapi/struct_wi_fi_scan_a_p/#variable-channel","title":"variable channel","text":"
int32_t WiFiScanAP::channel;\n
"},{"location":"ltapi/struct_wi_fi_scan_a_p/#variable-rssi","title":"variable rssi","text":"
int32_t WiFiScanAP::rssi;\n
"},{"location":"ltapi/struct_wi_fi_scan_a_p/#variable-ssid","title":"variable ssid","text":"
char* WiFiScanAP::ssid;\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiType.h

"},{"location":"ltapi/struct_wi_fi_scan_data/","title":"Struct WiFiScanData","text":"

ClassList > WiFiScanData

"},{"location":"ltapi/struct_wi_fi_scan_data/#public-attributes","title":"Public Attributes","text":"Type Name WiFiScanAP * ap = = NULL uint8_t count = = 0 bool running = = false unsigned long timeout = = 0"},{"location":"ltapi/struct_wi_fi_scan_data/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/struct_wi_fi_scan_data/#variable-ap","title":"variable ap","text":"
WiFiScanAP* WiFiScanData::ap;\n
"},{"location":"ltapi/struct_wi_fi_scan_data/#variable-count","title":"variable count","text":"
uint8_t WiFiScanData::count;\n
"},{"location":"ltapi/struct_wi_fi_scan_data/#variable-running","title":"variable running","text":"
bool WiFiScanData::running;\n
"},{"location":"ltapi/struct_wi_fi_scan_data/#variable-timeout","title":"variable timeout","text":"
unsigned long WiFiScanData::timeout;\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiType.h

"},{"location":"ltapi/struct_wifi_a_plist__t/","title":"Struct WifiAPlist_t","text":"

ClassList > WifiAPlist_t

"},{"location":"ltapi/struct_wifi_a_plist__t/#public-attributes","title":"Public Attributes","text":"Type Name char * passphrase char * ssid"},{"location":"ltapi/struct_wifi_a_plist__t/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/struct_wifi_a_plist__t/#variable-passphrase","title":"variable passphrase","text":"
char* WifiAPlist_t::passphrase;\n
"},{"location":"ltapi/struct_wifi_a_plist__t/#variable-ssid","title":"variable ssid","text":"
char* WifiAPlist_t::ssid;\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WiFiMulti/WiFiMulti.h

"},{"location":"ltapi/namespacearduino/","title":"Namespace arduino","text":"

Namespace List > arduino

"},{"location":"ltapi/namespacearduino/#classes","title":"Classes","text":"Type Name class IPv6Address

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/IPv6Address/IPv6Address.h

"},{"location":"ltapi/classarduino_1_1_i_pv6_address/","title":"Class arduino::IPv6Address","text":"

ClassList > arduino > IPv6Address

Inherits the following classes: Printable

"},{"location":"ltapi/classarduino_1_1_i_pv6_address/#public-attributes","title":"Public Attributes","text":"Type Name uint8_t bytes uint32_t dword"},{"location":"ltapi/classarduino_1_1_i_pv6_address/#public-functions","title":"Public Functions","text":"Type Name IPv6Address () IPv6Address (const uint8_t * address) IPv6Address (const uint32_t * address) bool fromString (const char * address) bool fromString (const String & address) operator const uint32_t * () const operator const uint8_t * () const IPv6Address & operator= (const uint8_t * address) bool operator== (const IPv6Address & addr) const bool operator== (const uint8_t * addr) const uint8_t operator[] (int index) const uint8_t & operator[] (int index) virtual size_t printTo (Print & p) const String toString () const virtual ~IPv6Address ()"},{"location":"ltapi/classarduino_1_1_i_pv6_address/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/classarduino_1_1_i_pv6_address/#variable-bytes","title":"variable bytes","text":"
uint8_t arduino::IPv6Address::bytes[16];\n
"},{"location":"ltapi/classarduino_1_1_i_pv6_address/#variable-dword","title":"variable dword","text":"
uint32_t arduino::IPv6Address::dword[4];\n
"},{"location":"ltapi/classarduino_1_1_i_pv6_address/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/classarduino_1_1_i_pv6_address/#function-ipv6address-13","title":"function IPv6Address [1/3]","text":"
arduino::IPv6Address::IPv6Address () \n
"},{"location":"ltapi/classarduino_1_1_i_pv6_address/#function-ipv6address-23","title":"function IPv6Address [2/3]","text":"
arduino::IPv6Address::IPv6Address (\n    const uint8_t * address\n) \n
"},{"location":"ltapi/classarduino_1_1_i_pv6_address/#function-ipv6address-33","title":"function IPv6Address [3/3]","text":"
arduino::IPv6Address::IPv6Address (\n    const uint32_t * address\n) \n
"},{"location":"ltapi/classarduino_1_1_i_pv6_address/#function-fromstring-12","title":"function fromString [1/2]","text":"
bool arduino::IPv6Address::fromString (\n    const char * address\n) \n
"},{"location":"ltapi/classarduino_1_1_i_pv6_address/#function-fromstring-22","title":"function fromString [2/2]","text":"
inline bool arduino::IPv6Address::fromString (\n    const String & address\n) \n
"},{"location":"ltapi/classarduino_1_1_i_pv6_address/#function-operator-const-uint32_t","title":"function operator const uint32_t *","text":"
inline arduino::IPv6Address::operator const uint32_t * () const\n
"},{"location":"ltapi/classarduino_1_1_i_pv6_address/#function-operator-const-uint8_t","title":"function operator const uint8_t *","text":"
inline arduino::IPv6Address::operator const uint8_t * () const\n
"},{"location":"ltapi/classarduino_1_1_i_pv6_address/#function-operator","title":"function operator=","text":"
IPv6Address & arduino::IPv6Address::operator= (\n    const uint8_t * address\n) \n
"},{"location":"ltapi/classarduino_1_1_i_pv6_address/#function-operator_1","title":"function operator==","text":"
inline bool arduino::IPv6Address::operator== (\n    const IPv6Address & addr\n) const\n
"},{"location":"ltapi/classarduino_1_1_i_pv6_address/#function-operator_2","title":"function operator==","text":"
bool arduino::IPv6Address::operator== (\n    const uint8_t * addr\n) const\n
"},{"location":"ltapi/classarduino_1_1_i_pv6_address/#function-operator_3","title":"function operator[]","text":"
inline uint8_t arduino::IPv6Address::operator[] (\n    int index\n) const\n
"},{"location":"ltapi/classarduino_1_1_i_pv6_address/#function-operator_4","title":"function operator[]","text":"
inline uint8_t & arduino::IPv6Address::operator[] (\n    int index\n) \n
"},{"location":"ltapi/classarduino_1_1_i_pv6_address/#function-printto","title":"function printTo","text":"
virtual size_t arduino::IPv6Address::printTo (\n    Print & p\n) const\n
"},{"location":"ltapi/classarduino_1_1_i_pv6_address/#function-tostring","title":"function toString","text":"
String arduino::IPv6Address::toString () const\n
"},{"location":"ltapi/classarduino_1_1_i_pv6_address/#function-ipv6address","title":"function ~IPv6Address","text":"
inline virtual arduino::IPv6Address::~IPv6Address () \n
"},{"location":"ltapi/classarduino_1_1_i_pv6_address/#friends-documentation","title":"Friends Documentation","text":""},{"location":"ltapi/classarduino_1_1_i_pv6_address/#friend-client","title":"friend Client","text":"
class arduino::IPv6Address::Client (\n    Client\n) \n
"},{"location":"ltapi/classarduino_1_1_i_pv6_address/#friend-server","title":"friend Server","text":"
class arduino::IPv6Address::Server (\n    Server\n) \n
"},{"location":"ltapi/classarduino_1_1_i_pv6_address/#friend-udp","title":"friend UDP","text":"
class arduino::IPv6Address::UDP (\n    UDP\n) \n

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/IPv6Address/IPv6Address.h

"},{"location":"ltapi/unionarduino__event__info__t/","title":"Union arduino_event_info_t","text":"

ClassList > arduino_event_info_t

"},{"location":"ltapi/unionarduino__event__info__t/#public-attributes","title":"Public Attributes","text":"Type Name ip_event_got_ip_t got_ip ip_event_got_ip6_t got_ip6 wifi_event_ap_probe_req_rx_t wifi_ap_probereqrecved wifi_event_ap_staconnected_t wifi_ap_staconnected wifi_event_ap_stadisconnected_t wifi_ap_stadisconnected ip_event_ap_staipassigned_t wifi_ap_staipassigned wifi_event_ftm_report_t wifi_ftm_report wifi_event_sta_scan_done_t wifi_scan_done wifi_event_sta_authmode_change_t wifi_sta_authmode_change wifi_event_sta_connected_t wifi_sta_connected wifi_event_sta_disconnected_t wifi_sta_disconnected wifi_event_sta_wps_er_pin_t wps_er_pin wifi_event_sta_wps_fail_reason_t wps_fail_reason"},{"location":"ltapi/unionarduino__event__info__t/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/unionarduino__event__info__t/#variable-got_ip","title":"variable got_ip","text":"
ip_event_got_ip_t arduino_event_info_t::got_ip;\n
"},{"location":"ltapi/unionarduino__event__info__t/#variable-got_ip6","title":"variable got_ip6","text":"
ip_event_got_ip6_t arduino_event_info_t::got_ip6;\n
"},{"location":"ltapi/unionarduino__event__info__t/#variable-wifi_ap_probereqrecved","title":"variable wifi_ap_probereqrecved","text":"
wifi_event_ap_probe_req_rx_t arduino_event_info_t::wifi_ap_probereqrecved;\n
"},{"location":"ltapi/unionarduino__event__info__t/#variable-wifi_ap_staconnected","title":"variable wifi_ap_staconnected","text":"
wifi_event_ap_staconnected_t arduino_event_info_t::wifi_ap_staconnected;\n
"},{"location":"ltapi/unionarduino__event__info__t/#variable-wifi_ap_stadisconnected","title":"variable wifi_ap_stadisconnected","text":"
wifi_event_ap_stadisconnected_t arduino_event_info_t::wifi_ap_stadisconnected;\n
"},{"location":"ltapi/unionarduino__event__info__t/#variable-wifi_ap_staipassigned","title":"variable wifi_ap_staipassigned","text":"
ip_event_ap_staipassigned_t arduino_event_info_t::wifi_ap_staipassigned;\n
"},{"location":"ltapi/unionarduino__event__info__t/#variable-wifi_ftm_report","title":"variable wifi_ftm_report","text":"
wifi_event_ftm_report_t arduino_event_info_t::wifi_ftm_report;\n
"},{"location":"ltapi/unionarduino__event__info__t/#variable-wifi_scan_done","title":"variable wifi_scan_done","text":"
wifi_event_sta_scan_done_t arduino_event_info_t::wifi_scan_done;\n
"},{"location":"ltapi/unionarduino__event__info__t/#variable-wifi_sta_authmode_change","title":"variable wifi_sta_authmode_change","text":"
wifi_event_sta_authmode_change_t arduino_event_info_t::wifi_sta_authmode_change;\n
"},{"location":"ltapi/unionarduino__event__info__t/#variable-wifi_sta_connected","title":"variable wifi_sta_connected","text":"
wifi_event_sta_connected_t arduino_event_info_t::wifi_sta_connected;\n
"},{"location":"ltapi/unionarduino__event__info__t/#variable-wifi_sta_disconnected","title":"variable wifi_sta_disconnected","text":"
wifi_event_sta_disconnected_t arduino_event_info_t::wifi_sta_disconnected;\n
"},{"location":"ltapi/unionarduino__event__info__t/#variable-wps_er_pin","title":"variable wps_er_pin","text":"
wifi_event_sta_wps_er_pin_t arduino_event_info_t::wps_er_pin;\n
"},{"location":"ltapi/unionarduino__event__info__t/#variable-wps_fail_reason","title":"variable wps_fail_reason","text":"
wifi_event_sta_wps_fail_reason_t arduino_event_info_t::wps_fail_reason;\n

The documentation for this class was generated from the following file cores/common/arduino/src/Events.h

"},{"location":"ltapi/structarduino__event__t/","title":"Struct arduino_event_t","text":"

ClassList > arduino_event_t

"},{"location":"ltapi/structarduino__event__t/#public-attributes","title":"Public Attributes","text":"Type Name arduino_event_id_t event_id arduino_event_info_t event_info"},{"location":"ltapi/structarduino__event__t/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/structarduino__event__t/#variable-event_id","title":"variable event_id","text":"
arduino_event_id_t arduino_event_t::event_id;\n
"},{"location":"ltapi/structarduino__event__t/#variable-event_info","title":"variable event_info","text":"
arduino_event_info_t arduino_event_t::event_info;\n

The documentation for this class was generated from the following file cores/common/arduino/src/Events.h

"},{"location":"ltapi/classbase64/","title":"Class base64","text":"

ClassList > base64

"},{"location":"ltapi/classbase64/#public-static-functions","title":"Public Static Functions","text":"Type Name String encode (const uint8_t * data, size_t length) String encode (const String & text)"},{"location":"ltapi/classbase64/#public-static-functions-documentation","title":"Public Static Functions Documentation","text":""},{"location":"ltapi/classbase64/#function-encode-12","title":"function encode [1/2]","text":"
static String base64::encode (\n    const uint8_t * data,\n    size_t length\n) \n

base64.cpp

Created on: 09.12.2015

Copyright (c) 2015 Markus Sattler. All rights reserved. This file is part of the ESP31B core for Arduino.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA convert input data to base64

Parameters:

  • data const uint8_t *
  • length size_t

Returns:

String

"},{"location":"ltapi/classbase64/#function-encode-22","title":"function encode [2/2]","text":"
static String base64::encode (\n    const String & text\n) \n

convert input data to base64

Parameters:

  • text const String&

Returns:

String

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/base64/base64.h

"},{"location":"ltapi/structbase64__decodestate/","title":"Struct base64_decodestate","text":"

ClassList > base64_decodestate

"},{"location":"ltapi/structbase64__decodestate/#public-attributes","title":"Public Attributes","text":"Type Name char plainchar base64_decodestep step"},{"location":"ltapi/structbase64__decodestate/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/structbase64__decodestate/#variable-plainchar","title":"variable plainchar","text":"
char base64_decodestate::plainchar;\n
"},{"location":"ltapi/structbase64__decodestate/#variable-step","title":"variable step","text":"
base64_decodestep base64_decodestate::step;\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/base64/libb64/cdecode.h

"},{"location":"ltapi/structbase64__encodestate/","title":"Struct base64_encodestate","text":"

ClassList > base64_encodestate

"},{"location":"ltapi/structbase64__encodestate/#public-attributes","title":"Public Attributes","text":"Type Name char result base64_encodestep step int stepcount"},{"location":"ltapi/structbase64__encodestate/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/structbase64__encodestate/#variable-result","title":"variable result","text":"
char base64_encodestate::result;\n
"},{"location":"ltapi/structbase64__encodestate/#variable-step","title":"variable step","text":"
base64_encodestep base64_encodestate::step;\n
"},{"location":"ltapi/structbase64__encodestate/#variable-stepcount","title":"variable stepcount","text":"
int base64_encodestate::stepcount;\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/base64/libb64/cencode.h

"},{"location":"ltapi/classcbuf/","title":"Class cbuf","text":"

ClassList > cbuf

"},{"location":"ltapi/classcbuf/#public-attributes","title":"Public Attributes","text":"Type Name cbuf * next"},{"location":"ltapi/classcbuf/#public-functions","title":"Public Functions","text":"Type Name size_t available () const cbuf (size_t size) bool empty () const void flush () bool full () const int peek () size_t peek (char * dst, size_t size) int read () size_t read (char * dst, size_t size) size_t remove (size_t size) size_t resize (size_t newSize) size_t resizeAdd (size_t addSize) size_t room () const size_t size () size_t write (char c) size_t write (const char * src, size_t size) ~cbuf ()"},{"location":"ltapi/classcbuf/#protected-attributes","title":"Protected Attributes","text":"Type Name char * _begin char * _buf const char * _bufend char * _end size_t _size"},{"location":"ltapi/classcbuf/#protected-functions","title":"Protected Functions","text":"Type Name char * wrap_if_bufend (char * ptr) const"},{"location":"ltapi/classcbuf/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/classcbuf/#variable-next","title":"variable next","text":"
cbuf* cbuf::next;\n
"},{"location":"ltapi/classcbuf/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/classcbuf/#function-available","title":"function available","text":"
size_t cbuf::available () const\n
"},{"location":"ltapi/classcbuf/#function-cbuf","title":"function cbuf","text":"
cbuf::cbuf (\n    size_t size\n) \n
"},{"location":"ltapi/classcbuf/#function-empty","title":"function empty","text":"
inline bool cbuf::empty () const\n
"},{"location":"ltapi/classcbuf/#function-flush","title":"function flush","text":"
void cbuf::flush () \n
"},{"location":"ltapi/classcbuf/#function-full","title":"function full","text":"
inline bool cbuf::full () const\n
"},{"location":"ltapi/classcbuf/#function-peek-12","title":"function peek [1/2]","text":"
int cbuf::peek () \n
"},{"location":"ltapi/classcbuf/#function-peek-22","title":"function peek [2/2]","text":"
size_t cbuf::peek (\n    char * dst,\n    size_t size\n) \n
"},{"location":"ltapi/classcbuf/#function-read-12","title":"function read [1/2]","text":"
int cbuf::read () \n
"},{"location":"ltapi/classcbuf/#function-read-22","title":"function read [2/2]","text":"
size_t cbuf::read (\n    char * dst,\n    size_t size\n) \n
"},{"location":"ltapi/classcbuf/#function-remove","title":"function remove","text":"
size_t cbuf::remove (\n    size_t size\n) \n
"},{"location":"ltapi/classcbuf/#function-resize","title":"function resize","text":"
size_t cbuf::resize (\n    size_t newSize\n) \n
"},{"location":"ltapi/classcbuf/#function-resizeadd","title":"function resizeAdd","text":"
size_t cbuf::resizeAdd (\n    size_t addSize\n) \n
"},{"location":"ltapi/classcbuf/#function-room","title":"function room","text":"
size_t cbuf::room () const\n
"},{"location":"ltapi/classcbuf/#function-size","title":"function size","text":"
size_t cbuf::size () \n
"},{"location":"ltapi/classcbuf/#function-write-12","title":"function write [1/2]","text":"
size_t cbuf::write (\n    char c\n) \n
"},{"location":"ltapi/classcbuf/#function-write-22","title":"function write [2/2]","text":"
size_t cbuf::write (\n    const char * src,\n    size_t size\n) \n
"},{"location":"ltapi/classcbuf/#function-cbuf_1","title":"function ~cbuf","text":"
cbuf::~cbuf () \n
"},{"location":"ltapi/classcbuf/#protected-attributes-documentation","title":"Protected Attributes Documentation","text":""},{"location":"ltapi/classcbuf/#variable-_begin","title":"variable _begin","text":"
char* cbuf::_begin;\n
"},{"location":"ltapi/classcbuf/#variable-_buf","title":"variable _buf","text":"
char* cbuf::_buf;\n
"},{"location":"ltapi/classcbuf/#variable-_bufend","title":"variable _bufend","text":"
const char* cbuf::_bufend;\n
"},{"location":"ltapi/classcbuf/#variable-_end","title":"variable _end","text":"
char* cbuf::_end;\n
"},{"location":"ltapi/classcbuf/#variable-_size","title":"variable _size","text":"
size_t cbuf::_size;\n
"},{"location":"ltapi/classcbuf/#protected-functions-documentation","title":"Protected Functions Documentation","text":""},{"location":"ltapi/classcbuf/#function-wrap_if_bufend","title":"function wrap_if_bufend","text":"
inline char * cbuf::wrap_if_bufend (\n    char * ptr\n) const\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/cbuf/cbuf.h

"},{"location":"ltapi/structesp__ip4__addr/","title":"Struct esp_ip4_addr","text":"

ClassList > esp_ip4_addr

"},{"location":"ltapi/structesp__ip4__addr/#public-attributes","title":"Public Attributes","text":"Type Name uint32_t addr"},{"location":"ltapi/structesp__ip4__addr/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/structesp__ip4__addr/#variable-addr","title":"variable addr","text":"
uint32_t esp_ip4_addr::addr;\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiType.h

"},{"location":"ltapi/structesp__ip6__addr/","title":"Struct esp_ip6_addr","text":"

ClassList > esp_ip6_addr

"},{"location":"ltapi/structesp__ip6__addr/#public-attributes","title":"Public Attributes","text":"Type Name uint32_t addr uint8_t zone"},{"location":"ltapi/structesp__ip6__addr/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/structesp__ip6__addr/#variable-addr","title":"variable addr","text":"
uint32_t esp_ip6_addr::addr[4];\n
"},{"location":"ltapi/structesp__ip6__addr/#variable-zone","title":"variable zone","text":"
uint8_t esp_ip6_addr::zone;\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiType.h

"},{"location":"ltapi/structesp__netif__ip6__info__t/","title":"Struct esp_netif_ip6_info_t","text":"

ClassList > esp_netif_ip6_info_t

IPV6 IP address information.

  • #include <WiFiEvents.h>
"},{"location":"ltapi/structesp__netif__ip6__info__t/#public-attributes","title":"Public Attributes","text":"Type Name esp_ip6_addr_t ip"},{"location":"ltapi/structesp__netif__ip6__info__t/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/structesp__netif__ip6__info__t/#variable-ip","title":"variable ip","text":"
esp_ip6_addr_t esp_netif_ip6_info_t::ip;\n

Interface IPV6 address

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

"},{"location":"ltapi/structesp__netif__ip__info__t/","title":"Struct esp_netif_ip_info_t","text":"

ClassList > esp_netif_ip_info_t

More...

  • #include <WiFiEvents.h>
"},{"location":"ltapi/structesp__netif__ip__info__t/#public-attributes","title":"Public Attributes","text":"Type Name esp_ip4_addr_t gw esp_ip4_addr_t ip esp_ip4_addr_t netmask"},{"location":"ltapi/structesp__netif__ip__info__t/#detailed-description","title":"Detailed Description","text":"

Event structure for IP_EVENT_STA_GOT_IP, IP_EVENT_ETH_GOT_IP events

"},{"location":"ltapi/structesp__netif__ip__info__t/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/structesp__netif__ip__info__t/#variable-gw","title":"variable gw","text":"
esp_ip4_addr_t esp_netif_ip_info_t::gw;\n

Interface IPV4 gateway address

"},{"location":"ltapi/structesp__netif__ip__info__t/#variable-ip","title":"variable ip","text":"
esp_ip4_addr_t esp_netif_ip_info_t::ip;\n

Interface IPV4 address

"},{"location":"ltapi/structesp__netif__ip__info__t/#variable-netmask","title":"variable netmask","text":"
esp_ip4_addr_t esp_netif_ip_info_t::netmask;\n

Interface IPV4 netmask

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

"},{"location":"ltapi/namespacefs/","title":"Namespace fs","text":"

Namespace List > fs

"},{"location":"ltapi/namespacefs/#classes","title":"Classes","text":"Type Name class FS class FSImpl class File class FileImpl"},{"location":"ltapi/namespacefs/#public-types","title":"Public Types","text":"Type Name typedef std::shared_ptr< FSImpl > FSImplPtr typedef std::shared_ptr< FileImpl > FileImplPtr enum SeekMode"},{"location":"ltapi/namespacefs/#public-types-documentation","title":"Public Types Documentation","text":""},{"location":"ltapi/namespacefs/#typedef-fsimplptr","title":"typedef FSImplPtr","text":"
typedef std::shared_ptr<FSImpl> fs::FSImplPtr;\n
"},{"location":"ltapi/namespacefs/#typedef-fileimplptr","title":"typedef FileImplPtr","text":"
typedef std::shared_ptr<FileImpl> fs::FileImplPtr;\n
"},{"location":"ltapi/namespacefs/#enum-seekmode","title":"enum SeekMode","text":"
enum fs::SeekMode {\n    SeekSet = 0,\n    SeekCur = 1,\n    SeekEnd = 2\n};\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/FS/FS.h

"},{"location":"ltapi/classfs_1_1_f_s/","title":"Class fs::FS","text":"

ClassList > fs > FS

"},{"location":"ltapi/classfs_1_1_f_s/#public-functions","title":"Public Functions","text":"Type Name FS (FSImplPtr impl) bool exists (const char * path) bool exists (const String & path) bool mkdir (const char * path) bool mkdir (const String & path) File open (const char * path, const char * mode=FILE_READ, const bool create=false) File open (const String & path, const char * mode=FILE_READ, const bool create=false) bool remove (const char * path) bool remove (const String & path) bool rename (const char * pathFrom, const char * pathTo) bool rename (const String & pathFrom, const String & pathTo) bool rmdir (const char * path) bool rmdir (const String & path)"},{"location":"ltapi/classfs_1_1_f_s/#protected-attributes","title":"Protected Attributes","text":"Type Name FSImplPtr _impl"},{"location":"ltapi/classfs_1_1_f_s/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/classfs_1_1_f_s/#function-fs","title":"function FS","text":"
inline fs::FS::FS (\n    FSImplPtr impl\n) \n
"},{"location":"ltapi/classfs_1_1_f_s/#function-exists-12","title":"function exists [1/2]","text":"
bool fs::FS::exists (\n    const char * path\n) \n
"},{"location":"ltapi/classfs_1_1_f_s/#function-exists-22","title":"function exists [2/2]","text":"
bool fs::FS::exists (\n    const String & path\n) \n
"},{"location":"ltapi/classfs_1_1_f_s/#function-mkdir-12","title":"function mkdir [1/2]","text":"
bool fs::FS::mkdir (\n    const char * path\n) \n
"},{"location":"ltapi/classfs_1_1_f_s/#function-mkdir-22","title":"function mkdir [2/2]","text":"
bool fs::FS::mkdir (\n    const String & path\n) \n
"},{"location":"ltapi/classfs_1_1_f_s/#function-open-12","title":"function open [1/2]","text":"
File fs::FS::open (\n    const char * path,\n    const char * mode=FILE_READ,\n    const bool create=false\n) \n
"},{"location":"ltapi/classfs_1_1_f_s/#function-open-22","title":"function open [2/2]","text":"
File fs::FS::open (\n    const String & path,\n    const char * mode=FILE_READ,\n    const bool create=false\n) \n
"},{"location":"ltapi/classfs_1_1_f_s/#function-remove-12","title":"function remove [1/2]","text":"
bool fs::FS::remove (\n    const char * path\n) \n
"},{"location":"ltapi/classfs_1_1_f_s/#function-remove-22","title":"function remove [2/2]","text":"
bool fs::FS::remove (\n    const String & path\n) \n
"},{"location":"ltapi/classfs_1_1_f_s/#function-rename-12","title":"function rename [1/2]","text":"
bool fs::FS::rename (\n    const char * pathFrom,\n    const char * pathTo\n) \n
"},{"location":"ltapi/classfs_1_1_f_s/#function-rename-22","title":"function rename [2/2]","text":"
bool fs::FS::rename (\n    const String & pathFrom,\n    const String & pathTo\n) \n
"},{"location":"ltapi/classfs_1_1_f_s/#function-rmdir-12","title":"function rmdir [1/2]","text":"
bool fs::FS::rmdir (\n    const char * path\n) \n
"},{"location":"ltapi/classfs_1_1_f_s/#function-rmdir-22","title":"function rmdir [2/2]","text":"
bool fs::FS::rmdir (\n    const String & path\n) \n
"},{"location":"ltapi/classfs_1_1_f_s/#protected-attributes-documentation","title":"Protected Attributes Documentation","text":""},{"location":"ltapi/classfs_1_1_f_s/#variable-_impl","title":"variable _impl","text":"
FSImplPtr fs::FS::_impl;\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/FS/FS.h

"},{"location":"ltapi/classfs_1_1_f_s_impl/","title":"Class fs::FSImpl","text":"

ClassList > fs > FSImpl

"},{"location":"ltapi/classfs_1_1_f_s_impl/#public-functions","title":"Public Functions","text":"Type Name FSImpl () virtual bool exists (const char * path) = 0 virtual bool mkdir (const char * path) = 0 virtual FileImplPtr open (const char * path, const char * mode, const bool create) = 0 virtual bool remove (const char * path) = 0 virtual bool rename (const char * pathFrom, const char * pathTo) = 0 virtual bool rmdir (const char * path) = 0 virtual ~FSImpl ()"},{"location":"ltapi/classfs_1_1_f_s_impl/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/classfs_1_1_f_s_impl/#function-fsimpl","title":"function FSImpl","text":"
inline fs::FSImpl::FSImpl () \n
"},{"location":"ltapi/classfs_1_1_f_s_impl/#function-exists","title":"function exists","text":"
virtual bool fs::FSImpl::exists (\n    const char * path\n) = 0\n
"},{"location":"ltapi/classfs_1_1_f_s_impl/#function-mkdir","title":"function mkdir","text":"
virtual bool fs::FSImpl::mkdir (\n    const char * path\n) = 0\n
"},{"location":"ltapi/classfs_1_1_f_s_impl/#function-open","title":"function open","text":"
virtual FileImplPtr fs::FSImpl::open (\n    const char * path,\n    const char * mode,\n    const bool create\n) = 0\n
"},{"location":"ltapi/classfs_1_1_f_s_impl/#function-remove","title":"function remove","text":"
virtual bool fs::FSImpl::remove (\n    const char * path\n) = 0\n
"},{"location":"ltapi/classfs_1_1_f_s_impl/#function-rename","title":"function rename","text":"
virtual bool fs::FSImpl::rename (\n    const char * pathFrom,\n    const char * pathTo\n) = 0\n
"},{"location":"ltapi/classfs_1_1_f_s_impl/#function-rmdir","title":"function rmdir","text":"
virtual bool fs::FSImpl::rmdir (\n    const char * path\n) = 0\n
"},{"location":"ltapi/classfs_1_1_f_s_impl/#function-fsimpl_1","title":"function ~FSImpl","text":"
inline virtual fs::FSImpl::~FSImpl () \n

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/FS/FS.h

"},{"location":"ltapi/classfs_1_1_file/","title":"Class fs::File","text":"

ClassList > fs > File

Inherits the following classes: Stream

"},{"location":"ltapi/classfs_1_1_file/#public-functions","title":"Public Functions","text":"Type Name File (FileImplPtr p=FileImplPtr()) int available () override void close () void flush () override time_t getLastWrite () boolean isDirectory (void) const char * name () const File openNextFile (const char * mode=FILE_READ) operator bool () const const char * path () const int peek () override size_t position () const int read () override size_t read (uint8_t * buf, size_t size) size_t readBytes (char * buffer, size_t length) void rewindDirectory (void) bool seek (uint32_t pos, SeekMode mode) bool seek (uint32_t pos) bool setBufferSize (size_t size) size_t size () const size_t write (uint8_t c) override size_t write (const uint8_t * buf, size_t size) override"},{"location":"ltapi/classfs_1_1_file/#protected-attributes","title":"Protected Attributes","text":"Type Name FileImplPtr _p"},{"location":"ltapi/classfs_1_1_file/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/classfs_1_1_file/#function-file","title":"function File","text":"
inline fs::File::File (\n    FileImplPtr p=FileImplPtr()\n) \n
"},{"location":"ltapi/classfs_1_1_file/#function-available","title":"function available","text":"
int fs::File::available () override\n
"},{"location":"ltapi/classfs_1_1_file/#function-close","title":"function close","text":"
void fs::File::close () \n
"},{"location":"ltapi/classfs_1_1_file/#function-flush","title":"function flush","text":"
void fs::File::flush () override\n
"},{"location":"ltapi/classfs_1_1_file/#function-getlastwrite","title":"function getLastWrite","text":"
time_t fs::File::getLastWrite () \n
"},{"location":"ltapi/classfs_1_1_file/#function-isdirectory","title":"function isDirectory","text":"
boolean fs::File::isDirectory (\n    void\n) \n
"},{"location":"ltapi/classfs_1_1_file/#function-name","title":"function name","text":"
const char * fs::File::name () const\n
"},{"location":"ltapi/classfs_1_1_file/#function-opennextfile","title":"function openNextFile","text":"
File fs::File::openNextFile (\n    const char * mode=FILE_READ\n) \n
"},{"location":"ltapi/classfs_1_1_file/#function-operator-bool","title":"function operator bool","text":"
fs::File::operator bool () const\n
"},{"location":"ltapi/classfs_1_1_file/#function-path","title":"function path","text":"
const char * fs::File::path () const\n
"},{"location":"ltapi/classfs_1_1_file/#function-peek","title":"function peek","text":"
int fs::File::peek () override\n
"},{"location":"ltapi/classfs_1_1_file/#function-position","title":"function position","text":"
size_t fs::File::position () const\n
"},{"location":"ltapi/classfs_1_1_file/#function-read-12","title":"function read [1/2]","text":"
int fs::File::read () override\n
"},{"location":"ltapi/classfs_1_1_file/#function-read-22","title":"function read [2/2]","text":"
size_t fs::File::read (\n    uint8_t * buf,\n    size_t size\n) \n
"},{"location":"ltapi/classfs_1_1_file/#function-readbytes","title":"function readBytes","text":"
inline size_t fs::File::readBytes (\n    char * buffer,\n    size_t length\n) \n
"},{"location":"ltapi/classfs_1_1_file/#function-rewinddirectory","title":"function rewindDirectory","text":"
void fs::File::rewindDirectory (\n    void\n) \n
"},{"location":"ltapi/classfs_1_1_file/#function-seek-12","title":"function seek [1/2]","text":"
bool fs::File::seek (\n    uint32_t pos,\n    SeekMode mode\n) \n
"},{"location":"ltapi/classfs_1_1_file/#function-seek-22","title":"function seek [2/2]","text":"
inline bool fs::File::seek (\n    uint32_t pos\n) \n
"},{"location":"ltapi/classfs_1_1_file/#function-setbuffersize","title":"function setBufferSize","text":"
bool fs::File::setBufferSize (\n    size_t size\n) \n
"},{"location":"ltapi/classfs_1_1_file/#function-size","title":"function size","text":"
size_t fs::File::size () const\n
"},{"location":"ltapi/classfs_1_1_file/#function-write-12","title":"function write [1/2]","text":"
size_t fs::File::write (\n    uint8_t c\n) override\n
"},{"location":"ltapi/classfs_1_1_file/#function-write-22","title":"function write [2/2]","text":"
size_t fs::File::write (\n    const uint8_t * buf,\n    size_t size\n) override\n
"},{"location":"ltapi/classfs_1_1_file/#protected-attributes-documentation","title":"Protected Attributes Documentation","text":""},{"location":"ltapi/classfs_1_1_file/#variable-_p","title":"variable _p","text":"
FileImplPtr fs::File::_p;\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/FS/FS.h

"},{"location":"ltapi/classfs_1_1_file_impl/","title":"Class fs::FileImpl","text":"

ClassList > fs > FileImpl

"},{"location":"ltapi/classfs_1_1_file_impl/#public-functions","title":"Public Functions","text":"Type Name virtual void close () = 0 virtual void flush () = 0 virtual time_t getLastWrite () = 0 virtual boolean isDirectory (void) = 0 virtual const char * name () const = 0 virtual FileImplPtr openNextFile (const char * mode) = 0 virtual operator bool () = 0 virtual const char * path () const = 0 virtual size_t position () const = 0 virtual size_t read (uint8_t * buf, size_t size) = 0 virtual void rewindDirectory (void) = 0 virtual bool seek (uint32_t pos, SeekMode mode) = 0 virtual bool setBufferSize (size_t size) = 0 virtual size_t size () const = 0 virtual size_t write (const uint8_t * buf, size_t size) = 0 virtual ~FileImpl ()"},{"location":"ltapi/classfs_1_1_file_impl/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/classfs_1_1_file_impl/#function-close","title":"function close","text":"
virtual void fs::FileImpl::close () = 0\n
"},{"location":"ltapi/classfs_1_1_file_impl/#function-flush","title":"function flush","text":"
virtual void fs::FileImpl::flush () = 0\n
"},{"location":"ltapi/classfs_1_1_file_impl/#function-getlastwrite","title":"function getLastWrite","text":"
virtual time_t fs::FileImpl::getLastWrite () = 0\n
"},{"location":"ltapi/classfs_1_1_file_impl/#function-isdirectory","title":"function isDirectory","text":"
virtual boolean fs::FileImpl::isDirectory (\n    void\n) = 0\n
"},{"location":"ltapi/classfs_1_1_file_impl/#function-name","title":"function name","text":"
virtual const char * fs::FileImpl::name () const = 0\n
"},{"location":"ltapi/classfs_1_1_file_impl/#function-opennextfile","title":"function openNextFile","text":"
virtual FileImplPtr fs::FileImpl::openNextFile (\n    const char * mode\n) = 0\n
"},{"location":"ltapi/classfs_1_1_file_impl/#function-operator-bool","title":"function operator bool","text":"
virtual fs::FileImpl::operator bool () = 0\n
"},{"location":"ltapi/classfs_1_1_file_impl/#function-path","title":"function path","text":"
virtual const char * fs::FileImpl::path () const = 0\n
"},{"location":"ltapi/classfs_1_1_file_impl/#function-position","title":"function position","text":"
virtual size_t fs::FileImpl::position () const = 0\n
"},{"location":"ltapi/classfs_1_1_file_impl/#function-read","title":"function read","text":"
virtual size_t fs::FileImpl::read (\n    uint8_t * buf,\n    size_t size\n) = 0\n
"},{"location":"ltapi/classfs_1_1_file_impl/#function-rewinddirectory","title":"function rewindDirectory","text":"
virtual void fs::FileImpl::rewindDirectory (\n    void\n) = 0\n
"},{"location":"ltapi/classfs_1_1_file_impl/#function-seek","title":"function seek","text":"
virtual bool fs::FileImpl::seek (\n    uint32_t pos,\n    SeekMode mode\n) = 0\n
"},{"location":"ltapi/classfs_1_1_file_impl/#function-setbuffersize","title":"function setBufferSize","text":"
virtual bool fs::FileImpl::setBufferSize (\n    size_t size\n) = 0\n
"},{"location":"ltapi/classfs_1_1_file_impl/#function-size","title":"function size","text":"
virtual size_t fs::FileImpl::size () const = 0\n
"},{"location":"ltapi/classfs_1_1_file_impl/#function-write","title":"function write","text":"
virtual size_t fs::FileImpl::write (\n    const uint8_t * buf,\n    size_t size\n) = 0\n
"},{"location":"ltapi/classfs_1_1_file_impl/#function-fileimpl","title":"function ~FileImpl","text":"
inline virtual fs::FileImpl::~FileImpl () \n

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/FS/FS.h

"},{"location":"ltapi/structip__event__ap__staipassigned__t/","title":"Struct ip_event_ap_staipassigned_t","text":"

ClassList > ip_event_ap_staipassigned_t

More...

  • #include <WiFiEvents.h>
"},{"location":"ltapi/structip__event__ap__staipassigned__t/#public-attributes","title":"Public Attributes","text":"Type Name esp_ip4_addr_t ip"},{"location":"ltapi/structip__event__ap__staipassigned__t/#detailed-description","title":"Detailed Description","text":"

Event structure for IP_EVENT_AP_STAIPASSIGNED event

"},{"location":"ltapi/structip__event__ap__staipassigned__t/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/structip__event__ap__staipassigned__t/#variable-ip","title":"variable ip","text":"
esp_ip4_addr_t ip_event_ap_staipassigned_t::ip;\n

IP address which was assigned to the station

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

"},{"location":"ltapi/structip__event__got__ip6__t/","title":"Struct ip_event_got_ip6_t","text":"

ClassList > ip_event_got_ip6_t

More...

  • #include <WiFiEvents.h>
"},{"location":"ltapi/structip__event__got__ip6__t/#public-attributes","title":"Public Attributes","text":"Type Name void * esp_netif int if_index esp_netif_ip6_info_t ip6_info int ip_index"},{"location":"ltapi/structip__event__got__ip6__t/#detailed-description","title":"Detailed Description","text":"

Event structure for IP_EVENT_GOT_IP6 event

"},{"location":"ltapi/structip__event__got__ip6__t/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/structip__event__got__ip6__t/#variable-esp_netif","title":"variable esp_netif","text":"
void* ip_event_got_ip6_t::esp_netif;\n

Pointer to corresponding esp-netif object

"},{"location":"ltapi/structip__event__got__ip6__t/#variable-if_index","title":"variable if_index","text":"
int ip_event_got_ip6_t::if_index;\n

Interface index for which the event is received (left for legacy compilation)

"},{"location":"ltapi/structip__event__got__ip6__t/#variable-ip6_info","title":"variable ip6_info","text":"
esp_netif_ip6_info_t ip_event_got_ip6_t::ip6_info;\n

IPv6 address of the interface

"},{"location":"ltapi/structip__event__got__ip6__t/#variable-ip_index","title":"variable ip_index","text":"
int ip_event_got_ip6_t::ip_index;\n

IPv6 address index

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

"},{"location":"ltapi/structip__event__got__ip__t/","title":"Struct ip_event_got_ip_t","text":"

ClassList > ip_event_got_ip_t

"},{"location":"ltapi/structip__event__got__ip__t/#public-attributes","title":"Public Attributes","text":"Type Name void * esp_netif int if_index bool ip_changed esp_netif_ip_info_t ip_info"},{"location":"ltapi/structip__event__got__ip__t/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/structip__event__got__ip__t/#variable-esp_netif","title":"variable esp_netif","text":"
void* ip_event_got_ip_t::esp_netif;\n

Pointer to corresponding esp-netif object

"},{"location":"ltapi/structip__event__got__ip__t/#variable-if_index","title":"variable if_index","text":"
int ip_event_got_ip_t::if_index;\n

Interface index for which the event is received (left for legacy compilation)

"},{"location":"ltapi/structip__event__got__ip__t/#variable-ip_changed","title":"variable ip_changed","text":"
bool ip_event_got_ip_t::ip_changed;\n

Whether the assigned IP has changed or not

"},{"location":"ltapi/structip__event__got__ip__t/#variable-ip_info","title":"variable ip_info","text":"
esp_netif_ip_info_t ip_event_got_ip_t::ip_info;\n

IP address, netmask, gatway IP address

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

"},{"location":"ltapi/structlt__flash__id__t/","title":"Struct lt_flash_id_t","text":"

ClassList > lt_flash_id_t

Flash chip ID structure.

  • #include <lt_flash.h>
"},{"location":"ltapi/structlt__flash__id__t/#public-attributes","title":"Public Attributes","text":"Type Name uint8_t chip_id uint8_t chip_size_id uint8_t manufacturer_id"},{"location":"ltapi/structlt__flash__id__t/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/structlt__flash__id__t/#variable-chip_id","title":"variable chip_id","text":"
uint8_t lt_flash_id_t::chip_id;\n
"},{"location":"ltapi/structlt__flash__id__t/#variable-chip_size_id","title":"variable chip_size_id","text":"
uint8_t lt_flash_id_t::chip_size_id;\n
"},{"location":"ltapi/structlt__flash__id__t/#variable-manufacturer_id","title":"variable manufacturer_id","text":"
uint8_t lt_flash_id_t::manufacturer_id;\n

The documentation for this class was generated from the following file cores/common/base/api/lt_flash.h

"},{"location":"ltapi/structlt__ota__ctx__t/","title":"Struct lt_ota_ctx_t","text":"

ClassList > lt_ota_ctx_t

OTA update process context.

  • #include <lt_ota.h>
"},{"location":"ltapi/structlt__ota__ctx__t/#public-attributes","title":"Public Attributes","text":"Type Name uint8_t buf uint8_t * buf_pos uint32_t bytes_total uint32_t bytes_written void(* callback void * callback_param uf2_err_t error uf2_info_t info bool running uf2_ota_t uf2"},{"location":"ltapi/structlt__ota__ctx__t/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/structlt__ota__ctx__t/#variable-buf","title":"variable buf","text":"
uint8_t lt_ota_ctx_t::buf[UF2_BLOCK_SIZE];\n
"},{"location":"ltapi/structlt__ota__ctx__t/#variable-buf_pos","title":"variable buf_pos","text":"
uint8_t* lt_ota_ctx_t::buf_pos;\n
"},{"location":"ltapi/structlt__ota__ctx__t/#variable-bytes_total","title":"variable bytes_total","text":"
uint32_t lt_ota_ctx_t::bytes_total;\n
"},{"location":"ltapi/structlt__ota__ctx__t/#variable-bytes_written","title":"variable bytes_written","text":"
uint32_t lt_ota_ctx_t::bytes_written;\n
"},{"location":"ltapi/structlt__ota__ctx__t/#variable-callback","title":"variable callback","text":"
void(* lt_ota_ctx_t::callback) (void *param);\n
"},{"location":"ltapi/structlt__ota__ctx__t/#variable-callback_param","title":"variable callback_param","text":"
void* lt_ota_ctx_t::callback_param;\n
"},{"location":"ltapi/structlt__ota__ctx__t/#variable-error","title":"variable error","text":"
uf2_err_t lt_ota_ctx_t::error;\n
"},{"location":"ltapi/structlt__ota__ctx__t/#variable-info","title":"variable info","text":"
uf2_info_t lt_ota_ctx_t::info;\n
"},{"location":"ltapi/structlt__ota__ctx__t/#variable-running","title":"variable running","text":"
bool lt_ota_ctx_t::running;\n
"},{"location":"ltapi/structlt__ota__ctx__t/#variable-uf2","title":"variable uf2","text":"
uf2_ota_t lt_ota_ctx_t::uf2;\n

The documentation for this class was generated from the following file cores/common/base/api/lt_ota.h

"},{"location":"ltapi/classm_d_n_s/","title":"Class mDNS","text":"

ClassList > mDNS

"},{"location":"ltapi/classm_d_n_s/#public-functions","title":"Public Functions","text":"Type Name IPAddress IP (int idx) IPv6Address IPv6 (int idx) bool addService (char * service, char * proto, uint16_t port) bool addService (const char * service, const char * proto, uint16_t port) bool addService (String service, String proto, uint16_t port) bool addServiceTxt (char * service, char * proto, char * key, char * value) void addServiceTxt (const char * service, const char * proto, const char * key, const char * value) void addServiceTxt (String service, String proto, String key, String value) bool begin (const char * hostname) void end () bool hasTxt (int idx, const char * key) String hostname (int idx) mDNS () int numTxt (int idx) uint16_t port (int idx) IPAddress queryHost (char * host, uint32_t timeout=2000) IPAddress queryHost (const char * host, uint32_t timeout=2000) IPAddress queryHost (String host, uint32_t timeout=2000) int queryService (char * service, char * proto) int queryService (const char * service, const char * proto) int queryService (String service, String proto) void setInstanceName (const char * name) void setInstanceName (String name) void setInstanceName (char * name) String txt (int idx, const char * key) String txt (int idx, int txtIdx) String txtKey (int idx, int txtIdx) ~mDNS ()"},{"location":"ltapi/classm_d_n_s/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/classm_d_n_s/#function-ip","title":"function IP","text":"
IPAddress mDNS::IP (\n    int idx\n) \n
"},{"location":"ltapi/classm_d_n_s/#function-ipv6","title":"function IPv6","text":"
IPv6Address mDNS::IPv6 (\n    int idx\n) \n
"},{"location":"ltapi/classm_d_n_s/#function-addservice-13","title":"function addService [1/3]","text":"
bool mDNS::addService (\n    char * service,\n    char * proto,\n    uint16_t port\n) \n
"},{"location":"ltapi/classm_d_n_s/#function-addservice-23","title":"function addService [2/3]","text":"
inline bool mDNS::addService (\n    const char * service,\n    const char * proto,\n    uint16_t port\n) \n
"},{"location":"ltapi/classm_d_n_s/#function-addservice-33","title":"function addService [3/3]","text":"
inline bool mDNS::addService (\n    String service,\n    String proto,\n    uint16_t port\n) \n
"},{"location":"ltapi/classm_d_n_s/#function-addservicetxt-13","title":"function addServiceTxt [1/3]","text":"
bool mDNS::addServiceTxt (\n    char * service,\n    char * proto,\n    char * key,\n    char * value\n) \n
"},{"location":"ltapi/classm_d_n_s/#function-addservicetxt-23","title":"function addServiceTxt [2/3]","text":"
inline void mDNS::addServiceTxt (\n    const char * service,\n    const char * proto,\n    const char * key,\n    const char * value\n) \n
"},{"location":"ltapi/classm_d_n_s/#function-addservicetxt-33","title":"function addServiceTxt [3/3]","text":"
inline void mDNS::addServiceTxt (\n    String service,\n    String proto,\n    String key,\n    String value\n) \n
"},{"location":"ltapi/classm_d_n_s/#function-begin","title":"function begin","text":"
bool mDNS::begin (\n    const char * hostname\n) \n
"},{"location":"ltapi/classm_d_n_s/#function-end","title":"function end","text":"
void mDNS::end () \n
"},{"location":"ltapi/classm_d_n_s/#function-hastxt","title":"function hasTxt","text":"
bool mDNS::hasTxt (\n    int idx,\n    const char * key\n) \n
"},{"location":"ltapi/classm_d_n_s/#function-hostname","title":"function hostname","text":"
String mDNS::hostname (\n    int idx\n) \n
"},{"location":"ltapi/classm_d_n_s/#function-mdns","title":"function mDNS","text":"
mDNS::mDNS () \n
"},{"location":"ltapi/classm_d_n_s/#function-numtxt","title":"function numTxt","text":"
int mDNS::numTxt (\n    int idx\n) \n
"},{"location":"ltapi/classm_d_n_s/#function-port","title":"function port","text":"
uint16_t mDNS::port (\n    int idx\n) \n
"},{"location":"ltapi/classm_d_n_s/#function-queryhost-13","title":"function queryHost [1/3]","text":"
IPAddress mDNS::queryHost (\n    char * host,\n    uint32_t timeout=2000\n) \n
"},{"location":"ltapi/classm_d_n_s/#function-queryhost-23","title":"function queryHost [2/3]","text":"
inline IPAddress mDNS::queryHost (\n    const char * host,\n    uint32_t timeout=2000\n) \n
"},{"location":"ltapi/classm_d_n_s/#function-queryhost-33","title":"function queryHost [3/3]","text":"
inline IPAddress mDNS::queryHost (\n    String host,\n    uint32_t timeout=2000\n) \n
"},{"location":"ltapi/classm_d_n_s/#function-queryservice-13","title":"function queryService [1/3]","text":"
int mDNS::queryService (\n    char * service,\n    char * proto\n) \n
"},{"location":"ltapi/classm_d_n_s/#function-queryservice-23","title":"function queryService [2/3]","text":"
inline int mDNS::queryService (\n    const char * service,\n    const char * proto\n) \n
"},{"location":"ltapi/classm_d_n_s/#function-queryservice-33","title":"function queryService [3/3]","text":"
inline int mDNS::queryService (\n    String service,\n    String proto\n) \n
"},{"location":"ltapi/classm_d_n_s/#function-setinstancename-13","title":"function setInstanceName [1/3]","text":"
void mDNS::setInstanceName (\n    const char * name\n) \n
"},{"location":"ltapi/classm_d_n_s/#function-setinstancename-23","title":"function setInstanceName [2/3]","text":"
inline void mDNS::setInstanceName (\n    String name\n) \n
"},{"location":"ltapi/classm_d_n_s/#function-setinstancename-33","title":"function setInstanceName [3/3]","text":"
inline void mDNS::setInstanceName (\n    char * name\n) \n
"},{"location":"ltapi/classm_d_n_s/#function-txt-12","title":"function txt [1/2]","text":"
String mDNS::txt (\n    int idx,\n    const char * key\n) \n
"},{"location":"ltapi/classm_d_n_s/#function-txt-22","title":"function txt [2/2]","text":"
String mDNS::txt (\n    int idx,\n    int txtIdx\n) \n
"},{"location":"ltapi/classm_d_n_s/#function-txtkey","title":"function txtKey","text":"
String mDNS::txtKey (\n    int idx,\n    int txtIdx\n) \n
"},{"location":"ltapi/classm_d_n_s/#function-mdns_1","title":"function ~mDNS","text":"
mDNS::~mDNS () \n

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/mDNS/mDNS.h

"},{"location":"ltapi/structmbedtls__md5__context/","title":"Struct mbedtls_md5_context","text":"

ClassList > mbedtls_md5_context

"},{"location":"ltapi/structmbedtls__md5__context/#public-attributes","title":"Public Attributes","text":"Type Name unsigned char buffer unsigned long state unsigned long total"},{"location":"ltapi/structmbedtls__md5__context/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/structmbedtls__md5__context/#variable-buffer","title":"variable buffer","text":"
unsigned char mbedtls_md5_context::buffer[64];\n

data block being processed

"},{"location":"ltapi/structmbedtls__md5__context/#variable-state","title":"variable state","text":"
unsigned long mbedtls_md5_context::state[4];\n

intermediate digest state

"},{"location":"ltapi/structmbedtls__md5__context/#variable-total","title":"variable total","text":"
unsigned long mbedtls_md5_context::total[2];\n

number of bytes processed

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/MD5/MD5MbedTLSImpl.h

"},{"location":"ltapi/namespacemime/","title":"Namespace mime","text":"

Namespace List > mime

"},{"location":"ltapi/namespacemime/#classes","title":"Classes","text":"Type Name struct Entry"},{"location":"ltapi/namespacemime/#public-types","title":"Public Types","text":"Type Name enum type"},{"location":"ltapi/namespacemime/#public-attributes","title":"Public Attributes","text":"Type Name const Entry mimeTable = = { {\".html\", \"text/html\" }, {\".htm\", \"text/html\" }, {\".css\", \"text/css\" }, {\".txt\", \"text/plain\" }, {\".js\", \"application/javascript\" }, {\".json\", \"application/json\" }, {\".png\", \"image/png\" }, {\".gif\", \"image/gif\" }, {\".jpg\", \"image/jpeg\" }, {\".ico\", \"image/x-icon\" }, {\".svg\", \"image/svg+xml\" }, {\".ttf\", \"application/x-font-ttf\" }, {\".otf\", \"application/x-font-opentype\" }, {\".woff\", \"application/font-woff\" }, {\".woff2\", \"application/font-woff2\" }, {\".eot\", \"application/vnd.ms-fontobject\"}, {\".sfnt\", \"application/font-sfnt\" }, {\".xml\", \"text/xml\" }, {\".pdf\", \"application/pdf\" }, {\".zip\", \"application/zip\" }, {\".gz\", \"application/x-gzip\" }, {\".appcache\", \"text/cache-manifest\" }, {\"\", \"application/octet-stream\" } }"},{"location":"ltapi/namespacemime/#public-types-documentation","title":"Public Types Documentation","text":""},{"location":"ltapi/namespacemime/#enum-type","title":"enum type","text":"
enum mime::type {\n    html,\n    htm,\n    css,\n    txt,\n    js,\n    json,\n    png,\n    gif,\n    jpg,\n    ico,\n    svg,\n    ttf,\n    otf,\n    woff,\n    woff2,\n    eot,\n    sfnt,\n    xml,\n    pdf,\n    zip,\n    gz,\n    appcache,\n    none,\n    maxType\n};\n
"},{"location":"ltapi/namespacemime/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/namespacemime/#variable-mimetable","title":"variable mimeTable","text":"
const Entry mime::mimeTable;\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/detail/mimetable.cpp

"},{"location":"ltapi/structmime_1_1_entry/","title":"Struct mime::Entry","text":"

ClassList > mime > Entry

"},{"location":"ltapi/structmime_1_1_entry/#public-attributes","title":"Public Attributes","text":"Type Name const char endsWith const char mimeType"},{"location":"ltapi/structmime_1_1_entry/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/structmime_1_1_entry/#variable-endswith","title":"variable endsWith","text":"
const char mime::Entry::endsWith[16];\n
"},{"location":"ltapi/structmime_1_1_entry/#variable-mimetype","title":"variable mimeType","text":"
const char mime::Entry::mimeType[32];\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/detail/mimetable.h

"},{"location":"ltapi/structwifi__event__action__tx__status__t/","title":"Struct wifi_event_action_tx_status_t","text":"

ClassList > wifi_event_action_tx_status_t

More...

  • #include <WiFiEvents.h>
"},{"location":"ltapi/structwifi__event__action__tx__status__t/#public-attributes","title":"Public Attributes","text":"Type Name uint32_t context uint8_t da int ifx uint8_t status"},{"location":"ltapi/structwifi__event__action__tx__status__t/#detailed-description","title":"Detailed Description","text":"

Argument structure for WIFI_EVENT_ACTION_TX_STATUS event

"},{"location":"ltapi/structwifi__event__action__tx__status__t/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/structwifi__event__action__tx__status__t/#variable-context","title":"variable context","text":"
uint32_t wifi_event_action_tx_status_t::context;\n

Context to identify the request

"},{"location":"ltapi/structwifi__event__action__tx__status__t/#variable-da","title":"variable da","text":"
uint8_t wifi_event_action_tx_status_t::da[6];\n

Destination MAC address

"},{"location":"ltapi/structwifi__event__action__tx__status__t/#variable-ifx","title":"variable ifx","text":"
int wifi_event_action_tx_status_t::ifx;\n

WiFi interface to send request to

"},{"location":"ltapi/structwifi__event__action__tx__status__t/#variable-status","title":"variable status","text":"
uint8_t wifi_event_action_tx_status_t::status;\n

Status of the operation

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

"},{"location":"ltapi/structwifi__event__ap__probe__req__rx__t/","title":"Struct wifi_event_ap_probe_req_rx_t","text":"

ClassList > wifi_event_ap_probe_req_rx_t

More...

  • #include <WiFiEvents.h>
"},{"location":"ltapi/structwifi__event__ap__probe__req__rx__t/#public-attributes","title":"Public Attributes","text":"Type Name uint8_t mac int rssi"},{"location":"ltapi/structwifi__event__ap__probe__req__rx__t/#detailed-description","title":"Detailed Description","text":"

Argument structure for WIFI_EVENT_AP_PROBEREQRECVED event

"},{"location":"ltapi/structwifi__event__ap__probe__req__rx__t/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/structwifi__event__ap__probe__req__rx__t/#variable-mac","title":"variable mac","text":"
uint8_t wifi_event_ap_probe_req_rx_t::mac[6];\n

MAC address of the station which send probe request

"},{"location":"ltapi/structwifi__event__ap__probe__req__rx__t/#variable-rssi","title":"variable rssi","text":"
int wifi_event_ap_probe_req_rx_t::rssi;\n

Received probe request signal strength

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

"},{"location":"ltapi/structwifi__event__ap__staconnected__t/","title":"Struct wifi_event_ap_staconnected_t","text":"

ClassList > wifi_event_ap_staconnected_t

More...

  • #include <WiFiEvents.h>
"},{"location":"ltapi/structwifi__event__ap__staconnected__t/#public-attributes","title":"Public Attributes","text":"Type Name uint8_t aid bool is_mesh_child uint8_t mac"},{"location":"ltapi/structwifi__event__ap__staconnected__t/#detailed-description","title":"Detailed Description","text":"

Argument structure for WIFI_EVENT_AP_STACONNECTED event

"},{"location":"ltapi/structwifi__event__ap__staconnected__t/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/structwifi__event__ap__staconnected__t/#variable-aid","title":"variable aid","text":"
uint8_t wifi_event_ap_staconnected_t::aid;\n

the aid that ESP32 soft-AP gives to the station connected to

"},{"location":"ltapi/structwifi__event__ap__staconnected__t/#variable-is_mesh_child","title":"variable is_mesh_child","text":"
bool wifi_event_ap_staconnected_t::is_mesh_child;\n

flag to identify mesh child

"},{"location":"ltapi/structwifi__event__ap__staconnected__t/#variable-mac","title":"variable mac","text":"
uint8_t wifi_event_ap_staconnected_t::mac[6];\n

MAC address of the station connected to ESP32 soft-AP

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

"},{"location":"ltapi/structwifi__event__ap__stadisconnected__t/","title":"Struct wifi_event_ap_stadisconnected_t","text":"

ClassList > wifi_event_ap_stadisconnected_t

More...

  • #include <WiFiEvents.h>
"},{"location":"ltapi/structwifi__event__ap__stadisconnected__t/#public-attributes","title":"Public Attributes","text":"Type Name uint8_t aid bool is_mesh_child uint8_t mac"},{"location":"ltapi/structwifi__event__ap__stadisconnected__t/#detailed-description","title":"Detailed Description","text":"

Argument structure for WIFI_EVENT_AP_STADISCONNECTED event

"},{"location":"ltapi/structwifi__event__ap__stadisconnected__t/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/structwifi__event__ap__stadisconnected__t/#variable-aid","title":"variable aid","text":"
uint8_t wifi_event_ap_stadisconnected_t::aid;\n

the aid that ESP32 soft-AP gave to the station disconnects to

"},{"location":"ltapi/structwifi__event__ap__stadisconnected__t/#variable-is_mesh_child","title":"variable is_mesh_child","text":"
bool wifi_event_ap_stadisconnected_t::is_mesh_child;\n

flag to identify mesh child

"},{"location":"ltapi/structwifi__event__ap__stadisconnected__t/#variable-mac","title":"variable mac","text":"
uint8_t wifi_event_ap_stadisconnected_t::mac[6];\n

MAC address of the station disconnects to ESP32 soft-AP

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

"},{"location":"ltapi/structwifi__event__ftm__report__t/","title":"Struct wifi_event_ftm_report_t","text":"

ClassList > wifi_event_ftm_report_t

More...

  • #include <WiFiEvents.h>
"},{"location":"ltapi/structwifi__event__ftm__report__t/#public-attributes","title":"Public Attributes","text":"Type Name uint32_t dist_est wifi_ftm_report_entry_t * ftm_report_data uint8_t ftm_report_num_entries uint8_t peer_mac uint32_t rtt_est uint32_t rtt_raw wifi_ftm_status_t status"},{"location":"ltapi/structwifi__event__ftm__report__t/#detailed-description","title":"Detailed Description","text":"

Argument structure for WIFI_EVENT_FTM_REPORT event

"},{"location":"ltapi/structwifi__event__ftm__report__t/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/structwifi__event__ftm__report__t/#variable-dist_est","title":"variable dist_est","text":"
uint32_t wifi_event_ftm_report_t::dist_est;\n

Estimated one-way distance in Centi-Meters

"},{"location":"ltapi/structwifi__event__ftm__report__t/#variable-ftm_report_data","title":"variable ftm_report_data","text":"
wifi_ftm_report_entry_t* wifi_event_ftm_report_t::ftm_report_data;\n

Pointer to FTM Report with multiple entries, should be freed after use

"},{"location":"ltapi/structwifi__event__ftm__report__t/#variable-ftm_report_num_entries","title":"variable ftm_report_num_entries","text":"
uint8_t wifi_event_ftm_report_t::ftm_report_num_entries;\n

Number of entries in the FTM Report data

"},{"location":"ltapi/structwifi__event__ftm__report__t/#variable-peer_mac","title":"variable peer_mac","text":"
uint8_t wifi_event_ftm_report_t::peer_mac[6];\n

MAC address of the FTM Peer

"},{"location":"ltapi/structwifi__event__ftm__report__t/#variable-rtt_est","title":"variable rtt_est","text":"
uint32_t wifi_event_ftm_report_t::rtt_est;\n

Estimated Round-Trip-Time with peer in Nano-Seconds

"},{"location":"ltapi/structwifi__event__ftm__report__t/#variable-rtt_raw","title":"variable rtt_raw","text":"
uint32_t wifi_event_ftm_report_t::rtt_raw;\n

Raw average Round-Trip-Time with peer in Nano-Seconds

"},{"location":"ltapi/structwifi__event__ftm__report__t/#variable-status","title":"variable status","text":"
wifi_ftm_status_t wifi_event_ftm_report_t::status;\n

Status of the FTM operation

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

"},{"location":"ltapi/structwifi__event__roc__done__t/","title":"Struct wifi_event_roc_done_t","text":"

ClassList > wifi_event_roc_done_t

More...

  • #include <WiFiEvents.h>
"},{"location":"ltapi/structwifi__event__roc__done__t/#public-attributes","title":"Public Attributes","text":"Type Name uint32_t context"},{"location":"ltapi/structwifi__event__roc__done__t/#detailed-description","title":"Detailed Description","text":"

Argument structure for WIFI_EVENT_ROC_DONE event

"},{"location":"ltapi/structwifi__event__roc__done__t/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/structwifi__event__roc__done__t/#variable-context","title":"variable context","text":"
uint32_t wifi_event_roc_done_t::context;\n

Context to identify the request

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

"},{"location":"ltapi/structwifi__event__sta__authmode__change__t/","title":"Struct wifi_event_sta_authmode_change_t","text":"

ClassList > wifi_event_sta_authmode_change_t

More...

  • #include <WiFiEvents.h>
"},{"location":"ltapi/structwifi__event__sta__authmode__change__t/#public-attributes","title":"Public Attributes","text":"Type Name wifi_auth_mode_t new_mode wifi_auth_mode_t old_mode"},{"location":"ltapi/structwifi__event__sta__authmode__change__t/#detailed-description","title":"Detailed Description","text":"

Argument structure for WIFI_EVENT_STA_AUTHMODE_CHANGE event

"},{"location":"ltapi/structwifi__event__sta__authmode__change__t/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/structwifi__event__sta__authmode__change__t/#variable-new_mode","title":"variable new_mode","text":"
wifi_auth_mode_t wifi_event_sta_authmode_change_t::new_mode;\n

the new auth mode of AP

"},{"location":"ltapi/structwifi__event__sta__authmode__change__t/#variable-old_mode","title":"variable old_mode","text":"
wifi_auth_mode_t wifi_event_sta_authmode_change_t::old_mode;\n

the old auth mode of AP

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

"},{"location":"ltapi/structwifi__event__sta__connected__t/","title":"Struct wifi_event_sta_connected_t","text":"

ClassList > wifi_event_sta_connected_t

More...

  • #include <WiFiEvents.h>
"},{"location":"ltapi/structwifi__event__sta__connected__t/#public-attributes","title":"Public Attributes","text":"Type Name wifi_auth_mode_t authmode uint8_t bssid uint8_t channel uint8_t ssid uint8_t ssid_len"},{"location":"ltapi/structwifi__event__sta__connected__t/#detailed-description","title":"Detailed Description","text":"

Argument structure for WIFI_EVENT_STA_CONNECTED event

"},{"location":"ltapi/structwifi__event__sta__connected__t/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/structwifi__event__sta__connected__t/#variable-authmode","title":"variable authmode","text":"
wifi_auth_mode_t wifi_event_sta_connected_t::authmode;\n

authentication mode used by AP

"},{"location":"ltapi/structwifi__event__sta__connected__t/#variable-bssid","title":"variable bssid","text":"
uint8_t wifi_event_sta_connected_t::bssid[6];\n

BSSID of connected AP

"},{"location":"ltapi/structwifi__event__sta__connected__t/#variable-channel","title":"variable channel","text":"
uint8_t wifi_event_sta_connected_t::channel;\n

channel of connected AP

"},{"location":"ltapi/structwifi__event__sta__connected__t/#variable-ssid","title":"variable ssid","text":"
uint8_t wifi_event_sta_connected_t::ssid[32];\n

SSID of connected AP

"},{"location":"ltapi/structwifi__event__sta__connected__t/#variable-ssid_len","title":"variable ssid_len","text":"
uint8_t wifi_event_sta_connected_t::ssid_len;\n

SSID length of connected AP

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

"},{"location":"ltapi/structwifi__event__sta__disconnected__t/","title":"Struct wifi_event_sta_disconnected_t","text":"

ClassList > wifi_event_sta_disconnected_t

More...

  • #include <WiFiEvents.h>
"},{"location":"ltapi/structwifi__event__sta__disconnected__t/#public-attributes","title":"Public Attributes","text":"Type Name uint8_t bssid uint8_t reason uint8_t ssid uint8_t ssid_len"},{"location":"ltapi/structwifi__event__sta__disconnected__t/#detailed-description","title":"Detailed Description","text":"

Argument structure for WIFI_EVENT_STA_DISCONNECTED event

"},{"location":"ltapi/structwifi__event__sta__disconnected__t/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/structwifi__event__sta__disconnected__t/#variable-bssid","title":"variable bssid","text":"
uint8_t wifi_event_sta_disconnected_t::bssid[6];\n

BSSID of disconnected AP

"},{"location":"ltapi/structwifi__event__sta__disconnected__t/#variable-reason","title":"variable reason","text":"
uint8_t wifi_event_sta_disconnected_t::reason;\n

reason of disconnection

"},{"location":"ltapi/structwifi__event__sta__disconnected__t/#variable-ssid","title":"variable ssid","text":"
uint8_t wifi_event_sta_disconnected_t::ssid[32];\n

SSID of disconnected AP

"},{"location":"ltapi/structwifi__event__sta__disconnected__t/#variable-ssid_len","title":"variable ssid_len","text":"
uint8_t wifi_event_sta_disconnected_t::ssid_len;\n

SSID length of disconnected AP

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

"},{"location":"ltapi/structwifi__event__sta__scan__done__t/","title":"Struct wifi_event_sta_scan_done_t","text":"

ClassList > wifi_event_sta_scan_done_t

More...

  • #include <WiFiEvents.h>
"},{"location":"ltapi/structwifi__event__sta__scan__done__t/#public-attributes","title":"Public Attributes","text":"Type Name uint8_t number uint8_t scan_id uint32_t status"},{"location":"ltapi/structwifi__event__sta__scan__done__t/#detailed-description","title":"Detailed Description","text":"

Argument structure for WIFI_EVENT_SCAN_DONE event

"},{"location":"ltapi/structwifi__event__sta__scan__done__t/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/structwifi__event__sta__scan__done__t/#variable-number","title":"variable number","text":"
uint8_t wifi_event_sta_scan_done_t::number;\n

number of scan results

"},{"location":"ltapi/structwifi__event__sta__scan__done__t/#variable-scan_id","title":"variable scan_id","text":"
uint8_t wifi_event_sta_scan_done_t::scan_id;\n

scan sequence number, used for block scan

"},{"location":"ltapi/structwifi__event__sta__scan__done__t/#variable-status","title":"variable status","text":"
uint32_t wifi_event_sta_scan_done_t::status;\n

status of scanning APs: 0 - success, 1 - failure

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

"},{"location":"ltapi/structwifi__event__sta__wps__er__pin__t/","title":"Struct wifi_event_sta_wps_er_pin_t","text":"

ClassList > wifi_event_sta_wps_er_pin_t

More...

  • #include <WiFiEvents.h>
"},{"location":"ltapi/structwifi__event__sta__wps__er__pin__t/#public-attributes","title":"Public Attributes","text":"Type Name uint8_t pin_code"},{"location":"ltapi/structwifi__event__sta__wps__er__pin__t/#detailed-description","title":"Detailed Description","text":"

Argument structure for WIFI_EVENT_STA_WPS_ER_PIN event

"},{"location":"ltapi/structwifi__event__sta__wps__er__pin__t/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/structwifi__event__sta__wps__er__pin__t/#variable-pin_code","title":"variable pin_code","text":"
uint8_t wifi_event_sta_wps_er_pin_t::pin_code[8];\n

PIN code of station in enrollee mode

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

"},{"location":"ltapi/structwifi__event__sta__wps__er__success__t/","title":"Struct wifi_event_sta_wps_er_success_t","text":"

ClassList > wifi_event_sta_wps_er_success_t

More...

  • #include <WiFiEvents.h>
"},{"location":"ltapi/structwifi__event__sta__wps__er__success__t/#public-attributes","title":"Public Attributes","text":"Type Name struct wifi_event_sta_wps_er_success_t::@0 ap_cred uint8_t ap_cred_cnt uint8_t passphrase uint8_t ssid"},{"location":"ltapi/structwifi__event__sta__wps__er__success__t/#detailed-description","title":"Detailed Description","text":"

Argument structure for WIFI_EVENT_STA_WPS_ER_SUCCESS event

"},{"location":"ltapi/structwifi__event__sta__wps__er__success__t/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/structwifi__event__sta__wps__er__success__t/#variable-ap_cred","title":"variable ap_cred","text":"
struct wifi_event_sta_wps_er_success_t::@0 wifi_event_sta_wps_er_success_t::ap_cred[MAX_WPS_AP_CRED];\n

All AP credentials received from WPS handshake

"},{"location":"ltapi/structwifi__event__sta__wps__er__success__t/#variable-ap_cred_cnt","title":"variable ap_cred_cnt","text":"
uint8_t wifi_event_sta_wps_er_success_t::ap_cred_cnt;\n

Number of AP credentials received

"},{"location":"ltapi/structwifi__event__sta__wps__er__success__t/#variable-passphrase","title":"variable passphrase","text":"
uint8_t wifi_event_sta_wps_er_success_t::passphrase[MAX_PASSPHRASE_LEN];\n

Passphrase for the AP

"},{"location":"ltapi/structwifi__event__sta__wps__er__success__t/#variable-ssid","title":"variable ssid","text":"
uint8_t wifi_event_sta_wps_er_success_t::ssid[MAX_SSID_LEN];\n

SSID of AP

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

"},{"location":"ltapi/structwifi__ftm__report__entry__t/","title":"Struct wifi_ftm_report_entry_t","text":"

ClassList > wifi_ftm_report_entry_t

More...

  • #include <WiFiEvents.h>
"},{"location":"ltapi/structwifi__ftm__report__entry__t/#public-attributes","title":"Public Attributes","text":"Type Name uint8_t dlog_token int8_t rssi uint32_t rtt uint64_t t1 uint64_t t2 uint64_t t3 uint64_t t4"},{"location":"ltapi/structwifi__ftm__report__entry__t/#detailed-description","title":"Detailed Description","text":"

Argument structure for

"},{"location":"ltapi/structwifi__ftm__report__entry__t/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/structwifi__ftm__report__entry__t/#variable-dlog_token","title":"variable dlog_token","text":"
uint8_t wifi_ftm_report_entry_t::dlog_token;\n

Dialog Token of the FTM frame

"},{"location":"ltapi/structwifi__ftm__report__entry__t/#variable-rssi","title":"variable rssi","text":"
int8_t wifi_ftm_report_entry_t::rssi;\n

RSSI of the FTM frame received

"},{"location":"ltapi/structwifi__ftm__report__entry__t/#variable-rtt","title":"variable rtt","text":"
uint32_t wifi_ftm_report_entry_t::rtt;\n

Round Trip Time in pSec with a peer

"},{"location":"ltapi/structwifi__ftm__report__entry__t/#variable-t1","title":"variable t1","text":"
uint64_t wifi_ftm_report_entry_t::t1;\n

Time of departure of FTM frame from FTM Responder in pSec

"},{"location":"ltapi/structwifi__ftm__report__entry__t/#variable-t2","title":"variable t2","text":"
uint64_t wifi_ftm_report_entry_t::t2;\n

Time of arrival of FTM frame at FTM Initiator in pSec

"},{"location":"ltapi/structwifi__ftm__report__entry__t/#variable-t3","title":"variable t3","text":"
uint64_t wifi_ftm_report_entry_t::t3;\n

Time of departure of ACK from FTM Initiator in pSec

"},{"location":"ltapi/structwifi__ftm__report__entry__t/#variable-t4","title":"variable t4","text":"
uint64_t wifi_ftm_report_entry_t::t4;\n

Time of arrival of ACK at FTM Responder in pSec

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

"},{"location":"ltapi/dir_51d9c9f08f6806a0f97badf342e5b4d7/","title":"Dir cores","text":"

FileList > cores

"},{"location":"ltapi/dir_51d9c9f08f6806a0f97badf342e5b4d7/#directories","title":"Directories","text":"Type Name dir common

The documentation for this class was generated from the following file cores/

"},{"location":"ltapi/dir_061390acc221bc2d9c9cb2f4362dac1d/","title":"Dir cores/common","text":"

FileList > common

"},{"location":"ltapi/dir_061390acc221bc2d9c9cb2f4362dac1d/#directories","title":"Directories","text":"Type Name dir arduino dir base

The documentation for this class was generated from the following file cores/common/

"},{"location":"ltapi/dir_b638d0c61cb610adbc247035a3e10d3e/","title":"Dir cores/common/arduino","text":"

FileList > arduino

"},{"location":"ltapi/dir_b638d0c61cb610adbc247035a3e10d3e/#directories","title":"Directories","text":"Type Name dir libraries dir src

The documentation for this class was generated from the following file cores/common/arduino/

"},{"location":"ltapi/dir_368b4a9ec74cf1c10b8199770b5e2c1b/","title":"Dir cores/common/arduino/libraries","text":"

FileList > arduino > libraries

"},{"location":"ltapi/dir_368b4a9ec74cf1c10b8199770b5e2c1b/#directories","title":"Directories","text":"Type Name dir api dir common dir ext dir inline

The documentation for this class was generated from the following file cores/common/arduino/libraries/

"},{"location":"ltapi/dir_e15f2f53a75910fcd29e18d04ab3723d/","title":"Dir cores/common/arduino/libraries/api","text":"

FileList > api

"},{"location":"ltapi/dir_e15f2f53a75910fcd29e18d04ab3723d/#directories","title":"Directories","text":"Type Name dir Serial dir SoftwareSerial dir WiFi

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/

"},{"location":"ltapi/dir_5e75bcdb2ffaceb01f94db1177614a08/","title":"Dir cores/common/arduino/libraries/api/Serial","text":"

FileList > api > Serial

"},{"location":"ltapi/dir_5e75bcdb2ffaceb01f94db1177614a08/#files","title":"Files","text":"Type Name file Serial.cpp file Serial.h

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/Serial/

"},{"location":"ltapi/_serial_8cpp/","title":"File Serial.cpp","text":"

FileList > api > Serial > Serial.cpp

Go to the source code of this file.

  • #include \"Serial.h\"

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/Serial/Serial.cpp

"},{"location":"ltapi/_serial_8cpp_source/","title":"File Serial.cpp","text":"

File List > api > Serial > Serial.cpp

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2023-05-23. */\n\n#include \"Serial.h\"\n\nSerialClass::SerialClass(uint32_t port, pin_size_t rx, pin_size_t tx) {\n    this->port = port;\n    this->rx   = rx;\n    this->tx   = tx;\n    this->buf  = NULL;\n    this->data = NULL;\n}\n\n#if LT_AUTO_DOWNLOAD_REBOOT && defined(LT_UART_ADR_PATTERN)\nstatic uint8_t adrState = 0;\nstatic uint8_t adrCmd[] = {LT_UART_ADR_PATTERN};\n\nvoid SerialClass::adrParse(uint8_t c) {\n    adrState = (adrState + 1) * (c == adrCmd[adrState]);\n    if (adrState == sizeof(adrCmd) / sizeof(uint8_t)) {\n        LT_I(\"Auto download mode: rebooting\");\n        LT.restartDownloadMode();\n    }\n}\n#endif\n\nint SerialClass::available() {\n    return this->buf ? this->buf->available() : 0;\n}\n\nint SerialClass::peek() {\n    return this->buf ? this->buf->peek() : -1;\n}\n\nint SerialClass::read() {\n    return this->buf ? this->buf->read_char() : -1;\n}\n
"},{"location":"ltapi/_serial_8h/","title":"File Serial.h","text":"

FileList > api > Serial > Serial.h

Go to the source code of this file.

  • #include <Arduino.h>
  • #include <api/HardwareSerial.h>
  • #include <api/RingBuffer.h>
"},{"location":"ltapi/_serial_8h/#classes","title":"Classes","text":"Type Name class SerialClass"},{"location":"ltapi/_serial_8h/#macros","title":"Macros","text":"Type Name define HAS_SERIAL_CLASS 1"},{"location":"ltapi/_serial_8h/#macro-definition-documentation","title":"Macro Definition Documentation","text":""},{"location":"ltapi/_serial_8h/#define-has_serial_class","title":"define HAS_SERIAL_CLASS","text":"
#define HAS_SERIAL_CLASS 1\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/Serial/Serial.h

"},{"location":"ltapi/_serial_8h_source/","title":"File Serial.h","text":"

File List > api > Serial > Serial.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-06-23. */\n\n#pragma once\n\n#include <Arduino.h>\n#include <api/HardwareSerial.h>\n#include <api/RingBuffer.h>\n\nusing namespace arduino;\n\nclass SerialClass : public HardwareSerial {\n  private:\n    uint32_t port;\n    pin_size_t rx;\n    pin_size_t tx;\n\n  public:\n    void *data;\n\n  private:\n    RingBuffer *buf;\n    uint32_t baudrate;\n    uint16_t config;\n\n  public:\n    SerialClass(uint32_t port, pin_size_t rx = PIN_INVALID, pin_size_t tx = PIN_INVALID);\n\n    inline void begin(unsigned long baudrate) {\n        begin(baudrate, SERIAL_8N1);\n    }\n\n    inline void configure(unsigned long baudrate) {\n        configure(baudrate, SERIAL_8N1);\n    }\n\n    void begin(unsigned long baudrate, uint16_t config);\n    void configure(unsigned long baudrate, uint16_t config);\n    void end();\n    int available();\n    int peek();\n    int read();\n    void flush();\n    size_t write(uint8_t c);\n\n    operator bool() {\n        return !!buf;\n    }\n\n  public:\n#if LT_AUTO_DOWNLOAD_REBOOT\n    static void adrParse(uint8_t c);\n#endif\n\n    using Print::write;\n};\n\n#define HAS_SERIAL_CLASS 1\n
"},{"location":"ltapi/dir_94e03dba73a2283a03d5afbcd7ac96fd/","title":"Dir cores/common/arduino/libraries/api/SoftwareSerial","text":"

FileList > api > SoftwareSerial

"},{"location":"ltapi/dir_94e03dba73a2283a03d5afbcd7ac96fd/#files","title":"Files","text":"Type Name file SoftwareSerial.cpp file SoftwareSerial.h

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/SoftwareSerial/

"},{"location":"ltapi/_software_serial_8cpp/","title":"File SoftwareSerial.cpp","text":"

FileList > api > SoftwareSerial > SoftwareSerial.cpp

Go to the source code of this file.

  • #include \"SoftwareSerial.h\"

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/SoftwareSerial/SoftwareSerial.cpp

"},{"location":"ltapi/_software_serial_8cpp_source/","title":"File SoftwareSerial.cpp","text":"

File List > api > SoftwareSerial > SoftwareSerial.cpp

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-07-03. */\n\n#include \"SoftwareSerial.h\"\n\n#if LT_ARD_HAS_SOFTSERIAL\n\nSoftwareSerial::SoftwareSerial(pin_size_t receivePin, pin_size_t transmitPin, bool inverted) {\n    data.rx.buf = NULL;\n    data.tx.buf = NULL;\n    data.rx.pin = receivePin;\n    data.tx.pin = transmitPin;\n    data.invert = inverted == true;\n}\n\nint SoftwareSerial::available() {\n    return data.rx.buf->available();\n}\n\nint SoftwareSerial::peek() {\n    return data.rx.buf->peek();\n}\n\nint SoftwareSerial::read() {\n    return data.rx.buf->read_char();\n}\n\nvoid SoftwareSerial::flush() {\n    while (data.rx.buf->available()) {\n        yield();\n    }\n}\n\nsize_t SoftwareSerial::write(uint8_t c) {\n    while (data.tx.buf->isFull()) {\n        yield();\n    }\n    data.tx.buf->store_char(c);\n    if (data.tx.state == SS_IDLE) {\n        data.tx.state = SS_START;\n        this->startTx();\n    }\n    return 1;\n}\n\n#endif\n
"},{"location":"ltapi/_software_serial_8h/","title":"File SoftwareSerial.h","text":"

FileList > api > SoftwareSerial > SoftwareSerial.h

Go to the source code of this file.

  • #include <Arduino.h>
  • #include <api/HardwareSerial.h>
  • #include <api/RingBuffer.h>
"},{"location":"ltapi/_software_serial_8h/#classes","title":"Classes","text":"Type Name struct SoftData struct SoftSerial class SoftwareSerial"},{"location":"ltapi/_software_serial_8h/#public-types","title":"Public Types","text":"Type Name enum SoftState"},{"location":"ltapi/_software_serial_8h/#public-types-documentation","title":"Public Types Documentation","text":""},{"location":"ltapi/_software_serial_8h/#enum-softstate","title":"enum SoftState","text":"
enum SoftState {\n    SS_IDLE = 0,\n    SS_START,\n    SS_DATA0,\n    SS_DATA1,\n    SS_DATA2,\n    SS_DATA3,\n    SS_DATA4,\n    SS_DATA5,\n    SS_DATA6,\n    SS_DATA7,\n    SS_STOP,\n    SS_END\n};\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/SoftwareSerial/SoftwareSerial.h

"},{"location":"ltapi/_software_serial_8h_source/","title":"File SoftwareSerial.h","text":"

File List > api > SoftwareSerial > SoftwareSerial.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-07-03. */\n\n#pragma once\n\n#if LT_ARD_HAS_SOFTSERIAL || DOXYGEN\n\n#include <Arduino.h>\n#include <api/HardwareSerial.h>\n#include <api/RingBuffer.h>\n\nusing namespace arduino;\n\ntypedef enum {\n    SS_IDLE = 0,\n    SS_START,\n    SS_DATA0,\n    SS_DATA1,\n    SS_DATA2,\n    SS_DATA3,\n    SS_DATA4,\n    SS_DATA5,\n    SS_DATA6,\n    SS_DATA7,\n    SS_STOP,\n    SS_END,\n} SoftState;\n\ntypedef struct {\n    SoftState state;\n    RingBuffer *buf;\n    uint8_t byte;\n    pin_size_t pin;\n    void *param;\n} SoftData;\n\ntypedef struct {\n    SoftData rx;\n    SoftData tx;\n    uint8_t invert;\n    void *param;\n} SoftSerial;\n\nclass SoftwareSerial : public HardwareSerial {\n  private:\n    SoftSerial data;\n    void *param;\n\n  public:\n    SoftwareSerial(pin_size_t receivePin, pin_size_t transmitPin, bool inverted = false);\n\n    inline void begin(unsigned long baudrate) {\n        begin(baudrate, SERIAL_8N1);\n    }\n\n    int available();\n    int peek();\n    int read();\n    void flush();\n    size_t write(uint8_t c);\n\n    operator bool() {\n        return data.rx.buf || data.tx.buf;\n    }\n\n  public: // Family needs to implement these methods only\n    void begin(unsigned long baudrate, uint16_t config);\n    void end();\n\n  private:\n    void startTx();\n    void endTx();\n\n    using Print::write;\n};\n\n#endif\n
"},{"location":"ltapi/dir_8a0a878499ba56a6674d17f5d719a3ab/","title":"Dir cores/common/arduino/libraries/api/WiFi","text":"

FileList > api > WiFi

"},{"location":"ltapi/dir_8a0a878499ba56a6674d17f5d719a3ab/#files","title":"Files","text":"Type Name file WiFi.cpp file WiFi.h file WiFiAP.cpp file WiFiEvents.cpp file WiFiEvents.h file WiFiGeneric.cpp file WiFiSTA.cpp file WiFiScan.cpp file WiFiType.h

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/

"},{"location":"ltapi/_wi_fi_8cpp/","title":"File WiFi.cpp","text":"

FileList > api > WiFi > WiFi.cpp

Go to the source code of this file.

  • #include \"WiFi.h\"
"},{"location":"ltapi/_wi_fi_8cpp/#public-attributes","title":"Public Attributes","text":"Type Name WiFiClass WiFi WiFiClass * pWiFi = = NULL"},{"location":"ltapi/_wi_fi_8cpp/#public-functions","title":"Public Functions","text":"Type Name __attribute__ ((weak))"},{"location":"ltapi/_wi_fi_8cpp/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/_wi_fi_8cpp/#variable-wifi","title":"variable WiFi","text":"
WiFiClass WiFi;\n
"},{"location":"ltapi/_wi_fi_8cpp/#variable-pwifi","title":"variable pWiFi","text":"
WiFiClass* pWiFi;\n
"},{"location":"ltapi/_wi_fi_8cpp/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/_wi_fi_8cpp/#function-__attribute__","title":"function __attribute__","text":"
__attribute__ (\n    (weak)\n) \n

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFi.cpp

"},{"location":"ltapi/_wi_fi_8cpp_source/","title":"File WiFi.cpp","text":"

File List > api > WiFi > WiFi.cpp

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-04-25. */\n\n#include \"WiFi.h\"\n\nvoid WiFiClass::printDiag(Print &dest) {\n    dest.print(\"Mode: \");\n    dest.println(WiFiModeText[getMode()]);\n\n    dest.print(\"Status: \");\n    dest.println(WiFiStatusText[status()]);\n\n    if (getMode() & WIFI_MODE_STA) {\n        dest.println(\"-- Station --\");\n        dest.print(\"SSID: \");\n        if (isConnected()) {\n            dest.println(SSID());\n            dest.print(\"Channel: \");\n            dest.println(channel());\n            dest.print(\"BSSID: \");\n            dest.println(BSSIDstr());\n            dest.print(\"RSSI: \");\n            dest.println(RSSI());\n            dest.print(\"Encryption: \");\n            dest.println(WiFiAuthModeText[getEncryption()]);\n            dest.print(\"IP: \");\n            dest.println(localIP());\n            dest.print(\"MAC: \");\n            dest.println(macAddress());\n            dest.print(\"Hostname: \");\n            dest.println(getHostname());\n        } else {\n            dest.println(\"disconnected\");\n        }\n    }\n\n    if (getMode() & WIFI_MODE_AP) {\n        dest.println(\"-- Access Point --\");\n        dest.print(\"SSID: \");\n        if (softAPSSID().length()) {\n            dest.println(softAPSSID());\n            dest.print(\"IP: \");\n            dest.println(softAPIP());\n            dest.print(\"MAC: \");\n            dest.println(softAPmacAddress());\n            dest.print(\"Hostname: \");\n            dest.println(softAPgetHostname());\n        } else {\n            dest.println(\"disconnected\");\n        }\n    }\n}\n\nbool WiFiClass::validate(const char *ssid, const char *passphrase) {\n    if (!ssid || *ssid == 0x00 || strlen(ssid) > 32) {\n        LT_WM(WIFI, \"SSID not specified or too long\");\n        return false;\n    }\n    if (passphrase) {\n        uint16_t length = strlen(passphrase);\n        if (length < 8) {\n            LT_WM(WIFI, \"Passphrase too short (%u)\", length);\n            return false;\n        }\n        if (length > 63) {\n            LT_WM(WIFI, \"Passphrase too long (%u)\", length);\n            return false;\n        }\n    }\n    return true;\n}\n\n__attribute__((weak)) void WiFiClass::dataInitialize() {}\n\n__attribute__((weak)) void WiFiClass::dataFree() {}\n\nWiFiClass WiFi;\nWiFiClass *pWiFi = NULL;\n
"},{"location":"ltapi/_wi_fi_8h/","title":"File WiFi.h","text":"

FileList > api > WiFi > WiFi.h

Go to the source code of this file.

  • #include <Arduino.h>
  • #include <Events.h>
  • #include <api/IPAddress.h>
  • #include <api/IPv6Address.h>
  • #include <vector>
  • #include \"WiFiType.h\"
  • #include <WiFiClient.h>
  • #include <WiFiClientSecure.h>
  • #include <WiFiServer.h>
  • #include <WiFiUdp.h>
"},{"location":"ltapi/_wi_fi_8h/#classes","title":"Classes","text":"Type Name class WiFiClass"},{"location":"ltapi/_wi_fi_8h/#public-attributes","title":"Public Attributes","text":"Type Name WiFiClass WiFi WiFiClass * pWiFi"},{"location":"ltapi/_wi_fi_8h/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/_wi_fi_8h/#variable-wifi","title":"variable WiFi","text":"
WiFiClass WiFi;\n
"},{"location":"ltapi/_wi_fi_8h/#variable-pwifi","title":"variable pWiFi","text":"
WiFiClass* pWiFi;\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFi.h

"},{"location":"ltapi/_wi_fi_8h_source/","title":"File WiFi.h","text":"

File List > api > WiFi > WiFi.h

Go to the documentation of this file.

/*\n WiFi.h - esp32 Wifi support.\n Based on WiFi.h from Arduino WiFi shield library.\n Copyright (c) 2011-2014 Arduino.  All right reserved.\n Modified by Ivan Grokhotkov, December 2014\n\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation; either\n version 2.1 of the License, or (at your option) any later version.\n\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this library; if not, write to the Free Software\n Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#pragma once\n\n#include <Arduino.h>\n#include <Events.h>\n#include <api/IPAddress.h>\n#include <api/IPv6Address.h>\n#include <vector>\n\n#include \"WiFiType.h\"\n\n#include <WiFiClient.h>\n#include <WiFiClientSecure.h>\n#include <WiFiServer.h>\n#include <WiFiUdp.h>\n\nclass WiFiClass {\n  public:\n    // must be public for WiFiEvents & WiFiScan static handlers\n    void *data;\n    WiFiScanData *scan = NULL;\n\n  public: /* WiFi.cpp */\n    WiFiClass();\n    ~WiFiClass();\n    void printDiag(Print &dest);\n    bool validate(const char *ssid, const char *passphrase);\n    void dataInitialize();\n    void dataFree();\n\n  public: /* WiFiGeneric.cpp */\n    bool mode(WiFiMode mode);\n    bool modePriv(WiFiMode mode, WiFiModeAction sta, WiFiModeAction ap);\n    WiFiMode getMode();\n    WiFiStatus status();\n\n    bool enableSTA(bool enable);\n    bool enableAP(bool enable);\n\n    bool setSleep(bool enable);\n    bool getSleep();\n\n    bool setTxPower(int power);\n    int getTxPower();\n\n    int hostByName(const char *hostname, IPAddress &aResult);\n    IPAddress hostByName(const char *hostname);\n\n    static IPAddress calculateNetworkID(IPAddress ip, IPAddress subnet);\n    static IPAddress calculateBroadcast(IPAddress ip, IPAddress subnet);\n    static uint8_t calculateSubnetCIDR(IPAddress subnetMask);\n    static String macToString(uint8_t *mac);\n\n    static void resetNetworkInfo(WiFiNetworkInfo &info);\n\n  private: /* WiFiGeneric.cpp */\n    bool restoreSTAConfig(const WiFiNetworkInfo &info);\n    bool restoreAPConfig(const WiFiNetworkInfo &info);\n\n  protected: /* WiFiEvents.cpp */\n    static std::vector<EventHandler> handlers;\n\n  public: /* WiFiEvents.cpp */\n    uint16_t onEvent(EventCb callback, EventId eventId = ARDUINO_EVENT_MAX);\n    uint16_t onEvent(EventFuncCb callback, EventId eventId = ARDUINO_EVENT_MAX);\n    uint16_t onEvent(EventSysCb callback, EventId eventId = ARDUINO_EVENT_MAX);\n    void removeEvent(EventCb callback, EventId eventId);\n    void removeEvent(EventSysCb callback, EventId eventId);\n    void removeEvent(uint16_t id);\n    static void postEvent(EventId eventId, EventInfo eventInfo);\n\n  public: /* WiFiSTA.cpp */\n    WiFiStatus begin(\n        const char *ssid,\n        const char *passphrase = NULL,\n        int32_t channel        = 0,\n        const uint8_t *bssid   = NULL,\n        bool connect           = true\n    );\n    WiFiStatus\n    begin(char *ssid, char *passphrase = NULL, int32_t channel = 0, const uint8_t *bssid = NULL, bool connect = true);\n\n    bool config(\n        IPAddress localIP,\n        IPAddress gateway,\n        IPAddress subnet,\n        IPAddress dns1 = (uint32_t)0x00000000,\n        IPAddress dns2 = (uint32_t)0x00000000\n    );\n\n    bool reconnect(const uint8_t *bssid = NULL);\n    bool disconnect(bool wifiOff = false);\n\n    bool isConnected();\n\n    bool setAutoReconnect(bool autoReconnect);\n    bool getAutoReconnect();\n\n    WiFiStatus waitForConnectResult(unsigned long timeout);\n\n    IPAddress localIP();\n    uint8_t *macAddress(uint8_t *mac);\n    String macAddress();\n    IPAddress subnetMask();\n    IPAddress gatewayIP();\n    IPAddress dnsIP(uint8_t dns_no = 0);\n    IPAddress broadcastIP();\n    IPAddress networkID();\n    uint8_t subnetCIDR();\n    bool enableIpV6();\n    IPv6Address localIPv6();\n    const char *getHostname();\n    bool setHostname(const char *hostname);\n    bool setMacAddress(const uint8_t *mac);\n\n    inline bool hostname(const String &aHostname) {\n        return setHostname(aHostname.c_str());\n    }\n\n    const String SSID();\n    const String psk();\n    uint8_t *BSSID();\n    String BSSIDstr();\n    int32_t channel();\n    int8_t RSSI();\n    WiFiAuthMode getEncryption();\n\n  public: /* WiFiScan.cpp */\n    int16_t scanNetworks(\n        bool async               = false,\n        bool showHidden          = false,\n        bool passive             = false,\n        uint32_t maxMsPerChannel = 300,\n        uint8_t channel          = 0\n    );\n    bool getNetworkInfo(\n        uint8_t networkItem,\n        String &ssid,\n        WiFiAuthMode &encryptionType,\n        int32_t &RSSI,\n        uint8_t *&BSSID,\n        int32_t &channel\n    );\n\n    int16_t scanComplete();\n    uint8_t scanAlloc(uint8_t count);\n    void scanInit();\n    void scanDelete();\n\n    String SSID(uint8_t networkItem);\n    WiFiAuthMode encryptionType(uint8_t networkItem);\n    int32_t RSSI(uint8_t networkItem);\n    uint8_t *BSSID(uint8_t networkItem);\n    String BSSIDstr(uint8_t networkItem);\n    int32_t channel(uint8_t networkItem);\n\n  public: /* WiFiAP.cpp */\n    bool softAP(\n        const char *ssid, const char *passphrase = NULL, int channel = 1, bool ssidHidden = false, int maxClients = 4\n    );\n    bool softAPConfig(IPAddress localIP, IPAddress gateway, IPAddress subnet);\n    bool softAPdisconnect(bool wifiOff = false);\n\n    uint8_t softAPgetStationNum();\n\n    IPAddress softAPIP();\n    IPAddress softAPBroadcastIP();\n    IPAddress softAPNetworkID();\n    uint8_t softAPSubnetCIDR();\n    IPAddress softAPSubnetMask();\n    bool softAPenableIpV6();\n    IPv6Address softAPIPv6();\n    const char *softAPgetHostname();\n    bool softAPsetHostname(const char *hostname);\n    uint8_t *softAPmacAddress(uint8_t *mac);\n    String softAPmacAddress(void);\n    const String softAPSSID(void);\n};\n\nextern WiFiClass WiFi;\nextern WiFiClass *pWiFi;\n
"},{"location":"ltapi/_wi_fi_a_p_8cpp/","title":"File WiFiAP.cpp","text":"

FileList > api > WiFi > WiFiAP.cpp

Go to the source code of this file.

  • #include \"WiFi.h\"
"},{"location":"ltapi/_wi_fi_a_p_8cpp/#public-functions","title":"Public Functions","text":"Type Name __attribute__ ((weak))"},{"location":"ltapi/_wi_fi_a_p_8cpp/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/_wi_fi_a_p_8cpp/#function-__attribute__","title":"function __attribute__","text":"
__attribute__ (\n    (weak)\n) \n

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiAP.cpp

"},{"location":"ltapi/_wi_fi_a_p_8cpp_source/","title":"File WiFiAP.cpp","text":"

File List > api > WiFi > WiFiAP.cpp

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-04-25. */\n\n#include \"WiFi.h\"\n\nIPAddress WiFiClass::softAPBroadcastIP() {\n    return calculateBroadcast(softAPIP(), softAPSubnetMask());\n}\n\nIPAddress WiFiClass::softAPNetworkID() {\n    return calculateNetworkID(softAPIP(), softAPSubnetMask());\n}\n\nuint8_t WiFiClass::softAPSubnetCIDR() {\n    return calculateSubnetCIDR(softAPSubnetMask());\n}\n\n__attribute__((weak)) bool WiFiClass::softAPenableIpV6() {\n    return false;\n}\n\n__attribute__((weak)) IPv6Address WiFiClass::softAPIPv6() {\n    return IPv6Address();\n}\n
"},{"location":"ltapi/_wi_fi_events_8cpp/","title":"File WiFiEvents.cpp","text":"

FileList > api > WiFi > WiFiEvents.cpp

Go to the source code of this file.

  • #include \"WiFi.h\"

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.cpp

"},{"location":"ltapi/_wi_fi_events_8cpp_source/","title":"File WiFiEvents.cpp","text":"

File List > api > WiFi > WiFiEvents.cpp

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-05-17. */\n\n#include \"WiFi.h\"\n\nstd::vector<EventHandler> WiFiClass::handlers;\n\nuint16_t WiFiClass::onEvent(EventCb callback, EventId eventId) {\n    if (!callback)\n        return 0;\n    EventHandler handler;\n    handler.cb      = callback;\n    handler.eventId = eventId;\n    handlers.push_back(handler);\n    return handler.id;\n}\n\nuint16_t WiFiClass::onEvent(EventFuncCb callback, EventId eventId) {\n    if (!callback)\n        return 0;\n    EventHandler handler;\n    handler.fcb     = callback;\n    handler.eventId = eventId;\n    handlers.push_back(handler);\n    return handler.id;\n}\n\nuint16_t WiFiClass::onEvent(EventSysCb callback, EventId eventId) {\n    if (!callback)\n        return 0;\n    EventHandler handler;\n    handler.scb     = callback;\n    handler.eventId = eventId;\n    handlers.push_back(handler);\n    return handler.id;\n}\n\nvoid WiFiClass::removeEvent(EventCb callback, EventId eventId) {\n    if (!callback)\n        return;\n    for (uint16_t i = 0; i < handlers.size(); i++) {\n        EventHandler handler = handlers[i];\n        if (handler.cb == callback && handler.eventId == eventId) {\n            handlers.erase(handlers.begin() + i);\n        }\n    }\n}\n\nvoid WiFiClass::removeEvent(EventSysCb callback, EventId eventId) {\n    if (!callback)\n        return;\n    for (uint16_t i = 0; i < handlers.size(); i++) {\n        EventHandler handler = handlers[i];\n        if (handler.scb == callback && handler.eventId == eventId) {\n            handlers.erase(handlers.begin() + i);\n        }\n    }\n}\n\nvoid WiFiClass::removeEvent(uint16_t id) {\n    for (uint16_t i = 0; i < handlers.size(); i++) {\n        EventHandler handler = handlers[i];\n        if (handler.id == id) {\n            handlers.erase(handlers.begin() + i);\n        }\n    }\n}\n\nvoid WiFiClass::postEvent(EventId eventId, EventInfo eventInfo) {\n    for (auto handler : handlers) {\n        if (handler.eventId != ARDUINO_EVENT_MAX && handler.eventId != eventId)\n            continue;\n        if (handler.cb) {\n            handler.cb(eventId);\n        } else if (handler.fcb) {\n            handler.fcb(eventId, eventInfo);\n        } else if (handler.scb) {\n            Event_t event = {\n                .event_id   = eventId,\n                .event_info = eventInfo,\n            };\n            handler.scb(&event);\n        }\n    }\n}\n
"},{"location":"ltapi/_wi_fi_events_8h/","title":"File WiFiEvents.h","text":"

FileList > api > WiFi > WiFiEvents.h

Go to the source code of this file.

  • #include \"WiFiType.h\"
"},{"location":"ltapi/_wi_fi_events_8h/#classes","title":"Classes","text":"Type Name struct esp_netif_ip6_info_t IPV6 IP address information. struct esp_netif_ip_info_t struct ip_event_ap_staipassigned_t struct ip_event_got_ip6_t struct ip_event_got_ip_t struct wifi_event_action_tx_status_t struct wifi_event_ap_probe_req_rx_t struct wifi_event_ap_staconnected_t struct wifi_event_ap_stadisconnected_t struct wifi_event_ftm_report_t struct wifi_event_roc_done_t struct wifi_event_sta_authmode_change_t struct wifi_event_sta_connected_t struct wifi_event_sta_disconnected_t struct wifi_event_sta_scan_done_t struct wifi_event_sta_wps_er_pin_t struct wifi_event_sta_wps_er_success_t struct wifi_ftm_report_entry_t"},{"location":"ltapi/_wi_fi_events_8h/#public-types","title":"Public Types","text":"Type Name enum wifi_event_sta_wps_fail_reason_t enum wifi_ftm_status_t FTM operation status types."},{"location":"ltapi/_wi_fi_events_8h/#macros","title":"Macros","text":"Type Name define MAX_PASSPHRASE_LEN 64 define MAX_SSID_LEN 32 define MAX_WPS_AP_CRED 3 define WIFI_STATIS_ALL (-1) define WIFI_STATIS_BUFFER (1 << 0) define WIFI_STATIS_DIAG (1 << 3) define WIFI_STATIS_HW (1 << 2) define WIFI_STATIS_PS (1 << 4) define WIFI_STATIS_RXTX (1 << 1)"},{"location":"ltapi/_wi_fi_events_8h/#public-types-documentation","title":"Public Types Documentation","text":""},{"location":"ltapi/_wi_fi_events_8h/#enum-wifi_event_sta_wps_fail_reason_t","title":"enum wifi_event_sta_wps_fail_reason_t","text":"
enum wifi_event_sta_wps_fail_reason_t {\n    WPS_FAIL_REASON_NORMAL = 0,\n    WPS_FAIL_REASON_RECV_M2D,\n    WPS_FAIL_REASON_MAX\n};\n

Argument structure for WIFI_EVENT_STA_WPS_ER_FAILED event

"},{"location":"ltapi/_wi_fi_events_8h/#enum-wifi_ftm_status_t","title":"enum wifi_ftm_status_t","text":"
enum wifi_ftm_status_t {\n    FTM_STATUS_SUCCESS = 0,\n    FTM_STATUS_UNSUPPORTED,\n    FTM_STATUS_CONF_REJECTED,\n    FTM_STATUS_NO_RESPONSE,\n    FTM_STATUS_FAIL\n};\n
"},{"location":"ltapi/_wi_fi_events_8h/#macro-definition-documentation","title":"Macro Definition Documentation","text":""},{"location":"ltapi/_wi_fi_events_8h/#define-max_passphrase_len","title":"define MAX_PASSPHRASE_LEN","text":"
#define MAX_PASSPHRASE_LEN 64\n
"},{"location":"ltapi/_wi_fi_events_8h/#define-max_ssid_len","title":"define MAX_SSID_LEN","text":"
#define MAX_SSID_LEN 32\n
"},{"location":"ltapi/_wi_fi_events_8h/#define-max_wps_ap_cred","title":"define MAX_WPS_AP_CRED","text":"
#define MAX_WPS_AP_CRED 3\n
"},{"location":"ltapi/_wi_fi_events_8h/#define-wifi_statis_all","title":"define WIFI_STATIS_ALL","text":"
#define WIFI_STATIS_ALL (-1)\n
"},{"location":"ltapi/_wi_fi_events_8h/#define-wifi_statis_buffer","title":"define WIFI_STATIS_BUFFER","text":"
#define WIFI_STATIS_BUFFER (1 << 0)\n
"},{"location":"ltapi/_wi_fi_events_8h/#define-wifi_statis_diag","title":"define WIFI_STATIS_DIAG","text":"
#define WIFI_STATIS_DIAG (1 << 3)\n
"},{"location":"ltapi/_wi_fi_events_8h/#define-wifi_statis_hw","title":"define WIFI_STATIS_HW","text":"
#define WIFI_STATIS_HW (1 << 2)\n
"},{"location":"ltapi/_wi_fi_events_8h/#define-wifi_statis_ps","title":"define WIFI_STATIS_PS","text":"
#define WIFI_STATIS_PS (1 << 4)\n
"},{"location":"ltapi/_wi_fi_events_8h/#define-wifi_statis_rxtx","title":"define WIFI_STATIS_RXTX","text":"
#define WIFI_STATIS_RXTX (1 << 1)\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiEvents.h

"},{"location":"ltapi/_wi_fi_events_8h_source/","title":"File WiFiEvents.h","text":"

File List > api > WiFi > WiFiEvents.h

Go to the documentation of this file.

/*\n * SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n#pragma once\n\n#include \"WiFiType.h\"\n\ntypedef struct {\n    uint32_t status; \n    uint8_t number;  \n    uint8_t scan_id; \n} wifi_event_sta_scan_done_t;\n\ntypedef struct {\n    uint8_t ssid[32];          \n    uint8_t ssid_len;          \n    uint8_t bssid[6];          \n    uint8_t channel;           \n    wifi_auth_mode_t authmode; \n} wifi_event_sta_connected_t;\n\ntypedef struct {\n    uint8_t ssid[32]; \n    uint8_t ssid_len; \n    uint8_t bssid[6]; \n    uint8_t reason;   \n} wifi_event_sta_disconnected_t;\n\ntypedef struct {\n    wifi_auth_mode_t old_mode; \n    wifi_auth_mode_t new_mode; \n} wifi_event_sta_authmode_change_t;\n\ntypedef struct {\n    uint8_t pin_code[8]; \n} wifi_event_sta_wps_er_pin_t;\n\ntypedef enum {\n    WPS_FAIL_REASON_NORMAL = 0, \n    WPS_FAIL_REASON_RECV_M2D,   \n    WPS_FAIL_REASON_MAX\n} wifi_event_sta_wps_fail_reason_t;\n\n#define MAX_SSID_LEN       32\n#define MAX_PASSPHRASE_LEN 64\n#define MAX_WPS_AP_CRED    3\n\ntypedef struct {\n    uint8_t ap_cred_cnt; \n    struct {\n        uint8_t ssid[MAX_SSID_LEN];             \n        uint8_t passphrase[MAX_PASSPHRASE_LEN]; \n    } ap_cred[MAX_WPS_AP_CRED];                 \n} wifi_event_sta_wps_er_success_t;\n\ntypedef struct {\n    uint8_t mac[6];     \n    uint8_t aid;        \n    bool is_mesh_child; \n} wifi_event_ap_staconnected_t;\n\ntypedef struct {\n    uint8_t mac[6];     \n    uint8_t aid;        \n    bool is_mesh_child; \n} wifi_event_ap_stadisconnected_t;\n\ntypedef struct {\n    int rssi;       \n    uint8_t mac[6]; \n} wifi_event_ap_probe_req_rx_t;\n\ntypedef enum {\n    FTM_STATUS_SUCCESS = 0,   \n    FTM_STATUS_UNSUPPORTED,   \n    FTM_STATUS_CONF_REJECTED, \n    FTM_STATUS_NO_RESPONSE,   \n    FTM_STATUS_FAIL,          \n} wifi_ftm_status_t;\n\ntypedef struct {\n    uint8_t dlog_token; \n    int8_t rssi;        \n    uint32_t rtt;       \n    uint64_t t1;        \n    uint64_t t2;        \n    uint64_t t3;        \n    uint64_t t4;        \n} wifi_ftm_report_entry_t;\n\ntypedef struct {\n    uint8_t peer_mac[6];      \n    wifi_ftm_status_t status; \n    uint32_t rtt_raw;         \n    uint32_t rtt_est;         \n    uint32_t dist_est;        \n    wifi_ftm_report_entry_t\n        *ftm_report_data;           \n    uint8_t ftm_report_num_entries; \n} wifi_event_ftm_report_t;\n\n#define WIFI_STATIS_BUFFER (1 << 0)\n#define WIFI_STATIS_RXTX   (1 << 1)\n#define WIFI_STATIS_HW     (1 << 2)\n#define WIFI_STATIS_DIAG   (1 << 3)\n#define WIFI_STATIS_PS     (1 << 4)\n#define WIFI_STATIS_ALL    (-1)\n\ntypedef struct {\n    int ifx;          \n    uint32_t context; \n    uint8_t da[6];    \n    uint8_t status;   \n} wifi_event_action_tx_status_t;\n\ntypedef struct {\n    uint32_t context; \n} wifi_event_roc_done_t;\n\ntypedef struct {\n    esp_ip4_addr_t ip;      \n    esp_ip4_addr_t netmask; \n    esp_ip4_addr_t gw;      \n} esp_netif_ip_info_t;\n\ntypedef struct {\n    esp_ip6_addr_t ip; \n} esp_netif_ip6_info_t;\n\ntypedef struct {\n    int if_index;                \n    void *esp_netif;             \n    esp_netif_ip_info_t ip_info; \n    bool ip_changed;             \n} ip_event_got_ip_t;\n\ntypedef struct {\n    int if_index;                  \n    void *esp_netif;               \n    esp_netif_ip6_info_t ip6_info; \n    int ip_index;                  \n} ip_event_got_ip6_t;\n\ntypedef struct {\n    esp_ip4_addr_t ip; \n} ip_event_ap_staipassigned_t;\n
"},{"location":"ltapi/_wi_fi_generic_8cpp/","title":"File WiFiGeneric.cpp","text":"

FileList > api > WiFi > WiFiGeneric.cpp

Go to the source code of this file.

  • #include \"WiFi.h\"
"},{"location":"ltapi/_wi_fi_generic_8cpp/#public-functions","title":"Public Functions","text":"Type Name __attribute__ ((weak))"},{"location":"ltapi/_wi_fi_generic_8cpp/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/_wi_fi_generic_8cpp/#function-__attribute__","title":"function __attribute__","text":"
__attribute__ (\n    (weak)\n) \n

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiGeneric.cpp

"},{"location":"ltapi/_wi_fi_generic_8cpp_source/","title":"File WiFiGeneric.cpp","text":"

File List > api > WiFi > WiFiGeneric.cpp

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-04-25. */\n\n#include \"WiFi.h\"\n\n#if LT_HAS_FREERTOS\n#include <FreeRTOS.h>\n#endif\n\nbool WiFiClass::mode(WiFiMode mode) {\n    // store a pointer to WiFi for WiFiEvents.cpp\n    pWiFi = this;\n\n    WiFiMode currentMode = getMode();\n    LT_DM(WIFI, \"Mode changing %s -> %s\", WiFiModeText[currentMode], WiFiModeText[mode]);\n    if (mode == currentMode)\n        return true;\n\n    // get mode changes as 0/1\n    WiFiModeAction sta = WiFiModeAction((mode & WIFI_MODE_STA) != (currentMode & WIFI_MODE_STA));\n    WiFiModeAction ap  = WiFiModeAction((mode & WIFI_MODE_AP) != (currentMode & WIFI_MODE_AP));\n    // change 0/1 to 1/2\n    sta = WiFiModeAction(sta + sta * !!(mode & WIFI_MODE_STA));\n    ap  = WiFiModeAction(ap + ap * !!(mode & WIFI_MODE_AP));\n    // initialize data structures if wifi is enabled\n    if (mode)\n        dataInitialize();\n    // actually change the mode\n    LT_HEAP_I();\n    if (!modePriv(mode, sta, ap))\n        return false;\n    if (getMode() != mode) {\n        LT_WM(WIFI, \"Mode changed to %d (requested %d)\", getMode(), mode);\n    }\n    return true;\n}\n\nbool WiFiClass::enableSTA(bool enable) {\n    WiFiMode currentMode = getMode();\n    if (((currentMode & WIFI_MODE_STA) != 0) != enable) {\n        return mode((WiFiMode)(currentMode ^ WIFI_MODE_STA));\n    }\n    return true;\n}\n\nbool WiFiClass::enableAP(bool enable) {\n    WiFiMode currentMode = getMode();\n    if (((currentMode & WIFI_MODE_AP) != 0) != enable) {\n        return mode((WiFiMode)(currentMode ^ WIFI_MODE_AP));\n    }\n    return true;\n}\n\n__attribute__((weak)) bool WiFiClass::setSleep(bool enable) {\n    return false;\n}\n\n__attribute__((weak)) bool WiFiClass::getSleep() {\n    return false;\n}\n\n__attribute__((weak)) bool WiFiClass::setTxPower(int power) {\n    return false;\n}\n\n__attribute__((weak)) int WiFiClass::getTxPower() {\n    return 0;\n}\n\nint WiFiClass::hostByName(const char *hostname, IPAddress &aResult) {\n    aResult = hostByName(hostname);\n    return true;\n}\n\nIPAddress WiFiClass::calculateNetworkID(IPAddress ip, IPAddress subnet) {\n    IPAddress networkID;\n\n    for (size_t i = 0; i < 4; i++)\n        networkID[i] = subnet[i] & ip[i];\n\n    return networkID;\n}\n\nIPAddress WiFiClass::calculateBroadcast(IPAddress ip, IPAddress subnet) {\n    IPAddress broadcastIp;\n\n    for (int i = 0; i < 4; i++)\n        broadcastIp[i] = ~subnet[i] | ip[i];\n\n    return broadcastIp;\n}\n\nuint8_t WiFiClass::calculateSubnetCIDR(IPAddress subnetMask) {\n    uint8_t CIDR = 0;\n\n    for (uint8_t i = 0; i < 4; i++) {\n        if (subnetMask[i] == 0x80) // 128\n            CIDR += 1;\n        else if (subnetMask[i] == 0xC0) // 192\n            CIDR += 2;\n        else if (subnetMask[i] == 0xE0) // 224\n            CIDR += 3;\n        else if (subnetMask[i] == 0xF0) // 242\n            CIDR += 4;\n        else if (subnetMask[i] == 0xF8) // 248\n            CIDR += 5;\n        else if (subnetMask[i] == 0xFC) // 252\n            CIDR += 6;\n        else if (subnetMask[i] == 0xFE) // 254\n            CIDR += 7;\n        else if (subnetMask[i] == 0xFF) // 255\n            CIDR += 8;\n    }\n\n    return CIDR;\n}\n\nString WiFiClass::macToString(uint8_t *mac) {\n    char macStr[18]; // 6*2 + 5*':' + '\\0'\n    sprintf(macStr, \"%02X:%02X:%02X:%02X:%02X:%02X\", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);\n    return macStr;\n}\n\nvoid WiFiClass::resetNetworkInfo(WiFiNetworkInfo &info) {\n    LT_VM(WIFI, \"Resetting network info: %s\", info.ssid);\n    free(info.ssid);\n    free(info.password);\n    free(info.bssid);\n    // wipe the structure, except IP addresses\n    memset(&info, 0x00, sizeof(WiFiNetworkInfo) - 5 * sizeof(uint32_t));\n}\n\nbool WiFiClass::restoreSTAConfig(const WiFiNetworkInfo &info) {\n    LT_DM(WIFI, \"Restoring %s config: %s\", \"STA\", info.ssid);\n    if (!info.ssid)\n        return false;\n    if (info.localIP) {\n        LT_DM(WIFI, \"Restoring STA IP config\");\n        if (!config(info.localIP, info.gateway, info.subnet, info.dns1, info.dns2))\n            return false;\n    }\n    return begin(info.ssid, info.password, info.channel, info.bssid);\n}\n\nbool WiFiClass::restoreAPConfig(const WiFiNetworkInfo &info) {\n    LT_DM(WIFI, \"Restoring %s config: %s\", \"AP\", info.ssid);\n    if (!info.ssid)\n        return false;\n    if (info.localIP) {\n        LT_DM(WIFI, \"Restoring AP IP config\");\n        if (!softAPConfig(info.localIP, info.gateway, info.subnet))\n            return false;\n    }\n    return softAP(info.ssid, info.password, info.channel, info.ssidHidden);\n}\n
"},{"location":"ltapi/_wi_fi_s_t_a_8cpp/","title":"File WiFiSTA.cpp","text":"

FileList > api > WiFi > WiFiSTA.cpp

Go to the source code of this file.

  • #include \"WiFi.h\"
"},{"location":"ltapi/_wi_fi_s_t_a_8cpp/#public-functions","title":"Public Functions","text":"Type Name __attribute__ ((weak))"},{"location":"ltapi/_wi_fi_s_t_a_8cpp/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/_wi_fi_s_t_a_8cpp/#function-__attribute__","title":"function __attribute__","text":"
__attribute__ (\n    (weak)\n) \n

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiSTA.cpp

"},{"location":"ltapi/_wi_fi_s_t_a_8cpp_source/","title":"File WiFiSTA.cpp","text":"

File List > api > WiFi > WiFiSTA.cpp

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-04-25. */\n\n#include \"WiFi.h\"\n\nWiFiStatus WiFiClass::begin(char *ssid, char *passphrase, int32_t channel, const uint8_t *bssid, bool connect) {\n    return begin((const char *)ssid, (const char *)passphrase, channel, bssid, connect);\n}\n\nbool WiFiClass::isConnected() {\n    return status() == WL_CONNECTED;\n}\n\nWiFiStatus WiFiClass::waitForConnectResult(unsigned long timeout) {\n    if ((getMode() & WIFI_MODE_STA) == 0) {\n        return WL_DISCONNECTED;\n    }\n    unsigned long start = millis();\n    while ((!status() || status() >= WL_DISCONNECTED) && (millis() - start) < timeout) {\n        delay(100);\n    }\n    return status();\n}\n\nString WiFiClass::macAddress(void) {\n    uint8_t mac[6];\n    macAddress(mac);\n    return macToString(mac);\n}\n\nIPAddress WiFiClass::networkID() {\n    return calculateNetworkID(gatewayIP(), subnetMask());\n}\n\nuint8_t WiFiClass::subnetCIDR() {\n    return calculateSubnetCIDR(subnetMask());\n}\n\nString WiFiClass::BSSIDstr() {\n    return macToString(BSSID());\n}\n\n__attribute__((weak)) bool WiFiClass::enableIpV6() {\n    return false;\n}\n\n__attribute__((weak)) IPv6Address WiFiClass::localIPv6() {\n    return IPv6Address();\n}\n
"},{"location":"ltapi/_wi_fi_scan_8cpp/","title":"File WiFiScan.cpp","text":"

FileList > api > WiFi > WiFiScan.cpp

Go to the source code of this file.

  • #include \"WiFi.h\"

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiScan.cpp

"},{"location":"ltapi/_wi_fi_scan_8cpp_source/","title":"File WiFiScan.cpp","text":"

File List > api > WiFi > WiFiScan.cpp

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-04-25. */\n\n#include \"WiFi.h\"\n\nbool WiFiClass::getNetworkInfo(\n    uint8_t networkItem, String &ssid, WiFiAuthMode &encType, int32_t &rssi, uint8_t *&bssid, int32_t &channel\n) {\n    ssid    = SSID(networkItem);\n    encType = encryptionType(networkItem);\n    rssi    = RSSI(networkItem);\n    bssid   = BSSID(networkItem);\n    channel = this->channel(networkItem);\n    return true;\n}\n\nint16_t WiFiClass::scanComplete() {\n    if (!scan)\n        return 0;\n    if (scan->running)\n        return WIFI_SCAN_RUNNING;\n    return scan->count;\n}\n\nvoid WiFiClass::scanInit() {\n    if (scan)\n        return;\n    scan = (WiFiScanData *)calloc(1, sizeof(WiFiScanData));\n}\n\nvoid WiFiClass::scanDelete() {\n    if (!scan)\n        return;\n    for (uint8_t i = 0; i < scan->count; i++) {\n        free(scan->ap[i].ssid);\n    }\n    free(scan->ap);\n    free(scan);\n    scan = NULL;\n}\n\nuint8_t WiFiClass::scanAlloc(uint8_t count) {\n    if ((!scan->ap) || (count > scan->count)) {\n        auto newMem = (WiFiScanAP *)realloc(scan->ap, count * sizeof(WiFiScanAP));\n        if (!newMem) {\n            return scan->count;\n        }\n        scan->ap = newMem;\n    }\n    if (!scan->ap) {\n        scan->count = 0;\n        return 0;\n    }\n    if (count > scan->count) {\n        // clear only new entries\n        memset(scan->ap + scan->count, 0, sizeof(WiFiScanAP) * (count - scan->count));\n    }\n    scan->count = count;\n    return count;\n}\n\nString WiFiClass::SSID(uint8_t networkItem) {\n    if (!scan || networkItem >= scan->count)\n        return \"\";\n    return scan->ap[networkItem].ssid;\n}\n\nWiFiAuthMode WiFiClass::encryptionType(uint8_t networkItem) {\n    if (!scan || networkItem >= scan->count)\n        return WIFI_AUTH_INVALID;\n    return scan->ap[networkItem].auth;\n}\n\nint32_t WiFiClass::RSSI(uint8_t networkItem) {\n    if (!scan || networkItem >= scan->count)\n        return 0;\n    return scan->ap[networkItem].rssi;\n}\n\nuint8_t *WiFiClass::BSSID(uint8_t networkItem) {\n    if (!scan || networkItem >= scan->count)\n        return NULL;\n    return scan->ap[networkItem].bssid.addr;\n}\n\nString WiFiClass::BSSIDstr(uint8_t networkItem) {\n    return macToString(BSSID(networkItem));\n}\n\nint32_t WiFiClass::channel(uint8_t networkItem) {\n    if (!scan || networkItem >= scan->count)\n        return 0;\n    return scan->ap[networkItem].channel;\n}\n
"},{"location":"ltapi/_wi_fi_type_8h/","title":"File WiFiType.h","text":"

FileList > api > WiFi > WiFiType.h

Go to the source code of this file.

  • #include <Arduino.h>
"},{"location":"ltapi/_wi_fi_type_8h/#classes","title":"Classes","text":"Type Name struct WiFiMacAddr struct WiFiNetworkInfo struct WiFiScanAP struct WiFiScanData struct esp_ip4_addr struct esp_ip6_addr"},{"location":"ltapi/_wi_fi_type_8h/#public-types","title":"Public Types","text":"Type Name enum WiFiModeAction typedef struct esp_ip4_addr esp_ip4_addr_t typedef struct esp_ip6_addr esp_ip6_addr_t enum wifi_auth_mode_t enum wifi_err_reason_t enum wifi_mode_t enum wl_status_t"},{"location":"ltapi/_wi_fi_type_8h/#public-static-attributes","title":"Public Static Attributes","text":"Type Name const char * WiFiAuthModeText = = { \"Open\", \"WEP\", \"WPA PSK\", \"WPA2 PSK\", \"WPA/WPA2 PSK\", \"WPA2 EAP\", \"WPA3 PSK\", \"WPA2/WPA3 PSK\", \"WAPI PSK\", \"WPA\", \"WPA2\", \"Auto\", } const char * WiFiModeText = = {\"NULL\", \"STA\", \"AP\", \"AP+STA\"} const char * WiFiStatusText = = { \"Idle\", \"No SSID\", \"Scan Completed\", \"Connected\", \"Connect failed\", \"Connection lost\", \"Disconnected\", }"},{"location":"ltapi/_wi_fi_type_8h/#macros","title":"Macros","text":"Type Name define WIFI_AP WIFI_MODE_AP define WIFI_AP_STA WIFI_MODE_APSTA define WIFI_OFF WIFI_MODE_NULL define WIFI_SCAN_FAILED (-2) define WIFI_SCAN_RUNNING (-1) define WIFI_STA WIFI_MODE_STA define WiFiAuthMode wifi_auth_mode_t define WiFiEventId_t uint16_t define WiFiEventInfo_t arduino_event_info_t define WiFiEvent_t arduino_event_id_t define WiFiMode wifi_mode_t define WiFiMode_t wifi_mode_t define WiFiStatus wl_status_t"},{"location":"ltapi/_wi_fi_type_8h/#public-types-documentation","title":"Public Types Documentation","text":""},{"location":"ltapi/_wi_fi_type_8h/#enum-wifimodeaction","title":"enum WiFiModeAction","text":"
enum WiFiModeAction {\n    WLMODE_NONE = 0,\n    WLMODE_DISABLE = 1,\n    WLMODE_ENABLE = 2\n};\n
"},{"location":"ltapi/_wi_fi_type_8h/#typedef-esp_ip4_addr_t","title":"typedef esp_ip4_addr_t","text":"
typedef struct esp_ip4_addr esp_ip4_addr_t;\n
"},{"location":"ltapi/_wi_fi_type_8h/#typedef-esp_ip6_addr_t","title":"typedef esp_ip6_addr_t","text":"
typedef struct esp_ip6_addr esp_ip6_addr_t;\n
"},{"location":"ltapi/_wi_fi_type_8h/#enum-wifi_auth_mode_t","title":"enum wifi_auth_mode_t","text":"
enum wifi_auth_mode_t {\n    WIFI_AUTH_OPEN = 0,\n    WIFI_AUTH_WEP,\n    WIFI_AUTH_WPA_PSK,\n    WIFI_AUTH_WPA2_PSK,\n    WIFI_AUTH_WPA_WPA2_PSK,\n    WIFI_AUTH_WPA2_ENTERPRISE,\n    WIFI_AUTH_WPA3_PSK,\n    WIFI_AUTH_WPA2_WPA3_PSK,\n    WIFI_AUTH_WAPI_PSK,\n    WIFI_AUTH_WPA,\n    WIFI_AUTH_WPA2,\n    WIFI_AUTH_AUTO = 200,\n    WIFI_AUTH_INVALID = 255,\n    WIFI_AUTH_MAX\n};\n
"},{"location":"ltapi/_wi_fi_type_8h/#enum-wifi_err_reason_t","title":"enum wifi_err_reason_t","text":"
enum wifi_err_reason_t {\n    WIFI_REASON_UNSPECIFIED = 1,\n    WIFI_REASON_AUTH_EXPIRE = 2,\n    WIFI_REASON_AUTH_LEAVE = 3,\n    WIFI_REASON_ASSOC_EXPIRE = 4,\n    WIFI_REASON_ASSOC_TOOMANY = 5,\n    WIFI_REASON_NOT_AUTHED = 6,\n    WIFI_REASON_NOT_ASSOCED = 7,\n    WIFI_REASON_ASSOC_LEAVE = 8,\n    WIFI_REASON_ASSOC_NOT_AUTHED = 9,\n    WIFI_REASON_DISASSOC_PWRCAP_BAD = 10,\n    WIFI_REASON_DISASSOC_SUPCHAN_BAD = 11,\n    WIFI_REASON_BSS_TRANSITION_DISASSOC = 12,\n    WIFI_REASON_IE_INVALID = 13,\n    WIFI_REASON_MIC_FAILURE = 14,\n    WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT = 15,\n    WIFI_REASON_GROUP_KEY_UPDATE_TIMEOUT = 16,\n    WIFI_REASON_IE_IN_4WAY_DIFFERS = 17,\n    WIFI_REASON_GROUP_CIPHER_INVALID = 18,\n    WIFI_REASON_PAIRWISE_CIPHER_INVALID = 19,\n    WIFI_REASON_AKMP_INVALID = 20,\n    WIFI_REASON_UNSUPP_RSN_IE_VERSION = 21,\n    WIFI_REASON_INVALID_RSN_IE_CAP = 22,\n    WIFI_REASON_802_1X_AUTH_FAILED = 23,\n    WIFI_REASON_CIPHER_SUITE_REJECTED = 24,\n    WIFI_REASON_INVALID_PMKID = 53,\n    WIFI_REASON_BEACON_TIMEOUT = 200,\n    WIFI_REASON_NO_AP_FOUND = 201,\n    WIFI_REASON_AUTH_FAIL = 202,\n    WIFI_REASON_ASSOC_FAIL = 203,\n    WIFI_REASON_HANDSHAKE_TIMEOUT = 204,\n    WIFI_REASON_CONNECTION_FAIL = 205,\n    WIFI_REASON_AP_TSF_RESET = 206,\n    WIFI_REASON_ROAMING = 207\n};\n
"},{"location":"ltapi/_wi_fi_type_8h/#enum-wifi_mode_t","title":"enum wifi_mode_t","text":"
enum wifi_mode_t {\n    WIFI_MODE_NULL = 0,\n    WIFI_MODE_STA,\n    WIFI_MODE_AP,\n    WIFI_MODE_APSTA,\n    WIFI_MODE_MAX\n};\n
"},{"location":"ltapi/_wi_fi_type_8h/#enum-wl_status_t","title":"enum wl_status_t","text":"
enum wl_status_t {\n    WL_NO_SHIELD = 255,\n    WL_IDLE_STATUS = 0,\n    WL_NO_SSID_AVAIL = 1,\n    WL_SCAN_COMPLETED = 2,\n    WL_CONNECTED = 3,\n    WL_CONNECT_FAILED = 4,\n    WL_CONNECTION_LOST = 5,\n    WL_DISCONNECTED = 6\n};\n
"},{"location":"ltapi/_wi_fi_type_8h/#public-static-attributes-documentation","title":"Public Static Attributes Documentation","text":""},{"location":"ltapi/_wi_fi_type_8h/#variable-wifiauthmodetext","title":"variable WiFiAuthModeText","text":"
const char* WiFiAuthModeText[];\n
"},{"location":"ltapi/_wi_fi_type_8h/#variable-wifimodetext","title":"variable WiFiModeText","text":"
const char* WiFiModeText[];\n
"},{"location":"ltapi/_wi_fi_type_8h/#variable-wifistatustext","title":"variable WiFiStatusText","text":"
const char* WiFiStatusText[];\n
"},{"location":"ltapi/_wi_fi_type_8h/#macro-definition-documentation","title":"Macro Definition Documentation","text":""},{"location":"ltapi/_wi_fi_type_8h/#define-wifi_ap","title":"define WIFI_AP","text":"
#define WIFI_AP WIFI_MODE_AP\n
"},{"location":"ltapi/_wi_fi_type_8h/#define-wifi_ap_sta","title":"define WIFI_AP_STA","text":"
#define WIFI_AP_STA WIFI_MODE_APSTA\n
"},{"location":"ltapi/_wi_fi_type_8h/#define-wifi_off","title":"define WIFI_OFF","text":"
#define WIFI_OFF WIFI_MODE_NULL\n
"},{"location":"ltapi/_wi_fi_type_8h/#define-wifi_scan_failed","title":"define WIFI_SCAN_FAILED","text":"
#define WIFI_SCAN_FAILED (-2)\n
"},{"location":"ltapi/_wi_fi_type_8h/#define-wifi_scan_running","title":"define WIFI_SCAN_RUNNING","text":"
#define WIFI_SCAN_RUNNING (-1)\n
"},{"location":"ltapi/_wi_fi_type_8h/#define-wifi_sta","title":"define WIFI_STA","text":"
#define WIFI_STA WIFI_MODE_STA\n
"},{"location":"ltapi/_wi_fi_type_8h/#define-wifiauthmode","title":"define WiFiAuthMode","text":"
#define WiFiAuthMode wifi_auth_mode_t\n
"},{"location":"ltapi/_wi_fi_type_8h/#define-wifieventid_t","title":"define WiFiEventId_t","text":"
#define WiFiEventId_t uint16_t\n
"},{"location":"ltapi/_wi_fi_type_8h/#define-wifieventinfo_t","title":"define WiFiEventInfo_t","text":"
#define WiFiEventInfo_t arduino_event_info_t\n
"},{"location":"ltapi/_wi_fi_type_8h/#define-wifievent_t","title":"define WiFiEvent_t","text":"
#define WiFiEvent_t arduino_event_id_t\n
"},{"location":"ltapi/_wi_fi_type_8h/#define-wifimode","title":"define WiFiMode","text":"
#define WiFiMode wifi_mode_t\n
"},{"location":"ltapi/_wi_fi_type_8h/#define-wifimode_t","title":"define WiFiMode_t","text":"
#define WiFiMode_t wifi_mode_t\n
"},{"location":"ltapi/_wi_fi_type_8h/#define-wifistatus","title":"define WiFiStatus","text":"
#define WiFiStatus wl_status_t\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/api/WiFi/WiFiType.h

"},{"location":"ltapi/_wi_fi_type_8h_source/","title":"File WiFiType.h","text":"

File List > api > WiFi > WiFiType.h

Go to the documentation of this file.

/*\n ESP8266WiFiType.h - esp8266 Wifi support.\n Copyright (c) 2011-2014 Arduino.  All right reserved.\n Modified by Ivan Grokhotkov, December 2014\n Reworked by Markus Sattler, December 2015\n\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation; either\n version 2.1 of the License, or (at your option) any later version.\n\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this library; if not, write to the Free Software\n Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#pragma once\n\n#include <Arduino.h>\n\n#define WIFI_SCAN_RUNNING (-1)\n#define WIFI_SCAN_FAILED  (-2)\n\n#define WiFiMode_t   wifi_mode_t\n#define WiFiMode     wifi_mode_t\n#define WiFiStatus   wl_status_t\n#define WiFiAuthMode wifi_auth_mode_t\n\n#define WIFI_OFF    WIFI_MODE_NULL\n#define WIFI_STA    WIFI_MODE_STA\n#define WIFI_AP     WIFI_MODE_AP\n#define WIFI_AP_STA WIFI_MODE_APSTA\n\n#define WiFiEvent_t     arduino_event_id_t\n#define WiFiEventInfo_t arduino_event_info_t\n#define WiFiEventId_t   uint16_t\n\ntypedef struct {\n    uint8_t addr[6];\n} WiFiMacAddr;\n\nstruct esp_ip6_addr {\n    uint32_t addr[4];\n    uint8_t zone;\n};\n\nstruct esp_ip4_addr {\n    uint32_t addr;\n};\n\ntypedef struct esp_ip4_addr esp_ip4_addr_t;\ntypedef struct esp_ip6_addr esp_ip6_addr_t;\n\ntypedef enum {\n    WIFI_MODE_NULL = 0, \n    WIFI_MODE_STA,      \n    WIFI_MODE_AP,       \n    WIFI_MODE_APSTA,    \n    WIFI_MODE_MAX\n} wifi_mode_t;\n\ntypedef enum {\n    WL_NO_SHIELD       = 255, // for compatibility with WiFi Shield library\n    WL_IDLE_STATUS     = 0,\n    WL_NO_SSID_AVAIL   = 1,\n    WL_SCAN_COMPLETED  = 2,\n    WL_CONNECTED       = 3,\n    WL_CONNECT_FAILED  = 4,\n    WL_CONNECTION_LOST = 5,\n    WL_DISCONNECTED    = 6,\n} wl_status_t;\n\ntypedef enum {\n    WIFI_AUTH_OPEN = 0,        \n    WIFI_AUTH_WEP,             \n    WIFI_AUTH_WPA_PSK,         \n    WIFI_AUTH_WPA2_PSK,        \n    WIFI_AUTH_WPA_WPA2_PSK,    \n    WIFI_AUTH_WPA2_ENTERPRISE, \n    WIFI_AUTH_WPA3_PSK,        \n    WIFI_AUTH_WPA2_WPA3_PSK,   \n    WIFI_AUTH_WAPI_PSK,        \n    WIFI_AUTH_WPA,\n    WIFI_AUTH_WPA2,\n    WIFI_AUTH_AUTO    = 200,\n    WIFI_AUTH_INVALID = 255,\n    WIFI_AUTH_MAX\n} wifi_auth_mode_t;\n\ntypedef enum {\n    WIFI_REASON_UNSPECIFIED              = 1,\n    WIFI_REASON_AUTH_EXPIRE              = 2,\n    WIFI_REASON_AUTH_LEAVE               = 3,\n    WIFI_REASON_ASSOC_EXPIRE             = 4,\n    WIFI_REASON_ASSOC_TOOMANY            = 5,\n    WIFI_REASON_NOT_AUTHED               = 6,\n    WIFI_REASON_NOT_ASSOCED              = 7,\n    WIFI_REASON_ASSOC_LEAVE              = 8,\n    WIFI_REASON_ASSOC_NOT_AUTHED         = 9,\n    WIFI_REASON_DISASSOC_PWRCAP_BAD      = 10,\n    WIFI_REASON_DISASSOC_SUPCHAN_BAD     = 11,\n    WIFI_REASON_BSS_TRANSITION_DISASSOC  = 12,\n    WIFI_REASON_IE_INVALID               = 13,\n    WIFI_REASON_MIC_FAILURE              = 14,\n    WIFI_REASON_4WAY_HANDSHAKE_TIMEOUT   = 15,\n    WIFI_REASON_GROUP_KEY_UPDATE_TIMEOUT = 16,\n    WIFI_REASON_IE_IN_4WAY_DIFFERS       = 17,\n    WIFI_REASON_GROUP_CIPHER_INVALID     = 18,\n    WIFI_REASON_PAIRWISE_CIPHER_INVALID  = 19,\n    WIFI_REASON_AKMP_INVALID             = 20,\n    WIFI_REASON_UNSUPP_RSN_IE_VERSION    = 21,\n    WIFI_REASON_INVALID_RSN_IE_CAP       = 22,\n    WIFI_REASON_802_1X_AUTH_FAILED       = 23,\n    WIFI_REASON_CIPHER_SUITE_REJECTED    = 24,\n    WIFI_REASON_INVALID_PMKID            = 53,\n    WIFI_REASON_BEACON_TIMEOUT           = 200,\n    WIFI_REASON_NO_AP_FOUND              = 201,\n    WIFI_REASON_AUTH_FAIL                = 202,\n    WIFI_REASON_ASSOC_FAIL               = 203,\n    WIFI_REASON_HANDSHAKE_TIMEOUT        = 204,\n    WIFI_REASON_CONNECTION_FAIL          = 205,\n    WIFI_REASON_AP_TSF_RESET             = 206,\n    WIFI_REASON_ROAMING                  = 207,\n} wifi_err_reason_t;\n\ntypedef struct {\n    char *ssid;\n    char *password;\n    uint8_t *bssid;\n    bool ssidHidden;\n    int channel;\n    int auth;\n    uint32_t localIP;\n    uint32_t subnet;\n    uint32_t gateway;\n    uint32_t dns1;\n    uint32_t dns2;\n} WiFiNetworkInfo;\n\ntypedef struct {\n    char *ssid;\n    WiFiAuthMode auth;\n    int32_t rssi;\n    WiFiMacAddr bssid;\n    int32_t channel;\n} WiFiScanAP;\n\ntypedef struct {\n    bool running          = false;\n    unsigned long timeout = 0;\n    uint8_t count         = 0;\n    WiFiScanAP *ap        = NULL;\n} WiFiScanData;\n\ntypedef enum {\n    WLMODE_NONE    = 0,\n    WLMODE_DISABLE = 1,\n    WLMODE_ENABLE  = 2,\n} WiFiModeAction;\n\nstatic const char *WiFiModeText[]   = {\"NULL\", \"STA\", \"AP\", \"AP+STA\"};\nstatic const char *WiFiStatusText[] = {\n    \"Idle\",\n    \"No SSID\",\n    \"Scan Completed\",\n    \"Connected\",\n    \"Connect failed\",\n    \"Connection lost\",\n    \"Disconnected\",\n};\nstatic const char *WiFiAuthModeText[] = {\n    \"Open\",\n    \"WEP\",\n    \"WPA PSK\",\n    \"WPA2 PSK\",\n    \"WPA/WPA2 PSK\",\n    \"WPA2 EAP\",\n    \"WPA3 PSK\",\n    \"WPA2/WPA3 PSK\",\n    \"WAPI PSK\",\n    \"WPA\",\n    \"WPA2\",\n    \"Auto\",\n};\n
"},{"location":"ltapi/dir_fbd007664e1d3c6800f6de85378c1012/","title":"Dir cores/common/arduino/libraries/common","text":"

FileList > arduino > libraries > common

"},{"location":"ltapi/dir_fbd007664e1d3c6800f6de85378c1012/#directories","title":"Directories","text":"Type Name dir FS dir IPv6Address dir MD5 dir Preferences dir Update dir WiFiClient dir WiFiServer dir WiFiUdp dir mDNS

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/

"},{"location":"ltapi/dir_20c0973793fbdc84288fa19008185bd9/","title":"Dir cores/common/arduino/libraries/common/FS","text":"

FileList > arduino > libraries > common > FS

"},{"location":"ltapi/dir_20c0973793fbdc84288fa19008185bd9/#files","title":"Files","text":"Type Name file FS.cpp file FS.h

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/FS/

"},{"location":"ltapi/_f_s_8cpp/","title":"File FS.cpp","text":"

FileList > arduino > libraries > common > FS > FS.cpp

Go to the source code of this file.

  • #include \"FS.h\"

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/FS/FS.cpp

"},{"location":"ltapi/_f_s_8cpp_source/","title":"File FS.cpp","text":"

File List > arduino > libraries > common > FS > FS.cpp

Go to the documentation of this file.

/*\n FS.cpp - file system wrapper\n Copyright (c) 2015 Ivan Grokhotkov. All rights reserved.\n This file is part of the esp8266 core for Arduino environment.\n\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation; either\n version 2.1 of the License, or (at your option) any later version.\n\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this library; if not, write to the Free Software\n Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#include \"FS.h\"\n\nusing namespace fs;\n\nsize_t File::write(uint8_t c) {\n    if (!*this) {\n        return 0;\n    }\n    return _p->write(&c, 1);\n}\n\ntime_t File::getLastWrite() {\n    if (!*this) {\n        return 0;\n    }\n    return _p->getLastWrite();\n}\n\nsize_t File::write(const uint8_t *buf, size_t size) {\n    if (!*this) {\n        return 0;\n    }\n    return _p->write(buf, size);\n}\n\nint File::available() {\n    if (!*this) {\n        return false;\n    }\n    return _p->size() - _p->position();\n}\n\nint File::read() {\n    if (!*this) {\n        return -1;\n    }\n    uint8_t result;\n    if (_p->read(&result, 1) != 1) {\n        return -1;\n    }\n    return result;\n}\n\nsize_t File::read(uint8_t *buf, size_t size) {\n    if (!*this) {\n        return -1;\n    }\n    return _p->read(buf, size);\n}\n\nint File::peek() {\n    if (!*this) {\n        return -1;\n    }\n    size_t curPos = _p->position();\n    int result    = read();\n    seek(curPos, SeekSet);\n    return result;\n}\n\nvoid File::flush() {\n    if (!*this) {\n        return;\n    }\n    _p->flush();\n}\n\nbool File::seek(uint32_t pos, SeekMode mode) {\n    if (!*this) {\n        return false;\n    }\n    return _p->seek(pos, mode);\n}\n\nsize_t File::position() const {\n    if (!*this) {\n        return 0;\n    }\n    return _p->position();\n}\n\nsize_t File::size() const {\n    if (!*this) {\n        return 0;\n    }\n    return _p->size();\n}\n\nbool File::setBufferSize(size_t size) {\n    if (!*this) {\n        return 0;\n    }\n    return _p->setBufferSize(size);\n}\n\nvoid File::close() {\n    if (_p) {\n        _p->close();\n        _p = nullptr;\n    }\n}\n\nFile::operator bool() const {\n    return _p != nullptr && *_p != false;\n}\n\nconst char *File::path() const {\n    if (!*this) {\n        return nullptr;\n    }\n    return _p->path();\n}\n\nconst char *File::name() const {\n    if (!*this) {\n        return nullptr;\n    }\n    return _p->name();\n}\n\n// to implement\nboolean File::isDirectory(void) {\n    if (!*this) {\n        return false;\n    }\n    return _p->isDirectory();\n}\n\nFile File::openNextFile(const char *mode) {\n    if (!*this) {\n        return File();\n    }\n    return _p->openNextFile(mode);\n}\n\nvoid File::rewindDirectory(void) {\n    if (!*this) {\n        return;\n    }\n    _p->rewindDirectory();\n}\n\nFile FS::open(const String &path, const char *mode, const bool create) {\n    return open(path.c_str(), mode, create);\n}\n\nFile FS::open(const char *path, const char *mode, const bool create) {\n    if (!_impl) {\n        return File();\n    }\n\n    return File(_impl->open(path, mode, create));\n}\n\nbool FS::exists(const char *path) {\n    if (!_impl) {\n        return false;\n    }\n    return _impl->exists(path);\n}\n\nbool FS::exists(const String &path) {\n    return exists(path.c_str());\n}\n\nbool FS::remove(const char *path) {\n    if (!_impl) {\n        return false;\n    }\n    return _impl->remove(path);\n}\n\nbool FS::remove(const String &path) {\n    return remove(path.c_str());\n}\n\nbool FS::rename(const char *pathFrom, const char *pathTo) {\n    if (!_impl) {\n        return false;\n    }\n    return _impl->rename(pathFrom, pathTo);\n}\n\nbool FS::rename(const String &pathFrom, const String &pathTo) {\n    return rename(pathFrom.c_str(), pathTo.c_str());\n}\n\nbool FS::mkdir(const char *path) {\n    if (!_impl) {\n        return false;\n    }\n    return _impl->mkdir(path);\n}\n\nbool FS::mkdir(const String &path) {\n    return mkdir(path.c_str());\n}\n\nbool FS::rmdir(const char *path) {\n    if (!_impl) {\n        return false;\n    }\n    return _impl->rmdir(path);\n}\n\nbool FS::rmdir(const String &path) {\n    return rmdir(path.c_str());\n}\n
"},{"location":"ltapi/libraries_2common_2_f_s_2_f_s_8h/","title":"File FS.h","text":"

FileList > arduino > libraries > common > FS > FS.h

Go to the source code of this file.

  • #include <Arduino.h>
  • #include <memory>
"},{"location":"ltapi/libraries_2common_2_f_s_2_f_s_8h/#namespaces","title":"Namespaces","text":"Type Name namespace fs"},{"location":"ltapi/libraries_2common_2_f_s_2_f_s_8h/#classes","title":"Classes","text":"Type Name class FS class FSImpl class File class FileImpl"},{"location":"ltapi/libraries_2common_2_f_s_2_f_s_8h/#macros","title":"Macros","text":"Type Name define FILE_APPEND \"a\" define FILE_READ \"r\" define FILE_WRITE \"w\""},{"location":"ltapi/libraries_2common_2_f_s_2_f_s_8h/#macro-definition-documentation","title":"Macro Definition Documentation","text":""},{"location":"ltapi/libraries_2common_2_f_s_2_f_s_8h/#define-file_append","title":"define FILE_APPEND","text":"
#define FILE_APPEND \"a\"\n
"},{"location":"ltapi/libraries_2common_2_f_s_2_f_s_8h/#define-file_read","title":"define FILE_READ","text":"
#define FILE_READ \"r\"\n
"},{"location":"ltapi/libraries_2common_2_f_s_2_f_s_8h/#define-file_write","title":"define FILE_WRITE","text":"
#define FILE_WRITE \"w\"\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/FS/FS.h

"},{"location":"ltapi/libraries_2common_2_f_s_2_f_s_8h_source/","title":"File FS.h","text":"

File List > arduino > libraries > common > FS > FS.h

Go to the documentation of this file.

/*\n FS.h - file system wrapper\n Copyright (c) 2015 Ivan Grokhotkov. All rights reserved.\n This file is part of the esp8266 core for Arduino environment.\n\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation; either\n version 2.1 of the License, or (at your option) any later version.\n\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this library; if not, write to the Free Software\n Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#pragma once\n\n#include <Arduino.h>\n#include <memory>\n\nnamespace fs {\n\n#define FILE_READ   \"r\"\n#define FILE_WRITE  \"w\"\n#define FILE_APPEND \"a\"\n\nclass File;\n\nclass FileImpl;\ntypedef std::shared_ptr<FileImpl> FileImplPtr;\nclass FSImpl;\ntypedef std::shared_ptr<FSImpl> FSImplPtr;\n\nenum SeekMode { SeekSet = 0, SeekCur = 1, SeekEnd = 2 };\n\nclass File : public Stream {\n  public:\n    File(FileImplPtr p = FileImplPtr()) : _p(p) {\n        _timeout = 0;\n    }\n\n    size_t write(uint8_t) override;\n    size_t write(const uint8_t *buf, size_t size) override;\n    int available() override;\n    int read() override;\n    int peek() override;\n    void flush() override;\n    size_t read(uint8_t *buf, size_t size);\n\n    size_t readBytes(char *buffer, size_t length) {\n        return read((uint8_t *)buffer, length);\n    }\n\n    bool seek(uint32_t pos, SeekMode mode);\n\n    bool seek(uint32_t pos) {\n        return seek(pos, SeekSet);\n    }\n\n    size_t position() const;\n    size_t size() const;\n    bool setBufferSize(size_t size);\n    void close();\n    operator bool() const;\n    time_t getLastWrite();\n    const char *path() const;\n    const char *name() const;\n\n    boolean isDirectory(void);\n    File openNextFile(const char *mode = FILE_READ);\n    void rewindDirectory(void);\n\n  protected:\n    FileImplPtr _p;\n};\n\nclass FileImpl {\n  public:\n    virtual ~FileImpl() {}\n\n    virtual size_t write(const uint8_t *buf, size_t size) = 0;\n    virtual size_t read(uint8_t *buf, size_t size)        = 0;\n    virtual void flush()                                  = 0;\n    virtual bool seek(uint32_t pos, SeekMode mode)        = 0;\n    virtual size_t position() const                       = 0;\n    virtual size_t size() const                           = 0;\n    virtual bool setBufferSize(size_t size)               = 0;\n    virtual void close()                                  = 0;\n    virtual time_t getLastWrite()                         = 0;\n    virtual const char *path() const                      = 0;\n    virtual const char *name() const                      = 0;\n    virtual boolean isDirectory(void)                     = 0;\n    virtual FileImplPtr openNextFile(const char *mode)    = 0;\n    virtual void rewindDirectory(void)                    = 0;\n    virtual operator bool()                               = 0;\n};\n\nclass FS {\n  public:\n    FS(FSImplPtr impl) : _impl(impl) {}\n\n    File open(const char *path, const char *mode = FILE_READ, const bool create = false);\n    File open(const String &path, const char *mode = FILE_READ, const bool create = false);\n\n    bool exists(const char *path);\n    bool exists(const String &path);\n\n    bool remove(const char *path);\n    bool remove(const String &path);\n\n    bool rename(const char *pathFrom, const char *pathTo);\n    bool rename(const String &pathFrom, const String &pathTo);\n\n    bool mkdir(const char *path);\n    bool mkdir(const String &path);\n\n    bool rmdir(const char *path);\n    bool rmdir(const String &path);\n\n  protected:\n    FSImplPtr _impl;\n};\n\nclass FSImpl {\n  public:\n    FSImpl() {}\n\n    virtual ~FSImpl() {}\n\n    virtual FileImplPtr open(const char *path, const char *mode, const bool create) = 0;\n    virtual bool exists(const char *path)                                           = 0;\n    virtual bool rename(const char *pathFrom, const char *pathTo)                   = 0;\n    virtual bool remove(const char *path)                                           = 0;\n    virtual bool mkdir(const char *path)                                            = 0;\n    virtual bool rmdir(const char *path)                                            = 0;\n};\n\n} // namespace fs\n\n#ifndef FS_NO_GLOBALS\nusing fs::File;\nusing fs::FS;\nusing fs::SeekCur;\nusing fs::SeekEnd;\nusing fs::SeekMode;\nusing fs::SeekSet;\n#endif // FS_NO_GLOBALS\n
"},{"location":"ltapi/dir_0e053ac3caf93ca4495f626616698305/","title":"Dir cores/common/arduino/libraries/common/IPv6Address","text":"

FileList > arduino > libraries > common > IPv6Address

"},{"location":"ltapi/dir_0e053ac3caf93ca4495f626616698305/#files","title":"Files","text":"Type Name file IPv6Address.cpp file IPv6Address.h"},{"location":"ltapi/dir_0e053ac3caf93ca4495f626616698305/#directories","title":"Directories","text":"Type Name dir api

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/IPv6Address/

"},{"location":"ltapi/_i_pv6_address_8cpp/","title":"File IPv6Address.cpp","text":"

FileList > arduino > libraries > common > IPv6Address > IPv6Address.cpp

Go to the source code of this file.

  • #include \"IPv6Address.h\"
  • #include <Arduino.h>
  • #include <api/Print.h>

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/IPv6Address/IPv6Address.cpp

"},{"location":"ltapi/_i_pv6_address_8cpp_source/","title":"File IPv6Address.cpp","text":"

File List > arduino > libraries > common > IPv6Address > IPv6Address.cpp

Go to the documentation of this file.

/*\n IPv6Address.cpp - Base class that provides IPv6Address\n Copyright (c) 2011 Adrian McEwen.  All right reserved.\n\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation; either\n version 2.1 of the License, or (at your option) any later version.\n\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this library; if not, write to the Free Software\n Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#include \"IPv6Address.h\"\n\n#include <Arduino.h>\n#include <api/Print.h>\n\nIPv6Address::IPv6Address() {\n    memset(_address.bytes, 0, sizeof(_address.bytes));\n}\n\nIPv6Address::IPv6Address(const uint8_t *address) {\n    memcpy(_address.bytes, address, sizeof(_address.bytes));\n}\n\nIPv6Address::IPv6Address(const uint32_t *address) {\n    memcpy(_address.bytes, (const uint8_t *)address, sizeof(_address.bytes));\n}\n\nIPv6Address &IPv6Address::operator=(const uint8_t *address) {\n    memcpy(_address.bytes, address, sizeof(_address.bytes));\n    return *this;\n}\n\nbool IPv6Address::operator==(const uint8_t *addr) const {\n    return memcmp(addr, _address.bytes, sizeof(_address.bytes)) == 0;\n}\n\nsize_t IPv6Address::printTo(Print &p) const {\n    /* size_t n = 0;\n    for(int i = 0; i < 16; i+=2) {\n        if(i){\n            n += p.print(':');\n        }\n        n += p.printf(\"%02x\", _address.bytes[i]);\n        n += p.printf(\"%02x\", _address.bytes[i+1]);\n\n    }\n    return n; */\n    return 0;\n}\n\nString IPv6Address::toString() const {\n    char szRet[40];\n    sprintf(\n        szRet,\n        \"%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x:%02x%02x\",\n        _address.bytes[0],\n        _address.bytes[1],\n        _address.bytes[2],\n        _address.bytes[3],\n        _address.bytes[4],\n        _address.bytes[5],\n        _address.bytes[6],\n        _address.bytes[7],\n        _address.bytes[8],\n        _address.bytes[9],\n        _address.bytes[10],\n        _address.bytes[11],\n        _address.bytes[12],\n        _address.bytes[13],\n        _address.bytes[14],\n        _address.bytes[15]\n    );\n    return String(szRet);\n}\n\nbool IPv6Address::fromString(const char *address) {\n    // format 0011:2233:4455:6677:8899:aabb:ccdd:eeff\n    if (strlen(address) != 39) {\n        return false;\n    }\n    char *pos = (char *)address;\n    size_t i  = 0;\n    for (i = 0; i < 16; i += 2) {\n        if (!sscanf(pos, \"%2hhx\", &_address.bytes[i]) || !sscanf(pos + 2, \"%2hhx\", &_address.bytes[i + 1])) {\n            return false;\n        }\n        pos += 5;\n    }\n    return true;\n}\n
"},{"location":"ltapi/_i_pv6_address_8h/","title":"File IPv6Address.h","text":"

FileList > arduino > libraries > common > IPv6Address > IPv6Address.h

Go to the source code of this file.

  • #include <api/Print.h>
  • #include <api/String.h>
  • #include <stdint.h>
"},{"location":"ltapi/_i_pv6_address_8h/#namespaces","title":"Namespaces","text":"Type Name namespace arduino"},{"location":"ltapi/_i_pv6_address_8h/#classes","title":"Classes","text":"Type Name class IPv6Address

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/IPv6Address/IPv6Address.h

"},{"location":"ltapi/_i_pv6_address_8h_source/","title":"File IPv6Address.h","text":"

File List > arduino > libraries > common > IPv6Address > IPv6Address.h

Go to the documentation of this file.

/*\n IPv6Address.h - Base class that provides IPv6Address\n Copyright (c) 2011 Adrian McEwen.  All right reserved.\n\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation; either\n version 2.1 of the License, or (at your option) any later version.\n\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this library; if not, write to the Free Software\n Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#pragma once\n\n#include <api/Print.h>\n#include <api/String.h>\n#include <stdint.h>\n\n// A class to make it easier to handle and pass around IP addresses\n\nnamespace arduino {\n\nclass IPv6Address : public Printable {\n  private:\n    union {\n        uint8_t bytes[16]; // IPv4 address\n        uint32_t dword[4];\n    } _address;\n\n    // Access the raw byte array containing the address.  Because this returns a pointer\n    // to the internal structure rather than a copy of the address this function should only\n    // be used when you know that the usage of the returned uint8_t* will be transient and not\n    // stored.\n    uint8_t *raw_address() {\n        return _address.bytes;\n    }\n\n  public:\n    // Constructors\n    IPv6Address();\n    IPv6Address(const uint8_t *address);\n    IPv6Address(const uint32_t *address);\n\n    virtual ~IPv6Address() {}\n\n    bool fromString(const char *address);\n\n    bool fromString(const String &address) {\n        return fromString(address.c_str());\n    }\n\n    operator const uint8_t *() const {\n        return _address.bytes;\n    }\n\n    operator const uint32_t *() const {\n        return _address.dword;\n    }\n\n    bool operator==(const IPv6Address &addr) const {\n        return (_address.dword[0] == addr._address.dword[0]) && (_address.dword[1] == addr._address.dword[1]) &&\n               (_address.dword[2] == addr._address.dword[2]) && (_address.dword[3] == addr._address.dword[3]);\n    }\n\n    bool operator==(const uint8_t *addr) const;\n\n    // Overloaded index operator to allow getting and setting individual octets of the address\n    uint8_t operator[](int index) const {\n        return _address.bytes[index];\n    }\n\n    uint8_t &operator[](int index) {\n        return _address.bytes[index];\n    }\n\n    // Overloaded copy operators to allow initialisation of IPv6Address objects from other types\n    IPv6Address &operator=(const uint8_t *address);\n\n    // TODO implement printTo()\n    virtual size_t printTo(Print &p) const;\n    String toString() const;\n\n    friend class UDP;\n    friend class Client;\n    friend class Server;\n};\n\n} // namespace arduino\n\nusing arduino::IPv6Address;\n
"},{"location":"ltapi/dir_0a5433a1da7b2b93282c1ad1558c5479/","title":"Dir cores/common/arduino/libraries/common/IPv6Address/api","text":"

FileList > api

"},{"location":"ltapi/dir_0a5433a1da7b2b93282c1ad1558c5479/#files","title":"Files","text":"Type Name file IPv6Address.h

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/IPv6Address/api/

"},{"location":"ltapi/api_2_i_pv6_address_8h/","title":"File IPv6Address.h","text":"

FileList > api > IPv6Address.h

Go to the source code of this file.

  • #include \"../IPv6Address.h\"

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/IPv6Address/api/IPv6Address.h

"},{"location":"ltapi/api_2_i_pv6_address_8h_source/","title":"File IPv6Address.h","text":"

File List > api > IPv6Address.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-04-30. */\n\n#pragma once\n\n#include \"../IPv6Address.h\"\n
"},{"location":"ltapi/dir_a154785acb726885f254a47f397a1398/","title":"Dir cores/common/arduino/libraries/common/MD5","text":"

FileList > arduino > libraries > common > MD5

"},{"location":"ltapi/dir_a154785acb726885f254a47f397a1398/#files","title":"Files","text":"Type Name file MD5.h file MD5HostapdImpl.h file MD5MbedTLSImpl.cpp file MD5MbedTLSImpl.h

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/MD5/

"},{"location":"ltapi/libraries_2common_2_m_d5_2_m_d5_8h/","title":"File MD5.h","text":"

FileList > arduino > libraries > common > MD5 > MD5.h

Go to the source code of this file.

  • #include <Arduino.h>
"},{"location":"ltapi/libraries_2common_2_m_d5_2_m_d5_8h/#public-types","title":"Public Types","text":"Type Name typedef LT_MD5_CTX_T md5_context_t"},{"location":"ltapi/libraries_2common_2_m_d5_2_m_d5_8h/#public-functions","title":"Public Functions","text":"Type Name void MD5Final (unsigned char digest, LT_MD5_CTX_T * context) void MD5Init (LT_MD5_CTX_T * context) void MD5Update (LT_MD5_CTX_T * context, const unsigned char * buf, unsigned len)"},{"location":"ltapi/libraries_2common_2_m_d5_2_m_d5_8h/#macros","title":"Macros","text":"Type Name define LT_MD5_CTX_T void"},{"location":"ltapi/libraries_2common_2_m_d5_2_m_d5_8h/#public-types-documentation","title":"Public Types Documentation","text":""},{"location":"ltapi/libraries_2common_2_m_d5_2_m_d5_8h/#typedef-md5_context_t","title":"typedef md5_context_t","text":"
typedef LT_MD5_CTX_T md5_context_t;\n
"},{"location":"ltapi/libraries_2common_2_m_d5_2_m_d5_8h/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/libraries_2common_2_m_d5_2_m_d5_8h/#function-md5final","title":"function MD5Final","text":"
void MD5Final (\n    unsigned char digest,\n    LT_MD5_CTX_T * context\n) \n
"},{"location":"ltapi/libraries_2common_2_m_d5_2_m_d5_8h/#function-md5init","title":"function MD5Init","text":"
void MD5Init (\n    LT_MD5_CTX_T * context\n) \n
"},{"location":"ltapi/libraries_2common_2_m_d5_2_m_d5_8h/#function-md5update","title":"function MD5Update","text":"
void MD5Update (\n    LT_MD5_CTX_T * context,\n    const unsigned char * buf,\n    unsigned len\n) \n
"},{"location":"ltapi/libraries_2common_2_m_d5_2_m_d5_8h/#macro-definition-documentation","title":"Macro Definition Documentation","text":""},{"location":"ltapi/libraries_2common_2_m_d5_2_m_d5_8h/#define-lt_md5_ctx_t","title":"define LT_MD5_CTX_T","text":"
#define LT_MD5_CTX_T void\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/MD5/MD5.h

"},{"location":"ltapi/libraries_2common_2_m_d5_2_m_d5_8h_source/","title":"File MD5.h","text":"

File List > arduino > libraries > common > MD5 > MD5.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-06-03. */\n\n#pragma once\n\n#include <Arduino.h>\n\n// available built-in implementations\n#if LT_ARD_MD5_MBEDTLS\n#include \"MD5MbedTLSImpl.h\"\n#endif\n#if LT_ARD_MD5_HOSTAPD\n#include \"MD5HostapdImpl.h\"\n#endif\n\n// common API\n#ifdef __cplusplus\nextern \"C\" {\n#endif // __cplusplus\n\n#ifndef LT_MD5_CTX_T\n#define LT_MD5_CTX_T void\n#endif\n\n// for compatibility with ESP8266\ntypedef LT_MD5_CTX_T md5_context_t;\n\nvoid MD5Init(LT_MD5_CTX_T *context);\nvoid MD5Update(LT_MD5_CTX_T *context, const unsigned char *buf, unsigned len);\nvoid MD5Final(unsigned char digest[16], LT_MD5_CTX_T *context);\n\n#ifdef __cplusplus\n} // extern \"C\"\n#endif\n
"},{"location":"ltapi/_m_d5_hostapd_impl_8h/","title":"File MD5HostapdImpl.h","text":"

FileList > arduino > libraries > common > MD5 > MD5HostapdImpl.h

Go to the source code of this file.

"},{"location":"ltapi/_m_d5_hostapd_impl_8h/#classes","title":"Classes","text":"Type Name struct MD5Context"},{"location":"ltapi/_m_d5_hostapd_impl_8h/#macros","title":"Macros","text":"Type Name define LT_MD5_CTX_T struct MD5Context"},{"location":"ltapi/_m_d5_hostapd_impl_8h/#macro-definition-documentation","title":"Macro Definition Documentation","text":""},{"location":"ltapi/_m_d5_hostapd_impl_8h/#define-lt_md5_ctx_t","title":"define LT_MD5_CTX_T","text":"
#define LT_MD5_CTX_T struct MD5Context\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/MD5/MD5HostapdImpl.h

"},{"location":"ltapi/_m_d5_hostapd_impl_8h_source/","title":"File MD5HostapdImpl.h","text":"

File List > arduino > libraries > common > MD5 > MD5HostapdImpl.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-07-12. */\n\n#pragma once\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nstruct MD5Context {\n    unsigned long buf[4];\n    unsigned long bits[2];\n    unsigned char in[64];\n};\n\n#define LT_MD5_CTX_T struct MD5Context\n\n#ifdef __cplusplus\n} // extern \"C\"\n#endif\n
"},{"location":"ltapi/_m_d5_mbed_t_l_s_impl_8cpp/","title":"File MD5MbedTLSImpl.cpp","text":"

FileList > arduino > libraries > common > MD5 > MD5MbedTLSImpl.cpp

Go to the source code of this file.

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/MD5/MD5MbedTLSImpl.cpp

"},{"location":"ltapi/_m_d5_mbed_t_l_s_impl_8cpp_source/","title":"File MD5MbedTLSImpl.cpp","text":"

File List > arduino > libraries > common > MD5 > MD5MbedTLSImpl.cpp

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-07-11. */\n\n#if LT_ARD_MD5_MBEDTLS\n\nextern \"C\" {\n\n#include <mbedtls/md5.h>\n\nvoid MD5Init(mbedtls_md5_context *context) {\n    mbedtls_md5_init(context);\n    mbedtls_md5_starts(context);\n}\n\nvoid MD5Update(mbedtls_md5_context *context, const unsigned char *buf, unsigned len) {\n    mbedtls_md5_update(context, buf, len);\n}\n\nvoid MD5Final(unsigned char digest[16], mbedtls_md5_context *context) {\n    mbedtls_md5_finish(context, digest);\n}\n\n} // extern \"C\"\n\n#endif // LT_ARD_MD5_MBEDTLS\n
"},{"location":"ltapi/_m_d5_mbed_t_l_s_impl_8h/","title":"File MD5MbedTLSImpl.h","text":"

FileList > arduino > libraries > common > MD5 > MD5MbedTLSImpl.h

Go to the source code of this file.

"},{"location":"ltapi/_m_d5_mbed_t_l_s_impl_8h/#classes","title":"Classes","text":"Type Name struct mbedtls_md5_context"},{"location":"ltapi/_m_d5_mbed_t_l_s_impl_8h/#macros","title":"Macros","text":"Type Name define LT_MD5_CTX_T mbedtls_md5_context"},{"location":"ltapi/_m_d5_mbed_t_l_s_impl_8h/#macro-definition-documentation","title":"Macro Definition Documentation","text":""},{"location":"ltapi/_m_d5_mbed_t_l_s_impl_8h/#define-lt_md5_ctx_t","title":"define LT_MD5_CTX_T","text":"
#define LT_MD5_CTX_T mbedtls_md5_context\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/MD5/MD5MbedTLSImpl.h

"},{"location":"ltapi/_m_d5_mbed_t_l_s_impl_8h_source/","title":"File MD5MbedTLSImpl.h","text":"

File List > arduino > libraries > common > MD5 > MD5MbedTLSImpl.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-07-11. */\n\n#pragma once\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef struct {\n    unsigned long total[2];   \n    unsigned long state[4];   \n    unsigned char buffer[64]; \n} mbedtls_md5_context;\n\n#define LT_MD5_CTX_T mbedtls_md5_context\n\n#ifdef __cplusplus\n} // extern \"C\"\n#endif\n
"},{"location":"ltapi/dir_e34b8d08ec2a080356b302de1e1a00cf/","title":"Dir cores/common/arduino/libraries/common/Preferences","text":"

FileList > arduino > libraries > common > Preferences

"},{"location":"ltapi/dir_e34b8d08ec2a080356b302de1e1a00cf/#files","title":"Files","text":"Type Name file Preferences.h

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/Preferences/

"},{"location":"ltapi/_preferences_8h/","title":"File Preferences.h","text":"

FileList > arduino > libraries > common > Preferences > Preferences.h

Go to the source code of this file.

  • #include <stdbool.h>
  • #include <stdint.h>
  • #include <stdlib.h>
  • #include <api/String.h>
"},{"location":"ltapi/_preferences_8h/#classes","title":"Classes","text":"Type Name class IPreferences"},{"location":"ltapi/_preferences_8h/#public-types","title":"Public Types","text":"Type Name enum PreferenceType"},{"location":"ltapi/_preferences_8h/#public-types-documentation","title":"Public Types Documentation","text":""},{"location":"ltapi/_preferences_8h/#enum-preferencetype","title":"enum PreferenceType","text":"
enum PreferenceType {\n    PT_I8,\n    PT_U8,\n    PT_I16,\n    PT_U16,\n    PT_I32,\n    PT_U32,\n    PT_I64,\n    PT_U64,\n    PT_STR,\n    PT_BLOB,\n    PT_INVALID\n};\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/Preferences/Preferences.h

"},{"location":"ltapi/_preferences_8h_source/","title":"File Preferences.h","text":"

File List > arduino > libraries > common > Preferences > Preferences.h

Go to the documentation of this file.

// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//     http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#pragma once\n\n#include <stdbool.h>\n#include <stdint.h>\n#include <stdlib.h>\n\n#include <api/String.h>\n\ntypedef enum {\n    PT_I8,\n    PT_U8,\n    PT_I16,\n    PT_U16,\n    PT_I32,\n    PT_U32,\n    PT_I64,\n    PT_U64,\n    PT_STR,\n    PT_BLOB,\n    PT_INVALID,\n} PreferenceType;\n\nclass IPreferences {\n  public:\n    IPreferences() {}\n\n    ~IPreferences() {}\n\n    bool begin(const char *name, bool readOnly = false, const char *partition_label = NULL);\n    void end();\n\n    bool clear();\n    bool remove(const char *key);\n\n    size_t putChar(const char *key, int8_t value);\n    size_t putUChar(const char *key, uint8_t value);\n    size_t putShort(const char *key, int16_t value);\n    size_t putUShort(const char *key, uint16_t value);\n    size_t putInt(const char *key, int32_t value);\n    size_t putUInt(const char *key, uint32_t value);\n    size_t putLong(const char *key, int32_t value);\n    size_t putULong(const char *key, uint32_t value);\n    size_t putLong64(const char *key, int64_t value);\n    size_t putULong64(const char *key, uint64_t value);\n    size_t putFloat(const char *key, float_t value);\n    size_t putDouble(const char *key, double_t value);\n    size_t putBool(const char *key, bool value);\n    size_t putString(const char *key, const char *value);\n    size_t putString(const char *key, String value);\n    size_t putBytes(const char *key, const void *value, size_t len);\n\n    bool isKey(const char *key);\n    PreferenceType getType(const char *key);\n    int8_t getChar(const char *key, int8_t defaultValue = 0);\n    uint8_t getUChar(const char *key, uint8_t defaultValue = 0);\n    int16_t getShort(const char *key, int16_t defaultValue = 0);\n    uint16_t getUShort(const char *key, uint16_t defaultValue = 0);\n    int32_t getInt(const char *key, int32_t defaultValue = 0);\n    uint32_t getUInt(const char *key, uint32_t defaultValue = 0);\n    int32_t getLong(const char *key, int32_t defaultValue = 0);\n    uint32_t getULong(const char *key, uint32_t defaultValue = 0);\n    int64_t getLong64(const char *key, int64_t defaultValue = 0);\n    uint64_t getULong64(const char *key, uint64_t defaultValue = 0);\n    float_t getFloat(const char *key, float_t defaultValue = NAN);\n    double_t getDouble(const char *key, double_t defaultValue = NAN);\n    bool getBool(const char *key, bool defaultValue = false);\n    size_t getString(const char *key, char *value, size_t maxLen);\n    String getString(const char *key, String defaultValue = String());\n    size_t getBytesLength(const char *key);\n    size_t getBytes(const char *key, void *buf, size_t maxLen);\n    size_t freeEntries();\n};\n
"},{"location":"ltapi/dir_540dc0be13f8284f6014d0451691d894/","title":"Dir cores/common/arduino/libraries/common/Update","text":"

FileList > arduino > libraries > common > Update

"},{"location":"ltapi/dir_540dc0be13f8284f6014d0451691d894/#files","title":"Files","text":"Type Name file Update.cpp file Update.h file UpdateUtil.cpp

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/Update/

"},{"location":"ltapi/_update_8cpp/","title":"File Update.cpp","text":"

FileList > arduino > libraries > common > Update > Update.cpp

Go to the source code of this file.

  • #include \"Update.h\"
"},{"location":"ltapi/_update_8cpp/#public-attributes","title":"Public Attributes","text":"Type Name UpdateClass Update"},{"location":"ltapi/_update_8cpp/#public-static-attributes","title":"Public Static Attributes","text":"Type Name const UpdateError errorMap = = { UPDATE_ERROR_OK, UPDATE_ERROR_OK, UPDATE_ERROR_MAGIC_BYTE, UPDATE_ERROR_BAD_ARGUMENT, UPDATE_ERROR_BAD_ARGUMENT, UPDATE_ERROR_BAD_ARGUMENT, UPDATE_ERROR_MAGIC_BYTE, UPDATE_ERROR_NO_PARTITION, UPDATE_ERROR_BAD_ARGUMENT, UPDATE_ERROR_BAD_ARGUMENT, UPDATE_ERROR_BAD_ARGUMENT, UPDATE_ERROR_BAD_ARGUMENT, UPDATE_ERROR_ERASE, UPDATE_ERROR_WRITE, UPDATE_ERROR_WRITE, UPDATE_ERROR_WRITE, UPDATE_ERROR_WRITE, }"},{"location":"ltapi/_update_8cpp/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/_update_8cpp/#variable-update","title":"variable Update","text":"
UpdateClass Update;\n
"},{"location":"ltapi/_update_8cpp/#public-static-attributes-documentation","title":"Public Static Attributes Documentation","text":""},{"location":"ltapi/_update_8cpp/#variable-errormap","title":"variable errorMap","text":"
const UpdateError errorMap[];\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/Update/Update.cpp

"},{"location":"ltapi/_update_8cpp_source/","title":"File Update.cpp","text":"

File List > arduino > libraries > common > Update > Update.cpp

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-05-29. */\n\n#include \"Update.h\"\n\nstatic const UpdateError errorMap[] = {\n    UPDATE_ERROR_OK,           /* UF2_ERR_OK - no error */\n    UPDATE_ERROR_OK,           /* UF2_ERR_IGNORE - block should be ignored */\n    UPDATE_ERROR_MAGIC_BYTE,   /* UF2_ERR_MAGIC - wrong magic numbers */\n    UPDATE_ERROR_BAD_ARGUMENT, /* UF2_ERR_FAMILY - family ID mismatched */\n    UPDATE_ERROR_BAD_ARGUMENT, /* UF2_ERR_NOT_HEADER - block is not a header */\n    UPDATE_ERROR_BAD_ARGUMENT, /* UF2_ERR_OTA_VER - unknown/invalid OTA format version */\n    UPDATE_ERROR_MAGIC_BYTE,   /* UF2_ERR_OTA_WRONG - no data for current OTA scheme */\n    UPDATE_ERROR_NO_PARTITION, /* UF2_ERR_PART_404 - no partition with that name */\n    UPDATE_ERROR_BAD_ARGUMENT, /* UF2_ERR_PART_INVALID - invalid partition info tag */\n    UPDATE_ERROR_BAD_ARGUMENT, /* UF2_ERR_PART_UNSET - attempted to write without target partition */\n    UPDATE_ERROR_BAD_ARGUMENT, /* UF2_ERR_DATA_TOO_LONG - data too long - tags won't fit */\n    UPDATE_ERROR_BAD_ARGUMENT, /* UF2_ERR_SEQ_MISMATCH - sequence number mismatched */\n    UPDATE_ERROR_ERASE,        /* UF2_ERR_ERASE_FAILED - erasing flash failed */\n    UPDATE_ERROR_WRITE,        /* UF2_ERR_WRITE_FAILED - writing to flash failed */\n    UPDATE_ERROR_WRITE,        /* UF2_ERR_WRITE_LENGTH - wrote fewer data than requested */\n    UPDATE_ERROR_WRITE,        /* UF2_ERR_WRITE_PROTECT - target area is write-protected */\n    UPDATE_ERROR_WRITE,        /* UF2_ERR_ALLOC_FAILED - dynamic memory allocation failed */\n};\n\nbool UpdateClass::begin(\n    size_t size,\n    int command,\n    __attribute__((unused)) int ledPin,\n    __attribute__((unused)) uint8_t ledOn,\n    __attribute__((unused)) const char *label\n) {\n#if !LT_HAS_OTA\n    LT_E(\"OTA is not yet supported on this chip!\");\n    this->errArd = UPDATE_ERROR_BAD_ARGUMENT;\n    return false;\n#endif\n    if (this->ctx) {\n        return false;\n    }\n    this->clearError();\n    if (size == 0) {\n        this->errArd = UPDATE_ERROR_SIZE;\n        return false;\n    }\n    if (command != U_FLASH) {\n        this->errArd = UPDATE_ERROR_BAD_ARGUMENT;\n        return false;\n    }\n    if (size == UPDATE_SIZE_UNKNOWN) {\n        size = 0;\n    }\n\n    this->ctx = static_cast<lt_ota_ctx_t *>(malloc(sizeof(lt_ota_ctx_t)));\n    lt_ota_begin(this->ctx, size);\n    this->ctx->callback       = reinterpret_cast<void (*)(void *)>(progressHandler);\n    this->ctx->callback_param = this;\n\n    this->md5Ctx = static_cast<LT_MD5_CTX_T *>(malloc(sizeof(LT_MD5_CTX_T)));\n    MD5Init(this->md5Ctx);\n\n    return true;\n}\n\nbool UpdateClass::end(bool evenIfRemaining) {\n    if (!this->ctx)\n        return false;\n\n    // update is running or finished; cleanup and end it\n    if (!isFinished() && !evenIfRemaining)\n        // abort if not finished\n        this->errArd = UPDATE_ERROR_ABORT;\n\n    if (!this->md5Digest)\n        this->md5Digest = static_cast<uint8_t *>(malloc(16));\n    MD5Final(this->md5Digest, this->md5Ctx);\n\n    this->cleanup(/* clearError= */ evenIfRemaining);\n    return !this->hasError();\n}\n\nvoid UpdateClass::cleanup(bool clearError) {\n    if (!this->ctx)\n        return;\n\n    if (!lt_ota_end(this->ctx)) {\n        // activating firmware failed\n        this->errArd = UPDATE_ERROR_ACTIVATE;\n        this->errUf2 = UF2_ERR_OK;\n    } else if (this->md5Digest && this->md5Expected && memcmp(this->md5Digest, this->md5Expected, 16) != 0) {\n        // MD5 doesn't match\n        this->errArd = UPDATE_ERROR_MD5;\n        this->errUf2 = UF2_ERR_OK;\n    } else if (clearError) {\n        // successful finish and activation, clear error codes\n        this->clearError();\n    } else if (this->ctx->error > UF2_ERR_IGNORE) {\n        // make error code based on UF2OTA code\n        this->errArd = errorMap[this->ctx->error];\n        this->errUf2 = this->ctx->error;\n    } else {\n        // only keep Arduino error code (set by the caller)\n        this->errUf2 = UF2_ERR_OK;\n    }\n\n#if LT_DEBUG_OTA\n    if (this->hasError())\n        this->printErrorContext();\n#endif\n\n    free(this->ctx);\n    this->ctx = nullptr;\n    free(this->md5Ctx);\n    this->md5Ctx = nullptr;\n    free(this->md5Digest);\n    this->md5Digest = nullptr;\n    free(this->md5Expected);\n    this->md5Expected = nullptr;\n}\n\nsize_t UpdateClass::write(const uint8_t *data, size_t len) {\n    if (!this->ctx)\n        return 0;\n\n    MD5Update(this->md5Ctx, data, len);\n    size_t written = lt_ota_write(ctx, data, len);\n    if (written != len)\n        this->cleanup(/* clearError= */ false);\n    return written;\n}\n\nsize_t UpdateClass::writeStream(Stream &data) {\n    if (!this->ctx)\n        return 0;\n\n    size_t written    = 0;\n    uint32_t lastData = millis();\n    // loop until the update is complete\n    while (remaining()) {\n        // check stream availability\n        auto available = data.available();\n        if (available <= 0) {\n            if (millis() - lastData > UPDATE_TIMEOUT_MS) {\n                // waited for data too long; abort with error\n                this->errArd = UPDATE_ERROR_STREAM;\n                this->cleanup(/* clearError= */ false);\n                return written;\n            }\n            continue;\n        }\n        // available > 0\n        lastData = millis();\n\n        // read data to fit in the remaining buffer space\n        auto bufSize = this->ctx->buf_pos - this->ctx->buf;\n        auto read    = data.readBytes(this->ctx->buf_pos, UF2_BLOCK_SIZE - bufSize);\n        // update MD5\n        MD5Update(this->md5Ctx, this->ctx->buf_pos, read);\n        // increment buffer writing head\n        this->ctx->buf_pos += read;\n        // process the block if complete\n        if (bufSize + read == UF2_BLOCK_SIZE)\n            lt_ota_write_block(this->ctx, reinterpret_cast<uf2_block_t *>(this->ctx->buf));\n        // abort on errors\n        if (hasError()) {\n            this->cleanup(/* clearError= */ false);\n            return written;\n        }\n        written += read;\n    }\n    return written;\n}\n\nUpdateClass Update;\n
"},{"location":"ltapi/_update_8h/","title":"File Update.h","text":"

FileList > arduino > libraries > common > Update > Update.h

Go to the source code of this file.

  • #include <Arduino.h>
  • #include <MD5.h>
  • #include <functional>
  • #include <uf2ota/uf2ota.h>
"},{"location":"ltapi/_update_8h/#classes","title":"Classes","text":"Type Name class UpdateClass"},{"location":"ltapi/_update_8h/#public-types","title":"Public Types","text":"Type Name enum UpdateCommand enum UpdateError"},{"location":"ltapi/_update_8h/#public-attributes","title":"Public Attributes","text":"Type Name UpdateClass Update"},{"location":"ltapi/_update_8h/#macros","title":"Macros","text":"Type Name define ENCRYPTED_BLOCK_SIZE 16 define UPDATE_SIZE_UNKNOWN 0xFFFFFFFF define UPDATE_TIMEOUT_MS 30 * 1000"},{"location":"ltapi/_update_8h/#public-types-documentation","title":"Public Types Documentation","text":""},{"location":"ltapi/_update_8h/#enum-updatecommand","title":"enum UpdateCommand","text":"
enum UpdateCommand {\n    U_FLASH = 0,\n    U_SPIFFS = 100,\n    U_AUTH = 200\n};\n
"},{"location":"ltapi/_update_8h/#enum-updateerror","title":"enum UpdateError","text":"
enum UpdateError {\n    UPDATE_ERROR_OK = 0,\n    UPDATE_ERROR_WRITE = 1,\n    UPDATE_ERROR_ERASE = 2,\n    UPDATE_ERROR_READ = 3,\n    UPDATE_ERROR_SPACE = 4,\n    UPDATE_ERROR_SIZE = 5,\n    UPDATE_ERROR_STREAM = 6,\n    UPDATE_ERROR_MD5 = 7,\n    UPDATE_ERROR_MAGIC_BYTE = 8,\n    UPDATE_ERROR_ACTIVATE = 9,\n    UPDATE_ERROR_NO_PARTITION = 10,\n    UPDATE_ERROR_BAD_ARGUMENT = 11,\n    UPDATE_ERROR_ABORT = 12\n};\n
"},{"location":"ltapi/_update_8h/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/_update_8h/#variable-update","title":"variable Update","text":"
UpdateClass Update;\n
"},{"location":"ltapi/_update_8h/#macro-definition-documentation","title":"Macro Definition Documentation","text":""},{"location":"ltapi/_update_8h/#define-encrypted_block_size","title":"define ENCRYPTED_BLOCK_SIZE","text":"
#define ENCRYPTED_BLOCK_SIZE 16\n
"},{"location":"ltapi/_update_8h/#define-update_size_unknown","title":"define UPDATE_SIZE_UNKNOWN","text":"
#define UPDATE_SIZE_UNKNOWN 0xFFFFFFFF\n
"},{"location":"ltapi/_update_8h/#define-update_timeout_ms","title":"define UPDATE_TIMEOUT_MS","text":"
#define UPDATE_TIMEOUT_MS 30 * 1000\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/Update/Update.h

"},{"location":"ltapi/_update_8h_source/","title":"File Update.h","text":"

File List > arduino > libraries > common > Update > Update.h

Go to the documentation of this file.

#pragma once\n\n#include <Arduino.h>\n#include <MD5.h>\n#include <functional>\n#include <uf2ota/uf2ota.h>\n\ntypedef enum {\n    UPDATE_ERROR_OK           = 0,  \n    UPDATE_ERROR_WRITE        = 1,  \n    UPDATE_ERROR_ERASE        = 2,  \n    UPDATE_ERROR_READ         = 3,  \n    UPDATE_ERROR_SPACE        = 4,  \n    UPDATE_ERROR_SIZE         = 5,  \n    UPDATE_ERROR_STREAM       = 6,  \n    UPDATE_ERROR_MD5          = 7,  \n    UPDATE_ERROR_MAGIC_BYTE   = 8,  \n    UPDATE_ERROR_ACTIVATE     = 9,  \n    UPDATE_ERROR_NO_PARTITION = 10, \n    UPDATE_ERROR_BAD_ARGUMENT = 11, \n    UPDATE_ERROR_ABORT        = 12, \n} UpdateError;\n\ntypedef enum {\n    U_FLASH  = 0,\n    U_SPIFFS = 100,\n    U_AUTH   = 200,\n} UpdateCommand;\n\n#define UPDATE_SIZE_UNKNOWN 0xFFFFFFFF\n\n#define ENCRYPTED_BLOCK_SIZE 16\n\n#define UPDATE_TIMEOUT_MS 30 * 1000\n\nclass UpdateClass {\n  public:\n    typedef std::function<void(size_t, size_t)> THandlerFunction_Progress;\n\n  public: /* Update.cpp */\n    bool begin(\n        size_t size       = UPDATE_SIZE_UNKNOWN,\n        int command       = U_FLASH,\n        int ledPin        = -1,\n        uint8_t ledOn     = LOW,\n        const char *label = nullptr\n    );\n    bool end(bool evenIfRemaining = false);\n\n    size_t write(const uint8_t *data, size_t len);\n    size_t writeStream(Stream &data);\n\n  private: /* Update.cpp */\n    void cleanup(bool clearError = false);\n\n  public: /* UpdateUtil.cpp */\n    UpdateClass &onProgress(THandlerFunction_Progress handler);\n    static bool canRollBack();\n    static bool rollBack();\n    bool setMD5(const char *md5);\n    String md5String();\n    void md5(uint8_t *result);\n    uint16_t getErrorCode() const;\n    bool hasError() const;\n    void clearError();\n    const char *errorString() const;\n    void printError(Print &out) const;\n\n  private: /* UpdateUtil.cpp */\n    static void progressHandler(UpdateClass *self);\n    void printErrorContext();\n\n  private:\n    lt_ota_ctx_t *ctx{nullptr};\n    uf2_err_t errUf2{UF2_ERR_OK};\n    UpdateError errArd{UPDATE_ERROR_OK};\n    THandlerFunction_Progress callback{nullptr};\n    LT_MD5_CTX_T *md5Ctx{nullptr};\n    uint8_t *md5Digest{nullptr};\n    uint8_t *md5Expected{nullptr};\n\n  public:\n    inline UpdateError getError() const {\n        return this->errArd;\n    }\n\n    inline uf2_err_t getUF2Error() const {\n        return this->ctx ? this->ctx->error : this->errUf2;\n    }\n\n    inline void abort() {\n        this->end();\n    }\n\n    inline bool isRunning() {\n        return this->ctx;\n    }\n\n    inline bool isFinished() {\n        return !(this->ctx && this->ctx->bytes_written != this->ctx->bytes_total);\n    }\n\n    inline size_t size() {\n        return this->ctx ? this->ctx->bytes_total : 0;\n    }\n\n    inline size_t progress() {\n        return this->ctx ? this->ctx->bytes_written : 0;\n    }\n\n    inline size_t remaining() {\n        return this->size() - this->progress();\n    }\n\n    inline const char *getFirmwareName() {\n        if (this->ctx)\n            return this->ctx->info.fw_name;\n        return nullptr;\n    }\n\n    inline const char *getFirmwareVersion() {\n        if (this->ctx)\n            return this->ctx->info.fw_version;\n        return nullptr;\n    }\n\n    inline const char *getLibreTinyVersion() {\n        if (this->ctx)\n            return this->ctx->info.lt_version;\n        return nullptr;\n    }\n\n    inline const char *getBoardName() {\n        if (this->ctx)\n            return this->ctx->info.board;\n        return nullptr;\n    }\n};\n\nextern UpdateClass Update;\n
"},{"location":"ltapi/_update_util_8cpp/","title":"File UpdateUtil.cpp","text":"

FileList > arduino > libraries > common > Update > UpdateUtil.cpp

Go to the source code of this file.

  • #include \"Update.h\"
  • #include <utility>
  • #include <fal.h>
"},{"location":"ltapi/_update_util_8cpp/#public-static-attributes","title":"Public Static Attributes","text":"Type Name const char * errArdText = = { nullptr, nullptr, nullptr, nullptr, nullptr, \"Bad Size Given\", \"Stream Read Timeout\", \"MD5 Check Failed\", nullptr, \"Could Not Activate The Firmware\", nullptr, \"Bad Argument\", \"Aborted\", } const char * errUf2Text = = { nullptr, nullptr, \"Bad Magic Number\", \"Bad Family ID\", \"Missing Header\", \"Old OTA Format Found\", \"Image Not Applicable\", \"Partition Not Found\", \"Partition Info Invalid\", \"Partition Info Missing\", \"Block Data Too Long\", \"Bad Block Sequence Number\", \"Flash Erase Failed\", \"Flash Write Failed\", \"Write Failed Length\", \"Partition Write-Protected\", \"Memory Alloc Failed\", } char errorStr"},{"location":"ltapi/_update_util_8cpp/#public-static-attributes-documentation","title":"Public Static Attributes Documentation","text":""},{"location":"ltapi/_update_util_8cpp/#variable-errardtext","title":"variable errArdText","text":"
const char* errArdText[];\n
"},{"location":"ltapi/_update_util_8cpp/#variable-erruf2text","title":"variable errUf2Text","text":"
const char* errUf2Text[];\n
"},{"location":"ltapi/_update_util_8cpp/#variable-errorstr","title":"variable errorStr","text":"
char errorStr[14];\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/Update/UpdateUtil.cpp

"},{"location":"ltapi/_update_util_8cpp_source/","title":"File UpdateUtil.cpp","text":"

File List > arduino > libraries > common > Update > UpdateUtil.cpp

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-05-30. */\n\n#include \"Update.h\"\n\n#include <utility>\n\nextern \"C\" {\n#include <fal.h>\n}\n\nstatic const char *errUf2Text[] = {\n    nullptr,                     // UF2_ERR_OK (0)\n    nullptr,                     // UF2_ERR_IGNORE (1)\n    \"Bad Magic Number\",          // UF2_ERR_MAGIC (2)\n    \"Bad Family ID\",             // UF2_ERR_FAMILY (3)\n    \"Missing Header\",            // UF2_ERR_NOT_HEADER (4)\n    \"Old OTA Format Found\",      // UF2_ERR_OTA_VER (5)\n    \"Image Not Applicable\",      // UF2_ERR_OTA_WRONG (6)\n    \"Partition Not Found\",       // UF2_ERR_PART_404 (7)\n    \"Partition Info Invalid\",    // UF2_ERR_PART_INVALID (8)\n    \"Partition Info Missing\",    // UF2_ERR_PART_UNSET (9)\n    \"Block Data Too Long\",       // UF2_ERR_DATA_TOO_LONG (10)\n    \"Bad Block Sequence Number\", // UF2_ERR_SEQ_MISMATCH (11)\n    \"Flash Erase Failed\",        // UF2_ERR_ERASE_FAILED (12)\n    \"Flash Write Failed\",        // UF2_ERR_WRITE_FAILED (13)\n    \"Write Failed Length\",       // UF2_ERR_WRITE_LENGTH (14)\n    \"Partition Write-Protected\", // UF2_ERR_WRITE_PROTECT (15)\n    \"Memory Alloc Failed\",       // UF2_ERR_ALLOC_FAILED (16)\n};\n\nstatic const char *errArdText[] = {\n    nullptr,                           // UPDATE_ERROR_OK (0)\n    nullptr,                           // UPDATE_ERROR_WRITE (1)\n    nullptr,                           // UPDATE_ERROR_ERASE (2)\n    nullptr,                           // UPDATE_ERROR_READ (3)\n    nullptr,                           // UPDATE_ERROR_SPACE (4)\n    \"Bad Size Given\",                  // UPDATE_ERROR_SIZE (5)\n    \"Stream Read Timeout\",             // UPDATE_ERROR_STREAM (6)\n    \"MD5 Check Failed\",                // UPDATE_ERROR_MD5 (7)\n    nullptr,                           // UPDATE_ERROR_MAGIC_BYTE (8)\n    \"Could Not Activate The Firmware\", // UPDATE_ERROR_ACTIVATE (9)\n    nullptr,                           // UPDATE_ERROR_NO_PARTITION (10)\n    \"Bad Argument\",                    // UPDATE_ERROR_BAD_ARGUMENT (11)\n    \"Aborted\",                         // UPDATE_ERROR_ABORT (12)\n};\n\nstatic char errorStr[14];\n\nUpdateClass &UpdateClass::onProgress(THandlerFunction_Progress handler) {\n    this->callback = std::move(handler);\n    return *this;\n}\n\nvoid UpdateClass::progressHandler(UpdateClass *self) {\n    if (self->callback)\n        self->callback(self->ctx->bytes_written, self->ctx->bytes_total);\n}\n\nbool UpdateClass::canRollBack() {\n    return lt_ota_can_rollback();\n}\n\nbool UpdateClass::rollBack() {\n    if (!lt_ota_can_rollback())\n        return false;\n    return lt_ota_switch(/* revert= */ false);\n}\n\nbool UpdateClass::setMD5(const char *md5) {\n    if (strlen(md5) != 32)\n        return false;\n    if (!this->md5Expected)\n        this->md5Expected = static_cast<uint8_t *>(malloc(16));\n    if (!this->md5Expected)\n        return false;\n    lt_xtob(md5, 32, this->md5Expected);\n    return true;\n}\n\nString UpdateClass::md5String() {\n    if (!this->md5Digest)\n        return \"\";\n    char out[32 + 1];\n    lt_btox(this->md5Digest, 16, out);\n    return String(out);\n}\n\nvoid UpdateClass::md5(uint8_t *result) {\n    if (!this->md5Digest) {\n        memset(result, '\\0', 16);\n        return;\n    }\n    memcpy(result, this->md5Digest, 16);\n}\n\nuint16_t UpdateClass::getErrorCode() const {\n    return (this->getError() << 8) | this->getUF2Error();\n}\n\nbool UpdateClass::hasError() const {\n    return this->getError() != UPDATE_ERROR_OK || this->getUF2Error() > UF2_ERR_IGNORE;\n}\n\nvoid UpdateClass::clearError() {\n    this->errArd = UPDATE_ERROR_OK;\n    this->errUf2 = UF2_ERR_OK;\n    if (this->ctx)\n        this->ctx->error = UF2_ERR_OK;\n}\n\nconst char *UpdateClass::errorString() const {\n    uint8_t err;\n    if ((err = this->getUF2Error()) > UF2_ERR_IGNORE)\n        return errUf2Text[err];\n    if ((err = this->getError()) != UPDATE_ERROR_OK)\n        return errArdText[err];\n    if (!this->hasError())\n        return \"\";\n    sprintf(errorStr, \"ard=%u,uf2=%u\", this->getError(), this->getUF2Error());\n    return errorStr;\n}\n\nvoid UpdateClass::printError(Print &out) const {\n    out.println(errorString());\n}\n\nvoid UpdateClass::printErrorContext() {\n#if LT_DEBUG_OTA\n    if (!this->ctx)\n        return;\n\n    LT_EM(OTA, \"Error: %s\", errorString());\n    if (errArd == UPDATE_ERROR_ABORT)\n        return;\n\n    LT_EM(OTA, \"- written: %u of %u\", this->ctx->bytes_written, this->ctx->bytes_total);\n    LT_EM(\n        OTA,\n        \"- buf: size=%lld, left=%lld\",\n        this->ctx->buf_pos - this->ctx->buf,\n        this->ctx->buf + UF2_BLOCK_SIZE - this->ctx->buf_pos\n    );\n    hexdump(this->ctx->buf, this->ctx->buf_pos - this->ctx->buf);\n\n    if (ctx)\n        LT_EM(\n            OTA,\n            \"- ctx: seq=%u, part=%s\",\n            this->ctx->uf2.seq - 1, // print last parsed block seq\n            this->ctx->uf2.part ? this->ctx->uf2.part->name : nullptr\n        );\n\n    auto *block = (uf2_block_t *)this->ctx->buf;\n    LT_EM(OTA, \"- buf: seq=%u/%u, addr=%u, len=%u\", block->block_seq, block->block_count, block->addr, block->len);\n#endif\n}\n
"},{"location":"ltapi/dir_f12ca718858451d77068237cb7af4643/","title":"Dir cores/common/arduino/libraries/common/WiFiClient","text":"

FileList > arduino > libraries > common > WiFiClient

"},{"location":"ltapi/dir_f12ca718858451d77068237cb7af4643/#files","title":"Files","text":"Type Name file LwIPClient.cpp file LwIPClient.h file LwIPRxBuffer.cpp file LwIPRxBuffer.h file MbedTLSClient.cpp file MbedTLSClient.h file WiFiClient.h file WiFiClientSecure.h

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiClient/

"},{"location":"ltapi/_lw_i_p_client_8cpp/","title":"File LwIPClient.cpp","text":"

FileList > arduino > libraries > common > WiFiClient > LwIPClient.cpp

Go to the source code of this file.

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiClient/LwIPClient.cpp

"},{"location":"ltapi/_lw_i_p_client_8cpp_source/","title":"File LwIPClient.cpp","text":"

File List > arduino > libraries > common > WiFiClient > LwIPClient.cpp

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-04-26. */\n\n#if LT_ARD_HAS_WIFI && LT_HAS_LWIP\n\n#include \"LwIPClient.h\"\n\n#include <WiFi.h>\n\n#define MAX_SOCK_NUM                4\n#define WIFI_CLIENT_CONNECT_TIMEOUT 3000\n#define WIFI_CLIENT_READ_TIMEOUT    3000\n#define WIFI_CLIENT_WRITE_RETRY     10\n#define WIFI_CLIENT_SELECT_TIMEOUT  1000\n#define WIFI_CLIENT_FLUSH_BUF_SIZE  1024\n\n// disable #defines removing lwip_ prefix\n#undef LWIP_COMPAT_SOCKETS\n#define LWIP_COMPAT_SOCKETS 0\n\nextern \"C\" {\n\n#include <lwip/api.h>\n#include <lwip/dns.h>\n#include <lwip/err.h>\n#include <lwip/sockets.h>\n#include <sys/time.h>\n\n} // extern \"C\"\n\nclass SocketHandle {\n  public:\n    int fd;\n\n    SocketHandle(int fd) : fd(fd) {}\n\n    ~SocketHandle() {\n        lwip_close(fd);\n    }\n};\n\nLwIPClient::LwIPClient() {\n    LT_VM(CLIENT, \"LwIPClient()\");\n    _connected = false;\n    _sock      = NULL;\n    _rxBuffer  = NULL;\n    _timeout   = WIFI_CLIENT_CONNECT_TIMEOUT;\n}\n\nLwIPClient::LwIPClient(int sock) {\n    LT_VM(CLIENT, \"LwIPClient(%d)\", sock);\n    _connected = true;\n    _sock      = std::make_shared<SocketHandle>(sock);\n    _rxBuffer  = std::make_shared<LwIPRxBuffer>(sock);\n    _timeout   = WIFI_CLIENT_CONNECT_TIMEOUT;\n}\n\nLwIPClient::~LwIPClient() {\n    LT_VM(CLIENT, \"~LwIPClient()\");\n    stop();\n}\n\nLwIPClient &LwIPClient::operator=(const LwIPClient &other) {\n    stop();\n    _connected = other._connected;\n    _sock      = other._sock;\n    _rxBuffer  = other._rxBuffer;\n    return *this;\n}\n\nbool IWiFiClient::operator==(const IWiFiClient &other) const {\n    return fd() == other.fd() && remoteIP() == other.remoteIP() && remotePort() == other.remotePort();\n}\n\nint LwIPClient::connect(IPAddress ip, uint16_t port) {\n    return connect(ip, port, _timeout);\n}\n\nint LwIPClient::connect(const char *host, uint16_t port) {\n    return connect(host, port, _timeout);\n}\n\nint LwIPClient::connect(const char *host, uint16_t port, int32_t timeout) {\n    IPAddress ip = WiFi.hostByName(host);\n    if (!ip)\n        return 0;\n    return connect(ip, port, timeout);\n}\n\nint LwIPClient::connect(IPAddress ip, uint16_t port, int32_t timeout) {\n    if (_connected)\n        stop();\n    int sock = lwip_socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);\n    if (sock < 0) {\n        LT_DM(CLIENT, \"socket failed\");\n        return -1;\n    }\n\n    if (timeout <= 0)\n        timeout = _timeout; // use default when -1 passed as timeout\n\n    lwip_fcntl(sock, F_SETFL, lwip_fcntl(sock, F_GETFL, 0) | O_NONBLOCK);\n\n    LT_ERRNO();\n\n    struct sockaddr_in addr;\n    memset(&addr, 0, sizeof(addr));\n    addr.sin_family      = AF_INET;\n    addr.sin_addr.s_addr = ip;\n    addr.sin_port        = htons(port);\n    fd_set fdset;\n    struct timeval tv;\n    FD_ZERO(&fdset);\n    FD_SET(sock, &fdset);\n    tv.tv_sec  = 0;\n    tv.tv_usec = timeout * 1000; // millis -> micros\n\n    int res = lwip_connect(sock, (struct sockaddr *)&addr, sizeof(addr));\n    if (res < 0 && errno != EINPROGRESS) {\n        LT_EM(CLIENT, \"Connect failed; errno=%d\", errno);\n        lwip_close(sock);\n        return -1;\n    }\n\n    res = lwip_select(sock + 1, NULL, &fdset, NULL, timeout < 0 ? NULL : &tv);\n    if (res < 0) {\n        LT_EM(CLIENT, \"Select failed; errno=%d\", errno);\n        lwip_close(sock);\n        return 0;\n    }\n    if (res == 0) {\n        LT_EM(CLIENT, \"Select timeout; errno=%d\", errno);\n        lwip_close(sock);\n        return 0;\n    }\n\n    int sockerr;\n    socklen_t len = (socklen_t)sizeof(sockerr);\n    res           = lwip_getsockopt(sock, SOL_SOCKET, SO_ERROR, &sockerr, &len);\n\n    if (res < 0 || sockerr != 0) {\n        LT_EM(CLIENT, \"Socket error; res=%d, sockerr=%d\", res, sockerr);\n        lwip_close(sock);\n        return 0;\n    }\n\n    int enable = 1;\n    lwip_setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, &timeout, sizeof(timeout));\n    lwip_setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, &timeout, sizeof(timeout));\n    lwip_setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, &enable, sizeof(enable));\n    lwip_setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, &enable, sizeof(enable));\n\n    LT_ERRNO();\n\n    lwip_fcntl(sock, F_SETFL, lwip_fcntl(sock, F_GETFL, 0) & ~O_NONBLOCK);\n\n    LT_ERRNO();\n\n    _connected = true;\n    _sock      = std::make_shared<SocketHandle>(sock);\n    _rxBuffer  = std::make_shared<LwIPRxBuffer>(sock);\n    return 1;\n}\n\nsize_t LwIPClient::write(uint8_t data) {\n    return write(&data, 1);\n}\n\nsize_t LwIPClient::write(Stream &stream) {\n    uint8_t *buf = (uint8_t *)malloc(1360);\n    if (!buf) {\n        return 0;\n    }\n    size_t toRead = 0, toWrite = 0, written = 0;\n    size_t available = stream.available();\n    while (available) {\n        toRead  = (available > 1360) ? 1360 : available;\n        toWrite = stream.readBytes(buf, toRead);\n        written += write(buf, toWrite);\n        available = stream.available();\n    }\n    free(buf);\n    return written;\n}\n\nsize_t LwIPClient::write(const uint8_t *buf, size_t size) {\n    if (_sock < 0 || !_connected || !size) {\n        setWriteError();\n        return 0;\n    }\n\n    int retry   = WIFI_CLIENT_WRITE_RETRY;\n    int written = 0;\n    while (retry) {\n        fd_set fdset;\n        struct timeval tv;\n        FD_ZERO(&fdset);\n        FD_SET(fd(), &fdset);\n        tv.tv_sec  = 0;\n        tv.tv_usec = WIFI_CLIENT_SELECT_TIMEOUT * 1000;\n        retry--;\n\n        if (lwip_select(fd() + 1, NULL, &fdset, NULL, &tv) < 0) {\n            LT_WM(CLIENT, \"Select failed; errno=%d\", errno);\n            return 0;\n        }\n\n        if (FD_ISSET(fd(), &fdset)) {\n            int res = lwip_send(fd(), buf, size, MSG_DONTWAIT);\n            if (res > 0) {\n                written += res;\n                if (res >= size) {\n                    retry = 0;\n                } else {\n                    buf += res;\n                    size -= res;\n                    retry = WIFI_CLIENT_WRITE_RETRY;\n                }\n            } else if (res < 0 && errno != EAGAIN) {\n                LT_WM(CLIENT, \"Send failed; errno=%d\", errno);\n                setWriteError(res);\n                _connected = false;\n                retry      = 0;\n            } else {\n                // Try again\n            }\n        }\n    }\n    LT_DM(CLIENT, \"wrote %d bytes\", written);\n    return written;\n}\n\nint LwIPClient::available() {\n    if (!_connected || !_rxBuffer)\n        return 0;\n    int res = _rxBuffer->available();\n    if (_rxBuffer->failed()) {\n        LT_ERRNO();\n        stop();\n    }\n    return res;\n}\n\nint LwIPClient::fd() const {\n    if (!_sock)\n        return -1;\n    return _sock->fd;\n}\n\nint LwIPClient::socket() {\n    return fd();\n}\n\nint LwIPClient::setTimeout(uint32_t seconds) {\n    Client::setTimeout(seconds * 1000);\n    lwip_setsockopt(fd(), SOL_SOCKET, SO_RCVTIMEO, &_timeout, sizeof(_timeout));\n    return lwip_setsockopt(fd(), SOL_SOCKET, SO_SNDTIMEO, &_timeout, sizeof(_timeout));\n}\n\nint LwIPClient::read() {\n    uint8_t data;\n    int res = read(&data, 1);\n    if (res < 0)\n        return res;\n    if (res == 0)\n        return -1;\n    return data;\n}\n\nint LwIPClient::read(uint8_t *buf, size_t size) {\n    int res = -1;\n    if (_rxBuffer) {\n        res = _rxBuffer->read(buf, size);\n        if (_rxBuffer->failed()) {\n            stop();\n        }\n    }\n    return res;\n}\n\nint LwIPClient::peek() {\n    int res = -1;\n    if (_rxBuffer) {\n        res = _rxBuffer->peek();\n        if (_rxBuffer->failed()) {\n            stop();\n        }\n    }\n    return res;\n}\n\nvoid LwIPClient::flush() {\n    int res;\n    size_t len = available();\n    if (!len)\n        return;\n    uint8_t *buf = (uint8_t *)malloc(WIFI_CLIENT_FLUSH_BUF_SIZE);\n    if (!buf)\n        return;\n    while (len) {\n        res = lwip_recv(fd(), buf, LWIP_MIN(len, WIFI_CLIENT_FLUSH_BUF_SIZE), MSG_DONTWAIT);\n        if (res < 0) {\n            stop();\n            break;\n        }\n        len -= res;\n    }\n    free(buf);\n}\n\nvoid LwIPClient::stop() {\n    LT_VM(CLIENT, \"Stopping TCP\");\n    _connected = false;\n    _sock      = NULL;\n    _rxBuffer  = NULL;\n}\n\nuint8_t LwIPClient::connected() {\n    if (_connected) {\n        uint8_t dummy;\n        if (lwip_recv(fd(), &dummy, 0, MSG_DONTWAIT) <= 0) {\n            switch (errno) {\n                case EWOULDBLOCK:\n                case ENOENT: // caused by vfs\n                case 0:\n                    _connected = true;\n                    break;\n                case ENOTCONN:\n                case EPIPE:\n                case ECONNRESET:\n                case ECONNREFUSED:\n                case ECONNABORTED:\n                    LT_IM(CLIENT, \"Connection closed; errno=%d\", errno);\n                    _connected = false;\n                    break;\n                default:\n                    LT_WM(CLIENT, \"Connection status unknown; errno=%d\", errno);\n                    _connected = true;\n                    break;\n            }\n        }\n    }\n    return _connected;\n}\n\nIPAddress __attribute__((noinline)) getaddr(int sock, int (*func)(int, struct sockaddr *, socklen_t *)) {\n    struct sockaddr addr;\n    socklen_t len = sizeof(addr);\n    func(sock, &addr, &len);\n    struct sockaddr_in *s = (struct sockaddr_in *)&addr;\n    return IPAddress((uint32_t)(s->sin_addr.s_addr));\n}\n\nuint16_t __attribute__((noinline)) getport(int sock, int (*func)(int, struct sockaddr *, socklen_t *)) {\n    struct sockaddr addr;\n    socklen_t len = sizeof(addr);\n    func(sock, &addr, &len);\n    struct sockaddr_in *s = (struct sockaddr_in *)&addr;\n    return ntohs(s->sin_port);\n}\n\nIPAddress LwIPClient::remoteIP() const {\n    return getaddr(fd(), lwip_getpeername);\n}\n\nIPAddress LwIPClient::remoteIP(int fd) const {\n    return getaddr(fd, lwip_getpeername);\n}\n\nuint16_t LwIPClient::remotePort() const {\n    return getport(fd(), lwip_getpeername);\n}\n\nuint16_t LwIPClient::remotePort(int fd) const {\n    return getport(fd, lwip_getpeername);\n}\n\nIPAddress LwIPClient::localIP() const {\n    return getaddr(fd(), lwip_getsockname);\n}\n\nIPAddress LwIPClient::localIP(int fd) const {\n    return getaddr(fd, lwip_getsockname);\n}\n\nuint16_t LwIPClient::localPort() const {\n    return getport(fd(), lwip_getsockname);\n}\n\nuint16_t LwIPClient::localPort(int fd) const {\n    return getport(fd, lwip_getsockname);\n}\n\n#endif\n
"},{"location":"ltapi/_lw_i_p_client_8h/","title":"File LwIPClient.h","text":"

FileList > arduino > libraries > common > WiFiClient > LwIPClient.h

Go to the source code of this file.

  • #include \"WiFiClient.h\"
  • #include \"LwIPRxBuffer.h\"
  • #include <memory>
"},{"location":"ltapi/_lw_i_p_client_8h/#classes","title":"Classes","text":"Type Name class LwIPClient"},{"location":"ltapi/_lw_i_p_client_8h/#public-types","title":"Public Types","text":"Type Name typedef LwIPClient WiFiClient"},{"location":"ltapi/_lw_i_p_client_8h/#public-types-documentation","title":"Public Types Documentation","text":""},{"location":"ltapi/_lw_i_p_client_8h/#typedef-wificlient","title":"typedef WiFiClient","text":"
typedef LwIPClient WiFiClient;\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiClient/LwIPClient.h

"},{"location":"ltapi/_lw_i_p_client_8h_source/","title":"File LwIPClient.h","text":"

File List > arduino > libraries > common > WiFiClient > LwIPClient.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-04-26. */\n\n#pragma once\n\n#if (LT_ARD_HAS_WIFI && LT_HAS_LWIP) || DOXYGEN\n\n#include \"WiFiClient.h\"\n\n#include \"LwIPRxBuffer.h\"\n#include <memory>\n\nclass SocketHandle;\n\nclass LwIPClient : public IWiFiClient {\n  private:\n    bool _connected;\n    std::shared_ptr<SocketHandle> _sock;\n    std::shared_ptr<LwIPRxBuffer> _rxBuffer;\n\n  public:\n    LwIPClient();\n    LwIPClient(int sock);\n    ~LwIPClient();\n\n    int connect(IPAddress ip, uint16_t port);\n    int connect(const char *host, uint16_t port);\n    int connect(IPAddress ip, uint16_t port, int32_t timeout);\n    int connect(const char *host, uint16_t port, int32_t timeout);\n\n    size_t write(uint8_t data);\n    size_t write(const uint8_t *buf, size_t size);\n    size_t write(Stream &stream);\n\n    int available();\n    int fd() const;\n    int socket();\n    int setTimeout(uint32_t seconds);\n\n    int read();\n    int read(uint8_t *buf, size_t size);\n    int peek();\n    void flush();\n    void stop();\n    uint8_t connected();\n\n    LwIPClient &operator=(const LwIPClient &other);\n\n    IPAddress remoteIP() const;\n    IPAddress remoteIP(int sock) const;\n    uint16_t remotePort() const;\n    uint16_t remotePort(int sock) const;\n    IPAddress localIP() const;\n    IPAddress localIP(int sock) const;\n    uint16_t localPort() const;\n    uint16_t localPort(int sock) const;\n\n    using Print::write;\n};\n\ntypedef LwIPClient WiFiClient;\n\n#endif\n
"},{"location":"ltapi/_lw_i_p_rx_buffer_8cpp/","title":"File LwIPRxBuffer.cpp","text":"

FileList > arduino > libraries > common > WiFiClient > LwIPRxBuffer.cpp

Go to the source code of this file.

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiClient/LwIPRxBuffer.cpp

"},{"location":"ltapi/_lw_i_p_rx_buffer_8cpp_source/","title":"File LwIPRxBuffer.cpp","text":"

File List > arduino > libraries > common > WiFiClient > LwIPRxBuffer.cpp

Go to the documentation of this file.

#if LT_HAS_LWIP\n\n#include \"LwIPRxBuffer.h\"\n\n// disable #defines removing lwip_ prefix\n#undef LWIP_COMPAT_SOCKETS\n#define LWIP_COMPAT_SOCKETS 0\n\nextern \"C\" {\n\n#include <lwip/sockets.h>\n\n} // extern \"C\"\n\nsize_t LwIPRxBuffer::r_available() {\n    if (_sock < 0) {\n        LT_DM(CLIENT, \"_sock < 0\");\n        return 0;\n    }\n    int count = 0; // must be of same size as in lwip_ioctl()\n    int res   = lwip_ioctl(_sock, FIONREAD, &count);\n    if (res < 0) {\n        LT_DM(CLIENT, \"lwip_ioctl()=%d, errno=%d\", res, errno);\n        _failed = true;\n        return 0;\n    }\n    return count;\n}\n\nsize_t LwIPRxBuffer::fillBuffer() {\n    if (!_buffer) {\n        _buffer = (uint8_t *)malloc(_size);\n        if (!_buffer) {\n            LT_E(\"buffer alloc failed\");\n            _failed = true;\n            return 0;\n        }\n    }\n    if (_fill && _pos == _fill) {\n        _fill = 0;\n        _pos  = 0;\n    }\n    if (!_buffer || _size <= _fill || !r_available()) {\n        return 0;\n    }\n    int res = lwip_recv(_sock, _buffer + _fill, _size - _fill, MSG_DONTWAIT);\n    if (res < 0) {\n        if (errno != EWOULDBLOCK) {\n            LT_ERRNO();\n            _failed = true;\n        }\n        return 0;\n    }\n    _fill += res;\n    return res;\n}\n\nLwIPRxBuffer::LwIPRxBuffer(int sock, size_t size)\n    : _size(size), _buffer(NULL), _pos(0), _fill(0), _sock(sock), _failed(false) {\n    //_buffer = (uint8_t *)malloc(_size);\n}\n\nLwIPRxBuffer::~LwIPRxBuffer() {\n    free(_buffer);\n}\n\nbool LwIPRxBuffer::failed() {\n    return _failed;\n}\n\nint LwIPRxBuffer::read(uint8_t *dst, size_t len) {\n    if (!dst || !len || (_pos == _fill && !fillBuffer())) {\n        return _failed ? -1 : 0;\n    }\n    size_t a = _fill - _pos;\n    if (len <= a || ((len - a) <= (_size - _fill) && fillBuffer() >= (len - a))) {\n        if (len == 1) {\n            *dst = _buffer[_pos];\n        } else {\n            memcpy(dst, _buffer + _pos, len);\n        }\n        _pos += len;\n        return len;\n    }\n    size_t left   = len;\n    size_t toRead = a;\n    uint8_t *buf  = dst;\n    memcpy(buf, _buffer + _pos, toRead);\n    _pos += toRead;\n    left -= toRead;\n    buf += toRead;\n    while (left) {\n        if (!fillBuffer()) {\n            return len - left;\n        }\n        a      = _fill - _pos;\n        toRead = (a > left) ? left : a;\n        memcpy(buf, _buffer + _pos, toRead);\n        _pos += toRead;\n        left -= toRead;\n        buf += toRead;\n    }\n    return len;\n}\n\nint LwIPRxBuffer::peek() {\n    if (_pos == _fill && !fillBuffer()) {\n        return -1;\n    }\n    return _buffer[_pos];\n}\n\nsize_t LwIPRxBuffer::available() {\n    return _fill - _pos + r_available();\n}\n\n#endif\n
"},{"location":"ltapi/_lw_i_p_rx_buffer_8h/","title":"File LwIPRxBuffer.h","text":"

FileList > arduino > libraries > common > WiFiClient > LwIPRxBuffer.h

Go to the source code of this file.

  • #include <Arduino.h>
  • #include <stdlib.h>
"},{"location":"ltapi/_lw_i_p_rx_buffer_8h/#classes","title":"Classes","text":"Type Name class LwIPRxBuffer

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiClient/LwIPRxBuffer.h

"},{"location":"ltapi/_lw_i_p_rx_buffer_8h_source/","title":"File LwIPRxBuffer.h","text":"

File List > arduino > libraries > common > WiFiClient > LwIPRxBuffer.h

Go to the documentation of this file.

#pragma once\n\n#include <Arduino.h>\n#include <stdlib.h>\n\nclass LwIPRxBuffer {\n  private:\n    size_t _size;\n    uint8_t *_buffer;\n    size_t _pos;\n    size_t _fill;\n    int _sock;\n    bool _failed;\n    size_t r_available();\n    size_t fillBuffer();\n\n  public:\n    LwIPRxBuffer(int sock, size_t size = 1436);\n    ~LwIPRxBuffer();\n    bool failed();\n    int read(uint8_t *dst, size_t len);\n    int peek();\n    size_t available();\n};\n
"},{"location":"ltapi/_mbed_t_l_s_client_8cpp/","title":"File MbedTLSClient.cpp","text":"

FileList > arduino > libraries > common > WiFiClient > MbedTLSClient.cpp

Go to the source code of this file.

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiClient/MbedTLSClient.cpp

"},{"location":"ltapi/_mbed_t_l_s_client_8cpp_source/","title":"File MbedTLSClient.cpp","text":"

File List > arduino > libraries > common > WiFiClient > MbedTLSClient.cpp

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-04-30. */\n\n#if LT_ARD_HAS_WIFI && LT_HAS_MBEDTLS\n\n#include \"MbedTLSClient.h\"\n\n#include <WiFi.h>\n\nextern \"C\" {\n\n#include <mbedtls/debug.h>\n#include <mbedtls/net.h>\n#include <mbedtls/pk.h>\n#include <mbedtls/platform.h>\n#include <mbedtls/sha256.h>\n#include <mbedtls/ssl.h>\n\n#if LT_HAS_FREERTOS\n#include <FreeRTOS.h>\n#endif\n\n} // extern \"C\"\n\n#define _clientKeyC ((mbedtls_pk_context *)_clientKey)\n\nMbedTLSClient::MbedTLSClient() : WiFiClient() {\n    init(); // ensure the context is zero filled\n}\n\nMbedTLSClient::MbedTLSClient(int sock) : WiFiClient(sock) {\n    init(); // ensure the context is zero filled\n}\n\nMbedTLSClient::~MbedTLSClient() {\n    LT_VM(CLIENT, \"~MbedTLSClient()\");\n    stop();\n}\n\nvoid MbedTLSClient::stop() {\n    if (!_sslCtx)\n        return;\n    LT_VM(SSL, \"Stopping SSL\");\n\n    if (_sslCfg->ca_chain) {\n        mbedtls_x509_crt_free(_caCert);\n    }\n    if (_sslCfg->key_cert) {\n        mbedtls_x509_crt_free(_clientCert);\n        mbedtls_pk_free(_clientKeyC);\n    }\n    mbedtls_ssl_free(_sslCtx);\n    mbedtls_ssl_config_free(_sslCfg);\n\n    free(_sslCtx);\n    free(_sslCfg);\n    free(_caCert);\n    free(_clientCert);\n    free(_clientKey);\n    _sslCtx = NULL;\n\n    LT_HEAP_I();\n}\n\nvoid MbedTLSClient::init() {\n    if (!_sslCtx) {\n        _sslCtx     = (mbedtls_ssl_context *)malloc(sizeof(mbedtls_ssl_context));\n        _sslCfg     = (mbedtls_ssl_config *)malloc(sizeof(mbedtls_ssl_config));\n        _caCert     = (mbedtls_x509_crt *)malloc(sizeof(mbedtls_x509_crt));\n        _clientCert = (mbedtls_x509_crt *)malloc(sizeof(mbedtls_x509_crt));\n        _clientKey  = (mbedtls_pk_context *)malloc(sizeof(mbedtls_pk_context));\n    }\n    // Realtek AmbZ: init platform here to ensure HW crypto is initialized in ssl_init\n    mbedtls_platform_set_calloc_free(calloc, free);\n    mbedtls_ssl_init(_sslCtx);\n    mbedtls_ssl_config_init(_sslCfg);\n}\n\nint MbedTLSClient::connect(IPAddress ip, uint16_t port, int32_t timeout) {\n    return connect(ipToString(ip).c_str(), port, timeout);\n}\n\nint MbedTLSClient::connect(const char *host, uint16_t port, int32_t timeout) {\n    if (_pskIdentStr && _pskStr)\n        return connect(host, port, timeout, NULL, NULL, NULL, _pskIdentStr, _pskStr) == 0;\n    return connect(host, port, timeout, _caCertStr, _clientCertStr, _clientKeyStr, NULL, NULL) == 0;\n}\n\nint MbedTLSClient::connect(\n    IPAddress ip, uint16_t port, const char *rootCABuf, const char *clientCert, const char *clientKey\n) {\n    return connect(ipToString(ip).c_str(), port, 0, rootCABuf, clientCert, clientKey, NULL, NULL) == 0;\n}\n\nint MbedTLSClient::connect(\n    const char *host, uint16_t port, const char *rootCABuf, const char *clientCert, const char *clientKey\n) {\n    return connect(host, port, 0, rootCABuf, clientCert, clientKey, NULL, NULL) == 0;\n}\n\nint MbedTLSClient::connect(IPAddress ip, uint16_t port, const char *pskIdent, const char *psk) {\n    return connect(ipToString(ip).c_str(), port, 0, NULL, NULL, NULL, pskIdent, psk) == 0;\n}\n\nint MbedTLSClient::connect(const char *host, uint16_t port, const char *pskIdent, const char *psk) {\n    return connect(host, port, 0, NULL, NULL, NULL, pskIdent, psk) == 0;\n}\n\nstatic int ssl_random(void *data, unsigned char *output, size_t len) {\n    lt_rand_bytes((uint8_t *)output, len);\n    return 0;\n}\n\nvoid debug_cb(void *ctx, int level, const char *file, int line, const char *str) {\n    // do not print the trailing \\n\n    uint16_t len = strlen(str);\n    char *msg    = (char *)str;\n    msg[len - 1] = '\\0';\n    LT_IM(SSL, \"%04d: |%d| %s\", line, level, msg);\n}\n\nint MbedTLSClient::connect(\n    const char *host,\n    uint16_t port,\n    int32_t timeout,\n    const char *rootCABuf,\n    const char *clientCert,\n    const char *clientKey,\n    const char *pskIdent,\n    const char *psk\n) {\n    LT_HEAP_I();\n\n    if (!rootCABuf && !pskIdent && !psk && !_insecure && !_useRootCA)\n        return -1;\n\n    if (timeout <= 0)\n        timeout = _timeout; // use default when -1 passed as timeout\n\n    IPAddress addr = WiFi.hostByName(host);\n    if (!(uint32_t)addr)\n        return -1;\n\n    int ret = WiFiClient::connect(addr, port, timeout);\n    if (ret < 0) {\n        LT_EM(SSL, \"SSL socket failed\");\n        return ret;\n    }\n\n    char *uid = \"lt-ssl\"; // TODO\n\n    LT_VM(SSL, \"Init SSL\");\n    init();\n    LT_HEAP_I();\n\n    // mbedtls_debug_set_threshold(4);\n    // mbedtls_ssl_conf_dbg(&_sslCfg, debug_cb, NULL);\n\n    ret = mbedtls_ssl_config_defaults(\n        _sslCfg,\n        MBEDTLS_SSL_IS_CLIENT,\n        MBEDTLS_SSL_TRANSPORT_STREAM,\n        MBEDTLS_SSL_PRESET_DEFAULT\n    );\n    LT_RET_NZ(ret);\n\n#ifdef MBEDTLS_SSL_ALPN\n    if (_alpnProtocols) {\n        ret = mbedtls_ssl_conf_alpn_protocols(&_sslCfg, _alpnProtocols);\n        LT_RET_NZ(ret);\n    }\n#endif\n\n    if (_insecure) {\n        mbedtls_ssl_conf_authmode(_sslCfg, MBEDTLS_SSL_VERIFY_NONE);\n    } else if (rootCABuf) {\n        mbedtls_x509_crt_init(_caCert);\n        mbedtls_ssl_conf_authmode(_sslCfg, MBEDTLS_SSL_VERIFY_REQUIRED);\n        ret = mbedtls_x509_crt_parse(_caCert, (const unsigned char *)rootCABuf, strlen(rootCABuf) + 1);\n        mbedtls_ssl_conf_ca_chain(_sslCfg, _caCert, NULL);\n        if (ret < 0) {\n            mbedtls_x509_crt_free(_caCert);\n            LT_RET(ret);\n        }\n    } else if (_useRootCA) {\n        return -1; // not implemented\n    } else if (pskIdent && psk) {\n#ifdef MBEDTLS_KEY_EXCHANGE__SOME__PSK_ENABLED\n        uint16_t len = strlen(psk);\n        if ((len & 1) != 0 || len > 2 * MBEDTLS_PSK_MAX_LEN) {\n            LT_EM(SSL, \"PSK length invalid\");\n            return -1;\n        }\n        unsigned char pskBin[MBEDTLS_PSK_MAX_LEN] = {};\n        for (uint8_t i = 0; i < len; i++) {\n            uint8_t c = psk[i];\n            c |= 0b00100000; // make lowercase\n            c -= '0' * (c >= '0' && c <= '9');\n            c -= ('a' - 10) * (c >= 'a' && c <= 'z');\n            if (c > 0xf)\n                return -1;\n            pskBin[i / 2] |= c << (4 * ((i & 1) ^ 1));\n        }\n        ret = mbedtls_ssl_conf_psk(_sslCfg, pskBin, len / 2, (const unsigned char *)pskIdent, strlen(pskIdent));\n        LT_RET_NZ(ret);\n#else\n        return -1;\n#endif\n    } else {\n        return -1;\n    }\n\n    if (!_insecure && clientCert && clientKey) {\n        mbedtls_x509_crt_init(_clientCert);\n        mbedtls_pk_init(_clientKeyC);\n        LT_VM(SSL, \"Loading client cert\");\n        ret = mbedtls_x509_crt_parse(_clientCert, (const unsigned char *)clientCert, strlen(clientCert) + 1);\n        if (ret < 0) {\n            mbedtls_x509_crt_free(_clientCert);\n            LT_RET(ret);\n        }\n        LT_VM(SSL, \"Loading private key\");\n        ret = mbedtls_pk_parse_key(_clientKeyC, (const unsigned char *)clientKey, strlen(clientKey) + 1, NULL, 0);\n        if (ret < 0) {\n            mbedtls_x509_crt_free(_clientCert);\n            LT_RET(ret);\n        }\n        mbedtls_ssl_conf_own_cert(_sslCfg, _clientCert, _clientKeyC);\n    }\n\n    LT_VM(SSL, \"Setting TLS hostname\");\n    ret = mbedtls_ssl_set_hostname(_sslCtx, host);\n    LT_RET_NZ(ret);\n\n    mbedtls_ssl_conf_rng(_sslCfg, ssl_random, NULL);\n    ret = mbedtls_ssl_setup(_sslCtx, _sslCfg);\n    LT_RET_NZ(ret);\n\n    _sockTls = fd();\n    mbedtls_ssl_set_bio(_sslCtx, &_sockTls, mbedtls_net_send, mbedtls_net_recv, NULL);\n    mbedtls_net_set_nonblock((mbedtls_net_context *)&_sockTls);\n\n    LT_HEAP_I();\n\n    LT_VM(SSL, \"SSL handshake\");\n    if (_handshakeTimeout == 0)\n        _handshakeTimeout = timeout;\n    unsigned long start = millis();\n    while (ret = mbedtls_ssl_handshake(_sslCtx)) {\n        if (ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE) {\n            LT_RET(ret);\n        }\n        if ((millis() - start) > _handshakeTimeout) {\n            LT_EM(SSL, \"SSL handshake timeout\");\n            return -1;\n        }\n        delay(2);\n    }\n\n    LT_HEAP_I();\n\n    if (clientCert && clientKey) {\n        LT_DM(\n            SSL,\n            \"Protocol %s, ciphersuite %s\",\n            mbedtls_ssl_get_version(_sslCtx),\n            mbedtls_ssl_get_ciphersuite(_sslCtx)\n        );\n        ret = mbedtls_ssl_get_record_expansion(_sslCtx);\n        if (ret >= 0)\n            LT_DM(SSL, \"Record expansion: %d\", ret);\n        else {\n            LT_WM(SSL, \"Record expansion unknown\");\n        }\n    }\n\n    LT_VM(SSL, \"Verifying certificate\");\n    ret = mbedtls_ssl_get_verify_result(_sslCtx);\n    if (ret) {\n        char buf[512];\n        memset(buf, 0, sizeof(buf));\n        mbedtls_x509_crt_verify_info(buf, sizeof(buf), \"  ! \", ret);\n        LT_EM(SSL, \"Failed to verify peer certificate! Verification info: %s\", buf);\n        return ret;\n    }\n\n    if (rootCABuf)\n        mbedtls_x509_crt_free(_caCert);\n    if (clientCert)\n        mbedtls_x509_crt_free(_clientCert);\n    if (clientKey != NULL)\n        mbedtls_pk_free(_clientKeyC);\n    return 0; // OK\n}\n\nsize_t MbedTLSClient::write(const uint8_t *buf, size_t size) {\n    int ret = -1;\n    while ((ret = mbedtls_ssl_write(_sslCtx, buf, size)) <= 0) {\n        if (ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE && ret < 0) {\n            LT_RET(ret);\n        }\n        delay(2);\n    }\n    return ret;\n}\n\nint MbedTLSClient::available() {\n    bool peeked = _peeked >= 0;\n    if (!connected())\n        return peeked;\n\n    int ret = mbedtls_ssl_read(_sslCtx, NULL, 0);\n    if (ret != MBEDTLS_ERR_SSL_WANT_READ && ret != MBEDTLS_ERR_SSL_WANT_WRITE && ret < 0) {\n        stop();\n        return peeked ? peeked : ret;\n    }\n    return mbedtls_ssl_get_bytes_avail(_sslCtx) + peeked;\n}\n\nint MbedTLSClient::read(uint8_t *buf, size_t size) {\n    bool peeked = false;\n    int toRead  = available();\n    if ((!buf && size) || toRead <= 0)\n        return -1;\n    if (!size)\n        return 0;\n    if (_peeked >= 0) {\n        buf[0]  = _peeked;\n        _peeked = -1;\n        size--;\n        toRead--;\n        if (!size || !toRead)\n            return 1;\n        buf++;\n        peeked = true;\n    }\n\n    int ret = mbedtls_ssl_read(_sslCtx, buf, size);\n    if (ret < 0) {\n        stop();\n        return peeked ? peeked : ret;\n    }\n    return ret + peeked;\n}\n\nint MbedTLSClient::peek() {\n    if (_peeked >= 0)\n        return _peeked;\n    _peeked = timedRead();\n    return _peeked;\n}\n\nvoid MbedTLSClient::flush() {}\n\nint MbedTLSClient::lastError(char *buf, const size_t size) {\n    return 0; // TODO (?)\n}\n\nvoid MbedTLSClient::setInsecure() {\n    _caCertStr     = NULL;\n    _clientCertStr = NULL;\n    _clientKeyStr  = NULL;\n    _pskIdentStr   = NULL;\n    _pskStr        = NULL;\n    _insecure      = true;\n}\n\n// TODO only allocate _caCert, _clientCert and _clientKey when one\n// of the following functions is used\n\nvoid MbedTLSClient::setPreSharedKey(const char *pskIdent, const char *psk) {\n    _pskIdentStr = pskIdent;\n    _pskStr      = psk;\n}\n\nvoid MbedTLSClient::setCACert(const char *rootCA) {\n    _caCertStr = rootCA;\n}\n\nvoid MbedTLSClient::setCertificate(const char *clientCA) {\n    _clientCertStr = clientCA;\n}\n\nvoid MbedTLSClient::setPrivateKey(const char *privateKey) {\n    _clientKeyStr = privateKey;\n}\n\nchar *streamToStr(Stream &stream, size_t size) {\n    char *buf = (char *)malloc(size + 1);\n    if (!buf)\n        return NULL;\n    if (size != stream.readBytes(buf, size)) {\n        free(buf);\n        return NULL;\n    }\n    buf[size] = '\\0';\n    return buf;\n}\n\nbool MbedTLSClient::loadCACert(Stream &stream, size_t size) {\n    char *str = streamToStr(stream, size);\n    if (str) {\n        _caCertStr = str;\n        return true;\n    }\n    return false;\n}\n\nbool MbedTLSClient::loadCertificate(Stream &stream, size_t size) {\n    char *str = streamToStr(stream, size);\n    if (str) {\n        _clientCertStr = str;\n        return true;\n    }\n    return false;\n}\n\nbool MbedTLSClient::loadPrivateKey(Stream &stream, size_t size) {\n    char *str = streamToStr(stream, size);\n    if (str) {\n        _clientKeyStr = str;\n        return true;\n    }\n    return false;\n}\n\nbool MbedTLSClient::verify(const char *fingerprint, const char *domainName) {\n    uint8_t fpLocal[32] = {};\n    uint16_t len        = strlen(fingerprint);\n    uint8_t byte        = 0;\n    for (uint8_t i = 0; i < len; i++) {\n        uint8_t c = fingerprint[i];\n        while ((c == ' ' || c == ':') && i < len) {\n            c = fingerprint[++i];\n        }\n        c |= 0b00100000; // make lowercase\n        c -= '0' * (c >= '0' && c <= '9');\n        c -= ('a' - 10) * (c >= 'a' && c <= 'z');\n        if (c > 0xf)\n            return -1;\n        fpLocal[byte / 2] |= c << (4 * ((byte & 1) ^ 1));\n        byte++;\n        if (byte >= 64)\n            break;\n    }\n\n    uint8_t fpRemote[32];\n    if (!getFingerprintSHA256(fpRemote))\n        return false;\n\n    if (memcmp(fpLocal, fpRemote, 32)) {\n        LT_DM(SSL, \"Fingerprints don't match\");\n        return false;\n    }\n\n    if (!domainName)\n        return true;\n    // TODO domain name verification\n    return true;\n}\n\nvoid MbedTLSClient::setHandshakeTimeout(unsigned long handshakeTimeout) {\n    _handshakeTimeout = handshakeTimeout * 1000;\n}\n\nvoid MbedTLSClient::setAlpnProtocols(const char **alpnProtocols) {\n    _alpnProtocols = alpnProtocols;\n}\n\nbool MbedTLSClient::getFingerprintSHA256(uint8_t result[32]) {\n    const mbedtls_x509_crt *cert = mbedtls_ssl_get_peer_cert(_sslCtx);\n    if (!cert) {\n        LT_EM(SSL, \"Failed to get peer certificate\");\n        return false;\n    }\n    mbedtls_sha256_context shaCtx;\n    mbedtls_sha256_init(&shaCtx);\n    mbedtls_sha256_starts(&shaCtx, false);\n    mbedtls_sha256_update(&shaCtx, cert->raw.p, cert->raw.len);\n    mbedtls_sha256_finish(&shaCtx, result);\n    return true;\n}\n\n#endif // LT_ARD_HAS_WIFI && LT_HAS_MBEDTLS\n
"},{"location":"ltapi/_mbed_t_l_s_client_8h/","title":"File MbedTLSClient.h","text":"

FileList > arduino > libraries > common > WiFiClient > MbedTLSClient.h

Go to the source code of this file.

  • #include \"WiFiClientSecure.h\"
"},{"location":"ltapi/_mbed_t_l_s_client_8h/#classes","title":"Classes","text":"Type Name class MbedTLSClient"},{"location":"ltapi/_mbed_t_l_s_client_8h/#public-types","title":"Public Types","text":"Type Name typedef MbedTLSClient WiFiClientSecure"},{"location":"ltapi/_mbed_t_l_s_client_8h/#public-types-documentation","title":"Public Types Documentation","text":""},{"location":"ltapi/_mbed_t_l_s_client_8h/#typedef-wificlientsecure","title":"typedef WiFiClientSecure","text":"
typedef MbedTLSClient WiFiClientSecure;\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiClient/MbedTLSClient.h

"},{"location":"ltapi/_mbed_t_l_s_client_8h_source/","title":"File MbedTLSClient.h","text":"

File List > arduino > libraries > common > WiFiClient > MbedTLSClient.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-04-30. */\n\n#pragma once\n\n#if (LT_ARD_HAS_WIFI && LT_HAS_MBEDTLS) || DOXYGEN\n\n#include \"WiFiClientSecure.h\"\n\nstruct mbedtls_ssl_context;\nstruct mbedtls_ssl_config;\nstruct mbedtls_x509_crt;\n\nclass MbedTLSClient : public WiFiClient, public IWiFiClientSecure {\n  private:\n    mbedtls_ssl_context *_sslCtx = NULL;\n    mbedtls_ssl_config *_sslCfg;\n    mbedtls_x509_crt *_caCert;\n    mbedtls_x509_crt *_clientCert;\n    void *_clientKey;\n    uint32_t _handshakeTimeout = 0;\n\n    void init();\n    int _sockTls    = -1;\n    bool _insecure  = false;\n    bool _useRootCA = false;\n    int _peeked     = -1;\n\n    const char *_caCertStr;\n    const char *_clientCertStr;\n    const char *_clientKeyStr;\n    const char *_pskIdentStr;\n    const char *_pskStr;\n    const char **_alpnProtocols;\n\n    int connect(\n        const char *host,\n        uint16_t port,\n        int32_t timeout,\n        const char *rootCABuf,\n        const char *clientCert,\n        const char *clientKey,\n        const char *pskIdent,\n        const char *psk\n    );\n\n  public:\n    MbedTLSClient();\n    MbedTLSClient(int sock);\n    ~MbedTLSClient();\n\n    int connect(IPAddress ip, uint16_t port, int32_t timeout);\n    int connect(const char *host, uint16_t port, int32_t timeout);\n\n    int connect(IPAddress ip, uint16_t port, const char *rootCABuf, const char *clientCert, const char *clientKey);\n    int connect(const char *host, uint16_t port, const char *rootCABuf, const char *clientCert, const char *clientKey);\n    int connect(IPAddress ip, uint16_t port, const char *pskIdent, const char *psk);\n    int connect(const char *host, uint16_t port, const char *pskIdent, const char *psk);\n\n    size_t write(const uint8_t *buf, size_t size);\n\n    int available();\n\n    int read(uint8_t *buf, size_t size);\n    int peek();\n    void flush();\n    void stop();\n\n    int lastError(char *buf, const size_t size);\n    void setInsecure(); // Don't validate the chain, just accept whatever is given. VERY INSECURE!\n    void setPreSharedKey(const char *pskIdent, const char *psk); // psk in hex\n    void setCACert(const char *rootCA);\n    void setCertificate(const char *clientCA);\n    void setPrivateKey(const char *privateKey);\n    bool loadCACert(Stream &stream, size_t size);\n    bool loadCertificate(Stream &stream, size_t size);\n    bool loadPrivateKey(Stream &stream, size_t size);\n    bool verify(const char *fingerprint, const char *domainName);\n    void setHandshakeTimeout(unsigned long handshakeTimeout);\n    void setAlpnProtocols(const char **alpnProtocols);\n    bool getFingerprintSHA256(uint8_t result[32]);\n\n    using WiFiClient::connect;\n    using WiFiClient::read;\n};\n\ntypedef MbedTLSClient WiFiClientSecure;\n\n#endif\n
"},{"location":"ltapi/_wi_fi_client_8h/","title":"File WiFiClient.h","text":"

FileList > arduino > libraries > common > WiFiClient > WiFiClient.h

Go to the source code of this file.

  • #include <Arduino.h>
  • #include <api/Client.h>
"},{"location":"ltapi/_wi_fi_client_8h/#classes","title":"Classes","text":"Type Name class IWiFiClient

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiClient/WiFiClient.h

"},{"location":"ltapi/_wi_fi_client_8h_source/","title":"File WiFiClient.h","text":"

File List > arduino > libraries > common > WiFiClient > WiFiClient.h

Go to the documentation of this file.

/*\n  Client.h - Base class that provides Client\n  Copyright (c) 2011 Adrian McEwen.  All right reserved.\n\n  This library is free software; you can redistribute it and/or\n  modify it under the terms of the GNU Lesser General Public\n  License as published by the Free Software Foundation; either\n  version 2.1 of the License, or (at your option) any later version.\n\n  This library is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n  Lesser General Public License for more details.\n\n  You should have received a copy of the GNU Lesser General Public\n  License along with this library; if not, write to the Free Software\n  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n*/\n\n#pragma once\n\n#include <Arduino.h>\n#include <api/Client.h>\n\nclass IWiFiClient : public Client {\n  public:\n    IWiFiClient() {}\n\n    IWiFiClient(int sock) {}\n\n    ~IWiFiClient() {}\n\n    virtual int connect(IPAddress ip, uint16_t port, int32_t timeout)     = 0;\n    virtual int connect(const char *host, uint16_t port, int32_t timeout) = 0;\n\n    virtual size_t write(Stream &stream) = 0;\n\n    size_t write_P(PGM_P buffer, size_t size) {\n        return write((const uint8_t *)buffer, size);\n    }\n\n    virtual int fd() const                   = 0;\n    virtual int socket()                     = 0;\n    virtual int setTimeout(uint32_t seconds) = 0;\n\n    bool operator==(const IWiFiClient &other) const;\n\n    operator bool() {\n        return connected();\n    }\n\n    virtual bool operator==(const bool value) {\n        return bool() == value;\n    }\n\n    virtual bool operator!=(const bool value) {\n        return bool() != value;\n    }\n\n    virtual bool operator!=(const IWiFiClient &other) {\n        return !this->operator==(other);\n    };\n\n    virtual IPAddress remoteIP() const          = 0;\n    virtual IPAddress remoteIP(int sock) const  = 0;\n    virtual uint16_t remotePort() const         = 0;\n    virtual uint16_t remotePort(int sock) const = 0;\n    virtual IPAddress localIP() const           = 0;\n    virtual IPAddress localIP(int sock) const   = 0;\n    virtual uint16_t localPort() const          = 0;\n    virtual uint16_t localPort(int sock) const  = 0;\n\n    using Print::write;\n};\n\n#if LT_ARD_HAS_WIFI && LT_HAS_LWIP\n#include \"LwIPClient.h\"\n#endif\n
"},{"location":"ltapi/_wi_fi_client_secure_8h/","title":"File WiFiClientSecure.h","text":"

FileList > arduino > libraries > common > WiFiClient > WiFiClientSecure.h

Go to the source code of this file.

  • #include <Arduino.h>
  • #include \"WiFiClient.h\"
"},{"location":"ltapi/_wi_fi_client_secure_8h/#classes","title":"Classes","text":"Type Name class IWiFiClientSecure

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiClient/WiFiClientSecure.h

"},{"location":"ltapi/_wi_fi_client_secure_8h_source/","title":"File WiFiClientSecure.h","text":"

File List > arduino > libraries > common > WiFiClient > WiFiClientSecure.h

Go to the documentation of this file.

/*\n  WiFiClientSecure.h - Base class that provides Client SSL to ESP32\n  Copyright (c) 2011 Adrian McEwen.  All right reserved.\n  Additions Copyright (C) 2017 Evandro Luis Copercini.\n\n  This library is free software; you can redistribute it and/or\n  modify it under the terms of the GNU Lesser General Public\n  License as published by the Free Software Foundation; either\n  version 2.1 of the License, or (at your option) any later version.\n\n  This library is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n  Lesser General Public License for more details.\n\n  You should have received a copy of the GNU Lesser General Public\n  License along with this library; if not, write to the Free Software\n  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n*/\n\n#pragma once\n\n#include <Arduino.h>\n\n#include \"WiFiClient.h\"\n\nclass IWiFiClientSecure {\n  public:\n    virtual int\n    connect(IPAddress ip, uint16_t port, const char *rootCABuf, const char *clientCert, const char *clientKey) = 0;\n    virtual int\n    connect(const char *host, uint16_t port, const char *rootCABuf, const char *clientCert, const char *clientKey) = 0;\n    virtual int connect(IPAddress ip, uint16_t port, const char *pskIdent, const char *psk)                        = 0;\n    virtual int connect(const char *host, uint16_t port, const char *pskIdent, const char *psk)                    = 0;\n\n    virtual int lastError(char *buf, const size_t size) = 0;\n    virtual void setInsecure() = 0; // Don't validate the chain, just accept whatever is given. VERY INSECURE!\n    virtual void setPreSharedKey(const char *pskIdent, const char *psk)  = 0; // psk in hex\n    virtual void setCACert(const char *rootCA)                           = 0;\n    virtual void setCertificate(const char *clientCA)                    = 0;\n    virtual void setPrivateKey(const char *privateKey)                   = 0;\n    virtual bool loadCACert(Stream &stream, size_t size)                 = 0;\n    virtual bool loadCertificate(Stream &stream, size_t size)            = 0;\n    virtual bool loadPrivateKey(Stream &stream, size_t size)             = 0;\n    virtual bool verify(const char *fingerprint, const char *domainName) = 0;\n    virtual void setHandshakeTimeout(unsigned long handshakeTimeout)     = 0;\n    virtual void setAlpnProtocols(const char **alpnProtocols)            = 0;\n    virtual bool getFingerprintSHA256(uint8_t result[32])                = 0;\n};\n\n#if LT_ARD_HAS_WIFI && LT_HAS_MBEDTLS\n#include \"MbedTLSClient.h\"\n#endif\n
"},{"location":"ltapi/dir_561e7e821afe2d99042aaa333fa070ac/","title":"Dir cores/common/arduino/libraries/common/WiFiServer","text":"

FileList > arduino > libraries > common > WiFiServer

"},{"location":"ltapi/dir_561e7e821afe2d99042aaa333fa070ac/#files","title":"Files","text":"Type Name file LwIPServer.cpp file LwIPServer.h file WiFiServer.h

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiServer/

"},{"location":"ltapi/_lw_i_p_server_8cpp/","title":"File LwIPServer.cpp","text":"

FileList > arduino > libraries > common > WiFiServer > LwIPServer.cpp

Go to the source code of this file.

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiServer/LwIPServer.cpp

"},{"location":"ltapi/_lw_i_p_server_8cpp_source/","title":"File LwIPServer.cpp","text":"

File List > arduino > libraries > common > WiFiServer > LwIPServer.cpp

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-04-26. */\n\n#if LT_ARD_HAS_WIFI && LT_HAS_LWIP\n\n#include \"LwIPServer.h\"\n\n// disable #defines removing lwip_ prefix\n#undef LWIP_COMPAT_SOCKETS\n#define LWIP_COMPAT_SOCKETS 0\n\nextern \"C\" {\n#include <lwip/api.h>\n// #include <lwip/dns.h>\n#include <lwip/err.h>\n#include <lwip/sockets.h>\n#include <sys/time.h>\n}\n\nLwIPServer::LwIPServer(uint32_t addr, uint16_t port, uint8_t maxClients)\n    : _sock(-1), _sockAccepted(-1), _addr(addr), _port(port), _maxClients(maxClients), _active(false), _noDelay(false) {\n}\n\nLwIPServer::operator bool() {\n    return _active;\n}\n\nbool LwIPServer::begin(uint16_t port, bool reuseAddr) {\n    if (_active)\n        return true;\n    if (port)\n        _port = port;\n\n    _sock = lwip_socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);\n    if (_sock < 0) {\n        LT_EM(SERVER, \"Socket failed; errno=%d\", errno);\n        return false;\n    }\n\n    int enable = reuseAddr;\n    lwip_setsockopt(_sock, SOL_SOCKET, SO_REUSEADDR, &enable, sizeof(enable));\n\n    struct sockaddr_in addr;\n    addr.sin_family      = AF_INET;\n    addr.sin_addr.s_addr = _addr;\n    addr.sin_port        = htons(_port);\n\n    if (lwip_bind(_sock, (struct sockaddr *)&addr, sizeof(addr)) < 0) {\n        LT_EM(SERVER, \"Bind failed; errno=%d\", errno);\n        return false;\n    }\n\n    if (lwip_listen(_sock, _maxClients) < 0) {\n        LT_EM(SERVER, \"Bind failed; errno=%d\", errno);\n        return false;\n    }\n\n    uint8_t *addrB = (uint8_t *)&_addr;\n    LT_IM(SERVER, \"Server running on %hhu.%hhu.%hhu.%hhu:%hu\", addrB[0], addrB[1], addrB[2], addrB[3], _port);\n\n    lwip_fcntl(_sock, F_SETFL, O_NONBLOCK);\n    _active       = true;\n    _noDelay      = false;\n    _sockAccepted = -1;\n    return true;\n}\n\nvoid LwIPServer::end() {\n    if (_sock == -1)\n        return;\n    lwip_close(_sock);\n    _sock   = -1;\n    _active = -1;\n}\n\nWiFiClient LwIPServer::accept() {\n    if (!_active)\n        return WiFiClient();\n\n    int sock;\n    if (_sockAccepted >= 0) {\n        sock          = _sockAccepted;\n        _sockAccepted = -1;\n    } else {\n        struct sockaddr_in addr;\n        socklen_t len = sizeof(addr);\n        sock          = lwip_accept(_sock, (struct sockaddr *)&addr, &len);\n    }\n\n    if (sock >= 0) {\n        int enable = 1;\n        if (lwip_setsockopt(sock, SOL_SOCKET, SO_KEEPALIVE, &enable, sizeof(enable)) == ERR_OK) {\n            enable = _noDelay;\n            if (lwip_setsockopt(sock, IPPROTO_TCP, TCP_NODELAY, &enable, sizeof(enable)) == ERR_OK) {\n                // HOTFIX: allow the TCP thread to receive data\n                // I'm not sure what's happening there, so this should probably be fixed properly.\n                // When a connection arrives, sometimes TCP hasn't received anything yet. This causes\n                // calling WiFiClient::connected() check for lwip_recv(), which returns EWOULDBLOCK\n                // as the client is still connected. The problem is that there's basically an infinite loop\n                // created: nowhere in that code is a yield()/delay() that would allow TCP thread to work\n                // and receive data, so LwIP still sees a connected client that sends nothing. At least\n                // that's what I understand. And any loop that doesn't call delay() seems to block the TCP\n                // stack completely and prevents it from even being pinged.\n                LT_DM(SERVER, \"Got client\");\n                delay(5);\n                return WiFiClient(sock);\n            }\n        }\n    }\n\n    return WiFiClient();\n}\n\nint LwIPServer::setTimeout(uint32_t seconds) {\n    struct timeval tv;\n    tv.tv_sec  = seconds;\n    tv.tv_usec = 0;\n    if (lwip_setsockopt(_sock, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv)) < 0)\n        return -1;\n    return lwip_setsockopt(_sock, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv));\n}\n\nvoid LwIPServer::setNoDelay(bool noDelay) {\n    _noDelay = noDelay;\n}\n\nbool LwIPServer::getNoDelay() {\n    return _noDelay;\n}\n\nbool LwIPServer::hasClient() {\n    if (_sockAccepted >= 0) {\n        return true;\n    }\n    struct sockaddr_in addr;\n    socklen_t len = sizeof(addr);\n    _sockAccepted = lwip_accept(_sock, (struct sockaddr *)&addr, &len);\n    if (_sockAccepted >= 0) {\n        return true;\n    }\n    return false;\n}\n\n#endif\n
"},{"location":"ltapi/_lw_i_p_server_8h/","title":"File LwIPServer.h","text":"

FileList > arduino > libraries > common > WiFiServer > LwIPServer.h

Go to the source code of this file.

  • #include \"WiFiServer.h\"
"},{"location":"ltapi/_lw_i_p_server_8h/#classes","title":"Classes","text":"Type Name class LwIPServer"},{"location":"ltapi/_lw_i_p_server_8h/#public-types","title":"Public Types","text":"Type Name typedef LwIPServer WiFiServer"},{"location":"ltapi/_lw_i_p_server_8h/#public-types-documentation","title":"Public Types Documentation","text":""},{"location":"ltapi/_lw_i_p_server_8h/#typedef-wifiserver","title":"typedef WiFiServer","text":"
typedef LwIPServer WiFiServer;\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiServer/LwIPServer.h

"},{"location":"ltapi/_lw_i_p_server_8h_source/","title":"File LwIPServer.h","text":"

File List > arduino > libraries > common > WiFiServer > LwIPServer.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-04-26. */\n\n#pragma once\n\n#if (LT_ARD_HAS_WIFI && LT_HAS_LWIP) || DOXYGEN\n\n#include \"WiFiServer.h\"\n\nclass LwIPServer : public IWiFiServer<WiFiClient> {\n  private:\n    int _sock;\n    int _sockAccepted;\n    uint32_t _addr;\n    uint16_t _port;\n    uint8_t _maxClients;\n    bool _active;\n    bool _noDelay = false;\n\n  private:\n    LwIPServer(uint32_t addr, uint16_t port = 80, uint8_t maxClients = 4);\n\n  public:\n    LwIPServer(uint16_t port = 80, uint8_t maxClients = 4) : LwIPServer((uint32_t)0, port, maxClients) {}\n\n    LwIPServer(int port = 80, uint8_t maxClients = 4) : LwIPServer((uint32_t)0, port, maxClients) {}\n\n    LwIPServer(const IPAddress &addr, uint16_t port = 80, uint8_t maxClients = 4)\n        : LwIPServer((uint32_t)addr, port, maxClients) {}\n\n    operator bool();\n\n    bool begin(uint16_t port = 0, bool reuseAddr = true);\n    void end();\n    WiFiClient accept();\n\n    size_t write(const uint8_t *buffer, size_t size) {\n        return 0;\n    }\n\n    void stopAll() {}\n\n    int setTimeout(uint32_t seconds);\n    void setNoDelay(bool noDelay);\n    bool getNoDelay();\n    bool hasClient();\n};\n\ntypedef LwIPServer WiFiServer;\n\n#endif\n
"},{"location":"ltapi/_wi_fi_server_8h/","title":"File WiFiServer.h","text":"

FileList > arduino > libraries > common > WiFiServer > WiFiServer.h

Go to the source code of this file.

  • #include <Arduino.h>
  • #include <api/Print.h>
  • #include \"WiFiClient.h\"
  • #include <type_traits>
"},{"location":"ltapi/_wi_fi_server_8h/#classes","title":"Classes","text":"Type Name class IWiFiServer <typename TWiFiClient, typename>

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiServer/WiFiServer.h

"},{"location":"ltapi/_wi_fi_server_8h_source/","title":"File WiFiServer.h","text":"

File List > arduino > libraries > common > WiFiServer > WiFiServer.h

Go to the documentation of this file.

/*\n  Server.h - Server class for Raspberry Pi\n  Copyright (c) 2016 Hristo Gochkov  All right reserved.\n\n  This library is free software; you can redistribute it and/or\n  modify it under the terms of the GNU Lesser General Public\n  License as published by the Free Software Foundation; either\n  version 2.1 of the License, or (at your option) any later version.\n\n  This library is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n  Lesser General Public License for more details.\n\n  You should have received a copy of the GNU Lesser General Public\n  License along with this library; if not, write to the Free Software\n  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n*/\n\n#pragma once\n\n#include <Arduino.h>\n#include <api/Print.h>\n\n#include \"WiFiClient.h\"\n\n#include <type_traits>\n\ntemplate <typename TWiFiClient, typename = std::enable_if<std::is_base_of<IWiFiClient, TWiFiClient>::value>>\n\nclass IWiFiServer : public Print { // arduino::Server is useless anyway\n  public:\n    void listenOnLocalhost() {}\n\n    IWiFiServer(uint16_t port = 80, uint8_t maxClients = 4) {}\n\n    IWiFiServer(const IPAddress &addr, uint16_t port = 80, uint8_t maxClients = 4) {}\n\n    ~IWiFiServer() {\n        stop();\n    }\n\n    TWiFiClient available() {\n        return accept();\n    };\n\n    virtual operator bool() = 0;\n\n    virtual bool begin(uint16_t port = 0, bool reuseAddr = true) = 0;\n    virtual void end()                                           = 0;\n    virtual TWiFiClient accept()                                 = 0;\n\n    void close() {\n        end();\n    }\n\n    void stop() {\n        end();\n    }\n\n    virtual int setTimeout(uint32_t seconds) = 0;\n    virtual void stopAll()                   = 0;\n    virtual void setNoDelay(bool noDelay)    = 0;\n    virtual bool getNoDelay()                = 0;\n    virtual bool hasClient()                 = 0;\n\n    size_t write(uint8_t data) {\n        return write(&data, 1);\n    }\n\n    using Print::write;\n};\n\n#if LT_ARD_HAS_WIFI && LT_HAS_LWIP\n#include \"LwIPServer.h\"\n#endif\n
"},{"location":"ltapi/dir_947f33558ea20e7a91b0d58d77bc396d/","title":"Dir cores/common/arduino/libraries/common/WiFiUdp","text":"

FileList > arduino > libraries > common > WiFiUdp

"},{"location":"ltapi/dir_947f33558ea20e7a91b0d58d77bc396d/#files","title":"Files","text":"Type Name file LwIPUdp.cpp file LwIPUdp.h file WiFiUdp.h

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiUdp/

"},{"location":"ltapi/_lw_i_p_udp_8cpp/","title":"File LwIPUdp.cpp","text":"

FileList > arduino > libraries > common > WiFiUdp > LwIPUdp.cpp

Go to the source code of this file.

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiUdp/LwIPUdp.cpp

"},{"location":"ltapi/_lw_i_p_udp_8cpp_source/","title":"File LwIPUdp.cpp","text":"

File List > arduino > libraries > common > WiFiUdp > LwIPUdp.cpp

Go to the documentation of this file.

/*\n  Udp.cpp - UDP class for Raspberry Pi\n  Copyright (c) 2016 Hristo Gochkov  All right reserved.\n  This library is free software; you can redistribute it and/or\n  modify it under the terms of the GNU Lesser General Public\n  License as published by the Free Software Foundation; either\n  version 2.1 of the License, or (at your option) any later version.\n  This library is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n  Lesser General Public License for more details.\n  You should have received a copy of the GNU Lesser General Public\n  License along with this library; if not, write to the Free Software\n  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n*/\n\n#if LT_ARD_HAS_WIFI && LT_HAS_LWIP\n\n#include \"LwIPUdp.h\"\n\nextern \"C\" {\n\n#include <lwip/netdb.h>\n#include <lwip/sockets.h>\n\n} // extern \"C\"\n\n#undef write\n#undef read\n\nLwIPUDP::LwIPUDP() : udp_server(-1), server_port(0), remote_port(0), tx_buffer(0), tx_buffer_len(0), rx_buffer(0) {}\n\nLwIPUDP::~LwIPUDP() {\n    stop();\n}\n\nuint8_t LwIPUDP::begin(IPAddress address, uint16_t port) {\n    stop();\n\n    server_port = port;\n\n    tx_buffer = new char[1460];\n    if (!tx_buffer) {\n        log_e(\"could not create tx buffer: %d\", errno);\n        return 0;\n    }\n\n    if ((udp_server = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {\n        log_e(\"could not create socket: %d\", errno);\n        return 0;\n    }\n\n    int yes = 1;\n    if (setsockopt(udp_server, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(yes)) < 0) {\n        log_e(\"could not set socket option: %d\", errno);\n        stop();\n        return 0;\n    }\n\n    struct sockaddr_in addr;\n    memset((char *)&addr, 0, sizeof(addr));\n    addr.sin_family      = AF_INET;\n    addr.sin_port        = htons(server_port);\n    addr.sin_addr.s_addr = (in_addr_t)address;\n    if (bind(udp_server, (struct sockaddr *)&addr, sizeof(addr)) == -1) {\n        log_e(\"could not bind socket: %d\", errno);\n        stop();\n        return 0;\n    }\n    fcntl(udp_server, F_SETFL, O_NONBLOCK);\n    return 1;\n}\n\nuint8_t LwIPUDP::begin(uint16_t p) {\n    return begin(IPAddress((uint32_t)INADDR_ANY), p);\n}\n\nuint8_t LwIPUDP::beginMulticast(IPAddress a, uint16_t p) {\n    if (begin(IPAddress((uint32_t)INADDR_ANY), p)) {\n        if ((uint32_t)a != 0) {\n            struct ip_mreq mreq;\n            mreq.imr_multiaddr.s_addr = (in_addr_t)a;\n            mreq.imr_interface.s_addr = INADDR_ANY;\n            if (setsockopt(udp_server, IPPROTO_IP, IP_ADD_MEMBERSHIP, &mreq, sizeof(mreq)) < 0) {\n                log_e(\"could not join igmp: %d\", errno);\n                stop();\n                return 0;\n            }\n            multicast_ip = a;\n        }\n        return 1;\n    }\n    return 0;\n}\n\nvoid LwIPUDP::stop() {\n    if (tx_buffer) {\n        delete[] tx_buffer;\n        tx_buffer = NULL;\n    }\n    tx_buffer_len = 0;\n    if (rx_buffer) {\n        cbuf *b   = rx_buffer;\n        rx_buffer = NULL;\n        delete b;\n    }\n    if (udp_server == -1)\n        return;\n    if ((uint32_t)multicast_ip != 0) {\n        struct ip_mreq mreq;\n        mreq.imr_multiaddr.s_addr = (in_addr_t)multicast_ip;\n        mreq.imr_interface.s_addr = (in_addr_t)0;\n        setsockopt(udp_server, IPPROTO_IP, IP_DROP_MEMBERSHIP, &mreq, sizeof(mreq));\n        multicast_ip = IPAddress((uint32_t)INADDR_ANY);\n    }\n    close(udp_server);\n    udp_server = -1;\n}\n\nint LwIPUDP::beginMulticastPacket() {\n    if (!server_port || multicast_ip == IPAddress((uint32_t)INADDR_ANY))\n        return 0;\n    remote_ip   = multicast_ip;\n    remote_port = server_port;\n    return beginPacket();\n}\n\nint LwIPUDP::beginPacket() {\n    if (!remote_port)\n        return 0;\n\n    // allocate tx_buffer if is necessary\n    if (!tx_buffer) {\n        tx_buffer = new char[1460];\n        if (!tx_buffer) {\n            log_e(\"could not create tx buffer: %d\", errno);\n            return 0;\n        }\n    }\n\n    tx_buffer_len = 0;\n\n    // check whereas socket is already open\n    if (udp_server != -1)\n        return 1;\n\n    if ((udp_server = socket(AF_INET, SOCK_DGRAM, 0)) == -1) {\n        log_e(\"could not create socket: %d\", errno);\n        return 0;\n    }\n\n    fcntl(udp_server, F_SETFL, O_NONBLOCK);\n\n    return 1;\n}\n\nint LwIPUDP::beginPacket(IPAddress ip, uint16_t port) {\n    remote_ip   = ip;\n    remote_port = port;\n    return beginPacket();\n}\n\nint LwIPUDP::beginPacket(const char *host, uint16_t port) {\n    struct hostent *server;\n    server = gethostbyname(host);\n    if (server == NULL) {\n        log_e(\"could not get host from dns: %d\", errno);\n        return 0;\n    }\n    return beginPacket(IPAddress((const uint8_t *)(server->h_addr_list[0])), port);\n}\n\nint LwIPUDP::endPacket() {\n    struct sockaddr_in recipient;\n    recipient.sin_addr.s_addr = (uint32_t)remote_ip;\n    recipient.sin_family      = AF_INET;\n    recipient.sin_port        = htons(remote_port);\n    int sent = sendto(udp_server, tx_buffer, tx_buffer_len, 0, (struct sockaddr *)&recipient, sizeof(recipient));\n    if (sent < 0) {\n        log_e(\"could not send data: %d\", errno);\n        return 0;\n    }\n    return 1;\n}\n\nsize_t LwIPUDP::write(uint8_t data) {\n    if (tx_buffer_len == 1460) {\n        endPacket();\n        tx_buffer_len = 0;\n    }\n    tx_buffer[tx_buffer_len++] = data;\n    return 1;\n}\n\nsize_t LwIPUDP::write(const uint8_t *buffer, size_t size) {\n    size_t i;\n    for (i = 0; i < size; i++)\n        write(buffer[i]);\n    return i;\n}\n\nint LwIPUDP::parsePacket() {\n    if (rx_buffer)\n        return 0;\n    struct sockaddr_in si_other;\n    int slen  = sizeof(si_other), len;\n    char *buf = new char[1460];\n    if (!buf) {\n        return 0;\n    }\n    if ((len = recvfrom(udp_server, buf, 1460, MSG_DONTWAIT, (struct sockaddr *)&si_other, (socklen_t *)&slen)) == -1) {\n        delete[] buf;\n        if (errno == EWOULDBLOCK) {\n            return 0;\n        }\n        log_e(\"could not receive data: %d\", errno);\n        return 0;\n    }\n    remote_ip   = IPAddress(si_other.sin_addr.s_addr);\n    remote_port = ntohs(si_other.sin_port);\n    if (len > 0) {\n        rx_buffer = new cbuf(len);\n        rx_buffer->write(buf, len);\n    }\n    delete[] buf;\n    return len;\n}\n\nint LwIPUDP::available() {\n    if (!rx_buffer)\n        return 0;\n    return rx_buffer->available();\n}\n\nint LwIPUDP::read() {\n    if (!rx_buffer)\n        return -1;\n    int out = rx_buffer->read();\n    if (!rx_buffer->available()) {\n        cbuf *b   = rx_buffer;\n        rx_buffer = 0;\n        delete b;\n    }\n    return out;\n}\n\nint LwIPUDP::read(unsigned char *buffer, size_t len) {\n    return read((char *)buffer, len);\n}\n\nint LwIPUDP::read(char *buffer, size_t len) {\n    if (!rx_buffer)\n        return 0;\n    int out = rx_buffer->read(buffer, len);\n    if (!rx_buffer->available()) {\n        cbuf *b   = rx_buffer;\n        rx_buffer = 0;\n        delete b;\n    }\n    return out;\n}\n\nint LwIPUDP::peek() {\n    if (!rx_buffer)\n        return -1;\n    return rx_buffer->peek();\n}\n\nvoid LwIPUDP::flush() {\n    if (!rx_buffer)\n        return;\n    cbuf *b   = rx_buffer;\n    rx_buffer = 0;\n    delete b;\n}\n\nIPAddress LwIPUDP::remoteIP() {\n    return remote_ip;\n}\n\nuint16_t LwIPUDP::remotePort() {\n    return remote_port;\n}\n\n#endif\n
"},{"location":"ltapi/_lw_i_p_udp_8h/","title":"File LwIPUdp.h","text":"

FileList > arduino > libraries > common > WiFiUdp > LwIPUdp.h

Go to the source code of this file.

  • #include \"WiFiUdp.h\"
  • #include <cbuf.h>
"},{"location":"ltapi/_lw_i_p_udp_8h/#classes","title":"Classes","text":"Type Name class LwIPUDP"},{"location":"ltapi/_lw_i_p_udp_8h/#public-types","title":"Public Types","text":"Type Name typedef LwIPUDP WiFiUDP"},{"location":"ltapi/_lw_i_p_udp_8h/#public-types-documentation","title":"Public Types Documentation","text":""},{"location":"ltapi/_lw_i_p_udp_8h/#typedef-wifiudp","title":"typedef WiFiUDP","text":"
typedef LwIPUDP WiFiUDP;\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiUdp/LwIPUdp.h

"},{"location":"ltapi/_lw_i_p_udp_8h_source/","title":"File LwIPUdp.h","text":"

File List > arduino > libraries > common > WiFiUdp > LwIPUdp.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-09-10. */\n\n#pragma once\n\n#if (LT_ARD_HAS_WIFI && LT_HAS_LWIP) || DOXYGEN\n\n#include \"WiFiUdp.h\"\n\n#include <cbuf.h>\n\nclass LwIPUDP : public IWiFiUDP {\n  private:\n    int udp_server;\n    IPAddress multicast_ip;\n    IPAddress remote_ip;\n    uint16_t server_port;\n    uint16_t remote_port;\n    char *tx_buffer;\n    size_t tx_buffer_len;\n    cbuf *rx_buffer;\n\n  public:\n    LwIPUDP();\n    ~LwIPUDP();\n    uint8_t begin(IPAddress ip, uint16_t port);\n    uint8_t begin(uint16_t port);\n    uint8_t beginMulticast(IPAddress ip, uint16_t port);\n    void stop();\n    int beginMulticastPacket();\n    int beginPacket();\n    int beginPacket(IPAddress ip, uint16_t port);\n    int beginPacket(const char *host, uint16_t port);\n    int endPacket();\n    size_t write(uint8_t);\n    size_t write(const uint8_t *buffer, size_t size);\n    int parsePacket();\n    int available();\n    int read();\n    int read(unsigned char *buffer, size_t len);\n    int read(char *buffer, size_t len);\n    int peek();\n    void flush();\n    IPAddress remoteIP();\n    uint16_t remotePort();\n};\n\ntypedef LwIPUDP WiFiUDP;\n\n#endif\n
"},{"location":"ltapi/_wi_fi_udp_8h/","title":"File WiFiUdp.h","text":"

FileList > arduino > libraries > common > WiFiUdp > WiFiUdp.h

Go to the source code of this file.

  • #include <Arduino.h>
  • #include <api/Udp.h>
"},{"location":"ltapi/_wi_fi_udp_8h/#classes","title":"Classes","text":"Type Name class IWiFiUDP

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/WiFiUdp/WiFiUdp.h

"},{"location":"ltapi/_wi_fi_udp_8h_source/","title":"File WiFiUdp.h","text":"

File List > arduino > libraries > common > WiFiUdp > WiFiUdp.h

Go to the documentation of this file.

#pragma once\n\n#include <Arduino.h>\n#include <api/Udp.h>\n\nclass IWiFiUDP : public UDP {\n  public:\n    IWiFiUDP() {}\n\n    ~IWiFiUDP() {}\n\n    virtual uint8_t begin(IPAddress ip, uint16_t port)          = 0;\n    virtual uint8_t begin(uint16_t port)                        = 0;\n    virtual uint8_t beginMulticast(IPAddress ip, uint16_t port) = 0;\n    virtual void stop()                                         = 0;\n    virtual int beginMulticastPacket()                          = 0;\n    virtual int beginPacket()                                   = 0;\n    virtual int beginPacket(IPAddress ip, uint16_t port)        = 0;\n    virtual int beginPacket(const char *host, uint16_t port)    = 0;\n    virtual int endPacket()                                     = 0;\n    virtual size_t write(uint8_t)                               = 0;\n    virtual size_t write(const uint8_t *buffer, size_t size)    = 0;\n    virtual int parsePacket()                                   = 0;\n    virtual int available()                                     = 0;\n    virtual int read()                                          = 0;\n    virtual int read(unsigned char *buffer, size_t len)         = 0;\n    virtual int read(char *buffer, size_t len)                  = 0;\n    virtual int peek()                                          = 0;\n    virtual void flush()                                        = 0;\n    virtual IPAddress remoteIP()                                = 0;\n    virtual uint16_t remotePort()                               = 0;\n};\n\n#if LT_ARD_HAS_WIFI && LT_HAS_LWIP\n#include \"LwIPUdp.h\"\n#endif\n
"},{"location":"ltapi/dir_5cec7dea66206196679083f825c4cd25/","title":"Dir cores/common/arduino/libraries/common/mDNS","text":"

FileList > arduino > libraries > common > mDNS

"},{"location":"ltapi/dir_5cec7dea66206196679083f825c4cd25/#files","title":"Files","text":"Type Name file LwIPmDNS.cpp file mDNS.cpp file mDNS.h

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/mDNS/

"},{"location":"ltapi/_lw_i_pm_d_n_s_8cpp/","title":"File LwIPmDNS.cpp","text":"

FileList > arduino > libraries > common > mDNS > LwIPmDNS.cpp

Go to the source code of this file.

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/mDNS/LwIPmDNS.cpp

"},{"location":"ltapi/_lw_i_pm_d_n_s_8cpp_source/","title":"File LwIPmDNS.cpp","text":"

File List > arduino > libraries > common > mDNS > LwIPmDNS.cpp

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-05-23. */\n\n#if LT_HAS_LWIP2\n\n#include \"mDNS.h\"\n#include <vector>\n\nextern \"C\" {\n#include <errno.h>\n#include <lwip/apps/mdns.h>\n#include <lwip/igmp.h>\n#include <lwip/init.h>\n#include <lwip/netif.h>\n}\n\n#if LWIP_VERSION_SIMPLE < 20100 && defined(LWIP_NETIF_EXT_STATUS_CALLBACK)\n#warning \"LWIP_NETIF_EXT_STATUS_CALLBACK not available before lwIP 2.1.0\"\n#undef LWIP_NETIF_EXT_STATUS_CALLBACK\n#endif\n\n#if LWIP_MDNS_RESPONDER\n\nstatic std::vector<char *> services_name;\nstatic std::vector<char *> services;\nstatic std::vector<uint8_t> protos;\nstatic std::vector<uint16_t> ports;\nstatic std::vector<std::vector<char *>> records;\n\nstatic const char *hostName;\n#ifdef LWIP_NETIF_EXT_STATUS_CALLBACK\nNETIF_DECLARE_EXT_CALLBACK(netif_callback)\n#endif\n\nmDNS::mDNS() {}\n\nmDNS::~mDNS() {}\n\nstatic void mdnsTxtCallback(struct mdns_service *service, void *userdata) {\n    size_t index = (size_t)userdata;\n    if (index >= records.size())\n        return;\n\n    for (const auto record : records[index]) {\n        err_t err = mdns_resp_add_service_txtitem(service, record, strlen(record));\n        if (err != ERR_OK)\n            return;\n    }\n}\n\nstatic void mdnsStatusCallback(struct netif *netif, uint8_t result) {\n    LT_DM(MDNS, \"Status: netif %u, status %u\", netif->num, result);\n}\n\n#ifdef LWIP_NETIF_EXT_STATUS_CALLBACK\nstatic void addServices(struct netif *netif) {\n    for (uint8_t i = 0; i < services.size(); i++) {\n        LT_DM(\n            MDNS,\n            \"Add service: netif %u / %s / %s / %u / %u\",\n            netif->num,\n            services_name[i],\n            services[i],\n            protos[i],\n            ports[i]\n        );\n        mdns_resp_add_service(\n            netif,\n            services_name[i],\n            services[i],\n            (mdns_sd_proto)protos[i],\n            ports[i],\n            255,\n            mdnsTxtCallback,\n            reinterpret_cast<void *>(i) // index of newly added service\n        );\n    }\n}\n#endif\n\nstatic bool enableMDNS(struct netif *netif) {\n    if (netif_is_up(netif)) {\n        LT_DM(MDNS, \"Starting mDNS on netif %u\", netif->num);\n        if ((netif->flags & NETIF_FLAG_IGMP) == 0) {\n            netif->flags |= NETIF_FLAG_IGMP;\n            igmp_start(netif);\n            LT_DM(MDNS, \"Added IGMP to netif %u\", netif->num);\n        }\n        err_t ret = mdns_resp_add_netif(netif, hostName, 255);\n        if (ret == ERR_OK) {\n            LT_DM(MDNS, \"mDNS started on netif %u, announcing it to network\", netif->num);\n#if LWIP_VERSION_SIMPLE >= 20100\n            mdns_resp_announce(netif);\n#else\n#warning \"lwIP version older than 2.1.0, mdns_resp_announce() unavailable\"\n#endif\n            return true;\n        } else {\n            LT_DM(MDNS, \"Cannot start mDNS on netif %u; ret=%d, errno=%d\", netif->num, ret, errno);\n        }\n    }\n    return false;\n}\n\n#ifdef LWIP_NETIF_EXT_STATUS_CALLBACK\nstatic void\nmdns_netif_ext_status_callback(struct netif *netif, netif_nsc_reason_t reason, const netif_ext_callback_args_t *args) {\n    if (reason & LWIP_NSC_NETIF_REMOVED) {\n        LT_DM(MDNS, \"Netif removed, stopping mDNS on netif %u\", netif->num);\n        mdns_resp_remove_netif(netif);\n    } else if (reason & LWIP_NSC_STATUS_CHANGED) {\n        LT_DM(MDNS, \"Netif changed, starting mDNS on netif %u\", netif->num);\n        if (enableMDNS(netif) && services.size() > 0) {\n            LT_DM(MDNS, \"Adding services to netif %u\", netif->num);\n            addServices(netif);\n        }\n    }\n}\n#endif\n\nbool mDNS::begin(const char *hostname) {\n    hostName = strdup(hostname);\n    setInstanceName(hostname);\n#ifdef LWIP_NETIF_EXT_STATUS_CALLBACK\n    netif_add_ext_callback(&netif_callback, mdns_netif_ext_status_callback);\n#endif\n    LT_DM(MDNS, \"Starting (%s)\", hostname);\n#if LWIP_VERSION_MAJOR >= 2 && LWIP_VERSION_MINOR >= 1\n    mdns_resp_register_name_result_cb(mdnsStatusCallback);\n#endif\n    mdns_resp_init();\n    struct netif *netif;\n    for (netif = netif_list; netif != NULL; netif = netif->next) {\n        enableMDNS(netif);\n    }\n    return true;\n}\n\nvoid mDNS::end() {\n    struct netif *netif = netif_list;\n    while (netif != NULL) {\n        if (netif_is_up(netif))\n            mdns_resp_remove_netif(netif);\n        netif = netif->next;\n    }\n}\n\nbool mDNS::addServiceImpl(const char *name, const char *service, uint8_t proto, uint16_t port) {\n    bool added          = false;\n    struct netif *netif = netif_list;\n    while (netif != NULL) {\n        if (netif_is_up(netif)) {\n            // register TXT callback;\n            // pass service index as userdata parameter\n            LT_DM(MDNS, \"Add service: netif %u / %s / %s / %u / %u\", netif->num, name, service, proto, port);\n            mdns_resp_add_service(\n                netif,\n                name,\n                service,\n                (mdns_sd_proto)proto,\n                port,\n                255,\n                mdnsTxtCallback,\n                (void *)services.size() // index of newly added service\n            );\n            added = true;\n        }\n        netif = netif->next;\n    }\n\n    if (!added)\n        return false;\n\n    // add the service to TXT record arrays\n    services_name.push_back(strdup(name));\n    services.push_back(strdup(service));\n    protos.push_back(proto);\n    ports.push_back(port);\n    records.emplace_back();\n\n    return true;\n}\n\nbool mDNS::addServiceTxtImpl(const char *service, uint8_t proto, const char *item) {\n    int8_t index = -1;\n    for (uint8_t i = 0; i < services.size(); i++) {\n        // find a matching service\n        if (strcmp(services[i], service) == 0 && protos[i] == proto) {\n            index = i;\n            break;\n        }\n    }\n    if (index == -1)\n        return false;\n\n    records[index].push_back(strdup(item));\n    return true;\n}\n\nMDNSResponder MDNS;\n\n#endif\n\n#endif\n
"},{"location":"ltapi/m_d_n_s_8cpp/","title":"File mDNS.cpp","text":"

FileList > arduino > libraries > common > mDNS > mDNS.cpp

Go to the source code of this file.

  • #include \"mDNS.h\"
"},{"location":"ltapi/m_d_n_s_8cpp/#public-static-functions","title":"Public Static Functions","text":"Type Name char * ensureUnderscore (const char * value)"},{"location":"ltapi/m_d_n_s_8cpp/#public-static-functions-documentation","title":"Public Static Functions Documentation","text":""},{"location":"ltapi/m_d_n_s_8cpp/#function-ensureunderscore","title":"function ensureUnderscore","text":"
static char * ensureUnderscore (\n    const char * value\n) \n

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/mDNS/mDNS.cpp

"},{"location":"ltapi/m_d_n_s_8cpp_source/","title":"File mDNS.cpp","text":"

File List > arduino > libraries > common > mDNS > mDNS.cpp

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-08-26. */\n\n#include \"mDNS.h\"\n\nstatic char *ensureUnderscore(const char *value) {\n    uint8_t len  = strlen(value) + 1;\n    char *result = (char *)malloc(len);\n    result[0]    = '_';\n    strcpy(result + 1, value + (value[0] == '_'));\n    return result;\n}\n\nvoid mDNS::setInstanceName(const char *name) {\n    if (instanceName)\n        free(instanceName);\n    instanceName = strdup(name);\n}\n\nbool mDNS::addService(char *service, char *proto, uint16_t port) {\n    char *_service = ensureUnderscore(service);\n    uint8_t _proto = strncmp(proto + (proto[0] == '_'), \"tcp\", 3) == 0 ? MDNS_TCP : MDNS_UDP;\n\n    bool result = addServiceImpl(instanceName ? instanceName : \"LT mDNS\", _service, _proto, port);\n    free(_service);\n    return result;\n}\n\nbool mDNS::addServiceTxt(char *service, char *proto, char *key, char *value) {\n    char *_service = ensureUnderscore(service);\n    uint8_t _proto = strncmp(proto + (proto[0] == '_'), \"tcp\", 3) == 0 ? MDNS_TCP : MDNS_UDP;\n\n    uint8_t txt_len = strlen(key) + strlen(value) + 1;\n    char *txt       = (char *)malloc(txt_len + 1);\n    sprintf(txt, \"%s=%s\", key, value);\n\n    bool result = addServiceTxtImpl(_service, _proto, txt);\n    free(_service);\n    free(txt);\n    return result;\n}\n
"},{"location":"ltapi/m_d_n_s_8h/","title":"File mDNS.h","text":"

FileList > arduino > libraries > common > mDNS > mDNS.h

Go to the source code of this file.

  • #include <Arduino.h>
  • #include <api/IPv6Address.h>
"},{"location":"ltapi/m_d_n_s_8h/#classes","title":"Classes","text":"Type Name class mDNS"},{"location":"ltapi/m_d_n_s_8h/#public-types","title":"Public Types","text":"Type Name typedef mDNS MDNSResponder"},{"location":"ltapi/m_d_n_s_8h/#public-attributes","title":"Public Attributes","text":"Type Name MDNSResponder MDNS"},{"location":"ltapi/m_d_n_s_8h/#macros","title":"Macros","text":"Type Name define MDNS_TCP 1 define MDNS_UDP 0"},{"location":"ltapi/m_d_n_s_8h/#public-types-documentation","title":"Public Types Documentation","text":""},{"location":"ltapi/m_d_n_s_8h/#typedef-mdnsresponder","title":"typedef MDNSResponder","text":"
typedef mDNS MDNSResponder;\n
"},{"location":"ltapi/m_d_n_s_8h/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/m_d_n_s_8h/#variable-mdns","title":"variable MDNS","text":"
MDNSResponder MDNS;\n
"},{"location":"ltapi/m_d_n_s_8h/#macro-definition-documentation","title":"Macro Definition Documentation","text":""},{"location":"ltapi/m_d_n_s_8h/#define-mdns_tcp","title":"define MDNS_TCP","text":"
#define MDNS_TCP 1\n
"},{"location":"ltapi/m_d_n_s_8h/#define-mdns_udp","title":"define MDNS_UDP","text":"
#define MDNS_UDP 0\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/common/mDNS/mDNS.h

"},{"location":"ltapi/m_d_n_s_8h_source/","title":"File mDNS.h","text":"

File List > arduino > libraries > common > mDNS > mDNS.h

Go to the documentation of this file.

/*\nESP8266 Multicast DNS (port of CC3000 Multicast DNS library)\nVersion 1.1\nCopyright (c) 2013 Tony DiCola (tony@tonydicola.com)\nESP8266 port (c) 2015 Ivan Grokhotkov (ivan@esp8266.com)\nMDNS-SD Suport 2015 Hristo Gochkov (hristo@espressif.com)\nExtended MDNS-SD support 2016 Lars Englund (lars.englund@gmail.com)\nRewritten for ESP32 by Hristo Gochkov (hristo@espressif.com)\n\nThis is a simple implementation of multicast DNS query support for an Arduino\nrunning on ESP32 chip.\n\nUsage:\n- Include the ESP32 Multicast DNS library in the sketch.\n- Call the begin method in the sketch's setup and provide a domain name (without\n  the '.local' suffix, i.e. just provide 'foo' to resolve 'foo.local'), and the\n  Adafruit CC3000 class instance.  Optionally provide a time to live (in seconds)\n  for the DNS record--the default is 1 hour.\n- Call the update method in each iteration of the sketch's loop function.\n\nLicense (MIT license):\n  Permission is hereby granted, free of charge, to any person obtaining a copy\n  of this software and associated documentation files (the \"Software\"), to deal\n  in the Software without restriction, including without limitation the rights\n  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n  copies of the Software, and to permit persons to whom the Software is\n  furnished to do so, subject to the following conditions:\n\n  The above copyright notice and this permission notice shall be included in\n  all copies or substantial portions of the Software.\n\n  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n  THE SOFTWARE.\n\n*/\n\n#pragma once\n\n#include <Arduino.h>\n#include <api/IPv6Address.h>\n\n#define MDNS_UDP 0\n#define MDNS_TCP 1\n\nclass mDNS {\n  private:\n    bool addServiceImpl(const char *name, const char *service, uint8_t proto, uint16_t port);\n    bool addServiceTxtImpl(const char *service, uint8_t proto, const char *item);\n\n    char *instanceName = NULL;\n\n  public:\n    mDNS();\n    ~mDNS();\n\n    bool begin(const char *hostname);\n    void end();\n\n    void setInstanceName(const char *name);\n    bool addService(char *service, char *proto, uint16_t port);\n    bool addServiceTxt(char *service, char *proto, char *key, char *value);\n    // void enableArduino(uint16_t port = 3232, bool auth = false);\n    // void disableArduino();\n    // void enableWorkstation(esp_interface_t interface = ESP_IF_WIFI_STA);\n    // void disableWorkstation();\n\n    IPAddress queryHost(char *host, uint32_t timeout = 2000);\n    int queryService(char *service, char *proto);\n\n    String hostname(int idx);\n    IPAddress IP(int idx);\n    IPv6Address IPv6(int idx);\n    uint16_t port(int idx);\n    int numTxt(int idx);\n    bool hasTxt(int idx, const char *key);\n    String txt(int idx, const char *key);\n    String txt(int idx, int txtIdx);\n    String txtKey(int idx, int txtIdx);\n\n    void setInstanceName(String name) {\n        setInstanceName(name.c_str());\n    }\n\n    void setInstanceName(char *name) {\n        setInstanceName((const char *)name);\n    }\n\n    bool addService(const char *service, const char *proto, uint16_t port) {\n        return addService((char *)service, (char *)proto, port);\n    }\n\n    bool addService(String service, String proto, uint16_t port) {\n        return addService(service.c_str(), proto.c_str(), port);\n    }\n\n    void addServiceTxt(const char *service, const char *proto, const char *key, const char *value) {\n        addServiceTxt((char *)service, (char *)proto, (char *)key, (char *)value);\n    }\n\n    void addServiceTxt(String service, String proto, String key, String value) {\n        addServiceTxt(service.c_str(), proto.c_str(), key.c_str(), value.c_str());\n    }\n\n    IPAddress queryHost(const char *host, uint32_t timeout = 2000) {\n        return queryHost((char *)host, timeout);\n    }\n\n    IPAddress queryHost(String host, uint32_t timeout = 2000) {\n        return queryHost(host.c_str(), timeout);\n    }\n\n    int queryService(const char *service, const char *proto) {\n        return queryService((char *)service, (char *)proto);\n    }\n\n    int queryService(String service, String proto) {\n        return queryService(service.c_str(), proto.c_str());\n    }\n};\n\ntypedef mDNS MDNSResponder;\n\nextern MDNSResponder MDNS;\n
"},{"location":"ltapi/dir_5ea3aad773d57a5f23d4c7a2455c87eb/","title":"Dir cores/common/arduino/libraries/ext","text":"

FileList > arduino > libraries > ext

"},{"location":"ltapi/dir_5ea3aad773d57a5f23d4c7a2455c87eb/#directories","title":"Directories","text":"Type Name dir HTTPClient dir StreamString dir WebServer dir WiFiMulti dir base64 dir cbuf

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/

"},{"location":"ltapi/dir_317cbb6bf43941e79ffdd996bee8e3bd/","title":"Dir cores/common/arduino/libraries/ext/HTTPClient","text":"

FileList > arduino > libraries > ext > HTTPClient

"},{"location":"ltapi/dir_317cbb6bf43941e79ffdd996bee8e3bd/#files","title":"Files","text":"Type Name file HTTPClient.cpp file HTTPClient.h

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/HTTPClient/

"},{"location":"ltapi/_h_t_t_p_client_8cpp/","title":"File HTTPClient.cpp","text":"

FileList > arduino > libraries > ext > HTTPClient > HTTPClient.cpp

Go to the source code of this file.

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/HTTPClient/HTTPClient.cpp

"},{"location":"ltapi/_h_t_t_p_client_8cpp_source/","title":"File HTTPClient.cpp","text":"

File List > arduino > libraries > ext > HTTPClient > HTTPClient.cpp

Go to the documentation of this file.

#if LT_ARD_HAS_WIFI\n\n#include <Arduino.h>\n\n#ifdef HTTPCLIENT_1_1_COMPATIBLE\n#include <WiFi.h>\n#include <WiFiClientSecure.h>\n#endif\n\n// #include <StreamString.h>\n#include <base64.h>\n\n#include \"HTTPClient.h\"\n\n#include <time.h>\n\n#ifdef HTTPCLIENT_1_1_COMPATIBLE\nclass TransportTraits {\n  public:\n    virtual ~TransportTraits() {}\n\n    virtual std::unique_ptr<WiFiClient> create() {\n        return std::unique_ptr<WiFiClient>(new WiFiClient());\n    }\n\n    virtual bool verify(WiFiClient &client, const char *host) {\n        return true;\n    }\n};\n\nclass TLSTraits : public TransportTraits {\n  public:\n    TLSTraits(const char *CAcert, const char *clicert = nullptr, const char *clikey = nullptr)\n        : _cacert(CAcert), _clicert(clicert), _clikey(clikey) {}\n\n    std::unique_ptr<WiFiClient> create() override {\n        return std::unique_ptr<WiFiClient>(new WiFiClientSecure());\n    }\n\n    bool verify(WiFiClient &client, const char *host) override {\n        WiFiClientSecure &wcs = static_cast<WiFiClientSecure &>(client);\n        if (_cacert == nullptr) {\n            wcs.setInsecure();\n        } else {\n            wcs.setCACert(_cacert);\n            wcs.setCertificate(_clicert);\n            wcs.setPrivateKey(_clikey);\n        }\n        return true;\n    }\n\n  protected:\n    const char *_cacert;\n    const char *_clicert;\n    const char *_clikey;\n};\n#endif // HTTPCLIENT_1_1_COMPATIBLE\n\nHTTPClient::HTTPClient() {}\n\nHTTPClient::~HTTPClient() {\n    if (_client) {\n        _client->stop();\n    }\n    if (_currentHeaders) {\n        delete[] _currentHeaders;\n    }\n    if (_tcpDeprecated) {\n        _tcpDeprecated.reset(nullptr);\n    }\n    if (_transportTraits) {\n        _transportTraits.reset(nullptr);\n    }\n}\n\nvoid HTTPClient::clear() {\n    _returnCode = 0;\n    _size       = -1;\n    _headers    = \"\";\n}\n\nbool HTTPClient::begin(WiFiClient &client, String url) {\n#ifdef HTTPCLIENT_1_1_COMPATIBLE\n    if (_tcpDeprecated) {\n        log_d(\"mix up of new and deprecated api\");\n        _canReuse = false;\n        end();\n    }\n#endif\n\n    _client = &client;\n\n    // check for : (http: or https:)\n    int index = url.indexOf(':');\n    if (index < 0) {\n        log_d(\"failed to parse protocol\");\n        return false;\n    }\n\n    String protocol = url.substring(0, index);\n    if (protocol != \"http\" && protocol != \"https\") {\n        log_d(\"unknown protocol '%s'\", protocol.c_str());\n        return false;\n    }\n\n    _port   = (protocol == \"https\" ? 443 : 80);\n    _secure = (protocol == \"https\");\n    return beginInternal(url, protocol.c_str());\n}\n\nbool HTTPClient::begin(WiFiClient &client, String host, uint16_t port, String uri, bool https) {\n#ifdef HTTPCLIENT_1_1_COMPATIBLE\n    if (_tcpDeprecated) {\n        log_d(\"mix up of new and deprecated api\");\n        _canReuse = false;\n        end();\n    }\n#endif\n\n    _client = &client;\n\n    clear();\n    _host     = host;\n    _port     = port;\n    _uri      = uri;\n    _protocol = (https ? \"https\" : \"http\");\n    _secure   = https;\n    return true;\n}\n\n#ifdef HTTPCLIENT_1_1_COMPATIBLE\nbool HTTPClient::begin(String url, const char *CAcert) {\n    if (_client && !_tcpDeprecated) {\n        log_d(\"mix up of new and deprecated api\");\n        _canReuse = false;\n        end();\n    }\n\n    clear();\n    _port = 443;\n    if (!beginInternal(url, \"https\")) {\n        return false;\n    }\n    _secure          = true;\n    _transportTraits = TransportTraitsPtr(new TLSTraits(CAcert));\n    if (!_transportTraits) {\n        log_e(\"could not create transport traits\");\n        return false;\n    }\n\n    return true;\n}\n\nbool HTTPClient::begin(String url) {\n    if (_client && !_tcpDeprecated) {\n        log_d(\"mix up of new and deprecated api\");\n        _canReuse = false;\n        end();\n    }\n\n    clear();\n    _port = 80;\n    if (!beginInternal(url, \"http\")) {\n        return begin(url, (const char *)NULL);\n    }\n    _transportTraits = TransportTraitsPtr(new TransportTraits());\n    if (!_transportTraits) {\n        log_e(\"could not create transport traits\");\n        return false;\n    }\n\n    return true;\n}\n#endif // HTTPCLIENT_1_1_COMPATIBLE\n\nbool HTTPClient::beginInternal(String url, const char *expectedProtocol) {\n    log_v(\"url: %s\", url.c_str());\n\n    // check for : (http: or https:\n    int index = url.indexOf(':');\n    if (index < 0) {\n        log_e(\"failed to parse protocol\");\n        return false;\n    }\n\n    _protocol = url.substring(0, index);\n    if (_protocol != expectedProtocol) {\n        log_d(\"unexpected protocol: %s, expected %s\", _protocol.c_str(), expectedProtocol);\n        return false;\n    }\n\n    url.remove(0, (index + 3)); // remove http:// or https://\n\n    index = url.indexOf('/');\n    if (index == -1) {\n        index = url.length();\n        url += '/';\n    }\n    String host = url.substring(0, index);\n    url.remove(0, index); // remove host part\n\n    // get Authorization\n    index = host.indexOf('@');\n    if (index >= 0) {\n        // auth info\n        String auth = host.substring(0, index);\n        host.remove(0, index + 1); // remove auth part including @\n        _base64Authorization = base64::encode(auth);\n    }\n\n    // get port\n    index = host.indexOf(':');\n    String the_host;\n    if (index >= 0) {\n        the_host = host.substring(0, index); // hostname\n        host.remove(0, (index + 1));         // remove hostname + :\n        _port = host.toInt();                // get port\n    } else {\n        the_host = host;\n    }\n    if (_host != the_host && connected()) {\n        log_d(\"switching host from '%s' to '%s'. disconnecting first\", _host.c_str(), the_host.c_str());\n        _canReuse = false;\n        disconnect(true);\n    }\n    _host = the_host;\n    _uri  = url;\n    log_d(\"protocol: %s, host: %s port: %d url: %s\", _protocol.c_str(), _host.c_str(), _port, _uri.c_str());\n    return true;\n}\n\n#ifdef HTTPCLIENT_1_1_COMPATIBLE\nbool HTTPClient::begin(String host, uint16_t port, String uri) {\n    if (_client && !_tcpDeprecated) {\n        log_d(\"mix up of new and deprecated api\");\n        _canReuse = false;\n        end();\n    }\n\n    clear();\n    _host            = host;\n    _port            = port;\n    _uri             = uri;\n    _transportTraits = TransportTraitsPtr(new TransportTraits());\n    log_d(\"host: %s port: %d uri: %s\", host.c_str(), port, uri.c_str());\n    return true;\n}\n\nbool HTTPClient::begin(String host, uint16_t port, String uri, const char *CAcert) {\n    if (_client && !_tcpDeprecated) {\n        log_d(\"mix up of new and deprecated api\");\n        _canReuse = false;\n        end();\n    }\n\n    clear();\n    _host = host;\n    _port = port;\n    _uri  = uri;\n\n    if (strlen(CAcert) == 0) {\n        return false;\n    }\n    _secure          = true;\n    _transportTraits = TransportTraitsPtr(new TLSTraits(CAcert));\n    return true;\n}\n\nbool HTTPClient::begin(\n    String host, uint16_t port, String uri, const char *CAcert, const char *cli_cert, const char *cli_key\n) {\n    if (_client && !_tcpDeprecated) {\n        log_d(\"mix up of new and deprecated api\");\n        _canReuse = false;\n        end();\n    }\n\n    clear();\n    _host = host;\n    _port = port;\n    _uri  = uri;\n\n    if (strlen(CAcert) == 0) {\n        return false;\n    }\n    _secure          = true;\n    _transportTraits = TransportTraitsPtr(new TLSTraits(CAcert, cli_cert, cli_key));\n    return true;\n}\n#endif // HTTPCLIENT_1_1_COMPATIBLE\n\nvoid HTTPClient::end(void) {\n    disconnect(false);\n    clear();\n}\n\nvoid HTTPClient::disconnect(bool preserveClient) {\n    if (connected()) {\n        if (_client->available() > 0) {\n            log_d(\"still data in buffer (%d), clean up.\\n\", _client->available());\n            _client->flush();\n        }\n\n        if (_reuse && _canReuse) {\n            log_d(\"tcp keep open for reuse\");\n        } else {\n            log_d(\"tcp stop\");\n            _client->stop();\n            if (!preserveClient) {\n                _client = nullptr;\n#ifdef HTTPCLIENT_1_1_COMPATIBLE\n                if (_tcpDeprecated) {\n                    _transportTraits.reset(nullptr);\n                    _tcpDeprecated.reset(nullptr);\n                }\n#endif\n            }\n        }\n    } else {\n        log_d(\"tcp is closed\\n\");\n    }\n}\n\nbool HTTPClient::connected() {\n    if (_client) {\n        return ((_client->available() > 0) || _client->connected());\n    }\n    return false;\n}\n\nvoid HTTPClient::setReuse(bool reuse) {\n    _reuse = reuse;\n}\n\nvoid HTTPClient::setUserAgent(const String &userAgent) {\n    _userAgent = userAgent;\n}\n\nvoid HTTPClient::setAuthorization(const char *user, const char *password) {\n    if (user && password) {\n        String auth = user;\n        auth += \":\";\n        auth += password;\n        _base64Authorization = base64::encode(auth);\n    }\n}\n\nvoid HTTPClient::setAuthorization(const char *auth) {\n    if (auth) {\n        _base64Authorization = auth;\n    }\n}\n\nvoid HTTPClient::setAuthorizationType(const char *authType) {\n    if (authType) {\n        _authorizationType = authType;\n    }\n}\n\nvoid HTTPClient::setConnectTimeout(int32_t connectTimeout) {\n    _connectTimeout = connectTimeout;\n}\n\nvoid HTTPClient::setTimeout(uint16_t timeout) {\n    _tcpTimeout = timeout;\n    if (connected()) {\n        _client->setTimeout((timeout + 500) / 1000);\n    }\n}\n\nvoid HTTPClient::useHTTP10(bool useHTTP10) {\n    _useHTTP10 = useHTTP10;\n    _reuse     = !useHTTP10;\n}\n\nint HTTPClient::GET() {\n    return sendRequest(\"GET\");\n}\n\nint HTTPClient::POST(uint8_t *payload, size_t size) {\n    return sendRequest(\"POST\", payload, size);\n}\n\nint HTTPClient::POST(String payload) {\n    return POST((uint8_t *)payload.c_str(), payload.length());\n}\n\nint HTTPClient::PATCH(uint8_t *payload, size_t size) {\n    return sendRequest(\"PATCH\", payload, size);\n}\n\nint HTTPClient::PATCH(String payload) {\n    return PATCH((uint8_t *)payload.c_str(), payload.length());\n}\n\nint HTTPClient::PUT(uint8_t *payload, size_t size) {\n    return sendRequest(\"PUT\", payload, size);\n}\n\nint HTTPClient::PUT(String payload) {\n    return PUT((uint8_t *)payload.c_str(), payload.length());\n}\n\nint HTTPClient::sendRequest(const char *type, String payload) {\n    return sendRequest(type, (uint8_t *)payload.c_str(), payload.length());\n}\n\nint HTTPClient::sendRequest(const char *type, uint8_t *payload, size_t size) {\n    int code;\n    bool redirect          = false;\n    uint16_t redirectCount = 0;\n    do {\n        // wipe out any existing headers from previous request\n        for (size_t i = 0; i < _headerKeysCount; i++) {\n            if (_currentHeaders[i].value.length() > 0) {\n                _currentHeaders[i].value = \"\"; // LT: changed from clear()\n            }\n        }\n\n        log_d(\"request type: '%s' redirCount: %d\\n\", type, redirectCount);\n\n        // connect to server\n        if (!connect()) {\n            return returnError(HTTPC_ERROR_CONNECTION_REFUSED);\n        }\n\n        if (payload && size > 0) {\n            addHeader(F(\"Content-Length\"), String(size));\n        }\n\n        // add cookies to header, if present\n        String cookie_string;\n        if (generateCookieString(&cookie_string)) {\n            addHeader(\"Cookie\", cookie_string);\n        }\n\n        // send Header\n        if (!sendHeader(type)) {\n            return returnError(HTTPC_ERROR_SEND_HEADER_FAILED);\n        }\n\n        // send Payload if needed\n        if (payload && size > 0) {\n            if (_client->write(&payload[0], size) != size) {\n                return returnError(HTTPC_ERROR_SEND_PAYLOAD_FAILED);\n            }\n        }\n\n        code = handleHeaderResponse();\n        log_d(\"sendRequest code=%d\\n\", code);\n\n        // Handle redirections as stated in RFC document:\n        // https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html\n        //\n        // Implementing HTTP_CODE_FOUND as redirection with GET method,\n        // to follow most of existing user agent implementations.\n        //\n        redirect = false;\n        if (_followRedirects != HTTPC_DISABLE_FOLLOW_REDIRECTS && redirectCount < _redirectLimit &&\n            _location.length() > 0) {\n            switch (code) {\n                // redirecting using the same method\n                case HTTP_CODE_MOVED_PERMANENTLY:\n                case HTTP_CODE_TEMPORARY_REDIRECT: {\n                    if (\n                        // allow to force redirections on other methods\n                        // (the RFC require user to accept the redirection)\n                        _followRedirects == HTTPC_FORCE_FOLLOW_REDIRECTS ||\n                        // allow GET and HEAD methods without force\n                        !strcmp(type, \"GET\") ||\n                        !strcmp(type, \"HEAD\")\n                    ) {\n                        redirectCount += 1;\n                        log_d(\n                            \"following redirect (the same method): '%s' redirCount: %d\\n\",\n                            _location.c_str(),\n                            redirectCount\n                        );\n                        if (!setURL(_location)) {\n                            log_d(\"failed setting URL for redirection\\n\");\n                            // no redirection\n                            break;\n                        }\n                        // redirect using the same request method and payload, diffrent URL\n                        redirect = true;\n                    }\n                    break;\n                }\n                // redirecting with method dropped to GET or HEAD\n                // note: it does not need `HTTPC_FORCE_FOLLOW_REDIRECTS` for any method\n                case HTTP_CODE_FOUND:\n                case HTTP_CODE_SEE_OTHER: {\n                    redirectCount += 1;\n                    log_d(\n                        \"following redirect (dropped to GET/HEAD): '%s' redirCount: %d\\n\",\n                        _location.c_str(),\n                        redirectCount\n                    );\n                    if (!setURL(_location)) {\n                        log_d(\"failed setting URL for redirection\\n\");\n                        // no redirection\n                        break;\n                    }\n                    // redirect after changing method to GET/HEAD and dropping payload\n                    type     = \"GET\";\n                    payload  = nullptr;\n                    size     = 0;\n                    redirect = true;\n                    break;\n                }\n\n                default:\n                    break;\n            }\n        }\n\n    } while (redirect);\n    // handle Server Response (Header)\n    return returnError(code);\n}\n\nint HTTPClient::sendRequest(const char *type, Stream *stream, size_t size) {\n\n    if (!stream) {\n        return returnError(HTTPC_ERROR_NO_STREAM);\n    }\n\n    // connect to server\n    if (!connect()) {\n        return returnError(HTTPC_ERROR_CONNECTION_REFUSED);\n    }\n\n    if (size > 0) {\n        addHeader(\"Content-Length\", String(size));\n    }\n\n    // add cookies to header, if present\n    String cookie_string;\n    if (generateCookieString(&cookie_string)) {\n        addHeader(\"Cookie\", cookie_string);\n    }\n\n    // send Header\n    if (!sendHeader(type)) {\n        return returnError(HTTPC_ERROR_SEND_HEADER_FAILED);\n    }\n\n    int buff_size = HTTP_TCP_BUFFER_SIZE;\n\n    int len          = size;\n    int bytesWritten = 0;\n\n    if (len == 0) {\n        len = -1;\n    }\n\n    // if possible create smaller buffer then HTTP_TCP_BUFFER_SIZE\n    if ((len > 0) && (len < HTTP_TCP_BUFFER_SIZE)) {\n        buff_size = len;\n    }\n\n    // create buffer for read\n    uint8_t *buff = (uint8_t *)malloc(buff_size);\n\n    if (buff) {\n        // read all data from stream and send it to server\n        while (connected() && (stream->available() > -1) && (len > 0 || len == -1)) {\n\n            // get available data size\n            int sizeAvailable = stream->available();\n\n            if (sizeAvailable) {\n\n                int readBytes = sizeAvailable;\n\n                // read only the asked bytes\n                if (len > 0 && readBytes > len) {\n                    readBytes = len;\n                }\n\n                // not read more the buffer can handle\n                if (readBytes > buff_size) {\n                    readBytes = buff_size;\n                }\n\n                // read data\n                int bytesRead = stream->readBytes(buff, readBytes);\n\n                // write it to Stream\n                int bytesWrite = _client->write((const uint8_t *)buff, bytesRead);\n                bytesWritten += bytesWrite;\n\n                // are all Bytes a writen to stream ?\n                if (bytesWrite != bytesRead) {\n                    log_d(\"short write, asked for %d but got %d retry...\", bytesRead, bytesWrite);\n\n                    // check for write error\n                    if (_client->getWriteError()) {\n                        log_d(\"stream write error %d\", _client->getWriteError());\n\n                        // reset write error for retry\n                        _client->clearWriteError();\n                    }\n\n                    // some time for the stream\n                    delay(1);\n\n                    int leftBytes = (readBytes - bytesWrite);\n\n                    // retry to send the missed bytes\n                    bytesWrite = _client->write((const uint8_t *)(buff + bytesWrite), leftBytes);\n                    bytesWritten += bytesWrite;\n\n                    if (bytesWrite != leftBytes) {\n                        // failed again\n                        log_d(\"short write, asked for %d but got %d failed.\", leftBytes, bytesWrite);\n                        free(buff);\n                        return returnError(HTTPC_ERROR_SEND_PAYLOAD_FAILED);\n                    }\n                }\n\n                // check for write error\n                if (_client->getWriteError()) {\n                    log_d(\"stream write error %d\", _client->getWriteError());\n                    free(buff);\n                    return returnError(HTTPC_ERROR_SEND_PAYLOAD_FAILED);\n                }\n\n                // count bytes to read left\n                if (len > 0) {\n                    len -= readBytes;\n                }\n\n                delay(0);\n            } else {\n                delay(1);\n            }\n        }\n\n        free(buff);\n\n        if (size && (int)size != bytesWritten) {\n            log_d(\"Stream payload bytesWritten %d and size %d mismatch!.\", bytesWritten, size);\n            log_d(\"ERROR SEND PAYLOAD FAILED!\");\n            return returnError(HTTPC_ERROR_SEND_PAYLOAD_FAILED);\n        } else {\n            log_d(\"Stream payload written: %d\", bytesWritten);\n        }\n\n    } else {\n        log_d(\"too less ram! need %d\", HTTP_TCP_BUFFER_SIZE);\n        return returnError(HTTPC_ERROR_TOO_LESS_RAM);\n    }\n\n    // handle Server Response (Header)\n    return returnError(handleHeaderResponse());\n}\n\nint HTTPClient::getSize(void) {\n    return _size;\n}\n\nWiFiClient &HTTPClient::getStream(void) {\n    if (connected()) {\n        return *_client;\n    }\n\n    log_w(\"getStream: not connected\");\n    static WiFiClient empty;\n    return empty;\n}\n\nWiFiClient *HTTPClient::getStreamPtr(void) {\n    if (connected()) {\n        return _client;\n    }\n\n    log_w(\"getStreamPtr: not connected\");\n    return nullptr;\n}\n\nint HTTPClient::writeToStream(Stream *stream) {\n\n    if (!stream) {\n        return returnError(HTTPC_ERROR_NO_STREAM);\n    }\n\n    if (!connected()) {\n        return returnError(HTTPC_ERROR_NOT_CONNECTED);\n    }\n\n    // get length of document (is -1 when Server sends no Content-Length header)\n    int len = _size;\n    int ret = 0;\n\n    if (_transferEncoding == HTTPC_TE_IDENTITY) {\n        ret = writeToStreamDataBlock(stream, len);\n\n        // have we an error?\n        if (ret < 0) {\n            return returnError(ret);\n        }\n    } else if (_transferEncoding == HTTPC_TE_CHUNKED) {\n        int size = 0;\n        while (1) {\n            if (!connected()) {\n                return returnError(HTTPC_ERROR_CONNECTION_LOST);\n            }\n            String chunkHeader = _client->readStringUntil('\\n');\n\n            if (chunkHeader.length() <= 0) {\n                return returnError(HTTPC_ERROR_READ_TIMEOUT);\n            }\n\n            chunkHeader.trim(); // remove \\r\n\n            // read size of chunk\n            len = (uint32_t)strtol((const char *)chunkHeader.c_str(), NULL, 16);\n            size += len;\n            log_d(\" read chunk len: %d\", len);\n\n            // data left?\n            if (len > 0) {\n                int r = writeToStreamDataBlock(stream, len);\n                if (r < 0) {\n                    // error in writeToStreamDataBlock\n                    return returnError(r);\n                }\n                ret += r;\n            } else {\n\n                // if no length Header use global chunk size\n                if (_size <= 0) {\n                    _size = size;\n                }\n\n                // check if we have write all data out\n                if (ret != _size) {\n                    return returnError(HTTPC_ERROR_STREAM_WRITE);\n                }\n                break;\n            }\n\n            // read trailing \\r\\n at the end of the chunk\n            char buf[2];\n            auto trailing_seq_len = _client->readBytes((uint8_t *)buf, 2);\n            if (trailing_seq_len != 2 || buf[0] != '\\r' || buf[1] != '\\n') {\n                return returnError(HTTPC_ERROR_READ_TIMEOUT);\n            }\n\n            delay(0);\n        }\n    } else {\n        return returnError(HTTPC_ERROR_ENCODING);\n    }\n\n    //    end();\n    disconnect(true);\n    return ret;\n}\n\n/* String HTTPClient::getString(void) {\n    // _size can be -1 when Server sends no Content-Length header\n    if (_size > 0 || _size == -1) {\n        StreamString sstring;\n        // try to reserve needed memory (noop if _size == -1)\n        if (sstring.reserve((_size + 1))) {\n            writeToStream(&sstring);\n            return sstring;\n        } else {\n            log_d(\"not enough memory to reserve a string! need: %d\", (_size + 1));\n        }\n    }\n\n    return \"\";\n} */\n\nString HTTPClient::errorToString(int error) {\n    switch (error) {\n        case HTTPC_ERROR_CONNECTION_REFUSED:\n            return F(\"connection refused\");\n        case HTTPC_ERROR_SEND_HEADER_FAILED:\n            return F(\"send header failed\");\n        case HTTPC_ERROR_SEND_PAYLOAD_FAILED:\n            return F(\"send payload failed\");\n        case HTTPC_ERROR_NOT_CONNECTED:\n            return F(\"not connected\");\n        case HTTPC_ERROR_CONNECTION_LOST:\n            return F(\"connection lost\");\n        case HTTPC_ERROR_NO_STREAM:\n            return F(\"no stream\");\n        case HTTPC_ERROR_NO_HTTP_SERVER:\n            return F(\"no HTTP server\");\n        case HTTPC_ERROR_TOO_LESS_RAM:\n            return F(\"too less ram\");\n        case HTTPC_ERROR_ENCODING:\n            return F(\"Transfer-Encoding not supported\");\n        case HTTPC_ERROR_STREAM_WRITE:\n            return F(\"Stream write error\");\n        case HTTPC_ERROR_READ_TIMEOUT:\n            return F(\"read Timeout\");\n        default:\n            return String();\n    }\n}\n\nvoid HTTPClient::addHeader(const String &name, const String &value, bool first, bool replace) {\n    // not allow set of Header handled by code\n    if (!name.equalsIgnoreCase(F(\"Connection\")) && !name.equalsIgnoreCase(F(\"User-Agent\")) &&\n        !name.equalsIgnoreCase(F(\"Host\")) &&\n        !(name.equalsIgnoreCase(F(\"Authorization\")) && _base64Authorization.length())) {\n\n        String headerLine = name;\n        headerLine += \": \";\n\n        if (replace) {\n            int headerStart = _headers.indexOf(headerLine);\n            if (headerStart != -1 && (headerStart == 0 || _headers[headerStart - 1] == '\\n')) {\n                int headerEnd = _headers.indexOf('\\n', headerStart);\n                _headers      = _headers.substring(0, headerStart) + _headers.substring(headerEnd + 1);\n            }\n        }\n\n        headerLine += value;\n        headerLine += \"\\r\\n\";\n        if (first) {\n            _headers = headerLine + _headers;\n        } else {\n            _headers += headerLine;\n        }\n    }\n}\n\nvoid HTTPClient::collectHeaders(const char *headerKeys[], const size_t headerKeysCount) {\n    _headerKeysCount = headerKeysCount;\n    if (_currentHeaders) {\n        delete[] _currentHeaders;\n    }\n    _currentHeaders = new RequestArgument[_headerKeysCount];\n    for (size_t i = 0; i < _headerKeysCount; i++) {\n        _currentHeaders[i].key = headerKeys[i];\n    }\n}\n\nString HTTPClient::header(const char *name) {\n    for (size_t i = 0; i < _headerKeysCount; ++i) {\n        if (_currentHeaders[i].key == name) {\n            return _currentHeaders[i].value;\n        }\n    }\n    return String();\n}\n\nString HTTPClient::header(size_t i) {\n    if (i < _headerKeysCount) {\n        return _currentHeaders[i].value;\n    }\n    return String();\n}\n\nString HTTPClient::headerName(size_t i) {\n    if (i < _headerKeysCount) {\n        return _currentHeaders[i].key;\n    }\n    return String();\n}\n\nint HTTPClient::headers() {\n    return _headerKeysCount;\n}\n\nbool HTTPClient::hasHeader(const char *name) {\n    for (size_t i = 0; i < _headerKeysCount; ++i) {\n        if ((_currentHeaders[i].key == name) && (_currentHeaders[i].value.length() > 0)) {\n            return true;\n        }\n    }\n    return false;\n}\n\nbool HTTPClient::connect(void) {\n    if (connected()) {\n        if (_reuse) {\n            log_d(\"already connected, reusing connection\");\n        } else {\n            log_d(\"already connected, try reuse!\");\n        }\n        while (_client->available() > 0) {\n            _client->read();\n        }\n        return true;\n    }\n\n#ifdef HTTPCLIENT_1_1_COMPATIBLE\n    if (_transportTraits && !_client) {\n        _tcpDeprecated = _transportTraits->create();\n        if (!_tcpDeprecated) {\n            log_e(\"failed to create client\");\n            return false;\n        }\n        _client = _tcpDeprecated.get();\n    }\n#endif\n\n    if (!_client) {\n        log_d(\"HTTPClient::begin was not called or returned error\");\n        return false;\n    }\n#ifdef HTTPCLIENT_1_1_COMPATIBLE\n    if (_tcpDeprecated && !_transportTraits->verify(*_client, _host.c_str())) {\n        log_d(\"transport level verify failed\");\n        _client->stop();\n        return false;\n    }\n#endif\n    if (!_client->connect(_host.c_str(), _port, _connectTimeout)) {\n        log_d(\"failed connect to %s:%u\", _host.c_str(), _port);\n        return false;\n    }\n\n    // set Timeout for WiFiClient and for Stream::readBytesUntil() and Stream::readStringUntil()\n    _client->setTimeout((_tcpTimeout + 500) / 1000);\n\n    log_d(\" connected to %s:%u\", _host.c_str(), _port);\n\n    /*\n    #ifdef ESP8266\n        _client->setNoDelay(true);\n    #endif\n     */\n    return connected();\n}\n\nbool HTTPClient::sendHeader(const char *type) {\n    if (!connected()) {\n        return false;\n    }\n\n    String header = String(type) + \" \" + _uri + F(\" HTTP/1.\");\n\n    if (_useHTTP10) {\n        header += \"0\";\n    } else {\n        header += \"1\";\n    }\n\n    header += String(F(\"\\r\\nHost: \")) + _host;\n    if (_port != 80 && _port != 443) {\n        header += ':';\n        header += String(_port);\n    }\n    header += String(F(\"\\r\\nUser-Agent: \")) + _userAgent + F(\"\\r\\nConnection: \");\n\n    if (_reuse) {\n        header += F(\"keep-alive\");\n    } else {\n        header += F(\"close\");\n    }\n    header += \"\\r\\n\";\n\n    if (!_useHTTP10) {\n        header += F(\"Accept-Encoding: identity;q=1,chunked;q=0.1,*;q=0\\r\\n\");\n    }\n\n    if (_base64Authorization.length()) {\n        _base64Authorization.replace(\"\\n\", \"\");\n        header += F(\"Authorization: \");\n        header += _authorizationType;\n        header += \" \";\n        header += _base64Authorization;\n        header += \"\\r\\n\";\n    }\n\n    header += _headers + \"\\r\\n\";\n\n    return (_client->write((const uint8_t *)header.c_str(), header.length()) == header.length());\n}\n\nint HTTPClient::handleHeaderResponse() {\n\n    if (!connected()) {\n        return HTTPC_ERROR_NOT_CONNECTED;\n    }\n\n    _returnCode = 0;\n    _size       = -1;\n    _canReuse   = _reuse;\n\n    String transferEncoding;\n\n    _transferEncoding          = HTTPC_TE_IDENTITY;\n    unsigned long lastDataTime = millis();\n    bool firstLine             = true;\n    String date;\n\n    while (connected()) {\n        size_t len = _client->available();\n        if (len > 0) {\n            String headerLine = _client->readStringUntil('\\n');\n            headerLine.trim(); // remove \\r\n\n            lastDataTime = millis();\n\n            log_v(\"RX: '%s'\", headerLine.c_str());\n\n            if (firstLine) {\n                firstLine = false;\n                if (_canReuse && headerLine.startsWith(\"HTTP/1.\")) {\n                    _canReuse = (headerLine[sizeof \"HTTP/1.\" - 1] != '0');\n                }\n                int codePos = headerLine.indexOf(' ') + 1;\n                _returnCode = headerLine.substring(codePos, headerLine.indexOf(' ', codePos)).toInt();\n            } else if (headerLine.indexOf(':')) {\n                String headerName  = headerLine.substring(0, headerLine.indexOf(':'));\n                String headerValue = headerLine.substring(headerLine.indexOf(':') + 1);\n                headerValue.trim();\n\n                if (headerName.equalsIgnoreCase(\"Date\")) {\n                    date = headerValue;\n                }\n\n                if (headerName.equalsIgnoreCase(\"Content-Length\")) {\n                    _size = headerValue.toInt();\n                }\n\n                if (_canReuse && headerName.equalsIgnoreCase(\"Connection\")) {\n                    if (headerValue.indexOf(\"close\") >= 0 && headerValue.indexOf(\"keep-alive\") < 0) {\n                        _canReuse = false;\n                    }\n                }\n\n                if (headerName.equalsIgnoreCase(\"Transfer-Encoding\")) {\n                    transferEncoding = headerValue;\n                }\n\n                if (headerName.equalsIgnoreCase(\"Location\")) {\n                    _location = headerValue;\n                }\n\n                if (headerName.equalsIgnoreCase(\"Set-Cookie\")) {\n                    setCookie(date, headerValue);\n                }\n\n                for (size_t i = 0; i < _headerKeysCount; i++) {\n                    if (_currentHeaders[i].key.equalsIgnoreCase(headerName)) {\n                        // Uncomment the following lines if you need to add support for multiple headers with the same\n                        // key: if (!_currentHeaders[i].value.isEmpty()) {\n                        //     // Existing value, append this one with a comma\n                        //     _currentHeaders[i].value += ',';\n                        //     _currentHeaders[i].value += headerValue;\n                        // } else {\n                        _currentHeaders[i].value = headerValue;\n                        // }\n                        break; // We found a match, stop looking\n                    }\n                }\n            }\n\n            if (headerLine == \"\") {\n                log_d(\"code: %d\", _returnCode);\n\n                if (_size > 0) {\n                    log_d(\"size: %d\", _size);\n                }\n\n                if (transferEncoding.length() > 0) {\n                    log_d(\"Transfer-Encoding: %s\", transferEncoding.c_str());\n                    if (transferEncoding.equalsIgnoreCase(\"chunked\")) {\n                        _transferEncoding = HTTPC_TE_CHUNKED;\n                    } else if (transferEncoding.equalsIgnoreCase(\"identity\")) {\n                        _transferEncoding = HTTPC_TE_IDENTITY;\n                    } else {\n                        return HTTPC_ERROR_ENCODING;\n                    }\n                } else {\n                    _transferEncoding = HTTPC_TE_IDENTITY;\n                }\n\n                if (_returnCode) {\n                    return _returnCode;\n                } else {\n                    log_d(\"Remote host is not an HTTP Server!\");\n                    return HTTPC_ERROR_NO_HTTP_SERVER;\n                }\n            }\n\n        } else {\n            if ((millis() - lastDataTime) > _tcpTimeout) {\n                return HTTPC_ERROR_READ_TIMEOUT;\n            }\n            delay(10);\n        }\n    }\n\n    return HTTPC_ERROR_CONNECTION_LOST;\n}\n\nint HTTPClient::writeToStreamDataBlock(Stream *stream, int size) {\n    int buff_size    = HTTP_TCP_BUFFER_SIZE;\n    int len          = size;\n    int bytesWritten = 0;\n\n    // if possible create smaller buffer then HTTP_TCP_BUFFER_SIZE\n    if ((len > 0) && (len < HTTP_TCP_BUFFER_SIZE)) {\n        buff_size = len;\n    }\n\n    // create buffer for read\n    uint8_t *buff = (uint8_t *)malloc(buff_size);\n\n    if (buff) {\n        // read all data from server\n        while (connected() && (len > 0 || len == -1)) {\n\n            // get available data size\n            size_t sizeAvailable = _client->available();\n\n            if (sizeAvailable) {\n\n                int readBytes = sizeAvailable;\n\n                // read only the asked bytes\n                if (len > 0 && readBytes > len) {\n                    readBytes = len;\n                }\n\n                // not read more the buffer can handle\n                if (readBytes > buff_size) {\n                    readBytes = buff_size;\n                }\n\n                // stop if no more reading\n                if (readBytes == 0)\n                    break;\n\n                // read data\n                int bytesRead = _client->readBytes(buff, readBytes);\n\n                // write it to Stream\n                int bytesWrite = stream->write(buff, bytesRead);\n                bytesWritten += bytesWrite;\n\n                // are all Bytes a writen to stream ?\n                if (bytesWrite != bytesRead) {\n                    log_d(\"short write asked for %d but got %d retry...\", bytesRead, bytesWrite);\n\n                    // check for write error\n                    if (stream->getWriteError()) {\n                        log_d(\"stream write error %d\", stream->getWriteError());\n\n                        // reset write error for retry\n                        stream->clearWriteError();\n                    }\n\n                    // some time for the stream\n                    delay(1);\n\n                    int leftBytes = (readBytes - bytesWrite);\n\n                    // retry to send the missed bytes\n                    bytesWrite = stream->write((buff + bytesWrite), leftBytes);\n                    bytesWritten += bytesWrite;\n\n                    if (bytesWrite != leftBytes) {\n                        // failed again\n                        log_w(\"short write asked for %d but got %d failed.\", leftBytes, bytesWrite);\n                        free(buff);\n                        return HTTPC_ERROR_STREAM_WRITE;\n                    }\n                }\n\n                // check for write error\n                if (stream->getWriteError()) {\n                    log_w(\"stream write error %d\", stream->getWriteError());\n                    free(buff);\n                    return HTTPC_ERROR_STREAM_WRITE;\n                }\n\n                // count bytes to read left\n                if (len > 0) {\n                    len -= readBytes;\n                }\n\n                delay(0);\n            } else {\n                delay(1);\n            }\n        }\n\n        free(buff);\n\n        log_d(\"connection closed or file end (written: %d).\", bytesWritten);\n\n        if ((size > 0) && (size != bytesWritten)) {\n            log_d(\"bytesWritten %d and size %d mismatch!.\", bytesWritten, size);\n            return HTTPC_ERROR_STREAM_WRITE;\n        }\n\n    } else {\n        log_w(\"too less ram! need %d\", HTTP_TCP_BUFFER_SIZE);\n        return HTTPC_ERROR_TOO_LESS_RAM;\n    }\n\n    return bytesWritten;\n}\n\nint HTTPClient::returnError(int error) {\n    if (error < 0) {\n        log_w(\"error(%d): %s\", error, errorToString(error).c_str());\n        if (connected()) {\n            log_d(\"tcp stop\");\n            _client->stop();\n        }\n    }\n    return error;\n}\n\nvoid HTTPClient::setFollowRedirects(followRedirects_t follow) {\n    _followRedirects = follow;\n}\n\nvoid HTTPClient::setRedirectLimit(uint16_t limit) {\n    _redirectLimit = limit;\n}\n\nbool HTTPClient::setURL(const String &url) {\n    // if the new location is only a path then only update the URI\n    if (url && url[0] == '/') {\n        _uri = url;\n        clear();\n        return true;\n    }\n\n    if (!url.startsWith(_protocol + ':')) {\n        log_d(\"new URL not the same protocol, expected '%s', URL: '%s'\\n\", _protocol.c_str(), url.c_str());\n        return false;\n    }\n\n    // check if the port is specified\n    int indexPort = url.indexOf(':', 6); // find the first ':' excluding the one from the protocol\n    int indexURI  = url.indexOf('/', 7); // find where the URI starts to make sure the ':' is not part of it\n    if (indexPort == -1 || indexPort > indexURI) {\n        // the port is not specified\n        _port = (_protocol == \"https\" ? 443 : 80);\n    }\n\n    // disconnect but preserve _client.\n    // Also have to keep the connection otherwise it will free some of the memory used by _client\n    // and will blow up later when trying to do _client->available() or similar\n    _canReuse = true;\n    disconnect(true);\n    return beginInternal(url, _protocol.c_str());\n}\n\nconst String &HTTPClient::getLocation(void) {\n    return _location;\n}\n\nvoid HTTPClient::setCookieJar(CookieJar *cookieJar) {\n    _cookieJar = cookieJar;\n}\n\nvoid HTTPClient::resetCookieJar() {\n    _cookieJar = nullptr;\n}\n\nvoid HTTPClient::clearAllCookies() {\n    if (_cookieJar)\n        _cookieJar->clear();\n}\n\nvoid HTTPClient::setCookie(String date, String headerValue) {\n    if (!_cookieJar) {\n        return;\n    }\n#define HTTP_TIME_PATTERN \"%a, %d %b %Y %H:%M:%S\"\n\n    Cookie cookie;\n    String value;\n    int pos1, pos2;\n\n    headerValue.toLowerCase();\n\n    struct tm tm;\n    strptime(date.c_str(), HTTP_TIME_PATTERN, &tm);\n    cookie.date = mktime(&tm);\n\n    pos1 = headerValue.indexOf('=');\n    pos2 = headerValue.indexOf(';');\n\n    if (pos1 >= 0 && pos2 > pos1) {\n        cookie.name  = headerValue.substring(0, pos1);\n        cookie.value = headerValue.substring(pos1 + 1, pos2);\n    } else {\n        return; // invalid cookie header\n    }\n\n    // expires\n    if (headerValue.indexOf(\"expires=\") >= 0) {\n        pos1 = headerValue.indexOf(\"expires=\") + strlen(\"expires=\");\n        pos2 = headerValue.indexOf(';', pos1);\n\n        if (pos2 > pos1)\n            value = headerValue.substring(pos1, pos2);\n        else\n            value = headerValue.substring(pos1);\n\n        strptime(value.c_str(), HTTP_TIME_PATTERN, &tm);\n        cookie.expires.date  = mktime(&tm);\n        cookie.expires.valid = true;\n    }\n\n    // max-age\n    if (headerValue.indexOf(\"max-age=\") >= 0) {\n        pos1 = headerValue.indexOf(\"max-age=\") + strlen(\"max-age=\");\n        pos2 = headerValue.indexOf(';', pos1);\n\n        if (pos2 > pos1)\n            value = headerValue.substring(pos1, pos2);\n        else\n            value = headerValue.substring(pos1);\n\n        cookie.max_age.duration = value.toInt();\n        cookie.max_age.valid    = true;\n    }\n\n    // domain\n    if (headerValue.indexOf(\"domain=\") >= 0) {\n        pos1 = headerValue.indexOf(\"domain=\") + strlen(\"domain=\");\n        pos2 = headerValue.indexOf(';', pos1);\n\n        if (pos2 > pos1)\n            value = headerValue.substring(pos1, pos2);\n        else\n            value = headerValue.substring(pos1);\n\n        if (value.startsWith(\".\"))\n            value.remove(0, 1);\n\n        if (_host.indexOf(value) >= 0) {\n            cookie.domain = value;\n        } else {\n            return; // server tries to set a cookie on a different domain; ignore it\n        }\n    } else {\n        pos1 = _host.lastIndexOf('.', _host.lastIndexOf('.') - 1);\n        if (pos1 >= 0)\n            cookie.domain = _host.substring(pos1 + 1);\n        else\n            cookie.domain = _host;\n    }\n\n    // path\n    if (headerValue.indexOf(\"path=\") >= 0) {\n        pos1 = headerValue.indexOf(\"path=\") + strlen(\"path=\");\n        pos2 = headerValue.indexOf(';', pos1);\n\n        if (pos2 > pos1)\n            cookie.path = headerValue.substring(pos1, pos2);\n        else\n            cookie.path = headerValue.substring(pos1);\n    }\n\n    // HttpOnly\n    cookie.http_only = (headerValue.indexOf(\"httponly\") >= 0);\n\n    // secure\n    cookie.secure = (headerValue.indexOf(\"secure\") >= 0);\n\n    // overwrite or delete cookie in/from cookie jar\n    time_t now_local = time(NULL);\n    time_t now_gmt   = mktime(gmtime(&now_local));\n\n    bool found = false;\n\n    for (auto c = _cookieJar->begin(); c != _cookieJar->end(); ++c) {\n        if (c->domain == cookie.domain && c->name == cookie.name) {\n            // when evaluating, max-age takes precedence over expires if both are defined\n            if ((cookie.max_age.valid && ((cookie.date + cookie.max_age.duration) < now_gmt)) ||\n                cookie.max_age.duration <= 0 ||\n                (!cookie.max_age.valid && cookie.expires.valid && cookie.expires.date < now_gmt)) {\n                _cookieJar->erase(c);\n                c--;\n            } else {\n                *c = cookie;\n            }\n            found = true;\n        }\n    }\n\n    // add cookie to jar\n    if (!found && !(cookie.max_age.valid && cookie.max_age.duration <= 0))\n        _cookieJar->push_back(cookie);\n}\n\nbool HTTPClient::generateCookieString(String *cookieString) {\n    time_t now_local = time(NULL);\n    time_t now_gmt   = mktime(gmtime(&now_local));\n\n    *cookieString = \"\";\n    bool found    = false;\n\n    if (!_cookieJar) {\n        return false;\n    }\n    for (auto c = _cookieJar->begin(); c != _cookieJar->end(); ++c) {\n        if ((c->max_age.valid && ((c->date + c->max_age.duration) < now_gmt)) ||\n            (!c->max_age.valid && c->expires.valid && c->expires.date < now_gmt)) {\n            _cookieJar->erase(c);\n            c--;\n        } else if (_host.indexOf(c->domain) >= 0 && (!c->secure || _secure)) {\n            if (*cookieString == \"\")\n                *cookieString = c->name + \"=\" + c->value;\n            else\n                *cookieString += \" ;\" + c->name + \"=\" + c->value;\n            found = true;\n        }\n    }\n\n    return found;\n}\n\n#endif // LT_ARD_HAS_WIFI\n
"},{"location":"ltapi/_h_t_t_p_client_8h/","title":"File HTTPClient.h","text":"

FileList > arduino > libraries > ext > HTTPClient > HTTPClient.h

Go to the source code of this file.

  • #include <Arduino.h>
  • #include <WiFiClient.h>
  • #include <WiFiClientSecure.h>
  • #include <memory>
  • #include <vector>
"},{"location":"ltapi/_h_t_t_p_client_8h/#classes","title":"Classes","text":"Type Name struct Cookie class HTTPClient struct RequestArgument"},{"location":"ltapi/_h_t_t_p_client_8h/#public-types","title":"Public Types","text":"Type Name typedef std::vector< Cookie > CookieJar typedef std::unique_ptr< TransportTraits > TransportTraitsPtr enum followRedirects_t enum t_http_codes HTTP codes see RFC7231. enum transferEncoding_t"},{"location":"ltapi/_h_t_t_p_client_8h/#macros","title":"Macros","text":"Type Name define HTTPCLIENT_1_1_COMPATIBLE define HTTPCLIENT_DEFAULT_TCP_TIMEOUT (5000)Cookie jar support. define HTTPC_ERROR_CONNECTION_LOST (-5) define HTTPC_ERROR_CONNECTION_REFUSED (-1)HTTP client errors. define HTTPC_ERROR_ENCODING (-9) define HTTPC_ERROR_NOT_CONNECTED (-4) define HTTPC_ERROR_NO_HTTP_SERVER (-7) define HTTPC_ERROR_NO_STREAM (-6) define HTTPC_ERROR_READ_TIMEOUT (-11) define HTTPC_ERROR_SEND_HEADER_FAILED (-2) define HTTPC_ERROR_SEND_PAYLOAD_FAILED (-3) define HTTPC_ERROR_STREAM_WRITE (-10) define HTTPC_ERROR_TOO_LESS_RAM (-8) define HTTP_TCP_BUFFER_SIZE (1460)size for the stream handling"},{"location":"ltapi/_h_t_t_p_client_8h/#public-types-documentation","title":"Public Types Documentation","text":""},{"location":"ltapi/_h_t_t_p_client_8h/#typedef-cookiejar","title":"typedef CookieJar","text":"
typedef std::vector<Cookie> CookieJar;\n
"},{"location":"ltapi/_h_t_t_p_client_8h/#typedef-transporttraitsptr","title":"typedef TransportTraitsPtr","text":"
typedef std::unique_ptr<TransportTraits> TransportTraitsPtr;\n
"},{"location":"ltapi/_h_t_t_p_client_8h/#enum-followredirects_t","title":"enum followRedirects_t","text":"
enum followRedirects_t {\n    HTTPC_DISABLE_FOLLOW_REDIRECTS,\n    HTTPC_STRICT_FOLLOW_REDIRECTS,\n    HTTPC_FORCE_FOLLOW_REDIRECTS\n};\n

redirection follow mode. * HTTPC_DISABLE_FOLLOW_REDIRECTS - no redirection will be followed. * HTTPC_STRICT_FOLLOW_REDIRECTS - strict RFC2616, only requests using GET or HEAD methods will be redirected (using the same method), since the RFC requires end-user confirmation in other cases. * HTTPC_FORCE_FOLLOW_REDIRECTS - all redirections will be followed, regardless of a used method. New request will use the same method, and they will include the same body data and the same headers. In the sense of the RFC, it's just like every redirection is confirmed.

"},{"location":"ltapi/_h_t_t_p_client_8h/#enum-t_http_codes","title":"enum t_http_codes","text":"
enum t_http_codes {\n    HTTP_CODE_CONTINUE = 100,\n    HTTP_CODE_SWITCHING_PROTOCOLS = 101,\n    HTTP_CODE_PROCESSING = 102,\n    HTTP_CODE_OK = 200,\n    HTTP_CODE_CREATED = 201,\n    HTTP_CODE_ACCEPTED = 202,\n    HTTP_CODE_NON_AUTHORITATIVE_INFORMATION = 203,\n    HTTP_CODE_NO_CONTENT = 204,\n    HTTP_CODE_RESET_CONTENT = 205,\n    HTTP_CODE_PARTIAL_CONTENT = 206,\n    HTTP_CODE_MULTI_STATUS = 207,\n    HTTP_CODE_ALREADY_REPORTED = 208,\n    HTTP_CODE_IM_USED = 226,\n    HTTP_CODE_MULTIPLE_CHOICES = 300,\n    HTTP_CODE_MOVED_PERMANENTLY = 301,\n    HTTP_CODE_FOUND = 302,\n    HTTP_CODE_SEE_OTHER = 303,\n    HTTP_CODE_NOT_MODIFIED = 304,\n    HTTP_CODE_USE_PROXY = 305,\n    HTTP_CODE_TEMPORARY_REDIRECT = 307,\n    HTTP_CODE_PERMANENT_REDIRECT = 308,\n    HTTP_CODE_BAD_REQUEST = 400,\n    HTTP_CODE_UNAUTHORIZED = 401,\n    HTTP_CODE_PAYMENT_REQUIRED = 402,\n    HTTP_CODE_FORBIDDEN = 403,\n    HTTP_CODE_NOT_FOUND = 404,\n    HTTP_CODE_METHOD_NOT_ALLOWED = 405,\n    HTTP_CODE_NOT_ACCEPTABLE = 406,\n    HTTP_CODE_PROXY_AUTHENTICATION_REQUIRED = 407,\n    HTTP_CODE_REQUEST_TIMEOUT = 408,\n    HTTP_CODE_CONFLICT = 409,\n    HTTP_CODE_GONE = 410,\n    HTTP_CODE_LENGTH_REQUIRED = 411,\n    HTTP_CODE_PRECONDITION_FAILED = 412,\n    HTTP_CODE_PAYLOAD_TOO_LARGE = 413,\n    HTTP_CODE_URI_TOO_LONG = 414,\n    HTTP_CODE_UNSUPPORTED_MEDIA_TYPE = 415,\n    HTTP_CODE_RANGE_NOT_SATISFIABLE = 416,\n    HTTP_CODE_EXPECTATION_FAILED = 417,\n    HTTP_CODE_MISDIRECTED_REQUEST = 421,\n    HTTP_CODE_UNPROCESSABLE_ENTITY = 422,\n    HTTP_CODE_LOCKED = 423,\n    HTTP_CODE_FAILED_DEPENDENCY = 424,\n    HTTP_CODE_UPGRADE_REQUIRED = 426,\n    HTTP_CODE_PRECONDITION_REQUIRED = 428,\n    HTTP_CODE_TOO_MANY_REQUESTS = 429,\n    HTTP_CODE_REQUEST_HEADER_FIELDS_TOO_LARGE = 431,\n    HTTP_CODE_INTERNAL_SERVER_ERROR = 500,\n    HTTP_CODE_NOT_IMPLEMENTED = 501,\n    HTTP_CODE_BAD_GATEWAY = 502,\n    HTTP_CODE_SERVICE_UNAVAILABLE = 503,\n    HTTP_CODE_GATEWAY_TIMEOUT = 504,\n    HTTP_CODE_HTTP_VERSION_NOT_SUPPORTED = 505,\n    HTTP_CODE_VARIANT_ALSO_NEGOTIATES = 506,\n    HTTP_CODE_INSUFFICIENT_STORAGE = 507,\n    HTTP_CODE_LOOP_DETECTED = 508,\n    HTTP_CODE_NOT_EXTENDED = 510,\n    HTTP_CODE_NETWORK_AUTHENTICATION_REQUIRED = 511\n};\n
"},{"location":"ltapi/_h_t_t_p_client_8h/#enum-transferencoding_t","title":"enum transferEncoding_t","text":"
enum transferEncoding_t {\n    HTTPC_TE_IDENTITY,\n    HTTPC_TE_CHUNKED\n};\n
"},{"location":"ltapi/_h_t_t_p_client_8h/#macro-definition-documentation","title":"Macro Definition Documentation","text":""},{"location":"ltapi/_h_t_t_p_client_8h/#define-httpclient_1_1_compatible","title":"define HTTPCLIENT_1_1_COMPATIBLE","text":"
#define HTTPCLIENT_1_1_COMPATIBLE \n

HTTPClient.h

Created on: 02.11.2015

Copyright (c) 2015 Markus Sattler. All rights reserved. This file is part of the HTTPClient for Arduino. Port to ESP32 by Evandro Luis Copercini (2017), changed fingerprints to CA verification.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

"},{"location":"ltapi/_h_t_t_p_client_8h/#define-httpclient_default_tcp_timeout","title":"define HTTPCLIENT_DEFAULT_TCP_TIMEOUT","text":"
#define HTTPCLIENT_DEFAULT_TCP_TIMEOUT (5000)\n
"},{"location":"ltapi/_h_t_t_p_client_8h/#define-httpc_error_connection_lost","title":"define HTTPC_ERROR_CONNECTION_LOST","text":"
#define HTTPC_ERROR_CONNECTION_LOST (-5)\n
"},{"location":"ltapi/_h_t_t_p_client_8h/#define-httpc_error_connection_refused","title":"define HTTPC_ERROR_CONNECTION_REFUSED","text":"
#define HTTPC_ERROR_CONNECTION_REFUSED (-1)\n
"},{"location":"ltapi/_h_t_t_p_client_8h/#define-httpc_error_encoding","title":"define HTTPC_ERROR_ENCODING","text":"
#define HTTPC_ERROR_ENCODING (-9)\n
"},{"location":"ltapi/_h_t_t_p_client_8h/#define-httpc_error_not_connected","title":"define HTTPC_ERROR_NOT_CONNECTED","text":"
#define HTTPC_ERROR_NOT_CONNECTED (-4)\n
"},{"location":"ltapi/_h_t_t_p_client_8h/#define-httpc_error_no_http_server","title":"define HTTPC_ERROR_NO_HTTP_SERVER","text":"
#define HTTPC_ERROR_NO_HTTP_SERVER (-7)\n
"},{"location":"ltapi/_h_t_t_p_client_8h/#define-httpc_error_no_stream","title":"define HTTPC_ERROR_NO_STREAM","text":"
#define HTTPC_ERROR_NO_STREAM (-6)\n
"},{"location":"ltapi/_h_t_t_p_client_8h/#define-httpc_error_read_timeout","title":"define HTTPC_ERROR_READ_TIMEOUT","text":"
#define HTTPC_ERROR_READ_TIMEOUT (-11)\n
"},{"location":"ltapi/_h_t_t_p_client_8h/#define-httpc_error_send_header_failed","title":"define HTTPC_ERROR_SEND_HEADER_FAILED","text":"
#define HTTPC_ERROR_SEND_HEADER_FAILED (-2)\n
"},{"location":"ltapi/_h_t_t_p_client_8h/#define-httpc_error_send_payload_failed","title":"define HTTPC_ERROR_SEND_PAYLOAD_FAILED","text":"
#define HTTPC_ERROR_SEND_PAYLOAD_FAILED (-3)\n
"},{"location":"ltapi/_h_t_t_p_client_8h/#define-httpc_error_stream_write","title":"define HTTPC_ERROR_STREAM_WRITE","text":"
#define HTTPC_ERROR_STREAM_WRITE (-10)\n
"},{"location":"ltapi/_h_t_t_p_client_8h/#define-httpc_error_too_less_ram","title":"define HTTPC_ERROR_TOO_LESS_RAM","text":"
#define HTTPC_ERROR_TOO_LESS_RAM (-8)\n
"},{"location":"ltapi/_h_t_t_p_client_8h/#define-http_tcp_buffer_size","title":"define HTTP_TCP_BUFFER_SIZE","text":"
#define HTTP_TCP_BUFFER_SIZE (1460)\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/HTTPClient/HTTPClient.h

"},{"location":"ltapi/_h_t_t_p_client_8h_source/","title":"File HTTPClient.h","text":"

File List > arduino > libraries > ext > HTTPClient > HTTPClient.h

Go to the documentation of this file.

#ifndef HTTPClient_H_\n#define HTTPClient_H_\n\n#ifndef HTTPCLIENT_1_1_COMPATIBLE\n#define HTTPCLIENT_1_1_COMPATIBLE\n#endif\n\n#include <Arduino.h>\n#include <WiFiClient.h>\n#include <WiFiClientSecure.h>\n#include <memory>\n\n#include <vector>\n\n#define HTTPCLIENT_DEFAULT_TCP_TIMEOUT (5000)\n\n#define HTTPC_ERROR_CONNECTION_REFUSED  (-1)\n#define HTTPC_ERROR_SEND_HEADER_FAILED  (-2)\n#define HTTPC_ERROR_SEND_PAYLOAD_FAILED (-3)\n#define HTTPC_ERROR_NOT_CONNECTED       (-4)\n#define HTTPC_ERROR_CONNECTION_LOST     (-5)\n#define HTTPC_ERROR_NO_STREAM           (-6)\n#define HTTPC_ERROR_NO_HTTP_SERVER      (-7)\n#define HTTPC_ERROR_TOO_LESS_RAM        (-8)\n#define HTTPC_ERROR_ENCODING            (-9)\n#define HTTPC_ERROR_STREAM_WRITE        (-10)\n#define HTTPC_ERROR_READ_TIMEOUT        (-11)\n\n#define HTTP_TCP_BUFFER_SIZE (1460)\n\ntypedef enum {\n    HTTP_CODE_CONTINUE                        = 100,\n    HTTP_CODE_SWITCHING_PROTOCOLS             = 101,\n    HTTP_CODE_PROCESSING                      = 102,\n    HTTP_CODE_OK                              = 200,\n    HTTP_CODE_CREATED                         = 201,\n    HTTP_CODE_ACCEPTED                        = 202,\n    HTTP_CODE_NON_AUTHORITATIVE_INFORMATION   = 203,\n    HTTP_CODE_NO_CONTENT                      = 204,\n    HTTP_CODE_RESET_CONTENT                   = 205,\n    HTTP_CODE_PARTIAL_CONTENT                 = 206,\n    HTTP_CODE_MULTI_STATUS                    = 207,\n    HTTP_CODE_ALREADY_REPORTED                = 208,\n    HTTP_CODE_IM_USED                         = 226,\n    HTTP_CODE_MULTIPLE_CHOICES                = 300,\n    HTTP_CODE_MOVED_PERMANENTLY               = 301,\n    HTTP_CODE_FOUND                           = 302,\n    HTTP_CODE_SEE_OTHER                       = 303,\n    HTTP_CODE_NOT_MODIFIED                    = 304,\n    HTTP_CODE_USE_PROXY                       = 305,\n    HTTP_CODE_TEMPORARY_REDIRECT              = 307,\n    HTTP_CODE_PERMANENT_REDIRECT              = 308,\n    HTTP_CODE_BAD_REQUEST                     = 400,\n    HTTP_CODE_UNAUTHORIZED                    = 401,\n    HTTP_CODE_PAYMENT_REQUIRED                = 402,\n    HTTP_CODE_FORBIDDEN                       = 403,\n    HTTP_CODE_NOT_FOUND                       = 404,\n    HTTP_CODE_METHOD_NOT_ALLOWED              = 405,\n    HTTP_CODE_NOT_ACCEPTABLE                  = 406,\n    HTTP_CODE_PROXY_AUTHENTICATION_REQUIRED   = 407,\n    HTTP_CODE_REQUEST_TIMEOUT                 = 408,\n    HTTP_CODE_CONFLICT                        = 409,\n    HTTP_CODE_GONE                            = 410,\n    HTTP_CODE_LENGTH_REQUIRED                 = 411,\n    HTTP_CODE_PRECONDITION_FAILED             = 412,\n    HTTP_CODE_PAYLOAD_TOO_LARGE               = 413,\n    HTTP_CODE_URI_TOO_LONG                    = 414,\n    HTTP_CODE_UNSUPPORTED_MEDIA_TYPE          = 415,\n    HTTP_CODE_RANGE_NOT_SATISFIABLE           = 416,\n    HTTP_CODE_EXPECTATION_FAILED              = 417,\n    HTTP_CODE_MISDIRECTED_REQUEST             = 421,\n    HTTP_CODE_UNPROCESSABLE_ENTITY            = 422,\n    HTTP_CODE_LOCKED                          = 423,\n    HTTP_CODE_FAILED_DEPENDENCY               = 424,\n    HTTP_CODE_UPGRADE_REQUIRED                = 426,\n    HTTP_CODE_PRECONDITION_REQUIRED           = 428,\n    HTTP_CODE_TOO_MANY_REQUESTS               = 429,\n    HTTP_CODE_REQUEST_HEADER_FIELDS_TOO_LARGE = 431,\n    HTTP_CODE_INTERNAL_SERVER_ERROR           = 500,\n    HTTP_CODE_NOT_IMPLEMENTED                 = 501,\n    HTTP_CODE_BAD_GATEWAY                     = 502,\n    HTTP_CODE_SERVICE_UNAVAILABLE             = 503,\n    HTTP_CODE_GATEWAY_TIMEOUT                 = 504,\n    HTTP_CODE_HTTP_VERSION_NOT_SUPPORTED      = 505,\n    HTTP_CODE_VARIANT_ALSO_NEGOTIATES         = 506,\n    HTTP_CODE_INSUFFICIENT_STORAGE            = 507,\n    HTTP_CODE_LOOP_DETECTED                   = 508,\n    HTTP_CODE_NOT_EXTENDED                    = 510,\n    HTTP_CODE_NETWORK_AUTHENTICATION_REQUIRED = 511\n} t_http_codes;\n\ntypedef enum { HTTPC_TE_IDENTITY, HTTPC_TE_CHUNKED } transferEncoding_t;\n\ntypedef enum {\n    HTTPC_DISABLE_FOLLOW_REDIRECTS,\n    HTTPC_STRICT_FOLLOW_REDIRECTS,\n    HTTPC_FORCE_FOLLOW_REDIRECTS\n} followRedirects_t;\n\n#ifdef HTTPCLIENT_1_1_COMPATIBLE\nclass TransportTraits;\ntypedef std::unique_ptr<TransportTraits> TransportTraitsPtr;\n#endif\n\n// cookie jar support\ntypedef struct {\n    String host; // host which tries to set the cookie\n    time_t date; // timestamp of the response that set the cookie\n    String name;\n    String value;\n    String domain;\n    String path = \"\";\n\n    struct {\n        time_t date = 0;\n        bool valid  = false;\n    } expires;\n\n    struct {\n        time_t duration = 0;\n        bool valid      = false;\n    } max_age;\n\n    bool http_only = false;\n    bool secure    = false;\n} Cookie;\n\ntypedef std::vector<Cookie> CookieJar;\n\nclass HTTPClient {\n  public:\n    HTTPClient();\n    ~HTTPClient();\n\n    /*\n     * Since both begin() functions take a reference to client as a parameter, you need to\n     * ensure the client object lives the entire time of the HTTPClient\n     */\n    bool begin(WiFiClient &client, String url);\n    bool begin(WiFiClient &client, String host, uint16_t port, String uri = \"/\", bool https = false);\n\n#ifdef HTTPCLIENT_1_1_COMPATIBLE\n    bool begin(String url);\n    bool begin(String url, const char *CAcert);\n    bool begin(String host, uint16_t port, String uri = \"/\");\n    bool begin(String host, uint16_t port, String uri, const char *CAcert);\n    bool begin(String host, uint16_t port, String uri, const char *CAcert, const char *cli_cert, const char *cli_key);\n#endif\n\n    void end(void);\n\n    bool connected(void);\n\n    void setReuse(bool reuse); \n    void setUserAgent(const String &userAgent);\n    void setAuthorization(const char *user, const char *password);\n    void setAuthorization(const char *auth);\n    void setAuthorizationType(const char *authType);\n    void setConnectTimeout(int32_t connectTimeout);\n    void setTimeout(uint16_t timeout);\n\n    // Redirections\n    void setFollowRedirects(followRedirects_t follow);\n    void setRedirectLimit(uint16_t limit); // max redirects to follow for a single request\n\n    bool setURL(const String &url);\n    void useHTTP10(bool usehttp10 = true);\n\n    int GET();\n    int PATCH(uint8_t *payload, size_t size);\n    int PATCH(String payload);\n    int POST(uint8_t *payload, size_t size);\n    int POST(String payload);\n    int PUT(uint8_t *payload, size_t size);\n    int PUT(String payload);\n    int sendRequest(const char *type, String payload);\n    int sendRequest(const char *type, uint8_t *payload = NULL, size_t size = 0);\n    int sendRequest(const char *type, Stream *stream, size_t size = 0);\n\n    void addHeader(const String &name, const String &value, bool first = false, bool replace = true);\n\n    void collectHeaders(const char *headerKeys[], const size_t headerKeysCount);\n    String header(const char *name);  // get request header value by name\n    String header(size_t i);          // get request header value by number\n    String headerName(size_t i);      // get request header name by number\n    int headers();                    // get header count\n    bool hasHeader(const char *name); // check if header exists\n\n    int getSize(void);\n    const String &getLocation(void);\n\n    WiFiClient &getStream(void);\n    WiFiClient *getStreamPtr(void);\n    int writeToStream(Stream *stream);\n    // String getString(void);\n\n    static String errorToString(int error);\n\n    void setCookieJar(CookieJar *cookieJar);\n    void resetCookieJar();\n    void clearAllCookies();\n\n  protected:\n    struct RequestArgument {\n        String key;\n        String value;\n    };\n\n    bool beginInternal(String url, const char *expectedProtocol);\n    void disconnect(bool preserveClient = false);\n    void clear();\n    int returnError(int error);\n    bool connect(void);\n    bool sendHeader(const char *type);\n    int handleHeaderResponse();\n    int writeToStreamDataBlock(Stream *stream, int len);\n\n    void setCookie(String date, String headerValue);\n    bool generateCookieString(String *cookieString);\n\n#ifdef HTTPCLIENT_1_1_COMPATIBLE\n    TransportTraitsPtr _transportTraits;\n    std::unique_ptr<WiFiClient> _tcpDeprecated;\n#endif\n\n    WiFiClient *_client = nullptr;\n\n    String _host;\n    uint16_t _port          = 0;\n    int32_t _connectTimeout = -1;\n    bool _reuse             = true;\n    uint16_t _tcpTimeout    = HTTPCLIENT_DEFAULT_TCP_TIMEOUT;\n    bool _useHTTP10         = false;\n    bool _secure            = false;\n\n    String _uri;\n    String _protocol;\n    String _headers;\n    String _userAgent = \"ESP32HTTPClient\";\n    String _base64Authorization;\n    String _authorizationType = \"Basic\";\n\n    RequestArgument *_currentHeaders = nullptr;\n    size_t _headerKeysCount          = 0;\n\n    int _returnCode                    = 0;\n    int _size                          = -1;\n    bool _canReuse                     = false;\n    followRedirects_t _followRedirects = HTTPC_DISABLE_FOLLOW_REDIRECTS;\n    uint16_t _redirectLimit            = 10;\n    String _location;\n    transferEncoding_t _transferEncoding = HTTPC_TE_IDENTITY;\n\n    CookieJar *_cookieJar = nullptr;\n};\n\n#endif /* HTTPClient_H_ */\n
"},{"location":"ltapi/dir_0a3ac6ff289d4ebfcd0c797d13f9a373/","title":"Dir cores/common/arduino/libraries/ext/StreamString","text":"

FileList > arduino > libraries > ext > StreamString

"},{"location":"ltapi/dir_0a3ac6ff289d4ebfcd0c797d13f9a373/#files","title":"Files","text":"Type Name file StreamString.cpp file StreamString.h

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/StreamString/

"},{"location":"ltapi/_stream_string_8cpp/","title":"File StreamString.cpp","text":"

FileList > arduino > libraries > ext > StreamString > StreamString.cpp

Go to the source code of this file.

  • #include <Arduino.h>
  • #include \"StreamString.h\"

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/StreamString/StreamString.cpp

"},{"location":"ltapi/_stream_string_8cpp_source/","title":"File StreamString.cpp","text":"

File List > arduino > libraries > ext > StreamString > StreamString.cpp

Go to the documentation of this file.

#include <Arduino.h>\n#include \"StreamString.h\"\n\nsize_t StreamString::write(const uint8_t *data, size_t size) {\n    if(size && data) {\n        concat(data, size);\n        return size;\n    }\n    return 0;\n}\n\nsize_t StreamString::write(uint8_t data) {\n    return concat((char) data);\n}\n\nint StreamString::available() {\n    return length();\n}\n\nint StreamString::read() {\n    if(length()) {\n        char c = charAt(0);\n        remove(0, 1);\n        return c;\n\n    }\n    return -1;\n}\n\nint StreamString::peek() {\n    if(length()) {\n        char c = charAt(0);\n        return c;\n    }\n    return -1;\n}\n\nvoid StreamString::flush() {\n}\n
"},{"location":"ltapi/_stream_string_8h/","title":"File StreamString.h","text":"

FileList > arduino > libraries > ext > StreamString > StreamString.h

Go to the source code of this file.

"},{"location":"ltapi/_stream_string_8h/#classes","title":"Classes","text":"Type Name class StreamString

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/StreamString/StreamString.h

"},{"location":"ltapi/_stream_string_8h_source/","title":"File StreamString.h","text":"

File List > arduino > libraries > ext > StreamString > StreamString.h

Go to the documentation of this file.

#ifndef STREAMSTRING_H_\n#define STREAMSTRING_H_\n\n\nclass StreamString: public Stream, public String\n{\npublic:\n    size_t write(const uint8_t *buffer, size_t size) override;\n    size_t write(uint8_t data) override;\n\n    int available() override;\n    int read() override;\n    int peek() override;\n    void flush() override;\n};\n\n\n#endif /* STREAMSTRING_H_ */\n
"},{"location":"ltapi/dir_f2f13d16dd1b4421bdcca863af8fd41a/","title":"Dir cores/common/arduino/libraries/ext/WebServer","text":"

FileList > arduino > libraries > ext > WebServer

"},{"location":"ltapi/dir_f2f13d16dd1b4421bdcca863af8fd41a/#files","title":"Files","text":"Type Name file HTTP_Method.h file Parsing.cpp file Uri.h file WebServer.cpp file WebServer.h"},{"location":"ltapi/dir_f2f13d16dd1b4421bdcca863af8fd41a/#directories","title":"Directories","text":"Type Name dir detail dir uri

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/

"},{"location":"ltapi/_h_t_t_p___method_8h/","title":"File HTTP_Method.h","text":"

FileList > arduino > libraries > ext > WebServer > HTTP_Method.h

Go to the source code of this file.

"},{"location":"ltapi/_h_t_t_p___method_8h/#public-types","title":"Public Types","text":"Type Name typedef enum http_method HTTPMethod enum http_method"},{"location":"ltapi/_h_t_t_p___method_8h/#macros","title":"Macros","text":"Type Name define HTTP_ANY (HTTPMethod)(255) define HTTP_METHOD_MAP (XX) define XX (num, name, string) HTTP_##name = num,"},{"location":"ltapi/_h_t_t_p___method_8h/#public-types-documentation","title":"Public Types Documentation","text":""},{"location":"ltapi/_h_t_t_p___method_8h/#typedef-httpmethod","title":"typedef HTTPMethod","text":"
typedef enum http_method HTTPMethod;\n
"},{"location":"ltapi/_h_t_t_p___method_8h/#enum-http_method","title":"enum http_method","text":"
enum http_method;\n
"},{"location":"ltapi/_h_t_t_p___method_8h/#macro-definition-documentation","title":"Macro Definition Documentation","text":""},{"location":"ltapi/_h_t_t_p___method_8h/#define-http_any","title":"define HTTP_ANY","text":"
#define HTTP_ANY (HTTPMethod)(255)\n
"},{"location":"ltapi/_h_t_t_p___method_8h/#define-http_method_map","title":"define HTTP_METHOD_MAP","text":"
#define HTTP_METHOD_MAP (\n    XX\n) \n
"},{"location":"ltapi/_h_t_t_p___method_8h/#define-xx","title":"define XX","text":"
#define XX (\n    num,\n    name,\n    string\n) HTTP_##name = num,\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/HTTP_Method.h

"},{"location":"ltapi/_h_t_t_p___method_8h_source/","title":"File HTTP_Method.h","text":"

File List > arduino > libraries > ext > WebServer > HTTP_Method.h

Go to the documentation of this file.

#pragma once\n\n/* Request Methods */\n#define HTTP_METHOD_MAP(XX)                                                                                            \\\n    XX(0, DELETE, DELETE)                                                                                              \\\n    XX(1, GET, GET)                                                                                                    \\\n    XX(2, HEAD, HEAD)                                                                                                  \\\n    XX(3, POST, POST)                                                                                                  \\\n    XX(4, PUT, PUT)                                                                                                    \\\n    /* pathological */                                                                                                 \\\n    XX(5, CONNECT, CONNECT)                                                                                            \\\n    XX(6, OPTIONS, OPTIONS)                                                                                            \\\n    XX(7, TRACE, TRACE)                                                                                                \\\n    /* WebDAV */                                                                                                       \\\n    XX(8, COPY, COPY)                                                                                                  \\\n    XX(9, LOCK, LOCK)                                                                                                  \\\n    XX(10, MKCOL, MKCOL)                                                                                               \\\n    XX(11, MOVE, MOVE)                                                                                                 \\\n    XX(12, PROPFIND, PROPFIND)                                                                                         \\\n    XX(13, PROPPATCH, PROPPATCH)                                                                                       \\\n    XX(14, SEARCH, SEARCH)                                                                                             \\\n    XX(15, UNLOCK, UNLOCK)                                                                                             \\\n    XX(16, BIND, BIND)                                                                                                 \\\n    XX(17, REBIND, REBIND)                                                                                             \\\n    XX(18, UNBIND, UNBIND)                                                                                             \\\n    XX(19, ACL, ACL)                                                                                                   \\\n    /* subversion */                                                                                                   \\\n    XX(20, REPORT, REPORT)                                                                                             \\\n    XX(21, MKACTIVITY, MKACTIVITY)                                                                                     \\\n    XX(22, CHECKOUT, CHECKOUT)                                                                                         \\\n    XX(23, MERGE, MERGE)                                                                                               \\\n    /* upnp */                                                                                                         \\\n    XX(24, MSEARCH, M - SEARCH)                                                                                        \\\n    XX(25, NOTIFY, NOTIFY)                                                                                             \\\n    XX(26, SUBSCRIBE, SUBSCRIBE)                                                                                       \\\n    XX(27, UNSUBSCRIBE, UNSUBSCRIBE)                                                                                   \\\n    /* RFC-5789 */                                                                                                     \\\n    XX(28, PATCH, PATCH)                                                                                               \\\n    XX(29, PURGE, PURGE)                                                                                               \\\n    /* CalDAV */                                                                                                       \\\n    XX(30, MKCALENDAR, MKCALENDAR)                                                                                     \\\n    /* RFC-2068, section 19.6.1.2 */                                                                                   \\\n    XX(31, LINK, LINK)                                                                                                 \\\n    XX(32, UNLINK, UNLINK)                                                                                             \\\n    /* icecast */                                                                                                      \\\n    XX(33, SOURCE, SOURCE)\n\nenum http_method {\n\n#define XX(num, name, string) HTTP_##name = num,\n    HTTP_METHOD_MAP(XX)\n#undef XX\n};\n\ntypedef enum http_method HTTPMethod;\n#define HTTP_ANY (HTTPMethod)(255)\n
"},{"location":"ltapi/_parsing_8cpp/","title":"File Parsing.cpp","text":"

FileList > arduino > libraries > ext > WebServer > Parsing.cpp

Go to the source code of this file.

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/Parsing.cpp

"},{"location":"ltapi/_parsing_8cpp_source/","title":"File Parsing.cpp","text":"

File List > arduino > libraries > ext > WebServer > Parsing.cpp

Go to the documentation of this file.

/*\n  Parsing.cpp - HTTP request parsing.\n\n  Copyright (c) 2015 Ivan Grokhotkov. All rights reserved.\n\n  This library is free software; you can redistribute it and/or\n  modify it under the terms of the GNU Lesser General Public\n  License as published by the Free Software Foundation; either\n  version 2.1 of the License, or (at your option) any later version.\n\n  This library is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n  Lesser General Public License for more details.\n\n  You should have received a copy of the GNU Lesser General Public\n  License along with this library; if not, write to the Free Software\n  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n  Modified 8 May 2015 by Hristo Gochkov (proper post and file upload handling)\n*/\n\n#if LT_ARD_HAS_WIFI\n\n#include <Arduino.h>\n\n#include \"WebServer.h\"\n#include \"WiFiClient.h\"\n#include \"WiFiServer.h\"\n#include \"detail/mimetable.h\"\n\n#ifndef WEBSERVER_MAX_POST_ARGS\n#define WEBSERVER_MAX_POST_ARGS 32\n#endif\n\n#define __STR(a) #a\n#define _STR(a)  __STR(a)\nconst char *_http_method_str[] = {\n#define XX(num, name, string) _STR(name),\n    HTTP_METHOD_MAP(XX)\n#undef XX\n};\n\nstatic const char Content_Type[] PROGMEM = \"Content-Type\";\nstatic const char filename[] PROGMEM     = \"filename\";\n\nstatic char *readBytesWithTimeout(WiFiClient &client, size_t maxLength, size_t &dataLength, int timeout_ms) {\n    char *buf  = nullptr;\n    dataLength = 0;\n    while (dataLength < maxLength) {\n        int tries = timeout_ms;\n        size_t newLength;\n        while (!(newLength = client.available()) && tries--)\n            delay(1);\n        if (!newLength) {\n            break;\n        }\n        if (!buf) {\n            buf = (char *)malloc(newLength + 1);\n            if (!buf) {\n                return nullptr;\n            }\n        } else {\n            char *newBuf = (char *)realloc(buf, dataLength + newLength + 1);\n            if (!newBuf) {\n                free(buf);\n                return nullptr;\n            }\n            buf = newBuf;\n        }\n        client.readBytes(buf + dataLength, newLength);\n        dataLength += newLength;\n        buf[dataLength] = '\\0';\n    }\n    return buf;\n}\n\nbool WebServer::_parseRequest(WiFiClient &client) {\n    // Read the first line of HTTP request\n    String req = client.readStringUntil('\\r');\n    client.readStringUntil('\\n');\n    // reset header value\n    for (int i = 0; i < _headerKeysCount; ++i) {\n        _currentHeaders[i].value = String();\n    }\n\n    // First line of HTTP request looks like \"GET /path HTTP/1.1\"\n    // Retrieve the \"/path\" part by finding the spaces\n    int addr_start = req.indexOf(' ');\n    int addr_end   = req.indexOf(' ', addr_start + 1);\n    if (addr_start == -1 || addr_end == -1) {\n        log_e(\"Invalid request: %s\", req.c_str());\n        return false;\n    }\n\n    String methodStr  = req.substring(0, addr_start);\n    String url        = req.substring(addr_start + 1, addr_end);\n    String versionEnd = req.substring(addr_end + 8);\n    _currentVersion   = atoi(versionEnd.c_str());\n    String searchStr  = \"\";\n    int hasSearch     = url.indexOf('?');\n    if (hasSearch != -1) {\n        searchStr = url.substring(hasSearch + 1);\n        url       = url.substring(0, hasSearch);\n    }\n    _currentUri = url;\n    _chunked    = false;\n\n    HTTPMethod method  = HTTP_ANY;\n    size_t num_methods = sizeof(_http_method_str) / sizeof(const char *);\n    for (size_t i = 0; i < num_methods; i++) {\n        if (methodStr == _http_method_str[i]) {\n            method = (HTTPMethod)i;\n            break;\n        }\n    }\n    if (method == HTTP_ANY) {\n        log_e(\"Unknown HTTP Method: %s\", methodStr.c_str());\n        return false;\n    }\n    _currentMethod = method;\n\n    log_v(\"method: %s url: %s search: %s\", methodStr.c_str(), url.c_str(), searchStr.c_str());\n\n    // attach handler\n    RequestHandler *handler;\n    for (handler = _firstHandler; handler; handler = handler->next()) {\n        if (handler->canHandle(_currentMethod, _currentUri))\n            break;\n    }\n    _currentHandler = handler;\n\n    String formData;\n    // below is needed only when POST type request\n    if (method == HTTP_POST || method == HTTP_PUT || method == HTTP_PATCH || method == HTTP_DELETE) {\n        String boundaryStr;\n        String headerName;\n        String headerValue;\n        bool isForm            = false;\n        bool isEncoded         = false;\n        uint32_t contentLength = 0;\n        // parse headers\n        while (1) {\n            req = client.readStringUntil('\\r');\n            client.readStringUntil('\\n');\n            if (req == \"\")\n                break; // no moar headers\n            int headerDiv = req.indexOf(':');\n            if (headerDiv == -1) {\n                break;\n            }\n            headerName  = req.substring(0, headerDiv);\n            headerValue = req.substring(headerDiv + 1);\n            headerValue.trim();\n            _collectHeader(headerName.c_str(), headerValue.c_str());\n\n            log_v(\"headerName: %s\", headerName.c_str());\n            log_v(\"headerValue: %s\", headerValue.c_str());\n\n            if (headerName.equalsIgnoreCase(FPSTR(Content_Type))) {\n                using namespace mime;\n                if (headerValue.startsWith(FPSTR(mimeTable[txt].mimeType))) {\n                    isForm = false;\n                } else if (headerValue.startsWith(F(\"application/x-www-form-urlencoded\"))) {\n                    isForm    = false;\n                    isEncoded = true;\n                } else if (headerValue.startsWith(F(\"multipart/\"))) {\n                    boundaryStr = headerValue.substring(headerValue.indexOf('=') + 1);\n                    boundaryStr.replace(\"\\\"\", \"\");\n                    isForm = true;\n                }\n            } else if (headerName.equalsIgnoreCase(F(\"Content-Length\"))) {\n                contentLength = headerValue.toInt();\n            } else if (headerName.equalsIgnoreCase(F(\"Host\"))) {\n                _hostHeader = headerValue;\n            }\n        }\n\n        if (!isForm) {\n            size_t plainLength;\n            char *plainBuf = readBytesWithTimeout(client, contentLength, plainLength, HTTP_MAX_POST_WAIT);\n            if (plainLength < contentLength) {\n                free(plainBuf);\n                return false;\n            }\n            if (contentLength > 0) {\n                if (isEncoded) {\n                    // url encoded form\n                    if (searchStr != \"\")\n                        searchStr += '&';\n                    searchStr += plainBuf;\n                }\n                _parseArguments(searchStr);\n                if (!isEncoded) {\n                    // plain post json or other data\n                    RequestArgument &arg = _currentArgs[_currentArgCount++];\n                    arg.key              = F(\"plain\");\n                    arg.value            = String(plainBuf);\n                }\n\n                log_v(\"Plain: %s\", plainBuf);\n                free(plainBuf);\n            } else {\n                // No content - but we can still have arguments in the URL.\n                _parseArguments(searchStr);\n            }\n        }\n\n        if (isForm) {\n            _parseArguments(searchStr);\n            if (!_parseForm(client, boundaryStr, contentLength)) {\n                return false;\n            }\n        }\n    } else {\n        String headerName;\n        String headerValue;\n        // parse headers\n        while (1) {\n            req = client.readStringUntil('\\r');\n            client.readStringUntil('\\n');\n            if (req == \"\")\n                break; // no moar headers\n            int headerDiv = req.indexOf(':');\n            if (headerDiv == -1) {\n                break;\n            }\n            headerName  = req.substring(0, headerDiv);\n            headerValue = req.substring(headerDiv + 2);\n            _collectHeader(headerName.c_str(), headerValue.c_str());\n\n            log_v(\"headerName: %s\", headerName.c_str());\n            log_v(\"headerValue: %s\", headerValue.c_str());\n\n            if (headerName.equalsIgnoreCase(\"Host\")) {\n                _hostHeader = headerValue;\n            }\n        }\n        _parseArguments(searchStr);\n    }\n    client.flush();\n\n    log_v(\"Request: %s\", url.c_str());\n    log_v(\" Arguments: %s\", searchStr.c_str());\n\n    return true;\n}\n\nbool WebServer::_collectHeader(const char *headerName, const char *headerValue) {\n    for (int i = 0; i < _headerKeysCount; i++) {\n        if (_currentHeaders[i].key.equalsIgnoreCase(headerName)) {\n            _currentHeaders[i].value = headerValue;\n            return true;\n        }\n    }\n    return false;\n}\n\nvoid WebServer::_parseArguments(String data) {\n    log_v(\"args: %s\", data.c_str());\n    if (_currentArgs)\n        delete[] _currentArgs;\n    _currentArgs = 0;\n    if (data.length() == 0) {\n        _currentArgCount = 0;\n        _currentArgs     = new RequestArgument[1];\n        return;\n    }\n    _currentArgCount = 1;\n\n    for (int i = 0; i < (int)data.length();) {\n        i = data.indexOf('&', i);\n        if (i == -1)\n            break;\n        ++i;\n        ++_currentArgCount;\n    }\n    log_v(\"args count: %d\", _currentArgCount);\n\n    _currentArgs = new RequestArgument[_currentArgCount + 1];\n    int pos      = 0;\n    int iarg;\n    for (iarg = 0; iarg < _currentArgCount;) {\n        int equal_sign_index = data.indexOf('=', pos);\n        int next_arg_index   = data.indexOf('&', pos);\n        log_v(\"pos %d =@%d &@%d\", pos, equal_sign_index, next_arg_index);\n        if ((equal_sign_index == -1) || ((equal_sign_index > next_arg_index) && (next_arg_index != -1))) {\n            log_e(\"arg missing value: %d\", iarg);\n            if (next_arg_index == -1)\n                break;\n            pos = next_arg_index + 1;\n            continue;\n        }\n        RequestArgument &arg = _currentArgs[iarg];\n        arg.key              = urlDecode(data.substring(pos, equal_sign_index));\n        arg.value            = urlDecode(data.substring(equal_sign_index + 1, next_arg_index));\n        log_v(\"arg %d key: %s value: %s\", iarg, arg.key.c_str(), arg.value.c_str());\n        ++iarg;\n        if (next_arg_index == -1)\n            break;\n        pos = next_arg_index + 1;\n    }\n    _currentArgCount = iarg;\n    log_v(\"args count: %d\", _currentArgCount);\n}\n\nvoid WebServer::_uploadWriteByte(uint8_t b) {\n    if (_currentUpload->currentSize == HTTP_UPLOAD_BUFLEN) {\n        if (_currentHandler && _currentHandler->canUpload(_currentUri))\n            _currentHandler->upload(*this, _currentUri, *_currentUpload);\n        _currentUpload->totalSize += _currentUpload->currentSize;\n        _currentUpload->currentSize = 0;\n    }\n    _currentUpload->buf[_currentUpload->currentSize++] = b;\n}\n\nint WebServer::_uploadReadByte(WiFiClient &client) {\n    int res = client.read();\n    if (res < 0) {\n        // keep trying until you either read a valid byte or timeout\n        unsigned long startMillis  = millis();\n        long timeoutIntervalMillis = client.getTimeout();\n        boolean timedOut           = false;\n        for (;;) {\n            if (!client.connected())\n                return -1;\n            // loosely modeled after blinkWithoutDelay pattern\n            while (!timedOut && !client.available() && client.connected()) {\n                delay(2);\n                timedOut = millis() - startMillis >= timeoutIntervalMillis;\n            }\n\n            res = client.read();\n            if (res >= 0) {\n                return res; // exit on a valid read\n            }\n            // NOTE: it is possible to get here and have all of the following\n            //       assertions hold true\n            //\n            //       -- client.available() > 0\n            //       -- client.connected == true\n            //       -- res == -1\n            //\n            //       a simple retry strategy overcomes this which is to say the\n            //       assertion is not permanent, but the reason that this works\n            //       is elusive, and possibly indicative of a more subtle underlying\n            //       issue\n\n            timedOut = millis() - startMillis >= timeoutIntervalMillis;\n            if (timedOut) {\n                return res; // exit on a timeout\n            }\n        }\n    }\n\n    return res;\n}\n\nbool WebServer::_parseForm(WiFiClient &client, String boundary, uint32_t len) {\n    (void)len;\n    log_v(\"Parse Form: Boundary: %s Length: %d\", boundary.c_str(), len);\n    String line;\n    int retry = 0;\n    do {\n        line = client.readStringUntil('\\r');\n        ++retry;\n    } while (line.length() == 0 && retry < 3);\n\n    client.readStringUntil('\\n');\n    // start reading the form\n    if (line == (\"--\" + boundary)) {\n        if (_postArgs)\n            delete[] _postArgs;\n        _postArgs    = new RequestArgument[WEBSERVER_MAX_POST_ARGS];\n        _postArgsLen = 0;\n        while (1) {\n            String argName;\n            String argValue;\n            String argType;\n            String argFilename;\n            bool argIsFile = false;\n\n            line = client.readStringUntil('\\r');\n            client.readStringUntil('\\n');\n            if (line.length() > 19 && line.substring(0, 19).equalsIgnoreCase(F(\"Content-Disposition\"))) {\n                int nameStart = line.indexOf('=');\n                if (nameStart != -1) {\n                    argName   = line.substring(nameStart + 2);\n                    nameStart = argName.indexOf('=');\n                    if (nameStart == -1) {\n                        argName = argName.substring(0, argName.length() - 1);\n                    } else {\n                        argFilename = argName.substring(nameStart + 2, argName.length() - 1);\n                        argName     = argName.substring(0, argName.indexOf('\"'));\n                        argIsFile   = true;\n                        log_v(\"PostArg FileName: %s\", argFilename.c_str());\n                        // use GET to set the filename if uploading using blob\n                        if (argFilename == F(\"blob\") && hasArg(FPSTR(filename)))\n                            argFilename = arg(FPSTR(filename));\n                    }\n                    log_v(\"PostArg Name: %s\", argName.c_str());\n                    using namespace mime;\n                    argType = FPSTR(mimeTable[txt].mimeType);\n                    line    = client.readStringUntil('\\r');\n                    client.readStringUntil('\\n');\n                    if (line.length() > 12 && line.substring(0, 12).equalsIgnoreCase(FPSTR(Content_Type))) {\n                        argType = line.substring(line.indexOf(':') + 2);\n                        // skip next line\n                        client.readStringUntil('\\r');\n                        client.readStringUntil('\\n');\n                    }\n                    log_v(\"PostArg Type: %s\", argType.c_str());\n                    if (!argIsFile) {\n                        while (1) {\n                            line = client.readStringUntil('\\r');\n                            client.readStringUntil('\\n');\n                            if (line.startsWith(\"--\" + boundary))\n                                break;\n                            if (argValue.length() > 0)\n                                argValue += \"\\n\";\n                            argValue += line;\n                        }\n                        log_v(\"PostArg Value: %s\", argValue.c_str());\n\n                        RequestArgument &arg = _postArgs[_postArgsLen++];\n                        arg.key              = argName;\n                        arg.value            = argValue;\n\n                        if (line == (\"--\" + boundary + \"--\")) {\n                            log_v(\"Done Parsing POST\");\n                            break;\n                        } else if (_postArgsLen >= WEBSERVER_MAX_POST_ARGS) {\n                            log_e(\"Too many PostArgs (max: %d) in request.\", WEBSERVER_MAX_POST_ARGS);\n                            return false;\n                        }\n                    } else {\n                        _currentUpload.reset(new HTTPUpload());\n                        _currentUpload->status      = UPLOAD_FILE_START;\n                        _currentUpload->name        = argName;\n                        _currentUpload->filename    = argFilename;\n                        _currentUpload->type        = argType;\n                        _currentUpload->totalSize   = 0;\n                        _currentUpload->currentSize = 0;\n                        log_v(\n                            \"Start File: %s Type: %s\",\n                            _currentUpload->filename.c_str(),\n                            _currentUpload->type.c_str()\n                        );\n                        if (_currentHandler && _currentHandler->canUpload(_currentUri))\n                            _currentHandler->upload(*this, _currentUri, *_currentUpload);\n                        _currentUpload->status = UPLOAD_FILE_WRITE;\n                        int argByte            = _uploadReadByte(client);\n                    readfile:\n\n                        while (argByte != 0x0D) {\n                            if (argByte < 0)\n                                return _parseFormUploadAborted();\n                            _uploadWriteByte(argByte);\n                            argByte = _uploadReadByte(client);\n                        }\n\n                        argByte = _uploadReadByte(client);\n                        if (argByte < 0)\n                            return _parseFormUploadAborted();\n                        if (argByte == 0x0A) {\n                            argByte = _uploadReadByte(client);\n                            if (argByte < 0)\n                                return _parseFormUploadAborted();\n                            if ((char)argByte != '-') {\n                                // continue reading the file\n                                _uploadWriteByte(0x0D);\n                                _uploadWriteByte(0x0A);\n                                goto readfile;\n                            } else {\n                                argByte = _uploadReadByte(client);\n                                if (argByte < 0)\n                                    return _parseFormUploadAborted();\n                                if ((char)argByte != '-') {\n                                    // continue reading the file\n                                    _uploadWriteByte(0x0D);\n                                    _uploadWriteByte(0x0A);\n                                    _uploadWriteByte((uint8_t)('-'));\n                                    goto readfile;\n                                }\n                            }\n\n                            uint8_t endBuf[boundary.length()];\n                            uint32_t i = 0;\n                            while (i < boundary.length()) {\n                                argByte = _uploadReadByte(client);\n                                if (argByte < 0)\n                                    return _parseFormUploadAborted();\n                                if ((char)argByte == 0x0D) {\n                                    _uploadWriteByte(0x0D);\n                                    _uploadWriteByte(0x0A);\n                                    _uploadWriteByte((uint8_t)('-'));\n                                    _uploadWriteByte((uint8_t)('-'));\n                                    uint32_t j = 0;\n                                    while (j < i) {\n                                        _uploadWriteByte(endBuf[j++]);\n                                    }\n                                    goto readfile;\n                                }\n                                endBuf[i++] = (uint8_t)argByte;\n                            }\n\n                            if (strstr((const char *)endBuf, boundary.c_str()) != NULL) {\n                                if (_currentHandler && _currentHandler->canUpload(_currentUri))\n                                    _currentHandler->upload(*this, _currentUri, *_currentUpload);\n                                _currentUpload->totalSize += _currentUpload->currentSize;\n                                _currentUpload->status = UPLOAD_FILE_END;\n                                if (_currentHandler && _currentHandler->canUpload(_currentUri))\n                                    _currentHandler->upload(*this, _currentUri, *_currentUpload);\n                                log_v(\n                                    \"End File: %s Type: %s Size: %d\",\n                                    _currentUpload->filename.c_str(),\n                                    _currentUpload->type.c_str(),\n                                    _currentUpload->totalSize\n                                );\n                                line = client.readStringUntil(0x0D);\n                                client.readStringUntil(0x0A);\n                                if (line == \"--\") {\n                                    log_v(\"Done Parsing POST\");\n                                    break;\n                                }\n                                continue;\n                            } else {\n                                _uploadWriteByte(0x0D);\n                                _uploadWriteByte(0x0A);\n                                _uploadWriteByte((uint8_t)('-'));\n                                _uploadWriteByte((uint8_t)('-'));\n                                uint32_t i = 0;\n                                while (i < boundary.length()) {\n                                    _uploadWriteByte(endBuf[i++]);\n                                }\n                                argByte = _uploadReadByte(client);\n                                goto readfile;\n                            }\n                        } else {\n                            _uploadWriteByte(0x0D);\n                            goto readfile;\n                        }\n                        break;\n                    }\n                }\n            }\n        }\n\n        int iarg;\n        int totalArgs = ((WEBSERVER_MAX_POST_ARGS - _postArgsLen) < _currentArgCount)\n                            ? (WEBSERVER_MAX_POST_ARGS - _postArgsLen)\n                            : _currentArgCount;\n        for (iarg = 0; iarg < totalArgs; iarg++) {\n            RequestArgument &arg = _postArgs[_postArgsLen++];\n            arg.key              = _currentArgs[iarg].key;\n            arg.value            = _currentArgs[iarg].value;\n        }\n        if (_currentArgs)\n            delete[] _currentArgs;\n        _currentArgs = new RequestArgument[_postArgsLen];\n        for (iarg = 0; iarg < _postArgsLen; iarg++) {\n            RequestArgument &arg = _currentArgs[iarg];\n            arg.key              = _postArgs[iarg].key;\n            arg.value            = _postArgs[iarg].value;\n        }\n        _currentArgCount = iarg;\n        if (_postArgs) {\n            delete[] _postArgs;\n            _postArgs    = nullptr;\n            _postArgsLen = 0;\n        }\n        return true;\n    }\n    log_e(\"Error: line: %s\", line.c_str());\n    return false;\n}\n\nString WebServer::urlDecode(const String &text) {\n    String decoded   = \"\";\n    char temp[]      = \"0x00\";\n    unsigned int len = text.length();\n    unsigned int i   = 0;\n    while (i < len) {\n        char decodedChar;\n        char encodedChar = text.charAt(i++);\n        if ((encodedChar == '%') && (i + 1 < len)) {\n            temp[2] = text.charAt(i++);\n            temp[3] = text.charAt(i++);\n\n            decodedChar = strtol(temp, NULL, 16);\n        } else {\n            if (encodedChar == '+') {\n                decodedChar = ' ';\n            } else {\n                decodedChar = encodedChar; // normal ascii char\n            }\n        }\n        decoded += decodedChar;\n    }\n    return decoded;\n}\n\nbool WebServer::_parseFormUploadAborted() {\n    _currentUpload->status = UPLOAD_FILE_ABORTED;\n    if (_currentHandler && _currentHandler->canUpload(_currentUri))\n        _currentHandler->upload(*this, _currentUri, *_currentUpload);\n    return false;\n}\n\n#endif // LT_ARD_HAS_WIFI\n
"},{"location":"ltapi/_uri_8h/","title":"File Uri.h","text":"

FileList > arduino > libraries > ext > WebServer > Uri.h

Go to the source code of this file.

  • #include <Arduino.h>
  • #include <vector>
"},{"location":"ltapi/_uri_8h/#classes","title":"Classes","text":"Type Name class Uri

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/Uri.h

"},{"location":"ltapi/_uri_8h_source/","title":"File Uri.h","text":"

File List > arduino > libraries > ext > WebServer > Uri.h

Go to the documentation of this file.

#pragma once\n\n#include <Arduino.h>\n#include <vector>\n\nclass Uri {\n\n  protected:\n    const String _uri;\n\n  public:\n    Uri(const char *uri) : _uri(uri) {}\n\n    Uri(const String &uri) : _uri(uri) {}\n\n    Uri(const __FlashStringHelper *uri) : _uri(String(uri)) {}\n\n    virtual ~Uri() {}\n\n    virtual Uri *clone() const {\n        return new Uri(_uri);\n    };\n\n    virtual void initPathArgs(__attribute__((unused)) std::vector<String> &pathArgs) {}\n\n    virtual bool canHandle(const String &requestUri, __attribute__((unused)) std::vector<String> &pathArgs) {\n        return _uri == requestUri;\n    }\n};\n
"},{"location":"ltapi/_web_server_8cpp/","title":"File WebServer.cpp","text":"

FileList > arduino > libraries > ext > WebServer > WebServer.cpp

Go to the source code of this file.

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/WebServer.cpp

"},{"location":"ltapi/_web_server_8cpp_source/","title":"File WebServer.cpp","text":"

File List > arduino > libraries > ext > WebServer > WebServer.cpp

Go to the documentation of this file.

/*\n  WebServer.cpp - Dead simple web-server.\n  Supports only one simultaneous client, knows how to handle GET and POST.\n\n  Copyright (c) 2014 Ivan Grokhotkov. All rights reserved.\n\n  This library is free software; you can redistribute it and/or\n  modify it under the terms of the GNU Lesser General Public\n  License as published by the Free Software Foundation; either\n  version 2.1 of the License, or (at your option) any later version.\n\n  This library is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n  Lesser General Public License for more details.\n\n  You should have received a copy of the GNU Lesser General Public\n  License along with this library; if not, write to the Free Software\n  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n  Modified 8 May 2015 by Hristo Gochkov (proper post and file upload handling)\n*/\n\n#if LT_ARD_HAS_WIFI\n\n#include <Arduino.h>\n\n#include \"FS.h\"\n#include \"WebServer.h\"\n#include \"WiFiClient.h\"\n#include \"WiFiServer.h\"\n#include \"detail/RequestHandlersImpl.h\"\n// #include \"mbedtls/md5.h\"\n#include <libb64/cencode.h>\n\nstatic const char AUTHORIZATION_HEADER[]    = \"Authorization\";\nstatic const char qop_auth[] PROGMEM        = \"qop=auth\";\nstatic const char qop_auth_quoted[] PROGMEM = \"qop=\\\"auth\\\"\";\nstatic const char WWW_Authenticate[]        = \"WWW-Authenticate\";\nstatic const char Content_Length[]          = \"Content-Length\";\n\nWebServer::WebServer(IPAddress addr, int port)\n    : _corsEnabled(false), _server(addr, port), _currentMethod(HTTP_ANY), _currentVersion(0), _currentStatus(HC_NONE),\n      _statusChange(0), _nullDelay(true), _currentHandler(nullptr), _firstHandler(nullptr), _lastHandler(nullptr),\n      _currentArgCount(0), _currentArgs(nullptr), _postArgsLen(0), _postArgs(nullptr), _headerKeysCount(0),\n      _currentHeaders(nullptr), _contentLength(0), _chunked(false) {\n    log_v(\"WebServer::Webserver(addr=%s, port=%d)\", ipToString(addr).c_str(), port);\n}\n\nWebServer::WebServer(int port)\n    : _corsEnabled(false), _server(port), _currentMethod(HTTP_ANY), _currentVersion(0), _currentStatus(HC_NONE),\n      _statusChange(0), _nullDelay(true), _currentHandler(nullptr), _firstHandler(nullptr), _lastHandler(nullptr),\n      _currentArgCount(0), _currentArgs(nullptr), _postArgsLen(0), _postArgs(nullptr), _headerKeysCount(0),\n      _currentHeaders(nullptr), _contentLength(0), _chunked(false) {\n    log_v(\"WebServer::Webserver(port=%d)\", port);\n}\n\nWebServer::~WebServer() {\n    _server.close();\n    if (_currentHeaders)\n        delete[] _currentHeaders;\n    RequestHandler *handler = _firstHandler;\n    while (handler) {\n        RequestHandler *next = handler->next();\n        delete handler;\n        handler = next;\n    }\n}\n\nvoid WebServer::begin() {\n    close();\n    _server.begin();\n    _server.setNoDelay(true);\n}\n\nvoid WebServer::begin(uint16_t port) {\n    close();\n    _server.begin(port);\n    _server.setNoDelay(true);\n}\n\nString WebServer::_extractParam(String &authReq, const String &param, const char delimit) {\n    int _begin = authReq.indexOf(param);\n    if (_begin == -1)\n        return \"\";\n    return authReq.substring(_begin + param.length(), authReq.indexOf(delimit, _begin + param.length()));\n}\n\nstatic String md5str(String &in) {\n    /* char out[33] = {0};\n    mbedtls_md5_context _ctx;\n    uint8_t i;\n    uint8_t *_buf = (uint8_t *)malloc(16);\n    if (_buf == NULL)\n        return String(out);\n    memset(_buf, 0x00, 16);\n    mbedtls_md5_init(&_ctx);\n    mbedtls_md5_starts_ret(&_ctx);\n    mbedtls_md5_update_ret(&_ctx, (const uint8_t *)in.c_str(), in.length());\n    mbedtls_md5_finish_ret(&_ctx, _buf);\n    for (i = 0; i < 16; i++) {\n        sprintf(out + (i * 2), \"%02x\", _buf[i]);\n    }\n    out[32] = 0;\n    free(_buf);\n    return String(out); */\n    return \"\";\n}\n\nbool WebServer::authenticate(const char *username, const char *password) {\n    if (hasHeader(FPSTR(AUTHORIZATION_HEADER))) {\n        String authReq = header(FPSTR(AUTHORIZATION_HEADER));\n        if (authReq.startsWith(F(\"Basic\"))) {\n            authReq = authReq.substring(6);\n            authReq.trim();\n            char toencodeLen = strlen(username) + strlen(password) + 1;\n            char *toencode   = new char[toencodeLen + 1];\n            if (toencode == NULL) {\n                authReq = \"\";\n                return false;\n            }\n            char *encoded = new char[base64_encode_expected_len(toencodeLen) + 1];\n            if (encoded == NULL) {\n                authReq = \"\";\n                delete[] toencode;\n                return false;\n            }\n            sprintf(toencode, \"%s:%s\", username, password);\n            if (base64_encode_chars(toencode, toencodeLen, encoded) > 0 && authReq.equals(encoded)) {\n                authReq = \"\";\n                delete[] toencode;\n                delete[] encoded;\n                return true;\n            }\n            delete[] toencode;\n            delete[] encoded;\n        } else if (authReq.startsWith(F(\"Digest\"))) {\n            authReq = authReq.substring(7);\n            log_v(\"%s\", authReq.c_str());\n            String _username = _extractParam(authReq, F(\"username=\\\"\"), '\\\"');\n            if (!_username.length() || _username != String(username)) {\n                authReq = \"\";\n                return false;\n            }\n            // extracting required parameters for RFC 2069 simpler Digest\n            String _realm    = _extractParam(authReq, F(\"realm=\\\"\"), '\\\"');\n            String _nonce    = _extractParam(authReq, F(\"nonce=\\\"\"), '\\\"');\n            String _uri      = _extractParam(authReq, F(\"uri=\\\"\"), '\\\"');\n            String _response = _extractParam(authReq, F(\"response=\\\"\"), '\\\"');\n            String _opaque   = _extractParam(authReq, F(\"opaque=\\\"\"), '\\\"');\n\n            if ((!_realm.length()) || (!_nonce.length()) || (!_uri.length()) || (!_response.length()) ||\n                (!_opaque.length())) {\n                authReq = \"\";\n                return false;\n            }\n            if ((_opaque != _sopaque) || (_nonce != _snonce) || (_realm != _srealm)) {\n                authReq = \"\";\n                return false;\n            }\n            // parameters for the RFC 2617 newer Digest\n            String _nc, _cnonce;\n            if (authReq.indexOf(FPSTR(qop_auth)) != -1 || authReq.indexOf(FPSTR(qop_auth_quoted)) != -1) {\n                _nc     = _extractParam(authReq, F(\"nc=\"), ',');\n                _cnonce = _extractParam(authReq, F(\"cnonce=\\\"\"), '\\\"');\n            }\n            String _H1 = md5str(String(username) + ':' + _realm + ':' + String(password));\n            log_v(\"Hash of user:realm:pass=%s\", _H1.c_str());\n            String _H2 = \"\";\n            if (_currentMethod == HTTP_GET) {\n                _H2 = md5str(String(F(\"GET:\")) + _uri);\n            } else if (_currentMethod == HTTP_POST) {\n                _H2 = md5str(String(F(\"POST:\")) + _uri);\n            } else if (_currentMethod == HTTP_PUT) {\n                _H2 = md5str(String(F(\"PUT:\")) + _uri);\n            } else if (_currentMethod == HTTP_DELETE) {\n                _H2 = md5str(String(F(\"DELETE:\")) + _uri);\n            } else {\n                _H2 = md5str(String(F(\"GET:\")) + _uri);\n            }\n            log_v(\"Hash of GET:uri=%s\", _H2.c_str());\n            String _responsecheck = \"\";\n            if (authReq.indexOf(FPSTR(qop_auth)) != -1 || authReq.indexOf(FPSTR(qop_auth_quoted)) != -1) {\n                _responsecheck = md5str(_H1 + ':' + _nonce + ':' + _nc + ':' + _cnonce + F(\":auth:\") + _H2);\n            } else {\n                _responsecheck = md5str(_H1 + ':' + _nonce + ':' + _H2);\n            }\n            log_v(\"The Proper response=%s\", _responsecheck.c_str());\n            if (_response == _responsecheck) {\n                authReq = \"\";\n                return true;\n            }\n        }\n        authReq = \"\";\n    }\n    return false;\n}\n\nString WebServer::_getRandomHexString() {\n    char buffer[33]; // buffer to hold 32 Hex Digit + /0\n    int i;\n    for (i = 0; i < 4; i++) {\n        sprintf(buffer + (i * 8), \"%08x\", rand());\n    }\n    return String(buffer);\n}\n\nvoid WebServer::requestAuthentication(HTTPAuthMethod mode, const char *realm, const String &authFailMsg) {\n    if (realm == NULL) {\n        _srealm = String(F(\"Login Required\"));\n    } else {\n        _srealm = String(realm);\n    }\n    if (mode == BASIC_AUTH) {\n        sendHeader(String(FPSTR(WWW_Authenticate)), String(F(\"Basic realm=\\\"\")) + _srealm + String(F(\"\\\"\")));\n    } else {\n        _snonce  = _getRandomHexString();\n        _sopaque = _getRandomHexString();\n        sendHeader(\n            String(FPSTR(WWW_Authenticate)),\n            String(F(\"Digest realm=\\\"\")) + _srealm + String(F(\"\\\", qop=\\\"auth\\\", nonce=\\\"\")) + _snonce +\n                String(F(\"\\\", opaque=\\\"\")) + _sopaque + String(F(\"\\\"\"))\n        );\n    }\n    using namespace mime;\n    send(401, String(FPSTR(mimeTable[html].mimeType)), authFailMsg);\n}\n\nvoid WebServer::on(const Uri &uri, WebServer::THandlerFunction handler) {\n    on(uri, HTTP_ANY, handler);\n}\n\nvoid WebServer::on(const Uri &uri, HTTPMethod method, WebServer::THandlerFunction fn) {\n    on(uri, method, fn, _fileUploadHandler);\n}\n\nvoid WebServer::on(const Uri &uri, HTTPMethod method, WebServer::THandlerFunction fn, WebServer::THandlerFunction ufn) {\n    _addRequestHandler(new FunctionRequestHandler(fn, ufn, uri, method));\n}\n\nvoid WebServer::addHandler(RequestHandler *handler) {\n    _addRequestHandler(handler);\n}\n\nvoid WebServer::_addRequestHandler(RequestHandler *handler) {\n    if (!_lastHandler) {\n        _firstHandler = handler;\n        _lastHandler  = handler;\n    } else {\n        _lastHandler->next(handler);\n        _lastHandler = handler;\n    }\n}\n\nvoid WebServer::serveStatic(const char *uri, FS &fs, const char *path, const char *cache_header) {\n    _addRequestHandler(new StaticRequestHandler(fs, path, uri, cache_header));\n}\n\nvoid WebServer::handleClient() {\n    if (_currentStatus == HC_NONE) {\n        WiFiClient client = _server.available();\n        if (!client) {\n            if (_nullDelay) {\n                delay(1);\n            }\n            return;\n        }\n\n        log_v(\"New client: client.localIP()=%s\", ipToString(client.localIP()).c_str());\n\n        _currentClient = client;\n        _currentStatus = HC_WAIT_READ;\n        _statusChange  = millis();\n    }\n\n    bool keepCurrentClient = false;\n    bool callYield         = false;\n\n    if (_currentClient.connected()) {\n        switch (_currentStatus) {\n            case HC_NONE:\n                // No-op to avoid C++ compiler warning\n                break;\n            case HC_WAIT_READ:\n                // Wait for data from client to become available\n                if (_currentClient.available()) {\n                    if (_parseRequest(_currentClient)) {\n                        // because HTTP_MAX_SEND_WAIT is expressed in milliseconds,\n                        // it must be divided by 1000\n                        _currentClient.setTimeout(HTTP_MAX_SEND_WAIT / 1000);\n                        _contentLength = CONTENT_LENGTH_NOT_SET;\n                        _handleRequest();\n\n                        // Fix for issue with Chrome based browsers:\n                        // https://github.com/espressif/arduino-esp32/issues/3652\n                        //           if (_currentClient.connected()) {\n                        //             _currentStatus = HC_WAIT_CLOSE;\n                        //             _statusChange = millis();\n                        //             keepCurrentClient = true;\n                        //           }\n                    }\n                } else { // !_currentClient.available()\n                    if (millis() - _statusChange <= HTTP_MAX_DATA_WAIT) {\n                        keepCurrentClient = true;\n                    }\n                    callYield = true;\n                }\n                break;\n            case HC_WAIT_CLOSE:\n                // Wait for client to close the connection\n                if (millis() - _statusChange <= HTTP_MAX_CLOSE_WAIT) {\n                    keepCurrentClient = true;\n                    callYield         = true;\n                }\n        }\n    }\n\n    if (!keepCurrentClient) {\n        _currentClient = WiFiClient();\n        _currentStatus = HC_NONE;\n        _currentUpload.reset();\n    }\n\n    if (callYield) {\n        yield();\n    }\n}\n\nvoid WebServer::close() {\n    _server.close();\n    _currentStatus = HC_NONE;\n    if (!_headerKeysCount)\n        collectHeaders(0, 0);\n}\n\nvoid WebServer::stop() {\n    close();\n}\n\nvoid WebServer::sendHeader(const String &name, const String &value, bool first) {\n    String headerLine = name;\n    headerLine += F(\": \");\n    headerLine += value;\n    headerLine += \"\\r\\n\";\n\n    if (first) {\n        _responseHeaders = headerLine + _responseHeaders;\n    } else {\n        _responseHeaders += headerLine;\n    }\n}\n\nvoid WebServer::setContentLength(const size_t contentLength) {\n    _contentLength = contentLength;\n}\n\nvoid WebServer::enableDelay(boolean value) {\n    _nullDelay = value;\n}\n\nvoid WebServer::enableCORS(boolean value) {\n    _corsEnabled = value;\n}\n\nvoid WebServer::enableCrossOrigin(boolean value) {\n    enableCORS(value);\n}\n\nvoid WebServer::_prepareHeader(String &response, int code, const char *content_type, size_t contentLength) {\n    response = String(F(\"HTTP/1.\")) + String(_currentVersion) + ' ';\n    response += String(code);\n    response += ' ';\n    response += _responseCodeToString(code);\n    response += \"\\r\\n\";\n\n    using namespace mime;\n    if (!content_type)\n        content_type = mimeTable[html].mimeType;\n\n    sendHeader(String(F(\"Content-Type\")), String(FPSTR(content_type)), true);\n    if (_contentLength == CONTENT_LENGTH_NOT_SET) {\n        sendHeader(String(FPSTR(Content_Length)), String(contentLength));\n    } else if (_contentLength != CONTENT_LENGTH_UNKNOWN) {\n        sendHeader(String(FPSTR(Content_Length)), String(_contentLength));\n    } else if (_contentLength == CONTENT_LENGTH_UNKNOWN && _currentVersion) { // HTTP/1.1 or above client\n        // let's do chunked\n        _chunked = true;\n        sendHeader(String(F(\"Accept-Ranges\")), String(F(\"none\")));\n        sendHeader(String(F(\"Transfer-Encoding\")), String(F(\"chunked\")));\n    }\n    if (_corsEnabled) {\n        sendHeader(String(FPSTR(\"Access-Control-Allow-Origin\")), String(\"*\"));\n        sendHeader(String(FPSTR(\"Access-Control-Allow-Methods\")), String(\"*\"));\n        sendHeader(String(FPSTR(\"Access-Control-Allow-Headers\")), String(\"*\"));\n    }\n    sendHeader(String(F(\"Connection\")), String(F(\"close\")));\n\n    response += _responseHeaders;\n    response += \"\\r\\n\";\n    _responseHeaders = \"\";\n}\n\nvoid WebServer::send(int code, const char *content_type, const String &content) {\n    String header;\n    // Can we asume the following?\n    // if(code == 200 && content.length() == 0 && _contentLength == CONTENT_LENGTH_NOT_SET)\n    //  _contentLength = CONTENT_LENGTH_UNKNOWN;\n    _prepareHeader(header, code, content_type, content.length());\n    _currentClientWrite(header.c_str(), header.length());\n    if (content.length())\n        sendContent(content);\n}\n\nvoid WebServer::send_P(int code, PGM_P content_type, PGM_P content) {\n    size_t contentLength = 0;\n\n    if (content != NULL) {\n        contentLength = strlen_P(content);\n    }\n\n    String header;\n    char type[64];\n    strncpy_P(type, (PGM_P)content_type, sizeof(type));\n    _prepareHeader(header, code, (const char *)type, contentLength);\n    _currentClientWrite(header.c_str(), header.length());\n    sendContent_P(content);\n}\n\nvoid WebServer::send_P(int code, PGM_P content_type, PGM_P content, size_t contentLength) {\n    String header;\n    char type[64];\n    strncpy_P(type, (PGM_P)content_type, sizeof(type));\n    _prepareHeader(header, code, (const char *)type, contentLength);\n    sendContent(header);\n    sendContent_P(content, contentLength);\n}\n\nvoid WebServer::send(int code, char *content_type, const String &content) {\n    send(code, (const char *)content_type, content);\n}\n\nvoid WebServer::send(int code, const String &content_type, const String &content) {\n    send(code, (const char *)content_type.c_str(), content);\n}\n\nvoid WebServer::sendContent(const String &content) {\n    sendContent(content.c_str(), content.length());\n}\n\nvoid WebServer::sendContent(const char *content, size_t contentLength) {\n    const char *footer = \"\\r\\n\";\n    if (_chunked) {\n        char *chunkSize = (char *)malloc(11);\n        if (chunkSize) {\n            sprintf(chunkSize, \"%x%s\", contentLength, footer);\n            _currentClientWrite(chunkSize, strlen(chunkSize));\n            free(chunkSize);\n        }\n    }\n    _currentClientWrite(content, contentLength);\n    if (_chunked) {\n        _currentClient.write(footer, 2);\n        if (contentLength == 0) {\n            _chunked = false;\n        }\n    }\n}\n\nvoid WebServer::sendContent_P(PGM_P content) {\n    sendContent_P(content, strlen_P(content));\n}\n\nvoid WebServer::sendContent_P(PGM_P content, size_t size) {\n    const char *footer = \"\\r\\n\";\n    if (_chunked) {\n        char *chunkSize = (char *)malloc(11);\n        if (chunkSize) {\n            sprintf(chunkSize, \"%x%s\", size, footer);\n            _currentClientWrite(chunkSize, strlen(chunkSize));\n            free(chunkSize);\n        }\n    }\n    _currentClientWrite_P(content, size);\n    if (_chunked) {\n        _currentClient.write(footer, 2);\n        if (size == 0) {\n            _chunked = false;\n        }\n    }\n}\n\nvoid WebServer::_streamFileCore(const size_t fileSize, const String &fileName, const String &contentType) {\n    using namespace mime;\n    setContentLength(fileSize);\n    if (fileName.endsWith(String(FPSTR(mimeTable[gz].endsWith))) &&\n        contentType != String(FPSTR(mimeTable[gz].mimeType)) &&\n        contentType != String(FPSTR(mimeTable[none].mimeType))) {\n        sendHeader(F(\"Content-Encoding\"), F(\"gzip\"));\n    }\n    send(200, contentType, \"\");\n}\n\nString WebServer::pathArg(unsigned int i) {\n    if (_currentHandler != nullptr)\n        return _currentHandler->pathArg(i);\n    return \"\";\n}\n\nString WebServer::arg(String name) {\n    for (int j = 0; j < _postArgsLen; ++j) {\n        if (_postArgs[j].key == name)\n            return _postArgs[j].value;\n    }\n    for (int i = 0; i < _currentArgCount; ++i) {\n        if (_currentArgs[i].key == name)\n            return _currentArgs[i].value;\n    }\n    return \"\";\n}\n\nString WebServer::arg(int i) {\n    if (i < _currentArgCount)\n        return _currentArgs[i].value;\n    return \"\";\n}\n\nString WebServer::argName(int i) {\n    if (i < _currentArgCount)\n        return _currentArgs[i].key;\n    return \"\";\n}\n\nint WebServer::args() {\n    return _currentArgCount;\n}\n\nbool WebServer::hasArg(String name) {\n    for (int j = 0; j < _postArgsLen; ++j) {\n        if (_postArgs[j].key == name)\n            return true;\n    }\n    for (int i = 0; i < _currentArgCount; ++i) {\n        if (_currentArgs[i].key == name)\n            return true;\n    }\n    return false;\n}\n\nString WebServer::header(String name) {\n    for (int i = 0; i < _headerKeysCount; ++i) {\n        if (_currentHeaders[i].key.equalsIgnoreCase(name))\n            return _currentHeaders[i].value;\n    }\n    return \"\";\n}\n\nvoid WebServer::collectHeaders(const char *headerKeys[], const size_t headerKeysCount) {\n    _headerKeysCount = headerKeysCount + 1;\n    if (_currentHeaders)\n        delete[] _currentHeaders;\n    _currentHeaders        = new RequestArgument[_headerKeysCount];\n    _currentHeaders[0].key = FPSTR(AUTHORIZATION_HEADER);\n    for (int i = 1; i < _headerKeysCount; i++) {\n        _currentHeaders[i].key = headerKeys[i - 1];\n    }\n}\n\nString WebServer::header(int i) {\n    if (i < _headerKeysCount)\n        return _currentHeaders[i].value;\n    return \"\";\n}\n\nString WebServer::headerName(int i) {\n    if (i < _headerKeysCount)\n        return _currentHeaders[i].key;\n    return \"\";\n}\n\nint WebServer::headers() {\n    return _headerKeysCount;\n}\n\nbool WebServer::hasHeader(String name) {\n    for (int i = 0; i < _headerKeysCount; ++i) {\n        if ((_currentHeaders[i].key.equalsIgnoreCase(name)) && (_currentHeaders[i].value.length() > 0))\n            return true;\n    }\n    return false;\n}\n\nString WebServer::hostHeader() {\n    return _hostHeader;\n}\n\nvoid WebServer::onFileUpload(THandlerFunction fn) {\n    _fileUploadHandler = fn;\n}\n\nvoid WebServer::onNotFound(THandlerFunction fn) {\n    _notFoundHandler = fn;\n}\n\nvoid WebServer::_handleRequest() {\n    bool handled = false;\n    if (!_currentHandler) {\n        log_e(\"request handler not found\");\n    } else {\n        handled = _currentHandler->handle(*this, _currentMethod, _currentUri);\n        if (!handled) {\n            log_e(\"request handler failed to handle request\");\n        }\n    }\n    if (!handled && _notFoundHandler) {\n        _notFoundHandler();\n        handled = true;\n    }\n    if (!handled) {\n        using namespace mime;\n        send(404, String(FPSTR(mimeTable[html].mimeType)), String(F(\"Not found: \")) + _currentUri);\n        handled = true;\n    }\n    if (handled) {\n        _finalizeResponse();\n    }\n    _currentUri = \"\";\n}\n\nvoid WebServer::_finalizeResponse() {\n    if (_chunked) {\n        sendContent(\"\");\n    }\n}\n\nString WebServer::_responseCodeToString(int code) {\n    switch (code) {\n        case 100:\n            return F(\"Continue\");\n        case 101:\n            return F(\"Switching Protocols\");\n        case 200:\n            return F(\"OK\");\n        case 201:\n            return F(\"Created\");\n        case 202:\n            return F(\"Accepted\");\n        case 203:\n            return F(\"Non-Authoritative Information\");\n        case 204:\n            return F(\"No Content\");\n        case 205:\n            return F(\"Reset Content\");\n        case 206:\n            return F(\"Partial Content\");\n        case 300:\n            return F(\"Multiple Choices\");\n        case 301:\n            return F(\"Moved Permanently\");\n        case 302:\n            return F(\"Found\");\n        case 303:\n            return F(\"See Other\");\n        case 304:\n            return F(\"Not Modified\");\n        case 305:\n            return F(\"Use Proxy\");\n        case 307:\n            return F(\"Temporary Redirect\");\n        case 400:\n            return F(\"Bad Request\");\n        case 401:\n            return F(\"Unauthorized\");\n        case 402:\n            return F(\"Payment Required\");\n        case 403:\n            return F(\"Forbidden\");\n        case 404:\n            return F(\"Not Found\");\n        case 405:\n            return F(\"Method Not Allowed\");\n        case 406:\n            return F(\"Not Acceptable\");\n        case 407:\n            return F(\"Proxy Authentication Required\");\n        case 408:\n            return F(\"Request Time-out\");\n        case 409:\n            return F(\"Conflict\");\n        case 410:\n            return F(\"Gone\");\n        case 411:\n            return F(\"Length Required\");\n        case 412:\n            return F(\"Precondition Failed\");\n        case 413:\n            return F(\"Request Entity Too Large\");\n        case 414:\n            return F(\"Request-URI Too Large\");\n        case 415:\n            return F(\"Unsupported Media Type\");\n        case 416:\n            return F(\"Requested range not satisfiable\");\n        case 417:\n            return F(\"Expectation Failed\");\n        case 500:\n            return F(\"Internal Server Error\");\n        case 501:\n            return F(\"Not Implemented\");\n        case 502:\n            return F(\"Bad Gateway\");\n        case 503:\n            return F(\"Service Unavailable\");\n        case 504:\n            return F(\"Gateway Time-out\");\n        case 505:\n            return F(\"HTTP Version not supported\");\n        default:\n            return F(\"\");\n    }\n}\n\n#endif // LT_ARD_HAS_WIFI\n
"},{"location":"ltapi/_web_server_8h/","title":"File WebServer.h","text":"

FileList > arduino > libraries > ext > WebServer > WebServer.h

Go to the source code of this file.

  • #include \"HTTP_Method.h\"
  • #include \"Uri.h\"
  • #include <WiFi.h>
  • #include <functional>
  • #include <memory>
  • #include \"detail/RequestHandler.h\"
"},{"location":"ltapi/_web_server_8h/#namespaces","title":"Namespaces","text":"Type Name namespace fs"},{"location":"ltapi/_web_server_8h/#classes","title":"Classes","text":"Type Name struct HTTPUpload class WebServer"},{"location":"ltapi/_web_server_8h/#public-types","title":"Public Types","text":"Type Name enum HTTPAuthMethod enum HTTPClientStatus enum HTTPUploadStatus"},{"location":"ltapi/_web_server_8h/#macros","title":"Macros","text":"Type Name define CONTENT_LENGTH_NOT_SET ((size_t)-2) define CONTENT_LENGTH_UNKNOWN ((size_t)-1) define HTTP_DOWNLOAD_UNIT_SIZE 1436 define HTTP_MAX_CLOSE_WAIT 2000 define HTTP_MAX_DATA_WAIT 5000 define HTTP_MAX_POST_WAIT 5000 define HTTP_MAX_SEND_WAIT 5000 define HTTP_UPLOAD_BUFLEN 1436"},{"location":"ltapi/_web_server_8h/#public-types-documentation","title":"Public Types Documentation","text":""},{"location":"ltapi/_web_server_8h/#enum-httpauthmethod","title":"enum HTTPAuthMethod","text":"
enum HTTPAuthMethod {\n    BASIC_AUTH,\n    DIGEST_AUTH\n};\n
"},{"location":"ltapi/_web_server_8h/#enum-httpclientstatus","title":"enum HTTPClientStatus","text":"
enum HTTPClientStatus {\n    HC_NONE,\n    HC_WAIT_READ,\n    HC_WAIT_CLOSE\n};\n
"},{"location":"ltapi/_web_server_8h/#enum-httpuploadstatus","title":"enum HTTPUploadStatus","text":"
enum HTTPUploadStatus {\n    UPLOAD_FILE_START,\n    UPLOAD_FILE_WRITE,\n    UPLOAD_FILE_END,\n    UPLOAD_FILE_ABORTED\n};\n
"},{"location":"ltapi/_web_server_8h/#macro-definition-documentation","title":"Macro Definition Documentation","text":""},{"location":"ltapi/_web_server_8h/#define-content_length_not_set","title":"define CONTENT_LENGTH_NOT_SET","text":"
#define CONTENT_LENGTH_NOT_SET ((size_t)-2)\n
"},{"location":"ltapi/_web_server_8h/#define-content_length_unknown","title":"define CONTENT_LENGTH_UNKNOWN","text":"
#define CONTENT_LENGTH_UNKNOWN ((size_t)-1)\n
"},{"location":"ltapi/_web_server_8h/#define-http_download_unit_size","title":"define HTTP_DOWNLOAD_UNIT_SIZE","text":"
#define HTTP_DOWNLOAD_UNIT_SIZE 1436\n
"},{"location":"ltapi/_web_server_8h/#define-http_max_close_wait","title":"define HTTP_MAX_CLOSE_WAIT","text":"
#define HTTP_MAX_CLOSE_WAIT 2000\n
"},{"location":"ltapi/_web_server_8h/#define-http_max_data_wait","title":"define HTTP_MAX_DATA_WAIT","text":"
#define HTTP_MAX_DATA_WAIT 5000\n
"},{"location":"ltapi/_web_server_8h/#define-http_max_post_wait","title":"define HTTP_MAX_POST_WAIT","text":"
#define HTTP_MAX_POST_WAIT 5000\n
"},{"location":"ltapi/_web_server_8h/#define-http_max_send_wait","title":"define HTTP_MAX_SEND_WAIT","text":"
#define HTTP_MAX_SEND_WAIT 5000\n
"},{"location":"ltapi/_web_server_8h/#define-http_upload_buflen","title":"define HTTP_UPLOAD_BUFLEN","text":"
#define HTTP_UPLOAD_BUFLEN 1436\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/WebServer.h

"},{"location":"ltapi/_web_server_8h_source/","title":"File WebServer.h","text":"

File List > arduino > libraries > ext > WebServer > WebServer.h

Go to the documentation of this file.

/*\n  WebServer.h - Dead simple web-server.\n  Supports only one simultaneous client, knows how to handle GET and POST.\n\n  Copyright (c) 2014 Ivan Grokhotkov. All rights reserved.\n\n  This library is free software; you can redistribute it and/or\n  modify it under the terms of the GNU Lesser General Public\n  License as published by the Free Software Foundation; either\n  version 2.1 of the License, or (at your option) any later version.\n\n  This library is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n  Lesser General Public License for more details.\n\n  You should have received a copy of the GNU Lesser General Public\n  License along with this library; if not, write to the Free Software\n  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n  Modified 8 May 2015 by Hristo Gochkov (proper post and file upload handling)\n*/\n\n#pragma once\n\n#include \"HTTP_Method.h\"\n#include \"Uri.h\"\n#include <WiFi.h>\n#include <functional>\n#include <memory>\n\nenum HTTPUploadStatus { UPLOAD_FILE_START, UPLOAD_FILE_WRITE, UPLOAD_FILE_END, UPLOAD_FILE_ABORTED };\n\nenum HTTPClientStatus { HC_NONE, HC_WAIT_READ, HC_WAIT_CLOSE };\n\nenum HTTPAuthMethod { BASIC_AUTH, DIGEST_AUTH };\n\n#define HTTP_DOWNLOAD_UNIT_SIZE 1436\n\n#ifndef HTTP_UPLOAD_BUFLEN\n#define HTTP_UPLOAD_BUFLEN 1436\n#endif\n\n#define HTTP_MAX_DATA_WAIT  5000 // ms to wait for the client to send the request\n#define HTTP_MAX_POST_WAIT  5000 // ms to wait for POST data to arrive\n#define HTTP_MAX_SEND_WAIT  5000 // ms to wait for data chunk to be ACKed\n#define HTTP_MAX_CLOSE_WAIT 2000 // ms to wait for the client to close the connection\n\n#define CONTENT_LENGTH_UNKNOWN ((size_t)-1)\n#define CONTENT_LENGTH_NOT_SET ((size_t)-2)\n\nclass WebServer;\n\ntypedef struct {\n    HTTPUploadStatus status;\n    String filename;\n    String name;\n    String type;\n    size_t totalSize;   // file size\n    size_t currentSize; // size of data currently in buf\n    uint8_t buf[HTTP_UPLOAD_BUFLEN];\n} HTTPUpload;\n\n#include \"detail/RequestHandler.h\"\n\nnamespace fs {\nclass FS;\n}\n\nclass WebServer {\n  public:\n    WebServer(IPAddress addr, int port = 80);\n    WebServer(int port = 80);\n    virtual ~WebServer();\n\n    virtual void begin();\n    virtual void begin(uint16_t port);\n    virtual void handleClient();\n\n    virtual void close();\n    void stop();\n\n    bool authenticate(const char *username, const char *password);\n    void requestAuthentication(\n        HTTPAuthMethod mode = BASIC_AUTH, const char *realm = NULL, const String &authFailMsg = String(\"\")\n    );\n\n    typedef std::function<void(void)> THandlerFunction;\n    void on(const Uri &uri, THandlerFunction fn);\n    void on(const Uri &uri, HTTPMethod method, THandlerFunction fn);\n    void on(const Uri &uri, HTTPMethod method, THandlerFunction fn, THandlerFunction ufn); // ufn handles file uploads\n    void addHandler(RequestHandler *handler);\n    void serveStatic(const char *uri, fs::FS &fs, const char *path, const char *cache_header = NULL);\n    void onNotFound(THandlerFunction fn);    // called when handler is not assigned\n    void onFileUpload(THandlerFunction ufn); // handle file uploads\n\n    String uri() {\n        return _currentUri;\n    }\n\n    HTTPMethod method() {\n        return _currentMethod;\n    }\n\n    virtual WiFiClient client() {\n        return _currentClient;\n    }\n\n    HTTPUpload &upload() {\n        return *_currentUpload;\n    }\n\n    String pathArg(unsigned int i);                                              // get request path argument by number\n    String arg(String name);                                                     // get request argument value by name\n    String arg(int i);                                                           // get request argument value by number\n    String argName(int i);                                                       // get request argument name by number\n    int args();                                                                  // get arguments count\n    bool hasArg(String name);                                                    // check if argument exists\n    void collectHeaders(const char *headerKeys[], const size_t headerKeysCount); // set the request headers to collect\n    String header(String name);                                                  // get request header value by name\n    String header(int i);                                                        // get request header value by number\n    String headerName(int i);                                                    // get request header name by number\n    int headers();                                                               // get header count\n    bool hasHeader(String name);                                                 // check if header exists\n\n    String hostHeader(); // get request host header if available or empty String if not\n\n    // send response to the client\n    // code - HTTP response code, can be 200 or 404\n    // content_type - HTTP content type, like \"text/plain\" or \"image/png\"\n    // content - actual content body\n    void send(int code, const char *content_type = NULL, const String &content = String(\"\"));\n    void send(int code, char *content_type, const String &content);\n    void send(int code, const String &content_type, const String &content);\n    void send_P(int code, PGM_P content_type, PGM_P content);\n    void send_P(int code, PGM_P content_type, PGM_P content, size_t contentLength);\n\n    void enableDelay(boolean value);\n    void enableCORS(boolean value = true);\n    void enableCrossOrigin(boolean value = true);\n\n    void setContentLength(const size_t contentLength);\n    void sendHeader(const String &name, const String &value, bool first = false);\n    void sendContent(const String &content);\n    void sendContent(const char *content, size_t contentLength);\n    void sendContent_P(PGM_P content);\n    void sendContent_P(PGM_P content, size_t size);\n\n    static String urlDecode(const String &text);\n\n    template <typename T>\n    size_t streamFile(T &file, const String &contentType) {\n        _streamFileCore(file.size(), file.name(), contentType);\n        return _currentClient.write(file);\n    }\n\n  protected:\n    virtual size_t _currentClientWrite(const char *b, size_t l) {\n        return _currentClient.write(b, l);\n    }\n\n    virtual size_t _currentClientWrite_P(PGM_P b, size_t l) {\n        return _currentClient.write_P(b, l);\n    }\n\n    void _addRequestHandler(RequestHandler *handler);\n    void _handleRequest();\n    void _finalizeResponse();\n    bool _parseRequest(WiFiClient &client);\n    void _parseArguments(String data);\n    static String _responseCodeToString(int code);\n    bool _parseForm(WiFiClient &client, String boundary, uint32_t len);\n    bool _parseFormUploadAborted();\n    void _uploadWriteByte(uint8_t b);\n    int _uploadReadByte(WiFiClient &client);\n    void _prepareHeader(String &response, int code, const char *content_type, size_t contentLength);\n    bool _collectHeader(const char *headerName, const char *headerValue);\n\n    void _streamFileCore(const size_t fileSize, const String &fileName, const String &contentType);\n\n    String _getRandomHexString();\n    // for extracting Auth parameters\n    String _extractParam(String &authReq, const String &param, const char delimit = '\"');\n\n    struct RequestArgument {\n        String key;\n        String value;\n    };\n\n    boolean _corsEnabled;\n    WiFiServer _server;\n\n    WiFiClient _currentClient;\n    HTTPMethod _currentMethod;\n    String _currentUri;\n    uint8_t _currentVersion;\n    HTTPClientStatus _currentStatus;\n    unsigned long _statusChange;\n    boolean _nullDelay;\n\n    RequestHandler *_currentHandler;\n    RequestHandler *_firstHandler;\n    RequestHandler *_lastHandler;\n    THandlerFunction _notFoundHandler;\n    THandlerFunction _fileUploadHandler;\n\n    int _currentArgCount;\n    RequestArgument *_currentArgs;\n    int _postArgsLen;\n    RequestArgument *_postArgs;\n\n    std::unique_ptr<HTTPUpload> _currentUpload;\n\n    int _headerKeysCount;\n    RequestArgument *_currentHeaders;\n    size_t _contentLength;\n    String _responseHeaders;\n\n    String _hostHeader;\n    bool _chunked;\n\n    String _snonce; // Store noance and opaque for future comparison\n    String _sopaque;\n    String _srealm; // Store the Auth realm between Calls\n};\n
"},{"location":"ltapi/dir_84f0c24223fe15b4f2fbb2a476e54856/","title":"Dir cores/common/arduino/libraries/ext/WebServer/detail","text":"

FileList > arduino > libraries > ext > WebServer > detail

"},{"location":"ltapi/dir_84f0c24223fe15b4f2fbb2a476e54856/#files","title":"Files","text":"Type Name file RequestHandler.h file RequestHandlersImpl.h file mimetable.cpp file mimetable.h

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/detail/

"},{"location":"ltapi/_request_handler_8h/","title":"File RequestHandler.h","text":"

FileList > arduino > libraries > ext > WebServer > detail > RequestHandler.h

Go to the source code of this file.

  • #include <assert.h>
  • #include <vector>
"},{"location":"ltapi/_request_handler_8h/#classes","title":"Classes","text":"Type Name class RequestHandler

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/detail/RequestHandler.h

"},{"location":"ltapi/_request_handler_8h_source/","title":"File RequestHandler.h","text":"

File List > arduino > libraries > ext > WebServer > detail > RequestHandler.h

Go to the documentation of this file.

#pragma once\n\n#include <assert.h>\n#include <vector>\n\nclass RequestHandler {\n  public:\n    virtual ~RequestHandler() {}\n\n    virtual bool canHandle(HTTPMethod method, String uri) {\n        (void)method;\n        (void)uri;\n        return false;\n    }\n\n    virtual bool canUpload(String uri) {\n        (void)uri;\n        return false;\n    }\n\n    virtual bool handle(WebServer &server, HTTPMethod requestMethod, String requestUri) {\n        (void)server;\n        (void)requestMethod;\n        (void)requestUri;\n        return false;\n    }\n\n    virtual void upload(WebServer &server, String requestUri, HTTPUpload &upload) {\n        (void)server;\n        (void)requestUri;\n        (void)upload;\n    }\n\n    RequestHandler *next() {\n        return _next;\n    }\n\n    void next(RequestHandler *r) {\n        _next = r;\n    }\n\n  private:\n    RequestHandler *_next = nullptr;\n\n  protected:\n    std::vector<String> pathArgs;\n\n  public:\n    const String &pathArg(unsigned int i) {\n        assert(i < pathArgs.size());\n        return pathArgs[i];\n    }\n};\n
"},{"location":"ltapi/_request_handlers_impl_8h/","title":"File RequestHandlersImpl.h","text":"

FileList > arduino > libraries > ext > WebServer > detail > RequestHandlersImpl.h

Go to the source code of this file.

  • #include \"RequestHandler.h\"
  • #include \"Uri.h\"
  • #include \"WString.h\"
  • #include \"mimetable.h\"
"},{"location":"ltapi/_request_handlers_impl_8h/#classes","title":"Classes","text":"Type Name class FunctionRequestHandler class StaticRequestHandler

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/detail/RequestHandlersImpl.h

"},{"location":"ltapi/_request_handlers_impl_8h_source/","title":"File RequestHandlersImpl.h","text":"

File List > arduino > libraries > ext > WebServer > detail > RequestHandlersImpl.h

Go to the documentation of this file.

#pragma once\n\n#include \"RequestHandler.h\"\n#include \"Uri.h\"\n#include \"WString.h\"\n#include \"mimetable.h\"\n\nusing namespace mime;\n\nclass FunctionRequestHandler : public RequestHandler {\n  public:\n    FunctionRequestHandler(\n        WebServer::THandlerFunction fn, WebServer::THandlerFunction ufn, const Uri &uri, HTTPMethod method\n    )\n        : _fn(fn), _ufn(ufn), _uri(uri.clone()), _method(method) {\n        _uri->initPathArgs(pathArgs);\n    }\n\n    ~FunctionRequestHandler() {\n        delete _uri;\n    }\n\n    bool canHandle(HTTPMethod requestMethod, String requestUri) override {\n        if (_method != HTTP_ANY && _method != requestMethod)\n            return false;\n\n        return _uri->canHandle(requestUri, pathArgs);\n    }\n\n    bool canUpload(String requestUri) override {\n        if (!_ufn || !canHandle(HTTP_POST, requestUri))\n            return false;\n\n        return true;\n    }\n\n    bool handle(WebServer &server, HTTPMethod requestMethod, String requestUri) override {\n        (void)server;\n        if (!canHandle(requestMethod, requestUri))\n            return false;\n\n        _fn();\n        return true;\n    }\n\n    void upload(WebServer &server, String requestUri, HTTPUpload &upload) override {\n        (void)server;\n        (void)upload;\n        if (canUpload(requestUri))\n            _ufn();\n    }\n\n  protected:\n    WebServer::THandlerFunction _fn;\n    WebServer::THandlerFunction _ufn;\n    Uri *_uri;\n    HTTPMethod _method;\n};\n\nclass StaticRequestHandler : public RequestHandler {\n  public:\n    StaticRequestHandler(FS &fs, const char *path, const char *uri, const char *cache_header)\n        : _fs(fs), _uri(uri), _path(path), _cache_header(cache_header) {\n        File f  = fs.open(path);\n        _isFile = (f && (!f.isDirectory()));\n        log_v(\n            \"StaticRequestHandler: path=%s uri=%s isFile=%d, cache_header=%s\\r\\n\",\n            path,\n            uri,\n            _isFile,\n            cache_header ? cache_header : \"\"\n        ); // issue 5506 - cache_header can be nullptr\n        _baseUriLength = _uri.length();\n    }\n\n    bool canHandle(HTTPMethod requestMethod, String requestUri) override {\n        if (requestMethod != HTTP_GET)\n            return false;\n\n        if ((_isFile && requestUri != _uri) || !requestUri.startsWith(_uri))\n            return false;\n\n        return true;\n    }\n\n    bool handle(WebServer &server, HTTPMethod requestMethod, String requestUri) override {\n        if (!canHandle(requestMethod, requestUri))\n            return false;\n\n        log_v(\"StaticRequestHandler::handle: request=%s _uri=%s\\r\\n\", requestUri.c_str(), _uri.c_str());\n\n        String path(_path);\n\n        if (!_isFile) {\n            // Base URI doesn't point to a file.\n            // If a directory is requested, look for index file.\n            if (requestUri.endsWith(\"/\"))\n                requestUri += \"index.htm\";\n\n            // Append whatever follows this URI in request to get the file path.\n            path += requestUri.substring(_baseUriLength);\n        }\n        log_v(\"StaticRequestHandler::handle: path=%s, isFile=%d\\r\\n\", path.c_str(), _isFile);\n\n        String contentType = getContentType(path);\n\n        // look for gz file, only if the original specified path is not a gz.  So part only works to send gzip via\n        // content encoding when a non compressed is asked for if you point the the path to gzip you will serve the gzip\n        // as content type \"application/x-gzip\", not text or javascript etc...\n        if (!path.endsWith(FPSTR(mimeTable[gz].endsWith)) && !_fs.exists(path)) {\n            String pathWithGz = path + FPSTR(mimeTable[gz].endsWith);\n            if (_fs.exists(pathWithGz))\n                path += FPSTR(mimeTable[gz].endsWith);\n        }\n\n        File f = _fs.open(path, \"r\");\n        if (!f || !f.available())\n            return false;\n\n        if (_cache_header.length() != 0)\n            server.sendHeader(\"Cache-Control\", _cache_header);\n\n        server.streamFile(f, contentType);\n        return true;\n    }\n\n    static String getContentType(const String &path) {\n        char buff[sizeof(mimeTable[0].mimeType)];\n        // Check all entries but last one for match, return if found\n        for (size_t i = 0; i < sizeof(mimeTable) / sizeof(mimeTable[0]) - 1; i++) {\n            strcpy_P(buff, mimeTable[i].endsWith);\n            if (path.endsWith(buff)) {\n                strcpy_P(buff, mimeTable[i].mimeType);\n                return String(buff);\n            }\n        }\n        // Fall-through and just return default type\n        strcpy_P(buff, mimeTable[sizeof(mimeTable) / sizeof(mimeTable[0]) - 1].mimeType);\n        return String(buff);\n    }\n\n  protected:\n    FS _fs;\n    String _uri;\n    String _path;\n    String _cache_header;\n    bool _isFile;\n    size_t _baseUriLength;\n};\n
"},{"location":"ltapi/mimetable_8cpp/","title":"File mimetable.cpp","text":"

FileList > arduino > libraries > ext > WebServer > detail > mimetable.cpp

Go to the source code of this file.

  • #include \"mimetable.h\"
  • #include \"pgmspace.h\"
"},{"location":"ltapi/mimetable_8cpp/#namespaces","title":"Namespaces","text":"Type Name namespace mime

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/detail/mimetable.cpp

"},{"location":"ltapi/mimetable_8cpp_source/","title":"File mimetable.cpp","text":"

File List > arduino > libraries > ext > WebServer > detail > mimetable.cpp

Go to the documentation of this file.

#include \"mimetable.h\"\n#include \"pgmspace.h\"\n\nnamespace mime {\n\n// Table of extension->MIME strings stored in PROGMEM, needs to be global due to GCC section typing rules\nconst Entry mimeTable[maxType] = {\n    {\".html\",     \"text/html\"                    },\n    {\".htm\",         \"text/html\"                    },\n    {\".css\",         \"text/css\"                    },\n    {\".txt\",         \"text/plain\"                    },\n    {\".js\",     \"application/javascript\"        },\n    {\".json\",     \"application/json\"                },\n    {\".png\",         \"image/png\"                    },\n    {\".gif\",         \"image/gif\"                    },\n    {\".jpg\",         \"image/jpeg\"                    },\n    {\".ico\",         \"image/x-icon\"                },\n    {\".svg\",         \"image/svg+xml\"                },\n    {\".ttf\",         \"application/x-font-ttf\"        },\n    {\".otf\",         \"application/x-font-opentype\"  },\n    {\".woff\",     \"application/font-woff\"        },\n    {\".woff2\",     \"application/font-woff2\"    },\n    {\".eot\",         \"application/vnd.ms-fontobject\"},\n    {\".sfnt\",     \"application/font-sfnt\"        },\n    {\".xml\",         \"text/xml\"                    },\n    {\".pdf\",         \"application/pdf\"            },\n    {\".zip\",         \"application/zip\"            },\n    {\".gz\",     \"application/x-gzip\"            },\n    {\".appcache\", \"text/cache-manifest\"        },\n    {\"\",          \"application/octet-stream\"       }\n};\n\n} // namespace mime\n
"},{"location":"ltapi/mimetable_8h/","title":"File mimetable.h","text":"

FileList > arduino > libraries > ext > WebServer > detail > mimetable.h

Go to the source code of this file.

"},{"location":"ltapi/mimetable_8h/#namespaces","title":"Namespaces","text":"Type Name namespace mime"},{"location":"ltapi/mimetable_8h/#classes","title":"Classes","text":"Type Name struct Entry

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/detail/mimetable.h

"},{"location":"ltapi/mimetable_8h_source/","title":"File mimetable.h","text":"

File List > arduino > libraries > ext > WebServer > detail > mimetable.h

Go to the documentation of this file.

#pragma once\n\nnamespace mime {\n\nenum type {\n    html,\n    htm,\n    css,\n    txt,\n    js,\n    json,\n    png,\n    gif,\n    jpg,\n    ico,\n    svg,\n    ttf,\n    otf,\n    woff,\n    woff2,\n    eot,\n    sfnt,\n    xml,\n    pdf,\n    zip,\n    gz,\n    appcache,\n    none,\n    maxType\n};\n\nstruct Entry {\n    const char endsWith[16];\n    const char mimeType[32];\n};\n\nextern const Entry mimeTable[maxType];\n} // namespace mime\n
"},{"location":"ltapi/dir_d96db7fd7f8e0e902a4f4b8f7da27505/","title":"Dir cores/common/arduino/libraries/ext/WebServer/uri","text":"

FileList > arduino > libraries > ext > WebServer > uri

"},{"location":"ltapi/dir_d96db7fd7f8e0e902a4f4b8f7da27505/#files","title":"Files","text":"Type Name file UriBraces.h file UriGlob.h file UriRegex.h

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/uri/

"},{"location":"ltapi/_uri_braces_8h/","title":"File UriBraces.h","text":"

FileList > arduino > libraries > ext > WebServer > uri > UriBraces.h

Go to the source code of this file.

  • #include \"Uri.h\"
"},{"location":"ltapi/_uri_braces_8h/#classes","title":"Classes","text":"Type Name class UriBraces

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/uri/UriBraces.h

"},{"location":"ltapi/_uri_braces_8h_source/","title":"File UriBraces.h","text":"

File List > arduino > libraries > ext > WebServer > uri > UriBraces.h

Go to the documentation of this file.

#pragma once\n\n#include \"Uri.h\"\n\nclass UriBraces : public Uri {\n\n  public:\n    explicit UriBraces(const char *uri) : Uri(uri){};\n    explicit UriBraces(const String &uri) : Uri(uri){};\n\n    Uri *clone() const override final {\n        return new UriBraces(_uri);\n    };\n\n    void initPathArgs(std::vector<String> &pathArgs) override final {\n        int numParams = 0, start = 0;\n        do {\n            start = _uri.indexOf(\"{}\", start);\n            if (start > 0) {\n                numParams++;\n                start += 2;\n            }\n        } while (start > 0);\n        pathArgs.resize(numParams);\n    }\n\n    bool canHandle(const String &requestUri, std::vector<String> &pathArgs) override final {\n        if (Uri::canHandle(requestUri, pathArgs))\n            return true;\n\n        size_t uriLength             = _uri.length();\n        unsigned int pathArgIndex    = 0;\n        unsigned int requestUriIndex = 0;\n        for (unsigned int i = 0; i < uriLength; i++, requestUriIndex++) {\n            char uriChar        = _uri[i];\n            char requestUriChar = requestUri[requestUriIndex];\n\n            if (uriChar == requestUriChar)\n                continue;\n            if (uriChar != '{')\n                return false;\n\n            i += 2; // index of char after '}'\n            if (i >= uriLength) {\n                // there is no char after '}'\n                pathArgs[pathArgIndex] = requestUri.substring(requestUriIndex);\n                return pathArgs[pathArgIndex].indexOf(\"/\") == -1; // path argument may not contain a '/'\n            } else {\n                char charEnd = _uri[i];\n                int uriIndex = requestUri.indexOf(charEnd, requestUriIndex);\n                if (uriIndex < 0)\n                    return false;\n                pathArgs[pathArgIndex] = requestUri.substring(requestUriIndex, uriIndex);\n                requestUriIndex        = (unsigned int)uriIndex;\n            }\n            pathArgIndex++;\n        }\n\n        return requestUriIndex >= requestUri.length();\n    }\n};\n
"},{"location":"ltapi/_uri_glob_8h/","title":"File UriGlob.h","text":"

FileList > arduino > libraries > ext > WebServer > uri > UriGlob.h

Go to the source code of this file.

  • #include \"Uri.h\"
  • #include <fnmatch.h>
"},{"location":"ltapi/_uri_glob_8h/#classes","title":"Classes","text":"Type Name class UriGlob

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/uri/UriGlob.h

"},{"location":"ltapi/_uri_glob_8h_source/","title":"File UriGlob.h","text":"

File List > arduino > libraries > ext > WebServer > uri > UriGlob.h

Go to the documentation of this file.

#pragma once\n\n#include \"Uri.h\"\n#include <fnmatch.h>\n\nclass UriGlob : public Uri {\n\n  public:\n    explicit UriGlob(const char *uri) : Uri(uri){};\n    explicit UriGlob(const String &uri) : Uri(uri){};\n\n    Uri *clone() const override final {\n        return new UriGlob(_uri);\n    };\n\n    bool canHandle(const String &requestUri, __attribute__((unused)) std::vector<String> &pathArgs) override final {\n        return fnmatch(_uri.c_str(), requestUri.c_str(), 0) == 0;\n    }\n};\n
"},{"location":"ltapi/_uri_regex_8h/","title":"File UriRegex.h","text":"

FileList > arduino > libraries > ext > WebServer > uri > UriRegex.h

Go to the source code of this file.

  • #include \"Uri.h\"
  • #include <regex>
"},{"location":"ltapi/_uri_regex_8h/#classes","title":"Classes","text":"Type Name class UriRegex

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WebServer/uri/UriRegex.h

"},{"location":"ltapi/_uri_regex_8h_source/","title":"File UriRegex.h","text":"

File List > arduino > libraries > ext > WebServer > uri > UriRegex.h

Go to the documentation of this file.

#pragma once\n\n#include \"Uri.h\"\n#include <regex>\n\nclass UriRegex : public Uri {\n\n  public:\n    explicit UriRegex(const char *uri) : Uri(uri){};\n    explicit UriRegex(const String &uri) : Uri(uri){};\n\n    Uri *clone() const override final {\n        return new UriRegex(_uri);\n    };\n\n    void initPathArgs(std::vector<String> &pathArgs) override final {\n        std::regex rgx((_uri + \"|\").c_str());\n        std::smatch matches;\n        std::string s{\"\"};\n        std::regex_search(s, matches, rgx);\n        pathArgs.resize(matches.size() - 1);\n    }\n\n    bool canHandle(const String &requestUri, std::vector<String> &pathArgs) override final {\n        if (Uri::canHandle(requestUri, pathArgs))\n            return true;\n\n        unsigned int pathArgIndex = 0;\n        std::regex rgx(_uri.c_str());\n        std::smatch matches;\n        std::string s(requestUri.c_str());\n        if (std::regex_search(s, matches, rgx)) {\n            for (size_t i = 1; i < matches.size(); ++i) { // skip first\n                pathArgs[pathArgIndex] = String(matches[i].str().c_str());\n                pathArgIndex++;\n            }\n            return true;\n        }\n        return false;\n    }\n};\n
"},{"location":"ltapi/dir_466525e97edd1426939c6f6f1c4cc401/","title":"Dir cores/common/arduino/libraries/ext/WiFiMulti","text":"

FileList > arduino > libraries > ext > WiFiMulti

"},{"location":"ltapi/dir_466525e97edd1426939c6f6f1c4cc401/#files","title":"Files","text":"Type Name file WiFiMulti.cpp file WiFiMulti.h

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WiFiMulti/

"},{"location":"ltapi/_wi_fi_multi_8cpp/","title":"File WiFiMulti.cpp","text":"

FileList > arduino > libraries > ext > WiFiMulti > WiFiMulti.cpp

Go to the source code of this file.

More...

"},{"location":"ltapi/_wi_fi_multi_8cpp/#detailed-description","title":"Detailed Description","text":"

Date:

16.05.2015

Author:

Markus Sattler

Copyright (c) 2015 Markus Sattler. All rights reserved. This file is part of the esp8266 core for Arduino environment.

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WiFiMulti/WiFiMulti.cpp

"},{"location":"ltapi/_wi_fi_multi_8cpp_source/","title":"File WiFiMulti.cpp","text":"

File List > arduino > libraries > ext > WiFiMulti > WiFiMulti.cpp

Go to the documentation of this file.

#if LT_ARD_HAS_WIFI\n\n#include \"WiFiMulti.h\"\n#include <Arduino.h>\n#include <limits.h>\n#include <string.h>\n\nWiFiMulti::WiFiMulti() {}\n\nWiFiMulti::~WiFiMulti() {\n    for (uint32_t i = 0; i < APlist.size(); i++) {\n        WifiAPlist_t entry = APlist[i];\n        if (entry.ssid) {\n            free(entry.ssid);\n        }\n        if (entry.passphrase) {\n            free(entry.passphrase);\n        }\n    }\n    APlist.clear();\n}\n\nbool WiFiMulti::addAP(const char *ssid, const char *passphrase) {\n    WifiAPlist_t newAP;\n\n    if (!ssid || *ssid == 0x00 || strlen(ssid) > 31) {\n        // fail SSID too long or missing!\n        LT_EM(WIFI, \"SSID missing or too long\");\n        return false;\n    }\n\n    if (passphrase && strlen(passphrase) > 64) {\n        // fail passphrase too long!\n        LT_EM(WIFI, \"Passphrase too long\");\n        return false;\n    }\n\n    newAP.ssid = strdup(ssid);\n\n    if (!newAP.ssid) {\n        LT_EM(WIFI, \"Fail newAP.ssid == 0\");\n        return false;\n    }\n\n    if (passphrase && *passphrase != 0x00) {\n        newAP.passphrase = strdup(passphrase);\n        if (!newAP.passphrase) {\n            LT_EM(WIFI, \"Fail newAP.passphrase == 0\");\n            free(newAP.ssid);\n            return false;\n        }\n    } else {\n        newAP.passphrase = NULL;\n    }\n\n    APlist.push_back(newAP);\n    LT_VM(WIFI, \"Add SSID: %s\", newAP.ssid);\n    return true;\n}\n\nuint8_t WiFiMulti::run(uint32_t connectTimeout) {\n    int8_t scanResult;\n    uint8_t status = WiFi.status();\n    if (status == WL_CONNECTED) {\n        for (uint32_t x = 0; x < APlist.size(); x++) {\n            if (WiFi.SSID() == APlist[x].ssid) {\n                return status;\n            }\n        }\n        WiFi.disconnect(false);\n        delay(10);\n        status = WiFi.status();\n    }\n\n    scanResult = WiFi.scanNetworks();\n    if (scanResult == WIFI_SCAN_RUNNING) {\n        // scan is running\n        return WL_NO_SSID_AVAIL;\n    } else if (scanResult >= 0) {\n        // scan done analyze\n        WifiAPlist_t bestNetwork{NULL, NULL};\n        int bestNetworkDb = INT_MIN;\n        uint8_t bestBSSID[6];\n        int32_t bestChannel = 0;\n\n        LT_IM(WIFI, \"Scan finished\");\n\n        if (scanResult == 0) {\n            LT_IM(WIFI, \"No networks found\");\n        } else {\n            LT_IM(WIFI, \"%d networks found\", scanResult);\n            for (int8_t i = 0; i < scanResult; ++i) {\n\n                String ssid_scan;\n                int32_t rssi_scan;\n                WiFiAuthMode sec_scan;\n                uint8_t *BSSID_scan;\n                int32_t chan_scan;\n\n                WiFi.getNetworkInfo(i, ssid_scan, sec_scan, rssi_scan, BSSID_scan, chan_scan);\n\n                bool known = false;\n                for (uint32_t x = APlist.size(); x > 0; x--) {\n                    WifiAPlist_t entry = APlist[x - 1];\n\n                    if (ssid_scan == entry.ssid) { // SSID match\n                        known = true;\n                        if (rssi_scan > bestNetworkDb) { // best network\n                            if (sec_scan == WIFI_AUTH_OPEN ||\n                                entry.passphrase) { // check for passphrase if not open wlan\n                                bestNetworkDb = rssi_scan;\n                                bestChannel   = chan_scan;\n                                memcpy((void *)&bestNetwork, (void *)&entry, sizeof(bestNetwork));\n                                memcpy((void *)&bestBSSID, (void *)BSSID_scan, sizeof(bestBSSID));\n                            }\n                        }\n                        break;\n                    }\n                }\n\n                if (known) {\n                    LT_DM(\n                        WIFI,\n                        \" --->   %d: [%d][%02X:%02X:%02X:%02X:%02X:%02X] %s (%d) %c\",\n                        i,\n                        chan_scan,\n                        BSSID_scan[0],\n                        BSSID_scan[1],\n                        BSSID_scan[2],\n                        BSSID_scan[3],\n                        BSSID_scan[4],\n                        BSSID_scan[5],\n                        ssid_scan.c_str(),\n                        rssi_scan,\n                        (sec_scan == WIFI_AUTH_OPEN) ? ' ' : '*'\n                    );\n                } else {\n                    LT_DM(\n                        WIFI,\n                        \"       %d: [%d][%02X:%02X:%02X:%02X:%02X:%02X] %s (%d) %c\",\n                        i,\n                        chan_scan,\n                        BSSID_scan[0],\n                        BSSID_scan[1],\n                        BSSID_scan[2],\n                        BSSID_scan[3],\n                        BSSID_scan[4],\n                        BSSID_scan[5],\n                        ssid_scan.c_str(),\n                        rssi_scan,\n                        (sec_scan == WIFI_AUTH_OPEN) ? ' ' : '*'\n                    );\n                }\n            }\n        }\n\n        // clean up ram\n        WiFi.scanDelete();\n\n        if (bestNetwork.ssid) {\n            LT_IM(\n                WIFI,\n                \"Connecting to BSSID: %02X:%02X:%02X:%02X:%02X:%02X SSID: %s Channel: %d (%d)\",\n                bestBSSID[0],\n                bestBSSID[1],\n                bestBSSID[2],\n                bestBSSID[3],\n                bestBSSID[4],\n                bestBSSID[5],\n                bestNetwork.ssid,\n                bestChannel,\n                bestNetworkDb\n            );\n\n            WiFi.begin(bestNetwork.ssid, bestNetwork.passphrase, bestChannel, bestBSSID);\n            status = WiFi.status();\n\n            auto startTime = millis();\n            // wait for connection, fail, or timeout\n            while (status != WL_CONNECTED && status != WL_NO_SSID_AVAIL && status != WL_CONNECT_FAILED &&\n                   (millis() - startTime) <= connectTimeout) {\n                delay(10);\n                status = WiFi.status();\n            }\n\n            IPAddress ip;\n            switch (status) {\n                case WL_CONNECTED:\n                    LT_IM(WIFI, \"Connecting done\");\n                    LT_DM(WIFI, \"SSID: %s\", WiFi.SSID().c_str());\n                    // TODO fix this after implementing IP format for printf()\n                    ip = WiFi.localIP();\n                    LT_DM(WIFI, \"IP: %u.%u.%u.%u\", ip[0], ip[1], ip[2], ip[3]);\n                    LT_DM(WIFI, \"MAC: %s\", WiFi.BSSIDstr().c_str());\n                    LT_DM(WIFI, \"Channel: %d\", WiFi.channel());\n                    break;\n                case WL_NO_SSID_AVAIL:\n                    LT_EM(WIFI, \"Connecting failed; AP not found\");\n                    break;\n                case WL_CONNECT_FAILED:\n                    LT_EM(WIFI, \"Connecting failed\");\n                    break;\n                default:\n                    LT_EM(WIFI, \"Connecting failed (%d)\", status);\n                    break;\n            }\n        } else {\n            LT_EM(WIFI, \"No matching network found!\");\n        }\n    } else {\n        // start scan\n        LT_VM(WIFI, \"Delete old wifi config...\");\n        WiFi.disconnect();\n\n        LT_DM(WIFI, \"Start scan\");\n        // scan wifi async mode\n        WiFi.scanNetworks(true);\n    }\n\n    return status;\n}\n\n#endif // LT_ARD_HAS_WIFI\n
"},{"location":"ltapi/_wi_fi_multi_8h/","title":"File WiFiMulti.h","text":"

FileList > arduino > libraries > ext > WiFiMulti > WiFiMulti.h

Go to the source code of this file.

  • #include \"WiFi.h\"
  • #include <vector>
"},{"location":"ltapi/_wi_fi_multi_8h/#classes","title":"Classes","text":"Type Name class WiFiMulti struct WifiAPlist_t

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/WiFiMulti/WiFiMulti.h

"},{"location":"ltapi/_wi_fi_multi_8h_source/","title":"File WiFiMulti.h","text":"

File List > arduino > libraries > ext > WiFiMulti > WiFiMulti.h

Go to the documentation of this file.

#pragma once\n\n#include \"WiFi.h\"\n#include <vector>\n\ntypedef struct {\n    char *ssid;\n    char *passphrase;\n} WifiAPlist_t;\n\nclass WiFiMulti {\n  public:\n    WiFiMulti();\n    ~WiFiMulti();\n\n    bool addAP(const char *ssid, const char *passphrase = NULL);\n\n    uint8_t run(uint32_t connectTimeout = 10000);\n\n  private:\n    std::vector<WifiAPlist_t> APlist;\n};\n
"},{"location":"ltapi/dir_e7aea143128db3d890560fea5ce624b6/","title":"Dir cores/common/arduino/libraries/ext/base64","text":"

FileList > arduino > libraries > ext > base64

"},{"location":"ltapi/dir_e7aea143128db3d890560fea5ce624b6/#files","title":"Files","text":"Type Name file base64.cpp file base64.h"},{"location":"ltapi/dir_e7aea143128db3d890560fea5ce624b6/#directories","title":"Directories","text":"Type Name dir libb64

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/base64/

"},{"location":"ltapi/base64_8cpp/","title":"File base64.cpp","text":"

FileList > arduino > libraries > ext > base64 > base64.cpp

Go to the source code of this file.

  • #include \"Arduino.h\"
  • #include \"libb64/cdecode.h\"
  • #include \"libb64/cencode.h\"
  • #include \"base64.h\"

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/base64/base64.cpp

"},{"location":"ltapi/base64_8cpp_source/","title":"File base64.cpp","text":"

File List > arduino > libraries > ext > base64 > base64.cpp

Go to the documentation of this file.

#include \"Arduino.h\"\nextern \"C\" {\n#include \"libb64/cdecode.h\"\n#include \"libb64/cencode.h\"\n}\n#include \"base64.h\"\n\nString base64::encode(const uint8_t * data, size_t length)\n{\n    size_t size = base64_encode_expected_len(length) + 1;\n    char * buffer = (char *) malloc(size);\n    if(buffer) {\n        base64_encodestate _state;\n        base64_init_encodestate(&_state);\n        int len = base64_encode_block((const char *) &data[0], length, &buffer[0], &_state);\n        len = base64_encode_blockend((buffer + len), &_state);\n\n        String base64 = String(buffer);\n        free(buffer);\n        return base64;\n    }\n    return String(\"-FAIL-\");\n}\n\nString base64::encode(const String& text)\n{\n    return base64::encode((uint8_t *) text.c_str(), text.length());\n}\n
"},{"location":"ltapi/base64_8h/","title":"File base64.h","text":"

FileList > arduino > libraries > ext > base64 > base64.h

Go to the source code of this file.

  • #include <Arduino.h>
"},{"location":"ltapi/base64_8h/#classes","title":"Classes","text":"Type Name class base64

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/base64/base64.h

"},{"location":"ltapi/base64_8h_source/","title":"File base64.h","text":"

File List > arduino > libraries > ext > base64 > base64.h

Go to the documentation of this file.

#pragma once\n\n#include <Arduino.h>\n\nclass base64 {\n  public:\n    static String encode(const uint8_t *data, size_t length);\n    static String encode(const String &text);\n};\n
"},{"location":"ltapi/dir_8526abab122814721f0f43c2acad511e/","title":"Dir cores/common/arduino/libraries/ext/base64/libb64","text":"

FileList > arduino > libraries > ext > base64 > libb64

"},{"location":"ltapi/dir_8526abab122814721f0f43c2acad511e/#files","title":"Files","text":"Type Name file cdecode.c file cdecode.h file cencode.c file cencode.h

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/base64/libb64/

"},{"location":"ltapi/cdecode_8c/","title":"File cdecode.c","text":"

FileList > arduino > libraries > ext > base64 > libb64 > cdecode.c

Go to the source code of this file.

  • #include \"cdecode.h\"
  • #include <stdint.h>
"},{"location":"ltapi/cdecode_8c/#public-functions","title":"Public Functions","text":"Type Name int base64_decode_block (const char * code_in, const int length_in, char * plaintext_out, base64_decodestate * state_in) int base64_decode_chars (const char * code_in, const int length_in, char * plaintext_out) int base64_decode_value (char value_in) void base64_init_decodestate (base64_decodestate * state_in)"},{"location":"ltapi/cdecode_8c/#public-static-functions","title":"Public Static Functions","text":"Type Name int base64_decode_block_signed (const int8_t * code_in, const int length_in, int8_t * plaintext_out, base64_decodestate * state_in) int base64_decode_chars_signed (const int8_t * code_in, const int length_in, int8_t * plaintext_out) int base64_decode_value_signed (int8_t value_in)"},{"location":"ltapi/cdecode_8c/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/cdecode_8c/#function-base64_decode_block","title":"function base64_decode_block","text":"
int base64_decode_block (\n    const char * code_in,\n    const int length_in,\n    char * plaintext_out,\n    base64_decodestate * state_in\n) \n
"},{"location":"ltapi/cdecode_8c/#function-base64_decode_chars","title":"function base64_decode_chars","text":"
int base64_decode_chars (\n    const char * code_in,\n    const int length_in,\n    char * plaintext_out\n) \n
"},{"location":"ltapi/cdecode_8c/#function-base64_decode_value","title":"function base64_decode_value","text":"
int base64_decode_value (\n    char value_in\n) \n
"},{"location":"ltapi/cdecode_8c/#function-base64_init_decodestate","title":"function base64_init_decodestate","text":"
void base64_init_decodestate (\n    base64_decodestate * state_in\n) \n
"},{"location":"ltapi/cdecode_8c/#public-static-functions-documentation","title":"Public Static Functions Documentation","text":""},{"location":"ltapi/cdecode_8c/#function-base64_decode_block_signed","title":"function base64_decode_block_signed","text":"
static int base64_decode_block_signed (\n    const int8_t * code_in,\n    const int length_in,\n    int8_t * plaintext_out,\n    base64_decodestate * state_in\n) \n
"},{"location":"ltapi/cdecode_8c/#function-base64_decode_chars_signed","title":"function base64_decode_chars_signed","text":"
static int base64_decode_chars_signed (\n    const int8_t * code_in,\n    const int length_in,\n    int8_t * plaintext_out\n) \n
"},{"location":"ltapi/cdecode_8c/#function-base64_decode_value_signed","title":"function base64_decode_value_signed","text":"
static int base64_decode_value_signed (\n    int8_t value_in\n) \n

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/base64/libb64/cdecode.c

"},{"location":"ltapi/cdecode_8c_source/","title":"File cdecode.c","text":"

File List > arduino > libraries > ext > base64 > libb64 > cdecode.c

Go to the documentation of this file.

/*\ncdecoder.c - c source to a base64 decoding algorithm implementation\n\nThis is part of the libb64 project, and has been placed in the public domain.\nFor details, see http://sourceforge.net/projects/libb64\n*/\n\n#include \"cdecode.h\"\n#include <stdint.h>\n\nstatic int base64_decode_value_signed(int8_t value_in){\n  static const int8_t decoding[] = {62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-2,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51};\n  static const int8_t decoding_size = sizeof(decoding);\n  value_in -= 43;\n  if (value_in < 0 || value_in >= decoding_size) return -1;\n  return decoding[(int)value_in];\n}\n\nvoid base64_init_decodestate(base64_decodestate* state_in){\n  state_in->step = step_a;\n  state_in->plainchar = 0;\n}\n\nstatic int base64_decode_block_signed(const int8_t* code_in, const int length_in, int8_t* plaintext_out, base64_decodestate* state_in){\n  const int8_t* codechar = code_in;\n  int8_t* plainchar = plaintext_out;\n  int8_t fragment;\n\n  *plainchar = state_in->plainchar;\n\n  switch (state_in->step){\n    while (1){\n      case step_a:\n        do {\n          if (codechar == code_in+length_in){\n            state_in->step = step_a;\n            state_in->plainchar = *plainchar;\n            return plainchar - plaintext_out;\n          }\n          fragment = (int8_t)base64_decode_value_signed(*codechar++);\n        } while (fragment < 0);\n        *plainchar    = (fragment & 0x03f) << 2;\n      case step_b:\n        do {\n          if (codechar == code_in+length_in){\n            state_in->step = step_b;\n            state_in->plainchar = *plainchar;\n            return plainchar - plaintext_out;\n          }\n          fragment = (int8_t)base64_decode_value_signed(*codechar++);\n        } while (fragment < 0);\n        *plainchar++ |= (fragment & 0x030) >> 4;\n        *plainchar    = (fragment & 0x00f) << 4;\n      case step_c:\n        do {\n          if (codechar == code_in+length_in){\n            state_in->step = step_c;\n            state_in->plainchar = *plainchar;\n            return plainchar - plaintext_out;\n          }\n          fragment = (int8_t)base64_decode_value_signed(*codechar++);\n        } while (fragment < 0);\n        *plainchar++ |= (fragment & 0x03c) >> 2;\n        *plainchar    = (fragment & 0x003) << 6;\n      case step_d:\n        do {\n          if (codechar == code_in+length_in){\n            state_in->step = step_d;\n            state_in->plainchar = *plainchar;\n            return plainchar - plaintext_out;\n          }\n          fragment = (int8_t)base64_decode_value_signed(*codechar++);\n        } while (fragment < 0);\n        *plainchar++   |= (fragment & 0x03f);\n    }\n  }\n  /* control should not reach here */\n  return plainchar - plaintext_out;\n}\n\nstatic int base64_decode_chars_signed(const int8_t* code_in, const int length_in, int8_t* plaintext_out){\n  base64_decodestate _state;\n  base64_init_decodestate(&_state);\n  int len = base64_decode_block_signed(code_in, length_in, plaintext_out, &_state);\n  if(len > 0) plaintext_out[len] = 0;\n  return len;\n}\n\nint base64_decode_value(char value_in){\n  return base64_decode_value_signed(*((int8_t *) &value_in));\n}\n\nint base64_decode_block(const char* code_in, const int length_in, char* plaintext_out, base64_decodestate* state_in){\n  return base64_decode_block_signed((int8_t *) code_in, length_in, (int8_t *) plaintext_out, state_in);\n}\n\nint base64_decode_chars(const char* code_in, const int length_in, char* plaintext_out){\n  return base64_decode_chars_signed((int8_t *) code_in, length_in, (int8_t *) plaintext_out);\n}\n
"},{"location":"ltapi/cdecode_8h/","title":"File cdecode.h","text":"

FileList > arduino > libraries > ext > base64 > libb64 > cdecode.h

Go to the source code of this file.

"},{"location":"ltapi/cdecode_8h/#classes","title":"Classes","text":"Type Name struct base64_decodestate"},{"location":"ltapi/cdecode_8h/#public-types","title":"Public Types","text":"Type Name enum base64_decodestep"},{"location":"ltapi/cdecode_8h/#public-functions","title":"Public Functions","text":"Type Name int base64_decode_block (const char * code_in, const int length_in, char * plaintext_out, base64_decodestate * state_in) int base64_decode_chars (const char * code_in, const int length_in, char * plaintext_out) int base64_decode_value (char value_in) void base64_init_decodestate (base64_decodestate * state_in)"},{"location":"ltapi/cdecode_8h/#macros","title":"Macros","text":"Type Name define base64_decode_expected_len (n) ((n * 3) / 4)"},{"location":"ltapi/cdecode_8h/#public-types-documentation","title":"Public Types Documentation","text":""},{"location":"ltapi/cdecode_8h/#enum-base64_decodestep","title":"enum base64_decodestep","text":"
enum base64_decodestep {\n    step_a,\n    step_b,\n    step_c,\n    step_d\n};\n
"},{"location":"ltapi/cdecode_8h/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/cdecode_8h/#function-base64_decode_block","title":"function base64_decode_block","text":"
int base64_decode_block (\n    const char * code_in,\n    const int length_in,\n    char * plaintext_out,\n    base64_decodestate * state_in\n) \n
"},{"location":"ltapi/cdecode_8h/#function-base64_decode_chars","title":"function base64_decode_chars","text":"
int base64_decode_chars (\n    const char * code_in,\n    const int length_in,\n    char * plaintext_out\n) \n
"},{"location":"ltapi/cdecode_8h/#function-base64_decode_value","title":"function base64_decode_value","text":"
int base64_decode_value (\n    char value_in\n) \n
"},{"location":"ltapi/cdecode_8h/#function-base64_init_decodestate","title":"function base64_init_decodestate","text":"
void base64_init_decodestate (\n    base64_decodestate * state_in\n) \n
"},{"location":"ltapi/cdecode_8h/#macro-definition-documentation","title":"Macro Definition Documentation","text":""},{"location":"ltapi/cdecode_8h/#define-base64_decode_expected_len","title":"define base64_decode_expected_len","text":"
#define base64_decode_expected_len (\n    n\n) ((n * 3) / 4)\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/base64/libb64/cdecode.h

"},{"location":"ltapi/cdecode_8h_source/","title":"File cdecode.h","text":"

File List > arduino > libraries > ext > base64 > libb64 > cdecode.h

Go to the documentation of this file.

/*\ncdecode.h - c header for a base64 decoding algorithm\n\nThis is part of the libb64 project, and has been placed in the public domain.\nFor details, see http://sourceforge.net/projects/libb64\n*/\n\n#ifndef BASE64_CDECODE_H\n#define BASE64_CDECODE_H\n\n#define base64_decode_expected_len(n) ((n * 3) / 4)\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef enum {\n    step_a, step_b, step_c, step_d\n} base64_decodestep;\n\ntypedef struct {\n    base64_decodestep step;\n    char plainchar;\n} base64_decodestate;\n\nvoid base64_init_decodestate(base64_decodestate* state_in);\n\nint base64_decode_value(char value_in);\n\nint base64_decode_block(const char* code_in, const int length_in, char* plaintext_out, base64_decodestate* state_in);\n\nint base64_decode_chars(const char* code_in, const int length_in, char* plaintext_out);\n\n#ifdef __cplusplus\n} // extern \"C\"\n#endif\n\n#endif /* BASE64_CDECODE_H */\n
"},{"location":"ltapi/cencode_8c/","title":"File cencode.c","text":"

FileList > arduino > libraries > ext > base64 > libb64 > cencode.c

Go to the source code of this file.

  • #include \"cencode.h\"
"},{"location":"ltapi/cencode_8c/#public-functions","title":"Public Functions","text":"Type Name int base64_encode_block (const char * plaintext_in, int length_in, char * code_out, base64_encodestate * state_in) int base64_encode_blockend (char * code_out, base64_encodestate * state_in) int base64_encode_chars (const char * plaintext_in, int length_in, char * code_out) char base64_encode_value (char value_in) void base64_init_encodestate (base64_encodestate * state_in)"},{"location":"ltapi/cencode_8c/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/cencode_8c/#function-base64_encode_block","title":"function base64_encode_block","text":"
int base64_encode_block (\n    const char * plaintext_in,\n    int length_in,\n    char * code_out,\n    base64_encodestate * state_in\n) \n
"},{"location":"ltapi/cencode_8c/#function-base64_encode_blockend","title":"function base64_encode_blockend","text":"
int base64_encode_blockend (\n    char * code_out,\n    base64_encodestate * state_in\n) \n
"},{"location":"ltapi/cencode_8c/#function-base64_encode_chars","title":"function base64_encode_chars","text":"
int base64_encode_chars (\n    const char * plaintext_in,\n    int length_in,\n    char * code_out\n) \n
"},{"location":"ltapi/cencode_8c/#function-base64_encode_value","title":"function base64_encode_value","text":"
char base64_encode_value (\n    char value_in\n) \n
"},{"location":"ltapi/cencode_8c/#function-base64_init_encodestate","title":"function base64_init_encodestate","text":"
void base64_init_encodestate (\n    base64_encodestate * state_in\n) \n

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/base64/libb64/cencode.c

"},{"location":"ltapi/cencode_8c_source/","title":"File cencode.c","text":"

File List > arduino > libraries > ext > base64 > libb64 > cencode.c

Go to the documentation of this file.

/*\ncencoder.c - c source to a base64 encoding algorithm implementation\n\nThis is part of the libb64 project, and has been placed in the public domain.\nFor details, see http://sourceforge.net/projects/libb64\n*/\n\n#include \"cencode.h\"\n\nvoid base64_init_encodestate(base64_encodestate* state_in)\n{\n    state_in->step = step_A;\n    state_in->result = 0;\n}\n\nchar base64_encode_value(char value_in)\n{\n    static const char* encoding = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n    if (value_in > 63) {\n        return '=';\n    }\n    return encoding[(int)value_in];\n}\n\nint base64_encode_block(const char* plaintext_in, int length_in, char* code_out, base64_encodestate* state_in)\n{\n    const char* plainchar = plaintext_in;\n    const char* const plaintextend = plaintext_in + length_in;\n    char* codechar = code_out;\n    char result;\n    char fragment;\n\n    result = state_in->result;\n\n    switch (state_in->step) {\n        while (1) {\n        case step_A:\n            if (plainchar == plaintextend) {\n                state_in->result = result;\n                state_in->step = step_A;\n                return codechar - code_out;\n            }\n            fragment = *plainchar++;\n            result = (fragment & 0x0fc) >> 2;\n            *codechar++ = base64_encode_value(result);\n            result = (fragment & 0x003) << 4;\n        case step_B:\n            if (plainchar == plaintextend) {\n                state_in->result = result;\n                state_in->step = step_B;\n                return codechar - code_out;\n            }\n            fragment = *plainchar++;\n            result |= (fragment & 0x0f0) >> 4;\n            *codechar++ = base64_encode_value(result);\n            result = (fragment & 0x00f) << 2;\n        case step_C:\n            if (plainchar == plaintextend) {\n                state_in->result = result;\n                state_in->step = step_C;\n                return codechar - code_out;\n            }\n            fragment = *plainchar++;\n            result |= (fragment & 0x0c0) >> 6;\n            *codechar++ = base64_encode_value(result);\n            result  = (fragment & 0x03f) >> 0;\n            *codechar++ = base64_encode_value(result);\n        }\n    }\n    /* control should not reach here */\n    return codechar - code_out;\n}\n\nint base64_encode_blockend(char* code_out, base64_encodestate* state_in)\n{\n    char* codechar = code_out;\n\n    switch (state_in->step) {\n    case step_B:\n        *codechar++ = base64_encode_value(state_in->result);\n        *codechar++ = '=';\n        *codechar++ = '=';\n        break;\n    case step_C:\n        *codechar++ = base64_encode_value(state_in->result);\n        *codechar++ = '=';\n        break;\n    case step_A:\n        break;\n    }\n    *codechar = 0x00;\n\n    return codechar - code_out;\n}\n\nint base64_encode_chars(const char* plaintext_in, int length_in, char* code_out)\n{\n    base64_encodestate _state;\n    base64_init_encodestate(&_state);\n    int len = base64_encode_block(plaintext_in, length_in, code_out, &_state);\n    return len + base64_encode_blockend((code_out + len), &_state);\n}\n
"},{"location":"ltapi/cencode_8h/","title":"File cencode.h","text":"

FileList > arduino > libraries > ext > base64 > libb64 > cencode.h

Go to the source code of this file.

"},{"location":"ltapi/cencode_8h/#classes","title":"Classes","text":"Type Name struct base64_encodestate"},{"location":"ltapi/cencode_8h/#public-types","title":"Public Types","text":"Type Name enum base64_encodestep"},{"location":"ltapi/cencode_8h/#public-functions","title":"Public Functions","text":"Type Name int base64_encode_block (const char * plaintext_in, int length_in, char * code_out, base64_encodestate * state_in) int base64_encode_blockend (char * code_out, base64_encodestate * state_in) int base64_encode_chars (const char * plaintext_in, int length_in, char * code_out) char base64_encode_value (char value_in) void base64_init_encodestate (base64_encodestate * state_in)"},{"location":"ltapi/cencode_8h/#macros","title":"Macros","text":"Type Name define base64_encode_expected_len (n) ((((4 * n) / 3) + 3) & ~3)"},{"location":"ltapi/cencode_8h/#public-types-documentation","title":"Public Types Documentation","text":""},{"location":"ltapi/cencode_8h/#enum-base64_encodestep","title":"enum base64_encodestep","text":"
enum base64_encodestep {\n    step_A,\n    step_B,\n    step_C\n};\n
"},{"location":"ltapi/cencode_8h/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/cencode_8h/#function-base64_encode_block","title":"function base64_encode_block","text":"
int base64_encode_block (\n    const char * plaintext_in,\n    int length_in,\n    char * code_out,\n    base64_encodestate * state_in\n) \n
"},{"location":"ltapi/cencode_8h/#function-base64_encode_blockend","title":"function base64_encode_blockend","text":"
int base64_encode_blockend (\n    char * code_out,\n    base64_encodestate * state_in\n) \n
"},{"location":"ltapi/cencode_8h/#function-base64_encode_chars","title":"function base64_encode_chars","text":"
int base64_encode_chars (\n    const char * plaintext_in,\n    int length_in,\n    char * code_out\n) \n
"},{"location":"ltapi/cencode_8h/#function-base64_encode_value","title":"function base64_encode_value","text":"
char base64_encode_value (\n    char value_in\n) \n
"},{"location":"ltapi/cencode_8h/#function-base64_init_encodestate","title":"function base64_init_encodestate","text":"
void base64_init_encodestate (\n    base64_encodestate * state_in\n) \n
"},{"location":"ltapi/cencode_8h/#macro-definition-documentation","title":"Macro Definition Documentation","text":""},{"location":"ltapi/cencode_8h/#define-base64_encode_expected_len","title":"define base64_encode_expected_len","text":"
#define base64_encode_expected_len (\n    n\n) ((((4 * n) / 3) + 3) & ~3)\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/base64/libb64/cencode.h

"},{"location":"ltapi/cencode_8h_source/","title":"File cencode.h","text":"

File List > arduino > libraries > ext > base64 > libb64 > cencode.h

Go to the documentation of this file.

/*\ncencode.h - c header for a base64 encoding algorithm\n\nThis is part of the libb64 project, and has been placed in the public domain.\nFor details, see http://sourceforge.net/projects/libb64\n*/\n\n#ifndef BASE64_CENCODE_H\n#define BASE64_CENCODE_H\n\n#define base64_encode_expected_len(n) ((((4 * n) / 3) + 3) & ~3)\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\ntypedef enum {\n    step_A, step_B, step_C\n} base64_encodestep;\n\ntypedef struct {\n    base64_encodestep step;\n    char result;\n    int stepcount;\n} base64_encodestate;\n\nvoid base64_init_encodestate(base64_encodestate* state_in);\n\nchar base64_encode_value(char value_in);\n\nint base64_encode_block(const char* plaintext_in, int length_in, char* code_out, base64_encodestate* state_in);\n\nint base64_encode_blockend(char* code_out, base64_encodestate* state_in);\n\nint base64_encode_chars(const char* plaintext_in, int length_in, char* code_out);\n\n#ifdef __cplusplus\n} // extern \"C\"\n#endif\n\n#endif /* BASE64_CENCODE_H */\n
"},{"location":"ltapi/dir_ac62547f78cd9f887119f688c741ca23/","title":"Dir cores/common/arduino/libraries/ext/cbuf","text":"

FileList > arduino > libraries > ext > cbuf

"},{"location":"ltapi/dir_ac62547f78cd9f887119f688c741ca23/#files","title":"Files","text":"Type Name file cbuf.cpp file cbuf.h

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/cbuf/

"},{"location":"ltapi/cbuf_8cpp/","title":"File cbuf.cpp","text":"

FileList > arduino > libraries > ext > cbuf > cbuf.cpp

Go to the source code of this file.

  • #include \"cbuf.h\"

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/cbuf/cbuf.cpp

"},{"location":"ltapi/cbuf_8cpp_source/","title":"File cbuf.cpp","text":"

File List > arduino > libraries > ext > cbuf > cbuf.cpp

Go to the documentation of this file.

/*\n cbuf.cpp - Circular buffer implementation\n Copyright (c) 2014 Ivan Grokhotkov. All rights reserved.\n This file is part of the esp8266 core for Arduino environment.\n\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation; either\n version 2.1 of the License, or (at your option) any later version.\n\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this library; if not, write to the Free Software\n Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#include \"cbuf.h\"\n\ncbuf::cbuf(size_t size) :\n    next(NULL), _size(size+1), _buf(new char[size+1]), _bufend(_buf + size + 1), _begin(_buf), _end(_begin)\n{\n}\n\ncbuf::~cbuf()\n{\n    delete[] _buf;\n}\n\nsize_t cbuf::resizeAdd(size_t addSize)\n{\n    return resize(_size + addSize);\n}\n\nsize_t cbuf::resize(size_t newSize)\n{\n\n    size_t bytes_available = available();\n    newSize += 1;\n    // not lose any data\n    // if data can be lost use remove or flush before resize\n    if((newSize < bytes_available) || (newSize == _size)) {\n        return _size;\n    }\n\n    char *newbuf = new char[newSize];\n    char *oldbuf = _buf;\n\n    if(!newbuf) {\n        return _size;\n    }\n\n    if(_buf) {\n        read(newbuf, bytes_available);\n        memset((newbuf + bytes_available), 0x00, (newSize - bytes_available));\n    }\n\n    _begin = newbuf;\n    _end = newbuf + bytes_available;\n    _bufend = newbuf + newSize;\n    _size = newSize;\n\n    _buf = newbuf;\n    delete[] oldbuf;\n\n    return _size;\n}\n\nsize_t cbuf::available() const\n{\n    if(_end >= _begin) {\n        return _end - _begin;\n    }\n    return _size - (_begin - _end);\n}\n\nsize_t cbuf::size()\n{\n    return _size;\n}\n\nsize_t cbuf::room() const\n{\n    if(_end >= _begin) {\n        return _size - (_end - _begin) - 1;\n    }\n    return _begin - _end - 1;\n}\n\nint cbuf::peek()\n{\n    if(empty()) {\n        return -1;\n    }\n\n    return static_cast<int>(*_begin);\n}\n\nsize_t cbuf::peek(char *dst, size_t size)\n{\n    size_t bytes_available = available();\n    size_t size_to_read = (size < bytes_available) ? size : bytes_available;\n    size_t size_read = size_to_read;\n    char * begin = _begin;\n    if(_end < _begin && size_to_read > (size_t) (_bufend - _begin)) {\n        size_t top_size = _bufend - _begin;\n        memcpy(dst, _begin, top_size);\n        begin = _buf;\n        size_to_read -= top_size;\n        dst += top_size;\n    }\n    memcpy(dst, begin, size_to_read);\n    return size_read;\n}\n\nint cbuf::read()\n{\n    if(empty()) {\n        return -1;\n    }\n\n    char result = *_begin;\n    _begin = wrap_if_bufend(_begin + 1);\n    return static_cast<int>(result);\n}\n\nsize_t cbuf::read(char* dst, size_t size)\n{\n    size_t bytes_available = available();\n    size_t size_to_read = (size < bytes_available) ? size : bytes_available;\n    size_t size_read = size_to_read;\n    if(_end < _begin && size_to_read > (size_t) (_bufend - _begin)) {\n        size_t top_size = _bufend - _begin;\n        memcpy(dst, _begin, top_size);\n        _begin = _buf;\n        size_to_read -= top_size;\n        dst += top_size;\n    }\n    memcpy(dst, _begin, size_to_read);\n    _begin = wrap_if_bufend(_begin + size_to_read);\n    return size_read;\n}\n\nsize_t cbuf::write(char c)\n{\n    if(full()) {\n        return 0;\n    }\n\n    *_end = c;\n    _end = wrap_if_bufend(_end + 1);\n    return 1;\n}\n\nsize_t cbuf::write(const char* src, size_t size)\n{\n    size_t bytes_available = room();\n    size_t size_to_write = (size < bytes_available) ? size : bytes_available;\n    size_t size_written = size_to_write;\n    if(_end >= _begin && size_to_write > (size_t) (_bufend - _end)) {\n        size_t top_size = _bufend - _end;\n        memcpy(_end, src, top_size);\n        _end = _buf;\n        size_to_write -= top_size;\n        src += top_size;\n    }\n    memcpy(_end, src, size_to_write);\n    _end = wrap_if_bufend(_end + size_to_write);\n    return size_written;\n}\n\nvoid cbuf::flush()\n{\n    _begin = _buf;\n    _end = _buf;\n}\n\nsize_t cbuf::remove(size_t size)\n{\n    size_t bytes_available = available();\n    if(size >= bytes_available) {\n        flush();\n        return 0;\n    }\n    size_t size_to_remove = (size < bytes_available) ? size : bytes_available;\n    if(_end < _begin && size_to_remove > (size_t) (_bufend - _begin)) {\n        size_t top_size = _bufend - _begin;\n        _begin = _buf;\n        size_to_remove -= top_size;\n    }\n    _begin = wrap_if_bufend(_begin + size_to_remove);\n    return available();\n}\n
"},{"location":"ltapi/cbuf_8h/","title":"File cbuf.h","text":"

FileList > arduino > libraries > ext > cbuf > cbuf.h

Go to the source code of this file.

  • #include <stddef.h>
  • #include <stdint.h>
  • #include <string.h>
"},{"location":"ltapi/cbuf_8h/#classes","title":"Classes","text":"Type Name class cbuf

The documentation for this class was generated from the following file cores/common/arduino/libraries/ext/cbuf/cbuf.h

"},{"location":"ltapi/cbuf_8h_source/","title":"File cbuf.h","text":"

File List > arduino > libraries > ext > cbuf > cbuf.h

Go to the documentation of this file.

/*\n cbuf.h - Circular buffer implementation\n Copyright (c) 2014 Ivan Grokhotkov. All rights reserved.\n This file is part of the esp8266 core for Arduino environment.\n\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation; either\n version 2.1 of the License, or (at your option) any later version.\n\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this library; if not, write to the Free Software\n Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#ifndef __cbuf_h\n#define __cbuf_h\n\n#include <stddef.h>\n#include <stdint.h>\n#include <string.h>\n\nclass cbuf\n{\npublic:\n    cbuf(size_t size);\n    ~cbuf();\n\n    size_t resizeAdd(size_t addSize);\n    size_t resize(size_t newSize);\n    size_t available() const;\n    size_t size();\n\n    size_t room() const;\n\n    inline bool empty() const\n    {\n        return _begin == _end;\n    }\n\n    inline bool full() const\n    {\n        return wrap_if_bufend(_end + 1) == _begin;\n    }\n\n    int peek();\n    size_t peek(char *dst, size_t size);\n\n    int read();\n    size_t read(char* dst, size_t size);\n\n    size_t write(char c);\n    size_t write(const char* src, size_t size);\n\n    void flush();\n    size_t remove(size_t size);\n\n    cbuf *next;\n\nprotected:\n    inline char* wrap_if_bufend(char* ptr) const\n    {\n        return (ptr == _bufend) ? _buf : ptr;\n    }\n\n    size_t _size;\n    char* _buf;\n    const char* _bufend;\n    char* _begin;\n    char* _end;\n\n};\n\n#endif//__cbuf_h\n
"},{"location":"ltapi/dir_930634efd5dc4a957bbb6e685a3ccda1/","title":"Dir cores/common/arduino/libraries/inline","text":"

FileList > arduino > libraries > inline

"},{"location":"ltapi/dir_930634efd5dc4a957bbb6e685a3ccda1/#files","title":"Files","text":"Type Name file Singletons.cpp"},{"location":"ltapi/dir_930634efd5dc4a957bbb6e685a3ccda1/#directories","title":"Directories","text":"Type Name dir ESP dir Flash dir LT dir OTA dir WDT

The documentation for this class was generated from the following file cores/common/arduino/libraries/inline/

"},{"location":"ltapi/_singletons_8cpp/","title":"File Singletons.cpp","text":"

FileList > arduino > libraries > inline > Singletons.cpp

Go to the source code of this file.

  • #include <LT.h>
  • #include <Flash.h>
"},{"location":"ltapi/_singletons_8cpp/#public-attributes","title":"Public Attributes","text":"Type Name EspClass ESP FlashClass Flash LibreTiny LT LibreTinyOTA OTA LibreTinyWDT WDT"},{"location":"ltapi/_singletons_8cpp/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/_singletons_8cpp/#variable-esp","title":"variable ESP","text":"
EspClass ESP;\n
"},{"location":"ltapi/_singletons_8cpp/#variable-flash","title":"variable Flash","text":"
FlashClass Flash;\n
"},{"location":"ltapi/_singletons_8cpp/#variable-lt","title":"variable LT","text":"
LibreTiny LT;\n
"},{"location":"ltapi/_singletons_8cpp/#variable-ota","title":"variable OTA","text":"
LibreTinyOTA OTA;\n
"},{"location":"ltapi/_singletons_8cpp/#variable-wdt","title":"variable WDT","text":"
LibreTinyWDT WDT;\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/inline/Singletons.cpp

"},{"location":"ltapi/_singletons_8cpp_source/","title":"File Singletons.cpp","text":"

File List > arduino > libraries > inline > Singletons.cpp

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2023-03-10. */\n\n#include <LT.h>\n\n#include <Flash.h>\n\nLibreTiny LT;\nLibreTinyOTA OTA;\nLibreTinyWDT WDT;\nEspClass ESP;\nFlashClass Flash;\n
"},{"location":"ltapi/dir_2f50d07e877c964a6683aa974aacc5a9/","title":"Dir cores/common/arduino/libraries/inline/ESP","text":"

FileList > arduino > libraries > inline > ESP

"},{"location":"ltapi/dir_2f50d07e877c964a6683aa974aacc5a9/#files","title":"Files","text":"Type Name file ESP.h

The documentation for this class was generated from the following file cores/common/arduino/libraries/inline/ESP/

"},{"location":"ltapi/_e_s_p_8h/","title":"File ESP.h","text":"

FileList > arduino > libraries > inline > ESP > ESP.h

Go to the source code of this file.

  • #include <Arduino.h>
"},{"location":"ltapi/_e_s_p_8h/#classes","title":"Classes","text":"Type Name class EspClass ESP Arduino Core compatibility class."},{"location":"ltapi/_e_s_p_8h/#public-attributes","title":"Public Attributes","text":"Type Name EspClass ESP"},{"location":"ltapi/_e_s_p_8h/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/_e_s_p_8h/#variable-esp","title":"variable ESP","text":"
EspClass ESP;\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/inline/ESP/ESP.h

"},{"location":"ltapi/_e_s_p_8h_source/","title":"File ESP.h","text":"

File List > arduino > libraries > inline > ESP > ESP.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2023-03-20.() */\n\n#include <Arduino.h>\n\n#ifdef __cplusplus\n\nclass EspClass {\n  public:\n    inline void wdtEnable(uint32_t timeout_ms = 0) { lt_wdt_enable(timeout_ms); }\n\n    inline void wdtDisable() { lt_wdt_disable(); }\n\n    inline void wdtFeed() { lt_wdt_feed(); }\n\n    inline void reset() { lt_reboot(); }\n\n    inline void restart() { lt_reboot(); }\n\n    inline void rebootIntoUartDownloadMode() { lt_reboot_download_mode(); }\n\n    inline uint16_t getVcc() { return 3300; }\n\n    inline uint32_t getChipId() { return lt_cpu_get_mac_id(); }\n\n    inline uint32_t getFreeHeap() { return lt_heap_get_free(); }\n\n    inline uint16_t getMaxFreeBlockSize() { return lt_heap_get_max_alloc(); }\n\n    inline const char *getSdkVersion() { return LT_VERSION_STR; }\n\n    inline String getCoreVersion() { return LT_VERSION_STR; }\n\n    inline String getFullVersion() { return LT_BANNER_STR; }\n\n    inline uint8_t getBootVersion() { return 0; }\n\n    inline uint8_t getBootMode() { return 0; }\n\n    inline uint8_t getCpuFreqMHz() { return lt_cpu_get_freq_mhz(); }\n\n    inline uint32_t getFlashChipId() {\n        lt_flash_id_t id = lt_flash_get_id();\n        return id.manufacturer_id << 16 | id.chip_id << 7 | id.chip_size_id;\n    }\n\n    inline uint8_t getFlashChipVendorId() { return lt_flash_get_id().manufacturer_id; }\n\n    inline uint32_t getFlashChipRealSize() { return lt_flash_get_size(); }\n\n    inline uint32_t getFlashChipSize() { return lt_flash_get_size(); }\n\n    inline uint32_t getFlashChipMode() { return 0xFF; }\n\n    inline uint32_t getFlashChipSizeByChipId() { return lt_flash_get_size(); }\n\n    inline bool flashEraseSector(uint32_t sector) { return lt_flash_erase_block(sector); }\n\n    inline bool flashWrite(uint32_t address, const uint8_t *data, size_t size) {\n        return lt_flash_write(address, data, size) == size;\n    }\n\n    inline bool flashRead(uint32_t address, uint8_t *data, size_t size) {\n        return lt_flash_read(address, data, size) == size;\n    }\n\n    inline String getResetReason() { return lt_get_reboot_reason_name(lt_get_reboot_reason()); }\n\n    inline String getResetInfo() { return lt_get_reboot_reason_name(lt_get_reboot_reason()); }\n\n    inline uint8_t *random(uint8_t *resultArray, const size_t outputSizeBytes) {\n        lt_rand_bytes(resultArray, (size_t)outputSizeBytes);\n        return resultArray;\n    }\n\n    inline uint32_t random() {\n        uint32_t i;\n        lt_rand_bytes((uint8_t *)&i, 4);\n        return i;\n    }\n\n    inline uint32_t getCycleCount() { return lt_cpu_get_cycle_count(); }\n};\n\nextern EspClass ESP;\n\n#endif\n
"},{"location":"ltapi/dir_e3ef11b23e60019cef556571ad08a868/","title":"Dir cores/common/arduino/libraries/inline/Flash","text":"

FileList > arduino > libraries > inline > Flash

"},{"location":"ltapi/dir_e3ef11b23e60019cef556571ad08a868/#files","title":"Files","text":"Type Name file Flash.h

The documentation for this class was generated from the following file cores/common/arduino/libraries/inline/Flash/

"},{"location":"ltapi/_flash_8h/","title":"File Flash.h","text":"

FileList > arduino > libraries > inline > Flash > Flash.h

Go to the source code of this file.

  • #include <Arduino.h>
"},{"location":"ltapi/_flash_8h/#classes","title":"Classes","text":"Type Name class FlashClass"},{"location":"ltapi/_flash_8h/#public-attributes","title":"Public Attributes","text":"Type Name FlashClass Flash"},{"location":"ltapi/_flash_8h/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/_flash_8h/#variable-flash","title":"variable Flash","text":"
FlashClass Flash;\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/inline/Flash/Flash.h

"},{"location":"ltapi/_flash_8h_source/","title":"File Flash.h","text":"

File List > arduino > libraries > inline > Flash > Flash.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-04-24. */\n\n#pragma once\n\n#include <Arduino.h>\n\n#ifdef __cplusplus\n\nclass FlashClass {\n  public:\n    inline FlashId getChipId() { return lt_flash_get_id(); }\n\n    inline uint32_t getSize() { return lt_flash_get_size(); }\n\n    inline bool eraseSector(uint32_t offset) {\n        //\n        return lt_flash_erase_block(offset);\n    }\n\n    inline bool readBlock(uint32_t offset, uint8_t *data, size_t length) {\n        //\n        return lt_flash_read(offset, data, length) == length;\n    }\n\n    inline bool writeBlock(uint32_t offset, const uint8_t *data, size_t length) {\n        //\n        return lt_flash_write(offset, data, length) == length;\n    }\n};\n\nextern FlashClass Flash;\n\n#endif\n
"},{"location":"ltapi/dir_264b85d2860d8f7b79a05bde705c2149/","title":"Dir cores/common/arduino/libraries/inline/LT","text":"

FileList > arduino > libraries > inline > LT

"},{"location":"ltapi/dir_264b85d2860d8f7b79a05bde705c2149/#files","title":"Files","text":"Type Name file LT.h

The documentation for this class was generated from the following file cores/common/arduino/libraries/inline/LT/

"},{"location":"ltapi/_l_t_8h/","title":"File LT.h","text":"

FileList > arduino > libraries > inline > LT > LT.h

Go to the source code of this file.

  • #include <Arduino.h>
  • #include <ESP.h>
  • #include <OTA.h>
  • #include <WDT.h>
"},{"location":"ltapi/_l_t_8h/#classes","title":"Classes","text":"Type Name class LibreTiny Main LibreTiny API class."},{"location":"ltapi/_l_t_8h/#public-attributes","title":"Public Attributes","text":"Type Name LibreTiny LT"},{"location":"ltapi/_l_t_8h/#macros","title":"Macros","text":"Type Name define ChipFamily lt_cpu_family_t define ChipType lt_cpu_model_t define FlashId lt_flash_id_t define ResetReason lt_reboot_reason_t"},{"location":"ltapi/_l_t_8h/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/_l_t_8h/#variable-lt","title":"variable LT","text":"
LibreTiny LT;\n
"},{"location":"ltapi/_l_t_8h/#macro-definition-documentation","title":"Macro Definition Documentation","text":""},{"location":"ltapi/_l_t_8h/#define-chipfamily","title":"define ChipFamily","text":"
#define ChipFamily lt_cpu_family_t\n
"},{"location":"ltapi/_l_t_8h/#define-chiptype","title":"define ChipType","text":"
#define ChipType lt_cpu_model_t\n
"},{"location":"ltapi/_l_t_8h/#define-flashid","title":"define FlashId","text":"
#define FlashId lt_flash_id_t\n
"},{"location":"ltapi/_l_t_8h/#define-resetreason","title":"define ResetReason","text":"
#define ResetReason lt_reboot_reason_t\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/inline/LT/LT.h

"},{"location":"ltapi/_l_t_8h_source/","title":"File LT.h","text":"

File List > arduino > libraries > inline > LT > LT.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-06-06. */\n\n#pragma once\n\n#include <Arduino.h>\n#include <ESP.h>\n#include <OTA.h>\n#include <WDT.h>\n\n#ifdef __cplusplus\n\n#define ChipFamily  lt_cpu_family_t\n#define ChipType    lt_cpu_model_t\n#define ResetReason lt_reboot_reason_t\n#define FlashId     lt_flash_id_t\n\nclass LibreTiny {\n  public: /* lt_cpu.h */\n    inline ChipFamily getChipFamily() { return lt_cpu_get_family(); }\n\n    inline const char *getChipFamilyName() { return lt_cpu_get_family_name(); }\n\n    inline ChipType getChipType() { return lt_cpu_get_model(); }\n\n    inline const char *getChipModel() { return lt_cpu_get_model_name(); }\n\n    inline uint32_t getChipId() { return lt_cpu_get_mac_id(); }\n\n    inline uint8_t getChipCores() { return lt_cpu_get_core_count(); }\n\n    inline const char *getChipCoreType() { return lt_cpu_get_core_type(); }\n\n    inline uint32_t getCpuFreq() { return lt_cpu_get_freq(); }\n\n    inline uint32_t getCpuFreqMHz() { return lt_cpu_get_freq_mhz(); }\n\n    inline uint32_t getCycleCount() { return lt_cpu_get_cycle_count(); }\n\n  public: /* lt_device.h */\n    inline const char *getVersion() { return lt_get_version(); }\n\n    inline const char *getBoard() { return lt_get_board_code(); }\n\n    inline const char *getDeviceName() { return lt_get_device_name(); }\n\n    inline void restart() { lt_reboot(); }\n\n    inline void restartDownloadMode() { lt_reboot_download_mode(); }\n\n    inline ResetReason getResetReason() { return lt_get_reboot_reason(); }\n\n    inline const char *getResetReasonName(ResetReason reason = lt_get_reboot_reason()) {\n        return lt_get_reboot_reason_name(reason);\n    }\n\n    inline void gpioRecover() { lt_gpio_recover(); }\n\n  public: /* lt_flash.h */\n    inline FlashId getFlashChipId() { return lt_flash_get_id(); }\n\n    inline uint32_t getFlashChipSize() { return lt_flash_get_size(); }\n\n  public: /* lt_mem.h */\n    inline uint32_t getRamSize() { return lt_ram_get_size(); }\n\n    inline uint32_t getHeapSize() { return lt_heap_get_size(); }\n\n    inline uint32_t getFreeHeap() { return lt_heap_get_free(); }\n\n    inline uint32_t getMinFreeHeap() { return lt_heap_get_min_free(); }\n\n    inline uint32_t getMaxAllocHeap() { return lt_heap_get_max_alloc(); }\n\n    inline uint32_t getMaxFreeBlockSize() { return lt_heap_get_max_alloc(); }\n};\n\nextern LibreTiny LT;\n\n#endif\n
"},{"location":"ltapi/dir_1f237d2cf3ecae9e1cbbfcb1aefdc1b7/","title":"Dir cores/common/arduino/libraries/inline/OTA","text":"

FileList > arduino > libraries > inline > OTA

"},{"location":"ltapi/dir_1f237d2cf3ecae9e1cbbfcb1aefdc1b7/#files","title":"Files","text":"Type Name file OTA.h

The documentation for this class was generated from the following file cores/common/arduino/libraries/inline/OTA/

"},{"location":"ltapi/_o_t_a_8h/","title":"File OTA.h","text":"

FileList > arduino > libraries > inline > OTA > OTA.h

Go to the source code of this file.

  • #include <Arduino.h>
"},{"location":"ltapi/_o_t_a_8h/#classes","title":"Classes","text":"Type Name class LibreTinyOTA Over-the-Air updates helper class."},{"location":"ltapi/_o_t_a_8h/#public-attributes","title":"Public Attributes","text":"Type Name LibreTinyOTA OTA"},{"location":"ltapi/_o_t_a_8h/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/_o_t_a_8h/#variable-ota","title":"variable OTA","text":"
LibreTinyOTA OTA;\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/inline/OTA/OTA.h

"},{"location":"ltapi/_o_t_a_8h_source/","title":"File OTA.h","text":"

File List > arduino > libraries > inline > OTA > OTA.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2023-03-10. */\n\n#pragma once\n\n#include <Arduino.h>\n\n#ifdef __cplusplus\n\nclass LibreTinyOTA {\n  public: /* lt_ota.h */\n    inline lt_ota_type_t getType() { return lt_ota_get_type(); }\n\n    inline bool isValid(uint8_t index) { return lt_ota_is_valid(index); }\n\n    inline bool canRollback() { return lt_ota_can_rollback(); }\n\n    inline uint8_t getCurrentIndex() { return lt_ota_dual_get_current(); }\n\n    inline uint8_t getStoredIndex() { return lt_ota_dual_get_stored(); }\n\n    inline uf2_ota_scheme_t getUF2Scheme() { return lt_ota_get_uf2_scheme(); }\n\n    inline bool switchImage(bool revert = false) { return lt_ota_switch(revert); }\n};\n\nextern LibreTinyOTA OTA;\n\n#endif\n
"},{"location":"ltapi/dir_bd1e4bd763507df1c98830c76e327ffd/","title":"Dir cores/common/arduino/libraries/inline/WDT","text":"

FileList > arduino > libraries > inline > WDT

"},{"location":"ltapi/dir_bd1e4bd763507df1c98830c76e327ffd/#files","title":"Files","text":"Type Name file WDT.h

The documentation for this class was generated from the following file cores/common/arduino/libraries/inline/WDT/

"},{"location":"ltapi/_w_d_t_8h/","title":"File WDT.h","text":"

FileList > arduino > libraries > inline > WDT > WDT.h

Go to the source code of this file.

  • #include <Arduino.h>
"},{"location":"ltapi/_w_d_t_8h/#classes","title":"Classes","text":"Type Name class LibreTinyWDT Watchdog control class."},{"location":"ltapi/_w_d_t_8h/#public-attributes","title":"Public Attributes","text":"Type Name LibreTinyWDT WDT"},{"location":"ltapi/_w_d_t_8h/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/_w_d_t_8h/#variable-wdt","title":"variable WDT","text":"
LibreTinyWDT WDT;\n

The documentation for this class was generated from the following file cores/common/arduino/libraries/inline/WDT/WDT.h

"},{"location":"ltapi/_w_d_t_8h_source/","title":"File WDT.h","text":"

File List > arduino > libraries > inline > WDT > WDT.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2023-03-10. */\n\n#pragma once\n\n#include <Arduino.h>\n\n#ifdef __cplusplus\n\nclass LibreTinyWDT {\n  public: /* lt_wdt.h */\n    inline bool enable(uint32_t timeout = 10000) { return lt_wdt_enable(timeout); }\n\n    inline void disable() { lt_wdt_disable(); }\n\n    inline void feed() { lt_wdt_feed(); }\n};\n\nextern LibreTinyWDT WDT;\n\n#endif\n
"},{"location":"ltapi/dir_cd39a9ca7156574bbf526216c63c01b5/","title":"Dir cores/common/arduino/src","text":"

FileList > arduino > src

"},{"location":"ltapi/dir_cd39a9ca7156574bbf526216c63c01b5/#files","title":"Files","text":"Type Name file Arduino.h file Events.cpp file Events.h file HardwareI2C.h file main.c"},{"location":"ltapi/dir_cd39a9ca7156574bbf526216c63c01b5/#directories","title":"Directories","text":"Type Name dir common dir compat dir posix dir wiring

The documentation for this class was generated from the following file cores/common/arduino/src/

"},{"location":"ltapi/_arduino_8h/","title":"File Arduino.h","text":"

FileList > arduino > src > Arduino.h

Go to the source code of this file.

  • #include <libretiny.h>
  • #include <sys/time.h>
  • #include <time.h>
  • #include <algorithm>
  • #include <cmath>
  • #include <api/ArduinoAPI.h>
  • #include <LT.h>
  • #include <ArduinoFamily.h>
  • #include \"wiring_compat.h\"
  • #include \"wiring_custom.h\"
  • #include <FreeRTOS.h>
  • #include <task.h>

The documentation for this class was generated from the following file cores/common/arduino/src/Arduino.h

"},{"location":"ltapi/_arduino_8h_source/","title":"File Arduino.h","text":"

File List > arduino > src > Arduino.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-06-14. */\n\n#pragma once\n\n// LibreTiny C API (with C standard libraries)\n#include <libretiny.h>\n\n// Additional C libraries\n#include <sys/time.h>\n#include <time.h>\n\n// C++ standard libraries\n#ifdef __cplusplus\n#include <algorithm>\n#include <cmath>\nusing ::round;\nusing std::abs;\nusing std::isinf;\nusing std::isnan;\nusing std::max;\nusing std::min;\n#endif\n\n// Arduino Core and LT class\n#include <api/ArduinoAPI.h>\n#ifdef __cplusplus\n#include <LT.h>\nusing namespace arduino;\n#endif\n\n// Include family-specific code\n#include <ArduinoFamily.h>\n\n// Additional Wiring headers\n#include \"wiring_compat.h\"\n#include \"wiring_custom.h\"\n\n// FreeRTOS kernel\n#include <FreeRTOS.h>\n#include <task.h>\n\n// Define available serial ports\n#if defined(__cplusplus) && LT_ARD_HAS_SERIAL\n#include <Serial.h>\n\n#if HAS_SERIAL_CLASS\n#if LT_HW_UART0\nextern SerialClass Serial0;\n#endif\n#if LT_HW_UART1\nextern SerialClass Serial1;\n#endif\n#if LT_HW_UART2\nextern SerialClass Serial2;\n#endif\n#endif\n\n#define SerialN(x) Serial##x\n#define SerialM(x) SerialN(x)\n#define Serial     SerialM(LT_UART_DEFAULT_SERIAL)\n#endif\n
"},{"location":"ltapi/_events_8cpp/","title":"File Events.cpp","text":"

FileList > arduino > src > Events.cpp

Go to the source code of this file.

  • #include \"Events.h\"

The documentation for this class was generated from the following file cores/common/arduino/src/Events.cpp

"},{"location":"ltapi/_events_8cpp_source/","title":"File Events.cpp","text":"

File List > arduino > src > Events.cpp

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-05-17. */\n\n#include \"Events.h\"\n\nuint16_t EventHandler_s::lastId = 1;\n
"},{"location":"ltapi/_events_8h/","title":"File Events.h","text":"

FileList > arduino > src > Events.h

Go to the source code of this file.

  • #include <Arduino.h>
  • #include <WiFiEvents.h>
  • #include <functional>
"},{"location":"ltapi/_events_8h/#classes","title":"Classes","text":"Type Name struct EventHandler_s struct arduino_event_t"},{"location":"ltapi/_events_8h/#public-types","title":"Public Types","text":"Type Name typedef void(* EventCb typedef std::function< void(EventId event, EventInfo info)> EventFuncCb typedef struct EventHandler_s EventHandler typedef void(* EventSysCb enum arduino_event_id_t union arduino_event_info_t"},{"location":"ltapi/_events_8h/#macros","title":"Macros","text":"Type Name define EventId arduino_event_id_t define EventId_t arduino_event_id_t define EventInfo arduino_event_info_t define EventInfo_t arduino_event_info_t define Event_t arduino_event_t"},{"location":"ltapi/_events_8h/#public-types-documentation","title":"Public Types Documentation","text":""},{"location":"ltapi/_events_8h/#typedef-eventcb","title":"typedef EventCb","text":"
typedef void(* EventCb) (EventId event);\n
"},{"location":"ltapi/_events_8h/#typedef-eventfunccb","title":"typedef EventFuncCb","text":"
typedef std::function<void(EventId event, EventInfo info)> EventFuncCb;\n
"},{"location":"ltapi/_events_8h/#typedef-eventhandler","title":"typedef EventHandler","text":"
typedef struct EventHandler_s EventHandler;\n
"},{"location":"ltapi/_events_8h/#typedef-eventsyscb","title":"typedef EventSysCb","text":"
typedef void(* EventSysCb) (Event_t *event);\n
"},{"location":"ltapi/_events_8h/#enum-arduino_event_id_t","title":"enum arduino_event_id_t","text":"
enum arduino_event_id_t {\n    ARDUINO_EVENT_WIFI_READY = 0,\n    ARDUINO_EVENT_WIFI_SCAN_DONE,\n    ARDUINO_EVENT_WIFI_STA_START,\n    ARDUINO_EVENT_WIFI_STA_STOP,\n    ARDUINO_EVENT_WIFI_STA_CONNECTED,\n    ARDUINO_EVENT_WIFI_STA_DISCONNECTED,\n    ARDUINO_EVENT_WIFI_STA_AUTHMODE_CHANGE,\n    ARDUINO_EVENT_WIFI_STA_GOT_IP,\n    ARDUINO_EVENT_WIFI_STA_GOT_IP6,\n    ARDUINO_EVENT_WIFI_STA_LOST_IP,\n    ARDUINO_EVENT_WIFI_AP_START,\n    ARDUINO_EVENT_WIFI_AP_STOP,\n    ARDUINO_EVENT_WIFI_AP_STACONNECTED,\n    ARDUINO_EVENT_WIFI_AP_STADISCONNECTED,\n    ARDUINO_EVENT_WIFI_AP_STAIPASSIGNED,\n    ARDUINO_EVENT_WIFI_AP_PROBEREQRECVED,\n    ARDUINO_EVENT_WIFI_AP_GOT_IP6,\n    ARDUINO_EVENT_WIFI_FTM_REPORT,\n    ARDUINO_EVENT_ETH_START,\n    ARDUINO_EVENT_ETH_STOP,\n    ARDUINO_EVENT_ETH_CONNECTED,\n    ARDUINO_EVENT_ETH_DISCONNECTED,\n    ARDUINO_EVENT_ETH_GOT_IP,\n    ARDUINO_EVENT_ETH_GOT_IP6,\n    ARDUINO_EVENT_WPS_ER_SUCCESS,\n    ARDUINO_EVENT_WPS_ER_FAILED,\n    ARDUINO_EVENT_WPS_ER_TIMEOUT,\n    ARDUINO_EVENT_WPS_ER_PIN,\n    ARDUINO_EVENT_WPS_ER_PBC_OVERLAP,\n    ARDUINO_EVENT_SC_SCAN_DONE,\n    ARDUINO_EVENT_SC_FOUND_CHANNEL,\n    ARDUINO_EVENT_SC_GOT_SSID_PSWD,\n    ARDUINO_EVENT_SC_SEND_ACK_DONE,\n    ARDUINO_EVENT_PROV_INIT,\n    ARDUINO_EVENT_PROV_DEINIT,\n    ARDUINO_EVENT_PROV_START,\n    ARDUINO_EVENT_PROV_END,\n    ARDUINO_EVENT_PROV_CRED_RECV,\n    ARDUINO_EVENT_PROV_CRED_FAIL,\n    ARDUINO_EVENT_PROV_CRED_SUCCESS,\n    ARDUINO_EVENT_MAX\n};\n
"},{"location":"ltapi/_events_8h/#union-arduino_event_info_t","title":"union arduino_event_info_t","text":""},{"location":"ltapi/_events_8h/#macro-definition-documentation","title":"Macro Definition Documentation","text":""},{"location":"ltapi/_events_8h/#define-eventid","title":"define EventId","text":"
#define EventId arduino_event_id_t\n
"},{"location":"ltapi/_events_8h/#define-eventid_t","title":"define EventId_t","text":"
#define EventId_t arduino_event_id_t\n
"},{"location":"ltapi/_events_8h/#define-eventinfo","title":"define EventInfo","text":"
#define EventInfo arduino_event_info_t\n
"},{"location":"ltapi/_events_8h/#define-eventinfo_t","title":"define EventInfo_t","text":"
#define EventInfo_t arduino_event_info_t\n
"},{"location":"ltapi/_events_8h/#define-event_t","title":"define Event_t","text":"
#define Event_t arduino_event_t\n

The documentation for this class was generated from the following file cores/common/arduino/src/Events.h

"},{"location":"ltapi/_events_8h_source/","title":"File Events.h","text":"

File List > arduino > src > Events.h

Go to the documentation of this file.

/*\n ESP8266WiFiGeneric.h - esp8266 Wifi support.\n Based on WiFi.h from Ardiono WiFi shield library.\n Copyright (c) 2011-2014 Arduino.  All right reserved.\n Modified by Ivan Grokhotkov, December 2014\n Reworked by Markus Sattler, December 2015\n\n This library is free software; you can redistribute it and/or\n modify it under the terms of the GNU Lesser General Public\n License as published by the Free Software Foundation; either\n version 2.1 of the License, or (at your option) any later version.\n\n This library is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public\n License along with this library; if not, write to the Free Software\n Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n */\n\n#pragma once\n\n#include <Arduino.h>\n#include <WiFiEvents.h>\n#include <functional>\n\ntypedef enum {\n    ARDUINO_EVENT_WIFI_READY = 0,           \n    ARDUINO_EVENT_WIFI_SCAN_DONE,           \n    ARDUINO_EVENT_WIFI_STA_START,           \n    ARDUINO_EVENT_WIFI_STA_STOP,            \n    ARDUINO_EVENT_WIFI_STA_CONNECTED,       \n    ARDUINO_EVENT_WIFI_STA_DISCONNECTED,    \n    ARDUINO_EVENT_WIFI_STA_AUTHMODE_CHANGE, \n    ARDUINO_EVENT_WIFI_STA_GOT_IP,\n    ARDUINO_EVENT_WIFI_STA_GOT_IP6,\n    ARDUINO_EVENT_WIFI_STA_LOST_IP,\n    ARDUINO_EVENT_WIFI_AP_START,           \n    ARDUINO_EVENT_WIFI_AP_STOP,            \n    ARDUINO_EVENT_WIFI_AP_STACONNECTED,    \n    ARDUINO_EVENT_WIFI_AP_STADISCONNECTED, \n    ARDUINO_EVENT_WIFI_AP_STAIPASSIGNED,\n    ARDUINO_EVENT_WIFI_AP_PROBEREQRECVED, \n    ARDUINO_EVENT_WIFI_AP_GOT_IP6,\n    ARDUINO_EVENT_WIFI_FTM_REPORT, \n    ARDUINO_EVENT_ETH_START,\n    ARDUINO_EVENT_ETH_STOP,\n    ARDUINO_EVENT_ETH_CONNECTED,\n    ARDUINO_EVENT_ETH_DISCONNECTED,\n    ARDUINO_EVENT_ETH_GOT_IP,\n    ARDUINO_EVENT_ETH_GOT_IP6,\n    ARDUINO_EVENT_WPS_ER_SUCCESS,     \n    ARDUINO_EVENT_WPS_ER_FAILED,      \n    ARDUINO_EVENT_WPS_ER_TIMEOUT,     \n    ARDUINO_EVENT_WPS_ER_PIN,         \n    ARDUINO_EVENT_WPS_ER_PBC_OVERLAP, \n    ARDUINO_EVENT_SC_SCAN_DONE,\n    ARDUINO_EVENT_SC_FOUND_CHANNEL,\n    ARDUINO_EVENT_SC_GOT_SSID_PSWD,\n    ARDUINO_EVENT_SC_SEND_ACK_DONE,\n    ARDUINO_EVENT_PROV_INIT,\n    ARDUINO_EVENT_PROV_DEINIT,\n    ARDUINO_EVENT_PROV_START,\n    ARDUINO_EVENT_PROV_END,\n    ARDUINO_EVENT_PROV_CRED_RECV,\n    ARDUINO_EVENT_PROV_CRED_FAIL,\n    ARDUINO_EVENT_PROV_CRED_SUCCESS,\n    ARDUINO_EVENT_MAX\n} arduino_event_id_t;\n\ntypedef union {\n    wifi_event_sta_scan_done_t wifi_scan_done;\n    wifi_event_sta_authmode_change_t wifi_sta_authmode_change;\n    wifi_event_sta_connected_t wifi_sta_connected;\n    wifi_event_sta_disconnected_t wifi_sta_disconnected;\n    wifi_event_sta_wps_er_pin_t wps_er_pin;\n    wifi_event_sta_wps_fail_reason_t wps_fail_reason;\n    wifi_event_ap_probe_req_rx_t wifi_ap_probereqrecved;\n    wifi_event_ap_staconnected_t wifi_ap_staconnected;\n    wifi_event_ap_stadisconnected_t wifi_ap_stadisconnected;\n    wifi_event_ftm_report_t wifi_ftm_report;\n    ip_event_ap_staipassigned_t wifi_ap_staipassigned;\n    ip_event_got_ip_t got_ip;\n    ip_event_got_ip6_t got_ip6;\n    // smartconfig_event_got_ssid_pswd_t sc_got_ssid_pswd;\n    // esp_eth_handle_t eth_connected;\n    // wifi_sta_config_t prov_cred_recv;\n    // wifi_prov_sta_fail_reason_t prov_fail_reason;\n} arduino_event_info_t;\n\ntypedef struct {\n    arduino_event_id_t event_id;\n    arduino_event_info_t event_info;\n} arduino_event_t;\n\n#define EventId     arduino_event_id_t\n#define EventId_t   arduino_event_id_t\n#define EventInfo   arduino_event_info_t\n#define EventInfo_t arduino_event_info_t\n#define Event_t     arduino_event_t\n\ntypedef void (*EventCb)(EventId event);\ntypedef std::function<void(EventId event, EventInfo info)> EventFuncCb;\ntypedef void (*EventSysCb)(Event_t *event);\n\ntypedef struct EventHandler_s {\n    static uint16_t lastId;\n    uint16_t id;\n    EventCb cb;\n    EventFuncCb fcb;\n    EventSysCb scb;\n    EventId eventId;\n\n    EventHandler_s() : id(lastId++), cb(NULL), fcb(NULL), scb(NULL) {}\n} EventHandler;\n
"},{"location":"ltapi/_hardware_i2_c_8h/","title":"File HardwareI2C.h","text":"

FileList > arduino > src > HardwareI2C.h

Go to the source code of this file.

  • #include <api/Stream.h>
"},{"location":"ltapi/_hardware_i2_c_8h/#classes","title":"Classes","text":"Type Name class HardwareI2C

The documentation for this class was generated from the following file cores/common/arduino/src/HardwareI2C.h

"},{"location":"ltapi/_hardware_i2_c_8h_source/","title":"File HardwareI2C.h","text":"

File List > arduino > src > HardwareI2C.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-05-09. */\n\n#include <api/Stream.h>\n\nclass HardwareI2C : public Stream {\n  protected:\n    int8_t _sda    = -1;\n    int8_t _scl    = -1;\n    uint32_t _freq = 0;\n\n    void (*onRequestCallback)(void);\n    void (*onReceiveCallback)(int);\n\n  public:\n    bool begin() {\n        return begin(_sda, _scl, _freq);\n    }\n\n    bool begin(uint8_t address) {\n        return begin(address, _sda, _scl, _freq);\n    }\n\n    virtual bool setPins(int8_t sda, int8_t scl) = 0;\n\n    virtual bool begin(int8_t sda, int8_t scl, uint32_t frequency = 0)                  = 0;\n    virtual bool begin(uint8_t address, int8_t sda, int8_t scl, uint32_t frequency = 0) = 0;\n    virtual bool end()                                                                  = 0;\n\n    virtual bool setClock(uint32_t freq) = 0;\n\n    virtual void beginTransmission(uint8_t address) = 0;\n    virtual uint8_t endTransmission(bool stopBit)   = 0;\n\n    virtual size_t requestFrom(uint8_t address, size_t len, bool stopBit) = 0;\n\n    virtual size_t write(const uint8_t *data, size_t len) = 0;\n\n    virtual int available() = 0;\n    virtual int read()      = 0;\n    virtual int peek()      = 0;\n    virtual void flush()    = 0;\n\n    uint32_t getClock() {\n        return _freq;\n    }\n\n    uint8_t endTransmission() {\n        return endTransmission(true);\n    }\n\n    size_t requestFrom(uint8_t address, size_t len) {\n        return requestFrom(address, len, true);\n    }\n\n    virtual size_t write(uint8_t data) {\n        return write(&data, 1);\n    }\n\n    void onReceive(void (*cb)(int)) {\n        onReceiveCallback = cb;\n    }\n\n    void onRequest(void (*cb)(void)) {\n        onRequestCallback = cb;\n    }\n};\n
"},{"location":"ltapi/dir_bdd93a4e8b1efe1644b5e8d87982bdbf/","title":"Dir cores/common/arduino/src/common","text":"

FileList > arduino > src > common

"},{"location":"ltapi/dir_bdd93a4e8b1efe1644b5e8d87982bdbf/#files","title":"Files","text":"Type Name file abi.cpp file dtostrf.c file serial_event.cpp

The documentation for this class was generated from the following file cores/common/arduino/src/common/

"},{"location":"ltapi/abi_8cpp/","title":"File abi.cpp","text":"

FileList > arduino > src > common > abi.cpp

Go to the source code of this file.

  • #include <stdlib.h>
"},{"location":"ltapi/abi_8cpp/#public-functions","title":"Public Functions","text":"Type Name void __cxa_deleted_virtual (void) void __cxa_pure_virtual (void)"},{"location":"ltapi/abi_8cpp/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/abi_8cpp/#function-__cxa_deleted_virtual","title":"function __cxa_deleted_virtual","text":"
void __cxa_deleted_virtual (\n    void\n) \n
"},{"location":"ltapi/abi_8cpp/#function-__cxa_pure_virtual","title":"function __cxa_pure_virtual","text":"
void __cxa_pure_virtual (\n    void\n) \n

The documentation for this class was generated from the following file cores/common/arduino/src/common/abi.cpp

"},{"location":"ltapi/abi_8cpp_source/","title":"File abi.cpp","text":"

File List > arduino > src > common > abi.cpp

Go to the documentation of this file.

/*\n  Copyright (c) 2014 Arduino LLC.  All right reserved.\n\n  This library is free software; you can redistribute it and/or\n  modify it under the terms of the GNU Lesser General Public\n  License as published by the Free Software Foundation; either\n  version 2.1 of the License, or (at your option) any later version.\n\n  This library is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n  See the GNU Lesser General Public License for more details.\n\n  You should have received a copy of the GNU Lesser General Public\n  License along with this library; if not, write to the Free Software\n  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n*/\n\n#include <stdlib.h>\n\nextern \"C\" void __cxa_pure_virtual(void) __attribute__((__noreturn__));\nextern \"C\" void __cxa_deleted_virtual(void) __attribute__((__noreturn__));\n\nvoid __cxa_pure_virtual(void) {\n    // We might want to write some diagnostics to uart in this case\n    // std::terminate();\n    while (1)\n        ;\n}\n\nvoid __cxa_deleted_virtual(void) {\n    // We might want to write some diagnostics to uart in this case\n    // std::terminate();\n    while (1)\n        ;\n}\n
"},{"location":"ltapi/dtostrf_8c/","title":"File dtostrf.c","text":"

FileList > arduino > src > common > dtostrf.c

Go to the source code of this file.

  • #include <Arduino.h>
"},{"location":"ltapi/dtostrf_8c/#public-functions","title":"Public Functions","text":"Type Name char * dtostrf (double val, signed char width, unsigned char prec, char * sout)"},{"location":"ltapi/dtostrf_8c/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/dtostrf_8c/#function-dtostrf","title":"function dtostrf","text":"
char * dtostrf (\n    double val,\n    signed char width,\n    unsigned char prec,\n    char * sout\n) \n

The documentation for this class was generated from the following file cores/common/arduino/src/common/dtostrf.c

"},{"location":"ltapi/dtostrf_8c_source/","title":"File dtostrf.c","text":"

File List > arduino > src > common > dtostrf.c

Go to the documentation of this file.

/*\n  dtostrf - Emulation for dtostrf function from avr-libc\n  Copyright (c) 2013 Arduino.  All rights reserved.\n  Written by Cristian Maglie <c.maglie@arduino.cc>\n\n  This library is free software; you can redistribute it and/or\n  modify it under the terms of the GNU Lesser General Public\n  License as published by the Free Software Foundation; either\n  version 2.1 of the License, or (at your option) any later version.\n\n  This library is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n  Lesser General Public License for more details.\n\n  You should have received a copy of the GNU Lesser General Public\n  License along with this library; if not, write to the Free Software\n  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n*/\n\n#include <Arduino.h>\n\nchar *dtostrf(double val, signed char width, unsigned char prec, char *sout) {\n    char fmt[20];\n    sprintf(fmt, \"%%%d.%df\", width, prec);\n    sprintf(sout, fmt, val);\n    return sout;\n}\n
"},{"location":"ltapi/serial__event_8cpp/","title":"File serial_event.cpp","text":"

FileList > arduino > src > common > serial_event.cpp

Go to the source code of this file.

  • #include <Arduino.h>
"},{"location":"ltapi/serial__event_8cpp/#public-functions","title":"Public Functions","text":"Type Name bool Serial_available () void serialEvent () void serialEventRun (void)"},{"location":"ltapi/serial__event_8cpp/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/serial__event_8cpp/#function-serial_available","title":"function Serial_available","text":"
bool Serial_available () \n
"},{"location":"ltapi/serial__event_8cpp/#function-serialevent","title":"function serialEvent","text":"
void serialEvent () \n
"},{"location":"ltapi/serial__event_8cpp/#function-serialeventrun","title":"function serialEventRun","text":"
void serialEventRun (\n    void\n) \n

The documentation for this class was generated from the following file cores/common/arduino/src/common/serial_event.cpp

"},{"location":"ltapi/serial__event_8cpp_source/","title":"File serial_event.cpp","text":"

File List > arduino > src > common > serial_event.cpp

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-06-19. */\n\n#include <Arduino.h>\n\nvoid serialEvent() __attribute__((weak));\nbool Serial_available() __attribute__((weak));\n\nvoid serialEventRun(void) {\n    if (Serial_available && serialEvent && Serial_available())\n        serialEvent();\n}\n
"},{"location":"ltapi/dir_1927ccce0cee954fb29eb9cedf1bc791/","title":"Dir cores/common/arduino/src/compat","text":"

FileList > arduino > src > compat

"},{"location":"ltapi/dir_1927ccce0cee954fb29eb9cedf1bc791/#files","title":"Files","text":"Type Name file ESPmDNS.h file FS.h file FSImpl.h file WiFiAP.h file md5.h file pgmspace.h file vfs_api.h

The documentation for this class was generated from the following file cores/common/arduino/src/compat/

"},{"location":"ltapi/_e_s_pm_d_n_s_8h/","title":"File ESPmDNS.h","text":"

FileList > arduino > src > compat > ESPmDNS.h

Go to the source code of this file.

  • #include \"mDNS.h\"

The documentation for this class was generated from the following file cores/common/arduino/src/compat/ESPmDNS.h

"},{"location":"ltapi/_e_s_pm_d_n_s_8h_source/","title":"File ESPmDNS.h","text":"

File List > arduino > src > compat > ESPmDNS.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-05-23. */\n\n#pragma once\n\n#include \"mDNS.h\"\n
"},{"location":"ltapi/src_2compat_2_f_s_8h/","title":"File FS.h","text":"

FileList > arduino > src > compat > FS.h

Go to the source code of this file.

  • #include <api/FS.h>

The documentation for this class was generated from the following file cores/common/arduino/src/compat/FS.h

"},{"location":"ltapi/src_2compat_2_f_s_8h_source/","title":"File FS.h","text":"

File List > arduino > src > compat > FS.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-04-30. */\n\n#pragma once\n\n#include <api/FS.h>\n
"},{"location":"ltapi/_f_s_impl_8h/","title":"File FSImpl.h","text":"

FileList > arduino > src > compat > FSImpl.h

Go to the source code of this file.

The documentation for this class was generated from the following file cores/common/arduino/src/compat/FSImpl.h

"},{"location":"ltapi/_f_s_impl_8h_source/","title":"File FSImpl.h","text":"

File List > arduino > src > compat > FSImpl.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-04-30. */\n\n// nop\n
"},{"location":"ltapi/_wi_fi_a_p_8h/","title":"File WiFiAP.h","text":"

FileList > arduino > src > compat > WiFiAP.h

Go to the source code of this file.

  • #include <WiFi.h>

The documentation for this class was generated from the following file cores/common/arduino/src/compat/WiFiAP.h

"},{"location":"ltapi/_wi_fi_a_p_8h_source/","title":"File WiFiAP.h","text":"

File List > arduino > src > compat > WiFiAP.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-04-26. */\n\n#pragma once\n\n// ESP32 WiFi examples use WiFiAP.h include\n\n#include <WiFi.h>\n
"},{"location":"ltapi/src_2compat_2_m_d5_8h/","title":"File md5.h","text":"

FileList > arduino > src > compat > md5.h

Go to the source code of this file.

  • #include <MD5.h>

The documentation for this class was generated from the following file cores/common/arduino/src/compat/md5.h

"},{"location":"ltapi/src_2compat_2_m_d5_8h_source/","title":"File md5.h","text":"

File List > arduino > src > compat > md5.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-06-04. */\n\n#pragma once\n\n// lowercase \"md5.h\" to allow including actual MD5.h on case-sensitive OSes\n#include <MD5.h>\n
"},{"location":"ltapi/pgmspace_8h/","title":"File pgmspace.h","text":"

FileList > arduino > src > compat > pgmspace.h

Go to the source code of this file.

  • #include <api/deprecated-avr-comp/avr/pgmspace.h>

The documentation for this class was generated from the following file cores/common/arduino/src/compat/pgmspace.h

"},{"location":"ltapi/pgmspace_8h_source/","title":"File pgmspace.h","text":"

File List > arduino > src > compat > pgmspace.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-04-30. */\n\n#pragma once\n\n#include <api/deprecated-avr-comp/avr/pgmspace.h>\n
"},{"location":"ltapi/vfs__api_8h/","title":"File vfs_api.h","text":"

FileList > arduino > src > compat > vfs_api.h

Go to the source code of this file.

The documentation for this class was generated from the following file cores/common/arduino/src/compat/vfs_api.h

"},{"location":"ltapi/vfs__api_8h_source/","title":"File vfs_api.h","text":"

File List > arduino > src > compat > vfs_api.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-04-30. */\n\n// nop\n
"},{"location":"ltapi/dir_7c3b5015b008a83a07f1017471251f6f/","title":"Dir cores/common/arduino/src/posix","text":"

FileList > arduino > src > posix

"},{"location":"ltapi/dir_7c3b5015b008a83a07f1017471251f6f/#files","title":"Files","text":"Type Name file time.c

The documentation for this class was generated from the following file cores/common/arduino/src/posix/

"},{"location":"ltapi/time_8c/","title":"File time.c","text":"

FileList > arduino > src > posix > time.c

Go to the source code of this file.

  • #include <Arduino.h>
  • #include <errno.h>
"},{"location":"ltapi/time_8c/#public-static-attributes","title":"Public Static Attributes","text":"Type Name uint32_t reset_epoch = = 0 uint32_t reset_millis = = 0"},{"location":"ltapi/time_8c/#public-functions","title":"Public Functions","text":"Type Name int __wrap_gettimeofday (struct timeval * tv, void * tz) int __wrap_settimeofday (const struct timeval * tv, const struct timezone * tz) int _gettimeofday (struct timeval * tv, void * tz) int _settimeofday (const struct timeval * tv, const struct timezone * tz) int gettimeofday (struct timeval * tv, void * tz) int settimeofday (const struct timeval * tv, const struct timezone * tz)"},{"location":"ltapi/time_8c/#public-static-attributes-documentation","title":"Public Static Attributes Documentation","text":""},{"location":"ltapi/time_8c/#variable-reset_epoch","title":"variable reset_epoch","text":"
uint32_t reset_epoch;\n
"},{"location":"ltapi/time_8c/#variable-reset_millis","title":"variable reset_millis","text":"
uint32_t reset_millis;\n
"},{"location":"ltapi/time_8c/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/time_8c/#function-__wrap_gettimeofday","title":"function __wrap_gettimeofday","text":"
int __wrap_gettimeofday (\n    struct timeval * tv,\n    void * tz\n) \n
"},{"location":"ltapi/time_8c/#function-__wrap_settimeofday","title":"function __wrap_settimeofday","text":"
int __wrap_settimeofday (\n    const struct timeval * tv,\n    const struct timezone * tz\n) \n
"},{"location":"ltapi/time_8c/#function-_gettimeofday","title":"function _gettimeofday","text":"
int _gettimeofday (\n    struct timeval * tv,\n    void * tz\n) \n
"},{"location":"ltapi/time_8c/#function-_settimeofday","title":"function _settimeofday","text":"
int _settimeofday (\n    const struct timeval * tv,\n    const struct timezone * tz\n) \n
"},{"location":"ltapi/time_8c/#function-gettimeofday","title":"function gettimeofday","text":"
int gettimeofday (\n    struct timeval * tv,\n    void * tz\n) \n
"},{"location":"ltapi/time_8c/#function-settimeofday","title":"function settimeofday","text":"
int settimeofday (\n    const struct timeval * tv,\n    const struct timezone * tz\n) \n

The documentation for this class was generated from the following file cores/common/arduino/src/posix/time.c

"},{"location":"ltapi/time_8c_source/","title":"File time.c","text":"

File List > arduino > src > posix > time.c

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-09-03. */\n\n#include <Arduino.h>\n#include <errno.h>\n\nstatic uint32_t reset_epoch  = 0; // epoch corresponding to millis() == 0\nstatic uint32_t reset_millis = 0; // millis() when epoch reset was performed\n\nint __wrap_gettimeofday(struct timeval *tv, void *tz) {\n    if (millis() < reset_millis) {\n        // the clock overflowed\n        reset_epoch += UINT32_MAX / 1000;\n        reset_millis = millis();\n    }\n    if (!tv) {\n        errno = EINVAL;\n        return -1;\n    }\n    unsigned long m = millis();\n    tv->tv_sec      = reset_epoch + (m / 1000);\n    tv->tv_usec     = (m % 1000) * 1000;\n    return 0;\n}\n\nint __wrap_settimeofday(const struct timeval *tv, const struct timezone *tz) {\n    if (!tv) {\n        errno = EINVAL;\n        return -1;\n    }\n    unsigned long m = millis();\n    reset_epoch     = tv->tv_sec - (m / 1000);\n    reset_millis    = m;\n    return 0;\n}\n\nint gettimeofday(struct timeval *tv, void *tz) {\n    return __wrap_gettimeofday(tv, tz);\n}\n\nint settimeofday(const struct timeval *tv, const struct timezone *tz) {\n    return __wrap_settimeofday(tv, tz);\n}\n\nint _gettimeofday(struct timeval *tv, void *tz) {\n    return __wrap_gettimeofday(tv, tz);\n}\n\nint _settimeofday(const struct timeval *tv, const struct timezone *tz) {\n    return __wrap_settimeofday(tv, tz);\n}\n
"},{"location":"ltapi/dir_7b42ca4cd5530baa6d3cca740865775d/","title":"Dir cores/common/arduino/src/wiring","text":"

FileList > arduino > src > wiring

"},{"location":"ltapi/dir_7b42ca4cd5530baa6d3cca740865775d/#files","title":"Files","text":"Type Name file wiring.c file wiring_compat.cpp file wiring_compat.h file wiring_custom.c file wiring_custom.h file wiring_irq.c file wiring_math.cpp file wiring_private.c file wiring_private.h file wiring_shift.c

The documentation for this class was generated from the following file cores/common/arduino/src/wiring/

"},{"location":"ltapi/wiring_8c/","title":"File wiring.c","text":"

FileList > arduino > src > wiring > wiring.c

Go to the source code of this file.

  • #include <Arduino.h>
"},{"location":"ltapi/wiring_8c/#public-functions","title":"Public Functions","text":"Type Name __attribute__ ((weak))"},{"location":"ltapi/wiring_8c/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/wiring_8c/#function-__attribute__","title":"function __attribute__","text":"
__attribute__ (\n    (weak)\n) \n

The documentation for this class was generated from the following file cores/common/arduino/src/wiring/wiring.c

"},{"location":"ltapi/wiring_8c_source/","title":"File wiring.c","text":"

File List > arduino > src > wiring > wiring.c

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2023-05-24. */\n\n#include <Arduino.h>\n\n#if LT_HAS_FREERTOS\n\n__attribute__((weak)) void delay(uint32_t ms) {\n    vTaskDelay(pdMS_TO_TICKS(ms));\n}\n\n__attribute__((weak)) void yield() {\n    runPeriodicTasks();\n    vTaskDelay(1);\n    taskYIELD();\n    lt_wdt_feed();\n}\n\n#else\n\n__attribute__((weak)) void yield() {}\n\n#endif\n
"},{"location":"ltapi/wiring__compat_8cpp/","title":"File wiring_compat.cpp","text":"

FileList > arduino > src > wiring > wiring_compat.cpp

Go to the source code of this file.

  • #include \"wiring_compat.h\"
"},{"location":"ltapi/wiring__compat_8cpp/#public-functions","title":"Public Functions","text":"Type Name String ipToString (const IPAddress & ip)"},{"location":"ltapi/wiring__compat_8cpp/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/wiring__compat_8cpp/#function-iptostring","title":"function ipToString","text":"
String ipToString (\n    const IPAddress & ip\n) \n

The documentation for this class was generated from the following file cores/common/arduino/src/wiring/wiring_compat.cpp

"},{"location":"ltapi/wiring__compat_8cpp_source/","title":"File wiring_compat.cpp","text":"

File List > arduino > src > wiring > wiring_compat.cpp

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-06-04. */\n\n#include \"wiring_compat.h\"\n\nString ipToString(const IPAddress &ip) {\n    char szRet[16];\n    sprintf(szRet, \"%hhu.%hhu.%hhu.%hhu\", ip[0], ip[1], ip[2], ip[3]);\n    return String(szRet);\n}\n
"},{"location":"ltapi/wiring__compat_8h/","title":"File wiring_compat.h","text":"

FileList > arduino > src > wiring > wiring_compat.h

Go to the source code of this file.

  • #include <Arduino.h>
"},{"location":"ltapi/wiring__compat_8h/#public-functions","title":"Public Functions","text":"Type Name String ipToString (const IPAddress & ip)"},{"location":"ltapi/wiring__compat_8h/#macros","title":"Macros","text":"Type Name define CONFIG_LWIP_MAX_ACTIVE_TCP 16 define ESP_FAIL -1 define ESP_OK 0 define FPSTR (pstr_pointer) (reinterpret_cast<const __FlashStringHelper *>(pstr_pointer)) define OUTPUT_OPEN_DRAIN OUTPUT_OPENDRAIN define PGM_VOID_P const void * define attachInterruptArg attachInterruptParam define digitalPinToInterrupt (pin) (pin) define esp_err_t int define round (x) ((x) >= 0 ? (long)((x) + 0.5) : (long)((x)-0.5)) define voidFuncPtrArg voidFuncPtrParam define vsnprintf_P vsnprintf define xTaskCreatePinnedToCore xTaskCreateUniversal define xTaskCreateUniversal (pxTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask, xCoreID) xTaskCreate(pxTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask)"},{"location":"ltapi/wiring__compat_8h/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/wiring__compat_8h/#function-iptostring","title":"function ipToString","text":"
String ipToString (\n    const IPAddress & ip\n) \n
"},{"location":"ltapi/wiring__compat_8h/#macro-definition-documentation","title":"Macro Definition Documentation","text":""},{"location":"ltapi/wiring__compat_8h/#define-config_lwip_max_active_tcp","title":"define CONFIG_LWIP_MAX_ACTIVE_TCP","text":"
#define CONFIG_LWIP_MAX_ACTIVE_TCP 16\n
"},{"location":"ltapi/wiring__compat_8h/#define-esp_fail","title":"define ESP_FAIL","text":"
#define ESP_FAIL -1\n

Generic esp_err_t code indicating failure

"},{"location":"ltapi/wiring__compat_8h/#define-esp_ok","title":"define ESP_OK","text":"
#define ESP_OK 0\n

esp_err_t value indicating success (no error)

"},{"location":"ltapi/wiring__compat_8h/#define-fpstr","title":"define FPSTR","text":"
#define FPSTR (\n    pstr_pointer\n) (reinterpret_cast<const __FlashStringHelper *>(pstr_pointer))\n
"},{"location":"ltapi/wiring__compat_8h/#define-output_open_drain","title":"define OUTPUT_OPEN_DRAIN","text":"
#define OUTPUT_OPEN_DRAIN OUTPUT_OPENDRAIN\n
"},{"location":"ltapi/wiring__compat_8h/#define-pgm_void_p","title":"define PGM_VOID_P","text":"
#define PGM_VOID_P const void *\n
"},{"location":"ltapi/wiring__compat_8h/#define-attachinterruptarg","title":"define attachInterruptArg","text":"
#define attachInterruptArg attachInterruptParam\n
"},{"location":"ltapi/wiring__compat_8h/#define-digitalpintointerrupt","title":"define digitalPinToInterrupt","text":"
#define digitalPinToInterrupt (\n    pin\n) (pin)\n
"},{"location":"ltapi/wiring__compat_8h/#define-esp_err_t","title":"define esp_err_t","text":"
#define esp_err_t int\n
"},{"location":"ltapi/wiring__compat_8h/#define-round","title":"define round","text":"
#define round (\n    x\n) ((x) >= 0 ? (long)((x) + 0.5) : (long)((x)-0.5))\n
"},{"location":"ltapi/wiring__compat_8h/#define-voidfuncptrarg","title":"define voidFuncPtrArg","text":"
#define voidFuncPtrArg voidFuncPtrParam\n
"},{"location":"ltapi/wiring__compat_8h/#define-vsnprintf_p","title":"define vsnprintf_P","text":"
#define vsnprintf_P vsnprintf\n
"},{"location":"ltapi/wiring__compat_8h/#define-xtaskcreatepinnedtocore","title":"define xTaskCreatePinnedToCore","text":"
#define xTaskCreatePinnedToCore xTaskCreateUniversal\n
"},{"location":"ltapi/wiring__compat_8h/#define-xtaskcreateuniversal","title":"define xTaskCreateUniversal","text":"
#define xTaskCreateUniversal (\n    pxTaskCode,\n    pcName,\n    usStackDepth,\n    pvParameters,\n    uxPriority,\n    pxCreatedTask,\n    xCoreID\n) xTaskCreate(pxTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask)\n

The documentation for this class was generated from the following file cores/common/arduino/src/wiring/wiring_compat.h

"},{"location":"ltapi/wiring__compat_8h_source/","title":"File wiring_compat.h","text":"

File List > arduino > src > wiring > wiring_compat.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-06-04. */\n\n#pragma once\n\n#include <Arduino.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif // __cplusplus\n\n// Definitions for error constants.\n#define esp_err_t int\n#define ESP_OK    0  \n#define ESP_FAIL  -1 \n// ArduinoCore-API doesn't define these anymore\n#define FPSTR(pstr_pointer) (reinterpret_cast<const __FlashStringHelper *>(pstr_pointer))\n#define PGM_VOID_P          const void *\n#define vsnprintf_P         vsnprintf\n#define OUTPUT_OPEN_DRAIN   OUTPUT_OPENDRAIN\n#define attachInterruptArg  attachInterruptParam\n#define voidFuncPtrArg      voidFuncPtrParam\n\n// Additional Arduino compatibility macros\n#define round(x)                   ((x) >= 0 ? (long)((x) + 0.5) : (long)((x)-0.5))\n#define digitalPinToInterrupt(pin) (pin)\n\n// FreeRTOS utilities\n#define xTaskCreateUniversal(pxTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask, xCoreID)       \\\n    xTaskCreate(pxTaskCode, pcName, usStackDepth, pvParameters, uxPriority, pxCreatedTask)\n#define xTaskCreatePinnedToCore xTaskCreateUniversal\n\n// Default values from sdkconfig.h\n#define CONFIG_LWIP_MAX_ACTIVE_TCP 16\n\n#ifdef __cplusplus\nString ipToString(const IPAddress &ip);\n#endif\n\n#ifdef __cplusplus\n} // extern \"C\"\n#endif\n
"},{"location":"ltapi/wiring__custom_8c/","title":"File wiring_custom.c","text":"

FileList > arduino > src > wiring > wiring_custom.c

Go to the source code of this file.

  • #include \"wiring_private.h\"
"},{"location":"ltapi/wiring__custom_8c/#public-attributes","title":"Public Attributes","text":"Type Name int _analogReadResolution = = 10 int _analogWritePeriod = = 20000 int _analogWriteResolution = = 8"},{"location":"ltapi/wiring__custom_8c/#public-static-attributes","title":"Public Static Attributes","text":"Type Name unsigned long periodicTasks = = {0, 0}"},{"location":"ltapi/wiring__custom_8c/#public-functions","title":"Public Functions","text":"Type Name __attribute__ ((weak)) int analogRead (pin_size_t pinNumber) Read voltage from ADC and return a value between 0 and the current reading resolution. void analogReadResolution (int res) Set resolution of values (in bits) returned by analogRead(). Defaults to 10 bit (0-1023). void analogWriteFrequency (int hz) Set PWM output frequency (in Hz). Defaults to 50 Hz (20,000 uS). void analogWritePeriod (int us) Set PWM output frequency (cycle period) in microseconds. Defaults to 20,000 uS (50 Hz). void analogWriteResolution (int res) Set resolution of values (in bits) expected by analogWrite(). Defaults to 8 bit (0-255). PinInfo * pinByGpio (uint32_t gpio) Find PinInfo struct by GPIO number. Returns NULL if not found. PinInfo * pinByIndex (uint32_t index) Get PinInfo struct for the specified index. Returns NULL if pin index is invalid. bool pinEnabled (PinInfo * pin, uint32_t mask) Check if pin has all features represented by 'mask' enabled. uint32_t pinIndex (PinInfo * pin) Get index of PinInfo in the global pin info table. PinInfo * pinInfo (pin_size_t pinNumber) Get PinInfo struct for the specified number. Returns NULL if pin number is invalid. void pinModeRemove (pin_size_t pinNumber, uint32_t mask) Disable modes specified by 'mask'. bool pinSupported (PinInfo * pin, uint32_t mask) Check if pin supports all features represented by 'mask'. void runPeriodicTasks () Run periodic tasks, like printing free heap or checking millis() overflow."},{"location":"ltapi/wiring__custom_8c/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/wiring__custom_8c/#variable-_analogreadresolution","title":"variable _analogReadResolution","text":"
int _analogReadResolution;\n
"},{"location":"ltapi/wiring__custom_8c/#variable-_analogwriteperiod","title":"variable _analogWritePeriod","text":"
int _analogWritePeriod;\n
"},{"location":"ltapi/wiring__custom_8c/#variable-_analogwriteresolution","title":"variable _analogWriteResolution","text":"
int _analogWriteResolution;\n
"},{"location":"ltapi/wiring__custom_8c/#public-static-attributes-documentation","title":"Public Static Attributes Documentation","text":""},{"location":"ltapi/wiring__custom_8c/#variable-periodictasks","title":"variable periodicTasks","text":"
unsigned long periodicTasks[];\n
"},{"location":"ltapi/wiring__custom_8c/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/wiring__custom_8c/#function-__attribute__","title":"function __attribute__","text":"
__attribute__ (\n    (weak)\n) \n
"},{"location":"ltapi/wiring__custom_8c/#function-analogread","title":"function analogRead","text":"
int analogRead (\n    pin_size_t pinNumber\n) \n
"},{"location":"ltapi/wiring__custom_8c/#function-analogreadresolution","title":"function analogReadResolution","text":"
void analogReadResolution (\n    int res\n) \n
"},{"location":"ltapi/wiring__custom_8c/#function-analogwritefrequency","title":"function analogWriteFrequency","text":"
void analogWriteFrequency (\n    int hz\n) \n
"},{"location":"ltapi/wiring__custom_8c/#function-analogwriteperiod","title":"function analogWritePeriod","text":"
void analogWritePeriod (\n    int us\n) \n
"},{"location":"ltapi/wiring__custom_8c/#function-analogwriteresolution","title":"function analogWriteResolution","text":"
void analogWriteResolution (\n    int res\n) \n
"},{"location":"ltapi/wiring__custom_8c/#function-pinbygpio","title":"function pinByGpio","text":"
PinInfo * pinByGpio (\n    uint32_t gpio\n) \n
"},{"location":"ltapi/wiring__custom_8c/#function-pinbyindex","title":"function pinByIndex","text":"
PinInfo * pinByIndex (\n    uint32_t index\n) \n
"},{"location":"ltapi/wiring__custom_8c/#function-pinenabled","title":"function pinEnabled","text":"
bool pinEnabled (\n    PinInfo * pin,\n    uint32_t mask\n) \n
"},{"location":"ltapi/wiring__custom_8c/#function-pinindex","title":"function pinIndex","text":"
uint32_t pinIndex (\n    PinInfo * pin\n) \n
"},{"location":"ltapi/wiring__custom_8c/#function-pininfo","title":"function pinInfo","text":"
PinInfo * pinInfo (\n    pin_size_t pinNumber\n) \n
"},{"location":"ltapi/wiring__custom_8c/#function-pinmoderemove","title":"function pinModeRemove","text":"
void pinModeRemove (\n    pin_size_t pinNumber,\n    uint32_t mask\n) \n
"},{"location":"ltapi/wiring__custom_8c/#function-pinsupported","title":"function pinSupported","text":"
bool pinSupported (\n    PinInfo * pin,\n    uint32_t mask\n) \n
"},{"location":"ltapi/wiring__custom_8c/#function-runperiodictasks","title":"function runPeriodicTasks","text":"

Run periodic tasks, like printing free heap or checking millis() overflow.

void runPeriodicTasks () \n

This is called during delaying operations, like yield() or delay().

The documentation for this class was generated from the following file cores/common/arduino/src/wiring/wiring_custom.c

"},{"location":"ltapi/wiring__custom_8c_source/","title":"File wiring_custom.c","text":"

File List > arduino > src > wiring > wiring_custom.c

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-06-20. */\n\n#include \"wiring_private.h\"\n\n#if LT_HAS_FREERTOS\n#include <FreeRTOS.h>\n#endif\n\nint _analogReadResolution  = 10;    // 0-1023\nint _analogWriteResolution = 8;     // 0-255\nint _analogWritePeriod     = 20000; // 50 Hz\n\nstatic unsigned long periodicTasks[] = {0, 0};\n\nvoid runPeriodicTasks() {\n#if LT_LOG_HEAP\n    if (millis() - periodicTasks[0] > 1000) {\n        LT_HEAP_I();\n        periodicTasks[0] = millis();\n    }\n#endif\n#if LT_USE_TIME\n    if (millis() - periodicTasks[1] > 10000) {\n        gettimeofday(NULL, NULL);\n        periodicTasks[1] = millis();\n    }\n#endif\n}\n\nvoid pinModeRemove(pin_size_t pinNumber, uint32_t mask) {\n    PinInfo *pin = pinInfo(pinNumber);\n    if (!pin)\n        return;\n    pinRemoveMode(pin, mask);\n    if (pin->enabled == PIN_NONE && mask == PIN_MODE_ALL)\n        pinRemoveData(pin);\n}\n\nPinInfo *pinInfo(pin_size_t pinNumber) {\n    if (pinNumber < 0 || pinNumber > PINS_GPIO_MAX)\n        return NULL;\n    return lt_arduino_pin_gpio_map[pinNumber];\n}\n\nPinInfo *pinByIndex(uint32_t index) {\n    if (index < 0 || index >= PINS_COUNT)\n        return NULL;\n    return &(lt_arduino_pin_info_list[index]);\n}\n\nPinInfo *pinByGpio(uint32_t gpio) {\n    for (uint32_t i = 0; i < PINS_COUNT; i++) {\n        if (lt_arduino_pin_info_list[i].gpio == gpio)\n            return &(lt_arduino_pin_info_list[i]);\n    }\n    return NULL;\n}\n\nuint32_t pinIndex(PinInfo *pin) {\n    return pin - lt_arduino_pin_info_list;\n}\n\nbool pinSupported(PinInfo *pin, uint32_t mask) {\n    return (pin->supported & mask) == mask;\n}\n\nbool pinEnabled(PinInfo *pin, uint32_t mask) {\n    return (pin->enabled & mask) == mask;\n}\n\nint analogRead(pin_size_t pinNumber) {\n    float voltage    = analogReadVoltage(pinNumber);\n    float maxVoltage = analogReadMaxVoltage(pinNumber);\n    uint16_t ret     = round((1 << _analogReadResolution) * voltage / maxVoltage);\n    if (ret >= (1 << _analogReadResolution))\n        ret = (1 << _analogReadResolution) - 1;\n    return ret;\n}\n\nvoid analogReadResolution(int res) {\n    _analogReadResolution = res;\n}\n\nvoid analogWriteResolution(int res) {\n    _analogWriteResolution = res;\n}\n\nvoid analogWriteFrequency(int hz) {\n    _analogWritePeriod = 1E6 / hz;\n}\n\nvoid analogWritePeriod(int us) {\n    _analogWritePeriod = us;\n}\n\n__attribute__((weak)) void analogReference(uint8_t mode) {}\n
"},{"location":"ltapi/wiring__custom_8h/","title":"File wiring_custom.h","text":"

FileList > arduino > src > wiring > wiring_custom.h

Go to the source code of this file.

  • #include <Arduino.h>
"},{"location":"ltapi/wiring__custom_8h/#classes","title":"Classes","text":"Type Name struct PinInfo"},{"location":"ltapi/wiring__custom_8h/#public-types","title":"Public Types","text":"Type Name typedef struct PinData_s PinData"},{"location":"ltapi/wiring__custom_8h/#public-attributes","title":"Public Attributes","text":"Type Name int _analogReadResolution int _analogWritePeriod int _analogWriteResolution PinInfo * lt_arduino_pin_gpio_map PinInfo lt_arduino_pin_info_list"},{"location":"ltapi/wiring__custom_8h/#public-functions","title":"Public Functions","text":"Type Name int analogRead (pin_size_t pinNumber) Read voltage from ADC and return a value between 0 and the current reading resolution. uint16_t analogReadMaxVoltage (pin_size_t pinNumber) Get max reading voltage for the specified pin (millivolts). void analogReadResolution (int res) Set resolution of values (in bits) returned by analogRead(). Defaults to 10 bit (0-1023). uint16_t analogReadVoltage (pin_size_t pinNumber) Read voltage from analog input (in millivolts). void analogWriteFrequency (int hz) Set PWM output frequency (in Hz). Defaults to 50 Hz (20,000 uS). void analogWritePeriod (int us) Set PWM output frequency (cycle period) in microseconds. Defaults to 20,000 uS (50 Hz). void analogWriteResolution (int res) Set resolution of values (in bits) expected by analogWrite(). Defaults to 8 bit (0-255). void mainTask (const void * arg) Main setup() and loop() task. Not to be called directly. PinInfo * pinByGpio (uint32_t gpio) Find PinInfo struct by GPIO number. Returns NULL if not found. PinInfo * pinByIndex (uint32_t index) Get PinInfo struct for the specified index. Returns NULL if pin index is invalid. bool pinEnabled (PinInfo * pin, uint32_t mask) Check if pin has all features represented by 'mask' enabled. uint32_t pinIndex (PinInfo * pin) Get index of PinInfo in the global pin info table. PinInfo * pinInfo (pin_size_t pinNumber) Get PinInfo struct for the specified number. Returns NULL if pin number is invalid. void pinModeNone (pin_size_t pinNumber) Deinitialize the pin, by removing all enabled modes. void pinModeRemove (pin_size_t pinNumber, uint32_t mask) Disable modes specified by 'mask'. void pinRemoveMode (PinInfo * pin, uint32_t mask) bool pinSupported (PinInfo * pin, uint32_t mask) Check if pin supports all features represented by 'mask'. void runPeriodicTasks () Run periodic tasks, like printing free heap or checking millis() overflow. bool startMainTask (void) Run mainTask & start OS kernel (family-defined). Return false if an error occured; else do not return and and keep the OS kernel running."},{"location":"ltapi/wiring__custom_8h/#macros","title":"Macros","text":"Type Name define PIN_ADC (1 << 4) define PIN_DAC (1 << 5) define PIN_GPIO (1 << 1) define PIN_I2C (1 << 6) define PIN_I2S (1 << 7) define PIN_IRQ (1 << 2) define PIN_JTAG (1 << 8) define PIN_MODE_ALL 0xFFFFFFFF define PIN_NONE (1 << 0) define PIN_PWM (1 << 3) define PIN_SPI (1 << 9) define PIN_SWD (1 << 10) define PIN_UART (1 << 11)"},{"location":"ltapi/wiring__custom_8h/#public-types-documentation","title":"Public Types Documentation","text":""},{"location":"ltapi/wiring__custom_8h/#typedef-pindata","title":"typedef PinData","text":"
typedef struct PinData_s PinData;\n
"},{"location":"ltapi/wiring__custom_8h/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/wiring__custom_8h/#variable-_analogreadresolution","title":"variable _analogReadResolution","text":"
int _analogReadResolution;\n
"},{"location":"ltapi/wiring__custom_8h/#variable-_analogwriteperiod","title":"variable _analogWritePeriod","text":"
int _analogWritePeriod;\n
"},{"location":"ltapi/wiring__custom_8h/#variable-_analogwriteresolution","title":"variable _analogWriteResolution","text":"
int _analogWriteResolution;\n
"},{"location":"ltapi/wiring__custom_8h/#variable-lt_arduino_pin_gpio_map","title":"variable lt_arduino_pin_gpio_map","text":"
PinInfo* lt_arduino_pin_gpio_map[PINS_GPIO_MAX+1];\n
"},{"location":"ltapi/wiring__custom_8h/#variable-lt_arduino_pin_info_list","title":"variable lt_arduino_pin_info_list","text":"
PinInfo lt_arduino_pin_info_list[PINS_COUNT];\n
"},{"location":"ltapi/wiring__custom_8h/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/wiring__custom_8h/#function-analogread","title":"function analogRead","text":"
int analogRead (\n    pin_size_t pinNumber\n) \n
"},{"location":"ltapi/wiring__custom_8h/#function-analogreadmaxvoltage","title":"function analogReadMaxVoltage","text":"
uint16_t analogReadMaxVoltage (\n    pin_size_t pinNumber\n) \n
"},{"location":"ltapi/wiring__custom_8h/#function-analogreadresolution","title":"function analogReadResolution","text":"
void analogReadResolution (\n    int res\n) \n
"},{"location":"ltapi/wiring__custom_8h/#function-analogreadvoltage","title":"function analogReadVoltage","text":"
uint16_t analogReadVoltage (\n    pin_size_t pinNumber\n) \n
"},{"location":"ltapi/wiring__custom_8h/#function-analogwritefrequency","title":"function analogWriteFrequency","text":"
void analogWriteFrequency (\n    int hz\n) \n
"},{"location":"ltapi/wiring__custom_8h/#function-analogwriteperiod","title":"function analogWritePeriod","text":"
void analogWritePeriod (\n    int us\n) \n
"},{"location":"ltapi/wiring__custom_8h/#function-analogwriteresolution","title":"function analogWriteResolution","text":"
void analogWriteResolution (\n    int res\n) \n
"},{"location":"ltapi/wiring__custom_8h/#function-maintask","title":"function mainTask","text":"
void mainTask (\n    const void * arg\n) \n
"},{"location":"ltapi/wiring__custom_8h/#function-pinbygpio","title":"function pinByGpio","text":"
PinInfo * pinByGpio (\n    uint32_t gpio\n) \n
"},{"location":"ltapi/wiring__custom_8h/#function-pinbyindex","title":"function pinByIndex","text":"
PinInfo * pinByIndex (\n    uint32_t index\n) \n
"},{"location":"ltapi/wiring__custom_8h/#function-pinenabled","title":"function pinEnabled","text":"
bool pinEnabled (\n    PinInfo * pin,\n    uint32_t mask\n) \n
"},{"location":"ltapi/wiring__custom_8h/#function-pinindex","title":"function pinIndex","text":"
uint32_t pinIndex (\n    PinInfo * pin\n) \n
"},{"location":"ltapi/wiring__custom_8h/#function-pininfo","title":"function pinInfo","text":"
PinInfo * pinInfo (\n    pin_size_t pinNumber\n) \n
"},{"location":"ltapi/wiring__custom_8h/#function-pinmodenone","title":"function pinModeNone","text":"
inline void pinModeNone (\n    pin_size_t pinNumber\n) \n
"},{"location":"ltapi/wiring__custom_8h/#function-pinmoderemove","title":"function pinModeRemove","text":"
void pinModeRemove (\n    pin_size_t pinNumber,\n    uint32_t mask\n) \n
"},{"location":"ltapi/wiring__custom_8h/#function-pinremovemode","title":"function pinRemoveMode","text":"
void pinRemoveMode (\n    PinInfo * pin,\n    uint32_t mask\n) \n
"},{"location":"ltapi/wiring__custom_8h/#function-pinsupported","title":"function pinSupported","text":"
bool pinSupported (\n    PinInfo * pin,\n    uint32_t mask\n) \n
"},{"location":"ltapi/wiring__custom_8h/#function-runperiodictasks","title":"function runPeriodicTasks","text":"

Run periodic tasks, like printing free heap or checking millis() overflow.

void runPeriodicTasks () \n

This is called during delaying operations, like yield() or delay().

"},{"location":"ltapi/wiring__custom_8h/#function-startmaintask","title":"function startMainTask","text":"
bool startMainTask (\n    void\n) \n
"},{"location":"ltapi/wiring__custom_8h/#macro-definition-documentation","title":"Macro Definition Documentation","text":""},{"location":"ltapi/wiring__custom_8h/#define-pin_adc","title":"define PIN_ADC","text":"
#define PIN_ADC (1 << 4)\n
"},{"location":"ltapi/wiring__custom_8h/#define-pin_dac","title":"define PIN_DAC","text":"
#define PIN_DAC (1 << 5)\n
"},{"location":"ltapi/wiring__custom_8h/#define-pin_gpio","title":"define PIN_GPIO","text":"
#define PIN_GPIO (1 << 1)\n
"},{"location":"ltapi/wiring__custom_8h/#define-pin_i2c","title":"define PIN_I2C","text":"
#define PIN_I2C (1 << 6)\n
"},{"location":"ltapi/wiring__custom_8h/#define-pin_i2s","title":"define PIN_I2S","text":"
#define PIN_I2S (1 << 7)\n
"},{"location":"ltapi/wiring__custom_8h/#define-pin_irq","title":"define PIN_IRQ","text":"
#define PIN_IRQ (1 << 2)\n
"},{"location":"ltapi/wiring__custom_8h/#define-pin_jtag","title":"define PIN_JTAG","text":"
#define PIN_JTAG (1 << 8)\n
"},{"location":"ltapi/wiring__custom_8h/#define-pin_mode_all","title":"define PIN_MODE_ALL","text":"
#define PIN_MODE_ALL 0xFFFFFFFF\n
"},{"location":"ltapi/wiring__custom_8h/#define-pin_none","title":"define PIN_NONE","text":"
#define PIN_NONE (1 << 0)\n
"},{"location":"ltapi/wiring__custom_8h/#define-pin_pwm","title":"define PIN_PWM","text":"
#define PIN_PWM (1 << 3)\n
"},{"location":"ltapi/wiring__custom_8h/#define-pin_spi","title":"define PIN_SPI","text":"
#define PIN_SPI (1 << 9)\n
"},{"location":"ltapi/wiring__custom_8h/#define-pin_swd","title":"define PIN_SWD","text":"
#define PIN_SWD (1 << 10)\n
"},{"location":"ltapi/wiring__custom_8h/#define-pin_uart","title":"define PIN_UART","text":"
#define PIN_UART (1 << 11)\n

The documentation for this class was generated from the following file cores/common/arduino/src/wiring/wiring_custom.h

"},{"location":"ltapi/wiring__custom_8h_source/","title":"File wiring_custom.h","text":"

File List > arduino > src > wiring > wiring_custom.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-06-06. */\n\n#pragma once\n\n#include <Arduino.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#define PIN_NONE (1 << 0)\n#define PIN_GPIO (1 << 1)\n#define PIN_IRQ  (1 << 2)\n#define PIN_PWM  (1 << 3)\n#define PIN_ADC  (1 << 4)\n#define PIN_DAC  (1 << 5)\n#define PIN_I2C  (1 << 6)\n#define PIN_I2S  (1 << 7)\n#define PIN_JTAG (1 << 8)\n#define PIN_SPI  (1 << 9)\n#define PIN_SWD  (1 << 10)\n#define PIN_UART (1 << 11)\n\n#define PIN_MODE_ALL 0xFFFFFFFF\n\ntypedef struct PinData_s PinData;\n\ntypedef struct {\n    uint32_t gpio;\n    uint32_t supported;\n    uint32_t enabled;\n    PinData *data;\n} PinInfo;\n\nextern PinInfo lt_arduino_pin_info_list[PINS_COUNT];\nextern PinInfo *lt_arduino_pin_gpio_map[PINS_GPIO_MAX + 1];\n\n// Custom Wiring methods\n\nbool startMainTask(void);\n\nvoid mainTask(const void *arg); // implemented in main.cpp\nvoid runPeriodicTasks();        // implemented in wiring_custom.c\n\nvoid pinModeRemove(pin_size_t pinNumber, uint32_t mask);\nPinInfo *pinInfo(pin_size_t pinNumber);\nPinInfo *pinByIndex(uint32_t index);\nPinInfo *pinByGpio(uint32_t gpio);\nuint32_t pinIndex(PinInfo *pin);\nbool pinSupported(PinInfo *pin, uint32_t mask);\nbool pinEnabled(PinInfo *pin, uint32_t mask);\nvoid pinRemoveMode(PinInfo *pin, uint32_t mask);\n\ninline void pinModeNone(pin_size_t pinNumber) {\n    pinModeRemove(pinNumber, PIN_MODE_ALL);\n}\n\nint analogRead(pin_size_t pinNumber);\nvoid analogReadResolution(int res);\nvoid analogWriteResolution(int res);\nvoid analogWriteFrequency(int hz);\nvoid analogWritePeriod(int us);\n\nextern int _analogReadResolution;\nextern int _analogWriteResolution;\nextern int _analogWritePeriod;\n\nuint16_t analogReadVoltage(pin_size_t pinNumber);\n\nuint16_t analogReadMaxVoltage(pin_size_t pinNumber);\n\n#ifdef __cplusplus\n} // extern \"C\"\n#endif\n
"},{"location":"ltapi/wiring__irq_8c/","title":"File wiring_irq.c","text":"

FileList > arduino > src > wiring > wiring_irq.c

Go to the source code of this file.

  • #include <Arduino.h>
"},{"location":"ltapi/wiring__irq_8c/#public-functions","title":"Public Functions","text":"Type Name void attachInterrupt (pin_size_t interruptNumber, voidFuncPtr callback, PinStatus mode)"},{"location":"ltapi/wiring__irq_8c/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/wiring__irq_8c/#function-attachinterrupt","title":"function attachInterrupt","text":"
void attachInterrupt (\n    pin_size_t interruptNumber,\n    voidFuncPtr callback,\n    PinStatus mode\n) \n

The documentation for this class was generated from the following file cores/common/arduino/src/wiring/wiring_irq.c

"},{"location":"ltapi/wiring__irq_8c_source/","title":"File wiring_irq.c","text":"

File List > arduino > src > wiring > wiring_irq.c

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2023-05-24. */\n\n#include <Arduino.h>\n\nvoid attachInterrupt(pin_size_t interruptNumber, voidFuncPtr callback, PinStatus mode) {\n    attachInterruptParam(interruptNumber, (voidFuncPtrParam)callback, mode, NULL);\n}\n
"},{"location":"ltapi/wiring__math_8cpp/","title":"File wiring_math.cpp","text":"

FileList > arduino > src > wiring > wiring_math.cpp

Go to the source code of this file.

  • #include <Arduino.h>
"},{"location":"ltapi/wiring__math_8cpp/#public-functions","title":"Public Functions","text":"Type Name long random (long howbig) long random (long howsmall, long howbig) void randomSeed (uint32_t dwSeed)"},{"location":"ltapi/wiring__math_8cpp/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/wiring__math_8cpp/#function-random","title":"function random","text":"
long random (\n    long howbig\n) \n
"},{"location":"ltapi/wiring__math_8cpp/#function-random_1","title":"function random","text":"
long random (\n    long howsmall,\n    long howbig\n) \n
"},{"location":"ltapi/wiring__math_8cpp/#function-randomseed","title":"function randomSeed","text":"
void randomSeed (\n    uint32_t dwSeed\n) \n

The documentation for this class was generated from the following file cores/common/arduino/src/wiring/wiring_math.cpp

"},{"location":"ltapi/wiring__math_8cpp_source/","title":"File wiring_math.cpp","text":"

File List > arduino > src > wiring > wiring_math.cpp

Go to the documentation of this file.

/*\n  Copyright (c) 2014 Arduino.  All right reserved.\n\n  This library is free software; you can redistribute it and/or\n  modify it under the terms of the GNU Lesser General Public\n  License as published by the Free Software Foundation; either\n  version 2.1 of the License, or (at your option) any later version.\n\n  This library is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n  See the GNU Lesser General Public License for more details.\n\n  You should have received a copy of the GNU Lesser General Public\n  License along with this library; if not, write to the Free Software\n  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n*/\n\n#include <Arduino.h>\n\nvoid randomSeed(uint32_t dwSeed) {\n    if (dwSeed != 0) {\n        srand(dwSeed);\n    }\n}\n\nlong random(long howbig) {\n    if (howbig == 0) {\n        return 0;\n    }\n\n    return rand() % howbig;\n}\n\nlong random(long howsmall, long howbig) {\n    if (howsmall >= howbig) {\n        return howsmall;\n    }\n\n    long diff = howbig - howsmall;\n\n    return random(diff) + howsmall;\n}\n
"},{"location":"ltapi/wiring__private_8c/","title":"File wiring_private.c","text":"

FileList > arduino > src > wiring > wiring_private.c

Go to the source code of this file.

  • #include \"wiring_private.h\"

The documentation for this class was generated from the following file cores/common/arduino/src/wiring/wiring_private.c

"},{"location":"ltapi/wiring__private_8c_source/","title":"File wiring_private.c","text":"

File List > arduino > src > wiring > wiring_private.c

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2023-05-24. */\n\n#include \"wiring_private.h\"\n\n#if __has_include(<wiring_data.h>)\nPinData *pinData(PinInfo *pin) {\n    if (pin->data == NULL) {\n        pin->data = calloc(1, sizeof(PinData));\n    }\n    return (PinData *)pin->data;\n}\n\nvoid pinRemoveData(PinInfo *pin) {\n    if (pin->data != NULL) {\n        free(pin->data);\n    }\n    pin->data = NULL;\n}\n#endif\n
"},{"location":"ltapi/wiring__private_8h/","title":"File wiring_private.h","text":"

FileList > arduino > src > wiring > wiring_private.h

Go to the source code of this file.

  • #include <Arduino.h>
"},{"location":"ltapi/wiring__private_8h/#public-functions","title":"Public Functions","text":"Type Name PinData * pinData (PinInfo * pin) void pinDisable (PinInfo * pin, uint32_t mask) void pinEnable (PinInfo * pin, uint32_t mask) void pinRemoveData (PinInfo * pin)"},{"location":"ltapi/wiring__private_8h/#macros","title":"Macros","text":"Type Name define pinCheckGetData (pinNumber, mask, ret) define pinCheckGetInfo (pinNumber, mask, ret) define pinIsInput (pin, data) (pinEnabled(pin, PIN_GPIO) && (data->gpioMode ^ 0b101) > 4) define pinIsOutput (pin, data) (pinEnabled(pin, PIN_GPIO) && (data->gpioMode ^ 0b101) < 5) define pinSetInputMode (pin, data, pinNumber) define pinSetOutputPull (pin, data, pinNumber, status)"},{"location":"ltapi/wiring__private_8h/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/wiring__private_8h/#function-pindata","title":"function pinData","text":"
PinData * pinData (\n    PinInfo * pin\n) \n
"},{"location":"ltapi/wiring__private_8h/#function-pindisable","title":"function pinDisable","text":"
inline void pinDisable (\n    PinInfo * pin,\n    uint32_t mask\n) \n
"},{"location":"ltapi/wiring__private_8h/#function-pinenable","title":"function pinEnable","text":"
inline void pinEnable (\n    PinInfo * pin,\n    uint32_t mask\n) \n
"},{"location":"ltapi/wiring__private_8h/#function-pinremovedata","title":"function pinRemoveData","text":"
void pinRemoveData (\n    PinInfo * pin\n) \n
"},{"location":"ltapi/wiring__private_8h/#macro-definition-documentation","title":"Macro Definition Documentation","text":""},{"location":"ltapi/wiring__private_8h/#define-pincheckgetdata","title":"define pinCheckGetData","text":"
#define pinCheckGetData (\n    pinNumber,\n    mask,\n    ret\n) PinInfo *pin = pinInfo(pinNumber);                                                                                 \\\n    if (!pin)                                                                                                          \\\n        return ret;                                                                                                    \\\n    if (!pinSupported(pin, mask))                                                                                      \\\n        return ret;                                                                                                    \\\n    PinData *data = pinData(pin);\n
"},{"location":"ltapi/wiring__private_8h/#define-pincheckgetinfo","title":"define pinCheckGetInfo","text":"
#define pinCheckGetInfo (\n    pinNumber,\n    mask,\n    ret\n) PinInfo *pin = pinInfo(pinNumber);                                                                                 \\\n    if (!pin)                                                                                                          \\\n        return ret;                                                                                                    \\\n    if (!pinSupported(pin, mask))                                                                                      \\\n        return ret;\n
"},{"location":"ltapi/wiring__private_8h/#define-pinisinput","title":"define pinIsInput","text":"
#define pinIsInput (\n    pin,\n    data\n) (pinEnabled(pin, PIN_GPIO) && (data->gpioMode ^ 0b101) > 4)\n
"},{"location":"ltapi/wiring__private_8h/#define-pinisoutput","title":"define pinIsOutput","text":"
#define pinIsOutput (\n    pin,\n    data\n) (pinEnabled(pin, PIN_GPIO) && (data->gpioMode ^ 0b101) < 5)\n
"},{"location":"ltapi/wiring__private_8h/#define-pinsetinputmode","title":"define pinSetInputMode","text":"
#define pinSetInputMode (\n    pin,\n    data,\n    pinNumber\n) do {                                                                                                               \\\n        if (!pinIsInput(pin, data))                                                                                    \\\n            pinMode(pinNumber, INPUT);                                                                                 \\\n    } while (0);\n
"},{"location":"ltapi/wiring__private_8h/#define-pinsetoutputpull","title":"define pinSetOutputPull","text":"
#define pinSetOutputPull (\n    pin,\n    data,\n    pinNumber,\n    status\n) do {                                                                                                               \\\n        if (!pinIsOutput(pin, data)) {                                                                                 \\\n            pinMode(pinNumber, INPUT_PULLDOWN ^ !!status);                                                             \\\n            return;                                                                                                    \\\n        }                                                                                                              \\\n    } while (0);\n

The documentation for this class was generated from the following file cores/common/arduino/src/wiring/wiring_private.h

"},{"location":"ltapi/wiring__private_8h_source/","title":"File wiring_private.h","text":"

File List > arduino > src > wiring > wiring_private.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2023-05-24. */\n\n#pragma once\n\n#include <Arduino.h>\n\n#if __has_include(<sdk_private.h>)\n#include <sdk_private.h>\n#endif\n\n#if __has_include(<wiring_data.h>)\n#include <wiring_data.h>\n#endif\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nPinData *pinData(PinInfo *pin);\nvoid pinRemoveData(PinInfo *pin);\n\ninline void pinEnable(PinInfo *pin, uint32_t mask) {\n    pin->enabled |= mask;\n}\n\ninline void pinDisable(PinInfo *pin, uint32_t mask) {\n    pin->enabled &= ~mask;\n}\n\n#define pinCheckGetInfo(pinNumber, mask, ret)                                                                          \\\n    PinInfo *pin = pinInfo(pinNumber);                                                                                 \\\n    if (!pin)                                                                                                          \\\n        return ret;                                                                                                    \\\n    if (!pinSupported(pin, mask))                                                                                      \\\n        return ret;\n\n#define pinCheckGetData(pinNumber, mask, ret)                                                                          \\\n    PinInfo *pin = pinInfo(pinNumber);                                                                                 \\\n    if (!pin)                                                                                                          \\\n        return ret;                                                                                                    \\\n    if (!pinSupported(pin, mask))                                                                                      \\\n        return ret;                                                                                                    \\\n    PinData *data = pinData(pin);\n\n#define pinIsOutput(pin, data) (pinEnabled(pin, PIN_GPIO) && (data->gpioMode ^ 0b101) < 5)\n#define pinIsInput(pin, data)  (pinEnabled(pin, PIN_GPIO) && (data->gpioMode ^ 0b101) > 4)\n\n#define pinSetOutputPull(pin, data, pinNumber, status)                                                                 \\\n    do {                                                                                                               \\\n        if (!pinIsOutput(pin, data)) {                                                                                 \\\n            pinMode(pinNumber, INPUT_PULLDOWN ^ !!status);                                                             \\\n            return;                                                                                                    \\\n        }                                                                                                              \\\n    } while (0);\n\n#define pinSetInputMode(pin, data, pinNumber)                                                                          \\\n    do {                                                                                                               \\\n        if (!pinIsInput(pin, data))                                                                                    \\\n            pinMode(pinNumber, INPUT);                                                                                 \\\n    } while (0);\n\n#ifdef __cplusplus\n} // extern \"C\"\n#endif\n
"},{"location":"ltapi/wiring__shift_8c/","title":"File wiring_shift.c","text":"

FileList > arduino > src > wiring > wiring_shift.c

Go to the source code of this file.

  • #include <Arduino.h>
  • #include <stdint.h>
"},{"location":"ltapi/wiring__shift_8c/#public-functions","title":"Public Functions","text":"Type Name uint8_t shiftIn (pin_size_t ulDataPin, pin_size_t ulClockPin, BitOrder ulBitOrder) void shiftOut (pin_size_t ulDataPin, pin_size_t ulClockPin, BitOrder ulBitOrder, uint8_t ulVal)"},{"location":"ltapi/wiring__shift_8c/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/wiring__shift_8c/#function-shiftin","title":"function shiftIn","text":"
uint8_t shiftIn (\n    pin_size_t ulDataPin,\n    pin_size_t ulClockPin,\n    BitOrder ulBitOrder\n) \n
"},{"location":"ltapi/wiring__shift_8c/#function-shiftout","title":"function shiftOut","text":"
void shiftOut (\n    pin_size_t ulDataPin,\n    pin_size_t ulClockPin,\n    BitOrder ulBitOrder,\n    uint8_t ulVal\n) \n

The documentation for this class was generated from the following file cores/common/arduino/src/wiring/wiring_shift.c

"},{"location":"ltapi/wiring__shift_8c_source/","title":"File wiring_shift.c","text":"

File List > arduino > src > wiring > wiring_shift.c

Go to the documentation of this file.

/*\n  Copyright (c) 2014 Arduino.  All right reserved.\n\n  This library is free software; you can redistribute it and/or\n  modify it under the terms of the GNU Lesser General Public\n  License as published by the Free Software Foundation; either\n  version 2.1 of the License, or (at your option) any later version.\n\n  This library is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n  See the GNU Lesser General Public License for more details.\n\n  You should have received a copy of the GNU Lesser General Public\n  License along with this library; if not, write to the Free Software\n  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n*/\n\n#include <Arduino.h>\n#include <stdint.h>\n\nuint8_t shiftIn(pin_size_t ulDataPin, pin_size_t ulClockPin, BitOrder ulBitOrder) {\n    uint8_t value = 0;\n    uint8_t i;\n\n    for (i = 0; i < 8; ++i) {\n        digitalWrite(ulClockPin, HIGH);\n\n        if (ulBitOrder == LSBFIRST) {\n            value |= digitalRead(ulDataPin) << i;\n        } else {\n            value |= digitalRead(ulDataPin) << (7 - i);\n        }\n\n        digitalWrite(ulClockPin, LOW);\n    }\n\n    return value;\n}\n\nvoid shiftOut(pin_size_t ulDataPin, pin_size_t ulClockPin, BitOrder ulBitOrder, uint8_t ulVal) {\n    uint8_t i;\n\n    for (i = 0; i < 8; i++) {\n        if (ulBitOrder == LSBFIRST) {\n            digitalWrite(ulDataPin, !!(ulVal & (1 << i)));\n        } else {\n            digitalWrite(ulDataPin, !!(ulVal & (1 << (7 - i))));\n        }\n\n        digitalWrite(ulClockPin, HIGH);\n        digitalWrite(ulClockPin, LOW);\n    }\n}\n
"},{"location":"ltapi/main_8c/","title":"File main.c","text":"

FileList > arduino > src > main.c

Go to the source code of this file.

  • #include <Arduino.h>
"},{"location":"ltapi/main_8c/#public-functions","title":"Public Functions","text":"Type Name int main () void mainTask (const void * arg) Main setup() and loop() task. Not to be called directly."},{"location":"ltapi/main_8c/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/main_8c/#function-main","title":"function main","text":"
int main () \n
"},{"location":"ltapi/main_8c/#function-maintask","title":"function mainTask","text":"
void mainTask (\n    const void * arg\n) \n

The documentation for this class was generated from the following file cores/common/arduino/src/main.c

"},{"location":"ltapi/main_8c_source/","title":"File main.c","text":"

File List > arduino > src > main.c

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2023-02-27. */\n\n#include <Arduino.h>\n\nint main() {\n    // initialize Arduino framework\n    lt_init_arduino();\n    // start the main task and OS kernel\n    if (!startMainTask()) {\n        LT_F(\"Couldn't start the main task\");\n        return 1;\n    }\n    return 0;\n}\n\nvoid mainTask(const void *arg) {\n    setup();\n\n    for (;;) {\n        loop();\n        yield();\n    }\n}\n
"},{"location":"ltapi/dir_715308b29b364e222d2654a6be231c22/","title":"Dir cores/common/base","text":"

FileList > base

"},{"location":"ltapi/dir_715308b29b364e222d2654a6be231c22/#files","title":"Files","text":"Type Name file libretiny.h file lt_api.h file lt_config.h file lt_logger.c file lt_logger.h file lt_main.c file lt_pins.h file lt_posix_api.h file lt_types.h"},{"location":"ltapi/dir_715308b29b364e222d2654a6be231c22/#directories","title":"Directories","text":"Type Name dir api dir compat dir config dir fixups dir posix dir wraps

The documentation for this class was generated from the following file cores/common/base/

"},{"location":"ltapi/dir_c7e317b16142bccc961a83c0babf0065/","title":"Dir cores/common/base/api","text":"

FileList > api

"},{"location":"ltapi/dir_c7e317b16142bccc961a83c0babf0065/#files","title":"Files","text":"Type Name file lt_cpu.c file lt_cpu.h file lt_device.c file lt_device.h file lt_flash.c file lt_flash.h file lt_init.h file lt_mem.c file lt_mem.h file lt_ota.c file lt_ota.h file lt_sleep.c file lt_sleep.h file lt_utils.c file lt_utils.h file lt_wdt.c file lt_wdt.h

The documentation for this class was generated from the following file cores/common/base/api/

"},{"location":"ltapi/lt__cpu_8c/","title":"File lt_cpu.c","text":"

FileList > api > lt_cpu.c

Go to the source code of this file.

  • #include \"lt_cpu.h\"
"},{"location":"ltapi/lt__cpu_8c/#public-functions","title":"Public Functions","text":"Type Name __attribute__ ((weak)) lt_cpu_family_t lt_cpu_get_family () Get CPU family ID (as lt_cpu_family_t enum member). const char * lt_cpu_get_family_name () Get CPU family name as string. uint32_t lt_cpu_get_freq_mhz () Get CPU frequency in MHz. const char * lt_cpu_get_model_code () Get CPU model name as string (lowercase). const char * lt_cpu_get_model_name () Get CPU model name as string (uppercase)."},{"location":"ltapi/lt__cpu_8c/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/lt__cpu_8c/#function-__attribute__","title":"function __attribute__","text":"
__attribute__ (\n    (weak)\n) \n
"},{"location":"ltapi/lt__cpu_8c/#function-lt_cpu_get_family","title":"function lt_cpu_get_family","text":"
lt_cpu_family_t lt_cpu_get_family () \n
"},{"location":"ltapi/lt__cpu_8c/#function-lt_cpu_get_family_name","title":"function lt_cpu_get_family_name","text":"
const char * lt_cpu_get_family_name () \n
"},{"location":"ltapi/lt__cpu_8c/#function-lt_cpu_get_freq_mhz","title":"function lt_cpu_get_freq_mhz","text":"
uint32_t lt_cpu_get_freq_mhz () \n
"},{"location":"ltapi/lt__cpu_8c/#function-lt_cpu_get_model_code","title":"function lt_cpu_get_model_code","text":"
const char * lt_cpu_get_model_code () \n
"},{"location":"ltapi/lt__cpu_8c/#function-lt_cpu_get_model_name","title":"function lt_cpu_get_model_name","text":"
const char * lt_cpu_get_model_name () \n

The documentation for this class was generated from the following file cores/common/base/api/lt_cpu.c

"},{"location":"ltapi/lt__cpu_8c_source/","title":"File lt_cpu.c","text":"

File List > api > lt_cpu.c

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-04-29. */\n\n#include \"lt_cpu.h\"\n\n#if LT_HAS_FREERTOS\n#include <FreeRTOS.h>\n#include <task.h>\n#endif\n\nlt_cpu_family_t lt_cpu_get_family() {\n    return FAMILY;\n}\n\nconst char *lt_cpu_get_family_name() {\n    return STRINGIFY_MACRO(FAMILY) + 2;\n}\n\n__attribute__((weak)) lt_cpu_model_t lt_cpu_get_model() {\n    return MCU;\n}\n\nconst char *lt_cpu_get_model_name() {\n    return STRINGIFY_MACRO(MCU);\n}\n\nconst char *lt_cpu_get_model_code() {\n    return STRINGIFY_MACRO(MCULC);\n}\n\n__attribute__((weak)) uint32_t lt_cpu_get_unique_id() {\n    return lt_cpu_get_mac_id();\n}\n\n__attribute__((weak)) uint32_t lt_cpu_get_mac_id() {\n    uint8_t mac[6];\n    lt_get_device_mac(mac);\n    return (mac[3] << 0) | (mac[4] << 8) | (mac[5] << 16);\n}\n\n__attribute__((weak)) uint8_t lt_cpu_get_core_count() {\n    return 1;\n}\n\n#if LT_HAS_FREERTOS\n__attribute__((weak)) uint32_t lt_cpu_get_freq() {\n    return configCPU_CLOCK_HZ;\n}\n#endif\n\nuint32_t lt_cpu_get_freq_mhz() {\n    return lt_cpu_get_freq() / 1000000;\n}\n\n#if LT_HAS_FREERTOS\n__attribute__((weak)) uint32_t lt_cpu_get_cycle_count() {\n    return xTaskGetTickCount() * (configCPU_CLOCK_HZ / configTICK_RATE_HZ);\n}\n#endif\n
"},{"location":"ltapi/lt__cpu_8h/","title":"File lt_cpu.h","text":"

FileList > api > lt_cpu.h

Go to the source code of this file.

  • #include <libretiny.h>
"},{"location":"ltapi/lt__cpu_8h/#public-functions","title":"Public Functions","text":"Type Name uint8_t lt_cpu_get_core_count () Get CPU core count. const char * lt_cpu_get_core_type () Get CPU core type name as string. uint32_t lt_cpu_get_cycle_count () Get CPU cycle count. lt_cpu_family_t lt_cpu_get_family () Get CPU family ID (as lt_cpu_family_t enum member). const char * lt_cpu_get_family_name () Get CPU family name as string. uint32_t lt_cpu_get_freq () Get CPU frequency in Hz. uint32_t lt_cpu_get_freq_mhz () Get CPU frequency in MHz. uint32_t lt_cpu_get_mac_id () Get CPU ID based on the last three octets of MAC address. Note: the number is 24-bit (with the MSB being zero). The 3rd-to-last octet is least-significant, the last octet is most-significant. lt_cpu_model_t lt_cpu_get_model () Get CPU model ID (as lt_cpu_model_t enum member). const char * lt_cpu_get_model_code () Get CPU model name as string (lowercase). const char * lt_cpu_get_model_name () Get CPU model name as string (uppercase). uint32_t lt_cpu_get_unique_id () Get CPU unique ID. This may be based on MAC, eFuse, etc. (family-specific). Note: the number is 24-bit (with the MSB being zero)."},{"location":"ltapi/lt__cpu_8h/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/lt__cpu_8h/#function-lt_cpu_get_core_count","title":"function lt_cpu_get_core_count","text":"
uint8_t lt_cpu_get_core_count () \n
"},{"location":"ltapi/lt__cpu_8h/#function-lt_cpu_get_core_type","title":"function lt_cpu_get_core_type","text":"
const char * lt_cpu_get_core_type () \n
"},{"location":"ltapi/lt__cpu_8h/#function-lt_cpu_get_cycle_count","title":"function lt_cpu_get_cycle_count","text":"
uint32_t lt_cpu_get_cycle_count () \n
"},{"location":"ltapi/lt__cpu_8h/#function-lt_cpu_get_family","title":"function lt_cpu_get_family","text":"
lt_cpu_family_t lt_cpu_get_family () \n
"},{"location":"ltapi/lt__cpu_8h/#function-lt_cpu_get_family_name","title":"function lt_cpu_get_family_name","text":"
const char * lt_cpu_get_family_name () \n
"},{"location":"ltapi/lt__cpu_8h/#function-lt_cpu_get_freq","title":"function lt_cpu_get_freq","text":"
uint32_t lt_cpu_get_freq () \n
"},{"location":"ltapi/lt__cpu_8h/#function-lt_cpu_get_freq_mhz","title":"function lt_cpu_get_freq_mhz","text":"
uint32_t lt_cpu_get_freq_mhz () \n
"},{"location":"ltapi/lt__cpu_8h/#function-lt_cpu_get_mac_id","title":"function lt_cpu_get_mac_id","text":"
uint32_t lt_cpu_get_mac_id () \n
"},{"location":"ltapi/lt__cpu_8h/#function-lt_cpu_get_model","title":"function lt_cpu_get_model","text":"
lt_cpu_model_t lt_cpu_get_model () \n
"},{"location":"ltapi/lt__cpu_8h/#function-lt_cpu_get_model_code","title":"function lt_cpu_get_model_code","text":"
const char * lt_cpu_get_model_code () \n
"},{"location":"ltapi/lt__cpu_8h/#function-lt_cpu_get_model_name","title":"function lt_cpu_get_model_name","text":"
const char * lt_cpu_get_model_name () \n
"},{"location":"ltapi/lt__cpu_8h/#function-lt_cpu_get_unique_id","title":"function lt_cpu_get_unique_id","text":"
uint32_t lt_cpu_get_unique_id () \n

The documentation for this class was generated from the following file cores/common/base/api/lt_cpu.h

"},{"location":"ltapi/lt__cpu_8h_source/","title":"File lt_cpu.h","text":"

File List > api > lt_cpu.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2023-03-09. */\n\n#pragma once\n\n#include <libretiny.h>\n\nlt_cpu_family_t lt_cpu_get_family();\n\nconst char *lt_cpu_get_family_name();\n\nlt_cpu_model_t lt_cpu_get_model();\n\nconst char *lt_cpu_get_model_name();\n\nconst char *lt_cpu_get_model_code();\n\nuint32_t lt_cpu_get_unique_id();\n\nuint32_t lt_cpu_get_mac_id();\n\nuint8_t lt_cpu_get_core_count();\n\nconst char *lt_cpu_get_core_type();\n\nuint32_t lt_cpu_get_freq();\n\nuint32_t lt_cpu_get_freq_mhz();\n\nuint32_t lt_cpu_get_cycle_count();\n
"},{"location":"ltapi/lt__device_8c/","title":"File lt_device.c","text":"

FileList > api > lt_device.c

Go to the source code of this file.

  • #include \"lt_device.h\"
"},{"location":"ltapi/lt__device_8c/#public-static-attributes","title":"Public Static Attributes","text":"Type Name char * device_name = = NULL"},{"location":"ltapi/lt__device_8c/#public-functions","title":"Public Functions","text":"Type Name __attribute__ ((weak)) const char * lt_get_board_code () Get board code. const char * lt_get_device_name () Get device friendly name in format \"LT-<chip model>-<MAC ID>\". Can be used as hostname. const char * lt_get_reboot_reason_name (lt_reboot_reason_t reason) Get a textual representation of a reboot reason. const char * lt_get_version () Get LibreTiny version string."},{"location":"ltapi/lt__device_8c/#public-static-attributes-documentation","title":"Public Static Attributes Documentation","text":""},{"location":"ltapi/lt__device_8c/#variable-device_name","title":"variable device_name","text":"
char* device_name;\n
"},{"location":"ltapi/lt__device_8c/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/lt__device_8c/#function-__attribute__","title":"function __attribute__","text":"
__attribute__ (\n    (weak)\n) \n
"},{"location":"ltapi/lt__device_8c/#function-lt_get_board_code","title":"function lt_get_board_code","text":"
const char * lt_get_board_code () \n
"},{"location":"ltapi/lt__device_8c/#function-lt_get_device_name","title":"function lt_get_device_name","text":"
const char * lt_get_device_name () \n
"},{"location":"ltapi/lt__device_8c/#function-lt_get_reboot_reason_name","title":"function lt_get_reboot_reason_name","text":"

Get a textual representation of a reboot reason.

const char * lt_get_reboot_reason_name (\n    lt_reboot_reason_t reason\n) \n

Parameters:

  • reason value to convert to text, pass 0 to read from lt_reboot_get_reason()
"},{"location":"ltapi/lt__device_8c/#function-lt_get_version","title":"function lt_get_version","text":"
const char * lt_get_version () \n

The documentation for this class was generated from the following file cores/common/base/api/lt_device.c

"},{"location":"ltapi/lt__device_8c_source/","title":"File lt_device.c","text":"

File List > api > lt_device.c

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-04-29. */\n\n#include \"lt_device.h\"\n\nstatic char *device_name = NULL;\n\nconst char *lt_get_version() {\n    return LT_VERSION_STR;\n}\n\nconst char *lt_get_board_code() {\n    return LT_BOARD_STR;\n}\n\nconst char *lt_get_device_name() {\n    if (device_name)\n        return device_name;\n    uint32_t chip_id = lt_cpu_get_mac_id();\n    uint8_t *id      = (uint8_t *)&chip_id;\n\n    const char *model = lt_cpu_get_model_code();\n    uint8_t model_len = strlen(model);\n    device_name       = (char *)malloc(3 + model_len + 1 + 6 + 1);\n\n    sprintf(device_name, \"LT-%s-%02x%02x%02x\", model, id[0], id[1], id[2]);\n    return device_name;\n}\n\n__attribute__((weak)) void lt_reboot() {\n    // The Watchdog Way\n    lt_wdt_enable(1L);\n    while (1) {}\n}\n\n__attribute__((weak)) bool lt_reboot_wdt() {\n    if (!lt_wdt_enable(1L))\n        return false;\n    while (1) {}\n}\n\n__attribute__((weak)) bool lt_reboot_download_mode() {\n    return false;\n}\n\n__attribute__((weak)) lt_reboot_reason_t lt_get_reboot_reason() {\n    return REBOOT_REASON_UNKNOWN;\n}\n\nconst char *lt_get_reboot_reason_name(lt_reboot_reason_t reason) {\n    if (!reason)\n        reason = lt_get_reboot_reason();\n    switch (reason) {\n        case REBOOT_REASON_POWER:\n            return \"Power-On\";\n        case REBOOT_REASON_BROWNOUT:\n            return \"Brownout\";\n        case REBOOT_REASON_HARDWARE:\n            return \"HW Reboot\";\n        case REBOOT_REASON_SOFTWARE:\n            return \"SW Reboot\";\n        case REBOOT_REASON_WATCHDOG:\n            return \"WDT Reset\";\n        case REBOOT_REASON_CRASH:\n            return \"Crash\";\n        case REBOOT_REASON_SLEEP_GPIO:\n            return \"Sleep Wakeup (GPIO)\";\n        case REBOOT_REASON_SLEEP_RTC:\n            return \"Sleep Wakeup (RTC)\";\n        case REBOOT_REASON_SLEEP_USB:\n            return \"Sleep Wakeup (USB)\";\n        case REBOOT_REASON_DEBUGGER:\n            return \"Debugger\";\n        default:\n            return \"Unknown\";\n    }\n}\n\n__attribute__((weak)) bool lt_set_debug_mode(lt_debug_mode_t mode) {\n    return false;\n}\n\n__attribute__((weak)) void lt_gpio_recover() {\n    lt_set_debug_mode(DEBUG_MODE_OFF);\n}\n
"},{"location":"ltapi/lt__device_8h/","title":"File lt_device.h","text":"

FileList > api > lt_device.h

Go to the source code of this file.

  • #include <libretiny.h>
"},{"location":"ltapi/lt__device_8h/#public-types","title":"Public Types","text":"Type Name enum lt_debug_mode_t Debugging mode enumeration. enum lt_reboot_reason_t Reset reason enumeration."},{"location":"ltapi/lt__device_8h/#public-functions","title":"Public Functions","text":"Type Name const char * lt_get_board_code () Get board code. void lt_get_device_mac (uint8_t * mac) Read device's default MAC address into 'mac' array. This can be used even without Wi-Fi enabled, and will ignore user-changed Wi-Fi MAC (if changing is possible). const char * lt_get_device_name () Get device friendly name in format \"LT-<chip model>-<MAC ID>\". Can be used as hostname. lt_reboot_reason_t lt_get_reboot_reason () Get the reason of last chip reboot. const char * lt_get_reboot_reason_name (lt_reboot_reason_t reason) Get a textual representation of a reboot reason. const char * lt_get_version () Get LibreTiny version string. void lt_gpio_recover () Reconfigure GPIO pins used for debugging (SWD/JTAG), so that they can be used as normal I/O. void lt_reboot () Reboot the CPU. bool lt_reboot_download_mode () Reboot the CPU and stay in download mode (if possible). bool lt_reboot_wdt () Reboot the CPU with a watchdog timeout (if possible). bool lt_set_debug_mode (lt_debug_mode_t mode) Set debugger mode (JTAG, SWD or OFF)."},{"location":"ltapi/lt__device_8h/#macros","title":"Macros","text":"Type Name define REBOOT_REASON_SLEEP REBOOT_REASON_SLEEP_GPIO define RESET_REASON_BROWNOUT REBOOT_REASON_BROWNOUT define RESET_REASON_CRASH REBOOT_REASON_CRASH define RESET_REASON_HARDWARE REBOOT_REASON_HARDWARE define RESET_REASON_MAX REBOOT_REASON_MAX define RESET_REASON_POWER REBOOT_REASON_POWER define RESET_REASON_SLEEP REBOOT_REASON_SLEEP_GPIO define RESET_REASON_SLEEP_GPIO REBOOT_REASON_SLEEP_GPIO define RESET_REASON_SLEEP_RTC REBOOT_REASON_SLEEP_RTC define RESET_REASON_SLEEP_USB REBOOT_REASON_SLEEP_USB define RESET_REASON_SOFTWARE REBOOT_REASON_SOFTWARE define RESET_REASON_UNKNOWN REBOOT_REASON_UNKNOWN define RESET_REASON_WATCHDOG REBOOT_REASON_WATCHDOG"},{"location":"ltapi/lt__device_8h/#public-types-documentation","title":"Public Types Documentation","text":""},{"location":"ltapi/lt__device_8h/#enum-lt_debug_mode_t","title":"enum lt_debug_mode_t","text":"
enum lt_debug_mode_t {\n    DEBUG_MODE_OFF = 0,\n    DEBUG_MODE_JTAG = 1,\n    DEBUG_MODE_SWD = 2\n};\n
"},{"location":"ltapi/lt__device_8h/#enum-lt_reboot_reason_t","title":"enum lt_reboot_reason_t","text":"
enum lt_reboot_reason_t {\n    REBOOT_REASON_UNKNOWN = 1,\n    REBOOT_REASON_POWER = 2,\n    REBOOT_REASON_BROWNOUT = 3,\n    REBOOT_REASON_HARDWARE = 4,\n    REBOOT_REASON_SOFTWARE = 5,\n    REBOOT_REASON_WATCHDOG = 6,\n    REBOOT_REASON_CRASH = 7,\n    REBOOT_REASON_SLEEP_GPIO = 8,\n    REBOOT_REASON_SLEEP_RTC = 9,\n    REBOOT_REASON_SLEEP_USB = 10,\n    REBOOT_REASON_DEBUGGER = 11,\n    REBOOT_REASON_MAX = 12\n};\n
"},{"location":"ltapi/lt__device_8h/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/lt__device_8h/#function-lt_get_board_code","title":"function lt_get_board_code","text":"
const char * lt_get_board_code () \n
"},{"location":"ltapi/lt__device_8h/#function-lt_get_device_mac","title":"function lt_get_device_mac","text":"
void lt_get_device_mac (\n    uint8_t * mac\n) \n
"},{"location":"ltapi/lt__device_8h/#function-lt_get_device_name","title":"function lt_get_device_name","text":"
const char * lt_get_device_name () \n
"},{"location":"ltapi/lt__device_8h/#function-lt_get_reboot_reason","title":"function lt_get_reboot_reason","text":"
lt_reboot_reason_t lt_get_reboot_reason () \n
"},{"location":"ltapi/lt__device_8h/#function-lt_get_reboot_reason_name","title":"function lt_get_reboot_reason_name","text":"

Get a textual representation of a reboot reason.

const char * lt_get_reboot_reason_name (\n    lt_reboot_reason_t reason\n) \n

Parameters:

  • reason value to convert to text, pass 0 to read from lt_reboot_get_reason()
"},{"location":"ltapi/lt__device_8h/#function-lt_get_version","title":"function lt_get_version","text":"
const char * lt_get_version () \n
"},{"location":"ltapi/lt__device_8h/#function-lt_gpio_recover","title":"function lt_gpio_recover","text":"
void lt_gpio_recover () \n
"},{"location":"ltapi/lt__device_8h/#function-lt_reboot","title":"function lt_reboot","text":"
void lt_reboot () \n
"},{"location":"ltapi/lt__device_8h/#function-lt_reboot_download_mode","title":"function lt_reboot_download_mode","text":"

Reboot the CPU and stay in download mode (if possible).

bool lt_reboot_download_mode () \n

Returns:

whether download-mode reboot is possible

"},{"location":"ltapi/lt__device_8h/#function-lt_reboot_wdt","title":"function lt_reboot_wdt","text":"

Reboot the CPU with a watchdog timeout (if possible).

bool lt_reboot_wdt () \n

Returns:

whether WDT reboot is possible

"},{"location":"ltapi/lt__device_8h/#function-lt_set_debug_mode","title":"function lt_set_debug_mode","text":"

Set debugger mode (JTAG, SWD or OFF).

bool lt_set_debug_mode (\n    lt_debug_mode_t mode\n) \n

Returns:

whether the mode is supported, and setting it was successful

"},{"location":"ltapi/lt__device_8h/#macro-definition-documentation","title":"Macro Definition Documentation","text":""},{"location":"ltapi/lt__device_8h/#define-reboot_reason_sleep","title":"define REBOOT_REASON_SLEEP","text":"
#define REBOOT_REASON_SLEEP REBOOT_REASON_SLEEP_GPIO\n
"},{"location":"ltapi/lt__device_8h/#define-reset_reason_brownout","title":"define RESET_REASON_BROWNOUT","text":"
#define RESET_REASON_BROWNOUT REBOOT_REASON_BROWNOUT\n
"},{"location":"ltapi/lt__device_8h/#define-reset_reason_crash","title":"define RESET_REASON_CRASH","text":"
#define RESET_REASON_CRASH REBOOT_REASON_CRASH\n
"},{"location":"ltapi/lt__device_8h/#define-reset_reason_hardware","title":"define RESET_REASON_HARDWARE","text":"
#define RESET_REASON_HARDWARE REBOOT_REASON_HARDWARE\n
"},{"location":"ltapi/lt__device_8h/#define-reset_reason_max","title":"define RESET_REASON_MAX","text":"
#define RESET_REASON_MAX REBOOT_REASON_MAX\n
"},{"location":"ltapi/lt__device_8h/#define-reset_reason_power","title":"define RESET_REASON_POWER","text":"
#define RESET_REASON_POWER REBOOT_REASON_POWER\n
"},{"location":"ltapi/lt__device_8h/#define-reset_reason_sleep","title":"define RESET_REASON_SLEEP","text":"
#define RESET_REASON_SLEEP REBOOT_REASON_SLEEP_GPIO\n
"},{"location":"ltapi/lt__device_8h/#define-reset_reason_sleep_gpio","title":"define RESET_REASON_SLEEP_GPIO","text":"
#define RESET_REASON_SLEEP_GPIO REBOOT_REASON_SLEEP_GPIO\n
"},{"location":"ltapi/lt__device_8h/#define-reset_reason_sleep_rtc","title":"define RESET_REASON_SLEEP_RTC","text":"
#define RESET_REASON_SLEEP_RTC REBOOT_REASON_SLEEP_RTC\n
"},{"location":"ltapi/lt__device_8h/#define-reset_reason_sleep_usb","title":"define RESET_REASON_SLEEP_USB","text":"
#define RESET_REASON_SLEEP_USB REBOOT_REASON_SLEEP_USB\n
"},{"location":"ltapi/lt__device_8h/#define-reset_reason_software","title":"define RESET_REASON_SOFTWARE","text":"
#define RESET_REASON_SOFTWARE REBOOT_REASON_SOFTWARE\n
"},{"location":"ltapi/lt__device_8h/#define-reset_reason_unknown","title":"define RESET_REASON_UNKNOWN","text":"
#define RESET_REASON_UNKNOWN REBOOT_REASON_UNKNOWN\n
"},{"location":"ltapi/lt__device_8h/#define-reset_reason_watchdog","title":"define RESET_REASON_WATCHDOG","text":"
#define RESET_REASON_WATCHDOG REBOOT_REASON_WATCHDOG\n

The documentation for this class was generated from the following file cores/common/base/api/lt_device.h

"},{"location":"ltapi/lt__device_8h_source/","title":"File lt_device.h","text":"

File List > api > lt_device.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2023-03-09. */\n\n#pragma once\n\n#include <libretiny.h>\n\n#define RESET_REASON_UNKNOWN    REBOOT_REASON_UNKNOWN\n#define RESET_REASON_POWER      REBOOT_REASON_POWER\n#define RESET_REASON_BROWNOUT   REBOOT_REASON_BROWNOUT\n#define RESET_REASON_HARDWARE   REBOOT_REASON_HARDWARE\n#define RESET_REASON_SOFTWARE   REBOOT_REASON_SOFTWARE\n#define RESET_REASON_WATCHDOG   REBOOT_REASON_WATCHDOG\n#define RESET_REASON_CRASH      REBOOT_REASON_CRASH\n#define RESET_REASON_SLEEP_GPIO REBOOT_REASON_SLEEP_GPIO\n#define RESET_REASON_SLEEP_RTC  REBOOT_REASON_SLEEP_RTC\n#define RESET_REASON_SLEEP_USB  REBOOT_REASON_SLEEP_USB\n#define RESET_REASON_MAX        REBOOT_REASON_MAX\n\ntypedef enum {\n    REBOOT_REASON_UNKNOWN    = 1,\n    REBOOT_REASON_POWER      = 2,\n    REBOOT_REASON_BROWNOUT   = 3,\n    REBOOT_REASON_HARDWARE   = 4,\n    REBOOT_REASON_SOFTWARE   = 5,\n    REBOOT_REASON_WATCHDOG   = 6,\n    REBOOT_REASON_CRASH      = 7,\n    REBOOT_REASON_SLEEP_GPIO = 8,\n    REBOOT_REASON_SLEEP_RTC  = 9,\n    REBOOT_REASON_SLEEP_USB  = 10,\n    REBOOT_REASON_DEBUGGER   = 11,\n    REBOOT_REASON_MAX        = 12,\n} lt_reboot_reason_t;\n\n// RESET_REASON_SLEEP deprecated, kept for compatibility\n#define RESET_REASON_SLEEP  REBOOT_REASON_SLEEP_GPIO\n#define REBOOT_REASON_SLEEP REBOOT_REASON_SLEEP_GPIO\n\ntypedef enum {\n    DEBUG_MODE_OFF  = 0,\n    DEBUG_MODE_JTAG = 1,\n    DEBUG_MODE_SWD  = 2,\n} lt_debug_mode_t;\n\nconst char *lt_get_version();\n\nconst char *lt_get_board_code();\n\nconst char *lt_get_device_name();\n\nvoid lt_get_device_mac(uint8_t *mac);\n\nvoid lt_reboot();\n\nbool lt_reboot_wdt();\n\nbool lt_reboot_download_mode();\n\nlt_reboot_reason_t lt_get_reboot_reason();\n\nconst char *lt_get_reboot_reason_name(lt_reboot_reason_t reason);\n\nbool lt_set_debug_mode(lt_debug_mode_t mode);\n\nvoid lt_gpio_recover();\n
"},{"location":"ltapi/lt__flash_8c/","title":"File lt_flash.c","text":"

FileList > api > lt_flash.c

Go to the source code of this file.

  • #include \"lt_flash.h\"
  • #include <fal.h>
"},{"location":"ltapi/lt__flash_8c/#public-functions","title":"Public Functions","text":"Type Name __attribute__ ((weak)) bool lt_flash_erase (uint32_t offset, size_t length) Erase flash area. Flash can only be erased in blocks (usually 4 KiB). bool lt_flash_erase_block (uint32_t offset) Erase a single block of flash (usually 4 KiB). uint32_t lt_flash_read (uint32_t offset, uint8_t * data, size_t length) Read data from the flash. uint32_t lt_flash_write (uint32_t offset, const uint8_t * data, size_t length) Write data to the flash."},{"location":"ltapi/lt__flash_8c/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/lt__flash_8c/#function-__attribute__","title":"function __attribute__","text":"
__attribute__ (\n    (weak)\n) \n
"},{"location":"ltapi/lt__flash_8c/#function-lt_flash_erase","title":"function lt_flash_erase","text":"

Erase flash area. Flash can only be erased in blocks (usually 4 KiB).

bool lt_flash_erase (\n    uint32_t offset,\n    size_t length\n) \n

Parameters:

  • offset starting offset to erase (in bytes); must be multiple of the flash chip's block size
  • length length of data to erase (in bytes); will be rounded up to block size

Returns:

whether erasing was successful

"},{"location":"ltapi/lt__flash_8c/#function-lt_flash_erase_block","title":"function lt_flash_erase_block","text":"

Erase a single block of flash (usually 4 KiB).

bool lt_flash_erase_block (\n    uint32_t offset\n) \n

Parameters:

  • offset offset of the block (in bytes); must be multiple of the flash chip's block size

Returns:

whether erasing was successful

"},{"location":"ltapi/lt__flash_8c/#function-lt_flash_read","title":"function lt_flash_read","text":"

Read data from the flash.

uint32_t lt_flash_read (\n    uint32_t offset,\n    uint8_t * data,\n    size_t length\n) \n

Parameters:

  • offset starting offset (in bytes)
  • data pointer to where to store the data
  • length length of data to read

Returns:

length of data successfully read (should equal 'length')

"},{"location":"ltapi/lt__flash_8c/#function-lt_flash_write","title":"function lt_flash_write","text":"

Write data to the flash.

uint32_t lt_flash_write (\n    uint32_t offset,\n    const uint8_t * data,\n    size_t length\n) \n

Parameters:

  • offset starting offset (in bytes)
  • data pointer to data to write
  • length length of data to write

Returns:

length of data successfully written (should equal 'length')

The documentation for this class was generated from the following file cores/common/base/api/lt_flash.c

"},{"location":"ltapi/lt__flash_8c_source/","title":"File lt_flash.c","text":"

File List > api > lt_flash.c

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-04-29. */\n\n#include \"lt_flash.h\"\n\n#include <fal.h>\n\n__attribute__((weak)) uint32_t lt_flash_get_size() {\n    lt_flash_id_t id = lt_flash_get_id();\n    if (id.chip_size_id >= 0x14 && id.chip_size_id <= 0x19) {\n        return (1 << id.chip_size_id);\n    }\n#ifdef FLASH_LENGTH\n    return FLASH_LENGTH;\n#else\n    return 0;\n#endif\n}\n\nbool lt_flash_erase(uint32_t offset, size_t length) {\n    return fal_partition_erase(fal_root_part, offset, length) >= 0;\n}\n\nbool lt_flash_erase_block(uint32_t offset) {\n    return fal_partition_erase(fal_root_part, offset, 1) >= 0;\n}\n\nuint32_t lt_flash_read(uint32_t offset, uint8_t *data, size_t length) {\n    int ret = fal_partition_read(fal_root_part, offset, data, length);\n    if (ret == -1)\n        return 0;\n    return ret;\n}\n\nuint32_t lt_flash_write(uint32_t offset, const uint8_t *data, size_t length) {\n    int ret = fal_partition_write(fal_root_part, offset, data, length);\n    if (ret == -1)\n        return 0;\n    return ret;\n}\n
"},{"location":"ltapi/lt__flash_8h/","title":"File lt_flash.h","text":"

FileList > api > lt_flash.h

Go to the source code of this file.

  • #include <libretiny.h>
"},{"location":"ltapi/lt__flash_8h/#classes","title":"Classes","text":"Type Name struct lt_flash_id_t Flash chip ID structure."},{"location":"ltapi/lt__flash_8h/#public-functions","title":"Public Functions","text":"Type Name bool lt_flash_erase (uint32_t offset, size_t length) Erase flash area. Flash can only be erased in blocks (usually 4 KiB). bool lt_flash_erase_block (uint32_t offset) Erase a single block of flash (usually 4 KiB). lt_flash_id_t lt_flash_get_id () Read flash chip ID and return a lt_flash_id_t struct. uint32_t lt_flash_get_size () Get flash chip total size. uint32_t lt_flash_read (uint32_t offset, uint8_t * data, size_t length) Read data from the flash. uint32_t lt_flash_write (uint32_t offset, const uint8_t * data, size_t length) Write data to the flash."},{"location":"ltapi/lt__flash_8h/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/lt__flash_8h/#function-lt_flash_erase","title":"function lt_flash_erase","text":"

Erase flash area. Flash can only be erased in blocks (usually 4 KiB).

bool lt_flash_erase (\n    uint32_t offset,\n    size_t length\n) \n

Parameters:

  • offset starting offset to erase (in bytes); must be multiple of the flash chip's block size
  • length length of data to erase (in bytes); will be rounded up to block size

Returns:

whether erasing was successful

"},{"location":"ltapi/lt__flash_8h/#function-lt_flash_erase_block","title":"function lt_flash_erase_block","text":"

Erase a single block of flash (usually 4 KiB).

bool lt_flash_erase_block (\n    uint32_t offset\n) \n

Parameters:

  • offset offset of the block (in bytes); must be multiple of the flash chip's block size

Returns:

whether erasing was successful

"},{"location":"ltapi/lt__flash_8h/#function-lt_flash_get_id","title":"function lt_flash_get_id","text":"
lt_flash_id_t lt_flash_get_id () \n
"},{"location":"ltapi/lt__flash_8h/#function-lt_flash_get_size","title":"function lt_flash_get_size","text":"

Get flash chip total size.

uint32_t lt_flash_get_size () \n

The default implementation uses the least significant byte of the chip ID to determine the size.

"},{"location":"ltapi/lt__flash_8h/#function-lt_flash_read","title":"function lt_flash_read","text":"

Read data from the flash.

uint32_t lt_flash_read (\n    uint32_t offset,\n    uint8_t * data,\n    size_t length\n) \n

Parameters:

  • offset starting offset (in bytes)
  • data pointer to where to store the data
  • length length of data to read

Returns:

length of data successfully read (should equal 'length')

"},{"location":"ltapi/lt__flash_8h/#function-lt_flash_write","title":"function lt_flash_write","text":"

Write data to the flash.

uint32_t lt_flash_write (\n    uint32_t offset,\n    const uint8_t * data,\n    size_t length\n) \n

Parameters:

  • offset starting offset (in bytes)
  • data pointer to data to write
  • length length of data to write

Returns:

length of data successfully written (should equal 'length')

The documentation for this class was generated from the following file cores/common/base/api/lt_flash.h

"},{"location":"ltapi/lt__flash_8h_source/","title":"File lt_flash.h","text":"

File List > api > lt_flash.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2023-03-09. */\n\n#pragma once\n\n#include <libretiny.h>\n\ntypedef struct {\n    uint8_t manufacturer_id;\n    uint8_t chip_id;\n    uint8_t chip_size_id;\n} lt_flash_id_t;\n\nlt_flash_id_t lt_flash_get_id();\n\nuint32_t lt_flash_get_size();\n\nbool lt_flash_erase(uint32_t offset, size_t length);\n\nbool lt_flash_erase_block(uint32_t offset);\n\nuint32_t lt_flash_read(uint32_t offset, uint8_t *data, size_t length);\n\nuint32_t lt_flash_write(uint32_t offset, const uint8_t *data, size_t length);\n
"},{"location":"ltapi/lt__init_8h/","title":"File lt_init.h","text":"

FileList > api > lt_init.h

Go to the source code of this file.

  • #include <libretiny.h>
"},{"location":"ltapi/lt__init_8h/#public-functions","title":"Public Functions","text":"Type Name void lt_init_arduino () Initialize the family's Arduino core (optional). This method is family-specific; the family core can do whatever it wants to. This method is empty if not implemented, and shouldn't be called manually. void lt_init_family () Initialize the family core (optional). This method is family-specific; the family core can do whatever it wants to. This method is empty if not implemented, and shouldn't be called manually. void lt_init_variant () Initialize the board (variant). This method is empty if not implemented (which is usually the case), and shouldn't be called manually."},{"location":"ltapi/lt__init_8h/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/lt__init_8h/#function-lt_init_arduino","title":"function lt_init_arduino","text":"
void lt_init_arduino () \n
"},{"location":"ltapi/lt__init_8h/#function-lt_init_family","title":"function lt_init_family","text":"
void lt_init_family () \n
"},{"location":"ltapi/lt__init_8h/#function-lt_init_variant","title":"function lt_init_variant","text":"
void lt_init_variant () \n

The documentation for this class was generated from the following file cores/common/base/api/lt_init.h

"},{"location":"ltapi/lt__init_8h_source/","title":"File lt_init.h","text":"

File List > api > lt_init.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2023-02-27. */\n\n#pragma once\n\n#include <libretiny.h>\n\nvoid lt_init_family() __attribute__((weak));\n\nvoid lt_init_variant() __attribute__((weak));\n\nvoid lt_init_arduino() __attribute__((weak));\n
"},{"location":"ltapi/lt__mem_8c/","title":"File lt_mem.c","text":"

FileList > api > lt_mem.c

Go to the source code of this file.

  • #include \"lt_mem.h\"
"},{"location":"ltapi/lt__mem_8c/#public-functions","title":"Public Functions","text":"Type Name __attribute__ ((weak))"},{"location":"ltapi/lt__mem_8c/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/lt__mem_8c/#function-__attribute__","title":"function __attribute__","text":"
__attribute__ (\n    (weak)\n) \n

The documentation for this class was generated from the following file cores/common/base/api/lt_mem.c

"},{"location":"ltapi/lt__mem_8c_source/","title":"File lt_mem.c","text":"

File List > api > lt_mem.c

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-04-29. */\n\n#include \"lt_mem.h\"\n\n#if LT_HAS_FREERTOS\n#include <FreeRTOS.h>\n#include <task.h>\n#endif\n\n#if LT_HAS_FREERTOS\n__attribute__((weak)) uint32_t lt_heap_get_size() {\n    return configTOTAL_HEAP_SIZE;\n}\n\n__attribute__((weak)) uint32_t lt_heap_get_free() {\n    return xPortGetFreeHeapSize();\n}\n\n__attribute__((weak)) uint32_t lt_heap_get_min_free() {\n    return xPortGetMinimumEverFreeHeapSize();\n}\n#endif\n\n__attribute__((weak)) uint32_t lt_heap_get_max_alloc() {\n    return 0;\n}\n
"},{"location":"ltapi/lt__mem_8h/","title":"File lt_mem.h","text":"

FileList > api > lt_mem.h

Go to the source code of this file.

  • #include <libretiny.h>
"},{"location":"ltapi/lt__mem_8h/#public-functions","title":"Public Functions","text":"Type Name uint32_t lt_heap_get_free () Get free heap size. uint32_t lt_heap_get_max_alloc () Get largest block of heap that can be allocated at once. uint32_t lt_heap_get_min_free () Get lowest level of free heap memory. uint32_t lt_heap_get_size () Get total heap size. uint32_t lt_ram_get_size () Get total RAM size."},{"location":"ltapi/lt__mem_8h/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/lt__mem_8h/#function-lt_heap_get_free","title":"function lt_heap_get_free","text":"
uint32_t lt_heap_get_free () \n
"},{"location":"ltapi/lt__mem_8h/#function-lt_heap_get_max_alloc","title":"function lt_heap_get_max_alloc","text":"
uint32_t lt_heap_get_max_alloc () \n
"},{"location":"ltapi/lt__mem_8h/#function-lt_heap_get_min_free","title":"function lt_heap_get_min_free","text":"
uint32_t lt_heap_get_min_free () \n
"},{"location":"ltapi/lt__mem_8h/#function-lt_heap_get_size","title":"function lt_heap_get_size","text":"
uint32_t lt_heap_get_size () \n
"},{"location":"ltapi/lt__mem_8h/#function-lt_ram_get_size","title":"function lt_ram_get_size","text":"
uint32_t lt_ram_get_size () \n

The documentation for this class was generated from the following file cores/common/base/api/lt_mem.h

"},{"location":"ltapi/lt__mem_8h_source/","title":"File lt_mem.h","text":"

File List > api > lt_mem.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2023-03-09. */\n\n#pragma once\n\n#include <libretiny.h>\n\nuint32_t lt_ram_get_size();\n\nuint32_t lt_heap_get_size();\n\nuint32_t lt_heap_get_free();\n\nuint32_t lt_heap_get_min_free();\n\nuint32_t lt_heap_get_max_alloc();\n
"},{"location":"ltapi/lt__ota_8c/","title":"File lt_ota.c","text":"

FileList > api > lt_ota.c

Go to the source code of this file.

  • #include \"lt_ota.h\"
  • #include <uf2ota/uf2ota.h>
"},{"location":"ltapi/lt__ota_8c/#public-functions","title":"Public Functions","text":"Type Name __attribute__ ((weak)) void lt_ota_begin (lt_ota_ctx_t * ctx, size_t size) Initialize the update context to begin OTA process. bool lt_ota_can_rollback () Check if OTA rollback is possible (switching the stored index to another partition). bool lt_ota_end (lt_ota_ctx_t * ctx) Finish the update process. If the update has been written completely, try to activate the target image. Free allocated internal structures, regardless of the activation result. uf2_ota_scheme_t lt_ota_get_uf2_scheme () Check which UF2 OTA scheme should be used for applying firmware updates. size_t lt_ota_write (lt_ota_ctx_t * ctx, const uint8_t * data, size_t len) Process a chunk of data. bool lt_ota_write_block (lt_ota_ctx_t * ctx, uf2_block_t * block) Try to write the block. In case of UF2 errors, error code is set in the context. Note: use lt_ota_write() instead. This is for internal usage only."},{"location":"ltapi/lt__ota_8c/#public-static-functions","title":"Public Static Functions","text":"Type Name size_t lt_ota_buf_left (lt_ota_ctx_t * ctx) size_t lt_ota_buf_size (lt_ota_ctx_t * ctx)"},{"location":"ltapi/lt__ota_8c/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/lt__ota_8c/#function-__attribute__","title":"function __attribute__","text":"
__attribute__ (\n    (weak)\n) \n
"},{"location":"ltapi/lt__ota_8c/#function-lt_ota_begin","title":"function lt_ota_begin","text":"

Initialize the update context to begin OTA process.

void lt_ota_begin (\n    lt_ota_ctx_t * ctx,\n    size_t size\n) \n

Parameters:

  • ctx OTA context
  • size length of the update file; 0 if unknown
"},{"location":"ltapi/lt__ota_8c/#function-lt_ota_can_rollback","title":"function lt_ota_can_rollback","text":"

Check if OTA rollback is possible (switching the stored index to another partition).

bool lt_ota_can_rollback () \n

Note that this is not the same as \"switching\" OTA with revert=true.

Returns:

true if 2nd image is valid and the chip is dual-OTA; false otherwise

"},{"location":"ltapi/lt__ota_8c/#function-lt_ota_end","title":"function lt_ota_end","text":"

Finish the update process. If the update has been written completely, try to activate the target image. Free allocated internal structures, regardless of the activation result.

bool lt_ota_end (\n    lt_ota_ctx_t * ctx\n) \n

Parameters:

  • ctx OTA context

Returns:

false if activation was attempted and not successful; true otherwise

"},{"location":"ltapi/lt__ota_8c/#function-lt_ota_get_uf2_scheme","title":"function lt_ota_get_uf2_scheme","text":"

Check which UF2 OTA scheme should be used for applying firmware updates.

uf2_ota_scheme_t lt_ota_get_uf2_scheme () \n

Returns:

OTA scheme of the target partition

"},{"location":"ltapi/lt__ota_8c/#function-lt_ota_write","title":"function lt_ota_write","text":"

Process a chunk of data.

size_t lt_ota_write (\n    lt_ota_ctx_t * ctx,\n    const uint8_t * data,\n    size_t len\n) \n

Data is written to the buffer, unless a full UF2 block is already available, in which case it's also processed by UF2OTA and written to flash.

It's advised to write in 512-byte chunks (or its multiples).

Parameters:

  • ctx OTA context
  • data chunk of bytes to process
  • len size of the chunk

Returns:

number of bytes correctly processed; should equal 'len' in case of no errors

"},{"location":"ltapi/lt__ota_8c/#function-lt_ota_write_block","title":"function lt_ota_write_block","text":"

Try to write the block. In case of UF2 errors, error code is set in the context. Note: use lt_ota_write() instead. This is for internal usage only.

bool lt_ota_write_block (\n    lt_ota_ctx_t * ctx,\n    uf2_block_t * block\n) \n

Parameters:

  • block UF2 block to check and write; cannot be NULL

Returns:

whether no error has occurred

"},{"location":"ltapi/lt__ota_8c/#public-static-functions-documentation","title":"Public Static Functions Documentation","text":""},{"location":"ltapi/lt__ota_8c/#function-lt_ota_buf_left","title":"function lt_ota_buf_left","text":"
static inline size_t lt_ota_buf_left (\n    lt_ota_ctx_t * ctx\n) \n
"},{"location":"ltapi/lt__ota_8c/#function-lt_ota_buf_size","title":"function lt_ota_buf_size","text":"
static inline size_t lt_ota_buf_size (\n    lt_ota_ctx_t * ctx\n) \n

The documentation for this class was generated from the following file cores/common/base/api/lt_ota.c

"},{"location":"ltapi/lt__ota_8c_source/","title":"File lt_ota.c","text":"

File List > api > lt_ota.c

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-04-29. */\n\n#include \"lt_ota.h\"\n\n#include <uf2ota/uf2ota.h>\n\nstatic inline size_t lt_ota_buf_left(lt_ota_ctx_t *ctx) {\n    return ctx->buf + UF2_BLOCK_SIZE - ctx->buf_pos;\n}\n\nstatic inline size_t lt_ota_buf_size(lt_ota_ctx_t *ctx) {\n    return ctx->buf_pos - ctx->buf;\n}\n\nvoid lt_ota_begin(lt_ota_ctx_t *ctx, size_t size) {\n    if (!ctx)\n        return;\n\n    memset(ctx, 0, sizeof(lt_ota_ctx_t));\n    uf2_ctx_init(&ctx->uf2, lt_ota_get_uf2_scheme(), lt_cpu_get_family());\n    uf2_info_init(&ctx->info);\n    ctx->buf_pos     = ctx->buf;\n    ctx->bytes_total = size;\n    ctx->running     = true;\n\n    lt_ota_set_write_protect(&ctx->uf2);\n\n    LT_DM(OTA, \"begin(%u, ...) / OTA curr: %u, scheme: %u\", size, lt_ota_dual_get_current(), lt_ota_get_uf2_scheme());\n}\n\nbool lt_ota_end(lt_ota_ctx_t *ctx) {\n    if (!ctx || !ctx->running)\n        return true;\n\n    uf2_ctx_free(&ctx->uf2);\n    uf2_info_free(&ctx->info);\n    ctx->running = false;\n\n    if (ctx->bytes_written && ctx->bytes_written == ctx->bytes_total) {\n        // try to activate the 2nd image\n        return lt_ota_switch(/* revert= */ false);\n    }\n\n    // activation not attempted (update aborted)\n    return true;\n}\n\n__attribute__((weak)) void lt_ota_set_write_protect(uf2_ota_t *uf2) {}\n\nsize_t lt_ota_write(lt_ota_ctx_t *ctx, const uint8_t *data, size_t len) {\n    if (!ctx || !ctx->running)\n        return 0;\n\n    // write until buffer space is available\n    size_t written = 0;\n    uint16_t to_write; // 1..512\n    while (len && (to_write = MIN((uint16_t)len, lt_ota_buf_left(ctx)))) {\n        LT_VM(OTA, \"Writing %u to buffer (%u/512)\", len, lt_ota_buf_size(ctx));\n\n        uf2_block_t *block = NULL;\n        if (to_write == UF2_BLOCK_SIZE) {\n            // data has a complete block; don't use the buffer\n            block = (uf2_block_t *)data;\n        } else {\n            // data has a part of a block; append it to the buffer\n            memcpy(ctx->buf_pos, data, to_write);\n            ctx->buf_pos += to_write;\n            if (lt_ota_buf_size(ctx) == UF2_BLOCK_SIZE) {\n                // the block is complete now\n                block = (uf2_block_t *)ctx->buf;\n            }\n        }\n\n        // write if a block is ready\n        if (block && lt_ota_write_block(ctx, block) == false)\n            // return on errors\n            return written;\n        data += to_write;\n        len -= to_write;\n        written += to_write;\n    }\n    return written;\n}\n\nbool lt_ota_write_block(lt_ota_ctx_t *ctx, uf2_block_t *block) {\n    ctx->error = uf2_check_block(&ctx->uf2, block);\n    if (ctx->error > UF2_ERR_IGNORE)\n        // block is invalid\n        return false;\n\n    if (!ctx->bytes_written) {\n        // parse header block to allow retrieving firmware info\n        ctx->error = uf2_parse_header(&ctx->uf2, block, &ctx->info);\n        if (ctx->error != UF2_ERR_OK)\n            return false;\n\n        LT_IM(\n            OTA,\n            \"%s v%s - LT v%s @ %s\",\n            ctx->info.fw_name,\n            ctx->info.fw_version,\n            ctx->info.lt_version,\n            ctx->info.board\n        );\n\n        if (ctx->bytes_total == 0) {\n            // set total update size from block count info\n            ctx->bytes_total = block->block_count * UF2_BLOCK_SIZE;\n        } else if (ctx->bytes_total != block->block_count * UF2_BLOCK_SIZE) {\n            // given update size does not match the block count\n            LT_EM(\n                OTA,\n                \"Image size wrong; got %u, calculated %llu\",\n                ctx->bytes_total,\n                block->block_count * UF2_BLOCK_SIZE\n            );\n            return false;\n        }\n    } else if (ctx->error == UF2_ERR_OK) {\n        // write data blocks normally\n        ctx->error = uf2_write(&ctx->uf2, block);\n        if (ctx->error > UF2_ERR_IGNORE)\n            // block writing failed\n            return false;\n    }\n\n    // increment total writing progress\n    ctx->bytes_written += UF2_BLOCK_SIZE;\n    // call progress callback\n    if (ctx->callback)\n        ctx->callback(ctx->callback_param);\n    // reset the buffer as it's used already\n    if (lt_ota_buf_size(ctx) == UF2_BLOCK_SIZE)\n        ctx->buf_pos = ctx->buf;\n\n    return true;\n}\n\nbool lt_ota_can_rollback() {\n    if (lt_ota_get_type() != OTA_TYPE_DUAL)\n        return false;\n    uint8_t current = lt_ota_dual_get_current();\n    if (current == 0)\n        return false;\n    return lt_ota_is_valid(current ^ 0b11);\n}\n\nuf2_ota_scheme_t lt_ota_get_uf2_scheme() {\n    if (lt_ota_get_type() == OTA_TYPE_SINGLE)\n        return UF2_SCHEME_DEVICE_SINGLE;\n    uint8_t current = lt_ota_dual_get_current();\n    if (current == 0)\n        return UF2_SCHEME_DEVICE_DUAL_1;\n    // UF2_SCHEME_DEVICE_DUAL_1 or UF2_SCHEME_DEVICE_DUAL_2\n    return (uf2_ota_scheme_t)(current ^ 0b11);\n}\n
"},{"location":"ltapi/lt__ota_8h/","title":"File lt_ota.h","text":"

FileList > api > lt_ota.h

Go to the source code of this file.

  • #include <libretiny.h>
  • #include <uf2ota/uf2types.h>
"},{"location":"ltapi/lt__ota_8h/#classes","title":"Classes","text":"Type Name struct lt_ota_ctx_t OTA update process context."},{"location":"ltapi/lt__ota_8h/#public-types","title":"Public Types","text":"Type Name enum lt_ota_type_t Chip's OTA type enumeration."},{"location":"ltapi/lt__ota_8h/#public-functions","title":"Public Functions","text":"Type Name void lt_ota_begin (lt_ota_ctx_t * ctx, size_t size) Initialize the update context to begin OTA process. bool lt_ota_can_rollback () Check if OTA rollback is possible (switching the stored index to another partition). uint8_t lt_ota_dual_get_current () Get the currently running firmware's OTA index. uint8_t lt_ota_dual_get_stored () Read the currently active OTA index, i.e. the one that will boot upon restart. bool lt_ota_end (lt_ota_ctx_t * ctx) Finish the update process. If the update has been written completely, try to activate the target image. Free allocated internal structures, regardless of the activation result. lt_ota_type_t lt_ota_get_type () Get OTA type of the device's chip. uf2_ota_scheme_t lt_ota_get_uf2_scheme () Check which UF2 OTA scheme should be used for applying firmware updates. bool lt_ota_is_valid (uint8_t index) Check if the specified OTA image is valid. void lt_ota_set_write_protect (uf2_ota_t * uf2) Set family-specific, write-protected flash areas in the OTA update context. This shouldn't be called manually, as it's done by lt_ota_begin(). bool lt_ota_switch (bool revert) Try to switch OTA index to the other image. For single-OTA chips, only check if the upgrade image is valid. size_t lt_ota_write (lt_ota_ctx_t * ctx, const uint8_t * data, size_t len) Process a chunk of data. bool lt_ota_write_block (lt_ota_ctx_t * ctx, uf2_block_t * block) Try to write the block. In case of UF2 errors, error code is set in the context. Note: use lt_ota_write() instead. This is for internal usage only."},{"location":"ltapi/lt__ota_8h/#public-types-documentation","title":"Public Types Documentation","text":""},{"location":"ltapi/lt__ota_8h/#enum-lt_ota_type_t","title":"enum lt_ota_type_t","text":"
enum lt_ota_type_t {\n    OTA_TYPE_SINGLE = 0,\n    OTA_TYPE_DUAL = 1,\n    OTA_TYPE_FILE = 2\n};\n
"},{"location":"ltapi/lt__ota_8h/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/lt__ota_8h/#function-lt_ota_begin","title":"function lt_ota_begin","text":"

Initialize the update context to begin OTA process.

void lt_ota_begin (\n    lt_ota_ctx_t * ctx,\n    size_t size\n) \n

Parameters:

  • ctx OTA context
  • size length of the update file; 0 if unknown
"},{"location":"ltapi/lt__ota_8h/#function-lt_ota_can_rollback","title":"function lt_ota_can_rollback","text":"

Check if OTA rollback is possible (switching the stored index to another partition).

bool lt_ota_can_rollback () \n

Note that this is not the same as \"switching\" OTA with revert=true.

Returns:

true if 2nd image is valid and the chip is dual-OTA; false otherwise

"},{"location":"ltapi/lt__ota_8h/#function-lt_ota_dual_get_current","title":"function lt_ota_dual_get_current","text":"

Get the currently running firmware's OTA index.

uint8_t lt_ota_dual_get_current () \n

Returns:

OTA index if dual-OTA is supported, 0 otherwise

"},{"location":"ltapi/lt__ota_8h/#function-lt_ota_dual_get_stored","title":"function lt_ota_dual_get_stored","text":"

Read the currently active OTA index, i.e. the one that will boot upon restart.

uint8_t lt_ota_dual_get_stored () \n

Returns:

OTA index if dual-OTA is supported, 0 otherwise

"},{"location":"ltapi/lt__ota_8h/#function-lt_ota_end","title":"function lt_ota_end","text":"

Finish the update process. If the update has been written completely, try to activate the target image. Free allocated internal structures, regardless of the activation result.

bool lt_ota_end (\n    lt_ota_ctx_t * ctx\n) \n

Parameters:

  • ctx OTA context

Returns:

false if activation was attempted and not successful; true otherwise

"},{"location":"ltapi/lt__ota_8h/#function-lt_ota_get_type","title":"function lt_ota_get_type","text":"
lt_ota_type_t lt_ota_get_type () \n
"},{"location":"ltapi/lt__ota_8h/#function-lt_ota_get_uf2_scheme","title":"function lt_ota_get_uf2_scheme","text":"

Check which UF2 OTA scheme should be used for applying firmware updates.

uf2_ota_scheme_t lt_ota_get_uf2_scheme () \n

Returns:

OTA scheme of the target partition

"},{"location":"ltapi/lt__ota_8h/#function-lt_ota_is_valid","title":"function lt_ota_is_valid","text":"

Check if the specified OTA image is valid.

bool lt_ota_is_valid (\n    uint8_t index\n) \n

Parameters:

  • index OTA index to check; 0 for single-OTA chips, 1 or 2 for dual-OTA chips

Returns:

true if index is valid for the chip's OTA type, and there is a valid image; false otherwise

"},{"location":"ltapi/lt__ota_8h/#function-lt_ota_set_write_protect","title":"function lt_ota_set_write_protect","text":"

Set family-specific, write-protected flash areas in the OTA update context. This shouldn't be called manually, as it's done by lt_ota_begin().

void lt_ota_set_write_protect (\n    uf2_ota_t * uf2\n) \n

Parameters:

  • uf2 uf2ota context
"},{"location":"ltapi/lt__ota_8h/#function-lt_ota_switch","title":"function lt_ota_switch","text":"

Try to switch OTA index to the other image. For single-OTA chips, only check if the upgrade image is valid.

bool lt_ota_switch (\n    bool revert\n) \n

This can be used to \"activate\" the upgrade after flashing.

Parameters:

  • revert switch if (and only if) the other image is already marked as active (i.e. switch back to the running image)

Returns:

false if the second image (or upgrade image) is not valid; false if writing failed; true otherwise

"},{"location":"ltapi/lt__ota_8h/#function-lt_ota_write","title":"function lt_ota_write","text":"

Process a chunk of data.

size_t lt_ota_write (\n    lt_ota_ctx_t * ctx,\n    const uint8_t * data,\n    size_t len\n) \n

Data is written to the buffer, unless a full UF2 block is already available, in which case it's also processed by UF2OTA and written to flash.

It's advised to write in 512-byte chunks (or its multiples).

Parameters:

  • ctx OTA context
  • data chunk of bytes to process
  • len size of the chunk

Returns:

number of bytes correctly processed; should equal 'len' in case of no errors

"},{"location":"ltapi/lt__ota_8h/#function-lt_ota_write_block","title":"function lt_ota_write_block","text":"

Try to write the block. In case of UF2 errors, error code is set in the context. Note: use lt_ota_write() instead. This is for internal usage only.

bool lt_ota_write_block (\n    lt_ota_ctx_t * ctx,\n    uf2_block_t * block\n) \n

Parameters:

  • block UF2 block to check and write; cannot be NULL

Returns:

whether no error has occurred

The documentation for this class was generated from the following file cores/common/base/api/lt_ota.h

"},{"location":"ltapi/lt__ota_8h_source/","title":"File lt_ota.h","text":"

File List > api > lt_ota.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2023-03-09. */\n\n#pragma once\n\n#include <libretiny.h>\n#include <uf2ota/uf2types.h>\n\ntypedef enum {\n    OTA_TYPE_SINGLE = 0,\n    OTA_TYPE_DUAL   = 1,\n    OTA_TYPE_FILE   = 2,\n} lt_ota_type_t;\n\ntypedef struct {\n    uf2_ota_t uf2;\n    uf2_info_t info;\n    uint8_t buf[UF2_BLOCK_SIZE];   // block data buffer\n    uint8_t *buf_pos;              // buffer writing position\n    uint32_t bytes_written;        // update progress\n    uint32_t bytes_total;          // total update size\n    uf2_err_t error;               // LT OTA/uf2ota error code\n    bool running;                  // whether update has begun\n    void (*callback)(void *param); // progress callback\n    void *callback_param;          // callback argument\n} lt_ota_ctx_t;\n\nvoid lt_ota_begin(lt_ota_ctx_t *ctx, size_t size);\n\nbool lt_ota_end(lt_ota_ctx_t *ctx);\n\nvoid lt_ota_set_write_protect(uf2_ota_t *uf2);\n\nsize_t lt_ota_write(lt_ota_ctx_t *ctx, const uint8_t *data, size_t len);\n\nbool lt_ota_write_block(lt_ota_ctx_t *ctx, uf2_block_t *block);\n\nlt_ota_type_t lt_ota_get_type();\n\nbool lt_ota_is_valid(uint8_t index);\n\nbool lt_ota_can_rollback();\n\nuint8_t lt_ota_dual_get_current();\n\nuint8_t lt_ota_dual_get_stored();\n\nuf2_ota_scheme_t lt_ota_get_uf2_scheme();\n\nbool lt_ota_switch(bool revert);\n
"},{"location":"ltapi/lt__sleep_8c/","title":"File lt_sleep.c","text":"

FileList > api > lt_sleep.c

Go to the source code of this file.

  • #include \"lt_sleep.h\"

The documentation for this class was generated from the following file cores/common/base/api/lt_sleep.c

"},{"location":"ltapi/lt__sleep_8c_source/","title":"File lt_sleep.c","text":"

File List > api > lt_sleep.c

Go to the documentation of this file.

/* Copyright (c) Peter Sarkozi 2023-06-17. */\n\n#include \"lt_sleep.h\"\n\n__attribute__((weak)) void lt_deep_sleep_config_gpio(uint32_t gpio_index_map, bool on_high);\n\n__attribute__((weak)) void lt_deep_sleep_unset_gpio(uint32_t gpio_index_map);\n\n__attribute__((weak)) void lt_deep_sleep_config_timer(uint32_t sleep_duration);\n\n__attribute__((weak)) void lt_deep_sleep_enter();\n
"},{"location":"ltapi/lt__sleep_8h/","title":"File lt_sleep.h","text":"

FileList > api > lt_sleep.h

Go to the source code of this file.

  • #include <libretiny.h>
"},{"location":"ltapi/lt__sleep_8h/#public-functions","title":"Public Functions","text":"Type Name void lt_deep_sleep_config_gpio (uint32_t gpio_index_map, bool on_high) Enable GPIO Wakeup from Deep Sleep. void lt_deep_sleep_config_timer (uint32_t sleep_duration) Set a sleep timer to wake up the device. void lt_deep_sleep_enter () Start deep sleep. void lt_deep_sleep_unset_gpio (uint32_t gpio_index_map) Disable GPIO Wakeup on given pins."},{"location":"ltapi/lt__sleep_8h/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/lt__sleep_8h/#function-lt_deep_sleep_config_gpio","title":"function lt_deep_sleep_config_gpio","text":"

Enable GPIO Wakeup from Deep Sleep.

void lt_deep_sleep_config_gpio (\n    uint32_t gpio_index_map,\n    bool on_high\n) \n

Parameters:

  • gpio_index_map bitMap of the pins we should wake up on
  • on_high whether to wake up on High or Low state
"},{"location":"ltapi/lt__sleep_8h/#function-lt_deep_sleep_config_timer","title":"function lt_deep_sleep_config_timer","text":"

Set a sleep timer to wake up the device.

void lt_deep_sleep_config_timer (\n    uint32_t sleep_duration\n) \n

Parameters:

  • sleep_duration the time in milliseconds to sleep
"},{"location":"ltapi/lt__sleep_8h/#function-lt_deep_sleep_enter","title":"function lt_deep_sleep_enter","text":"
void lt_deep_sleep_enter () \n
"},{"location":"ltapi/lt__sleep_8h/#function-lt_deep_sleep_unset_gpio","title":"function lt_deep_sleep_unset_gpio","text":"

Disable GPIO Wakeup on given pins.

void lt_deep_sleep_unset_gpio (\n    uint32_t gpio_index_map\n) \n

Parameters:

  • gpio_index_map bitMap of the pins we should disable wake up on

The documentation for this class was generated from the following file cores/common/base/api/lt_sleep.h

"},{"location":"ltapi/lt__sleep_8h_source/","title":"File lt_sleep.h","text":"

File List > api > lt_sleep.h

Go to the documentation of this file.

/* Copyright (c) Peter Sarkozi 2023-06-17. */\n\n#pragma once\n\n#include <libretiny.h>\n\nvoid lt_deep_sleep_config_gpio(uint32_t gpio_index_map, bool on_high);\n\nvoid lt_deep_sleep_unset_gpio(uint32_t gpio_index_map);\n\nvoid lt_deep_sleep_config_timer(uint32_t sleep_duration);\n\nvoid lt_deep_sleep_enter();\n
"},{"location":"ltapi/lt__utils_8c/","title":"File lt_utils.c","text":"

FileList > api > lt_utils.c

Go to the source code of this file.

  • #include \"lt_utils.h\"
"},{"location":"ltapi/lt__utils_8c/#public-functions","title":"Public Functions","text":"Type Name void hexdump (const uint8_t * buf, size_t len, uint32_t offset=0, uint8_t width=16) Print data pointed to by buf in hexdump-like format (hex+ASCII). char * lt_btox (const uint8_t * src, int len, char * dest) Convert a byte array to hexadecimal string. void lt_rand_bytes (uint8_t * buf, size_t len) Generate random bytes using rand(). uint8_t * lt_xtob (const char * src, int len, uint8_t * dest) Convert a hexadecimal string to byte array."},{"location":"ltapi/lt__utils_8c/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/lt__utils_8c/#function-hexdump","title":"function hexdump","text":"

Print data pointed to by buf in hexdump-like format (hex+ASCII).

void hexdump (\n    const uint8_t * buf,\n    size_t len,\n    uint32_t offset=0,\n    uint8_t width=16\n) \n

Parameters:

  • buf source pointer
  • len how many bytes to print
  • offset increment printed offset by this value
  • width how many bytes on a line
"},{"location":"ltapi/lt__utils_8c/#function-lt_btox","title":"function lt_btox","text":"

Convert a byte array to hexadecimal string.

char * lt_btox (\n    const uint8_t * src,\n    int len,\n    char * dest\n) \n

Parameters:

  • src source byte array
  • len source length (bytes)
  • dest destination string

Returns:

destination string

"},{"location":"ltapi/lt__utils_8c/#function-lt_rand_bytes","title":"function lt_rand_bytes","text":"

Generate random bytes using rand().

void lt_rand_bytes (\n    uint8_t * buf,\n    size_t len\n) \n

Parameters:

  • buf destination pointer
  • len how many bytes to generate
"},{"location":"ltapi/lt__utils_8c/#function-lt_xtob","title":"function lt_xtob","text":"

Convert a hexadecimal string to byte array.

uint8_t * lt_xtob (\n    const char * src,\n    int len,\n    uint8_t * dest\n) \n

Parameters:

  • src source string
  • len source length (chars)
  • dest destination byte array

Returns:

destination byte array

The documentation for this class was generated from the following file cores/common/base/api/lt_utils.c

"},{"location":"ltapi/lt__utils_8c_source/","title":"File lt_utils.c","text":"

File List > api > lt_utils.c

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-04-29. */\n\n#include \"lt_utils.h\"\n\nvoid lt_rand_bytes(uint8_t *buf, size_t len) {\n    int *data = (int *)buf;\n    size_t i;\n    for (i = 0; len >= sizeof(int); len -= sizeof(int)) {\n        data[i++] = rand();\n    }\n    if (len) {\n        int rem             = rand();\n        unsigned char *pRem = (unsigned char *)&rem;\n        memcpy(buf + i * sizeof(int), pRem, len);\n    }\n}\n\nvoid hexdump(const uint8_t *buf, size_t len, uint32_t offset, uint8_t width) {\n    uint16_t pos = 0;\n    while (pos < len) {\n        // print hex offset\n        printf(\"%06lx \", offset + pos);\n        // calculate current line width\n        uint8_t lineWidth = MIN(width, len - pos);\n        // print hexadecimal representation\n        for (uint8_t i = 0; i < lineWidth; i++) {\n            if (i % 8 == 0) {\n                printf(\" \");\n            }\n            printf(\"%02x \", buf[pos + i]);\n        }\n        // print ascii representation\n        printf(\" |\");\n        for (uint8_t i = 0; i < lineWidth; i++) {\n            char c = buf[pos + i];\n            putchar((c >= 0x20 && c <= 0x7f) ? c : '.');\n        }\n        puts(\"|\\r\");\n        pos += lineWidth;\n    }\n}\n\nchar *lt_btox(const uint8_t *src, int len, char *dest) {\n    // https://stackoverflow.com/a/53966346\n    const char hex[] = \"0123456789abcdef\";\n    len *= 2;\n    dest[len] = '\\0';\n    while (--len >= 0)\n        dest[len] = hex[(src[len >> 1] >> ((1 - (len & 1)) << 2)) & 0xF];\n    return dest;\n}\n\nuint8_t *lt_xtob(const char *src, int len, uint8_t *dest) {\n    // https://gist.github.com/vi/dd3b5569af8a26b97c8e20ae06e804cb\n\n    // mapping of ASCII characters to hex values\n    // (16-byte swapped to reduce XOR 0x10 operation)\n    const uint8_t mapping[] = {\n        0x00, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x00, // @ABCDEFG\n        0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // HIJKLMNO\n        0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, // 01234567\n        0x08, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 89:;<=>?\n    };\n\n    int j = 0;\n    uint8_t idx0;\n    uint8_t idx1;\n    for (int i = 0; i < len; i += 2) {\n        idx0      = ((uint8_t)src[i + 0] & 0x1F);\n        idx1      = ((uint8_t)src[i + 1] & 0x1F);\n        dest[j++] = (mapping[idx0] << 4) | (mapping[idx1] << 0);\n    }\n    return dest;\n}\n
"},{"location":"ltapi/lt__utils_8h/","title":"File lt_utils.h","text":"

FileList > api > lt_utils.h

Go to the source code of this file.

  • #include <libretiny.h>
"},{"location":"ltapi/lt__utils_8h/#public-functions","title":"Public Functions","text":"Type Name void hexdump (const uint8_t * buf, size_t len, uint32_t offset=0, uint8_t width=16) Print data pointed to by buf in hexdump-like format (hex+ASCII). char * lt_btox (const uint8_t * src, int len, char * dest) Convert a byte array to hexadecimal string. void lt_rand_bytes (uint8_t * buf, size_t len) Generate random bytes using rand(). uint8_t * lt_xtob (const char * src, int len, uint8_t * dest) Convert a hexadecimal string to byte array."},{"location":"ltapi/lt__utils_8h/#macros","title":"Macros","text":"Type Name define MAX (a, b) define MIN (a, b)"},{"location":"ltapi/lt__utils_8h/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/lt__utils_8h/#function-hexdump","title":"function hexdump","text":"

Print data pointed to by buf in hexdump-like format (hex+ASCII).

void hexdump (\n    const uint8_t * buf,\n    size_t len,\n    uint32_t offset=0,\n    uint8_t width=16\n) \n

Parameters:

  • buf source pointer
  • len how many bytes to print
  • offset increment printed offset by this value
  • width how many bytes on a line
"},{"location":"ltapi/lt__utils_8h/#function-lt_btox","title":"function lt_btox","text":"

Convert a byte array to hexadecimal string.

char * lt_btox (\n    const uint8_t * src,\n    int len,\n    char * dest\n) \n

Parameters:

  • src source byte array
  • len source length (bytes)
  • dest destination string

Returns:

destination string

"},{"location":"ltapi/lt__utils_8h/#function-lt_rand_bytes","title":"function lt_rand_bytes","text":"

Generate random bytes using rand().

void lt_rand_bytes (\n    uint8_t * buf,\n    size_t len\n) \n

Parameters:

  • buf destination pointer
  • len how many bytes to generate
"},{"location":"ltapi/lt__utils_8h/#function-lt_xtob","title":"function lt_xtob","text":"

Convert a hexadecimal string to byte array.

uint8_t * lt_xtob (\n    const char * src,\n    int len,\n    uint8_t * dest\n) \n

Parameters:

  • src source string
  • len source length (chars)
  • dest destination byte array

Returns:

destination byte array

"},{"location":"ltapi/lt__utils_8h/#macro-definition-documentation","title":"Macro Definition Documentation","text":""},{"location":"ltapi/lt__utils_8h/#define-max","title":"define MAX","text":"
#define MAX (\n    a,\n    b\n) ({                                                                                                                 \\\n        __typeof__(a) _a = (a);                                                                                        \\\n        __typeof__(b) _b = (b);                                                                                        \\\n        _a > _b ? _a : _b;                                                                                             \\\n    })\n
"},{"location":"ltapi/lt__utils_8h/#define-min","title":"define MIN","text":"
#define MIN (\n    a,\n    b\n) ({                                                                                                                 \\\n        __typeof__(a) _a = (a);                                                                                        \\\n        __typeof__(b) _b = (b);                                                                                        \\\n        _a < _b ? _a : _b;                                                                                             \\\n    })\n

The documentation for this class was generated from the following file cores/common/base/api/lt_utils.h

"},{"location":"ltapi/lt__utils_8h_source/","title":"File lt_utils.h","text":"

File List > api > lt_utils.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2023-02-27. */\n\n#pragma once\n\n#include <libretiny.h>\n\n// https://stackoverflow.com/a/3437484\n#define MAX(a, b)                                                                                                      \\\n    ({                                                                                                                 \\\n        __typeof__(a) _a = (a);                                                                                        \\\n        __typeof__(b) _b = (b);                                                                                        \\\n        _a > _b ? _a : _b;                                                                                             \\\n    })\n#define MIN(a, b)                                                                                                      \\\n    ({                                                                                                                 \\\n        __typeof__(a) _a = (a);                                                                                        \\\n        __typeof__(b) _b = (b);                                                                                        \\\n        _a < _b ? _a : _b;                                                                                             \\\n    })\n\nvoid lt_rand_bytes(uint8_t *buf, size_t len);\n\nvoid hexdump(\n    const uint8_t *buf,\n    size_t len,\n#ifdef __cplusplus\n    uint32_t offset = 0,\n    uint8_t width   = 16\n#else\n    uint32_t offset,\n    uint8_t width\n#endif\n);\n\nchar *lt_btox(const uint8_t *src, int len, char *dest);\n\nuint8_t *lt_xtob(const char *src, int len, uint8_t *dest);\n
"},{"location":"ltapi/lt__wdt_8c/","title":"File lt_wdt.c","text":"

FileList > api > lt_wdt.c

Go to the source code of this file.

  • #include \"lt_wdt.h\"
"},{"location":"ltapi/lt__wdt_8c/#public-functions","title":"Public Functions","text":"Type Name __attribute__ ((weak))"},{"location":"ltapi/lt__wdt_8c/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/lt__wdt_8c/#function-__attribute__","title":"function __attribute__","text":"
__attribute__ (\n    (weak)\n) \n

The documentation for this class was generated from the following file cores/common/base/api/lt_wdt.c

"},{"location":"ltapi/lt__wdt_8c_source/","title":"File lt_wdt.c","text":"

File List > api > lt_wdt.c

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-04-29. */\n\n#include \"lt_wdt.h\"\n\n__attribute__((weak)) bool lt_wdt_enable(uint32_t timeout) {\n    return false;\n}\n\n__attribute__((weak)) void lt_wdt_disable() {}\n\n__attribute__((weak)) void lt_wdt_feed() {}\n
"},{"location":"ltapi/lt__wdt_8h/","title":"File lt_wdt.h","text":"

FileList > api > lt_wdt.h

Go to the source code of this file.

  • #include <libretiny.h>
"},{"location":"ltapi/lt__wdt_8h/#public-functions","title":"Public Functions","text":"Type Name void lt_wdt_disable () Disable the hardware watchdog. bool lt_wdt_enable (uint32_t timeout) Enable the hardware watchdog. void lt_wdt_feed () Feed/reset the hardware watchdog timer."},{"location":"ltapi/lt__wdt_8h/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/lt__wdt_8h/#function-lt_wdt_disable","title":"function lt_wdt_disable","text":"
void lt_wdt_disable () \n
"},{"location":"ltapi/lt__wdt_8h/#function-lt_wdt_enable","title":"function lt_wdt_enable","text":"

Enable the hardware watchdog.

bool lt_wdt_enable (\n    uint32_t timeout\n) \n

Parameters:

  • timeout watchdog timeout, milliseconds

Returns:

whether the chip has a hardware watchdog

"},{"location":"ltapi/lt__wdt_8h/#function-lt_wdt_feed","title":"function lt_wdt_feed","text":"
void lt_wdt_feed () \n

The documentation for this class was generated from the following file cores/common/base/api/lt_wdt.h

"},{"location":"ltapi/lt__wdt_8h_source/","title":"File lt_wdt.h","text":"

File List > api > lt_wdt.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2023-03-09. */\n\n#pragma once\n\n#include <libretiny.h>\n\nbool lt_wdt_enable(uint32_t timeout);\n\nvoid lt_wdt_disable();\n\nvoid lt_wdt_feed();\n
"},{"location":"ltapi/dir_df2c4eb2fc0858b25d84c91a81f7ab75/","title":"Dir cores/common/base/compat","text":"

FileList > base > compat

"},{"location":"ltapi/dir_df2c4eb2fc0858b25d84c91a81f7ab75/#files","title":"Files","text":"Type Name file certs.h file err.h file netdb.h file netif.h file sockets.h file sys.h file tcpip.h file udp.h"},{"location":"ltapi/dir_df2c4eb2fc0858b25d84c91a81f7ab75/#directories","title":"Directories","text":"Type Name dir lwip

The documentation for this class was generated from the following file cores/common/base/compat/

"},{"location":"ltapi/certs_8h/","title":"File certs.h","text":"

FileList > base > compat > certs.h

Go to the source code of this file.

  • #include <mbedtls/certs.h>

The documentation for this class was generated from the following file cores/common/base/compat/certs.h

"},{"location":"ltapi/certs_8h_source/","title":"File certs.h","text":"

File List > base > compat > certs.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-06-13. */\n\n#pragma once\n\n#include <mbedtls/certs.h>\n
"},{"location":"ltapi/dir_8dc93de83995bf7a7f7c574b7e694258/","title":"Dir cores/common/base/compat/lwip","text":"

FileList > base > compat > lwip

"},{"location":"ltapi/dir_8dc93de83995bf7a7f7c574b7e694258/#files","title":"Files","text":"Type Name file lwip_timers.h

The documentation for this class was generated from the following file cores/common/base/compat/lwip/

"},{"location":"ltapi/lwip__timers_8h/","title":"File lwip_timers.h","text":"

FileList > base > compat > lwip > lwip_timers.h

Go to the source code of this file.

  • #include <lwip/timeouts.h>

The documentation for this class was generated from the following file cores/common/base/compat/lwip/lwip_timers.h

"},{"location":"ltapi/lwip__timers_8h_source/","title":"File lwip_timers.h","text":"

File List > base > compat > lwip > lwip_timers.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-05-22. */\n\n#pragma once\n\n#include <lwip/timeouts.h>\n
"},{"location":"ltapi/err_8h/","title":"File err.h","text":"

FileList > base > compat > err.h

Go to the source code of this file.

  • #include <lwip/err.h>

The documentation for this class was generated from the following file cores/common/base/compat/err.h

"},{"location":"ltapi/err_8h_source/","title":"File err.h","text":"

File List > base > compat > err.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-05-22. */\n\n#pragma once\n\n#include <lwip/err.h>\n
"},{"location":"ltapi/netdb_8h/","title":"File netdb.h","text":"

FileList > base > compat > netdb.h

Go to the source code of this file.

  • #include <lwip/netdb.h>

The documentation for this class was generated from the following file cores/common/base/compat/netdb.h

"},{"location":"ltapi/netdb_8h_source/","title":"File netdb.h","text":"

File List > base > compat > netdb.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-06-13. */\n\n#pragma once\n\n#include <lwip/netdb.h>\n
"},{"location":"ltapi/netif_8h/","title":"File netif.h","text":"

FileList > base > compat > netif.h

Go to the source code of this file.

  • #include <lwip/netif.h>

The documentation for this class was generated from the following file cores/common/base/compat/netif.h

"},{"location":"ltapi/netif_8h_source/","title":"File netif.h","text":"

File List > base > compat > netif.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-07-20. */\n\n#pragma once\n\n#include <lwip/netif.h>\n
"},{"location":"ltapi/sockets_8h/","title":"File sockets.h","text":"

FileList > base > compat > sockets.h

Go to the source code of this file.

  • #include <lwip/sockets.h>

The documentation for this class was generated from the following file cores/common/base/compat/sockets.h

"},{"location":"ltapi/sockets_8h_source/","title":"File sockets.h","text":"

File List > base > compat > sockets.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-05-23. */\n\n#pragma once\n\n#include <lwip/sockets.h>\n
"},{"location":"ltapi/sys_8h/","title":"File sys.h","text":"

FileList > base > compat > sys.h

Go to the source code of this file.

  • #include <lwip/sys.h>

The documentation for this class was generated from the following file cores/common/base/compat/sys.h

"},{"location":"ltapi/sys_8h_source/","title":"File sys.h","text":"

File List > base > compat > sys.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-05-22. */\n\n#pragma once\n\n#include <lwip/sys.h>\n
"},{"location":"ltapi/tcpip_8h/","title":"File tcpip.h","text":"

FileList > base > compat > tcpip.h

Go to the source code of this file.

  • #include <lwip/tcpip.h>

The documentation for this class was generated from the following file cores/common/base/compat/tcpip.h

"},{"location":"ltapi/tcpip_8h_source/","title":"File tcpip.h","text":"

File List > base > compat > tcpip.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-05-22. */\n\n#pragma once\n\n#include <lwip/tcpip.h>\n
"},{"location":"ltapi/udp_8h/","title":"File udp.h","text":"

FileList > base > compat > udp.h

Go to the source code of this file.

  • #include <lwip/udp.h>
"},{"location":"ltapi/udp_8h/#macros","title":"Macros","text":"Type Name define lwip_ntohl lwip_htonl"},{"location":"ltapi/udp_8h/#macro-definition-documentation","title":"Macro Definition Documentation","text":""},{"location":"ltapi/udp_8h/#define-lwip_ntohl","title":"define lwip_ntohl","text":"
#define lwip_ntohl lwip_htonl\n

The documentation for this class was generated from the following file cores/common/base/compat/udp.h

"},{"location":"ltapi/udp_8h_source/","title":"File udp.h","text":"

File List > base > compat > udp.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-05-23. */\n\n#pragma once\n\n#include <lwip/udp.h>\n\n// this is included only by wifi_simple_config.c\n// which uses lwip_ntohl without parentheses\n// so the #define from lwip/def.h doesn't work\n#undef lwip_ntohl\n#define lwip_ntohl lwip_htonl\n
"},{"location":"ltapi/dir_117c171b5277df11652dc53a144cb684/","title":"Dir cores/common/base/config","text":"

FileList > base > config

"},{"location":"ltapi/dir_117c171b5277df11652dc53a144cb684/#files","title":"Files","text":"Type Name file fal_cfg.h file fdb_cfg.h file lwipopts.h file printf_config.h

The documentation for this class was generated from the following file cores/common/base/config/

"},{"location":"ltapi/fal__cfg_8h/","title":"File fal_cfg.h","text":"

FileList > base > config > fal_cfg.h

Go to the source code of this file.

  • #include <fal_def.h>
"},{"location":"ltapi/fal__cfg_8h/#public-attributes","title":"Public Attributes","text":"Type Name fal_partition_t fal_root_part \"Root\" partition entry, representing the entire flash. Declared and initialized in lt_main.c. const struct fal_flash_dev flash0"},{"location":"ltapi/fal__cfg_8h/#public-functions","title":"Public Functions","text":"Type Name void printf_nop (const char * fmt, ...)"},{"location":"ltapi/fal__cfg_8h/#macros","title":"Macros","text":"Type Name define FAL_DEBUG 0 define FAL_DEV_NAME_MAX 16 define FAL_FLASH_DEV_NAME \"flash0\" define FAL_FLASH_DEV_TABLE { &flash0, } define FAL_PART_HAS_TABLE_CFG define FAL_PART_TABLE_ITEM (part_lower, part_upper) define FAL_PRINTF printf_nop"},{"location":"ltapi/fal__cfg_8h/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/fal__cfg_8h/#variable-fal_root_part","title":"variable fal_root_part","text":"
fal_partition_t fal_root_part;\n
"},{"location":"ltapi/fal__cfg_8h/#variable-flash0","title":"variable flash0","text":"
const struct fal_flash_dev flash0;\n
"},{"location":"ltapi/fal__cfg_8h/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/fal__cfg_8h/#function-printf_nop","title":"function printf_nop","text":"
inline void printf_nop (\n    const char * fmt,\n    ...\n) \n
"},{"location":"ltapi/fal__cfg_8h/#macro-definition-documentation","title":"Macro Definition Documentation","text":""},{"location":"ltapi/fal__cfg_8h/#define-fal_debug","title":"define FAL_DEBUG","text":"
#define FAL_DEBUG 0\n
"},{"location":"ltapi/fal__cfg_8h/#define-fal_dev_name_max","title":"define FAL_DEV_NAME_MAX","text":"
#define FAL_DEV_NAME_MAX 16\n
"},{"location":"ltapi/fal__cfg_8h/#define-fal_flash_dev_name","title":"define FAL_FLASH_DEV_NAME","text":"
#define FAL_FLASH_DEV_NAME \"flash0\"\n
"},{"location":"ltapi/fal__cfg_8h/#define-fal_flash_dev_table","title":"define FAL_FLASH_DEV_TABLE","text":"
#define FAL_FLASH_DEV_TABLE { &flash0, }\n
"},{"location":"ltapi/fal__cfg_8h/#define-fal_part_has_table_cfg","title":"define FAL_PART_HAS_TABLE_CFG","text":"
#define FAL_PART_HAS_TABLE_CFG \n
"},{"location":"ltapi/fal__cfg_8h/#define-fal_part_table_item","title":"define FAL_PART_TABLE_ITEM","text":"
#define FAL_PART_TABLE_ITEM (\n    part_lower,\n    part_upper\n) {                                                                                                                  \\\n        .magic_word = FAL_PART_MAGIC_WORD,         /* magic word */                                                    \\\n        .name       = #part_lower,                 /* lowercase name as string */                                      \\\n        .flash_name = FAL_FLASH_DEV_NAME,          /* flash device name */                                             \\\n        .offset     = FLASH_##part_upper##_OFFSET, /* partition offset macro as uppercase string */                    \\\n        .len        = FLASH_##part_upper##_LENGTH, /* partition length macro as uppercase string */                    \\\n    },\n
"},{"location":"ltapi/fal__cfg_8h/#define-fal_printf","title":"define FAL_PRINTF","text":"
#define FAL_PRINTF printf_nop\n

The documentation for this class was generated from the following file cores/common/base/config/fal_cfg.h

"},{"location":"ltapi/fal__cfg_8h_source/","title":"File fal_cfg.h","text":"

File List > base > config > fal_cfg.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-05-24. */\n\n#pragma once\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif // __cplusplus\n\ninline void printf_nop(const char *fmt, ...) {}\n\n#define FAL_PRINTF printf_nop\n#define FAL_DEBUG  0\n\n// Flash device configuration\nextern const struct fal_flash_dev flash0;\n\n#ifdef __cplusplus\n} // extern \"C\"\n#endif\n\n#define FAL_FLASH_DEV_NAME \"flash0\"\n\n#define FAL_FLASH_DEV_TABLE                                                                                            \\\n    { &flash0, }\n\n#define FAL_DEV_NAME_MAX 16 // no need for 24 chars (default)\n\n// Partition table\n#define FAL_PART_HAS_TABLE_CFG\n\n#define FAL_PART_TABLE_ITEM(part_lower, part_upper)                                                                    \\\n    {                                                                                                                  \\\n        .magic_word = FAL_PART_MAGIC_WORD,         /* magic word */                                                    \\\n        .name       = #part_lower,                 /* lowercase name as string */                                      \\\n        .flash_name = FAL_FLASH_DEV_NAME,          /* flash device name */                                             \\\n        .offset     = FLASH_##part_upper##_OFFSET, /* partition offset macro as uppercase string */                    \\\n        .len        = FLASH_##part_upper##_LENGTH, /* partition length macro as uppercase string */                    \\\n    },\n\n// for fal_partition_t\n#include <fal_def.h>\n\nextern fal_partition_t fal_root_part;\n
"},{"location":"ltapi/fdb__cfg_8h/","title":"File fdb_cfg.h","text":"

FileList > base > config > fdb_cfg.h

Go to the source code of this file.

"},{"location":"ltapi/fdb__cfg_8h/#macros","title":"Macros","text":"Type Name define FDB_PRINT (...) define FDB_USING_FAL_MODE define FDB_USING_KVDB define FDB_WRITE_GRAN 8"},{"location":"ltapi/fdb__cfg_8h/#macro-definition-documentation","title":"Macro Definition Documentation","text":""},{"location":"ltapi/fdb__cfg_8h/#define-fdb_print","title":"define FDB_PRINT","text":"
#define FDB_PRINT (\n    ...\n) \n
"},{"location":"ltapi/fdb__cfg_8h/#define-fdb_using_fal_mode","title":"define FDB_USING_FAL_MODE","text":"
#define FDB_USING_FAL_MODE \n
"},{"location":"ltapi/fdb__cfg_8h/#define-fdb_using_kvdb","title":"define FDB_USING_KVDB","text":"
#define FDB_USING_KVDB \n
"},{"location":"ltapi/fdb__cfg_8h/#define-fdb_write_gran","title":"define FDB_WRITE_GRAN","text":"
#define FDB_WRITE_GRAN 8\n

The documentation for this class was generated from the following file cores/common/base/config/fdb_cfg.h

"},{"location":"ltapi/fdb__cfg_8h_source/","title":"File fdb_cfg.h","text":"

File List > base > config > fdb_cfg.h

Go to the documentation of this file.

/*\n * Copyright (c) 2020, Armink, <armink.ztl@gmail.com>\n *\n * SPDX-License-Identifier: Apache-2.0\n */\n\n#ifndef _FDB_CFG_H_\n#define _FDB_CFG_H_\n\n/* using KVDB feature */\n#define FDB_USING_KVDB\n\n#ifdef FDB_USING_KVDB\n/* Auto update KV to latest default when current KVDB version number is changed. @see fdb_kvdb.ver_num */\n// #define FDB_KV_AUTO_UPDATE\n#endif\n\n/* using TSDB (Time series database) feature */\n// #define FDB_USING_TSDB\n\n/* Using FAL storage mode */\n#define FDB_USING_FAL_MODE\n\n#ifdef FDB_USING_FAL_MODE\n/* the flash write granularity, unit: bit\n * only support 1(nor flash)/ 8(stm32f2/f4)/ 32(stm32f1) */\n#define FDB_WRITE_GRAN 8\n#endif\n\n/* Using file storage mode by LIBC file API, like fopen/fread/fwrte/fclose */\n// #define FDB_USING_FILE_LIBC_MODE\n\n/* Using file storage mode by POSIX file API, like open/read/write/close */\n// #define FDB_USING_FILE_POSIX_MODE\n\n/* MCU Endian Configuration, default is Little Endian Order. */\n// #define FDB_BIG_ENDIAN\n\n#if LT_DEBUG_FDB\n#include <libretiny.h>\n#include <printf/printf.h>\n#define FDB_PRINT(...) __wrap_printf(__VA_ARGS__)\n#define FDB_DEBUG_ENABLE\n#else\n#define FDB_PRINT(...)\n#endif\n\n#endif /* _FDB_CFG_H_ */\n
"},{"location":"ltapi/lwipopts_8h/","title":"File lwipopts.h","text":"

FileList > base > config > lwipopts.h

Go to the source code of this file.

  • #include <sys/time.h>
"},{"location":"ltapi/lwipopts_8h/#macros","title":"Macros","text":"Type Name define LWIP_MDNS_RESPONDER 1 define LWIP_NETIF_HOSTNAME 1 define LWIP_SO_RCVBUF 1 define LWIP_TIMEVAL_PRIVATE 0 define LWIP_VERSION_SIMPLE (LWIP_VERSION_MAJOR * 10000 + LWIP_VERSION_MINOR * 100 + LWIP_VERSION_REVISION) define MDNS_MAX_SERVICES 10 define SNTP_GET_SYSTEM_TIME (sec, us) define SNTP_SERVER_DNS 1 define SNTP_SET_SYSTEM_TIME_US (sec, us)"},{"location":"ltapi/lwipopts_8h/#macro-definition-documentation","title":"Macro Definition Documentation","text":""},{"location":"ltapi/lwipopts_8h/#define-lwip_mdns_responder","title":"define LWIP_MDNS_RESPONDER","text":"
#define LWIP_MDNS_RESPONDER 1\n
"},{"location":"ltapi/lwipopts_8h/#define-lwip_netif_hostname","title":"define LWIP_NETIF_HOSTNAME","text":"
#define LWIP_NETIF_HOSTNAME 1\n
"},{"location":"ltapi/lwipopts_8h/#define-lwip_so_rcvbuf","title":"define LWIP_SO_RCVBUF","text":"
#define LWIP_SO_RCVBUF 1\n
"},{"location":"ltapi/lwipopts_8h/#define-lwip_timeval_private","title":"define LWIP_TIMEVAL_PRIVATE","text":"
#define LWIP_TIMEVAL_PRIVATE 0\n
"},{"location":"ltapi/lwipopts_8h/#define-lwip_version_simple","title":"define LWIP_VERSION_SIMPLE","text":"
#define LWIP_VERSION_SIMPLE (LWIP_VERSION_MAJOR * 10000 + LWIP_VERSION_MINOR * 100 + LWIP_VERSION_REVISION)\n
"},{"location":"ltapi/lwipopts_8h/#define-mdns_max_services","title":"define MDNS_MAX_SERVICES","text":"
#define MDNS_MAX_SERVICES 10\n
"},{"location":"ltapi/lwipopts_8h/#define-sntp_get_system_time","title":"define SNTP_GET_SYSTEM_TIME","text":"
#define SNTP_GET_SYSTEM_TIME (\n    sec,\n    us\n) do {                                                                                                               \\\n        struct timeval tv = {.tv_sec = 0, .tv_usec = 0};                                                               \\\n        gettimeofday(&tv, NULL);                                                                                       \\\n        (sec) = tv.tv_sec;                                                                                             \\\n        (us)  = tv.tv_usec;                                                                                            \\\n    } while (0);\n
"},{"location":"ltapi/lwipopts_8h/#define-sntp_server_dns","title":"define SNTP_SERVER_DNS","text":"
#define SNTP_SERVER_DNS 1\n

Set this to 1 to support DNS names (or IP address strings) to set sntp servers One server address/name can be defined as default if SNTP_SERVER_DNS == 1: #define SNTP_SERVER_ADDRESS \"pool.ntp.org\"

"},{"location":"ltapi/lwipopts_8h/#define-sntp_set_system_time_us","title":"define SNTP_SET_SYSTEM_TIME_US","text":"
#define SNTP_SET_SYSTEM_TIME_US (\n    sec,\n    us\n) do {                                                                                                               \\\n        struct timeval tv = {.tv_sec = sec, .tv_usec = us};                                                            \\\n        settimeofday(&tv, NULL);                                                                                       \\\n    } while (0);\n

The documentation for this class was generated from the following file cores/common/base/config/lwipopts.h

"},{"location":"ltapi/lwipopts_8h_source/","title":"File lwipopts.h","text":"

File List > base > config > lwipopts.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-08-26. */\n\n#pragma once\n\n#define LWIP_TIMEVAL_PRIVATE 0\n#define LWIP_NETIF_HOSTNAME  1 // to support hostname changing\n#define LWIP_SO_RCVBUF       1 // for ioctl(FIONREAD)\n\n#define LWIP_MDNS_RESPONDER 1\n#define MDNS_MAX_SERVICES   10\n\n#include_next \"lwipopts.h\"\n\n#include <sys/time.h>\n\n// set lwIP debugging options according to LT config\n#if LT_DEBUG_LWIP\n#undef LWIP_DEBUG\n#define LWIP_DEBUG 1\n// make lwIP use printf() library\n#include <stdio.h>\n#undef LWIP_PLATFORM_DIAG\n// clang-format off\n#define LWIP_PLATFORM_DIAG(x) do { printf x; } while (0)\n// clang-format on\n#endif\n\n#if LT_DEBUG_LWIP_ASSERT\n#undef LWIP_NOASSERT\n#undef LWIP_PLATFORM_ASSERT\n// clang-format off\n#define LWIP_PLATFORM_ASSERT(x) do { printf(\"ASSERT \\\"%s\\\" - %s:%d\\n\", x, __FILE__, __LINE__); while (1) {}; } while (0)\n// clang-format on\n#endif\n\n// lwIP version as a decimal number, with 2 digits for each part (major, minor, patch)\n#define LWIP_VERSION_SIMPLE (LWIP_VERSION_MAJOR * 10000 + LWIP_VERSION_MINOR * 100 + LWIP_VERSION_REVISION)\n\n// remove family-defined debugging options (use lwIP defaults, or user-defined)\n#undef ETHARP_DEBUG\n#undef NETIF_DEBUG\n#undef PBUF_DEBUG\n#undef API_LIB_DEBUG\n#undef API_MSG_DEBUG\n#undef SOCKETS_DEBUG\n#undef ICMP_DEBUG\n#undef IGMP_DEBUG\n#undef INET_DEBUG\n#undef IP_DEBUG\n#undef IP_REASS_DEBUG\n#undef RAW_DEBUG\n#undef MEM_DEBUG\n#undef MEMP_DEBUG\n#undef SYS_DEBUG\n#undef TIMERS_DEBUG\n#undef TCP_DEBUG\n#undef TCP_INPUT_DEBUG\n#undef TCP_FR_DEBUG\n#undef TCP_RTO_DEBUG\n#undef TCP_CWND_DEBUG\n#undef TCP_WND_DEBUG\n#undef TCP_OUTPUT_DEBUG\n#undef TCP_RST_DEBUG\n#undef TCP_QLEN_DEBUG\n#undef UDP_DEBUG\n#undef TCPIP_DEBUG\n#undef SLIP_DEBUG\n#undef DHCP_DEBUG\n#undef AUTOIP_DEBUG\n#undef DNS_DEBUG\n#undef IP6_DEBUG\n#undef MDNS_DEBUG\n\n#undef LWIP_DONT_PROVIDE_BYTEORDER_FUNCTIONS\n#undef LWIP_PROVIDE_ERRNO\n\n#define SNTP_SERVER_DNS 1\n\n#define SNTP_SET_SYSTEM_TIME_US(sec, us)                                                                               \\\n    do {                                                                                                               \\\n        struct timeval tv = {.tv_sec = sec, .tv_usec = us};                                                            \\\n        settimeofday(&tv, NULL);                                                                                       \\\n    } while (0);\n\n#define SNTP_GET_SYSTEM_TIME(sec, us)                                                                                  \\\n    do {                                                                                                               \\\n        struct timeval tv = {.tv_sec = 0, .tv_usec = 0};                                                               \\\n        gettimeofday(&tv, NULL);                                                                                       \\\n        (sec) = tv.tv_sec;                                                                                             \\\n        (us)  = tv.tv_usec;                                                                                            \\\n    } while (0);\n
"},{"location":"ltapi/printf__config_8h/","title":"File printf_config.h","text":"

FileList > base > config > printf_config.h

Go to the source code of this file.

  • #include <lt_config.h>
"},{"location":"ltapi/printf__config_8h/#public-functions","title":"Public Functions","text":"Type Name void putchar_p (char c, unsigned long port)"},{"location":"ltapi/printf__config_8h/#macros","title":"Macros","text":"Type Name define PRINTF_HAS_DISABLE 1 define WRAP_DISABLE_CHECK (name) define WRAP_DISABLE_DECL (name) define WRAP_DISABLE_DEF (name) define WRAP_PRINTF (name) define WRAP_SNPRINTF (name) define WRAP_SPRINTF (name) define WRAP_VPRINTF (name) define WRAP_VSNPRINTF (name) define WRAP_VSPRINTF (name) define printf_ __wrap_printf define snprintf_ __wrap_snprintf define sprintf_ __wrap_sprintf define vprintf_ __wrap_vprintf define vsnprintf_ __wrap_vsnprintf define vsprintf_ __wrap_vsprintf"},{"location":"ltapi/printf__config_8h/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/printf__config_8h/#function-putchar_p","title":"function putchar_p","text":"
void putchar_p (\n    char c,\n    unsigned long port\n) \n
"},{"location":"ltapi/printf__config_8h/#macro-definition-documentation","title":"Macro Definition Documentation","text":""},{"location":"ltapi/printf__config_8h/#define-printf_has_disable","title":"define PRINTF_HAS_DISABLE","text":"
#define PRINTF_HAS_DISABLE 1\n
"},{"location":"ltapi/printf__config_8h/#define-wrap_disable_check","title":"define WRAP_DISABLE_CHECK","text":"
#define WRAP_DISABLE_CHECK (\n    name\n) {                                                                                                                  \\\n        if (LT_UART_SILENT_ALL)                                                                                        \\\n            return 0;                                                                                                  \\\n    }\n
"},{"location":"ltapi/printf__config_8h/#define-wrap_disable_decl","title":"define WRAP_DISABLE_DECL","text":"
#define WRAP_DISABLE_DECL (\n    name\n) void __wrap_##name##_disable() {}                                                                                  \\\n    void __wrap_##name##_enable() {}                                                                                   \\\n    void __wrap_##name##_set(unsigned char disabled) {}                                                                \\\n    unsigned char __wrap_##name##_get() {                                                                              \\\n        return LT_UART_SILENT_ALL;                                                                                     \\\n    }\n
"},{"location":"ltapi/printf__config_8h/#define-wrap_disable_def","title":"define WRAP_DISABLE_DEF","text":"
#define WRAP_DISABLE_DEF (\n    name\n) extern void __wrap_##name##_disable();                                                                             \\\n    extern void __wrap_##name##_enable();                                                                              \\\n    extern void __wrap_##name##_set(unsigned char disabled);                                                           \\\n    extern unsigned char __wrap_##name##_get();\n
"},{"location":"ltapi/printf__config_8h/#define-wrap_printf","title":"define WRAP_PRINTF","text":"
#define WRAP_PRINTF (\n    name\n) WRAP_DISABLE_DECL(name)                                                                                            \\\n    int __wrap_##name(const char *format, ...) {                                                                       \\\n        va_list va;                                                                                                    \\\n        va_start(va, format);                                                                                          \\\n        const int ret = vprintf(format, va);                                                                           \\\n        va_end(va);                                                                                                    \\\n        return ret;                                                                                                    \\\n    }\n
"},{"location":"ltapi/printf__config_8h/#define-wrap_snprintf","title":"define WRAP_SNPRINTF","text":"
#define WRAP_SNPRINTF (\n    name\n) int __wrap_##name(char *s, size_t count, const char *format, ...) {                                                \\\n        va_list va;                                                                                                    \\\n        va_start(va, format);                                                                                          \\\n        const int ret = vsnprintf(s, count, format, va);                                                               \\\n        va_end(va);                                                                                                    \\\n        return ret;                                                                                                    \\\n    }\n
"},{"location":"ltapi/printf__config_8h/#define-wrap_sprintf","title":"define WRAP_SPRINTF","text":"
#define WRAP_SPRINTF (\n    name\n) int __wrap_##name(char *s, const char *format, ...) {                                                              \\\n        va_list va;                                                                                                    \\\n        va_start(va, format);                                                                                          \\\n        const int ret = vsprintf(s, format, va);                                                                       \\\n        va_end(va);                                                                                                    \\\n        return ret;                                                                                                    \\\n    }\n
"},{"location":"ltapi/printf__config_8h/#define-wrap_vprintf","title":"define WRAP_VPRINTF","text":"
#define WRAP_VPRINTF (\n    name\n) WRAP_DISABLE_DECL(name)                                                                                            \\\n    int __wrap_##name(const char *format, va_list arg) {                                                               \\\n        return vprintf(format, arg);                                                                                   \\\n    }\n
"},{"location":"ltapi/printf__config_8h/#define-wrap_vsnprintf","title":"define WRAP_VSNPRINTF","text":"
#define WRAP_VSNPRINTF (\n    name\n) int __wrap_##name(char *s, size_t count, const char *format, va_list arg) {                                        \\\n        return vsnprintf(s, count, format, arg);                                                                       \\\n    }\n
"},{"location":"ltapi/printf__config_8h/#define-wrap_vsprintf","title":"define WRAP_VSPRINTF","text":"
#define WRAP_VSPRINTF (\n    name\n) int __wrap_##name(char *s, const char *format, va_list arg) {                                                      \\\n        return vsprintf(s, format, arg);                                                                               \\\n    }\n
"},{"location":"ltapi/printf__config_8h/#define-printf_","title":"define printf_","text":"
#define printf_ __wrap_printf\n
"},{"location":"ltapi/printf__config_8h/#define-snprintf_","title":"define snprintf_","text":"
#define snprintf_ __wrap_snprintf\n
"},{"location":"ltapi/printf__config_8h/#define-sprintf_","title":"define sprintf_","text":"
#define sprintf_ __wrap_sprintf\n
"},{"location":"ltapi/printf__config_8h/#define-vprintf_","title":"define vprintf_","text":"
#define vprintf_ __wrap_vprintf\n
"},{"location":"ltapi/printf__config_8h/#define-vsnprintf_","title":"define vsnprintf_","text":"
#define vsnprintf_ __wrap_vsnprintf\n
"},{"location":"ltapi/printf__config_8h/#define-vsprintf_","title":"define vsprintf_","text":"
#define vsprintf_ __wrap_vsprintf\n

The documentation for this class was generated from the following file cores/common/base/config/printf_config.h

"},{"location":"ltapi/printf__config_8h_source/","title":"File printf_config.h","text":"

File List > base > config > printf_config.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-06-19. */\n\n#pragma once\n\n#include <lt_config.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif // __cplusplus\n\n#define PRINTF_HAS_DISABLE 1\n\n// make printf.c define wrapper functions\n#define printf_    __wrap_printf\n#define sprintf_   __wrap_sprintf\n#define vsprintf_  __wrap_vsprintf\n#define snprintf_  __wrap_snprintf\n#define vsnprintf_ __wrap_vsnprintf\n#define vprintf_   __wrap_vprintf\n\n// declare putchar() method with custom output port\nvoid putchar_p(char c, unsigned long port);\n\n#define WRAP_DISABLE_DEF(name)                                                                                         \\\n    extern void __wrap_##name##_disable();                                                                             \\\n    extern void __wrap_##name##_enable();                                                                              \\\n    extern void __wrap_##name##_set(unsigned char disabled);                                                           \\\n    extern unsigned char __wrap_##name##_get();\n\n#if !LT_UART_SILENT_ENABLED || LT_UART_SILENT_ALL\n\n#define WRAP_DISABLE_DECL(name)                                                                                        \\\n    void __wrap_##name##_disable() {}                                                                                  \\\n    void __wrap_##name##_enable() {}                                                                                   \\\n    void __wrap_##name##_set(unsigned char disabled) {}                                                                \\\n    unsigned char __wrap_##name##_get() {                                                                              \\\n        return LT_UART_SILENT_ALL;                                                                                     \\\n    }\n\n#define WRAP_DISABLE_CHECK(name)                                                                                       \\\n    {                                                                                                                  \\\n        if (LT_UART_SILENT_ALL)                                                                                        \\\n            return 0;                                                                                                  \\\n    }\n\n#else // LT_UART_SILENT_ENABLED && !LT_UART_SILENT_ALL\n\n#define WRAP_DISABLE_DECL(name)                                                                                        \\\n    static unsigned char __wrap_##name##_disabled = 0;                                                                 \\\n    void __wrap_##name##_disable() {                                                                                   \\\n        __wrap_##name##_disabled = 1;                                                                                  \\\n    }                                                                                                                  \\\n    void __wrap_##name##_enable() {                                                                                    \\\n        __wrap_##name##_disabled = 0;                                                                                  \\\n    }                                                                                                                  \\\n    void __wrap_##name##_set(unsigned char disabled) {                                                                 \\\n        __wrap_##name##_disabled = disabled;                                                                           \\\n    }                                                                                                                  \\\n    unsigned char __wrap_##name##_get() {                                                                              \\\n        return __wrap_##name##_disabled;                                                                               \\\n    }\n\n#define WRAP_DISABLE_CHECK(name)                                                                                       \\\n    {                                                                                                                  \\\n        if (__wrap_##name##_disabled)                                                                                  \\\n            return 0;                                                                                                  \\\n    }\n\n#endif // LT_UART_SILENT_ENABLED && !LT_UART_SILENT_ALL\n\n#if !LT_UART_SILENT_ENABLED\n\n#define WRAP_PRINTF(name)                                                                                              \\\n    WRAP_DISABLE_DECL(name)                                                                                            \\\n    int __wrap_##name(const char *format, ...) {                                                                       \\\n        va_list va;                                                                                                    \\\n        va_start(va, format);                                                                                          \\\n        const int ret = vprintf(format, va);                                                                           \\\n        va_end(va);                                                                                                    \\\n        return ret;                                                                                                    \\\n    }\n\n#define WRAP_VPRINTF(name)                                                                                             \\\n    WRAP_DISABLE_DECL(name)                                                                                            \\\n    int __wrap_##name(const char *format, va_list arg) {                                                               \\\n        return vprintf(format, arg);                                                                                   \\\n    }\n\n#elif LT_UART_SILENT_ALL\n\n#define WRAP_PRINTF(name)                                                                                              \\\n    WRAP_DISABLE_DECL(name)                                                                                            \\\n    int __wrap_##name(const char *format, ...) {                                                                       \\\n        return 0;                                                                                                      \\\n    }\n\n#define WRAP_VPRINTF(name)                                                                                             \\\n    WRAP_DISABLE_DECL(name)                                                                                            \\\n    int __wrap_##name(const char *format, va_list arg) {                                                               \\\n        return 0;                                                                                                      \\\n    }\n\n#else // !LT_UART_SILENT_ENABLED || !LT_UART_SILENT_ALL\n\n#define WRAP_PRINTF(name)                                                                                              \\\n    WRAP_DISABLE_DECL(name)                                                                                            \\\n    int __wrap_##name(const char *format, ...) {                                                                       \\\n        WRAP_DISABLE_CHECK(name);                                                                                      \\\n        va_list va;                                                                                                    \\\n        va_start(va, format);                                                                                          \\\n        const int ret = vprintf(format, va);                                                                           \\\n        va_end(va);                                                                                                    \\\n        return ret;                                                                                                    \\\n    }\n\n#define WRAP_VPRINTF(name)                                                                                             \\\n    WRAP_DISABLE_DECL(name)                                                                                            \\\n    int __wrap_##name(const char *format, va_list arg) {                                                               \\\n        WRAP_DISABLE_CHECK(name);                                                                                      \\\n        return vprintf(format, arg);                                                                                   \\\n    }\n\n#endif // !LT_UART_SILENT_ENABLED || !LT_UART_SILENT_ALL\n\n#define WRAP_SPRINTF(name)                                                                                             \\\n    int __wrap_##name(char *s, const char *format, ...) {                                                              \\\n        va_list va;                                                                                                    \\\n        va_start(va, format);                                                                                          \\\n        const int ret = vsprintf(s, format, va);                                                                       \\\n        va_end(va);                                                                                                    \\\n        return ret;                                                                                                    \\\n    }\n\n#define WRAP_SNPRINTF(name)                                                                                            \\\n    int __wrap_##name(char *s, size_t count, const char *format, ...) {                                                \\\n        va_list va;                                                                                                    \\\n        va_start(va, format);                                                                                          \\\n        const int ret = vsnprintf(s, count, format, va);                                                               \\\n        va_end(va);                                                                                                    \\\n        return ret;                                                                                                    \\\n    }\n\n#define WRAP_VSPRINTF(name)                                                                                            \\\n    int __wrap_##name(char *s, const char *format, va_list arg) {                                                      \\\n        return vsprintf(s, format, arg);                                                                               \\\n    }\n\n#define WRAP_VSNPRINTF(name)                                                                                           \\\n    int __wrap_##name(char *s, size_t count, const char *format, va_list arg) {                                        \\\n        return vsnprintf(s, count, format, arg);                                                                       \\\n    }\n\n#ifdef __cplusplus\n} // extern \"C\"\n#endif\n
"},{"location":"ltapi/dir_17709fc88a4f25e302be8aa6231cd94b/","title":"Dir cores/common/base/fixups","text":"

FileList > base > fixups

"},{"location":"ltapi/dir_17709fc88a4f25e302be8aa6231cd94b/#files","title":"Files","text":"Type Name file errno.h file malloc.c"},{"location":"ltapi/dir_17709fc88a4f25e302be8aa6231cd94b/#directories","title":"Directories","text":"Type Name dir lwip

The documentation for this class was generated from the following file cores/common/base/fixups/

"},{"location":"ltapi/dir_07703e3b72c625f10ef9850082fac0e3/","title":"Dir cores/common/base/fixups/lwip","text":"

FileList > base > fixups > lwip

"},{"location":"ltapi/dir_07703e3b72c625f10ef9850082fac0e3/#files","title":"Files","text":"Type Name file errno.h

The documentation for this class was generated from the following file cores/common/base/fixups/lwip/

"},{"location":"ltapi/lwip_2errno_8h/","title":"File errno.h","text":"

FileList > base > fixups > lwip > errno.h

Go to the source code of this file.

  • #include \"../errno.h\"

The documentation for this class was generated from the following file cores/common/base/fixups/lwip/errno.h

"},{"location":"ltapi/lwip_2errno_8h_source/","title":"File errno.h","text":"

File List > base > fixups > lwip > errno.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-06-13. */\n\n#pragma once\n\n#include \"../errno.h\"\n
"},{"location":"ltapi/errno_8h/","title":"File errno.h","text":"

FileList > base > fixups > errno.h

Go to the source code of this file.

  • #include <sys/errno.h>
"},{"location":"ltapi/errno_8h/#public-attributes","title":"Public Attributes","text":"Type Name int errno"},{"location":"ltapi/errno_8h/#macros","title":"Macros","text":"Type Name define errno errno"},{"location":"ltapi/errno_8h/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/errno_8h/#variable-errno","title":"variable errno","text":"
int errno;\n
"},{"location":"ltapi/errno_8h/#macro-definition-documentation","title":"Macro Definition Documentation","text":""},{"location":"ltapi/errno_8h/#define-errno","title":"define errno","text":"
#define errno errno\n

The documentation for this class was generated from the following file cores/common/base/fixups/errno.h

"},{"location":"ltapi/errno_8h_source/","title":"File errno.h","text":"

File List > base > fixups > errno.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-06-13. */\n\n#pragma once\n\n// This is an attempt to bring at least some order to <errno.h>, as\n// it's generally a source of problems everywhere.\n// The idea is that all units will try to import this errno.h first,\n// which means it won't use lwIP's error codes.\n// The code below was moved from realtek-ambz/fixups during\n// porting of BK72XX SDK, when the errno stroke again.\n\n// There are two different errno's:\n// - first is just an int\n// - second is a macro that calls __errno()\n// Here the first option is ensured in the entire project.\n#include <sys/errno.h> // use system __errno() & error codes\n#undef errno           // undefine __errno() macro\nextern int errno;      // use a global errno variable\n#define errno errno    // for #ifdef errno in lwIP\n\n// make sure lwIP never defines its own error codes\n#undef LWIP_PROVIDE_ERRNO\n
"},{"location":"ltapi/malloc_8c/","title":"File malloc.c","text":"

FileList > base > fixups > malloc.c

Go to the source code of this file.

"},{"location":"ltapi/malloc_8c/#public-functions","title":"Public Functions","text":"Type Name void * __wrap_zalloc (size_t size)"},{"location":"ltapi/malloc_8c/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/malloc_8c/#function-__wrap_zalloc","title":"function __wrap_zalloc","text":"
void * __wrap_zalloc (\n    size_t size\n) \n

The documentation for this class was generated from the following file cores/common/base/fixups/malloc.c

"},{"location":"ltapi/malloc_8c_source/","title":"File malloc.c","text":"

File List > base > fixups > malloc.c

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2023-03-03. */\n\n// Generic implementation of malloc() family wrappers for FreeRTOS\n\n#if LT_HAS_FREERTOS\n\n#include <stddef.h>\n#include <stdint.h>\n#include <string.h>\n\n#include <FreeRTOS.h>\n\n// no such thing in FreeRTOS, but present on most vendor SDKs\nextern void *LT_REALLOC_FUNC(void *pv, size_t xWantedSize);\n\nvoid *__wrap_malloc(size_t size) {\n    return pvPortMalloc(size);\n}\n\nvoid *__wrap_calloc(size_t num, size_t size) {\n    void *ptr;\n    if (num == 0 || size == 0)\n        num = size = 1;\n    ptr = pvPortMalloc(num * size);\n    if (ptr)\n        memset(ptr, 0, num * size);\n    return ptr;\n}\n\nvoid *__wrap_realloc(void *ptr, size_t new_size) {\n#if LT_REMALLOC\n    void *nptr = pvPortMalloc(new_size);\n    if (nptr) {\n        memcpy(nptr, ptr, new_size);\n        vPortFree(ptr);\n    }\n    return nptr;\n#else\n    return LT_REALLOC_FUNC(ptr, new_size);\n#endif\n}\n\nvoid __wrap_free(void *ptr) {\n    vPortFree(ptr);\n}\n\n// Mind the 'reent' parameter - do NOT define these as linker aliases!\n\nvoid *__wrap__malloc_r(void *reent, size_t size) {\n    return pvPortMalloc(size);\n}\n\nvoid *__wrap__calloc_r(void *reent, size_t num, size_t size) {\n    void *ptr;\n    if (num == 0 || size == 0)\n        num = size = 1;\n    ptr = pvPortMalloc(num * size);\n    if (ptr)\n        memset(ptr, 0, num * size);\n    return ptr;\n}\n\nvoid *__wrap__realloc_r(void *reent, void *ptr, size_t new_size) {\n#if LT_REMALLOC\n    void *nptr = pvPortMalloc(new_size);\n    if (nptr) {\n        memcpy(nptr, ptr, new_size);\n        vPortFree(ptr);\n    }\n    return nptr;\n#else\n    return LT_REALLOC_FUNC(ptr, new_size);\n#endif\n}\n\nvoid __wrap__free_r(void *reent, void *ptr) {\n    vPortFree(ptr);\n}\n\n#endif\n\n// Additionally, define zalloc() as a shorthand to calloc() - some implementation use it\n\nvoid *__wrap_zalloc(size_t size) {\n    return __wrap_calloc(1, size);\n}\n\n__attribute__((alias(\"__wrap_zalloc\"), weak)) void *zalloc(size_t size);\n
"},{"location":"ltapi/dir_846e8f2c00731a5babdd912d0551347c/","title":"Dir cores/common/base/posix","text":"

FileList > base > posix

"},{"location":"ltapi/dir_846e8f2c00731a5babdd912d0551347c/#files","title":"Files","text":"Type Name file itoa.c file strcasecmp.c file strdup.c file strptime.c

The documentation for this class was generated from the following file cores/common/base/posix/

"},{"location":"ltapi/itoa_8c/","title":"File itoa.c","text":"

FileList > base > posix > itoa.c

Go to the source code of this file.

  • #include <string.h>
"},{"location":"ltapi/itoa_8c/#public-functions","title":"Public Functions","text":"Type Name char * itoa (int value, char * string, int radix) char * ltoa (long value, char * string, int radix) char * ultoa (unsigned long value, char * string, int radix) char * utoa (unsigned int value, char * string, int radix)"},{"location":"ltapi/itoa_8c/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/itoa_8c/#function-itoa","title":"function itoa","text":"
char * itoa (\n    int value,\n    char * string,\n    int radix\n) \n
"},{"location":"ltapi/itoa_8c/#function-ltoa","title":"function ltoa","text":"
char * ltoa (\n    long value,\n    char * string,\n    int radix\n) \n
"},{"location":"ltapi/itoa_8c/#function-ultoa","title":"function ultoa","text":"
char * ultoa (\n    unsigned long value,\n    char * string,\n    int radix\n) \n
"},{"location":"ltapi/itoa_8c/#function-utoa","title":"function utoa","text":"
char * utoa (\n    unsigned int value,\n    char * string,\n    int radix\n) \n

The documentation for this class was generated from the following file cores/common/base/posix/itoa.c

"},{"location":"ltapi/itoa_8c_source/","title":"File itoa.c","text":"

File List > base > posix > itoa.c

Go to the documentation of this file.

/*\n  Copyright (c) 2014 Arduino LLC.  All right reserved.\n\n  This library is free software; you can redistribute it and/or\n  modify it under the terms of the GNU Lesser General Public\n  License as published by the Free Software Foundation; either\n  version 2.1 of the License, or (at your option) any later version.\n\n  This library is distributed in the hope that it will be useful,\n  but WITHOUT ANY WARRANTY; without even the implied warranty of\n  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n  See the GNU Lesser General Public License for more details.\n\n  You should have received a copy of the GNU Lesser General Public\n  License along with this library; if not, write to the Free Software\n  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA\n*/\n\n#include <string.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nchar *ltoa(long value, char *string, int radix) {\n    char tmp[33];\n    char *tp = tmp;\n    long i;\n    unsigned long v;\n    int sign;\n    char *sp;\n\n    if (string == NULL) {\n        return 0;\n    }\n\n    if (radix > 36 || radix <= 1) {\n        return 0;\n    }\n\n    sign = (radix == 10 && value < 0);\n    if (sign) {\n        v = -value;\n    } else {\n        v = (unsigned long)value;\n    }\n\n    while (v || tp == tmp) {\n        i = v % radix;\n        v = v / radix;\n        if (i < 10)\n            *tp++ = i + '0';\n        else\n            *tp++ = i + 'a' - 10;\n    }\n\n    sp = string;\n\n    if (sign)\n        *sp++ = '-';\n    while (tp > tmp)\n        *sp++ = *--tp;\n    *sp = 0;\n\n    return string;\n}\n\nchar *ultoa(unsigned long value, char *string, int radix) {\n    char tmp[33];\n    char *tp = tmp;\n    long i;\n    unsigned long v = value;\n    char *sp;\n\n    if (string == NULL) {\n        return 0;\n    }\n\n    if (radix > 36 || radix <= 1) {\n        return 0;\n    }\n\n    while (v || tp == tmp) {\n        i = v % radix;\n        v = v / radix;\n        if (i < 10)\n            *tp++ = i + '0';\n        else\n            *tp++ = i + 'a' - 10;\n    }\n\n    sp = string;\n\n    while (tp > tmp)\n        *sp++ = *--tp;\n    *sp = 0;\n\n    return string;\n}\n\nchar *itoa(int value, char *string, int radix) {\n    return ltoa(value, string, radix);\n}\n\nchar *utoa(unsigned int value, char *string, int radix) {\n    return ultoa(value, string, radix);\n}\n\n#ifdef __cplusplus\n} // extern \"C\"\n#endif\n
"},{"location":"ltapi/strcasecmp_8c/","title":"File strcasecmp.c","text":"

FileList > base > posix > strcasecmp.c

Go to the source code of this file.

  • #include <string.h>
"},{"location":"ltapi/strcasecmp_8c/#public-types","title":"Public Types","text":"Type Name typedef unsigned char u_char"},{"location":"ltapi/strcasecmp_8c/#public-static-attributes","title":"Public Static Attributes","text":"Type Name const u_char charmap"},{"location":"ltapi/strcasecmp_8c/#public-functions","title":"Public Functions","text":"Type Name int strcasecmp (const char * s1, const char * s2) int strncasecmp (const char * s1, const char * s2, size_t n)"},{"location":"ltapi/strcasecmp_8c/#public-types-documentation","title":"Public Types Documentation","text":""},{"location":"ltapi/strcasecmp_8c/#typedef-u_char","title":"typedef u_char","text":"
typedef unsigned char u_char;\n
"},{"location":"ltapi/strcasecmp_8c/#public-static-attributes-documentation","title":"Public Static Attributes Documentation","text":""},{"location":"ltapi/strcasecmp_8c/#variable-charmap","title":"variable charmap","text":"
const u_char charmap[];\n
"},{"location":"ltapi/strcasecmp_8c/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/strcasecmp_8c/#function-strcasecmp","title":"function strcasecmp","text":"
int strcasecmp (\n    const char * s1,\n    const char * s2\n) \n
"},{"location":"ltapi/strcasecmp_8c/#function-strncasecmp","title":"function strncasecmp","text":"
int strncasecmp (\n    const char * s1,\n    const char * s2,\n    size_t n\n) \n

The documentation for this class was generated from the following file cores/common/base/posix/strcasecmp.c

"},{"location":"ltapi/strcasecmp_8c_source/","title":"File strcasecmp.c","text":"

File List > base > posix > strcasecmp.c

Go to the documentation of this file.

/*  $OpenBSD: strcasecmp.c,v 1.6 2005/08/08 08:05:37 espie Exp $    */\n/*\n * Copyright (c) 1987, 1993\n *  The Regents of the University of California.  All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n * 1. Redistributions of source code must retain the above copyright\n *    notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n *    notice, this list of conditions and the following disclaimer in the\n *    documentation and/or other materials provided with the distribution.\n * 3. Neither the name of the University nor the names of its contributors\n *    may be used to endorse or promote products derived from this software\n *    without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n */\n#include <string.h>\ntypedef unsigned char u_char;\n/*\n * This array is designed for mapping upper and lower case letter\n * together for a case independent comparison.  The mappings are\n * based upon ascii character sequences.\n */\nstatic const u_char charmap[] = {\n    '\\000', '\\001', '\\002', '\\003', '\\004', '\\005', '\\006', '\\007',\n    '\\010', '\\011', '\\012', '\\013', '\\014', '\\015', '\\016', '\\017',\n    '\\020', '\\021', '\\022', '\\023', '\\024', '\\025', '\\026', '\\027',\n    '\\030', '\\031', '\\032', '\\033', '\\034', '\\035', '\\036', '\\037',\n    '\\040', '\\041', '\\042', '\\043', '\\044', '\\045', '\\046', '\\047',\n    '\\050', '\\051', '\\052', '\\053', '\\054', '\\055', '\\056', '\\057',\n    '\\060', '\\061', '\\062', '\\063', '\\064', '\\065', '\\066', '\\067',\n    '\\070', '\\071', '\\072', '\\073', '\\074', '\\075', '\\076', '\\077',\n    '\\100', '\\141', '\\142', '\\143', '\\144', '\\145', '\\146', '\\147',\n    '\\150', '\\151', '\\152', '\\153', '\\154', '\\155', '\\156', '\\157',\n    '\\160', '\\161', '\\162', '\\163', '\\164', '\\165', '\\166', '\\167',\n    '\\170', '\\171', '\\172', '\\133', '\\134', '\\135', '\\136', '\\137',\n    '\\140', '\\141', '\\142', '\\143', '\\144', '\\145', '\\146', '\\147',\n    '\\150', '\\151', '\\152', '\\153', '\\154', '\\155', '\\156', '\\157',\n    '\\160', '\\161', '\\162', '\\163', '\\164', '\\165', '\\166', '\\167',\n    '\\170', '\\171', '\\172', '\\173', '\\174', '\\175', '\\176', '\\177',\n    '\\200', '\\201', '\\202', '\\203', '\\204', '\\205', '\\206', '\\207',\n    '\\210', '\\211', '\\212', '\\213', '\\214', '\\215', '\\216', '\\217',\n    '\\220', '\\221', '\\222', '\\223', '\\224', '\\225', '\\226', '\\227',\n    '\\230', '\\231', '\\232', '\\233', '\\234', '\\235', '\\236', '\\237',\n    '\\240', '\\241', '\\242', '\\243', '\\244', '\\245', '\\246', '\\247',\n    '\\250', '\\251', '\\252', '\\253', '\\254', '\\255', '\\256', '\\257',\n    '\\260', '\\261', '\\262', '\\263', '\\264', '\\265', '\\266', '\\267',\n    '\\270', '\\271', '\\272', '\\273', '\\274', '\\275', '\\276', '\\277',\n    '\\300', '\\301', '\\302', '\\303', '\\304', '\\305', '\\306', '\\307',\n    '\\310', '\\311', '\\312', '\\313', '\\314', '\\315', '\\316', '\\317',\n    '\\320', '\\321', '\\322', '\\323', '\\324', '\\325', '\\326', '\\327',\n    '\\330', '\\331', '\\332', '\\333', '\\334', '\\335', '\\336', '\\337',\n    '\\340', '\\341', '\\342', '\\343', '\\344', '\\345', '\\346', '\\347',\n    '\\350', '\\351', '\\352', '\\353', '\\354', '\\355', '\\356', '\\357',\n    '\\360', '\\361', '\\362', '\\363', '\\364', '\\365', '\\366', '\\367',\n    '\\370', '\\371', '\\372', '\\373', '\\374', '\\375', '\\376', '\\377',\n};\nint\nstrcasecmp(const char *s1, const char *s2)\n{\n    const u_char *cm = charmap;\n    const u_char *us1 = (const u_char *)s1;\n    const u_char *us2 = (const u_char *)s2;\n    while (cm[*us1] == cm[*us2++])\n        if (*us1++ == '\\0')\n            return (0);\n    return (cm[*us1] - cm[*--us2]);\n}\nint\nstrncasecmp(const char *s1, const char *s2, size_t n)\n{\n    if (n != 0) {\n        const u_char *cm = charmap;\n        const u_char *us1 = (const u_char *)s1;\n        const u_char *us2 = (const u_char *)s2;\n        do {\n            if (cm[*us1] != cm[*us2++])\n                return (cm[*us1] - cm[*--us2]);\n            if (*us1++ == '\\0')\n                break;\n        } while (--n != 0);\n    }\n    return (0);\n}\n
"},{"location":"ltapi/strdup_8c/","title":"File strdup.c","text":"

FileList > base > posix > strdup.c

Go to the source code of this file.

  • #include <stddef.h>
  • #include <stdlib.h>
  • #include <string.h>
"},{"location":"ltapi/strdup_8c/#public-functions","title":"Public Functions","text":"Type Name __attribute__ ((weak))"},{"location":"ltapi/strdup_8c/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/strdup_8c/#function-__attribute__","title":"function __attribute__","text":"
__attribute__ (\n    (weak)\n) \n

The documentation for this class was generated from the following file cores/common/base/posix/strdup.c

"},{"location":"ltapi/strdup_8c_source/","title":"File strdup.c","text":"

File List > base > posix > strdup.c

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-05-16. */\n\n#include <stddef.h>\n#include <stdlib.h>\n#include <string.h>\n\n__attribute__((weak)) char *strdup(const char *s) {\n    size_t len = strlen(s) + 1;\n    void *newp = malloc(len);\n    if (newp == NULL)\n        return NULL;\n    return (char *)memcpy(newp, s, len);\n}\n
"},{"location":"ltapi/strptime_8c/","title":"File strptime.c","text":"

FileList > base > posix > strptime.c

Go to the source code of this file.

  • #include <stdlib.h>
  • #include <langinfo.h>
  • #include <time.h>
  • #include <ctype.h>
  • #include <stddef.h>
  • #include <string.h>
  • #include <strings.h>
"},{"location":"ltapi/strptime_8c/#public-functions","title":"Public Functions","text":"Type Name char * strptime (const char *restrict s, const char *restrict f, struct tm *restrict tm)"},{"location":"ltapi/strptime_8c/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/strptime_8c/#function-strptime","title":"function strptime","text":"
char * strptime (\n    const char *restrict s,\n    const char *restrict f,\n    struct tm *restrict tm\n) \n

The documentation for this class was generated from the following file cores/common/base/posix/strptime.c

"},{"location":"ltapi/strptime_8c_source/","title":"File strptime.c","text":"

File List > base > posix > strptime.c

Go to the documentation of this file.

#include <stdlib.h>\n#include <langinfo.h>\n#include <time.h>\n#include <ctype.h>\n#include <stddef.h>\n#include <string.h>\n#include <strings.h>\n\nchar *strptime(const char *restrict s, const char *restrict f, struct tm *restrict tm)\n{\n    int i, w, neg, adj, min, range, *dest, dummy;\n    const char *ex;\n    size_t len;\n    int want_century = 0, century = 0;\n    while (*f) {\n        if (*f != '%') {\n            if (isspace(*f)) for (; *s && isspace(*s); s++);\n            else if (*s != *f) return 0;\n            else s++;\n            f++;\n            continue;\n        }\n        f++;\n        if (*f == '+') f++;\n        if (isdigit(*f)) w=strtoul(f, (void *)&f, 10);\n        else w=-1;\n        adj=0;\n        switch (*f++) {\n        case 'a': case 'A':\n            dest = &tm->tm_wday;\n            min = ABDAY_1;\n            range = 7;\n            goto symbolic_range;\n        case 'b': case 'B': case 'h':\n            dest = &tm->tm_mon;\n            min = ABMON_1;\n            range = 12;\n            goto symbolic_range;\n        case 'c':\n            s = strptime(s, nl_langinfo(D_T_FMT), tm);\n            if (!s) return 0;\n            break;\n        case 'C':\n            dest = &century;\n            if (w<0) w=2;\n            want_century |= 2;\n            goto numeric_digits;\n        case 'd': case 'e':\n            dest = &tm->tm_mday;\n            min = 1;\n            range = 31;\n            goto numeric_range;\n        case 'D':\n            s = strptime(s, \"%m/%d/%y\", tm);\n            if (!s) return 0;\n            break;\n        case 'H':\n            dest = &tm->tm_hour;\n            min = 0;\n            range = 24;\n            goto numeric_range;\n        case 'I':\n            dest = &tm->tm_hour;\n            min = 1;\n            range = 12;\n            goto numeric_range;\n        case 'j':\n            dest = &tm->tm_yday;\n            min = 1;\n            range = 366;\n            goto numeric_range;\n        case 'm':\n            dest = &tm->tm_mon;\n            min = 1;\n            range = 12;\n            adj = 1;\n            goto numeric_range;\n        case 'M':\n            dest = &tm->tm_min;\n            min = 0;\n            range = 60;\n            goto numeric_range;\n        case 'n': case 't':\n            for (; *s && isspace(*s); s++);\n            break;\n        case 'p':\n            ex = nl_langinfo(AM_STR);\n            len = strlen(ex);\n            if (!strncasecmp(s, ex, len)) {\n                tm->tm_hour %= 12;\n                break;\n            }\n            ex = nl_langinfo(PM_STR);\n            len = strlen(ex);\n            if (!strncasecmp(s, ex, len)) {\n                tm->tm_hour %= 12;\n                tm->tm_hour += 12;\n                break;\n            }\n            return 0;\n        case 'r':\n            s = strptime(s, nl_langinfo(T_FMT_AMPM), tm);\n            if (!s) return 0;\n            break;\n        case 'R':\n            s = strptime(s, \"%H:%M\", tm);\n            if (!s) return 0;\n            break;\n        case 'S':\n            dest = &tm->tm_sec;\n            min = 0;\n            range = 61;\n            goto numeric_range;\n        case 'T':\n            s = strptime(s, \"%H:%M:%S\", tm);\n            if (!s) return 0;\n            break;\n        case 'U':\n        case 'W':\n            /* Throw away result, for now. (FIXME?) */\n            dest = &dummy;\n            min = 0;\n            range = 54;\n            goto numeric_range;\n        case 'w':\n            dest = &tm->tm_wday;\n            min = 0;\n            range = 7;\n            goto numeric_range;\n        case 'x':\n            s = strptime(s, nl_langinfo(D_FMT), tm);\n            if (!s) return 0;\n            break;\n        case 'X':\n            s = strptime(s, nl_langinfo(T_FMT), tm);\n            if (!s) return 0;\n            break;\n        case 'y':\n            dest = &tm->tm_year;\n            w = 2;\n            want_century |= 1;\n            goto numeric_digits;\n        case 'Y':\n            dest = &tm->tm_year;\n            if (w<0) w=4;\n            adj = 1900;\n            want_century = 0;\n            goto numeric_digits;\n        case '%':\n            if (*s++ != '%') return 0;\n            break;\n        default:\n            return 0;\n        numeric_range:\n            if (!isdigit(*s)) return 0;\n            *dest = 0;\n            for (i=1; i<=min+range && isdigit(*s); i*=10)\n                *dest = *dest * 10 + *s++ - '0';\n            if (*dest - min >= (unsigned)range) return 0;\n            *dest -= adj;\n            switch((char *)dest - (char *)tm) {\n            case offsetof(struct tm, tm_yday):\n                ;\n            }\n            goto update;\n        numeric_digits:\n            neg = 0;\n            if (*s == '+') s++;\n            else if (*s == '-') neg=1, s++;\n            if (!isdigit(*s)) return 0;\n            for (*dest=i=0; i<w && isdigit(*s); i++)\n                *dest = *dest * 10 + *s++ - '0';\n            if (neg) *dest = -*dest;\n            *dest -= adj;\n            goto update;\n        symbolic_range:\n            for (i=2*range-1; i>=0; i--) {\n                ex = nl_langinfo(min+i);\n                len = strlen(ex);\n                if (strncasecmp(s, ex, len)) continue;\n                s += len;\n                *dest = i % range;\n                break;\n            }\n            if (i<0) return 0;\n            goto update;\n        update:\n            //FIXME\n            ;\n        }\n    }\n    if (want_century) {\n        if (want_century & 2) tm->tm_year += century * 100 - 1900;\n        else if (tm->tm_year <= 68) tm->tm_year += 100;\n    }\n    return (char *)s;\n}\n
"},{"location":"ltapi/dir_b483440aeb16b525e6183721aad24145/","title":"Dir cores/common/base/wraps","text":"

FileList > base > wraps

"},{"location":"ltapi/dir_b483440aeb16b525e6183721aad24145/#files","title":"Files","text":"Type Name file putchar.c file puts.c

The documentation for this class was generated from the following file cores/common/base/wraps/

"},{"location":"ltapi/putchar_8c/","title":"File putchar.c","text":"

FileList > base > wraps > putchar.c

Go to the source code of this file.

  • #include <printf/printf.h>
  • #include <stdio.h>
"},{"location":"ltapi/putchar_8c/#public-functions","title":"Public Functions","text":"Type Name int __wrap_putchar (int c)"},{"location":"ltapi/putchar_8c/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/putchar_8c/#function-__wrap_putchar","title":"function __wrap_putchar","text":"
int __wrap_putchar (\n    int c\n) \n

The documentation for this class was generated from the following file cores/common/base/wraps/putchar.c

"},{"location":"ltapi/putchar_8c_source/","title":"File putchar.c","text":"

File List > base > wraps > putchar.c

Go to the documentation of this file.

// https://github.com/embeddedartistry/libc/blob/master/src/stdio/putchar.c\n\n#include <printf/printf.h>\n#include <stdio.h>\n\nint __wrap_putchar(int c) {\n    putchar_((char)c);\n    return c;\n}\n
"},{"location":"ltapi/puts_8c/","title":"File puts.c","text":"

FileList > base > wraps > puts.c

Go to the source code of this file.

  • #include <printf/printf.h>
  • #include <stdio.h>
"},{"location":"ltapi/puts_8c/#public-functions","title":"Public Functions","text":"Type Name int __wrap_puts (const char * str)"},{"location":"ltapi/puts_8c/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/puts_8c/#function-__wrap_puts","title":"function __wrap_puts","text":"
int __wrap_puts (\n    const char * str\n) \n

The documentation for this class was generated from the following file cores/common/base/wraps/puts.c

"},{"location":"ltapi/puts_8c_source/","title":"File puts.c","text":"

File List > base > wraps > puts.c

Go to the documentation of this file.

// https://github.com/embeddedartistry/libc/blob/master/src/stdio/puts.c\n\n#include <printf/printf.h>\n#include <stdio.h>\n\nint __wrap_puts(const char *str) {\n    int r = 0;\n\n    for (const char *c = str; *c != 0; c++) {\n        putchar_((int)*c);\n        r++;\n    }\n\n    // puts adds a newline\n    if (r) {\n        putchar_('\\n');\n        r++;\n    }\n\n    return r ? r : EOF;\n}\n
"},{"location":"ltapi/libretiny_8h/","title":"File libretiny.h","text":"

FileList > base > libretiny.h

Go to the source code of this file.

  • #include <errno.h>
  • #include <inttypes.h>
  • #include <math.h>
  • #include <stdarg.h>
  • #include <stdbool.h>
  • #include <stddef.h>
  • #include <stdint.h>
  • #include <stdio.h>
  • #include <stdlib.h>
  • #include <string.h>
  • #include \"lt_config.h\"
  • #include \"lt_types.h\"
  • #include <lt_family.h>
  • #include \"lt_api.h\"
  • #include \"lt_logger.h\"
  • #include \"lt_pins.h\"
  • #include \"lt_posix_api.h\"
  • #include <printf_port.h>
"},{"location":"ltapi/libretiny_8h/#macros","title":"Macros","text":"Type Name define GCC_VERSION_STR STRINGIFY_MACRO(__GNUC__) \".\" STRINGIFY_MACRO(__GNUC_MINOR__) \".\" STRINGIFY_MACRO(__GNUC_PATCHLEVEL__) define LT_BANNER () LT_LOG(LT_LEVEL_INFO, __FUNCTION__, __LINE__, LT_BANNER_STR) define LT_BANNER_STR define LT_BOARD unknown define LT_BOARD_STR STRINGIFY_MACRO(LT_BOARD) define LT_VERSION 1.0.0 define LT_VERSION_STR STRINGIFY_MACRO(LT_VERSION) define STRINGIFY (x) #x define STRINGIFY_MACRO (x) STRINGIFY(x)"},{"location":"ltapi/libretiny_8h/#macro-definition-documentation","title":"Macro Definition Documentation","text":""},{"location":"ltapi/libretiny_8h/#define-gcc_version_str","title":"define GCC_VERSION_STR","text":"
#define GCC_VERSION_STR STRINGIFY_MACRO(__GNUC__) \".\" STRINGIFY_MACRO(__GNUC_MINOR__) \".\" STRINGIFY_MACRO(__GNUC_PATCHLEVEL__)\n
"},{"location":"ltapi/libretiny_8h/#define-lt_banner","title":"define LT_BANNER","text":"
#define LT_BANNER (\n\n) LT_LOG(LT_LEVEL_INFO, __FUNCTION__, __LINE__, LT_BANNER_STR)\n
"},{"location":"ltapi/libretiny_8h/#define-lt_banner_str","title":"define LT_BANNER_STR","text":"
#define LT_BANNER_STR \"LibreTiny v\" LT_VERSION_STR \" on \" LT_BOARD_STR \", compiled at \" __DATE__ \" \" __TIME__ \", GCC \" GCC_VERSION_STR   \\\n    \" (-O\" STRINGIFY_MACRO(__OPTIMIZE_LEVEL__) \")\"\n
"},{"location":"ltapi/libretiny_8h/#define-lt_board","title":"define LT_BOARD","text":"
#define LT_BOARD unknown\n
"},{"location":"ltapi/libretiny_8h/#define-lt_board_str","title":"define LT_BOARD_STR","text":"
#define LT_BOARD_STR STRINGIFY_MACRO(LT_BOARD)\n
"},{"location":"ltapi/libretiny_8h/#define-lt_version","title":"define LT_VERSION","text":"
#define LT_VERSION 1.0.0\n
"},{"location":"ltapi/libretiny_8h/#define-lt_version_str","title":"define LT_VERSION_STR","text":"
#define LT_VERSION_STR STRINGIFY_MACRO(LT_VERSION)\n
"},{"location":"ltapi/libretiny_8h/#define-stringify","title":"define STRINGIFY","text":"
#define STRINGIFY (\n    x\n) #x\n
"},{"location":"ltapi/libretiny_8h/#define-stringify_macro","title":"define STRINGIFY_MACRO","text":"
#define STRINGIFY_MACRO (\n    x\n) STRINGIFY(x)\n

The documentation for this class was generated from the following file cores/common/base/libretiny.h

"},{"location":"ltapi/libretiny_8h_source/","title":"File libretiny.h","text":"

File List > base > libretiny.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-04-28. */\n\n#pragma once\n\n// C standard libraries\n#include <errno.h>\n#include <inttypes.h>\n#include <math.h>\n#include <stdarg.h>\n#include <stdbool.h>\n#include <stddef.h>\n#include <stdint.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n\n// LibreTiny version macros\n#ifndef LT_VERSION\n#define LT_VERSION 1.0.0\n#endif\n#ifndef LT_BOARD\n#define LT_BOARD unknown\n#endif\n#define STRINGIFY(x)       #x\n#define STRINGIFY_MACRO(x) STRINGIFY(x)\n#define LT_VERSION_STR     STRINGIFY_MACRO(LT_VERSION)\n#define LT_BOARD_STR       STRINGIFY_MACRO(LT_BOARD)\n#define GCC_VERSION_STR                                                                                                \\\n    STRINGIFY_MACRO(__GNUC__) \".\" STRINGIFY_MACRO(__GNUC_MINOR__) \".\" STRINGIFY_MACRO(__GNUC_PATCHLEVEL__)\n#define LT_BANNER_STR                                                                                                  \\\n    \"LibreTiny v\" LT_VERSION_STR \" on \" LT_BOARD_STR \", compiled at \" __DATE__ \" \" __TIME__ \", GCC \" GCC_VERSION_STR   \\\n    \" (-O\" STRINGIFY_MACRO(__OPTIMIZE_LEVEL__) \")\"\n\n// Functional macros\n#define LT_BANNER() LT_LOG(LT_LEVEL_INFO, __FUNCTION__, __LINE__, LT_BANNER_STR)\n\n// Types & macros\n#include \"lt_config.h\" // platform configuration options\n#include \"lt_types.h\"  // types & enums\n// Family-specific macros\n#include <lt_family.h>\n// Board variant (pin definitions)\n#include LT_VARIANT_H\n// APIs\n#include \"lt_api.h\"       // main API function definitions\n#include \"lt_logger.h\"    // UART logger utility\n#include \"lt_pins.h\"      // additional pin macros\n#include \"lt_posix_api.h\" // POSIX compat functions\n// printf silencing methods\n#include <printf_port.h>\n
"},{"location":"ltapi/lt__api_8h/","title":"File lt_api.h","text":"

FileList > base > lt_api.h

Go to the source code of this file.

  • #include \"api/lt_cpu.h\"
  • #include \"api/lt_device.h\"
  • #include \"api/lt_flash.h\"
  • #include \"api/lt_init.h\"
  • #include \"api/lt_mem.h\"
  • #include \"api/lt_ota.h\"
  • #include \"api/lt_sleep.h\"
  • #include \"api/lt_utils.h\"
  • #include \"api/lt_wdt.h\"

The documentation for this class was generated from the following file cores/common/base/lt_api.h

"},{"location":"ltapi/lt__api_8h_source/","title":"File lt_api.h","text":"

File List > base > lt_api.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2023-03-09. */\n\n#pragma once\n\n// This file collects all LibreTiny C API includes.\n// The functions are implemented in api/*.c units, which are located\n// in the common core, and in the family cores.\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif // __cplusplus\n\n#include \"api/lt_cpu.h\"\n#include \"api/lt_device.h\"\n#include \"api/lt_flash.h\"\n#include \"api/lt_init.h\"\n#include \"api/lt_mem.h\"\n#include \"api/lt_ota.h\"\n#include \"api/lt_sleep.h\"\n#include \"api/lt_utils.h\"\n#include \"api/lt_wdt.h\"\n\n#ifdef __cplusplus\n} // extern \"C\"\n#endif\n
"},{"location":"ltapi/lt__config_8h/","title":"File lt_config.h","text":"

FileList > base > lt_config.h

Go to the source code of this file.

"},{"location":"ltapi/lt__config_8h/#macros","title":"Macros","text":"Type Name define LT_AUTO_DOWNLOAD_REBOOT 1 define LT_DEBUG_ALL 0 define LT_DEBUG_CLIENT LT_DEBUG_ALL define LT_DEBUG_FDB 0 define LT_DEBUG_LWIP 0 define LT_DEBUG_LWIP_ASSERT 0 define LT_DEBUG_MDNS LT_DEBUG_ALL define LT_DEBUG_OTA 1 define LT_DEBUG_SERVER LT_DEBUG_ALL define LT_DEBUG_SSL LT_DEBUG_ALL define LT_DEBUG_WIFI 1 define LT_LEVEL_DEBUG 1 define LT_LEVEL_ERROR 4 define LT_LEVEL_FATAL 5 define LT_LEVEL_INFO 2 define LT_LEVEL_NONE 6 define LT_LEVEL_TRACE 0 define LT_LEVEL_VERBOSE LT_LEVEL_TRACE define LT_LEVEL_WARN 3 define LT_LOGGER 1 define LT_LOGGER_CALLER 0 define LT_LOGGER_COLOR 0 define LT_LOGGER_TASK 0 define LT_LOGGER_TIMESTAMP 1 define LT_LOGLEVEL LT_LEVEL_INFO define LT_LOG_ERRNO 0 define LT_LOG_HEAP 0 define LT_MICROS_HIGH_RES 1 define LT_PRINTF_BROKEN 0 define LT_UART_DEFAULT_LOGGER LT_UART_DEFAULT_PORT define LT_UART_DEFAULT_SERIAL LT_UART_DEFAULT_PORT define LT_UART_SILENT_ALL 0 define LT_UART_SILENT_ENABLED 1 define LT_USE_TIME 0"},{"location":"ltapi/lt__config_8h/#macro-definition-documentation","title":"Macro Definition Documentation","text":""},{"location":"ltapi/lt__config_8h/#define-lt_auto_download_reboot","title":"define LT_AUTO_DOWNLOAD_REBOOT","text":"
#define LT_AUTO_DOWNLOAD_REBOOT 1\n
"},{"location":"ltapi/lt__config_8h/#define-lt_debug_all","title":"define LT_DEBUG_ALL","text":"
#define LT_DEBUG_ALL 0\n
"},{"location":"ltapi/lt__config_8h/#define-lt_debug_client","title":"define LT_DEBUG_CLIENT","text":"
#define LT_DEBUG_CLIENT LT_DEBUG_ALL\n
"},{"location":"ltapi/lt__config_8h/#define-lt_debug_fdb","title":"define LT_DEBUG_FDB","text":"
#define LT_DEBUG_FDB 0\n
"},{"location":"ltapi/lt__config_8h/#define-lt_debug_lwip","title":"define LT_DEBUG_LWIP","text":"
#define LT_DEBUG_LWIP 0\n
"},{"location":"ltapi/lt__config_8h/#define-lt_debug_lwip_assert","title":"define LT_DEBUG_LWIP_ASSERT","text":"
#define LT_DEBUG_LWIP_ASSERT 0\n
"},{"location":"ltapi/lt__config_8h/#define-lt_debug_mdns","title":"define LT_DEBUG_MDNS","text":"
#define LT_DEBUG_MDNS LT_DEBUG_ALL\n
"},{"location":"ltapi/lt__config_8h/#define-lt_debug_ota","title":"define LT_DEBUG_OTA","text":"
#define LT_DEBUG_OTA 1\n
"},{"location":"ltapi/lt__config_8h/#define-lt_debug_server","title":"define LT_DEBUG_SERVER","text":"
#define LT_DEBUG_SERVER LT_DEBUG_ALL\n
"},{"location":"ltapi/lt__config_8h/#define-lt_debug_ssl","title":"define LT_DEBUG_SSL","text":"
#define LT_DEBUG_SSL LT_DEBUG_ALL\n
"},{"location":"ltapi/lt__config_8h/#define-lt_debug_wifi","title":"define LT_DEBUG_WIFI","text":"
#define LT_DEBUG_WIFI 1\n
"},{"location":"ltapi/lt__config_8h/#define-lt_level_debug","title":"define LT_LEVEL_DEBUG","text":"
#define LT_LEVEL_DEBUG 1\n
"},{"location":"ltapi/lt__config_8h/#define-lt_level_error","title":"define LT_LEVEL_ERROR","text":"
#define LT_LEVEL_ERROR 4\n
"},{"location":"ltapi/lt__config_8h/#define-lt_level_fatal","title":"define LT_LEVEL_FATAL","text":"
#define LT_LEVEL_FATAL 5\n
"},{"location":"ltapi/lt__config_8h/#define-lt_level_info","title":"define LT_LEVEL_INFO","text":"
#define LT_LEVEL_INFO 2\n
"},{"location":"ltapi/lt__config_8h/#define-lt_level_none","title":"define LT_LEVEL_NONE","text":"
#define LT_LEVEL_NONE 6\n
"},{"location":"ltapi/lt__config_8h/#define-lt_level_trace","title":"define LT_LEVEL_TRACE","text":"
#define LT_LEVEL_TRACE 0\n
"},{"location":"ltapi/lt__config_8h/#define-lt_level_verbose","title":"define LT_LEVEL_VERBOSE","text":"
#define LT_LEVEL_VERBOSE LT_LEVEL_TRACE\n
"},{"location":"ltapi/lt__config_8h/#define-lt_level_warn","title":"define LT_LEVEL_WARN","text":"
#define LT_LEVEL_WARN 3\n
"},{"location":"ltapi/lt__config_8h/#define-lt_logger","title":"define LT_LOGGER","text":"
#define LT_LOGGER 1\n
"},{"location":"ltapi/lt__config_8h/#define-lt_logger_caller","title":"define LT_LOGGER_CALLER","text":"
#define LT_LOGGER_CALLER 0\n
"},{"location":"ltapi/lt__config_8h/#define-lt_logger_color","title":"define LT_LOGGER_COLOR","text":"
#define LT_LOGGER_COLOR 0\n
"},{"location":"ltapi/lt__config_8h/#define-lt_logger_task","title":"define LT_LOGGER_TASK","text":"
#define LT_LOGGER_TASK 0\n
"},{"location":"ltapi/lt__config_8h/#define-lt_logger_timestamp","title":"define LT_LOGGER_TIMESTAMP","text":"
#define LT_LOGGER_TIMESTAMP 1\n
"},{"location":"ltapi/lt__config_8h/#define-lt_loglevel","title":"define LT_LOGLEVEL","text":"
#define LT_LOGLEVEL LT_LEVEL_INFO\n
"},{"location":"ltapi/lt__config_8h/#define-lt_log_errno","title":"define LT_LOG_ERRNO","text":"
#define LT_LOG_ERRNO 0\n
"},{"location":"ltapi/lt__config_8h/#define-lt_log_heap","title":"define LT_LOG_HEAP","text":"
#define LT_LOG_HEAP 0\n
"},{"location":"ltapi/lt__config_8h/#define-lt_micros_high_res","title":"define LT_MICROS_HIGH_RES","text":"
#define LT_MICROS_HIGH_RES 1\n
"},{"location":"ltapi/lt__config_8h/#define-lt_printf_broken","title":"define LT_PRINTF_BROKEN","text":"
#define LT_PRINTF_BROKEN 0\n
"},{"location":"ltapi/lt__config_8h/#define-lt_uart_default_logger","title":"define LT_UART_DEFAULT_LOGGER","text":"
#define LT_UART_DEFAULT_LOGGER LT_UART_DEFAULT_PORT\n
"},{"location":"ltapi/lt__config_8h/#define-lt_uart_default_serial","title":"define LT_UART_DEFAULT_SERIAL","text":"
#define LT_UART_DEFAULT_SERIAL LT_UART_DEFAULT_PORT\n
"},{"location":"ltapi/lt__config_8h/#define-lt_uart_silent_all","title":"define LT_UART_SILENT_ALL","text":"
#define LT_UART_SILENT_ALL 0\n
"},{"location":"ltapi/lt__config_8h/#define-lt_uart_silent_enabled","title":"define LT_UART_SILENT_ENABLED","text":"
#define LT_UART_SILENT_ENABLED 1\n
"},{"location":"ltapi/lt__config_8h/#define-lt_use_time","title":"define LT_USE_TIME","text":"
#define LT_USE_TIME 0\n

The documentation for this class was generated from the following file cores/common/base/lt_config.h

"},{"location":"ltapi/lt__config_8h_source/","title":"File lt_config.h","text":"

File List > base > lt_config.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-04-28. */\n\n#pragma once\n\n// see docs/API Configuration\n\n// Loglevels\n#define LT_LEVEL_VERBOSE LT_LEVEL_TRACE\n#define LT_LEVEL_TRACE   0\n#define LT_LEVEL_DEBUG   1\n#define LT_LEVEL_INFO    2\n#define LT_LEVEL_WARN    3\n#define LT_LEVEL_ERROR   4\n#define LT_LEVEL_FATAL   5\n#define LT_LEVEL_NONE    6\n\n// Logger enabled/disabled\n#ifndef LT_LOGGER\n#define LT_LOGGER 1\n#endif\n\n// Logger format options\n#ifndef LT_LOGGER_TIMESTAMP\n#define LT_LOGGER_TIMESTAMP 1\n#endif\n\n#ifndef LT_LOGGER_CALLER\n#define LT_LOGGER_CALLER 0\n#endif\n\n#ifndef LT_LOGGER_TASK\n#define LT_LOGGER_TASK 0\n#endif\n\n#ifndef LT_LOGGER_COLOR\n#define LT_LOGGER_COLOR 0\n#endif\n\n#ifndef LT_PRINTF_BROKEN\n#define LT_PRINTF_BROKEN 0\n#endif\n\n// Global loglevel\n#ifndef LT_LOGLEVEL\n#define LT_LOGLEVEL LT_LEVEL_INFO\n#endif\n\n#if !LT_LOGGER\n#undef LT_LOGLEVEL\n#define LT_LOGLEVEL LT_LEVEL_NONE\n#endif\n\n// Free heap size debugging\n#ifndef LT_LOG_HEAP\n#define LT_LOG_HEAP 0\n#endif\n\n// Debug errno values using LT_ERRNO()\n#ifndef LT_LOG_ERRNO\n#define LT_LOG_ERRNO 0\n#endif\n\n// Serial output options\n#ifndef LT_UART_SILENT_ENABLED\n#define LT_UART_SILENT_ENABLED 1\n#endif\n\n#ifndef LT_UART_SILENT_ALL\n#define LT_UART_SILENT_ALL 0\n#endif\n\n#ifndef LT_UART_DEFAULT_LOGGER\n#define LT_UART_DEFAULT_LOGGER LT_UART_DEFAULT_PORT\n#endif\n\n#ifndef LT_UART_DEFAULT_SERIAL\n#define LT_UART_DEFAULT_SERIAL LT_UART_DEFAULT_PORT\n#endif\n\n// Misc options\n#ifndef LT_USE_TIME\n#define LT_USE_TIME 0\n#endif\n\n#ifndef LT_MICROS_HIGH_RES // NOTE: this is also defined in fixups/clock_rtos.c\n#define LT_MICROS_HIGH_RES 1\n#endif\n\n#ifndef LT_AUTO_DOWNLOAD_REBOOT\n#define LT_AUTO_DOWNLOAD_REBOOT 1\n#endif\n\n// Per-module logging output - applies to all loglevels\n#ifndef LT_DEBUG_ALL\n#define LT_DEBUG_ALL 0\n#endif\n\n#ifndef LT_DEBUG_WIFI\n#define LT_DEBUG_WIFI 1\n#endif\n\n#ifndef LT_DEBUG_CLIENT\n#define LT_DEBUG_CLIENT LT_DEBUG_ALL\n#endif\n\n#ifndef LT_DEBUG_SERVER\n#define LT_DEBUG_SERVER LT_DEBUG_ALL\n#endif\n\n#ifndef LT_DEBUG_SSL\n#define LT_DEBUG_SSL LT_DEBUG_ALL\n#endif\n\n#ifndef LT_DEBUG_OTA\n#define LT_DEBUG_OTA 1\n#endif\n\n#ifndef LT_DEBUG_FDB\n#define LT_DEBUG_FDB 0\n#endif\n\n#ifndef LT_DEBUG_MDNS\n#define LT_DEBUG_MDNS LT_DEBUG_ALL\n#endif\n\n#ifndef LT_DEBUG_LWIP\n#define LT_DEBUG_LWIP 0\n#endif\n\n#ifndef LT_DEBUG_LWIP_ASSERT\n#define LT_DEBUG_LWIP_ASSERT 0\n#endif\n
"},{"location":"ltapi/lt__logger_8c/","title":"File lt_logger.c","text":"

FileList > base > lt_logger.c

Go to the source code of this file.

  • #include \"lt_logger.h\"
  • #include <stdio.h>
"},{"location":"ltapi/lt__logger_8c/#public-static-attributes","title":"Public Static Attributes","text":"Type Name const char levels = = {'V', 'D', 'I', 'W', 'E', 'F'} uint32_t uart_port = = 0"},{"location":"ltapi/lt__logger_8c/#public-functions","title":"Public Functions","text":"Type Name void lt_log (const uint8_t level, const char * format, ...) void lt_log_disable () Disable LT logger. Enable it back using lt_log_set_port(LT_UART_DEFAULT_LOGGER). void lt_log_set_port (uint8_t port) Change log output port."},{"location":"ltapi/lt__logger_8c/#macros","title":"Macros","text":"Type Name define COLOR_BLACK 0x00 define COLOR_BLUE 0x04 define COLOR_BRIGHT_BLACK 0x10 define COLOR_BRIGHT_BLUE 0x14 define COLOR_BRIGHT_CYAN 0x16 define COLOR_BRIGHT_GREEN 0x12 define COLOR_BRIGHT_MAGENTA 0x15 define COLOR_BRIGHT_RED 0x11 define COLOR_BRIGHT_WHITE 0x17 define COLOR_BRIGHT_YELLOW 0x13 define COLOR_CYAN 0x06 define COLOR_FMT \"e[0;30m\" define COLOR_GREEN 0x02 define COLOR_MAGENTA 0x05 define COLOR_RED 0x01 define COLOR_WHITE 0x07 define COLOR_YELLOW 0x03"},{"location":"ltapi/lt__logger_8c/#public-static-attributes-documentation","title":"Public Static Attributes Documentation","text":""},{"location":"ltapi/lt__logger_8c/#variable-levels","title":"variable levels","text":"
const char levels[];\n
"},{"location":"ltapi/lt__logger_8c/#variable-uart_port","title":"variable uart_port","text":"
uint32_t uart_port;\n
"},{"location":"ltapi/lt__logger_8c/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/lt__logger_8c/#function-lt_log","title":"function lt_log","text":"
void lt_log (\n    const uint8_t level,\n    const char * format,\n    ...\n) \n
"},{"location":"ltapi/lt__logger_8c/#function-lt_log_disable","title":"function lt_log_disable","text":"
void lt_log_disable () \n
"},{"location":"ltapi/lt__logger_8c/#function-lt_log_set_port","title":"function lt_log_set_port","text":"

Change log output port.

void lt_log_set_port (\n    uint8_t port\n) \n

Parameters:

  • port UART port index - can be 0, 1 or 2
"},{"location":"ltapi/lt__logger_8c/#macro-definition-documentation","title":"Macro Definition Documentation","text":""},{"location":"ltapi/lt__logger_8c/#define-color_black","title":"define COLOR_BLACK","text":"
#define COLOR_BLACK 0x00\n
"},{"location":"ltapi/lt__logger_8c/#define-color_blue","title":"define COLOR_BLUE","text":"
#define COLOR_BLUE 0x04\n
"},{"location":"ltapi/lt__logger_8c/#define-color_bright_black","title":"define COLOR_BRIGHT_BLACK","text":"
#define COLOR_BRIGHT_BLACK 0x10\n
"},{"location":"ltapi/lt__logger_8c/#define-color_bright_blue","title":"define COLOR_BRIGHT_BLUE","text":"
#define COLOR_BRIGHT_BLUE 0x14\n
"},{"location":"ltapi/lt__logger_8c/#define-color_bright_cyan","title":"define COLOR_BRIGHT_CYAN","text":"
#define COLOR_BRIGHT_CYAN 0x16\n
"},{"location":"ltapi/lt__logger_8c/#define-color_bright_green","title":"define COLOR_BRIGHT_GREEN","text":"
#define COLOR_BRIGHT_GREEN 0x12\n
"},{"location":"ltapi/lt__logger_8c/#define-color_bright_magenta","title":"define COLOR_BRIGHT_MAGENTA","text":"
#define COLOR_BRIGHT_MAGENTA 0x15\n
"},{"location":"ltapi/lt__logger_8c/#define-color_bright_red","title":"define COLOR_BRIGHT_RED","text":"
#define COLOR_BRIGHT_RED 0x11\n
"},{"location":"ltapi/lt__logger_8c/#define-color_bright_white","title":"define COLOR_BRIGHT_WHITE","text":"
#define COLOR_BRIGHT_WHITE 0x17\n
"},{"location":"ltapi/lt__logger_8c/#define-color_bright_yellow","title":"define COLOR_BRIGHT_YELLOW","text":"
#define COLOR_BRIGHT_YELLOW 0x13\n
"},{"location":"ltapi/lt__logger_8c/#define-color_cyan","title":"define COLOR_CYAN","text":"
#define COLOR_CYAN 0x06\n
"},{"location":"ltapi/lt__logger_8c/#define-color_fmt","title":"define COLOR_FMT","text":"
#define COLOR_FMT \"\\e[0;30m\"\n
"},{"location":"ltapi/lt__logger_8c/#define-color_green","title":"define COLOR_GREEN","text":"
#define COLOR_GREEN 0x02\n
"},{"location":"ltapi/lt__logger_8c/#define-color_magenta","title":"define COLOR_MAGENTA","text":"
#define COLOR_MAGENTA 0x05\n
"},{"location":"ltapi/lt__logger_8c/#define-color_red","title":"define COLOR_RED","text":"
#define COLOR_RED 0x01\n
"},{"location":"ltapi/lt__logger_8c/#define-color_white","title":"define COLOR_WHITE","text":"
#define COLOR_WHITE 0x07\n
"},{"location":"ltapi/lt__logger_8c/#define-color_yellow","title":"define COLOR_YELLOW","text":"
#define COLOR_YELLOW 0x03\n

The documentation for this class was generated from the following file cores/common/base/lt_logger.c

"},{"location":"ltapi/lt__logger_8c_source/","title":"File lt_logger.c","text":"

File List > base > lt_logger.c

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-04-28. */\n\n#include \"lt_logger.h\"\n\n#if __has_include(<sdk_private.h>)\n#include <sdk_private.h>\n#endif\n\n#if LT_HAS_PRINTF\n#include <printf/printf.h>\n#include <printf_port.h>\n#else\n#include <stdio.h>\n#endif\n\n#if (LT_LOGGER_TIMESTAMP || LT_LOGGER_TASK) && LT_HAS_FREERTOS\n#include <FreeRTOS.h>\n#include <task.h>\n#endif\n\n#define COLOR_FMT            \"\\e[0;30m\"\n#define COLOR_BLACK          0x00\n#define COLOR_RED            0x01\n#define COLOR_GREEN          0x02\n#define COLOR_YELLOW         0x03\n#define COLOR_BLUE           0x04\n#define COLOR_MAGENTA        0x05\n#define COLOR_CYAN           0x06\n#define COLOR_WHITE          0x07\n#define COLOR_BRIGHT_BLACK   0x10\n#define COLOR_BRIGHT_RED     0x11\n#define COLOR_BRIGHT_GREEN   0x12\n#define COLOR_BRIGHT_YELLOW  0x13\n#define COLOR_BRIGHT_BLUE    0x14\n#define COLOR_BRIGHT_MAGENTA 0x15\n#define COLOR_BRIGHT_CYAN    0x16\n#define COLOR_BRIGHT_WHITE   0x17\n\n#ifdef LT_UART_DEFAULT_PORT\nstatic uint32_t uart_port = LT_UART_DEFAULT_LOGGER;\n#else\nstatic uint32_t uart_port = 0;\n#endif\nstatic const char levels[] = {'V', 'D', 'I', 'W', 'E', 'F'};\n\n#if LT_LOGGER_COLOR\nstatic const uint8_t colors[] = {\n    COLOR_BRIGHT_CYAN,\n    COLOR_BRIGHT_BLUE,\n    COLOR_BRIGHT_GREEN,\n    COLOR_BRIGHT_YELLOW,\n    COLOR_BRIGHT_RED,\n    COLOR_BRIGHT_MAGENTA,\n};\n#endif\n\n#if LIBRETINY_ARDUINO\nunsigned long millis(void);\n#endif\n\n#if LT_LOGGER_CALLER\nvoid lt_log(const uint8_t level, const char *caller, const unsigned short line, const char *format, ...) {\n#else\nvoid lt_log(const uint8_t level, const char *format, ...) {\n#endif\n\n    if (uart_port == 0xFF)\n        return;\n\n#if LT_LOGGER_TIMESTAMP\n#if LIBRETINY_ARDUINO\n    float seconds = millis() / 1000.0f;\n#elif LT_HAS_FREERTOS\n    float seconds = xTaskGetTickCount() * portTICK_PERIOD_MS / 1000.0f;\n#else\n    float seconds = 0;\n#endif\n#if LT_PRINTF_BROKEN\n    char zero[4] = \"\\x00\\x30\\x30\";\n    if (seconds == 0.0f)\n        zero[0] = '0';\n#endif\n#endif\n\n#if LT_LOGGER_TASK && LT_HAS_FREERTOS\n    char task_colon   = ':';\n    TaskHandle_t task = xTaskGetCurrentTaskHandle();\n    char *task_name   = pcTaskGetTaskName(task);\n    if (!task) {\n        task_name  = \"\";\n        task_colon = '-';\n    }\n#endif\n\n#if LT_LOGGER_COLOR\n    char c_bright = '0' + (colors[level] >> 4);\n    char c_value  = '0' + (colors[level] & 0x7);\n#endif\n\n#if LT_HAS_PRINTF\n    fctprintf(\n        (void (*)(char, void *))putchar_p,\n        (void *)uart_port,\n#else\n    printf(\n#endif\n    // format:\n#if LT_LOGGER_COLOR\n        \"\\e[%c;3%cm\"\n#endif\n        \"%c \"\n#if LT_LOGGER_TIMESTAMP\n#if LT_PRINTF_BROKEN\n        \"[%11.3f%s] \"\n#else\n        \"[%11.3f] \"\n#endif\n#endif\n#if LT_LOGGER_COLOR\n        \"\\e[0m\"\n#endif\n#if LT_LOGGER_CALLER\n        \"%s():%hu: \"\n#endif\n#if LT_LOGGER_TASK && LT_HAS_FREERTOS\n        \"%s%c \"\n#endif\n        ,\n    // arguments:\n#if LT_LOGGER_COLOR\n        c_bright, // whether text is bright\n        c_value,  // text color\n#endif\n        levels[level]\n#if LT_LOGGER_TIMESTAMP\n        ,\n        seconds // float\n#if LT_PRINTF_BROKEN\n        ,\n        zero // append missing zeroes if printf \"%11.3f\" prints \"0.\"\n#endif\n#endif\n#if LT_LOGGER_CALLER\n        ,\n        caller,\n        line\n#endif\n#if LT_LOGGER_TASK && LT_HAS_FREERTOS\n        ,\n        task_name,\n        task_colon // printing outside of tasks\n#endif\n    );\n\n#if LT_HAS_PRINTF\n    va_list va_args;\n    va_start(va_args, format);\n    vfctprintf((void (*)(char, void *))putchar_p, (void *)uart_port, format, va_args);\n    va_end(va_args);\n    putchar_p('\\r', uart_port);\n    putchar_p('\\n', uart_port);\n#else\n    va_list va_args;\n    va_start(va_args, format);\n    vprintf(format, va_args);\n    va_end(va_args);\n    putchar('\\r');\n    putchar('\\n');\n#endif\n}\n\nvoid lt_log_set_port(uint8_t port) {\n    uart_port = port;\n}\n\nvoid lt_log_disable() {\n    uart_port = 0xFF;\n}\n
"},{"location":"ltapi/lt__logger_8h/","title":"File lt_logger.h","text":"

FileList > base > lt_logger.h

Go to the source code of this file.

  • #include <libretiny.h>
"},{"location":"ltapi/lt__logger_8h/#public-functions","title":"Public Functions","text":"Type Name void lt_log (const uint8_t level, const char * format, ...) void lt_log_disable () Disable LT logger. Enable it back using lt_log_set_port(LT_UART_DEFAULT_LOGGER). void void lt_log_set_port (uint8_t port) Change log output port."},{"location":"ltapi/lt__logger_8h/#macros","title":"Macros","text":"Type Name define ESP_EARLY_LOGD (...) LT_D(__VA_ARGS__) define ESP_EARLY_LOGE (...) LT_E(__VA_ARGS__) define ESP_EARLY_LOGI (...) LT_I(__VA_ARGS__) define ESP_EARLY_LOGV (...) LT_V(__VA_ARGS__) define ESP_EARLY_LOGW (...) LT_W(__VA_ARGS__) define ESP_LOGD (...) LT_D(__VA_ARGS__) define ESP_LOGE (...) LT_E(__VA_ARGS__) define ESP_LOGI (...) LT_I(__VA_ARGS__) define ESP_LOGV (...) LT_V(__VA_ARGS__) define ESP_LOGW (...) LT_W(__VA_ARGS__) define ETS_PRINTF (...) LT_I(__VA_ARGS__) define LT_D (...) LT_LOG(LT_LEVEL_DEBUG, __FUNCTION__, __LINE__, __VA_ARGS__) define LT_DM (module, ...) LT_LOGM(LT_LEVEL_DEBUG, module, __FUNCTION__, __LINE__, __VA_ARGS__) define LT_E (...) LT_LOG(LT_LEVEL_ERROR, __FUNCTION__, __LINE__, __VA_ARGS__) define LT_EM (module, ...) LT_LOGM(LT_LEVEL_ERROR, module, __FUNCTION__, __LINE__, __VA_ARGS__) define LT_ERRNO () define LT_ERRNO_LEZ (ret) define LT_ERRNO_LZ (ret) define LT_ERRNO_NZ (ret) define LT_F (...) LT_LOG(LT_LEVEL_FATAL, __FUNCTION__, __LINE__, __VA_ARGS__) define LT_FM (module, ...) LT_LOGM(LT_LEVEL_FATAL, module, __FUNCTION__, __LINE__, __VA_ARGS__) define LT_HEAP_I () define LT_I (...) LT_LOG(LT_LEVEL_INFO, __FUNCTION__, __LINE__, __VA_ARGS__) define LT_IM (module, ...) LT_LOGM(LT_LEVEL_INFO, module, __FUNCTION__, __LINE__, __VA_ARGS__) define LT_LOG (level, caller, line, ...) lt_log(level, __VA_ARGS__) define LT_LOGM (level, module, caller, line, ...) define LT_RET (ret) define LT_RET_LEZ (ret) define LT_RET_LZ (ret) define LT_RET_NZ (ret) define LT_T (...) LT_LOG(LT_LEVEL_TRACE, __FUNCTION__, __LINE__, __VA_ARGS__) define LT_TM (module, ...) LT_LOGM(LT_LEVEL_TRACE, module, __FUNCTION__, __LINE__, __VA_ARGS__) define LT_V (...) LT_LOG(LT_LEVEL_TRACE, __FUNCTION__, __LINE__, __VA_ARGS__) define LT_VM (module, ...) LT_LOGM(LT_LEVEL_TRACE, module, __FUNCTION__, __LINE__, __VA_ARGS__) define LT_W (...) LT_LOG(LT_LEVEL_WARN, __FUNCTION__, __LINE__, __VA_ARGS__) define LT_WM (module, ...) LT_LOGM(LT_LEVEL_WARN, module, __FUNCTION__, __LINE__, __VA_ARGS__) define ets_printf (...) LT_I(__VA_ARGS__) define isr_log_d (...) LT_D(__VA_ARGS__) define isr_log_e (...) LT_E(__VA_ARGS__) define isr_log_i (...) LT_I(__VA_ARGS__) define isr_log_n (...) LT_E(__VA_ARGS__) define isr_log_v (...) LT_V(__VA_ARGS__) define isr_log_w (...) LT_W(__VA_ARGS__) define log_d (...) LT_D(__VA_ARGS__) define log_e (...) LT_E(__VA_ARGS__) define log_i (...) LT_I(__VA_ARGS__) define log_n (...) LT_E(__VA_ARGS__) define log_printf (...) LT_I(__VA_ARGS__) define log_v (...) LT_V(__VA_ARGS__) define log_w (...) LT_W(__VA_ARGS__)"},{"location":"ltapi/lt__logger_8h/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/lt__logger_8h/#function-lt_log","title":"function lt_log","text":"
void lt_log (\n    const uint8_t level,\n    const char * format,\n    ...\n) \n
"},{"location":"ltapi/lt__logger_8h/#function-lt_log_disable","title":"function lt_log_disable","text":"
void lt_log_disable () \n
"},{"location":"ltapi/lt__logger_8h/#function-lt_log_set_port","title":"function lt_log_set_port","text":"

Change log output port.

void void lt_log_set_port (\n    uint8_t port\n) \n

Parameters:

  • port UART port index - can be 0, 1 or 2
"},{"location":"ltapi/lt__logger_8h/#macro-definition-documentation","title":"Macro Definition Documentation","text":""},{"location":"ltapi/lt__logger_8h/#define-esp_early_logd","title":"define ESP_EARLY_LOGD","text":"
#define ESP_EARLY_LOGD (\n    ...\n) LT_D(__VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-esp_early_loge","title":"define ESP_EARLY_LOGE","text":"
#define ESP_EARLY_LOGE (\n    ...\n) LT_E(__VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-esp_early_logi","title":"define ESP_EARLY_LOGI","text":"
#define ESP_EARLY_LOGI (\n    ...\n) LT_I(__VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-esp_early_logv","title":"define ESP_EARLY_LOGV","text":"
#define ESP_EARLY_LOGV (\n    ...\n) LT_V(__VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-esp_early_logw","title":"define ESP_EARLY_LOGW","text":"
#define ESP_EARLY_LOGW (\n    ...\n) LT_W(__VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-esp_logd","title":"define ESP_LOGD","text":"
#define ESP_LOGD (\n    ...\n) LT_D(__VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-esp_loge","title":"define ESP_LOGE","text":"
#define ESP_LOGE (\n    ...\n) LT_E(__VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-esp_logi","title":"define ESP_LOGI","text":"
#define ESP_LOGI (\n    ...\n) LT_I(__VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-esp_logv","title":"define ESP_LOGV","text":"
#define ESP_LOGV (\n    ...\n) LT_V(__VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-esp_logw","title":"define ESP_LOGW","text":"
#define ESP_LOGW (\n    ...\n) LT_W(__VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-ets_printf","title":"define ETS_PRINTF","text":"
#define ETS_PRINTF (\n    ...\n) LT_I(__VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-lt_d","title":"define LT_D","text":"
#define LT_D (\n    ...\n) LT_LOG(LT_LEVEL_DEBUG, __FUNCTION__, __LINE__, __VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-lt_dm","title":"define LT_DM","text":"
#define LT_DM (\n    module,\n    ...\n) LT_LOGM(LT_LEVEL_DEBUG, module, __FUNCTION__, __LINE__, __VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-lt_e","title":"define LT_E","text":"
#define LT_E (\n    ...\n) LT_LOG(LT_LEVEL_ERROR, __FUNCTION__, __LINE__, __VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-lt_em","title":"define LT_EM","text":"
#define LT_EM (\n    module,\n    ...\n) LT_LOGM(LT_LEVEL_ERROR, module, __FUNCTION__, __LINE__, __VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-lt_errno","title":"define LT_ERRNO","text":"
#define LT_ERRNO (\n\n) \n
"},{"location":"ltapi/lt__logger_8h/#define-lt_errno_lez","title":"define LT_ERRNO_LEZ","text":"
#define LT_ERRNO_LEZ (\n    ret\n) if (ret <= 0) {                                                                                                    \\\n        LT_E(\"errno=%d, ret=%d\", errno, ret);                                                                          \\\n        return ret;                                                                                                    \\\n    }\n
"},{"location":"ltapi/lt__logger_8h/#define-lt_errno_lz","title":"define LT_ERRNO_LZ","text":"
#define LT_ERRNO_LZ (\n    ret\n) if (ret < 0) {                                                                                                     \\\n        LT_E(\"errno=%d, ret=%d\", errno, ret);                                                                          \\\n        return ret;                                                                                                    \\\n    }\n
"},{"location":"ltapi/lt__logger_8h/#define-lt_errno_nz","title":"define LT_ERRNO_NZ","text":"
#define LT_ERRNO_NZ (\n    ret\n) if (ret) {                                                                                                         \\\n        LT_E(\"errno=%d, ret=%d\", errno, ret);                                                                          \\\n        return ret;                                                                                                    \\\n    }\n
"},{"location":"ltapi/lt__logger_8h/#define-lt_f","title":"define LT_F","text":"
#define LT_F (\n    ...\n) LT_LOG(LT_LEVEL_FATAL, __FUNCTION__, __LINE__, __VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-lt_fm","title":"define LT_FM","text":"
#define LT_FM (\n    module,\n    ...\n) LT_LOGM(LT_LEVEL_FATAL, module, __FUNCTION__, __LINE__, __VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-lt_heap_i","title":"define LT_HEAP_I","text":"
#define LT_HEAP_I (\n\n) \n
"},{"location":"ltapi/lt__logger_8h/#define-lt_i","title":"define LT_I","text":"
#define LT_I (\n    ...\n) LT_LOG(LT_LEVEL_INFO, __FUNCTION__, __LINE__, __VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-lt_im","title":"define LT_IM","text":"
#define LT_IM (\n    module,\n    ...\n) LT_LOGM(LT_LEVEL_INFO, module, __FUNCTION__, __LINE__, __VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-lt_log","title":"define LT_LOG","text":"
#define LT_LOG (\n    level,\n    caller,\n    line,\n    ...\n) lt_log(level, __VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-lt_logm","title":"define LT_LOGM","text":"
#define LT_LOGM (\n    level,\n    module,\n    caller,\n    line,\n    ...\n) do {                                                                                                               \\\n        if (LT_DEBUG_##module) {                                                                                       \\\n            lt_log(level, #module \": \" __VA_ARGS__);                                                                   \\\n        }                                                                                                              \\\n    } while (0)\n
"},{"location":"ltapi/lt__logger_8h/#define-lt_ret","title":"define LT_RET","text":"
#define LT_RET (\n    ret\n) LT_E(\"ret=%d\", ret);                                                                                               \\\n    return ret;\n
"},{"location":"ltapi/lt__logger_8h/#define-lt_ret_lez","title":"define LT_RET_LEZ","text":"
#define LT_RET_LEZ (\n    ret\n) if (ret <= 0) {                                                                                                    \\\n        LT_E(\"ret=%d\", ret);                                                                                           \\\n        return ret;                                                                                                    \\\n    }\n
"},{"location":"ltapi/lt__logger_8h/#define-lt_ret_lz","title":"define LT_RET_LZ","text":"
#define LT_RET_LZ (\n    ret\n) if (ret < 0) {                                                                                                     \\\n        LT_E(\"ret=%d\", ret);                                                                                           \\\n        return ret;                                                                                                    \\\n    }\n
"},{"location":"ltapi/lt__logger_8h/#define-lt_ret_nz","title":"define LT_RET_NZ","text":"
#define LT_RET_NZ (\n    ret\n) if (ret) {                                                                                                         \\\n        LT_E(\"ret=%d\", ret);                                                                                           \\\n        return ret;                                                                                                    \\\n    }\n
"},{"location":"ltapi/lt__logger_8h/#define-lt_t","title":"define LT_T","text":"
#define LT_T (\n    ...\n) LT_LOG(LT_LEVEL_TRACE, __FUNCTION__, __LINE__, __VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-lt_tm","title":"define LT_TM","text":"
#define LT_TM (\n    module,\n    ...\n) LT_LOGM(LT_LEVEL_TRACE, module, __FUNCTION__, __LINE__, __VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-lt_v","title":"define LT_V","text":"
#define LT_V (\n    ...\n) LT_LOG(LT_LEVEL_TRACE, __FUNCTION__, __LINE__, __VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-lt_vm","title":"define LT_VM","text":"
#define LT_VM (\n    module,\n    ...\n) LT_LOGM(LT_LEVEL_TRACE, module, __FUNCTION__, __LINE__, __VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-lt_w","title":"define LT_W","text":"
#define LT_W (\n    ...\n) LT_LOG(LT_LEVEL_WARN, __FUNCTION__, __LINE__, __VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-lt_wm","title":"define LT_WM","text":"
#define LT_WM (\n    module,\n    ...\n) LT_LOGM(LT_LEVEL_WARN, module, __FUNCTION__, __LINE__, __VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-ets_printf_1","title":"define ets_printf","text":"
#define ets_printf (\n    ...\n) LT_I(__VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-isr_log_d","title":"define isr_log_d","text":"
#define isr_log_d (\n    ...\n) LT_D(__VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-isr_log_e","title":"define isr_log_e","text":"
#define isr_log_e (\n    ...\n) LT_E(__VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-isr_log_i","title":"define isr_log_i","text":"
#define isr_log_i (\n    ...\n) LT_I(__VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-isr_log_n","title":"define isr_log_n","text":"
#define isr_log_n (\n    ...\n) LT_E(__VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-isr_log_v","title":"define isr_log_v","text":"
#define isr_log_v (\n    ...\n) LT_V(__VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-isr_log_w","title":"define isr_log_w","text":"
#define isr_log_w (\n    ...\n) LT_W(__VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-log_d","title":"define log_d","text":"
#define log_d (\n    ...\n) LT_D(__VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-log_e","title":"define log_e","text":"
#define log_e (\n    ...\n) LT_E(__VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-log_i","title":"define log_i","text":"
#define log_i (\n    ...\n) LT_I(__VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-log_n","title":"define log_n","text":"
#define log_n (\n    ...\n) LT_E(__VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-log_printf","title":"define log_printf","text":"
#define log_printf (\n    ...\n) LT_I(__VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-log_v","title":"define log_v","text":"
#define log_v (\n    ...\n) LT_V(__VA_ARGS__)\n
"},{"location":"ltapi/lt__logger_8h/#define-log_w","title":"define log_w","text":"
#define log_w (\n    ...\n) LT_W(__VA_ARGS__)\n

The documentation for this class was generated from the following file cores/common/base/lt_logger.h

"},{"location":"ltapi/lt__logger_8h_source/","title":"File lt_logger.h","text":"

File List > base > lt_logger.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-04-28. */\n\n#pragma once\n\n#include <libretiny.h>\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif // __cplusplus\n\n#if LT_LOGGER_CALLER\n#define LT_LOG(level, caller, line, ...) lt_log(level, caller, line, __VA_ARGS__)\n#define LT_LOGM(level, module, caller, line, ...)                                                                      \\\n    do {                                                                                                               \\\n        if (LT_DEBUG_##module) {                                                                                       \\\n            lt_log(level, caller, line, #module \": \" __VA_ARGS__);                                                     \\\n        }                                                                                                              \\\n    } while (0)\nvoid lt_log(const uint8_t level, const char *caller, const unsigned short line, const char *format, ...)\n    __attribute__((format(printf, 4, 5)));\n#else\n#define LT_LOG(level, caller, line, ...) lt_log(level, __VA_ARGS__)\n#define LT_LOGM(level, module, caller, line, ...)                                                                      \\\n    do {                                                                                                               \\\n        if (LT_DEBUG_##module) {                                                                                       \\\n            lt_log(level, #module \": \" __VA_ARGS__);                                                                   \\\n        }                                                                                                              \\\n    } while (0)\nvoid lt_log(const uint8_t level, const char *format, ...) __attribute__((format(printf, 2, 3)));\n#endif\n\nvoid lt_log_set_port(uint8_t port);\n\nvoid lt_log_disable();\n\n#if LT_LEVEL_TRACE >= LT_LOGLEVEL\n#define LT_T(...)          LT_LOG(LT_LEVEL_TRACE, __FUNCTION__, __LINE__, __VA_ARGS__)\n#define LT_V(...)          LT_LOG(LT_LEVEL_TRACE, __FUNCTION__, __LINE__, __VA_ARGS__)\n#define LT_TM(module, ...) LT_LOGM(LT_LEVEL_TRACE, module, __FUNCTION__, __LINE__, __VA_ARGS__)\n#define LT_VM(module, ...) LT_LOGM(LT_LEVEL_TRACE, module, __FUNCTION__, __LINE__, __VA_ARGS__)\n#else\n#define LT_T(...)\n#define LT_V(...)\n#define LT_TM(...)\n#define LT_VM(...)\n#endif\n\n#if LT_LEVEL_DEBUG >= LT_LOGLEVEL\n#define LT_D(...)          LT_LOG(LT_LEVEL_DEBUG, __FUNCTION__, __LINE__, __VA_ARGS__)\n#define LT_DM(module, ...) LT_LOGM(LT_LEVEL_DEBUG, module, __FUNCTION__, __LINE__, __VA_ARGS__)\n#else\n#define LT_D(...)\n#define LT_DM(...)\n#endif\n\n#if LT_LEVEL_INFO >= LT_LOGLEVEL\n#define LT_I(...)          LT_LOG(LT_LEVEL_INFO, __FUNCTION__, __LINE__, __VA_ARGS__)\n#define LT_IM(module, ...) LT_LOGM(LT_LEVEL_INFO, module, __FUNCTION__, __LINE__, __VA_ARGS__)\n#else\n#define LT_I(...)\n#define LT_IM(...)\n#endif\n\n#if LT_LEVEL_WARN >= LT_LOGLEVEL\n#define LT_W(...)          LT_LOG(LT_LEVEL_WARN, __FUNCTION__, __LINE__, __VA_ARGS__)\n#define LT_WM(module, ...) LT_LOGM(LT_LEVEL_WARN, module, __FUNCTION__, __LINE__, __VA_ARGS__)\n#else\n#define LT_W(...)\n#define LT_WM(...)\n#endif\n\n#if LT_LEVEL_ERROR >= LT_LOGLEVEL\n#define LT_E(...)          LT_LOG(LT_LEVEL_ERROR, __FUNCTION__, __LINE__, __VA_ARGS__)\n#define LT_EM(module, ...) LT_LOGM(LT_LEVEL_ERROR, module, __FUNCTION__, __LINE__, __VA_ARGS__)\n#else\n#define LT_E(...)\n#define LT_EM(...)\n#endif\n\n#if LT_LEVEL_FATAL >= LT_LOGLEVEL\n#define LT_F(...)          LT_LOG(LT_LEVEL_FATAL, __FUNCTION__, __LINE__, __VA_ARGS__)\n#define LT_FM(module, ...) LT_LOGM(LT_LEVEL_FATAL, module, __FUNCTION__, __LINE__, __VA_ARGS__)\n#else\n#define LT_F(...)\n#define LT_FM(...)\n#endif\n\n#if LT_LOG_HEAP && LT_HAS_FREERTOS\n#define LT_HEAP_I() LT_I(\"Free heap: %u\", LT_HEAP_FUNC());\n#else\n#define LT_HEAP_I()\n#endif\n\n// ESP32 compat\n#define log_printf(...)     LT_I(__VA_ARGS__)\n#define log_v(...)          LT_V(__VA_ARGS__)\n#define log_d(...)          LT_D(__VA_ARGS__)\n#define log_i(...)          LT_I(__VA_ARGS__)\n#define log_w(...)          LT_W(__VA_ARGS__)\n#define log_e(...)          LT_E(__VA_ARGS__)\n#define log_n(...)          LT_E(__VA_ARGS__)\n#define isr_log_v(...)      LT_V(__VA_ARGS__)\n#define isr_log_d(...)      LT_D(__VA_ARGS__)\n#define isr_log_i(...)      LT_I(__VA_ARGS__)\n#define isr_log_w(...)      LT_W(__VA_ARGS__)\n#define isr_log_e(...)      LT_E(__VA_ARGS__)\n#define isr_log_n(...)      LT_E(__VA_ARGS__)\n#define ESP_LOGV(...)       LT_V(__VA_ARGS__)\n#define ESP_LOGD(...)       LT_D(__VA_ARGS__)\n#define ESP_LOGI(...)       LT_I(__VA_ARGS__)\n#define ESP_LOGW(...)       LT_W(__VA_ARGS__)\n#define ESP_LOGE(...)       LT_E(__VA_ARGS__)\n#define ESP_EARLY_LOGV(...) LT_V(__VA_ARGS__)\n#define ESP_EARLY_LOGD(...) LT_D(__VA_ARGS__)\n#define ESP_EARLY_LOGI(...) LT_I(__VA_ARGS__)\n#define ESP_EARLY_LOGW(...) LT_W(__VA_ARGS__)\n#define ESP_EARLY_LOGE(...) LT_E(__VA_ARGS__)\n#define ets_printf(...)     LT_I(__VA_ARGS__)\n#define ETS_PRINTF(...)     LT_I(__VA_ARGS__)\n\n#define LT_RET(ret)                                                                                                    \\\n    LT_E(\"ret=%d\", ret);                                                                                               \\\n    return ret;\n\n#define LT_RET_NZ(ret)                                                                                                 \\\n    if (ret) {                                                                                                         \\\n        LT_E(\"ret=%d\", ret);                                                                                           \\\n        return ret;                                                                                                    \\\n    }\n#define LT_RET_LZ(ret)                                                                                                 \\\n    if (ret < 0) {                                                                                                     \\\n        LT_E(\"ret=%d\", ret);                                                                                           \\\n        return ret;                                                                                                    \\\n    }\n#define LT_RET_LEZ(ret)                                                                                                \\\n    if (ret <= 0) {                                                                                                    \\\n        LT_E(\"ret=%d\", ret);                                                                                           \\\n        return ret;                                                                                                    \\\n    }\n\n#define LT_ERRNO_NZ(ret)                                                                                               \\\n    if (ret) {                                                                                                         \\\n        LT_E(\"errno=%d, ret=%d\", errno, ret);                                                                          \\\n        return ret;                                                                                                    \\\n    }\n#define LT_ERRNO_LZ(ret)                                                                                               \\\n    if (ret < 0) {                                                                                                     \\\n        LT_E(\"errno=%d, ret=%d\", errno, ret);                                                                          \\\n        return ret;                                                                                                    \\\n    }\n#define LT_ERRNO_LEZ(ret)                                                                                              \\\n    if (ret <= 0) {                                                                                                    \\\n        LT_E(\"errno=%d, ret=%d\", errno, ret);                                                                          \\\n        return ret;                                                                                                    \\\n    }\n\n#if LT_LOG_ERRNO\n#define LT_ERRNO()                                                                                                     \\\n    if (errno) {                                                                                                       \\\n        LT_E(\"errno=%d\", errno);                                                                                       \\\n        errno = 0;                                                                                                     \\\n    }\n#else\n#define LT_ERRNO()\n#endif\n\n#ifdef __cplusplus\n} // extern \"C\"\n#endif\n
"},{"location":"ltapi/lt__main_8c/","title":"File lt_main.c","text":"

FileList > base > lt_main.c

Go to the source code of this file.

  • #include <libretiny.h>
  • #include <fal.h>
"},{"location":"ltapi/lt__main_8c/#public-attributes","title":"Public Attributes","text":"Type Name fal_partition_t fal_root_part = = NULL\"Root\" partition entry, representing the entire flash. Declared and initialized in lt_main.c."},{"location":"ltapi/lt__main_8c/#public-functions","title":"Public Functions","text":"Type Name void __libc_init_array (void) int lt_main (void) int main (void)"},{"location":"ltapi/lt__main_8c/#public-attributes-documentation","title":"Public Attributes Documentation","text":""},{"location":"ltapi/lt__main_8c/#variable-fal_root_part","title":"variable fal_root_part","text":"
fal_partition_t fal_root_part;\n
"},{"location":"ltapi/lt__main_8c/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/lt__main_8c/#function-__libc_init_array","title":"function __libc_init_array","text":"
void __libc_init_array (\n    void\n) \n
"},{"location":"ltapi/lt__main_8c/#function-lt_main","title":"function lt_main","text":"
int lt_main (\n    void\n) \n
"},{"location":"ltapi/lt__main_8c/#function-main","title":"function main","text":"
int main (\n    void\n) \n

The documentation for this class was generated from the following file cores/common/base/lt_main.c

"},{"location":"ltapi/lt__main_8c_source/","title":"File lt_main.c","text":"

File List > base > lt_main.c

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-06-19. */\n\n#include <libretiny.h>\n\n#include <fal.h>\n\nfal_partition_t fal_root_part = NULL;\n\n// Initialize C library\nvoid __libc_init_array(void);\n// Main app entrypoint\nint main(void);\n\nint lt_main(void) {\n    // early initialize the family and variant\n    lt_init_family();\n    lt_init_variant();\n    // print a startup banner\n    LT_BANNER();\n    // initialize C library\n    __libc_init_array();\n    // inform about the reset reason\n    LT_I(\"Reset reason: %s\", lt_get_reboot_reason_name(0));\n    // initialize FAL\n    fal_init();\n    // provide root partition\n    fal_root_part = (fal_partition_t)fal_partition_find(\"root\");\n\n    // run the application\n    return main();\n}\n
"},{"location":"ltapi/lt__pins_8h/","title":"File lt_pins.h","text":"

FileList > base > lt_pins.h

Go to the source code of this file.

"},{"location":"ltapi/lt__pins_8h/#macros","title":"Macros","text":"Type Name define LT_HW_I2C0 HAS_WIRE0 define LT_HW_I2C1 HAS_WIRE1 define LT_HW_I2C2 HAS_WIRE2 define LT_HW_SPI0 HAS_SPI0 define LT_HW_SPI1 HAS_SPI1 define LT_HW_SPI2 HAS_SPI2 define LT_HW_UART0 HAS_SERIAL0 define LT_HW_UART1 HAS_SERIAL1 define LT_HW_UART2 HAS_SERIAL2 define PIN_INVALID 255"},{"location":"ltapi/lt__pins_8h/#macro-definition-documentation","title":"Macro Definition Documentation","text":""},{"location":"ltapi/lt__pins_8h/#define-lt_hw_i2c0","title":"define LT_HW_I2C0","text":"
#define LT_HW_I2C0 HAS_WIRE0\n
"},{"location":"ltapi/lt__pins_8h/#define-lt_hw_i2c1","title":"define LT_HW_I2C1","text":"
#define LT_HW_I2C1 HAS_WIRE1\n
"},{"location":"ltapi/lt__pins_8h/#define-lt_hw_i2c2","title":"define LT_HW_I2C2","text":"
#define LT_HW_I2C2 HAS_WIRE2\n
"},{"location":"ltapi/lt__pins_8h/#define-lt_hw_spi0","title":"define LT_HW_SPI0","text":"
#define LT_HW_SPI0 HAS_SPI0\n
"},{"location":"ltapi/lt__pins_8h/#define-lt_hw_spi1","title":"define LT_HW_SPI1","text":"
#define LT_HW_SPI1 HAS_SPI1\n
"},{"location":"ltapi/lt__pins_8h/#define-lt_hw_spi2","title":"define LT_HW_SPI2","text":"
#define LT_HW_SPI2 HAS_SPI2\n
"},{"location":"ltapi/lt__pins_8h/#define-lt_hw_uart0","title":"define LT_HW_UART0","text":"
#define LT_HW_UART0 HAS_SERIAL0\n
"},{"location":"ltapi/lt__pins_8h/#define-lt_hw_uart1","title":"define LT_HW_UART1","text":"
#define LT_HW_UART1 HAS_SERIAL1\n
"},{"location":"ltapi/lt__pins_8h/#define-lt_hw_uart2","title":"define LT_HW_UART2","text":"
#define LT_HW_UART2 HAS_SERIAL2\n
"},{"location":"ltapi/lt__pins_8h/#define-pin_invalid","title":"define PIN_INVALID","text":"
#define PIN_INVALID 255\n

The documentation for this class was generated from the following file cores/common/base/lt_pins.h

"},{"location":"ltapi/lt__pins_8h_source/","title":"File lt_pins.h","text":"

File List > base > lt_pins.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2023-06-21. */\n\n#include LT_VARIANT_H\n\n#define PIN_INVALID 255\n\n#define LT_HW_UART0 HAS_SERIAL0\n#define LT_HW_UART1 HAS_SERIAL1\n#define LT_HW_UART2 HAS_SERIAL2\n#define LT_HW_I2C0  HAS_WIRE0\n#define LT_HW_I2C1  HAS_WIRE1\n#define LT_HW_I2C2  HAS_WIRE2\n#define LT_HW_SPI0  HAS_SPI0\n#define LT_HW_SPI1  HAS_SPI1\n#define LT_HW_SPI2  HAS_SPI2\n\n#if LT_HW_UART0\n#ifndef PIN_SERIAL0_RX\n#define PIN_SERIAL0_RX PIN_INVALID\n#endif\n#ifndef PIN_SERIAL0_TX\n#define PIN_SERIAL0_TX PIN_INVALID\n#endif\n#endif\n\n#if LT_HW_UART1\n#ifndef PIN_SERIAL1_RX\n#define PIN_SERIAL1_RX PIN_INVALID\n#endif\n#ifndef PIN_SERIAL1_TX\n#define PIN_SERIAL1_TX PIN_INVALID\n#endif\n#endif\n\n#if LT_HW_UART2\n#ifndef PIN_SERIAL2_RX\n#define PIN_SERIAL2_RX PIN_INVALID\n#endif\n#ifndef PIN_SERIAL2_TX\n#define PIN_SERIAL2_TX PIN_INVALID\n#endif\n#endif\n\n#if LT_HW_I2C0\n#ifndef PIN_WIRE0_SDA\n#define PIN_WIRE0_SDA PIN_INVALID\n#endif\n#ifndef PIN_WIRE0_SCL\n#define PIN_WIRE0_SCL PIN_INVALID\n#endif\n#endif\n\n#if LT_HW_I2C1\n#ifndef PIN_WIRE1_SDA\n#define PIN_WIRE1_SDA PIN_INVALID\n#endif\n#ifndef PIN_WIRE1_SCL\n#define PIN_WIRE1_SCL PIN_INVALID\n#endif\n#endif\n\n#if LT_HW_I2C2\n#ifndef PIN_WIRE2_SDA\n#define PIN_WIRE2_SDA PIN_INVALID\n#endif\n#ifndef PIN_WIRE2_SCL\n#define PIN_WIRE2_SCL PIN_INVALID\n#endif\n#endif\n
"},{"location":"ltapi/lt__posix__api_8h/","title":"File lt_posix_api.h","text":"

FileList > base > lt_posix_api.h

Go to the source code of this file.

  • #include <sys/time.h>
  • #include <time.h>
"},{"location":"ltapi/lt__posix__api_8h/#public-functions","title":"Public Functions","text":"Type Name int strcasecmp (const char * s1, const char * s2) char * strdup (const char *) int strncasecmp (const char * s1, const char * s2, size_t n) char * strptime (const char * buf, const char * fmt, struct tm * tm)"},{"location":"ltapi/lt__posix__api_8h/#public-functions-documentation","title":"Public Functions Documentation","text":""},{"location":"ltapi/lt__posix__api_8h/#function-strcasecmp","title":"function strcasecmp","text":"
int strcasecmp (\n    const char * s1,\n    const char * s2\n) \n
"},{"location":"ltapi/lt__posix__api_8h/#function-strdup","title":"function strdup","text":"
char * strdup (\n    const char *\n) \n
"},{"location":"ltapi/lt__posix__api_8h/#function-strncasecmp","title":"function strncasecmp","text":"
int strncasecmp (\n    const char * s1,\n    const char * s2,\n    size_t n\n) \n
"},{"location":"ltapi/lt__posix__api_8h/#function-strptime","title":"function strptime","text":"
char * strptime (\n    const char * buf,\n    const char * fmt,\n    struct tm * tm\n) \n

The documentation for this class was generated from the following file cores/common/base/lt_posix_api.h

"},{"location":"ltapi/lt__posix__api_8h_source/","title":"File lt_posix_api.h","text":"

File List > base > lt_posix_api.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-05-16. */\n\n#include <sys/time.h>\n#include <time.h>\n\nextern char *strdup(const char *);\nextern int strcasecmp(const char *s1, const char *s2);\nextern int strncasecmp(const char *s1, const char *s2, size_t n);\nextern char *strptime(const char *buf, const char *fmt, struct tm *tm);\n
"},{"location":"ltapi/lt__types_8h/","title":"File lt_types.h","text":"

FileList > base > lt_types.h

Go to the source code of this file.

  • #include <stdint.h>
"},{"location":"ltapi/lt__types_8h/#public-types","title":"Public Types","text":"Type Name enum lt_cpu_family_t enum lt_cpu_model_t"},{"location":"ltapi/lt__types_8h/#macros","title":"Macros","text":"Type Name define CPU_MODEL (family, chip_id) (((family >> 24) << 8) | chip_id) define CPU_MODEL_ENUM (family, chip_id) (lt_cpu_model_t) CPU_MODEL(family, chip_id)"},{"location":"ltapi/lt__types_8h/#public-types-documentation","title":"Public Types Documentation","text":""},{"location":"ltapi/lt__types_8h/#enum-lt_cpu_family_t","title":"enum lt_cpu_family_t","text":"
enum lt_cpu_family_t {\n    F_RTL8710A = 0x9FFFD543,\n    F_RTL8710B = 0x22E0D6FC,\n    F_RTL8720C = 0xE08F7564,\n    F_RTL8720D = 0x3379CFE2,\n    F_BK7231Q = 0xAFE81D49,\n    F_BK7231T = 0x675A40B0,\n    F_BK7231N = 0x7B3EF230,\n    F_BK7251 = 0x6A82CC42,\n    F_BL60X = 0xDE1270B7\n};\n
"},{"location":"ltapi/lt__types_8h/#enum-lt_cpu_model_t","title":"enum lt_cpu_model_t","text":"
enum lt_cpu_model_t {\n    RTL8710BL = CPU_MODEL(F_RTL8710B, 0xE0),\n    RTL8710BN = CPU_MODEL(F_RTL8710B, 0xFF),\n    RTL8710BU = CPU_MODEL(F_RTL8710B, 0xFE),\n    RTL8710BX = CPU_MODEL(F_RTL8710B, 0xF6),\n    RTL8710L0 = CPU_MODEL(F_RTL8710B, 0xFB),\n    RTL8711BN = CPU_MODEL(F_RTL8710B, 0xFD),\n    RTL8711BU = CPU_MODEL(F_RTL8710B, 0xFC),\n    MX1290 = RTL8710BN,\n    MX1290V2 = RTL8710BX,\n    W302 = RTL8710BN,\n    RTL8720CM = CPU_MODEL(F_RTL8720C, 0xEC),\n    RTL8720CF = CPU_MODEL(F_RTL8720C, 0xED),\n    RTL8720CX = RTL8720CM,\n    BK7231Q = CPU_MODEL(F_BK7231Q, 0x31),\n    BK7231T = CPU_MODEL(F_BK7231T, 0x1A),\n    BK7231N = CPU_MODEL(F_BK7231N, 0x1C),\n    BK7252 = CPU_MODEL(F_BK7251, 0x00),\n    BL2028N = BK7231N,\n    BK7231S = BK7231T,\n    BK7231U = BK7231T\n};\n
"},{"location":"ltapi/lt__types_8h/#macro-definition-documentation","title":"Macro Definition Documentation","text":""},{"location":"ltapi/lt__types_8h/#define-cpu_model","title":"define CPU_MODEL","text":"
#define CPU_MODEL (\n    family,\n    chip_id\n) (((family >> 24) << 8) | chip_id)\n
"},{"location":"ltapi/lt__types_8h/#define-cpu_model_enum","title":"define CPU_MODEL_ENUM","text":"
#define CPU_MODEL_ENUM (\n    family,\n    chip_id\n) (lt_cpu_model_t) CPU_MODEL(family, chip_id)\n

The documentation for this class was generated from the following file cores/common/base/lt_types.h

"},{"location":"ltapi/lt__types_8h_source/","title":"File lt_types.h","text":"

File List > base > lt_types.h

Go to the documentation of this file.

/* Copyright (c) Kuba Szczodrzy\u0144ski 2022-05-28. */\n\n#pragma once\n\n#include <stdint.h>\n\n#define CPU_MODEL(family, chip_id)      (((family >> 24) << 8) | chip_id)\n#define CPU_MODEL_ENUM(family, chip_id) (lt_cpu_model_t) CPU_MODEL(family, chip_id)\n\ntypedef enum {\n    F_RTL8710A = 0x9FFFD543, // Realtek Ameba1\n    F_RTL8710B = 0x22E0D6FC, // Realtek AmebaZ (realtek-ambz)\n    F_RTL8720C = 0xE08F7564, // Realtek AmebaZ2\n    F_RTL8720D = 0x3379CFE2, // Realtek AmebaD\n    F_BK7231Q  = 0xAFE81D49, // Beken 7231Q\n    F_BK7231T  = 0x675A40B0, // Beken 7231T\n    F_BK7231N  = 0x7B3EF230, // Beken 7231N\n    F_BK7251   = 0x6A82CC42, // Beken 7251/7252\n    F_BL60X    = 0xDE1270B7, // Boufallo 602\n} lt_cpu_family_t;\n\ntypedef enum {\n    // Realtek AmebaZ\n    // IDs copied from rtl8710b_efuse.h\n    RTL8710BL = CPU_MODEL(F_RTL8710B, 0xE0), // ???\n    RTL8710BN = CPU_MODEL(F_RTL8710B, 0xFF), // CHIPID_8710BN / QFN32\n    RTL8710BU = CPU_MODEL(F_RTL8710B, 0xFE), // CHIPID_8710BU / QFN48\n    RTL8710BX = CPU_MODEL(F_RTL8710B, 0xF6), // found on an actual RTL8710BX\n    RTL8710L0 = CPU_MODEL(F_RTL8710B, 0xFB), // CHIPID_8710BN_L0 / QFN32\n    RTL8711BN = CPU_MODEL(F_RTL8710B, 0xFD), // CHIPID_8711BN / QFN48\n    RTL8711BU = CPU_MODEL(F_RTL8710B, 0xFC), // CHIPID_8711BG / QFN68\n    MX1290    = RTL8710BN,\n    MX1290V2  = RTL8710BX,\n    W302      = RTL8710BN,\n    // Realtek AmebaZ2 (chip_id << 2 | flash_mode)\n    RTL8720CM = CPU_MODEL(F_RTL8720C, 0xEC), // 0xFB << 2 | 0\n    RTL8720CF = CPU_MODEL(F_RTL8720C, 0xED), // 0xFB << 2 | 1\n    RTL8720CX = RTL8720CM,\n    // Beken 72XX\n    BK7231Q = CPU_MODEL(F_BK7231Q, 0x31), // *SCTRL_CHIP_ID = 0x7231\n    BK7231T = CPU_MODEL(F_BK7231T, 0x1A), // *SCTRL_CHIP_ID = 0x7231a\n    BK7231N = CPU_MODEL(F_BK7231N, 0x1C), // *SCTRL_CHIP_ID = 0x7231c\n    BK7252  = CPU_MODEL(F_BK7251, 0x00),  // TODO\n    BL2028N = BK7231N,\n    BK7231S = BK7231T,\n    BK7231U = BK7231T,\n} lt_cpu_model_t;\n
"},{"location":"ltapi/namespaces/","title":"Namespace List","text":"

Here is a list of all namespaces with brief descriptions:

  • namespace arduino
  • namespace fs
  • namespace mime
"},{"location":"ltapi/classes/","title":"Class Index","text":""},{"location":"ltapi/classes/#a","title":"a","text":"
  • arduino_event_t
"},{"location":"ltapi/classes/#b","title":"b","text":"
  • base64
  • base64_decodestate
  • base64_encodestate
"},{"location":"ltapi/classes/#c","title":"c","text":"
  • cbuf
  • Cookie
"},{"location":"ltapi/classes/#e","title":"e","text":"
  • EspClass
  • EventHandler_s
  • esp_ip4_addr
  • esp_ip6_addr
  • esp_netif_ip6_info_t
  • esp_netif_ip_info_t
  • Entry (mime)
"},{"location":"ltapi/classes/#f","title":"f","text":"
  • FlashClass
  • FunctionRequestHandler
  • FS (fs)
  • FSImpl (fs)
  • File (fs)
  • FileImpl (fs)
"},{"location":"ltapi/classes/#h","title":"h","text":"
  • HTTPClient
  • HardwareI2C
  • HTTPUpload
"},{"location":"ltapi/classes/#i","title":"i","text":"
  • IPreferences
  • IWiFiClient
  • IWiFiClientSecure
  • IWiFiServer
  • IWiFiUDP
  • IPv6Address (arduino)
  • ip_event_ap_staipassigned_t
  • ip_event_got_ip6_t
  • ip_event_got_ip_t
"},{"location":"ltapi/classes/#l","title":"l","text":"
  • LibreTiny
  • LibreTinyOTA
  • LibreTinyWDT
  • LwIPClient
  • LwIPRxBuffer
  • LwIPServer
  • LwIPUDP
  • lt_flash_id_t
  • lt_ota_ctx_t
"},{"location":"ltapi/classes/#m","title":"m","text":"
  • MbedTLSClient
  • mDNS
  • MD5Context
  • mbedtls_md5_context
"},{"location":"ltapi/classes/#p","title":"p","text":"
  • PinInfo
"},{"location":"ltapi/classes/#r","title":"r","text":"
  • RequestHandler
  • RequestArgument (HTTPClient)
  • RequestArgument (WebServer)
"},{"location":"ltapi/classes/#s","title":"s","text":"
  • SerialClass
  • SoftwareSerial
  • StaticRequestHandler
  • StreamString
  • SoftData
  • SoftSerial
"},{"location":"ltapi/classes/#u","title":"u","text":"
  • UpdateClass
  • Uri
  • UriBraces
  • UriGlob
  • UriRegex
"},{"location":"ltapi/classes/#w","title":"w","text":"
  • WebServer
  • WiFiClass
  • WiFiMulti
  • WiFiMacAddr
  • WiFiNetworkInfo
  • WiFiScanAP
  • WiFiScanData
  • WifiAPlist_t
  • wifi_event_action_tx_status_t
  • wifi_event_ap_probe_req_rx_t
  • wifi_event_ap_staconnected_t
  • wifi_event_ap_stadisconnected_t
  • wifi_event_ftm_report_t
  • wifi_event_roc_done_t
  • wifi_event_sta_authmode_change_t
  • wifi_event_sta_connected_t
  • wifi_event_sta_disconnected_t
  • wifi_event_sta_scan_done_t
  • wifi_event_sta_wps_er_pin_t
  • wifi_event_sta_wps_er_success_t
  • wifi_ftm_report_entry_t
"},{"location":"ltapi/hierarchy/","title":"Class Hierarchy","text":"

This inheritance list is sorted roughly, but not completely, alphabetically:

  • class EspClass ESP Arduino Core compatibility class.
  • class FlashClass
  • class RequestHandler
  • class FunctionRequestHandler
  • class StaticRequestHandler
  • class HTTPClient
  • class IPreferences
  • class IWiFiClientSecure
  • class MbedTLSClient
  • class LibreTiny Main LibreTiny API class.
  • class LibreTinyOTA Over-the-Air updates helper class.
  • class LibreTinyWDT Watchdog control class.
  • class LwIPRxBuffer
  • class UpdateClass
  • class Uri
  • class UriBraces
  • class UriGlob
  • class UriRegex
  • class WebServer
  • class WiFiClass
  • class WiFiMulti
  • class base64
  • class cbuf
  • class fs::FS
  • class fs::FSImpl
  • class fs::FileImpl
  • class mDNS
  • struct Cookie
  • struct EventHandler_s
  • struct HTTPClient::RequestArgument
  • struct HTTPUpload
  • struct MD5Context
  • struct PinInfo
  • struct SoftData
  • struct SoftSerial
  • struct WebServer::RequestArgument
  • struct WiFiMacAddr
  • struct WiFiNetworkInfo
  • struct WiFiScanAP
  • struct WiFiScanData
  • struct WifiAPlist_t
  • struct arduino_event_t
  • struct base64_decodestate
  • struct base64_encodestate
  • struct esp_ip4_addr
  • struct esp_ip6_addr
  • struct esp_netif_ip6_info_t IPV6 IP address information.
  • struct esp_netif_ip_info_t
  • struct ip_event_ap_staipassigned_t
  • struct ip_event_got_ip6_t
  • struct ip_event_got_ip_t
  • struct lt_flash_id_t Flash chip ID structure.
  • struct lt_ota_ctx_t OTA update process context.
  • struct mbedtls_md5_context
  • struct mime::Entry
  • struct wifi_event_action_tx_status_t
  • struct wifi_event_ap_probe_req_rx_t
  • struct wifi_event_ap_staconnected_t
  • struct wifi_event_ap_stadisconnected_t
  • struct wifi_event_ftm_report_t
  • struct wifi_event_roc_done_t
  • struct wifi_event_sta_authmode_change_t
  • struct wifi_event_sta_connected_t
  • struct wifi_event_sta_disconnected_t
  • struct wifi_event_sta_scan_done_t
  • struct wifi_event_sta_wps_er_pin_t
  • struct wifi_event_sta_wps_er_success_t
  • struct wifi_ftm_report_entry_t
  • class Stream
  • class HardwareI2C
  • class StreamString
  • class fs::File
  • class Client
  • class IWiFiClient
    • class LwIPClient
    • class MbedTLSClient
  • class IWiFiClient
    • class LwIPClient
    • class MbedTLSClient
  • class IWiFiClient
    • class LwIPClient
    • class MbedTLSClient
  • class Print
  • class IWiFiServer
  • class IWiFiServer
  • class UDP
  • class IWiFiUDP
    • class LwIPUDP
  • class IWiFiUDP
    • class LwIPUDP
  • class HardwareSerial
  • class SerialClass
  • class SoftwareSerial
  • class String
  • class StreamString
  • class Printable
  • class arduino::IPv6Address
"},{"location":"ltapi/modules/","title":"Modules","text":"

Here is a list of all modules:

"},{"location":"ltapi/pages/","title":"Class List","text":"

Here are the classes, structs, unions and interfaces with brief descriptions:

"},{"location":"ltapi/class_members/","title":"Class Members","text":""},{"location":"ltapi/class_members/#a","title":"a","text":"
  • addHeader (HTTPClient)
  • available (HardwareI2C, IWiFiServer, IWiFiUDP, LwIPClient, LwIPRxBuffer, LwIPUDP, MbedTLSClient, SerialClass, SoftwareSerial, StreamString, cbuf, fs::File)
  • accept (IWiFiServer, LwIPServer)
  • abort (UpdateClass)
  • addHandler (WebServer)
  • arg (WebServer)
  • argName (WebServer)
  • args (WebServer)
  • authenticate (WebServer)
  • addr (WiFiMacAddr, esp_ip4_addr, esp_ip6_addr)
  • APlist (WiFiMulti)
  • addAP (WiFiMulti)
  • auth (WiFiNetworkInfo, WiFiScanAP)
  • ap (WiFiScanData)
  • addService (mDNS)
  • addServiceImpl (mDNS)
  • addServiceTxt (mDNS)
  • addServiceTxtImpl (mDNS)
  • aid (wifi_event_ap_staconnected_t, wifi_event_ap_stadisconnected_t)
  • authmode (wifi_event_sta_connected_t)
  • ap_cred (wifi_event_sta_wps_er_success_t)
  • ap_cred_cnt (wifi_event_sta_wps_er_success_t)
"},{"location":"ltapi/class_members/#b","title":"b","text":"
  • begin (HTTPClient, HardwareI2C, IPreferences, IWiFiServer, IWiFiUDP, LwIPServer, LwIPUDP, SerialClass, SoftwareSerial, UpdateClass, WebServer, WiFiClass, mDNS)
  • beginInternal (HTTPClient)
  • buf (HTTPUpload, MD5Context, SerialClass, SoftData, lt_ota_ctx_t)
  • beginTransmission (HardwareI2C)
  • beginMulticast (IWiFiUDP, LwIPUDP)
  • beginMulticastPacket (IWiFiUDP, LwIPUDP)
  • beginPacket (IWiFiUDP, LwIPUDP)
  • bits (MD5Context)
  • baudrate (SerialClass)
  • byte (SoftData)
  • BSSID (WiFiClass)
  • BSSIDstr (WiFiClass)
  • broadcastIP (WiFiClass)
  • bssid (WiFiNetworkInfo, WiFiScanAP, wifi_event_sta_connected_t, wifi_event_sta_disconnected_t)
  • bytes (arduino::IPv6Address)
  • buf_pos (lt_ota_ctx_t)
  • bytes_total (lt_ota_ctx_t)
  • bytes_written (lt_ota_ctx_t)
  • buffer (mbedtls_md5_context)
"},{"location":"ltapi/class_members/#c","title":"c","text":"
  • cb (EventHandler_s)
  • canHandle (FunctionRequestHandler, RequestHandler, StaticRequestHandler, Uri, UriBraces, UriGlob, UriRegex)
  • canUpload (FunctionRequestHandler, RequestHandler)
  • clear (HTTPClient, IPreferences)
  • clearAllCookies (HTTPClient)
  • collectHeaders (HTTPClient, WebServer)
  • connect (HTTPClient, IWiFiClient, IWiFiClientSecure, LwIPClient, MbedTLSClient)
  • connected (HTTPClient, LwIPClient)
  • currentSize (HTTPUpload)
  • close (IWiFiServer, WebServer, fs::File, fs::FileImpl)
  • canRollback (LibreTinyOTA)
  • config (SerialClass, WiFiClass)
  • configure (SerialClass)
  • callback (UpdateClass, lt_ota_ctx_t)
  • canRollBack (UpdateClass)
  • cleanup (UpdateClass)
  • clearError (UpdateClass)
  • ctx (UpdateClass)
  • clone (Uri, UriBraces, UriGlob, UriRegex)
  • client (WebServer)
  • calculateBroadcast (WiFiClass)
  • calculateNetworkID (WiFiClass)
  • calculateSubnetCIDR (WiFiClass)
  • channel (WiFiClass, WiFiNetworkInfo, WiFiScanAP, wifi_event_sta_connected_t)
  • count (WiFiScanData)
  • cbuf (cbuf)
  • chip_id (lt_flash_id_t)
  • chip_size_id (lt_flash_id_t)
  • callback_param (lt_ota_ctx_t)
  • context (wifi_event_action_tx_status_t, wifi_event_roc_done_t)
"},{"location":"ltapi/class_members/#d","title":"d","text":"
  • date (Cookie)
  • domain (Cookie)
  • duration (Cookie)
  • disconnect (HTTPClient, WiFiClass)
  • disable (LibreTinyWDT)
  • data (PinInfo, SerialClass, SoftwareSerial, WiFiClass)
  • dataFree (WiFiClass)
  • dataInitialize (WiFiClass)
  • dnsIP (WiFiClass)
  • dns1 (WiFiNetworkInfo)
  • dns2 (WiFiNetworkInfo)
  • dword (arduino::IPv6Address)
  • da (wifi_event_action_tx_status_t)
  • dist_est (wifi_event_ftm_report_t)
  • dlog_token (wifi_ftm_report_entry_t)
"},{"location":"ltapi/class_members/#e","title":"e","text":"
  • expires (Cookie)
  • EventHandler_s (EventHandler_s)
  • eventId (EventHandler_s)
  • eraseSector (FlashClass)
  • end (HTTPClient, HardwareI2C, IPreferences, IWiFiServer, LwIPServer, SerialClass, SoftwareSerial, UpdateClass, mDNS)
  • errorToString (HTTPClient)
  • endTransmission (HardwareI2C)
  • endPacket (IWiFiUDP, LwIPUDP)
  • enable (LibreTinyWDT)
  • enabled (PinInfo)
  • endTx (SoftwareSerial)
  • errArd (UpdateClass)
  • errUf2 (UpdateClass)
  • errorString (UpdateClass)
  • enableCORS (WebServer)
  • enableCrossOrigin (WebServer)
  • enableDelay (WebServer)
  • enableAP (WiFiClass)
  • enableIpV6 (WiFiClass)
  • enableSTA (WiFiClass)
  • encryptionType (WiFiClass)
  • event_id (arduino_event_t)
  • event_info (arduino_event_t)
  • encode (base64)
  • empty (cbuf)
  • exists (fs::FS, fs::FSImpl)
  • esp_netif (ip_event_got_ip6_t, ip_event_got_ip_t)
  • error (lt_ota_ctx_t)
  • endsWith (mime::Entry)
"},{"location":"ltapi/class_members/#f","title":"f","text":"
  • flashEraseSector (EspClass)
  • flashRead (EspClass)
  • flashWrite (EspClass)
  • fcb (EventHandler_s)
  • FunctionRequestHandler (FunctionRequestHandler)
  • filename (HTTPUpload)
  • flush (HardwareI2C, IWiFiUDP, LwIPClient, LwIPUDP, MbedTLSClient, SerialClass, SoftwareSerial, StreamString, cbuf, fs::File, fs::FileImpl)
  • freeEntries (IPreferences)
  • fd (IWiFiClient, LwIPClient)
  • feed (LibreTinyWDT)
  • failed (LwIPRxBuffer)
  • fillBuffer (LwIPRxBuffer)
  • fromString (arduino::IPv6Address)
  • full (cbuf)
  • FS (fs::FS)
  • FSImpl (fs::FSImpl)
  • File (fs::File)
  • ftm_report_data (wifi_event_ftm_report_t)
  • ftm_report_num_entries (wifi_event_ftm_report_t)
"},{"location":"ltapi/class_members/#g","title":"g","text":"
  • getBootMode (EspClass)
  • getBootVersion (EspClass)
  • getChipId (EspClass, FlashClass, LibreTiny)
  • getCoreVersion (EspClass)
  • getCpuFreqMHz (EspClass, LibreTiny)
  • getCycleCount (EspClass, LibreTiny)
  • getFlashChipId (EspClass, LibreTiny)
  • getFlashChipMode (EspClass)
  • getFlashChipRealSize (EspClass)
  • getFlashChipSize (EspClass, LibreTiny)
  • getFlashChipSizeByChipId (EspClass)
  • getFlashChipVendorId (EspClass)
  • getFreeHeap (EspClass, LibreTiny)
  • getFullVersion (EspClass)
  • getMaxFreeBlockSize (EspClass, LibreTiny)
  • getResetInfo (EspClass)
  • getResetReason (EspClass, LibreTiny)
  • getSdkVersion (EspClass)
  • getVcc (EspClass)
  • getSize (FlashClass, HTTPClient)
  • GET (HTTPClient)
  • generateCookieString (HTTPClient)
  • getLocation (HTTPClient)
  • getStream (HTTPClient)
  • getStreamPtr (HTTPClient)
  • getClock (HardwareI2C)
  • getBool (IPreferences)
  • getBytes (IPreferences)
  • getBytesLength (IPreferences)
  • getChar (IPreferences)
  • getDouble (IPreferences)
  • getFloat (IPreferences)
  • getInt (IPreferences)
  • getLong (IPreferences)
  • getLong64 (IPreferences)
  • getShort (IPreferences)
  • getString (IPreferences)
  • getType (IPreferences, LibreTinyOTA)
  • getUChar (IPreferences)
  • getUInt (IPreferences)
  • getULong (IPreferences)
  • getULong64 (IPreferences)
  • getUShort (IPreferences)
  • getFingerprintSHA256 (IWiFiClientSecure, MbedTLSClient)
  • getNoDelay (IWiFiServer, LwIPServer)
  • getBoard (LibreTiny)
  • getChipCoreType (LibreTiny)
  • getChipCores (LibreTiny)
  • getChipFamily (LibreTiny)
  • getChipFamilyName (LibreTiny)
  • getChipModel (LibreTiny)
  • getChipType (LibreTiny)
  • getCpuFreq (LibreTiny)
  • getDeviceName (LibreTiny)
  • getHeapSize (LibreTiny)
  • getMaxAllocHeap (LibreTiny)
  • getMinFreeHeap (LibreTiny)
  • getRamSize (LibreTiny)
  • getResetReasonName (LibreTiny)
  • getVersion (LibreTiny)
  • gpioRecover (LibreTiny)
  • getCurrentIndex (LibreTinyOTA)
  • getStoredIndex (LibreTinyOTA)
  • getUF2Scheme (LibreTinyOTA)
  • gpio (PinInfo)
  • getContentType (StaticRequestHandler)
  • getBoardName (UpdateClass)
  • getError (UpdateClass)
  • getErrorCode (UpdateClass)
  • getFirmwareName (UpdateClass)
  • getFirmwareVersion (UpdateClass)
  • getLibreTinyVersion (UpdateClass)
  • getUF2Error (UpdateClass)
  • gatewayIP (WiFiClass)
  • getAutoReconnect (WiFiClass)
  • getEncryption (WiFiClass)
  • getHostname (WiFiClass)
  • getMode (WiFiClass)
  • getNetworkInfo (WiFiClass)
  • getSleep (WiFiClass)
  • getTxPower (WiFiClass)
  • gateway (WiFiNetworkInfo)
  • gw (esp_netif_ip_info_t)
  • getLastWrite (fs::File, fs::FileImpl)
"},{"location":"ltapi/class_members/#h","title":"h","text":"
  • host (Cookie)
  • http_only (Cookie)
  • handle (FunctionRequestHandler, RequestHandler, StaticRequestHandler)
  • HTTPClient (HTTPClient)
  • handleHeaderResponse (HTTPClient)
  • hasHeader (HTTPClient, WebServer)
  • header (HTTPClient, WebServer)
  • headerName (HTTPClient, WebServer)
  • headers (HTTPClient, WebServer)
  • hasClient (IWiFiServer, LwIPServer)
  • hasError (UpdateClass)
  • handleClient (WebServer)
  • hasArg (WebServer)
  • hostHeader (WebServer)
  • handlers (WiFiClass)
  • hostByName (WiFiClass)
  • hostname (WiFiClass, mDNS)
  • hasTxt (mDNS)
"},{"location":"ltapi/class_members/#i","title":"i","text":"
  • id (EventHandler_s)
  • IPreferences (IPreferences)
  • isKey (IPreferences)
  • IWiFiClient (IWiFiClient)
  • IWiFiServer (IWiFiServer)
  • IWiFiUDP (IWiFiUDP)
  • isValid (LibreTinyOTA)
  • in (MD5Context)
  • init (MbedTLSClient)
  • invert (SoftSerial)
  • isFinished (UpdateClass)
  • isRunning (UpdateClass)
  • initPathArgs (Uri, UriBraces, UriRegex)
  • isConnected (WiFiClass)
  • IPv6Address (arduino::IPv6Address)
  • ip (esp_netif_ip6_info_t, esp_netif_ip_info_t, ip_event_ap_staipassigned_t)
  • isDirectory (fs::File, fs::FileImpl)
  • if_index (ip_event_got_ip6_t, ip_event_got_ip_t)
  • ip6_info (ip_event_got_ip6_t)
  • ip_index (ip_event_got_ip6_t)
  • ip_changed (ip_event_got_ip_t)
  • ip_info (ip_event_got_ip_t)
  • info (lt_ota_ctx_t)
  • IP (mDNS)
  • IPv6 (mDNS)
  • instanceName (mDNS)
  • ifx (wifi_event_action_tx_status_t)
  • is_mesh_child (wifi_event_ap_staconnected_t, wifi_event_ap_stadisconnected_t)
"},{"location":"ltapi/class_members/#k","title":"k","text":"
  • key (HTTPClient::RequestArgument, WebServer::RequestArgument)
"},{"location":"ltapi/class_members/#l","title":"l","text":"
  • lastId (EventHandler_s)
  • localIP (IWiFiClient, LwIPClient, WiFiClass, WiFiNetworkInfo)
  • localPort (IWiFiClient, LwIPClient)
  • lastError (IWiFiClientSecure, MbedTLSClient)
  • loadCACert (IWiFiClientSecure, MbedTLSClient)
  • loadCertificate (IWiFiClientSecure, MbedTLSClient)
  • loadPrivateKey (IWiFiClientSecure, MbedTLSClient)
  • listenOnLocalhost (IWiFiServer)
  • LwIPClient (LwIPClient)
  • LwIPRxBuffer (LwIPRxBuffer)
  • LwIPServer (LwIPServer)
  • LwIPUDP (LwIPUDP)
  • localIPv6 (WiFiClass)
"},{"location":"ltapi/class_members/#m","title":"m","text":"
  • max_age (Cookie)
  • multicast_ip (LwIPUDP)
  • MbedTLSClient (MbedTLSClient)
  • md5 (UpdateClass)
  • md5Ctx (UpdateClass)
  • md5Digest (UpdateClass)
  • md5Expected (UpdateClass)
  • md5String (UpdateClass)
  • method (WebServer)
  • macAddress (WiFiClass)
  • macToString (WiFiClass)
  • mode (WiFiClass)
  • modePriv (WiFiClass)
  • mkdir (fs::FS, fs::FSImpl)
  • manufacturer_id (lt_flash_id_t)
  • mDNS (mDNS)
  • mimeType (mime::Entry)
  • mac (wifi_event_ap_probe_req_rx_t, wifi_event_ap_staconnected_t, wifi_event_ap_stadisconnected_t)
"},{"location":"ltapi/class_members/#n","title":"n","text":"
  • name (Cookie, HTTPUpload, fs::File, fs::FileImpl)
  • next (RequestHandler, cbuf)
  • networkID (WiFiClass)
  • netmask (esp_netif_ip_info_t)
  • numTxt (mDNS)
  • new_mode (wifi_event_sta_authmode_change_t)
  • number (wifi_event_sta_scan_done_t)
"},{"location":"ltapi/class_members/#o","title":"o","text":"
  • onReceive (HardwareI2C)
  • onReceiveCallback (HardwareI2C)
  • onRequest (HardwareI2C)
  • onRequestCallback (HardwareI2C)
  • operator bool (IWiFiClient, IWiFiServer, LwIPServer, SerialClass, SoftwareSerial, fs::File, fs::FileImpl)
  • operator!= (IWiFiClient)
  • operator== (IWiFiClient, arduino::IPv6Address)
  • operator= (LwIPClient, arduino::IPv6Address)
  • onProgress (UpdateClass)
  • on (WebServer)
  • onFileUpload (WebServer)
  • onNotFound (WebServer)
  • onEvent (WiFiClass)
  • operator const uint32_t * (arduino::IPv6Address)
  • operator const uint8_t * (arduino::IPv6Address)
  • operator[] (arduino::IPv6Address)
  • open (fs::FS, fs::FSImpl)
  • openNextFile (fs::File, fs::FileImpl)
  • old_mode (wifi_event_sta_authmode_change_t)
"},{"location":"ltapi/class_members/#p","title":"p","text":"
  • path (Cookie, fs::File, fs::FileImpl)
  • PATCH (HTTPClient)
  • POST (HTTPClient)
  • PUT (HTTPClient)
  • peek (HardwareI2C, IWiFiUDP, LwIPClient, LwIPRxBuffer, LwIPUDP, MbedTLSClient, SerialClass, SoftwareSerial, StreamString, cbuf, fs::File)
  • putBool (IPreferences)
  • putBytes (IPreferences)
  • putChar (IPreferences)
  • putDouble (IPreferences)
  • putFloat (IPreferences)
  • putInt (IPreferences)
  • putLong (IPreferences)
  • putLong64 (IPreferences)
  • putShort (IPreferences)
  • putString (IPreferences)
  • putUChar (IPreferences)
  • putUInt (IPreferences)
  • putULong (IPreferences)
  • putULong64 (IPreferences)
  • putUShort (IPreferences)
  • parsePacket (IWiFiUDP, LwIPUDP)
  • pathArg (RequestHandler, WebServer)
  • pathArgs (RequestHandler)
  • port (SerialClass, mDNS)
  • param (SoftData, SoftSerial, SoftwareSerial)
  • pin (SoftData)
  • printError (UpdateClass)
  • printErrorContext (UpdateClass)
  • progress (UpdateClass)
  • progressHandler (UpdateClass)
  • postEvent (WiFiClass)
  • printDiag (WiFiClass)
  • psk (WiFiClass)
  • password (WiFiNetworkInfo)
  • passphrase (WifiAPlist_t, wifi_event_sta_wps_er_success_t)
  • printTo (arduino::IPv6Address)
  • plainchar (base64_decodestate)
  • position (fs::File, fs::FileImpl)
  • peer_mac (wifi_event_ftm_report_t)
  • pin_code (wifi_event_sta_wps_er_pin_t)
"},{"location":"ltapi/class_members/#q","title":"q","text":"
  • queryHost (mDNS)
  • queryService (mDNS)
"},{"location":"ltapi/class_members/#r","title":"r","text":"
  • random (EspClass)
  • rebootIntoUartDownloadMode (EspClass)
  • reset (EspClass)
  • restart (EspClass, LibreTiny)
  • readBlock (FlashClass)
  • resetCookieJar (HTTPClient)
  • returnError (HTTPClient)
  • read (HardwareI2C, IWiFiUDP, LwIPClient, LwIPRxBuffer, LwIPUDP, MbedTLSClient, SerialClass, SoftwareSerial, StreamString, cbuf, fs::File, fs::FileImpl)
  • requestFrom (HardwareI2C)
  • remove (IPreferences, cbuf, fs::FS, fs::FSImpl)
  • remoteIP (IWiFiClient, IWiFiUDP, LwIPClient, LwIPUDP)
  • remotePort (IWiFiClient, IWiFiUDP, LwIPClient, LwIPUDP)
  • restartDownloadMode (LibreTiny)
  • r_available (LwIPRxBuffer)
  • remote_ip (LwIPUDP)
  • remote_port (LwIPUDP)
  • rx_buffer (LwIPUDP)
  • rx (SerialClass, SoftSerial)
  • remaining (UpdateClass)
  • rollBack (UpdateClass)
  • requestAuthentication (WebServer)
  • RSSI (WiFiClass)
  • reconnect (WiFiClass)
  • removeEvent (WiFiClass)
  • resetNetworkInfo (WiFiClass)
  • restoreAPConfig (WiFiClass)
  • restoreSTAConfig (WiFiClass)
  • run (WiFiMulti)
  • rssi (WiFiScanAP, wifi_event_ap_probe_req_rx_t, wifi_ftm_report_entry_t)
  • running (WiFiScanData, lt_ota_ctx_t)
  • raw_address (arduino::IPv6Address)
  • result (base64_encodestate)
  • resize (cbuf)
  • resizeAdd (cbuf)
  • room (cbuf)
  • rename (fs::FS, fs::FSImpl)
  • rmdir (fs::FS, fs::FSImpl)
  • readBytes (fs::File)
  • rewindDirectory (fs::File, fs::FileImpl)
  • rtt_est (wifi_event_ftm_report_t)
  • rtt_raw (wifi_event_ftm_report_t)
  • reason (wifi_event_sta_disconnected_t)
  • rtt (wifi_ftm_report_entry_t)
"},{"location":"ltapi/class_members/#s","title":"s","text":"
  • secure (Cookie)
  • scb (EventHandler_s)
  • sendHeader (HTTPClient, WebServer)
  • sendRequest (HTTPClient)
  • setAuthorization (HTTPClient)
  • setAuthorizationType (HTTPClient)
  • setConnectTimeout (HTTPClient)
  • setCookie (HTTPClient)
  • setCookieJar (HTTPClient)
  • setFollowRedirects (HTTPClient)
  • setRedirectLimit (HTTPClient)
  • setReuse (HTTPClient)
  • setTimeout (HTTPClient, IWiFiClient, IWiFiServer, LwIPClient, LwIPServer)
  • setURL (HTTPClient)
  • setUserAgent (HTTPClient)
  • status (HTTPUpload, WiFiClass, wifi_event_action_tx_status_t, wifi_event_ftm_report_t, wifi_event_sta_scan_done_t)
  • setClock (HardwareI2C)
  • setPins (HardwareI2C)
  • socket (IWiFiClient, LwIPClient)
  • setAlpnProtocols (IWiFiClientSecure, MbedTLSClient)
  • setCACert (IWiFiClientSecure, MbedTLSClient)
  • setCertificate (IWiFiClientSecure, MbedTLSClient)
  • setHandshakeTimeout (IWiFiClientSecure, MbedTLSClient)
  • setInsecure (IWiFiClientSecure, MbedTLSClient)
  • setPreSharedKey (IWiFiClientSecure, MbedTLSClient)
  • setPrivateKey (IWiFiClientSecure, MbedTLSClient)
  • setNoDelay (IWiFiServer, LwIPServer)
  • stop (IWiFiServer, IWiFiUDP, LwIPClient, LwIPUDP, MbedTLSClient, WebServer)
  • stopAll (IWiFiServer, LwIPServer)
  • switchImage (LibreTinyOTA)
  • server_port (LwIPUDP)
  • supported (PinInfo)
  • SerialClass (SerialClass)
  • state (SoftData, mbedtls_md5_context)
  • SoftwareSerial (SoftwareSerial)
  • startTx (SoftwareSerial)
  • StaticRequestHandler (StaticRequestHandler)
  • setMD5 (UpdateClass)
  • size (UpdateClass, cbuf, fs::File, fs::FileImpl)
  • send (WebServer)
  • sendContent (WebServer)
  • sendContent_P (WebServer)
  • send_P (WebServer)
  • serveStatic (WebServer)
  • setContentLength (WebServer)
  • streamFile (WebServer)
  • SSID (WiFiClass)
  • scan (WiFiClass)
  • scanAlloc (WiFiClass)
  • scanComplete (WiFiClass)
  • scanDelete (WiFiClass)
  • scanInit (WiFiClass)
  • scanNetworks (WiFiClass)
  • setAutoReconnect (WiFiClass)
  • setHostname (WiFiClass)
  • setMacAddress (WiFiClass)
  • setSleep (WiFiClass)
  • setTxPower (WiFiClass)
  • softAP (WiFiClass)
  • softAPBroadcastIP (WiFiClass)
  • softAPConfig (WiFiClass)
  • softAPIP (WiFiClass)
  • softAPIPv6 (WiFiClass)
  • softAPNetworkID (WiFiClass)
  • softAPSSID (WiFiClass)
  • softAPSubnetCIDR (WiFiClass)
  • softAPSubnetMask (WiFiClass)
  • softAPdisconnect (WiFiClass)
  • softAPenableIpV6 (WiFiClass)
  • softAPgetHostname (WiFiClass)
  • softAPgetStationNum (WiFiClass)
  • softAPmacAddress (WiFiClass)
  • softAPsetHostname (WiFiClass)
  • subnetCIDR (WiFiClass)
  • subnetMask (WiFiClass)
  • ssid (WiFiNetworkInfo, WiFiScanAP, WifiAPlist_t, wifi_event_sta_connected_t, wifi_event_sta_disconnected_t, wifi_event_sta_wps_er_success_t)
  • ssidHidden (WiFiNetworkInfo)
  • subnet (WiFiNetworkInfo)
  • step (base64_decodestate, base64_encodestate)
  • stepcount (base64_encodestate)
  • seek (fs::File, fs::FileImpl)
  • setBufferSize (fs::File, fs::FileImpl)
  • setInstanceName (mDNS)
  • ssid_len (wifi_event_sta_connected_t, wifi_event_sta_disconnected_t)
  • scan_id (wifi_event_sta_scan_done_t)
"},{"location":"ltapi/class_members/#t","title":"t","text":"
  • totalSize (HTTPUpload)
  • type (HTTPUpload)
  • tx_buffer (LwIPUDP)
  • tx_buffer_len (LwIPUDP)
  • tx (SerialClass, SoftSerial)
  • THandlerFunction_Progress (UpdateClass)
  • THandlerFunction (WebServer)
  • timeout (WiFiScanData)
  • toString (arduino::IPv6Address)
  • txt (mDNS)
  • txtKey (mDNS)
  • total (mbedtls_md5_context)
  • t1 (wifi_ftm_report_entry_t)
  • t2 (wifi_ftm_report_entry_t)
  • t3 (wifi_ftm_report_entry_t)
  • t4 (wifi_ftm_report_entry_t)
"},{"location":"ltapi/class_members/#u","title":"u","text":"
  • upload (FunctionRequestHandler, RequestHandler, WebServer)
  • useHTTP10 (HTTPClient)
  • udp_server (LwIPUDP)
  • Uri (Uri)
  • UriBraces (UriBraces)
  • UriGlob (UriGlob)
  • UriRegex (UriRegex)
  • uri (WebServer)
  • urlDecode (WebServer)
  • uf2 (lt_ota_ctx_t)
"},{"location":"ltapi/class_members/#v","title":"v","text":"
  • valid (Cookie)
  • value (Cookie, HTTPClient::RequestArgument, WebServer::RequestArgument)
  • verify (IWiFiClientSecure, MbedTLSClient)
  • validate (WiFiClass)
"},{"location":"ltapi/class_members/#w","title":"w","text":"
  • wdtDisable (EspClass)
  • wdtEnable (EspClass)
  • wdtFeed (EspClass)
  • writeBlock (FlashClass)
  • writeToStream (HTTPClient)
  • writeToStreamDataBlock (HTTPClient)
  • write (HardwareI2C, IWiFiClient, IWiFiServer, IWiFiUDP, LwIPClient, LwIPServer, LwIPUDP, MbedTLSClient, SerialClass, SoftwareSerial, StreamString, UpdateClass, cbuf, fs::File, fs::FileImpl)
  • write_P (IWiFiClient)
  • writeStream (UpdateClass)
  • WebServer (WebServer)
  • WiFiClass (WiFiClass)
  • waitForConnectResult (WiFiClass)
  • WiFiMulti (WiFiMulti)
  • wrap_if_bufend (cbuf)
"},{"location":"ltapi/class_members/#z","title":"z","text":"
  • zone (esp_ip6_addr)
"},{"location":"ltapi/class_members/#_1","title":"~","text":"
  • ~FunctionRequestHandler (FunctionRequestHandler)
  • ~HTTPClient (HTTPClient)
  • ~IPreferences (IPreferences)
  • ~IWiFiClient (IWiFiClient)
  • ~IWiFiServer (IWiFiServer)
  • ~IWiFiUDP (IWiFiUDP)
  • ~LwIPClient (LwIPClient)
  • ~LwIPRxBuffer (LwIPRxBuffer)
  • ~LwIPUDP (LwIPUDP)
  • ~MbedTLSClient (MbedTLSClient)
  • ~RequestHandler (RequestHandler)
  • ~Uri (Uri)
  • ~WebServer (WebServer)
  • ~WiFiClass (WiFiClass)
  • ~WiFiMulti (WiFiMulti)
  • ~IPv6Address (arduino::IPv6Address)
  • ~cbuf (cbuf)
  • ~FSImpl (fs::FSImpl)
  • ~FileImpl (fs::FileImpl)
  • ~mDNS (mDNS)
"},{"location":"ltapi/class_members/#_","title":"_","text":"
  • _fn (FunctionRequestHandler)
  • _method (FunctionRequestHandler)
  • _ufn (FunctionRequestHandler)
  • _uri (FunctionRequestHandler, HTTPClient, StaticRequestHandler, Uri)
  • _authorizationType (HTTPClient)
  • _base64Authorization (HTTPClient)
  • _canReuse (HTTPClient)
  • _client (HTTPClient)
  • _connectTimeout (HTTPClient)
  • _cookieJar (HTTPClient)
  • _currentHeaders (HTTPClient, WebServer)
  • _followRedirects (HTTPClient)
  • _headerKeysCount (HTTPClient, WebServer)
  • _headers (HTTPClient)
  • _host (HTTPClient)
  • _location (HTTPClient)
  • _port (HTTPClient, LwIPServer)
  • _protocol (HTTPClient)
  • _redirectLimit (HTTPClient)
  • _returnCode (HTTPClient)
  • _reuse (HTTPClient)
  • _secure (HTTPClient)
  • _size (HTTPClient, LwIPRxBuffer, cbuf)
  • _tcpDeprecated (HTTPClient)
  • _tcpTimeout (HTTPClient)
  • _transferEncoding (HTTPClient)
  • _transportTraits (HTTPClient)
  • _useHTTP10 (HTTPClient)
  • _userAgent (HTTPClient)
  • _freq (HardwareI2C)
  • _scl (HardwareI2C)
  • _sda (HardwareI2C)
  • _connected (LwIPClient)
  • _rxBuffer (LwIPClient)
  • _sock (LwIPClient, LwIPRxBuffer, LwIPServer)
  • _buffer (LwIPRxBuffer)
  • _failed (LwIPRxBuffer)
  • _fill (LwIPRxBuffer)
  • _pos (LwIPRxBuffer)
  • _active (LwIPServer)
  • _addr (LwIPServer)
  • _maxClients (LwIPServer)
  • _noDelay (LwIPServer)
  • _sockAccepted (LwIPServer)
  • _alpnProtocols (MbedTLSClient)
  • _caCert (MbedTLSClient)
  • _caCertStr (MbedTLSClient)
  • _clientCert (MbedTLSClient)
  • _clientCertStr (MbedTLSClient)
  • _clientKey (MbedTLSClient)
  • _clientKeyStr (MbedTLSClient)
  • _handshakeTimeout (MbedTLSClient)
  • _insecure (MbedTLSClient)
  • _peeked (MbedTLSClient)
  • _pskIdentStr (MbedTLSClient)
  • _pskStr (MbedTLSClient)
  • _sockTls (MbedTLSClient)
  • _sslCfg (MbedTLSClient)
  • _sslCtx (MbedTLSClient)
  • _useRootCA (MbedTLSClient)
  • _next (RequestHandler)
  • _baseUriLength (StaticRequestHandler)
  • _cache_header (StaticRequestHandler)
  • _fs (StaticRequestHandler)
  • _isFile (StaticRequestHandler)
  • _path (StaticRequestHandler)
  • _addRequestHandler (WebServer)
  • _chunked (WebServer)
  • _collectHeader (WebServer)
  • _contentLength (WebServer)
  • _corsEnabled (WebServer)
  • _currentArgCount (WebServer)
  • _currentArgs (WebServer)
  • _currentClient (WebServer)
  • _currentClientWrite (WebServer)
  • _currentClientWrite_P (WebServer)
  • _currentHandler (WebServer)
  • _currentMethod (WebServer)
  • _currentStatus (WebServer)
  • _currentUpload (WebServer)
  • _currentUri (WebServer)
  • _currentVersion (WebServer)
  • _extractParam (WebServer)
  • _fileUploadHandler (WebServer)
  • _finalizeResponse (WebServer)
  • _firstHandler (WebServer)
  • _getRandomHexString (WebServer)
  • _handleRequest (WebServer)
  • _hostHeader (WebServer)
  • _lastHandler (WebServer)
  • _notFoundHandler (WebServer)
  • _nullDelay (WebServer)
  • _parseArguments (WebServer)
  • _parseForm (WebServer)
  • _parseFormUploadAborted (WebServer)
  • _parseRequest (WebServer)
  • _postArgs (WebServer)
  • _postArgsLen (WebServer)
  • _prepareHeader (WebServer)
  • _responseCodeToString (WebServer)
  • _responseHeaders (WebServer)
  • _server (WebServer)
  • _snonce (WebServer)
  • _sopaque (WebServer)
  • _srealm (WebServer)
  • _statusChange (WebServer)
  • _streamFileCore (WebServer)
  • _uploadReadByte (WebServer)
  • _uploadWriteByte (WebServer)
  • _address (arduino::IPv6Address)
  • _begin (cbuf)
  • _buf (cbuf)
  • _bufend (cbuf)
  • _end (cbuf)
  • _impl (fs::FS)
  • _p (fs::File)
"},{"location":"ltapi/class_member_functions/","title":"Class Member Functions","text":""},{"location":"ltapi/class_member_functions/#a","title":"a","text":"
  • addHeader (HTTPClient)
  • available (HardwareI2C, IWiFiServer, IWiFiUDP, LwIPClient, LwIPRxBuffer, LwIPUDP, MbedTLSClient, SerialClass, SoftwareSerial, StreamString, cbuf, fs::File)
  • accept (IWiFiServer, LwIPServer)
  • abort (UpdateClass)
  • addHandler (WebServer)
  • arg (WebServer)
  • argName (WebServer)
  • args (WebServer)
  • authenticate (WebServer)
  • addAP (WiFiMulti)
  • addService (mDNS)
  • addServiceImpl (mDNS)
  • addServiceTxt (mDNS)
  • addServiceTxtImpl (mDNS)
"},{"location":"ltapi/class_member_functions/#b","title":"b","text":"
  • begin (HTTPClient, HardwareI2C, IPreferences, IWiFiServer, IWiFiUDP, LwIPServer, LwIPUDP, SerialClass, SoftwareSerial, UpdateClass, WebServer, WiFiClass, mDNS)
  • beginInternal (HTTPClient)
  • beginTransmission (HardwareI2C)
  • beginMulticast (IWiFiUDP, LwIPUDP)
  • beginMulticastPacket (IWiFiUDP, LwIPUDP)
  • beginPacket (IWiFiUDP, LwIPUDP)
  • BSSID (WiFiClass)
  • BSSIDstr (WiFiClass)
  • broadcastIP (WiFiClass)
"},{"location":"ltapi/class_member_functions/#c","title":"c","text":"
  • canHandle (FunctionRequestHandler, RequestHandler, StaticRequestHandler, Uri, UriBraces, UriGlob, UriRegex)
  • canUpload (FunctionRequestHandler, RequestHandler)
  • clear (HTTPClient, IPreferences)
  • clearAllCookies (HTTPClient)
  • collectHeaders (HTTPClient, WebServer)
  • connect (HTTPClient, IWiFiClient, IWiFiClientSecure, LwIPClient, MbedTLSClient)
  • connected (HTTPClient, LwIPClient)
  • close (IWiFiServer, WebServer, fs::File, fs::FileImpl)
  • canRollback (LibreTinyOTA)
  • configure (SerialClass)
  • canRollBack (UpdateClass)
  • cleanup (UpdateClass)
  • clearError (UpdateClass)
  • clone (Uri, UriBraces, UriGlob, UriRegex)
  • client (WebServer)
  • calculateBroadcast (WiFiClass)
  • calculateNetworkID (WiFiClass)
  • calculateSubnetCIDR (WiFiClass)
  • channel (WiFiClass)
  • config (WiFiClass)
  • cbuf (cbuf)
"},{"location":"ltapi/class_member_functions/#d","title":"d","text":"
  • disconnect (HTTPClient, WiFiClass)
  • disable (LibreTinyWDT)
  • dataFree (WiFiClass)
  • dataInitialize (WiFiClass)
  • dnsIP (WiFiClass)
"},{"location":"ltapi/class_member_functions/#e","title":"e","text":"
  • EventHandler_s (EventHandler_s)
  • eraseSector (FlashClass)
  • end (HTTPClient, HardwareI2C, IPreferences, IWiFiServer, LwIPServer, SerialClass, SoftwareSerial, UpdateClass, mDNS)
  • errorToString (HTTPClient)
  • endTransmission (HardwareI2C)
  • endPacket (IWiFiUDP, LwIPUDP)
  • enable (LibreTinyWDT)
  • endTx (SoftwareSerial)
  • errorString (UpdateClass)
  • enableCORS (WebServer)
  • enableCrossOrigin (WebServer)
  • enableDelay (WebServer)
  • enableAP (WiFiClass)
  • enableIpV6 (WiFiClass)
  • enableSTA (WiFiClass)
  • encryptionType (WiFiClass)
  • encode (base64)
  • empty (cbuf)
  • exists (fs::FS, fs::FSImpl)
"},{"location":"ltapi/class_member_functions/#f","title":"f","text":"
  • flashEraseSector (EspClass)
  • flashRead (EspClass)
  • flashWrite (EspClass)
  • FunctionRequestHandler (FunctionRequestHandler)
  • flush (HardwareI2C, IWiFiUDP, LwIPClient, LwIPUDP, MbedTLSClient, SerialClass, SoftwareSerial, StreamString, cbuf, fs::File, fs::FileImpl)
  • freeEntries (IPreferences)
  • fd (IWiFiClient, LwIPClient)
  • feed (LibreTinyWDT)
  • failed (LwIPRxBuffer)
  • fillBuffer (LwIPRxBuffer)
  • fromString (arduino::IPv6Address)
  • full (cbuf)
  • FS (fs::FS)
  • FSImpl (fs::FSImpl)
  • File (fs::File)
"},{"location":"ltapi/class_member_functions/#g","title":"g","text":"
  • getBootMode (EspClass)
  • getBootVersion (EspClass)
  • getChipId (EspClass, FlashClass, LibreTiny)
  • getCoreVersion (EspClass)
  • getCpuFreqMHz (EspClass, LibreTiny)
  • getCycleCount (EspClass, LibreTiny)
  • getFlashChipId (EspClass, LibreTiny)
  • getFlashChipMode (EspClass)
  • getFlashChipRealSize (EspClass)
  • getFlashChipSize (EspClass, LibreTiny)
  • getFlashChipSizeByChipId (EspClass)
  • getFlashChipVendorId (EspClass)
  • getFreeHeap (EspClass, LibreTiny)
  • getFullVersion (EspClass)
  • getMaxFreeBlockSize (EspClass, LibreTiny)
  • getResetInfo (EspClass)
  • getResetReason (EspClass, LibreTiny)
  • getSdkVersion (EspClass)
  • getVcc (EspClass)
  • getSize (FlashClass, HTTPClient)
  • GET (HTTPClient)
  • generateCookieString (HTTPClient)
  • getLocation (HTTPClient)
  • getStream (HTTPClient)
  • getStreamPtr (HTTPClient)
  • getClock (HardwareI2C)
  • getBool (IPreferences)
  • getBytes (IPreferences)
  • getBytesLength (IPreferences)
  • getChar (IPreferences)
  • getDouble (IPreferences)
  • getFloat (IPreferences)
  • getInt (IPreferences)
  • getLong (IPreferences)
  • getLong64 (IPreferences)
  • getShort (IPreferences)
  • getString (IPreferences)
  • getType (IPreferences, LibreTinyOTA)
  • getUChar (IPreferences)
  • getUInt (IPreferences)
  • getULong (IPreferences)
  • getULong64 (IPreferences)
  • getUShort (IPreferences)
  • getFingerprintSHA256 (IWiFiClientSecure, MbedTLSClient)
  • getNoDelay (IWiFiServer, LwIPServer)
  • getBoard (LibreTiny)
  • getChipCoreType (LibreTiny)
  • getChipCores (LibreTiny)
  • getChipFamily (LibreTiny)
  • getChipFamilyName (LibreTiny)
  • getChipModel (LibreTiny)
  • getChipType (LibreTiny)
  • getCpuFreq (LibreTiny)
  • getDeviceName (LibreTiny)
  • getHeapSize (LibreTiny)
  • getMaxAllocHeap (LibreTiny)
  • getMinFreeHeap (LibreTiny)
  • getRamSize (LibreTiny)
  • getResetReasonName (LibreTiny)
  • getVersion (LibreTiny)
  • gpioRecover (LibreTiny)
  • getCurrentIndex (LibreTinyOTA)
  • getStoredIndex (LibreTinyOTA)
  • getUF2Scheme (LibreTinyOTA)
  • getContentType (StaticRequestHandler)
  • getBoardName (UpdateClass)
  • getError (UpdateClass)
  • getErrorCode (UpdateClass)
  • getFirmwareName (UpdateClass)
  • getFirmwareVersion (UpdateClass)
  • getLibreTinyVersion (UpdateClass)
  • getUF2Error (UpdateClass)
  • gatewayIP (WiFiClass)
  • getAutoReconnect (WiFiClass)
  • getEncryption (WiFiClass)
  • getHostname (WiFiClass)
  • getMode (WiFiClass)
  • getNetworkInfo (WiFiClass)
  • getSleep (WiFiClass)
  • getTxPower (WiFiClass)
  • getLastWrite (fs::File, fs::FileImpl)
"},{"location":"ltapi/class_member_functions/#h","title":"h","text":"
  • handle (FunctionRequestHandler, RequestHandler, StaticRequestHandler)
  • HTTPClient (HTTPClient)
  • handleHeaderResponse (HTTPClient)
  • hasHeader (HTTPClient, WebServer)
  • header (HTTPClient, WebServer)
  • headerName (HTTPClient, WebServer)
  • headers (HTTPClient, WebServer)
  • hasClient (IWiFiServer, LwIPServer)
  • hasError (UpdateClass)
  • handleClient (WebServer)
  • hasArg (WebServer)
  • hostHeader (WebServer)
  • hostByName (WiFiClass)
  • hostname (WiFiClass, mDNS)
  • hasTxt (mDNS)
"},{"location":"ltapi/class_member_functions/#i","title":"i","text":"
  • IPreferences (IPreferences)
  • isKey (IPreferences)
  • IWiFiClient (IWiFiClient)
  • IWiFiServer (IWiFiServer)
  • IWiFiUDP (IWiFiUDP)
  • isValid (LibreTinyOTA)
  • init (MbedTLSClient)
  • isFinished (UpdateClass)
  • isRunning (UpdateClass)
  • initPathArgs (Uri, UriBraces, UriRegex)
  • isConnected (WiFiClass)
  • IPv6Address (arduino::IPv6Address)
  • isDirectory (fs::File, fs::FileImpl)
  • IP (mDNS)
  • IPv6 (mDNS)
"},{"location":"ltapi/class_member_functions/#l","title":"l","text":"
  • localIP (IWiFiClient, LwIPClient, WiFiClass)
  • localPort (IWiFiClient, LwIPClient)
  • lastError (IWiFiClientSecure, MbedTLSClient)
  • loadCACert (IWiFiClientSecure, MbedTLSClient)
  • loadCertificate (IWiFiClientSecure, MbedTLSClient)
  • loadPrivateKey (IWiFiClientSecure, MbedTLSClient)
  • listenOnLocalhost (IWiFiServer)
  • LwIPClient (LwIPClient)
  • LwIPRxBuffer (LwIPRxBuffer)
  • LwIPServer (LwIPServer)
  • LwIPUDP (LwIPUDP)
  • localIPv6 (WiFiClass)
"},{"location":"ltapi/class_member_functions/#m","title":"m","text":"
  • MbedTLSClient (MbedTLSClient)
  • md5 (UpdateClass)
  • md5String (UpdateClass)
  • method (WebServer)
  • macAddress (WiFiClass)
  • macToString (WiFiClass)
  • mode (WiFiClass)
  • modePriv (WiFiClass)
  • mkdir (fs::FS, fs::FSImpl)
  • mDNS (mDNS)
"},{"location":"ltapi/class_member_functions/#n","title":"n","text":"
  • next (RequestHandler)
  • networkID (WiFiClass)
  • name (fs::File, fs::FileImpl)
  • numTxt (mDNS)
"},{"location":"ltapi/class_member_functions/#o","title":"o","text":"
  • onReceive (HardwareI2C)
  • onRequest (HardwareI2C)
  • operator bool (IWiFiClient, IWiFiServer, LwIPServer, SerialClass, SoftwareSerial, fs::File, fs::FileImpl)
  • operator!= (IWiFiClient)
  • operator== (IWiFiClient, arduino::IPv6Address)
  • operator= (LwIPClient, arduino::IPv6Address)
  • onProgress (UpdateClass)
  • on (WebServer)
  • onFileUpload (WebServer)
  • onNotFound (WebServer)
  • onEvent (WiFiClass)
  • operator const uint32_t * (arduino::IPv6Address)
  • operator const uint8_t * (arduino::IPv6Address)
  • operator[] (arduino::IPv6Address)
  • open (fs::FS, fs::FSImpl)
  • openNextFile (fs::File, fs::FileImpl)
"},{"location":"ltapi/class_member_functions/#p","title":"p","text":"
  • PATCH (HTTPClient)
  • POST (HTTPClient)
  • PUT (HTTPClient)
  • peek (HardwareI2C, IWiFiUDP, LwIPClient, LwIPRxBuffer, LwIPUDP, MbedTLSClient, SerialClass, SoftwareSerial, StreamString, cbuf, fs::File)
  • putBool (IPreferences)
  • putBytes (IPreferences)
  • putChar (IPreferences)
  • putDouble (IPreferences)
  • putFloat (IPreferences)
  • putInt (IPreferences)
  • putLong (IPreferences)
  • putLong64 (IPreferences)
  • putShort (IPreferences)
  • putString (IPreferences)
  • putUChar (IPreferences)
  • putUInt (IPreferences)
  • putULong (IPreferences)
  • putULong64 (IPreferences)
  • putUShort (IPreferences)
  • parsePacket (IWiFiUDP, LwIPUDP)
  • pathArg (RequestHandler, WebServer)
  • printError (UpdateClass)
  • printErrorContext (UpdateClass)
  • progress (UpdateClass)
  • progressHandler (UpdateClass)
  • postEvent (WiFiClass)
  • printDiag (WiFiClass)
  • psk (WiFiClass)
  • printTo (arduino::IPv6Address)
  • path (fs::File, fs::FileImpl)
  • position (fs::File, fs::FileImpl)
  • port (mDNS)
"},{"location":"ltapi/class_member_functions/#q","title":"q","text":"
  • queryHost (mDNS)
  • queryService (mDNS)
"},{"location":"ltapi/class_member_functions/#r","title":"r","text":"
  • random (EspClass)
  • rebootIntoUartDownloadMode (EspClass)
  • reset (EspClass)
  • restart (EspClass, LibreTiny)
  • readBlock (FlashClass)
  • resetCookieJar (HTTPClient)
  • returnError (HTTPClient)
  • read (HardwareI2C, IWiFiUDP, LwIPClient, LwIPRxBuffer, LwIPUDP, MbedTLSClient, SerialClass, SoftwareSerial, StreamString, cbuf, fs::File, fs::FileImpl)
  • requestFrom (HardwareI2C)
  • remove (IPreferences, cbuf, fs::FS, fs::FSImpl)
  • remoteIP (IWiFiClient, IWiFiUDP, LwIPClient, LwIPUDP)
  • remotePort (IWiFiClient, IWiFiUDP, LwIPClient, LwIPUDP)
  • restartDownloadMode (LibreTiny)
  • r_available (LwIPRxBuffer)
  • remaining (UpdateClass)
  • rollBack (UpdateClass)
  • requestAuthentication (WebServer)
  • RSSI (WiFiClass)
  • reconnect (WiFiClass)
  • removeEvent (WiFiClass)
  • resetNetworkInfo (WiFiClass)
  • restoreAPConfig (WiFiClass)
  • restoreSTAConfig (WiFiClass)
  • run (WiFiMulti)
  • raw_address (arduino::IPv6Address)
  • resize (cbuf)
  • resizeAdd (cbuf)
  • room (cbuf)
  • rename (fs::FS, fs::FSImpl)
  • rmdir (fs::FS, fs::FSImpl)
  • readBytes (fs::File)
  • rewindDirectory (fs::File, fs::FileImpl)
"},{"location":"ltapi/class_member_functions/#s","title":"s","text":"
  • sendHeader (HTTPClient, WebServer)
  • sendRequest (HTTPClient)
  • setAuthorization (HTTPClient)
  • setAuthorizationType (HTTPClient)
  • setConnectTimeout (HTTPClient)
  • setCookie (HTTPClient)
  • setCookieJar (HTTPClient)
  • setFollowRedirects (HTTPClient)
  • setRedirectLimit (HTTPClient)
  • setReuse (HTTPClient)
  • setTimeout (HTTPClient, IWiFiClient, IWiFiServer, LwIPClient, LwIPServer)
  • setURL (HTTPClient)
  • setUserAgent (HTTPClient)
  • setClock (HardwareI2C)
  • setPins (HardwareI2C)
  • socket (IWiFiClient, LwIPClient)
  • setAlpnProtocols (IWiFiClientSecure, MbedTLSClient)
  • setCACert (IWiFiClientSecure, MbedTLSClient)
  • setCertificate (IWiFiClientSecure, MbedTLSClient)
  • setHandshakeTimeout (IWiFiClientSecure, MbedTLSClient)
  • setInsecure (IWiFiClientSecure, MbedTLSClient)
  • setPreSharedKey (IWiFiClientSecure, MbedTLSClient)
  • setPrivateKey (IWiFiClientSecure, MbedTLSClient)
  • setNoDelay (IWiFiServer, LwIPServer)
  • stop (IWiFiServer, IWiFiUDP, LwIPClient, LwIPUDP, MbedTLSClient, WebServer)
  • stopAll (IWiFiServer, LwIPServer)
  • switchImage (LibreTinyOTA)
  • SerialClass (SerialClass)
  • SoftwareSerial (SoftwareSerial)
  • startTx (SoftwareSerial)
  • StaticRequestHandler (StaticRequestHandler)
  • setMD5 (UpdateClass)
  • size (UpdateClass, cbuf, fs::File, fs::FileImpl)
  • send (WebServer)
  • sendContent (WebServer)
  • sendContent_P (WebServer)
  • send_P (WebServer)
  • serveStatic (WebServer)
  • setContentLength (WebServer)
  • streamFile (WebServer)
  • SSID (WiFiClass)
  • scanAlloc (WiFiClass)
  • scanComplete (WiFiClass)
  • scanDelete (WiFiClass)
  • scanInit (WiFiClass)
  • scanNetworks (WiFiClass)
  • setAutoReconnect (WiFiClass)
  • setHostname (WiFiClass)
  • setMacAddress (WiFiClass)
  • setSleep (WiFiClass)
  • setTxPower (WiFiClass)
  • softAP (WiFiClass)
  • softAPBroadcastIP (WiFiClass)
  • softAPConfig (WiFiClass)
  • softAPIP (WiFiClass)
  • softAPIPv6 (WiFiClass)
  • softAPNetworkID (WiFiClass)
  • softAPSSID (WiFiClass)
  • softAPSubnetCIDR (WiFiClass)
  • softAPSubnetMask (WiFiClass)
  • softAPdisconnect (WiFiClass)
  • softAPenableIpV6 (WiFiClass)
  • softAPgetHostname (WiFiClass)
  • softAPgetStationNum (WiFiClass)
  • softAPmacAddress (WiFiClass)
  • softAPsetHostname (WiFiClass)
  • status (WiFiClass)
  • subnetCIDR (WiFiClass)
  • subnetMask (WiFiClass)
  • seek (fs::File, fs::FileImpl)
  • setBufferSize (fs::File, fs::FileImpl)
  • setInstanceName (mDNS)
"},{"location":"ltapi/class_member_functions/#t","title":"t","text":"
  • toString (arduino::IPv6Address)
  • txt (mDNS)
  • txtKey (mDNS)
"},{"location":"ltapi/class_member_functions/#u","title":"u","text":"
  • upload (FunctionRequestHandler, RequestHandler, WebServer)
  • useHTTP10 (HTTPClient)
  • Uri (Uri)
  • UriBraces (UriBraces)
  • UriGlob (UriGlob)
  • UriRegex (UriRegex)
  • uri (WebServer)
  • urlDecode (WebServer)
"},{"location":"ltapi/class_member_functions/#v","title":"v","text":"
  • verify (IWiFiClientSecure, MbedTLSClient)
  • validate (WiFiClass)
"},{"location":"ltapi/class_member_functions/#w","title":"w","text":"
  • wdtDisable (EspClass)
  • wdtEnable (EspClass)
  • wdtFeed (EspClass)
  • writeBlock (FlashClass)
  • writeToStream (HTTPClient)
  • writeToStreamDataBlock (HTTPClient)
  • write (HardwareI2C, IWiFiClient, IWiFiServer, IWiFiUDP, LwIPClient, LwIPServer, LwIPUDP, MbedTLSClient, SerialClass, SoftwareSerial, StreamString, UpdateClass, cbuf, fs::File, fs::FileImpl)
  • write_P (IWiFiClient)
  • writeStream (UpdateClass)
  • WebServer (WebServer)
  • WiFiClass (WiFiClass)
  • waitForConnectResult (WiFiClass)
  • WiFiMulti (WiFiMulti)
  • wrap_if_bufend (cbuf)
"},{"location":"ltapi/class_member_functions/#_1","title":"~","text":"
  • ~FunctionRequestHandler (FunctionRequestHandler)
  • ~HTTPClient (HTTPClient)
  • ~IPreferences (IPreferences)
  • ~IWiFiClient (IWiFiClient)
  • ~IWiFiServer (IWiFiServer)
  • ~IWiFiUDP (IWiFiUDP)
  • ~LwIPClient (LwIPClient)
  • ~LwIPRxBuffer (LwIPRxBuffer)
  • ~LwIPUDP (LwIPUDP)
  • ~MbedTLSClient (MbedTLSClient)
  • ~RequestHandler (RequestHandler)
  • ~Uri (Uri)
  • ~WebServer (WebServer)
  • ~WiFiClass (WiFiClass)
  • ~WiFiMulti (WiFiMulti)
  • ~IPv6Address (arduino::IPv6Address)
  • ~cbuf (cbuf)
  • ~FSImpl (fs::FSImpl)
  • ~FileImpl (fs::FileImpl)
  • ~mDNS (mDNS)
"},{"location":"ltapi/class_member_functions/#_","title":"_","text":"
  • _addRequestHandler (WebServer)
  • _collectHeader (WebServer)
  • _currentClientWrite (WebServer)
  • _currentClientWrite_P (WebServer)
  • _extractParam (WebServer)
  • _finalizeResponse (WebServer)
  • _getRandomHexString (WebServer)
  • _handleRequest (WebServer)
  • _parseArguments (WebServer)
  • _parseForm (WebServer)
  • _parseFormUploadAborted (WebServer)
  • _parseRequest (WebServer)
  • _prepareHeader (WebServer)
  • _responseCodeToString (WebServer)
  • _streamFileCore (WebServer)
  • _uploadReadByte (WebServer)
  • _uploadWriteByte (WebServer)
"},{"location":"ltapi/class_member_variables/","title":"Class Member Variables","text":""},{"location":"ltapi/class_member_variables/#a","title":"a","text":"
  • addr (WiFiMacAddr, esp_ip4_addr, esp_ip6_addr)
  • APlist (WiFiMulti)
  • auth (WiFiNetworkInfo, WiFiScanAP)
  • ap (WiFiScanData)
  • aid (wifi_event_ap_staconnected_t, wifi_event_ap_stadisconnected_t)
  • authmode (wifi_event_sta_connected_t)
  • ap_cred (wifi_event_sta_wps_er_success_t)
  • ap_cred_cnt (wifi_event_sta_wps_er_success_t)
"},{"location":"ltapi/class_member_variables/#b","title":"b","text":"
  • buf (HTTPUpload, MD5Context, SerialClass, SoftData, lt_ota_ctx_t)
  • bits (MD5Context)
  • baudrate (SerialClass)
  • byte (SoftData)
  • bssid (WiFiNetworkInfo, WiFiScanAP, wifi_event_sta_connected_t, wifi_event_sta_disconnected_t)
  • bytes (arduino::IPv6Address)
  • buf_pos (lt_ota_ctx_t)
  • bytes_total (lt_ota_ctx_t)
  • bytes_written (lt_ota_ctx_t)
  • buffer (mbedtls_md5_context)
"},{"location":"ltapi/class_member_variables/#c","title":"c","text":"
  • cb (EventHandler_s)
  • currentSize (HTTPUpload)
  • config (SerialClass)
  • callback (UpdateClass, lt_ota_ctx_t)
  • ctx (UpdateClass)
  • channel (WiFiNetworkInfo, WiFiScanAP, wifi_event_sta_connected_t)
  • count (WiFiScanData)
  • chip_id (lt_flash_id_t)
  • chip_size_id (lt_flash_id_t)
  • callback_param (lt_ota_ctx_t)
  • context (wifi_event_action_tx_status_t, wifi_event_roc_done_t)
"},{"location":"ltapi/class_member_variables/#d","title":"d","text":"
  • date (Cookie)
  • domain (Cookie)
  • duration (Cookie)
  • data (PinInfo, SerialClass, SoftwareSerial, WiFiClass)
  • dns1 (WiFiNetworkInfo)
  • dns2 (WiFiNetworkInfo)
  • dword (arduino::IPv6Address)
  • da (wifi_event_action_tx_status_t)
  • dist_est (wifi_event_ftm_report_t)
  • dlog_token (wifi_ftm_report_entry_t)
"},{"location":"ltapi/class_member_variables/#e","title":"e","text":"
  • expires (Cookie)
  • eventId (EventHandler_s)
  • enabled (PinInfo)
  • errArd (UpdateClass)
  • errUf2 (UpdateClass)
  • event_id (arduino_event_t)
  • event_info (arduino_event_t)
  • esp_netif (ip_event_got_ip6_t, ip_event_got_ip_t)
  • error (lt_ota_ctx_t)
  • endsWith (mime::Entry)
"},{"location":"ltapi/class_member_variables/#f","title":"f","text":"
  • fcb (EventHandler_s)
  • filename (HTTPUpload)
  • ftm_report_data (wifi_event_ftm_report_t)
  • ftm_report_num_entries (wifi_event_ftm_report_t)
"},{"location":"ltapi/class_member_variables/#g","title":"g","text":"
  • gpio (PinInfo)
  • gateway (WiFiNetworkInfo)
  • gw (esp_netif_ip_info_t)
"},{"location":"ltapi/class_member_variables/#h","title":"h","text":"
  • host (Cookie)
  • http_only (Cookie)
  • handlers (WiFiClass)
"},{"location":"ltapi/class_member_variables/#i","title":"i","text":"
  • id (EventHandler_s)
  • in (MD5Context)
  • invert (SoftSerial)
  • ip (esp_netif_ip6_info_t, esp_netif_ip_info_t, ip_event_ap_staipassigned_t)
  • if_index (ip_event_got_ip6_t, ip_event_got_ip_t)
  • ip6_info (ip_event_got_ip6_t)
  • ip_index (ip_event_got_ip6_t)
  • ip_changed (ip_event_got_ip_t)
  • ip_info (ip_event_got_ip_t)
  • info (lt_ota_ctx_t)
  • instanceName (mDNS)
  • ifx (wifi_event_action_tx_status_t)
  • is_mesh_child (wifi_event_ap_staconnected_t, wifi_event_ap_stadisconnected_t)
"},{"location":"ltapi/class_member_variables/#k","title":"k","text":"
  • key (HTTPClient::RequestArgument, WebServer::RequestArgument)
"},{"location":"ltapi/class_member_variables/#l","title":"l","text":"
  • lastId (EventHandler_s)
  • localIP (WiFiNetworkInfo)
"},{"location":"ltapi/class_member_variables/#m","title":"m","text":"
  • max_age (Cookie)
  • multicast_ip (LwIPUDP)
  • md5Ctx (UpdateClass)
  • md5Digest (UpdateClass)
  • md5Expected (UpdateClass)
  • manufacturer_id (lt_flash_id_t)
  • mimeType (mime::Entry)
  • mac (wifi_event_ap_probe_req_rx_t, wifi_event_ap_staconnected_t, wifi_event_ap_stadisconnected_t)
"},{"location":"ltapi/class_member_variables/#n","title":"n","text":"
  • name (Cookie, HTTPUpload)
  • next (cbuf)
  • netmask (esp_netif_ip_info_t)
  • new_mode (wifi_event_sta_authmode_change_t)
  • number (wifi_event_sta_scan_done_t)
"},{"location":"ltapi/class_member_variables/#o","title":"o","text":"
  • onReceiveCallback (HardwareI2C)
  • onRequestCallback (HardwareI2C)
  • old_mode (wifi_event_sta_authmode_change_t)
"},{"location":"ltapi/class_member_variables/#p","title":"p","text":"
  • path (Cookie)
  • pathArgs (RequestHandler)
  • port (SerialClass)
  • param (SoftData, SoftSerial, SoftwareSerial)
  • pin (SoftData)
  • password (WiFiNetworkInfo)
  • passphrase (WifiAPlist_t, wifi_event_sta_wps_er_success_t)
  • plainchar (base64_decodestate)
  • peer_mac (wifi_event_ftm_report_t)
  • pin_code (wifi_event_sta_wps_er_pin_t)
"},{"location":"ltapi/class_member_variables/#r","title":"r","text":"
  • remote_ip (LwIPUDP)
  • remote_port (LwIPUDP)
  • rx_buffer (LwIPUDP)
  • rx (SerialClass, SoftSerial)
  • rssi (WiFiScanAP, wifi_event_ap_probe_req_rx_t, wifi_ftm_report_entry_t)
  • running (WiFiScanData, lt_ota_ctx_t)
  • result (base64_encodestate)
  • rtt_est (wifi_event_ftm_report_t)
  • rtt_raw (wifi_event_ftm_report_t)
  • reason (wifi_event_sta_disconnected_t)
  • rtt (wifi_ftm_report_entry_t)
"},{"location":"ltapi/class_member_variables/#s","title":"s","text":"
  • secure (Cookie)
  • scb (EventHandler_s)
  • status (HTTPUpload, wifi_event_action_tx_status_t, wifi_event_ftm_report_t, wifi_event_sta_scan_done_t)
  • server_port (LwIPUDP)
  • supported (PinInfo)
  • state (SoftData, mbedtls_md5_context)
  • scan (WiFiClass)
  • ssid (WiFiNetworkInfo, WiFiScanAP, WifiAPlist_t, wifi_event_sta_connected_t, wifi_event_sta_disconnected_t, wifi_event_sta_wps_er_success_t)
  • ssidHidden (WiFiNetworkInfo)
  • subnet (WiFiNetworkInfo)
  • step (base64_decodestate, base64_encodestate)
  • stepcount (base64_encodestate)
  • ssid_len (wifi_event_sta_connected_t, wifi_event_sta_disconnected_t)
  • scan_id (wifi_event_sta_scan_done_t)
"},{"location":"ltapi/class_member_variables/#t","title":"t","text":"
  • totalSize (HTTPUpload)
  • type (HTTPUpload)
  • tx_buffer (LwIPUDP)
  • tx_buffer_len (LwIPUDP)
  • tx (SerialClass, SoftSerial)
  • timeout (WiFiScanData)
  • total (mbedtls_md5_context)
  • t1 (wifi_ftm_report_entry_t)
  • t2 (wifi_ftm_report_entry_t)
  • t3 (wifi_ftm_report_entry_t)
  • t4 (wifi_ftm_report_entry_t)
"},{"location":"ltapi/class_member_variables/#u","title":"u","text":"
  • udp_server (LwIPUDP)
  • uf2 (lt_ota_ctx_t)
"},{"location":"ltapi/class_member_variables/#v","title":"v","text":"
  • valid (Cookie)
  • value (Cookie, HTTPClient::RequestArgument, WebServer::RequestArgument)
"},{"location":"ltapi/class_member_variables/#z","title":"z","text":"
  • zone (esp_ip6_addr)
"},{"location":"ltapi/class_member_variables/#_","title":"_","text":"
  • _fn (FunctionRequestHandler)
  • _method (FunctionRequestHandler)
  • _ufn (FunctionRequestHandler)
  • _uri (FunctionRequestHandler, HTTPClient, StaticRequestHandler, Uri)
  • _authorizationType (HTTPClient)
  • _base64Authorization (HTTPClient)
  • _canReuse (HTTPClient)
  • _client (HTTPClient)
  • _connectTimeout (HTTPClient)
  • _cookieJar (HTTPClient)
  • _currentHeaders (HTTPClient, WebServer)
  • _followRedirects (HTTPClient)
  • _headerKeysCount (HTTPClient, WebServer)
  • _headers (HTTPClient)
  • _host (HTTPClient)
  • _location (HTTPClient)
  • _port (HTTPClient, LwIPServer)
  • _protocol (HTTPClient)
  • _redirectLimit (HTTPClient)
  • _returnCode (HTTPClient)
  • _reuse (HTTPClient)
  • _secure (HTTPClient)
  • _size (HTTPClient, LwIPRxBuffer, cbuf)
  • _tcpDeprecated (HTTPClient)
  • _tcpTimeout (HTTPClient)
  • _transferEncoding (HTTPClient)
  • _transportTraits (HTTPClient)
  • _useHTTP10 (HTTPClient)
  • _userAgent (HTTPClient)
  • _freq (HardwareI2C)
  • _scl (HardwareI2C)
  • _sda (HardwareI2C)
  • _connected (LwIPClient)
  • _rxBuffer (LwIPClient)
  • _sock (LwIPClient, LwIPRxBuffer, LwIPServer)
  • _buffer (LwIPRxBuffer)
  • _failed (LwIPRxBuffer)
  • _fill (LwIPRxBuffer)
  • _pos (LwIPRxBuffer)
  • _active (LwIPServer)
  • _addr (LwIPServer)
  • _maxClients (LwIPServer)
  • _noDelay (LwIPServer)
  • _sockAccepted (LwIPServer)
  • _alpnProtocols (MbedTLSClient)
  • _caCert (MbedTLSClient)
  • _caCertStr (MbedTLSClient)
  • _clientCert (MbedTLSClient)
  • _clientCertStr (MbedTLSClient)
  • _clientKey (MbedTLSClient)
  • _clientKeyStr (MbedTLSClient)
  • _handshakeTimeout (MbedTLSClient)
  • _insecure (MbedTLSClient)
  • _peeked (MbedTLSClient)
  • _pskIdentStr (MbedTLSClient)
  • _pskStr (MbedTLSClient)
  • _sockTls (MbedTLSClient)
  • _sslCfg (MbedTLSClient)
  • _sslCtx (MbedTLSClient)
  • _useRootCA (MbedTLSClient)
  • _next (RequestHandler)
  • _baseUriLength (StaticRequestHandler)
  • _cache_header (StaticRequestHandler)
  • _fs (StaticRequestHandler)
  • _isFile (StaticRequestHandler)
  • _path (StaticRequestHandler)
  • _chunked (WebServer)
  • _contentLength (WebServer)
  • _corsEnabled (WebServer)
  • _currentArgCount (WebServer)
  • _currentArgs (WebServer)
  • _currentClient (WebServer)
  • _currentHandler (WebServer)
  • _currentMethod (WebServer)
  • _currentStatus (WebServer)
  • _currentUpload (WebServer)
  • _currentUri (WebServer)
  • _currentVersion (WebServer)
  • _fileUploadHandler (WebServer)
  • _firstHandler (WebServer)
  • _hostHeader (WebServer)
  • _lastHandler (WebServer)
  • _notFoundHandler (WebServer)
  • _nullDelay (WebServer)
  • _postArgs (WebServer)
  • _postArgsLen (WebServer)
  • _responseHeaders (WebServer)
  • _server (WebServer)
  • _snonce (WebServer)
  • _sopaque (WebServer)
  • _srealm (WebServer)
  • _statusChange (WebServer)
  • _address (arduino::IPv6Address)
  • _begin (cbuf)
  • _buf (cbuf)
  • _bufend (cbuf)
  • _end (cbuf)
  • _impl (fs::FS)
  • _p (fs::File)
"},{"location":"ltapi/class_member_typedefs/","title":"Class Member Typedefs","text":""},{"location":"ltapi/class_member_typedefs/#t","title":"t","text":"
  • THandlerFunction_Progress (UpdateClass)
  • THandlerFunction (WebServer)
"},{"location":"ltapi/class_member_enums/","title":"Class Member Enums","text":""},{"location":"ltapi/namespace_members/","title":"Namespace Members","text":""},{"location":"ltapi/namespace_members/#f","title":"f","text":"
  • FSImplPtr (fs)
  • FileImplPtr (fs)
"},{"location":"ltapi/namespace_members/#m","title":"m","text":"
  • mimeTable (mime)
"},{"location":"ltapi/namespace_members/#s","title":"s","text":"
  • SeekMode (fs)
"},{"location":"ltapi/namespace_members/#t","title":"t","text":"
  • type (mime)
"},{"location":"ltapi/namespace_member_functions/","title":"Namespace Member Functions","text":""},{"location":"ltapi/namespace_member_variables/","title":"Namespace Member Variables","text":""},{"location":"ltapi/namespace_member_variables/#m","title":"m","text":"
  • mimeTable (mime)
"},{"location":"ltapi/namespace_member_typedefs/","title":"Namespace Member Typedefs","text":""},{"location":"ltapi/namespace_member_typedefs/#f","title":"f","text":"
  • FSImplPtr (fs)
  • FileImplPtr (fs)
"},{"location":"ltapi/namespace_member_enums/","title":"Namespace Member Enums","text":""},{"location":"ltapi/namespace_member_enums/#s","title":"s","text":"
  • SeekMode (fs)
"},{"location":"ltapi/namespace_member_enums/#t","title":"t","text":"
  • type (mime)
"},{"location":"ltapi/functions/","title":"Functions","text":""},{"location":"ltapi/functions/#a","title":"a","text":"
  • analogRead (wiring_custom.c, wiring_custom.h)
  • analogReadResolution (wiring_custom.c, wiring_custom.h)
  • analogWriteFrequency (wiring_custom.c, wiring_custom.h)
  • analogWritePeriod (wiring_custom.c, wiring_custom.h)
  • analogWriteResolution (wiring_custom.c, wiring_custom.h)
  • analogReadMaxVoltage (wiring_custom.h)
  • analogReadVoltage (wiring_custom.h)
  • attachInterrupt (wiring_irq.c)
"},{"location":"ltapi/functions/#b","title":"b","text":"
  • base64_decode_block (cdecode.c, cdecode.h)
  • base64_decode_block_signed (cdecode.c)
  • base64_decode_chars (cdecode.c, cdecode.h)
  • base64_decode_chars_signed (cdecode.c)
  • base64_decode_value (cdecode.c, cdecode.h)
  • base64_decode_value_signed (cdecode.c)
  • base64_init_decodestate (cdecode.c, cdecode.h)
  • base64_encode_block (cencode.c, cencode.h)
  • base64_encode_blockend (cencode.c, cencode.h)
  • base64_encode_chars (cencode.c, cencode.h)
  • base64_encode_value (cencode.c, cencode.h)
  • base64_init_encodestate (cencode.c, cencode.h)
"},{"location":"ltapi/functions/#d","title":"d","text":"
  • dtostrf (dtostrf.c)
"},{"location":"ltapi/functions/#e","title":"e","text":"
  • ensureUnderscore (mDNS.cpp)
"},{"location":"ltapi/functions/#g","title":"g","text":"
  • gettimeofday (time.c)
"},{"location":"ltapi/functions/#h","title":"h","text":"
  • hexdump (lt_utils.c, lt_utils.h)
"},{"location":"ltapi/functions/#i","title":"i","text":"
  • ipToString (wiring_compat.cpp, wiring_compat.h)
  • itoa (itoa.c)
"},{"location":"ltapi/functions/#l","title":"l","text":"
  • lt_cpu_get_family (lt_cpu.c, lt_cpu.h)
  • lt_cpu_get_family_name (lt_cpu.c, lt_cpu.h)
  • lt_cpu_get_freq_mhz (lt_cpu.c, lt_cpu.h)
  • lt_cpu_get_model_code (lt_cpu.c, lt_cpu.h)
  • lt_cpu_get_model_name (lt_cpu.c, lt_cpu.h)
  • lt_cpu_get_core_count (lt_cpu.h)
  • lt_cpu_get_core_type (lt_cpu.h)
  • lt_cpu_get_cycle_count (lt_cpu.h)
  • lt_cpu_get_freq (lt_cpu.h)
  • lt_cpu_get_mac_id (lt_cpu.h)
  • lt_cpu_get_model (lt_cpu.h)
  • lt_cpu_get_unique_id (lt_cpu.h)
  • lt_get_board_code (lt_device.c, lt_device.h)
  • lt_get_device_name (lt_device.c, lt_device.h)
  • lt_get_reboot_reason_name (lt_device.c, lt_device.h)
  • lt_get_version (lt_device.c, lt_device.h)
  • lt_get_device_mac (lt_device.h)
  • lt_get_reboot_reason (lt_device.h)
  • lt_gpio_recover (lt_device.h)
  • lt_reboot (lt_device.h)
  • lt_reboot_download_mode (lt_device.h)
  • lt_reboot_wdt (lt_device.h)
  • lt_set_debug_mode (lt_device.h)
  • lt_flash_erase (lt_flash.c, lt_flash.h)
  • lt_flash_erase_block (lt_flash.c, lt_flash.h)
  • lt_flash_read (lt_flash.c, lt_flash.h)
  • lt_flash_write (lt_flash.c, lt_flash.h)
  • lt_flash_get_id (lt_flash.h)
  • lt_flash_get_size (lt_flash.h)
  • lt_init_arduino (lt_init.h)
  • lt_init_family (lt_init.h)
  • lt_init_variant (lt_init.h)
  • lt_heap_get_free (lt_mem.h)
  • lt_heap_get_max_alloc (lt_mem.h)
  • lt_heap_get_min_free (lt_mem.h)
  • lt_heap_get_size (lt_mem.h)
  • lt_ram_get_size (lt_mem.h)
  • lt_ota_begin (lt_ota.c, lt_ota.h)
  • lt_ota_buf_left (lt_ota.c)
  • lt_ota_buf_size (lt_ota.c)
  • lt_ota_can_rollback (lt_ota.c, lt_ota.h)
  • lt_ota_end (lt_ota.c, lt_ota.h)
  • lt_ota_get_uf2_scheme (lt_ota.c, lt_ota.h)
  • lt_ota_write (lt_ota.c, lt_ota.h)
  • lt_ota_write_block (lt_ota.c, lt_ota.h)
  • lt_ota_dual_get_current (lt_ota.h)
  • lt_ota_dual_get_stored (lt_ota.h)
  • lt_ota_get_type (lt_ota.h)
  • lt_ota_is_valid (lt_ota.h)
  • lt_ota_set_write_protect (lt_ota.h)
  • lt_ota_switch (lt_ota.h)
  • lt_deep_sleep_config_gpio (lt_sleep.h)
  • lt_deep_sleep_config_timer (lt_sleep.h)
  • lt_deep_sleep_enter (lt_sleep.h)
  • lt_deep_sleep_unset_gpio (lt_sleep.h)
  • lt_btox (lt_utils.c, lt_utils.h)
  • lt_rand_bytes (lt_utils.c, lt_utils.h)
  • lt_xtob (lt_utils.c, lt_utils.h)
  • lt_wdt_disable (lt_wdt.h)
  • lt_wdt_enable (lt_wdt.h)
  • lt_wdt_feed (lt_wdt.h)
  • ltoa (itoa.c)
  • lt_log (lt_logger.c, lt_logger.h)
  • lt_log_disable (lt_logger.c, lt_logger.h)
  • lt_log_set_port (lt_logger.c, lt_logger.h)
  • lt_main (lt_main.c)
"},{"location":"ltapi/functions/#m","title":"m","text":"
  • MD5Final (MD5.h)
  • MD5Init (MD5.h)
  • MD5Update (MD5.h)
  • mainTask (wiring_custom.h, main.c)
  • main (main.c, lt_main.c)
"},{"location":"ltapi/functions/#p","title":"p","text":"
  • pinByGpio (wiring_custom.c, wiring_custom.h)
  • pinByIndex (wiring_custom.c, wiring_custom.h)
  • pinEnabled (wiring_custom.c, wiring_custom.h)
  • pinIndex (wiring_custom.c, wiring_custom.h)
  • pinInfo (wiring_custom.c, wiring_custom.h)
  • pinModeRemove (wiring_custom.c, wiring_custom.h)
  • pinSupported (wiring_custom.c, wiring_custom.h)
  • pinModeNone (wiring_custom.h)
  • pinRemoveMode (wiring_custom.h)
  • pinData (wiring_private.h)
  • pinDisable (wiring_private.h)
  • pinEnable (wiring_private.h)
  • pinRemoveData (wiring_private.h)
  • printf_nop (fal_cfg.h)
  • putchar_p (printf_config.h)
"},{"location":"ltapi/functions/#r","title":"r","text":"
  • runPeriodicTasks (wiring_custom.c, wiring_custom.h)
  • random (wiring_math.cpp)
  • randomSeed (wiring_math.cpp)
"},{"location":"ltapi/functions/#s","title":"s","text":"
  • Serial_available (serial_event.cpp)
  • serialEvent (serial_event.cpp)
  • serialEventRun (serial_event.cpp)
  • settimeofday (time.c)
  • startMainTask (wiring_custom.h)
  • shiftIn (wiring_shift.c)
  • shiftOut (wiring_shift.c)
  • strcasecmp (strcasecmp.c, lt_posix_api.h)
  • strncasecmp (strcasecmp.c, lt_posix_api.h)
  • strptime (strptime.c, lt_posix_api.h)
  • strdup (lt_posix_api.h)
"},{"location":"ltapi/functions/#u","title":"u","text":"
  • ultoa (itoa.c)
  • utoa (itoa.c)
"},{"location":"ltapi/functions/#_","title":"_","text":"
  • __attribute__ (WiFi.cpp, WiFiAP.cpp, WiFiGeneric.cpp, WiFiSTA.cpp, wiring.c, wiring_custom.c, lt_cpu.c, lt_device.c, lt_flash.c, lt_mem.c, lt_ota.c, lt_wdt.c, strdup.c)
  • __cxa_deleted_virtual (abi.cpp)
  • __cxa_pure_virtual (abi.cpp)
  • __wrap_gettimeofday (time.c)
  • __wrap_settimeofday (time.c)
  • _gettimeofday (time.c)
  • _settimeofday (time.c)
  • __wrap_zalloc (malloc.c)
  • __wrap_putchar (putchar.c)
  • __wrap_puts (puts.c)
  • __libc_init_array (lt_main.c)
"},{"location":"ltapi/macros/","title":"Macros","text":""},{"location":"ltapi/macros/#a","title":"a","text":"
  • attachInterruptArg (wiring_compat.h)
"},{"location":"ltapi/macros/#b","title":"b","text":"
  • base64_decode_expected_len (cdecode.h)
  • base64_encode_expected_len (cencode.h)
"},{"location":"ltapi/macros/#c","title":"c","text":"
  • CONTENT_LENGTH_NOT_SET (WebServer.h)
  • CONTENT_LENGTH_UNKNOWN (WebServer.h)
  • ChipFamily (LT.h)
  • ChipType (LT.h)
  • CONFIG_LWIP_MAX_ACTIVE_TCP (wiring_compat.h)
  • COLOR_BLACK (lt_logger.c)
  • COLOR_BLUE (lt_logger.c)
  • COLOR_BRIGHT_BLACK (lt_logger.c)
  • COLOR_BRIGHT_BLUE (lt_logger.c)
  • COLOR_BRIGHT_CYAN (lt_logger.c)
  • COLOR_BRIGHT_GREEN (lt_logger.c)
  • COLOR_BRIGHT_MAGENTA (lt_logger.c)
  • COLOR_BRIGHT_RED (lt_logger.c)
  • COLOR_BRIGHT_WHITE (lt_logger.c)
  • COLOR_BRIGHT_YELLOW (lt_logger.c)
  • COLOR_CYAN (lt_logger.c)
  • COLOR_FMT (lt_logger.c)
  • COLOR_GREEN (lt_logger.c)
  • COLOR_MAGENTA (lt_logger.c)
  • COLOR_RED (lt_logger.c)
  • COLOR_WHITE (lt_logger.c)
  • COLOR_YELLOW (lt_logger.c)
  • CPU_MODEL (lt_types.h)
  • CPU_MODEL_ENUM (lt_types.h)
"},{"location":"ltapi/macros/#d","title":"d","text":"
  • digitalPinToInterrupt (wiring_compat.h)
"},{"location":"ltapi/macros/#e","title":"e","text":"
  • ENCRYPTED_BLOCK_SIZE (Update.h)
  • EventId (Events.h)
  • EventId_t (Events.h)
  • EventInfo (Events.h)
  • EventInfo_t (Events.h)
  • Event_t (Events.h)
  • ESP_FAIL (wiring_compat.h)
  • ESP_OK (wiring_compat.h)
  • esp_err_t (wiring_compat.h)
  • errno (errno.h)
  • ESP_EARLY_LOGD (lt_logger.h)
  • ESP_EARLY_LOGE (lt_logger.h)
  • ESP_EARLY_LOGI (lt_logger.h)
  • ESP_EARLY_LOGV (lt_logger.h)
  • ESP_EARLY_LOGW (lt_logger.h)
  • ESP_LOGD (lt_logger.h)
  • ESP_LOGE (lt_logger.h)
  • ESP_LOGI (lt_logger.h)
  • ESP_LOGV (lt_logger.h)
  • ESP_LOGW (lt_logger.h)
  • ETS_PRINTF (lt_logger.h)
  • ets_printf (lt_logger.h)
"},{"location":"ltapi/macros/#f","title":"f","text":"
  • FILE_APPEND (FS.h)
  • FILE_READ (FS.h)
  • FILE_WRITE (FS.h)
  • FlashId (LT.h)
  • FPSTR (wiring_compat.h)
  • FAL_DEBUG (fal_cfg.h)
  • FAL_DEV_NAME_MAX (fal_cfg.h)
  • FAL_FLASH_DEV_NAME (fal_cfg.h)
  • FAL_FLASH_DEV_TABLE (fal_cfg.h)
  • FAL_PART_HAS_TABLE_CFG (fal_cfg.h)
  • FAL_PART_TABLE_ITEM (fal_cfg.h)
  • FAL_PRINTF (fal_cfg.h)
  • FDB_PRINT (fdb_cfg.h)
  • FDB_USING_FAL_MODE (fdb_cfg.h)
  • FDB_USING_KVDB (fdb_cfg.h)
  • FDB_WRITE_GRAN (fdb_cfg.h)
"},{"location":"ltapi/macros/#g","title":"g","text":"
  • GCC_VERSION_STR (libretiny.h)
"},{"location":"ltapi/macros/#h","title":"h","text":"
  • HAS_SERIAL_CLASS (Serial.h)
  • HTTPCLIENT_1_1_COMPATIBLE (HTTPClient.h)
  • HTTPCLIENT_DEFAULT_TCP_TIMEOUT (HTTPClient.h)
  • HTTPC_ERROR_CONNECTION_LOST (HTTPClient.h)
  • HTTPC_ERROR_CONNECTION_REFUSED (HTTPClient.h)
  • HTTPC_ERROR_ENCODING (HTTPClient.h)
  • HTTPC_ERROR_NOT_CONNECTED (HTTPClient.h)
  • HTTPC_ERROR_NO_HTTP_SERVER (HTTPClient.h)
  • HTTPC_ERROR_NO_STREAM (HTTPClient.h)
  • HTTPC_ERROR_READ_TIMEOUT (HTTPClient.h)
  • HTTPC_ERROR_SEND_HEADER_FAILED (HTTPClient.h)
  • HTTPC_ERROR_SEND_PAYLOAD_FAILED (HTTPClient.h)
  • HTTPC_ERROR_STREAM_WRITE (HTTPClient.h)
  • HTTPC_ERROR_TOO_LESS_RAM (HTTPClient.h)
  • HTTP_TCP_BUFFER_SIZE (HTTPClient.h)
  • HTTP_ANY (HTTP_Method.h)
  • HTTP_METHOD_MAP (HTTP_Method.h)
  • HTTP_DOWNLOAD_UNIT_SIZE (WebServer.h)
  • HTTP_MAX_CLOSE_WAIT (WebServer.h)
  • HTTP_MAX_DATA_WAIT (WebServer.h)
  • HTTP_MAX_POST_WAIT (WebServer.h)
  • HTTP_MAX_SEND_WAIT (WebServer.h)
  • HTTP_UPLOAD_BUFLEN (WebServer.h)
"},{"location":"ltapi/macros/#i","title":"i","text":"
  • isr_log_d (lt_logger.h)
  • isr_log_e (lt_logger.h)
  • isr_log_i (lt_logger.h)
  • isr_log_n (lt_logger.h)
  • isr_log_v (lt_logger.h)
  • isr_log_w (lt_logger.h)
"},{"location":"ltapi/macros/#l","title":"l","text":"
  • LT_MD5_CTX_T (MD5.h, MD5HostapdImpl.h, MD5MbedTLSImpl.h)
  • lwip_ntohl (udp.h)
  • LWIP_MDNS_RESPONDER (lwipopts.h)
  • LWIP_NETIF_HOSTNAME (lwipopts.h)
  • LWIP_SO_RCVBUF (lwipopts.h)
  • LWIP_TIMEVAL_PRIVATE (lwipopts.h)
  • LWIP_VERSION_SIMPLE (lwipopts.h)
  • LT_BANNER (libretiny.h)
  • LT_BANNER_STR (libretiny.h)
  • LT_BOARD (libretiny.h)
  • LT_BOARD_STR (libretiny.h)
  • LT_VERSION (libretiny.h)
  • LT_VERSION_STR (libretiny.h)
  • LT_AUTO_DOWNLOAD_REBOOT (lt_config.h)
  • LT_DEBUG_ALL (lt_config.h)
  • LT_DEBUG_CLIENT (lt_config.h)
  • LT_DEBUG_FDB (lt_config.h)
  • LT_DEBUG_LWIP (lt_config.h)
  • LT_DEBUG_LWIP_ASSERT (lt_config.h)
  • LT_DEBUG_MDNS (lt_config.h)
  • LT_DEBUG_OTA (lt_config.h)
  • LT_DEBUG_SERVER (lt_config.h)
  • LT_DEBUG_SSL (lt_config.h)
  • LT_DEBUG_WIFI (lt_config.h)
  • LT_LEVEL_DEBUG (lt_config.h)
  • LT_LEVEL_ERROR (lt_config.h)
  • LT_LEVEL_FATAL (lt_config.h)
  • LT_LEVEL_INFO (lt_config.h)
  • LT_LEVEL_NONE (lt_config.h)
  • LT_LEVEL_TRACE (lt_config.h)
  • LT_LEVEL_VERBOSE (lt_config.h)
  • LT_LEVEL_WARN (lt_config.h)
  • LT_LOGGER (lt_config.h)
  • LT_LOGGER_CALLER (lt_config.h)
  • LT_LOGGER_COLOR (lt_config.h)
  • LT_LOGGER_TASK (lt_config.h)
  • LT_LOGGER_TIMESTAMP (lt_config.h)
  • LT_LOGLEVEL (lt_config.h)
  • LT_LOG_ERRNO (lt_config.h)
  • LT_LOG_HEAP (lt_config.h)
  • LT_MICROS_HIGH_RES (lt_config.h)
  • LT_PRINTF_BROKEN (lt_config.h)
  • LT_UART_DEFAULT_LOGGER (lt_config.h)
  • LT_UART_DEFAULT_SERIAL (lt_config.h)
  • LT_UART_SILENT_ALL (lt_config.h)
  • LT_UART_SILENT_ENABLED (lt_config.h)
  • LT_USE_TIME (lt_config.h)
  • LT_D (lt_logger.h)
  • LT_DM (lt_logger.h)
  • LT_E (lt_logger.h)
  • LT_EM (lt_logger.h)
  • LT_ERRNO (lt_logger.h)
  • LT_ERRNO_LEZ (lt_logger.h)
  • LT_ERRNO_LZ (lt_logger.h)
  • LT_ERRNO_NZ (lt_logger.h)
  • LT_F (lt_logger.h)
  • LT_FM (lt_logger.h)
  • LT_HEAP_I (lt_logger.h)
  • LT_I (lt_logger.h)
  • LT_IM (lt_logger.h)
  • LT_LOG (lt_logger.h)
  • LT_LOGM (lt_logger.h)
  • LT_RET (lt_logger.h)
  • LT_RET_LEZ (lt_logger.h)
  • LT_RET_LZ (lt_logger.h)
  • LT_RET_NZ (lt_logger.h)
  • LT_T (lt_logger.h)
  • LT_TM (lt_logger.h)
  • LT_V (lt_logger.h)
  • LT_VM (lt_logger.h)
  • LT_W (lt_logger.h)
  • LT_WM (lt_logger.h)
  • log_d (lt_logger.h)
  • log_e (lt_logger.h)
  • log_i (lt_logger.h)
  • log_n (lt_logger.h)
  • log_printf (lt_logger.h)
  • log_v (lt_logger.h)
  • log_w (lt_logger.h)
  • LT_HW_I2C0 (lt_pins.h)
  • LT_HW_I2C1 (lt_pins.h)
  • LT_HW_I2C2 (lt_pins.h)
  • LT_HW_SPI0 (lt_pins.h)
  • LT_HW_SPI1 (lt_pins.h)
  • LT_HW_SPI2 (lt_pins.h)
  • LT_HW_UART0 (lt_pins.h)
  • LT_HW_UART1 (lt_pins.h)
  • LT_HW_UART2 (lt_pins.h)
"},{"location":"ltapi/macros/#m","title":"m","text":"
  • MAX_PASSPHRASE_LEN (WiFiEvents.h)
  • MAX_SSID_LEN (WiFiEvents.h)
  • MAX_WPS_AP_CRED (WiFiEvents.h)
  • MDNS_TCP (mDNS.h)
  • MDNS_UDP (mDNS.h)
  • MAX (lt_utils.h)
  • MIN (lt_utils.h)
  • MDNS_MAX_SERVICES (lwipopts.h)
"},{"location":"ltapi/macros/#o","title":"o","text":"
  • OUTPUT_OPEN_DRAIN (wiring_compat.h)
"},{"location":"ltapi/macros/#p","title":"p","text":"
  • PGM_VOID_P (wiring_compat.h)
  • PIN_ADC (wiring_custom.h)
  • PIN_DAC (wiring_custom.h)
  • PIN_GPIO (wiring_custom.h)
  • PIN_I2C (wiring_custom.h)
  • PIN_I2S (wiring_custom.h)
  • PIN_IRQ (wiring_custom.h)
  • PIN_JTAG (wiring_custom.h)
  • PIN_MODE_ALL (wiring_custom.h)
  • PIN_NONE (wiring_custom.h)
  • PIN_PWM (wiring_custom.h)
  • PIN_SPI (wiring_custom.h)
  • PIN_SWD (wiring_custom.h)
  • PIN_UART (wiring_custom.h)
  • pinCheckGetData (wiring_private.h)
  • pinCheckGetInfo (wiring_private.h)
  • pinIsInput (wiring_private.h)
  • pinIsOutput (wiring_private.h)
  • pinSetInputMode (wiring_private.h)
  • pinSetOutputPull (wiring_private.h)
  • PRINTF_HAS_DISABLE (printf_config.h)
  • printf_ (printf_config.h)
  • PIN_INVALID (lt_pins.h)
"},{"location":"ltapi/macros/#r","title":"r","text":"
  • ResetReason (LT.h)
  • round (wiring_compat.h)
  • REBOOT_REASON_SLEEP (lt_device.h)
  • RESET_REASON_BROWNOUT (lt_device.h)
  • RESET_REASON_CRASH (lt_device.h)
  • RESET_REASON_HARDWARE (lt_device.h)
  • RESET_REASON_MAX (lt_device.h)
  • RESET_REASON_POWER (lt_device.h)
  • RESET_REASON_SLEEP (lt_device.h)
  • RESET_REASON_SLEEP_GPIO (lt_device.h)
  • RESET_REASON_SLEEP_RTC (lt_device.h)
  • RESET_REASON_SLEEP_USB (lt_device.h)
  • RESET_REASON_SOFTWARE (lt_device.h)
  • RESET_REASON_UNKNOWN (lt_device.h)
  • RESET_REASON_WATCHDOG (lt_device.h)
"},{"location":"ltapi/macros/#s","title":"s","text":"
  • SNTP_GET_SYSTEM_TIME (lwipopts.h)
  • SNTP_SERVER_DNS (lwipopts.h)
  • SNTP_SET_SYSTEM_TIME_US (lwipopts.h)
  • snprintf_ (printf_config.h)
  • sprintf_ (printf_config.h)
  • STRINGIFY (libretiny.h)
  • STRINGIFY_MACRO (libretiny.h)
"},{"location":"ltapi/macros/#u","title":"u","text":"
  • UPDATE_SIZE_UNKNOWN (Update.h)
  • UPDATE_TIMEOUT_MS (Update.h)
"},{"location":"ltapi/macros/#v","title":"v","text":"
  • voidFuncPtrArg (wiring_compat.h)
  • vsnprintf_P (wiring_compat.h)
  • vprintf_ (printf_config.h)
  • vsnprintf_ (printf_config.h)
  • vsprintf_ (printf_config.h)
"},{"location":"ltapi/macros/#w","title":"w","text":"
  • WIFI_STATIS_ALL (WiFiEvents.h)
  • WIFI_STATIS_BUFFER (WiFiEvents.h)
  • WIFI_STATIS_DIAG (WiFiEvents.h)
  • WIFI_STATIS_HW (WiFiEvents.h)
  • WIFI_STATIS_PS (WiFiEvents.h)
  • WIFI_STATIS_RXTX (WiFiEvents.h)
  • WIFI_AP (WiFiType.h)
  • WIFI_AP_STA (WiFiType.h)
  • WIFI_OFF (WiFiType.h)
  • WIFI_SCAN_FAILED (WiFiType.h)
  • WIFI_SCAN_RUNNING (WiFiType.h)
  • WIFI_STA (WiFiType.h)
  • WiFiAuthMode (WiFiType.h)
  • WiFiEventId_t (WiFiType.h)
  • WiFiEventInfo_t (WiFiType.h)
  • WiFiEvent_t (WiFiType.h)
  • WiFiMode (WiFiType.h)
  • WiFiMode_t (WiFiType.h)
  • WiFiStatus (WiFiType.h)
  • WRAP_DISABLE_CHECK (printf_config.h)
  • WRAP_DISABLE_DECL (printf_config.h)
  • WRAP_DISABLE_DEF (printf_config.h)
  • WRAP_PRINTF (printf_config.h)
  • WRAP_SNPRINTF (printf_config.h)
  • WRAP_SPRINTF (printf_config.h)
  • WRAP_VPRINTF (printf_config.h)
  • WRAP_VSNPRINTF (printf_config.h)
  • WRAP_VSPRINTF (printf_config.h)
"},{"location":"ltapi/macros/#x","title":"x","text":"
  • XX (HTTP_Method.h)
  • xTaskCreatePinnedToCore (wiring_compat.h)
  • xTaskCreateUniversal (wiring_compat.h)
"},{"location":"ltapi/variables/","title":"Variables","text":""},{"location":"ltapi/variables/#a","title":"a","text":"
  • arduino_event_id_t (Events.h)
"},{"location":"ltapi/variables/#b","title":"b","text":"
  • base64_decodestep (cdecode.h)
  • base64_encodestep (cencode.h)
"},{"location":"ltapi/variables/#c","title":"c","text":"
  • CookieJar (HTTPClient.h)
  • charmap (strcasecmp.c)
"},{"location":"ltapi/variables/#d","title":"d","text":"
  • device_name (lt_device.c)
"},{"location":"ltapi/variables/#e","title":"e","text":"
  • esp_ip4_addr_t (WiFiType.h)
  • esp_ip6_addr_t (WiFiType.h)
  • errorMap (Update.cpp)
  • errArdText (UpdateUtil.cpp)
  • errUf2Text (UpdateUtil.cpp)
  • errorStr (UpdateUtil.cpp)
  • ESP (Singletons.cpp, ESP.h)
  • EventCb (Events.h)
  • EventFuncCb (Events.h)
  • EventHandler (Events.h)
  • EventSysCb (Events.h)
  • errno (errno.h)
"},{"location":"ltapi/variables/#f","title":"f","text":"
  • followRedirects_t (HTTPClient.h)
  • Flash (Singletons.cpp, Flash.h)
  • fal_root_part (fal_cfg.h, lt_main.c)
  • flash0 (fal_cfg.h)
"},{"location":"ltapi/variables/#h","title":"h","text":"
  • HTTPMethod (HTTP_Method.h)
  • http_method (HTTP_Method.h)
  • HTTPAuthMethod (WebServer.h)
  • HTTPClientStatus (WebServer.h)
  • HTTPUploadStatus (WebServer.h)
"},{"location":"ltapi/variables/#l","title":"l","text":"
  • LT (Singletons.cpp, LT.h)
  • lt_arduino_pin_gpio_map (wiring_custom.h)
  • lt_arduino_pin_info_list (wiring_custom.h)
  • lt_debug_mode_t (lt_device.h)
  • lt_reboot_reason_t (lt_device.h)
  • lt_ota_type_t (lt_ota.h)
  • levels (lt_logger.c)
  • lt_cpu_family_t (lt_types.h)
  • lt_cpu_model_t (lt_types.h)
"},{"location":"ltapi/variables/#m","title":"m","text":"
  • md5_context_t (MD5.h)
  • MDNS (mDNS.h)
  • MDNSResponder (mDNS.h)
"},{"location":"ltapi/variables/#o","title":"o","text":"
  • OTA (Singletons.cpp, OTA.h)
"},{"location":"ltapi/variables/#p","title":"p","text":"
  • pWiFi (WiFi.cpp, WiFi.h)
  • PreferenceType (Preferences.h)
  • periodicTasks (wiring_custom.c)
  • PinData (wiring_custom.h)
"},{"location":"ltapi/variables/#r","title":"r","text":"
  • reset_epoch (time.c)
  • reset_millis (time.c)
"},{"location":"ltapi/variables/#s","title":"s","text":"
  • SoftState (SoftwareSerial.h)
"},{"location":"ltapi/variables/#t","title":"t","text":"
  • TransportTraitsPtr (HTTPClient.h)
  • t_http_codes (HTTPClient.h)
  • transferEncoding_t (HTTPClient.h)
"},{"location":"ltapi/variables/#u","title":"u","text":"
  • Update (Update.cpp, Update.h)
  • UpdateCommand (Update.h)
  • UpdateError (Update.h)
  • u_char (strcasecmp.c)
  • uart_port (lt_logger.c)
"},{"location":"ltapi/variables/#w","title":"w","text":"
  • WiFi (WiFi.cpp, WiFi.h)
  • wifi_event_sta_wps_fail_reason_t (WiFiEvents.h)
  • wifi_ftm_status_t (WiFiEvents.h)
  • WiFiAuthModeText (WiFiType.h)
  • WiFiModeAction (WiFiType.h)
  • WiFiModeText (WiFiType.h)
  • WiFiStatusText (WiFiType.h)
  • wifi_auth_mode_t (WiFiType.h)
  • wifi_err_reason_t (WiFiType.h)
  • wifi_mode_t (WiFiType.h)
  • wl_status_t (WiFiType.h)
  • WiFiClient (LwIPClient.h)
  • WiFiClientSecure (MbedTLSClient.h)
  • WiFiServer (LwIPServer.h)
  • WiFiUDP (LwIPUdp.h)
  • WDT (Singletons.cpp, WDT.h)
"},{"location":"ltapi/variables/#_","title":"_","text":"
  • _analogReadResolution (wiring_custom.c, wiring_custom.h)
  • _analogWritePeriod (wiring_custom.c, wiring_custom.h)
  • _analogWriteResolution (wiring_custom.c, wiring_custom.h)
"},{"location":"ltapi/links/","title":"Links","text":"
  • Related Pages
  • Modules
  • Class List
    • struct Cookie
    • class EspClass
    • struct EventHandler_s
    • class FlashClass
    • class FunctionRequestHandler
    • class HTTPClient
    • struct HTTPClient::RequestArgument
    • struct HTTPUpload
    • class HardwareI2C
    • class IPreferences
    • class IWiFiClient
    • class IWiFiClientSecure
    • class IWiFiServer
    • class IWiFiUDP
    • class LibreTiny
    • class LibreTinyOTA
    • class LibreTinyWDT
    • class LwIPClient
    • class LwIPRxBuffer
    • class LwIPServer
    • class LwIPUDP
    • struct MD5Context
    • class MbedTLSClient
    • struct PinInfo
    • class RequestHandler
    • class SerialClass
    • struct SoftData
    • struct SoftSerial
    • class SoftwareSerial
    • class StaticRequestHandler
    • class StreamString
    • class UpdateClass
    • class Uri
    • class UriBraces
    • class UriGlob
    • class UriRegex
    • class WebServer
    • struct WebServer::RequestArgument
    • class WiFiClass
    • struct WiFiMacAddr
    • class WiFiMulti
    • struct WiFiNetworkInfo
    • struct WiFiScanAP
    • struct WiFiScanData
    • struct WifiAPlist_t
    • namespace arduino
    • class arduino::IPv6Address
    • union arduino_event_info_t
    • struct arduino_event_t
    • class base64
    • struct base64_decodestate
    • struct base64_encodestate
    • class cbuf
    • struct esp_ip4_addr
    • struct esp_ip6_addr
    • struct esp_netif_ip6_info_t
    • struct esp_netif_ip_info_t
    • namespace fs
    • class fs::FS
    • class fs::FSImpl
    • class fs::File
    • class fs::FileImpl
    • struct ip_event_ap_staipassigned_t
    • struct ip_event_got_ip6_t
    • struct ip_event_got_ip_t
    • struct lt_flash_id_t
    • struct lt_ota_ctx_t
    • class mDNS
    • struct mbedtls_md5_context
    • namespace mime
    • struct mime::Entry
    • struct wifi_event_action_tx_status_t
    • struct wifi_event_ap_probe_req_rx_t
    • struct wifi_event_ap_staconnected_t
    • struct wifi_event_ap_stadisconnected_t
    • struct wifi_event_ftm_report_t
    • struct wifi_event_roc_done_t
    • struct wifi_event_sta_authmode_change_t
    • struct wifi_event_sta_connected_t
    • struct wifi_event_sta_disconnected_t
    • struct wifi_event_sta_scan_done_t
    • struct wifi_event_sta_wps_er_pin_t
    • struct wifi_event_sta_wps_er_success_t
    • struct wifi_ftm_report_entry_t
  • Namespace ListNamespace List
  • Namespace Members
  • Namespace Member Functions
  • Namespace Member Variables
  • Namespace Member Typedefs
  • Namespace Member Enumerations
  • Class Index
  • Class Hierarchy
  • Class Members
  • Class Member Functions
  • Class Member Variables
  • Class Member Typedefs
  • Class Member Enumerations
  • Files
    • cores
    • cores/common
      • cores/common/arduino
      • cores/common/arduino/libraries
        • cores/common/arduino/libraries/api
        • cores/common/arduino/libraries/api/Serial
          • Serial.cpp
          • Serial.cpp source
          • Serial.h
          • Serial.h source
        • cores/common/arduino/libraries/api/SoftwareSerial
          • SoftwareSerial.cpp
          • SoftwareSerial.cpp source
          • SoftwareSerial.h
          • SoftwareSerial.h source
        • cores/common/arduino/libraries/api/WiFi
          • WiFi.cpp
          • WiFi.cpp source
          • WiFi.h
          • WiFi.h source
          • WiFiAP.cpp
          • WiFiAP.cpp source
          • WiFiEvents.cpp
          • WiFiEvents.cpp source
          • WiFiEvents.h
          • WiFiEvents.h source
          • WiFiGeneric.cpp
          • WiFiGeneric.cpp source
          • WiFiSTA.cpp
          • WiFiSTA.cpp source
          • WiFiScan.cpp
          • WiFiScan.cpp source
          • WiFiType.h
          • WiFiType.h source
        • cores/common/arduino/libraries/common
        • cores/common/arduino/libraries/common/FS
          • FS.cpp
          • FS.cpp source
          • FS.h
          • FS.h source
        • cores/common/arduino/libraries/common/IPv6Address
          • IPv6Address.cpp
          • IPv6Address.cpp source
          • IPv6Address.h
          • IPv6Address.h source
          • cores/common/arduino/libraries/common/IPv6Address/api
          • IPv6Address.h
          • IPv6Address.h source
        • cores/common/arduino/libraries/common/MD5
          • MD5.h
          • MD5.h source
          • MD5HostapdImpl.h
          • MD5HostapdImpl.h source
          • MD5MbedTLSImpl.cpp
          • MD5MbedTLSImpl.cpp source
          • MD5MbedTLSImpl.h
          • MD5MbedTLSImpl.h source
        • cores/common/arduino/libraries/common/Preferences
          • Preferences.h
          • Preferences.h source
        • cores/common/arduino/libraries/common/Update
          • Update.cpp
          • Update.cpp source
          • Update.h
          • Update.h source
          • UpdateUtil.cpp
          • UpdateUtil.cpp source
        • cores/common/arduino/libraries/common/WiFiClient
          • LwIPClient.cpp
          • LwIPClient.cpp source
          • LwIPClient.h
          • LwIPClient.h source
          • LwIPRxBuffer.cpp
          • LwIPRxBuffer.cpp source
          • LwIPRxBuffer.h
          • LwIPRxBuffer.h source
          • MbedTLSClient.cpp
          • MbedTLSClient.cpp source
          • MbedTLSClient.h
          • MbedTLSClient.h source
          • WiFiClient.h
          • WiFiClient.h source
          • WiFiClientSecure.h
          • WiFiClientSecure.h source
        • cores/common/arduino/libraries/common/WiFiServer
          • LwIPServer.cpp
          • LwIPServer.cpp source
          • LwIPServer.h
          • LwIPServer.h source
          • WiFiServer.h
          • WiFiServer.h source
        • cores/common/arduino/libraries/common/WiFiUdp
          • LwIPUdp.cpp
          • LwIPUdp.cpp source
          • LwIPUdp.h
          • LwIPUdp.h source
          • WiFiUdp.h
          • WiFiUdp.h source
        • cores/common/arduino/libraries/common/mDNS
          • LwIPmDNS.cpp
          • LwIPmDNS.cpp source
          • mDNS.cpp
          • mDNS.cpp source
          • mDNS.h
          • mDNS.h source
        • cores/common/arduino/libraries/ext
        • cores/common/arduino/libraries/ext/HTTPClient
          • HTTPClient.cpp
          • HTTPClient.cpp source
          • HTTPClient.h
          • HTTPClient.h source
        • cores/common/arduino/libraries/ext/StreamString
          • StreamString.cpp
          • StreamString.cpp source
          • StreamString.h
          • StreamString.h source
        • cores/common/arduino/libraries/ext/WebServer
          • HTTP_Method.h
          • HTTP_Method.h source
          • Parsing.cpp
          • Parsing.cpp source
          • Uri.h
          • Uri.h source
          • WebServer.cpp
          • WebServer.cpp source
          • WebServer.h
          • WebServer.h source
          • cores/common/arduino/libraries/ext/WebServer/detail
          • RequestHandler.h
          • RequestHandler.h source
          • RequestHandlersImpl.h
          • RequestHandlersImpl.h source
          • mimetable.cpp
          • mimetable.cpp source
          • mimetable.h
          • mimetable.h source
          • cores/common/arduino/libraries/ext/WebServer/uri
          • UriBraces.h
          • UriBraces.h source
          • UriGlob.h
          • UriGlob.h source
          • UriRegex.h
          • UriRegex.h source
        • cores/common/arduino/libraries/ext/WiFiMulti
          • WiFiMulti.cpp
          • WiFiMulti.cpp source
          • WiFiMulti.h
          • WiFiMulti.h source
        • cores/common/arduino/libraries/ext/base64
          • base64.cpp
          • base64.cpp source
          • base64.h
          • base64.h source
          • cores/common/arduino/libraries/ext/base64/libb64
          • cdecode.c
          • cdecode.c source
          • cdecode.h
          • cdecode.h source
          • cencode.c
          • cencode.c source
          • cencode.h
          • cencode.h source
        • cores/common/arduino/libraries/ext/cbuf
          • cbuf.cpp
          • cbuf.cpp source
          • cbuf.h
          • cbuf.h source
        • cores/common/arduino/libraries/inline
        • Singletons.cpp
        • Singletons.cpp source
        • cores/common/arduino/libraries/inline/ESP
          • ESP.h
          • ESP.h source
        • cores/common/arduino/libraries/inline/Flash
          • Flash.h
          • Flash.h source
        • cores/common/arduino/libraries/inline/LT
          • LT.h
          • LT.h source
        • cores/common/arduino/libraries/inline/OTA
          • OTA.h
          • OTA.h source
        • cores/common/arduino/libraries/inline/WDT
          • WDT.h
          • WDT.h source
      • cores/common/arduino/src
        • Arduino.h
        • Arduino.h source
        • Events.cpp
        • Events.cpp source
        • Events.h
        • Events.h source
        • HardwareI2C.h
        • HardwareI2C.h source
        • cores/common/arduino/src/common
        • abi.cpp
        • abi.cpp source
        • dtostrf.c
        • dtostrf.c source
        • serial_event.cpp
        • serial_event.cpp source
        • cores/common/arduino/src/compat
        • ESPmDNS.h
        • ESPmDNS.h source
        • FS.h
        • FS.h source
        • FSImpl.h
        • FSImpl.h source
        • WiFiAP.h
        • WiFiAP.h source
        • md5.h
        • md5.h source
        • pgmspace.h
        • pgmspace.h source
        • vfs_api.h
        • vfs_api.h source
        • cores/common/arduino/src/posix
        • time.c
        • time.c source
        • cores/common/arduino/src/wiring
        • wiring.c
        • wiring.c source
        • wiring_compat.cpp
        • wiring_compat.cpp source
        • wiring_compat.h
        • wiring_compat.h source
        • wiring_custom.c
        • wiring_custom.c source
        • wiring_custom.h
        • wiring_custom.h source
        • wiring_irq.c
        • wiring_irq.c source
        • wiring_math.cpp
        • wiring_math.cpp source
        • wiring_private.c
        • wiring_private.c source
        • wiring_private.h
        • wiring_private.h source
        • wiring_shift.c
        • wiring_shift.c source
        • main.c
        • main.c source
      • cores/common/base
      • cores/common/base/api
        • lt_cpu.c
        • lt_cpu.c source
        • lt_cpu.h
        • lt_cpu.h source
        • lt_device.c
        • lt_device.c source
        • lt_device.h
        • lt_device.h source
        • lt_flash.c
        • lt_flash.c source
        • lt_flash.h
        • lt_flash.h source
        • lt_init.h
        • lt_init.h source
        • lt_mem.c
        • lt_mem.c source
        • lt_mem.h
        • lt_mem.h source
        • lt_ota.c
        • lt_ota.c source
        • lt_ota.h
        • lt_ota.h source
        • lt_sleep.c
        • lt_sleep.c source
        • lt_sleep.h
        • lt_sleep.h source
        • lt_utils.c
        • lt_utils.c source
        • lt_utils.h
        • lt_utils.h source
        • lt_wdt.c
        • lt_wdt.c source
        • lt_wdt.h
        • lt_wdt.h source
      • cores/common/base/compat
        • certs.h
        • certs.h source
        • cores/common/base/compat/lwip
        • lwip_timers.h
        • lwip_timers.h source
        • err.h
        • err.h source
        • netdb.h
        • netdb.h source
        • netif.h
        • netif.h source
        • sockets.h
        • sockets.h source
        • sys.h
        • sys.h source
        • tcpip.h
        • tcpip.h source
        • udp.h
        • udp.h source
      • cores/common/base/config
        • fal_cfg.h
        • fal_cfg.h source
        • fdb_cfg.h
        • fdb_cfg.h source
        • lwipopts.h
        • lwipopts.h source
        • printf_config.h
        • printf_config.h source
      • cores/common/base/fixups
        • cores/common/base/fixups/lwip
        • errno.h
        • errno.h source
        • errno.h
        • errno.h source
        • malloc.c
        • malloc.c source
      • cores/common/base/posix
        • itoa.c
        • itoa.c source
        • strcasecmp.c
        • strcasecmp.c source
        • strdup.c
        • strdup.c source
        • strptime.c
        • strptime.c source
      • cores/common/base/wraps
        • putchar.c
        • putchar.c source
        • puts.c
        • puts.c source
      • libretiny.h
      • libretiny.h source
      • lt_api.h
      • lt_api.h source
      • lt_config.h
      • lt_config.h source
      • lt_logger.c
      • lt_logger.c source
      • lt_logger.h
      • lt_logger.h source
      • lt_main.c
      • lt_main.c source
      • lt_pins.h
      • lt_pins.h source
      • lt_posix_api.h
      • lt_posix_api.h source
      • lt_types.h
      • lt_types.h source
  • File Variables
  • File Functions
  • File Macros
"}]} \ No newline at end of file diff --git a/sitemap.xml b/sitemap.xml new file mode 100644 index 000000000..3ec0a5f14 --- /dev/null +++ b/sitemap.xml @@ -0,0 +1,2758 @@ + + + + https://docs.libretiny.eu/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/SUMMARY/ + 2024-02-26 + daily + + + None + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/bw12/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/bw15/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/cb1s/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/cb2l/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/cb2s/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/cb3l/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/cb3s/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/cb3se/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/cblc5/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/cbu/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/generic-bk7231n-qfn32-tuya/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/generic-bk7231t-qfn32-tuya/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/generic-bk7252/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/generic-rtl8710bn-2mb-468k/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/generic-rtl8710bn-2mb-788k/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/generic-rtl8710bx-4mb-980k/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/generic-rtl8720cf-2mb-992k/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/lsc-lma35/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/lsc-lma35-t/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/t102-v1.1/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/t103-v1.0/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/t112-v1.1/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/wa2/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/wb1s/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/wb2l/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/wb2l-m1/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/wb2s/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/wb3l/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/wb3s/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/wblc5/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/wr1/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/wr1e/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/wr2/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/wr2e/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/wr2l/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/wr2le/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/wr3/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/wr3e/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/wr3l/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/wr3le/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/boards/wr3n/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/cores/realtek-ambz/base/fixups/lib_rtlstd_patch/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/TODO/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/contrib/lt-api-functions/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/contrib/lt-api/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/contrib/porting/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/contrib/project-structure/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/contrib/stdlib/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/contrib/ota/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/contrib/ota/library/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/contrib/ota/uf2ota/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/dev/config/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/dev/libs-3rd-party/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/dev/lt-api/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/dev/migration_v1.0.0/ + 2024-02-26 + daily + + + None + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/flashing/dumping/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/flashing/esphome/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/flashing/platformio/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/flashing/tools/adr/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/flashing/tools/cloudcutter/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/flashing/tools/ltchiptool/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/getting-started/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/getting-started/gpio/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/inc/find-board/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/inc/flashing-note/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/inc/ota-cloudcutter/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/inc/ota-openbeken/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/inc/uart-adr/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/inc/uart-cen/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/inc/uart-info/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/inc/uart-ltchiptool/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/inc/uart-power/ + 2024-02-26 + daily + + + None + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/platform/beken-72xx/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/platform/beken-72xx/keys/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/platform/realtek-amb/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/platform/realtek-ambz/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/platform/realtek-ambz/debugging/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/platform/realtek-ambz/exception-decoder/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/projects/esphome/ + 2024-02-26 + daily + + + None + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/resources/beken-flash/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/resources/documents/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/resources/tuya-pin-config/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/status/supported/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/status/supported_boards/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/status/supported_chips/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/status/supported_families/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/docs/status/unsupported_boards_tuya_all/ + 2024-02-26 + daily + + + None + 2024-02-26 + daily + + + https://docs.libretiny.eu/examples/PinScan/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/src/mkdoxy/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/src/mkdoxy/tests/files/docs/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/src/mkdoxy/tests/files/src-animal/markdown-demo/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/annotated/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/files/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/struct_cookie/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_esp_class/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/struct_event_handler__s/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_flash_class/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_function_request_handler/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_h_t_t_p_client/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/struct_h_t_t_p_client_1_1_request_argument/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/struct_h_t_t_p_upload/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_hardware_i2_c/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_i_preferences/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_i_wi_fi_client/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_i_wi_fi_client_secure/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_i_wi_fi_server/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_i_wi_fi_u_d_p/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_libre_tiny/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_libre_tiny_o_t_a/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_libre_tiny_w_d_t/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_lw_i_p_client/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_lw_i_p_rx_buffer/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_lw_i_p_server/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_lw_i_p_u_d_p/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/struct_m_d5_context/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_mbed_t_l_s_client/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/struct_pin_info/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_request_handler/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_serial_class/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/struct_soft_data/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/struct_soft_serial/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_software_serial/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_static_request_handler/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_stream_string/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_update_class/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_uri/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_uri_braces/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_uri_glob/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_uri_regex/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_web_server/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/struct_web_server_1_1_request_argument/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_wi_fi_class/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/struct_wi_fi_mac_addr/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_wi_fi_multi/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/struct_wi_fi_network_info/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/struct_wi_fi_scan_a_p/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/struct_wi_fi_scan_data/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/struct_wifi_a_plist__t/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/namespacearduino/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/classarduino_1_1_i_pv6_address/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/unionarduino__event__info__t/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/structarduino__event__t/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/classbase64/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/structbase64__decodestate/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/structbase64__encodestate/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/classcbuf/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/structesp__ip4__addr/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/structesp__ip6__addr/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/structesp__netif__ip6__info__t/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/structesp__netif__ip__info__t/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/namespacefs/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/classfs_1_1_f_s/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/classfs_1_1_f_s_impl/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/classfs_1_1_file/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/classfs_1_1_file_impl/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/structip__event__ap__staipassigned__t/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/structip__event__got__ip6__t/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/structip__event__got__ip__t/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/structlt__flash__id__t/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/structlt__ota__ctx__t/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/classm_d_n_s/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/structmbedtls__md5__context/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/namespacemime/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/structmime_1_1_entry/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/structwifi__event__action__tx__status__t/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/structwifi__event__ap__probe__req__rx__t/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/structwifi__event__ap__staconnected__t/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/structwifi__event__ap__stadisconnected__t/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/structwifi__event__ftm__report__t/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/structwifi__event__roc__done__t/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/structwifi__event__sta__authmode__change__t/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/structwifi__event__sta__connected__t/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/structwifi__event__sta__disconnected__t/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/structwifi__event__sta__scan__done__t/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/structwifi__event__sta__wps__er__pin__t/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/structwifi__event__sta__wps__er__success__t/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/structwifi__ftm__report__entry__t/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_51d9c9f08f6806a0f97badf342e5b4d7/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_061390acc221bc2d9c9cb2f4362dac1d/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_b638d0c61cb610adbc247035a3e10d3e/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_368b4a9ec74cf1c10b8199770b5e2c1b/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_e15f2f53a75910fcd29e18d04ab3723d/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_5e75bcdb2ffaceb01f94db1177614a08/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_serial_8cpp/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_serial_8cpp_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_serial_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_serial_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_94e03dba73a2283a03d5afbcd7ac96fd/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_software_serial_8cpp/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_software_serial_8cpp_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_software_serial_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_software_serial_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_8a0a878499ba56a6674d17f5d719a3ab/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_wi_fi_8cpp/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_wi_fi_8cpp_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_wi_fi_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_wi_fi_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_wi_fi_a_p_8cpp/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_wi_fi_a_p_8cpp_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_wi_fi_events_8cpp/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_wi_fi_events_8cpp_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_wi_fi_events_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_wi_fi_events_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_wi_fi_generic_8cpp/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_wi_fi_generic_8cpp_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_wi_fi_s_t_a_8cpp/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_wi_fi_s_t_a_8cpp_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_wi_fi_scan_8cpp/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_wi_fi_scan_8cpp_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_wi_fi_type_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_wi_fi_type_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_fbd007664e1d3c6800f6de85378c1012/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_20c0973793fbdc84288fa19008185bd9/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_f_s_8cpp/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_f_s_8cpp_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/libraries_2common_2_f_s_2_f_s_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/libraries_2common_2_f_s_2_f_s_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_0e053ac3caf93ca4495f626616698305/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_i_pv6_address_8cpp/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_i_pv6_address_8cpp_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_i_pv6_address_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_i_pv6_address_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_0a5433a1da7b2b93282c1ad1558c5479/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/api_2_i_pv6_address_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/api_2_i_pv6_address_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_a154785acb726885f254a47f397a1398/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/libraries_2common_2_m_d5_2_m_d5_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/libraries_2common_2_m_d5_2_m_d5_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_m_d5_hostapd_impl_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_m_d5_hostapd_impl_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_m_d5_mbed_t_l_s_impl_8cpp/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_m_d5_mbed_t_l_s_impl_8cpp_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_m_d5_mbed_t_l_s_impl_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_m_d5_mbed_t_l_s_impl_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_e34b8d08ec2a080356b302de1e1a00cf/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_preferences_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_preferences_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_540dc0be13f8284f6014d0451691d894/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_update_8cpp/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_update_8cpp_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_update_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_update_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_update_util_8cpp/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_update_util_8cpp_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_f12ca718858451d77068237cb7af4643/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_lw_i_p_client_8cpp/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_lw_i_p_client_8cpp_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_lw_i_p_client_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_lw_i_p_client_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_lw_i_p_rx_buffer_8cpp/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_lw_i_p_rx_buffer_8cpp_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_lw_i_p_rx_buffer_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_lw_i_p_rx_buffer_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_mbed_t_l_s_client_8cpp/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_mbed_t_l_s_client_8cpp_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_mbed_t_l_s_client_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_mbed_t_l_s_client_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_wi_fi_client_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_wi_fi_client_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_wi_fi_client_secure_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_wi_fi_client_secure_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_561e7e821afe2d99042aaa333fa070ac/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_lw_i_p_server_8cpp/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_lw_i_p_server_8cpp_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_lw_i_p_server_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_lw_i_p_server_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_wi_fi_server_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_wi_fi_server_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_947f33558ea20e7a91b0d58d77bc396d/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_lw_i_p_udp_8cpp/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_lw_i_p_udp_8cpp_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_lw_i_p_udp_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_lw_i_p_udp_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_wi_fi_udp_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_wi_fi_udp_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_5cec7dea66206196679083f825c4cd25/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_lw_i_pm_d_n_s_8cpp/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_lw_i_pm_d_n_s_8cpp_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/m_d_n_s_8cpp/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/m_d_n_s_8cpp_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/m_d_n_s_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/m_d_n_s_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_5ea3aad773d57a5f23d4c7a2455c87eb/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_317cbb6bf43941e79ffdd996bee8e3bd/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_h_t_t_p_client_8cpp/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_h_t_t_p_client_8cpp_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_h_t_t_p_client_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_h_t_t_p_client_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_0a3ac6ff289d4ebfcd0c797d13f9a373/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_stream_string_8cpp/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_stream_string_8cpp_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_stream_string_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_stream_string_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_f2f13d16dd1b4421bdcca863af8fd41a/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_h_t_t_p___method_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_h_t_t_p___method_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_parsing_8cpp/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_parsing_8cpp_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_uri_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_uri_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_web_server_8cpp/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_web_server_8cpp_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_web_server_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_web_server_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_84f0c24223fe15b4f2fbb2a476e54856/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_request_handler_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_request_handler_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_request_handlers_impl_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_request_handlers_impl_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/mimetable_8cpp/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/mimetable_8cpp_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/mimetable_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/mimetable_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_d96db7fd7f8e0e902a4f4b8f7da27505/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_uri_braces_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_uri_braces_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_uri_glob_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_uri_glob_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_uri_regex_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_uri_regex_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_466525e97edd1426939c6f6f1c4cc401/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_wi_fi_multi_8cpp/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_wi_fi_multi_8cpp_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_wi_fi_multi_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_wi_fi_multi_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_e7aea143128db3d890560fea5ce624b6/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/base64_8cpp/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/base64_8cpp_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/base64_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/base64_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_8526abab122814721f0f43c2acad511e/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/cdecode_8c/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/cdecode_8c_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/cdecode_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/cdecode_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/cencode_8c/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/cencode_8c_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/cencode_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/cencode_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_ac62547f78cd9f887119f688c741ca23/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/cbuf_8cpp/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/cbuf_8cpp_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/cbuf_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/cbuf_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_930634efd5dc4a957bbb6e685a3ccda1/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_singletons_8cpp/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_singletons_8cpp_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_2f50d07e877c964a6683aa974aacc5a9/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_e_s_p_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_e_s_p_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_e3ef11b23e60019cef556571ad08a868/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_flash_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_flash_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_264b85d2860d8f7b79a05bde705c2149/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_l_t_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_l_t_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_1f237d2cf3ecae9e1cbbfcb1aefdc1b7/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_o_t_a_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_o_t_a_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_bd1e4bd763507df1c98830c76e327ffd/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_w_d_t_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_w_d_t_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_cd39a9ca7156574bbf526216c63c01b5/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_arduino_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_arduino_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_events_8cpp/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_events_8cpp_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_events_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_events_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_hardware_i2_c_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_hardware_i2_c_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_bdd93a4e8b1efe1644b5e8d87982bdbf/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/abi_8cpp/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/abi_8cpp_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dtostrf_8c/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dtostrf_8c_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/serial__event_8cpp/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/serial__event_8cpp_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_1927ccce0cee954fb29eb9cedf1bc791/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_e_s_pm_d_n_s_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_e_s_pm_d_n_s_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/src_2compat_2_f_s_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/src_2compat_2_f_s_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_f_s_impl_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_f_s_impl_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_wi_fi_a_p_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/_wi_fi_a_p_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/src_2compat_2_m_d5_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/src_2compat_2_m_d5_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/pgmspace_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/pgmspace_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/vfs__api_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/vfs__api_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_7c3b5015b008a83a07f1017471251f6f/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/time_8c/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/time_8c_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_7b42ca4cd5530baa6d3cca740865775d/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/wiring_8c/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/wiring_8c_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/wiring__compat_8cpp/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/wiring__compat_8cpp_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/wiring__compat_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/wiring__compat_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/wiring__custom_8c/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/wiring__custom_8c_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/wiring__custom_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/wiring__custom_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/wiring__irq_8c/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/wiring__irq_8c_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/wiring__math_8cpp/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/wiring__math_8cpp_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/wiring__private_8c/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/wiring__private_8c_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/wiring__private_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/wiring__private_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/wiring__shift_8c/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/wiring__shift_8c_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/main_8c/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/main_8c_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_715308b29b364e222d2654a6be231c22/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_c7e317b16142bccc961a83c0babf0065/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__cpu_8c/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__cpu_8c_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__cpu_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__cpu_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__device_8c/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__device_8c_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__device_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__device_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__flash_8c/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__flash_8c_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__flash_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__flash_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__init_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__init_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__mem_8c/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__mem_8c_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__mem_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__mem_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__ota_8c/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__ota_8c_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__ota_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__ota_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__sleep_8c/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__sleep_8c_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__sleep_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__sleep_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__utils_8c/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__utils_8c_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__utils_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__utils_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__wdt_8c/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__wdt_8c_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__wdt_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__wdt_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_df2c4eb2fc0858b25d84c91a81f7ab75/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/certs_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/certs_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_8dc93de83995bf7a7f7c574b7e694258/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lwip__timers_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lwip__timers_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/err_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/err_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/netdb_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/netdb_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/netif_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/netif_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/sockets_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/sockets_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/sys_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/sys_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/tcpip_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/tcpip_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/udp_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/udp_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_117c171b5277df11652dc53a144cb684/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/fal__cfg_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/fal__cfg_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/fdb__cfg_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/fdb__cfg_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lwipopts_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lwipopts_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/printf__config_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/printf__config_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_17709fc88a4f25e302be8aa6231cd94b/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_07703e3b72c625f10ef9850082fac0e3/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lwip_2errno_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lwip_2errno_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/errno_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/errno_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/malloc_8c/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/malloc_8c_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_846e8f2c00731a5babdd912d0551347c/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/itoa_8c/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/itoa_8c_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/strcasecmp_8c/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/strcasecmp_8c_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/strdup_8c/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/strdup_8c_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/strptime_8c/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/strptime_8c_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/dir_b483440aeb16b525e6183721aad24145/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/putchar_8c/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/putchar_8c_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/puts_8c/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/puts_8c_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/libretiny_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/libretiny_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__api_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__api_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__config_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__config_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__logger_8c/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__logger_8c_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__logger_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__logger_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__main_8c/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__main_8c_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__pins_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__pins_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__posix__api_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__posix__api_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__types_8h/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/lt__types_8h_source/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/namespaces/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/classes/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/hierarchy/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/modules/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/pages/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_members/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_member_functions/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_member_variables/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_member_typedefs/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/class_member_enums/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/namespace_members/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/namespace_member_functions/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/namespace_member_variables/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/namespace_member_typedefs/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/namespace_member_enums/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/functions/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/macros/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/variables/ + 2024-02-26 + daily + + + https://docs.libretiny.eu/ltapi/links/ + 2024-02-26 + daily + + \ No newline at end of file diff --git a/sitemap.xml.gz b/sitemap.xml.gz new file mode 100644 index 0000000000000000000000000000000000000000..db8427115c85852dadbab0f62a5b7fdabf22f274 GIT binary patch literal 4369 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 LedSW&DRcnfn3`uczWb2Cc+ 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%0D%fn+}XbAF-gk;jI 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�SemQ-UbaXj6*HxdO(c>cwu(7v9}+h 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 MlYd_#^6AU}0*n)&tN;K2 literal 0 HcmV?d00001 diff --git a/src/mkdoxy/docs/media/Basic-implementation.png b/src/mkdoxy/docs/media/Basic-implementation.png new file mode 100644 index 0000000000000000000000000000000000000000..6f51df876ec7f7d9c1c05358851c455d81047ebc GIT binary patch literal 131857 zcmbTdbySsI_XUa~ARr(hAT1&#&7o64K)Sm*ba#hHNOz}-ba#VF9J;%^yPLatzwiBi z|J`xNWekjSo^$rI_g-tRx#rwYkgT*Q8VUgl92^{)*ym63aB$CD;o#uypCf`-_+;Cd zz+cEVpVjQ);Luwif1kjta}B_Y_zuFV4hq&r4$gXZhH%c#&J3nj=JrrM8$$+bJL8mn zUII9{H*jK~J}SDT?#>zODo!LF9zBG*9cbkaQIPq)6ilRagY->KA`)TGV!@_3rP;eE zQyj-#_vS3HU_pB?3GtZvzA*PWz(0k5s`ye+uu0&$hk6uRpfB#_U%`o*_T?Q*BeuD(9 zW$~k{20p6)jQ{w3Lo%M-tN7cv-OmSXG%XtUw+#yEdM7XL%{iykF6suRA2hq#hI|i} z3-|f4p%gds-e?%c4OTOs0-hcAx6m)8d29S#k;`;EAjGG++>5=rAnU%}kjy`1vUBUo~Lb0 zUMa$*r(;WZ+AwNAjG&tl61duK8O)|xI(mNn=5}16G~(($=M_C1@|tk7$67nF$NK)B z4d2!91^#MxN(tR6X-b6sxjdzKR`ieNVz@$e*7W0i#QO!&8@W6-mxk$)!P)UOH&z0A z(SB{cbEr@Kn}{rb{20M+hYc6bThmf6h^7}Lz`x**8@4Xek`(2W8alA5Z$@So7LVHH znkvx`RW^77caj~t?4XZJwK8I=VrpWk5S8kR^TjC+(HM!gQIi;s`hCHV?0K8`zNkc2 z!EYFUkKBAVbIV$(^9srMN)#v7?Tj#uu`9qwIoc+>t?1*<0~YXpV&j3Ojn z?+DtF5TLy{vZW~a9-2QL@FWZ#gvS)-CO%Ji8IIjpHdr zQPEyyW#!Q1Y`%L*mXd!~lGoB=j*&lRMzV~2{rxeMs0OY0do!!;8EMD6FbZJ?^zqnv z2cqwlg^0%A!gWI%GSO6e^3nQFPPB|^XiC-ubdme_iiA*OZ288H9VS#5RHe}QaS zZg9u0Xn9+bpZ}gGd3t-l-2={LM`z)%Vk7%xWlgSdj-<%FCBGOGiBMwBoIL9(kA(f) z&ha*)Ch=JfnX`Ra&d+-Cku`NCJ`#p=!~wO1$zGU_Ck*_4ONk+FQHP{Z8T%i#H`^o5 zkaDN>O2|l4vQvPHb5Lg)<@6Up~(uu!NQ-NhOKXjR_xN zEmmbhZejFmzLvlG+>s5$B@z{&oZj91>$$q+;?rHWqA3_&^u(<(AYQr3s#rOmG8EZ%T}1#Dy6l26@5(_Er#=Gpehk+a znh_sK%)NnczujInhr&92P%X|dqUFNlj#lI?%cxIm-bh}fty z&K@pS2Bjz^wzuHLnf;o-VN7W?Q&ydn@NC>uCz6Kezu$0(#!HfB;;jyWtqu}fnsQya zGMLzE@Dk{!SlirNcZ9^Lw^~1xHR!CUsjF@|4b^j*=aiSr*X)ctFQi2iSA*FEx^GVA z2_BG)cUo_#*@McP*BEc9$a19NMyS+Bn z%Vks7z8Mn}7q_OP60rLjDbRBEx}*?&J;FO2L3g9sB3tTweTyoFqB~iZdNGIb z+xHCxTm^$ti+_TCmRKP)1nndonDPQX!n!Ug+{8VGWiSn2?@i-Yrr ze5tTr7pK1^w&ji+y2~5Cw8NSb?A;gpUJFE18Aq(ayk{L+a#-HP<0{V~+PZN&6&S%c zL?VNYsv*F?AGqQ3M^fIvDpc|E5@fW2KU~Im>S}iMa;_|W+Uni~SE}#5_VpAp9A&8e z21ZNJ;z?hg$CaZ|!pZ$w1U5d`tWOp##-Nj@>-gah^xHdcO3W15j)MiRfkw6F#{0}6 z#EKxRv;CQv*Qrs!K+i}Xu92^-2xeG(YN)+n*Te+d=wWSs;Xr%p9s3W;UEb7KG_xi~&##a}+BVC5J1iQ@{4-dqtQUf0W zpH^a*6@h{8@{YXT{b@_B13G9F6h*;k8Y4EP9MB_P?*NRljg1z*F!7>41F(Px_Z{Zo z683Ui4Q|}^4!ZP%fra^`wg_+A=xFm}3sA$BmnO`mNIpE}tx* zCPH(9FI!ruHm3~@CJwJ7L@L1A=p6KP^!5g-C?nYeu<(8;f#i-6i*1@FjonVPL_qa_ zAyEyy!e;A2g(#5E-)5Y|DmiFc+nG^#U#)z~mN_3TV15Vog}3nf)hg!oxiD2ZBlnS) zjL_qZR(W^*6CN%wBDR{WtS3q>RVWFoor<9L<{DqBGALq_wTs*>t&E<1un)1xVWp7(?GK z$=7K|t=u0US3b3(BUYgPP&7o)Th7cPzxfmrymMf>#U(p3oWCxxzz-|^a~_J}47JFm zeYoneu{+thjHuDiE#9ijjshLq5tHov0rF!V7Yr=;^DV8&G~;@8eL_$F z=jd3Im~_!o-CI=--@S*s9Oz{aDb;op9?5ohW!HQvzsld5A%BlbetaZ%h_(yEA$u`m zw#-p>mXg%+T6mTY#Y8d_yZrK+Ue<*4581^%)1sOECJ6QFQuYG+8xueB{bJ%I{`7t2 zT276~D6Q5G%dN(H(uJdM4^3ZMO6VnUpUsZX`ad?msQ+zYdB3wCbpD?04KxfvyqF%J z{4BOfZ9Hm5zlKAM&uh#WD=RnETQ2Nt>%=-?PRctR^c^!C+~m)mWo8Iuc|jZbN1a;x zv0&OD4NWx-NIDCD07V6XI7>j%(1msfx(7F>DcPp#il2?PcB~r> zJ3XynfqvzQwSS%RqK-q+YKVMeJn!j_rI)D%cR9!S*YzMxEHQc3rBO<3=egaKYSIgn z`F~;|jBWz!KS9x|?Q*4z7t<})muob{>)kvZBc*j0MqK@q(pACHlPf-~iYDeQ-}A$Y zwH?o?`g)GNJ%am-rf2i_1E24&Ca9bF)IM8U68bh41to6^D@oDrG}rzlJh?I!SzI^k znjVPG%QXWn;5|(2c4v;->pXMl_7acEQ6q&=-^{G-E0-7C+pXb-RnSz zOwtn4vxU#}O-o{*A|$mYlum2vez;qCE7eEbV21N*EGAB&r*kP>GGkfl@H3ToPx9r= zw1lQOJFm_oeb&o-%|5GBP581VtFEr-LIf-ri7R>QgKJC98<3UHk7Q$#|6i1xUx($j zmbkc{GviACWbxx4&JhOxKh++e8I)cChl5fN?)vd&LG}1OH@>efG$(lE@Zx)M-LiDw|8>BE zFMeAZ9;>Q37>p~j#?D4{{re%1-ad6jk|d}KgmCY7uJKl{h9bNK#g7f2B4YgM=}F1Y z7jM2c*_-oSo1@)<2`2FT#|i zT!rLXZX)m@@q05h@^WfjE2y}~yAay0o`IE2Z_mK2I2^`8*QDKD$>EWa(`#3EH2te% zV@{`C>V#;lCyCsK1o!t(JQ}U&!@|OPlOPzPNJv_w0s`K+jN0ARmKvRXeR`XNdc0?= z5Rc}2?BI})!^1;^_TY`l3U|CbQyS_x@y22#$LxVbVM{4`jT$S#%%Mdvn7zG3!p@Lc zm1bk&hs{JLtw`AHZ0h&#y6hI0niEzAx-T1?_6#2GJ^ca#%1xHAP*6^$sy%7J3h>_a zzNeH)|GU(RbmJ)lQ2Rd{e6&e$Xh)A)5l)w$oQ*O{pww~$Ylqntof5oP;sGtd><$5_6Kq)lQ#x^L#3bcytP(ovd=tVfYQtKE~>zvKP5 z#>RMX@87>Sv9Mrrkvc-QeS!Y^Yn3C6rF!wZoT8GFoT6r~Ik;TH%nSt#6oQA%1c8wA z^T#JAo2jd-f3EjHmcc0TT9El~yaNt3jYzaw_OGrZ`*3|t=o5Wj?KG`EV`ADAMK&@% z9-fz!r=1}dlM@*iCuU_8K7Yf`UJVADe_hg)77#$VGBY)!;5lOZWqaGqVvqYP^ZEI? z;=Ens$WZ3DyyE=jq#TvQ9-Z3&gcCe{BO{|yORx%4Txy~C5X3KKP#BQnoF!7+=33YY z(B4-C*Vl75?XW{Qc$@#-0J2Zci2q11_81`y)>Gw}G8i(ry*j@xygWUL$H&?0C&aU` zBv2*hcBYdFc6Wh@QBzZsQ(R46E3cs73+0%J<>273JskA9Ke}JITpfuxJU%vBZtI%s zXC@;HXa1pA+fcW%x+^I^oaLpH^M9jyqt#N%*g8^@l0FbiSvodxGz$?B5U92+L6nPb zpGe>e{7G+W7zBY|a^hKeDo}(&tDY5%^;bojpg?g#N(=>pvK_-(ZmQf&E!= zVIq8ad%G%7+mzD9zV_+ zN4(D3+FH5ug7*4=I}stFhMBqfFJry?(WsoBn7zI+S;Q@Xw2zX-ZX^791*FN!6o>M)A`4=!l?gvChQkW zwQykiPnOL(hjl1Bdq}pIF5OSxJC(CLFUD;hd{=xO73usHN~3Xb+15ND^39LMRQ?s| z{YldeAI{_Ceaf5%K5BYj@DMre18d=ty!zE1m}N^-+?04Xffb;R$th|I3a-aWwV10@ zPjeKdI`uR*GZSC+3rcOVIrowg2A^>Go|v4hZ(snr-+%Jr=mQfA%ir1A+wgF%(l-(R zYY~&@d3fJ;h)U|N_o^8f8b;al6sv;~+cNt{M_*;x{dVX7XD+;ovEqg`4bB*&U(Ao; zuommuuTYs&TVC4#=j(YRL&L%-I{y(EZPVoQ+D1n!F9PmtG(M6%jvm;|!pywI-Z{eW z#!7#(v9N;w*ntbqdKwK4C3ZMSJ(r_?m6(_~J7g~w`A>1W@QaF)tNBRcDEqR=y3sbm z_?_Qo7srB!kcS5^txB;$XC&D_-QH1?;q2sd#IL;KS@QpJS1!F+*x5yX$iC(sU-*^^ zY72u_{U-JN0V#dye1rfw0$$)B4_c#@$WqHvzoL%o{%1(AhWyST*5K=Jq6!!X1nwyQvwO4H ze0zms3Exr^6JMjCpuFaFVKN^t+&WKS6crVXr`HImsDOM!CtltuX<2W_(`hWKBh)uG zhQ-n->|fSm{OpHIi;9Z6Eqiz#HK6sJY(F$T-3Pc`r@hH+3Bkv943r%U2YIuQ5L~`L z?IE^c4Q3DWHp^<9b*~f#j*sfS=d0`!lak6juEd*f?Z^R)ID2@YqDrJ|p0jFHd-guYjy!_XMgo!Wf^rsM4 zx0}?q*31+8gPsR|P!t^woYK9occM^_={!7W9M7s!d0jOx(i0LmP}doaM%K?*+1Tb= zy3jtDZR4n`CtJG{@$k4S^WMOZ-|vt*>ndMFWM#2IvIqY5^$`QCK%MMp)6xVztIT`_=dkW*Ftohz3qCMj9#3&9f%oOir{8_jEO zCV}JNsL`Hr3dbWNk`xm|MnFJtad+PdZ@QRwkBy5v>gPFtBR+HNPv?`6mPW6tssanN zw71uHd9;Fzj?T{M1wtB-2a5OagI!P7w}{;@=A83NN;dj97Csdz+uz^1Mn^|e)6!;E zRpAg45(c0XcdvEG-K{+Ot!KLBZ|>F9oexn{`+fpmHDZb;UKX^mVZx@8W>qb%C@YJqnRg43 z%M>Xy8+#8bDX056ol3FhkNSFoFcII(O!AK(KT4+asvUT6?A$J>8Gnbp1ZoBttgNgI z)W)IV;jeLVI3Q_52|2BO_sDg&vf!tX998cf*(TM1lI1N!2vN0RqCeQYcJ$ao;mx zWVnRMd|mUgUEi-wzn4{{el^%56kb$B&&I~4sG~%duoVYMp>J0CDu8Cr; z){&7IGNFL)LnhSJ)Nk0?<3sQmk4F_`FbN2z_b%VZ1w)McZ5Dq&>Fw(~Iz4Thm`DH| z3*buUz`(|Gdq|;L1tKW9z860l8&e1PZ$k6)-_Ma=h=_>9#>Zpf;faD0fQm~uh-&c| zpYidyiyiyw*i?TA^gRDP3m`peC^zROqx2q!$7%NsGczVRIk|_YCq9e8^P-|6@HKWz ze-ZSd&?GK*dA+B>foz1IcXWr)Er2 zV8qc;#q#oUPWyGq8j0QhR4ySeuV#i#$CIk6%F0s98TMk$y02wr%%H@)AmM%OFZdBG z8G!$H@7_7MTc%}XiDZ(|(uNdi)clms1LXfV2=9OZL@<9&k4q*{1R76=B_<~)ZMH{g z(22SI^73dvbhx;>$^j;$r$;6%EUek=kwkj8DXPUX!#ywo3XGK%Lkhd)&!VERkG_aY z`}@-N_7GQBS1_N{$w^ghk0asPxjD4?gp>+btFhtXzW}oVEr)@w?aLQ9I(quNq9O`% za^Kk4SAs%9uG@JzzicXAE=M`>fEsYtc{fp=m*)d9mS(YEC#trX`t64tlUrQ;mW>TT zhg5)4I`wN&5it&qVQL`1h@l|@T*=+)hR6AoXnkQMO-!bVx%I|u9i%DUzH{-%r_hWq z;9~l|zBZ~h+bg@Df2#j{%se_f13={eL+IPcpzMGT{LSGxNn5RLl*telv1cggem;2D zDccO1Jbn7q#MJapdwbQ&pR+c(Vr}~UGXh*XRX?!Y1u8Aie(%rma>3Mwim=3UYLpK^iZWCAhiI={NQC7oYZI9&J4BH=GO zdS^ocOPBU^{<^&U7OulT0yf$Qr? z%4zpUWg?xeZ!hl#D`);FEs@G&qXU6qBMPCrA78#Ke6d&s~qZr~tHw&L@J$)E#p0#{3AOP#_4ds}35n_aj7L3_}B67Yv)mm*iW8>hk>vY@J_Nlw4 zN3GU|Y^5V?pdYS15R+WB-hl@6VQw(6CsTFyRH6|i z?fw1XwksWH9`M#>?iW^|Ry}|5Vl{{=eK1AT-JJ(qu?8v|2uI`F(;R`ZIVu2Z3Nn1{ z?gve1S`-p&+L9~(WGk#g_3JjTRbMWFA~P`+FJV`U!){9 zb6kaN$)THBLIQ%xMpp8tQ(I+YVi32auwh6-(NzDwVS$6w?>lqJ?piV7>upMn#bWQ&K_auKbjEtE_k*_Ldz_t#66oEvTicM*|dFaKj zeL;40Ro9zgd`Tt$f0^@1f!~?h!Fv)=PemB9u%M7<5%&) zp&mIhSc18RmgSSP9k^@WgBc|yt@diml*`RbjL+iY2J^H2p6@*z-(G8g?3}7`#skBX z)9<0cWoH|4a&wh0g~&`cT$n#16_6Et7k`N)lZ2pNWa_L{eg1Sbg|#ztX424uchT560)=gOg7sV$wa0n0s;a++_+kek)ft< zx?3v;fo3?CuM|qmQ!OzFDp>^B(abTkppcNAi%In&Tx@J?ZMUr~hK~rKA{ZFF3&Eua z(oU)S#l97chK5G3Js1bEhSAx^Mz=4SjgyND6gCkvv;2A6Fp<{ty%|$;bLiRj7@{x6 z{QUf5g?MDd;KNVGJa#mrjr8>XbjQ&)Jad5)2`B0TwaQ^i;VvpYU0PD|Me8?=jk=BW z9V`>jgX!JhUV+>9F`p>5y*@Q`QtJ2ePOuhN__{ytbATq=;I%fmnhCD=jUpa*?_}NFzK( zZ6HV8J#s9`4F0B`4J%8_zF-_$CU$m81_tQ^H!Ec=Eh!flPKgADG1No2`ri_tKR&uUhe8QN^y^@z#^rNXMO<^I;;Bb))KHb^dz~I-==&YY|0mWLkp`sbi`8j%% z^X{J{NRDitVr*Q3ytZ~gNC*V3^;^Wd^;vv%4GmL^LMn#)r{p4t+t;S71Xx)54a5_p zy`k0B#TfI>D-E;b;{kO^Y68XTfc5bMV)IA@z-D!IbuC$Y-w^JM7m>5GE31^`w18LL z3-PhAu%0q43dklfXiY;S`2Yh3EedE-Y2LqQnWSW5iv0flyA_OygJXi8ipP0Bb-oO6 zAwXOL0|S3AEVRrpgW8(Nr1umsr*{+-XAWYBfD#Q(PX{+Oc}57A@gyXJPGtx{+{O_G z32z_(_MUk99cEv1P)C4R;Z%nK2Ze=GaB?R8{VUk?LDIp26-c&^jXDX*d{%~d)>}@_ zN!_sYl)Bp5#pUI{V+AS=bB({dyYnUPvQyMlRhcX%nOF(XK#K4g@qnm#B&>kY);y5` zP0o7n*44KP0K7jH-v@<-31`WlO;#%a(9V&`=$M;pf)TF+4a0H5d=mmB7uyX!yPhg; zHrCOh`FRl~M+!I~%CWL;G79Av6}5K{+c0Gb04XbwNB|QFNfZun+1!#HK)@9gPQnDc zL6cfpRkh7WS6Nd~kM;!!58L-e$^|@L!mRB0gC%x=PuJG@W4>Y)zepF!YzH&wiKYi? zAEiuEKtl=-kp7@hXnq0DQ;o+_+1WR%tW6q^nC5K{tQ)N?3PnMyWoRlaWhvFNF-J-+ z@{EPs;DxfXvPq?SAze{v>83^+l2E;u@*dDsfXx&DSmnHDK|w+5boY98vnAiY$=LXG zaGvSJz@3#xf|Qh$Y28)>FrS?Tt^E;h-RBh!Ubo^&*Cs(TS5~ydHo3kekAp%|@wzW@b9}L|?lV4PrKeAj<*t zA0)L^g2R)>>+J%*{uO0IL&MnESSE0-FTP++Klz(CUn(nE&CJZ|4c6#1szVzadBaKg z#C3IH81xHXH}qghcmYHsme9X@_X%%zCk&)KpdRb%MosR6TvjeFE+sszpdvp3{>1E# z@%rlOC(!4eot?QM6!F|}adPU8_e8KeIXS%`=8io*br2U9KaEFox~S7>_Q0=FmohLg zD8U~T`i9;PW;HuI%cHHS2qYpzd6z2&Q2-D&5 z`5HHhlMVXS-Xw)zIwd}USU-L?kI}6jF-&A8%Tq`QzKbS7OuBh=XEKILbZC0`Z+71f zK&Q~xn4b^N7Gg@jRo5 zQzAYyQx<4eRJoRx$4!A6I6aMBs~1(bn$2 zJc>ATE1qxZdEd0dqWEiM{*TY`ak=&Y1;E{qoE$2^l8iwo59S{Uij2BC0hM&>Vp|Y) zZ9@YD+7W7Hp6O8Uh#W#jNeO>b_N#>ZA-CCSZ~6-iz<&qm4nY9q=jYov?RUNfSkXQ_ zTn?-Ml*WAn^!Kyja#~PaM)MT7Ksy8=3JS*IGeSQT1wscL5D7fZyiXiw30AjWtUr=e z;L-pr1}g*h|Ao1^xlpTP0mOZ4oz%pw$8SsG&tZRWNwXJ+&&<8o_2uR37sn1c0vTc( z{d%BL70MjyRNe)-o*)*vQQuoA`Iek&d1vKOFU}MR>u789`};TibQh3A50Bf=Vq$;C z$I-nX{=Cz!FS{AEFYx*-C`d%3!r+WQ1Bh|(j<7Yz1mr`EH(PcGJ~2E+Ip!vorX8J~ z&m|;i=lUfRVi=h{r|G)IOXQTbgY)w6oB5j!j0_#{XWB+%%_qcxE%KU>5c?J9cJ@j9 z@cev7A~O^SL%&BxP<3sc?FQbWIFt+yrKf}_V;7ClApqCV`5}C9e+I9qAjt^^bHQ zNv&SOI6YS1P*P?C3KJe1yUMSl;wp@f;*Uj0$g{oEfWdTruEoH}*bajw0AW~CQt~-E z$`DQ`B4CS|Wo2@~45(zyc#kimpbXO+13Tv}KYu!42kh4Kz3m}*u7H8N_Ze+Uc|X0m z8>_=sgs$w})!LqL_V*JLlCiR~ejhWt8Y}S{+ptZx?xx-c4xAC3&F&=gc(GOpkWm1O zF+N=U16t}@nUAPK+%>if6~-9u=et|>E&Ijfpg4gp0F!X0>{GoxzKS*AphrhXkB#!r zpKp_sldpLbkhF}`el&X_?GzjTYPs2OxZ{=q@zN5^0}h#P3LqbAs_5wS+{3#kahjr> zSXkuc7U~YnmpHa`re5zqt1#-P;52!4hIY2PzP5S&{uK%xeGzq?)7au9EW*3z))f`x zdrn@SSP4mA)946WWmOHZfO_)d1~L^1$}De;j!*2l?9X3S81=OSKmfTG9E^g7=nABz z)?R%3*W3=5XHE$91WW*)tj`bh)D3~}6M^*Wp-U?pJ7GgbLq z-+ZF1V^XCqFCYDyizN~jPru%BV#fJOepuLOAQ{$;GcYna`B_iy39w7*??EwgYPd-O z9^7VQQ`6D;xzT!WlE>ZI#N%E7rTTa|gmL~L47pT<~l$1b>@&TeBHl?KQ>E_U#xYWUm>}LoFTb5z-grcG_ zs|evwpEkepKI)R;N{WhYz;4VdF75y0pl}m&4{uL&Jp@$;ti$X`P*S zj)=b3je zHUg0s8~DuTva1YG`m=Oh)Eel(<_yy_JnEG%4uBKtID@z7i}5g?V-6P>#3dyedT;d# zAK$dTsM=j#POd*;hJCBa`9Ax@C!m+iR9lZXX_x9EqoK9ePaGZL1xB*^4io9`{A%70AMfqDD(c6SHI z(W;a??Wxb%6@$JQSXlU@__13+tMrC#^=g+_R~vOjQ`E3Ic>`^V$#GjTTRJURJnLs^ zX(S+lpe3FxH$>eS$k@2r$l$2eoQ&+>d5(c`PzL9ylQ(7tz(1=1QUMzDCi)3$B_*YH z7^!!tNaj+Kak^e_BJ&&~yL1}2j_|~N2jIrspxo)xo_-nS2%NXIMixA3Jcp~1(HcD{<*o-fEaMvt$wcA ziy-C^kpM(4o{o%;ZubWr$*imO%{6i3NJbEF!FWW!@-C;_IM^7h1#h^ntxY7d+M;~J zILIlp)t#Bk&dHHiAV1RwGnR`^O6t15yXorf-EBIO;&$dF*u>qr5ZoBwA|WAxClSh$ zx80j&la!KjY=As@LBJZAotvv2Ohp}A2=UMdr^X%*r!824s?GD zdJ_IC2YS$$KLP#zn~nHu_Q(Em8oHzhj695tek~6Mt?h*l1PTfYxF)M6&l-pQ+{u`J z^KC0GHJy&nQc_t}RdGP!+a3$V=W(KgqmoJAEjDj)NWiRgKG2?b+o1=ds@tx$g+*ve z3ZZ&Y^?(ltDJiL@rY2A-TZ)J~r>CbUt1ZDh@qms(_4OY$RvCdiRuuoQmNV7(jT1oG zowFkLt^i{4+{NCEv>DMnY({T7;*q;)KGtt3O3{ZzYk}TxPaOM z11cQ!OynDCG&|mECesSKI$^&}V8q2DjoSZ-Gfahv9nYq{_ZBFvv z94>_?TLX8?4F*iTqr<~Dz#LaGspSD)!R}ncgzl5gegZl)G&IDU`r6vT!NCt;LJ=D# z=H{8demx^6&-B7^N#}EC2eSfF*?IDlSH#4YHm>tv>+^DRb-QC}F0Ze*=P!{gL3ej|V9=IV1>zT=LH!&u0j=4l zy`BLN56@e2a&X?}k@oO0ASvc4?oL&F>lSaVq6M1KtlEFiNW#nHDIVXR3_z`|fewo_ zS!t?JqlOJ6djQ4!my7Vg;7DXK47PIZYKjLDnk|*`!l>vSCFSwigbvieU=*rn0D(aG zuQ$n~V`3U^ndb%ve_x;N(9qJ7b8^;7ut$PTqg5{a4d`-7^L4Ow%bjw~%yQrG@UUuw z6FpGL>*;%}$Lm5jmW5jz1jC7Wz}XOE(3VcNc(?r7YcI&ppRBbd2L%05XVF1$2U#ff z>C-b1bhkS?4?lr7FOia+P3g2h+XZgF)^06$z6|hopb7$-VhGwyt?T|oW_a)%AyEGt zPSZfM3I{BLO{`7OqJ#WD{)0p+tE>zfZB(X1%gqB;U_=1BsRziT4FbNs*3&ugx@A?jEAPULWT-D%g*nh`6e8Ql%UrHPc%Y+$p|9s@jg)*8^073m?toU zDhdPgr$d!FXxbhJ?4rte#_ePXl&pkHP{}y~d>9X;w+{?pfN??V4WNB>V3Mc_6m7w&vyK1+Fu&onlf_Lez_lhJT6if_1F-0-fmYWEp&x ze4a+OV?n>6#zD&iKj>j_fDVcXbb}9~xT?U<9U2<)xZcVES`?@|g68J5pf4O98(Ugm ze{{M9fouRydH}#*+~1!+FmD_Ip5>z@2{!t%5?tQgK+Vl1z=Q!d0OF|&Vm*YhIk#tg zn--{aUbicxCu<2hc2~!Sz{(N)@BvO*S{fW!QczYFk(0v&Kuf37oH~>#x{y@>PEFcE z{&NU+*}ZjsK3%CmSx#PFP+S}ZxMZ45Zb~(wox{Ue0Lg&IDz2)USbTVVx4ggK&**(6 z@o3+ID}f&KcrpRp69{EFIXO-qo(t~&pTZ%)hFrS6I(hW2b#x+vf{?*!JHKz=ut`XY zRYEqDi;IgJ@2_`&)fp8V`^m|P9U$N%)@^SC+)#L|zD}r?K*3Qi(e48!z0U3Iy-JC8 z`@(`wNfKwMPfZ78RClR3ED-;AEOguwEf;jD}0wHm#CB-F8@P{slXYe9e z8zC?VNK(+IJgy*6?|{<36J1qhKEbfPy&V`F{1*nxnK|M~uq5Vj3Qgm2e#DZU@IFvU zfgxyfzN-dmP+nnSTX#1K1_lPeVj&b+p5j|@(*dhyljAa z*kBt#{eM6okmc~28ske>=t#B;Osl*?+G1ZSSr5n6BCs@ni7-cP0-8CCOvhqP|KJ7T`o+X2(f3f zDvnoFsj<6MW!G@}wYYEAKHV~~)*7*Lb^a-RfA-;SrYkXt@FeAdyO=PCCkj)$@oJ|F zj+MP8Iz^+W-*YRqVX&$;^WQr?`d*jwF@11|*c_Y`AvQHJF_<~uyEs0DFV`Nqb4vQ@ zeSdcW%PlZ(Z*2`wQI7aCKcDJ+Z>Q|c3uy>`xN(2cAtHWzw|g~Ju##J1ZTJvn0jI6a z7f@I6^l~*s;#aoP;$bnPj{!dV(4szYf3mZAKxl1wcv};6MN5Vi2HkK{B3;VmEKp(8TE?E z?_F>o^89s@{IIN+zlQw%DlUb(P>FX~_a3e2X~$w4DgE2eN=lH~$@H_LEjsqIR%yNN z77kdXm}o#Wo^qoVOE41@kHCbyzR9m@ud9-p)$Ig4`6gI2E~}+Aw_#p8Rb?KgsK_QK zs|b68L8#16=qLCjt>I5~bpg%${YfuK$@h5J2Abg|lPGvVp`&jsTKMGK(Gtv-h;thA zw5zLNsHc3YiZRSI#?y5_Nq5{@Y*|#`1@vV6Rk61D<^*p@Fk!B>2?bjdmOX?#-P?(E zA-z-B{?4g4bsbhAg9x7W>8dhE^JrdUVcs~aK|mwi>&Q12d`+Y)Bjm}mu@Za10&Yq$&Pmu;YO5j|B;OV?!9qi&nlSnw(hU;IseD1R*> zB|!+Q^whau$to2IiO-VyhOESS(!BOgnmsO3lurbO;(cY~h({C_0sgPjb&U0u+~LYn zjTEFWnP2h6o&P-xFdT|zxy4(2wr0GZ>5{kgjyCLD=_u!y2L%fKe5GUO9vJ70b~i>! zI5ddaIx%dWit^8`Qrs_&gfJb8pZWRGaRtg}uJ-|)JnC4O`#$PfV+by%ruf`#m;$64 zKU;c`-q4K_XUTs&-TG<;QvwfpKMWz?*%!7yFmAh&2?|rAM@M5BrlJo>i0A zd_RAva9&uFQ@SFBEjUv`w&G+3bDs!qe#VoddE5RJ_hk=;R%ucFxuflbmX?-U+4tg| z`uZ=WKWX(pevEn>D6Zo6Ei&@Mm&kd@-u?aa7ok7iy`+pC*l|7Pt=mX-@4wLg>35JS zSP(zNd;URY-qV}jeB98c-B9Xk1-q&4A*yb7MkngK*${8=Mn+xqK+9}Dp>@eS>dEdw zANnTG@gVf|u5a!~{oY=BYXkV7M3IK-gzg~03ZMS@S^YU1ljDOa7_QdA4Iv!)Lf8G< ze)}eWrT>d^uVc1*3_X7AVI8^ukLnJOja;|r93l?VTIXeET{JbK!`MiJPtj($%WbU% z#b@)?H+}NBoEO6*>IrJa!L}!S=_h7mK7F?9qDxXU;DH(m8!om@@|NkTG)kq zu|1BQRonJaEbrtO)M6&8H9}%!)7#LVgqUN2=VskuZC#njhk%&)lejwngyvi{S_;PT z7za*89)EIO5`PmR#6=gC^1+!HF4M{kHhqSa$a1%t(HEXp(6j*SK*ZLqDqY_2TwRTi zO4H~rp3C9j5&!h5UrGj8UicS7Wl&LVud6kJKoJJ^A3uIvPhn!#eb$N%p#bze<=vL^oQ;;8+R3i(1z6M!PRD084IbOhd;M!`90|}0b(86L!8aY6f^H&Y z_RUjjYnlosfnoi`E7T0Og9YxqGtTSakyKG50{n0Afgz|=6zw$wqkOJy9M8|RIV=gf zz6w)m$0wvl!`6w_8c(iu#|wEntBI%R?rkv;{MV=&MgJQ>iVWTF2Ka;V)mSpD;@up| z+KydhsSs;dT)WH4MPRNC4iHk3iiCkJric`m{Lh@4dTmF#y6*Ry^}#y5Lb3QHBxTj$ zppRNydeZ{EGsz+{EEpS20eZei`<6DxPwU{Ww}ld2Pez?2#GAMNc6*Y~Retz5s0h0^ zmvDwciZQw&-pTxp`PGfiO_@m-$?yg7gF|J0U=Z@t zH&i*V;96Ok`ylSj3<=+I?kgj!#T>UroB1cuEZe18V`@P<<)r4l1Kb<@*u9OPM*m(N zOJL>2dU2BNPQKDJKFIS1U4o73m{XEt9NR!Jnh!w}OEw4bEngXW{Oj@h3f1n92b5iX z^q6DY(3*xX@61_0uIG8b+MXzpnVXy(2_8%M)5}L~BR>0R@NQ0eviUv3-h5>0EX(2GTvas|(zRz4%BbE7x9TT^2iEUCCR27Uua1TBBM!8%W++smrtOC~a?%Bl^M9%iK}| z^4C=OS&h27T|w5Gm|I~wU%H^WI(Z=L9-O9O+eo|9@#^1_zO!F)!6_{W=ikxfSeb?J zEm-w6KWvCw<}?e$fiotVBKi-eSK1a&l#83+|IxrTsTii_Pc@QyTUTjJZq?Y#W7w^IM2;TbsS+9d8$Fr$67kGjx^ASsIdq$T4I9Xi z;D;+-C&3&zn0hrcfHimMm%YTshEH5wy>uR#!WwBeaeo`3!L!V)=gSjf+^y`o<1QBw z1YF^XJxgZZ4?IL97@iU>$MFYQi4U<>YZo8Wa-q-4dhAc1pBZFEQb{B*1AjN_JU(_w zzkxOaL(90@V@GwtW%#p$$k9TiSFKdc|HIZ>fJN1XeZL?IA|>4*q9D>BJ%EUSbV-+h zba#iKbST}3lyt|?-QC>-(%p5|Jde-$-tU}uUwSEA%&=$0z3%w^?=8JY)?lA8)P|!C z6X?Of3Xfuf>1y!ZVY?F(Fzg)S9aJ2*Wvh-q%!|G0sV4PSX4JbF6fA6p zoqdl~?8wzQW7|!aUU0kPH(*rbF_`0K2&^fgT3e5Ci=fzTTNrFm$i{ zRx9RY2-`w`5=^EPWU+GbB`S({DmkJvxQOYPhr;7}fNbGnQbKfoETwjTr|nChp0=w; zyi+{!#~tW#ENC|qCQlAszM8-zZYFHSpIM zGxbo9nQ1`M=FBZTM>r{~9V7IkuIZlt{b`;>x^6|ZGx@&6J!x92kNuGi|C&6ohq7Sm z;8y;*2oYYo{QdrWCIpH9^X>>yYdm2OpQ{q^CK0h0R|@}qSL~dKV9st_Q{-X>dv0;V z&ldjwy_0Rnjbn|nv-89G8b>N7rm&`_XHT9Ssa1LMgK+ZhiO_$)-3M0nLiX0xp+uD- zU$q4AX?h87OnSWUZf&^9GP1L;>Cv|mgxrZar`-5o=BJ)te-W{J#i_ZlEhCEVgi@K- z!12{!0IBYesxWjJ@!3@Qk#_+N25GJF8y~V&-g-1xXAI3f zUd7SiUwA#+HEF0GeZ>uG_HhRX)<;K2*4$)9yYqhswCl3hs<*=NB`tj5cVxtuKN-^G zd1*_7Sgt>j<5=Y}0vTJ+A1z2QxFG~0#qzj?_A>BgFKsgtOUr`KAoa~V@|aOT zW?}JI!4C4{--jgrFMLY-3E{18SE&2hH{X2 z(-^)&G7ojGyfLbb5aVsHTc3N2E6H6Dn(lU!Z%e5cO^fRdOYzNTEi?Xvnxjnl-()E* zSHaX9W8&fh<}HnmV+tzpTj(-fo-7|^BtVkJxO@6q(ay%F9JdXO)`l!cx0`KJ<2e=Q1@BR*C2k zz+#@^@+4lNGPHdMWhwPbtUOSEQvJl#n1`C%Y_PVZG(F!C(6%W!4`Xi`@zHpI`&;;F zE&roBt%i7x&zEg_73w*P*_iF^nSiEJ-sce@ZC{~O*mM;~YDkHd8WqL1H`WOkADv+H zl7EfBr8$}KuSQ+A%jA7{mDM(#C}(-O^n4qy4kQDzcSu zuUiUlROXXx{aIH8srZJ55!(XAcDjEj-nQ^aBZ5{?F!gjhoQ49B-0$DLvm@aQX*7<6 zAo!XeLewjh%*#Sh&$Q>P%zAZ_1d*P83ANaBUvRRdrKIH#b%jul_}1#NJK~z z9>Zjy@Ij}P9|qB`2@$9Aa9M;VGo*(si?UmynK$ zn2)aA-)fuPFFZ7vtuw(h$dpOB>U|d!l%zRQ(onUB<)!`b<4(67B>VpjB{h}k-Hucl z2uRvHammR=l+V&;9xo@c&i?4|l&~hEAgDPT=^%j>%t}z~yH%Ejx}PbwFtA7S?>(p? zcBr=izVnngA__m~TPDz^eDsQi{LM2WZ&o4kI>pLwuyrA}SIcPZ(Tpi%R~jVaf9&$r zoV+=<*$`E4dp$YLc|Y8`QY~Cz2`sc7MZ0x#%e4)xX&QP!Lz$9EKSJ;Gt~gtlZI91D z3~VJz#TRMk>~+OkxHU`0;xRLW#8`JVVTx%OBd58tmW}V02N{U(_&ehY8aJLb6UE#9 z@18GoQnc8jKhJr)%B^+Y@)Z`h%TMA+dFvuPT`6}x zCV?5YE4=jI%nAwG@3p}-MtwG-PdkCrW=A#e9A+u7npG3rWOoAmc7FT);nnig)@5tO zJ#L66lvL~|sfIUx@FNJtpRp1Or@4_Y>(b9rF-nk@?4hy~nc?gG&rRl7e4wfG>N!lj zujA(G*!E8sJVc_RQWlPK*+c&Z_ZgKJ{M}{7hk6f?cHe}UeTbE00w{Ch?KS%ic?VDH zah}>MWWV$4>jyK#qsp<_y~?Gt3{3`cQfOQLusBXyJ+jgL`S!)KZ*>W1H6-Y*KV|Hn z4)S~OunWxh9DCjWXnBrO@7i|Ux6hoXtRq;|zclD|y&Sb06fDc!tVqjSExPj8@5;gO z)G1U_RecLcEK*L(XD&``TDA74PLDT2!w^~BS3ek`Tvnq;z8!s6_p-d_e1jAd>m$XNxZ8w`uo#RT_X3JX~TWwj(!p`imHN9STl(nPhfNnZ7OhbAETE~ zIJ;-#8i~h8zOCKOZ~tqs6|^c!X$P^9kr6A)&cn}+wGy%e1`r({vtZR)JV7IFjxU|=w|vrAN*69LRIj`; zS3>VEL%uc4MwRgA_cL?EimTL!zXtg}#;n3@mLP9jRQZf*j)@Rsg(M;_u8X-bpXaon zFsF(Bxv3u_#;c(P9p73-W5+kk`8NC|5MqEzHOOF8PoIeH)U6g&Q(8|f zQg^ywn&Nt*0Ia;Pf6(Ph-tNu%J+HFq^)PLs%ZU@e%l+ac&gUwZa5*RLxtl|1`<#c7 zQHS6xVX&_5e#5(UuT%vXca5WE)8gISq}x1A38wzupRcVj!zo7gJp7H7mu|+3G%>(l zQorchvm2}Zdu&;-;An7h$JPu;{*n9qG1$3zj}^NM07%58rB5fV|IY4nLVSzA z5j%+45#=KOrY7F6J^1+|{O{OyJzDxDd1O3l@Yh>{KE1S9g@5sb9cIlP2lN0yZvPy3 zD7E_ywUxsEcnL<(Q&gW+^H#6X6(U~f%K~UK- z<%?2}j*4niQqh9d-`(ze$-aB{05IA7me-(|67l_eQ!AF>4rA?hVeN+xAD+?DZsd2; zgZmXw{O5iL&=j*}3^oRm=iHC`^R;SYD7|hT5RyByIfCXP%CZAh5&LKsP};5 zZAw>)Hk+%I=X~7HB`zaVxGM+lbAb4t@T1E`cQi{H0djND3gmY(eb^&G*x|N&vK|GD+On-q-t$sh}#qzaSQ?6wf@m9(5S!wUV1&*8V@!rg!%y#;~138mu#WV zhwX&*yMR5?pzyrVefRF&pT$N&koj~6w?5~z=mELEIo9;LJ%yal*=1yA0+|z@>*-cI zs7#y8R_>y94)pbXZVSK$A?awNmls@+3Tn?TK(-2`1*mWy3<8;(y#sn1_>vzh(n$rO zLm5!pHC*rU!9OXOx)SvQT8{~8i^A%aCxCYN5>)R4ikRTDKS4sld;wx)uuFb`g^>~x zf_`_=DfmDR)ct_$Z@NSu<@V}SA85*V78_G}?AGDyuir5xi80U2&W0n}g+K_405E(amQM(&9%saZg7*;R zyl4>Wr?{*WgI8bdlnolsl+z)ELyjJU(*J5^thV08!Ey)%e*%aB*}+@@x}+6o!(@5S zK<)pnt1ItnXSmVWZ~28IuhRiiIR6mhUf367sG0)APdw)670 z$onrJM}MUHgRlkuCcySV!99A+a3{+EsZSRG)$0wI>kb}#`SPXicz{oUy)nggi%#J7 zL=iBhk^qD;d!r1jj@R*QCq6-NG+=H@^xB^Q4cje8KKvjE2U~w6ap_ACzbA-u{aTlo zn!X?*Flg7oYvp^@tC&_kC~$czX!oH|WvKxz){6JNLG>wz}+;bk_MD%4$0hQ;bpDZCd!S$Yce z9qv#Y1v|h42ZG>rcbuwLVH(ZVylTx2^tcBDkNM8v=hT3TXJYqgfd(NsAON0qI{6)b zLPnD@Z$2d;Kz<8I2LzxlL;4B0jp&&$Vs<}P{f>`rbBr35V7LF7F3XmE{_u4KgI0~b z?%o{q1ud-`E*8MEqhp?a^YeRvFPR|&n_LBi;UoXnFSEPrfI2zO;d4HCCRbwBj}6ER zAc~F$%fj#W`h3-%x86Z4LS8025=c-JI4vYJHRtH`kNj~NYiGdb1Q1@MD%AERKq>^> zo|0digB#tT2k|Hfr?O?F(DlPFGrLSH*c|(afFfD4tE2|R(lmJw#&Mv9B8sPC~3 ziaosYjh?rw699L=3i03sR0RTl=P)Ht#NA|=`P*cG_!aB6b^+rLPKPwOD6Or{`p*zm z>a+;Ji@-F5-fLEXIS>WN5g<&e<{e4FJ_l!Jsq>*8807mgM`v(f94%JjDL`a$WsVs) z#v9nyrtHq)#@XI3a`!|SeoIkdeLFl6csZzIXV|>*so*0aycZD}pNeZFz{7jk1Sa)z zH1*DYq!K`%K=qwIawpW75>1YSd_Z~!P1HP|liDq??DnN4E0vZ$8miDcFQ^&fn@08Rr4)A*9V=dE?w6=>IA zMOj2fMj}?PMM%1X6hM!Ap#>)?qk8!>e*W9)&Y}C69}jy2!&C&12Eykhf75{V0m8i9 zNU)m}+rT(5;qlTcfPV+f`V+abfB){HwE=qlCcq!c)D9vdA%h!j21-Y9S=sX#LVSEy z&l_if%QalU=Y2_cTT3#HS28ze0A~F&PzdxT@r-6$0*DBx8f{xKxSkRbInUUnN&rg- z-6`#zD%M2;63oLK;2lysEx6DEEA{9n2#paILgUg_h{KcaV2+fx-}h>^3jvk)6-)4D zD0>j7FT0JXO}qiJs8=-$@SzB&{d8)O8tKRok1U?ug`Z`#9x%L3-RZc> z>Y+36d?<6vSq}pNZ^{NfE``e)c46b4>(%+bEEs&Cc!!%GxbzRKxd%h}YV1I?6%W|K zERzx75J_Ykksr?44VIXU(!i-LzzvxU|9S-PM%!QUBvR@-kXz};_>Tj0<{ZH{J-Hh8!JVK}_`3DpzM?f+N+QQ+#v zb6Sv4i-nz3q5--pT17j}^Y*GQk!#Qm{rd2Y@sPJ#nW4?BMO6tno&no}80G=!*`Hr4$d zkWfy8XzyV31kv8ZEA)W(2nC%{BIbU;FyLgM4J=zUgU&zLfk%ImP0IB2z+wc>B zwL$ch3>ISe`Jz`U7?&h@1>pCuY3jbHwDi0}n}A!$T;uD?dFw%b783U{5RH96;uI~1vs z5xWketnD^$%6J!$CMwH|MUTGfU#gM+_l``O5=Ug6AiJa1o}+2@X1VZZMw!3@rxOKF zRO%@_oQGd)E$~9dr%z9v!tNR+V54`}h%lJJ-ILX%@&I(}Nk=?z*YL|$;P_f9c@LYJQ;|&9qcG+mGB6C@tg!3TS!jsDKPirZfgJD z>2q7{gX@l77ne(L6gf9ajh;9?MnEs;Fsv~{@s(IVaB+Fnl|8Cp%{i{Od`_w$snTW_3<6{qZ%;6G`m@9(|`7NCyda)MYyudGoS7 zmIBuMZTd|lrQAz&RNVnD#u*;|{DR$sckXzm_~b3fq^zzv|2v_;3T{-zLnx{e0b)~j zQ2VVfvC-Sd$K4N|Lh9D_6l9>o-^dORPoZ~N6OML027^GVAv_Hes9|7?R0x6;nx04Q z(zRNUCGURxmyp<&CGUpd&V5tat-lD((N|05(XuUn!2xAyVFE_KoH zh+9i$qDW_>excDz5ZJwPi^(wGieg!*rlKPaMA6eDtw!z7h946I^go)~@k*^a*OQTN zTbvs<(21ufW>R<{tyI(h|C(R4phcWJl;S5 zlJ%`)g5}I5$YUmInI>R$e^k*p=6Yg&Z=c5Se+Lm$!UW12o&M_W@mJhsuuKHsp^ z565`6ITb>goZ#j_?M0VJy%)YQ!DUO8JN`lz2)jkTRg}5E8YXEkh=~CubeFCP#43~0 zsmSF~!^C*8DC`ejBsluWIC>P)Bjyep!;1v6-X>4=k!_Rf0|)DMxE22x1si?GmZg5@ z(l&vZy_qv?^!N=UL~r*k3cH^wdw{m62MLMp&cT|B>Gd^j>RKLi+mD3BjB8PCNpao8$0pJwy=wxpjzootEd0A(&_BsRoel~9q>yV#2_ zi`83TnC)6^P7Ww}$d+zSXjQ|7c#vX8KR8{>O8fa0UCM)XzB3z*PxSlsy?wq?bh91l zLdnIS4i=Bd%drB^Xk2%)zU{Xbo)cTeTW}+s<1y>9L$lqH!x0@Ag+RtU)YymnbIbu{ zCjp=^Qip5*Gfv0hKc;G+Is+_L6ZyniwT@H}2$@vmP7-7y|MD9!tC#xDltojnC6kJ4 z(o+|{7-(q1g|Oxo%IVKZykDrnpr=hYSa8kRVM!%?gxdBI#X+X;h2W*IB#YIK=C7#H zz5W=!YGtPOuNwQ;K-Bz_gJWE$b(}ZRWZ6|x(UT2JPOpZDd?*Mh1*g(f`16084(%pp z4N9bC5We9lse!-=wY~J%v`t+dg4<^JW!fVWzjj$~*RDp{YT|rhaVgvIjd$w5a^*mT zI=>cxhX1`xJ49mFOhz)gb4dTz=s+ybRP%q5THikW4`baV0zE9fSPaQ&b#WUZ@w}ib zfES&A9EZ&Ab}U6y3Wg1vmn!5j1M8O$S%3OD;dau2tqC=&Zc z!}sP*7V3B$Ym@8hAOv3b{7@+L4ju0A4p2)Rz+NM}|7UP%zSn;hFrfX!&#N1fobK}Eim8d&eZg{~_5DGI>ClpG~pZ9G~XYx4Gqoc-9j^1!^zIzI#vDvb0DBmQbYOmYh6?g@BMfDX)NGQSL=4$?a81FnH zAgx8xYsuYapg!SB;qem%&Zop`>v*2&{LK+}i8O&=1jPG5y-h=v#we3GtMA;%{K|%g%ZEs_?u4qO&=l#~L1%ICz%KgYcQ` zRW9DPQ?R0Hi76$*V&80gf9q`0=IUR5qf6IQ^60A{GA=&8kbA3NpH8tikn0sz*I{LK zwlbSdT+oNu4S*zpN%9nlH;0+$@)s1!+=<(=#_4w4#_euz`ovNTF-$=wNm>t`cB!0z zgSUFWd@ow{V~_khnNFe19##$K*Jl2eD>Zo<3XMXqzElQL26AklsgRh>hV86&43&$& zfXNWfIvFB$*vuki7?DZ8#m9@mrSPn~ZU4Io*X%DCyY-2X9o?QSdNqEH7{LKbrQZOC z*VD@j=Iv&;oEx3mbwmJpgFKJ>wfjQ-DpVDJ7Z#*!b`)%v9k+GT$!~I+}T%(kX8wM=gKbKK#yAG0p zk%4a2H0UFD6azwec})e|h}yN!JC5{?>(ajhA7edS3KEe1Gu5D7vGPH>*JwJ(KIKA- znQ8N5YW0=w$>w-K-W5k)ju`&GJMM?#!K_qD{q>mwNRa|9M)Q_Z9*{?-Y0Xxe&o<2K z0GlBdE^hykWtCzdi143Ht7S^1mUP!bSwEVWn^&k3vDPtS&6BuvO!%h`VoqY5UQPM&3pLy~ENumX5>+;>`DbE`s)RRsVBO`@@)UY6w84UJ@;B4xBh{Z~q1Z>Z&DATIylMDZG@tIyR zF?DR(PdE}0e!Jre(Hot}B`^Ka!0ZdYIP#Rf{1aJ5HXjdYB3&RS0R{I-$5-ICwKwb| zIz3kR>viA@Cc77A3y+lG!3>R5+*=``-M$(|Mkl)swC$+~b!YW+=GnO38uCjHvS_b5 zeixFW+im{T(r|(M2%Eusa&J+L)r+%8Eco9)!0eKyEYy z(!oGzsghR$CWCA{N#-ADYV0dWe3gOF4>aqvshzJN5VQUnO=~IrQ>1lNW1-AkAJfb! zCAGIjdbI6LzYd{oMjH$I4kxK&B1Rspt?`%TEHrN-5(3&aHN$L&LHMg43QnuF$#U9o z%KXQuhKXlPPr+e0WbiVxyaoXiuX;Vf3Cc;bz;UUKBql4Xe z__5ZvP$0l){ic?aox#@42r`i-L)-5D}*kj3cCI5tCQCezYUSZ?+xO zdvfs0tU#xuR*wIZg(RBU3t8@%e-=%}mK91VQ^1SxdF@)tO7tCyUZwfhIH>pMH#Mu3 zYBf}`ot7p8^OIb zB@s{e!*K5ryj!7f&^qDw@><6l3k+PRymv`$ly(nRNx8;FK#RR;GqPJhnz(4h(V+Fi z61Yq7_3*{pMaz-^&XwbBc1=q|_2w98HSvpJl}o+@+6Rn`#S z$%O{s;I>$qsk7Vr{@4X|?lg5WEa*50sNe^#=C~<3;1k)=TbuN9E_i=P z;!yt?d+qZ!@tZ)h-s4IQ@j-@yLsg0fBXkeuZIRyfe&gvnVg$>oL@dGN_PANgH1Txj zcf#+g?+f`Z3~ohBOYIQ;jO6fJ-QK!vP38rUo5E&vo9vCB zF1K`EIYqg}YLknPfZiCRnflj}SlV=HipPT}onE4#wH?Aj@)?yz)qdOVAzY}Loghx* z-@3dDyx=v>)vCs1PRpq-&{V;rr;vojJ8JBs*EegSEny@IOjB7c>aVGq#H!M0OppcF zJQHiLw;Fy^iBJ7PrBlqc=@;KV!OwO@=Oj7&ASZTL^ch=Clo&x4Me`l584*^@?FTPO zh}Yw-K8}}mHbnl{9MS?9#BCu*T74%w$e+qH@vD$4Tbe$(USe8eN-fnN6}YeFOnLpU zz~l;UPa;D4fb z3Tt;zGSdvoSd3pH`m{F*#d)~I@2GWSvJbO$;BFvU;IIUgk^T-O$VF`1WUR z`kKyh$_>eb5V{4<#YZ}wv|(DBCc)Gbk9G6-VjH9HThdzh34i*_$6oJPh!?+)Fd;Y& z)UT=vw?RyX3KYjz?Xq24BN#^Qu1KF}z2?t5A6zue1m#XV!dL}OcUM{{ID?=dmjy{l zkPUe+BKi~$uL~DzPPjJXeQHfWE4y-*2PCq8){$kISr!+UT*OnCiYug{bGA_1oE-Br z1@AJE!>@GJDwAN@>9id(J$=1g{JeI(=GDWbnq`}t)96W)#Hk=BZE{(;PtODybh-ua zjy)@`9%B?ty{QE%+pexv+DLH9nFcS$m_I=o(=ncjd#S8Z`$>YmQ| ziWH*nFrq@Jq=~#Fq z71$@--nP znZezhz0N$pW4SQBovG1rBS|IJ52ZE%mTn5@_`DkdWK|NIbp9`mF?W6aFOTEpDpS~6 zm2$LFy^(LSKC`9=5suLP#1v+bu5*Z-pM_(vn+CLZP;=eTj3#?)>29tNdaY*RFXYBn zqSxibpUwL84SJzjC!|mMZ10TsR|+Jb`Jf8b$L&tF?q;IJt5*JC{UVOevV!Q`T@eOA z+Bo^j;LI?j6Q&dqkUtW`g^W8-fZFBZX%f$z)Be1YXE-oT$5NwhtE}~?B;kRB4odCg zsGrSDvA?}!lIWesi&nn#y5B5TWzZCKeg+JwjJ!PSk7ex76g}&{vI6Io-QE4PpsQh5 zfc2au7aGAmg7>v`i@~SG-b=^f^Zdo~Z@*Ub4Eqvx**l`^-AY`pF$vu7sWUSTZt5(N z7H^BA@~*Y_EP$V8UCZw*g*$rUTogWDEaY*vEBLl2#Xd=fkjKSE$#WoS&Ry?U`r{|) z8PyqIDPxLq9a~<3o=~9YDad!)yaPrdqjGEpG78f6-+%lN(p|oELH`5&R9wM&8Fg&6 zVaS5MU}v#x>PDT)$u*V8nhuEv>=*(K_r#&npQo;>TQ0rYHu)QkRJYZO=AEaNhIPu7 z6MU^5y3VRgbG=X9a0z(W5UP29VuPjA#q~Oie({spfZm3{y6Xs{b3gQl+L_-1Q9@iA zdNGHd>S5Kw^t&P+uHqq2#)8lfm2!u@YXARqS^f-q6td`J9z){oK65Fg(pSE#Hw&Eo zCB6!+(sY)}d|1OBB>fC3rqLY;ua2uPhw5=hy&2a^TA-=Am4@cFFxS~W$DQS+Whd_O zl4PtFYdc6@b<{Z6xE9XbASI(s zafm^}aut(U*BjBX;E7gLcgsY*@9F)0=@ZlbxUV+?{WX^1NWKkqVRbnz_%GXCXcfE) zzUB2&H%%-&$ZCuwEH;I>v-bY>`{ZKsdmx&ITrSmX+ByfSTs5HYx&N`Tx{hwlhqcNY zVN*_eW8IzlRn?hgW1>?G#rk*L5{GxTj^7q8m0ahY>2{2ULz*-qvyR#)7eVwc7j^3S3)pJPzXH)99L`0`y*>I@{n&*{?i3Pfs45$yhF2L15 zDmLtAh8!#jD>ZN};PhBJArko;wGxT8pXw@)J{!Q1D0L}kn6&<`A2Zzb_>{?)nN<^_ za>Ty>O{?1}tiF%k0~fe4HYDQZ2X}O zW(@s+j@0mkRCAMo&{B_h=nYQjtCx&xAE4bQkk`zxeWO=+r zCp*^N(k{FBbN)!%7^yb$EL>ux0m1YD%#!Q4V6RP25Z=4@9px0Qgf!K*x$f=;zlV}6m_+04Ytp|Uas z7tqa24I~jV*4sfT8FWm5cge5=4A!J0H$0N6u>I<)pkM~L0VR{r({^J}?14As;CDL% z-Lb!z&eskqO4W@!ncAd#r;q-c_v=QKWo2X(<9Zarx!Xo0w8LkZC2sZ{%2kX3;NX{w zyKC4QFj>qE?hzt$v%V$ojy}7LRfwU5Tup6&GDt%^@cW>ak@ZvV{YCq8)d$bbvJg%1 zTpFKXG86JC=Pa*_*$IM#EL(#)Mm^F>@z}v#)F}hi*Lco-2cMTd9(y>coQz>E8;rl5 zxvu+yIJ;9GFrogo>#@;vE>3wtryOmB@%ZsG0NQ|^wd(Xwe3%LPm4KE7fbUP4!31N` z*1IpB0_-y&YkDhpXK(mV9&KnikpNMn3JHE9qmE_U@W_^1Pb-7i>#B#9OA6@%{f{@W z&IZWdNUFiQAHJ5UcNO@}N6F_{5@w#_bkp+IjrxkDfs}jDE;|zMsWhbqQiDVG<(S8^ zR9Y%yijXKI^f3%u10`vF_=Oya2!rj;Ds*Y@N-w{83DqBiRDeI8EmE?nuCOgG9@|C5q>`i830fo+;sch=@PJeaCRXGc_^RwUN zdCC4$vLX>i3Hp5e54Mgq%-TCf3IdjtB_%B@%1<__`x$7uNu+UGiW3P^rE~MH@@lR!X(++2cmK`AdvI#BAHx30#N(6F)4CmXpK{0HjKl(k z+ji#mbin@LaW<^h`B^b}XufW~lfmIH{emi{=~rvrBL*QA6}lPqFAb`v_Ig%@WA~2= zF8AzRYqnVFs+o0T5K^hf22bEy2wZC|tCJvtw9FO>eyChHCMasw!*=|vw+Az&c)=j9 z4z|#yk(n5#A-GUcsn@!sZ|L23wxjE40?X+ zo1$mcnCX|uHAm`_Zog`?fA4j+$H$v%YO!>%-}jj&Qkx1D74gBBA-8>UJj9{{trBfS z{1R^rx1y;c=aMhKRi6qW(v9Fh&A@ei_7q1!yl8a8-3wic2G4NDjznD+5SvXq78&0?Xp`o)_wd>$vDNis12*tY^v5gB1++dkI4+{C>YI$V-3OI}K9lbPdc-5LW8RC2MMfxGKJS3{ z82GIX`b>U;^+bcdHsEm=(w$-Co0CP9LAIfo`~{DEdB2S`3O`1;cj0J=Nryi+=Pv$5 zH~f(_0cPsp2{1ZdFUQ^c|6>7e;Xo@jD3vb(&JjGR%OAv+y!LOCmgz@|a~6K%xd6LoDx8VwZ#j*}i&i)JIGE@rDl*E_QaiIE zDK4$Qo&f5;Z0`u+ey+i?7NG&xJ3btQ0$FIgHUMh{C|2Qa9U1x zY*V_o)v4W6Hw|JT__sC}L{hBiQ2VhvuASa&G>Z}O*s~;7?XP`mk>C2}&w9FmT5h_~ zhu>=Db<<6_*iTK%m5O{yeK}ZtpKj*wI6ff;CU-?*WXus^Wq;$5mRQQ6vCgb+fI8>a zm7)91U9l-NRy*6Ey(KZwjAY00?usf@t>nN^nV~M8SrD2gah^-K*BkVW3s<@7isJSA z{%gxKw7=K{Obi$Ut%}?<0k;W{6!c^dsjv=)D8ok{R}|ApF;h-aS8B5j8GDe z-1gt5{{4kV%dLzq+h4eGWMf#Z9BT4*j$hKfFo-%_5N5pioWM@Sd7G$Tc(mvUWAm~= z4qqf`jUB8^7u$ZO9p~`%mx4w``+48C74BpPE82#8PY9Q`VeeV;O}Y8EyqjBD!({^& z7O#m;_se0oC}Qaws|gi^lbxBsq3@q!inKR!8$FyL?JqOYDW?`4EXS=#T@LnYRk=45 zXDUsbH7Gq+UeDG$3GNTvMEUPg46Z=Sps=jrx|50P3?oA&4N9=30_ep>!E-hWx&3oX zU2j>RpfOr*#1`;&lqz)+@&3kM?I_Q!JWFw}=5ws|trDCIQqC*3ziZSoc=U}1ld@a) zY|dF>GzdIN4$3Z!!in5uS{9kC*sE6krs8;6Q zAa0qT-(-_>Ej;ZMOSKfVO14u{(LtJD05w011grK_Qc;Jbv!BVal2-OC*5I2>x)LVd&r0pzqZ&Jt=E% zzS4r$aX@*f5M2@WD2V&DiaH{bOfrP32^;TRg5>L4jd5T|O#vyoHA6F2PjSWnIYq6rPmf#y%P7tUmQ) z^7vLZ__9%+3-lkoFc>HC!`ccjlD#BF;zB2X@B8}$f*;mS=U}gAyLsi(W{%P3Rt5Ur zq`%DW48l;Y2BE}0Q>$gwJ?swtI4h1cV1xnenGKN1hmVl;O5((MZG1pqw{A)qszMvi zMBj6P8PCI@@n_HbVpHa~kB9U@U)aGrQ!KANDe7lUks6k!-DZQQ8+-mS(1fUZmIpwv%Mv7FG>TG$g z4j3NcghOZ zD)pPGM2)+mm+S)5+L;drGp{_GznC@}S&+Etvsao+M?REglv9cp2_}%&)a)a7nmY{F zv{&PykJsRuiuBQ=N8tHJ@DaZ%xyrpBa&UU~jDAqc*P6K$jRD_rJ?Qb_3;IS^&pmvR zw2bnQ*o8aq$W7u`LGL_;sI+FP9L8OC?%d+eM{!bIb{RuxaOe4))+$-KYI^+7_Is1| zH_BXQF%!5fTF$f%;Ts))hNo3=U&>g`f)m1jn$$CpsTSE`dFqd`qr!NL3(ULeyU>>| z|2!hbnFa8Hpw~Xf#pNZ7@zS#$M-;%P738qIf9Z-nAnd0+CSN!GSyC*|w0PM%8YRb- zVzMGVj|m+GlXIHQWwtbyt^G25S&?ElaN^3g(S#cF(Mhf!kDup_Ztv%;+h@K}A5vJ# zSFcL(Rij4Fm6Qmav0x~6&joqIkgWY_Vr)`MUcGYH7ib|GBobh!)PuG{(bQfDNR3xy z`HGQC6dxpV_=Xo;vnDrenAI@Fm8^bw#}#fJ#Bv(5bKgyjgV)$n+tRybF?Zov~2S(aI}|+N+bOg#D>7ee^7N~ z7V^&j?wwtjkJqgEA%_d=okxB0IwK1KzA)o*yOVLDv&ukwCWYBe6`Wc5yivs!#qi z@iL<2Ihr7|c=e}SuTaaLf%*6s$?QkeRZSmE)md{)+TBg2d;LfKN2=wY`Qz9kvS{oU z4l~gzJRxR<#28BZY6XTfugC1;MOwcJ?+EqzGgFeXJx8mvV`Ik5lNoTSGyfrR!a=Q( zD&Dc6H6VARbCmg3)KP{mu=99xiZcnjRewGLBCxJf5H_07({ ziEy#)cy-YK_1NLz#9>Qhz40PblH#;M-;Fzp+gVKKOoO?+TZcYbU7cEXrOOsM@GZWe32^Il`e~E?)|?XsSe)Yt6fXtU&$i>l zUK$z+Z!q;%WAH5RROlc0LU^oM60>!#Fs$$L=N!yPT^)lvX2m3JC9umHW?Jujr(^F$ zs{NA04*+&-2k_RPg16T9vN0;g?TacXZ$EfrihSvVu(O^frE5!sa!T}=k73w0C_6kj z{k&d7YtLra-^OuJ5aTQ%A?dQyt`dLN70&>0@Iru6nwLU&NGO zmT6}+tuDhWu~`sqop)T`fTXL=Ohd}WGF~0OP9X&OWw!hJzNsemStzZOadI%h!p86e zTt|U29?C9GZZ>O#`Y7v34vT2Ht=HQ5rP&XLgi-Z<(s(En&TWbgoz%^IA1k95Ub!l@ zdeysrPm8fpndVJ-bsf2$@OEz!id8|mgx!rZi|QA{Xz&g8Le`~1EM58bv|3{_>2W9) zR+PmG=PF49E2WUzL~V-A!-J4C>f`=SXn{Fn9z#yu*7&zq?zszHCQqJ3Vlc*AF0>Yp z7}QyWbh`3FIYk4PwT00dI4PH7N-OFt!m`7%Zcd2`-mDP}cGQ{8^cHkfFjTxa4pVV@ zeqd`x4W1-tAQ@}B&yUN@Bj9}{e>aADy0T0=anwG?f3s1^S#DuxB7Ee(_$FMQ>)u&y z7io^CkfT3wd^tYW%joJl5p2M-ItL^q2=SbtA0;6r#ERUCnH=f*4T5#3xlK0C?27=u z;X5*ZZ8;Mc`zS#zz6t8Xi%VQ(&uq%1Cuqr7o6?D2zej3--I$X%koJ`j6Nje+HD#lPRKrsJM&G>Hhhna9*-cS@N8P>)`wgA2b4^)D zRoF6D|LV|>x#Nk=*;+&t%=LpNYWis?z3)cWY0G5i?Xs58a^dU@+iID`&0@0P@iOgf z@l2ASS%U!Y`dxAAHKkg2S<#Km`wYSJ#rcwVd>gf$38&)aX5^yQa+iY}-VGQ$F;O~H z%}CaxzYWQ_qjot%u|Ca2S!QGs+AOxxJFjhWm{0%k16<0hNKuRjn{!M)CWA%GF|`CG z?gqc|c1locMj9+0?hj10++r1d9%dH%P3XDVm{=&1n_K$18?NcAzCD}0A4W~VaI=+H z!cU(bDD77}F(-fMEmV|gb^WwKJw-w{5dM9_UWLGdePLhgjm4NWt?lB^iUi`D22(q) z>8lJQqm8muNH_RDDgkkdCj$4!xiIFe>I}T#c8T|@~@VqK``*ecf*SaS7m|4!s7|+ zao{P!t0$?`m~8JUVXupV3HeW#rC!g!eK3F$BO8k1JY9>nuXe7GHO2DUF@?)=1Gh*( zwI9>+z`RS#V7r8Fz-x;k$aj3=qu+MAnvo6D0e2g9kf238-s=IUUaK(ek#%)ZqbOgT#hQ;j2P|>Z&^rI@N?#py$qHsbVlri}8 zyhnUh9IaURQl5rrB~D-BQ~VYg@sF&S(pK%effZ+AGRpX~G7$%+hnHopK3~E zn6NpCSgC&MFKn=$uZ0(@${nx#{+vl(lj}F?p z^7K_BgJ8?__E<<`JtJ3Wh;X|6g@r!b{jGDS3w5K5lwBBEul}IG#^fuOx3WTM@d#c> zl#PNR`vep}i@V;xeS6tzxTrn+e&To|nb^z1epP4F?8EP4@|&HxQnX5W!}5dEb2k@f zTNT5>P}+^>r$tfv;+G8E{59qv(m_5k`F~h@>!_;M_TL+IiveOFDIp@A64GGNAcAyv zhjfDlNGnK}G}7H64N}tG-Q9JriO+t{@4VwZ|D8F;9s}I0wdT6#9anxo&)~(hTr`KV zos>@7wY+`=ZP(Q0oDMIiTF$T9mW{{Nd)O~jwu1pT&I8UyLNZQwmhBZ6PM+WCYU`-9 zYC-aoL@t#M?igN^vx^UCzW3hRo*X8={nh&SA!jt6fi-Z%+MG*2f5p z{dlcBlrx^}6SGww()h4rBWizVtLtSi6RmxSB}V!NSSxJ|FY2Uf zIeRSCrR2b&w4(Wq#kj4z&RMPIXFT{lRNs%!dMDy?_&@jRELC9I9Y);-HJ(=jpCuW% zeSB!=#|ii)?Uvn=4`y1-4)*Js*$FTdS&V+?U!y1)rC|IOa|TDn_sFS2BUu?FAmBkU z+NQ+JOOloS-hFp@dn#Y>i_i6{gL*J)>&BmfT?^17`9fp7E7xwtfo%(h8PYHb?QRS% zImMcfSa}JGa7qFmQ+jP5h;g)EtJE_5wydyE$*+&)=HSKV$-Yb!`<0>1qhvgd%q*nd zGC-=xMs`5zV4&>wC0!mJFW(QPl&Wm27D4^}N7+5fXa18^KHu4Y+b-*;?@}mEx9E;P z;E-cP-Fk;X++p#ZLPtbqe)nuaS(wO7rcoqjS=qXhkx|DGK7?q%z}}v`$bbe6!Nq~fxwFn&7+WT6zASlT^3YxZx-(dD^=1PKW^n0Hmpmzu)r z8cUEEfXTV3c>Ds2Q+Y>vo8;l`?ZdU4qasZ7h3>C0!H@62Is4_ETAx`8yY;I3WKKd7 zR+%^j*L29NC-;%M9O|A4l)u>wWIHGQSOzQz&T2dujB!5L*GcM#J_3Jx5}v=QA!WvHvBnr=`8&Z zLD0zTN|UdANkO_3ozLaoDcMO|)=v??WxHe^2*`;O@@_0uqj&Sp#i+6gNd|dWV$Tcw zh)k|jk$FNLQnheU*EP;Aq|@!0nV)xL`C1Q4e3w@_`mis5@b`nB{gqXO(utb_;ZH=tZg*tbaDCMd2$)EQR2S3 zZ3_3Ex*YbY#XsH!C(CxV);S|AoPOXESVn})yqO@V*J2tBJ*qQAX&CLPDVUa@4t;j{ zgy(P~gCx^vhe(lJd_^dW2*$R49ECBQRxDhxGHRoQEBLgxa&CrQFreqg=G=kjwyW!{ zh2i(u=CNYVnzzg2d#BDMGcv{TxXBwQW~uEq8ph_< zg9lXfIe#)lLDX?9@5Si$=oR%*Gm7Hv;64@~40ZJw)Rlp#$--a^u+D=e`|Gzl=Yu4S zB2IUS=6kZ9PVTHI`bRY8Pi*S-%L>s31xKG-OLwdm-#LG#BS4B4Oxvjaw7W>Ke+UCX zf~T0X7LrSB7qjOp(hV1`KV)EtnVHevTOE}+wplfz{zuZ2MUd*7qFIrpB++bb-&+a) zCWE+xlJ@#3|Cer71x`J!;v%HshF3!MPkf1pCedXc(c~BO1k^C9IJ?{T=q1i37@gw1 z58S(_S#Xv)U1~R(M%D40s0in7@~xU5X9Z>oG9T`XC=>IG)L%`kAc78QGT^42$63>05*WWz8c%?uX>oD3TgXc^!w&EFu_D{fRuVU^xDEI2(9QX6 zG@tKybe}zf#@V=QvR?2+dAN77v1nCK)k^E!ul>k>1AV3c3+nEbcBMv5>xo&JCrQjK zly>^8c6Q%gB~djnUlq0m zdhNEyV4l=PnoWnjb5uHUYOx*tX&5OGc&p-UYurqK;D-~5^zGZXI(JW+no@=yO+R_^ zoYJeN-0hk&X&=7ogf(Z(h!bhqG&9~v)m>+Yr`l~t2{*0XF^t8`e+G#wy^h}JZKgm| zD5w1ZRx$-^Mkq+4L=~C38NI#vWWk!n`&Nma4oRj)kwo-w;$fSOtw8^{-sp4NVu;(D zXQbvl_8;rct10uL#yGs9+~QJ@d?)sxOU|5}$${oBOJ^|OOk_=yt`YfLZl!J?6vcaW z6{>U!COnHnDrq@OjaS@d%XNqNAMuxK4b^J7+q{~H9+5ZT6OI(TQ(-lEVrU!ldn1q4 z^Q=_Jo%-9W$=drWM(Kw3_w?OJuaerR?ykJByzD9KjGOdoGeNM-(3ywaFuYUc1}OnU z_`PQoDk;M|>Gg$=IURa*eD1xx&pVQ6AV4aPBDyl`-9wa%!}tux(Qpc%CMO25^niNrFm{a^ zopStkYa#OS(GMv?e5m_oLi2vR@;P&%X(#%c^c9Y;rYB=bDF6KWddZhQElR6#Yjb}) z!PfuipR4#APb0$`60$AY%mw`Py+T5+sj3p47-`qr3*nLBG+> zuX3fCGqNHRj^}Svy9Wo^MCKR@nqdntabzH-D;gowyx6Ej5p?BgG zb))K-JfDIz?YmC0mRbe9XY1QUvGTk&vPN5$Cn1$Q%b2qL9zUL4!D_5gk)IZL4&RYE zZt0L|a<5R|`exO+WPwU06O-2;gM$1omS-a@hIigoyHzk~?;briEvCo5ecR21t84Uk zzM>oQl_9Q0?Zb5W&vL;CTPzRV)C)M}un2cK|uPa@%d?qNqDoVIL3MYl*H z6s$TLhuc#%sk1BiC9SuHBW7!{%~d7sbFfRd1=%_PC4AEzJ@s|Lu}W$ja1|ThWz$nZTO<>{H<+MqW&VCBspSfew{ql zz%jhhZhTs`ce#b^4+%MDlr4w9^}NRzUL5plGA46C6sa7!(2^H zCojAnC#hD9HJ|@eP5&He{?>I1GKW^LPgD(jc0&CDw<{dtp1;hE|Dw~kbb4k^c@vh< zUH98$@`LK)wrlrn9NslOziBsG?0s(cboRM84O0(OG{dmK%~`Za7hRq@@1xhWyOn;A z1@ETO8jMWY8{GCoBLEZnrmfvmo$!VTT0y+=h!z}+Qw5$6eJSQaI4QbQCM5~OX||ig zfj{|YX7CT!cdF%SF)BkJtQQ9D$&IhV8s#}K-J=ZX_Bt?mdy~zVTA~KA%CyXk*En6y zZ_P_55IT0*uLa%8+%~|gciNjJB9~YZQh)!Uz6GPK@bS6Bm7TOrAL_#C#z9~bjiJ=pF7@CiYV4G7Dc98VCV0(1KL(yE{KrC z>+K(jg%$n|%6=nru;V>izPYG{bft&FpiX>ZlYG% zJ5}e*m^9VxBobs?up^=*&*{fAR*P;?=yx;uaG9CBl$E8*D&M`9sMAMX5EZUkd zY+`83g722TBITkQ@Jppg%^}yYrH_Rco9jVQLb1&nXS`XKz7>%o$UaLh7Nou;qx|Dd zLA?0<*?Wo-4uQ%;4L(;>(Xs^Gv8Wv1GE=j*>D$(g!;RBB*h^&$B@AHVLE>>Kk;SAh zrGb2t&7kXZp~=w1I`R8@%|{$$ZXoWXl_Oo*@cvZIzl^v4Y{#ac4w%*ABEN$~X)8j5 zT8c048{jjzxoxQYIJOF-A#5D)RetH(C*O7O+kEEZu9d$0G|$IlQMO#QpGRebQ!&Z5 z`;^GOV*6UrVT|?d=i;u*SGdED4=JPVT%wF9*eQa-)^F>Lt~b-lOPhaNORG)`urZjlOg*x9P^(mBAoYIayh*vZ6~fv$J;z2$YRhk;OZ; zly77dIr=N%iI8)@-)=&QXMeGj;jCZ;d0dN#H;JDOidbFWy&CfYzIPPkx-`J?=ZW z>J$EaZxt$~&i0U06eJBv<0 z5?S4$@xk;7+Tcy|L{=mGnzAg6DQ$0O(MC2${S$ttY9Bj*X?D1Z&$-1rL3QpgFc(=)K9c=3$S zwHFr`TcfyeBE*wIZX(0;`)g6a#UHha3JW6)WJv65Fyb!s{KUM1ik{Mm3%WE2EeHD5 zG(g9Jb*K=@#h>A6|C^Kt@(ZGwf++LoMccb?PB-Q`AKL)3M`=0-9hdPv-}y;kO-&8H znG!O|`gw&RGYg*^uA4KBFB$c3EdWS6CEtdwP=1I7ebAfpasFvOudAR`|J4hj<@(wj+BeXj)R%xT}u?omYNO}&=p zEXY`?&EpZ2=1O_87qu8ERC06-ckOx&pu01m_Ec?H(Dm~z1t5%!$S?pz4cb43i6-zD zFO-K3S(>{OgfWK-OuVbA_!1Kn0Yl~g(&Kio_VuZoxm46ygEsv(xc%SPaR^dY?;t~g zXw^gE!!r=!L71rkB!B0-@l%*H3L~voaeDRQISt8a2}eU`-qHSY<6N7P&}(55ZdxAz zmA{cvl%lbmatjo2GbpvO>gtX4o8r%`t&=jkX=&^siKQ1+pvuNL9w4Nq@=vT6o5#vw zx#5^_p{B*C9t>jtylu!?`=u=gDnIjZa^>W#4h$oVm%F<;lM^(Sm(d7?WxVqI4ApbY z4qub09qidU^A>AUC5jx{6qp35lRG@65L<2o%PmX6MnjgsbQ2-_FygX<<`~)Tm5GK2 z;ZKTPNgvfXXUngE{(rlk+FERJ9Y@V#(l>MTmGQ66$9W6=X_uaIIh}W33Z~~Po3vcavDky=+Sct-4DO8eU$uQu0YQ}L{U;6IWt-4`Fo&fNHM>2aeOIT&AoHIs zzAWCy-?6gQnyd692faMu52<4^6N`(OWyeGN+sZayHqxj@;hB2dEYtkL>`r>3-E`;Z zHZI^xH_3Ku`vn_Ei1z{`mEZgO`#DnB%$${RZOt7kDO=<7U&}Sv7B(fS`jRC6G3@L& ziXU;ywEBz8ywmxmt5?8R_>0jTz`f`~%h1ik=jpHV2GFMT5T! ztq>pd^9mGKZ1y|vL0d40t06g+8m~{b#+#Yb=)FybM${?=*7Dk1lbq+?WMQ;EC{6~# z>Y3}$9;K^lNAk)MieYe#5BbMYzx#UmEMJ#Vr2p$_;R$u40#;tejm&QX5gB1D{irHi zJoMUY<)@~N-q^%*vB#WcQOsc(5GBEtar+!^zcLb5on8GT6WJ}kEMel~|1LJ4Muarb zaOmsQ8R5>A9QM~#Xf_D|R|H*PeImmb3%#&cK7fLU^iwdMk`y1cSK!Z|pWQ!qWox|T z=C)$R`pE7d!QxviJpSc+J&uI0WoxE_M}32$(=f)6;*vW@bzo z83vbXga3M(?3ntsM_8DWv9YQLM+;O`*7OY{4>`ZK`iLqWLwKRC7m-ukS?>1-O_n|z z%8O|r(0ec}l$t7~YxR2HpsV->9^N7=;YW7S-1ty(Mc2#H^Z9YlMIIAcSyT6vJs5L}E|BDl zC9Q43pC0_C{;|`XH0tA3d)mUscQZCE(~5pYHfeVRL!{NSXm%r9rzp)hxA1BaUU;b= z-~J-nFKi=hf5pN#GK~aoGhDPzlcWAjy$#0=c6;A!h0QNRLUI22OPaG)Ja3OU>46ug zA|m1p8V!2GVNVOV@O@v%+E78lej;;txVTqTg#JhNpH|m#e4plpi9n7rc00;z@BLP5 z>~~9CGE3Vc+!@ab3+0V%1Wu0|@fSUi(;k`7X%fEV_HdvYbSK@y_YHnKI7q8f_&qMJ zCLH~FWNqv($HIzoy^IC5N1-IoBYwIpn8+y*aJm%%4O$$9pGmJ!uXwnX( z$~&oBTvTbKiW6LXRK#yL#@BIr_PeH~DwDT8D{WM8mR8xK_(g@p{K{N6M;T4zcnL)y zqzlW^3&9MM&YGB*7{Yjt+*RCfIBWCHipC9dIgp$Dd#A4GgF_ep`{MU0{5SEW_I14m zKQ=>X#v1-p8@Xw7hJj7bp}e?5_wNg*vc7)%TOWDxy8ic7yFx^(5@!82*Z;mT^6qk1 z@h-|4FFxtI`7JQW{`0XgfmtWaKn$YC566ly=O>10-fE`QX-;^9PZz&sg#9U&U-}-H z&qey(>bNLn0odE!F&(`YuV6i{zP*1{Mh5zbkz4sv#Us4+#q~RdKt^K+S3=FvGsFys>tB_$tU)IJB`{3vIMLD9qA`3Licn2bj08 zd{b8$FUFJJ|FztrL58e%QIT!IQyKUK{!aBGt^ts32N}Bb1Z9nZKe69~gR||L@72`S zfG8bBeSLkTn0Q7eW1Y?dKl^PwMM=R;-9S3RjMQrPTA8&(!?1Lt`e!PSiS)m~RF7tj zM)xt@4@)0(QHvGoYeZq%WyL@}&iWM_XQU zIDLa%C3(hl6oiR8eS*ck_9ElaxW2^x_-xG8#nH;WbxQ80`ZD!0$shV+O7R)U@m=+j z4pH{;6uX3PWLOaJd}k!b4d0HnC*H?*O)hx)MZNw_tm=g<82#*+Be|+eGQ+P%n$If2 z-iJKVYC3t@GZ4;A5*rJmt{~Pq#TgP5#Ge+NVTgo#HHMDv zYtCUVUwU(&H;+*J3-50kqKqTPH#qevU24seVn}Yc1^@JVIMpSB1Qe8O)a#0SQt9%- zHsAmB_dlmm{Q>74EpqQoMQv-SqhVvfX(zYwPgN zbri>d;No7Div5?IjeaCO3`xJ^?LRs%e~Y&Ln%=#O_8a0q#|7mP2MKBeE-Q`Qvp`n>+zd2D%->VzXB-K65>Ltl{?-OIBwm+6AG)$1EBCfV>l@ycnFO~6&uk7A*^Mca^cQ{i6k@VUCEJl6@)ao)Rhg zeDV&u3ciO$kHh@s{Nqz-F(slHI{Xf&1CCr6t#7TLFnuSV`^0tZ{5#8WOhdGW zEt9iq?eM+0N993_Gg8WZF(ukl3R&&xlhRwigoNNcjqv67#`y+NjpSsa_)h7!Bws`l zI7B>qO0(t&t@~1fUU_Zw=zG4s%wQM8>4j5ic<43h%j%La)RH`hm8OgSJxdfb$=qx^ zq2jZAM%8jLz3PD>_1r_Af8+91F9y{T_ctCrq6`+lR+W%Vdj%_~^vstg!zed6wmZ`G zzM|(74<2Ffu&UV`g@jRp-YJ(dbJJ@`SyH=Who*7EuSCG76u6M(t(|gD_&%># zXF)?MC%c@s_G3|O2HmO8H+oN{)N}BtD4P?^?c`9(cP^ouawT?^{~ z$>$%v-~B}%{IOsXU*0A8#r5&auQ`^R%P$1RG~^D=j`@;>?Ici(qD2U+aBHrFcjgU7 z?HJqW73>TDca94dyzak=j{YjX^GCP+#NwjxyLXJTX}(iak3b`tijp$HHcQobbdN$q zL*rGSw>DJs_u_ples$>OrYEKpwlo+n`28tC_T07yYj;MwQLxI$vVL{9D&dBpM6hB5 zm?E-?+&2P^86Gui%%H8igi3RrGq3C6%-(=}r-z;7xM$*6|F;=R%^)&gC2lR1*@#|R zB*B~-ONW0Ss-0qk1m7fjM$;Ia5qB5IZZlh%Y?+A_O1W@t;Q7{Y%BB?U*D>Mut~Pys zZppY%erQuGjggpf4pC36H+3XY+1LT)Wd}t^wxb~&wua93Xm0&3CGFM*xAJMGltkrkm!4og{ zwh}a8W0yra(sO@5yyOz%l=c4&PlY^4LY8secz>Wo&CViLhd=&RZ)_Q(x4oPJ^AToM z73%hqk|dz=n9)vN&-x z@D&`1QbkC;gMxL@=)`q7@!RUcTJ=_6%C9YMy!jil0dMDTCx#?i(%g)tt*VBJ$KTt@ zBw;OdEB$wqfD8i?E#voAs6(s!QYw(eY-H8B+<@x z_8xV1hxG_|EoaBbU~A>{DJoyA-KizA?t-&P%?%_{@lmG3yDtjtgtDVG);mEEX*qs+ zXqVG89#RM4x4&y$nI6ou)RpXt_uQ=^&dz3JA8~F);p(3x;>V|k!*OS~a1_(7R7tu? zfoKj>-w{PF#Sh)FEJhEN9!Z5k^ij4&&8!ON&$kB zECZ_;d#l5O@OWv=T3?DzzTm`S_3kR|A+En}p?Kq1$k z4pskhMctd#TaZp^B(p-e`%6yrlXRA3rlC9%&ioVg*E2MYcTwD_CCev9n`K;Kj8OcB z&`P@V$E;nl@71eBi~meMkopqFm#$E*Gd$fFESm;M_0L^W(C1w*vli2)L6XNa-db&08kkNw+pwGe@O7EcpJgD65S z+shM!v7a8>pXoL%J=iX_XLDJwt50LDHR+_4l0ab`b_pF!^ZMn#PHw0yL!-Io0GZ4JwN)*)_3z{vgxt>W3lT)v1}jjOap^Z;*ZV|RUDD;K-F>`-N- zZ=Y26j1$|#Aqd0m-^sCAL}9db9Yt3Oll>Vl%HOC*PLoaC@BWA!=6;v^9+%6SNV+8j zBJcgWQD7KvvP6x_ecw&o58VQbnIn{aDy4!-nuzlXS`n|u;F8bzv!x|!6`ZBv_kEo& z?Tt3oy?m2V4s_<1x!H8lc0Ve94KG^vs)sVY{#JD!=QT3Frq-Vaa9@6ZU+@WKdk0$fy(C=v#Uo{p8)b2&e!i(#eEheUuF`Y1+%5Q8 zQK($GN!0Yz2>Y1u5NcqhQshUL$S5efOGHCNy;dz|u%q6Q+0paMzhS=5Kk3Ok=a2JxT&JXi8~awISk$1>TMYyF+7P}FBG zi#dv-I$k!Qpodzz#f-vm(hPeHk1PC=Z@!D3(!iDmv0b;hDVfhHMA*H4dzU?lJuW*o&7vJ^ ztO3+SY+9VT-uc!K=GyJk)6*=g;vgmkkw1=hWqw%vpJL<=hn|NW3c~MF3@Kanjfmq3 zxa`}RWow+J)|Q!Jh1ScmzrwP^SdFm%BW(|o$r~Uzua(C!&WK3)K6&y4QFl*{aR~=$ z=xw;$%h@)oil(KDWMvHs4aL>e)I`pctK{Ze8DKY`vmmmsMP!2c!##$w8yfzc}B&&Y65<^D_Qsukf#D(Tm+XVCxI2#JqS zc%Z4NOj-@-sJDq))3Pd;O823Q6pvXK9h~sYx*m{kt^x7r!zphDW$ShyvCH%4a_bfQ zL~sa`a&t$52qww~a3i)sGWrSVX~X(sH=p{4JkS%w*f(35I~d^~!-kMXSY@qLYw_s2 z{Sdy{UzEIMz4RwVk`%PJF9KO?ADDloa z53BaiW7kj8R=s!gdyI`gib+@$)-R`M>qq*5qv7+-d5Jfz(#yKps_bJ+igt(fhlCwU zg@)_baLR3JV-<|qSz4^iU8;`DYO$5@T5Kw+b5+bv3LYXm(nb@hf3ZM9B&g~;_d9Td za)fyl1104{CZ>DuLGioD2nYl!H}Kwf@E*7B+6xQcuwMEuQQy|o^pJ(6$9km9*6cn% z#N075Ey2LK`~$MQC@}A@WP^Y?3S?E3g(H}C1pNp&%=o}i@oLk3nbn_XI?4&-KTl0V zLo+?o9GE!`Z-B5U`prQP7tuNg1`3EV0t%VzK0c}oQz2xkbxlz*BlypsHz2m&0Z$y*3;#R>HcZi&14L&Ju6QRpc{F&7i&9fl zPr>ZbKHQoG1F9q_YJKRpKy@UCt?pvv`b3N^4HKB!83PhqDw8OVmDUgFAEoLS2qT@NOA#AjO8h8#Rz^mY}Ub-JI=&uWT zPXb=2(A&Jl8`s6(Cr3MY!QA*uOR-kh-iOz6ss8~hFokN6XB zTz^C@f9I7n?UyY1L6x$mxHuz*A0G$a+_`i&;nU98N2_}xLhCxej|H_ElU@ovJmKvx z=x^tcDC;nv5HXDoh=^!`9&Uw$ex`#s`3za0rw9TGmfiV?1vY9fvx?o|`1SmJ7Le^c zIN9zX?4Si{ie8TkwQ?!C&u(s$^C7O3&wwAY*q0HZ^;XNfeoFp@%y-?k@Jk!8djg$O z0v7oSj6Q$< zJOQ1d0Nz4@BY6gt@kywuZ>IHnMMOOKbnUh-=+2Wxd+oviZr5Q-OsubWz&HbP#|QUG zjroql_FNlCTf|zk?c*k@Jmjs z%PJFNiGCovn5pdFNU{0sMeg*`;KZ}J13MXET80?E`M&S@m-or9UfUYIT8CM2&gg@8 zCB{Xu_+1a>AA<;Zgi?e&rz|JdxGye!LaiPNkjSHFXqy3B_2T-83WLYK^YrtRzLC%2 z0=71a)Ao#d;$cG-3nRhHDm5tbUoCy)Xoqip7o2G3J(KYMw-$hnsGlp-tXaO5Dwm#f z%$2LCTC)fXU*bZ8;?;~{!ef6F_1p)c3w>VaI_sLAbl5acDW{oEU1v?^)a)Y;i!37^ zwfG0Vp7$yFJXO6<#3rrY6B46$EvsgrgM_n2;S;%qIy zsoptT8gkO*THfsSwzQaXy~KYWbs@?s7jsi|D^yIN)Mi!Wjrtv^NB~8IJi}c>!IF>= zHk0A}B;Y-Twq=3^knP-v0lHVxk|a(18;w2@opt2L3SGDCWeD4`mb=FVHCRGXaR01v zY|##$l$ubZU=O>+w8Kj1{_~xsRfl~v#aZ|1Dsvv%=y~@_++W#fc4_&5Ms-Hbf}w!| zBOLLFr*zV)c>;F?;=e(kb0A1+y?SNhu)88`YDy2v3@Is$36YOBb&~`o8h347+wuoB zII5J5zA5n~>8`8)e&q63k}Z;B)vbvxFf6e_@&CD8&69uhk~owI6MxUT@s!Vnwgm?tEhN- zd(+7InE$*+7-LC`H=~%#9(7M8MfKAJ{fPajqf?>P<10hFf?p*b8-$rVmG792C_CBZ zpZk~Zy}iwpi;1!@ex%^UW5{Tu^T5crRc zgy(#gXG-Nve{r&^t7>7^QDlEjA=K7~_x0To9n+?)l6eWr2fC?^;`9afPaM&bSHid_ zMnao235!XWZPVRPT&ai+zi6i$VUGPCYPNB_T!3zx{}lB@!GxWJcx00=+nA7lbcK)v zL+ImFN>ub6(?fPkw#r|F`7eQ!S7TW8{ijKpLs1v&lBvts7L$3ihryk$u(HyMMlLin za*pj8GEccz)ME~|Y>_RDfywMS?TXfPh;+}q%%X&cZXQ@iZpks;CvS=0vQy1$Xp9jt z;vNj-hCDbQS~-lYrnf$LI)BG?paX@G!YVI(6Y(#qoIYq-h58ata4+HbsxiTS&*qeJL+Us zBv#-yhSJ;WjegTVs4vfU)x>PB6!;Jk9WE_zH&Ib#c!M2ckq|12+yLCdsElv`1$!}h6qmL3 z;(AL{t5}xTodkljlCQts^l26SHt;^BC1rB8Rc;()CZup0ytK?0%pz~>7Q#NjpgH(b zCvV7jM)4*wnHj@W0%3f${KA-rx8R+?;^lxk1oQ=$Ty#wphpHy4Vb70!-wK5iLsoF+ zf_Tc6-?KPkWQG#-v-+;__qAjzy<-jaqP@~|WK@NRcXrRY*Ua$ImKHaAy0pdm;zB05kR5{JnLq~KnTnnL`*{&{Jd1IgXgQFvOk(~``j1?bVrdMQ_b6}T(*upQn{VP@N>EDBrhYn!V{T!e@@H1Dva%9Vl#x+Uj1g^6 zOB5KQM?y!3Z;iWrjd~! zZz{%Dp5(WpO*roxnX|EPO3$In4ogI3sWWa^?8!!3m^81>9TDUwzLVJ7VygeD-85UW za?6K}4e1DW+zOD7uq}NSWtQQw(P6Ci4Va->Q2~*3L zC-KFWU|WNJXHhVgMIszh}6ZV#OQg_gT&rG^`k)$L6)MwPzOzPdk@k6_yvaE$u z4~Hqd~ve#0RHd7bi96w(Ew6VQS%E=inlP1UYyP~{&aj1a#(%A2s6v`^!2DRk{WWospG%0=H*zK5rv>oX`v{O~#KwYh#l4t!h13Yv{Nnm4 zOKnUpp>PYI{R=+pM-Z|$9w`2{uy7^lfLK9cWxqIo3q3C+3KU{_!dr^%EwT zg=tD|nxp-2K%onN7ZKvw(W zT(P*y&eq+e&M0k;kYRfT-J&zC-=3eLSIlA?{&Q6l*naL~7HFfHt2dts=#m#Kzk27K zrHY_7-ES@B8FcFwt`Dew`}_EAfWuk?(L#j11$x=jo)pm!d3h_JMO{V1Mu30#tcD1v zP$5V2DvFxRA=$TY-y(UP!@(cKgm6`7ydYY>FJyp#l3~9+mt!{03r_Um-muvv{qag3 z#4d-QDZqgQWXTho6?rIDlKtU-oA=;7$hTq@7wL5nK}ha71iWF&(g5$$yuK0_hQ{#6 z3%#w@NY=E0TyQC|k4T=ulbw;0hY$)xLYSZ{l#G_v2gqk%fwm}ZEiXe4)KUoKMNCYn zk2x&ULBVP$w>=X88t;rd?-QbcwXX%SDg@=|iAjN!1Tw?j0DP|n7-fJxy<$6RjROU> zh`bXx7WZ-EK|2_bkYA|YCcWEPkQ{Sd=K*PH!dc6?R*jjaZzI6V1@2ie)f%9=-XUa2 zD9r1OGAb>l!v@RY5Vfc#PEkxD96UO4w9ZbwxV5uGgEP%dr z+^1EHH}XlKuafQ8sK7Q>-#ELSGszzGn^rvv+1hyH?NJg=nvbekKjQMv=w?=B(%kSA zMkhYL&cM6vYNbEgC3#*@G)~IH94Hs<958Ftw|QEARk=Tr)N+pDF$G)5nhNLUz-c@q z{x*erazf(f8U?d_l|4;nrfzAzS<8TwiD2*He(mlt8>hPLTC?5zmH=fpT|d0u$5u5V*o3N8lc+WbB4c_{xadU166 zu0gE5fr4>*6xt9v%j8X-COPkf#d9A`kc=H_b9PABeLiGPX5NeD3OiZ5M&Rv9_G{dK zIjbx<#zkQ!B_=$${Wo79v(+=c#)>N*{u47ZbvWx4^$`rG-a*TKc}}auep{{*E|~8X zh%0I-%*5wDJ^SbV`Bo~ugK(oU{?MO z666*Z7ELWJ@!({v3>7SEsu81r2}Efd0YK!gc){B!g391_&%#3nn4OG}GO|)XT;OPg z3ZSx6#Mn4}x)dT|SY4o4j|!|dzlaDL6gK7lApc7CD&^6^LA+0wz)Huwi!I{OM|U_k zeGVPtmwsh@I|Qz)1xYep=hKB=e>iqVK)faVi5BP zWEqvc<0cP|a@^bO#vz`bp1t~ubl+FI)5(peX5kF=AbLKbt5)Y9LdQd0o!a*;& z11Fkx^~bANW9w*d$KpV4%xPm>&YU$uVYd+#W@KqRH$Cr%@aG@Ok51moXFM%j9coMH zKl6_9zfG6fJbrLk7;$amB<-y}wBsz|h3za1m9$P@yNdcXC`w#JF4PHIT&xF?=FUPVFh1G$x*#J#mEA9HXh^M_H)w9cf-fr8 z`n>?-835bLY}e`EtwW^vYUVJ6m7p^K6a(L_h->E!LU%d+oe+3fy{{cFm=xb7HKlHz zxl|U1w`ptZ<}UgB!gvWD_7RrZtqh*On;EzvMo#+S(it31TBk};!Tl^Gv5?JC1P`hNET?53l^Nnu1obv|MbJ3sND#&BbFgC7_YZ)CLms z$-3)#Jh=Y=gw%W*fyd{i#71(_KwjXr^ND+J#C2n9=OGX?0W-X#(bmR+39Aqx0pOe!d4|%oYHQq z&00)&$cg>@!*ej+?h+EVrS_(Ir!TLqHD|o^P%lsnQ>df50U!3LR}#$0VcT_`&UKoD zgSP%OP6Bw(pSskv&CvUhqi6z~XWAbF^z)v0N49(S0^mTQ&xr;jQ%HttwI>;Eb0~j* z@WCmC1mDq}*n*EV`RlGsxaf&;pqBm3FtH{8Q4wV|>O*-`^?Wm#3rWyHEI%ON?Zz%0 z2OeS`Ny#WHD>t>ZW&C;7Q58d=rr{g}rSuRwl%mptZK7#5UdsQ?{`PJ>Y=b8|-4ZN@ zJ;h8OFmQLNaG=sHB0}lH^m`GO@HafUwQr{Q=w8%sW zVQqs|L}MfbZ-89i(gYIe`fuL20Vh;UXS@K%T9_EQfIohH9KSca{gSkf8!}4BCABK8 z7@!C6(@-(;M(g+#0WkXB$IN#CRktD+A>m$JKZB`Rnx~hSy*u^m1_y8C4f;Ua49vl< zE-7J%sWdgWH&>e$1qK92{k8BA4?{T!USkOsVsTm7yxLz25t?xnvfpX&WBiL!dUXCK zRyaB=PdBJ!%?~Me*K*{?K)^r91s+3w_r)oF@ol>#1OA0!Cg8vMfAsUa)D%D1aKH*9 zqh!2}SQPQ`3Iz@Y@gv4Iv(aVi)IDq73{{UPD9YmgI~pa_i2Lz>1pEre0un``d&F9K zer`@$`odsFzJgo^1STP$38&eWXQ!yQyfdKo@C6u({I>uz^!Jih4@gc2=h-7K&od$6 zexdQ`3*aB=c>L=)T|A;j-GW?=Y4X=Gyl$QP36j$HosV}WA=N)8rmU>v242F&B}FHr z7(mex0Ezx#!hUc+YWn*_$i*Y5oBthfi*Knr*LOeHz2fHKNn=8!m67Y4VXR0X_u1K5 zLUN*v&VTQ|_hVpkvYeZ3DUjY#M3x;FyT(P+ZQm^(c7$*I`-W27$vakU3Ey%7pO&$7 z2WBO8FTh>XWz(jI+S+`-e7TOKi=6jIJ<`&QummXJJ|T|K1+W*mW;IywpM;4)MhhCg z+9J#XU(8(feX7A3N&M> zLrOk~$h%(i=gt%4k4655W|hq$@@Wqypt+^x6@(1zmkWjxlkor}xSt|G?zUh0nG9TS zGH_#?nuNN}ICnHgip`;p1D(>rMgp?Io<2S^9>gvv6GKK>WN<%7QX4+ED?^D*Fb1h% zQ7ZI7Of&EZ7$L)fLBzeVunguGvME9?x-*U+&9rRwDZrtZDbK;)DFH?jxcd?eqoN1| z%kZzeUNRLWx|gny=MIUETp&e(cL{lLr}NW&?vssLJ3G5SC6;=y_EElgdBs6`eU@lB z%64oLTqs=Mc~>8xs!e~mMl=DR3qzR)bq@&B9tBc4#gHOX$k)FM`Rbl5wHPoPpMbdt z<_X3x@Oz%?>XO5OS2iGrOdz=@7heC27ntAG`3Buhzkk<2`%mo4YbdIYtE}Mu!pWft z;AW`sxCtu-=JZQtWddfscB{vqiJW&N5wB=12cAX~5UK%qFYw_QIcC9c(%G76Mll{O z4FU@m68~-B4sC30O+lBQ2IL~qiMT@{FZ9%G3>_(Bu!EY5!~Lpr=euUeqs+82UenuevhsK>9waGI zAQ8Z|w!bon`KkIDJn&24*MqZ-iH+^B>G9a-R^dA6I`_pY+fX5*F zbg%eDIHg1rLSE>opQhP&A(y%}pyhw*4l(h1N|D{>)C&{Ld-tfx1U^+y92gf3|CC9? z2G3FpScI)Hd@+aH^I9zUc$`+02=ZAsuS9AJIYgEuF5Hh9FY`643`+_lI@R(}Xm&+` zvS)%_1UL|K8w<-0nZdvaLI&nfmKq;4y76H=g9I|M)5awvjqw#(XfsRF z#sQ5JQ(l2(60yhhsxBccV8h=1)&+BRY_)n?Ezq_2qwCl9^+OQx~&Dg#z_?wlzCS(7| zSetoAvZ;6}_mfbY+q+plci@ZD8`XN;M(8atqoLXgb;iu)1d0?oq2m-nqmc2lS{n(2 zuWM-r6- zmCjs%e4mGj_|AA@1bR;)X$ll^EjJ%3WThtGV^g)Uu})s|wf)waPD3sy@xN$$>!>c* zu4@zvlvGhbQbkI-8%#Q+yHmP5R0IVH0VyewZUO1;F6r(r>4vjzpZ9ssH_jO6{C5~* z?=ki!es^5gy4IR&&bidjKeUK(sVsJt^E(m=hi}a{l)2-Rq_qx2U2F-ogrpjM4g0F9 zJCXK&gS+ya>C|%)<(=ck!#~|A>UNk)8NYs6>FWB$U1-SutE*KcA%C{22tZrs(QHpxm$qyD#4HDh_~(I-s*B;A6@?40Kw1iUIp zNg}wake&Os4Q9p(XP1?n+|XE6e(Ep$6(^l4lz1q;xy#1zbmp$Ayq1p6OvlBED{Pdr zdW+`3STL$Mgs!vFbA9BXfG^o#hLJm~Lzv}wxjoOmW3RlZzt|8FunwmuW2l>7l}LO} zl0J|@D#g(CgjAq2XM~odz;^Y(?0F>-Sov=H(Ra7`?w^kA))Vpw3J|UzknvXe7GMe*hPma0kWF%i06_r3v z6p}V0UjsE1;yddX7VH;TFVN|SOzgL?2qY;LD|hI_vxt9MtcsMQo#w5ES^iC%5f4=> z`!$;k^LVA|^d0J0pP;<6w>*D!=}4x(@r_JeJ*RNCam4Pj+Y0+EKPogD2j$I{kK%Q9 zU+VlSN2iA*WDjamr15Zz*KWqude{*PeqR4ZCuPa2tWTum$=IQ3K^MD6LCWr4dXTQu zZ+y3FlWg$U!rW^%!r@>%#{>O=_9>K}Us}8$2tO6fE?BlmcK=-I$tgiooQ!+6Hgs8w zEA4O8_Kh>@Z-X9+M3gMk%70S`rJ@(@g_u%ZPD7UOl{Qjdb6ByI&y6MV3t)}Ct9_GG ztM1N!>#at7Y(aQvbhvk?uHIC)=d?;6e(qNkGdv;!%p;$nn$}K#_U0FD!L0ZP`UdjF z!nV2`Lb%0qOvCF*@e=cY^GQD1n<<+Sl{dCkIj`jzE(N=+)6ob^gg0six8dv9bi)$kIpnVo@JAo{aUAYD zs583ly`)nqUGQrq?;+aid3IG3-FlprC#r=`Cvh>RU*cD+r-OKo_j;0Db0K^4hg#!? z`Po;RiVQgdq~HcCXd37p)9-(Gu1&Oct9xJyBk>DvkvfJZ`}uBrh`7an^HHVv#}THD z<`-CA1+0am6Uu2FhK1I9#f&1n>U(kQH_pg!eGB`_GbUj4UoHS@&1$P{i+K0b{MM+A zPuvCPOsG`2cVY?qE)uHFcrI|wit2794`cN}r(nO3A6~pVdjC7Rk;A+9!gowuXnjHqE^`=BHQN3nycE z0;u9+evJI@(|(ngY8rd2cg3iPf!3p*e?heLF1rR|_K2M-?Rv`l@3|B?KKdVcIt<-!$wFv(?uOCo1a3v7Q^Noffol9G-$;UrMq6$=E(ySm1%wF zgdssq+s$LPBL^dQ2`BsGkl?nyAY~!MvE9oYGwN_VG1Rx|8t<$^J6U4&b?Op*=un#}Jg8sw&O+fC_Pf4rfKf_b#bm`Y$u1NIx&G{O`}n-etM2zz6%|R za;Y4%vN;XD%jw3@`u;|=v5P5wnRHofR)gJLoY==360+$VHnOY?ClBiD>Y`v@Kz!T2 zTHwH8KH1Wc8aG`nH@O%%Q@r|-{$JH`Czv({>8#!59L&3>!*4-xKL1GeXR)HJvTQKe zQGAh{{U(1Pt+Ft_1yg?Kw*tw&yl2*%?vuvA44H{pz-aF zSha+gVJ;ubu6)+GaQDW38kU*#B+&5RaBVn;FP&gSs`SoxR~s>62g2s@Pukb;=L=Sqh;1elySG& z&uY$6(YngyvUd(SI^rZFui}4xiql|GkZ0A)h(8e#8p;|Zz!FC(nL}es1iDJsEordt z-@xbhcwJUC6yW6Qx;rN=C~r?a5Yjr|u-knZ?KtWDB`K*P1N%QEdy<$2Gpn-?W@*?$ zyJvNp*8F2M|3@p`Br%gEH?#2E2#X$Poo26}?kJdztRxpz&-e%cYQSna8H7(Rzj0#1>$GWH zF6ZJCW>sPTlWy~Rp90$FiTW)?ir30;?c1HtNixaqw`MbdM%FV)k#ewu<8Sf2!4gTr#nL zBwYBIlm0<>kIQ}Hg=FY|1At!+6}WW#?B0r;0)fmiV7cG0H+Xw9hp^5rPD7r4A!noW z_x|Eh3ssAtmgnqj*FCkNDZzJR7DQdMQ+Ro%OW0-(MDVg2hK8y;<{F!tQ@OI z-gub80wr1De|nGe`3kxr&Gq$Po?k<|gGc(@P>2$oVCddhuo0H#sKFQv%lFZlv;YR^ z_U2-6xpH*Lq?(T%*cngVv9u&(VPyrl;|5el2^JF~78MCN0##Mo#kL3QDkUi$#`g9zky~c90$DkgZxcGnzADW$U=~Y|rCA9oWVyK^Vd2 zIMr>q+%pE=s4mS}Njt{lB{We{4+0(4G@);#U5qqlH%9G0^SYvf#f#awYT=7t%JgQV zziX`-DHpFZGgA={;qWm9!eYFIb*sL;9ix1r>x1_$x5pX58>`a6QpZaDR$W3)lMkT< ztm)}A9r2f}D=X=N7mzQ%vg%X~eDJKAL9@jdx0yr_@6erglXrDt<@IGW>RmiS)Mo&* z3w9jm)Wr8y)8=?eOItQgUOud*SLw*nIA%=&g!V&jE~AzQHwk=b&3mtOd=(reB~IDC zKgtD$-g*uL-flxsSabw%?&)kz^1pi3-!w1~23^g+VH2cDm*Y9-Xq4?@uUD@03=2i=2Ppux9=w^~vs_nw*t`!%UHm<2~vv2XjZLW}1M; z4ZunASm8wJT264q;UpWhrj~~jSYe?rej=-)pgg#~xk(yG)&s22wk>f_z2>eBsG=dT zi(?(M^wyu{Ym<`uOf`0>Xo2mI+npdyf%3!kBmmtLl9@Kf9Ftz22D%-dn*l)ZQeK{X zvt&*R=;j)-a&ms|U0R+RBCnh_WFt)7k9uAC_NK|R)C)iGyEQEFr>>u z$V@27x8H9I_$#13()|0xt`1v^5jS?x3%>+#zwg!7p024~pD2iyOO*}|mT^+iN)(ce zWS(P%oon3tlfuiAwC%TJ3LcTPlhgG+BRAlHCmIEN4T40zDRvY=Pfr#W z)+4tQDlTqrYnX8WSeYYe>SCzr=soU~+Dv#}p8x0EYca?jChvE5KmVMj5e=?NVc-b_ zccq+Xqw<~yhzEuPtM{Szr<YCfjqJv=(*qLt?gQq$V^$<`5ue5bw))|N$@IcP zK&PQ?hZ}V#)XK-s7wSG!)>N?k7CdLs2NT?d6|>Z9qgapIJ$@!0+Ripu!`{GDKeE+K zE85`6w;f{mdHG$#_P~soh|~Os^DZ7mky@z@_k#y-_4Si*Nh;&{#7U!z&FXYp^)4^m zffp=OU?_>AT4>hU6+1>!AP$h0%%XuPJV3HVH{oZ`9%_`StC_gNhJ+_^6RT4?kY4S8 zmxR}jl8Y;n)jCyN@-Ir3W`SR8sFu!Q+yvdpK0c+ihc^_2Zl|3?5^-l@!M8}^MA8>H zIRYe=7J#26-&?p3TrXetXXC2;m<;cXCcfpnylm`t?za8+FC9l5$YZn%Mo^Rs9PaDP z%p9G@Yk|7uR8iRT6Asy98s=c3fM}Ft&nZ86n12tpDVdmVzB@WPdK{`?uyWZFT%R@d zE0EWsI<(5&QnxE+3w^K9e$B8sWgQLYymjW~r!=+V>C>m(j#xDz5zRhWo?LMT^*(~e zBl-I`8W|reG8_c2LVu7U*#c4?jh#ff~ zsg~9Bd}>H5BdLtWfifs42&a_0^oGZKaWT4*kz6pdc#riCRAV$Wtxl&-*N%OEHZ**E ze0sSUtzuVR#EaukBCM#0r&eqZkQloG`lw-n4jZ=))4k}#r!@r*dj4Gu1b*BhW4SuC zS>eR8LFQ*i zw|ES&n~~Bz@;?*f<7s!~p)X?w2L9Jj#~Z*%oXd8R4NwkDA_uf7cg}K&xxs9rR_H@P z!~ph(&DpD!Tg4wgI^oeB9p@^Kuk~kTZUiXyb zWNrcIHH1Wmg7F8Aujl#kiR*ExDcRQ91FK~BDL3T*$!1o2#1xGoFBd23m6TUj0V%!$tGeg4^ za$sn=J2|_6=^O*K$DMQmf#Z2xuq){VMNeBG3GWfWv4Bj^4ysui0OBnX#o`TrbqDw> zK%iG2nDK)ISKX$O(is{bR?Ova53|FjjeUKY&tm)g<=x!RG1l?H^F-W4?1Ir6(yHr6 zX!p2XDHt{}1v^?Vl?wmoFV^Od{!;}w+%Ll|_ zFC6vko}O6Om*XsS3>rMyqIa44zDqKKF(D=;rMt2vK3wkTcn3?&L+VuU1lrW)dbyz( zVZgO`;pXN|Y@iv_|LtByWd+9g?%p2Vx9fC%wc6S(U)4a+rq}3akUSU^B-rkmTD4g+ zS$%oGc}YpjJ+J=&-siZ(n3X>&ImizDiJi%$C~>7IsYspYt@8`=owm*$#Wv6$($a>q zn=1C^XtlS zNcqJ>qvod;{`A^f^Di~aRPhMYFY24}CYLqS(Uy-+YCP)d$-%tH{{6WvNDAvBv?Qqn z1V~#1J3F4u=u0>Q1dDg%+5$P{@4eqIJU!Y7tAU#h6oi@V;z4!dKA(o z_z#5!qhLfrUS3||(^IHHWoi6k(P0rc_|7%2j3yI(y=-@0>e4{(hdv$AkmeYcmX;uN zC6+xjq~YxHB=twto=d^9E6+ho@H9VK-Q0Yht@;QKw(snwzL_KU-|g+$tvjgsMo+)+ z_+SJzNXLa?%3MTCe#>X>ni=nSodUc{8PoBig&0-2y^z>yadC0-8o?hmm>;l+2Ky3E z_phTt(c0P?1$PU}MQzmr(Np0pj^ta=q%>xeg=4bW^O};9l0``Z zPL)6v)aYQSWjt7MBQEaPH}31#H;>oCJ!D5puS**Wp?<++5KA!EU8 zB;Oa%+yaQAiaF{{{pq3N5`RHK6Co8_hS+Yl&VNiz=i>l|nQ@v16)t=@?JsTNO0Yglk z;`>rxza?K#Vh*3DQ0p&R4yRbGrXNB! zc^edc>m%h~nk2vTv?*n4zOOZ&j&l_PG8MP`$vrK1_WC?b{qqz1VRHuyQacQA$O`N$ z?1~FW1kT;w$^?F5tB9f@R2n%9zxU?0Uc9U?F=)w#H;Q-bmVxx&m{1QpMq#|p9~M(G z1d>a(YSv>)Ha7d?EcIby10IC+sy-bo{m-@9 z)Z5%cIcl9XSG=H4PLe7WH=h~B3PZOqfpsfdb?ksQk-OIV?ur)^0cK1Oz)P<5lLZ}Ik5}-u71t5KXK>?4Ym&rZ11C>1UPnZv0fF2fTUjkpNw|5X}X+gKZS{f^8x*&~< z;^+0uc;=+pE1rk$tKq-9h!v?m z-Xg`P@Vr+vUAMcYZ2*(n^qeX_>2FaDg=%E;2-wT*#D_s2f#{`6I@q_5+Tr8sd*$KfRZW!(E1Pm+Wq{1hJ5Mm=5wt;B_g;g+Z2e877dwyI2$tT@d(fvxDa@d_B_OkT<;py!kfDRq6 zWU|CsFM%iiTu(Y4=%tIDwC8&g$gi*dRHbzG8NhxdCw>cf#}fJ$q+2omng2s^PP#t8 z(rP>07{!*T_|x~Z{5|{)jeo$d&4?T&vO18j|0jE5iKXXPEG@moUd@Es=}l;RB3~`u z>EW(B>Tk<1cPZG~V!MOlAF{INX4IFOV11vKF4(LJT=U+F*ICPbpg<7(pI;Ff(HIbo zLleYY=$J8El#v6w=<$@uV#(&hhw;dN)@2gw&ZYF$bfVLAPI)IPre6 z_13rPvsZl$xH03N_LSeTEjl05b_z}4ZC-y}qG*qd0Y|A{$KStOAKK||t#+^!+8?r8HCLO?EUq-H)I)$BzL{a3 zVy?A?A+{soxnoy4Cek=o@c0WqZT|A*FPZ<+=1XVgO+uPmTN`R$eu4rw0Vu;^+`nID zpLF?qu#Q{v&$p@ub{|%dDyC5I=*Sq3^Tl$NaEDoH`lHpf-gx}Igllz=bWObc;=)Yz ztH?%*#nJV0EA5v&yQvhq1@rN*`DT*|`^{%ojCZ?L*ov#)c%5YPsaz=Vb-KFDk}TK7 zNB2bv(g#Qx} zAI))ReGh9$Fz0^V#Izc4=4gB1#6iaIcK6*69;tDrw)n3;IRyTwvR(6eE)I`R2Mr>Q zD^F3QOST0BO*n0vP2NYItI(bE1ve=VPwYh3x{ zu_~cm)9WTlTh}~3!f&-V-x80DopWV9-cP(PJ7@NrXj*iOnSJ>8!{EhAH|1T)$5^~& zxVKFVFVw8hO1aA=wle8P4-S9SKh)woj}i54H)x-g=jfEaR(>Fl;0>^{Gvv~V7%eCB zy`hW`4f(DbRgd>IT-#t_{d!2(Vu%|@L|6fCi$t*%+#RhEmDQ@YMY_9w@(4GRR0|Rer-Lc8__K8zm$x4M z&a(|>Ue}1OgFm*e8oanXSG44n-q#UZnJGJx&lJ_chEcoUnOv1>E7652R6!u&<)BGC z7S`HJ@}S>zp>`tITibzCyZAxm;epDIjhWqpMd4>9z7E&iT3hp(E@Q9Py!%4LwmI85 zLOx=q`R$dN9VOP7vvptn`x{N@H|-yBwhQG3KTo1iwsK(pGh?{LQl0zf_xi^3_&oMn zeeLcHc}$^YcP%U)>;s0%y#MUU77Dw8jn>dOeZBqld#Z=qi``f&S*MS}a$dTRc`6S6Zj|LD~>yDDMS{*rzL#XC;gYZ!p)ElJO!X^=(k6 z2pRNKRFrwC0=}_&cHVyK8u%$?V*D=#M}fKZU5rWbt3Q@RFk(Ml@A+NMtA=m*l|av+ zG0Vw#GZgXT`dm)6%5gyuR0`+&fhG1gxF0pHns=C23Y==k>+o z=YKme7Ib5a(x%xn<}Wtgk;NBRt);l^CmNrQb&AK1chcpO8r7`#nV2rxN9_n_+fT^) z#LWMPp=Oh=ZZArTA}vU+>CqL#_f7nbIh8~grBs9tYWEbqn_yIDbxL1K5S3(^OP{I! z?fua*=G_t2nqvdrRwFtTeS>+b+v?+O)k#bJ@6U$2NDH+)3uZ~C)gR_r?_7?QZ~daq zU4K6}^|<~66;%0OG2OdId@PowOO>qGcH>G9#|sqtQrPaR zGQ=`Arj%nHFr-APQNN+S$K{;iWRw^*$*tz{UC+PGhKoqy*{8{(ijsyeS@W{9IQZ61 zFR%PyUnOQR&j_L87vk>G`{p&tK^0_rE3!TseR+I}uv=;{CWz*V;bGxh+i(u_rpp0e z2Y$0R)O)8r>h>E;Z8m8~wmj;uOT*j5n3#vAs*5f%7+dvp(rYG5Go~)evH~VKh?i`2cDb6W3lZ;m+I^%>MBc5hquic z&=eP$*D!D@%15V1xIg{w8xpD;_fzvQuqS<$@H!zY>WS=kP1la3lLrGP%yJ4EMqQ08 zvoFy118KU32qrEr1=>>9dLFyEs?BUzHcr#fZ?7lmE_|R%4CFjzy%p+~@pX^Yz-5f( zZqB)xfzbyqSB1Ncy?w+Ov^NYI75I;)&CuMgnzxG4EVLByiS5uj9}Or*s!+@Hv#$JY z63EQ1w)^c9&mJl$%&4Gf{CPN1POrS_h~fS}mj(EjMd>L+tF2Y1LK)_-+QHUuE%eSu zI0d!+FGTmc+!!dr2RyF=9iPS_Fr`8G8w$GLF59>JN)t2DYU3xftg7;84fJWN_X=);&=XJ%zJw$U*%Q8t>nlM zu8t%Sd90%Rlq)Yc68F@PS&qhOC3Vp0R4wt1Nw3Lj^`v;Kf@p63W2{rp&OUyNrJt|l zoHvg0x_NcYjhc=lUyPy-|ApHxx+s6TqR79qJe`plbBngIP4j)!>p3y8fkCZ-HnGe& zaZ|MOVqxnXpSlWkGu6nuM6$02OEY9tsee1!u?TBCPIN+y77zz#mmy{sgFcvhuDfK`Rd8uj z-!JRy-S+V}>+7;~VPD~$w^Qwb&Qq=-cuM}>0k=r2!igt>+b`x#hukO>B#8t~g}Ut@ zAIsmmq4d|bnCyPjUsIHr)@KT7c*R5-C46G*!E|Y_FR8%BQan*KPvUQ zcK|)S+B&b7`M+*^w>dLKm4@>3@@ji~@6ghUe-on!3=HJr;pz9Brq?&f{b68we@XgV z&!6_|M6Rq|WSkx}R`2>*O@0<>yw;HSb#)c*$d(Y{3+Zk3GYbkI=%XWF|I4O>yu6N>tz#Pdf0uS>W zxvYE;7(d~rBgY$dlg*x*ZJ`tw^#*g13?TnTNxADJ!k`!l!Ka=d8`M{_Sqa;Qq zFu*HBrkm&5ufx<#`Eb*b@^y5SIZcP>2HDd=@w;5OaY4n^>^R+y3$ivaPvgE&v$mP% zl^AS#N}G0tr?kJX2VU%Q+hn+8zA~fMZa$1?>3*8({)64TOjRyM>3N3-O&Kz{6Ir!C zooRUN%*OO>B}fSbh{?##uhtL-_#_LS+sQ3WM8-%h<(qnkx*iuLJR3Z)Q{NUsyQ7jZjaNh!n7U94<#Nuy}6Vtw4Stxyig{i4&H5Z^BM19D_^c7@*Y$xh)ufWcfk(K=bDjm=z?qs7E_3mqNZuj1ln=*j|pd3Ir8U|eTXDaW&N zN+jWpwuMDtVIg}?PLAFBa4;CwXuo~ytfr?5!bf0|>j8Ne=%nL=MIUb$OM(0aqzwe@ zHuuo5NgvbGXQxLaF0Kvy2>TeufV}_t^KnOKCm2-Mb#(>$`JqEwkjr`J3Amdy10Ni4 zoSD_t(eX!Lq7gOXOC0`>+1ciafr2*kHz_D6in*TFgG=;Hu+bVBISz#J2yBF)ZbaO) z!otFaM@MHjHUh%J?!)6#FSGLn)^J^YJt$a>0Prg24}Q3(qNdiDEFM7^lsRBxV{0oa zAu$i4L69bWqKb3+08G@0B4ubdQiCNgoMb*$REAN7B4?KqJgKD=jEvu&|Q5&l7>iXpttxU;mz`f7s$o~Wg6LvKv`}AJ}x5ObXrM{0I_E^eIDQOd?@Ua zI|KwyYF&)~*4$ZsVj{U-v;QN33pyoR8!J1z28i@(YUL^D|18%Xp>5ukXV8w9m6a9A z>&SqNkO`i?@+&V-2lPFN?b$ti`~sVWw$l^TON&JieTXGL1}`o@KR;A5_>zVZC|9mr zVZTdw7z*}0wlKB@v;@v@Nz3D<1+^E(0~z;$6P^ULZ?JmGgT{m5XT|=e@$nd-PP15y zbAd0_2*66_rtPpE-d{u0H88Lr8@>Hv+(j~ce%tD>p|0-3I}}e!>F-IWoK8J8|9jm4 z@g@wIfUfy2_!#VOPJvPwgv_lS9rNIFC3!ocWT2y?V;QXYyuH0av&MFG^!4j)6jW?t zrzy%4*tF1v6@=*<)8PM>b(o@&@CGsG(l$5moT>i=CV!?sMZEK%s}b-bVH&_!*vq$P zvHSG<3Z>$BYFp)~zGwV%upifhw;&8%k({*rJkT~s0|_0xC$Ms8WmHr|k*PRRF%QYf zy=G^1B_t)S?d+0({{T8@GFR7Ao^Ba=`B%!y1V&vkk9c{B3RMG=lPREeV7DLc`^2-kyvmU(>G0o>IwQQb{U7fRHrd3Ocm#>lK6V6y~Nbpc`ud-LzXK~raEXPO?U4xncM zmWR0dhK4^CGxPHE>pDBJzzG7>wxAaDon!`b$SkmyU4pXJOGCnFm98pKU`#sAVR>x; zpT!0w&J5}$&tzoo;Nju@HX8|n?b%!Hd8vxag5``&PEJn4$Y|8^^${c|gabI?;o-n* z_kvf7xLnq}FZ5(qn=tC_?FGq$oQ%x-%1VCNP`b-K3HyVxVi5O001l$HukrCgFA{1X z7Qq(#14MQRu^L8X$diNDK4nK7!Kk%}Xl(gi!_Us#AWT|WTPMKcy?*0{j;?MU7+b!C zXM>36O!=kZLBXz$;dKoB@Zl=_EV9^PGnDO)(_vs>$UnUgF$_Xh<<;GR*D**l6mU+p zC8Y0l1g3j8Z{E~C*;{cL8_d-L#{TsJ!_J?uIIsd?{RBfSgCC=2U}zd0{SN+ZebAms z>`ompK`hQd0S}u=Mpe}h;8;6WiC!2pNDpJmg# zvlcycnWp~|KQ?Gwq@oboh2kKdXzx%NkG_V5!6Yf#61$a<&Bcbv$+(>z8?eiR$V&;E z9YokeE{WEg3)*}uMJUKZz#0`CW`+35fud%V6z^3PR*`o#<1H{ZV zjok+5gsFn-k?DFbo0?C`5Sy zANNL9whj&fu*|y#xEmrT0Tal6=eQG?5+Msqtg`Z)r1Zlyyaz6;X%rNApFkCW$pT_7 zESH$SF47+uwrvffoGDKEdMzH$CW5*sk`|AP#$aLHveH&oLFM1wr`K4x*+v zPs3mr>lztR*{3w{ONRV2gD#;3ne9~qcQ38ZKYv1Cn0VUr=6m<<{XIXNl7mYG<2A5} z(+U9KnAPZ?=nK|Jq@brqKy))OMUZz1s|~a^^;1(?TZUP`etnJQb-W7>5%~t~P77g5 zd!x{D#{{lU0u0!Zh~+74GWLN!AL2j?9q1$Y7^1=kC+PK{;gCLg`0yP(VIqlqc{R|; zg3+OprgO4T!VtK=BKNR5kZIp;rL_f;Xb5rv@D!K%C&8U@!uZSRXpU4DCNbAna6W;g zz~2Q65=z9s0bU3sa*3en={jfBC~JV+@uiB&18DUaLR51hXMlZ$yqQnfB(p%8n1Pdh zuyK8BD+t7uC=fiTC@5|~H1)d0m_~TK1MaWEQBk5`J%>vv(Ib9cK~WKjpd99-4Uh%a z$w~7YST$0lU2=ma;~|Xp5f^Vq#V0%5-PMDZd?Do>_%M|+I~w5C=!3-DC25{H|Ct6ZH75oMWJDO#GBOTjn-!UjuxPrh zB&*`$HhuQ@f0a2f8Jwv}0+ym6ih-#yHIS@9>iEaJ&!n)SsVN_Np**3V?%%≺`5> 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 + + + + + + + + + + + + + + 1 + 2 + 3 + + diff --git a/src/mkdoxy/index.html b/src/mkdoxy/index.html new file mode 100644 index 000000000..8d7cf3e2a --- /dev/null +++ b/src/mkdoxy/index.html @@ -0,0 +1,2626 @@ + + + + + + + + + + + + + + + + + + + + MkDoxy - LibreTiny + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + +
+ + +
+ +
+ + + + + + +
+
+ + + +
+
+
+ + + + +
+
+
+ + + +
+
+
+ + + +
+
+
+ + + +
+
+ + + + + + + + +

MkDoxy

+

MkDoxy -> MkDocs + Doxygen. Easy documentation with code snippets.

+

Based on matusnovak/doxybook

+

This python tool is extension for MkDocs. Extension will take your programme source code and runs Doxygen. +Than converts exported XML into markdown and create new folder with full generated documentation. +Next usage is by snippets inside documentation markdown.

+

Example usage

+
    +
  1. +

    Generate class with name rb::MotorChangeBuilder +

    ::: doxy.Class
    +    name: rb::MotorChangeBuilder
    +

    +
  2. +
  3. +

    Generate method brake (MotorId id, uint16_t brakingPower) from class with name rb::MotorChangeBuilderA +

    ::: doxy.Class.Method
    +    name: rb::MotorChangeBuilder
    +    method: brake (MotorId id, uint16_t brakingPower)
    +

    +
  4. +
  5. +

    Generate function with name readUltra (bool async) +

    ::: doxy.Function
    +    name: readUltra (bool async)
    +

    +
  6. +
  7. +

    Generate code snippet from file RBCXLeds.cpp +

    ::: doxy.Code
    +    file: RBCXLeds.cpp
    +    start: 21
    +    end: 35
    +

    +
  8. +
+

Basic-implementation

+ + +

Requirements

+

Apt

+
    +
  • python 3.6 or newer -> sudo apt install python3
  • +
  • Pip -> sudo apt install python3-pip
  • +
  • Git -> sudo apt install git
  • +
  • Doxygen -> sudo apt install doxygen
  • +
+

Pip

+
    +
  • Jinja2 -> pip install jinja2
  • +
  • Mkdocs -> pip install mkdocs
  • +
  • ruamel.yaml -> pip install ruamel.yaml
  • +
+

Optional:

+
    +
  • mkdocs-material -> pip install mkdocs-material
  • +
+

Installation

+

Install using Python Pip: https://pypi.org/project/mkdocs-doxygen-snippets-plugin/

+
pip install mkdocs-doxygen-snippets-plugin
+
+

Or Install manually:

+
git clone https://github.com/JakubAndrysek/mkdocs-doxygen-snippets-plugin.git
+cd mkdocs-doxygen-snippets-plugin
+python setup.py install
+
+ + + + + + + + + + + + +

License

+
MIT License
+
+Copyright (c) 2021 Kuba Andrýsek
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
+ + + + + + +
+
+ + + + +
+ +
+ + + +
+
+
+
+ + + + + + + + + + + + + \ No newline at end of file diff --git a/src/mkdoxy/mkdoxy.egg-info/PKG-INFO b/src/mkdoxy/mkdoxy.egg-info/PKG-INFO new file mode 100644 index 000000000..7f09717ad --- /dev/null +++ b/src/mkdoxy/mkdoxy.egg-info/PKG-INFO @@ -0,0 +1,287 @@ +Metadata-Version: 2.1 +Name: mkdoxy +Version: 1.0.0 +Summary: MkDoxy -> MkDocs + Doxygen. Easy documentation with code snippets. +Home-page: https://github.com/JakubAndrysek/mkdoxy +Author: Jakub Andrýsek +Author-email: email@kubaandrysek.cz +License: MIT +Keywords: python,open-source,documentation,mkdocs,doxygen,multilanguage +Classifier: License :: OSI Approved :: MIT License +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Operating System :: OS Independent +Requires-Python: >=3.7 +Description-Content-Type: text/markdown +License-File: LICENSE + +# MkDoxy + +## MkDoxy -> MkDocs + Doxygen. Easy documentation with code snippets. + +### Based on [matusnovak/doxybook](https://matusnovak.github.io/doxybook) + +This python tool is extension for MkDocs. Extension will take your programme source code and runs Doxygen. +Than converts exported XML into markdown and create new folder with full generated documentation. +Next usage is by snippets inside documentation markdown. + +## Example usage + +1. Generate class with name `rb::MotorChangeBuilder` +```yaml +::: doxy.Class + name: rb::MotorChangeBuilder +``` + +2. Generate method `brake (MotorId id, uint16_t brakingPower)` from class with name `rb::MotorChangeBuilderA` +```yaml +::: doxy.Class.Method + name: rb::MotorChangeBuilder + method: brake (MotorId id, uint16_t brakingPower) +``` + +3. Generate function with name `readUltra (bool async)` +```yaml +::: doxy.Function + name: readUltra (bool async) +``` + +4. Generate code snippet from file `RBCXLeds.cpp` +```yaml +::: doxy.Code + file: RBCXLeds.cpp + start: 21 + end: 35 +``` + +![Basic-implementation](docs/media/Basic-implementation.png) + + + +## Requirements + +### Apt +- python 3.6 or newer -> `sudo apt install python3` +- Pip -> `sudo apt install python3-pip` +- Git -> `sudo apt install git` +- Doxygen -> `sudo apt install doxygen` + +### Pip +- Jinja2 -> `pip install jinja2` +- Mkdocs -> `pip install mkdocs` +- ruamel.yaml -> `pip install ruamel.yaml` + +### Optional: +- mkdocs-material -> `pip install mkdocs-material` + + +## Installation + +**Install using Python Pip: ** + +```bash +pip install mkdocs-doxygen-snippets-plugin +``` + +**Or Install manually:** + +```bash +git clone https://github.com/JakubAndrysek/mkdocs-doxygen-snippets-plugin.git +cd mkdocs-doxygen-snippets-plugin +python setup.py install +``` + + + + +## What files are generated? + +This tool was designed to copy the file naming and structure of Doxygen html output. The naming of the files is identical except tiny changes with Class/Variable/enumeration Index pages. + +All classes, namespaces, structures, and interfaces are generated, including the following additional files: + +* Directories (e.g. `dir_....md`) +* Files with source code + file documentation (e.g. `filename_8h.md`) +* Markdown pages processed through doxygen, highly do not recommend using this! (e.g. `md_src_....md`) +* Members (e.g. `class_xxx_yyy.md` or `namespace_xxx_yyy.md`) +* Class List (e.g. `annotated.md`) +* Class Index (e.g. `classes.md`) +* Class Members (e.g. `class_members.md`, `class_member_enums.md`, `class_member_functions.md`, `class_member_typedefs.md`, `class_member_variables.md`) +* Class Hierarchy (.e.g `hierarchy.md`) +* Namespace List (e.g. `namespaces.md`) +* Namespace Members (e.g. `namespace_members.md`, `namespace_member_enums.md`, `namespace_member_functions.md`, `namespace_member_typedefs.md`, `namespace_member_variables.md`) +* Modules/groups (e.g. `modules.md`) +* Index page (if exists within Doxygen output as `indexpage.xml`) (e.g. `index.md`) +* Any additional pages generated by Doxygen such as bugs, todo, tests + +See the example folder to see all files. + + + + + + + + + + + + + +## License + +``` +MIT License + +Copyright (c) 2021 Kuba Andrýsek + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. +``` diff --git a/src/mkdoxy/mkdoxy.egg-info/SOURCES.txt b/src/mkdoxy/mkdoxy.egg-info/SOURCES.txt new file mode 100644 index 000000000..a3f27b39e --- /dev/null +++ b/src/mkdoxy/mkdoxy.egg-info/SOURCES.txt @@ -0,0 +1,39 @@ +LICENSE +README.md +setup.py +mkdoxy/__init__.py +mkdoxy/cache.py +mkdoxy/constants.py +mkdoxy/doxygen.py +mkdoxy/doxyrun.py +mkdoxy/finder.py +mkdoxy/generatorAuto.py +mkdoxy/generatorBase.py +mkdoxy/generatorSnippets.py +mkdoxy/markdown.py +mkdoxy/node.py +mkdoxy/plugin.py +mkdoxy/property.py +mkdoxy/utils.py +mkdoxy/xml_parser.py +mkdoxy.egg-info/PKG-INFO +mkdoxy.egg-info/SOURCES.txt +mkdoxy.egg-info/dependency_links.txt +mkdoxy.egg-info/entry_points.txt +mkdoxy.egg-info/requires.txt +mkdoxy.egg-info/top_level.txt +mkdoxy/templates/annotated.jinja2 +mkdoxy/templates/classes.jinja2 +mkdoxy/templates/code.jinja2 +mkdoxy/templates/error.jinja2 +mkdoxy/templates/files.jinja2 +mkdoxy/templates/hierarchy.jinja2 +mkdoxy/templates/index.jinja2 +mkdoxy/templates/memDef.jinja2 +mkdoxy/templates/memTab.jinja2 +mkdoxy/templates/member.jinja2 +mkdoxy/templates/modules.jinja2 +mkdoxy/templates/namespaces.jinja2 +mkdoxy/templates/page.jinja2 +mkdoxy/templates/pages.jinja2 +mkdoxy/templates/programlisting.jinja2 \ No newline at end of file diff --git a/src/mkdoxy/mkdoxy.egg-info/dependency_links.txt b/src/mkdoxy/mkdoxy.egg-info/dependency_links.txt new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/src/mkdoxy/mkdoxy.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/src/mkdoxy/mkdoxy.egg-info/entry_points.txt b/src/mkdoxy/mkdoxy.egg-info/entry_points.txt new file mode 100644 index 000000000..146b8a02d --- /dev/null +++ b/src/mkdoxy/mkdoxy.egg-info/entry_points.txt @@ -0,0 +1,2 @@ +[mkdocs.plugins] +mkdoxy = mkdoxy.plugin:MkDoxy diff --git a/src/mkdoxy/mkdoxy.egg-info/requires.txt b/src/mkdoxy/mkdoxy.egg-info/requires.txt new file mode 100644 index 000000000..053d84433 --- /dev/null +++ b/src/mkdoxy/mkdoxy.egg-info/requires.txt @@ -0,0 +1,3 @@ +mkdocs +Jinja2 +ruamel.yaml diff --git a/src/mkdoxy/mkdoxy.egg-info/top_level.txt b/src/mkdoxy/mkdoxy.egg-info/top_level.txt new file mode 100644 index 000000000..5ed5181e0 --- /dev/null +++ b/src/mkdoxy/mkdoxy.egg-info/top_level.txt @@ -0,0 +1 @@ +mkdoxy diff --git a/src/mkdoxy/mkdoxy/__init__.py b/src/mkdoxy/mkdoxy/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/src/mkdoxy/mkdoxy/cache.py b/src/mkdoxy/mkdoxy/cache.py new file mode 100644 index 000000000..646764a10 --- /dev/null +++ b/src/mkdoxy/mkdoxy/cache.py @@ -0,0 +1,12 @@ +class Cache: + def __init__(self): + self.cache = {} + + def add(self, key: str, value): + self.cache[key] = value + + def get(self, key: str): + if key in self.cache: + return self.cache[key] + else: + raise IndexError('Key: ' + key + ' not found in cache!') diff --git a/src/mkdoxy/mkdoxy/constants.py b/src/mkdoxy/mkdoxy/constants.py new file mode 100644 index 000000000..19d6ab088 --- /dev/null +++ b/src/mkdoxy/mkdoxy/constants.py @@ -0,0 +1,156 @@ +from enum import Enum + +OVERLOAD_OPERATORS = [ + 'operator=', + 'operator+', + 'operator-', + 'operator*', + 'operator/', + 'operator+=', + 'operator-=', + 'operator*=', + 'operator/=', + 'operator==', + 'operator%', + 'operator%=', + 'operator++', + 'operator--', + 'operator==', + 'operator!=', + 'operator<=', + 'operator>=', + 'operator>', + 'operator<', + 'operator!', + 'operator&&', + 'operator||', + 'operator~', + 'operator&', + 'operator|', + 'operator^', + 'operator<<', + 'operator>>', + 'operator~=', + 'operator&=', + 'operator|=', + 'operator^=', + 'operator<<=', + 'operator>>=', + 'operator[]', + 'operator*', + 'operator&', + 'operator->', + 'operator->*' +] + + +class Kind(Enum): + NONE = 'none' + ROOT = 'root' + NAMESPACE = 'namespace' + CLASS = 'class' + STRUCT = 'struct' + UNION = 'union' + FUNCTION = 'function' + VARIABLE = 'variable' + DEFINE = 'define' + TYPEDEF = 'typedef' + ENUM = 'enum' + ENUMVALUE = 'enumvalue' + FRIEND = 'friend' + FILE = 'file' + DIR = 'dir' + PAGE = 'page' + EXAMPLE = 'example' + GROUP = 'group' + INTERFACE = 'interface' + + def is_function(self) -> bool: + return self == Kind.FUNCTION + + def is_variable(self) -> bool: + return self == Kind.VARIABLE + + def is_namespace(self) -> bool: + return self == Kind.NAMESPACE + + def is_class(self) -> bool: + return self == Kind.CLASS + + def is_struct(self) -> bool: + return self == Kind.STRUCT + + def is_enum(self) -> bool: + return self == Kind.ENUM + + def is_interface(self) -> bool: + return self == Kind.INTERFACE + + def is_class_or_struct(self) -> bool: + return self == Kind.CLASS or self == Kind.STRUCT or self == Kind.INTERFACE + + def is_typedef(self) -> bool: + return self == Kind.TYPEDEF + + def is_define(self) -> bool: + return self == Kind.DEFINE + + def is_union(self) -> bool: + return self == Kind.UNION + + def is_group(self) -> bool: + return self == Kind.GROUP + + def is_root(self) -> bool: + return self == Kind.ROOT + + def is_friend(self) -> bool: + return self == Kind.FRIEND + + def is_file(self) -> bool: + return self == Kind.FILE + + def is_dir(self) -> bool: + return self == Kind.DIR + + def is_page(self) -> bool: + return self == Kind.PAGE + + def is_language(self) -> bool: + LANGUAGE = [ + Kind.FUNCTION, + Kind.VARIABLE, + Kind.NAMESPACE, + Kind.DEFINE, + Kind.CLASS, + Kind.STRUCT, + Kind.TYPEDEF, + Kind.ENUM, + Kind.ENUMVALUE, + Kind.UNION, + Kind.INTERFACE, + Kind.FRIEND + ] + + if self in LANGUAGE: + return True + return False + + def is_parent(self) -> bool: + return self == Kind.NAMESPACE or self == Kind.CLASS or self == Kind.STRUCT or self == Kind.UNION or self == Kind.INTERFACE + + def is_member(self) -> bool: + return self.is_language() and not self.is_parent() + + @staticmethod + def from_str(s: str) -> 'Kind': + try: + return Kind(s) + except Exception as e: + return Kind.NONE + + +class Visibility(Enum): + PUBLIC = 'public' + PROTECTED = 'protected' + PRIVATE = 'private' diff --git a/src/mkdoxy/mkdoxy/doxygen.py b/src/mkdoxy/mkdoxy/doxygen.py new file mode 100644 index 000000000..54db2fc2c --- /dev/null +++ b/src/mkdoxy/mkdoxy/doxygen.py @@ -0,0 +1,121 @@ +import os +from xml.etree import ElementTree +from mkdoxy.node import Node +from mkdoxy.constants import Kind, Visibility +from mkdoxy.cache import Cache +from mkdoxy.xml_parser import XmlParser +import logging + +log = logging.getLogger("mkdocs") + + + +class Doxygen: + def __init__(self, index_path: str, parser: XmlParser, cache: Cache, debug: bool = False): + self.debug = debug + path = os.path.join(index_path, 'index.xml') + if self.debug: + log.info('Loading XML from: ' + path) + xml = ElementTree.parse(path).getroot() + + self.parser = parser + self.cache = cache + + self.root = Node('root', None, self.cache, self.parser, None) + self.groups = Node('root', None, self.cache, self.parser, None) + self.files = Node('root', None, self.cache, self.parser, None) + self.pages = Node('root', None, self.cache, self.parser, None) + + for compound in xml.findall('compound'): + kind = Kind.from_str(compound.get('kind')) + refid = compound.get('refid') + if kind.is_language(): + node = Node(os.path.join(index_path, refid + '.xml'), None, self.cache, self.parser, self.root) + node._visibility = Visibility.PUBLIC + self.root.add_child(node) + if kind == Kind.GROUP: + node = Node(os.path.join(index_path, refid + '.xml'), None, self.cache, self.parser, self.root) + node._visibility = Visibility.PUBLIC + self.groups.add_child(node) + if kind in [Kind.FILE, Kind.DIR]: + node = Node(os.path.join(index_path, refid + '.xml'), None, self.cache, self.parser, self.root) + node._visibility = Visibility.PUBLIC + self.files.add_child(node) + if kind == Kind.PAGE: + node = Node(os.path.join(index_path, refid + '.xml'), None, self.cache, self.parser, self.root) + node._visibility = Visibility.PUBLIC + self.pages.add_child(node) + + if self.debug: + log.info('Deduplicating data... (may take a minute!)') + for i, child in enumerate(self.root.children.copy()): + self._fix_duplicates(child, self.root, []) + + for i, child in enumerate(self.groups.children.copy()): + self._fix_duplicates(child, self.groups, [Kind.GROUP]) + + for i, child in enumerate(self.files.children.copy()): + self._fix_duplicates(child, self.files, [Kind.FILE, Kind.DIR]) + + self._fix_parents(self.files) + + if self.debug: + log.info('Sorting...') + self._recursive_sort(self.root) + self._recursive_sort(self.groups) + self._recursive_sort(self.files) + self._recursive_sort(self.pages) + + def _fix_parents(self, node: Node): + if node.is_dir or node.is_root: + for child in node.children: + if child.is_file: + child._parent = node + if child.is_dir: + self._fix_parents(child) + + def _recursive_sort(self, node: Node): + node.sort_children() + for child in node.children: + self._recursive_sort(child) + + def _is_in_root(self, node: Node, root: Node): + return any(node.refid == child.refid for child in root.children) + + def _remove_from_root(self, refid: str, root: Node): + for i, child in enumerate(root.children): + if child.refid == refid: + root.children.pop(i) + return + + def _fix_duplicates(self, node: Node, root: Node, filter: [Kind]): + for child in node.children: + if len(filter) > 0 and child.kind not in filter: + continue + if self._is_in_root(child, root): + self._remove_from_root(child.refid, root) + self._fix_duplicates(child, root, filter) + + def printStructure(self): + if not self.debug: + return + print('\n') + log.info("Print root") + for node in self.root.children: + self.print_node(node, '') + print('\n') + + log.info("Print groups") + for node in self.groups.children: + self.print_node(node, '') + print('\n') + + log.info("Print files") + for node in self.files.children: + self.print_node(node, '') + + def print_node(self, node: Node, indent: str): + if self.debug: + log.info(f"{indent} {node.kind} {node.name}") + for child in node.children: + self.print_node(child, indent + ' ') diff --git a/src/mkdoxy/mkdoxy/doxyrun.py b/src/mkdoxy/mkdoxy/doxyrun.py new file mode 100644 index 000000000..f4c961b30 --- /dev/null +++ b/src/mkdoxy/mkdoxy/doxyrun.py @@ -0,0 +1,107 @@ +from subprocess import Popen, PIPE, STDOUT +import shlex +import logging +from pprint import * +import sys +import hashlib +import glob +import ruamel.yaml as yaml +from pathlib import Path, PurePath +import tempfile + +log = logging.getLogger("mkdocs") + + +class DoxygenRun: + def __init__(self, doxygenSource: str, tempDoxyFolder: str, doxyCfgNew): + self.doxygenSource = doxygenSource + self.tempDoxyFolder = tempDoxyFolder + self.doxyCfgNew = doxyCfgNew + self.hashFileName = "hashChanges.yaml" + self.hashFilePath = PurePath.joinpath(Path(self.tempDoxyFolder), Path(self.hashFileName)) + + self.doxyCfg = { + "INPUT": self.doxygenSource, + "OUTPUT_DIRECTORY": self.tempDoxyFolder, + "DOXYFILE_ENCODING": "UTF-8", + "GENERATE_XML": "YES", + "RECURSIVE": "YES", + "EXAMPLE_PATH": "examples", + "SHOW_NAMESPACES": "YES", + "GENERATE_HTML": "NO", + "GENERATE_LATEX": "NO", + } + + self.doxyCfg.update(self.doxyCfgNew) + self.doxyCfgStr = self.dox_dict2str(self.doxyCfg) + + new_file, filename = tempfile.mkstemp() + + # Source of dox_dict2str: https://xdress-fabio.readthedocs.io/en/latest/_modules/xdress/doxygen.html#XDressPlugin + def dox_dict2str(self, dox_dict): + s = "" + new_line = '{option} = {value}\n' + for key, value in dox_dict.items(): + + if value is True: + _value = 'YES' + elif value is False: + _value = 'NO' + else: + _value = value + + s += new_line.format(option=key.upper(), value=_value) + + # Don't need an empty line at the end + return s.strip() + + def hasChanged(self): + def heshWrite(filename: str, hash: str): + with open(filename, "w") as file: + file.write(hash) + + def hashRead(filename: str) -> str: + with open(filename, "r") as file: + return str(file.read()) + + sha1 = hashlib.sha1() + srcs = self.doxygenSource.split(" ") + for src in srcs: + for path in Path(src).rglob('*.*'): + # # Code from https://stackoverflow.com/a/22058673/15411117 + # # BUF_SIZE is totally arbitrary, change for your app! + BUF_SIZE = 65536 # lets read stuff in 64kb chunks! + with open(path, 'rb') as f: + while True: + data = f.read(BUF_SIZE) + if not data: + break + sha1.update(data) + # print(f"{path}: {sha1.hexdigest()}") + + hahsNew = sha1.hexdigest() + if Path(self.hashFilePath).is_file(): + hashOld = hashRead(self.hashFilePath) + if hahsNew == hashOld: + return False + + heshWrite(self.hashFilePath, hahsNew) + return True + + def run(self): + doxyBuilder = Popen(['doxygen', '-'], stdout=PIPE, stdin=PIPE, stderr=PIPE) + stdout_data = doxyBuilder.communicate(self.doxyCfgStr.encode('utf-8'))[0].decode().strip() + # log.info(self.destinationDir) + # log.info(stdout_data) + + def checkAndRun(self): + if self.hasChanged(): + self.run() + return True + else: + return False + + + @property + def path(self): + return Path.joinpath(Path(self.tempDoxyFolder), Path("xml")) diff --git a/src/mkdoxy/mkdoxy/finder.py b/src/mkdoxy/mkdoxy/finder.py new file mode 100644 index 000000000..5765a14e1 --- /dev/null +++ b/src/mkdoxy/mkdoxy/finder.py @@ -0,0 +1,70 @@ +import os +import re +import string +import traceback +from typing import TextIO +from jinja2 import Template +from jinja2.exceptions import TemplateSyntaxError, TemplateError +from jinja2 import StrictUndefined, Undefined +from mkdoxy.node import Node, DummyNode +from mkdoxy.doxygen import Doxygen +from mkdoxy.constants import Kind +from mkdoxy.utils import recursive_find, recursive_find_with_parent +from pprint import pprint + + +class Finder: + def __init__(self, doxygen: Doxygen, debug: bool = False): + self.doxygen = doxygen + self.debug = debug + + def _normalize(self, name: str) -> str: + return name.replace(" ", "") + + def listToNames(self, list): + return [part.name_params for part in list] + + def doxyClass(self, project, className: str): + classes = recursive_find(self.doxygen[project].root.children, Kind.CLASS) + if classes: + for findClass in classes: + if findClass.name_long == className: + return findClass + return self.listToNames(classes) + return None + + def doxyClassMethod(self, project, className: str, methodName: str): + findClass = self.doxyClass(project, className) + if findClass: + if isinstance(findClass, list): + for member in findClass: + if self._normalize(methodName) in self._normalize(member): + return member + return findClass + else: + members = recursive_find(findClass.children, Kind.FUNCTION) + if members: + for member in members: + if self._normalize(methodName) in self._normalize(member.name_params): + return member + return self.listToNames(members) + return None + return None + + def doxyFunction(self, project, functionName: str): + functions = recursive_find_with_parent(self.doxygen[project].files.children, [Kind.FUNCTION], [Kind.FILE]) + if functions: + for function in functions: + if self._normalize(functionName) == self._normalize(function.name_params): + return function + return self.listToNames(functions) + return None + + def doxyCode(self, project, fileName): + files = recursive_find_with_parent(self.doxygen[project].files.children, [Kind.FILE], [Kind.DIR]) + if files: + for file in files: + if self._normalize(fileName) == self._normalize(file.name_long): + return file + return self.listToNames(files) + return None diff --git a/src/mkdoxy/mkdoxy/generatorAuto.py b/src/mkdoxy/mkdoxy/generatorAuto.py new file mode 100644 index 000000000..afec0eda8 --- /dev/null +++ b/src/mkdoxy/mkdoxy/generatorAuto.py @@ -0,0 +1,248 @@ +import os +import re +import string +import traceback +from mkdocs.structure import files +from io import StringIO +from typing import TextIO +from jinja2 import Template +from jinja2.exceptions import TemplateSyntaxError, TemplateError +from jinja2 import StrictUndefined, Undefined +from mkdoxy.node import Node, DummyNode +from mkdoxy.doxygen import Doxygen +from mkdoxy.constants import Kind +from mkdoxy.generatorBase import GeneratorBase +from mkdoxy.utils import recursive_find, recursive_find_with_parent +from pprint import * +from pathlib import Path, PurePath +import logging + +log = logging.getLogger("mkdocs") + +ADDITIONAL_FILES = { + 'Namespace ListNamespace List': 'namespaces.md', + 'Namespace Members': 'namespace_members.md', + 'Namespace Member Functions': 'namespace_member_functions.md', + 'Namespace Member Variables': 'namespace_member_variables.md', + 'Namespace Member Typedefs': 'namespace_member_typedefs.md', + 'Namespace Member Enumerations': 'namespace_member_enums.md', + 'Class Index': 'classes.md', + 'Class Hierarchy': 'hierarchy.md', + 'Class Members': 'class_members.md', + 'Class Member Functions': 'class_member_functions.md', + 'Class Member Variables': 'class_member_variables.md', + 'Class Member Typedefs': 'class_member_typedefs.md', + 'Class Member Enumerations': 'class_member_enums.md', +} + +def generate_link(name, url) -> str: + return '* [' + name + '](' + url + ')\n' + +# def generate_link(name, url) -> str: +# return f"\t\t- '{name}': '{url}'\n" + +class GeneratorAuto: + def __init__(self, + generatorBase: GeneratorBase, + tempDoxyDir: str, + siteDir: str, + apiPath: str, + doxygen: Doxygen, + useDirectoryUrls: bool, + debug: bool = False): + self.generatorBase = generatorBase + self.tempDoxyDir = tempDoxyDir + self.siteDir = siteDir + self.apiPath = apiPath + self.doxygen = doxygen + self.useDirectoryUrls = useDirectoryUrls, + self.fullDocFiles = [] + self.debug = debug + self.outputSumm = "" + os.makedirs(os.path.join(self.tempDoxyDir, self.apiPath), exist_ok=True) + + def save(self, path: str, output: str): + pathRel = os.path.join(self.apiPath, path) + self.fullDocFiles.append(files.File(pathRel, self.tempDoxyDir, self.siteDir, self.useDirectoryUrls)) + with open(os.path.join(self.tempDoxyDir, pathRel), 'w', encoding='utf-8') as file: + file.write(output) + + def fullDoc(self): + self.annotated(self.doxygen.root.children) + self.fileindex(self.doxygen.files.children) + self.members(self.doxygen.root.children) + self.members(self.doxygen.groups.children) + self.files(self.doxygen.files.children) + self.namespaces(self.doxygen.root.children) + self.classes(self.doxygen.root.children) + self.hierarchy(self.doxygen.root.children) + self.modules(self.doxygen.groups.children) + self.pages(self.doxygen.pages.children) + self.relatedpages(self.doxygen.pages.children) + self.index(self.doxygen.root.children, [Kind.FUNCTION, Kind.VARIABLE, Kind.TYPEDEF, Kind.ENUM], + [Kind.CLASS, Kind.STRUCT, Kind.INTERFACE], 'Class Members') + self.index(self.doxygen.root.children, [Kind.FUNCTION], [Kind.CLASS, Kind.STRUCT, Kind.INTERFACE], + 'Class Member Functions') + self.index(self.doxygen.root.children, [Kind.VARIABLE], [Kind.CLASS, Kind.STRUCT, Kind.INTERFACE], + 'Class Member Variables') + self.index(self.doxygen.root.children, [Kind.TYPEDEF], [Kind.CLASS, Kind.STRUCT, Kind.INTERFACE], + 'Class Member Typedefs') + self.index(self.doxygen.root.children, [Kind.ENUM], [Kind.CLASS, Kind.STRUCT, Kind.INTERFACE], + 'Class Member Enums') + self.index(self.doxygen.root.children, [Kind.FUNCTION, Kind.VARIABLE, Kind.TYPEDEF, Kind.ENUM], + [Kind.NAMESPACE], 'Namespace Members') + self.index(self.doxygen.root.children, [Kind.FUNCTION], [Kind.NAMESPACE], 'Namespace Member Functions') + self.index(self.doxygen.root.children, [Kind.VARIABLE], [Kind.NAMESPACE], 'Namespace Member Variables') + self.index(self.doxygen.root.children, [Kind.TYPEDEF], [Kind.NAMESPACE], 'Namespace Member Typedefs') + self.index(self.doxygen.root.children, [Kind.ENUM], [Kind.NAMESPACE], 'Namespace Member Enums') + self.index(self.doxygen.files.children, [Kind.FUNCTION], [Kind.FILE], 'Functions') + self.index(self.doxygen.files.children, [Kind.DEFINE], [Kind.FILE], 'Macros') + self.index(self.doxygen.files.children, [Kind.VARIABLE, Kind.UNION, Kind.TYPEDEF, Kind.ENUM], [Kind.FILE], + 'Variables') + + def annotated(self, nodes: [Node]): + path = 'annotated.md' + output = self.generatorBase.annotated(nodes) + self.save(path, output) + + def programlisting(self, node: [Node]): + path = node.refid + '_source.md' + + output = self.generatorBase.programlisting(node) + self.save(path, output) + + def fileindex(self, nodes: [Node]): + path = 'files.md' + + output = self.generatorBase.fileindex(nodes) + self.save(path, output) + + def namespaces(self, nodes: [Node]): + path = 'namespaces.md' + + output = self.generatorBase.namespaces(nodes) + self.save(path, output) + + def page(self, node: Node): + path = node.name + '.md' + + output = self.generatorBase.page(node) + self.save(path, output) + + def pages(self, nodes: [Node]): + for node in nodes: + self.page(node) + + def relatedpages(self, nodes: [Node]): + path = 'pages.md' + + output = self.generatorBase.annotated(nodes) + self.save(path, output) + + def classes(self, nodes: [Node]): + path = 'classes.md' + + output = self.generatorBase.classes(nodes) + self.save(path, output) + + def modules(self, nodes: [Node]): + path = 'modules.md' + + output = self.generatorBase.modules(nodes) + self.save(path, output) + + def hierarchy(self, nodes: [Node]): + path = 'hierarchy.md' + + output = self.generatorBase.hierarchy(nodes) + self.save(path, output) + + def member(self, node: Node): + path = node.filename + + output = self.generatorBase.member(node) + self.save(path, output) + + if node.is_language or node.is_group or node.is_file or node.is_dir: + self.members(node.children) + + def file(self, node: Node): + path = node.filename + + output = self.generatorBase.file(node) + self.save(path, output) + + if node.is_file and node.has_programlisting: + self.programlisting(node) + + if node.is_file or node.is_dir: + self.files(node.children) + + def members(self, nodes: [Node]): + for node in nodes: + if node.is_parent or node.is_group or node.is_file or node.is_dir: + self.member(node) + + def files(self, nodes: [Node]): + for node in nodes: + if node.is_file or node.is_dir: + self.file(node) + + def index(self, nodes: [Node], kind_filters: Kind, kind_parents: [Kind], title: str): + path = title.lower().replace(' ', '_') + '.md' + + output = self.generatorBase.index(nodes, kind_filters, kind_parents, title) + self.save(path, output) + + def _generate_recursive(self, node: Node, level: int): + if node.kind.is_parent(): + self.outputSumm += str(' ' * level + generate_link(node.kind.value + ' ' + node.name, node.refid + '.md')) + for child in node.children: + self._generate_recursive(child, level + 2) + + def _generate_recursive_files(self, node: Node, level: int): + if node.kind.is_file() or node.kind.is_dir(): + self.outputSumm += str(' ' * level + generate_link(node.name, node.refid + '.md')) + if node.kind.is_file(): + self.outputSumm += str(' ' * level + generate_link(node.name + ' source', node.refid + '_source.md')) + for child in node.children: + self._generate_recursive_files(child, level + 2) + + def _generate_recursive_groups(self, node: Node, level: int): + if node.kind.is_group(): + self.outputSumm += str(' ' * level + generate_link(node.title, node.refid + '.md')) + for child in node.children: + self._generate_recursive_groups(child, level + 2) + + def _generate_recursive_pages(self, node: Node, level: int): + if node.kind.is_page(): + self.outputSumm += str(' ' * level + generate_link(node.title, node.refid + '.md')) + for child in node.children: + self._generate_recursive_pages(child, level + 2) + + def summary(self): + offset = 0 + self.outputSumm += str(' ' * (offset + 2) + generate_link('Related Pages', 'pages.md')) + for node in self.doxygen.pages.children: + self._generate_recursive_pages(node, offset + 4) + + self.outputSumm += str(' ' * (offset + 2) + generate_link('Modules', 'modules.md')) + for node in self.doxygen.groups.children: + self._generate_recursive_groups(node, offset + 4) + + self.outputSumm += str(' ' * (offset + 2) + generate_link('Class List', 'annotated.md')) + for node in self.doxygen.root.children: + self._generate_recursive(node, offset + 4) + + for key, val in ADDITIONAL_FILES.items(): + self.outputSumm += str(' ' * (offset + 2) + generate_link(key, val)) + + self.outputSumm += str(' ' * (offset + 2) + generate_link('Files', 'files.md')) + for node in self.doxygen.files.children: + self._generate_recursive_files(node, offset + 4) + + self.outputSumm += str(' ' * (offset + 2) + generate_link('File Variables', 'variables.md')) + self.outputSumm += str(' ' * (offset + 2) + generate_link('File Functions', 'functions.md')) + self.outputSumm += str(' ' * (offset + 2) + generate_link('File Macros', 'macros.md')) + + self.save("links.md", self.outputSumm) \ No newline at end of file diff --git a/src/mkdoxy/mkdoxy/generatorBase.py b/src/mkdoxy/mkdoxy/generatorBase.py new file mode 100644 index 000000000..ab4a5f107 --- /dev/null +++ b/src/mkdoxy/mkdoxy/generatorBase.py @@ -0,0 +1,299 @@ +import os +import re +import string +import traceback +from dataclasses import dataclass, field +from typing import Tuple +from typing import TextIO +from jinja2.exceptions import TemplateSyntaxError, TemplateError +from jinja2 import StrictUndefined, Undefined +from jinja2 import Environment, FileSystemLoader, Template, select_autoescape +import mkdoxy +from mkdoxy.node import Node, DummyNode +from mkdoxy.doxygen import Doxygen +from mkdoxy.constants import Kind +from mkdoxy.utils import parseTemplateFile, merge_two_dicts, recursive_find_with_parent, recursive_find +from mkdocs import exceptions +from markdown import extensions, preprocessors +import logging + +log = logging.getLogger("mkdocs") + + +LETTERS = string.ascii_lowercase + '~_@\\' + +class GeneratorBase: + def __init__(self, ignore_errors: bool = False, debug: bool = False): + self.debug = debug + + on_undefined_class = Undefined + if not ignore_errors: + on_undefined_class = StrictUndefined + + self.templates: Dict[str, Template] = {} + self.metaData: Dict[str, list[str]] = {} + + # code from https://github.com/daizutabi/mkapi/blob/master/mkapi/core/renderer.py#L29-L38 + path = os.path.join(os.path.dirname(mkdoxy.__file__), "templates") + for fileName in os.listdir(path): + filePath = os.path.join(path, fileName) + if fileName.endswith(".jinja2"): + with open(filePath, "r") as file: + name = os.path.splitext(fileName)[0] + fileTemplate, metaData = parseTemplateFile(file.read()) + self.templates[name] = Template(fileTemplate) + self.metaData[name] = metaData + else: + log.error(f"Trying to load unsupported file '{filePath}'. Supported file ends with '.jinja2'.") + + def loadConfigAndTemplate(self, name: str) -> [Template, dict]: + template = self.templates.get(name) + if not template: + raise exceptions.Abort(f"Trying to load unexisting template '{name}'. Please create a new template file with name '{name}.jinja2'") + metaData = self.metaData.get(name, {}) + return template, metaData + + def render(self, tmpl: Template, data: dict) -> str: + try: + if self.debug: + print('Generating', path) + return tmpl.render(data) + except TemplateError as e: + raise Exception(str(e)) + + def error(self, title: str = "", message: str = "", language: str = ""): + template, metaConfig = self.loadConfigAndTemplate("error") + + data = { + 'title': title, + 'message': message, + 'language': language, + + } + return self.render(template, data) + + def annotated(self, nodes: [Node], config: dict = {}): + template, metaConfig = self.loadConfigAndTemplate("annotated") + data = { + 'nodes': nodes, + 'config': merge_two_dicts(config, metaConfig), + } + return self.render(template, data) + + def programlisting(self, node: [Node], config: dict = {}): + template, metaConfig = self.loadConfigAndTemplate("programlisting") + data = { + 'node': node, + 'config': merge_two_dicts(config, metaConfig), + } + return self.render(template, data) + + def code(self, node: [Node], config: dict = {}, code: str = ""): + template, metaConfig = self.loadConfigAndTemplate("code") + newConfig = config + # newConfig = merge_two_dicts(CODE_CONFIG, config) + + data = { + 'node': node, + 'config': merge_two_dicts(config, metaConfig), + 'code': code + } + + return self.render(template, data) + + def fileindex(self, nodes: [Node], config: dict = {}): + template, metaConfig = self.loadConfigAndTemplate("files") + data = { + 'nodes': nodes, + 'config': merge_two_dicts(config, metaConfig), + } + return self.render(template, data) + + def namespaces(self, nodes: [Node], config: dict = {}): + template, metaConfig = self.loadConfigAndTemplate("namespaces") + data = { + 'nodes': nodes, + 'config': merge_two_dicts(config, metaConfig), + } + return self.render(template, data) + + def page(self, node: Node, config: dict = {}): + template, metaConfig = self.loadConfigAndTemplate("page") + data = { + 'node': node, + 'config': merge_two_dicts(config, metaConfig), + } + return self.render(template, data) + + def relatedpages(self, nodes: [Node], config: dict = {}): + template, metaConfig = self.loadConfigAndTemplate("page") + data = { + 'nodes': nodes, + 'config': merge_two_dicts(config, metaConfig), + } + return self.render(template, data) + + def classes(self, nodes: [Node], config: dict = {}): + template, metaConfig = self.loadConfigAndTemplate("classes") + + classes = recursive_find(nodes, Kind.CLASS) + classes.extend(recursive_find(nodes, Kind.STRUCT)) + classes.extend(recursive_find(nodes, Kind.INTERFACE)) + dictionary = {letter: [] for letter in LETTERS} + + for klass in classes: + asd = klass.name_short[0].lower() + dictionary[asd].append(klass) + + for letter in list(dictionary): + if len(dictionary[letter]) == 0: + del dictionary[letter] + + data = { + 'dictionary': dictionary, + 'config': merge_two_dicts(config, metaConfig), + } + return self.render(template, data) + + def _find_base_classes(self, nodes: [Node], derived: Node): + ret = [] + for node in nodes: + if isinstance(node, str): + ret.append({ + 'refid': node, + 'derived': derived + }) + elif node.kind.is_parent() and not node.kind.is_namespace(): + bases = node.base_classes + if len(bases) == 0: + ret.append(node) + else: + ret.extend(self._find_base_classes(bases, node)) + return ret + + def modules(self, nodes: [Node], config: dict = {}): + template, metaConfig = self.loadConfigAndTemplate("modules") + data = { + 'nodes': nodes, + 'config': merge_two_dicts(config, metaConfig), + } + return self.render(template, data) + + def hierarchy(self, nodes: [Node], config: dict = {}): + template, metaConfig = self.loadConfigAndTemplate("hierarchy") + + classes = recursive_find(nodes, Kind.CLASS) + classes.extend(recursive_find(nodes, Kind.STRUCT)) + classes.extend(recursive_find(nodes, Kind.INTERFACE)) + + bases = self._find_base_classes(classes, None) + deduplicated = { + base.refid: base + for base in bases if not isinstance(base, dict) + } + + for base in bases: + if isinstance(base, dict): + if base['refid'] not in deduplicated: + deduplicated[base['refid']] = [] + deduplicated[base['refid']].append(base) + + deduplicated_arr = [] + for key, children in deduplicated.items(): + if isinstance(children, list): + deduplicated_arr.append(DummyNode( + key, + list(map(lambda x: x['derived'], children)), + Kind.CLASS + )) + else: + found: Node = None + for klass in classes: + if klass.refid == key: + found = klass + break + if found: + deduplicated_arr.append(found) + + data = { + 'classes': deduplicated_arr, + 'config': merge_two_dicts(config, metaConfig), + } + return self.render(template, data) + + def function(self, node: Node, config: dict = {}): + templateMemDef, metaConfigMemDef = self.loadConfigAndTemplate("memDef") + + data = { + 'node': node, + 'configMemDef': merge_two_dicts(config, metaConfigMemDef) + } + return self.render(templateMemDef, data) + + def member(self, node: Node, config: dict = {}): + template, metaConfig = self.loadConfigAndTemplate("member") + templateMemDef, metaConfigMemDef = self.loadConfigAndTemplate("memDef") + templateMemTab, metaConfigMemTab = self.loadConfigAndTemplate("memTab") + + data = { + 'node': node, + 'templateMemDef': templateMemDef, + 'configMemDef': metaConfigMemDef, + 'templateMemTab': templateMemTab, + 'configMemTab': metaConfigMemTab, + 'config': merge_two_dicts(config, metaConfig) + } + return self.render(template, data) + + def file(self, node: Node, config: dict = {}): + template, metaConfig = self.loadConfigAndTemplate("member") + templateMemDef, metaConfigMemDef = self.loadConfigAndTemplate("memDef") + templateMemTab, metaConfigMemTab = self.loadConfigAndTemplate("memTab") + + data = { + 'node': node, + 'templateMemDef': templateMemDef, + 'configMemDef': metaConfigMemDef, + 'templateMemTab': templateMemTab, + 'configMemTab': metaConfigMemTab, + 'config': merge_two_dicts(config, metaConfig) + } + return self.render(template, data) + + def index(self, nodes: [Node], kind_filters: Kind, kind_parents: [Kind], title: str, config: dict = {}): + template, metaConfig = self.loadConfigAndTemplate("index") + + found_nodes = recursive_find_with_parent(nodes, kind_filters, kind_parents) + dictionary = {letter: [] for letter in LETTERS} + + # Sort items into the dictionary + for found in found_nodes: + dictionary[found.name_tokens[-1][0].lower()].append(found) + + # Delete unused letters + for letter in list(dictionary): + if len(dictionary[letter]) == 0: + del dictionary[letter] + + # Sort items if they have the same name + sorted_dictionary = {} + for letter, items in dictionary.items(): + d = {} + for item in items: + # The name of the item is not yet in the dictionary + if item.name_short not in d: + d[item.name_short] = [item.parent] + + else: + found = any(test.refid == item.parent.refid for test in d[item.name_short]) + if not found: + d[item.name_short].append(item.parent) + + sorted_dictionary[letter] = d + + data = { + 'title': title, + 'dictionary': sorted_dictionary, + 'config': merge_two_dicts(config, metaConfig), + } + return self.render(template, data) diff --git a/src/mkdoxy/mkdoxy/generatorSnippets.py b/src/mkdoxy/mkdoxy/generatorSnippets.py new file mode 100644 index 000000000..91baf6bc1 --- /dev/null +++ b/src/mkdoxy/mkdoxy/generatorSnippets.py @@ -0,0 +1,247 @@ +import os +import sys +from typing import * +from jinja2 import Template +from mkdocs.config import base +from mkdocs.structure import files, pages +from mkdoxy.doxygen import Doxygen +from mkdoxy.finder import Finder +import re +from ruamel.yaml import YAML, YAMLError +from pprint import * +import pathlib +import string +import traceback +from typing import TextIO +from jinja2 import Template +from jinja2.exceptions import TemplateSyntaxError, TemplateError +from jinja2 import StrictUndefined, Undefined +from mkdoxy.node import Node, DummyNode +from mkdoxy.doxygen import Doxygen +from mkdoxy.constants import Kind +from mkdoxy.generatorBase import GeneratorBase +import logging + +log = logging.getLogger("mkdocs") + +regexLong= r"(?s)(?[a-zA-Z]+)\.(?P[a-zA-Z.-_]+))\s*\n(?P.*?)(?:(?:(?:\r*\n)(?=\n))|(?=:::)|`|\Z)" #https://regex101.com/r/lIgOij/2 +regexShort = r"(?s)(?[a-zA-Z]+)\.(?P[a-zA-Z.-_]+))\s*\n(?:(?=\n)|(?=:::)|\Z)" # https://regex101.com/r/QnqxRc/1 + +class GeneratorSnippets: + def __init__(self, + markdown, + generatorBase, #: GeneratorBase, + doxygen, # Dict[Doxygen], + useDirectoryUrls: bool, + page: pages.Page, + debug: bool = False): + + self.markdown = markdown + self.generatorBase = generatorBase + self.doxygen = doxygen + self.useDirectoryUrls = useDirectoryUrls + self.page = page + self.debug = debug + self.finder = Finder(doxygen, debug) + + self.DOXY_CALL = { + "code": self.doxyCode, + "function": self.doxyFunction, + "class": self.doxyClass, + "class.method": self.doxyClassMethod, + "class.list":self.doxyClassList, + "class.index":self.doxyClassIndex, + "class.hierarchy":self.doxyClassHierarchy, + "namespace.list":self.doxyNamespaceList, + "file.list":self.doxyFileList, + } + + # fix absolute path + path = pathlib.PurePath(self.page.url).parts + self.pageUrlPrefix = ''.join("../" for i in range(len(path)-1)) + + def generate(self): + + matches = re.finditer(regexShort, self.markdown, re.MULTILINE) + for match in reversed(list(matches)): + snippet = match.group() + key = match.group('key') + project = match.group('project') + + keyLow = key.lower() + log.debug(f"\nKey: {keyLow}") + + replaceStr = self.callDoxyByName(snippet, project, keyLow, {}) + self.replaceMarkdown(match.start(), match.end(), replaceStr) + + matches = re.finditer(regexLong, self.markdown, re.MULTILINE) + for match in reversed(list(matches)): + if match: + snippet = match.group() + key = match.group('key') + project = match.group('project') + keyLow = key.lower() + log.debug(f"\nKey: {keyLow}") + yamlRaw = match.group('yaml') + if yamlRaw: + try: + yaml = YAML() + config = yaml.load(yamlRaw) + # yaml.dump(config, sys.stdout) + log.debug(pformat(config)) + except YAMLError as e: + print(e) + + replaceStr = self.callDoxyByName(snippet, project, keyLow, config) + self.replaceMarkdown(match.start(), match.end(), replaceStr) + + + return self.markdown + + def replaceMarkdown(self, start: int, end: int, newString: string): + self.markdown = self.markdown[:start] + newString + "\n" + self.markdown[end:] + + def _recurs_setLinkPrefixNode(self, node: Node, linkPrefix: str): + node.setLinkPrefix(linkPrefix) + if node.kind.is_parent(): + self._recurs_setLinkPrefixNodes(node.children, linkPrefix) + + def _recurs_setLinkPrefixNodes(self, nodes: [Node], linkPrefix: str): + for node in nodes: + self._recurs_setLinkPrefixNode(node, linkPrefix) + + def callDoxyByName(self, snippet, project: str, key: str, config): + if key not in self.DOXY_CALL: + return self.generatorBase[project].error(f"Did not exist key with name: {key}", snippet, "yaml") + + funcName = self.DOXY_CALL[key] + return funcName(snippet, project, config) + + def checkConfig(self, snippet, project: str, config, params): + """ + returns false if config is correct + return error message if project not exist or find problem in config + """ + # Project is exist + if project not in self.generatorBase: + return self.generatorBase[list(self.generatorBase)[0]].error(f"Did not exist project with name: {project}", snippet, "yaml") + # Project has got parameters + for param in params: + if not config.get(param): + return self.doxyError(project, f"The requid parameter `{param}` is not configured!", snippet, "yaml") + return False + + ### Create documentation generator callbacks + + def doxyError(self, project, title: str = "", message: str = "", language: str = ""): + log.error(f" -> {title} -> page: {self.page.canonical_url}") + return self.generatorBase[project].error(title, message, language) + + def doxyCode(self, snippet, project: str, config): + errorMsg = self.checkConfig(snippet, project, config, ["file"]) + if errorMsg: + return errorMsg + node = self.finder.doxyCode(project, config.get("file")) + if isinstance(node, Node): + + progCode = self.codeStrip(node.programlisting, node.code_language, config.get("start", 1), config.get("end", 0)) + if progCode == False: + return self.doxyError(project, f"Parameter start: {config.get('start')} is greater than end: {config.get('end')}",f"{snippet}", "yaml") + self._recurs_setLinkPrefixNode(node, self.pageUrlPrefix + project + "/") + return self.generatorBase[project].code(node, config, progCode) + return self.doxyError(project, f"Did not find File: `{config.get('file')}`", f"{snippet}\nAvailable:\n{pformat(node)}", "yaml") + + def codeStrip(self, codeRaw, codeLanguage: str, start: int = 1, end: int = None): + lines = codeRaw.split("\n") + + if end and start > end: + return False + + out = "".join(line + "\n" for num, line in enumerate(lines) + if num >= start and (num <= end or end == 0)) + return f"```{codeLanguage} linenums='{start}'\n{out}```" + + + def doxyFunction(self, snippet, project: str, config): + errorMsg = self.checkConfig(snippet, project, config, ["name"]) + if errorMsg: + return errorMsg + + node = self.finder.doxyFunction(project, config.get("name")) + if isinstance(node, Node): + self._recurs_setLinkPrefixNode(node, self.pageUrlPrefix + project + "/") + return self.generatorBase[project].function(node, config) + return self.doxyError(project, f"Did not find Function with name: `{config.get('name')}`", f"{snippet}\nAvailable:\n{pformat(node)}", "yaml") + + def doxyClass(self, snippet, project: str, config): + errorMsg = self.checkConfig(snippet, project, config, ["name"]) + if errorMsg: + return errorMsg + + node = self.finder.doxyClass(project, config.get("name")) + if isinstance(node, Node): + self._recurs_setLinkPrefixNode(node, self.pageUrlPrefix + project + "/") + return self.generatorBase[project].member(node, config) + return self.doxyError(project, f"Did not find Class with name: `{config.get('name')}`", f"{snippet}\nAvailable:\n{pformat(node)}", "yaml") + + def doxyClassMethod(self, snippet, project: str, config): + errorMsg = self.checkConfig(snippet, project, config, ["name", "method"]) + if errorMsg: + return errorMsg + + node = self.finder.doxyClassMethod(project, config.get("name"), config.get("method")) + if isinstance(node, Node): + self._recurs_setLinkPrefixNode(node, self.pageUrlPrefix + project + "/") + return self.generatorBase[project].function(node, config) + return self.doxyError(project, f"Did not find Class with name: `{config.get('name')}` and method: `{config.get('method')}`", f"{snippet}\nAvailable:\n{pformat(node)}", "yaml") + + + def doxyClassList(self, snippet, project: str, config): + errorMsg = self.checkConfig(snippet, project, config, []) + if errorMsg: + return errorMsg + nodes = self.doxygen[project].root.children + self._recurs_setLinkPrefixNodes(nodes, self.pageUrlPrefix + project + "/") + return self.generatorBase[project].annotated(nodes) + + def doxyClassIndex(self, snippet, project: str, config): + errorMsg = self.checkConfig(snippet, project, config, []) + if errorMsg: + return errorMsg + nodes = self.doxygen[project].root.children + self._recurs_setLinkPrefixNodes(nodes, self.pageUrlPrefix + project + "/") + return self.generatorBase[project].classes(nodes) + + def doxyClassHierarchy(self, snippet, project: str, config): + errorMsg = self.checkConfig(snippet, project, config, []) + if errorMsg: + return errorMsg + nodes = self.doxygen[project].root.children + self._recurs_setLinkPrefixNodes(nodes, self.pageUrlPrefix + project + "/") + return self.generatorBase[project].hierarchy(nodes) + + def doxyNamespaceList(self, snippet, project: str, config): + errorMsg = self.checkConfig(snippet, project, config, []) + if errorMsg: + return errorMsg + nodes = self.doxygen[project].root.children + self._recurs_setLinkPrefixNodes(nodes, self.pageUrlPrefix + project + "/") + return self.generatorBase[project].namespaces(nodes) + + def doxyFileList(self, snippet, project: str, config): + errorMsg = self.checkConfig(snippet, project, config, []) + if errorMsg: + return errorMsg + nodes = self.doxygen[project].files.children + self._recurs_setLinkPrefixNodes(nodes, self.pageUrlPrefix + project + "/") + return self.generatorBase[project].fileindex(nodes) + +### Create documentation generator callbacks END + + +class SnippetClass: + def __init__(self, config): + self.config = config + + def default(self): + return "" \ No newline at end of file diff --git a/src/mkdoxy/mkdoxy/markdown.py b/src/mkdoxy/mkdoxy/markdown.py new file mode 100644 index 000000000..e8a98e872 --- /dev/null +++ b/src/mkdoxy/mkdoxy/markdown.py @@ -0,0 +1,225 @@ +from typing import List + +def escape(s: str) -> str: + ret = s.replace('*', '\\*') + ret = ret.replace('_', '\\_') + ret = ret.replace('<', '<') + ret = ret.replace('>', '>') + ret = ret.replace('|', '\|') + return ret + + + +class MdRenderer: + def __init__(self): + self.output = '' + self.eol_flag = True + + def write(self, s: str): + self.output += s + self.eol_flag = False + + def eol(self): + if not self.eol_flag: + self.output += '\n' + self.eol_flag = True + + +class Md: + def __init__(self, children: List['Md']): + self.children = children + + def append(self, child: 'Md'): + self.children.append(child) + + def extend(self, child: List['Md']): + self.children.extend(child) + + +class Text: + def __init__(self, text: str): + self.text = text + + def render(self, f: MdRenderer, indent: str): + if self.text: + f.write(escape(self.text)) + + +class Br: + def __init__(self): + pass + + def render(self, f: MdRenderer, indent: str): + f.write('\n\n') + + +class MdHint(Md): + def __init__(self, children: List[Md], typ: str, title: str): + Md.__init__(self, children) + self.title = title + self.typ = typ + + def render(self, f: MdRenderer, indent: str): + f.write('::: ' + self.typ + ' ' + self.title + '\n') + for child in self.children: + child.render(f, '') + f.write(':::\n') + + +class MdBold(Md): + def __init__(self, children: List[Md]): + Md.__init__(self, children) + + def render(self, f: MdRenderer, indent: str): + f.write('**') + for child in self.children: + child.render(f, '') + f.write('**') + + +class MdImage: + def __init__(self, url: str): + self.url = url + + def render(self, f: MdRenderer, indent: str): + f.write('![Image](' + self.url + ')') + + +class Code(): + def __init__(self, text: str): + self.text = text + + def render(self, f: MdRenderer, indent: str): + f.write('`' + self.text + '`') + + +class MdCodeBlock: + def __init__(self, lines: List[str]): + self.lines = lines + + def append(self, line: str): + self.lines.append(line) + + def render(self, f: MdRenderer, indent: str): + for line in self.lines: + f.write(line) + f.write('\n') + + +class MdBlockQuote(Md): + def __init__(self, children: List[Md]): + Md.__init__(self, children) + + def render(self, f: MdRenderer, indent: str): + f.write('\n') + for child in self.children: + f.write('> ') + child.render(f, '') + f.write('\n') + + +class MdItalic(Md): + def __init__(self, children: List[Md]): + Md.__init__(self, children) + + def render(self, f: MdRenderer, indent: str): + f.write('_') + for child in self.children: + child.render(f, '') + f.write('_') + + +class MdParagraph(Md): + def __init__(self, children: List[Md]): + Md.__init__(self, children) + + def render(self, f: MdRenderer, indent: str): + for child in self.children: + child.render(f, indent) + f.eol() + + +class MdLink(Md): + def __init__(self, children: List[Md], url: str): + Md.__init__(self, children) + self.url = url + + def render(self, f: MdRenderer, indent: str): + f.write('[') + for child in self.children: + child.render(f, '') + f.write('](' + self.url + ')') # TODO add {{link_prefix}} + + +class MdList(Md): + def __init__(self, children: List[Md]): + Md.__init__(self, children) + + def render(self, f: MdRenderer, indent: str): + f.eol() + for child in self.children: + if not isinstance(child, MdList): + f.write(indent + '* ') + child.render(f, indent + ' ') + + +class MdLine: + def __init__(self): + pass + + def render(self, f: MdRenderer, indent: str): + f.eol() + f.write('----------------------------------------') + f.eol() + + +class MdHeader(Md): + def __init__(self, level: int, children: List[Md]): + Md.__init__(self, children) + self.level = level + + def render(self, f: MdRenderer, indent: str): + f.write('#' * self.level + ' ') + for child in self.children: + child.render(f, indent + '') + f.write('\n') + f.eol() + + +class MdTableCell(Md): + def __init__(self, children: List[Md]): + Md.__init__(self, children) + + def render(self, f: MdRenderer, indent: str): + for child in self.children: + child.render(f, indent) + + +class MdTableRow(Md): + def __init__(self, children: List[Md]): + Md.__init__(self, children) + + def render(self, f: MdRenderer, indent: str): + f.eol() + f.write('|') + for child in self.children: + child.render(f, '') + f.write('|') + f.eol() + + +class MdTable(Md): + def __init__(self): + Md.__init__(self, []) + + def render(self, f: MdRenderer, indent: str): + is_first = True + f.eol() + for child in self.children: + child.render(f, '') + if is_first: + for _ in range(len(child.children)): + f.write('|-----') + f.write('|') + is_first = False + f.write('\n\n') diff --git a/src/mkdoxy/mkdoxy/node.py b/src/mkdoxy/mkdoxy/node.py new file mode 100644 index 000000000..d68251aca --- /dev/null +++ b/src/mkdoxy/mkdoxy/node.py @@ -0,0 +1,780 @@ +import os +import re +import traceback +from xml.etree import ElementTree +from xml.etree.ElementTree import Element as Element +from mkdoxy.constants import Kind, Visibility, OVERLOAD_OPERATORS +from mkdoxy.cache import Cache +from mkdoxy.xml_parser import XmlParser +from mkdoxy.markdown import escape +from mkdoxy.utils import split_safe +from mkdoxy.property import Property +import logging + +log = logging.getLogger("mkdocs") + + +class Node: + def __init__(self, xml_file: str, xml: Element, cache: Cache, parser: XmlParser, parent: 'Node', refid: str = None, debug: bool = False): + self._children: ['Node'] = [] + self._cache: Cache = cache + self._parser: XmlParser = parser + self._parent = parent + self.debug = debug + self.linkPrefix = "" + + if xml_file == 'root': + self._refid = 'root' + self._kind = Kind.from_str('root') + self._name = 'root' + self._xml = None + + elif xml is None: + if self.debug: + log.info('Loading XML from: ' + xml_file) + self._dirname = os.path.dirname(xml_file) + self._xml = ElementTree.parse(xml_file).getroot().find('compounddef') + if self._xml is None: + raise Exception('File ' + xml_file + ' has no ') + self._kind = Kind.from_str(self._xml.get('kind')) + self._refid = self._xml.get('id') + self._language = self._xml.get('language') + self._name = self._xml.find('compoundname').text + self._cache.add(self._refid, self) + self._static = False + + if self.debug: + log.info('Parsing: ' + self._refid) + self._check_for_children() + + title = self._xml.find('title') + self._title = title.text if title is not None else self._name + else: + self._xml = xml + self._kind = Kind.from_str(self._xml.get('kind')) + self._language = parent.code_language + self._refid = refid if refid is not None else self._xml.get('id') + self._cache.add(self._refid, self) + + if self.debug: + log.info('Parsing: ' + self._refid) + self._check_attrs() + self._title = self._name + + self._details = Property.Details(self._xml, parser, self._kind) + self._brief = Property.Brief(self._xml, parser, self._kind) + self._includes = Property.Includes(self._xml, parser, self._kind) + self._type = Property.Type(self._xml, parser, self._kind) + self._location = Property.Location(self._xml, parser, self._kind) + self._params = Property.Params(self._xml, parser, self._kind) + self._templateparams = Property.TemplateParams(self._xml, parser, self._kind) + self._specifiers = Property.Specifiers(self._xml, parser, self._kind) + self._values = Property.Values(self._xml, parser, self._kind) + self._initializer = Property.Initializer(self._xml, parser, self._kind) + self._definition = Property.Definition(self._xml, parser, self._kind) + self._programlisting = Property.Programlisting(self._xml, parser, self._kind) + + def setLinkPrefix(self, linkPrefix: str): + self.linkPrefix = linkPrefix + + def add_child(self, child: 'Node'): + self._children.append(child) + + def sort_children(self): + self._children.sort(key=lambda x: x._name, reverse=False) + + def _check_for_children(self): + for innergroup in self._xml.findall('innergroup'): + refid = innergroup.get('refid') + if self._kind in [Kind.GROUP, Kind.DIR, Kind.FILE]: + try: + child = self._cache.get(refid) + self.add_child(child) + continue + except: + pass + child = Node(os.path.join(self._dirname, refid + '.xml'), None, self._cache, self._parser, self) + child._visibility = Visibility.PUBLIC + self.add_child(child) + + for innerclass in self._xml.findall('innerclass'): + refid = innerclass.get('refid') + prot = Visibility(innerclass.get('prot')) + if prot == Visibility.PRIVATE: + continue + + if self._kind in [Kind.GROUP, Kind.DIR, Kind.FILE]: + try: + child = self._cache.get(refid) + self.add_child(child) + continue + except: + pass + + try: + child = Node(os.path.join(self._dirname, refid + '.xml'), None, self._cache, self._parser, self) + except FileNotFoundError as e: + child = Node(os.path.join(self._dirname, refid + '.xml'), Element('compounddef'), self._cache, + self._parser, self, refid=refid) + child._name = innerclass.text + child._visibility = prot + self.add_child(child) + + for innerfile in self._xml.findall('innerfile'): + refid = innerfile.get('refid') + if self._kind == Kind.DIR: + try: + child = self._cache.get(refid) + self.add_child(child) + continue + except: + pass + + child = Node(os.path.join(self._dirname, refid + '.xml'), None, self._cache, self._parser, self) + child._visibility = Visibility.PUBLIC + self.add_child(child) + + for innerdir in self._xml.findall('innerdir'): + refid = innerdir.get('refid') + if self._kind == Kind.DIR: + try: + child = self._cache.get(refid) + self.add_child(child) + continue + except: + pass + + child = Node(os.path.join(self._dirname, refid + '.xml'), None, self._cache, self._parser, self) + child._visibility = Visibility.PUBLIC + self.add_child(child) + + for innernamespace in self._xml.findall('innernamespace'): + refid = innernamespace.get('refid') + + if self._kind in [Kind.GROUP, Kind.DIR, Kind.FILE]: + try: + child = self._cache.get(refid) + self.add_child(child) + continue + except: + pass + + child = Node(os.path.join(self._dirname, refid + '.xml'), None, self._cache, self._parser, self) + child._visibility = Visibility.PUBLIC + self.add_child(child) + + for sectiondef in self._xml.findall('sectiondef'): + for memberdef in sectiondef.findall('memberdef'): + kind = Kind.from_str(memberdef.get('kind')) + if kind.is_language(): + if self._kind in [Kind.GROUP, Kind.DIR, Kind.FILE]: + refid = memberdef.get('id') + try: + child = self._cache.get(refid) + self.add_child(child) + continue + except: + pass + child = Node(None, memberdef, self._cache, self._parser, self) + self.add_child(child) + + def _check_attrs(self): + prot = self._xml.get('prot') + self._visibility = Visibility(prot) if prot is not None else Visibility.PUBLIC + + static = self._xml.get('static') + self._static = static == 'yes' + + explicit = self._xml.get('explicit') + self._explicit = explicit == 'yes' + + mutable = self._xml.get('mutable') + self._mutable = mutable == 'yes' + + inline = self._xml.get('inline') + self._inline = inline == 'yes' + + const = self._xml.get('inline') + self._const = const == 'yes' + + name = self._xml.find('name') + self._name = name.text if name is not None else '' + virt = self._xml.get('virt') + if virt: + self._virtual = virt in ['virtual', 'pure-virtual'] + self._pure = virt == 'pure-virtual' + else: + self._virtual = False + self._pure = False + + def has(self, visibility: str, kinds: [str], static: bool) -> bool: + return len(self.query(visibility, kinds, static)) > 0 + + def query(self, visibility: str, kinds: [str], static: bool) -> ['Node']: + visibility = Visibility(visibility) + kinds = list(map(lambda kind: Kind.from_str(kind), kinds)) + return [ + child for child in self._children if child._visibility == visibility + and child._kind in kinds and child._static == static + ] + + @property + def is_static(self) -> bool: + return self._static + + @property + def is_explicit(self) -> bool: + return self._explicit + + @property + def is_const(self) -> bool: + return self._const + + @property + def is_inline(self) -> bool: + return self._inline + + @property + def is_mutable(self) -> bool: + return self._mutable + + @property + def is_virtual(self) -> bool: + return self._virtual + + @property + def is_pure(self) -> bool: + return self._pure + + @property + def has_children(self) -> bool: + return len(self._children) > 0 + + @property + def children(self) -> ['Node']: + return self._children + + @property + def parent(self) -> 'Node': + return self._parent + + @property + def is_function(self) -> bool: + return self._kind.is_function() + + @property + def is_variable(self) -> bool: + return self._kind.is_variable() + + @property + def is_namespace(self) -> bool: + return self._kind.is_namespace() + + @property + def is_class(self) -> bool: + return self._kind.is_class() + + @property + def is_struct(self) -> bool: + return self._kind.is_struct() + + @property + def is_enum(self) -> bool: + return self._kind.is_enum() + + @property + def is_class_or_struct(self) -> bool: + return self._kind.is_class_or_struct() + + @property + def is_interface(self) -> bool: + return self._kind.is_interface() + + @property + def is_typedef(self) -> bool: + return self._kind.is_typedef() + + @property + def is_define(self) -> bool: + return self._kind.is_define() + + @property + def is_union(self) -> bool: + return self._kind.is_union() + + @property + def is_group(self) -> bool: + return self._kind.is_group() + + @property + def is_language(self) -> bool: + return self._kind.is_language() + + @property + def is_root(self) -> bool: + return self._kind.is_root() + + @property + def is_parent(self) -> bool: + return self._kind.is_parent() + + @property + def is_friend(self) -> bool: + return self._kind.is_friend() + + @property + def is_file(self) -> bool: + return self._kind.is_file() + + @property + def is_dir(self) -> bool: + return self._kind.is_dir() + + @property + def is_page(self) -> bool: + return self._kind.is_page() + + @property + def name(self) -> str: + return self._name + + @property + def name_params(self) -> str: + name = self._name + type = self._type.plain() + params = self._specifiers.plain() + if params: + return type + " " + name + params + return self.name_long + + @property + def title(self) -> str: + return self._title + + @property + def refid(self) -> str: + return self._refid + + @property + def kind(self) -> str: + return self._kind + + @property + def is_operator(self) -> bool: + return self._name in OVERLOAD_OPERATORS + + @property + def operators_total(self) -> int: + return sum(child.name in OVERLOAD_OPERATORS for child in self.children) + + @property + def operator_num(self) -> int: + total = 0 + for child in self.parent.children: + if child.is_function and child.name.replace(' ', '') in OVERLOAD_OPERATORS: + total += 1 + if child.refid == self._refid: + break + return total + + @property + def name_url_safe(self) -> str: + name = self.name_tokens[-1] + name = name.replace(' ', '-').replace('=', '').replace('~', '').lower() + return name + + @property + def anchor(self) -> str: + name = '' + if self._name.replace(' ', '') in OVERLOAD_OPERATORS: + num = self.operator_num + name = 'operator_' + str(self.operator_num - 1) if num > 1 else 'operator' + elif self.is_overloaded: + name = self.name_url_safe + '-' + str(self.overload_num) + str(self.overload_total) + else: + name = self.name_url_safe + + if name.startswith('-'): + name = name[1:] + return self._kind.value + '-' + name + + @property + def url(self) -> str: + if self.is_parent or self.is_group or self.is_file or self.is_dir or self.is_page: + return self.linkPrefix + self._refid + '.md' + else: + return self._parent.url + '#' + self.anchor + + @property + def base_url(self) -> str: + def prefix(page: str): + return self.linkPrefix + page + + if self.is_group: + return prefix("modules.md") + elif self.is_file or self.is_dir: + return prefix("files.md") + elif self.is_namespace: + return prefix("namespaces.md") + else: + return prefix("annotated.md") + + @property + def base_name(self) -> str: + if self.is_group: + return "Modules" + elif self.is_file or self.is_dir: + return "FileList" + elif self.is_namespace: + return "Namespace List" + else: + return "ClassList" + + @property + def url_source(self) -> str: + if self.is_parent or self.is_group or self.is_file or self.is_dir: + return self.linkPrefix + self._refid + '_source.md' + else: + return self.linkPrefix + self._refid + '.md' + + @property + def filename(self) -> str: + return self.linkPrefix + self._refid + '.md' + + @property + def root(self) -> 'Node': + if self._kind == Kind.ROOT: + return self + else: + return self._parent.root + + @property + def name_tokens(self) -> [str]: + if self.is_dir or self.is_file: + return self._name.split('/') + return split_safe(self._name, '::') + + @property + def name_short(self) -> str: + return escape(self.name_tokens[-1]) + + @property + def name_long(self) -> str: + try: + if self._parent.is_parent: + return self._parent.name_long + '::' + escape(self.name_tokens[-1]) + else: + return escape(self._name) + except Exception as e: + print(e) + raise e + + @property + def name_full_unescaped(self) -> str: + if self._parent is not None and not self._parent.is_root and self._parent.is_parent: + return self._parent.name_full_unescaped + '::' + self.name_tokens[-1] + else: + return self.name_tokens[-1] + + @property + def overload_total(self) -> int: + if self._parent is not None and self._parent.is_class_or_struct: + return sum(neighbour.name == self.name for neighbour in self._parent.children) + return 0 + + @property + def overload_num(self) -> int: + if self._parent is not None and self._parent.is_class_or_struct: + count = 0 + for neighbour in self._parent.children: + if neighbour.name == self.name: + count += 1 + if neighbour.refid == self.refid: + break + return count + return 0 + + @property + def is_overloaded(self) -> bool: + return self.overload_total > 1 + + @property + def overload_suffix(self) -> str: + if self.is_operator: + return '' + + total = self.overload_total + if total > 1: + return '[' + str(self.overload_num) + '/' + str(total) + ']' + else: + return '' + + @property + def parents(self) -> ['Node']: + ret = [] + if self._parent is not None and (self._parent.is_language + or self._parent.is_dir): + ret.extend(self.parent.parents) + ret.append(self) + return ret + + @property + def suffix(self) -> str: + if self.is_parent: + if self._templateparams.has(): + return '<' + ', '.join(self._templateparams.array(notype=True)) + '>' + else: + return '' + elif self.is_function: + return self._specifiers.md() + elif self.is_variable: + if self._initializer.has(): + return ' = ' + self._initializer.md() + else: + return '' + elif self.is_define: + test = self._initializer.md() + if '\n' in test: + return '' + return test + else: + return '' + + @property + def prefix(self) -> str: + if self.is_function: + ret = [] + if self.is_virtual: + ret.append('virtual') + return ' '.join(ret) + elif self.kind is Kind.VARIABLE: + return '' + else: + return self.kind.value + + @property + def code_language(self) -> str: + return self._language + + @property + def codeblock(self) -> str: + code = [] + if self.is_function or self.is_friend: + if self._templateparams.has(): + code.append('template<' + self._templateparams.plain() + '>') + + typ = self._type.plain() + if typ: + typ += ' ' + if self.is_virtual: + typ = 'virtual ' + typ + if self.is_explicit: + typ = 'explicit ' + typ + if self.is_inline: + typ = 'inline ' + typ + if self.is_static: + typ = 'static ' + typ + + if self._params.has(): + code.append(typ + self.name_full_unescaped + ' (') + params = self._params.array(plain=True) + for i, param in enumerate(params): + if i + 1 >= len(params): + code.append(' ' + param) + else: + code.append(' ' + param + ',') + code.append(') ' + self._specifiers.parsed()) + else: + code.append(typ + self.name_full_unescaped + ' () ' + self._specifiers.parsed()) + + elif self.is_enum: + if self._values.has(): + code.append('enum ' + self.name_full_unescaped + ' {') + + values = [] + for enumvalue in self._xml.findall('enumvalue'): + p = enumvalue.find('name').text + initializer = enumvalue.find('initializer') + if initializer is not None: + p += ' ' + self._parser.paras_as_str(initializer, plain=True) + values.append(p) + + for i, value in enumerate(values): + if i + 1 >= len(values): + code.append(' ' + value) + else: + code.append(' ' + value + ',') + code.append('};') + else: + code.append('enum ' + self.name_full_unescaped + ';') + + elif self.is_define: + if self._params.has(): + code.append('#define ' + self.name_full_unescaped + ' (') + params = self._params.array(plain=True) + for i, param in enumerate(params): + if i + 1 >= len(params): + code.append(' ' + param) + else: + code.append(' ' + param + ',') + code.append(') ' + self._initializer.plain()) + else: + code.append('#define ' + self.name_full_unescaped + ' ' + self._initializer.plain()) + + else: + code.append(self._definition.plain()) + return '\n'.join(code) + + @property + def has_base_classes(self) -> bool: + return len(self._xml.findall('basecompoundref')) > 0 + + @property + def has_derived_classes(self) -> bool: + return len(self._xml.findall('derivedcompoundref')) > 0 + + @property + def base_classes(self) -> ['Node']: + ret = [] + for basecompoundref in self._xml.findall('basecompoundref'): + refid = basecompoundref.get('refid') + if refid is None: + ret.append(basecompoundref.text) + else: + ret.append(self._cache.get(refid)) + return ret + + @property + def derived_classes(self) -> ['Node']: + ret = [] + for derivedcompoundref in self._xml.findall('derivedcompoundref'): + refid = derivedcompoundref.get('refid') + if refid is None: + ret.append(derivedcompoundref.text) + else: + ret.append(self._cache.get(refid)) + return ret + + @property + def has_details(self) -> bool: + return self._details.has() + + @property + def details(self) -> str: + return self._details.md() + + @property + def has_brief(self) -> bool: + return self._brief.has() + + @property + def brief(self) -> str: + return self._brief.md() + + @property + def has_includes(self) -> bool: + return self._includes.has() + + @property + def includes(self) -> str: + return self._includes.plain() + + @property + def has_type(self) -> bool: + return self._type.has() + + @property + def type(self) -> str: + return self._type.md() + + @property + def has_location(self) -> bool: + return self._location.has() + + @property + def location(self) -> str: + return self._location.plain() + + @property + def has_params(self) -> bool: + return self._params.has() + + @property + def params(self) -> str: + if self._params.has(): + return '(' + self._params.md() + ')' + elif self.is_function: + return '()' + else: + return '' + + @property + def has_templateparams(self) -> bool: + return self._templateparams.has() + + @property + def templateparams(self) -> str: + return self._templateparams.md() + + @property + def has_specifiers(self) -> bool: + return self._specifiers.has() + + @property + def specifiders(self) -> str: + return self._specifiers.parsed() + + @property + def has_values(self) -> bool: + return self._values.has() + + @property + def values(self) -> str: + return self._values.md() + + @property + def has_initializer(self) -> bool: + return self._initializer.has() + + @property + def initializer(self) -> str: + return self._initializer.md() + + @property + def has_definition(self) -> bool: + return self._definition.has() + + @property + def definition(self) -> str: + return self._definition.plain() + + @property + def has_programlisting(self) -> bool: + return self._programlisting.has() + + @property + def programlisting(self) -> str: + return self._programlisting.md() + + @property + def is_resolved(self) -> bool: + return True + + @property + def reimplements(self) -> 'Node': + reimp = self._xml.find('reimplements') + if reimp is not None: + return self._cache.get(reimp.get('refid')) + else: + return None + + +class DummyNode: + def __init__(self, name_long: str, derived_classes: [Node], kind: Kind): + self.name_long = name_long + self.derived_classes = derived_classes + self.kind = kind + + @property + def is_resolved(self) -> bool: + return False diff --git a/src/mkdoxy/mkdoxy/plugin.py b/src/mkdoxy/mkdoxy/plugin.py new file mode 100644 index 000000000..c1f0fe1a9 --- /dev/null +++ b/src/mkdoxy/mkdoxy/plugin.py @@ -0,0 +1,195 @@ +import sys +from os import path, makedirs +from pathlib import Path, PurePath +from mkdocs import utils as mkdocs_utils +from mkdocs.plugins import BasePlugin +from mkdocs.config import base, config_options, Config +from mkdocs.structure import files, pages +from mkdocs.commands import serve +from mkdocs import exceptions + +from mkdoxy.doxyrun import DoxygenRun +from mkdoxy.doxygen import Doxygen +from mkdoxy.generatorBase import GeneratorBase +from mkdoxy.generatorAuto import GeneratorAuto +from mkdoxy.xml_parser import XmlParser +from mkdoxy.cache import Cache +from mkdoxy.constants import Kind +from mkdoxy.generatorSnippets import GeneratorSnippets +from mkdoxy.finder import Finder + +from pprint import * +import logging + +log = logging.getLogger("mkdocs") +pluginName = "MkDoxy" + + +class MkDoxy(BasePlugin): + """ + plugins: + - search + - mkdoxy + """ + + config_scheme = ( + ('projects', config_options.Type(dict, default={})), + ('full-doc', config_options.Type(bool, default=True)), + ('debug', config_options.Type(bool, default=False)), + ('ignore-errors', config_options.Type(bool, default=False)), + ('save-api', config_options.Type(str, default="")), + ) + + config_project = ( + ('src-dirs', config_options.Type(str)), + ('full-doc', config_options.Type(bool, default=True)), + ('debug', config_options.Type(bool, default=False)), + # ('ignore-errors', config_options.Type(bool, default=False)), + ('doxy-cfg', config_options.Type(dict, default={}, required=False)), + ) + + def on_files(self, files: files.Files, config): + def checkConfig(config_project, proData, strict: bool): + cfg = Config(config_project, '') + cfg.load_dict(proData) + errors, warnings = cfg.validate() + for config_name, warning in warnings: + log.warning(f" -> Config value: '{config_name}' in project '{projectName}'. Warning: {warning}") + for config_name, error in errors: + log.error(f" -> Config value: '{config_name}' in project '{projectName}'. Error: {error}") + + if len(errors) > 0: + raise exceptions.Abort(f"Aborted with {len(errors)} Configuration Errors!") + elif strict and len(warnings) > 0: + raise exceptions.Abort(f"Aborted with {len(warnings)} Configuration Warnings in 'strict' mode!") + + def tempDir(siteDir: str, tempDir:str, projectName: str) ->str: + tempDoxyDir = PurePath.joinpath(Path(siteDir), Path(tempDir), Path(projectName)) + tempDoxyDir.mkdir(parents=True, exist_ok=True) + return str(tempDoxyDir) + + self.doxygen = {} + self.generatorBase = {} + self.projects = self.config["projects"] + + log.info(f"Start plugin {pluginName}") + + for projectName in self.projects: + self.proData = self.projects.get(projectName) + log.info(f"-> Start project '{projectName}'") + + # Check project config -> raise exceptions + checkConfig(self.config_project, self.proData, config['strict']) + + if self.config.get("save-api"): + tempDirApi = tempDir("", self.config.get("save-api"), "") + else: + tempDirApi = tempDir(config['site_dir'], "assets/.doxy/", projectName) + + # Check scr changes -> run Doxygen + doxygenRun = DoxygenRun(self.proData.get('src-dirs'), tempDirApi, self.proData.get('doxy-cfg', {})) + if doxygenRun.checkAndRun(): + log.info(" -> generating Doxygen filese") + else: + log.info(" -> skip generating Doxygen files (nothing changes)") + + self.debug = self.config.get('debug', False) + + # Parse XML to bacic structure + cache = Cache() + parser = XmlParser(cache=cache, debug=self.debug) + + # Parse bacic structure to recursive Nodes + self.doxygen[projectName] = Doxygen(doxygenRun.path, parser=parser, cache=cache, debug=self.debug) + + # Print parsed files + if self.debug: + self.doxygen[projectName].printStructure() + + # Prepare generator for future use (GeneratorAuto, SnippetGenerator) + self.generatorBase[projectName] = GeneratorBase(ignore_errors=self.config["ignore-errors"]) + + if self.config["full-doc"] and self.proData.get("full-doc", True): + generatorAuto = GeneratorAuto( + generatorBase=self.generatorBase[projectName], + tempDoxyDir=tempDirApi, + siteDir=config['site_dir'], + apiPath=projectName, + doxygen=self.doxygen[projectName], + useDirectoryUrls=config['use_directory_urls'], + debug=self.debug + ) + + # generate automatic documentation and append files into files + generatorAuto.fullDoc() + + generatorAuto.summary() + + for file in generatorAuto.fullDocFiles: + files.append(file) + return files + + def on_page_markdown( + self, + markdown: str, + page: pages.Page, + config: base.Config, + files: files.Files, + ) -> str: + generatorSnippets = GeneratorSnippets( + markdown=markdown, + generatorBase=self.generatorBase, + doxygen=self.doxygen, + useDirectoryUrls=config['use_directory_urls'], + page = page, + debug=self.debug + ) + + return generatorSnippets.generate() + +# def on_pre_build(self, config): + +# def on_serve(self, server): +# return server +# +# def on_files(self, files: files.Files, config): +# return files + +# def on_nav(self, nav, config, files): +# return nav +# +# def on_env(self, env, config, files): +# return env +# +# def on_config(self, config): +# return config +# +# def on_post_build(self, config): +# return +# +# def on_pre_template(self, template, template_name, config): +# return template +# +# def on_template_context(self, context, template_name, config): +# return context +# +# def on_post_template(self, output_content, template_name, config): +# return output_content +# +# def on_pre_page(self, page: pages.Page, config, files: files.Files): +# return page +# +# def on_page_read_source(self, page: pages.Page, config): +# return +# +# def on_page_markdown(self, markdown, page, config, files): +# return markdown +# +# def on_page_content(self, html, page, config, files): +# return html +# +# def on_page_context(self, context, page, config, nav): +# return context +# +# def on_post_page(self, output_content, page, config): +# return output_content diff --git a/src/mkdoxy/mkdoxy/property.py b/src/mkdoxy/mkdoxy/property.py new file mode 100644 index 000000000..43a5beeb8 --- /dev/null +++ b/src/mkdoxy/mkdoxy/property.py @@ -0,0 +1,347 @@ +import re +from xml.etree.ElementTree import Element as Element +from mkdoxy.xml_parser import XmlParser +from mkdoxy.constants import Kind +from mkdoxy.markdown import escape + + +class Property: + class Details: + def __init__(self, xml: Element, parser: XmlParser, kind: Kind): + self.xml = xml + self.parser = parser + self.kind = kind + + def md(self, plain: bool = False) -> str: + detaileddescription = self.xml.find('detaileddescription') + if len(list(detaileddescription)) > 0: + return self.parser.paras_as_str(detaileddescription, plain=plain) + else: + return '' + + def plain(self) -> str: + return self.md(plain=True) + + def has(self) -> bool: + detaileddescription = self.xml.find('detaileddescription') + return len(list(detaileddescription)) > 0 + + class Brief: + def __init__(self, xml: Element, parser: XmlParser, kind: Kind): + self.xml = xml + self.parser = parser + self.kind = kind + + def md(self, plain: bool = False) -> str: + briefdescription = self.xml.find('briefdescription') + if not briefdescription: + return '' + + paras = briefdescription.findall('para') + if len(paras) > 0: + text = [] + for para in paras: + text.append(self.parser.paras_as_str(para, italic=True, plain=plain)) + return ' '.join(text) + else: + return '' + + def plain(self) -> str: + return self.md(plain=True) + + def has(self) -> bool: + detaileddescription = self.xml.find('detaileddescription') + return len(list(detaileddescription)) > 0 + + class Includes: + def __init__(self, xml: Element, parser: XmlParser, kind: Kind): + self.xml = xml + self.parser = parser + self.kind = kind + + def md(self, plain: bool = False) -> [str]: + return self.array(plain=False) + + def plain(self) -> [str]: + return self.array(plain=True) + + def array(self, plain: bool = False) -> [str]: + ret = [] + for includes in self.xml.findall('includes'): + if plain: + incl = includes.text + else: + incl = self.parser.reference_as_str(includes) + + if includes.get('local') == 'yes': + ret.append('"' + incl + '"') + else: + if plain: + ret.append('<' + incl + '>') + else: + ret.append('<' + incl + '>') + return ret + + def has(self) -> bool: + return len(self.xml.findall('includes')) > 0 + + class Type: + def __init__(self, xml: Element, parser: XmlParser, kind: Kind): + self.xml = xml + self.parser = parser + self.kind = kind + + def md(self, plain: bool = False) -> str: + para = self.xml.find('type') + if para is not None: + return self.parser.paras_as_str(para, plain=plain) + else: + return '' + + def plain(self) -> str: + return self.md(plain=True) + + def has(self) -> bool: + return self.xml.find('type') is not None + + class Location: + def __init__(self, xml: Element, parser: XmlParser, kind: Kind): + self.xml = xml + self.parser = parser + self.kind = kind + + def md(self, plain: bool = False) -> str: + return self.plain() + + def plain(self) -> str: + loc = self.xml.find('location') + if loc is not None: + return loc.get('file') + else: + return '' + + def has(self) -> bool: + return self.xml.find('location') is not None + + class Params: + def __init__(self, xml: Element, parser: XmlParser, kind: Kind): + self.xml = xml + self.parser = parser + self.kind = kind + + def md(self, plain: bool = False) -> str: + return ', '.join(self.array(plain=plain)) + + def plain(self) -> str: + return ', '.join(self.array(plain=True)) + + def array(self, plain: bool = False) -> [str]: + ret = [] + for param in self.xml.findall('param'): + p = '' + type = param.find('type') + p = self.parser.paras_as_str(type, plain=plain) + + declname = param.find('declname') + if declname is not None: + p += ' ' + self.parser.paras_as_str(declname, plain=plain) + else: + defname = param.find('defname') + if defname is not None: + p += ' ' + self.parser.paras_as_str(defname, plain=plain) + + defval = param.find('defval') + if defval is not None: + p += '=' + self.parser.paras_as_str(defval, plain=plain) + + ret.append(p.strip()) + return ret + + def has(self) -> bool: + return len(self.xml.findall('param')) > 0 + + class TemplateParams: + def __init__(self, xml: Element, parser: XmlParser, kind: Kind): + self.xml = xml + self.parser = parser + self.kind = kind + + def md(self, plain: bool = False) -> str: + return ', '.join(self.array(plain=plain)) + + def plain(self) -> str: + return ', '.join(self.array(plain=True)) + + def array(self, plain: bool = False, notype: bool = False) -> [str]: + ret = [] + templateparamlist = self.xml.find('templateparamlist') + if templateparamlist is not None: + for param in templateparamlist.findall('param'): + if notype: + declname = param.find('declname') + if declname is None: + declname = param.find('type') + ret.append(self.parser.paras_as_str(declname, plain=plain)) + else: + type = param.find('type') + declname = param.find('declname') + if declname is None: + declname = param.find('type') + ret.append( + self.parser.paras_as_str(type, plain=plain) + ' ' + self.parser.paras_as_str(declname, + plain=plain)) + return ret + + def has(self) -> bool: + return self.xml.find('templateparamlist') is not None + + class CodeBlock: + def __init__(self, xml: Element, parser: XmlParser, kind: Kind): + self.xml = xml + self.parser = parser + self.kind = kind + + def md(self, plain: bool = False) -> str: + return self.plain() + + def plain(self) -> str: + return '' + + def has(self) -> bool: + return True + + class Specifiers: + def __init__(self, xml: Element, parser: XmlParser, kind: Kind): + self.xml = xml + self.parser = parser + self.kind = kind + + def md(self, plain: bool = False) -> str: + return self.parsed() + + def plain(self) -> str: + argss = self.xml.find('argsstring') + if argss is None or argss.text is None: + return '' + return argss.text + + def parsed(self) -> str: + argss = self.xml.find('argsstring') + if argss is None or argss.text is None: + return '' + + argsstring = argss.text + ret = [] + + # Is deleted? + if re.search('\\)\\s*=\\s*delete', argsstring): + ret.append('= delete') + + # Is default? + if re.search('\\)\\s*=\\s*default', argsstring): + ret.append('= default') + + # Is noexcept + if re.search('\\).*noexcept', argsstring): + ret.append('noexcept') + + # Is override + if re.search('\\).*override', argsstring): + ret.append('override') + + # Is const? + if self.xml.get('const') == 'yes': + ret.append('const') + + # Is pure? + virt = self.xml.get('virt') + if virt == 'pure-virtual': + ret.append('= 0') + + return ' '.join(ret) + + def has(self) -> bool: + return self.xml.find('argsstring') is not None + + class Values: + def __init__(self, xml: Element, parser: XmlParser, kind: Kind): + self.xml = xml + self.parser = parser + self.kind = kind + + def md(self, plain: bool = False) -> str: + return ', '.join(self.array(plain=plain)) + + def plain(self) -> str: + return ', '.join(self.array(plain=False)) + + def array(self, plain: bool = False) -> [str]: + ret = [] + if self.kind.is_enum(): + for enumvalue in self.xml.findall('enumvalue'): + p = '**' + escape(enumvalue.find('name').text) + '**' + initializer = enumvalue.find('initializer') + if initializer is not None: + p += ' ' + self.parser.paras_as_str(initializer, plain=plain) + ret.append(p) + return ret + + def has(self) -> bool: + if self.kind.is_enum(): + return self.xml.find('enumvalue') is not None + else: + return False + + class Initializer: + def __init__(self, xml: Element, parser: XmlParser, kind: Kind): + self.xml = xml + self.parser = parser + self.kind = kind + + def md(self, plain: bool = False) -> str: + initializer = self.xml.find('initializer') + if initializer is not None: + return self.parser.paras_as_str(initializer, plain=plain) + else: + return '' + + def plain(self) -> str: + return self.md(plain=True) + + def has(self) -> bool: + return self.xml.find('initializer') is not None + + class Definition: + def __init__(self, xml: Element, parser: XmlParser, kind: Kind): + self.xml = xml + self.parser = parser + self.kind = kind + + def md(self, plain: bool = False) -> str: + return self.plain() + + def plain(self) -> str: + definition = self.xml.find('definition') + if definition is not None and definition.text: + return definition.text + ';' + else: + return '' + + def has(self) -> bool: + return self.xml.find('definition') is not None + + class Programlisting: + def __init__(self, xml: Element, parser: XmlParser, kind: Kind): + self.xml = xml + self.parser = parser + self.kind = kind + + def md(self, plain: bool = False) -> str: + programlisting = self.xml.find('programlisting') + if programlisting is None: + return '' + + return self.parser.programlisting_as_str(programlisting) + + def has(self) -> bool: + return self.xml.find('programlisting') is not None diff --git a/src/mkdoxy/mkdoxy/templates/annotated.jinja2 b/src/mkdoxy/mkdoxy/templates/annotated.jinja2 new file mode 100644 index 000000000..5a5318e7b --- /dev/null +++ b/src/mkdoxy/mkdoxy/templates/annotated.jinja2 @@ -0,0 +1,12 @@ +# Class List + +Here are the classes, structs, unions and interfaces with brief descriptions: + +{% for node in nodes recursive %} +{%- if node.is_parent %} +* **{{node.kind.value}}** [**{{node.name_short}}**]({{node.url}}) {{node.brief}} +{%- if node.has_children %} + {{- loop(node.children)|indent(2, true) }} +{%- endif %} +{%- endif -%} +{%- endfor %} \ No newline at end of file diff --git a/src/mkdoxy/mkdoxy/templates/classes.jinja2 b/src/mkdoxy/mkdoxy/templates/classes.jinja2 new file mode 100644 index 000000000..c99253e16 --- /dev/null +++ b/src/mkdoxy/mkdoxy/templates/classes.jinja2 @@ -0,0 +1,12 @@ +# Class Index + +{% for letter, children in dictionary.items() %} +## {{letter}} + +{% for node in children -%} +* [**{{node.name_short}}**]({{node.url}}) +{% if node.parent.is_language -%} + ([**{{node.parent.name_long}}**]({{node.parent.url}})) +{% endif -%} +{% endfor %} +{% endfor %} diff --git a/src/mkdoxy/mkdoxy/templates/code.jinja2 b/src/mkdoxy/mkdoxy/templates/code.jinja2 new file mode 100644 index 000000000..de9b1949a --- /dev/null +++ b/src/mkdoxy/mkdoxy/templates/code.jinja2 @@ -0,0 +1,23 @@ +--- +header: False +breadcrumbs: True +source: False +start: 1 +end: 0 +--- + + +{% if config.get('header') -%} +# {{node.kind.value|title}} {{node.name_long}} +{%- endif %} + + +{% if config.get('breadcrumbs') -%} +[**{{node.name_long if node.is_group else node.name_short}}**]({{node.url_source}}) +{%- endif %} + +{% if config.get('source') -%} +# [Go to the documentation of this file.]({{node.url}}) +# {%- endif %} + +{{code}} diff --git a/src/mkdoxy/mkdoxy/templates/error.jinja2 b/src/mkdoxy/mkdoxy/templates/error.jinja2 new file mode 100644 index 000000000..e00596eab --- /dev/null +++ b/src/mkdoxy/mkdoxy/templates/error.jinja2 @@ -0,0 +1,8 @@ +
+

Error: {{title }}

+{%- if message %} +```{{language}} +{{message}} +``` +{%- endif %} +
\ No newline at end of file diff --git a/src/mkdoxy/mkdoxy/templates/files.jinja2 b/src/mkdoxy/mkdoxy/templates/files.jinja2 new file mode 100644 index 000000000..a6fc4ab42 --- /dev/null +++ b/src/mkdoxy/mkdoxy/templates/files.jinja2 @@ -0,0 +1,12 @@ +# File List + +Here is a list of all files with brief descriptions: + +{% for node in nodes recursive %} +{%- if node.is_dir or node.is_file %} +* **{{node.kind.value}}** [**{{node.name_short}}**]({{node.url}}) {{node.brief}} +{%- if node.has_children %} + {{- loop(node.children)|indent(2, true) }} +{%- endif %} +{%- endif -%} +{%- endfor %} \ No newline at end of file diff --git a/src/mkdoxy/mkdoxy/templates/hierarchy.jinja2 b/src/mkdoxy/mkdoxy/templates/hierarchy.jinja2 new file mode 100644 index 000000000..6f203fcf8 --- /dev/null +++ b/src/mkdoxy/mkdoxy/templates/hierarchy.jinja2 @@ -0,0 +1,14 @@ +# Class Hierarchy + +This inheritance list is sorted roughly, but not completely, alphabetically: + +{% for node in classes recursive %} +{% if node.is_resolved -%} +* **{{node.kind.value}}** [**{{node.name_long}}**]({{node.url}}) {{node.brief}} +{%- else -%} +* **{{node.kind.value}}** **{{node.name_long}}** +{%- endif %} +{%- if node.derived_classes %} + {{- loop(node.derived_classes)|indent(2, true) }} +{%- endif %} +{%- endfor %} \ No newline at end of file diff --git a/src/mkdoxy/mkdoxy/templates/index.jinja2 b/src/mkdoxy/mkdoxy/templates/index.jinja2 new file mode 100644 index 000000000..bc96df8cb --- /dev/null +++ b/src/mkdoxy/mkdoxy/templates/index.jinja2 @@ -0,0 +1,10 @@ +# {{title}} + +{% for letter, items in dictionary.items() %} +## {{letter}} + +{% for name, parents in items.items() -%} +* **{{name}}** ( +{%- for parent in parents -%}[**{{parent.name_long}}**]({{parent.url}}){{ ', ' if not loop.last else '' }}{% endfor -%} ) +{% endfor %} +{% endfor %} \ No newline at end of file diff --git a/src/mkdoxy/mkdoxy/templates/memDef.jinja2 b/src/mkdoxy/mkdoxy/templates/memDef.jinja2 new file mode 100644 index 000000000..5a8892709 --- /dev/null +++ b/src/mkdoxy/mkdoxy/templates/memDef.jinja2 @@ -0,0 +1,31 @@ +--- +brief: True +details: True +implements: True +--- +{# This template is used inside of member.py #} + +### {{node.kind.value}} {{node.name_long if node.is_group else node.name_short}} {{node.overload_suffix}} + +{% if configMemDef.get('brief') -%} +{% if node.has_brief -%} +{{node.brief + "\n"}} +{%- endif -%} +{%- endif -%} + +```{{node.code_language}} +{{node.codeblock}} +``` + + +{% if configMemDef.get('details') -%} +{% if node.has_details -%} +{{node.details}} +{%- endif -%} +{%- endif -%} + +{% if configMemDef.get('implements') -%} +{% if node.reimplements %} +Implements [*{{node.reimplements.name_long}}*]({{node.reimplements.url}}) +{% endif %} +{%- endif -%} diff --git a/src/mkdoxy/mkdoxy/templates/memTab.jinja2 b/src/mkdoxy/mkdoxy/templates/memTab.jinja2 new file mode 100644 index 000000000..bc650246b --- /dev/null +++ b/src/mkdoxy/mkdoxy/templates/memTab.jinja2 @@ -0,0 +1,32 @@ +{# This template is used inside of member.py #} + +{%- if node.has(visibility, kinds, static) -%} +{%- if parent is none -%} +## {{title}} +{%- else -%} +## {{title}} inherited from {{node.name}} + +See [{{node.name_long}}]({{node.url}}) +{%- endif %} + +| Type | Name | +| ---: | :--- | +{% for member in node.query(visibility, kinds, static) -%} +{%- if member.is_group -%} +| module | [**{{member.title}}**]({{member.url}}) {{member.suffix}}
{{member.brief}} | +{%- elif member.is_file -%} +| file | [**{{member.name_short}}**]({{member.url}}) {{member.suffix}}
{{member.brief}} | +{%- elif member.is_dir -%} +| dir | [**{{member.name_short}}**]({{member.url}}) {{member.suffix}}
{{member.brief}} | +{%- elif member.is_namespace -%} +| {{member.kind.value}} | [**{{member.name_long if node.is_group else member.name_short}}**]({{member.url}}) {{member.suffix}}
{{member.brief}} | +{%- elif member.is_class or member.is_interface or member.is_struct -%} +| {{member.kind.value}} | [**{{member.name_long if node.is_group else member.name_short}}**]({{member.url}}) {{member.suffix}}
{{member.brief}} | +{%- elif member.is_enum or member.is_function or member.is_variable or member.is_union or member.is_typedef -%} +| {{member.prefix}} {{member.type}} | [**{{member.name_long if node.is_group else member.name_short}}**](#{{member.anchor}}) {{member.params}} {{member.suffix}}
{{member.brief}} | +{%- else -%} +| {{member.prefix}} {{member.type}} | [**{{member.name_long if node.is_group else member.name_short}}**]({{member.url}}) {{member.params}} {{member.suffix}}
{{member.brief}} | +{%- endif %} +{% endfor -%} + +{%- endif -%} diff --git a/src/mkdoxy/mkdoxy/templates/member.jinja2 b/src/mkdoxy/mkdoxy/templates/member.jinja2 new file mode 100644 index 000000000..583df2f0b --- /dev/null +++ b/src/mkdoxy/mkdoxy/templates/member.jinja2 @@ -0,0 +1,107 @@ +--- +brief: True +details: True +implements: True +--- + +# {{node.kind.value|title}} {{node.name_long}} +{% if node.has_templateparams %} +**template <{{node.templateparams}}>** +{% endif %} + + +[**{{node.base_name}}**]({{node.base_url}}) +{%- for parent in node.parents -%} +{{'**>**'|indent(1, true)}} [**{{parent.name_long if node.is_group else parent.name_short}}**]({{parent.url}}) +{%- endfor %} + +{% if node.is_file and node.has_programlisting -%} +[Go to the source code of this file.]({{node.url_source}}) +{%- endif %} + +{{node.brief}} +{%- if node.has_details -%} +[More...](#detailed-description) +{%- endif %} + +{% if node.has_includes -%} +{%- for include in node.includes -%} +* `#include {{include}}` +{% endfor -%} +{%- endif %} + +{% if node.has_base_classes %} +Inherits the following classes: +{%- for base in node.base_classes -%} +{%- if base is string %} {{base}}{%- else %} [{{base.name_long}}]({{base.url}}){%- endif -%} +{{ ', ' if not loop.last else '' }} +{%- endfor -%} +{%- endif %} + +{% if node.has_derived_classes %} +Inherited by the following classes: +{%- for derived in node.derived_classes -%} +{%- if derived is string %} {{derived}}{%- else %} [{{derived.name_long}}]({{derived.url}}){%- endif -%} +{{ ', ' if not loop.last else '' }} +{%- endfor -%} +{%- endif %} + +{{ templateMemTab.render({'node': node, 'parent': None, 'title': 'Files', 'visibility': 'public', 'kinds': ['file'], 'static': False}) }} +{{ templateMemTab.render({'node': node, 'parent': None, 'title': 'Directories', 'visibility': 'public', 'kinds': ['dir'], 'static': False}) }} +{{ templateMemTab.render({'node': node, 'parent': None, 'title': 'Modules', 'visibility': 'public', 'kinds': ['group'], 'static': False}) }} +{{ templateMemTab.render({'node': node, 'parent': None, 'title': 'Namespaces', 'visibility': 'public', 'kinds': ['namespace'], 'static': False}) }} +{{ templateMemTab.render({'node': node, 'parent': None, 'title': 'Classes', 'visibility': 'public', 'kinds': ['class', 'struct', 'interface'], 'static': False}) }} + +{%- for visibility in ['public', 'protected'] -%} +{%- for query in [['types', ['enum', 'union', 'typedef']], ['attributes', ['variable']], ['functions', ['function']]] -%} +{%- for static in [['', False], ['static ', True]] %} +{{ templateMemTab.render({'node': node, 'parent': None, 'title': visibility|title + ' ' + static[0]|title + query[0]|title, 'visibility': visibility, 'kinds': query[1], 'static': static[1]}) }} +{%- for child in node.base_classes recursive -%}{%- if child is not string %} +{{ templateMemTab.render({'node': child, 'parent': node, 'title': visibility|title + ' ' + static[0]|title + query[0]|title, 'visibility': visibility, 'kinds': query[1], 'static': static[1]}) }} +{{- loop(child.base_classes)}} +{%- endif -%}{%- endfor -%} +{%- endfor -%} +{%- endfor -%} +{%- endfor -%} + +{{ templateMemTab.render({'node': node, 'parent': None, 'title': 'Macros', 'visibility': 'public', 'kinds': ['define'], 'static': False}) }} + +{%- if node.has_details %} +# Detailed Description + +{{node.details}} +{%- endif %} + +{%- for visibility in ['public', 'protected'] -%} +{%- for query in [['types', ['enum', 'union', 'typedef']], ['attributes', ['variable']], ['functions', ['function']]] -%} +{%- for static in [['', False], ['static ', True]] %} +{%- if node.has(visibility, query[1], static[1]) %} +## {{visibility|title}} {{static[0]|title}}{{query[0]|title}} Documentation +{% for member in node.query(visibility, query[1], static[1]) -%} +{{ templateMemDef.render({'node': member, 'configMemDef': configMemDef}) }} +{%- endfor %} +{%- endif -%} +{%- endfor -%} +{%- endfor -%} +{%- endfor -%} + +{%- if node.has('public', ['define'], False) %} +## Macro Definition Documentation + +{% for member in node.query('public', ['define'], False) -%} +{{ templateMemDef.render({'node': member, 'configMemDef': configMemDef}) }} +{%- endfor -%} +{%- endif %} + +{%- if node.has('public', ['friend'], False) -%} +## Friends Documentation + +{% for member in node.query('public', ['friend'], False) -%} +{{ templateMemDef.render({'node': member, 'configMemDef': configMemDef}) }} +{%- endfor %} +{%- endif %} + +------------------------------ +{% if node.has_location -%} +The documentation for this class was generated from the following file `{{node.location}}` +{%- endif %} \ No newline at end of file diff --git a/src/mkdoxy/mkdoxy/templates/modules.jinja2 b/src/mkdoxy/mkdoxy/templates/modules.jinja2 new file mode 100644 index 000000000..46cffae91 --- /dev/null +++ b/src/mkdoxy/mkdoxy/templates/modules.jinja2 @@ -0,0 +1,12 @@ +# Modules + +Here is a list of all modules: + +{% for node in nodes recursive %} +{%- if node.is_group %} +* [**{{node.title}}**]({{node.url}}) {{node.brief}} +{%- if node.has_children %} + {{- loop(node.children)|indent(2, true) }} +{%- endif %} +{%- endif -%} +{%- endfor %} \ No newline at end of file diff --git a/src/mkdoxy/mkdoxy/templates/namespaces.jinja2 b/src/mkdoxy/mkdoxy/templates/namespaces.jinja2 new file mode 100644 index 000000000..3de7cd298 --- /dev/null +++ b/src/mkdoxy/mkdoxy/templates/namespaces.jinja2 @@ -0,0 +1,12 @@ +# Namespace List + +Here is a list of all namespaces with brief descriptions: + +{% for node in nodes recursive %} +{%- if node.is_namespace %} +* **{{node.kind.value}}** [**{{node.name_short}}**]({{node.url}}) {{node.brief}} + {%- if node.has_children %} + {{- loop(node.children)|indent(2, true) }} + {%- endif %} +{%- endif -%} +{%- endfor %} \ No newline at end of file diff --git a/src/mkdoxy/mkdoxy/templates/page.jinja2 b/src/mkdoxy/mkdoxy/templates/page.jinja2 new file mode 100644 index 000000000..de514c3e1 --- /dev/null +++ b/src/mkdoxy/mkdoxy/templates/page.jinja2 @@ -0,0 +1,3 @@ +# {{node.title}} + +{{node.details}} \ No newline at end of file diff --git a/src/mkdoxy/mkdoxy/templates/pages.jinja2 b/src/mkdoxy/mkdoxy/templates/pages.jinja2 new file mode 100644 index 000000000..2adfdfcbc --- /dev/null +++ b/src/mkdoxy/mkdoxy/templates/pages.jinja2 @@ -0,0 +1,7 @@ +# Related Pages + +Here is a list of all related documentation pages: + +{% for page in nodes -%} +* [*{{page.title}}*]({{page.url}}) {{page.brief}} +{% endfor -%} \ No newline at end of file diff --git a/src/mkdoxy/mkdoxy/templates/programlisting.jinja2 b/src/mkdoxy/mkdoxy/templates/programlisting.jinja2 new file mode 100644 index 000000000..875417b07 --- /dev/null +++ b/src/mkdoxy/mkdoxy/templates/programlisting.jinja2 @@ -0,0 +1,17 @@ +--- +header: False +breadcrumbs: False +--- + +# {{node.kind.value|title}} {{node.name_long}} + +[**File List**](files.md) +{%- for child in node.parents -%} +{{'**>**'|indent(1, true)}} [**{{child.name_long if node.is_group else child.name_short}}**]({{child.url}}) +{%- endfor %} + +[Go to the documentation of this file.]({{node.url}}) + +```{{ node.code_language }} +{{node.programlisting}} +``` \ No newline at end of file diff --git a/src/mkdoxy/mkdoxy/utils.py b/src/mkdoxy/mkdoxy/utils.py new file mode 100644 index 000000000..1b5e651f1 --- /dev/null +++ b/src/mkdoxy/mkdoxy/utils.py @@ -0,0 +1,110 @@ +import re +import sys +from pprint import * +from ruamel.yaml import YAML +# from mkdoxy.node import Node +# from mkdoxy.constants import Kind + +import logging + +log = logging.getLogger("mkdocs") + + +regex = r"(-{3}|\.{3})\n(?P([\S\s])*)\n(-{3}|\.{3})\n(?P