7576c7e56fb3b5381979e4fcb711396f72e47ee2
[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 //! Setup glitching.
17 void glitchsetup();
18 //! Setup analog chain for glitching.
19 void glitchsetupdac();
20 //! Call this before the function to be glitched.
21 void glitchprime();
22
23 extern u16 glitchH, glitchL, glitchstate, glitchcount;
24
25 //! Glitch an application.
26 void glitchapp(u8 app);
27 //! Set glitching voltages.
28 void glitchvoltages(u16 low, u16 high);
29 //! Set glitching rate.
30 void glitchrate(u16 rate);
31
32 //! Handles a monitor command.
33 void glitchhandle(unsigned char app,
34                   unsigned char verb,
35                   unsigned long len);