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:

  1. Idle, but pended
    • If TX pending: goto 6
    • Else: goto 2
  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
  3. On First Byte
    • Verify+clear RXDRDY event
    • Disable RXDRDY interrupt
    • Set "Receiving" flag
    • Enable RXDRDY -> Timer Clear shortcut
    • Start timer
  4. On Timeout
    • Disable timer
    • Set "Flush" flag
    • Trigger STOPRX event
  5. On Stop
    • Check+clear end_rx
    • trigger FLUSHRX
    • Wait for Endrx
    • clear end_rx
    • goto 1
  6. Start TX
  7. On completion: goto 1