OpenOCD
transport.h File Reference
Include dependency graph for transport.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  transport
 Wrapper for transport lifecycle operations. More...
 

Functions

int allow_transports (struct command_context *ctx, const char *const *vector)
 Called by debug adapter drivers, or affiliated Tcl config scripts, to declare the set of transports supported by an adapter. More...
 
 COMMAND_HELPER (transport_list_parse, char ***vector)
 Makes and stores a copy of a set of transports passed as parameters to a command. More...
 
struct transportget_current_transport (void)
 Returns the transport currently being used by this debug or programming session. More...
 
bool transport_is_dapdirect_jtag (void)
 Returns true if the current debug session is using JTAG as its transport. More...
 
bool transport_is_dapdirect_swd (void)
 Returns true if the current debug session is using SWD as its transport. More...
 
static bool transport_is_hla (void)
 
bool transport_is_jtag (void)
 Returns true if the current debug session is using JTAG as its transport. More...
 
bool transport_is_swd (void)
 Returns true if the current debug session is using SWD as its transport. More...
 
bool transport_is_swim (void)
 
int transport_register (struct transport *new_transport)
 Registers a transport. More...
 
int transport_register_commands (struct command_context *ctx)
 

Function Documentation

◆ allow_transports()

int allow_transports ( struct command_context ctx,
const char *const *  vector 
)

Called by debug adapter drivers, or affiliated Tcl config scripts, to declare the set of transports supported by an adapter.

When there is only one member of that set, it is automatically selected.

Definition at line 86 of file transport.c.

References allowed_transports, ERROR_FAIL, ERROR_OK, LOG_ERROR, LOG_INFO, session, and transport_select().

Referenced by COMMAND_HANDLER().

◆ COMMAND_HELPER()

COMMAND_HELPER ( transport_list_parse  ,
char ***  vector 
)

Makes and stores a copy of a set of transports passed as parameters to a command.

Parameters
vectorwhere the resulting copy is stored, as an argv-style NULL-terminated vector.

Definition at line 176 of file transport.c.

References CMD_ARGC, CMD_ARGV, ERROR_COMMAND_SYNTAX_ERROR, ERROR_FAIL, ERROR_OK, LOG_ERROR, transport::name, transport::next, NULL, and transport_list.

◆ get_current_transport()

struct transport* get_current_transport ( void  )

Returns the transport currently being used by this debug or programming session.

Returns
handle to the read-only transport entity.

Definition at line 157 of file transport.c.

References session.

Referenced by adapter_assert_reset(), adapter_deassert_reset(), adapter_resets(), hl_transport_init(), target_create(), transport_is_dapdirect_jtag(), transport_is_dapdirect_swd(), transport_is_hla(), transport_is_jtag(), transport_is_swd(), and transport_is_swim().

◆ transport_is_dapdirect_jtag()

bool transport_is_dapdirect_jtag ( void  )

Returns true if the current debug session is using JTAG as its transport.

Definition at line 232 of file adi_v5_dapdirect.c.

References dapdirect_jtag_transport, and get_current_transport().

Referenced by adapter_assert_reset(), adapter_deassert_reset(), adapter_resets(), dap_check_config(), dap_init_all(), and stlink_dap_init().

◆ transport_is_dapdirect_swd()

bool transport_is_dapdirect_swd ( void  )

Returns true if the current debug session is using SWD as its transport.

Definition at line 241 of file adi_v5_dapdirect.c.

References dapdirect_swd_transport, and get_current_transport().

Referenced by adapter_assert_reset(), adapter_deassert_reset(), adapter_resets(), COMMAND_HANDLER(), dap_check_config(), dap_init_all(), and stlink_dap_init().

◆ transport_is_hla()

static bool transport_is_hla ( void  )
inlinestatic

Definition at line 93 of file transport.h.

◆ transport_is_jtag()

◆ transport_is_swd()

bool transport_is_swd ( void  )

◆ transport_is_swim()

bool transport_is_swim ( void  )

◆ transport_register()

int transport_register ( struct transport new_transport)

Registers a transport.

There are general purpose transports (such as JTAG), as well as relatively proprietary ones which are specific to a given chip (or chip family).

Code implementing a transport needs to register it before it can be selected and then activated. This is a dynamic process, so that chips (and families) can define transports as needed (without needing error-prone static tables).

Parameters
new_transportthe transport being registered. On a successful return, this memory is owned by the transport framework.
Returns
ERROR_OK on success, else a fault code.

Definition at line 129 of file transport.c.

References ERROR_FAIL, ERROR_OK, transport::init, LOG_DEBUG, LOG_ERROR, transport::name, transport::next, transport::select, and transport_list.

◆ transport_register_commands()

int transport_register_commands ( struct command_context ctx)

Definition at line 353 of file transport.c.

References NULL, register_commands(), and transport_group.

Referenced by setup_command_handler().