CMSIS-DAP
Version 2.1.1
Interface Firmware for CoreSight Debug Access Port
|
Standard I/O Pins of the CMSIS-DAP Hardware Debug Port support standard JTAG mode and Serial Wire Debug (SWD) mode. More...
Functions | |
__STATIC_INLINE void | PORT_JTAG_SETUP (void) |
Setup JTAG I/O pins: TCK, TMS, TDI, TDO, nTRST, and nRESET. More... | |
__STATIC_INLINE void | PORT_SWD_SETUP (void) |
Setup SWD I/O pins: SWCLK, SWDIO, and nRESET. More... | |
__STATIC_INLINE void | PORT_OFF (void) |
Disable JTAG/SWD I/O Pins. More... | |
__STATIC_FORCEINLINE uint32_t | PIN_SWCLK_TCK_IN (void) |
SWCLK/TCK I/O pin: Get Input. More... | |
__STATIC_FORCEINLINE void | PIN_SWCLK_TCK_SET (void) |
SWCLK/TCK I/O pin: Set Output to High. More... | |
__STATIC_FORCEINLINE void | PIN_SWCLK_TCK_CLR (void) |
SWCLK/TCK I/O pin: Set Output to Low. More... | |
__STATIC_FORCEINLINE uint32_t | PIN_SWDIO_TMS_IN (void) |
SWDIO/TMS I/O pin: Get Input. More... | |
__STATIC_FORCEINLINE void | PIN_SWDIO_TMS_SET (void) |
SWDIO/TMS I/O pin: Set Output to High. More... | |
__STATIC_FORCEINLINE void | PIN_SWDIO_TMS_CLR (void) |
SWDIO/TMS I/O pin: Set Output to Low. More... | |
__STATIC_FORCEINLINE uint32_t | PIN_SWDIO_IN (void) |
SWDIO I/O pin: Get Input (used in SWD mode only). More... | |
__STATIC_FORCEINLINE void | PIN_SWDIO_OUT (uint32_t bit) |
SWDIO I/O pin: Set Output (used in SWD mode only). More... | |
__STATIC_FORCEINLINE void | PIN_SWDIO_OUT_ENABLE (void) |
SWDIO I/O pin: Switch to Output mode (used in SWD mode only). More... | |
__STATIC_FORCEINLINE void | PIN_SWDIO_OUT_DISABLE (void) |
SWDIO I/O pin: Switch to Input mode (used in SWD mode only). More... | |
__STATIC_FORCEINLINE uint32_t | PIN_TDI_IN (void) |
TDI I/O pin: Get Input. More... | |
__STATIC_FORCEINLINE void | PIN_TDI_OUT (uint32_t bit) |
TDI I/O pin: Set Output. More... | |
__STATIC_FORCEINLINE uint32_t | PIN_TDO_IN (void) |
TDO I/O pin: Get Input. More... | |
__STATIC_FORCEINLINE uint32_t | PIN_nTRST_IN (void) |
nTRST I/O pin: Get Input. More... | |
__STATIC_FORCEINLINE void | PIN_nTRST_OUT (uint32_t bit) |
nTRST I/O pin: Set Output. More... | |
__STATIC_FORCEINLINE uint32_t | PIN_nRESET_IN (void) |
nRESET I/O pin: Get Input. More... | |
__STATIC_FORCEINLINE void | PIN_nRESET_OUT (uint32_t bit) |
nRESET I/O pin: Set Output. More... | |
Standard I/O Pins of the CMSIS-DAP Hardware Debug Port support standard JTAG mode and Serial Wire Debug (SWD) mode.
In SWD mode only 2 pins are required to implement the debug interface of a device. The following I/O Pins are provided:
JTAG I/O Pin | SWD I/O Pin | CMSIS-DAP Hardware pin mode |
---|---|---|
TCK: Test Clock | SWCLK: Clock | Output Push/Pull |
TMS: Test Mode Select | SWDIO: Data I/O | Output Push/Pull; Input (for receiving data) |
TDI: Test Data Input | Output Push/Pull | |
TDO: Test Data Output | Input | |
nTRST: Test Reset (optional) | Output Open Drain with pull-up resistor | |
nRESET: Device Reset | nRESET: Device Reset | Output Open Drain with pull-up resistor |
The various I/O Pins are accessed by functions that implement the Read, Write, Set, or Clear to these I/O Pins.
For the SWDIO I/O Pin there are additional functions that are called in SWD I/O mode only. This functions are provided to achieve faster I/O that is possible with some advanced GPIO peripherals that can independently write/read a single I/O pin without affecting any other pins of the same I/O port. The following SWDIO I/O Pin functions are provided:
__STATIC_FORCEINLINE uint32_t PIN_nRESET_IN | ( | void | ) |
nRESET I/O pin: Get Input.
__STATIC_FORCEINLINE void PIN_nRESET_OUT | ( | uint32_t | bit | ) |
nRESET I/O pin: Set Output.
bit | target device hardware reset pin status:
|
__STATIC_FORCEINLINE uint32_t PIN_nTRST_IN | ( | void | ) |
nTRST I/O pin: Get Input.
__STATIC_FORCEINLINE void PIN_nTRST_OUT | ( | uint32_t | bit | ) |
nTRST I/O pin: Set Output.
bit | JTAG TRST Test Reset pin status:
|
__STATIC_FORCEINLINE void PIN_SWCLK_TCK_CLR | ( | void | ) |
SWCLK/TCK I/O pin: Set Output to Low.
Set the SWCLK/TCK DAP hardware I/O pin to low level.
__STATIC_FORCEINLINE uint32_t PIN_SWCLK_TCK_IN | ( | void | ) |
SWCLK/TCK I/O pin: Get Input.
__STATIC_FORCEINLINE void PIN_SWCLK_TCK_SET | ( | void | ) |
SWCLK/TCK I/O pin: Set Output to High.
Set the SWCLK/TCK DAP hardware I/O pin to high level.
__STATIC_FORCEINLINE uint32_t PIN_SWDIO_IN | ( | void | ) |
SWDIO I/O pin: Get Input (used in SWD mode only).
__STATIC_FORCEINLINE void PIN_SWDIO_OUT | ( | uint32_t | bit | ) |
SWDIO I/O pin: Set Output (used in SWD mode only).
bit | Output value for the SWDIO DAP hardware I/O pin. |
__STATIC_FORCEINLINE void PIN_SWDIO_OUT_DISABLE | ( | void | ) |
SWDIO I/O pin: Switch to Input mode (used in SWD mode only).
Configure the SWDIO DAP hardware I/O pin to input mode. This function is called prior PIN_SWDIO_IN function calls.
__STATIC_FORCEINLINE void PIN_SWDIO_OUT_ENABLE | ( | void | ) |
SWDIO I/O pin: Switch to Output mode (used in SWD mode only).
Configure the SWDIO DAP hardware I/O pin to output mode. This function is called prior PIN_SWDIO_OUT function calls.
__STATIC_FORCEINLINE void PIN_SWDIO_TMS_CLR | ( | void | ) |
SWDIO/TMS I/O pin: Set Output to Low.
Set the SWDIO/TMS DAP hardware I/O pin to low level.
__STATIC_FORCEINLINE uint32_t PIN_SWDIO_TMS_IN | ( | void | ) |
SWDIO/TMS I/O pin: Get Input.
__STATIC_FORCEINLINE void PIN_SWDIO_TMS_SET | ( | void | ) |
SWDIO/TMS I/O pin: Set Output to High.
Set the SWDIO/TMS DAP hardware I/O pin to high level.
__STATIC_FORCEINLINE uint32_t PIN_TDI_IN | ( | void | ) |
TDI I/O pin: Get Input.
__STATIC_FORCEINLINE void PIN_TDI_OUT | ( | uint32_t | bit | ) |
TDI I/O pin: Set Output.
bit | Output value for the TDI DAP hardware I/O pin. |
__STATIC_FORCEINLINE uint32_t PIN_TDO_IN | ( | void | ) |
TDO I/O pin: Get Input.
__STATIC_INLINE void PORT_JTAG_SETUP | ( | void | ) |
Setup JTAG I/O pins: TCK, TMS, TDI, TDO, nTRST, and nRESET.
Configures the DAP Hardware I/O pins for JTAG mode:
__STATIC_INLINE void PORT_OFF | ( | void | ) |
Disable JTAG/SWD I/O Pins.
Disables the DAP Hardware I/O pins which configures:
__STATIC_INLINE void PORT_SWD_SETUP | ( | void | ) |
Setup SWD I/O pins: SWCLK, SWDIO, and nRESET.
Configures the DAP Hardware I/O pins for Serial Wire Debug (SWD) mode: