Project

General

Profile

Statistics
| Branch: | Revision:

root / tooltron_mb.h @ dc472500

History | View | Annotate | Download (1.09 KB)

1 20e5429c Tom Mullins
#ifndef TOOLTRON_MB_H
2
#define TOOLTRON_MB_H
3
4
/*
5
 * Input registers, 16 bit read only
6
 */
7
8
/* Serial number from rfid reader, or 0 if there is no rfid tag present */
9 dc472500 Tom Mullins
#define MB_INP_SERNOL  0
10
#define MB_INP_SERNOH  1
11 20e5429c Tom Mullins
12
/* Value from current sensor */
13 dc472500 Tom Mullins
#define MB_INP_CURRENT 2
14 20e5429c Tom Mullins
15
/*
16
 * Coils, 1 bit read/write
17
 */
18
19 7bdb98c5 Tom Mullins
/* When 1, there is a new rfid tag in the tool. Automatically cleared when the
20
 * main box writes to MB_COIL_EN */
21 dc472500 Tom Mullins
#define MB_COIL_NEW     0
22 20e5429c Tom Mullins
23 7bdb98c5 Tom Mullins
/* When 1, the tool receives power. Write 1 or 0 to grant or deny an access
24
 * request, respectively. If the tool is running, write 0 to immediately shut
25
 * off the tool */
26 dc472500 Tom Mullins
#define MB_COIL_EN      1
27 20e5429c Tom Mullins
28
/* Write 1 to request that the tool is disabled soon (what that means will be
29
 * determined later) */
30 dc472500 Tom Mullins
#define MB_COIL_REQ_DIS 2
31 20e5429c Tom Mullins
32
/* When 1, tool has been properly initialized. When 0, tool has lost power and
33
 * the main box should rewrite values for current limits (to be implemented
34
 * later) */
35 dc472500 Tom Mullins
#define MB_COIL_INIT    3
36 20e5429c Tom Mullins
37 7bdb98c5 Tom Mullins
/* Number of coils */
38
#define N_COILS 4
39
40 20e5429c Tom Mullins
/*
41
 * Other things
42
 */
43
#define SLAVE_ADDR 4 // TODO move to makefile?
44
#define MB_BAUD 9600
45
46
#endif