xref: /freebsd/contrib/ntp/include/icom.h (revision 416ba5c74546f32a993436a99516d35008e9f384)
1 /*
2  * Header file for ICOM radios
3  */
4 #include "ntp_types.h"
5 
6 /*
7  * Common definitions
8  */
9 #define P_ERMSG	0x1		/* trace bus error messages */
10 #define P_TRACE 0x2		/* trace CI-V messges */
11 #define RETRY	3		/* max packet retries */
12 #define IBAUD	B1200		/* autotune port speed */
13 
14 /*
15  * Radio identifier codes
16  */
17 #define IC1271	0x24
18 #define IC1275	0x18
19 #define IC271	0x20
20 #define IC275	0x10
21 #define IC375	0x12
22 #define IC471	0x22
23 #define IC475	0x14
24 #define IC575	0x16
25 #define IC725	0x28
26 #define IC726	0x30
27 #define IC735	0x04
28 #define IC751	0x1c
29 #define IC761	0x1e
30 #define IC765	0x2c
31 #define IC775	0x46
32 #define IC781	0x26
33 #define IC970	0x2e
34 #define R7000	0x08
35 #define R71	0x1a
36 #define R7100	0x34
37 #define R72	0x32
38 #define R8500	0x4a
39 #define R9000	0x2a
40 
41 /*
42  * CI-V frame codes
43  */
44 #define PR	0xfe		/* preamble */
45 #define TX	0xe0		/* controller address */
46 #define FI	0xfd		/* end of message */
47 #define ACK	0xfb		/* controller normal reply */
48 #define NAK	0xfa		/* controller error reply */
49 #define PAD	0xff		/* transmit padding */
50 
51 /*
52  * CI-V controller commands
53  */
54 #define V_FREQT	0x00		/* freq set (transceive) */
55 #define V_MODET	0x01		/* set mode (transceive) */
56 #define V_RBAND	0x02		/* read band edge */
57 #define V_RFREQ	0x03		/* read frequency */
58 #define V_RMODE	0x04		/* read mode */
59 #define V_SFREQ	0x05		/* set frequency */
60 #define V_SMODE	0x06		/* set mode */
61 #define V_SVFO	0x07		/* select vfo */
62 #define V_SMEM	0x08		/* select channel/bank */
63 #define V_WRITE	0x09		/* write channel */
64 #define V_VFOM	0x0a		/* memory -> vfo */
65 #define V_CLEAR	0x0b		/* clear channel */
66 #define V_ROFFS	0x0c		/* read tx offset */
67 #define V_SOFFS	0x0d		/* write tx offset */
68 #define V_SCAN	0x0e		/* scan control */
69 #define V_SPLIT	0x0f		/* split control */
70 #define V_DIAL	0x10		/* set dial tuning step */
71 #define V_ATTEN	0x11		/* set attenuator */
72 #define V_SANT	0x12		/* select antenna */
73 #define V_ANNC	0x13		/* announce control */
74 #define V_WRCTL	0x14		/* write controls */
75 #define V_RDCTL	0x15		/* read controls */
76 #define V_TOGL	0x16		/* set switches */
77 #define V_ASCII	0x17		/* send CW message */
78 #define V_POWER	0x18		/* power control */
79 #define V_RDID	0x19		/* read model ID */
80 #define V_SETW	0x1a		/* read/write channel/bank data */
81 #define V_CTRL	0x7f		/* miscellaneous control */
82 
83 /*
84  * Function prototypes
85  */
86 int	icom_init		(const char *, int, int);
87 int	icom_freq		(int, int, double);
88