this chip uses 12-bit ADC, vs 10-bit on old chip. I tried to limit the pot within
a small range, but it still wasn't working as expected until I did this.
have no idea. don't code without sleep.
copied over and modified for use my CH59x soft I2C.
CH32X GPIO does not have an open drain mode, so I have to implement this with RMW to the mode register. After doing this and adding missing functions needed for existing code, LED writes and EEPROM reads and writes.
using the AWU for system timing so the clock speed can change.
existing issues:
- changing clock speed divider in soft i2c routines causes the system to crash
- ADC seems to be reading, but result isn't being used