COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
ic9100_lib.h
Go to the documentation of this file.
1 /********************************************************************
2 * Copyright (C) 2015 by Interstel Technologies, Inc.
3 * and Hawaii Space Flight Laboratory.
4 *
5 * This file is part of the COSMOS/core that is the central
6 * module for COSMOS. For more information on COSMOS go to
7 * <http://cosmos-project.com>
8 *
9 * The COSMOS/core software is licenced under the
10 * GNU Lesser General Public License (LGPL) version 3 licence.
11 *
12 * You should have received a copy of the
13 * GNU Lesser General Public License
14 * If not, go to <http://www.gnu.org/licenses/>
15 *
16 * COSMOS/core is free software: you can redistribute it and/or
17 * modify it under the terms of the GNU Lesser General Public License
18 * as published by the Free Software Foundation, either version 3 of
19 * the License, or (at your option) any later version.
20 *
21 * COSMOS/core is distributed in the hope that it will be useful, but
22 * WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
24 * Lesser General Public License for more details.
25 *
26 * Refer to the "licences" folder for further information on the
27 * condititons and terms to use this software.
28 ********************************************************************/
29 
30 
31 #ifndef IC9100_LIB_H
32 #define IC9100_LIB_H
33 
34 #include "support/configCosmos.h"
36 
37 #define IC9100_BAUD 19200
38 #define IC9100_BITS 8
39 #define IC9100_PARITY 0
40 #define IC9100_STOPBITS 1
41 
42 #define IC9100_CHANNEL_A 0
43 #define IC9100_CHANNEL_B 1
44 #define IC9100_CHANNEL_SWAP 2
45 
46 #define IC9100_DATAMODE_OFF 0
47 #define IC9100_DATAMODE_ON 1
48 
49 #define IC9100_9600MODE_OFF 0
50 #define IC9100_9600MODE_ON 1
51 
52 #define IC9100_MODE_LSB 0
53 #define IC9100_MODE_USB 1
54 #define IC9100_MODE_AM 2
55 #define IC9100_MODE_CW 3
56 #define IC9100_MODE_RTTY 4
57 #define IC9100_MODE_FM 5
58 #define IC9100_MODE_CWR 7
59 #define IC9100_MODE_RTTYR 8
60 #define IC9100_MODE_DV 17
61 
62 #define IC9100_FILTER_1 1
63 #define IC9100_FILTER_2 2
64 #define IC9100_FILTER_3 3
65 
67 {
68  uint8_t address;
69  uint8_t channelnum;
71  std::mutex mut;
72  vector <uint8_t> response;
73  uint8_t freqband;
74  uint8_t filtband;
75  uint8_t mode;
76  uint8_t datamode;
77  uint8_t bps9600mode;
78  uint8_t rfgain;
79  uint8_t squelch;
80  uint8_t rfpower;
81  uint8_t smeter;
82  uint8_t rfmeter;
83  uint8_t swrmeter;
84  uint8_t alcmeter;
85  uint8_t compmeter;
86  uint8_t opmode;
87  float bandpass;
88  float powerin;
89  float powerout;
90  float maxpower;
92  double frequency;
93 };
94 
95 int32_t ic9100_connect(string device, uint8_t address, ic9100_handle &handle);
98 int32_t ic9100_write(ic9100_handle &handle, uint8_t command);
99 int32_t ic9100_write(ic9100_handle &handle, uint8_t command, uint8_t subcommand);
100 int32_t ic9100_write(ic9100_handle &handle, uint8_t command, vector <uint8_t> message);
101 int32_t ic9100_write(ic9100_handle &handle, uint8_t command, uint8_t subcommand, vector <uint8_t> message);
102 uint8_t ic9100_byte(vector <uint8_t> response);
103 uint8_t ic9100_freq2band(double frequency);
104 //int32_t ic9100_read(ic9100_handle &handle, vector <uint8_t> &message);
109 int32_t ic9100_set_freqband(ic9100_handle &handle, uint8_t mode);
113 int32_t ic9100_set_mode(ic9100_handle &handle, uint8_t opmode);
114 int32_t ic9100_set_mode(ic9100_handle &handle, uint8_t opmode, uint8_t filtband, uint16_t modulation=0);
116 int32_t ic9100_set_rfgain(ic9100_handle &handle, uint8_t rfgain);
118 int32_t ic9100_set_rfpower(ic9100_handle &handle, float power);
124 int32_t ic9100_set_datamode(ic9100_handle &handle, uint8_t mode);
133 
134 #endif // IC9100_LIB_H
135 
float powerout
Definition: ic9100_lib.h:89
int32_t ic9100_get_rfgain(ic9100_handle &handle)
Definition: ic9100_lib.cpp:1123
vector< uint8_t > response
Definition: ic9100_lib.h:72
int32_t ic9100_get_freqband(ic9100_handle &handle)
Definition: ic9100_lib.cpp:1368
uint8_t rfpower
Definition: ic9100_lib.h:80
int32_t ic9100_write(ic9100_handle &handle, uint8_t command)
Definition: ic9100_lib.cpp:88
int32_t ic9100_set_rfpower(ic9100_handle &handle, float power)
Definition: ic9100_lib.cpp:687
uint8_t rfgain
Definition: ic9100_lib.h:78
int32_t ic9100_get_datamode(ic9100_handle &handle)
Definition: ic9100_lib.cpp:1483
Definition: serialclass.h:43
int32_t ic9100_set_squelch(ic9100_handle &handle, uint8_t squelch)
Definition: ic9100_lib.cpp:653
int32_t ic9100_set_bps9600mode(ic9100_handle &handle, uint8_t mode)
Definition: ic9100_lib.cpp:1390
std::mutex mut
Definition: ic9100_lib.h:71
uint8_t datamode
Definition: ic9100_lib.h:76
float maxpower
Definition: ic9100_lib.h:90
uint8_t opmode
Definition: ic9100_lib.h:86
int32_t ic9100_get_smeter(ic9100_handle &handle)
Definition: ic9100_lib.cpp:1202
int32_t ic9100_get_rfpower(ic9100_handle &handle)
Definition: ic9100_lib.cpp:1162
uint8_t freqband
Definition: ic9100_lib.h:73
int32_t ic9100_set_frequency(ic9100_handle &handle, double frequency)
Definition: ic9100_lib.cpp:868
int32_t ic9100_disconnect(ic9100_handle &handle)
Definition: ic9100_lib.cpp:52
float powerin
Definition: ic9100_lib.h:88
uint8_t message[300]
Definition: kpc9612p_send.cpp:36
Headers and definitions common to all COSMOS.
Serial * serial
Definition: ic9100_lib.h:70
int32_t ic9100_get_compmeter(ic9100_handle &handle)
Definition: ic9100_lib.cpp:1321
int32_t ic9100_set_rfgain(ic9100_handle &handle, uint8_t rfgain)
Definition: ic9100_lib.cpp:619
int32_t ic9100_get_bandpass(ic9100_handle &handle)
Definition: ic9100_lib.cpp:510
int32_t ic9100_set_channel(ic9100_handle &handle, uint8_t channelnum)
Definition: ic9100_lib.cpp:1089
string command
Definition: add_radio.cpp:27
int32_t ic9100_set_datamode(ic9100_handle &handle, uint8_t mode)
Definition: ic9100_lib.cpp:1434
gige_handle * handle
Definition: kpc9612p_recv.cpp:33
int32_t ic9100_write_header(ic9100_handle &handle)
Definition: ic9100_lib.cpp:60
uint8_t address
Definition: ic9100_lib.h:68
uint8_t ic9100_freq2band(double frequency)
Definition: ic9100_lib.cpp:295
uint8_t bps9600mode
Definition: ic9100_lib.h:77
int32_t ic9100_get_squelch(ic9100_handle &handle)
Definition: ic9100_lib.cpp:1143
int32_t ic9100_connect(string device, uint8_t address, ic9100_handle &handle)
Definition: ic9100_lib.cpp:33
uint8_t rfmeter
Definition: ic9100_lib.h:82
Definition: ic9100_lib.h:66
uint8_t swrmeter
Definition: ic9100_lib.h:83
uint8_t alcmeter
Definition: ic9100_lib.h:84
uint8_t channelnum
Definition: ic9100_lib.h:69
float bandpass
Definition: ic9100_lib.h:87
int32_t ic9100_get_mode(ic9100_handle &handle)
Definition: ic9100_lib.cpp:810
int32_t ic9100_get_rfmeter(ic9100_handle &handle)
Definition: ic9100_lib.cpp:1243
int32_t ic9100_get_repeater_squelch(ic9100_handle &handle)
Definition: ic9100_lib.cpp:1551
int32_t ic9100_get_swrmeter(ic9100_handle &handle)
Definition: ic9100_lib.cpp:1291
int32_t ic9100_set_bandpass(ic9100_handle &handle, double bandpass)
Definition: ic9100_lib.cpp:362
uint8_t squelch
Definition: ic9100_lib.h:79
int32_t ic9100_get_alcmeter(ic9100_handle &handle)
Definition: ic9100_lib.cpp:1306
int32_t ic9100_set_freqband(ic9100_handle &handle, uint8_t mode)
Definition: ic9100_lib.cpp:1336
int32_t ic9100_set_mode(ic9100_handle &handle, uint8_t opmode)
Definition: ic9100_lib.cpp:974
double frequency
Definition: ic9100_lib.h:92
uint8_t compmeter
Definition: ic9100_lib.h:85
uint8_t ic9100_byte(vector< uint8_t > response)
Definition: ic9100_lib.cpp:283
float repeater_squelch
Definition: ic9100_lib.h:91
int32_t ic9100_check_address(ic9100_handle &handle)
Definition: ic9100_lib.cpp:760
uint8_t mode
Definition: ic9100_lib.h:75
uint8_t filtband
Definition: ic9100_lib.h:74
uint8_t smeter
Definition: ic9100_lib.h:81
int32_t ic9100_get_frequency(ic9100_handle &handle)
Definition: ic9100_lib.cpp:778
static string device
Definition: ax25_recv.cpp:39
int32_t ic9100_set_repeater_squelch(ic9100_handle &handle, float frequency)
Definition: ic9100_lib.cpp:1499
int32_t ic9100_get_bps9600mode(ic9100_handle &handle)
Definition: ic9100_lib.cpp:1418