OpenOCD
swd_driver Struct Reference

Data Fields

int(* init )(void)
 Initialize the debug link so it can perform SWD operations. More...
 
void(* read_reg )(uint8_t cmd, uint32_t *value, uint32_t ap_delay_hint)
 Queued read of an AP or DP register. More...
 
int(* run )(void)
 Execute any queued transactions and collect the result. More...
 
int(* switch_seq )(enum swd_special_seq seq)
 Queue a special SWDIO sequence. More...
 
int *(* trace )(bool swo)
 Configures data collection from the Single-wire trace (SWO) signal. More...
 
void(* write_reg )(uint8_t cmd, uint32_t value, uint32_t ap_delay_hint)
 Queued write of an AP or DP register. More...
 

Detailed Description

Definition at line 246 of file swd.h.

Field Documentation

◆ init

int(* swd_driver::init) (void)

Initialize the debug link so it can perform SWD operations.

As an example, this would switch a dual-mode debug adapter into SWD mode and out of JTAG mode.

Returns
ERROR_OK on success, else a negative fault code.

Definition at line 255 of file swd.h.

Referenced by swd_select().

◆ read_reg

void(* swd_driver::read_reg) (uint8_t cmd, uint32_t *value, uint32_t ap_delay_hint)

Queued read of an AP or DP register.

Parameters
Commandbyte with APnDP/RnW/addr/parity bits
Whereto store value to read from register
ap_delay_hintNumber of idle cycles that may be needed after an AP access to avoid WAITs or zero in case of DP read.

Definition at line 275 of file swd.h.

Referenced by swd_finish_read(), swd_queue_ap_read(), swd_queue_dp_read_inner(), and swd_select().

◆ run

int(* swd_driver::run) (void)

Execute any queued transactions and collect the result.

Returns
ERROR_OK on success, Ack response code on WAIT/FAULT or negative error code on other kinds of failure.

Definition at line 294 of file swd.h.

Referenced by swd_run_inner().

◆ switch_seq

int(* swd_driver::switch_seq) (enum swd_special_seq seq)

Queue a special SWDIO sequence.

Parameters
seqThe special sequence to generate.
Returns
ERROR_OK if the sequence was queued, negative error if the sequence is unsupported.

Definition at line 264 of file swd.h.

Referenced by swd_send_sequence().

◆ trace

int*(* swd_driver::trace) (bool swo)

Configures data collection from the Single-wire trace (SWO) signal.

Parameters
swotrue if SWO data collection should be routed.

For example, some debug adapters include a UART which is normally connected to a microcontroller's UART TX, but which may instead be connected to SWO for use in collecting ITM (and possibly ETM) trace data.

Returns
ERROR_OK on success, else a negative fault code.

Definition at line 308 of file swd.h.

◆ write_reg

void(* swd_driver::write_reg) (uint8_t cmd, uint32_t value, uint32_t ap_delay_hint)

Queued write of an AP or DP register.

Parameters
Commandbyte with APnDP/RnW/addr/parity bits
Valueto be written to the register
ap_delay_hintNumber of idle cycles that may be needed after an AP access to avoid WAITs or zero in case of DP write.

Definition at line 286 of file swd.h.

Referenced by swd_clear_sticky_errors(), swd_queue_ap_abort(), swd_queue_ap_write(), swd_queue_dp_write_inner(), and swd_select().


The documentation for this struct was generated from the following file: