-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathswd.h
More file actions
34 lines (28 loc) · 731 Bytes
/
swd.h
File metadata and controls
34 lines (28 loc) · 731 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/**
* @file swd.h
* @author Lee Essen (lee.essen@nowonline.co.uk)
* @brief
* @version 0.1
* @date 2022-06-27
*
* @copyright Copyright (c) 2022
*
*/
#ifndef __SWD_H
#define __SWD_H
#define SWD_OK 0
#define SWD_WAIT 1
#define SWD_FAULT 2
#define SWD_ERROR 3
#define SWD_PARITY 4
#define CHECK_OK(func) { int rc = func; if (rc != SWD_OK) return rc; }
int swd_init();
void swd_pio_poll();
void swd_targetsel(uint32_t target);
int swd_read(int APnDP, int addr, uint32_t *result);
int swd_write(int APnDP, int addr, uint32_t value);
void swd_send_bits(uint32_t *data, int bitcount);
void swd_line_reset();
void swd_from_dormant();
void swd_to_dormant();
#endif