Async thoughts

Are these good async demos?

  • An async button or two, that do something like cycle colors or turn off the LEDs
  • an async SPI driver that handles sending the WS2812 commands
  • An async i2c port listening for color/brightness/mode values for 2 LEDs

I2C port

  • Event driven: We are responding to incoming commands
    • Have a couple different API items:
      • Mode (off, solid, blink, updown)
      • Brightness
      • Color
    • Have two register sets
    • Could benefit from interrupts
  • Outputs...?
    • Event stream to another Cassette?
    • Poll API for current state?
    • Pub Sub?

Button

  • Purely event driven
    • Basically this is just the exti interrupt? Or polling I guess?
  • Outputs...?
    • Event stream?
    • Poll API?

SPI

  • Really just sequencing outputs
  • Could have it's own state for sequencing?
  • Could potentially benefit from DMA/interrupts?
  • Could potentially allow for multiple concurrent senders?

Approaches

Brain Default

  • RTIC
  • EXTI interrupt task
  • SPI task
    • Mostly for DMA reload?
  • I2C task
    • emit changes/updates?
  • IDLE task
    • Doing periodic updates

???

  • EXTI future
    • allows for waiting on events like transitions?
    • async task that awaits on futures, and sends messages to N channels?
  • SPI/smartled task
    • Listens for messages to send (but how does it know to wake up?)
    • Calls future enabled SPI driver
    • Has some sort of "current status" interface?
  • I2C Peripheral
    • pretty much all in the interrupt?