├── LICENSE ├── README.md ├── examples ├── Commons │ └── ESP32LiteDebugGPIO │ │ └── ESP32LiteDebugGPIO.ino ├── M5Lite │ ├── M5LiteBasic │ │ └── M5LiteBasic.ino │ ├── M5LiteI2CScan │ │ └── M5LiteI2CScan.ino │ ├── M5LiteSD │ │ └── M5LiteSD.ino │ ├── M5LiteScreenshot │ │ └── M5LiteScreenshot.ino │ └── M5LiteSound │ │ └── M5LiteSound.ino └── Quick │ └── M5Stack │ ├── Core │ ├── M5AtomEcho │ │ └── M5AtomEcho.ino │ ├── M5AtomLite │ │ └── M5AtomLite.ino │ ├── M5AtomMatrix │ │ └── M5AtomMatrix.ino │ └── M5StickC │ │ └── M5StickC.ino │ └── Unit │ ├── ANGLE │ └── ANGLE.ino │ ├── DAC │ └── DAC.ino │ ├── EXT_IO │ └── EXT_IO.ino │ ├── HEART │ └── HEART.ino │ ├── NCIR │ └── NCIR.ino │ ├── RGB │ └── RGB.ino │ └── TOF │ └── TOF.ino ├── keywords.txt ├── library.properties └── src ├── ESP32LiteDebugGPIO.h ├── I2C_BMA423.h ├── I2C_BMA423_config.h ├── I2C_IP5306.h ├── I2C_SH200Q.h ├── M5Lite.h ├── M5LiteAXP192.h ├── M5LiteButton.h ├── M5LiteCommUtil.h ├── M5LiteDebug.h ├── M5LiteEx.h ├── M5LiteIMU.h ├── M5LiteLED.h ├── M5LiteMPU6886.h ├── M5LitePower.h ├── M5LiteRTC.h ├── M5LiteSH200Q.h ├── M5LiteSound.h ├── M5LiteSpeaker.h └── M5LiteTouch.h /LICENSE: -------------------------------------------------------------------------------- 1 | Creative Commons Legal Code 2 | 3 | CC0 1.0 Universal 4 | 5 | CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE 6 | LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN 7 | ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS 8 | INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES 9 | REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS 10 | PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM 11 | THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED 12 | HEREUNDER. 13 | 14 | Statement of Purpose 15 | 16 | The laws of most jurisdictions throughout the world automatically confer 17 | exclusive Copyright and Related Rights (defined below) upon the creator 18 | and subsequent owner(s) (each and all, an "owner") of an original work of 19 | authorship and/or a database (each, a "Work"). 20 | 21 | Certain owners wish to permanently relinquish those rights to a Work for 22 | the purpose of contributing to a commons of creative, cultural and 23 | scientific works ("Commons") that the public can reliably and without fear 24 | of later claims of infringement build upon, modify, incorporate in other 25 | works, reuse and redistribute as freely as possible in any form whatsoever 26 | and for any purposes, including without limitation commercial purposes. 27 | These owners may contribute to the Commons to promote the ideal of a free 28 | culture and the further production of creative, cultural and scientific 29 | works, or to gain reputation or greater distribution for their Work in 30 | part through the use and efforts of others. 31 | 32 | For these and/or other purposes and motivations, and without any 33 | expectation of additional consideration or compensation, the person 34 | associating CC0 with a Work (the "Affirmer"), to the extent that he or she 35 | is an owner of Copyright and Related Rights in the Work, voluntarily 36 | elects to apply CC0 to the Work and publicly distribute the Work under its 37 | terms, with knowledge of his or her Copyright and Related Rights in the 38 | Work and the meaning and intended legal effect of CC0 on those rights. 39 | 40 | 1. Copyright and Related Rights. A Work made available under CC0 may be 41 | protected by copyright and related or neighboring rights ("Copyright and 42 | Related Rights"). Copyright and Related Rights include, but are not 43 | limited to, the following: 44 | 45 | i. the right to reproduce, adapt, distribute, perform, display, 46 | communicate, and translate a Work; 47 | ii. moral rights retained by the original author(s) and/or performer(s); 48 | iii. publicity and privacy rights pertaining to a person's image or 49 | likeness depicted in a Work; 50 | iv. rights protecting against unfair competition in regards to a Work, 51 | subject to the limitations in paragraph 4(a), below; 52 | v. rights protecting the extraction, dissemination, use and reuse of data 53 | in a Work; 54 | vi. database rights (such as those arising under Directive 96/9/EC of the 55 | European Parliament and of the Council of 11 March 1996 on the legal 56 | protection of databases, and under any national implementation 57 | thereof, including any amended or successor version of such 58 | directive); and 59 | vii. other similar, equivalent or corresponding rights throughout the 60 | world based on applicable law or treaty, and any national 61 | implementations thereof. 62 | 63 | 2. Waiver. To the greatest extent permitted by, but not in contravention 64 | of, applicable law, Affirmer hereby overtly, fully, permanently, 65 | irrevocably and unconditionally waives, abandons, and surrenders all of 66 | Affirmer's Copyright and Related Rights and associated claims and causes 67 | of action, whether now known or unknown (including existing as well as 68 | future claims and causes of action), in the Work (i) in all territories 69 | worldwide, (ii) for the maximum duration provided by applicable law or 70 | treaty (including future time extensions), (iii) in any current or future 71 | medium and for any number of copies, and (iv) for any purpose whatsoever, 72 | including without limitation commercial, advertising or promotional 73 | purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each 74 | member of the public at large and to the detriment of Affirmer's heirs and 75 | successors, fully intending that such Waiver shall not be subject to 76 | revocation, rescission, cancellation, termination, or any other legal or 77 | equitable action to disrupt the quiet enjoyment of the Work by the public 78 | as contemplated by Affirmer's express Statement of Purpose. 79 | 80 | 3. Public License Fallback. Should any part of the Waiver for any reason 81 | be judged legally invalid or ineffective under applicable law, then the 82 | Waiver shall be preserved to the maximum extent permitted taking into 83 | account Affirmer's express Statement of Purpose. In addition, to the 84 | extent the Waiver is so judged Affirmer hereby grants to each affected 85 | person a royalty-free, non transferable, non sublicensable, non exclusive, 86 | irrevocable and unconditional license to exercise Affirmer's Copyright and 87 | Related Rights in the Work (i) in all territories worldwide, (ii) for the 88 | maximum duration provided by applicable law or treaty (including future 89 | time extensions), (iii) in any current or future medium and for any number 90 | of copies, and (iv) for any purpose whatsoever, including without 91 | limitation commercial, advertising or promotional purposes (the 92 | "License"). The License shall be deemed effective as of the date CC0 was 93 | applied by Affirmer to the Work. Should any part of the License for any 94 | reason be judged legally invalid or ineffective under applicable law, such 95 | partial invalidity or ineffectiveness shall not invalidate the remainder 96 | of the License, and in such case Affirmer hereby affirms that he or she 97 | will not (i) exercise any of his or her remaining Copyright and Related 98 | Rights in the Work or (ii) assert any associated claims and causes of 99 | action with respect to the Work, in either case contrary to Affirmer's 100 | express Statement of Purpose. 101 | 102 | 4. Limitations and Disclaimers. 103 | 104 | a. No trademark or patent rights held by Affirmer are waived, abandoned, 105 | surrendered, licensed or otherwise affected by this document. 106 | b. Affirmer offers the Work as-is and makes no representations or 107 | warranties of any kind concerning the Work, express, implied, 108 | statutory or otherwise, including without limitation warranties of 109 | title, merchantability, fitness for a particular purpose, non 110 | infringement, or the absence of latent or other defects, accuracy, or 111 | the present or absence of errors, whether or not discoverable, all to 112 | the greatest extent permissible under applicable law. 113 | c. Affirmer disclaims responsibility for clearing rights of other persons 114 | that may apply to the Work or any use thereof, including without 115 | limitation any person's Copyright and Related Rights in the Work. 116 | Further, Affirmer disclaims responsibility for obtaining any necessary 117 | consents, permissions or other rights required for any use of the 118 | Work. 119 | d. Affirmer understands and acknowledges that Creative Commons is not a 120 | party to this document and has no duty or obligation with respect to 121 | this CC0 or use of the Work. 122 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ESP32 Lite Pack Library 2 | 3 | A lightweight compatibility library. You can use any combination of libraries. 4 | 5 | ## Usage library 6 | 7 | ### LovyanGFX(like M5Display) 8 | https://github.com/lovyan03/LovyanGFX 9 | 10 | ### FastLED 11 | https://github.com/FastLED/FastLED 12 | 13 | ### I2C_AXP192(like AXP192) 14 | https://github.com/tanakamasayuki/I2C_AXP192 15 | 16 | ### I2C_BM8563(like RTC) 17 | https://github.com/tanakamasayuki/I2C_BM8563 18 | 19 | ### I2C_MPU6886(like MPU6886) 20 | https://github.com/tanakamasayuki/I2C_MPU6886 21 | 22 | ## Support Devices 23 | 24 | - [M5StickC](https://docs.m5stack.com/#/en/core/m5stickc) 25 | - [M5StickC Plus](https://docs.m5stack.com/#/en/core/m5stickc_plus) 26 | - [M5Stack BASIC](https://docs.m5stack.com/#/en/core/basic) 27 | - [M5Stack GRAY](https://docs.m5stack.com/#/en/core/gray) 28 | - [M5Stack FIRE](https://docs.m5stack.com/#/en/core/fire) 29 | - [M5Stack CORE2](https://docs.m5stack.com/#/en/core/core2) 30 | - [M5Stack ATOM Lite](https://docs.m5stack.com/#/en/core/atom_lite) 31 | - [M5Stack ATOM Matrix](https://docs.m5stack.com/#/en/core/atom_matrix) 32 | - [M5Stack ATOM ECHO](https://docs.m5stack.com/#/en/atom/atomecho) 33 | 34 | ## Usage 35 | ```c 36 | #include // Define before M5Lite 37 | #include "M5Lite.h" 38 | 39 | void setup() { 40 | M5Lite.begin(); 41 | M5Lite.Axp.ScreenBreath(10); 42 | 43 | M5Lite.Imu.Init(); 44 | 45 | M5Lite.dis.drawpix(0, CRGB(255, 0, 0)); 46 | M5Lite.dis.drawpix(2, CRGB(0, 255, 0)); 47 | M5Lite.dis.drawpix(4, CRGB(0, 0, 255)); 48 | M5Lite.dis.drawpix(6, CRGB::White); 49 | 50 | // Info & Help 51 | M5Lite.Debug.dispInfo(); 52 | M5Lite.Debug.dispHelp(); 53 | } 54 | 55 | void loop() { 56 | static int vol = 11; 57 | 58 | M5Lite.Lcd.setCursor(0, 4, 1); 59 | M5Lite.Lcd.printf("M5StackAuto\n"); 60 | 61 | M5Lite.Lcd.printf("Battery\n"); 62 | M5Lite.Lcd.printf(" Temp :%6.1f\n", M5Lite.Axp.GetTempInAXP192()); // AXP192 Internal temperature 63 | M5Lite.Lcd.printf(" V(V) :%6.3f\n", M5Lite.Axp.GetBatVoltage()); // Battery Voltage(3.0V-4.2V) 64 | M5Lite.Lcd.printf(" I(mA):%6.1f\n", M5Lite.Axp.GetBatCurrent()); // Battery Current(+:charge, -:decharge) 65 | 66 | M5Lite.Lcd.printf("ASP\n"); 67 | M5Lite.Lcd.printf(" V(V) :%6.3f\n", M5Lite.Axp.GetAPSVoltage()); // ESP32 Voltage 68 | 69 | M5Lite.Lcd.printf("VBus(USB)\n"); 70 | M5Lite.Lcd.printf(" V(V) :%6.3f\n", M5Lite.Axp.GetVBusVoltage()); // USB Voltage 71 | M5Lite.Lcd.printf(" I(mA):%6.1f\n", M5Lite.Axp.GetVBusCurrent()); // USB Current 72 | 73 | M5Lite.Lcd.printf("VIN(5V-In)\n"); 74 | M5Lite.Lcd.printf(" V(V) :%6.3f\n", M5Lite.Axp.GetVinVoltage()); // 5V IN Voltage 75 | M5Lite.Lcd.printf(" I(mA):%6.1f\n", M5Lite.Axp.GetVinCurrent()); // 5V IN Current 76 | 77 | if (M5Lite.Imu.imuType != 0) { 78 | float ax; 79 | float ay; 80 | float az; 81 | float gx; 82 | float gy; 83 | float gz; 84 | float t; 85 | 86 | M5Lite.Imu.getAccelData(&ax, &ay, &az); 87 | M5Lite.Imu.getGyroData(&gx, &gy, &gz); 88 | M5Lite.Imu.getTempData(&t); 89 | 90 | if (!M5Lite.Ex.useLcd) { 91 | Serial.printf(" %f,%f,%f,%f,%f,%f,%f\n", ax, ay, az, gx, gy, gz, t); 92 | } 93 | 94 | M5Lite.Lcd.printf(" Accel Gyro\n"); 95 | M5Lite.Lcd.printf("X%5.2f%7.1f\n", ax, gx); 96 | M5Lite.Lcd.printf("Y%5.2f%7.1f\n", ay, gy); 97 | M5Lite.Lcd.printf("Z%5.2f%7.1f\n", az, gz); 98 | } 99 | 100 | RTC_TimeTypeDef RTC_TimeStruct; 101 | RTC_DateTypeDef RTC_DateStruct; 102 | M5Lite.Rtc.GetTime(&RTC_TimeStruct); 103 | M5Lite.Rtc.GetData(&RTC_DateStruct); 104 | M5Lite.Lcd.printf("%04d-%02d-%02d\n", RTC_DateStruct.Year, RTC_DateStruct.Month, RTC_DateStruct.Date); 105 | M5Lite.Lcd.printf("%02d:%02d:%02d\n", RTC_TimeStruct.Hours, RTC_TimeStruct.Minutes, RTC_TimeStruct.Seconds); 106 | 107 | if (M5Lite.BtnA.wasPressed()) { 108 | Serial.println("M5Lite.BtnA.wasPressed()"); 109 | M5Lite.Beep.tone(1000, 100); 110 | } 111 | if (M5Lite.BtnB.wasPressed()) { 112 | Serial.println("M5Lite.BtnB.wasPressed()"); 113 | vol--; 114 | M5Lite.Beep.setVolume(vol); 115 | Serial.printf("vol = %d\n", vol); 116 | } 117 | if (M5Lite.BtnC.wasPressed()) { 118 | Serial.println("M5Lite.BtnC.wasPressed()"); 119 | vol++; 120 | M5Lite.Beep.setVolume(vol); 121 | Serial.printf("vol = %d\n", vol); 122 | } 123 | if (M5Lite.BtnA.wasReleased()) { 124 | Serial.println("M5Lite.BtnA.wasReleased()"); 125 | } 126 | if (M5Lite.BtnB.wasReleased()) { 127 | Serial.println("M5Lite.BtnB.wasReleased()"); 128 | } 129 | if (M5Lite.BtnC.wasReleased()) { 130 | Serial.println("M5Lite.BtnC.wasReleased()"); 131 | } 132 | if (M5Lite.Touch.enable) { 133 | TouchPoint_t p = M5Lite.Touch.getPressPoint(); 134 | M5Lite.Lcd.printf("Touch\n"); 135 | M5Lite.Lcd.printf(" X : %4d\n", p.x); 136 | M5Lite.Lcd.printf(" Y : %4d\n", p.y); 137 | } 138 | 139 | if (M5Lite.BtnA.isPressed()) { 140 | M5Lite.Ex.setLed(true); 141 | } else { 142 | M5Lite.Ex.setLed(false); 143 | } 144 | if (M5Lite.BtnB.isPressed()) { 145 | M5Lite.Ex.setVibration(true); 146 | } else { 147 | M5Lite.Ex.setVibration(false); 148 | } 149 | 150 | // delay & M5Lile.update() 151 | M5Lite.Ex.delay(100); 152 | } 153 | ``` 154 | -------------------------------------------------------------------------------- /examples/Commons/ESP32LiteDebugGPIO/ESP32LiteDebugGPIO.ino: -------------------------------------------------------------------------------- 1 | #include "M5StickC.h" 2 | #include "ESP32LiteDebugGPIO.h" 3 | 4 | void setup() { 5 | M5.begin(); 6 | delay(1000); 7 | dispGpio(); 8 | } 9 | 10 | void loop() { 11 | } 12 | -------------------------------------------------------------------------------- /examples/M5Lite/M5LiteBasic/M5LiteBasic.ino: -------------------------------------------------------------------------------- 1 | #include // Define before M5Lite 2 | #include "M5Lite.h" 3 | 4 | void setup() { 5 | M5Lite.begin(); 6 | M5Lite.Axp.ScreenBreath(10); 7 | 8 | M5Lite.Imu.Init(); 9 | 10 | M5Lite.dis.drawpix(0, CRGB(255, 0, 0)); 11 | M5Lite.dis.drawpix(2, CRGB(0, 255, 0)); 12 | M5Lite.dis.drawpix(4, CRGB(0, 0, 255)); 13 | M5Lite.dis.drawpix(6, CRGB::White); 14 | 15 | // Info & Help 16 | M5Lite.Debug.dispInfo(); 17 | M5Lite.Debug.dispHelp(); 18 | } 19 | 20 | void loop() { 21 | static int vol = 11; 22 | 23 | M5Lite.Lcd.setCursor(0, 4, 1); 24 | M5Lite.Lcd.printf("M5StackAuto\n"); 25 | 26 | M5Lite.Lcd.printf("Battery\n"); 27 | M5Lite.Lcd.printf(" Temp :%6.1f\n", M5Lite.Axp.GetTempInAXP192()); // AXP192 Internal temperature 28 | M5Lite.Lcd.printf(" V(V) :%6.3f\n", M5Lite.Axp.GetBatVoltage()); // Battery Voltage(3.0V-4.2V) 29 | M5Lite.Lcd.printf(" I(mA):%6.1f\n", M5Lite.Axp.GetBatCurrent()); // Battery Current(+:charge, -:decharge) 30 | 31 | M5Lite.Lcd.printf("ASP\n"); 32 | M5Lite.Lcd.printf(" V(V) :%6.3f\n", M5Lite.Axp.GetAPSVoltage()); // ESP32 Voltage 33 | 34 | M5Lite.Lcd.printf("VBus(USB)\n"); 35 | M5Lite.Lcd.printf(" V(V) :%6.3f\n", M5Lite.Axp.GetVBusVoltage()); // USB Voltage 36 | M5Lite.Lcd.printf(" I(mA):%6.1f\n", M5Lite.Axp.GetVBusCurrent()); // USB Current 37 | 38 | M5Lite.Lcd.printf("VIN(5V-In)\n"); 39 | M5Lite.Lcd.printf(" V(V) :%6.3f\n", M5Lite.Axp.GetVinVoltage()); // 5V IN Voltage 40 | M5Lite.Lcd.printf(" I(mA):%6.1f\n", M5Lite.Axp.GetVinCurrent()); // 5V IN Current 41 | 42 | if (M5Lite.Imu.imuType != 0) { 43 | float ax; 44 | float ay; 45 | float az; 46 | float gx; 47 | float gy; 48 | float gz; 49 | float t; 50 | 51 | M5Lite.Imu.getAccelData(&ax, &ay, &az); 52 | M5Lite.Imu.getGyroData(&gx, &gy, &gz); 53 | M5Lite.Imu.getTempData(&t); 54 | 55 | if (!M5Lite.Ex.useLcd) { 56 | Serial.printf(" %f,%f,%f,%f,%f,%f,%f\n", ax, ay, az, gx, gy, gz, t); 57 | } 58 | 59 | M5Lite.Lcd.printf(" Accel Gyro\n"); 60 | M5Lite.Lcd.printf("X%5.2f%7.1f\n", ax, gx); 61 | M5Lite.Lcd.printf("Y%5.2f%7.1f\n", ay, gy); 62 | M5Lite.Lcd.printf("Z%5.2f%7.1f\n", az, gz); 63 | } 64 | 65 | RTC_TimeTypeDef RTC_TimeStruct; 66 | RTC_DateTypeDef RTC_DateStruct; 67 | M5Lite.Rtc.GetTime(&RTC_TimeStruct); 68 | M5Lite.Rtc.GetData(&RTC_DateStruct); 69 | M5Lite.Lcd.printf("%04d-%02d-%02d\n", RTC_DateStruct.Year, RTC_DateStruct.Month, RTC_DateStruct.Date); 70 | M5Lite.Lcd.printf("%02d:%02d:%02d\n", RTC_TimeStruct.Hours, RTC_TimeStruct.Minutes, RTC_TimeStruct.Seconds); 71 | 72 | if (M5Lite.BtnA.wasPressed()) { 73 | Serial.println("M5Lite.BtnA.wasPressed()"); 74 | M5Lite.Beep.tone(1000, 100); 75 | } 76 | if (M5Lite.BtnB.wasPressed()) { 77 | Serial.println("M5Lite.BtnB.wasPressed()"); 78 | vol--; 79 | M5Lite.Beep.setVolume(vol); 80 | Serial.printf("vol = %d\n", vol); 81 | } 82 | if (M5Lite.BtnC.wasPressed()) { 83 | Serial.println("M5Lite.BtnC.wasPressed()"); 84 | vol++; 85 | M5Lite.Beep.setVolume(vol); 86 | Serial.printf("vol = %d\n", vol); 87 | } 88 | if (M5Lite.BtnA.wasReleased()) { 89 | Serial.println("M5Lite.BtnA.wasReleased()"); 90 | } 91 | if (M5Lite.BtnB.wasReleased()) { 92 | Serial.println("M5Lite.BtnB.wasReleased()"); 93 | } 94 | if (M5Lite.BtnC.wasReleased()) { 95 | Serial.println("M5Lite.BtnC.wasReleased()"); 96 | } 97 | if (M5Lite.Touch.enable) { 98 | TouchPoint_t p = M5Lite.Touch.getPressPoint(); 99 | M5Lite.Lcd.printf("Touch\n"); 100 | M5Lite.Lcd.printf(" X : %4d\n", p.x); 101 | M5Lite.Lcd.printf(" Y : %4d\n", p.y); 102 | } 103 | 104 | if (M5Lite.BtnA.isPressed()) { 105 | M5Lite.Ex.setLed(true); 106 | } else { 107 | M5Lite.Ex.setLed(false); 108 | } 109 | if (M5Lite.BtnB.isPressed()) { 110 | M5Lite.Ex.setVibration(true); 111 | } else { 112 | M5Lite.Ex.setVibration(false); 113 | } 114 | 115 | // delay & M5Lile.update() 116 | M5Lite.Ex.delay(100); 117 | } 118 | -------------------------------------------------------------------------------- /examples/M5Lite/M5LiteI2CScan/M5LiteI2CScan.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | TwoWire *i2cWire; 4 | 5 | uint8_t sda = -1; 6 | uint8_t scl = -1; 7 | uint8_t i2cMode = 0; 8 | 9 | void updateI2c() { 10 | if (M5.Ex.board == lgfx::board_M5Stack) { 11 | i2cMode = 0; 12 | 13 | // Internal 14 | sda = 21; 15 | scl = 22; 16 | i2cWire = &Wire1; 17 | } else if (M5.Ex.board == lgfx::board_M5StackCore2) { 18 | // M5Stack Core2 19 | if (i2cMode == 1) { 20 | // GROVE 21 | sda = 32; 22 | scl = 33; 23 | Wire.begin(sda, scl); 24 | i2cWire = &Wire; 25 | } else { 26 | i2cMode = 0; 27 | 28 | // Internal 29 | sda = 21; 30 | scl = 22; 31 | i2cWire = &Wire1; 32 | } 33 | } else if (M5.Ex.board == lgfx::board_M5StickC || M5.Ex.board == lgfx::board_M5StickCPlus) { 34 | // M5StickC 35 | if (i2cMode == 1) { 36 | // GROVE 37 | sda = 32; 38 | scl = 33; 39 | Wire.begin(sda, scl); 40 | i2cWire = &Wire; 41 | } else if (i2cMode == 2) { 42 | // PIN Header 43 | sda = 0; 44 | scl = 26; 45 | Wire.begin(sda, scl); 46 | i2cWire = &Wire; 47 | } else { 48 | i2cMode = 0; 49 | 50 | // Internal 51 | sda = 21; 52 | scl = 22; 53 | i2cWire = &Wire1; 54 | } 55 | } else if (M5.Ex.board == lgfx::board_TTGO_TWatch) { 56 | i2cMode = 0; 57 | 58 | // Internal 59 | sda = 21; 60 | scl = 22; 61 | i2cWire = &Wire1; 62 | } else if (M5.Ex.board == lgfx::board_unknown) { 63 | // ATOM 64 | if (i2cMode == 1) { 65 | // GROVE 66 | sda = 26; 67 | scl = 32; 68 | Wire.begin(sda, scl); 69 | i2cWire = &Wire; 70 | } else { 71 | i2cMode = 0; 72 | 73 | // Internal 74 | sda = 21; 75 | scl = 25; 76 | i2cWire = &Wire1; 77 | } 78 | } 79 | } 80 | 81 | void setup() { 82 | M5.begin(); 83 | M5.Lcd.fillScreen(BLACK); 84 | } 85 | 86 | void loop() { 87 | M5.Lcd.fillScreen(BLACK); 88 | M5.Lcd.setCursor(0, 0); 89 | 90 | M5.Lcd.printf("I2C Scan\n"); 91 | Serial.printf("===================\n"); 92 | Serial.printf("I2C Scan\n"); 93 | 94 | i2cMode = 0; 95 | updateI2c(); 96 | 97 | while (1) { 98 | M5.Lcd.println(); 99 | M5.Lcd.printf("SDA:%2d SCL:%2d\n", sda, scl); 100 | Serial.println(); 101 | Serial.printf("SDA:%2d SCL:%2d\n", sda, scl); 102 | 103 | for (byte address = 0; address <= 127; address++) { 104 | i2cWire->beginTransmission(address); 105 | byte error = i2cWire->endTransmission(); 106 | if (error == 0) { 107 | M5.Lcd.printf("%02X ", address); 108 | Serial.printf("%02X ", address); 109 | } else { 110 | if (240 <= M5.Lcd.width()) { 111 | M5.Lcd.print(".. "); 112 | if (address % 16 == 15) { 113 | M5.Lcd.println(); 114 | } 115 | } 116 | } 117 | delay(1); 118 | } 119 | 120 | M5.Lcd.println(); 121 | Serial.println(); 122 | 123 | i2cMode++; 124 | updateI2c(); 125 | if (i2cMode == 0) { 126 | break; 127 | } 128 | } 129 | 130 | delay(3000); 131 | } 132 | -------------------------------------------------------------------------------- /examples/M5Lite/M5LiteSD/M5LiteSD.ino: -------------------------------------------------------------------------------- 1 | #include "M5Lite.h" 2 | 3 | SPIClass SPI_EXT; 4 | 5 | void setup() { 6 | M5Lite.begin(); 7 | 8 | if (M5.Ex.board == lgfx::board_M5Stack) { 9 | // AutoStart 10 | } else if (M5.Ex.board == lgfx::board_M5StackCore2) { 11 | // AutoStart 12 | } else if (M5.Ex.board == lgfx::board_M5StickC) { 13 | // SD M5StickC 14 | // 3V3 3V3 15 | // GND GND 16 | // CLK GPIO0 17 | // MISO GPIO38 18 | // MOSI GPIO26 19 | // CS GND 20 | SPI_EXT.begin(0, 36, 26, -1); 21 | SD.begin(-1, SPI_EXT); 22 | } else if (M5.Ex.board == lgfx::board_M5StickCPlus) { 23 | // SD M5StickC 24 | // 3V3 3V3 25 | // GND GND 26 | // CLK GPIO0 27 | // MISO GPIO38 28 | // MOSI GPIO26 29 | // CS GND 30 | SPI_EXT.begin(0, 36, 26, -1); 31 | SD.begin(-1, SPI_EXT); 32 | } else if (M5.Ex.board == lgfx::board_unknown) { 33 | // SD ATOM(Lite, Matrix) Doesn't work with Echo! 34 | // 3V3 3V3 35 | // GND GND 36 | // CLK GPIO23 37 | // MISO GPIO33 38 | // MOSI GPIO19 39 | // CS GND 40 | SPI_EXT.begin(23, 33, 19, -1); 41 | SD.begin(-1, SPI_EXT); 42 | } 43 | } 44 | 45 | void loop() { 46 | M5Lite.Lcd.setCursor(0, 0, 1); 47 | M5Lite.Lcd.println("M5LiteSD"); 48 | M5Lite.Lcd.println(millis()); 49 | 50 | // delay & M5Lile.update() 51 | M5Lite.Ex.delay(100); 52 | } 53 | -------------------------------------------------------------------------------- /examples/M5Lite/M5LiteScreenshot/M5LiteScreenshot.ino: -------------------------------------------------------------------------------- 1 | //#include // Define before M5Lite 2 | #include "M5Lite.h" 3 | 4 | void setup() { 5 | M5Lite.begin(); 6 | 7 | M5Lite.Lcd.setCursor(0, 0, 1); 8 | M5Lite.Lcd.println("M5Lite"); 9 | M5Lite.Lcd.println("Screenshot"); 10 | 11 | M5Lite.Ex.screenshot(SD, "/screenshot.bmp"); 12 | } 13 | 14 | void loop() { 15 | // delay & M5Lile.update() 16 | M5Lite.Ex.delay(100); 17 | } 18 | -------------------------------------------------------------------------------- /examples/Quick/M5Stack/Core/M5AtomEcho/M5AtomEcho.ino: -------------------------------------------------------------------------------- 1 | #include // http://librarymanager/All#M5Atom https://github.com/m5stack/M5Atom 2 | #include // http://librarymanager/All#FastLED https://github.com/FastLED/FastLED 3 | #include 4 | 5 | #define CONFIG_I2S_BCK_PIN 19 6 | #define CONFIG_I2S_LRCK_PIN 33 7 | #define CONFIG_I2S_DATA_PIN 22 8 | #define CONFIG_I2S_DATA_IN_PIN 23 9 | 10 | #define SPEAKER_I2S_NUMBER I2S_NUM_0 11 | 12 | #define MODE_MIC 0 13 | #define MODE_SPK 1 14 | 15 | void InitI2SSpeakerOrMic(int mode) 16 | { 17 | esp_err_t err = ESP_OK; 18 | 19 | i2s_driver_uninstall(SPEAKER_I2S_NUMBER); 20 | i2s_config_t i2s_config = { 21 | .mode = (i2s_mode_t)(I2S_MODE_MASTER), 22 | .sample_rate = 16000, 23 | .bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT, 24 | .channel_format = I2S_CHANNEL_FMT_ALL_RIGHT, 25 | .communication_format = I2S_COMM_FORMAT_I2S, 26 | .intr_alloc_flags = ESP_INTR_FLAG_LEVEL1, 27 | .dma_buf_count = 6, 28 | .dma_buf_len = 60, 29 | .use_apll = false, 30 | .tx_desc_auto_clear = true, 31 | .fixed_mclk = 0 32 | }; 33 | if (mode == MODE_MIC){ 34 | i2s_config.mode = (i2s_mode_t)(I2S_MODE_MASTER | I2S_MODE_RX | I2S_MODE_PDM); 35 | }else{ 36 | i2s_config.mode = (i2s_mode_t)(I2S_MODE_MASTER | I2S_MODE_TX); 37 | } 38 | 39 | err += i2s_driver_install(SPEAKER_I2S_NUMBER, &i2s_config, 0, NULL); 40 | 41 | i2s_pin_config_t tx_pin_config = { 42 | .bck_io_num = CONFIG_I2S_BCK_PIN, 43 | .ws_io_num = CONFIG_I2S_LRCK_PIN, 44 | .data_out_num = CONFIG_I2S_DATA_PIN, 45 | .data_in_num = CONFIG_I2S_DATA_IN_PIN, 46 | }; 47 | err += i2s_set_pin(SPEAKER_I2S_NUMBER, &tx_pin_config); 48 | 49 | if (mode != MODE_MIC) { 50 | err += i2s_set_clk(SPEAKER_I2S_NUMBER, 16000, I2S_BITS_PER_SAMPLE_16BIT, I2S_CHANNEL_MONO); 51 | } 52 | 53 | i2s_zero_dma_buffer(SPEAKER_I2S_NUMBER); 54 | } 55 | 56 | void setup() { 57 | // 初期化 58 | M5.begin(true, false, true); // (Serial, I2C, NeoPixel) 59 | 60 | // GPIO初期化 61 | pinMode(21, INPUT); // PIN (INPUT, OUTPUT, )I2C, UART利用不可 62 | pinMode(25, INPUT); // PIN (INPUT, OUTPUT, ANALOG)I2C, UART利用不可, 無線利用時にはANALOG利用不可 63 | pinMode(26, INPUT); // GROVE(INPUT, OUTPUT, ANALOG)無線利用時にはANALOG利用不可, DAC出力可 64 | pinMode(32, INPUT); // GROVE(INPUT, OUTPUT, ANALOG) 65 | 66 | // 内部ピン初期化 67 | pinMode(12, OUTPUT_OPEN_DRAIN); // IR赤外線(LOWで出力) 68 | digitalWrite(12, HIGH); 69 | 70 | // LED(0固定) 71 | M5.dis.drawpix(0, CRGB::Red); 72 | 73 | // MICで初期化 74 | InitI2SSpeakerOrMic(MODE_MIC); 75 | } 76 | 77 | void loop() { 78 | // ボタンの状態更新 79 | M5.update(); 80 | 81 | if (M5.Btn.wasPressed()) { 82 | // ボタンが押された 83 | Serial.println("Btnが押された"); 84 | } 85 | 86 | // ウエイト(1以上推奨) 87 | delay(1); 88 | } 89 | -------------------------------------------------------------------------------- /examples/Quick/M5Stack/Core/M5AtomLite/M5AtomLite.ino: -------------------------------------------------------------------------------- 1 | #include // http://librarymanager/All#M5Atom https://github.com/m5stack/M5Atom 2 | #include // http://librarymanager/All#FastLED https://github.com/FastLED/FastLED 3 | 4 | void setup() { 5 | // 初期化 6 | M5.begin(true, false, true); // (Serial, I2C, NeoPixel) 7 | 8 | // GPIO初期化 9 | pinMode(22, INPUT); // PIN (INPUT, OUTPUT, ) 10 | pinMode(19, INPUT); // PIN (INPUT, OUTPUT, ) 11 | pinMode(23, INPUT); // PIN (INPUT, OUTPUT, ) 12 | pinMode(33, INPUT); // PIN (INPUT, OUTPUT, ANALOG) 13 | pinMode(21, INPUT); // PIN (INPUT, OUTPUT, ) 14 | pinMode(25, INPUT); // PIN (INPUT, OUTPUT, ANALOG)無線利用時にはANALOG利用不可 15 | pinMode(26, INPUT); // GROVE(INPUT, OUTPUT, ANALOG)無線利用時にはANALOG利用不可, DAC出力可 16 | pinMode(32, INPUT); // GROVE(INPUT, OUTPUT, ANALOG) 17 | 18 | // 内部ピン初期化 19 | pinMode(12, OUTPUT_OPEN_DRAIN); // IR赤外線(LOWで出力) 20 | digitalWrite(12, HIGH); 21 | 22 | // LED(0固定) 23 | M5.dis.drawpix(0, CRGB::Red); 24 | } 25 | 26 | void loop() { 27 | // ボタンの状態更新 28 | M5.update(); 29 | 30 | if (M5.Btn.wasPressed()) { 31 | // ボタンが押された 32 | Serial.println("Btnが押された"); 33 | } 34 | 35 | // ウエイト(1以上推奨) 36 | delay(1); 37 | } 38 | -------------------------------------------------------------------------------- /examples/Quick/M5Stack/Core/M5AtomMatrix/M5AtomMatrix.ino: -------------------------------------------------------------------------------- 1 | #include // http://librarymanager/All#M5Atom https://github.com/m5stack/M5Atom 2 | #include // http://librarymanager/All#FastLED https://github.com/FastLED/FastLED 3 | 4 | void setup() { 5 | // 初期化 6 | M5.begin(true, false, true); // (Serial, I2C, NeoPixel) 7 | Wire.begin(25, 21, 10000); // 内蔵I2C 0x68(MPU6886) 8 | 9 | // GPIO初期化 10 | pinMode(22, INPUT); // PIN (INPUT, OUTPUT, ) 11 | pinMode(19, INPUT); // PIN (INPUT, OUTPUT, ) 12 | pinMode(23, INPUT); // PIN (INPUT, OUTPUT, ) 13 | pinMode(33, INPUT); // PIN (INPUT, OUTPUT, ANALOG) 14 | pinMode(26, INPUT); // GROVE(INPUT, OUTPUT, ANALOG)無線利用時にはANALOG利用不可, DAC出力可 15 | pinMode(32, INPUT); // GROVE(INPUT, OUTPUT, ANALOG) 16 | 17 | // 内部ピン初期化 18 | pinMode(12, OUTPUT_OPEN_DRAIN); // IR赤外線(LOWで出力) 19 | digitalWrite(12, HIGH); 20 | 21 | // LED(0-24) 22 | for (int i = 0; i < 25; i++) { 23 | M5.dis.drawpix(i, CRGB::Red); 24 | } 25 | } 26 | 27 | void loop() { 28 | // ボタンの状態更新 29 | M5.update(); 30 | 31 | if (M5.Btn.wasPressed()) { 32 | // ボタンが押された 33 | Serial.println("Btnが押された"); 34 | } 35 | 36 | // ウエイト(1以上推奨) 37 | delay(1); 38 | } 39 | -------------------------------------------------------------------------------- /examples/Quick/M5Stack/Core/M5StickC/M5StickC.ino: -------------------------------------------------------------------------------- 1 | #include // http://librarymanager/All#M5StickC https://github.com/m5stack/M5StickC 2 | 3 | void setup() { 4 | // 初期化 5 | M5.begin(); 6 | M5.Axp.ScreenBreath(12); // 明るさ(7-12) 7 | M5.Lcd.setRotation(0); // 画面方向(0:縦, 1:ボタンB上, 2:逆さ, 3:ボタンB下) 8 | M5.Lcd.setTextSize(1); // 文字サイズ(1-7) 元の高さの倍数 9 | M5.Lcd.setTextColor(WHITE, BLACK); // (文字色, 背景色)同じ色を指定すると背景色無し 10 | M5.Lcd.fillScreen(BLACK); // 塗りつぶし 11 | 12 | // GPIO初期化 13 | pinMode(26, INPUT); // PIN (INPUT, OUTPUT, ANALOG)無線利用時にはANALOG利用不可, DAC出力可 14 | pinMode(36, INPUT); // PIN (INPUT, , ANALOG)入力専用、INPUT_PULLUP等も不可 15 | pinMode( 0, INPUT); // PIN (INPUT, OUTPUT, )外部回路でプルアップ済み 16 | pinMode(32, INPUT); // GROVE(INPUT, OUTPUT, ANALOG) 17 | pinMode(33, INPUT); // GROVE(INPUT, OUTPUT, ANALOG) 18 | 19 | // 内部ピン初期化 20 | pinMode(9, OUTPUT_OPEN_DRAIN); // IR赤外線(LOWで出力) 21 | digitalWrite(9, HIGH); 22 | pinMode(10, OUTPUT_OPEN_DRAIN); // 赤色LED(LOWで出力) 23 | digitalWrite(10, HIGH); 24 | 25 | // タイトル描画 26 | M5.Lcd.setCursor(0, 0); 27 | M5.Lcd.printf("TITLE\n"); 28 | } 29 | 30 | void loop() { 31 | // ボタンの状態更新 32 | M5.update(); 33 | 34 | if (M5.BtnA.wasPressed()) { 35 | // ボタンAが押された 36 | Serial.println("BtnAが押された"); 37 | } 38 | if (M5.BtnB.wasPressed()) { 39 | // ボタンBが押された 40 | Serial.println("BtnBが押された"); 41 | } 42 | int btn = M5.Axp.GetBtnPress(); 43 | if (btn == 2) { 44 | // 電源ボタン(1秒以下) 45 | Serial.println("電源Btnが押された"); 46 | } else if (btn == 1) { 47 | Serial.println("電源Btnが長押し"); 48 | } 49 | 50 | // ウエイト(1以上推奨) 51 | delay(1); 52 | } 53 | -------------------------------------------------------------------------------- /examples/Quick/M5Stack/Unit/ANGLE/ANGLE.ino: -------------------------------------------------------------------------------- 1 | const int anglePin = 33; // M5StickC 2 | 3 | void setup() { 4 | Serial.begin(115200); 5 | delay(100); 6 | 7 | pinMode(anglePin, ANALOG); 8 | } 9 | 10 | void loop() { 11 | Serial.println(analogRead(anglePin)); 12 | delay(500); 13 | } 14 | -------------------------------------------------------------------------------- /examples/Quick/M5Stack/Unit/DAC/DAC.ino: -------------------------------------------------------------------------------- 1 | #include // http://librarymanager/All#Adafruit_MCP4725 https://github.com/adafruit/Adafruit_MCP4725 2 | 3 | Adafruit_MCP4725 dac; 4 | 5 | void setup() { 6 | dac.begin(0x60, &Wire); // call Wire.begin() 7 | Wire.begin(32, 33); // Re Init(M5StickC) 8 | 9 | Serial.begin(115200); 10 | delay(1000); 11 | } 12 | 13 | void loop() { 14 | dac.setVoltage(0, false, 400000L); 15 | dac.setVoltage(4095, false, 400000L); 16 | } 17 | -------------------------------------------------------------------------------- /examples/Quick/M5Stack/Unit/EXT_IO/EXT_IO.ino: -------------------------------------------------------------------------------- 1 | #include // http://librarymanager/All#TCA9534 https://github.com/hideakitai/TCA9534 2 | 3 | TCA9534 ioex; 4 | const uint8_t IOEX_ADDR = 0x27; 5 | 6 | void setup() 7 | { 8 | Serial.begin(115200); 9 | delay(2000); 10 | 11 | Wire.begin(32, 33); 12 | 13 | ioex.attach(Wire); 14 | ioex.setDeviceAddress(IOEX_ADDR); 15 | ioex.config(TCA9534::Config::IN); 16 | //ioex.polarity(TCA9534::Polarity::INVERSE); 17 | 18 | Serial.print("config : "); 19 | Serial.println(ioex.config(), HEX); 20 | Serial.print("polarity: "); 21 | Serial.println(ioex.polarity(), HEX); 22 | } 23 | 24 | void loop() 25 | { 26 | for (int i = 0; i < 8; i++) { 27 | uint8_t raw = ioex.input(i); 28 | Serial.print(raw != 0); 29 | } 30 | Serial.println(); 31 | delay(1000); 32 | } 33 | -------------------------------------------------------------------------------- /examples/Quick/M5Stack/Unit/HEART/HEART.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include "MAX30100_PulseOximeter.h" // http://librarymanager/All#MAX30100lib https://github.com/oxullo/Arduino-MAX30100 3 | 4 | #define REPORTING_PERIOD_MS 1000 5 | 6 | PulseOximeter pox; 7 | 8 | uint32_t tsLastReport = 0; 9 | 10 | // コールバック 11 | void onBeatDetected() 12 | { 13 | Serial.println("Beat!"); 14 | } 15 | 16 | void setup() 17 | { 18 | Serial.begin(115200); 19 | delay(100); 20 | Serial.print("Initializing pulse oximeter.."); 21 | 22 | Wire.begin(32, 33); // M5StickC 23 | 24 | if (!pox.begin()) { 25 | Serial.println("FAILED"); 26 | for (;;); 27 | } else { 28 | Serial.println("SUCCESS"); 29 | } 30 | 31 | // コールバック登録 32 | //pox.setOnBeatDetectedCallback(onBeatDetected); 33 | } 34 | 35 | void loop() 36 | { 37 | pox.update(); 38 | 39 | if (millis() - tsLastReport > REPORTING_PERIOD_MS) { 40 | Serial.print(pox.getHeartRate()); 41 | Serial.print(","); 42 | Serial.print(pox.getSpO2()); 43 | Serial.println(); 44 | 45 | tsLastReport = millis(); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /examples/Quick/M5Stack/Unit/NCIR/NCIR.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include // http://librarymanager/All#Adafruit_MLX90614_shop https://github.com/adafruit/Adafruit-MLX90614-Library 3 | 4 | Adafruit_MLX90614 mlx = Adafruit_MLX90614(); 5 | 6 | void setup() { 7 | Serial.begin(115200); 8 | delay(100); 9 | 10 | Wire.begin(32, 33); // M5StickC 11 | 12 | mlx.begin(); 13 | } 14 | 15 | void loop() { 16 | Serial.print(mlx.readAmbientTempC()); // 環境温度 17 | Serial.print(","); 18 | Serial.print(mlx.readObjectTempC()); // 物質温度 19 | Serial.println(); 20 | 21 | delay(100); 22 | } 23 | -------------------------------------------------------------------------------- /examples/Quick/M5Stack/Unit/RGB/RGB.ino: -------------------------------------------------------------------------------- 1 | #define FASTLED_INTERNAL // FastLEDの警告抑制 2 | #include // http://librarymanager/All#FastLED https://github.com/FastLED/FastLED 3 | 4 | #define NUM_LEDS 3 // LEDの数 5 | #define DATA_PIN 32 // M5StickC(内側のデータ線) 6 | 7 | CRGB leds[NUM_LEDS]; // 色データ保存用 8 | 9 | void setup() { 10 | // 初期化 11 | FastLED.addLeds(leds, NUM_LEDS); 12 | FastLED.setBrightness(20); 13 | 14 | // 色をセット 15 | leds[0] = CRGB::Red; 16 | leds[1] = CRGB::Yellow; 17 | leds[2] = CRGB::Green; 18 | } 19 | 20 | void loop() { 21 | // 定期的に出力しないとユニットを抜いたときに再点灯しなくなる 22 | FastLED.show(); 23 | 24 | delay(1000); 25 | } 26 | -------------------------------------------------------------------------------- /examples/Quick/M5Stack/Unit/TOF/TOF.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include // by Pololu http://librarymanager/All#vl53l0x-arduino https://github.com/pololu/vl53l0x-arduino 3 | 4 | VL53L0X sensor; 5 | 6 | void setup() 7 | { 8 | Serial.begin(115200); 9 | Wire.begin(32, 33); // M5StickC 10 | 11 | sensor.setAddress(0x29); 12 | sensor.setTimeout(500); 13 | if (!sensor.init()) { 14 | Serial.println("Failed to detect and initialize sensor!"); 15 | while (1) {} 16 | } 17 | 18 | sensor.startContinuous(); 19 | } 20 | 21 | void loop() 22 | { 23 | Serial.print(sensor.readRangeContinuousMillimeters()); 24 | if (sensor.timeoutOccurred()) { 25 | Serial.print(" TIMEOUT"); 26 | } 27 | 28 | Serial.println(); 29 | } 30 | -------------------------------------------------------------------------------- /keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For M5Lite 3 | ####################################### 4 | 5 | ####################################### 6 | # Library (KEYWORD3) 7 | ####################################### 8 | 9 | M5Lite KEYWORD3 10 | M5 KEYWORD3 11 | 12 | ####################################### 13 | # Datatypes (KEYWORD1) 14 | ####################################### 15 | 16 | Lcd KEYWORD1 17 | Rtc KEYWORD1 18 | Imu KEYWORD1 19 | Speaker KEYWORD1 20 | BtnA KEYWORD1 21 | BtnB KEYWORD1 22 | BtnC KEYWORD1 23 | dis KEYWORD1 24 | Ex KEYWORD1 25 | Debug KEYWORD1 26 | 27 | ####################################### 28 | # Methods and Functions (KEYWORD2) 29 | ####################################### 30 | 31 | begin KEYWORD2 32 | update KEYWORD2 33 | 34 | isPressed KEYWORD2 35 | wasPressed KEYWORD2 36 | pressedFor KEYWORD2 37 | 38 | isReleased KEYWORD2 39 | wasReleased KEYWORD2 40 | releasedFor KEYWORD2 41 | wasReleasefor KEYWORD2 42 | 43 | held KEYWORD2 44 | repeat KEYWORD2 45 | timeHeld KEYWORD2 46 | 47 | getBuffer KEYWORD2 48 | setContrast KEYWORD2 49 | clear KEYWORD2 50 | update KEYWORD2 51 | fillScreen KEYWORD2 52 | persistence KEYWORD2 53 | setColor KEYWORD2 54 | drawPixel KEYWORD2 55 | getPixel KEYWORD2 56 | drawLine KEYWORD2 57 | drawFastVLine KEYWORD2 58 | drawFastHLine KEYWORD2 59 | drawRect KEYWORD2 60 | fillRect KEYWORD2 61 | drawRoundRect KEYWORD2 62 | fillRoundRect KEYWORD2 63 | drawCircle KEYWORD2 64 | fillCircle KEYWORD2 65 | drawCircleHelper KEYWORD2 66 | fillCircleHelper KEYWORD2 67 | drawTriangle KEYWORD2 68 | fillTriangle KEYWORD2 69 | drawBitmap KEYWORD2 70 | drawChar KEYWORD2 71 | print KEYWORD2 72 | cursorX KEYWORD2 73 | cursorY KEYWORD2 74 | fontSize KEYWORD2 75 | textWrap KEYWORD2 76 | fontWidth KEYWORD2 77 | fontHeight KEYWORD2 78 | setFont KEYWORD2 79 | setTextColor KEYWORD2 80 | setTextSize KEYWORD2 81 | 82 | WHITE LITERAL1 83 | BLACK LITERAL1 84 | INVERT LITERAL1 85 | GRAY LITERAL1 86 | RED LITERAL1 87 | BLUE LITERAL1 88 | GREEN LITERAL1 89 | -------------------------------------------------------------------------------- /library.properties: -------------------------------------------------------------------------------- 1 | name=ESP32 Lite Pack Library 2 | version=1.3.2 3 | author=TANAKA Masayuki 4 | maintainer=TANAKA Masayuki 5 | sentence=ESP32LitePack, M5Lite, A lightweight compatibility library. Support Devices:M5StickC, M5StickC Plus, M5Stack BASIC, M5Stack GRAY, M5Stack FIRE, M5Stack Core2, M5Stack ATOM Lite, M5Stack ATOM Matrix, M5Stack ATOM ECHO 6 | paragraph=You can run multiple boards with the same code. 7 | category=Device Control 8 | url=https://github.com/tanakamasayuki/ESP32LitePack 9 | architectures=* 10 | depends=LovyanGFX, FastLED, I2C AXP192 Power management, I2C BM8563 RTC, I2C MPU6886 IMU 11 | -------------------------------------------------------------------------------- /src/ESP32LiteDebugGPIO.h: -------------------------------------------------------------------------------- 1 | #ifndef __ESP32LiteDebugGPIO_H__ 2 | #define __ESP32LiteDebugGPIO_H__ 3 | 4 | #include "soc/rtc_periph.h" 5 | 6 | const String _sigInName[256] = { 7 | "SPICLK_IN_IDX", 8 | "SPIQ_IN_IDX", 9 | "SPID_IN_IDX", 10 | "SPIHD_IN_IDX", 11 | "SPIWP_IN_IDX", 12 | "SPICS0_IN_IDX", 13 | "SPICS1_IN_IDX", 14 | "SPICS2_IN_IDX", 15 | "HSPICLK_IN_IDX", 16 | "HSPIQ_IN_IDX", 17 | "HSPID_IN_IDX", 18 | "HSPICS0_IN_IDX", 19 | "HSPIHD_IN_IDX", 20 | "HSPIWP_IN_IDX", 21 | "U0RXD_IN_IDX", 22 | "U0CTS_IN_IDX", 23 | "U0DSR_IN_IDX", 24 | "U1RXD_IN_IDX", 25 | "U1CTS_IN_IDX", 26 | "I2CM_SCL_O_IDX", 27 | "I2CM_SDA_I_IDX", 28 | "EXT_I2C_SCL_O_IDX", 29 | "EXT_I2C_SDA_I_IDX", 30 | "I2S0O_BCK_IN_IDX", 31 | "I2S1O_BCK_IN_IDX", 32 | "I2S0O_WS_IN_IDX", 33 | "I2S1O_WS_IN_IDX", 34 | "I2S0I_BCK_IN_IDX", 35 | "I2S0I_WS_IN_IDX", 36 | "I2CEXT0_SCL_IN_IDX", 37 | "I2CEXT0_SDA_IN_IDX", 38 | "PWM0_SYNC0_IN_IDX", 39 | "PWM0_SYNC1_IN_IDX", 40 | "PWM0_SYNC2_IN_IDX", 41 | "PWM0_F0_IN_IDX", 42 | "PWM0_F1_IN_IDX", 43 | "PWM0_F2_IN_IDX", 44 | "GPIO_BT_ACTIVE_IDX", 45 | "GPIO_BT_PRIORITY_IDX", 46 | "PCNT_SIG_CH0_IN0_IDX", 47 | "PCNT_SIG_CH1_IN0_IDX", 48 | "PCNT_CTRL_CH0_IN0_IDX", 49 | "PCNT_CTRL_CH1_IN0_IDX", 50 | "PCNT_SIG_CH0_IN1_IDX", 51 | "PCNT_SIG_CH1_IN1_IDX", 52 | "PCNT_CTRL_CH0_IN1_IDX", 53 | "PCNT_CTRL_CH1_IN1_IDX", 54 | "PCNT_SIG_CH0_IN2_IDX", 55 | "PCNT_SIG_CH1_IN2_IDX", 56 | "PCNT_CTRL_CH0_IN2_IDX", 57 | "PCNT_CTRL_CH1_IN2_IDX", 58 | "PCNT_SIG_CH0_IN3_IDX", 59 | "PCNT_SIG_CH1_IN3_IDX", 60 | "PCNT_CTRL_CH0_IN3_IDX", 61 | "PCNT_CTRL_CH1_IN3_IDX", 62 | "PCNT_SIG_CH0_IN4_IDX", 63 | "PCNT_SIG_CH1_IN4_IDX", 64 | "PCNT_CTRL_CH0_IN4_IDX", 65 | "PCNT_CTRL_CH1_IN4_IDX", 66 | "BB_DIAG18_IDX", 67 | "BB_DIAG19_IDX", 68 | "HSPICS1_IN_IDX", 69 | "HSPICS2_IN_IDX", 70 | "VSPICLK_IN_IDX", 71 | "VSPIQ_IN_IDX", 72 | "VSPID_IN_IDX", 73 | "VSPIHD_IN_IDX", 74 | "VSPIWP_IN_IDX", 75 | "VSPICS0_IN_IDX", 76 | "VSPICS1_IN_IDX", 77 | "VSPICS2_IN_IDX", 78 | "PCNT_SIG_CH0_IN5_IDX", 79 | "PCNT_SIG_CH1_IN5_IDX", 80 | "PCNT_CTRL_CH0_IN5_IDX", 81 | "PCNT_CTRL_CH1_IN5_IDX", 82 | "PCNT_SIG_CH0_IN6_IDX", 83 | "PCNT_SIG_CH1_IN6_IDX", 84 | "PCNT_CTRL_CH0_IN6_IDX", 85 | "PCNT_CTRL_CH1_IN6_IDX", 86 | "PCNT_SIG_CH0_IN7_IDX", 87 | "PCNT_SIG_CH1_IN7_IDX", 88 | "PCNT_CTRL_CH0_IN7_IDX", 89 | "PCNT_CTRL_CH1_IN7_IDX", 90 | "RMT_SIG_IN0_IDX", 91 | "RMT_SIG_IN1_IDX", 92 | "RMT_SIG_IN2_IDX", 93 | "RMT_SIG_IN3_IDX", 94 | "RMT_SIG_IN4_IDX", 95 | "RMT_SIG_IN5_IDX", 96 | "RMT_SIG_IN6_IDX", 97 | "RMT_SIG_IN7_IDX", 98 | "RMT_SIG_OUT4_IDX", 99 | "RMT_SIG_OUT5_IDX", 100 | "EXT_ADC_START_IDX", 101 | "CAN_RX_IDX", 102 | "I2CEXT1_SCL_IN_IDX", 103 | "I2CEXT1_SDA_IN_IDX", 104 | "HOST_CCMD_OD_PULLUP_EN_N_IDX", 105 | "HOST_RST_N_1_IDX", 106 | "HOST_RST_N_2_IDX", 107 | "HOST_CARD_WRITE_PRT_2_IDX", 108 | "HOST_CARD_INT_N_1_IDX", 109 | "HOST_CARD_INT_N_2_IDX", 110 | "PWM1_SYNC0_IN_IDX", 111 | "PWM1_SYNC1_IN_IDX", 112 | "PWM1_SYNC2_IN_IDX", 113 | "PWM1_F0_IN_IDX", 114 | "PWM1_F1_IN_IDX", 115 | "PWM1_F2_IN_IDX", 116 | "PWM0_CAP0_IN_IDX", 117 | "PWM0_CAP1_IN_IDX", 118 | "PWM0_CAP2_IN_IDX", 119 | "PWM1_CAP0_IN_IDX", 120 | "PWM1_CAP1_IN_IDX", 121 | "PWM1_CAP2_IN_IDX", 122 | "PWM2_FLTA_IDX", 123 | "PWM2_FLTB_IDX", 124 | "PWM2_CAP1_IN_IDX", 125 | "PWM2_CAP2_IN_IDX", 126 | "PWM2_CAP3_IN_IDX", 127 | "PWM3_FLTA_IDX", 128 | "PWM3_FLTB_IDX", 129 | "PWM3_CAP1_IN_IDX", 130 | "PWM3_CAP2_IN_IDX", 131 | "PWM3_CAP3_IN_IDX", 132 | "CAN_CLKOUT_IDX", 133 | "126", 134 | "127", 135 | "SPID4_IN_IDX", 136 | "SPID5_IN_IDX", 137 | "SPID6_IN_IDX", 138 | "SPID7_IN_IDX", 139 | "HSPID4_IN_IDX", 140 | "HSPID5_IN_IDX", 141 | "HSPID6_IN_IDX", 142 | "HSPID7_IN_IDX", 143 | "VSPID4_IN_IDX", 144 | "VSPID5_IN_IDX", 145 | "VSPID6_IN_IDX", 146 | "VSPID7_IN_IDX", 147 | "I2S0I_DATA_IN0_IDX", 148 | "I2S0I_DATA_IN1_IDX", 149 | "I2S0I_DATA_IN2_IDX", 150 | "I2S0I_DATA_IN3_IDX", 151 | "I2S0I_DATA_IN4_IDX", 152 | "I2S0I_DATA_IN5_IDX", 153 | "I2S0I_DATA_IN6_IDX", 154 | "I2S0I_DATA_IN7_IDX", 155 | "I2S0I_DATA_IN8_IDX", 156 | "I2S0I_DATA_IN9_IDX", 157 | "I2S0I_DATA_IN10_IDX", 158 | "I2S0I_DATA_IN11_IDX", 159 | "I2S0I_DATA_IN12_IDX", 160 | "I2S0I_DATA_IN13_IDX", 161 | "I2S0I_DATA_IN14_IDX", 162 | "I2S0I_DATA_IN15_IDX", 163 | "I2S0O_DATA_OUT16_IDX", 164 | "I2S0O_DATA_OUT17_IDX", 165 | "I2S0O_DATA_OUT18_IDX", 166 | "I2S0O_DATA_OUT19_IDX", 167 | "I2S0O_DATA_OUT20_IDX", 168 | "I2S0O_DATA_OUT21_IDX", 169 | "I2S0O_DATA_OUT22_IDX", 170 | "I2S0O_DATA_OUT23_IDX", 171 | "I2S1I_BCK_IN_IDX", 172 | "I2S1I_WS_IN_IDX", 173 | "I2S1I_DATA_IN0_IDX", 174 | "I2S1I_DATA_IN1_IDX", 175 | "I2S1I_DATA_IN2_IDX", 176 | "I2S1I_DATA_IN3_IDX", 177 | "I2S1I_DATA_IN4_IDX", 178 | "I2S1I_DATA_IN5_IDX", 179 | "I2S1I_DATA_IN6_IDX", 180 | "I2S1I_DATA_IN7_IDX", 181 | "I2S1I_DATA_IN8_IDX", 182 | "I2S1I_DATA_IN9_IDX", 183 | "I2S1I_DATA_IN10_IDX", 184 | "I2S1I_DATA_IN11_IDX", 185 | "I2S1I_DATA_IN12_IDX", 186 | "I2S1I_DATA_IN13_IDX", 187 | "I2S1I_DATA_IN14_IDX", 188 | "I2S1I_DATA_IN15_IDX", 189 | "I2S1O_DATA_OUT16_IDX", 190 | "I2S1O_DATA_OUT17_IDX", 191 | "I2S1O_DATA_OUT18_IDX", 192 | "I2S1O_DATA_OUT19_IDX", 193 | "I2S1O_DATA_OUT20_IDX", 194 | "I2S1O_DATA_OUT21_IDX", 195 | "I2S1O_DATA_OUT22_IDX", 196 | "I2S1O_DATA_OUT23_IDX", 197 | "I2S0I_H_SYNC_IDX", 198 | "I2S0I_V_SYNC_IDX", 199 | "I2S0I_H_ENABLE_IDX", 200 | "I2S1I_H_SYNC_IDX", 201 | "I2S1I_V_SYNC_IDX", 202 | "I2S1I_H_ENABLE_IDX", 203 | "PWM3_OUT4H_IDX", 204 | "PWM3_OUT4L_IDX", 205 | "U2RXD_IN_IDX", 206 | "U2CTS_IN_IDX", 207 | "EMAC_MDC_I_IDX", 208 | "EMAC_MDI_I_IDX", 209 | "EMAC_CRS_I_IDX", 210 | "EMAC_COL_I_IDX", 211 | "PCMFSYNC_IN_IDX", 212 | "PCMCLK_IN_IDX", 213 | "PCMDIN_IDX", 214 | "BLE_AUDIO0_IRQ_IDX", 215 | "BLE_AUDIO1_IRQ_IDX", 216 | "BLE_AUDIO2_IRQ_IDX", 217 | "PCMFSYNC_OUT_IDX", 218 | "PCMCLK_OUT_IDX", 219 | "PCMDOUT_IDX", 220 | "BLE_AUDIO_SYNC0_P_IDX", 221 | "BLE_AUDIO_SYNC1_P_IDX", 222 | "BLE_AUDIO_SYNC2_P_IDX", 223 | "ANT_SEL0_IDX", 224 | "ANT_SEL1_IDX", 225 | "ANT_SEL2_IDX", 226 | "ANT_SEL3_IDX", 227 | "ANT_SEL4_IDX", 228 | "ANT_SEL5_IDX", 229 | "ANT_SEL6_IDX", 230 | "ANT_SEL7_IDX", 231 | "SIG_IN_FUNC224_IDX", 232 | "SIG_IN_FUNC225_IDX", 233 | "SIG_IN_FUNC226_IDX", 234 | "SIG_IN_FUNC227_IDX", 235 | "SIG_IN_FUNC228_IDX", 236 | "229", 237 | "230", 238 | "231", 239 | "232", 240 | "233", 241 | "234", 242 | "235", 243 | "236", 244 | "237", 245 | "238", 246 | "239", 247 | "240", 248 | "241", 249 | "242", 250 | "243", 251 | "244", 252 | "245", 253 | "246", 254 | "247", 255 | "248", 256 | "249", 257 | "250", 258 | "251", 259 | "252", 260 | "253", 261 | "254", 262 | "255", 263 | }; 264 | 265 | const String _sigOutName[256] = { 266 | "SPICLK_OUT_IDX", 267 | "SPIQ_OUT_IDX", 268 | "SPID_OUT_IDX", 269 | "SPIHD_OUT_IDX", 270 | "SPIWP_OUT_IDX", 271 | "SPICS0_OUT_IDX", 272 | "SPICS1_OUT_IDX", 273 | "SPICS2_OUT_IDX", 274 | "HSPICLK_OUT_IDX", 275 | "HSPIQ_OUT_IDX", 276 | "HSPID_OUT_IDX", 277 | "HSPICS0_OUT_IDX", 278 | "HSPIHD_OUT_IDX", 279 | "HSPIWP_OUT_IDX", 280 | "U0TXD_OUT_IDX", 281 | "U0RTS_OUT_IDX", 282 | "U0DTR_OUT_IDX", 283 | "U1TXD_OUT_IDX", 284 | "U1RTS_OUT_IDX", 285 | "I2CM_SCL_O_IDX", 286 | "I2CM_SDA_O_IDX", 287 | "EXT_I2C_SCL_O_IDX", 288 | "EXT_I2C_SDA_O_IDX", 289 | "I2S0O_BCK_OUT_IDX", 290 | "I2S1O_BCK_OUT_IDX", 291 | "I2S0O_WS_OUT_IDX", 292 | "I2S1O_WS_OUT_IDX", 293 | "I2S0I_BCK_OUT_IDX", 294 | "I2S0I_WS_OUT_IDX", 295 | "I2CEXT0_SCL_OUT_IDX", 296 | "I2CEXT0_SDA_OUT_IDX", 297 | "SDIO_TOHOST_INT_OUT_IDX", 298 | "PWM0_OUT0A_IDX", 299 | "PWM0_OUT0B_IDX", 300 | "PWM0_OUT1A_IDX", 301 | "PWM0_OUT1B_IDX", 302 | "PWM0_OUT2A_IDX", 303 | "GPIO_BT_ACTIVE_IDX", 304 | "PWM0_OUT2B_IDX", 305 | "GPIO_BT_PRIORITY_IDX", 306 | "GPIO_WLAN_ACTIVE_IDX", 307 | "BB_DIAG0_IDX", 308 | "BB_DIAG1_IDX", 309 | "BB_DIAG2_IDX", 310 | "BB_DIAG3_IDX", 311 | "BB_DIAG4_IDX", 312 | "BB_DIAG5_IDX", 313 | "BB_DIAG6_IDX", 314 | "BB_DIAG7_IDX", 315 | "BB_DIAG8_IDX", 316 | "BB_DIAG9_IDX", 317 | "BB_DIAG10_IDX", 318 | "BB_DIAG11_IDX", 319 | "BB_DIAG12_IDX", 320 | "BB_DIAG13_IDX", 321 | "BB_DIAG14_IDX", 322 | "BB_DIAG15_IDX", 323 | "BB_DIAG16_IDX", 324 | "BB_DIAG17_IDX", 325 | "BB_DIAG18_IDX", 326 | "BB_DIAG19_IDX", 327 | "HSPICS1_OUT_IDX", 328 | "HSPICS2_OUT_IDX", 329 | "VSPICLK_OUT_IDX", 330 | "VSPIQ_OUT_IDX", 331 | "VSPID_OUT_IDX", 332 | "VSPIHD_OUT_IDX", 333 | "VSPIWP_OUT_IDX", 334 | "VSPICS0_OUT_IDX", 335 | "VSPICS1_OUT_IDX", 336 | "VSPICS2_OUT_IDX", 337 | "LEDC_HS_SIG_OUT0_IDX", 338 | "LEDC_HS_SIG_OUT1_IDX", 339 | "LEDC_HS_SIG_OUT2_IDX", 340 | "LEDC_HS_SIG_OUT3_IDX", 341 | "LEDC_HS_SIG_OUT4_IDX", 342 | "LEDC_HS_SIG_OUT5_IDX", 343 | "LEDC_HS_SIG_OUT6_IDX", 344 | "LEDC_HS_SIG_OUT7_IDX", 345 | "LEDC_LS_SIG_OUT0_IDX", 346 | "LEDC_LS_SIG_OUT1_IDX", 347 | "LEDC_LS_SIG_OUT2_IDX", 348 | "LEDC_LS_SIG_OUT3_IDX", 349 | "LEDC_LS_SIG_OUT4_IDX", 350 | "LEDC_LS_SIG_OUT5_IDX", 351 | "LEDC_LS_SIG_OUT6_IDX", 352 | "LEDC_LS_SIG_OUT7_IDX", 353 | "RMT_SIG_OUT0_IDX", 354 | "RMT_SIG_OUT1_IDX", 355 | "RMT_SIG_OUT2_IDX", 356 | "RMT_SIG_OUT3_IDX", 357 | "RMT_SIG_OUT4_IDX", 358 | "RMT_SIG_OUT5_IDX", 359 | "RMT_SIG_OUT6_IDX", 360 | "RMT_SIG_OUT7_IDX", 361 | "I2CEXT1_SCL_OUT_IDX", 362 | "I2CEXT1_SDA_OUT_IDX", 363 | "HOST_CCMD_OD_PULLUP_EN_N_IDX", 364 | "HOST_RST_N_1_IDX", 365 | "HOST_RST_N_2_IDX", 366 | "GPIO_SD0_OUT_IDX", 367 | "GPIO_SD1_OUT_IDX", 368 | "GPIO_SD2_OUT_IDX", 369 | "GPIO_SD3_OUT_IDX", 370 | "GPIO_SD4_OUT_IDX", 371 | "GPIO_SD5_OUT_IDX", 372 | "GPIO_SD6_OUT_IDX", 373 | "GPIO_SD7_OUT_IDX", 374 | "PWM1_OUT0A_IDX", 375 | "PWM1_OUT0B_IDX", 376 | "PWM1_OUT1A_IDX", 377 | "PWM1_OUT1B_IDX", 378 | "PWM1_OUT2A_IDX", 379 | "PWM1_OUT2B_IDX", 380 | "PWM2_OUT1H_IDX", 381 | "PWM2_OUT1L_IDX", 382 | "PWM2_OUT2H_IDX", 383 | "PWM2_OUT2L_IDX", 384 | "PWM2_OUT3H_IDX", 385 | "PWM2_OUT3L_IDX", 386 | "PWM2_OUT4H_IDX", 387 | "PWM2_OUT4L_IDX", 388 | "PWM3_CAP1_IN_IDX", 389 | "CAN_TX_IDX", 390 | "CAN_BUS_OFF_ON_IDX", 391 | "CAN_CLKOUT_IDX", 392 | "126", 393 | "127", 394 | "SPID4_OUT_IDX", 395 | "SPID5_OUT_IDX", 396 | "SPID6_OUT_IDX", 397 | "SPID7_OUT_IDX", 398 | "HSPID4_OUT_IDX", 399 | "HSPID5_OUT_IDX", 400 | "HSPID6_OUT_IDX", 401 | "HSPID7_OUT_IDX", 402 | "VSPID4_OUT_IDX", 403 | "VSPID5_OUT_IDX", 404 | "VSPID6_OUT_IDX", 405 | "VSPID7_OUT_IDX", 406 | "I2S0O_DATA_OUT0_IDX", 407 | "I2S0O_DATA_OUT1_IDX", 408 | "I2S0O_DATA_OUT2_IDX", 409 | "I2S0O_DATA_OUT3_IDX", 410 | "I2S0O_DATA_OUT4_IDX", 411 | "I2S0O_DATA_OUT5_IDX", 412 | "I2S0O_DATA_OUT6_IDX", 413 | "I2S0O_DATA_OUT7_IDX", 414 | "I2S0O_DATA_OUT8_IDX", 415 | "I2S0O_DATA_OUT9_IDX", 416 | "I2S0O_DATA_OUT10_IDX", 417 | "I2S0O_DATA_OUT11_IDX", 418 | "I2S0O_DATA_OUT12_IDX", 419 | "I2S0O_DATA_OUT13_IDX", 420 | "I2S0O_DATA_OUT14_IDX", 421 | "I2S0O_DATA_OUT15_IDX", 422 | "I2S0O_DATA_OUT16_IDX", 423 | "I2S0O_DATA_OUT17_IDX", 424 | "I2S0O_DATA_OUT18_IDX", 425 | "I2S0O_DATA_OUT19_IDX", 426 | "I2S0O_DATA_OUT20_IDX", 427 | "I2S0O_DATA_OUT21_IDX", 428 | "I2S0O_DATA_OUT22_IDX", 429 | "I2S0O_DATA_OUT23_IDX", 430 | "I2S1I_BCK_OUT_IDX", 431 | "I2S1I_WS_OUT_IDX", 432 | "I2S1O_DATA_OUT0_IDX", 433 | "I2S1O_DATA_OUT1_IDX", 434 | "I2S1O_DATA_OUT2_IDX", 435 | "I2S1O_DATA_OUT3_IDX", 436 | "I2S1O_DATA_OUT4_IDX", 437 | "I2S1O_DATA_OUT5_IDX", 438 | "I2S1O_DATA_OUT6_IDX", 439 | "I2S1O_DATA_OUT7_IDX", 440 | "I2S1O_DATA_OUT8_IDX", 441 | "I2S1O_DATA_OUT9_IDX", 442 | "I2S1O_DATA_OUT10_IDX", 443 | "I2S1O_DATA_OUT11_IDX", 444 | "I2S1O_DATA_OUT12_IDX", 445 | "I2S1O_DATA_OUT13_IDX", 446 | "I2S1O_DATA_OUT14_IDX", 447 | "I2S1O_DATA_OUT15_IDX", 448 | "I2S1O_DATA_OUT16_IDX", 449 | "I2S1O_DATA_OUT17_IDX", 450 | "I2S1O_DATA_OUT18_IDX", 451 | "I2S1O_DATA_OUT19_IDX", 452 | "I2S1O_DATA_OUT20_IDX", 453 | "I2S1O_DATA_OUT21_IDX", 454 | "I2S1O_DATA_OUT22_IDX", 455 | "I2S1O_DATA_OUT23_IDX", 456 | "PWM3_OUT1H_IDX", 457 | "PWM3_OUT1L_IDX", 458 | "PWM3_OUT2H_IDX", 459 | "PWM3_OUT2L_IDX", 460 | "PWM3_OUT3H_IDX", 461 | "PWM3_OUT3L_IDX", 462 | "PWM3_OUT4H_IDX", 463 | "PWM3_OUT4L_IDX", 464 | "U2TXD_OUT_IDX", 465 | "U2RTS_OUT_IDX", 466 | "EMAC_MDC_O_IDX", 467 | "EMAC_MDO_O_IDX", 468 | "EMAC_CRS_O_IDX", 469 | "EMAC_COL_O_IDX", 470 | "BT_AUDIO0_IRQ_IDX", 471 | "BT_AUDIO1_IRQ_IDX", 472 | "BT_AUDIO2_IRQ_IDX", 473 | "BLE_AUDIO0_IRQ_IDX", 474 | "BLE_AUDIO1_IRQ_IDX", 475 | "BLE_AUDIO2_IRQ_IDX", 476 | "PCMFSYNC_OUT_IDX", 477 | "PCMCLK_OUT_IDX", 478 | "PCMDOUT_IDX", 479 | "BLE_AUDIO_SYNC0_P_IDX", 480 | "BLE_AUDIO_SYNC1_P_IDX", 481 | "BLE_AUDIO_SYNC2_P_IDX", 482 | "ANT_SEL0_IDX", 483 | "ANT_SEL1_IDX", 484 | "ANT_SEL2_IDX", 485 | "ANT_SEL3_IDX", 486 | "ANT_SEL4_IDX", 487 | "ANT_SEL5_IDX", 488 | "ANT_SEL6_IDX", 489 | "ANT_SEL7_IDX", 490 | "224", 491 | "225", 492 | "226", 493 | "227", 494 | "228", 495 | "229", 496 | "230", 497 | "231", 498 | "232", 499 | "233", 500 | "234", 501 | "235", 502 | "236", 503 | "237", 504 | "238", 505 | "239", 506 | "240", 507 | "241", 508 | "242", 509 | "243", 510 | "244", 511 | "245", 512 | "246", 513 | "247", 514 | "248", 515 | "249", 516 | "250", 517 | "251", 518 | "252", 519 | "253", 520 | "254", 521 | "255", 522 | }; 523 | 524 | typedef struct { 525 | bool enable: 1; 526 | bool pullup: 1; 527 | bool pulldown: 1; 528 | bool openDrain: 1; 529 | bool adc: 1; 530 | bool output: 1; 531 | bool level: 1; 532 | } _gpio_info_t; 533 | 534 | _gpio_info_t getPinMode(uint8_t pin) 535 | { 536 | _gpio_info_t info = {}; 537 | 538 | if (!digitalPinIsValid(pin)) { 539 | return info; 540 | } 541 | 542 | info.enable = true; 543 | 544 | uint32_t rtc_reg = rtc_gpio_desc[pin].reg; 545 | if (rtc_reg) { 546 | uint32_t reg_val = ESP_REG(rtc_reg); 547 | 548 | if (reg_val & rtc_gpio_desc[pin].mux) { 549 | info.adc = true; 550 | } 551 | 552 | if (reg_val & rtc_gpio_desc[pin].pullup) { 553 | info.pullup = true; 554 | } 555 | 556 | if (reg_val & rtc_gpio_desc[pin].pulldown) { 557 | info.pulldown = true; 558 | } 559 | } 560 | 561 | if (pin > 33) { 562 | } else if (pin < 32) { 563 | if (ESP_REG(GPIO_ENABLE_REG) & ((uint32_t)1 << pin)) { 564 | info.output = true; 565 | } 566 | } else { 567 | if (ESP_REG(GPIO_ENABLE1_REG) & ((uint32_t)1 << (pin - 32))) { 568 | info.output = true; 569 | } 570 | } 571 | 572 | if (ESP_REG(DR_REG_IO_MUX_BASE + esp32_gpioMux[pin].reg) & FUN_PU) { 573 | info.pullup = true; 574 | } 575 | 576 | if (ESP_REG(DR_REG_IO_MUX_BASE + esp32_gpioMux[pin].reg) & FUN_PD) { 577 | info.pulldown = true; 578 | } 579 | 580 | if (GPIO.pin[pin].val & (1 << GPIO_PIN0_PAD_DRIVER_S)) { 581 | info.openDrain = true; 582 | } 583 | 584 | if (pin < 32) { 585 | if (ESP_REG(GPIO_IN_REG) & ((uint32_t)1 << pin)) { 586 | info.level = true; 587 | } else { 588 | info.level = false; 589 | } 590 | } else { 591 | if (ESP_REG(GPIO_IN1_REG) & ((uint32_t)1 << (pin - 32))) { 592 | info.level = true; 593 | } else { 594 | info.level = false; 595 | } 596 | } 597 | 598 | if (34 <= pin) { 599 | // INPUT Only 600 | info.pullup = false; 601 | info.pulldown = false; 602 | info.openDrain = false; 603 | } 604 | 605 | return info; 606 | } 607 | 608 | void getPinMux(String *gpioMap) { 609 | // INPUT 610 | for (int i = 0; i < 256; i++) { 611 | uint32_t reg = GPIO_FUNC0_IN_SEL_CFG_REG + 0x04 * i; 612 | uint32_t reg_val = ESP_REG(reg); 613 | if (reg_val & (1 << 7)) { 614 | int gpio = reg_val & 0b00111111; 615 | gpioMap[gpio] = "[I]" + _sigInName[i]; 616 | } 617 | } 618 | 619 | // OUTPUT 620 | for (int i = 0; i < 40; i++) { 621 | uint32_t reg = GPIO_FUNC0_OUT_SEL_CFG_REG + 0x04 * i; 622 | uint32_t reg_val = ESP_REG(reg); 623 | int func = reg_val & 0b111111111; 624 | if (func < 256) { 625 | gpioMap[i] = String("[O]") + _sigOutName[func]; 626 | } 627 | } 628 | } 629 | 630 | void dispGpio() { 631 | String pinMap[40]; 632 | getPinMux(pinMap); 633 | 634 | Serial.println("GPIO LEVEL MODE ADC PULLUP PULLDOWN OPEN_DRAIN I/O NOTE "); 635 | Serial.println("-----------------------------------------------------------------------------"); 636 | for (int i = 0; i < 40; i++) { 637 | _gpio_info_t gpioInfo = getPinMode(i); 638 | if (!gpioInfo.enable) { 639 | continue; 640 | } 641 | 642 | Serial.printf("%4d ", i); 643 | 644 | if (gpioInfo.level) { 645 | Serial.print("HIGH "); 646 | } else { 647 | Serial.print("LOW "); 648 | } 649 | 650 | if (gpioInfo.output) { 651 | Serial.print("OUTPUT "); 652 | } else { 653 | Serial.print("INPUT "); 654 | } 655 | 656 | if (gpioInfo.adc) { 657 | Serial.print("ADC "); 658 | } else { 659 | Serial.print(" "); 660 | } 661 | 662 | if (gpioInfo.pullup) { 663 | Serial.print("PULLUP "); 664 | } else { 665 | Serial.print(" "); 666 | } 667 | 668 | if (gpioInfo.pulldown) { 669 | Serial.print("PULLDOWN "); 670 | } else { 671 | Serial.print(" "); 672 | } 673 | 674 | if (gpioInfo.openDrain) { 675 | Serial.print("OPEN_DRAIN "); 676 | } else { 677 | Serial.print(" "); 678 | } 679 | 680 | if (i < 34) { 681 | Serial.print("I/O "); 682 | } else { 683 | Serial.print("I "); 684 | } 685 | 686 | Serial.print(pinMap[i]); 687 | 688 | Serial.println(); 689 | } 690 | } 691 | 692 | #endif 693 | -------------------------------------------------------------------------------- /src/I2C_BMA423.h: -------------------------------------------------------------------------------- 1 | #ifndef __I2C_BMA423_H__ 2 | #define __I2C_BMA423_H__ 3 | 4 | #include 5 | #include "I2C_BMA423_config.h" 6 | 7 | #define I2C_BMA423_DEFAULT_ADDRESS 0x19 8 | 9 | class I2C_BMA423 { 10 | public: 11 | I2C_BMA423(uint8_t deviceAddress = I2C_BMA423_DEFAULT_ADDRESS, TwoWire &i2cPort = Wire) { 12 | _deviceAddress = deviceAddress; 13 | _i2cPort = &i2cPort; 14 | } 15 | 16 | int begin(void) { 17 | // Reset 18 | writeByte(0x7E, 0xB6); 19 | delay(1); 20 | 21 | // WHO_AM_I : IMU Check 22 | if (WhoAmI() != 0x13) { 23 | return -1; 24 | } 25 | delay(1); 26 | 27 | writeByte(0x7C, 0x02); 28 | delay(1); 29 | 30 | writeByte(0x59, 0x00); 31 | delay(1); 32 | 33 | int len = 8; 34 | for (int i = 0; i < sizeof(_bma423_config_data); i += len) { 35 | uint8_t asic_msb = (uint8_t)((i / 2) >> 4); 36 | uint8_t asic_lsb = ((i / 2) & 0x0F); 37 | writeByte(0x5B, asic_lsb); 38 | writeByte(0x5C, asic_msb); 39 | writeBytes(0x5E, &_bma423_config_data[i], len); 40 | } 41 | 42 | writeByte(0x59, 0x01); 43 | delay(1); 44 | 45 | writeByte(0x7C, 0x03); 46 | delay(1); 47 | 48 | writeByte(0x53, 0x0A); 49 | delay(1); 50 | 51 | writeByte(0x40, 0xA8); 52 | delay(1); 53 | 54 | writeByte(0x41, 0x00); 55 | delay(1); 56 | 57 | // Enable Accel 58 | writeByte(0x7D, 0x04); 59 | delay(1); 60 | 61 | return 0; 62 | } 63 | 64 | uint8_t WhoAmI() { 65 | return readByte(0x00); 66 | } 67 | 68 | void getAccel(float* ax, float* ay, float* az) { 69 | *ax = (int16_t)((readByte(0x13) << 8) | readByte(0x12)) / 0x10 / 1000.0; 70 | *ay = (int16_t)((readByte(0x15) << 8) | readByte(0x14)) / 0x10 / 1000.0; 71 | *az = (int16_t)((readByte(0x17) << 8) | readByte(0x16)) / 0x10 / 1000.0; 72 | } 73 | 74 | private: 75 | uint8_t readByte(uint8_t address) { 76 | _i2cPort->beginTransmission(_deviceAddress); 77 | _i2cPort->write(address); 78 | _i2cPort->endTransmission(); 79 | _i2cPort->requestFrom(_deviceAddress, 1); 80 | uint8_t val = _i2cPort->read(); 81 | 82 | ESP_LOGD("BMA423", "readByte(%02X, %02X) = %02X", _deviceAddress, address, val); 83 | return val; 84 | } 85 | void writeByte(uint8_t address, uint8_t data) { 86 | _i2cPort->beginTransmission(_deviceAddress); 87 | _i2cPort->write(address); 88 | _i2cPort->write(data); 89 | _i2cPort->endTransmission(); 90 | ESP_LOGD("BMA423", "writeByte(%02X, %02X) = %02X", _deviceAddress, address, data); 91 | } 92 | void writeBytes(uint8_t address, const uint8_t *data, uint8_t len) { 93 | _i2cPort->beginTransmission(_deviceAddress); 94 | _i2cPort->write(address); 95 | _i2cPort->write(data, len); 96 | _i2cPort->endTransmission(); 97 | ESP_LOGD("BMA423", "writeByte(%02X, %02X, len=%d) = %02X", _deviceAddress, address, len, data[0]); 98 | } 99 | void bitOn(uint8_t address, uint8_t bit) { 100 | uint8_t add = address; 101 | uint8_t val = readByte(add) | bit; 102 | writeByte(add, val); 103 | } 104 | void bitOff(uint8_t address, uint8_t bit) { 105 | uint8_t add = address; 106 | uint8_t val = readByte(add) & ~bit; 107 | writeByte(add, val); 108 | } 109 | 110 | TwoWire *_i2cPort; 111 | int _deviceAddress; 112 | }; 113 | 114 | #endif 115 | -------------------------------------------------------------------------------- /src/I2C_BMA423_config.h: -------------------------------------------------------------------------------- 1 | #ifndef __I2C_BMA423_CONFIG_H__ 2 | #define __I2C_BMA423_CONFIG_H__ 3 | 4 | static const uint8_t _bma423_config_data[6144] = { 5 | 0x80, 0x2e, 0xfc, 0x00, 0x80, 0x2e, 0xfe, 0x00, 6 | 0xc8, 0x2e, 0x00, 0x2e, 0x80, 0x2e, 0xfa, 0x00, 7 | 0x80, 0x2e, 0x23, 0xb1, 0x80, 0x2e, 0xfd, 0x00, 8 | 0x80, 0x2e, 0xfb, 0x00, 0x80, 0x2e, 0x5a, 0xb1, 9 | 0x50, 0x39, 0x21, 0x2e, 0xb0, 0xf0, 0x10, 0x30, 10 | 0x21, 0x2e, 0x16, 0xf0, 0x80, 0x2e, 0xfc, 0x01, 11 | 0x5d, 0x50, 0x45, 0x52, 0x01, 0x42, 0x3b, 0x80, 12 | 0x41, 0x30, 0x01, 0x42, 0x3c, 0x80, 0x00, 0x2e, 13 | 0x01, 0x40, 0x01, 0x42, 0x21, 0x2e, 0xff, 0xaf, 14 | 0xb8, 0x2e, 0xb6, 0xd6, 0x80, 0x2e, 0x18, 0x00, 15 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 16 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 17 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 18 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 19 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 20 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 21 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 22 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 23 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 24 | 0x80, 0x2e, 0x18, 0x00, 0xfd, 0x2d, 0x00, 0x00, 25 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 26 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 27 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 28 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 29 | 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 30 | 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 31 | 0x00, 0x08, 0x00, 0xf8, 0x00, 0x00, 0x00, 0x00, 32 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x00, 33 | 0x24, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 34 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 35 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 36 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 37 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 38 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 39 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 40 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x98, 0x2e, 41 | 0x99, 0x01, 0x20, 0x26, 0x98, 0x2e, 0xf6, 0x00, 42 | 0x98, 0x2e, 0xe9, 0x01, 0x10, 0x30, 0x21, 0x2e, 43 | 0x59, 0xf0, 0x98, 0x2e, 0xd8, 0x00, 0x00, 0x2e, 44 | 0x00, 0x2e, 0xd0, 0x2e, 0x98, 0x2e, 0xdd, 0x00, 45 | 0x01, 0x2e, 0x56, 0x00, 0x00, 0xb2, 0x11, 0x2f, 46 | 0x00, 0x30, 0x21, 0x2e, 0x56, 0x00, 0x41, 0x50, 47 | 0x98, 0x2e, 0xcc, 0xb0, 0x41, 0x50, 0x98, 0x2e, 48 | 0x8f, 0xb4, 0x01, 0x2e, 0x03, 0xf0, 0x0d, 0xbc, 49 | 0x0f, 0xb8, 0x00, 0x90, 0x02, 0x2f, 0x45, 0x50, 50 | 0x21, 0x2e, 0xbc, 0xf0, 0x01, 0x2e, 0x55, 0x00, 51 | 0x00, 0xb2, 0x1a, 0x2f, 0x00, 0x30, 0x21, 0x2e, 52 | 0x55, 0x00, 0x43, 0x50, 0x98, 0x2e, 0xcc, 0xb0, 53 | 0x43, 0x50, 0x98, 0x2e, 0xdc, 0xb1, 0x43, 0x50, 54 | 0x98, 0x2e, 0x92, 0xb5, 0x43, 0x50, 0x98, 0x2e, 55 | 0x00, 0xb0, 0x01, 0x2e, 0x1c, 0x01, 0x0f, 0xbc, 56 | 0x0f, 0xb8, 0x00, 0x90, 0x45, 0x50, 0x02, 0x2f, 57 | 0x21, 0x2e, 0xbc, 0xf0, 0x02, 0x2d, 0x21, 0x2e, 58 | 0xba, 0xf0, 0x98, 0x2e, 0xd8, 0x00, 0xc3, 0x2d, 59 | 0x01, 0x2e, 0x55, 0xf0, 0xc0, 0x2e, 0x21, 0x2e, 60 | 0x55, 0xf0, 0x03, 0x2e, 0x00, 0xf0, 0x45, 0x54, 61 | 0x01, 0x2e, 0x59, 0xf0, 0x4a, 0x0e, 0x02, 0x2f, 62 | 0xf1, 0x33, 0x0d, 0x2c, 0x01, 0x08, 0xf2, 0x30, 63 | 0x4a, 0x08, 0x79, 0x84, 0x82, 0xa2, 0x04, 0x2f, 64 | 0x02, 0x34, 0x82, 0x0a, 0x47, 0xa2, 0x03, 0x2c, 65 | 0x10, 0x22, 0x45, 0x52, 0x01, 0x0a, 0xc0, 0x2e, 66 | 0x21, 0x2e, 0x59, 0xf0, 0x00, 0x31, 0xc0, 0x2e, 67 | 0x21, 0x2e, 0xba, 0xf0, 0xc8, 0x2e, 0xc8, 0x2e, 68 | 0xc8, 0x2e, 0xc8, 0x2e, 0xc8, 0x2e, 0x44, 0x47, 69 | 0xaa, 0x00, 0x05, 0x00, 0x2d, 0x01, 0xd4, 0x7b, 70 | 0x3b, 0x01, 0xdb, 0x7a, 0x04, 0x00, 0x3f, 0x7b, 71 | 0xcd, 0x6c, 0xc3, 0x04, 0x85, 0x09, 0xc3, 0x04, 72 | 0xec, 0xe6, 0x0c, 0x46, 0x01, 0x00, 0x27, 0x00, 73 | 0x19, 0x00, 0x96, 0x00, 0xa0, 0x00, 0x01, 0x00, 74 | 0x0c, 0x00, 0xf0, 0x3c, 0x00, 0x01, 0x01, 0x00, 75 | 0x03, 0x00, 0x01, 0x00, 0x0e, 0x00, 0x00, 0x00, 76 | 0x06, 0x00, 0x00, 0x00, 0x43, 0x28, 0x88, 0x00, 77 | 0x52, 0x00, 0x4f, 0x00, 0x80, 0x00, 0x5b, 0x00, 78 | 0x00, 0x40, 0xaf, 0x00, 0xff, 0x00, 0xff, 0xb7, 79 | 0x00, 0x02, 0x00, 0xb0, 0x05, 0x80, 0xb1, 0xf0, 80 | 0xc0, 0x00, 0x00, 0x01, 0x5e, 0xf0, 0x39, 0xf0, 81 | 0x89, 0xf0, 0x00, 0x20, 0xff, 0x7f, 0x7d, 0x00, 82 | 0x5e, 0x00, 0x62, 0x00, 0x7c, 0x00, 0xff, 0xfb, 83 | 0x52, 0xf0, 0x56, 0xf0, 0x33, 0x09, 0x33, 0x07, 84 | 0x00, 0x08, 0x90, 0x01, 0x00, 0xf8, 0x67, 0x00, 85 | 0x4c, 0x04, 0xa0, 0x00, 0xe8, 0x03, 0x81, 0x00, 86 | 0x82, 0x00, 0x6a, 0x00, 0x6d, 0x00, 0x6c, 0x00, 87 | 0xeb, 0x07, 0xae, 0x07, 0x72, 0x00, 0x6f, 0x00, 88 | 0xa1, 0x01, 0x1e, 0x05, 0x47, 0xfd, 0x73, 0x00, 89 | 0x77, 0x00, 0x79, 0x00, 0x76, 0x00, 0xcc, 0x00, 90 | 0x30, 0x50, 0x50, 0x40, 0x00, 0x18, 0x50, 0x40, 91 | 0x56, 0x25, 0x47, 0x25, 0x00, 0x18, 0x2e, 0x00, 92 | 0x41, 0x40, 0xa7, 0x02, 0x09, 0x18, 0xc6, 0x00, 93 | 0xfb, 0x7f, 0x00, 0x30, 0x49, 0x52, 0x05, 0x30, 94 | 0x05, 0x2c, 0x17, 0x03, 0x1e, 0xbd, 0xd2, 0xba, 95 | 0x92, 0xb8, 0x6a, 0x0b, 0x61, 0x0e, 0xf9, 0x2f, 96 | 0x61, 0x1a, 0x01, 0x2f, 0x5d, 0x0e, 0xf5, 0x2f, 97 | 0xd4, 0x7f, 0x02, 0x30, 0x1f, 0x2c, 0xe3, 0x7f, 98 | 0x85, 0x01, 0xd1, 0x03, 0x7c, 0x0e, 0x03, 0x2f, 99 | 0x7c, 0x1a, 0x0f, 0x2f, 0x73, 0x0f, 0x0d, 0x2f, 100 | 0xe3, 0x6f, 0xde, 0x04, 0x5f, 0xba, 0x11, 0xbf, 101 | 0xb4, 0x0b, 0xd4, 0x6f, 0x27, 0x07, 0xb3, 0x25, 102 | 0xd1, 0xbf, 0xeb, 0x7f, 0x07, 0x00, 0xb4, 0x25, 103 | 0x96, 0x02, 0xdb, 0x7f, 0x2f, 0xbf, 0x9e, 0xbf, 104 | 0x01, 0xb8, 0xd2, 0xba, 0x21, 0xb9, 0x92, 0xb8, 105 | 0x06, 0x0a, 0x6f, 0x0b, 0x40, 0x90, 0xdf, 0x2f, 106 | 0x40, 0x91, 0xdd, 0x2f, 0xfb, 0x6f, 0xd0, 0x5f, 107 | 0xb8, 0x2e, 0x57, 0x50, 0x41, 0x30, 0x02, 0x40, 108 | 0x51, 0x0a, 0x01, 0x42, 0x18, 0x82, 0x4b, 0x50, 109 | 0x60, 0x42, 0x70, 0x3c, 0x4d, 0x54, 0x42, 0x42, 110 | 0x69, 0x82, 0x82, 0x32, 0x43, 0x40, 0x18, 0x08, 111 | 0x02, 0x0a, 0x40, 0x42, 0x42, 0x80, 0x02, 0x3f, 112 | 0x01, 0x40, 0x10, 0x50, 0x4a, 0x08, 0xfb, 0x7f, 113 | 0x11, 0x42, 0x0b, 0x31, 0x0b, 0x42, 0x3e, 0x80, 114 | 0x01, 0x32, 0x01, 0x42, 0x00, 0x2e, 0x01, 0x2e, 115 | 0x40, 0xf0, 0x13, 0x90, 0x20, 0x2f, 0x03, 0x30, 116 | 0x51, 0x50, 0x4f, 0x54, 0xf4, 0x34, 0x06, 0x30, 117 | 0x55, 0x52, 0x55, 0x32, 0x1d, 0x1a, 0xe3, 0x22, 118 | 0x18, 0x1a, 0x53, 0x58, 0xe3, 0x22, 0x04, 0x30, 119 | 0xd5, 0x40, 0xb5, 0x0d, 0xe1, 0xbe, 0x6f, 0xbb, 120 | 0x80, 0x91, 0xa9, 0x0d, 0x01, 0x89, 0xb5, 0x23, 121 | 0x10, 0xa1, 0xf7, 0x2f, 0xda, 0x0e, 0xf4, 0x34, 122 | 0xeb, 0x2f, 0x01, 0x2e, 0x25, 0x00, 0x70, 0x1a, 123 | 0x00, 0x30, 0x21, 0x30, 0x02, 0x2c, 0x08, 0x22, 124 | 0x30, 0x30, 0x00, 0xb2, 0x06, 0x2f, 0x21, 0x2e, 125 | 0x59, 0xf0, 0x98, 0x2e, 0xd8, 0x00, 0x00, 0x2e, 126 | 0x00, 0x2e, 0xd0, 0x2e, 0xfb, 0x6f, 0xf0, 0x5f, 127 | 0xb8, 0x2e, 0x01, 0x2e, 0xb1, 0xf0, 0x59, 0x52, 128 | 0x01, 0x0a, 0x21, 0x2e, 0xb1, 0xf0, 0x01, 0x2e, 129 | 0x1c, 0x01, 0x0f, 0xbc, 0x0f, 0xb8, 0x00, 0x90, 130 | 0x45, 0x50, 0x02, 0x2f, 0xc0, 0x2e, 0x21, 0x2e, 131 | 0xbc, 0xf0, 0xc0, 0x2e, 0x21, 0x2e, 0xba, 0xf0, 132 | 0x1a, 0x24, 0x26, 0x00, 0x80, 0x2e, 0x8f, 0x00, 133 | 0x03, 0x2e, 0x01, 0x01, 0x05, 0x2e, 0x01, 0x01, 134 | 0x92, 0xbd, 0x20, 0x50, 0x03, 0x2e, 0x01, 0x01, 135 | 0xbf, 0xba, 0x21, 0xbd, 0x2f, 0xbb, 0x1f, 0xba, 136 | 0x40, 0x91, 0xf0, 0x7f, 0x04, 0x2f, 0x80, 0x91, 137 | 0x02, 0x2f, 0x00, 0xb3, 0x90, 0x2e, 0xc7, 0xb0, 138 | 0x03, 0x2e, 0x7b, 0x00, 0x01, 0x80, 0x40, 0x90, 139 | 0x14, 0x2f, 0x41, 0x84, 0xf1, 0x6f, 0x25, 0x2e, 140 | 0x7b, 0x00, 0x41, 0x40, 0x23, 0x2e, 0x5a, 0x00, 141 | 0x47, 0x52, 0x12, 0x40, 0x52, 0x42, 0x02, 0x30, 142 | 0x00, 0x40, 0x40, 0x42, 0xe0, 0x5f, 0x25, 0x2e, 143 | 0x57, 0x00, 0x25, 0x2e, 0x58, 0x00, 0x25, 0x2e, 144 | 0x5d, 0x00, 0xb8, 0x2e, 0x07, 0x2e, 0x00, 0x01, 145 | 0x03, 0x2e, 0x01, 0x01, 0x05, 0x2e, 0x00, 0x01, 146 | 0x24, 0xbd, 0x0f, 0x2e, 0x59, 0x00, 0xb5, 0xbd, 147 | 0x93, 0xbc, 0x2f, 0xb9, 0xb5, 0xb9, 0x93, 0xb8, 148 | 0x3a, 0x1a, 0x06, 0x2f, 0x07, 0x30, 0x25, 0x2e, 149 | 0x59, 0x00, 0x2f, 0x2e, 0x57, 0x00, 0x2f, 0x2e, 150 | 0x58, 0x00, 0x40, 0xb3, 0x05, 0x30, 0x07, 0x30, 151 | 0x0a, 0x2f, 0xf7, 0x6f, 0xe6, 0x7f, 0x00, 0x2e, 152 | 0xc6, 0x41, 0x0f, 0x2e, 0x5a, 0x00, 0xb7, 0x05, 153 | 0x80, 0xa9, 0xee, 0x05, 0xf7, 0x23, 0xe6, 0x6f, 154 | 0x80, 0xb3, 0x06, 0x30, 0x09, 0x2f, 0xe7, 0x7f, 155 | 0x00, 0x2e, 0x06, 0x40, 0x0f, 0x2e, 0x5b, 0x00, 156 | 0xb7, 0x05, 0x80, 0xa9, 0xee, 0x05, 0xb7, 0x23, 157 | 0xe7, 0x6f, 0x00, 0xb3, 0x04, 0x30, 0x0b, 0x2f, 158 | 0xf4, 0x6f, 0x02, 0x89, 0xe7, 0x7f, 0x00, 0x2e, 159 | 0x04, 0x41, 0x0f, 0x2e, 0x5c, 0x00, 0x27, 0x05, 160 | 0x00, 0xa9, 0xec, 0x05, 0x27, 0x23, 0xe7, 0x6f, 161 | 0x7b, 0x0f, 0x17, 0x30, 0x0b, 0x2f, 0x73, 0x0f, 162 | 0x05, 0x30, 0x17, 0x30, 0x07, 0x2f, 0x63, 0x0f, 163 | 0x15, 0x30, 0x17, 0x30, 0x00, 0x2f, 0x07, 0x30, 164 | 0xe3, 0x0e, 0x00, 0x2f, 0x05, 0x30, 0x80, 0x90, 165 | 0x05, 0x2e, 0x57, 0x00, 0x13, 0x30, 0x13, 0x29, 166 | 0xf2, 0x6f, 0x47, 0x5c, 0x17, 0x2f, 0xc0, 0x91, 167 | 0x05, 0x30, 0x0b, 0x2f, 0x07, 0x2e, 0x58, 0x00, 168 | 0xc1, 0x86, 0x2b, 0x2e, 0x57, 0x00, 0x59, 0x0e, 169 | 0x27, 0x2e, 0x58, 0x00, 0x24, 0x2f, 0x2b, 0x2e, 170 | 0x5d, 0x00, 0x22, 0x2d, 0x61, 0x0e, 0x29, 0x2e, 171 | 0x57, 0x00, 0x2b, 0x2e, 0x58, 0x00, 0x1b, 0x2f, 172 | 0x27, 0x2e, 0x5d, 0x00, 0x19, 0x2d, 0x40, 0x91, 173 | 0x05, 0x2f, 0x01, 0x30, 0x23, 0x2e, 0x57, 0x00, 174 | 0x23, 0x2e, 0x5d, 0x00, 0x06, 0x2d, 0x29, 0x2e, 175 | 0x57, 0x00, 0x61, 0x0e, 0x01, 0x2f, 0x27, 0x2e, 176 | 0x5d, 0x00, 0x81, 0x40, 0x23, 0x2e, 0x5a, 0x00, 177 | 0x30, 0x25, 0x47, 0x52, 0xd4, 0x40, 0x54, 0x42, 178 | 0x00, 0x2e, 0xc3, 0x40, 0x43, 0x42, 0x00, 0x2e, 179 | 0x03, 0x2e, 0x5d, 0x00, 0x40, 0xb2, 0x0d, 0x2f, 180 | 0x81, 0x40, 0x23, 0x2e, 0x5a, 0x00, 0x11, 0x40, 181 | 0x91, 0x43, 0x01, 0x34, 0x00, 0x40, 0x80, 0x43, 182 | 0x23, 0x2e, 0x5e, 0xf0, 0x03, 0x2d, 0x00, 0x30, 183 | 0x21, 0x2e, 0x7b, 0x00, 0xe0, 0x5f, 0xb8, 0x2e, 184 | 0x50, 0x50, 0xf0, 0x7f, 0x1a, 0x25, 0x13, 0x40, 185 | 0x7b, 0x84, 0xe0, 0x7f, 0x83, 0x42, 0x35, 0x30, 186 | 0x11, 0x40, 0x04, 0x40, 0xc1, 0x7f, 0xd4, 0x7f, 187 | 0x86, 0x31, 0x07, 0x2e, 0x59, 0xf0, 0x03, 0x2e, 188 | 0x1f, 0x01, 0x0d, 0x09, 0x02, 0xab, 0x05, 0x30, 189 | 0x8e, 0x09, 0x2c, 0x23, 0xe3, 0xba, 0x42, 0xab, 190 | 0x16, 0x30, 0x75, 0x23, 0x59, 0x5c, 0x8e, 0x09, 191 | 0x66, 0xbb, 0x82, 0xab, 0x27, 0x30, 0xbe, 0x23, 192 | 0x3e, 0x80, 0x25, 0x1a, 0x06, 0x2f, 0x2e, 0x1a, 193 | 0x04, 0x2f, 0x26, 0x1a, 0x02, 0x2f, 0xf7, 0x3d, 194 | 0x03, 0x2c, 0xdf, 0x08, 0x07, 0x32, 0xdf, 0x0a, 195 | 0x14, 0x01, 0x55, 0x01, 0x04, 0x41, 0x14, 0x42, 196 | 0x16, 0x01, 0x42, 0x41, 0x45, 0x30, 0x4d, 0x09, 197 | 0x04, 0x41, 0x12, 0x42, 0x04, 0x42, 0x40, 0xb3, 198 | 0x04, 0x2f, 0xf0, 0x6f, 0x02, 0x30, 0x04, 0x40, 199 | 0x94, 0x04, 0x02, 0x42, 0x00, 0x32, 0x08, 0x08, 200 | 0x00, 0xb2, 0x00, 0x30, 0x05, 0x2f, 0xe2, 0x6f, 201 | 0x00, 0x2e, 0x84, 0x40, 0x04, 0x05, 0x84, 0x42, 202 | 0x00, 0x2e, 0x5b, 0x54, 0x4a, 0x08, 0x40, 0xb2, 203 | 0xf1, 0x6f, 0x04, 0x2f, 0x42, 0x82, 0x00, 0x2e, 204 | 0x42, 0x40, 0x02, 0x04, 0x40, 0x42, 0xb0, 0x5f, 205 | 0x27, 0x2e, 0x59, 0xf0, 0xb8, 0x2e, 0x50, 0x50, 206 | 0xf7, 0x7f, 0x00, 0x2e, 0x0f, 0x2e, 0xb8, 0xf0, 207 | 0xf8, 0xbf, 0xff, 0xbb, 0xc0, 0xb3, 0x2a, 0x2f, 208 | 0x0f, 0x2e, 0x01, 0xf0, 0xfe, 0xbf, 0xe6, 0x7f, 209 | 0x7e, 0xbb, 0xd5, 0x7f, 0x37, 0x30, 0x5f, 0x5a, 210 | 0xbe, 0x05, 0x67, 0x41, 0xc4, 0x7f, 0x78, 0xbe, 211 | 0x47, 0x41, 0x27, 0x0b, 0xb3, 0x7f, 0xe6, 0x11, 212 | 0x41, 0x56, 0x43, 0x89, 0xd7, 0x42, 0x00, 0x2e, 213 | 0x27, 0x41, 0x05, 0x41, 0xf8, 0xbf, 0x7d, 0x0b, 214 | 0x6e, 0x11, 0x03, 0x8f, 0xd5, 0x42, 0x14, 0x30, 215 | 0xe5, 0x41, 0xc7, 0x41, 0xd8, 0xbe, 0x6f, 0x0b, 216 | 0x6e, 0x11, 0xc5, 0x42, 0x29, 0x2e, 0x56, 0x00, 217 | 0x45, 0x56, 0x27, 0x2e, 0xb8, 0xf0, 0xe6, 0x6f, 218 | 0xd5, 0x6f, 0xc4, 0x6f, 0xb3, 0x6f, 0xf7, 0x6f, 219 | 0xb0, 0x5f, 0xc8, 0x2e, 0x50, 0x50, 0xe5, 0x7f, 220 | 0xd7, 0x7f, 0xf6, 0x7f, 0x36, 0x30, 0x0b, 0x2e, 221 | 0x01, 0xf0, 0xde, 0xbe, 0xde, 0xbb, 0x61, 0x5a, 222 | 0xb7, 0x05, 0x67, 0x41, 0xc4, 0x7f, 0x78, 0xbe, 223 | 0x47, 0x41, 0x27, 0x0b, 0xb3, 0x7f, 0xe6, 0x11, 224 | 0x43, 0x56, 0x43, 0x89, 0xd7, 0x42, 0x00, 0x2e, 225 | 0x27, 0x41, 0x05, 0x41, 0xf8, 0xbf, 0x7d, 0x0b, 226 | 0x6e, 0x11, 0x03, 0x8f, 0xd5, 0x42, 0x14, 0x30, 227 | 0xe5, 0x41, 0xc7, 0x41, 0xd8, 0xbe, 0x6f, 0x0b, 228 | 0x6e, 0x11, 0xc5, 0x42, 0x29, 0x2e, 0x55, 0x00, 229 | 0x03, 0x31, 0x27, 0x2e, 0xb8, 0xf0, 0xf6, 0x6f, 230 | 0xe5, 0x6f, 0xd7, 0x6f, 0xc4, 0x6f, 0xb3, 0x6f, 231 | 0xb0, 0x5f, 0xc8, 0x2e, 0x40, 0x50, 0xf6, 0x7f, 232 | 0x1a, 0x18, 0x63, 0x56, 0x33, 0x00, 0x06, 0x30, 233 | 0xfe, 0x03, 0x0e, 0xb8, 0xf2, 0xbf, 0x07, 0x0a, 234 | 0x2a, 0x18, 0x63, 0x5a, 0xb5, 0x01, 0x03, 0x30, 235 | 0xfb, 0x03, 0x6e, 0xbb, 0xf2, 0xbf, 0xe1, 0x7f, 236 | 0xf7, 0x0b, 0x56, 0x40, 0x36, 0x25, 0x46, 0x40, 237 | 0x06, 0x28, 0xc7, 0x7f, 0x22, 0x18, 0xd1, 0x7f, 238 | 0xb5, 0x00, 0x01, 0x30, 0x39, 0x03, 0x2e, 0xb9, 239 | 0x42, 0xbe, 0x14, 0x0b, 0xf2, 0x6f, 0x10, 0x18, 240 | 0xb5, 0x00, 0xb9, 0x03, 0x2e, 0xb9, 0x62, 0xbf, 241 | 0x96, 0x0a, 0xb6, 0x6f, 0x30, 0x18, 0x75, 0x01, 242 | 0xb9, 0x03, 0x5c, 0x28, 0xe2, 0xbf, 0xde, 0xb9, 243 | 0xd6, 0x6f, 0xdf, 0x0a, 0x8a, 0x28, 0xc4, 0x6f, 244 | 0x82, 0x43, 0x23, 0x29, 0xe5, 0x6f, 0xc0, 0x2e, 245 | 0x44, 0x43, 0xc0, 0x5f, 0x40, 0x50, 0xd0, 0x7f, 246 | 0x4a, 0x17, 0x00, 0x40, 0x01, 0x18, 0x46, 0x25, 247 | 0x07, 0x25, 0x65, 0x56, 0xd9, 0x04, 0x53, 0x18, 248 | 0xeb, 0x18, 0x05, 0x30, 0x49, 0x16, 0x69, 0x06, 249 | 0xca, 0x18, 0xa6, 0x00, 0xc7, 0x02, 0x65, 0x58, 250 | 0xcb, 0x7f, 0x98, 0x2e, 0x7f, 0xb6, 0xcb, 0x6f, 251 | 0xd2, 0x6f, 0xc0, 0x2e, 0x80, 0x42, 0xc0, 0x5f, 252 | 0x09, 0x2e, 0x1b, 0x01, 0x05, 0x2e, 0x1b, 0x01, 253 | 0xa3, 0xbc, 0x44, 0xbe, 0x90, 0x50, 0x4f, 0xb9, 254 | 0x07, 0x2e, 0x1b, 0x01, 0x4a, 0x25, 0x9f, 0xb8, 255 | 0x39, 0x8f, 0xb2, 0xbd, 0xf2, 0x7f, 0xbf, 0xb9, 256 | 0xeb, 0x7f, 0x8a, 0x0a, 0x37, 0x89, 0x0b, 0x30, 257 | 0x93, 0x0a, 0x8b, 0x7f, 0xcb, 0x43, 0x0b, 0x43, 258 | 0x80, 0xb2, 0xd3, 0x7f, 0xc1, 0x7f, 0x90, 0x2e, 259 | 0x87, 0xb2, 0x20, 0x25, 0x01, 0x2e, 0x64, 0x00, 260 | 0x01, 0x90, 0x0e, 0x2f, 0x67, 0x52, 0x01, 0x2e, 261 | 0x61, 0x00, 0xb4, 0x7f, 0xa2, 0x7f, 0x98, 0x2e, 262 | 0x8d, 0xb2, 0x00, 0x30, 0x21, 0x2e, 0x64, 0x00, 263 | 0xc1, 0x6f, 0xd3, 0x6f, 0xa2, 0x6f, 0xb4, 0x6f, 264 | 0x0b, 0x30, 0x01, 0x2e, 0x1b, 0x01, 0x06, 0xbc, 265 | 0x06, 0xbb, 0x57, 0x25, 0x01, 0x2e, 0x1b, 0x01, 266 | 0x94, 0xb1, 0x05, 0xbc, 0xb6, 0x7f, 0x0f, 0xbb, 267 | 0x6b, 0x50, 0x80, 0xb3, 0x0f, 0x2f, 0x0d, 0x2e, 268 | 0x1b, 0x01, 0x6f, 0x5e, 0xb7, 0x09, 0x2d, 0x2e, 269 | 0x1b, 0x01, 0x71, 0x5c, 0x69, 0x5e, 0x9b, 0x43, 270 | 0x9b, 0x43, 0xdb, 0x43, 0x9b, 0x43, 0x1b, 0x42, 271 | 0xcb, 0x43, 0x0b, 0x42, 0x8b, 0x43, 0x40, 0xb2, 272 | 0x05, 0x2f, 0x69, 0x50, 0x00, 0x2e, 0x16, 0x40, 273 | 0x0b, 0x40, 0x76, 0x7f, 0x8b, 0x7f, 0xcb, 0x0a, 274 | 0x01, 0x2e, 0x61, 0x00, 0x67, 0x52, 0x6d, 0x5c, 275 | 0x98, 0x2e, 0xd3, 0xb2, 0x90, 0x6f, 0x00, 0xb2, 276 | 0x0b, 0x2f, 0xf0, 0x6f, 0x00, 0xb2, 0x08, 0x2f, 277 | 0x69, 0x58, 0x6b, 0x50, 0x12, 0x41, 0x12, 0x42, 278 | 0x21, 0x30, 0x04, 0x41, 0x04, 0x42, 0x23, 0x2e, 279 | 0x5e, 0xf0, 0xc0, 0x6f, 0x00, 0xb2, 0x26, 0x2f, 280 | 0x74, 0x6f, 0x80, 0x6f, 0x71, 0x54, 0x88, 0xbd, 281 | 0xc8, 0xb8, 0x4b, 0x0a, 0x94, 0x42, 0x91, 0x42, 282 | 0x90, 0x42, 0x88, 0xba, 0x69, 0x52, 0xf3, 0x6f, 283 | 0x54, 0x42, 0x85, 0x42, 0xc0, 0x90, 0x40, 0x42, 284 | 0x15, 0x2f, 0x6b, 0x52, 0x00, 0x2e, 0x52, 0x40, 285 | 0x41, 0x40, 0xa2, 0x04, 0x41, 0x06, 0x40, 0xaa, 286 | 0x04, 0x2f, 0x40, 0x90, 0x0b, 0x2f, 0xb1, 0x6f, 287 | 0x4a, 0x0f, 0x08, 0x2f, 0xb2, 0x6f, 0x80, 0xb2, 288 | 0x05, 0x2f, 0x6b, 0x54, 0x21, 0x30, 0x94, 0x42, 289 | 0x80, 0x42, 0x23, 0x2e, 0x5e, 0xf0, 0xd0, 0x6f, 290 | 0x00, 0xb2, 0x13, 0x2f, 0x01, 0x2e, 0x60, 0x00, 291 | 0x09, 0x2e, 0x7c, 0x00, 0x04, 0x1a, 0x0d, 0x2f, 292 | 0x73, 0x50, 0x29, 0x2e, 0x60, 0x00, 0x24, 0x42, 293 | 0x44, 0x30, 0x02, 0x40, 0x02, 0x42, 0x09, 0x80, 294 | 0x00, 0x2e, 0x04, 0x42, 0x03, 0x2d, 0x10, 0x30, 295 | 0x21, 0x2e, 0x64, 0x00, 0xeb, 0x6f, 0x70, 0x5f, 296 | 0xb8, 0x2e, 0x09, 0x86, 0x49, 0x54, 0xe4, 0x40, 297 | 0xc3, 0x80, 0x94, 0x04, 0xc3, 0x40, 0x13, 0x05, 298 | 0x05, 0x40, 0x25, 0x05, 0x8a, 0x17, 0x73, 0x30, 299 | 0x73, 0x09, 0x8c, 0x17, 0xf3, 0x08, 0xe3, 0x00, 300 | 0x4c, 0x82, 0x95, 0x00, 0xb3, 0xb5, 0x23, 0xb5, 301 | 0x53, 0x42, 0x52, 0x42, 0x53, 0x42, 0x42, 0x42, 302 | 0x71, 0x82, 0x75, 0x54, 0x52, 0x42, 0x10, 0x50, 303 | 0x77, 0x54, 0x52, 0x42, 0xfb, 0x7f, 0x22, 0x30, 304 | 0x79, 0x56, 0x43, 0x42, 0x44, 0x82, 0x0b, 0x30, 305 | 0x52, 0x42, 0x5b, 0x42, 0x7c, 0x84, 0x4b, 0x42, 306 | 0x35, 0x82, 0x8c, 0x80, 0x8b, 0x42, 0x0b, 0x42, 307 | 0x39, 0x80, 0x04, 0x30, 0x0b, 0x42, 0x37, 0x80, 308 | 0x15, 0x30, 0x60, 0x25, 0x98, 0x2e, 0xc6, 0xb2, 309 | 0x8b, 0x83, 0xfb, 0x6f, 0x65, 0x42, 0xc0, 0x2e, 310 | 0x44, 0x42, 0xf0, 0x5f, 0x05, 0x80, 0x02, 0x30, 311 | 0x51, 0x82, 0x02, 0x42, 0x13, 0x30, 0x41, 0x40, 312 | 0x4b, 0x08, 0x7b, 0x54, 0x3e, 0x80, 0x51, 0x14, 313 | 0xc0, 0x2e, 0x01, 0x42, 0x00, 0x2e, 0x40, 0x51, 314 | 0xd1, 0x7f, 0x12, 0x25, 0x02, 0x30, 0x42, 0x43, 315 | 0x32, 0x30, 0x82, 0x43, 0xc6, 0x7f, 0xe5, 0x7f, 316 | 0xb4, 0x7f, 0xa3, 0x7f, 0x90, 0x7f, 0x8b, 0x7f, 317 | 0x98, 0x2e, 0x54, 0x01, 0xc0, 0x7e, 0x00, 0xac, 318 | 0x01, 0x2f, 0x65, 0x50, 0xc0, 0x7e, 0x00, 0x2e, 319 | 0x90, 0x6f, 0x09, 0x8a, 0xd1, 0x6f, 0x75, 0x7f, 320 | 0x4c, 0x82, 0x63, 0x41, 0x65, 0x7f, 0x11, 0x7f, 321 | 0x00, 0x2e, 0x64, 0x41, 0x44, 0x85, 0x52, 0x7f, 322 | 0x45, 0x7f, 0x00, 0x2e, 0xa6, 0x40, 0x80, 0x40, 323 | 0x32, 0x7f, 0x82, 0x8e, 0xc2, 0x6e, 0x45, 0x41, 324 | 0xf0, 0x7f, 0x27, 0x7f, 0x02, 0x7f, 0x98, 0x2e, 325 | 0x8a, 0xb1, 0x23, 0x6f, 0xd1, 0x6f, 0xc2, 0x40, 326 | 0xf9, 0x86, 0x23, 0x7f, 0x80, 0xb2, 0xe0, 0x7e, 327 | 0x0f, 0x2f, 0x32, 0x6f, 0x64, 0x6f, 0x82, 0x40, 328 | 0xf2, 0x7f, 0x4e, 0x82, 0x42, 0x6f, 0x50, 0x6f, 329 | 0x73, 0x6f, 0x85, 0x40, 0xc3, 0x40, 0x04, 0x41, 330 | 0x06, 0x40, 0xe2, 0x6e, 0x98, 0x2e, 0x8a, 0xb1, 331 | 0xe0, 0x7e, 0xf3, 0x31, 0x10, 0x6f, 0x36, 0x80, 332 | 0xe1, 0x6e, 0x02, 0x40, 0x71, 0x7f, 0x51, 0x04, 333 | 0x02, 0x30, 0x40, 0xa8, 0x91, 0x04, 0x4a, 0x22, 334 | 0x89, 0x16, 0x93, 0x08, 0x4a, 0x00, 0x95, 0xb4, 335 | 0x09, 0x18, 0x8e, 0x16, 0x13, 0x30, 0x93, 0x08, 336 | 0x21, 0x6f, 0x60, 0x7f, 0x4d, 0x86, 0x02, 0x80, 337 | 0xb2, 0x00, 0x41, 0x40, 0x21, 0xb5, 0x50, 0x7f, 338 | 0x43, 0x7f, 0x98, 0x2e, 0xc2, 0xb1, 0x40, 0x6f, 339 | 0x62, 0x6f, 0x55, 0x6f, 0x13, 0x40, 0x84, 0x40, 340 | 0x01, 0x40, 0x45, 0x41, 0x42, 0xbe, 0x1d, 0x18, 341 | 0x4c, 0x04, 0x31, 0x0f, 0x04, 0x8a, 0xc0, 0x6f, 342 | 0x11, 0x30, 0x02, 0x2f, 0x00, 0x2e, 0x03, 0x2c, 343 | 0x01, 0x42, 0x23, 0x30, 0x03, 0x42, 0x00, 0x2e, 344 | 0xd6, 0x6f, 0x44, 0x41, 0x8a, 0x87, 0x76, 0x8b, 345 | 0x00, 0xb3, 0x53, 0x7f, 0x15, 0x2f, 0x04, 0x6f, 346 | 0x7d, 0x5e, 0x8b, 0x8d, 0xe7, 0x01, 0xc0, 0xa5, 347 | 0x84, 0x41, 0x01, 0x2f, 0x00, 0xa1, 0x03, 0x2f, 348 | 0xc0, 0xad, 0x08, 0x2f, 0x00, 0xa5, 0x06, 0x2f, 349 | 0xc6, 0x40, 0x81, 0x8d, 0x07, 0x30, 0x3c, 0x05, 350 | 0xd6, 0x42, 0x04, 0x2c, 0xc4, 0x42, 0x02, 0x2c, 351 | 0x07, 0x30, 0x07, 0x30, 0x86, 0x86, 0x94, 0x6f, 352 | 0xd7, 0x7e, 0x0e, 0x8d, 0x00, 0x40, 0x74, 0x89, 353 | 0xc7, 0x40, 0x02, 0xb2, 0xf9, 0x29, 0x45, 0x41, 354 | 0x86, 0x41, 0xbe, 0x80, 0x21, 0x41, 0x75, 0x23, 355 | 0x82, 0x40, 0xc7, 0x42, 0x45, 0x7f, 0x34, 0x7f, 356 | 0x20, 0x7f, 0x98, 0x2e, 0xc2, 0xb1, 0x31, 0x6f, 357 | 0x60, 0x6f, 0x24, 0x6f, 0x22, 0x40, 0x05, 0x41, 358 | 0x43, 0x40, 0x13, 0x01, 0x43, 0x86, 0xac, 0x0f, 359 | 0xd1, 0x6f, 0x30, 0x7f, 0x00, 0x2f, 0x44, 0x42, 360 | 0x48, 0x8a, 0x41, 0x88, 0xe1, 0x40, 0x13, 0x7f, 361 | 0x04, 0x7f, 0xf5, 0x7e, 0x98, 0x2e, 0xc2, 0xb1, 362 | 0x11, 0x6f, 0x60, 0x6f, 0x34, 0x6f, 0x42, 0x40, 363 | 0x03, 0x40, 0x9a, 0x04, 0x04, 0x41, 0x43, 0x82, 364 | 0xa2, 0x0e, 0x03, 0x6f, 0x00, 0x2f, 0xc2, 0x42, 365 | 0x00, 0x2e, 0x41, 0x40, 0x72, 0x6f, 0x98, 0x2e, 366 | 0xc2, 0xb1, 0x25, 0x6f, 0x72, 0x6f, 0x53, 0x41, 367 | 0x93, 0x0e, 0xd1, 0x6f, 0x46, 0x80, 0x1b, 0x30, 368 | 0x03, 0x30, 0x0c, 0x2f, 0x04, 0x40, 0x00, 0x91, 369 | 0x42, 0x42, 0x08, 0x2f, 0xf6, 0x6e, 0x44, 0x6f, 370 | 0x86, 0x41, 0xb4, 0x0e, 0x03, 0x2f, 0x02, 0x88, 371 | 0xdb, 0x7e, 0x03, 0x43, 0x0b, 0x42, 0x46, 0x8d, 372 | 0x44, 0x41, 0x47, 0x80, 0x05, 0x6f, 0x94, 0x0f, 373 | 0x76, 0x7f, 0x60, 0x7f, 0x02, 0x2f, 0x45, 0x89, 374 | 0x42, 0x43, 0x03, 0x43, 0x49, 0x88, 0xa5, 0x6f, 375 | 0x40, 0x91, 0xa4, 0x7f, 0x15, 0x30, 0xe2, 0x6f, 376 | 0xd3, 0x6e, 0x03, 0x2f, 0x04, 0x30, 0x83, 0x42, 377 | 0x80, 0x2e, 0x77, 0xb4, 0x04, 0x40, 0x25, 0x29, 378 | 0x04, 0x42, 0x83, 0x42, 0x45, 0x82, 0x94, 0x6f, 379 | 0x04, 0x85, 0xc0, 0xb2, 0x90, 0x2e, 0x63, 0xb4, 380 | 0x15, 0x87, 0x3c, 0x8c, 0xc4, 0x40, 0x46, 0x7f, 381 | 0xc2, 0x86, 0x07, 0x40, 0x86, 0x41, 0xf4, 0xbf, 382 | 0x00, 0xb3, 0x0c, 0x2f, 0x90, 0x6f, 0x16, 0x80, 383 | 0x46, 0x25, 0x00, 0x40, 0x57, 0x25, 0x04, 0x18, 384 | 0xae, 0x0e, 0x10, 0x30, 0x06, 0x30, 0x75, 0x25, 385 | 0x46, 0x23, 0x60, 0x6f, 0x64, 0x25, 0xc4, 0x40, 386 | 0xfa, 0x86, 0x00, 0xb3, 0x33, 0x7f, 0x09, 0x2f, 387 | 0x93, 0x6f, 0xd8, 0x88, 0x53, 0x6f, 0x04, 0x41, 388 | 0xc3, 0x40, 0xdc, 0x0e, 0x13, 0x30, 0x04, 0x30, 389 | 0xdc, 0x22, 0xb3, 0x25, 0x40, 0xb3, 0x02, 0x2f, 390 | 0x3b, 0x25, 0xc0, 0x90, 0x05, 0x2f, 0x91, 0x6f, 391 | 0xd0, 0x6f, 0x98, 0x2e, 0xc6, 0xb2, 0x4d, 0x2c, 392 | 0x04, 0x30, 0x8d, 0x88, 0x43, 0x40, 0x82, 0x40, 393 | 0x54, 0x7f, 0xda, 0x0f, 0x04, 0x30, 0x08, 0x2f, 394 | 0xc1, 0x80, 0x40, 0x42, 0xc2, 0x0f, 0x02, 0x2f, 395 | 0x00, 0x30, 0xc0, 0x7e, 0x1b, 0x2d, 0xc0, 0x7e, 396 | 0x19, 0x2d, 0xe1, 0xbc, 0x92, 0x6f, 0x4f, 0x04, 397 | 0x90, 0x84, 0x40, 0xa8, 0x21, 0x05, 0x83, 0x40, 398 | 0x4c, 0x22, 0x4b, 0x0e, 0xb6, 0x84, 0x21, 0x30, 399 | 0x02, 0x2f, 0x11, 0x30, 0x04, 0x2c, 0xc1, 0x7e, 400 | 0xe3, 0x6f, 0xc1, 0x7e, 0xc1, 0x42, 0x00, 0x2e, 401 | 0x00, 0x40, 0x81, 0x40, 0x04, 0xbd, 0x40, 0x6f, 402 | 0x98, 0x2e, 0xc2, 0xb1, 0x50, 0x6f, 0x11, 0x30, 403 | 0x02, 0x40, 0x51, 0x08, 0xc3, 0x6e, 0x03, 0x80, 404 | 0x99, 0x15, 0x0b, 0x40, 0xb1, 0x6f, 0xd0, 0x6f, 405 | 0xb6, 0x7f, 0x5b, 0x7f, 0x04, 0x30, 0x4d, 0x54, 406 | 0x03, 0x30, 0x11, 0x2c, 0x10, 0x80, 0x55, 0x6f, 407 | 0x06, 0x40, 0x75, 0x01, 0x58, 0xbb, 0x6a, 0x09, 408 | 0x05, 0x42, 0xc1, 0x86, 0x47, 0x40, 0x51, 0x25, 409 | 0xbe, 0x01, 0x56, 0x43, 0x00, 0x2e, 0x46, 0x41, 410 | 0xf4, 0x03, 0xb6, 0x6f, 0x47, 0x43, 0x5e, 0x0e, 411 | 0xed, 0x2f, 0x31, 0x6f, 0x60, 0x6f, 0x42, 0x40, 412 | 0x15, 0x30, 0x02, 0x82, 0x95, 0x08, 0x04, 0x42, 413 | 0x52, 0x42, 0x02, 0x2c, 0x44, 0x42, 0x04, 0x30, 414 | 0x3e, 0x8e, 0x91, 0x6f, 0x4f, 0x8c, 0x02, 0x40, 415 | 0x83, 0x41, 0xb5, 0x8d, 0x93, 0x0e, 0xd0, 0x6f, 416 | 0x01, 0x2f, 0x98, 0x2e, 0xc6, 0xb2, 0x00, 0x2e, 417 | 0xc0, 0x41, 0x81, 0x41, 0xc1, 0x0f, 0xc0, 0x6f, 418 | 0x01, 0x2f, 0x04, 0x42, 0x00, 0x2e, 0x70, 0x6f, 419 | 0x3c, 0x82, 0x00, 0x40, 0x41, 0x40, 0x89, 0x16, 420 | 0x95, 0x08, 0x4a, 0x00, 0x04, 0xbc, 0x91, 0xb4, 421 | 0x01, 0x0e, 0xe0, 0x6f, 0x07, 0x2f, 0xa1, 0x6f, 422 | 0x00, 0x2e, 0x41, 0x40, 0x40, 0xb2, 0x02, 0x2f, 423 | 0xa1, 0x6f, 0x05, 0x42, 0x44, 0x42, 0x00, 0x2e, 424 | 0x8b, 0x6f, 0xc0, 0x5e, 0xb8, 0x2e, 0x03, 0x2e, 425 | 0x1c, 0x01, 0x9c, 0xbc, 0x1d, 0xb9, 0x02, 0x82, 426 | 0x25, 0x2e, 0x8e, 0x00, 0x83, 0x56, 0x13, 0x18, 427 | 0x01, 0x2e, 0x66, 0x00, 0x43, 0x40, 0xd8, 0x04, 428 | 0x05, 0x2e, 0x65, 0x00, 0x40, 0x50, 0x27, 0x2e, 429 | 0x65, 0x00, 0xfb, 0x7f, 0xda, 0x05, 0x8b, 0x50, 430 | 0x4b, 0x40, 0x02, 0x40, 0x81, 0x82, 0x01, 0x42, 431 | 0x03, 0x80, 0x81, 0x52, 0xb1, 0x00, 0x03, 0x40, 432 | 0x3b, 0x82, 0x85, 0x58, 0x14, 0x01, 0xc0, 0xb2, 433 | 0x37, 0x2e, 0x66, 0x00, 0xd1, 0x7f, 0xe2, 0x7f, 434 | 0x04, 0x2f, 0x05, 0x2e, 0x6b, 0x00, 0x81, 0x84, 435 | 0x25, 0x2e, 0x6b, 0x00, 0x62, 0x40, 0x3a, 0x0f, 436 | 0x45, 0x40, 0xc1, 0x7f, 0x21, 0x30, 0x12, 0x30, 437 | 0x42, 0x2f, 0x0d, 0x2e, 0x69, 0x00, 0x3e, 0x0e, 438 | 0x33, 0x2f, 0x05, 0x2e, 0x6a, 0x00, 0x01, 0x35, 439 | 0x91, 0x0e, 0x01, 0x30, 0x03, 0x2f, 0x09, 0x2e, 440 | 0x6e, 0x00, 0x00, 0xb3, 0x24, 0x2f, 0xc0, 0x35, 441 | 0x90, 0x0e, 0x39, 0x2f, 0x8f, 0x50, 0x02, 0x30, 442 | 0x01, 0x40, 0x7f, 0x82, 0x43, 0xa2, 0x02, 0x2f, 443 | 0x00, 0x2e, 0x0c, 0x2c, 0x01, 0x30, 0xc0, 0xb2, 444 | 0x11, 0x30, 0x02, 0x2f, 0x25, 0x2e, 0x6d, 0x00, 445 | 0x03, 0x2d, 0x23, 0x2e, 0x6d, 0x00, 0x21, 0x30, 446 | 0x25, 0x2e, 0x6b, 0x00, 0x42, 0xb2, 0x04, 0x2f, 447 | 0x41, 0xb2, 0x02, 0x2f, 0x25, 0x2e, 0x6d, 0x00, 448 | 0x31, 0x30, 0x3e, 0x80, 0x04, 0x86, 0x25, 0x2e, 449 | 0x6c, 0x00, 0x02, 0x42, 0xc2, 0x42, 0x18, 0x2d, 450 | 0x02, 0x35, 0x01, 0x42, 0x25, 0x2e, 0x6a, 0x00, 451 | 0x13, 0x2d, 0x2c, 0x04, 0x38, 0x1e, 0x21, 0x2e, 452 | 0x69, 0x00, 0x7f, 0x50, 0x11, 0x30, 0x22, 0x30, 453 | 0x98, 0x2e, 0x66, 0xb5, 0x09, 0x2c, 0x01, 0x30, 454 | 0x2c, 0x00, 0x38, 0x1c, 0x21, 0x2e, 0x68, 0x00, 455 | 0x7f, 0x50, 0x98, 0x2e, 0x66, 0xb5, 0x01, 0x30, 456 | 0xc0, 0x6f, 0xd4, 0xb1, 0xf5, 0xbd, 0x6b, 0xba, 457 | 0x91, 0x5a, 0x02, 0x40, 0x15, 0x18, 0xf5, 0xbe, 458 | 0xeb, 0xbb, 0xe3, 0x0a, 0x3d, 0x0b, 0xd2, 0x6f, 459 | 0xe3, 0x00, 0x84, 0x40, 0x63, 0x05, 0x93, 0x58, 460 | 0x2c, 0x18, 0xf5, 0xbe, 0x03, 0x42, 0xeb, 0xbb, 461 | 0xfd, 0x0b, 0xe0, 0x6f, 0x58, 0x01, 0xdf, 0x01, 462 | 0x7d, 0x1f, 0x95, 0x42, 0x18, 0x04, 0x85, 0x40, 463 | 0x5d, 0x05, 0x2c, 0x18, 0x75, 0xbe, 0xeb, 0xba, 464 | 0x2c, 0x0b, 0xdc, 0x04, 0x18, 0x1c, 0x80, 0x42, 465 | 0x84, 0x80, 0x02, 0x30, 0x00, 0x40, 0x00, 0xb2, 466 | 0x0c, 0x2f, 0x01, 0x2e, 0x6b, 0x00, 0x03, 0x35, 467 | 0x83, 0x0e, 0x07, 0x2f, 0x8d, 0x50, 0x3e, 0x80, 468 | 0x25, 0x2e, 0x6d, 0x00, 0x02, 0x42, 0x03, 0x80, 469 | 0x00, 0x2e, 0x02, 0x42, 0x40, 0xb2, 0x04, 0x2f, 470 | 0x8b, 0x50, 0x04, 0x80, 0x25, 0x2e, 0x6a, 0x00, 471 | 0x02, 0x42, 0x42, 0xb2, 0x89, 0x56, 0x9a, 0x22, 472 | 0x41, 0xb2, 0x01, 0x2e, 0x1c, 0x01, 0x87, 0x52, 473 | 0x0b, 0xbc, 0x8a, 0x22, 0x0f, 0xb8, 0x00, 0x90, 474 | 0x01, 0x32, 0x06, 0x2f, 0x10, 0x30, 0x90, 0x08, 475 | 0x80, 0xb2, 0x08, 0x2f, 0x23, 0x2e, 0x5e, 0xf0, 476 | 0x06, 0x2d, 0x20, 0x30, 0x90, 0x08, 0x80, 0xb2, 477 | 0x01, 0x2f, 0x23, 0x2e, 0x5e, 0xf0, 0xfb, 0x6f, 478 | 0xc0, 0x5f, 0xb8, 0x2e, 0x07, 0x86, 0xfc, 0x88, 479 | 0xc6, 0x40, 0x05, 0x41, 0x31, 0x1a, 0x12, 0x2f, 480 | 0x80, 0x91, 0x22, 0x2f, 0x01, 0x35, 0x29, 0x0f, 481 | 0x0a, 0x2f, 0x06, 0x80, 0x00, 0x2e, 0x00, 0x40, 482 | 0x00, 0xb2, 0x01, 0x2f, 0x44, 0xa9, 0x03, 0x2f, 483 | 0x00, 0x30, 0xc0, 0x42, 0x00, 0x43, 0xb8, 0x2e, 484 | 0xc2, 0x42, 0x01, 0x43, 0xb8, 0x2e, 0x01, 0x35, 485 | 0xa9, 0x0e, 0x0e, 0x2f, 0x03, 0x3b, 0xeb, 0x00, 486 | 0xcc, 0xa8, 0x0a, 0x2f, 0x05, 0x86, 0xc2, 0x80, 487 | 0xc3, 0x40, 0x02, 0x42, 0x3c, 0x84, 0xc1, 0x80, 488 | 0x81, 0x42, 0x82, 0x84, 0xc0, 0x2e, 0x80, 0x42, 489 | 0x00, 0x2e, 0xb8, 0x2e, 0x03, 0x2e, 0x1d, 0x01, 490 | 0x9f, 0xbc, 0x9f, 0xb8, 0x90, 0x50, 0x40, 0xb2, 491 | 0x90, 0x2e, 0x71, 0xb6, 0x12, 0x40, 0x03, 0x30, 492 | 0x11, 0x40, 0x80, 0xa8, 0x5a, 0x05, 0x9f, 0x58, 493 | 0x55, 0x23, 0x00, 0x40, 0x75, 0x7f, 0x40, 0xa8, 494 | 0x16, 0x41, 0xd9, 0x05, 0xcf, 0x23, 0x56, 0x05, 495 | 0x40, 0xa9, 0x9d, 0x05, 0x87, 0x7f, 0x6e, 0x23, 496 | 0x17, 0x41, 0xa5, 0x7f, 0x3e, 0x8b, 0x04, 0x41, 497 | 0x52, 0x43, 0x00, 0xa8, 0x98, 0x05, 0xf2, 0x7f, 498 | 0x86, 0x22, 0xcf, 0x05, 0xc0, 0xa9, 0x9f, 0x05, 499 | 0xbe, 0x23, 0x04, 0x05, 0x92, 0x7f, 0x00, 0xa9, 500 | 0xdc, 0x05, 0x51, 0x43, 0xb6, 0x7f, 0x27, 0x23, 501 | 0xa7, 0x54, 0xe1, 0x7f, 0x02, 0x18, 0x7d, 0x83, 502 | 0x40, 0x43, 0xeb, 0xba, 0x75, 0xbd, 0xaa, 0x0a, 503 | 0x0b, 0x2e, 0x71, 0x00, 0x77, 0x5c, 0x2e, 0x18, 504 | 0xf5, 0xbe, 0x6b, 0xbb, 0x75, 0x0b, 0xaa, 0x00, 505 | 0xc4, 0x7f, 0x25, 0x2e, 0x71, 0x00, 0xb2, 0x6f, 506 | 0xa5, 0x6f, 0xaa, 0x00, 0x54, 0x01, 0x84, 0x6f, 507 | 0x72, 0x6f, 0x94, 0x05, 0x80, 0xa9, 0xde, 0x05, 508 | 0xb7, 0x23, 0x99, 0x5e, 0x77, 0x0e, 0x41, 0x40, 509 | 0x97, 0x5c, 0xb1, 0x01, 0xd5, 0x7f, 0x00, 0x2e, 510 | 0x85, 0x41, 0x0e, 0x2f, 0x00, 0xa0, 0x0c, 0x2f, 511 | 0x14, 0x0f, 0x04, 0x2f, 0xe0, 0x6f, 0x00, 0xac, 512 | 0x10, 0x30, 0x08, 0x2c, 0x18, 0x22, 0xf0, 0x6f, 513 | 0x00, 0xac, 0x30, 0x30, 0x24, 0x30, 0x02, 0x2c, 514 | 0x20, 0x22, 0x40, 0x30, 0x0d, 0x2e, 0x71, 0x00, 515 | 0x80, 0xa1, 0x1e, 0x23, 0x79, 0x5e, 0x37, 0x0f, 516 | 0xbc, 0x23, 0x00, 0x90, 0x14, 0x30, 0x10, 0x30, 517 | 0x18, 0x2f, 0x9d, 0x50, 0x30, 0x00, 0x9b, 0x56, 518 | 0x43, 0x0e, 0x02, 0x2f, 0x10, 0x30, 0x0a, 0x2c, 519 | 0x03, 0x30, 0x99, 0x50, 0x10, 0x0e, 0x13, 0x30, 520 | 0x00, 0x2f, 0x03, 0x30, 0x90, 0x0f, 0x10, 0x30, 521 | 0x00, 0x2f, 0x00, 0x30, 0x00, 0x90, 0x10, 0x30, 522 | 0x00, 0x2f, 0x00, 0x30, 0xc0, 0x90, 0x13, 0x30, 523 | 0x00, 0x2f, 0x03, 0x30, 0x40, 0xb2, 0x87, 0x5c, 524 | 0x22, 0x2f, 0x41, 0x90, 0x4a, 0x2f, 0xa5, 0x50, 525 | 0x00, 0x2e, 0x01, 0x40, 0x41, 0x82, 0x01, 0x42, 526 | 0x02, 0x80, 0x4a, 0xa8, 0x01, 0x40, 0x06, 0x2f, 527 | 0xd0, 0x6f, 0x85, 0x0e, 0x3e, 0x2f, 0x41, 0x80, 528 | 0x21, 0x2e, 0x78, 0x00, 0x3b, 0x2d, 0x95, 0x50, 529 | 0xfb, 0x7f, 0x4a, 0xa8, 0x06, 0x2f, 0x98, 0x2e, 530 | 0x73, 0xb6, 0xc0, 0x90, 0xfb, 0x6f, 0x32, 0x2f, 531 | 0x00, 0x2e, 0x30, 0x2d, 0x98, 0x2e, 0x73, 0xb6, 532 | 0x29, 0x2e, 0x7a, 0x00, 0x2b, 0x2c, 0xfb, 0x6f, 533 | 0xa1, 0x52, 0xd2, 0x6f, 0x95, 0x0e, 0x41, 0x40, 534 | 0x05, 0x2f, 0x00, 0x90, 0x17, 0x2f, 0x05, 0x2e, 535 | 0x7a, 0x00, 0x80, 0x90, 0x13, 0x2f, 0x7f, 0x82, 536 | 0x40, 0xac, 0x23, 0x2e, 0x77, 0x00, 0x01, 0x30, 537 | 0x18, 0x2f, 0xa1, 0x54, 0x82, 0x84, 0x23, 0x2e, 538 | 0x77, 0x00, 0x82, 0x40, 0x80, 0xb2, 0x11, 0x2f, 539 | 0x00, 0x90, 0x23, 0x2e, 0x79, 0x00, 0x0d, 0x2f, 540 | 0x29, 0x2e, 0x72, 0x00, 0x0b, 0x2d, 0x41, 0x80, 541 | 0x21, 0x2e, 0x77, 0x00, 0x0f, 0xa4, 0x05, 0x2f, 542 | 0xa3, 0x50, 0x3e, 0x80, 0xf1, 0x30, 0x29, 0x2e, 543 | 0x79, 0x00, 0x01, 0x42, 0x06, 0x30, 0x34, 0x08, 544 | 0x00, 0xb2, 0x02, 0x2f, 0x80, 0x30, 0x21, 0x2e, 545 | 0x5e, 0xf0, 0x70, 0x5f, 0xb8, 0x2e, 0x04, 0x84, 546 | 0x01, 0x30, 0x81, 0x42, 0x82, 0x84, 0x01, 0x42, 547 | 0xa1, 0x42, 0x81, 0x42, 0x82, 0x84, 0x00, 0x2e, 548 | 0x91, 0x42, 0x81, 0x42, 0xb8, 0x2e, 0x30, 0x50, 549 | 0xf3, 0x7f, 0xc0, 0xac, 0xe4, 0x7f, 0xd5, 0x7f, 550 | 0x03, 0x2f, 0x00, 0x30, 0x82, 0x04, 0xf3, 0x6f, 551 | 0xc3, 0x06, 0x40, 0xad, 0x05, 0x2f, 0xe0, 0x6f, 552 | 0x05, 0x30, 0x28, 0x04, 0xd1, 0x6f, 0x69, 0x07, 553 | 0xe0, 0x7f, 0x40, 0xa1, 0x01, 0x30, 0x20, 0x2f, 554 | 0x13, 0x25, 0x02, 0x25, 0x04, 0x32, 0x06, 0x30, 555 | 0x02, 0x30, 0x03, 0x30, 0xaf, 0xbb, 0xb1, 0xbd, 556 | 0xdf, 0x0a, 0x9f, 0xbb, 0x21, 0xbd, 0x97, 0x0a, 557 | 0x8f, 0xbb, 0x91, 0xbc, 0x01, 0xbc, 0x4f, 0x0a, 558 | 0x6b, 0x0e, 0x04, 0x2f, 0x6b, 0x1a, 0x07, 0x2f, 559 | 0xe7, 0x6f, 0x7a, 0x0f, 0x04, 0x2f, 0xe7, 0x6f, 560 | 0x97, 0x04, 0x17, 0x30, 0x07, 0x0a, 0xdd, 0x06, 561 | 0x81, 0x8d, 0x34, 0x0e, 0xe6, 0x2f, 0x00, 0x2e, 562 | 0x0d, 0x2d, 0x6b, 0x0e, 0x00, 0x30, 0x05, 0x2f, 563 | 0x6b, 0x1a, 0x07, 0x2f, 0xe0, 0x6f, 0x42, 0x0f, 564 | 0x00, 0x30, 0x03, 0x2f, 0xe0, 0x6f, 0x90, 0x04, 565 | 0xdd, 0x06, 0x10, 0x30, 0xf5, 0x6f, 0xc3, 0x7f, 566 | 0xb2, 0x7f, 0x40, 0xad, 0x06, 0x2f, 0x03, 0x30, 567 | 0xb2, 0x6f, 0x9a, 0x04, 0xc4, 0x6f, 0xdc, 0x06, 568 | 0xb2, 0x7f, 0xc3, 0x7f, 0x00, 0x2e, 0xd2, 0x6f, 569 | 0xaa, 0x0c, 0x80, 0xac, 0x02, 0x30, 0x01, 0x2f, 570 | 0x10, 0x04, 0x51, 0x06, 0xd0, 0x5f, 0xb8, 0x2e, 571 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 572 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 573 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 574 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 575 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 576 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 577 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 578 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 579 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 580 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 581 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 582 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 583 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 584 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 585 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 586 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 587 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 588 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 589 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 590 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 591 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 592 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 593 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 594 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 595 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 596 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 597 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 598 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 599 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 600 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 601 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 602 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 603 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 604 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 605 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 606 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 607 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 608 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 609 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 610 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 611 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 612 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 613 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 614 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 615 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 616 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 617 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 618 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 619 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 620 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 621 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 622 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 623 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 624 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 625 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 626 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 627 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 628 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 629 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 630 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 631 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 632 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 633 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 634 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 635 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 636 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 637 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 638 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 639 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 640 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 641 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 642 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 643 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 644 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 645 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 646 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 647 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 648 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 649 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 650 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 651 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 652 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 653 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 654 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 655 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 656 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 657 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 658 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 659 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 660 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 661 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 662 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 663 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 664 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 665 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 666 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 667 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 668 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 669 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 670 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 671 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 672 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 673 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 674 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 675 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 676 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 677 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 678 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 679 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 680 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 681 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 682 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 683 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 684 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 685 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 686 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 687 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 688 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 689 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 690 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 691 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 692 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 693 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 694 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 695 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 696 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 697 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 698 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 699 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 700 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 701 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 702 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 703 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 704 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 705 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 706 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 707 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 708 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 709 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 710 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 711 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 712 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 713 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 714 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 715 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 716 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 717 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 718 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 719 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 720 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 721 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 722 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 723 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 724 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 725 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 726 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 727 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 728 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 729 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 730 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 731 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 732 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 733 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 734 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 735 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 736 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 737 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 738 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 739 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 740 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 741 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 742 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 743 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 744 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 745 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 746 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 747 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 748 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 749 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 750 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 751 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 752 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 753 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 754 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 755 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 756 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 757 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 758 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 759 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 760 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 761 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 762 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 763 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 764 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 765 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 766 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 767 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 768 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 769 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 770 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 771 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 772 | 0x80, 0x2e, 0x18, 0x00, 0x80, 0x2e, 0x18, 0x00, 773 | }; 774 | 775 | #endif 776 | -------------------------------------------------------------------------------- /src/I2C_IP5306.h: -------------------------------------------------------------------------------- 1 | #ifndef __I2C_IP5306_H__ 2 | #define __I2C_IP5306_H__ 3 | 4 | #include 5 | 6 | #define I2C_IP5306_DEFAULT_ADDRESS 0x75 7 | 8 | class I2C_IP5306 { 9 | public: 10 | I2C_IP5306(uint8_t deviceAddress = I2C_IP5306_DEFAULT_ADDRESS, TwoWire &i2cPort = Wire) { 11 | _deviceAddress = deviceAddress; 12 | _i2cPort = &i2cPort; 13 | } 14 | 15 | bool canControl() { 16 | _i2cPort->beginTransmission(_deviceAddress); 17 | _i2cPort->write(0x70); 18 | uint8_t ret = _i2cPort->endTransmission(); 19 | return (ret == 0); 20 | } 21 | int begin(void) { 22 | return !canControl(); 23 | } 24 | 25 | void setBoost(bool enable) { 26 | if (enable) { 27 | bitOn(0x00, 1 << 5); 28 | } else { 29 | bitOff(0x00, 1 << 5); 30 | } 31 | } 32 | void setCharger(bool enable) { 33 | if (enable) { 34 | bitOn(0x00, 1 << 4); 35 | } else { 36 | bitOff(0x00, 1 << 4); 37 | } 38 | } 39 | void setBoosOnLoad(bool enable) { 40 | if (enable) { 41 | bitOn(0x00, 1 << 2); 42 | } else { 43 | bitOff(0x00, 1 << 2); 44 | } 45 | } 46 | void setBoostOut(bool enable) { 47 | if (enable) { 48 | bitOn(0x00, 1 << 1); 49 | } else { 50 | bitOff(0x00, 1 << 1); 51 | } 52 | } 53 | void setBoostButton(bool enable) { 54 | if (enable) { 55 | bitOn(0x00, 1 << 0); 56 | } else { 57 | bitOff(0x00, 1 << 0); 58 | } 59 | } 60 | void setBoostButtonType(bool enable) { 61 | if (enable) { 62 | bitOn(0x01, 1 << 7); 63 | } else { 64 | bitOff(0x01, 1 << 7); 65 | } 66 | } 67 | void setWledButtonType(bool enable) { 68 | if (enable) { 69 | bitOn(0x01, 1 << 6); 70 | } else { 71 | bitOff(0x01, 1 << 6); 72 | } 73 | } 74 | void setShortBoost(bool enable) { 75 | if (enable) { 76 | bitOn(0x01, 1 << 5); 77 | } else { 78 | bitOff(0x01, 1 << 5); 79 | } 80 | } 81 | void setVin(bool enable) { 82 | if (enable) { 83 | bitOn(0x01, 1 << 2); 84 | } else { 85 | bitOff(0x01, 1 << 2); 86 | } 87 | } 88 | void setLowBatteryShutdown(bool enable) { 89 | if (enable) { 90 | bitOn(0x01, 1 << 0); 91 | } else { 92 | bitOff(0x01, 1 << 0); 93 | } 94 | } 95 | void setLowPowerShutdownTime(uint8_t set) { 96 | uint8_t val = readByte(0x02); 97 | val = ( val & ~(1 << 2 | 1 << 3) ) | ((set & 0x03) << 2); 98 | writeByte(0x02, val); 99 | } 100 | void setChargeVolt(uint8_t set) { 101 | uint8_t val = readByte(0x20); 102 | val = ( val & ~(1 << 0 | 1 << 1) ) | ((set & 0x03) << 0); 103 | writeByte(0x20, val); 104 | } 105 | void setChargeStopCurrent(uint8_t set) { 106 | uint8_t val = readByte(0x21); 107 | val = ( val & ~(1 << 6 | 1 << 7) ) | ((set & 0x03) << 6); 108 | writeByte(0x21, val); 109 | } 110 | void setChargeAddVolt(uint8_t set) { 111 | uint8_t val = readByte(0x22); 112 | val = ( val & ~(1 << 0 | 1 << 1) ) | ((set & 0x03) << 0); 113 | writeByte(0x22, val); 114 | } 115 | void setChargeCC(uint8_t set) { 116 | uint8_t val = readByte(0x23); 117 | val = ( val & ~(1 << 5) ) | ((set & 0x01) << 5); 118 | writeByte(0x23, val); 119 | } 120 | void setVinMaxCurrent(uint8_t set) { 121 | uint8_t val = readByte(0x24); 122 | val = ( val & ~(1 << 0 | 1 << 1 | 1 << 2 | 1 << 3 | 1 << 4) ) | ((set & 0x1F) << 0); 123 | writeByte(0x24, val); 124 | } 125 | bool isCharging() { 126 | uint8_t val = readByte(0x70); 127 | return val & (1 << 3); 128 | } 129 | bool isChargeFull() { 130 | uint8_t val = readByte(0x71); 131 | return val & (1 << 3); 132 | } 133 | bool isLightLoad() { 134 | uint8_t val = readByte(0x72); 135 | return val & (1 << 2); 136 | } 137 | int8_t getBatteryLevel() { 138 | uint8_t val = readByte(0x78); 139 | if (val & 0x10) { 140 | return 0; 141 | } 142 | if (val & 0x20) { 143 | return 25; 144 | } 145 | if (val & 0x40) { 146 | return 50; 147 | } 148 | if (val & 0x80) { 149 | return 75; 150 | } 151 | return 100; 152 | } 153 | 154 | private: 155 | uint8_t readByte(uint8_t address) { 156 | _i2cPort->beginTransmission(_deviceAddress); 157 | _i2cPort->write(address); 158 | _i2cPort->endTransmission(); 159 | _i2cPort->requestFrom(_deviceAddress, 1); 160 | uint8_t val = _i2cPort->read(); 161 | 162 | ESP_LOGD("IP5306", "readByte(%02X, %02X) = %02X", _deviceAddress, address, val); 163 | return val; 164 | } 165 | void writeByte(uint8_t address, uint8_t data) { 166 | _i2cPort->beginTransmission(_deviceAddress); 167 | _i2cPort->write(address); 168 | _i2cPort->write(data); 169 | _i2cPort->endTransmission(); 170 | ESP_LOGD("IP5306", "writeByte(%02X, %02X) = %02X", _deviceAddress, address, data); 171 | } 172 | void writeBytes(uint8_t address, const uint8_t *data, uint8_t len) { 173 | _i2cPort->beginTransmission(_deviceAddress); 174 | _i2cPort->write(address); 175 | _i2cPort->write(data, len); 176 | _i2cPort->endTransmission(); 177 | ESP_LOGD("IP5306", "writeByte(%02X, %02X, len=%d) = %02X", _deviceAddress, address, len, data[0]); 178 | } 179 | void bitOn(uint8_t address, uint8_t bit) { 180 | uint8_t add = address; 181 | uint8_t val = readByte(add) | bit; 182 | writeByte(add, val); 183 | } 184 | void bitOff(uint8_t address, uint8_t bit) { 185 | uint8_t add = address; 186 | uint8_t val = readByte(add) & ~bit; 187 | writeByte(add, val); 188 | } 189 | 190 | TwoWire *_i2cPort; 191 | int _deviceAddress; 192 | }; 193 | 194 | #endif 195 | -------------------------------------------------------------------------------- /src/I2C_SH200Q.h: -------------------------------------------------------------------------------- 1 | #ifndef __I2C_SH200Q_H__ 2 | #define __I2C_SH200Q_H__ 3 | 4 | #include 5 | 6 | #define I2C_SH200Q_DEFAULT_ADDRESS 0x6C 7 | 8 | class I2C_SH200Q { 9 | public: 10 | I2C_SH200Q(uint8_t deviceAddress = I2C_SH200Q_DEFAULT_ADDRESS, TwoWire &i2cPort = Wire) { 11 | _deviceAddress = deviceAddress; 12 | _i2cPort = &i2cPort; 13 | } 14 | 15 | int begin(void) { 16 | // WHO_AM_I : IMU Check 17 | if (WhoAmI() != 0x18) { 18 | return -1; 19 | } 20 | delay(1); 21 | 22 | bitOn(0xC2, 0x04); 23 | delay(1); 24 | 25 | bitOff(0xC2, 0x04); 26 | delay(1); 27 | 28 | bitOn(0xD8, 0x80); 29 | delay(1); 30 | 31 | bitOff(0xD8, 0x80); 32 | delay(1); 33 | 34 | writeByte(0x78, 0x61); 35 | delay(1); 36 | 37 | writeByte(0x78, 0x00); 38 | delay(1); 39 | 40 | // ACC_CONFIG(0x0E) : 256Hz 41 | writeByte(0x0E, 0x91); 42 | delay(1); 43 | 44 | // GYRO_CONFIG(0x0F) : 500Hz 45 | writeByte(0x0F, 0x13); 46 | delay(1); 47 | 48 | // GYRO_DLPF(0x11) : 50Hz 49 | writeByte(0x11, 0x03); 50 | delay(1); 51 | 52 | // FIFO_CONFIG(0x12) 53 | writeByte(0x12, 0x00); 54 | delay(1); 55 | 56 | // ACC_RANGE(0x16) : +-8G 57 | writeByte(0x16, 0x01); 58 | delay(1); 59 | 60 | // GYRO_RANGE(0x2B) : +-2000 61 | writeByte(0x2B, 0x00); 62 | delay(1); 63 | 64 | // REG_SET1(0xBA) 65 | writeByte(0xBA, 0xC0); 66 | delay(1); 67 | 68 | // REG_SET2(0xCA) 69 | bitOn(0xCA, 0x10); 70 | delay(1); 71 | 72 | // REG_SET2(0xCA) 73 | bitOff(0xCA, 0x10); 74 | delay(1); 75 | 76 | return 0; 77 | } 78 | 79 | uint8_t WhoAmI() { 80 | return readByte(0x30); 81 | } 82 | 83 | void getAccel(float* ax, float* ay, float* az) { 84 | float aRes = 8.0 / 32768.0; 85 | *ax = (int16_t)((readByte(0x01) << 8) | readByte(0x00)) * aRes; 86 | *ay = (int16_t)((readByte(0x03) << 8) | readByte(0x02)) * aRes; 87 | *az = (int16_t)((readByte(0x05) << 8) | readByte(0x04)) * aRes; 88 | } 89 | void getGyro(float* gx, float* gy, float* gz) { 90 | float gRes = 2000.0 / 32768.0; 91 | *gx = (int16_t)((readByte(0x07) << 8) | readByte(0x06)) * gRes; 92 | *gy = (int16_t)((readByte(0x09) << 8) | readByte(0x08)) * gRes; 93 | *gz = (int16_t)((readByte(0x0b) << 8) | readByte(0x0a)) * gRes; 94 | } 95 | void getTemp(float *t) { 96 | *t = 21.0 + ((readByte(0x0d) << 8) | readByte(0x0c)) / 333.87; 97 | } 98 | 99 | private: 100 | uint8_t readByte(uint8_t address) { 101 | _i2cPort->beginTransmission(_deviceAddress); 102 | _i2cPort->write(address); 103 | _i2cPort->endTransmission(); 104 | _i2cPort->requestFrom(_deviceAddress, 1); 105 | uint8_t val = _i2cPort->read(); 106 | 107 | ESP_LOGD("SH200Q", "readByte(%02X) = %02X", address, val); 108 | return val; 109 | } 110 | void writeByte(uint8_t address, uint8_t data) { 111 | _i2cPort->beginTransmission(_deviceAddress); 112 | _i2cPort->write(address); 113 | _i2cPort->write(data); 114 | _i2cPort->endTransmission(); 115 | ESP_LOGD("SH200Q", "writeByte(%02X) = %02X", address, data); 116 | } 117 | void bitOn(uint8_t address, uint8_t bit) { 118 | uint8_t add = address; 119 | uint8_t val = readByte(add) | bit; 120 | writeByte(add, val); 121 | } 122 | void bitOff(uint8_t address, uint8_t bit) { 123 | uint8_t add = address; 124 | uint8_t val = readByte(add) & ~bit; 125 | writeByte(add, val); 126 | } 127 | 128 | TwoWire *_i2cPort; 129 | int _deviceAddress; 130 | }; 131 | 132 | #endif 133 | -------------------------------------------------------------------------------- /src/M5Lite.h: -------------------------------------------------------------------------------- 1 | #ifndef __M5Lite_H__ 2 | #define __M5Lite_H__ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "FS.h" 9 | #include "SD.h" 10 | #include "SPIFFS.h" 11 | #include 12 | #include "nvs_flash.h" 13 | #include "lwip/sockets.h" 14 | 15 | #define LGFX_M5STACK // M5Stack (Basic / Gray / Go / Fire) 16 | #define LGFX_M5STACKCORE2 // M5StackCore2 17 | #define LGFX_M5STICKC // M5Stick C / CPlus 18 | #define LGFX_TTGO_TWATCH // TTGO T-Watch 19 | #include // https://github.com/lovyan03/LovyanGFX 20 | #include "M5LiteAXP192.h" 21 | #include "M5LiteRTC.h" 22 | #include "M5LiteTouch.h" 23 | #include "M5LiteButton.h" 24 | #include "M5LiteIMU.h" 25 | #include "M5LiteMPU6886.h" 26 | #include "M5LiteSH200Q.h" 27 | #include "M5LitePower.h" 28 | #include "M5LiteCommUtil.h" 29 | #include "M5LiteSpeaker.h" 30 | #include "M5LiteLED.h" 31 | #include "M5LiteSound.h" 32 | #include "M5LiteDebug.h" 33 | #include "M5LiteEx.h" 34 | 35 | // Color 36 | #define BLACK 0x0000 37 | #define NAVY 0x000F 38 | #define DARKGREEN 0x03E0 39 | #define DARKCYAN 0x03EF 40 | #define MAROON 0x7800 41 | #define PURPLE 0x780F 42 | #define OLIVE 0x7BE0 43 | #define LIGHTGREY 0xC618 44 | #define DARKGREY 0x7BEF 45 | #define BLUE 0x001F 46 | #define GREEN 0x07E0 47 | #define CYAN 0x07FF 48 | #define RED 0xF800 49 | #define MAGENTA 0xF81F 50 | #define YELLOW 0xFFE0 51 | #define WHITE 0xFFFF 52 | #define ORANGE 0xFD20 53 | #define GREENYELLOW 0xAFE5 54 | #define PINK 0xF81F 55 | 56 | // Config 57 | uint8_t M5_IR = -1; 58 | uint8_t M5_LED = -1; 59 | uint8_t BUTTON_A_PIN = -1; 60 | uint8_t BUTTON_B_PIN = -1; 61 | uint8_t BUTTON_C_PIN = -1; 62 | uint8_t SPEAKER_PIN = -1; 63 | uint8_t TONE_PIN_CHANNEL = -1; 64 | uint8_t TFCARD_CS_PIN = -1; 65 | 66 | class M5LiteBase { 67 | public: 68 | void begin(bool LCDEnable = true, bool PowerEnable = true, bool SerialEnable = true) { 69 | // UART 70 | if (SerialEnable) { 71 | Serial.begin(115200); 72 | Serial.flush(); 73 | delay(200); 74 | } 75 | 76 | Serial.println("==============================================================="); 77 | Serial.println("M5Lite Initializing"); 78 | Serial.println("==============================================================="); 79 | Serial.printf ("ESP32 : %s\n", ARDUINO_ESP32_RELEASE); 80 | 81 | Axp.setAXP192(&axp192); 82 | Mpu6886.setMPU6886(&mpu6886); 83 | Sh200Q.setSH200Q(&sh200q); 84 | Imu.setMPU6886(&mpu6886); 85 | Imu.setSH200Q(&sh200q); 86 | Imu.setBMA423(&bma423); 87 | Power.setIP5306(&ip5306); 88 | BtnC.setAXP192(&axp192); 89 | BtnA.setTouch(&Touch); 90 | BtnB.setTouch(&Touch); 91 | BtnC.setTouch(&Touch); 92 | 93 | // LCD INIT 94 | if (LCDEnable) { 95 | Lcd.begin(); 96 | Ex.board = (int)Lcd.getBoard(); 97 | Imu.board = Ex.board; 98 | if (Ex.board == lgfx::board_M5Stack) { 99 | // M5Stack 100 | M5_IR = -1; 101 | M5_LED = -1; 102 | BUTTON_A_PIN = 39; 103 | BUTTON_B_PIN = 38; 104 | BUTTON_C_PIN = 37; 105 | SPEAKER_PIN = 25; 106 | TONE_PIN_CHANNEL = 0; 107 | TFCARD_CS_PIN = 4; 108 | 109 | Ex.Sound.begin(); 110 | SD.begin(TFCARD_CS_PIN, SPI, 20000000); 111 | 112 | Wire1.begin(21, 22); 113 | } else if (Ex.board == lgfx::board_M5StackCore2) { 114 | // M5Stack Core2 115 | M5_IR = -1; 116 | M5_LED = 100; 117 | BUTTON_A_PIN = 101; 118 | BUTTON_B_PIN = 102; 119 | BUTTON_C_PIN = 103; 120 | SPEAKER_PIN = -1; 121 | TONE_PIN_CHANNEL = 0; 122 | TFCARD_CS_PIN = 4; 123 | 124 | Axp.enable = true; 125 | Rtc.enable = true; 126 | Touch.enable = true; 127 | 128 | Ex.Sound.begin(); 129 | SD.begin(TFCARD_CS_PIN, SPI, 20000000); 130 | 131 | Wire1.begin(21, 22); 132 | } else if (Ex.board == lgfx::board_M5StickC) { 133 | // M5StickC 134 | M5_IR = 9; 135 | M5_LED = 10; 136 | BUTTON_A_PIN = 37; 137 | BUTTON_B_PIN = 39; 138 | BUTTON_C_PIN = 100; 139 | SPEAKER_PIN = -1; 140 | TONE_PIN_CHANNEL = -1; 141 | TFCARD_CS_PIN = -1; 142 | 143 | Axp.enable = true; 144 | Rtc.enable = true; 145 | 146 | Wire1.begin(21, 22); 147 | } else if (Ex.board == lgfx::board_M5StickCPlus) { 148 | // M5StickC Plus 149 | M5_IR = 9; 150 | M5_LED = 10; 151 | BUTTON_A_PIN = 37; 152 | BUTTON_B_PIN = 39; 153 | BUTTON_C_PIN = 100; 154 | SPEAKER_PIN = 2; 155 | TONE_PIN_CHANNEL = 0; 156 | TFCARD_CS_PIN = -1; 157 | 158 | Axp.enable = true; 159 | Rtc.enable = true; 160 | 161 | Wire1.begin(21, 22); 162 | } else if (Ex.board == lgfx::board_TTGO_TWatch) { 163 | // TTGO T-Watch 164 | M5_IR = -1; 165 | M5_LED = -1; 166 | BUTTON_A_PIN = 36; 167 | BUTTON_B_PIN = -1; 168 | BUTTON_C_PIN = -1; 169 | SPEAKER_PIN = -1; 170 | TONE_PIN_CHANNEL = -1; 171 | TFCARD_CS_PIN = -1; 172 | 173 | Rtc.enable = true; 174 | 175 | Wire1.begin(21, 22); 176 | } else if (Ex.board == lgfx::board_unknown) { 177 | // ATOM 178 | M5_IR = 12; 179 | M5_LED = -1; 180 | BUTTON_A_PIN = 39; 181 | BUTTON_B_PIN = -1; 182 | BUTTON_C_PIN = -1; 183 | SPEAKER_PIN = -1; 184 | TONE_PIN_CHANNEL = -1; 185 | TFCARD_CS_PIN = -1; 186 | 187 | // LCD not use 188 | Ex.useLcd = false; 189 | 190 | // LED start 191 | dis.begin(); 192 | 193 | // I2C Init 194 | Wire1.begin(25, 21, 10000); 195 | } else { 196 | // Other 197 | Wire1.begin(-1, -1); 198 | } 199 | } else { 200 | Wire1.begin(21, 22); 201 | } 202 | 203 | // Power 204 | if (PowerEnable) { 205 | Axp.setBoard(Ex.board); 206 | Axp.begin(); 207 | if (Ex.useLcd) { 208 | Lcd.drawPixel(0, 0, 0x0000); 209 | Lcd.clear(); 210 | } 211 | } 212 | 213 | Rtc.begin(); 214 | 215 | BtnA.begin(BUTTON_A_PIN, true, DEBOUNCE_MS); 216 | BtnB.begin(BUTTON_B_PIN, true, DEBOUNCE_MS); 217 | BtnC.begin(BUTTON_C_PIN, true, DEBOUNCE_MS); 218 | 219 | Beep.setPin(SPEAKER_PIN, TONE_PIN_CHANNEL); 220 | 221 | Ex.Sound.setAXP(&Axp); 222 | Ex.Sound.setBoard(Ex.board); 223 | 224 | Debug._Lcd = &Lcd; 225 | Debug._Axp = &Axp; 226 | Debug._BtnA = &BtnA; 227 | Debug._BtnB = &BtnB; 228 | Debug._BtnC = &BtnC; 229 | Debug._Rtc = &Rtc; 230 | Debug._Imu = &Imu; 231 | Debug._Mpu6886 = &Mpu6886; 232 | Debug._Sh200Q = &Sh200Q; 233 | Debug._I2C = &I2C; 234 | Debug._Power = &Power; 235 | Debug._Beep = &Beep; 236 | Debug._dis = &dis; 237 | Debug._Touch = &Touch; 238 | Debug._preferences = &preferences; 239 | Ex._Lcd = &Lcd; 240 | Ex._Axp = &Axp; 241 | Ex._BtnA = &BtnA; 242 | Ex._BtnB = &BtnB; 243 | Ex._BtnC = &BtnC; 244 | Ex._Rtc = &Rtc; 245 | Ex._Imu = &Imu; 246 | Ex._Mpu6886 = &Mpu6886; 247 | Ex._Sh200Q = &Sh200Q; 248 | Ex._I2C = &I2C; 249 | Ex._Power = &Power; 250 | Ex._Beep = &Beep; 251 | Ex._dis = &dis; 252 | Ex._Touch = &Touch; 253 | Ex._Debug = &Debug; 254 | Ex._preferences = &preferences; 255 | 256 | Ex.setPin(M5_LED); 257 | Ex.setLed(false); 258 | 259 | Touch.setLcd(&Lcd); 260 | 261 | Imu.Init(); 262 | 263 | // Mac Address 264 | uint8_t mac[6]; 265 | esp_read_mac(mac, ESP_MAC_WIFI_STA); 266 | Serial.printf ("Mac Address : %02X:%02X:%02X:%02X:%02X:%02X\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); 267 | 268 | // Board 269 | Serial.printf ("Board : "); 270 | if (Imu.board == lgfx::board_M5Stack) { 271 | // M5Stack 272 | Serial.println("M5Stack"); 273 | } else if (Imu.board == lgfx::board_M5StackCore2) { 274 | // M5Stack Core2 275 | Serial.println("M5Stack Core2"); 276 | } else if (Imu.board == lgfx::board_M5StickC) { 277 | // M5StickC 278 | Serial.println("M5StickC"); 279 | } else if (Imu.board == lgfx::board_M5StickCPlus) { 280 | // M5StickC Plus 281 | Serial.println("M5StickC Plus"); 282 | } else if (Imu.board == lgfx::board_TTGO_TWatch) { 283 | // TTGO T-Watch 284 | Serial.println("LILYGO TTGO T-Watch"); 285 | } else if (Imu.board == lgfx::board_unknown) { 286 | // ATOM 287 | Serial.println("M5Stack ATOM"); 288 | } 289 | 290 | // LCD 291 | int width = Lcd.width(); 292 | int height = Lcd.height(); 293 | if (0 < width) { 294 | Serial.printf ("LCD : Width:%d, Height:%d\n", width, height); 295 | } else { 296 | Serial.printf ("LCD : (NONE)\n"); 297 | } 298 | 299 | // Touch 300 | if (Touch.enable) { 301 | Serial.printf ("Touch : Enable\n"); 302 | } else { 303 | Serial.printf ("Touch : (NONE)\n"); 304 | } 305 | 306 | // AXP192 307 | if (Axp.enable) { 308 | Serial.printf ("AXP192 : Enable\n"); 309 | } else { 310 | Serial.printf ("AXP192 : (NONE)\n"); 311 | } 312 | 313 | // IMU 314 | Serial.printf ("IMU : "); 315 | if (Imu.imuType == M5LiteIMU::IMU_UNKNOWN) { 316 | Serial.println("(NONE)"); 317 | } else if (Imu.imuType == M5LiteIMU::IMU_SH200Q) { 318 | Serial.println("SH200Q(6-AXIS)"); 319 | } else if (Imu.imuType == M5LiteIMU::IMU_MPU6886) { 320 | Serial.println("MPU6886(6-AXIS)"); 321 | } else if (Imu.imuType == M5LiteIMU::IMU_BMA423) { 322 | Serial.println("BMA423(3-AXIS:ACCEL)"); 323 | } 324 | 325 | // RTC 326 | if (Rtc.enable) { 327 | RTC_TimeTypeDef RTC_TimeStruct; 328 | RTC_DateTypeDef RTC_DateStruct; 329 | Rtc.GetTime(&RTC_TimeStruct); 330 | Rtc.GetData(&RTC_DateStruct); 331 | struct tm dt; 332 | dt.tm_year = RTC_DateStruct.Year - 1900; 333 | dt.tm_mon = RTC_DateStruct.Month - 1; 334 | dt.tm_mday = RTC_DateStruct.Date; 335 | dt.tm_hour = RTC_TimeStruct.Hours; 336 | dt.tm_min = RTC_TimeStruct.Minutes; 337 | dt.tm_sec = RTC_TimeStruct.Seconds; 338 | struct timeval tv; 339 | tv.tv_sec = mktime(&dt); 340 | struct timezone tz; 341 | tz.tz_minuteswest = 9 * 60; // Jp 342 | tz.tz_dsttime = 0; 343 | settimeofday(&tv, &tz); 344 | 345 | Serial.printf ("RTC : "); 346 | Serial.printf ("%04d-%02d-%02d ", RTC_DateStruct.Year, RTC_DateStruct.Month, RTC_DateStruct.Date); 347 | Serial.printf ("%02d:%02d:%02d\n", RTC_TimeStruct.Hours, RTC_TimeStruct.Minutes, RTC_TimeStruct.Seconds); 348 | } else { 349 | Serial.printf ("RTC : (NONE)\n"); 350 | } 351 | 352 | Serial.printf ("Local Time : "); 353 | time_t t = time(NULL); 354 | struct tm *t_st; 355 | t_st = localtime(&t); 356 | Serial.printf ("%04d-%02d-%02d ", t_st->tm_year + 1900, t_st->tm_mon + 1, t_st->tm_mday); 357 | Serial.printf ("%02d:%02d:%02d\n", t_st->tm_hour, t_st->tm_min, t_st->tm_sec); 358 | 359 | if(!SPIFFS.begin()){ 360 | Lcd.fillScreen(TFT_RED); 361 | Lcd.println("SPIFFS Format ... (please wait)"); 362 | Serial.print("SPIFFS Format ... (please wait)"); 363 | delay(100); 364 | SPIFFS.format(); 365 | Serial.println("Down"); 366 | ESP.restart(); 367 | } 368 | uint32_t totalBytes = SPIFFS.totalBytes(); 369 | uint32_t usedBytes = SPIFFS.usedBytes(); 370 | String sizeString = Debug.fileSizeString(totalBytes); 371 | Serial.printf("SPIFFS Total Bytes : %10s\n", sizeString.c_str()); 372 | sizeString = Debug.fileSizeString(usedBytes); 373 | Serial.printf("SPIFFS Used Bytes : %10s\n", sizeString.c_str()); 374 | 375 | if (SerialEnable) { 376 | Serial.println(); 377 | Serial.println("Initializing ... Down\n"); 378 | } 379 | } 380 | 381 | void update() { 382 | Ex.update(); 383 | } 384 | 385 | TFT_eSPI Lcd; 386 | M5LiteAXP192 Axp = M5LiteAXP192(); 387 | 388 | M5LiteButton BtnA; 389 | M5LiteButton BtnB; 390 | M5LiteButton BtnC; 391 | 392 | M5LiteRTC Rtc; 393 | 394 | M5LiteIMU Imu; 395 | M5LiteMPU6886 Mpu6886; 396 | M5LiteSH200Q Sh200Q; 397 | 398 | M5LiteCommUtil I2C = M5LiteCommUtil(Wire); 399 | M5LitePower Power; 400 | M5LiteSpeaker Beep; 401 | M5LiteLED dis; 402 | M5LiteTouch Touch; 403 | 404 | M5LiteDebug Debug; 405 | M5LiteEx Ex; 406 | 407 | private: 408 | const uint32_t DEBOUNCE_MS = 10; 409 | I2C_MPU6886 mpu6886 = I2C_MPU6886(I2C_MPU6886_DEFAULT_ADDRESS, Wire1); 410 | I2C_SH200Q sh200q = I2C_SH200Q(I2C_SH200Q_DEFAULT_ADDRESS, Wire1); 411 | I2C_BMA423 bma423 = I2C_BMA423(I2C_BMA423_DEFAULT_ADDRESS, Wire1); 412 | I2C_AXP192 axp192 = I2C_AXP192(I2C_AXP192_DEFAULT_ADDRESS, Wire1); 413 | I2C_IP5306 ip5306 = I2C_IP5306(I2C_IP5306_DEFAULT_ADDRESS, Wire1); 414 | Preferences preferences = Preferences(); 415 | }; 416 | 417 | M5LiteBase M5Lite; 418 | #define M5 M5Lite 419 | 420 | #endif 421 | -------------------------------------------------------------------------------- /src/M5LiteAXP192.h: -------------------------------------------------------------------------------- 1 | #ifndef __M5LiteAXP192_H__ 2 | #define __M5LiteAXP192_H__ 3 | 4 | #include 5 | 6 | class M5LiteAXP192 { 7 | public: 8 | void begin(bool disableLDO2 = false, bool disableLDO3 = false, bool disableRTC = false, bool disableDCDC1 = false, bool disableDCDC3 = false) { 9 | if (!enable) { 10 | return; 11 | } 12 | 13 | if (_board == lgfx::board_M5StackCore2) { 14 | // M5Stack Core2 15 | writeByte(0x92, 0x00); // GPIO1 OpenDrain 16 | } else if (_board == lgfx::board_M5StickC || _board == lgfx::board_M5StickCPlus) { 17 | // M5StickC 18 | I2C_AXP192_InitDef initDef = { 19 | .EXTEN = true, 20 | .BACKUP = true, 21 | .DCDC1 = disableDCDC1 ? -1 : 3300, 22 | .DCDC2 = 0, 23 | .DCDC3 = disableDCDC3 ? -1 : -1, 24 | .LDO2 = disableLDO2 ? -1 : 3000, 25 | .LDO3 = disableLDO3 ? -1 : 3000, 26 | .GPIO0 = disableRTC ? -1 : 2800, 27 | .GPIO1 = -1, 28 | .GPIO2 = -1, 29 | .GPIO3 = -1, 30 | .GPIO4 = -1, 31 | }; 32 | _axp192->begin(initDef); 33 | } 34 | } 35 | 36 | void setAXP192(I2C_AXP192 *axp192) { 37 | _axp192 = axp192; 38 | } 39 | 40 | void setBoard(int board) { 41 | _board = board; 42 | } 43 | 44 | void ScreenBreath(uint8_t brightness) { 45 | if (!enable) { 46 | return; 47 | } 48 | 49 | if (brightness > 12) { 50 | brightness = 12; 51 | } 52 | _axp192->setLDO2(1800 + brightness * 100); 53 | } 54 | 55 | float GetBatVoltage() { 56 | if (!enable) { 57 | return 0; 58 | } 59 | return _axp192->getBatteryVoltage() / 1000.0; 60 | } 61 | 62 | float GetBatCurrent() { 63 | if (!enable) { 64 | return 0; 65 | } 66 | return _axp192->getBatteryChargeCurrent() - _axp192->getBatteryDischargeCurrent(); 67 | } 68 | 69 | float GetVinVoltage() { 70 | if (!enable) { 71 | return 0; 72 | } 73 | if (_board == lgfx::board_M5StackCore2) { 74 | return _axp192->getVbusVoltage() / 1000.0; 75 | } else { 76 | return _axp192->getAcinVolatge() / 1000.0; 77 | } 78 | } 79 | 80 | float GetVinCurrent() { 81 | if (!enable) { 82 | return 0; 83 | } 84 | if (_board == lgfx::board_M5StackCore2) { 85 | return _axp192->getVbusCurrent(); 86 | } else { 87 | return _axp192->getAcinCurrent(); 88 | } 89 | } 90 | 91 | float GetVBusVoltage() { 92 | if (!enable) { 93 | return 0; 94 | } 95 | if (_board == lgfx::board_M5StackCore2) { 96 | return _axp192->getAcinVolatge() / 1000.0; 97 | } else { 98 | return _axp192->getVbusVoltage() / 1000.0; 99 | } 100 | } 101 | 102 | float GetVBusCurrent() { 103 | if (!enable) { 104 | return 0; 105 | } 106 | if (_board == lgfx::board_M5StackCore2) { 107 | return _axp192->getAcinCurrent(); 108 | } else { 109 | return _axp192->getVbusCurrent(); 110 | } 111 | } 112 | 113 | float GetTempInAXP192() { 114 | if (!enable) { 115 | return 0; 116 | } 117 | return _axp192->getInternalTemperature(); 118 | } 119 | 120 | float GetBatPower() { 121 | if (!enable) { 122 | return 0; 123 | } 124 | return _axp192->getBatteryPower(); 125 | } 126 | 127 | float GetBatChargeCurrent() { 128 | if (!enable) { 129 | return 0; 130 | } 131 | return _axp192->getBatteryChargeCurrent(); 132 | } 133 | 134 | float GetAPSVoltage() { 135 | if (!enable) { 136 | return 0; 137 | } 138 | return _axp192->getApsVoltage() / 1000.0; 139 | } 140 | 141 | void PowerOff() { 142 | if (!enable) { 143 | return; 144 | } 145 | _axp192->powerOff(); 146 | } 147 | 148 | void SetLed(uint8_t state) { 149 | if (state) { 150 | bitOff(0x94, 0x02); 151 | } else { 152 | bitOn(0x94, 0x02); 153 | } 154 | } 155 | 156 | void SetVibration(uint8_t state) { 157 | if (!state) { 158 | bitOff(0x12, 0x08); 159 | } else { 160 | bitOn(0x12, 0x08); 161 | } 162 | } 163 | 164 | void SetSpkEnable(uint8_t state) { 165 | if (!state) { 166 | bitOff(0x94, 0x04); 167 | } else { 168 | bitOn(0x94, 0x04); 169 | } 170 | } 171 | 172 | uint8_t readByte(uint8_t address) { 173 | _i2cPort->beginTransmission(_deviceAddress); 174 | _i2cPort->write(address); 175 | _i2cPort->endTransmission(); 176 | _i2cPort->requestFrom(_deviceAddress, 1); 177 | uint8_t val = _i2cPort->read(); 178 | 179 | ESP_LOGD("AXP192", "readByte(%02X) = %02X", address, val); 180 | return val; 181 | } 182 | 183 | void writeByte(uint8_t address, uint8_t data) { 184 | _i2cPort->beginTransmission(_deviceAddress); 185 | _i2cPort->write(address); 186 | _i2cPort->write(data); 187 | _i2cPort->endTransmission(); 188 | ESP_LOGD("AXP192", "writeByte(%02X) = %02X", address, data); 189 | } 190 | 191 | void bitOn(uint8_t address, uint8_t bit) { 192 | uint8_t add = address; 193 | uint8_t val = readByte(add) | bit; 194 | writeByte(add, val); 195 | } 196 | 197 | void bitOff(uint8_t address, uint8_t bit) { 198 | uint8_t add = address; 199 | uint8_t val = readByte(add) & ~bit; 200 | writeByte(add, val); 201 | } 202 | 203 | int enable = 0; 204 | 205 | private: 206 | I2C_AXP192 *_axp192; 207 | int _board; 208 | 209 | TwoWire *_i2cPort = &Wire1; 210 | int _deviceAddress = 0x34; 211 | }; 212 | 213 | #endif 214 | -------------------------------------------------------------------------------- /src/M5LiteButton.h: -------------------------------------------------------------------------------- 1 | #ifndef __M5LiteButton_H__ 2 | #define __M5LiteButton_H__ 3 | 4 | class M5LiteButton { 5 | public: 6 | void begin(int8_t pin, uint8_t invert, uint32_t dbTime) { 7 | _pin = pin; 8 | if (_pin == -1) { 9 | return; 10 | } 11 | if (_pin < 40) { 12 | pinMode(_pin, INPUT); 13 | } 14 | _invert = invert; 15 | _dbTime = dbTime; 16 | _state = getPin(); 17 | _time = millis(); 18 | _lastState = _state; 19 | _changed = 0; 20 | _changedLow = 0; 21 | _changedHigh = 0; 22 | _clear = 0; 23 | _hold_time = -1; 24 | _lastTime = _time; 25 | _lastChange = _time; 26 | _pressTime = _time; 27 | } 28 | 29 | void setAXP192(I2C_AXP192 *axp192) { 30 | _axp192 = axp192; 31 | } 32 | 33 | void setTouch(M5LiteTouch *Touch) { 34 | _Touch = Touch; 35 | } 36 | 37 | uint8_t getPin(void) { 38 | if (_pin == -1) { 39 | return 0; 40 | } else if (_pin == 100) { 41 | // AXP192 Pek 42 | return _axp192->getPekPress() != 0; 43 | } else if (_pin == 101) { 44 | // Touch A 45 | TouchPoint_t p = _Touch->getPressPointRaw(); 46 | if (240 < p.y && p.x <= 106) { 47 | return true; 48 | } else { 49 | return false; 50 | } 51 | } else if (_pin == 102) { 52 | // Touch B 53 | TouchPoint_t p = _Touch->getPressPointRaw(); 54 | if (240 < p.y && 106 < p.x && p.x < 212) { 55 | return true; 56 | } else { 57 | return false; 58 | } 59 | } else if (_pin == 103) { 60 | // Touch C 61 | TouchPoint_t p = _Touch->getPressPointRaw(); 62 | if (240 < p.y && 212 <= p.x) { 63 | return true; 64 | } else { 65 | return false; 66 | } 67 | } 68 | 69 | if (_invert) { 70 | return !digitalRead(_pin); 71 | } 72 | return digitalRead(_pin); 73 | } 74 | 75 | uint8_t read() { 76 | static uint32_t nowtime; 77 | static uint8_t pinVal; 78 | 79 | if (_clear) { 80 | _changed = 0; 81 | _changedLow = 0; 82 | _changedHigh = 0; 83 | _clear = 0; 84 | } 85 | 86 | nowtime = millis(); 87 | pinVal = getPin(); 88 | 89 | if (nowtime - _lastChange < _dbTime) { 90 | _lastTime = _time; 91 | _time = nowtime; 92 | return _state; 93 | } else { 94 | _lastTime = _time; 95 | _time = nowtime; 96 | _lastState = _state; 97 | _state = pinVal; 98 | if (_state != _lastState) { 99 | _lastChange = nowtime; 100 | _changed = 1; 101 | if (_state) { 102 | _pressTime = _time; 103 | _changedHigh = 1; 104 | } else { 105 | _changedLow = 1; 106 | } 107 | } 108 | return _state; 109 | } 110 | } 111 | 112 | uint8_t isPressed() { 113 | _clear = 1; 114 | return _state == 0 ? 0 : 1; 115 | } 116 | 117 | uint8_t isReleased() { 118 | _clear = 1; 119 | return _state == 0 ? 1 : 0; 120 | } 121 | 122 | uint8_t wasPressed() { 123 | _clear = 1; 124 | return _changedHigh; 125 | } 126 | 127 | uint8_t wasReleased() { 128 | _clear = 1; 129 | return _changedLow && millis() - _pressTime < _hold_time; 130 | } 131 | 132 | uint8_t pressedFor(uint32_t ms) { 133 | _clear = 1; 134 | return (_state == 1 && _time - _lastChange >= ms) ? 1 : 0; 135 | } 136 | 137 | uint8_t releasedFor(uint32_t ms) { 138 | _clear = 1; 139 | return (_state == 0 && _time - _lastChange >= ms) ? 1 : 0; 140 | } 141 | 142 | uint8_t wasReleasefor(uint32_t ms) { 143 | _clear = 1; 144 | _hold_time = ms; 145 | return !_state && _changed && millis() - _pressTime >= ms; 146 | } 147 | 148 | uint32_t lastChange() { 149 | _clear = 1; 150 | return _lastChange; 151 | } 152 | 153 | private: 154 | int8_t _pin; 155 | uint8_t _puEnable; 156 | uint8_t _invert; 157 | uint8_t _state; 158 | uint8_t _lastState; 159 | uint8_t _changed; 160 | uint8_t _changedHigh; 161 | uint8_t _changedLow; 162 | uint8_t _clear; 163 | uint32_t _time; 164 | uint32_t _lastTime; 165 | uint32_t _lastChange; 166 | uint32_t _dbTime; 167 | uint32_t _pressTime; 168 | uint32_t _hold_time; 169 | 170 | I2C_AXP192 *_axp192; 171 | M5LiteTouch *_Touch; 172 | }; 173 | 174 | #endif 175 | -------------------------------------------------------------------------------- /src/M5LiteCommUtil.h: -------------------------------------------------------------------------------- 1 | #ifndef __M5LiteCommUtil_H__ 2 | #define __M5LiteCommUtil_H__ 3 | 4 | class M5LiteCommUtil { 5 | public: 6 | M5LiteCommUtil(TwoWire &i2cPort = Wire) { 7 | _i2cPort = &i2cPort; 8 | } 9 | bool writeCommand(uint8_t address, uint8_t subAddress) { 10 | _i2cPort->beginTransmission(address); 11 | _i2cPort->write(subAddress); 12 | uint8_t ret = _i2cPort->endTransmission(); 13 | ESP_LOGD("M5LiteCommUtil", "writeCommand(%02X) = %02X", address, subAddress); 14 | return (ret == 0); 15 | } 16 | bool writeByte(uint8_t address, uint8_t subAddress, uint8_t data) { 17 | _i2cPort->beginTransmission(address); 18 | _i2cPort->write(subAddress); 19 | _i2cPort->write(data); 20 | uint8_t ret = _i2cPort->endTransmission(); 21 | ESP_LOGD("M5LiteCommUtil", "writeByte(%02X) = %02X", address, subAddress); 22 | return (ret == 0); 23 | } 24 | bool writeBytes(uint8_t address, uint8_t subAddress, uint8_t *data, uint8_t length) { 25 | _i2cPort->beginTransmission(address); 26 | _i2cPort->write(subAddress); 27 | for (int i = 0; i < length; i++) { 28 | _i2cPort->write(data[i]); 29 | ESP_LOGD("M5LiteCommUtil", "writeBytes(%02X) = %02X", address + i, data[i]); 30 | } 31 | uint8_t ret = _i2cPort->endTransmission(); 32 | return (ret == 0); 33 | } 34 | bool readByte(uint8_t address, uint8_t *result) { 35 | _i2cPort->requestFrom(address, (uint8_t)1); 36 | *result = _i2cPort->read(); 37 | 38 | ESP_LOGD("M5LiteCommUtil", "readByte(%02X) = %02X", address, *result); 39 | return true; 40 | } 41 | bool readByte(uint8_t address, uint8_t subAddress, uint8_t *result) { 42 | if (writeCommand(address, subAddress)) { 43 | readByte(address, result); 44 | return true; 45 | } 46 | return false; 47 | } 48 | bool readBytes(uint8_t address, uint8_t count, uint8_t *dest) { 49 | _i2cPort->requestFrom(address, count); 50 | for (int i = 0; i < count; i++) { 51 | dest[i] = _i2cPort->read(); 52 | ESP_LOGD("M5LiteCommUtil", "readBytes(%02X) = %02X", address + i, dest[i]); 53 | } 54 | return true; 55 | } 56 | bool readBytes(uint8_t address, uint8_t subAddress, uint8_t count, uint8_t * dest) { 57 | if (writeCommand(address, subAddress)) { 58 | readBytes(address, count, dest); 59 | return true; 60 | } 61 | return false; 62 | } 63 | void scanID(bool *result) { 64 | for (int i = 0; i <= 0x7f; i++) { 65 | result[i] = writeCommand(i, 0x00); 66 | } 67 | } 68 | 69 | private: 70 | TwoWire *_i2cPort; 71 | }; 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /src/M5LiteDebug.h: -------------------------------------------------------------------------------- 1 | #ifndef __M5LiteDebug_H__ 2 | #define __M5LiteDebug_H__ 3 | 4 | const String _sigInName[256] = { 5 | "SPICLK_IN_IDX", 6 | "SPIQ_IN_IDX", 7 | "SPID_IN_IDX", 8 | "SPIHD_IN_IDX", 9 | "SPIWP_IN_IDX", 10 | "SPICS0_IN_IDX", 11 | "SPICS1_IN_IDX", 12 | "SPICS2_IN_IDX", 13 | "HSPICLK_IN_IDX", 14 | "HSPIQ_IN_IDX", 15 | "HSPID_IN_IDX", 16 | "HSPICS0_IN_IDX", 17 | "HSPIHD_IN_IDX", 18 | "HSPIWP_IN_IDX", 19 | "U0RXD_IN_IDX", 20 | "U0CTS_IN_IDX", 21 | "U0DSR_IN_IDX", 22 | "U1RXD_IN_IDX", 23 | "U1CTS_IN_IDX", 24 | "I2CM_SCL_O_IDX", 25 | "I2CM_SDA_I_IDX", 26 | "EXT_I2C_SCL_O_IDX", 27 | "EXT_I2C_SDA_I_IDX", 28 | "I2S0O_BCK_IN_IDX", 29 | "I2S1O_BCK_IN_IDX", 30 | "I2S0O_WS_IN_IDX", 31 | "I2S1O_WS_IN_IDX", 32 | "I2S0I_BCK_IN_IDX", 33 | "I2S0I_WS_IN_IDX", 34 | "I2CEXT0_SCL_IN_IDX", 35 | "I2CEXT0_SDA_IN_IDX", 36 | "PWM0_SYNC0_IN_IDX", 37 | "PWM0_SYNC1_IN_IDX", 38 | "PWM0_SYNC2_IN_IDX", 39 | "PWM0_F0_IN_IDX", 40 | "PWM0_F1_IN_IDX", 41 | "PWM0_F2_IN_IDX", 42 | "GPIO_BT_ACTIVE_IDX", 43 | "GPIO_BT_PRIORITY_IDX", 44 | "PCNT_SIG_CH0_IN0_IDX", 45 | "PCNT_SIG_CH1_IN0_IDX", 46 | "PCNT_CTRL_CH0_IN0_IDX", 47 | "PCNT_CTRL_CH1_IN0_IDX", 48 | "PCNT_SIG_CH0_IN1_IDX", 49 | "PCNT_SIG_CH1_IN1_IDX", 50 | "PCNT_CTRL_CH0_IN1_IDX", 51 | "PCNT_CTRL_CH1_IN1_IDX", 52 | "PCNT_SIG_CH0_IN2_IDX", 53 | "PCNT_SIG_CH1_IN2_IDX", 54 | "PCNT_CTRL_CH0_IN2_IDX", 55 | "PCNT_CTRL_CH1_IN2_IDX", 56 | "PCNT_SIG_CH0_IN3_IDX", 57 | "PCNT_SIG_CH1_IN3_IDX", 58 | "PCNT_CTRL_CH0_IN3_IDX", 59 | "PCNT_CTRL_CH1_IN3_IDX", 60 | "PCNT_SIG_CH0_IN4_IDX", 61 | "PCNT_SIG_CH1_IN4_IDX", 62 | "PCNT_CTRL_CH0_IN4_IDX", 63 | "PCNT_CTRL_CH1_IN4_IDX", 64 | "BB_DIAG18_IDX", 65 | "BB_DIAG19_IDX", 66 | "HSPICS1_IN_IDX", 67 | "HSPICS2_IN_IDX", 68 | "VSPICLK_IN_IDX", 69 | "VSPIQ_IN_IDX", 70 | "VSPID_IN_IDX", 71 | "VSPIHD_IN_IDX", 72 | "VSPIWP_IN_IDX", 73 | "VSPICS0_IN_IDX", 74 | "VSPICS1_IN_IDX", 75 | "VSPICS2_IN_IDX", 76 | "PCNT_SIG_CH0_IN5_IDX", 77 | "PCNT_SIG_CH1_IN5_IDX", 78 | "PCNT_CTRL_CH0_IN5_IDX", 79 | "PCNT_CTRL_CH1_IN5_IDX", 80 | "PCNT_SIG_CH0_IN6_IDX", 81 | "PCNT_SIG_CH1_IN6_IDX", 82 | "PCNT_CTRL_CH0_IN6_IDX", 83 | "PCNT_CTRL_CH1_IN6_IDX", 84 | "PCNT_SIG_CH0_IN7_IDX", 85 | "PCNT_SIG_CH1_IN7_IDX", 86 | "PCNT_CTRL_CH0_IN7_IDX", 87 | "PCNT_CTRL_CH1_IN7_IDX", 88 | "RMT_SIG_IN0_IDX", 89 | "RMT_SIG_IN1_IDX", 90 | "RMT_SIG_IN2_IDX", 91 | "RMT_SIG_IN3_IDX", 92 | "RMT_SIG_IN4_IDX", 93 | "RMT_SIG_IN5_IDX", 94 | "RMT_SIG_IN6_IDX", 95 | "RMT_SIG_IN7_IDX", 96 | "RMT_SIG_OUT4_IDX", 97 | "RMT_SIG_OUT5_IDX", 98 | "EXT_ADC_START_IDX", 99 | "CAN_RX_IDX", 100 | "I2CEXT1_SCL_IN_IDX", 101 | "I2CEXT1_SDA_IN_IDX", 102 | "HOST_CCMD_OD_PULLUP_EN_N_IDX", 103 | "HOST_RST_N_1_IDX", 104 | "HOST_RST_N_2_IDX", 105 | "HOST_CARD_WRITE_PRT_2_IDX", 106 | "HOST_CARD_INT_N_1_IDX", 107 | "HOST_CARD_INT_N_2_IDX", 108 | "PWM1_SYNC0_IN_IDX", 109 | "PWM1_SYNC1_IN_IDX", 110 | "PWM1_SYNC2_IN_IDX", 111 | "PWM1_F0_IN_IDX", 112 | "PWM1_F1_IN_IDX", 113 | "PWM1_F2_IN_IDX", 114 | "PWM0_CAP0_IN_IDX", 115 | "PWM0_CAP1_IN_IDX", 116 | "PWM0_CAP2_IN_IDX", 117 | "PWM1_CAP0_IN_IDX", 118 | "PWM1_CAP1_IN_IDX", 119 | "PWM1_CAP2_IN_IDX", 120 | "PWM2_FLTA_IDX", 121 | "PWM2_FLTB_IDX", 122 | "PWM2_CAP1_IN_IDX", 123 | "PWM2_CAP2_IN_IDX", 124 | "PWM2_CAP3_IN_IDX", 125 | "PWM3_FLTA_IDX", 126 | "PWM3_FLTB_IDX", 127 | "PWM3_CAP1_IN_IDX", 128 | "PWM3_CAP2_IN_IDX", 129 | "PWM3_CAP3_IN_IDX", 130 | "CAN_CLKOUT_IDX", 131 | "126", 132 | "127", 133 | "SPID4_IN_IDX", 134 | "SPID5_IN_IDX", 135 | "SPID6_IN_IDX", 136 | "SPID7_IN_IDX", 137 | "HSPID4_IN_IDX", 138 | "HSPID5_IN_IDX", 139 | "HSPID6_IN_IDX", 140 | "HSPID7_IN_IDX", 141 | "VSPID4_IN_IDX", 142 | "VSPID5_IN_IDX", 143 | "VSPID6_IN_IDX", 144 | "VSPID7_IN_IDX", 145 | "I2S0I_DATA_IN0_IDX", 146 | "I2S0I_DATA_IN1_IDX", 147 | "I2S0I_DATA_IN2_IDX", 148 | "I2S0I_DATA_IN3_IDX", 149 | "I2S0I_DATA_IN4_IDX", 150 | "I2S0I_DATA_IN5_IDX", 151 | "I2S0I_DATA_IN6_IDX", 152 | "I2S0I_DATA_IN7_IDX", 153 | "I2S0I_DATA_IN8_IDX", 154 | "I2S0I_DATA_IN9_IDX", 155 | "I2S0I_DATA_IN10_IDX", 156 | "I2S0I_DATA_IN11_IDX", 157 | "I2S0I_DATA_IN12_IDX", 158 | "I2S0I_DATA_IN13_IDX", 159 | "I2S0I_DATA_IN14_IDX", 160 | "I2S0I_DATA_IN15_IDX", 161 | "I2S0O_DATA_OUT16_IDX", 162 | "I2S0O_DATA_OUT17_IDX", 163 | "I2S0O_DATA_OUT18_IDX", 164 | "I2S0O_DATA_OUT19_IDX", 165 | "I2S0O_DATA_OUT20_IDX", 166 | "I2S0O_DATA_OUT21_IDX", 167 | "I2S0O_DATA_OUT22_IDX", 168 | "I2S0O_DATA_OUT23_IDX", 169 | "I2S1I_BCK_IN_IDX", 170 | "I2S1I_WS_IN_IDX", 171 | "I2S1I_DATA_IN0_IDX", 172 | "I2S1I_DATA_IN1_IDX", 173 | "I2S1I_DATA_IN2_IDX", 174 | "I2S1I_DATA_IN3_IDX", 175 | "I2S1I_DATA_IN4_IDX", 176 | "I2S1I_DATA_IN5_IDX", 177 | "I2S1I_DATA_IN6_IDX", 178 | "I2S1I_DATA_IN7_IDX", 179 | "I2S1I_DATA_IN8_IDX", 180 | "I2S1I_DATA_IN9_IDX", 181 | "I2S1I_DATA_IN10_IDX", 182 | "I2S1I_DATA_IN11_IDX", 183 | "I2S1I_DATA_IN12_IDX", 184 | "I2S1I_DATA_IN13_IDX", 185 | "I2S1I_DATA_IN14_IDX", 186 | "I2S1I_DATA_IN15_IDX", 187 | "I2S1O_DATA_OUT16_IDX", 188 | "I2S1O_DATA_OUT17_IDX", 189 | "I2S1O_DATA_OUT18_IDX", 190 | "I2S1O_DATA_OUT19_IDX", 191 | "I2S1O_DATA_OUT20_IDX", 192 | "I2S1O_DATA_OUT21_IDX", 193 | "I2S1O_DATA_OUT22_IDX", 194 | "I2S1O_DATA_OUT23_IDX", 195 | "I2S0I_H_SYNC_IDX", 196 | "I2S0I_V_SYNC_IDX", 197 | "I2S0I_H_ENABLE_IDX", 198 | "I2S1I_H_SYNC_IDX", 199 | "I2S1I_V_SYNC_IDX", 200 | "I2S1I_H_ENABLE_IDX", 201 | "PWM3_OUT4H_IDX", 202 | "PWM3_OUT4L_IDX", 203 | "U2RXD_IN_IDX", 204 | "U2CTS_IN_IDX", 205 | "EMAC_MDC_I_IDX", 206 | "EMAC_MDI_I_IDX", 207 | "EMAC_CRS_I_IDX", 208 | "EMAC_COL_I_IDX", 209 | "PCMFSYNC_IN_IDX", 210 | "PCMCLK_IN_IDX", 211 | "PCMDIN_IDX", 212 | "BLE_AUDIO0_IRQ_IDX", 213 | "BLE_AUDIO1_IRQ_IDX", 214 | "BLE_AUDIO2_IRQ_IDX", 215 | "PCMFSYNC_OUT_IDX", 216 | "PCMCLK_OUT_IDX", 217 | "PCMDOUT_IDX", 218 | "BLE_AUDIO_SYNC0_P_IDX", 219 | "BLE_AUDIO_SYNC1_P_IDX", 220 | "BLE_AUDIO_SYNC2_P_IDX", 221 | "ANT_SEL0_IDX", 222 | "ANT_SEL1_IDX", 223 | "ANT_SEL2_IDX", 224 | "ANT_SEL3_IDX", 225 | "ANT_SEL4_IDX", 226 | "ANT_SEL5_IDX", 227 | "ANT_SEL6_IDX", 228 | "ANT_SEL7_IDX", 229 | "SIG_IN_FUNC224_IDX", 230 | "SIG_IN_FUNC225_IDX", 231 | "SIG_IN_FUNC226_IDX", 232 | "SIG_IN_FUNC227_IDX", 233 | "SIG_IN_FUNC228_IDX", 234 | "229", 235 | "230", 236 | "231", 237 | "232", 238 | "233", 239 | "234", 240 | "235", 241 | "236", 242 | "237", 243 | "238", 244 | "239", 245 | "240", 246 | "241", 247 | "242", 248 | "243", 249 | "244", 250 | "245", 251 | "246", 252 | "247", 253 | "248", 254 | "249", 255 | "250", 256 | "251", 257 | "252", 258 | "253", 259 | "254", 260 | "255", 261 | }; 262 | 263 | const String _sigOutName[256] = { 264 | "SPICLK_OUT_IDX", 265 | "SPIQ_OUT_IDX", 266 | "SPID_OUT_IDX", 267 | "SPIHD_OUT_IDX", 268 | "SPIWP_OUT_IDX", 269 | "SPICS0_OUT_IDX", 270 | "SPICS1_OUT_IDX", 271 | "SPICS2_OUT_IDX", 272 | "HSPICLK_OUT_IDX", 273 | "HSPIQ_OUT_IDX", 274 | "HSPID_OUT_IDX", 275 | "HSPICS0_OUT_IDX", 276 | "HSPIHD_OUT_IDX", 277 | "HSPIWP_OUT_IDX", 278 | "U0TXD_OUT_IDX", 279 | "U0RTS_OUT_IDX", 280 | "U0DTR_OUT_IDX", 281 | "U1TXD_OUT_IDX", 282 | "U1RTS_OUT_IDX", 283 | "I2CM_SCL_O_IDX", 284 | "I2CM_SDA_O_IDX", 285 | "EXT_I2C_SCL_O_IDX", 286 | "EXT_I2C_SDA_O_IDX", 287 | "I2S0O_BCK_OUT_IDX", 288 | "I2S1O_BCK_OUT_IDX", 289 | "I2S0O_WS_OUT_IDX", 290 | "I2S1O_WS_OUT_IDX", 291 | "I2S0I_BCK_OUT_IDX", 292 | "I2S0I_WS_OUT_IDX", 293 | "I2CEXT0_SCL_OUT_IDX", 294 | "I2CEXT0_SDA_OUT_IDX", 295 | "SDIO_TOHOST_INT_OUT_IDX", 296 | "PWM0_OUT0A_IDX", 297 | "PWM0_OUT0B_IDX", 298 | "PWM0_OUT1A_IDX", 299 | "PWM0_OUT1B_IDX", 300 | "PWM0_OUT2A_IDX", 301 | "GPIO_BT_ACTIVE_IDX", 302 | "PWM0_OUT2B_IDX", 303 | "GPIO_BT_PRIORITY_IDX", 304 | "GPIO_WLAN_ACTIVE_IDX", 305 | "BB_DIAG0_IDX", 306 | "BB_DIAG1_IDX", 307 | "BB_DIAG2_IDX", 308 | "BB_DIAG3_IDX", 309 | "BB_DIAG4_IDX", 310 | "BB_DIAG5_IDX", 311 | "BB_DIAG6_IDX", 312 | "BB_DIAG7_IDX", 313 | "BB_DIAG8_IDX", 314 | "BB_DIAG9_IDX", 315 | "BB_DIAG10_IDX", 316 | "BB_DIAG11_IDX", 317 | "BB_DIAG12_IDX", 318 | "BB_DIAG13_IDX", 319 | "BB_DIAG14_IDX", 320 | "BB_DIAG15_IDX", 321 | "BB_DIAG16_IDX", 322 | "BB_DIAG17_IDX", 323 | "BB_DIAG18_IDX", 324 | "BB_DIAG19_IDX", 325 | "HSPICS1_OUT_IDX", 326 | "HSPICS2_OUT_IDX", 327 | "VSPICLK_OUT_IDX", 328 | "VSPIQ_OUT_IDX", 329 | "VSPID_OUT_IDX", 330 | "VSPIHD_OUT_IDX", 331 | "VSPIWP_OUT_IDX", 332 | "VSPICS0_OUT_IDX", 333 | "VSPICS1_OUT_IDX", 334 | "VSPICS2_OUT_IDX", 335 | "LEDC_HS_SIG_OUT0_IDX", 336 | "LEDC_HS_SIG_OUT1_IDX", 337 | "LEDC_HS_SIG_OUT2_IDX", 338 | "LEDC_HS_SIG_OUT3_IDX", 339 | "LEDC_HS_SIG_OUT4_IDX", 340 | "LEDC_HS_SIG_OUT5_IDX", 341 | "LEDC_HS_SIG_OUT6_IDX", 342 | "LEDC_HS_SIG_OUT7_IDX", 343 | "LEDC_LS_SIG_OUT0_IDX", 344 | "LEDC_LS_SIG_OUT1_IDX", 345 | "LEDC_LS_SIG_OUT2_IDX", 346 | "LEDC_LS_SIG_OUT3_IDX", 347 | "LEDC_LS_SIG_OUT4_IDX", 348 | "LEDC_LS_SIG_OUT5_IDX", 349 | "LEDC_LS_SIG_OUT6_IDX", 350 | "LEDC_LS_SIG_OUT7_IDX", 351 | "RMT_SIG_OUT0_IDX", 352 | "RMT_SIG_OUT1_IDX", 353 | "RMT_SIG_OUT2_IDX", 354 | "RMT_SIG_OUT3_IDX", 355 | "RMT_SIG_OUT4_IDX", 356 | "RMT_SIG_OUT5_IDX", 357 | "RMT_SIG_OUT6_IDX", 358 | "RMT_SIG_OUT7_IDX", 359 | "I2CEXT1_SCL_OUT_IDX", 360 | "I2CEXT1_SDA_OUT_IDX", 361 | "HOST_CCMD_OD_PULLUP_EN_N_IDX", 362 | "HOST_RST_N_1_IDX", 363 | "HOST_RST_N_2_IDX", 364 | "GPIO_SD0_OUT_IDX", 365 | "GPIO_SD1_OUT_IDX", 366 | "GPIO_SD2_OUT_IDX", 367 | "GPIO_SD3_OUT_IDX", 368 | "GPIO_SD4_OUT_IDX", 369 | "GPIO_SD5_OUT_IDX", 370 | "GPIO_SD6_OUT_IDX", 371 | "GPIO_SD7_OUT_IDX", 372 | "PWM1_OUT0A_IDX", 373 | "PWM1_OUT0B_IDX", 374 | "PWM1_OUT1A_IDX", 375 | "PWM1_OUT1B_IDX", 376 | "PWM1_OUT2A_IDX", 377 | "PWM1_OUT2B_IDX", 378 | "PWM2_OUT1H_IDX", 379 | "PWM2_OUT1L_IDX", 380 | "PWM2_OUT2H_IDX", 381 | "PWM2_OUT2L_IDX", 382 | "PWM2_OUT3H_IDX", 383 | "PWM2_OUT3L_IDX", 384 | "PWM2_OUT4H_IDX", 385 | "PWM2_OUT4L_IDX", 386 | "PWM3_CAP1_IN_IDX", 387 | "CAN_TX_IDX", 388 | "CAN_BUS_OFF_ON_IDX", 389 | "CAN_CLKOUT_IDX", 390 | "126", 391 | "127", 392 | "SPID4_OUT_IDX", 393 | "SPID5_OUT_IDX", 394 | "SPID6_OUT_IDX", 395 | "SPID7_OUT_IDX", 396 | "HSPID4_OUT_IDX", 397 | "HSPID5_OUT_IDX", 398 | "HSPID6_OUT_IDX", 399 | "HSPID7_OUT_IDX", 400 | "VSPID4_OUT_IDX", 401 | "VSPID5_OUT_IDX", 402 | "VSPID6_OUT_IDX", 403 | "VSPID7_OUT_IDX", 404 | "I2S0O_DATA_OUT0_IDX", 405 | "I2S0O_DATA_OUT1_IDX", 406 | "I2S0O_DATA_OUT2_IDX", 407 | "I2S0O_DATA_OUT3_IDX", 408 | "I2S0O_DATA_OUT4_IDX", 409 | "I2S0O_DATA_OUT5_IDX", 410 | "I2S0O_DATA_OUT6_IDX", 411 | "I2S0O_DATA_OUT7_IDX", 412 | "I2S0O_DATA_OUT8_IDX", 413 | "I2S0O_DATA_OUT9_IDX", 414 | "I2S0O_DATA_OUT10_IDX", 415 | "I2S0O_DATA_OUT11_IDX", 416 | "I2S0O_DATA_OUT12_IDX", 417 | "I2S0O_DATA_OUT13_IDX", 418 | "I2S0O_DATA_OUT14_IDX", 419 | "I2S0O_DATA_OUT15_IDX", 420 | "I2S0O_DATA_OUT16_IDX", 421 | "I2S0O_DATA_OUT17_IDX", 422 | "I2S0O_DATA_OUT18_IDX", 423 | "I2S0O_DATA_OUT19_IDX", 424 | "I2S0O_DATA_OUT20_IDX", 425 | "I2S0O_DATA_OUT21_IDX", 426 | "I2S0O_DATA_OUT22_IDX", 427 | "I2S0O_DATA_OUT23_IDX", 428 | "I2S1I_BCK_OUT_IDX", 429 | "I2S1I_WS_OUT_IDX", 430 | "I2S1O_DATA_OUT0_IDX", 431 | "I2S1O_DATA_OUT1_IDX", 432 | "I2S1O_DATA_OUT2_IDX", 433 | "I2S1O_DATA_OUT3_IDX", 434 | "I2S1O_DATA_OUT4_IDX", 435 | "I2S1O_DATA_OUT5_IDX", 436 | "I2S1O_DATA_OUT6_IDX", 437 | "I2S1O_DATA_OUT7_IDX", 438 | "I2S1O_DATA_OUT8_IDX", 439 | "I2S1O_DATA_OUT9_IDX", 440 | "I2S1O_DATA_OUT10_IDX", 441 | "I2S1O_DATA_OUT11_IDX", 442 | "I2S1O_DATA_OUT12_IDX", 443 | "I2S1O_DATA_OUT13_IDX", 444 | "I2S1O_DATA_OUT14_IDX", 445 | "I2S1O_DATA_OUT15_IDX", 446 | "I2S1O_DATA_OUT16_IDX", 447 | "I2S1O_DATA_OUT17_IDX", 448 | "I2S1O_DATA_OUT18_IDX", 449 | "I2S1O_DATA_OUT19_IDX", 450 | "I2S1O_DATA_OUT20_IDX", 451 | "I2S1O_DATA_OUT21_IDX", 452 | "I2S1O_DATA_OUT22_IDX", 453 | "I2S1O_DATA_OUT23_IDX", 454 | "PWM3_OUT1H_IDX", 455 | "PWM3_OUT1L_IDX", 456 | "PWM3_OUT2H_IDX", 457 | "PWM3_OUT2L_IDX", 458 | "PWM3_OUT3H_IDX", 459 | "PWM3_OUT3L_IDX", 460 | "PWM3_OUT4H_IDX", 461 | "PWM3_OUT4L_IDX", 462 | "U2TXD_OUT_IDX", 463 | "U2RTS_OUT_IDX", 464 | "EMAC_MDC_O_IDX", 465 | "EMAC_MDO_O_IDX", 466 | "EMAC_CRS_O_IDX", 467 | "EMAC_COL_O_IDX", 468 | "BT_AUDIO0_IRQ_IDX", 469 | "BT_AUDIO1_IRQ_IDX", 470 | "BT_AUDIO2_IRQ_IDX", 471 | "BLE_AUDIO0_IRQ_IDX", 472 | "BLE_AUDIO1_IRQ_IDX", 473 | "BLE_AUDIO2_IRQ_IDX", 474 | "PCMFSYNC_OUT_IDX", 475 | "PCMCLK_OUT_IDX", 476 | "PCMDOUT_IDX", 477 | "BLE_AUDIO_SYNC0_P_IDX", 478 | "BLE_AUDIO_SYNC1_P_IDX", 479 | "BLE_AUDIO_SYNC2_P_IDX", 480 | "ANT_SEL0_IDX", 481 | "ANT_SEL1_IDX", 482 | "ANT_SEL2_IDX", 483 | "ANT_SEL3_IDX", 484 | "ANT_SEL4_IDX", 485 | "ANT_SEL5_IDX", 486 | "ANT_SEL6_IDX", 487 | "ANT_SEL7_IDX", 488 | "224", 489 | "225", 490 | "226", 491 | "227", 492 | "228", 493 | "229", 494 | "230", 495 | "231", 496 | "232", 497 | "233", 498 | "234", 499 | "235", 500 | "236", 501 | "237", 502 | "238", 503 | "239", 504 | "240", 505 | "241", 506 | "242", 507 | "243", 508 | "244", 509 | "245", 510 | "246", 511 | "247", 512 | "248", 513 | "249", 514 | "250", 515 | "251", 516 | "252", 517 | "253", 518 | "254", 519 | "255", 520 | }; 521 | 522 | class M5LiteDebug { 523 | public: 524 | TFT_eSPI *_Lcd; 525 | M5LiteAXP192 *_Axp; 526 | M5LiteButton *_BtnA; 527 | M5LiteButton *_BtnB; 528 | M5LiteButton *_BtnC; 529 | M5LiteRTC *_Rtc; 530 | M5LiteIMU *_Imu; 531 | M5LiteMPU6886 *_Mpu6886; 532 | M5LiteSH200Q *_Sh200Q; 533 | M5LiteCommUtil *_I2C; 534 | M5LitePower *_Power; 535 | M5LiteSpeaker *_Beep; 536 | M5LiteLED *_dis; 537 | M5LiteTouch *_Touch; 538 | Preferences *_preferences; 539 | 540 | void dispHelp(void) { 541 | Serial.println("==============================================================="); 542 | Serial.println("M5Lite Debug Command List"); 543 | Serial.println("==============================================================="); 544 | Serial.println(" ? : This print"); 545 | Serial.println(" INFO : Print Info"); 546 | Serial.println(" AXP192 : AXP192 Info"); 547 | Serial.println(" IMU : IMU Info"); 548 | Serial.println(" RTC : RTC Info"); 549 | Serial.println(" MEM : Memory Info"); 550 | Serial.println(" GPIO : GPIO Info"); 551 | Serial.println(" I2C : I2C Scan"); 552 | #ifdef WiFi_h 553 | Serial.println(" WIFI [SSID] [KEY] : Connect Wi-Fi(default Last SSID & Key)"); 554 | Serial.println(" NTP [SERVER] : Sync NTP Server(default pool.ntp.org)"); 555 | #endif 556 | Serial.println(" SD [DIR] : SD Storage"); 557 | Serial.println(" SPIFFS [DIR] : SPIFFS Storage"); 558 | Serial.println(" FORMAT [NVS|SPIFFS] : Format Flash"); 559 | Serial.println(" SCREENSHOT [SD|SPIFFS] [FILENAME] : Screenshot 16bitBMP(default SD)"); 560 | Serial.println(" RESET : Reset ESP32"); 561 | } 562 | 563 | void dispAxp192(void) { 564 | // AXP192 565 | if (_Axp->enable) { 566 | Serial.printf("===============================================================\n"); 567 | Serial.printf("AXP192\n"); 568 | Serial.printf("===============================================================\n"); 569 | Serial.printf("Battery\n"); 570 | Serial.printf(" Temp :%6.1f C\n", _Axp->GetTempInAXP192()); // AXP192 Internal temperature 571 | Serial.printf(" V :%6.3f V\n", _Axp->GetBatVoltage()); // Battery Voltage(3.0V-4.2V) 572 | Serial.printf(" I :%6.1f mA\n", _Axp->GetBatCurrent()); // Battery Current(+:charge, -:decharge) 573 | 574 | Serial.printf("ASP(ESP32)\n"); 575 | Serial.printf(" V :%6.3f V\n", _Axp->GetAPSVoltage()); // ESP32 Voltage 576 | 577 | Serial.printf("VBus(USB)\n"); 578 | Serial.printf(" V :%6.3f V\n", _Axp->GetVBusVoltage()); // USB Voltage 579 | Serial.printf(" I :%6.1f mA\n", _Axp->GetVBusCurrent()); // USB Current 580 | 581 | Serial.printf("VIN(5V-In)\n"); 582 | Serial.printf(" V :%6.3f V\n", _Axp->GetVinVoltage()); // 5V IN Voltage 583 | Serial.printf(" I :%6.1f mA\n", _Axp->GetVinCurrent()); // 5V IN Current 584 | } else { 585 | Serial.printf("AXP192 : (NONE)\n"); 586 | } 587 | } 588 | 589 | void dispImu(void) { 590 | Serial.printf("===============================================================\n"); 591 | Serial.printf("IMU\n"); 592 | Serial.printf("===============================================================\n"); 593 | if (_Imu->imuType == M5LiteIMU::IMU_UNKNOWN) { 594 | Serial.println("(NONE)"); 595 | } else if (_Imu->imuType == M5LiteIMU::IMU_SH200Q) { 596 | Serial.println("SH200Q(6-AXIS)"); 597 | float ax, ay, az, gx, gy, gz , t; 598 | _Imu->getAccelData(&ax, &ay, &az); 599 | _Imu->getGyroData(&gx, &gy, &gz); 600 | _Imu->getTempData(&t); 601 | Serial.printf(" ACCEL\n"); 602 | Serial.printf(" X :%11.6f\n", ax); 603 | Serial.printf(" Y :%11.6f\n", ay); 604 | Serial.printf(" Z :%11.6f\n", az); 605 | Serial.printf(" GYRO\n"); 606 | Serial.printf(" X :%11.6f\n", gx); 607 | Serial.printf(" Y :%11.6f\n", gy); 608 | Serial.printf(" Z :%11.6f\n", gz); 609 | Serial.printf(" TEMP\n"); 610 | Serial.printf(" T :%11.6f C\n", t); 611 | } else if (_Imu->imuType == M5LiteIMU::IMU_MPU6886) { 612 | Serial.println("MPU6886(6-AXIS)"); 613 | float ax, ay, az, gx, gy, gz , t; 614 | _Imu->getAccelData(&ax, &ay, &az); 615 | _Imu->getGyroData(&gx, &gy, &gz); 616 | _Imu->getTempData(&t); 617 | Serial.printf(" ACCEL\n"); 618 | Serial.printf(" X :%11.6f\n", ax); 619 | Serial.printf(" Y :%11.6f\n", ay); 620 | Serial.printf(" Z :%11.6f\n", az); 621 | Serial.printf(" GYRO\n"); 622 | Serial.printf(" X :%11.6f\n", gx); 623 | Serial.printf(" Y :%11.6f\n", gy); 624 | Serial.printf(" Z :%11.6f\n", gz); 625 | Serial.printf(" TEMP\n"); 626 | Serial.printf(" T :%11.6f C\n", t); 627 | } else if (_Imu->imuType == M5LiteIMU::IMU_BMA423) { 628 | Serial.println("BMA423(3-AXIS:ACCEL)"); 629 | float ax, ay, az; 630 | _Imu->getAccelData(&ax, &ay, &az); 631 | Serial.printf(" ACCEL\n"); 632 | Serial.printf(" X :%11.6f\n", ax); 633 | Serial.printf(" Y :%11.6f\n", ay); 634 | Serial.printf(" Z :%11.6f\n", az); 635 | } 636 | } 637 | 638 | void dispRtc(void) { 639 | Serial.printf("===============================================================\n"); 640 | Serial.printf("RTC\n"); 641 | Serial.printf("===============================================================\n"); 642 | if (_Rtc->enable) { 643 | RTC_TimeTypeDef RTC_TimeStruct; 644 | RTC_DateTypeDef RTC_DateStruct; 645 | _Rtc->GetTime(&RTC_TimeStruct); 646 | _Rtc->GetData(&RTC_DateStruct); 647 | Serial.printf("%04d-%02d-%02d ", RTC_DateStruct.Year, RTC_DateStruct.Month, RTC_DateStruct.Date); 648 | Serial.printf("%02d:%02d:%02d\n", RTC_TimeStruct.Hours, RTC_TimeStruct.Minutes, RTC_TimeStruct.Seconds); 649 | } else { 650 | Serial.println("(NONE)"); 651 | } 652 | } 653 | 654 | void dispMemory() { 655 | Serial.printf("===============================================================\n"); 656 | Serial.printf("Memory Info\n"); 657 | Serial.printf("===============================================================\n"); 658 | 659 | Serial.printf("esp_get_free_heap_size() : %6d\n", esp_get_free_heap_size() ); 660 | Serial.printf("esp_get_minimum_free_heap_size() : %6d\n", esp_get_minimum_free_heap_size() ); 661 | 662 | //xPortGetFreeHeapSize()(データメモリ)ヒープの空きバイト数を返すFreeRTOS関数です。これはを呼び出すのと同じheap_caps_get_free_size(MALLOC_CAP_8BIT)です。 663 | Serial.printf("xPortGetFreeHeapSize() : %6d\n", xPortGetFreeHeapSize() ); 664 | 665 | //xPortGetMinimumEverFreeHeapSize()また、関連heap_caps_get_minimum_free_size()するものを使用して、ブート以降のヒープの「最低水準点」を追跡できます。 666 | Serial.printf("xPortGetMinimumEverFreeHeapSize() : %6d\n", xPortGetMinimumEverFreeHeapSize() ); 667 | 668 | //heap_caps_get_free_size() さまざまなメモリ機能の現在の空きメモリを返すためにも使用できます。 669 | Serial.printf("heap_caps_get_free_size(MALLOC_CAP_EXEC) : %6d\n", heap_caps_get_free_size(MALLOC_CAP_EXEC) ); 670 | Serial.printf("heap_caps_get_free_size(MALLOC_CAP_32BIT) : %6d\n", heap_caps_get_free_size(MALLOC_CAP_32BIT) ); 671 | Serial.printf("heap_caps_get_free_size(MALLOC_CAP_8BIT) : %6d\n", heap_caps_get_free_size(MALLOC_CAP_8BIT) ); 672 | Serial.printf("heap_caps_get_free_size(MALLOC_CAP_DMA) : %6d\n", heap_caps_get_free_size(MALLOC_CAP_DMA) ); 673 | Serial.printf("heap_caps_get_free_size(MALLOC_CAP_PID2) : %6d\n", heap_caps_get_free_size(MALLOC_CAP_PID2) ); 674 | Serial.printf("heap_caps_get_free_size(MALLOC_CAP_PID3) : %6d\n", heap_caps_get_free_size(MALLOC_CAP_PID3) ); 675 | Serial.printf("heap_caps_get_free_size(MALLOC_CAP_PID3) : %6d\n", heap_caps_get_free_size(MALLOC_CAP_PID4) ); 676 | Serial.printf("heap_caps_get_free_size(MALLOC_CAP_PID4) : %6d\n", heap_caps_get_free_size(MALLOC_CAP_PID5) ); 677 | Serial.printf("heap_caps_get_free_size(MALLOC_CAP_PID5) : %6d\n", heap_caps_get_free_size(MALLOC_CAP_PID6) ); 678 | Serial.printf("heap_caps_get_free_size(MALLOC_CAP_PID6) : %6d\n", heap_caps_get_free_size(MALLOC_CAP_PID7) ); 679 | Serial.printf("heap_caps_get_free_size(MALLOC_CAP_PID7) : %6d\n", heap_caps_get_free_size(MALLOC_CAP_PID3) ); 680 | Serial.printf("heap_caps_get_free_size(MALLOC_CAP_SPIRAM) : %6d\n", heap_caps_get_free_size(MALLOC_CAP_SPIRAM) ); 681 | Serial.printf("heap_caps_get_free_size(MALLOC_CAP_INTERNAL) : %6d\n", heap_caps_get_free_size(MALLOC_CAP_INTERNAL) ); 682 | Serial.printf("heap_caps_get_free_size(MALLOC_CAP_DEFAULT) : %6d\n", heap_caps_get_free_size(MALLOC_CAP_DEFAULT) ); 683 | Serial.printf("heap_caps_get_free_size(MALLOC_CAP_INVALID) : %6d\n", heap_caps_get_free_size(MALLOC_CAP_INVALID) ); 684 | 685 | //heap_caps_get_largest_free_block()ヒープ内の最大の空きブロックを返すために使用できます。これは、現在可能な最大の単一割り当てです。この値を追跡し、合計空きヒープと比較すると、ヒープの断片化を検出できます。 686 | Serial.printf("heap_caps_get_largest_free_block(MALLOC_CAP_EXEC) : %6d\n", heap_caps_get_largest_free_block(MALLOC_CAP_EXEC) ); 687 | Serial.printf("heap_caps_get_largest_free_block(MALLOC_CAP_32BIT) : %6d\n", heap_caps_get_largest_free_block(MALLOC_CAP_32BIT) ); 688 | Serial.printf("heap_caps_get_largest_free_block(MALLOC_CAP_8BIT) : %6d\n", heap_caps_get_largest_free_block(MALLOC_CAP_8BIT) ); 689 | Serial.printf("heap_caps_get_largest_free_block(MALLOC_CAP_DMA) : %6d\n", heap_caps_get_largest_free_block(MALLOC_CAP_DMA) ); 690 | Serial.printf("heap_caps_get_largest_free_block(MALLOC_CAP_PID2) : %6d\n", heap_caps_get_largest_free_block(MALLOC_CAP_PID2) ); 691 | Serial.printf("heap_caps_get_largest_free_block(MALLOC_CAP_PID3) : %6d\n", heap_caps_get_largest_free_block(MALLOC_CAP_PID3) ); 692 | Serial.printf("heap_caps_get_largest_free_block(MALLOC_CAP_PID3) : %6d\n", heap_caps_get_largest_free_block(MALLOC_CAP_PID4) ); 693 | Serial.printf("heap_caps_get_largest_free_block(MALLOC_CAP_PID4) : %6d\n", heap_caps_get_largest_free_block(MALLOC_CAP_PID5) ); 694 | Serial.printf("heap_caps_get_largest_free_block(MALLOC_CAP_PID5) : %6d\n", heap_caps_get_largest_free_block(MALLOC_CAP_PID6) ); 695 | Serial.printf("heap_caps_get_largest_free_block(MALLOC_CAP_PID6) : %6d\n", heap_caps_get_largest_free_block(MALLOC_CAP_PID7) ); 696 | Serial.printf("heap_caps_get_largest_free_block(MALLOC_CAP_PID7) : %6d\n", heap_caps_get_largest_free_block(MALLOC_CAP_PID3) ); 697 | Serial.printf("heap_caps_get_largest_free_block(MALLOC_CAP_SPIRAM) : %6d\n", heap_caps_get_largest_free_block(MALLOC_CAP_SPIRAM) ); 698 | Serial.printf("heap_caps_get_largest_free_block(MALLOC_CAP_INTERNAL) : %6d\n", heap_caps_get_largest_free_block(MALLOC_CAP_INTERNAL) ); 699 | Serial.printf("heap_caps_get_largest_free_block(MALLOC_CAP_DEFAULT) : %6d\n", heap_caps_get_largest_free_block(MALLOC_CAP_DEFAULT) ); 700 | Serial.printf("heap_caps_get_largest_free_block(MALLOC_CAP_INVALID) : %6d\n", heap_caps_get_largest_free_block(MALLOC_CAP_INVALID) ); 701 | 702 | //heap_caps_get_minimum_free_size()指定された機能を持つすべての領域の合計最小空きメモリを取得します。 703 | Serial.printf("heap_caps_get_minimum_free_size(MALLOC_CAP_EXEC) : %6d\n", heap_caps_get_minimum_free_size(MALLOC_CAP_EXEC) ); 704 | Serial.printf("heap_caps_get_minimum_free_size(MALLOC_CAP_32BIT) : %6d\n", heap_caps_get_minimum_free_size(MALLOC_CAP_32BIT) ); 705 | Serial.printf("heap_caps_get_minimum_free_size(MALLOC_CAP_8BIT) : %6d\n", heap_caps_get_minimum_free_size(MALLOC_CAP_8BIT) ); 706 | Serial.printf("heap_caps_get_minimum_free_size(MALLOC_CAP_DMA) : %6d\n", heap_caps_get_minimum_free_size(MALLOC_CAP_DMA) ); 707 | Serial.printf("heap_caps_get_minimum_free_size(MALLOC_CAP_PID2) : %6d\n", heap_caps_get_minimum_free_size(MALLOC_CAP_PID2) ); 708 | Serial.printf("heap_caps_get_minimum_free_size(MALLOC_CAP_PID3) : %6d\n", heap_caps_get_minimum_free_size(MALLOC_CAP_PID3) ); 709 | Serial.printf("heap_caps_get_minimum_free_size(MALLOC_CAP_PID3) : %6d\n", heap_caps_get_minimum_free_size(MALLOC_CAP_PID4) ); 710 | Serial.printf("heap_caps_get_minimum_free_size(MALLOC_CAP_PID4) : %6d\n", heap_caps_get_minimum_free_size(MALLOC_CAP_PID5) ); 711 | Serial.printf("heap_caps_get_minimum_free_size(MALLOC_CAP_PID5) : %6d\n", heap_caps_get_minimum_free_size(MALLOC_CAP_PID6) ); 712 | Serial.printf("heap_caps_get_minimum_free_size(MALLOC_CAP_PID6) : %6d\n", heap_caps_get_minimum_free_size(MALLOC_CAP_PID7) ); 713 | Serial.printf("heap_caps_get_minimum_free_size(MALLOC_CAP_PID7) : %6d\n", heap_caps_get_minimum_free_size(MALLOC_CAP_PID3) ); 714 | Serial.printf("heap_caps_get_minimum_free_size(MALLOC_CAP_SPIRAM) : %6d\n", heap_caps_get_minimum_free_size(MALLOC_CAP_SPIRAM) ); 715 | Serial.printf("heap_caps_get_minimum_free_size(MALLOC_CAP_INTERNAL) : %6d\n", heap_caps_get_minimum_free_size(MALLOC_CAP_INTERNAL) ); 716 | Serial.printf("heap_caps_get_minimum_free_size(MALLOC_CAP_DEFAULT) : %6d\n", heap_caps_get_minimum_free_size(MALLOC_CAP_DEFAULT) ); 717 | Serial.printf("heap_caps_get_minimum_free_size(MALLOC_CAP_INVALID) : %6d\n", heap_caps_get_minimum_free_size(MALLOC_CAP_INVALID) ); 718 | } 719 | 720 | void dispInfo(void) { 721 | Serial.printf("===============================================================\n"); 722 | Serial.printf("M5Lite Info\n"); 723 | Serial.printf("===============================================================\n"); 724 | 725 | // Mac Address 726 | uint8_t mac[6]; 727 | esp_read_mac(mac, ESP_MAC_WIFI_STA); 728 | Serial.printf("Mac Address : %02X:%02X:%02X:%02X:%02X:%02X\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]); 729 | 730 | #ifdef WiFi_h 731 | // IP Address 732 | Serial.printf("IP Address : "); 733 | Serial.println(WiFi.localIP()); 734 | #endif 735 | 736 | // Board 737 | Serial.printf("Board : "); 738 | if (_Imu->board == lgfx::board_M5Stack) { 739 | // M5Stack 740 | Serial.println("M5Stack"); 741 | } else if (_Imu->board == lgfx::board_M5StackCore2) { 742 | // M5Stack Core2 743 | Serial.println("M5Stack Core2"); 744 | } else if (_Imu->board == lgfx::board_M5StickC) { 745 | // M5StickC 746 | Serial.println("M5StickC"); 747 | } else if (_Imu->board == lgfx::board_M5StickCPlus) { 748 | // M5StickC Plus 749 | Serial.println("M5StickC Plus"); 750 | } else if (_Imu->board == lgfx::board_TTGO_TWatch) { 751 | // TTGO T-Watch 752 | Serial.println("LILYGO TTGO T-Watch"); 753 | } else if (_Imu->board == lgfx::board_unknown) { 754 | // ATOM 755 | Serial.println("M5Stack ATOM"); 756 | } 757 | 758 | // LCD 759 | int width = _Lcd->width(); 760 | int height = _Lcd->height(); 761 | if (0 < width) { 762 | Serial.printf("LCD : Width:%d, Height:%d\n", width, height); 763 | } else { 764 | Serial.printf("LCD : (NONE)\n"); 765 | } 766 | 767 | // RTC 768 | dispRtc(); 769 | } 770 | 771 | #ifdef WiFi_h 772 | void connectWiFi(String ssid, String key) { 773 | Serial.printf("===============================================================\n"); 774 | Serial.printf("Wi-Fi Connect\n"); 775 | Serial.printf("===============================================================\n"); 776 | if (ssid == "" && key == "") { 777 | WiFi.begin(); 778 | } else { 779 | WiFi.begin(ssid.c_str(), key.c_str()); 780 | } 781 | int i; 782 | for (i = 0; i < 50 ; i++) { 783 | if (WiFi.status() == WL_CONNECTED) { 784 | Serial.println("Connect"); 785 | Serial.printf(" IP Address : "); 786 | Serial.println(WiFi.localIP()); 787 | break; 788 | } else { 789 | Serial.print("."); 790 | } 791 | 792 | delay(200); 793 | } 794 | 795 | if (i == 50) { 796 | Serial.println("TimeOut"); 797 | } 798 | } 799 | 800 | void syncNTP(String server) { 801 | Serial.printf("===============================================================\n"); 802 | Serial.printf("NTP Sync\n"); 803 | Serial.printf("===============================================================\n"); 804 | if (WiFi.status() == WL_CONNECTED) { 805 | String ntpServer; 806 | // Set ntp time to local 807 | if (server != "") { 808 | configTime(9 * 3600, 0, server.c_str()); 809 | ntpServer = server; 810 | } else { 811 | configTime(9 * 3600, 0, "pool.ntp.org"); 812 | ntpServer = "pool.ntp.org"; 813 | } 814 | 815 | Serial.print("NTP : "); 816 | Serial.println(ntpServer); 817 | 818 | // Get local time 819 | struct tm timeInfo; 820 | if (getLocalTime(&timeInfo)) { 821 | // Set RTC time 822 | RTC_TimeTypeDef TimeStruct; 823 | TimeStruct.Hours = timeInfo.tm_hour; 824 | TimeStruct.Minutes = timeInfo.tm_min; 825 | TimeStruct.Seconds = timeInfo.tm_sec; 826 | _Rtc->SetTime(&TimeStruct); 827 | 828 | RTC_DateTypeDef DateStruct; 829 | DateStruct.WeekDay = timeInfo.tm_wday; 830 | DateStruct.Month = timeInfo.tm_mon + 1; 831 | DateStruct.Date = timeInfo.tm_mday; 832 | DateStruct.Year = timeInfo.tm_year + 1900; 833 | _Rtc->SetData(&DateStruct); 834 | 835 | Serial.print("Local Time : "); 836 | Serial.printf("%04d-%02d-%02d ", DateStruct.Year, DateStruct.Month, DateStruct.Date); 837 | Serial.printf("%02d:%02d:%02d\n", TimeStruct.Hours, TimeStruct.Minutes, TimeStruct.Seconds); 838 | 839 | if (_Rtc->enable) { 840 | dispRtc(); 841 | } 842 | } 843 | } else { 844 | Serial.println("Not Wi-Fi Connection"); 845 | } 846 | } 847 | #endif 848 | 849 | typedef struct { 850 | bool enable: 1; 851 | bool pullup: 1; 852 | bool pulldown: 1; 853 | bool openDrain: 1; 854 | bool adc: 1; 855 | bool output: 1; 856 | bool level: 1; 857 | } gpio_info_t; 858 | 859 | gpio_info_t getPinMode(uint8_t pin) { 860 | gpio_info_t info = {}; 861 | 862 | if (!digitalPinIsValid(pin)) { 863 | return info; 864 | } 865 | 866 | info.enable = true; 867 | 868 | uint32_t rtc_reg = rtc_gpio_desc[pin].reg; 869 | if (rtc_reg) { 870 | uint32_t reg_val = ESP_REG(rtc_reg); 871 | 872 | if (reg_val & rtc_gpio_desc[pin].mux) { 873 | info.adc = true; 874 | } 875 | 876 | if (reg_val & rtc_gpio_desc[pin].pullup) { 877 | info.pullup = true; 878 | } 879 | 880 | if (reg_val & rtc_gpio_desc[pin].pulldown) { 881 | info.pulldown = true; 882 | } 883 | } 884 | 885 | if (pin > 33) { 886 | } else if (pin < 32) { 887 | if (ESP_REG(GPIO_ENABLE_REG) & ((uint32_t)1 << pin)) { 888 | info.output = true; 889 | } 890 | } else { 891 | if (ESP_REG(GPIO_ENABLE1_REG) & ((uint32_t)1 << (pin - 32))) { 892 | info.output = true; 893 | } 894 | } 895 | 896 | if (ESP_REG(DR_REG_IO_MUX_BASE + esp32_gpioMux[pin].reg) & FUN_PU) { 897 | info.pullup = true; 898 | } 899 | 900 | if (ESP_REG(DR_REG_IO_MUX_BASE + esp32_gpioMux[pin].reg) & FUN_PD) { 901 | info.pulldown = true; 902 | } 903 | 904 | if (GPIO.pin[pin].val & (1 << GPIO_PIN0_PAD_DRIVER_S)) { 905 | info.openDrain = true; 906 | } 907 | 908 | if (pin < 32) { 909 | if (ESP_REG(GPIO_IN_REG) & ((uint32_t)1 << pin)) { 910 | info.level = true; 911 | } else { 912 | info.level = false; 913 | } 914 | } else { 915 | if (ESP_REG(GPIO_IN1_REG) & ((uint32_t)1 << (pin - 32))) { 916 | info.level = true; 917 | } else { 918 | info.level = false; 919 | } 920 | } 921 | 922 | if (34 <= pin) { 923 | // INPUT Only 924 | info.pullup = false; 925 | info.pulldown = false; 926 | info.openDrain = false; 927 | } 928 | 929 | return info; 930 | } 931 | 932 | void getPinMux(String *gpioMap) { 933 | // INPUT 934 | for (int i = 0; i < 256; i++) { 935 | uint32_t reg = GPIO_FUNC0_IN_SEL_CFG_REG + 0x04 * i; 936 | uint32_t reg_val = ESP_REG(reg); 937 | if (reg_val & (1 << 7)) { 938 | int gpio = reg_val & 0b00111111; 939 | gpioMap[gpio] = "[I]" + _sigInName[i]; 940 | } 941 | } 942 | 943 | // OUTPUT 944 | for (int i = 0; i < 40; i++) { 945 | uint32_t reg = GPIO_FUNC0_OUT_SEL_CFG_REG + 0x04 * i; 946 | uint32_t reg_val = ESP_REG(reg); 947 | int func = reg_val & 0b111111111; 948 | if (func < 256) { 949 | gpioMap[i] = String("[O]") + _sigOutName[func]; 950 | } 951 | } 952 | } 953 | 954 | void dispGpio() { 955 | String pinMap[40]; 956 | getPinMux(pinMap); 957 | 958 | Serial.println("GPIO LEVEL MODE ADC PULLUP PULLDOWN OPEN_DRAIN I/O NOTE "); 959 | Serial.println("-----------------------------------------------------------------------------"); 960 | for (int i = 0; i < 40; i++) { 961 | gpio_info_t gpioInfo = getPinMode(i); 962 | if (!gpioInfo.enable) { 963 | continue; 964 | } 965 | 966 | Serial.printf("%4d ", i); 967 | 968 | if (gpioInfo.level) { 969 | Serial.print("HIGH "); 970 | } else { 971 | Serial.print("LOW "); 972 | } 973 | 974 | if (gpioInfo.output) { 975 | Serial.print("OUTPUT "); 976 | } else { 977 | Serial.print("INPUT "); 978 | } 979 | 980 | if (gpioInfo.adc) { 981 | Serial.print("ADC "); 982 | } else { 983 | Serial.print(" "); 984 | } 985 | 986 | if (gpioInfo.pullup) { 987 | Serial.print("PULLUP "); 988 | } else { 989 | Serial.print(" "); 990 | } 991 | 992 | if (gpioInfo.pulldown) { 993 | Serial.print("PULLDOWN "); 994 | } else { 995 | Serial.print(" "); 996 | } 997 | 998 | if (gpioInfo.openDrain) { 999 | Serial.print("OPEN_DRAIN "); 1000 | } else { 1001 | Serial.print(" "); 1002 | } 1003 | 1004 | if (i < 34) { 1005 | Serial.print("I/O "); 1006 | } else { 1007 | Serial.print("I "); 1008 | } 1009 | 1010 | Serial.print(pinMap[i]); 1011 | 1012 | Serial.println(); 1013 | } 1014 | } 1015 | 1016 | void dispI2c() { 1017 | Serial.printf("===============================================================\n"); 1018 | Serial.printf("I2C Scan\n"); 1019 | Serial.printf("===============================================================\n"); 1020 | 1021 | // Disp I2C 1022 | int i2c0SDA = -1; 1023 | int i2c0SCL = -1; 1024 | int i2c1SDA = -1; 1025 | int i2c1SCL = -1; 1026 | for (int i = 0; i < 40; i++) { 1027 | uint32_t reg = GPIO_FUNC0_OUT_SEL_CFG_REG + 0x04 * i; 1028 | uint32_t reg_val = ESP_REG(reg); 1029 | int func = reg_val & 0b111111111; 1030 | if (func == I2CEXT0_SDA_IN_IDX) { 1031 | i2c0SDA = i; 1032 | } else if (func == I2CEXT0_SCL_IN_IDX) { 1033 | i2c0SCL = i; 1034 | } else if (func == I2CEXT1_SDA_IN_IDX) { 1035 | i2c1SDA = i; 1036 | } else if (func == I2CEXT1_SCL_IN_IDX) { 1037 | i2c1SCL = i; 1038 | } 1039 | } 1040 | 1041 | if (i2c0SDA != -1 && i2c0SCL != -1) { 1042 | // Wire 1043 | Serial.printf("Wire(I2C0) SDA:%2d SCL:%2d\n", i2c0SDA, i2c0SCL); 1044 | for (byte address = 0; address <= 127; address++) { 1045 | Wire.beginTransmission(address); 1046 | byte error = Wire.endTransmission(); 1047 | if (error == 0) { 1048 | Serial.printf("%02X ", address); 1049 | } else { 1050 | Serial.print(".. "); 1051 | if (address % 16 == 15) { 1052 | Serial.println(); 1053 | } 1054 | } 1055 | delay(1); 1056 | } 1057 | Serial.println(); 1058 | } 1059 | if (i2c1SDA != -1 && i2c1SCL != -1) { 1060 | // Wire1 1061 | Serial.printf("Wire1(I2C1) SDA:%2d SCL:%2d\n", i2c1SDA, i2c1SCL); 1062 | for (byte address = 0; address <= 127; address++) { 1063 | Wire1.beginTransmission(address); 1064 | byte error = Wire1.endTransmission(); 1065 | if (error == 0) { 1066 | Serial.printf("%02X ", address); 1067 | } else { 1068 | Serial.print(".. "); 1069 | if (address % 16 == 15) { 1070 | Serial.println(); 1071 | } 1072 | } 1073 | delay(1); 1074 | } 1075 | Serial.println(); 1076 | } 1077 | } 1078 | 1079 | void formatStorage(String flash) { 1080 | Serial.printf("===============================================================\n"); 1081 | Serial.println("Format Storage"); 1082 | Serial.printf("===============================================================\n"); 1083 | if (flash == "NVS") { 1084 | Serial.println("Start NVS Format"); 1085 | if (nvs_flash_erase() == ESP_OK) { 1086 | Serial.println("NVS clear"); 1087 | } else { 1088 | Serial.println("NVS not clear"); 1089 | } 1090 | Serial.println("Finish NVS Format"); 1091 | } else if (flash == "SPIFFS") { 1092 | Serial.println("Start SPIFFS Format"); 1093 | SPIFFS.format(); 1094 | Serial.println("Finish SPIFFS Format"); 1095 | } else { 1096 | Serial.println("Unknown Storage"); 1097 | } 1098 | } 1099 | 1100 | String fileSizeString(uint32_t val) { 1101 | if (1024 * 1024 * 1024 < val) { 1102 | // GB 1103 | return String(val / 1024.0 / 1024.0 / 1024.0, 2) + String(" GB"); 1104 | } else if (1024 * 1024 < val) { 1105 | // MB 1106 | return String(val / 1024.0 / 1024.0, 2) + String(" MB"); 1107 | } else if (1024 < val) { 1108 | // KB 1109 | return String(val / 1024.0, 2) + String(" KB"); 1110 | } else { 1111 | // B 1112 | return String(val) + String(" B"); 1113 | } 1114 | } 1115 | 1116 | void dispSPIFFS(String command, String path1, String path2) { 1117 | Serial.printf("===============================================================\n"); 1118 | Serial.printf("SPIFFS\n"); 1119 | Serial.printf("===============================================================\n"); 1120 | uint32_t totalBytes = SPIFFS.totalBytes(); 1121 | uint32_t usedBytes = SPIFFS.usedBytes(); 1122 | 1123 | String sizeString = fileSizeString(totalBytes); 1124 | Serial.printf("Total Bytes : %10s\n", sizeString.c_str()); 1125 | sizeString = fileSizeString(usedBytes); 1126 | Serial.printf("Used Bytes : %10s\n", sizeString.c_str()); 1127 | 1128 | if (command == "DIR") { 1129 | if (path1 == "") { 1130 | path1 = "/"; 1131 | } 1132 | Serial.println(); 1133 | Serial.println("[DIR " + path1 + "]"); 1134 | 1135 | File root = SPIFFS.open(path1); 1136 | if (root) { 1137 | File file = root.openNextFile(); 1138 | while (file) { 1139 | time_t t = file.getLastWrite(); 1140 | struct tm *tm_t = localtime(&t); 1141 | Serial.printf("%04d-%02d-%02d %02d:%02d:%02d ", tm_t->tm_year + 1900, tm_t->tm_mon + 1, tm_t->tm_mday, tm_t->tm_hour, tm_t->tm_min, tm_t->tm_sec); 1142 | if (file.isDirectory()) { 1143 | Serial.print(""); 1144 | Serial.print(" "); 1145 | Serial.println(file.name()); 1146 | } else { 1147 | // ファイル名とファイルサイズを出力 1148 | Serial.print(" "); 1149 | String sizeString = fileSizeString(file.size()); 1150 | Serial.printf("%10s ", sizeString.c_str()); 1151 | Serial.println(file.name()); 1152 | } 1153 | file = root.openNextFile(); 1154 | } 1155 | } 1156 | } 1157 | 1158 | Serial.println(""); 1159 | Serial.println("[USAGE]"); 1160 | Serial.println(" SPIFFS : SPIFFS Info"); 1161 | Serial.println(" SPIFFS DIR [PATH] : Dir Info(default /)"); 1162 | } 1163 | 1164 | void dispSD(String command, String path1, String path2) { 1165 | Serial.printf("===============================================================\n"); 1166 | Serial.println("SD"); 1167 | Serial.printf("===============================================================\n"); 1168 | sdcard_type_t cardType = SD.cardType(); 1169 | String cardTypeName = ""; 1170 | if (cardType == CARD_NONE) { 1171 | cardTypeName = "(NONE)"; 1172 | } else if (cardType == CARD_MMC) { 1173 | cardTypeName = "MMC"; 1174 | } else if (cardType == CARD_SD) { 1175 | cardTypeName = "SD"; 1176 | } else if (cardType == CARD_SDHC) { 1177 | cardTypeName = "SDHC"; 1178 | } else if (cardType == CARD_UNKNOWN) { 1179 | cardTypeName = "(UNKNOWN)"; 1180 | } 1181 | uint32_t cardSize = SD.cardSize(); 1182 | uint32_t totalBytes = SD.totalBytes(); 1183 | uint32_t usedBytes = SD.usedBytes(); 1184 | 1185 | Serial.printf("Card Type : %s\n", cardTypeName.c_str()); 1186 | String sizeString = fileSizeString(cardSize); 1187 | Serial.printf("Card Size : %10s\n", sizeString.c_str()); 1188 | sizeString = fileSizeString(totalBytes); 1189 | Serial.printf("Total Bytes : %10s\n", sizeString.c_str()); 1190 | sizeString = fileSizeString(usedBytes); 1191 | Serial.printf("Used Bytes : %10s\n", sizeString.c_str()); 1192 | 1193 | if (SD.cardSize() == 0) { 1194 | // No SD 1195 | return; 1196 | } 1197 | 1198 | if (command == "DIR") { 1199 | if (path1 == "") { 1200 | path1 = "/"; 1201 | } 1202 | Serial.println(); 1203 | Serial.println("[DIR " + path1 + "]"); 1204 | 1205 | File root = SD.open(path1); 1206 | if (root) { 1207 | File file = root.openNextFile(); 1208 | while (file) { 1209 | time_t t = file.getLastWrite(); 1210 | struct tm *tm_t = localtime(&t); 1211 | Serial.printf("%04d-%02d-%02d %02d:%02d:%02d ", tm_t->tm_year + 1900, tm_t->tm_mon + 1, tm_t->tm_mday, tm_t->tm_hour, tm_t->tm_min, tm_t->tm_sec); 1212 | if (file.isDirectory()) { 1213 | Serial.print(""); 1214 | Serial.print(" "); 1215 | Serial.println(file.name()); 1216 | } else { 1217 | // ファイル名とファイルサイズを出力 1218 | Serial.print(" "); 1219 | String sizeString = fileSizeString(file.size()); 1220 | Serial.printf("%10s ", sizeString.c_str()); 1221 | Serial.println(file.name()); 1222 | } 1223 | file = root.openNextFile(); 1224 | } 1225 | } 1226 | } 1227 | 1228 | Serial.println(""); 1229 | Serial.println("[USAGE]"); 1230 | Serial.println(" SD : SD Info"); 1231 | Serial.println(" SD DIR [PATH] : Dir Info(default /)"); 1232 | } 1233 | 1234 | void screenshot(fs::FS &fs, String filename) { 1235 | Serial.printf("===============================================================\n"); 1236 | Serial.printf("SCREENSHOT\n"); 1237 | Serial.printf("===============================================================\n"); 1238 | 1239 | if (&fs == &SD) { 1240 | Serial.printf("Storage : SD\n"); 1241 | } 1242 | if (&fs == &SPIFFS) { 1243 | Serial.printf("Storage : SPIFFS\n"); 1244 | } 1245 | 1246 | Serial.printf("filename : %s\n", filename.c_str()); 1247 | 1248 | File file = fs.open(filename, FILE_WRITE); 1249 | if (!file) { 1250 | Serial.printf("file not open!\n"); 1251 | } 1252 | 1253 | uint8_t headSize = 66; 1254 | uint16_t width = _Lcd->width(); 1255 | uint16_t height = _Lcd->height(); 1256 | uint16_t dataSize = width * height * 2; 1257 | uint16_t fileSize = headSize + dataSize; 1258 | uint16_t rMask = 0b1111100000000000; 1259 | uint16_t gMask = 0b0000011111100000; 1260 | uint16_t bMask = 0b0000000000011111; 1261 | 1262 | // BMP Header 1263 | file.write('B'); 1264 | file.write('M'); 1265 | 1266 | // fileSize 1267 | file.write((uint8_t)(fileSize & 0xff)); 1268 | file.write((uint8_t)(fileSize >> 8)); 1269 | file.write(0x00); 1270 | file.write(0x00); 1271 | 1272 | // Reserve 1273 | file.write(0x00); 1274 | file.write(0x00); 1275 | file.write(0x00); 1276 | file.write(0x00); 1277 | 1278 | // headSize 1279 | file.write(headSize); 1280 | file.write(0x00); 1281 | file.write(0x00); 1282 | file.write(0x00); 1283 | 1284 | // infoSize 1285 | file.write(0x28); 1286 | file.write(0x00); 1287 | file.write(0x00); 1288 | file.write(0x00); 1289 | 1290 | // width 1291 | file.write((uint8_t)(width & 0xff)); 1292 | file.write((uint8_t)(width >> 8)); 1293 | file.write(0x00); 1294 | file.write(0x00); 1295 | 1296 | // height 1297 | file.write((uint8_t)(height & 0xff)); 1298 | file.write((uint8_t)(height >> 8)); 1299 | file.write(0x00); 1300 | file.write(0x00); 1301 | 1302 | // plane 1303 | file.write(0x01); 1304 | file.write(0x00); 1305 | 1306 | // bit/pixel 1307 | file.write(16); 1308 | file.write(0x00); 1309 | 1310 | // compression 1311 | file.write(0x03); 1312 | file.write(0x00); 1313 | file.write(0x00); 1314 | file.write(0x00); 1315 | 1316 | // dataSize 1317 | file.write((uint8_t)(dataSize & 0xff)); 1318 | file.write((uint8_t)(dataSize >> 8)); 1319 | file.write(0x00); 1320 | file.write(0x00); 1321 | 1322 | // Horizontal resolution 1323 | file.write(0x00); 1324 | file.write(0x00); 1325 | file.write(0x00); 1326 | file.write(0x00); 1327 | 1328 | // Vertical resolution 1329 | file.write(0x00); 1330 | file.write(0x00); 1331 | file.write(0x00); 1332 | file.write(0x00); 1333 | 1334 | // Color Size 1335 | file.write(0x00); 1336 | file.write(0x00); 1337 | file.write(0x00); 1338 | file.write(0x00); 1339 | 1340 | // Number of important colors 1341 | file.write(0x00); 1342 | file.write(0x00); 1343 | file.write(0x00); 1344 | file.write(0x00); 1345 | 1346 | // R MASK 1347 | file.write((uint8_t)(rMask & 0xff)); 1348 | file.write((uint8_t)(rMask >> 8)); 1349 | file.write(0x00); 1350 | file.write(0x00); 1351 | 1352 | // G MASK 1353 | file.write((uint8_t)(gMask & 0xff)); 1354 | file.write((uint8_t)(gMask >> 8)); 1355 | file.write(0x00); 1356 | file.write(0x00); 1357 | 1358 | // B MASK 1359 | file.write((uint8_t)(bMask & 0xff)); 1360 | file.write((uint8_t)(bMask >> 8)); 1361 | file.write(0x00); 1362 | file.write(0x00); 1363 | 1364 | // DATA 1365 | bool swap = _Lcd->getSwapBytes(); 1366 | _Lcd->setSwapBytes(true); 1367 | for (int y = 0; y < height; y++) { 1368 | uint16_t pl[width]; 1369 | _Lcd->readRect(0, height - y - 1, width, 1, pl); 1370 | file.write((uint8_t *)pl, width * 2); 1371 | } 1372 | _Lcd->setSwapBytes(swap); 1373 | 1374 | file.close(); 1375 | 1376 | Serial.println("Finish!"); 1377 | } 1378 | 1379 | void update() { 1380 | while (Serial.available()) { 1381 | char input[256]; 1382 | String command = Serial.readStringUntil('\n'); 1383 | command.trim(); 1384 | strncpy(input, command.c_str(), sizeof(input) - 1); 1385 | char* command0 = strtok(input, " "); 1386 | command = command0; 1387 | command0 = strtok(NULL, " "); 1388 | String command2 = command0; 1389 | command0 = strtok(NULL, " "); 1390 | String command3 = command0; 1391 | command0 = strtok(NULL, " "); 1392 | String command4 = command0; 1393 | 1394 | if (command == "") { 1395 | // Skip 1396 | } else if (command == "?") { 1397 | dispHelp(); 1398 | } else if (command == "RESET") { 1399 | ESP.restart(); 1400 | } else if (command == "INFO") { 1401 | dispInfo(); 1402 | } else if (command == "AXP192") { 1403 | dispAxp192(); 1404 | } else if (command == "IMU") { 1405 | dispImu(); 1406 | } else if (command == "RTC") { 1407 | dispRtc(); 1408 | } else if (command == "MEM") { 1409 | dispMemory(); 1410 | } else if (command == "GPIO") { 1411 | dispGpio(); 1412 | } else if (command == "I2C") { 1413 | dispI2c(); 1414 | } else if (command == "FORMAT") { 1415 | formatStorage(command2); 1416 | } else if (command == "SPIFFS") { 1417 | dispSPIFFS(command2, command3, command4); 1418 | } else if (command == "SD") { 1419 | dispSD(command2, command3, command4); 1420 | } else if (command == "SCREENSHOT") { 1421 | String filename; 1422 | if (command3 != "") { 1423 | filename = command3; 1424 | } else { 1425 | char name[40]; 1426 | time_t t = time(NULL); 1427 | struct tm *t_st; 1428 | t_st = localtime(&t); 1429 | snprintf(name, 40, "/screenshot_%04d-%02d-%02d_%02d-%02d-%02d.bmp", 1430 | t_st->tm_year + 1900, t_st->tm_mon + 1, t_st->tm_mday, 1431 | t_st->tm_hour, t_st->tm_min, t_st->tm_sec); 1432 | filename = name; 1433 | } 1434 | if (command2 == "SPIFFS") { 1435 | screenshot(SPIFFS, filename); 1436 | } else { 1437 | screenshot(SD, filename); 1438 | } 1439 | #ifdef WiFi_h 1440 | } else if (command == "WIFI") { 1441 | connectWiFi(command2, command3); 1442 | } else if (command == "NTP") { 1443 | syncNTP(command2); 1444 | #endif 1445 | } else { 1446 | dispHelp(); 1447 | } 1448 | 1449 | Serial.println(">"); 1450 | } 1451 | } 1452 | }; 1453 | 1454 | #endif 1455 | -------------------------------------------------------------------------------- /src/M5LiteEx.h: -------------------------------------------------------------------------------- 1 | #ifndef __M5LiteEx_H__ 2 | #define __M5LiteEx_H__ 3 | 4 | class M5LiteEx { 5 | public: 6 | int board = 0; 7 | bool useLcd = true; 8 | 9 | M5LiteSound Sound; 10 | 11 | TFT_eSPI *_Lcd; 12 | M5LiteAXP192 *_Axp; 13 | M5LiteButton *_BtnA; 14 | M5LiteButton *_BtnB; 15 | M5LiteButton *_BtnC; 16 | M5LiteRTC *_Rtc; 17 | M5LiteIMU *_Imu; 18 | M5LiteMPU6886 *_Mpu6886; 19 | M5LiteSH200Q *_Sh200Q; 20 | M5LiteCommUtil *_I2C; 21 | M5LitePower *_Power; 22 | M5LiteSpeaker *_Beep; 23 | M5LiteLED *_dis; 24 | M5LiteDebug *_Debug; 25 | M5LiteTouch *_Touch; 26 | Preferences *_preferences; 27 | 28 | void update(void) { 29 | _Touch->update(); 30 | _BtnA->read(); 31 | _BtnB->read(); 32 | _BtnC->read(); 33 | _Beep->update(); 34 | _Debug->update(); 35 | } 36 | 37 | void delay(unsigned long ms) { 38 | const unsigned long tick = 50; 39 | 40 | update(); 41 | 42 | while (0 < ms) { 43 | if (tick < ms) { 44 | ::delay(tick); 45 | ms -= tick; 46 | } else { 47 | ::delay(ms); 48 | ms = 0; 49 | } 50 | update(); 51 | } 52 | } 53 | 54 | void setLed(bool state) { 55 | static int8_t now = -1; 56 | 57 | if (now == state) { 58 | return; 59 | } 60 | now = state; 61 | 62 | if (_ledPin == -1) { 63 | // Non LED 64 | return; 65 | } else if (_ledPin < 40) { 66 | // GPIO 67 | pinMode(_ledPin, OUTPUT); 68 | digitalWrite(_ledPin, !state); 69 | } else if (_ledPin == 100) { 70 | // AXP192 71 | _Axp->SetLed(state); 72 | } 73 | } 74 | 75 | void setVibration(bool state) { 76 | static int8_t now = -1; 77 | 78 | if (now == state) { 79 | return; 80 | } 81 | now = state; 82 | 83 | if (_ledPin == 100) { 84 | // AXP192 85 | _Axp->SetVibration(state); 86 | } 87 | } 88 | 89 | void setPin(int8_t ledPin) { 90 | _ledPin = ledPin; 91 | } 92 | 93 | void screenshot(fs::FS &fs, String filename) { 94 | _Debug->screenshot(fs, filename); 95 | } 96 | 97 | private: 98 | int8_t _ledPin; 99 | }; 100 | 101 | #endif 102 | -------------------------------------------------------------------------------- /src/M5LiteIMU.h: -------------------------------------------------------------------------------- 1 | #ifndef __M5LiteIMU_H__ 2 | #define __M5LiteIMU_H__ 3 | 4 | #include "I2C_MPU6886.h" 5 | #include "I2C_SH200Q.h" 6 | #include "I2C_BMA423.h" 7 | 8 | class M5LiteIMU { 9 | public: 10 | enum ImuType { 11 | IMU_UNKNOWN = 0, 12 | IMU_SH200Q = 1, 13 | IMU_MPU6886 = 2, 14 | IMU_BMA423 = 101, 15 | }; 16 | 17 | int Init(void) { 18 | int imu_flag = _mpu6886->begin(); 19 | if (imu_flag == 0) { 20 | imuType = IMU_MPU6886; 21 | return 0; 22 | } 23 | 24 | imu_flag = _sh200q->begin(); 25 | if (imu_flag == 0) { 26 | imuType = IMU_SH200Q; 27 | return 0; 28 | } 29 | 30 | imu_flag = _bma423->begin(); 31 | if (imu_flag == 0) { 32 | imuType = IMU_BMA423; 33 | return 0; 34 | } 35 | 36 | imuType = IMU_UNKNOWN; 37 | return -1; 38 | } 39 | 40 | void setMPU6886(I2C_MPU6886 *mpu6886) { 41 | _mpu6886 = mpu6886; 42 | } 43 | void setSH200Q(I2C_SH200Q *sh200q) { 44 | _sh200q = sh200q; 45 | } 46 | void setBMA423(I2C_BMA423 *bma423) { 47 | _bma423 = bma423; 48 | } 49 | 50 | void getGres() __attribute__((deprecated)) { 51 | // TODO 52 | ESP_LOGE("IMU", "Not Support"); 53 | } 54 | void getAres() __attribute__((deprecated)) { 55 | // TODO 56 | ESP_LOGE("IMU", "Not Support"); 57 | } 58 | 59 | void getAccelData(float *ax, float *ay, float *az) { 60 | if (imuType == IMU_MPU6886) { 61 | _mpu6886->getAccel(ax, ay, az); 62 | } else if (imuType == IMU_SH200Q) { 63 | _sh200q->getAccel(ax, ay, az); 64 | } else if (imuType == IMU_BMA423) { 65 | _bma423->getAccel(ax, ay, az); 66 | } else { 67 | *ax = 0; 68 | *ay = 0; 69 | *az = 0; 70 | } 71 | 72 | if (board == lgfx::board_unknown) { 73 | *ax = -(*ax); 74 | *az = -(*az); 75 | } else if (board == lgfx::board_TTGO_TWatch) { 76 | *ax = -(*ax); 77 | *ay = -(*ay); 78 | } 79 | } 80 | 81 | void getGyroData(float *gx, float *gy, float *gz) { 82 | if (imuType == IMU_MPU6886) { 83 | _mpu6886->getGyro(gx, gy, gz); 84 | } else if (imuType == IMU_SH200Q) { 85 | _sh200q->getGyro(gx, gy, gz); 86 | } else { 87 | *gx = 0; 88 | *gy = 0; 89 | *gz = 0; 90 | } 91 | 92 | if (board == lgfx::board_unknown) { 93 | *gx = -(*gx); 94 | *gz = -(*gz); 95 | } 96 | } 97 | 98 | void getTempData(float *t) { 99 | if (imuType == IMU_MPU6886) { 100 | _mpu6886->getTemp(t); 101 | } else if (imuType == IMU_SH200Q) { 102 | _sh200q->getTemp(t); 103 | } else { 104 | *t = 0; 105 | } 106 | } 107 | 108 | ImuType imuType; 109 | int board; 110 | float aRes; 111 | float gRes; 112 | 113 | private: 114 | I2C_MPU6886 *_mpu6886; 115 | I2C_SH200Q *_sh200q; 116 | I2C_BMA423 *_bma423; 117 | }; 118 | 119 | #endif 120 | -------------------------------------------------------------------------------- /src/M5LiteLED.h: -------------------------------------------------------------------------------- 1 | #ifndef __M5LiteLED_H__ 2 | #define __M5LiteLED_H__ 3 | 4 | #define FASTLED_INTERNAL 5 | #include 6 | 7 | class M5LiteLED { 8 | public: 9 | const static uint8_t NUM_LEDS = 25; 10 | const static uint8_t DATA_PIN = 27; 11 | 12 | M5LiteLED() { 13 | _xSemaphore = xSemaphoreCreateMutex(); 14 | } 15 | 16 | void begin() { 17 | // LED Reset 18 | digitalWrite(DATA_PIN, LOW); 19 | delay(50); 20 | 21 | // LED Start 22 | FastLED.addLeds(_ledbuff, NUM_LEDS); 23 | xTaskCreateUniversal( 24 | task, 25 | "M5LiteLED", 26 | 8192, 27 | this, 28 | 5, 29 | NULL, 30 | APP_CPU_NUM 31 | ); 32 | } 33 | 34 | static void task(void *pvParameters) { 35 | M5LiteLED *led = (M5LiteLED*)pvParameters; 36 | led->run(); 37 | } 38 | 39 | void run(void) { 40 | clear(); 41 | FastLED.show(); 42 | FastLED.setBrightness(20); 43 | 44 | while (1) { 45 | FastLED.show(); 46 | delay(10); 47 | } 48 | } 49 | 50 | void setBrightness(uint8_t brightness) { 51 | if (20 < brightness) { 52 | brightness = 20; 53 | } 54 | xSemaphoreTake(_xSemaphore, portMAX_DELAY); 55 | FastLED.setBrightness(brightness); 56 | xSemaphoreGive(_xSemaphore); 57 | } 58 | 59 | void drawpix(uint8_t xpos, uint8_t ypos, CRGB Color) { 60 | if ((5 <= xpos) || (5 <= ypos)) { 61 | return; 62 | } 63 | xSemaphoreTake(_xSemaphore, portMAX_DELAY); 64 | _ledbuff[ypos * 5 + xpos] = Color; 65 | xSemaphoreGive(_xSemaphore); 66 | } 67 | 68 | void drawpix(uint8_t Number, CRGB Color) { 69 | if (Number >= 25) { 70 | return; 71 | } 72 | xSemaphoreTake(_xSemaphore, portMAX_DELAY); 73 | _ledbuff[Number] = Color; 74 | xSemaphoreGive(_xSemaphore); 75 | } 76 | 77 | void clear() { 78 | xSemaphoreTake(_xSemaphore, portMAX_DELAY); 79 | for (int8_t i = 0; i < NUM_LEDS; i++) { 80 | _ledbuff[i] = 0; 81 | } 82 | xSemaphoreGive(_xSemaphore); 83 | } 84 | 85 | CRGB _ledbuff[NUM_LEDS]; 86 | private: 87 | uint8_t _numberled; 88 | 89 | uint8_t _mode; 90 | uint16_t _am_speed; 91 | uint8_t _am_mode; 92 | int32_t _count_x, _count_y; 93 | int32_t _am_count = -1; 94 | uint8_t *_am_buffptr; 95 | 96 | SemaphoreHandle_t _xSemaphore = NULL; 97 | }; 98 | 99 | #endif 100 | -------------------------------------------------------------------------------- /src/M5LiteMPU6886.h: -------------------------------------------------------------------------------- 1 | #ifndef __M5LiteMPU6886_H__ 2 | #define __M5LiteMPU6886_H__ 3 | 4 | #include "I2C_MPU6886.h" 5 | 6 | class M5LiteMPU6886 { 7 | public: 8 | enum Ascale { 9 | AFS_2G = 0, 10 | AFS_4G, 11 | AFS_8G, 12 | AFS_16G 13 | }; 14 | 15 | enum Gscale { 16 | GFS_250DPS = 0, 17 | GFS_500DPS, 18 | GFS_1000DPS, 19 | GFS_2000DPS 20 | }; 21 | 22 | void setMPU6886(I2C_MPU6886 *mpu6886) { 23 | imu = mpu6886; 24 | } 25 | 26 | int Init(void) { 27 | return imu->begin(); 28 | } 29 | 30 | void getAccelData(float* ax, float* ay, float* az) { 31 | imu->getAccel(ax, ay, az); 32 | } 33 | 34 | void getGyroData(float* gx, float* gy, float* gz) { 35 | imu->getGyro(gx, gy, gz); 36 | } 37 | 38 | void getTempData(float *t) { 39 | imu->getTemp(t); 40 | } 41 | 42 | private: 43 | I2C_MPU6886 *imu; 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /src/M5LitePower.h: -------------------------------------------------------------------------------- 1 | #ifndef __M5LitePower_H__ 2 | #define __M5LitePower_H__ 3 | 4 | #include "I2C_IP5306.h" 5 | 6 | #define SLEEP_MSEC(us) (((uint64_t)us) * 1000L) 7 | #define SLEEP_SEC(us) (((uint64_t)us) * 1000000L) 8 | #define SLEEP_MIN(us) (((uint64_t)us) * 60L * 1000000L) 9 | #define SLEEP_HR(us) (((uint64_t)us) * 60L * 60L * 1000000L) 10 | 11 | class M5LitePower 12 | { 13 | public: 14 | M5LitePower() { 15 | } 16 | 17 | void setIP5306(I2C_IP5306 *ip5306) { 18 | _ip5306 = ip5306; 19 | } 20 | 21 | bool canControl() { 22 | return _ip5306->canControl(); 23 | } 24 | void begin() { 25 | if (!_ip5306->canControl()) { 26 | return; 27 | } 28 | 29 | // 650mA 30 | _ip5306->setVinMaxCurrent(0x06); 31 | 32 | // 4.2V 33 | _ip5306->setChargeVolt(0x00); 34 | 35 | // 200mA 36 | _ip5306->setChargeStopCurrent(0x00); 37 | 38 | // 28mv 39 | _ip5306->setChargeAddVolt(0x02); 40 | 41 | // VIN 42 | _ip5306->setChargeCC(0x01); 43 | 44 | enable = true; 45 | } 46 | 47 | enum ShutdownTime { 48 | SHUTDOWN_8S = 0, 49 | SHUTDOWN_16S, 50 | SHUTDOWN_32S, 51 | SHUTDOWN_64S 52 | }; 53 | 54 | bool setPowerBoostKeepOn(bool en) { 55 | if (!enable) { 56 | return false; 57 | } 58 | _ip5306->setBoostOut(en); 59 | return true; 60 | } 61 | bool setAutoBootOnLoad(bool en) { 62 | if (!enable) { 63 | return false; 64 | } 65 | _ip5306->setBoosOnLoad(en); 66 | return true; 67 | } 68 | bool setLowPowerShutdownTime(ShutdownTime time) { 69 | if (!enable) { 70 | return false; 71 | } 72 | _ip5306->setLowPowerShutdownTime(time >> 2); 73 | return true; 74 | } 75 | bool setPowerBoostOnOff(bool en) { 76 | if (!enable) { 77 | return false; 78 | } 79 | _ip5306->setBoostButtonType(en); 80 | return true; 81 | } 82 | bool setPowerBoostSet(bool en) { 83 | if (!enable) { 84 | return false; 85 | } 86 | _ip5306->setShortBoost(en); 87 | return true; 88 | } 89 | bool setPowerVin(bool en) { 90 | if (!enable) { 91 | return false; 92 | } 93 | _ip5306->setVin(en); 94 | return true; 95 | } 96 | bool setPowerWLEDSet(bool en) { 97 | if (!enable) { 98 | return false; 99 | } 100 | _ip5306->setWledButtonType(en); 101 | return true; 102 | } 103 | bool setPowerBtnEn(bool en) { 104 | if (!enable) { 105 | return false; 106 | } 107 | _ip5306->setBoostButton(en); 108 | return true; 109 | } 110 | 111 | bool setVinMaxCurrent(uint8_t cur) { 112 | if (!enable) { 113 | return false; 114 | } 115 | _ip5306->setVinMaxCurrent(cur); 116 | return true; 117 | } 118 | bool setChargeVolt(uint8_t volt) { 119 | if (!enable) { 120 | return false; 121 | } 122 | _ip5306->setChargeVolt(volt); 123 | return true; 124 | } 125 | 126 | bool setCharge(bool en) { 127 | if (!enable) { 128 | return false; 129 | } 130 | _ip5306->setCharger(en); 131 | return true; 132 | } 133 | bool isChargeFull() { 134 | if (!enable) { 135 | return false; 136 | } 137 | return _ip5306->isChargeFull(); 138 | } 139 | bool isCharging() { 140 | if (!enable) { 141 | return false; 142 | } 143 | return _ip5306->isCharging(); 144 | } 145 | int8_t getBatteryLevel() { 146 | if (!enable) { 147 | return false; 148 | } 149 | return _ip5306->getBatteryLevel(); 150 | } 151 | 152 | void powerOFF() { 153 | if (!enable) { 154 | return; 155 | } 156 | _ip5306->setBoost(false); 157 | } 158 | 159 | void reset() { 160 | esp_restart(); 161 | } 162 | 163 | private: 164 | uint8_t _wakeupPin; 165 | I2C_IP5306 *_ip5306; 166 | bool enable = false; 167 | }; 168 | #endif 169 | -------------------------------------------------------------------------------- /src/M5LiteRTC.h: -------------------------------------------------------------------------------- 1 | #ifndef __M5LiteRTC_H__ 2 | #define __M5LiteRTC_H__ 3 | 4 | #include 5 | #include "I2C_BM8563.h" 6 | 7 | typedef struct { 8 | uint8_t Hours; 9 | uint8_t Minutes; 10 | uint8_t Seconds; 11 | } RTC_TimeTypeDef; 12 | 13 | typedef struct { 14 | uint8_t WeekDay; 15 | uint8_t Month; 16 | uint8_t Date; 17 | uint16_t Year; 18 | } RTC_DateTypeDef; 19 | 20 | class M5LiteRTC { 21 | public: 22 | void begin(void) { 23 | if (!enable) { 24 | return; 25 | } 26 | rtc.begin(); 27 | } 28 | 29 | void SetTime(RTC_TimeTypeDef* RTC_TimeStruct) { 30 | if (!enable) { 31 | return; 32 | } 33 | rtc.setTime((I2C_BM8563_TimeTypeDef*)RTC_TimeStruct); 34 | } 35 | void SetData(RTC_DateTypeDef* RTC_DateStruct) { 36 | if (!enable) { 37 | return; 38 | } 39 | rtc.setDate((I2C_BM8563_DateTypeDef*)RTC_DateStruct); 40 | } 41 | 42 | void GetTime(RTC_TimeTypeDef* RTC_TimeStruct) { 43 | if (!enable) { 44 | memset(RTC_TimeStruct, 0, sizeof(RTC_TimeTypeDef)); 45 | return; 46 | } 47 | rtc.getTime((I2C_BM8563_TimeTypeDef*)RTC_TimeStruct); 48 | } 49 | void GetData(RTC_DateTypeDef* RTC_DateStruct) { 50 | if (!enable) { 51 | memset(RTC_DateStruct, 0, sizeof(RTC_DateTypeDef)); 52 | return; 53 | } 54 | rtc.getDate((I2C_BM8563_DateTypeDef*)RTC_DateStruct); 55 | } 56 | 57 | bool enable = false; 58 | 59 | private: 60 | I2C_BM8563 rtc = I2C_BM8563(I2C_BM8563_DEFAULT_ADDRESS, Wire1); 61 | }; 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /src/M5LiteSH200Q.h: -------------------------------------------------------------------------------- 1 | #ifndef __M5LiteSH200Q_H__ 2 | #define __M5LiteSH200Q_H__ 3 | 4 | #include "I2C_SH200Q.h" 5 | 6 | class M5LiteSH200Q { 7 | public: 8 | enum Ascale { 9 | AFS_2G = 0, 10 | AFS_4G, 11 | AFS_8G, 12 | AFS_16G 13 | }; 14 | 15 | enum Gscale { 16 | GFS_250DPS = 0, 17 | GFS_500DPS, 18 | GFS_1000DPS, 19 | GFS_2000DPS 20 | }; 21 | 22 | void setSH200Q(I2C_SH200Q *SH200Q) { 23 | imu = SH200Q; 24 | } 25 | 26 | int Init(void) { 27 | return imu->begin(); 28 | } 29 | 30 | void getAccelData(float* ax, float* ay, float* az) { 31 | imu->getAccel(ax, ay, az); 32 | } 33 | void getGyroData(float* gx, float* gy, float* gz) { 34 | imu->getGyro(gx, gy, gz); 35 | } 36 | void getTempData(float *t) { 37 | imu->getTemp(t); 38 | } 39 | 40 | private: 41 | I2C_SH200Q *imu; 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/M5LiteSound.h: -------------------------------------------------------------------------------- 1 | #ifndef __M5LiteSound_H__ 2 | #define __M5LiteSound_H__ 3 | 4 | #define M5LITE_SOUND_I2S_NUMBER I2S_NUM_0 5 | 6 | class M5LiteSound { 7 | public: 8 | enum { 9 | M5LITE_SOUND_NONE, 10 | M5LITE_SOUND_SPEAKER, 11 | M5LITE_SOUND_MIC 12 | }; 13 | 14 | M5LiteSound(void) { 15 | } 16 | 17 | void begin() { 18 | _state = true; 19 | } 20 | 21 | void setAXP(M5LiteAXP192 *Axp) { 22 | _Axp = Axp; 23 | } 24 | 25 | void setBoard(int board) { 26 | _board = board; 27 | } 28 | 29 | void setMode(uint8_t mode, int sampleRate = 16000) { 30 | esp_err_t err = ESP_OK; 31 | 32 | _mode = mode; 33 | 34 | i2s_driver_uninstall(M5LITE_SOUND_I2S_NUMBER); 35 | 36 | if (mode == M5LITE_SOUND_NONE) { 37 | return; 38 | } 39 | 40 | int8_t bckPin = -1; 41 | int8_t lrckPin = -1; 42 | int8_t dataOutPin = -1; 43 | int8_t dataInPin = -1; 44 | 45 | if (_board == lgfx::board_M5Stack) { 46 | // DAC 47 | _i2s = false; 48 | } else if (_board == lgfx::board_M5StackCore2) { 49 | // I2S 50 | bckPin = 12; 51 | lrckPin = 0; 52 | dataOutPin = 2; 53 | dataInPin = 34; 54 | } else if (_board == lgfx::board_M5StickC) { 55 | // Speaker HAT 56 | _i2s = false; 57 | } else if (_board == lgfx::board_M5StickCPlus) { 58 | // Speaker HAT 59 | _i2s = false; 60 | } else if (_board == lgfx::board_unknown) { 61 | // ATOM Echo 62 | bckPin = 19; 63 | lrckPin = 33; 64 | dataOutPin = 22; 65 | dataInPin = 23; 66 | } 67 | 68 | if (_i2s) { 69 | i2s_config_t i2s_config = { 70 | .mode = (i2s_mode_t)(I2S_MODE_MASTER), 71 | .sample_rate = sampleRate, 72 | .bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT, 73 | .channel_format = I2S_CHANNEL_FMT_ALL_RIGHT, 74 | .communication_format = I2S_COMM_FORMAT_I2S, 75 | .intr_alloc_flags = ESP_INTR_FLAG_LEVEL1, 76 | .dma_buf_count = 4, 77 | .dma_buf_len = buffSize, 78 | .use_apll = false, 79 | .tx_desc_auto_clear = true, 80 | .fixed_mclk = 0 81 | }; 82 | 83 | if (mode == M5LITE_SOUND_MIC) { 84 | i2s_config.mode = (i2s_mode_t)(I2S_MODE_MASTER | I2S_MODE_RX | I2S_MODE_PDM); 85 | } else { 86 | i2s_config.mode = (i2s_mode_t)(I2S_MODE_MASTER | I2S_MODE_TX); 87 | } 88 | 89 | err += i2s_driver_install(M5LITE_SOUND_I2S_NUMBER, &i2s_config, 0, NULL); 90 | 91 | i2s_pin_config_t tx_pin_config = { 92 | .bck_io_num = bckPin, 93 | .ws_io_num = lrckPin, 94 | .data_out_num = dataOutPin, 95 | .data_in_num = dataInPin, 96 | }; 97 | err += i2s_set_pin(M5LITE_SOUND_I2S_NUMBER, &tx_pin_config); 98 | 99 | if (mode != M5LITE_SOUND_MIC) { 100 | err += i2s_set_clk(M5LITE_SOUND_I2S_NUMBER, sampleRate, I2S_BITS_PER_SAMPLE_16BIT, I2S_CHANNEL_MONO); 101 | } 102 | } else { 103 | i2s_config_t i2s_config = { 104 | .mode = (i2s_mode_t)(I2S_MODE_MASTER | I2S_MODE_TX | I2S_MODE_DAC_BUILT_IN), 105 | .sample_rate = sampleRate, 106 | .bits_per_sample = I2S_BITS_PER_SAMPLE_16BIT, 107 | .channel_format = I2S_CHANNEL_FMT_ALL_LEFT, 108 | .communication_format = I2S_COMM_FORMAT_I2S_MSB, 109 | .intr_alloc_flags = ESP_INTR_FLAG_LEVEL1, 110 | .dma_buf_count = 4, 111 | .dma_buf_len = buffSize, 112 | .use_apll = false, 113 | .tx_desc_auto_clear = true, 114 | .fixed_mclk = 0 115 | }; 116 | err += i2s_driver_install(M5LITE_SOUND_I2S_NUMBER, &i2s_config, 0, NULL); 117 | err += i2s_set_pin(M5LITE_SOUND_I2S_NUMBER, NULL); 118 | } 119 | 120 | i2s_zero_dma_buffer(M5LITE_SOUND_I2S_NUMBER); 121 | } 122 | 123 | void play(const unsigned char *playWav, size_t playSize, int sampleRate = 16000, int bit = 8) { 124 | setMode(M5LITE_SOUND_SPEAKER, sampleRate); 125 | 126 | if (_board == lgfx::board_M5StackCore2) { 127 | _Axp->SetSpkEnable(true); 128 | } 129 | 130 | // Write Speaker 131 | size_t bytes_written; 132 | if (_i2s) { 133 | // I2S 134 | int16_t data[buffSize / 2]; 135 | uint8_t *wave8 = (uint8_t*)playWav; 136 | int16_t *wave16 = (int16_t*)playWav; 137 | int index = 0; 138 | int waveSize = 0; 139 | if (bit == 16) { 140 | waveSize = playSize / 2; 141 | } else { 142 | waveSize = playSize; 143 | } 144 | 145 | for (int i; i < waveSize; i++) { 146 | int16_t val; 147 | if (bit == 16) { 148 | val = wave16[i]; 149 | } else { 150 | val = (wave8[i] - 128) * 256; 151 | } 152 | 153 | data[index] = val; 154 | index += 1; 155 | if ((buffSize / 2) <= index) { 156 | index = 0; 157 | i2s_write(M5LITE_SOUND_I2S_NUMBER, data, buffSize, &bytes_written, portMAX_DELAY); 158 | } 159 | } 160 | if (index != 0) { 161 | i2s_write(M5LITE_SOUND_I2S_NUMBER, data, index, &bytes_written, portMAX_DELAY); 162 | } 163 | delay(100); 164 | } else { 165 | // DAC Out 166 | unsigned char data[buffSize]; 167 | uint8_t *wave8 = (uint8_t*)playWav; 168 | int16_t *wave16 = (int16_t*)playWav; 169 | int index = 0; 170 | int waveSize = 0; 171 | if (bit == 16) { 172 | waveSize = playSize / 2; 173 | } else { 174 | waveSize = playSize; 175 | } 176 | 177 | for (int i; i < waveSize; i++) { 178 | uint8_t val; 179 | if (bit == 16) { 180 | val = (wave16[i] / 256) + 128; 181 | } else { 182 | val = wave8[i]; 183 | } 184 | 185 | data[index] = 0; 186 | data[index + 1] = val; 187 | data[index + 2] = 0; 188 | data[index + 3] = 0; 189 | index += 4; 190 | if (buffSize <= index) { 191 | index = 0; 192 | i2s_write(M5LITE_SOUND_I2S_NUMBER, data, buffSize, &bytes_written, portMAX_DELAY); 193 | Serial.printf("len = %d\n", bytes_written); 194 | } 195 | } 196 | if (index != 0) { 197 | i2s_write(M5LITE_SOUND_I2S_NUMBER, data, index, &bytes_written, portMAX_DELAY); 198 | Serial.printf("len = %d\n", bytes_written); 199 | } 200 | } 201 | 202 | i2s_zero_dma_buffer(M5LITE_SOUND_I2S_NUMBER); 203 | 204 | if (_board == lgfx::board_M5StackCore2) { 205 | _Axp->SetSpkEnable(false); 206 | } 207 | } 208 | 209 | private: 210 | bool _state = false; 211 | bool _i2s = true; 212 | M5LiteAXP192 *_Axp; 213 | int _board; 214 | int _mode = M5LITE_SOUND_NONE; 215 | const int buffSize = 256; 216 | }; 217 | #endif 218 | -------------------------------------------------------------------------------- /src/M5LiteSpeaker.h: -------------------------------------------------------------------------------- 1 | #ifndef __M5LiteSpeaker_H__ 2 | #define __M5LiteSpeaker_H__ 3 | 4 | class M5LiteSpeaker { 5 | public: 6 | M5LiteSpeaker(void) { 7 | } 8 | void setPin(uint8_t pin, uint8_t pwm_ch) { 9 | _pin = pin; 10 | _pwm_ch = pwm_ch; 11 | _volume = 11; 12 | if (_pin == 25 || _pin == 26) { 13 | dac = true; 14 | } else { 15 | dac = false; 16 | } 17 | } 18 | 19 | void begin() { 20 | if (_pin == -1) { 21 | return; 22 | } 23 | _begun = true; 24 | ledcSetup(_pwm_ch, 0, 13); 25 | ledcAttachPin(_pin, _pwm_ch); 26 | setBeep(1000, 100); 27 | } 28 | void end() { 29 | mute(); 30 | ledcDetachPin(_pin); 31 | _begun = false; 32 | } 33 | void mute() { 34 | ledcWriteTone(_pwm_ch, 0); 35 | digitalWrite(_pin, 0); 36 | } 37 | void tone(uint16_t frequency) { 38 | if (!_begun) { 39 | begin(); 40 | } 41 | ledcSetup(_pwm_ch, frequency, 11); 42 | int vol = _volume; 43 | if (!dac) { 44 | vol = (1024 / 2 / 11) * _volume; 45 | } 46 | ledcWrite(_pwm_ch, vol); 47 | } 48 | void tone(uint16_t frequency, uint32_t duration) { 49 | tone(frequency); 50 | _count = millis() + duration; 51 | speaker_on = 1; 52 | } 53 | void beep() { 54 | if (!_begun) { 55 | begin(); 56 | } 57 | tone(_beep_freq, _beep_duration); 58 | } 59 | void setBeep(uint16_t frequency, uint16_t duration) { 60 | _beep_freq = frequency; 61 | _beep_duration = duration; 62 | } 63 | void update() { 64 | if (speaker_on) { 65 | if (millis() > _count) { 66 | speaker_on = 0; 67 | mute(); 68 | } 69 | } 70 | } 71 | 72 | void write(uint8_t value) { 73 | if (dac) { 74 | dacWrite(_pin, value); 75 | } 76 | } 77 | void setVolume(uint8_t volume) { 78 | if (dac == false && 11 < volume) { 79 | volume = 11; 80 | } 81 | _volume = volume; 82 | } 83 | void playMusic(const uint8_t *music_data, uint16_t sample_rate) { 84 | if (!dac) { 85 | return; 86 | } 87 | uint32_t length = strlen((char*)music_data); 88 | uint16_t delay_interval = ((uint32_t)1000000 / sample_rate); 89 | if (_volume != 11) { 90 | for (int i = 0; i < length; i++) { 91 | write(music_data[i] / _volume); 92 | delayMicroseconds(delay_interval); 93 | } 94 | 95 | for (int t = music_data[length - 1] / _volume; t >= 0; t--) { 96 | write(t); 97 | delay(2); 98 | } 99 | } 100 | ledcAttachPin(_pin, _pwm_ch); 101 | } 102 | 103 | private: 104 | int8_t _pin = -1; 105 | int8_t _pwm_ch = -1; 106 | uint32_t _count; 107 | uint8_t _volume = 8; 108 | uint16_t _beep_duration; 109 | uint16_t _beep_freq; 110 | bool _begun = false; 111 | bool speaker_on; 112 | bool dac = false; 113 | }; 114 | #endif 115 | -------------------------------------------------------------------------------- /src/M5LiteTouch.h: -------------------------------------------------------------------------------- 1 | #ifndef __M5LiteTouch_H__ 2 | #define __M5LiteTouch_H__ 3 | 4 | typedef struct point 5 | { 6 | int x; 7 | int y; 8 | } TouchPoint_t; 9 | 10 | class M5LiteTouch { 11 | public: 12 | void setLcd(TFT_eSPI *Lcd) { 13 | _Lcd = Lcd; 14 | } 15 | 16 | bool ispressed() { 17 | return (_TouchPoint.x != -1); 18 | } 19 | bool ispressedRaw() { 20 | return (_TouchPointRaw.x != -1); 21 | } 22 | 23 | TouchPoint_t getPressPoint() { 24 | return _TouchPoint; 25 | } 26 | TouchPoint_t getPressPointRaw() { 27 | return _TouchPointRaw; 28 | } 29 | 30 | void update() { 31 | if (enable) { 32 | if (!_Lcd->getTouch(&_TouchPoint.x, &_TouchPoint.y)) { 33 | _TouchPoint.x = -1; 34 | _TouchPoint.y = -1; 35 | } 36 | if (!_Lcd->getTouchRaw(&_TouchPointRaw.x, &_TouchPointRaw.y)) { 37 | _TouchPointRaw.x = -1; 38 | _TouchPointRaw.y = -1; 39 | } 40 | } 41 | } 42 | 43 | bool enable = false; 44 | 45 | private: 46 | TouchPoint_t _TouchPoint = { -1, -1}; 47 | TouchPoint_t _TouchPointRaw = { -1, -1}; 48 | TFT_eSPI *_Lcd; 49 | }; 50 | 51 | #endif 52 | --------------------------------------------------------------------------------