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AMUn9IqDHKVNGAACMPJwIxoL+FoigYUT9IqDIKVZGf/4AMUH9IqDJKVNGfP4oI1bCnq0EgUX+4AgAoqJxwKoRgT7+4AgAgUL+4AgAxnP+AAAoMxaCnK0EgTz+4AgAoqPogTb+4AgA4AIARmz+HfAAAAA2QQCdAoKgwCgDh5kPzDIMEoYHAAwCKQN84oYPACYSByYiGIYDAAAAgqDbgCkjh5kqDCIpA3zyRggAAAAioNwnmQoMEikDLQgGBAAAAIKg3Xzyh5kGDBIpAyKg2x3wAAA=",g=1074520064,B="GOv8P9jnC0Bx6AtA8+wLQO3oC0CP6AtA7egLQEnpC0AG6gtAeOoLQCHqC0CB5wtAo+kLQPjpC0Bn6QtAmuoLQI7pC0Ca6gtAXegLQLPoC0Dt6AtASekLQHfoC0BM6wtAs+wLQKXmC0DX7AtApeYLQKXmC0Cl5gtApeYLQKXmC0Cl5gtApeYLQKXmC0Dz6gtApeYLQM3rC0Cz7AtA",E=1073605544;class i extends A{constructor(){super(...arguments),this.CHIP_NAME="ESP32",this.IMAGE_CHIP_ID=0,this.EFUSE_RD_REG_BASE=1073061888,this.DR_REG_SYSCON_BASE=1073111040,this.UART_CLKDIV_REG=1072955412,this.UART_CLKDIV_MASK=1048575,this.UART_DATE_REG_ADDR=1610612856,this.XTAL_CLK_DIVIDER=1,this.FLASH_SIZES={"1MB":0,"2MB":16,"4MB":32,"8MB":48,"16MB":64},this.FLASH_WRITE_SIZE=1024,this.BOOTLOADER_FLASH_OFFSET=4096,this.SPI_REG_BASE=1072963584,this.SPI_USR_OFFS=28,this.SPI_USR1_OFFS=32,this.SPI_USR2_OFFS=36,this.SPI_W0_OFFS=128,this.SPI_MOSI_DLEN_OFFS=40,this.SPI_MISO_DLEN_OFFS=44,this.TEXT_START=g,this.ENTRY=C,this.DATA_START=E,this.ROM_DATA=B,this.ROM_TEXT=I}async readEfuse(A,C){const I=this.EFUSE_RD_REG_BASE+4*C;return A.debug("Read efuse "+I),await A.readReg(I)}async getPkgVersion(A){const C=await this.readEfuse(A,3);let I=C>>9&7;return I+=(C>>2&1)<<3,I}async getChipRevision(A){const C=await this.readEfuse(A,3),I=await this.readEfuse(A,5),g=await A.readReg(this.DR_REG_SYSCON_BASE+124);return 0!=(C>>15&1)?0!=(I>>20&1)?0!=(g>>31&1)?3:2:1:0}async getChipDescription(A){const C=["ESP32-D0WDQ6","ESP32-D0WD","ESP32-D2WD","","ESP32-U4WDH","ESP32-PICO-D4","ESP32-PICO-V3-02"];let I="";const g=await this.getPkgVersion(A),B=await this.getChipRevision(A),E=3==B;return 0!=(1&await this.readEfuse(A,3))&&(C[0]="ESP32-S0WDQ6",C[1]="ESP32-S0WD"),E&&(C[5]="ESP32-PICO-V3"),I=g>=0&&g<=6?C[g]:"Unknown ESP32",!E||0!==g&&1!==g||(I+="-V3"),I+" (revision "+B+")"}async getChipFeatures(A){const C=["Wi-Fi"],I=await this.readEfuse(A,3);0===(2&I)&&C.push(" BT");0!==(1&I)?C.push(" Single Core"):C.push(" Dual Core");if(0!==(8192&I)){0!==(4096&I)?C.push(" 160MHz"):C.push(" 240MHz")}const g=await this.getPkgVersion(A);-1!==[2,4,5,6].indexOf(g)&&C.push(" Embedded Flash"),6===g&&C.push(" Embedded PSRAM");0!==(await this.readEfuse(A,4)>>8&31)&&C.push(" VRef calibration in efuse");0!==(I>>14&1)&&C.push(" BLK3 partially reserved");const B=3&await this.readEfuse(A,6);return C.push(" Coding Scheme "+["None","3/4","Repeat (UNSUPPORTED)","Invalid"][B]),C}async getCrystalFreq(A){const C=await A.readReg(this.UART_CLKDIV_REG)&this.UART_CLKDIV_MASK,I=A.transport.baudrate*C/1e6/this.XTAL_CLK_DIVIDER;let g;return g=I>33?40:26,Math.abs(g-I)>1&&A.info("WARNING: Unsupported crystal in use"),g}_d2h(A){const C=(+A).toString(16);return 1===C.length?"0"+C:C}async readMac(A){let C=await this.readEfuse(A,1);C>>>=0;let I=await this.readEfuse(A,2);I>>>=0;const g=new Uint8Array(6);return g[0]=I>>8&255,g[1]=255&I,g[2]=C>>24&255,g[3]=C>>16&255,g[4]=C>>8&255,g[5]=255&C,this._d2h(g[0])+":"+this._d2h(g[1])+":"+this._d2h(g[2])+":"+this._d2h(g[3])+":"+this._d2h(g[4])+":"+this._d2h(g[5])}}export{i as ESP32ROM};
|