b7082d8df46605068978428aad7f2929ac36e9ff
[goodfet] / firmware / include / glitch.h
1 /*! \file glitch.h
2   \author Travis Goodspeed
3   \brief Glitch handler functions.
4 */
5
6 #ifndef GLITCH_H
7 #define GLITCH_H
8
9 #include "app.h"
10
11 #include <signal.h>
12 #include <io.h>
13 #include <iomacros.h>
14
15 #define GLITCH 0x71
16
17 //Command codes
18 #define GLITCHAPP      0x80
19 #define GLITCHVERB     0x81
20 #define GLITCHTIME     0x82
21 #define GLITCHVOLTAGES 0x90
22 #define GLITCHRATE     0x91
23
24
25 //! Setup glitching.
26 void glitchsetup();
27 //! Call this before the function to be glitched.
28 void glitchprime();
29
30 extern u16 glitchH, glitchL, glitchstate, glitchcount;
31
32 //! Glitch an application.
33 void glitchapp(u8 app);
34 //! Set glitching voltages.
35 void glitchvoltages(u16 gnd, u16 vcc);
36 //! Set glitching rate.
37 void glitchrate(u16 rate);
38
39 extern app_t const glitch_app;
40
41 #endif // GLITCH_H
42