Zephyr API Documentation 4.4.0-rc1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
dap_link.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: Copyright The Zephyr Project Contributors
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
12
13#ifndef ZEPHYR_INCLUDE_DAP_DAP_LINK_H
14#define ZEPHYR_INCLUDE_DAP_DAP_LINK_H
15
16#include <stdint.h>
17#include <zephyr/device.h>
18#include <zephyr/drivers/swdp.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
32
38 /* Pointer to SWD or JTAG device. Only SWD is supported yet. */
39 const struct device *dev;
41 /* Runtime debug port type */
42 uint8_t debug_port;
43 /* Debug port capabilities */
44 uint8_t capabilities;
45 /* Packet size used by a backend */
46 uint16_t pkt_size;
47 struct {
48 /* Idle cycles after transfer */
49 uint8_t idle_cycles;
50 /* Number of retries after WAIT response */
51 uint16_t retry_count;
52 /* Number of retries if read value does not match */
53 uint16_t match_retry;
54 /* Match Mask */
55 uint32_t match_mask;
56 } transfer;
58};
59
73#define DAP_LINK_CONTEXT_DEFINE(ctx_name, ctx_dev) \
74 static struct dap_link_context ctx_name = { \
75 .dev = ctx_dev, \
76 }
77
86int dap_link_init(struct dap_link_context *const dap_link_ctx);
87
95void dap_link_set_pkt_size(struct dap_link_context *const dap_link_ctx,
96 const uint16_t pkt_size);
97
106int dap_link_backend_usb_init(struct dap_link_context *const dap_link_ctx);
107
108#ifdef __cplusplus
109}
110#endif
111
113
114#endif /* ZEPHYR_INCLUDE_DAP_DAP_LINK_H */
long atomic_t
Definition atomic_types.h:15
state
Definition parser_state.h:29
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Runtime device structure (in ROM) per driver instance.
Definition device.h:513
Main header file for SWDP (Serial Wire Debug Port) driver API.