Thanks for posting that info, djhopkins2, it's hard to come across!
I have found that this function keeps the board from shutting off after a few seconds, but I only started using an hour ago; I don't know if it has any adverse effects on the hardware yet:
void disable_shutoff() {
return M5.I2C.writeByte(0x75, 0x02, 0x00);
}
Also, here are the corrected voltage and current functions alluded to above; I don't think the voltage can go negative, but the current certainly does, and displays meaningless values without this correction:
int16_t readBatV(uint8_t Reg) {
uint8_t dataV[2] = {0, 0};
M5.I2C.readBytes(0x75, Reg, 2, dataV);
if(dataV[1] & 0x20) dataV[1] |= 0xC0; // 14 bit 2's complement to 16 bit
return (dataV[1]<<8) | dataV[0];
}
int16_t readBatI(uint8_t Reg) {
uint8_t dataI[2] = {0, 0};
M5.I2C.readBytes(0x75, Reg, 2, dataI);
if(dataI[1] & 0x20) dataI[1] |= 0xC0; // 14 bit 2's complement to 16 bit
return (dataI[1]<<8) | dataI[0];
}