### ESP-IDF Project Setup and Build Commands Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/SensorLib/examples/ESP_IDF_TouchDrv_Example/README.md This snippet provides a step-by-step guide to set up the ESP-IDF development environment, clone required libraries (esp-idf, XPowersLib), and compile/flash an ESP-IDF project using `idf.py` commands. It assumes ESP-IDF is not yet installed and includes a note about configuring specific pins (SDA, SCL, INT, RST). ```shell mkdir -p ~/esp cd ~/esp git clone --recursive https://github.com/espressif/esp-idf.git git clone https://github.com/lewisxhe/XPowersLib.git cd esp-idf ./install.sh . ./export.sh cd .. cd SensorLib/examples/ESP_IDF_Example # Configure SDA,SCL,INT,RST,Pin ... idf.py menuconfig idf.py build idf.py -b 921600 flash idf.py monitor ``` -------------------------------- ### Configure PlatformIO Project for LilyGO-T-A76XX Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/README.md This snippet details the configuration steps within the `platformio.ini` file for a LilyGO-T-A76XX project in PlatformIO. It involves selecting the target board by uncommenting its `default_envs` entry and specifying the active source directory by uncommenting one `src_dir` line. ```INI ; platformio.ini snippet ; Uncomment the desired board environment, e.g.: ; default_envs = esp32dev ; default_envs = T-A7670X default_envs = YOUR_SELECTED_BOARD_NAME ; Uncomment the active source directory, e.g.: ; src_dir = src ; src_dir = examples/ATdebug src_dir = YOUR_SELECTED_SOURCE_DIRECTORY ``` -------------------------------- ### Simple Adafruit NeoPixel LED Control Example Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/Adafruit NeoPixel/README.md An Arduino C++ sketch demonstrating basic setup and sequential illumination of pixels on an Adafruit NeoPixel strip. It initializes the strip, clears it, and then lights up each pixel in green with a delay. ```Cpp #include #ifdef __AVR__ #include #endif #define PIN 6 #define NUMPIXELS 16 Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); #define DELAYVAL 500 void setup() { #if defined(__AVR_ATtiny85__) && (F_CPU == 16000000) clock_prescale_set(clock_div_1); #endif pixels.begin(); } void loop() { pixels.clear(); for(int i=0; i ``` -------------------------------- ### HttpClient Library Methods and Functions Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/ArduinoHttpClient/keywords.txt Details the available methods and functions for HTTP requests (GET, POST, PUT, PATCH), request lifecycle management, header handling, response parsing, WebSocket operations, and URL encoding, categorized as KEYWORD2. ```APIDOC get post put patch startRequest beginRequest beginBody sendHeader sendBasicAuth endRequest responseStatusCode readHeader skipResponseHeaders endOfHeadersReached endOfBodyReached completed contentLength isResponseChunked connectionKeepAlive noDefaultRequestHeaders headerAvailable readHeaderName readHeaderValue responseBody beginMessage endMessage parseMessage messageType isFinal readString ping encode ``` -------------------------------- ### Configure Arduino Sketch Settings Substitution Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/pubsubclient/tests/README.md Describes how the test suite automatically substitutes `server_ip` and `arduino_ip` values into Arduino sketches before compilation. The suite identifies lines that start with specific byte array definitions and replaces them with the appropriate configuration values. ```Arduino byte server[] = { byte ip[] = { ``` -------------------------------- ### Configure Arduino IDE Project for LilyGO-T-A76XX Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/README.md This snippet shows how to modify the board macro definition in `utilities.h` for LilyGO-T-A76XX projects within the Arduino IDE. Additionally, for ESP32-S3 controllers, 'USB CDC ON Boot' needs to be set to 'Enabled' in the Tools menu if serial communication is required. ```C/C++ // In examples/ATdebug/utilities.h // Change the board macro definition from commented to uncommented, e.g.: // #define LILYGO_T_A7670 // to: #define LILYGO_T_A7670 ``` -------------------------------- ### Navigate to fontconvert Directory in MSYS Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/Adafruit GFX Library/fontconvert/fontconvert_win.md Command to change the current directory to the `fontconvert` tool's folder within the MSYS command prompt, assuming the Adafruit GFX library is copied to C:\. ```Shell cd /c/adafruit_gfx_library\fontconvert ``` -------------------------------- ### Compile fontconvert.c Executable Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/Adafruit GFX Library/fontconvert/fontconvert_win.md Command to execute the Makefile in the `fontconvert` directory, which compiles the `fontconvert.c` source file into an executable named `fontconvert.exe`. ```Shell make ``` -------------------------------- ### Modified Makefile for fontconvert.c Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/Adafruit GFX Library/fontconvert/fontconvert_win.md The content of the `makefile` for `fontconvert.c`, specifying GCC as the compiler, including FreeType headers, linking the FreeType library, and defining targets for building the executable and cleaning up. ```Makefile all: fontconvert CC = gcc CFLAGS = -Wall -I c:/mingw/include/freetype2 LIBS = -lfreetype fontconvert: fontconvert.c $(CC) $(CFLAGS) $< $(LIBS) -o $@ clean: rm -f fontconvert ``` -------------------------------- ### Navigate to FreeType Directory in MSYS Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/Adafruit GFX Library/fontconvert/fontconvert_win.md Commands to change the current directory to the FreeType library folder (e.g., 'ft27') within the MSYS command prompt, assuming it's unzipped in the C:\ drive. ```Shell cd /c cd ft27 ``` -------------------------------- ### Generate Custom Font Header File from TTF Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/Adafruit GFX Library/fontconvert/fontconvert_win.md Command to use the compiled `fontconvert.exe` tool to convert a TrueType Font (.ttf) file (e.g., `yourfonts.ttf`) into a C header file (e.g., `yourfonts9pt7b.h`) for use with the Adafruit GFX library, specifying the desired font size (e.g., 9pt). ```Shell ./fontconvert yourfonts.ttf 9 > yourfonts9pt7b.h ``` -------------------------------- ### Disable USB CDC On Boot for ESP32S3 Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/README.md Instructions to disable the USB CDC (Communication Device Class) option on ESP32S3 boards, which prevents the board from waiting for USB access during boot when using external power. This is particularly relevant for early Arduino esp-core versions (< 3.0). Disabling CDC will redirect serial output from USB-C to GPIO43 and GPIO44. ```c Tools -> USB CDC On Boot -> Disable ``` ```bash build_flags = ; Enable UARDUINO_USB_CDC_ON_BOOT will start printing and wait for terminal access during startup ; -DARDUINO_USB_CDC_ON_BOOT=1 ; Enable UARDUINO_USB_CDC_ON_BOOT will turn off printing and will not block when using the battery -UARDUINO_USB_CDC_ON_BOOT ``` -------------------------------- ### Build Local Tests with Makefile Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/pubsubclient/tests/README.md Instructions to compile the local test executables using the provided Makefile. This process creates binaries in the `./bin/` directory, which can then be run to test specific functionalities. ```Shell $ make ``` -------------------------------- ### Create TinyGSM Modem and Client Instances Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/TinyGSM/README.md Illustrates how to instantiate the TinyGSM modem object and various types of client objects (secure, insecure, single, multiple connections) for network interaction. ```C++ TinyGsm modem(SerialAT); ``` ```C++ TinyGsmClient client(modem); ``` ```C++ TinyGsmClientSecure client(modem); ``` ```C++ TinyGsmClient clientX(modem, 0); ``` ```C++ TinyGsmClient clientY(modem, 1); ``` ```C++ TinyGsmClientSecure clientX(modem, 0); ``` ```C++ TinyGsmClientSecure clientY(modem, 1); ``` -------------------------------- ### Run Arduino Test Suite with Python Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/pubsubclient/tests/README.md Instructions to execute the Arduino test suite using a Python script. This command assumes an MQTT server is already running and will print a summary of activity to the console, with more comprehensive logs written to the `logs` directory. ```Shell $ python testsuite.py ``` -------------------------------- ### Build, Flash, and Monitor ESP-IDF Project Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/SensorLib/examples/ESP_IDF_TouchDrv_Example/README.md This command performs a sequence of actions: it builds the ESP-IDF project, flashes the compiled firmware to the connected device via the specified serial port, and then opens a serial monitor to display the device's output. Replace 'PORT' with the actual serial port of your device. ```Shell idf.py -p PORT flash monitor ``` -------------------------------- ### Python Test Case Conventions for Arduino Suite Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/pubsubclient/tests/README.md Defines the required structure and conventions for Python test cases used in the Arduino test suite. Test cases must subclass `unittest.TestCase`, provide `setUpClass` and `tearDownClass` methods, and all test method names must begin with `test_`. ```Python import unittest class MyTestCase(unittest.TestCase): @classmethod def setUpClass(cls): # Setup before sketch upload, e.g., connecting a client or subscribing to topics. pass @classmethod def tearDownClass(cls): # Teardown after tests complete. pass def test_something(self): # Test logic for a specific functionality. pass ``` -------------------------------- ### Blynk Library Methods, Functions, and Defines Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/Blynk/keywords.txt This snippet details the core methods and functions for controlling device behavior and communicating with the Blynk server. It also includes handler helpers for event processing, variable binding macros, and special preprocessor defines for configuration and debugging. ```APIDOC begin config run connect connected virtualWrite virtualWriteBinary syncAll syncVirtual setProperty logEvent resolveEvent resolveAllEvents beginGroup endGroup # Handler helpers BLYNK_READ BLYNK_WRITE BLYNK_READ_DEFAULT BLYNK_WRITE_DEFAULT BLYNK_ATTACH_WIDGET BLYNK_CONNECTED #BLYNK_DISCONNECTED BLYNK_APP_CONNECTED BLYNK_APP_DISCONNECTED BLYNK_OUTPUT BLYNK_INPUT BLYNK_OUTPUT_DEFAULT BLYNK_INPUT_DEFAULT # Variables binding BLYNK_VAR_INT BLYNK_VAR_LONG BLYNK_VAR_DOUBLE BLYNK_VAR_STRING # Special defines BLYNK_DEBUG BLYNK_DEBUG_ALL BLYNK_PRINT BLYNK_AUTH_TOKEN BLYNK_TEMPLATE_ID BLYNK_TEMPLATE_NAME BLYNK_FIRMWARE_VERSION BLYNK_FIRMWARE_TYPE BLYNK_HEARTBEAT BLYNK_EXPERIMENTAL BLYNK_NO_BUILTIN BLYNK_NO_FLOAT BLYNK_NO_FANCY_LOGO BLYNK_FANCY_LOGO_3D BLYNK_USE_DIRECT_CONNECT BLYNK_MAX_SENDBYTES BLYNK_MAX_READBYTES # Periodic actions #BLYNK_EVERY_N_MILLIS #BLYNK_EVERY_N_SECONDS #BLYNK_EVERY_N_MINUTES #BLYNK_EVERY_N_HOURS ``` -------------------------------- ### Configure ESP-IDF Project Settings Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/SensorLib/examples/ESP_IDF_TouchDrv_Example/README.md Use this command to open the project configuration menu (`menuconfig`). Here, you can customize various settings such as PMU type, GPIO pins for Sensor SCL, SDA, Interrupt, Reset, and the Master Frequency for communication. ```Shell idf.py menuconfig ``` -------------------------------- ### Adafruit_NeoPixel Methods and Functions Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/Adafruit NeoPixel/keywords.txt Lists the available methods and functions for controlling NeoPixel strips, including initialization, color setting, brightness adjustment, and pixel manipulation. ```APIDOC Methods and Functions: begin() show() setPin() setPixelColor() fill() setBrightness() clear() updateLength() updateType() canShow() getPixels() getBrightness() getPin() numPixels() getPixelColor() sine8() gamma8() Color() ColorHSV() gamma32() ``` -------------------------------- ### PubSubClient 2.0: MQTT 3.1.1 Support and API Enhancements Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/pubsubclient/CHANGES.txt Version 2.0 adds default support for MQTT 3.1.1, improves PROGMEM handling, and introduces overloaded constructors, chainable setters, and a state function for connection return codes. ```APIDOC MQTT Protocol: Adds (and defaults to) MQTT 3.1.1 support Constructors: Add overloaded constructors for convenience Setters: Add chainable setters for server/callback/client/stream State Function: Add state() function to return connack return code Fixes: Fix PROGMEM handling for Intel Galileo/ESP8266 ``` -------------------------------- ### Registering ESP-IDF Component Source Files and Includes Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/SensorLib/examples/ESP_IDF_TouchDrv_Example/main/CMakeLists.txt This snippet demonstrates how to register source files (`.cpp`) and include directories (`.`) for an ESP-IDF component using the `idf_component_register` function. It lists the source files `touch_drv.cpp`, `i2c_driver.cpp`, and `main.cpp`, and sets the current directory as an include path. This configuration is typically found in a `CMakeLists.txt` or similar build configuration file within an ESP-IDF component directory. ```ESP-IDF Config idf_component_register(SRCS "touch_drv.cpp" "i2c_driver.cpp" "main.cpp" INCLUDE_DIRS ".") ``` -------------------------------- ### API Methods for SensorBMA423 Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/SensorLib/keywords.txt Lists the available API methods for the SensorBMA423 module, detailing their names. ```APIDOC enablePowerSave disablePowerSave disableInterruptCtrl enableInterruptCtrl enableAccelerometer disableAccelerometer configAccelerometer getAccelRaw getAccelerometer getTemperature direction setRemapAxes setStepCounterWatermark resetPedometer enableFeature readIrqStatus configInterrupt configFeatureInterrupt enablePedometerIRQ enableTiltIRQ enableWakeupIRQ enableAnyNoMotionIRQ enableActivityIRQ disablePedometerIRQ disableTiltIRQ disableWakeupIRQ disableAnyNoMotionIRQ disableActivityIRQ isActivity isTilt isDoubleTap isAnyNoMotion isPedometer ``` -------------------------------- ### API Methods for SensorWireHelper Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/SensorLib/keywords.txt Lists the available API methods for the SensorWireHelper module, detailing their names. ```APIDOC regdump dumpDevices hexdump ``` -------------------------------- ### Common AT Commands for T-A76xx Modules Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/examples/ATdebug/readme.md A table listing frequently used AT commands for the LilyGO T-A76xx module, showing the command, its explanation, and typical responses. These commands are essential for basic module interaction and status queries. ```APIDOC AT Command Reference: - Command: AT Explanation: AT test instruction Response: OK - Command: AT+SIMCOMATI Explanation: version information Response: "" - Command: AT+CPIN? Explanation: Example Query the SIM card status Response: +CPIN: READY - Command: AT+CGREG? Explanation: Network Registration Status Response: +CGREG: 0,1 - Command: AT+CSQ Explanation: Network signal quality query Response: "" - Command: AT+COPS? Explanation: Querying current Carrier Information Response: "" ``` -------------------------------- ### API Methods for SensorBHI260AP Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/SensorLib/keywords.txt Lists the available API methods for the SensorBHI260AP module, detailing their names. ```APIDOC setPins setBootFormFlash getHandler printSensors printInfo setInterruptCtrl getInterruptCtrl printInterruptCtrl isReady getKernelVersion onEvent removeEvent onResultEvent removeResultEvent setProcessBufferSize uploadFirmware getError configure getConfigure getScaling setFirmware getSensorName getAccuracy ``` -------------------------------- ### Initialize and Manage TinyGSM Modem State Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/TinyGSM/README.md Shows commands to initialize or restart the modem and unlock the SIM card if required, ensuring the module is ready for network operations. ```C++ modem.init() ``` ```C++ modem.restart() ``` ```C++ modem.simUnlock(GSM_PIN) ``` -------------------------------- ### PubSubClient 2.8: MQTT Configuration and Topic Handling Enhancements Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/pubsubclient/CHANGES.txt Version 2.8 introduces new methods for overriding default MQTT client settings like buffer size, keep-alive interval, and socket timeout. It also adds validation to prevent subscriptions to empty topics and improves client object handling. ```APIDOC PubSubClient Configuration: setBufferSize(): Overrides MQTT_MAX_PACKET_SIZE setKeepAlive(): Overrides MQTT_KEEPALIVE setSocketTimeout(): Overrides MQTT_SOCKET_TIMEOUT Topic Handling: Prevents subscribe/unsubscribe to empty topics Client Objects: Supports pre-connected Client objects Internal: Uses strnlen to avoid overruns ``` -------------------------------- ### Establish GPRS/EPS Data Connection with TinyGSM Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/TinyGSM/README.md Demonstrates how to establish a GPRS or EPS data connection using an APN, with optional username and password, after successful network registration. ```C++ modem.gprsConnect(apn, gprsUser, gprsPass) ``` ```C++ modem.gprsConnect(apn) ``` -------------------------------- ### PubSubClient 1.5: Default Constructor and Compile Fixes Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/pubsubclient/CHANGES.txt Version 1.5 introduces a default constructor and fixes compile errors when used with older Arduino versions. ```APIDOC PubSubClient Constructors: Added default constructor Fixes: Fixed compile error when used with arduino-0021 or later ``` -------------------------------- ### Define TinyGSM Modem and Include Library Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/TinyGSM/README.md Defines the specific modem module being used (e.g., SIM800) and includes the necessary TinyGSM client library for communication. ```C++ #define TINY_GSM_MODEM_SIM800 ``` ```C++ #include ``` -------------------------------- ### Correct HTTP Request Line Formatting in C++ Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/TinyGSM/README.md This snippet illustrates the recommended method for constructing and sending HTTP request lines using `client.print` in C++. It contrasts a single, concatenated string approach with a fragmented, multi-print method, highlighting the importance of sending complete lines to prevent issues like 'typewriter style' transmission. ```cpp client.print(String("GET ") + resource + " HTTP/1.1\r\n"); ``` ```cpp client.print("GET "); client.print(resource); client.println(" HTTP/1.1") ``` -------------------------------- ### CMake Configuration for Adafruit GFX Library ESP-IDF Component Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/Adafruit GFX Library/CMakeLists.txt This CMakeLists.txt snippet defines the build configuration for the Adafruit GFX Library as an ESP-IDF component. It specifies the minimum required CMake version, lists the source files, defines include directories, and declares dependencies on the 'arduino' and 'Adafruit_BusIO' components for proper compilation and linking. ```CMake cmake_minimum_required(VERSION 3.5) idf_component_register(SRCS "Adafruit_GFX.cpp" "Adafruit_GrayOLED.cpp" "Adafruit_SPITFT.cpp" "glcdfont.c" INCLUDE_DIRS "." REQUIRES arduino Adafruit_BusIO) project(Adafruit-GFX-Library) ``` -------------------------------- ### PubSubClient 1.9: Client Instance Requirement and New Features Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/pubsubclient/CHANGES.txt Version 1.9 introduces a significant API change requiring a Client instance in all constructors. It also adds username/password support and a function to publish messages from PROGMEM. ```APIDOC PubSubClient API Change: All constructors now require an instance of Client to be passed in. Authentication: Added username/password support PROGMEM Publishing: Added publish_P: Publishes messages from PROGMEM Internal: Do not split MQTT packets over multiple calls to _client->write() ``` -------------------------------- ### API Methods for TouchDrvGT911 Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/SensorLib/keywords.txt Lists the available API methods for the TouchDrvGT911 module, detailing their names. ```APIDOC setInterruptMode getInterruptMode getFwVersion getConfigVersion updateRefreshRate getRefreshRate writeConfig loadConfig reloadConfig dumpRegister setMaxTouchPoint getMaxTouchPoint ``` -------------------------------- ### SensorQMC6310 Magnetometer Methods Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/SensorLib/keywords.txt Functions for configuring and reading data from the SensorQMC6310 magnetometer, including calibration and raw data access. ```APIDOC reset getChipID getStatus isDataReady isDataOverflow setSelfTest setMode setCtrlRegister setDataOutputRate setOverSampleRate setDownSampleRate setSign configMagnetometer setMagRange setOffset readData setDeclination readPolar getRawX getRawY getRawZ getX Y getZ getMag dumpCtrlRegister ``` -------------------------------- ### TinyGSM Library API Overview Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/TinyGSM/README.md Overview of the TinyGSM library's API, highlighting its adherence to the standard Arduino Client interface for GPRS data streams and mentioning additional functions available. ```APIDOC TinyGSM Library API: - Provides standard Arduino Client interface for GPRS data streams. - Additional functions are available, refer to examples for details. ``` -------------------------------- ### API Methods for TouchDrvFT6X36 Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/SensorLib/keywords.txt Lists the available API methods for the TouchDrvFT6X36 module, detailing their names. ```APIDOC getDeviceMode getGesture getThreshold getMonitorTime setMonitorTime getLibraryVersion interruptPolling interruptTrigger getVendorID getErrorCode ``` -------------------------------- ### API Methods for SensorLTR553 Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/SensorLib/keywords.txt Lists the available API methods for the SensorLTR553 module, detailing their names. ```APIDOC setIRQLevel enableIRQ disableIRQ psAvailable setLightSensorThreshold setLightSensorPersists setLightSensorRate enableLightSensor disableLightSensor setLightSensorGain getLightSensor setProximityPersists setProximityThreshold setProximityRate enableProximity disableProximity enablePsIndicator disablePsIndicator getProximity setPsLedPulsePeriod setPsLedDutyCycle setPsLedCurrent setPsLedPulses getPartID getRevisionID getManufacturerID ``` -------------------------------- ### API Methods for SensorDRV2605 Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/SensorLib/keywords.txt Lists the available API methods for the SensorDRV2605 module, detailing their names. ```APIDOC setWaveform selectLibrary run stop setMode setRealtimeValue useERM useLRA ``` -------------------------------- ### XL9555 I/O Expander Methods Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/SensorLib/keywords.txt Functions for interacting with the ExtensionIOXL9555 I/O expander, including pin control, port operations, and SPI communication. ```APIDOC init deinit pinMode digitalRead digitalWrite digitalToggle readPort writePort readConfig configPort update removePinEvent setPinEvent write read transferDataBits transfer9 transfer8 setBitOrder beginSPI ``` -------------------------------- ### Adafruit_NeoPixel Class Definition Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/Adafruit NeoPixel/keywords.txt Defines the main class for interacting with NeoPixel LED strips within the Adafruit ecosystem. ```APIDOC Class: Adafruit_NeoPixel ``` -------------------------------- ### Enable AT Command Dumping with StreamDebugger Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/TinyGSM/README.md To copy the entire AT command sequence exchanged with the module to the main serial port using StreamDebugger, define DUMP_AT_COMMANDS. This is useful for low-level debugging of communication issues. ```cpp #define DUMP_AT_COMMANDS ``` -------------------------------- ### API Methods for SensorCM32181 Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/SensorLib/keywords.txt Lists the available API methods for the SensorCM32181 module, detailing their names. ```APIDOC setSampling setIntThreshold powerSave getRaw getLux ``` -------------------------------- ### APIDOC: TinyGsm Module Functions Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/TinyGSM/keywords.txt Defines key methods and functions for controlling and interacting with the TinyGsm module, covering initialization, network management, GPRS connection, and device reset. ```APIDOC Functions: begin() restart() waitForNetwork() getSimStatus() gprsConnect() gprsDisconnect() isGprsConnected() isNetworkConnected() factoryReset() ``` -------------------------------- ### ESP-IDF Component Registration for Adafruit_SSD1306 Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/Adafruit SSD1306/CMakeLists.txt This CMake snippet registers the Adafruit_SSD1306 library as an ESP-IDF component. It declares the minimum CMake version, specifies the source file 'Adafruit_SSD1306.cpp', sets the current directory as an include path, and lists 'arduino' and 'Adafruit-GFX-Library' as required dependencies. Finally, it names the project 'Adafruit_SSD1306'. ```CMake cmake_minimum_required(VERSION 3.5) idf_component_register(SRCS "Adafruit_SSD1306.cpp" INCLUDE_DIRS "." REQUIRES arduino Adafruit-GFX-Library) project(Adafruit_SSD1306) ``` -------------------------------- ### API Methods for TouchDrvCSTXXX Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/SensorLib/keywords.txt Lists the available API methods for the TouchDrvCSTXXX module, detailing their names. ```APIDOC setCenterButtonCoordinate setHomeButtonCallback disableAutoSleep enableAutoSleep setSwapXY setMirrorXY setMaxCoordinates ``` -------------------------------- ### PubSubClient 1.1: Library Size Reduction and Will Messages Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/pubsubclient/CHANGES.txt Version 1.1 reduces the library size, adds support for MQTT Will messages, and clarifies licensing information. ```APIDOC PubSubClient Improvements: Reduced size of library Added support for Will messages Clarified licensing - see LICENSE.txt ``` -------------------------------- ### PubSubClient 1.4: Connection Lost Handling Fix Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/pubsubclient/CHANGES.txt Version 1.4 addresses and fixes issues related to handling lost connections. ```APIDOC PubSubClient Connection Handling: Fixed connection lost handling ``` -------------------------------- ### Connect TinyGSM Client to TCP or SSL Server Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/TinyGSM/README.md Shows the command to connect the TinyGSM client instance to a specified server and port for TCP or SSL communication. ```C++ client.connect(server, port) ``` -------------------------------- ### CMake Configuration for Adafruit Bus IO Library Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/Adafruit BusIO/CMakeLists.txt This CMake snippet defines the minimum required CMake version (3.5) and registers the Adafruit Bus IO library as an ESP-IDF component. It specifies the source files (Adafruit_I2CDevice.cpp, Adafruit_BusIO_Register.cpp, Adafruit_SPIDevice.cpp), sets the current directory as an include path, and declares a dependency on the 'arduino' component. Finally, it sets the project name to 'Adafruit_BusIO'. ```CMake cmake_minimum_required(VERSION 3.5) idf_component_register(SRCS "Adafruit_I2CDevice.cpp" "Adafruit_BusIO_Register.cpp" "Adafruit_SPIDevice.cpp" INCLUDE_DIRS "." REQUIRES arduino) project(Adafruit_BusIO) ``` -------------------------------- ### PubSubClient 1.0: Initial Release Features and Limitations Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/pubsubclient/CHANGES.txt Version 1.0, the initial release, supports Quality of Service (QoS) 0 messaging, has a maximum message size of 128 bytes, a fixed keepalive interval of 30 seconds, and no support for Will messages. ```APIDOC PubSubClient 1.0 Features and Limitations: Quality of Service (QOS) 0 messaging is supported Maximum message size, including header, is 128 bytes Keepalive interval is set to 30 seconds No support for Will messages ``` -------------------------------- ### PubSubClient 2.7: Large Payload API and Reliability Improvements Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/pubsubclient/CHANGES.txt Version 2.7 addresses buffer overrun issues and introduces a new API for handling large MQTT payloads. It also enhances reliability on ESP platforms with yield calls and adds support for the Clean Session flag and functional callback signatures for ESP32. ```APIDOC PubSubClient Large Payload API: beginPublish(topic, payloadSize, retained) write(data) publish() endPublish() MQTT Options: Add Clean Session flag to connect options Reliability: Add yield call to improve reliability on ESP Callbacks: Add ESP32 support for functional callback signature Fixes: Fix remaining-length handling to prevent buffer overrun ``` -------------------------------- ### API Methods for TouchDrvCST92xx Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/SensorLib/keywords.txt Lists the available API methods for the TouchDrvCST92xx module, detailing their names. ```APIDOC jumpCheck setCoverScreenCallback ``` -------------------------------- ### PubSubClient API Element Definitions Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/pubsubclient/keywords.txt This snippet lists the core API elements of the PubSubClient library, categorizing them into datatypes, methods/functions, and constants. It serves as a reference for the library's exposed interface. ```APIDOC PubSubClient API Elements: Datatypes: - PubSubClient Methods and Functions: - connect() - disconnect() - publish() - publish_P() - beginPublish() - endPublish() - write() - subscribe() - unsubscribe() - loop() - connected() - setServer() - setCallback() - setClient() - setStream() - setKeepAlive() - setBufferSize() - setSocketTimeout() Constants: (No specific constants listed) ``` -------------------------------- ### API Methods for TouchDrvCHSC5816 Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/SensorLib/keywords.txt Lists the available API methods for the TouchDrvCHSC5816 module, detailing their names. ```APIDOC getPoint isPressed getModelName sleep wakeup idle getSupportTouchPoint getResolution setGpioCallback ``` -------------------------------- ### HttpClient Library Datatypes Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/ArduinoHttpClient/keywords.txt Lists the core data types or classes provided by the HttpClient, ArduinoHttpClient, WebSocketClient, and URLEncoder libraries, categorized as KEYWORD1. ```APIDOC ArduinoHttpClient HttpClient WebSocketClient URLEncoder ``` -------------------------------- ### Adafruit NeoPixel Library Core Functions Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/Adafruit NeoPixel/README.md A list of the primary functions available in the Adafruit NeoPixel library for managing and controlling LED pixels and strips, including initialization, color setting, brightness control, and display updates. ```APIDOC begin() updateLength() updateType() show() delay_ns() setPin() setPixelColor() fill() ColorHSV() getPixelColor() setBrightness() getBrightness() clear() gamma32() ``` -------------------------------- ### PubSubClient 2.2: Arduino Library Layout Compliance Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/pubsubclient/CHANGES.txt Version 2.2 updates the code layout to meet Arduino Library requirements. ```APIDOC Code Layout: Changed code layout to match Arduino Library requirements ``` -------------------------------- ### APIDOC: Date/Time Literals Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/TinyGSM/keywords.txt Enumerates predefined literal values used for specifying different date and time formats. ```APIDOC Literals: DATE_FULL DATE_TIME DATE_DATE ``` -------------------------------- ### SensorBMM150 Magnetometer Methods Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/SensorLib/keywords.txt Functions for managing the SensorBMM150 magnetometer, including power modes and interrupt configuration. ```APIDOC sleep setMode setThreshold setInterruptLevel enabledDataReady disabledDataReady isLowThreshold isHighThreshold ``` -------------------------------- ### Adafruit_NeoPixel Constants Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/Adafruit NeoPixel/keywords.txt Enumerates constants used for configuring NeoPixel behavior, such as color order masks, speed masks, and specific color order definitions for various LED types. ```APIDOC Constants: NEO_COLMASK NEO_SPDMASK NEO_KHZ800 NEO_KHZ400 NEO_RGB NEO_RBG NEO_GRB NEO_GBR NEO_BRG NEO_BGR NEO_WRGB NEO_WRBG NEO_WGRB NEO_WGBR NEO_WBRG NEO_WBGR NEO_RWGB NEO_RWBG NEO_RGWB NEO_RGBW NEO_RBWG NEO_RBGW NEO_GWRB NEO_GWBR NEO_GRWB NEO_GRBW NEO_GBWR NEO_GBRW NEO_BWRG NEO_BWGR NEO_BRWG NEO_BRGW NEO_BGWR NEO_BGRW ``` -------------------------------- ### Integrate StreamDebugger for Conditional AT Command Logging Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/TinyGSM/README.md This C++ snippet demonstrates how to conditionally include and initialize StreamDebugger in custom code. When DUMP_AT_COMMANDS is defined, it logs AT commands to SerialMon; otherwise, it initializes TinyGsm directly. This allows flexible debugging without modifying core code. ```cpp #ifdef DUMP_AT_COMMANDS #include StreamDebugger debugger(SerialAT, SerialMon); TinyGsm modem(debugger); #else TinyGsm modem(SerialAT); #endif ``` -------------------------------- ### Retrieve Sensor Capabilities with Unified Driver (C++) Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/Adafruit Unified Sensor/README.md Shows how to query the basic technical capabilities of a sensor, such as its name, driver version, unique ID, maximum and minimum values, and resolution, using the `sensor_t` structure and `getSensor` method. ```c++ sensor_t sensor; sensor_t sensor; tsl.getSensor(&sensor); /* Display the sensor details */ Serial.println("------------------------------------"); Serial.print ("Sensor: "); Serial.println(sensor.name); Serial.print ("Driver Ver: "); Serial.println(sensor.version); Serial.print ("Unique ID: "); Serial.println(sensor.sensor_id); Serial.print ("Max Value: "); Serial.print(sensor.max_value); Serial.println(" lux"); Serial.print ("Min Value: "); Serial.print(sensor.min_value); Serial.println(" lux"); Serial.print ("Resolution: "); Serial.print(sensor.resolution); Serial.println(" lux"); Serial.println("------------------------------------"); Serial.println(""); ``` -------------------------------- ### PubSubClient 1.2: Compile Error Fix for Older Arduino Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/pubsubclient/CHANGES.txt Version 1.2 fixes compile errors when the library is used with Arduino 0016 or later versions. ```APIDOC PubSubClient Compatibility: Fixed compile error when used with arduino-0016 or later ``` -------------------------------- ### PubSubClient 1.7: Keepalive and Arduino API Updates Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/pubsubclient/CHANGES.txt Version 1.7 improves keepalive handling and updates the library to the Arduino-1.0 API. ```APIDOC PubSubClient Improvements: Improved keepalive handling Updated to the Arduino-1.0 API ``` -------------------------------- ### Ensuring Blank Line for HTTP POST Content in C++ Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/TinyGSM/README.md This snippet demonstrates how to correctly add the required blank line between HTTP headers and the content body of a POST request. This is a crucial HTTP requirement often missed, and can be achieved by adding two carriage return/newline pairs or an extra `client.println()`. ```cpp client.print("....\r\n\r\n") ``` ```cpp client.println() ``` -------------------------------- ### PubSubClient 1.6: Retained Message Publishing Capability Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/pubsubclient/CHANGES.txt Version 1.6 adds the ability to publish MQTT messages with the retained flag. ```APIDOC PubSubClient Publishing: Added the ability to publish a retained message ``` -------------------------------- ### PubSubClient 2.3: Retained Message Publishing Source: https://github.com/xinyuan-lilygo/lilygo-t-a76xx/blob/main/lib/pubsubclient/CHANGES.txt Version 2.3 adds a new function to publish MQTT messages with the retained flag. ```APIDOC PubSubClient Publish Function: publish(topic, payload, retained): Publishes a message with the retained flag ```