Thoughts on PowerBus Rev 2
- Have a shunt resistor + op amp for measuring 5v usage
- Have some buttons on-board
- Include the stm32g 8x booster board? Optionally?
Uarte
Take a timer and a uarte and two gpios
Basic RX state machine:
- Idle, but pended
- If TX pending: goto 6
- Else: goto 2
- Prep Idle RX
- Disable timer
- Set GPIOs
- Clear "Receiving" flag
- Clear "Flush" flag
- Enable RXDRDY Interrupt
- Enable STOP interrupt
- Start receiving with some max size
- On First Byte
- Verify+clear RXDRDY event
- Disable RXDRDY interrupt
- Set "Receiving" flag
- Enable RXDRDY -> Timer Clear shortcut
- Start timer
- On Timeout
- Disable timer
- Set "Flush" flag
- Trigger STOPRX event
- On Stop
- Check+clear end_rx
- trigger FLUSHRX
- Wait for Endrx
- clear end_rx
- goto 1
- Start TX
- On completion: goto 1