CMSIS-DAP  Version 2.0.0
Interface Firmware for CoreSight Debug Access Port
 All Functions Groups Pages
CMSIS-DAP Hardware I/O Pin Access

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

Description

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

DAP Hardware I/O Pin Access Functions

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:

Function Documentation

__STATIC_FORCEINLINE uint32_t PIN_nRESET_IN ( void  )

nRESET I/O pin: Get Input.

Returns
Current status of the nRESET DAP hardware I/O pin.
__STATIC_FORCEINLINE void PIN_nRESET_OUT ( uint32_t  bit)

nRESET I/O pin: Set Output.

Parameters
bittarget device hardware reset pin status:
  • 0: issue a device hardware reset.
  • 1: release device hardware reset.
__STATIC_FORCEINLINE uint32_t PIN_nTRST_IN ( void  )

nTRST I/O pin: Get Input.

Returns
Current status of the nTRST DAP hardware I/O pin.
__STATIC_FORCEINLINE void PIN_nTRST_OUT ( uint32_t  bit)

nTRST I/O pin: Set Output.

Parameters
bitJTAG TRST Test Reset pin status:
  • 0: issue a JTAG TRST Test Reset.
  • 1: release JTAG TRST Test Reset.
__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.

Returns
Current status of the SWCLK/TCK DAP hardware I/O pin.
__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).

Returns
Current status of the SWDIO DAP hardware I/O pin.
__STATIC_FORCEINLINE void PIN_SWDIO_OUT ( uint32_t  bit)

SWDIO I/O pin: Set Output (used in SWD mode only).

Parameters
bitOutput 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.

Returns
Current status of the SWDIO/TMS DAP hardware I/O pin.
__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.

Returns
Current status of the TDI DAP hardware I/O pin.
__STATIC_FORCEINLINE void PIN_TDI_OUT ( uint32_t  bit)

TDI I/O pin: Set Output.

Parameters
bitOutput value for the TDI DAP hardware I/O pin.
__STATIC_FORCEINLINE uint32_t PIN_TDO_IN ( void  )

TDO I/O pin: Get Input.

Returns
Current status of the TDO DAP hardware I/O pin.
__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:

  • TCK, TMS, TDI, nTRST, nRESET to output mode and set to high level.
  • TDO to input mode.
__STATIC_INLINE void PORT_OFF ( void  )

Disable JTAG/SWD I/O Pins.

Disables the DAP Hardware I/O pins which configures:

  • TCK/SWCLK, TMS/SWDIO, TDI, TDO, nTRST, nRESET to High-Z mode.
__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:

  • SWCLK, SWDIO, nRESET to output mode and set to default high level.
  • TDI, nTRST to HighZ mode (pins are unused in SWD mode).