Standalone SWD programator
swd.h
Zobrazit dokumentaci tohoto souboru.
1 /*
2 <Copyright 2011 mrd>
3 
4 Usage of the works is permitted provided that this instrument is retained with the works, so that any entity that uses the works is notified of this instrument.
5 
6 DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY.
7 */
13 // GPIO pins used for SWD
14 #define SWCLK_BIT 18
15 #define SWDIO_BIT 19
16 
17 #define SWCLK_BIT_MSK (1<<SWCLK_BIT)
18 #define SWDIO_BIT_MSK (1<<SWDIO_BIT)
19 
20 // Bit delay - pro 48MHz clock muze byt 0
21 #define BIT_DELAY 0
22 
32 void swd_enable(void);
36 void swd_flush(void);
37 
38 // SWD status responses. SWD_ACK is good.
39 enum SWD_RESPONSES {
40  SWD_ACK = 0b001,
41  SWD_WAIT = 0b010,
42  SWD_FAULT = 0b100,
43  SWD_PARITY = 0b1000
44 };
57 enum SWD_RESPONSES swd_write(char APnDP, int A, unsigned long data);
58 
71 enum SWD_RESPONSES swd_read(char APnDP, int A, volatile unsigned long *data);
72 
enum SWD_RESPONSES swd_write(char APnDP, int A, unsigned long data)
Obecný zápis na SWD.
Definition: swd.c:210
enum SWD_RESPONSES swd_read(char APnDP, int A, volatile unsigned long *data)
Obecné čtení ze SWD.
Definition: swd.c:250
void swd_enable(void)
Přepnutí do SWD módu.
Definition: swd.c:149
void swd_flush(void)
Pomocná funkce.
Definition: swd.c:139