Some bits of Spy-Bi-Wire support, thanks to Mark Rages. (Not yet complete.)
[goodfet] / firmware / include / glitch.h
1 /*! \file glitch.h
2   \author Travis Goodspeed
3   \brief Glitch handler functions.
4 */
5
6 #include <signal.h>
7 #include <io.h>
8 #include <iomacros.h>
9
10 //Command codes
11 #define GLITCHAPP      0x80
12 #define GLITCHVERB     0x81
13 #define GLITCHVOLTAGES 0x90
14 #define GLITCHRATE     0x91
15
16 //! Disable glitch state at init.
17 void glitchsetup();
18 //! Setup analog chain for glitching.
19 void glitchsetupdac();
20
21 extern u16 glitchH, glitchL, glitchstate, glitchcount;
22
23 //! Glitch an application.
24 void glitchapp(u8 app);
25 //! Set glitching voltages.
26 void glitchvoltages(u16 low, u16 high);
27 //! Set glitching rate.
28 void glitchrate(u16 rate);
29
30 //! Handles a monitor command.
31 void glitchhandle(unsigned char app,
32                   unsigned char verb,
33                   unsigned long len);