Skip to content

Commit

Permalink
Adds a SAI driver to the tree
Browse files Browse the repository at this point in the history
SAI can be modeled like a UART in some regards where there are a Tx/Rx
pair. Unlike a UART though SAI in iMXRT can have multiple data channels
connected to the same peripheral. While each channel has its own fifo
and pin they are still part of the same peripheral instance. Meaning the
clock, status, FIFO watermark, and more are all the shared.

This adds some complications. Use of the Tx and Rx together is also
optional, its quite possible only Tx or Rx in use.

So modeling this API requires some interesting use of generics, but in
effect the Sai struct is a builder that enables building a SaiTx/SaiRx
pair given pins and builder like options.

From there a SaiTx/SaiRx need to provide functionality for writing
frames of audio samples per channel in some sensible manner, catching
events (interrupts) notifying of errors and FIFO watermarks perhaps, as
well as in the end providing ideally a connection to an edma channel per
tx and rx channel in use.
  • Loading branch information
SpinFast committed Nov 23, 2023
1 parent b81b6c5 commit e5410c0
Show file tree
Hide file tree
Showing 2 changed files with 456 additions and 1 deletion.
Loading

0 comments on commit e5410c0

Please sign in to comment.