Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Standard I/O Pins of the CMSIS-DAP Hardware Debug Port support standard JTAG mode and Serial Wire Debug (SWD) mode. More...
Modules | |
CMSIS-DAP Hardware Status LEDs | |
CMSIS-DAP Hardware may provide LEDs that indicate the status of the CMSIS-DAP Debug Unit. | |
CMSIS-DAP Timestamp | |
Access function for Test Domain Timer. | |
CMSIS-DAP Initialization | |
CMSIS-DAP Hardware I/O and LED Pins are initialized with the function DAP_SETUP. | |
Functions | |
__STATIC_INLINE void | PORT_JTAG_SETUP (void) |
Setup JTAG I/O pins: TCK, TMS, TDI, TDO, nTRST, and nRESET. | |
__STATIC_INLINE void | PORT_SWD_SETUP (void) |
Setup SWD I/O pins: SWCLK, SWDIO, and nRESET. | |
__STATIC_INLINE void | PORT_OFF (void) |
Disable JTAG/SWD I/O Pins. | |
__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. | |
__STATIC_FORCEINLINE void | PIN_SWCLK_TCK_CLR (void) |
SWCLK/TCK I/O pin: Set Output to Low. | |
__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. | |
__STATIC_FORCEINLINE void | PIN_SWDIO_TMS_CLR (void) |
SWDIO/TMS I/O pin: Set Output to Low. | |
__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). | |
__STATIC_FORCEINLINE void | PIN_SWDIO_OUT_ENABLE (void) |
SWDIO I/O pin: Switch to Output mode (used in SWD mode only). | |
__STATIC_FORCEINLINE void | PIN_SWDIO_OUT_DISABLE (void) |
SWDIO I/O pin: Switch to Input mode (used in SWD mode only). | |
__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. | |
__STATIC_FORCEINLINE uint32_t | PIN_TDO_IN (void) |
TDO I/O pin: Get Input. | |
__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. | |
__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. |
Detailed 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:
- PIN_SWDIO_OUT_ENABLE to enable the output mode from the DAP hardware.
- PIN_SWDIO_OUT_DISABLE to enable the input mode to the DAP hardware.
- PIN_SWDIO_IN to read from the SWDIO I/O pin with utmost possible speed.
- PIN_SWDIO_OUT to write to the SWDIO I/O pin with utmost possible speed.
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.
Definition at line 358 of file atmel/sam3u2c/DAP_config.h.
__STATIC_FORCEINLINE void PIN_nRESET_OUT | ( | uint32_t | bit ) |
nRESET I/O pin: Set Output.
- Parameters:
-
bit target device hardware reset pin status: - 0: issue a device hardware reset.
- 1: release device hardware reset.
There is no reset pin on the nRF51822, so we need to use a reset routine: Enable reset through the RESET register in the POWER peripheral. Hold the SWDCLK and SWDIO/nRESET line low for a minimum of 100 us.
Definition at line 370 of file atmel/sam3u2c/DAP_config.h.
__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.
Definition at line 338 of file atmel/sam3u2c/DAP_config.h.
__STATIC_FORCEINLINE void PIN_nTRST_OUT | ( | uint32_t | bit ) |
nTRST I/O pin: Set Output.
- Parameters:
-
bit JTAG TRST Test Reset pin status: - 0: issue a JTAG TRST Test Reset.
- 1: release JTAG TRST Test Reset.
Definition at line 348 of file atmel/sam3u2c/DAP_config.h.
__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.
Definition at line 232 of file atmel/sam3u2c/DAP_config.h.
__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.
Definition at line 216 of file atmel/sam3u2c/DAP_config.h.
__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.
Definition at line 224 of file atmel/sam3u2c/DAP_config.h.
__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.
Definition at line 266 of file atmel/sam3u2c/DAP_config.h.
__STATIC_FORCEINLINE void PIN_SWDIO_OUT | ( | uint32_t | bit ) |
SWDIO I/O pin: Set Output (used in SWD mode only).
- Parameters:
-
bit Output value for the SWDIO DAP hardware I/O pin.
Definition at line 274 of file atmel/sam3u2c/DAP_config.h.
__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.
Definition at line 297 of file atmel/sam3u2c/DAP_config.h.
__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.
Definition at line 288 of file atmel/sam3u2c/DAP_config.h.
__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.
Definition at line 258 of file atmel/sam3u2c/DAP_config.h.
__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.
Definition at line 242 of file atmel/sam3u2c/DAP_config.h.
__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.
Definition at line 250 of file atmel/sam3u2c/DAP_config.h.
__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.
Definition at line 308 of file atmel/sam3u2c/DAP_config.h.
__STATIC_FORCEINLINE void PIN_TDI_OUT | ( | uint32_t | bit ) |
TDI I/O pin: Set Output.
- Parameters:
-
bit Output value for the TDI DAP hardware I/O pin.
Definition at line 316 of file atmel/sam3u2c/DAP_config.h.
__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.
Definition at line 327 of file atmel/sam3u2c/DAP_config.h.
__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.
Definition at line 161 of file atmel/sam3u2c/DAP_config.h.
__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.
Definition at line 195 of file atmel/sam3u2c/DAP_config.h.
__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, TMS, nTRST to HighZ mode (pins are unused in SWD mode).
Definition at line 168 of file atmel/sam3u2c/DAP_config.h.
Generated on Tue Jul 12 2022 15:37:31 by
