hstlink-0.1.0.0

Copyright(c) UBC Orbit
Maintainersam.schweigel@ubcorbit.com
Safe HaskellNone
LanguageHaskell2010

STLink.Commands

Description

All the raw commands that an STLink dongle understands can be found here, though high-level wrappers for them are elsewhere.

Synopsis

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

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).

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.

data DebugMode Source #

Which debugging interface the dongle with interface with. Prefer SWD when possible.

Constructors

DebugJTAG 
DebugSWD 
DebugSWIM 

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).

haltCore :: STLink () Source #

Stop execution on the microcontroller.

runCore :: STLink () Source #

Continue execution on the microcontroller.

stepCore :: STLink () Source #

Step one instruction on the microcontroller.

resetCore :: STLink () Source #

Reset the microcontroller.

readReg :: Reg -> STLink Word32 Source #

Read the specified real register. (Debug registers are not accessible through this command).

writeReg :: Reg -> Word32 -> STLink () Source #

Write a Word32 to the specified Reg.

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.