chiark / gitweb /
realtime: movpos: debug output: exclude some more stuff from the default movpos output
[trains.git] / hostside / skelproto-pic.h
1 /* @skeleton@ @1@ @L@ */
2 /*
3  * arranges for the declarations of
4  *  enco_pic_WHATEVER
5  *  on_pic_WHATEVER
6  * and the tables
7  * and related functions
8  */
9
10 #ifndef AUPROTO_PIC_H
11 #define AUPROTO_PIC_H
12
13 typedef struct PicInsnInfo PicInsnInfo;
14 typedef void PicInputFn(const PicInsnInfo *pii, const PicInsn *pi, int objnum);
15
16 void enco_pic_@cnameyn@(PicInsn *out);                   @h2p@ @nargs=0@
17 void enco_pic_@cnameyn@(PicInsn *out, int objum);        @h2p@ @nargs=1@
18 void enco_pic_@cnameyn@(PicInsn *out, int objum, int v); @h2p@ @nargs=2@
19 PicInputFn on_pic_@cnameyn@;                    @p2h@
20 #define PICMSG_@cnameynu@       @opcodeyn@
21 #define PICMSG_@cnameynu@_M     @opcodemaskyn@
22 #define PICMSG_@cnameynu@_P(v)  (((v) & @opcodemaskyn@) == @opcodeyn@)
23
24 extern void enco_pic_polarity_begin(PicInsn *out);
25 extern void enco_pic_polarity_setbit(PicInsn *out, int objnum);
26
27 extern void enco_pic_pii(PicInsn *out, const PicInsnInfo *pii, int obj, int v);
28
29 const PicInsnInfo *lookup_byopcode(Byte byte0, const PicInsnInfo *table);
30 void picinsn_decode(const PicInsn *pi, const PicInsnInfo *table,
31                     const PicInsnInfo **pii_r, int *objnum_r, int *v_r);
32 void oopicio(const char *dirn, const PicInsnInfo *pii, int objnum);
33
34 struct PicInsnInfo {
35   const char *name;
36   Byte opcode, mask;
37   int argsbits, vbits, noiselevel;
38   PicInputFn *input_fn;
39 };
40
41 extern const PicInsnInfo pic_command_infos[], pic_reply_infos[];
42
43 #define PING_PONG_PATTERN 0x5a
44
45 #endif /*AUPROTO_PIC_H*/