1 /*
2  * Copyright 1996, 1997, 1998, 1999 by Daniel B. Suthers,
3  * Pleasanton Ca. 94588 USA
4  * E-MAIL dbs@tanj.com
5  *
6  */
7 
8 /*
9  *   This program is free software: you can redistribute it and/or modify
10  *   it under the terms of the GNU General Public License as published by
11  *   the Free Software Foundation, either version 3 of the License, or
12  *   (at your option) any later version.
13  *
14  *   This program is distributed in the hope that it will be useful,
15  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  *   GNU General Public License for more details.
18  *
19  *   You should have received a copy of the GNU General Public License
20  *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
21  *
22  */
23 
24 
25 int sendpacket();
26     /* sendpacket sends the packet from a 19 byte string and handles
27     Arg1 = eeprom address
28     arg2 = 16 byte eeprom data array
29     Return 0 on success, -1 on error
30     Locks before it starts to write
31     locking and handshake.
32     */
33 int eraseall();
34     /*  eraseall uses sendpacket to fill eeprom with zeroed macros,
35     timers and triggers.
36     */
37 
38 int validate_sched(FILE *sch_file);
39     /* Validates that the config file is OK.
40     Builds a map of the eeprom in memory.
41     All dates are validated,
42     */
43 
44 
45 /* Prom is 1024 bytes of memory.  This is gathered from usenet and from
46  * observations:  The CM11A crashes when I exceed 1024 :-)
47  */
48 
49 # define PROMSIZE 1024
50 
51 
52 #if 0
53 struct timerinit {
54 	unsigned int unused : 1;
55 	unsigned int dow : 7 ;
56 	unsigned int start_jul;
57 	unsigned int stop_jul;
58 	unsigned int start_time : 4 ; /* start minute / 120,   */
59 	unsigned int stop_time : 4 ; /* stop minute / 120,   */
60 	unsigned int hi_startjul : 1; /* high bit of start_jul */
61 	unsigned int start_mins : 7 ; /* start minute % 120 */
62 	unsigned int hi_stopjul : 1; /* high bit of stop_jul */
63 	unsigned int stop_mins : 7 ; /* stop minute % 120 */
64 	unsigned int hi_start_nybble : 4;
65 	unsigned int hi_stop_nybble : 4;
66 	unsigned int low_start_macro;
67 	unsigned int low_stop_macro;
68 	};
69 
70 struct macroinit {
71 	unsigned int dev : 4;
72 	unsigned int hc : 4;
73 	unsigned int onoff : 1;
74 	unsigned int unused : 3;
75 	unsigned int macro_pointer : 12;  /* address the macro is written to */
76 	unsigned int macro_num;  /* number of the macro in the array */
77 	int macro_label;	/* label in the config file */
78 	} ;
79 
80 struct basicmacrodata {	/* simple one */
81 	unsigned char delay;
82 	unsigned char size;	/* number of elements */
83 	int memsize;		/* amount of prom memory taken by the macro */
84 	struct macrolinkl *lnk;
85 	unsigned char fc : 4;
86 	unsigned char hc : 4;
87 	unsigned int device_bm ;
88 	unsigned int terminator;
89 	} ;
90 
91 struct macrolinkl {
92         struct macrolinkl *lnk;
93 	unsigned int hc : 4;
94 	unsigned int fc : 4;
95 	unsigned int device_bm :16;	/* device bitmap */
96 	unsigned int dim_value : 5;
97 	} ;
98 #endif
99