Copyright | (c) Marc Fontaine 2017 |
---|---|
License | BSD3 |
Maintainer | Marc.Fontaine@gmx.de |
Stability | experimental |
Portability | GHC-only |
Safe Haskell | None |
Language | Haskell2010 |
In this example, the controller reads chars from the USART and writes them to a RAM buffer using DMA.
- readCommDMA :: IO ()
- uartRingBuffer :: IO ()
- parseSlot :: Get (Char, Bool)
Documentation
readCommDMA :: IO () Source #
Initialize the Hardware and keep polling the DMA Buffer. This function loops for ever. Though after the buffer is full nothing interesting happens.
uartRingBuffer :: IO () Source #
Initialize the Hardware and keep polling the DMA Buffer.
uartRingBuffer
uses a ring buffer that wraps over when filled up.
The DMA controller is configured to read Bytes (8 Bit) from the UART
and write half words (16 Bit) to then RAM. This means
it transfers a char and clears out the next byte to flag that this position
in the buffer has been written.