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