| Copyright | (c) UBC Orbit |
|---|---|
| Maintainer | sam.schweigel@ubcorbit.com |
| Safe Haskell | None |
| Language | Haskell2010 |
STLink.Commands
Description
All the raw commands that an STLink dongle understands can be found here, though high-level wrappers for them are elsewhere.
- getVersion :: STLink ResponseVersion
- data ResponseVersion = ResponseVersion {
- versionStlink :: Int
- versionJtag :: Int
- versionSwim :: Int
- getCurrentMode :: STLink STLinkMode
- data STLinkMode
- getCurrentVoltage :: STLink Float
- enterMode :: DebugMode -> STLink ()
- data DebugMode
- getStatus :: STLink DebugStatus
- data DebugStatus
- haltCore :: STLink ()
- runCore :: STLink ()
- stepCore :: STLink ()
- resetCore :: STLink ()
- readReg :: Reg -> STLink Word32
- writeReg :: Reg -> Word32 -> STLink ()
- readMem :: Word32 -> Word16 -> STLink ByteString
- writeMem :: Word32 -> ByteString -> STLink ()
Documentation
getVersion :: STLink ResponseVersion Source #
Get the version of an STLink dongle.
data ResponseVersion Source #
The STLink version reported by the dongle. The response also contians the VID and PID of the USB interface, but this is ignored since it is redundant.
Constructors
| ResponseVersion | |
Fields
| |
Instances
getCurrentMode :: STLink STLinkMode Source #
Figure out what major mode the STLink dongle is operating in. (Debug or otherwise.)
data STLinkMode Source #
Major mode for STLink, rather than the minor debug mode (DebugMode).
Constructors
| ModeDFU | |
| ModeMass | |
| ModeDebug | |
| ModeSWIM | |
| ModeBootloader |
Instances
getCurrentVoltage :: STLink Float Source #
Get the voltage on the output of the STLink regulator. (Should be ~3.3V).
enterMode :: DebugMode -> STLink () Source #
Leave either DFU or Mass mode and enter one of the three debug modes.
Which debugging interface the dongle with interface with. Prefer SWD when possible.
getStatus :: STLink DebugStatus Source #
Get the current state of the CPU. You must be in SWD or JTAG mode to issue this command.
data DebugStatus Source #
Determines if the CPU is running or halted (through debug commands).
Instances
readReg :: Reg -> STLink Word32 Source #
Read the specified real register. (Debug registers are not accessible through this command).
readMem :: Word32 -> Word16 -> STLink ByteString Source #
Peeks l bytes of memory at address a.
A maximum of 64 bytes can be read in one command.
writeMem :: Word32 -> ByteString -> STLink () Source #
Writes a ByteString into the location in memory specified by
a.
A maximum of 64 bytes can be written in one command.