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
21
extern
"C"
{
22
#endif
23
32
36
struct
dap_link_context
{
38
/* Pointer to SWD or JTAG device. Only SWD is supported yet. */
39
const
struct
device
*dev;
40
atomic_t
state
;
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
86
int
dap_link_init
(
struct
dap_link_context
*
const
dap_link_ctx);
87
95
void
dap_link_set_pkt_size
(
struct
dap_link_context
*
const
dap_link_ctx,
96
const
uint16_t
pkt_size);
97
106
int
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 */
atomic_t
long atomic_t
Definition
atomic_types.h:15
device.h
dap_link_backend_usb_init
int dap_link_backend_usb_init(struct dap_link_context *const dap_link_ctx)
Initialize the DAP Link USB backend.
dap_link_set_pkt_size
void dap_link_set_pkt_size(struct dap_link_context *const dap_link_ctx, const uint16_t pkt_size)
Set the packet size used by a DAP Link backend.
dap_link_init
int dap_link_init(struct dap_link_context *const dap_link_ctx)
Initialize a DAP Link context.
state
state
Definition
parser_state.h:29
stdint.h
uint32_t
__UINT32_TYPE__ uint32_t
Definition
stdint.h:90
uint8_t
__UINT8_TYPE__ uint8_t
Definition
stdint.h:88
uint16_t
__UINT16_TYPE__ uint16_t
Definition
stdint.h:89
dap_link_context
DAP Link runtime context (opaque type).
Definition
dap_link.h:36
device
Runtime device structure (in ROM) per driver instance.
Definition
device.h:513
swdp.h
Main header file for SWDP (Serial Wire Debug Port) driver API.
zephyr
dap
dap_link.h
Generated on
for Zephyr API Documentation by
1.16.1