forked from DangerousPrototypes/BusPirate5-firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
modes.h
86 lines (81 loc) · 2.32 KB
/
modes.h
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
//#include "pirate.h"
enum
{
HIZ = 0,
#ifdef BP_USE_DUMMY1
DUMMY1,
#endif
#ifdef BP_USE_DUMMY2
DUMMY2,
#endif
#ifdef BP_USE_HWSPI
HWSPI,
#endif
#ifdef BP_USE_HWUSART
HWUSART,
#endif
#ifdef BP_USE_HWI2C
HWI2C,
#endif
#ifdef BP_USE_LA
LA,
#endif
#ifdef BP_USE_SW2W
SW2W,
#endif
#ifdef BP_USE_SW3W
SW3W,
#endif
#ifdef BP_USE_DIO
DIO,
#endif
#ifdef BP_USE_LCDSPI
LCDSPI,
#endif
#ifdef BP_USE_LCDI2C // future
LCDI2C,
#endif
#ifdef BP_USE_SW1WIRE
SW1WIRE,
#endif
#ifdef BP_USE_HW1WIRE
HW1WIRE,
#endif
#ifdef BP_USE_HWLED
HWLED,
#endif
MAXPROTO
};
typedef struct _mode
{
void (*protocol_start)(struct _bytecode *result, struct _bytecode *next); // start
void (*protocol_startR)(struct _bytecode *result, struct _bytecode *next); // start with read
void (*protocol_stop)(struct _bytecode *result, struct _bytecode *next); // stop
void (*protocol_stopR)(struct _bytecode *result, struct _bytecode *next); // stop with read
void (*protocol_write)(struct _bytecode *result, struct _bytecode *next); // send(/read) max 32 bit
void (*protocol_read)(struct _bytecode *result, struct _bytecode *next); // read max 32 bit
void (*protocol_clkh)(void); // set clk high
void (*protocol_clkl)(void); // set clk low
void (*protocol_dath)(void); // set dat hi
void (*protocol_datl)(void); // set dat lo
uint32_t (*protocol_dats)(void); // toglle dat (?)
void (*protocol_clk)(void); // toggle clk (?)
uint32_t (*protocol_bitr)(void); // read 1 bit (?)
uint32_t (*protocol_periodic)(void); // service to regular poll whether a byte has arrived or something interesting has happened
void (*protocol_macro)(uint32_t); // macro
uint32_t (*protocol_setup)(void); // setup UI
uint32_t (*protocol_setup_exc)(void); // real setup
void (*protocol_cleanup)(void); // cleanup for HiZ
//const char*(*protocol_pins)(void); // display pin config
void (*protocol_settings)(void); // display settings
void (*protocol_help)(void); // display protocol specific help
char protocol_name[10]; // friendly name (promptname)
} _mode;
extern struct _mode modes[MAXPROTO];
void nullfunc1(void);
uint32_t nullfunc2(uint32_t c);
uint32_t nullfunc3(void);
void nullfunc4(uint32_t c);
const char *nullfunc5(void);
void nohelp(void);
uint32_t noperiodic(void);