Copyright | (c) Marc Fontaine 2017 |
---|---|
License | BSD3 |
Maintainer | Marc.Fontaine@gmx.de |
Stability | experimental |
Portability | GHC-only |
Safe Haskell | None |
Language | Haskell2010 |
This module exports a small driver for the STLink dongles. The focus of this API is on reading and writing to the memory of and attached STM32 controller. The STM32 architecture use memory mapped IO registers to program IO ports a hardware peripherals. Therefor a STLink dongle with an attached STM32 board in combination with this library makes a nice Haskell-controlled IO extension board.
- test :: IO ()
- type STLT m a = ReaderT STLinkEnv m a
- type STL a = forall m. MonadIO m => ReaderT STLinkEnv m a
- data STLinkEnv
- runSTLink :: STLT IO a -> IO a
- initDongle :: STL ()
- resetHalt :: STL ()
- writeDebugReg :: Word32 -> Word32 -> STL ()
- writeMem8 :: Addr -> ByteString -> STL ()
- writeMem32 :: Addr -> ByteString -> STL ()
- readMem8 :: Addr -> Int -> STL ByteString
- readMem32 :: Addr -> Int -> STL ByteString
- data LogLevel
- type Logger = LogLevel -> String -> IO ()
- xfer :: Cmd -> STL ByteString
Documentation
Test the dongle and connection to the board. This test fails if no board is attached
initDongle :: STL () Source #
Init the dongle and set debug mode. A Haskell translation of the same function in the openocd library.
writeMem32 :: Addr -> ByteString -> STL () Source #