Zephyr API Documentation 4.0.0-rc2
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
swdp_api Struct Reference

#include <swdp.h>

Data Fields

int(* swdp_output_sequence )(const struct device *dev, uint32_t count, const uint8_t *data)
 Write count bits to SWDIO from data LSB first.
 
int(* swdp_input_sequence )(const struct device *dev, uint32_t count, uint8_t *data)
 Read count bits from SWDIO into data LSB first.
 
int(* swdp_transfer )(const struct device *dev, uint8_t request, uint32_t *data, uint8_t idle_cycles, uint8_t *response)
 Perform SWDP transfer and store response.
 
int(* swdp_set_pins )(const struct device *dev, uint8_t pins, uint8_t value)
 Set SWCLK, SWDPIO, and nRESET pins state.
 
int(* swdp_get_pins )(const struct device *dev, uint8_t *state)
 Get SWCLK, SWDPIO, and nRESET pins state.
 
int(* swdp_set_clock )(const struct device *dev, uint32_t clock)
 Set SWDP clock frequency.
 
int(* swdp_configure )(const struct device *dev, uint8_t turnaround, bool data_phase)
 Configure SWDP interface.
 
int(* swdp_port_on )(const struct device *dev)
 Enable interface, set pins to default state.
 
int(* swdp_port_off )(const struct device *dev)
 Disable interface, set pins to High-Z mode.
 

Field Documentation

◆ swdp_configure

int(* swdp_api::swdp_configure) (const struct device *dev, uint8_t turnaround, bool data_phase)

Configure SWDP interface.

Parameters
devSWDP device
turnaroundLine turnaround cycles
data_phaseAlways generate Data Phase (also on WAIT/FAULT)
Returns
0 on success, or error code

◆ swdp_get_pins

int(* swdp_api::swdp_get_pins) (const struct device *dev, uint8_t *state)

Get SWCLK, SWDPIO, and nRESET pins state.

Note
The bit positions are defined by the SWDP_*_PIN macros.
Parameters
devSWDP device
statePlace to store pins state
Returns
0 on success, or error code

◆ swdp_input_sequence

int(* swdp_api::swdp_input_sequence) (const struct device *dev, uint32_t count, uint8_t *data)

Read count bits from SWDIO into data LSB first.

Parameters
devSWDP device
countNumber of bits to read
dataBuffer to store bits read
Returns
0 on success, or error code

◆ swdp_output_sequence

int(* swdp_api::swdp_output_sequence) (const struct device *dev, uint32_t count, const uint8_t *data)

Write count bits to SWDIO from data LSB first.

Parameters
devSWDP device
countNumber of bits to write
dataBits to write
Returns
0 on success, or error code

◆ swdp_port_off

int(* swdp_api::swdp_port_off) (const struct device *dev)

Disable interface, set pins to High-Z mode.

Parameters
devSWDP device
Returns
0 on success, or error code

◆ swdp_port_on

int(* swdp_api::swdp_port_on) (const struct device *dev)

Enable interface, set pins to default state.

Note
SWDPIO is set to output mode, SWCLK and nRESET are set to high level.
Parameters
devSWDP device
Returns
0 on success, or error code

◆ swdp_set_clock

int(* swdp_api::swdp_set_clock) (const struct device *dev, uint32_t clock)

Set SWDP clock frequency.

Parameters
devSWDP device
clockClock frequency in Hz
Returns
0 on success, or error code

◆ swdp_set_pins

int(* swdp_api::swdp_set_pins) (const struct device *dev, uint8_t pins, uint8_t value)

Set SWCLK, SWDPIO, and nRESET pins state.

Note
The bit positions are defined by the SWDP_*_PIN macros.
Parameters
devSWDP device
pinsBitmask of pins to set
valueValue to set pins to
Returns
0 on success, or error code

◆ swdp_transfer

int(* swdp_api::swdp_transfer) (const struct device *dev, uint8_t request, uint32_t *data, uint8_t idle_cycles, uint8_t *response)

Perform SWDP transfer and store response.

Parameters
devSWDP device
requestSWDP request bits
dataData to be transferred with request
idle_cyclesIdle cycles between request and response
responseBuffer to store response (ACK/WAIT/FAULT)
Returns
0 on success, or error code

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