MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / readRegister

Method readRegister

tools/xsbug/esptool.js:708–728  ·  view source on GitHub ↗
(address)

Source from the content-addressed store, hash-verified

706 return this.readRegister(EFUSE_REG_BASE + (index << 2));
707 }
708 async readRegister(address) {
709 const payload = new ArrayBuffer(4);
710 const view = new DataView(payload);
711 view.setUint32(0, address, true); // little-endian
712
713 for (let i = 0; i < 3; i++) {
714 await this.command(Bootloader.READ_REG, payload);
715
716 let reply = await this.getReply();
717 if (!reply)
718 continue;
719
720 reply = this.parseReply(reply, Bootloader.READ_REG);
721 if (!reply)
722 continue;
723
724 return reply.value;
725 }
726
727 throw new Error(`readRegister ${address.toString(16)} failed`);
728 }
729 async changeBaud(baud, previous = 0) {
730 const view = new DataView(new ArrayBuffer(8));
731 view.setUint32(0, baud, true); // little-endian

Callers 3

getInfoMethod · 0.95
beginProgrammingMethod · 0.95
readEfuseMethod · 0.95

Calls 4

commandMethod · 0.95
getReplyMethod · 0.95
parseReplyMethod · 0.95
toStringMethod · 0.45

Tested by

no test coverage detected