23 #define _AMPLIFIER_H 1 26 #include <hamlib/amplist.h> 83 #define NETAMPCTL_RET "RPRT " 106 #define AMP_TYPE_MASK (AMP_FLAG_1|AMP_FLAG_2) 108 #define AMP_TYPE_OTHER 0 109 #define AMP_TYPE_1 AMP_FLAG_1 110 #define AMP_TYPE_2 AMP_FLAG_2 111 #define AMP_TYPE_ALL (AMP_FLAG_1|AMP_FLAG_2) 119 AMP_LEVEL_SWR = (1 << 0),
120 AMP_LEVEL_NH = (1 << 1),
121 AMP_LEVEL_PF = (1 << 2),
122 AMP_LEVEL_PWR_INPUT = (1 << 3),
123 AMP_LEVEL_PWR_FWD = (1 << 4),
124 AMP_LEVEL_PWR_REFLECTED = (1 << 5),
125 AMP_LEVEL_PWR_PEAK = (1 << 6),
126 AMP_LEVEL_FAULT = (1 << 7)
131 #define AMP_LEVEL_FLOAT_LIST (AMP_LEVEL_SWR) 132 #define AMP_LEVEL_STRING_LIST (AMP_LEVEL_FAULT) 133 #define AMP_LEVEL_IS_FLOAT(l) ((l)&_LEVEL_FLOAT_LIST) 134 #define AMP_LEVEL_IS_STRING(l) ((l)&_LEVEL_STRING_LIST) 159 #define AMP_MODEL(arg) .amp_model=arg,.macro_name=#arg 163 amp_model_t amp_model;
164 const char *model_name;
165 const char *mfg_name;
167 const char *copyright;
175 int serial_data_bits;
176 int serial_stop_bits;
181 int post_write_delay;
186 const rig_ptr_t priv;
187 const char *amp_model_macro_name;
216 int (*reset)(
AMP *
amp, amp_reset_t reset);
224 const char *(*get_info)(
AMP *
amp);
231 const char *macro_name;
293 extern HAMLIB_EXPORT(
AMP *)
294 amp_init HAMLIB_PARAMS((amp_model_t amp_model));
296 extern HAMLIB_EXPORT(
int)
299 extern HAMLIB_EXPORT(
int)
302 extern HAMLIB_EXPORT(
int)
305 extern HAMLIB_EXPORT(
int)
309 extern HAMLIB_EXPORT(
int)
313 extern HAMLIB_EXPORT(
int)
316 extern HAMLIB_EXPORT(
int)
317 amp_get_powerstat HAMLIB_PARAMS((
AMP *
amp,
325 extern HAMLIB_EXPORT(
int)
326 amp_get_freq HAMLIB_PARAMS((
AMP *
amp,
328 extern HAMLIB_EXPORT(
int)
329 amp_set_freq HAMLIB_PARAMS((
AMP *
amp,
332 extern HAMLIB_EXPORT(
int)
336 extern HAMLIB_EXPORT(
const char *)
339 extern HAMLIB_EXPORT(
int)
342 extern HAMLIB_EXPORT(
int)
343 amp_register HAMLIB_PARAMS((
const struct amp_caps *caps));
345 extern HAMLIB_EXPORT(
int)
346 amp_unregister HAMLIB_PARAMS((amp_model_t amp_model));
348 extern HAMLIB_EXPORT(
int)
349 amp_list_foreach HAMLIB_PARAMS((
int (*cfunc)(
const struct amp_caps *,
353 extern HAMLIB_EXPORT(
int)
354 amp_load_backend HAMLIB_PARAMS((
const char *be_name));
356 extern HAMLIB_EXPORT(
int)
357 amp_check_backend HAMLIB_PARAMS((amp_model_t amp_model));
359 extern HAMLIB_EXPORT(
int)
360 amp_load_all_backends HAMLIB_PARAMS((
void));
362 extern HAMLIB_EXPORT(amp_model_t)
363 amp_probe_all HAMLIB_PARAMS((hamlib_port_t *p));
365 extern HAMLIB_EXPORT(
int)
366 amp_token_foreach HAMLIB_PARAMS((
AMP *
amp,
371 extern HAMLIB_EXPORT(
const struct confparams *)
379 extern HAMLIB_EXPORT(
const struct amp_caps *)
380 amp_get_caps HAMLIB_PARAMS((amp_model_t amp_model));
386 extern HAMLIB_EXPORT(
const struct confparams *)
390 extern HAMLIB_EXPORT(
int)
391 amp_get_ext_level HAMLIB_PARAMS((
AMP *
amp,
397 extern HAMLIB_EXPORT(
const struct confparams *)
416 #define amp_debug rig_debug Amplifier data structure.
int amp_set_powerstat(AMP *amp, powerstat_t status)
turn on/off the amplifier or standby/operate toggle
Definition: amplifier.c:693
int amp_set_conf(AMP *amp, token_t token, const char *val)
set a amplifier configuration parameter
Definition: amp_conf.c:584
double freq_t
Frequency type,.
Definition: rig.h:333
int comm_state
Definition: amplifier.h:258
gran_t parm_gran[64]
Definition: amplifier.h:267
long token_t
configuration token
Definition: rig.h:649
setting_t amp_parse_level(const char *s)
Convert alpha string to enum AMP_LEVEL_...
Definition: misc.c:888
int amp_open(AMP *amp)
open the communication to the amp
Definition: amplifier.c:290
powerstat_t
Radio power state.
Definition: rig.h:571
int amp_reset(AMP *amp, amp_reset_t reset)
reset the amplifier
Definition: amplifier.c:543
amp_type_t
Amplifier type flags.
Definition: amplifier.h:98
setting_t amp_has_get_level(AMP *amp, setting_t level)
check retrieval ability of level settings
Definition: amp_settings.c:62
token_t amp_token_lookup(AMP *amp, const char *name)
Simple lookup returning token id associated with name.
Definition: amp_conf.c:553
serial_handshake_e
Serial handshake.
Definition: rig.h:238
Universal approach for passing values.
Definition: rig.h:825
float swr_t
Type definition for SWR.
Definition: amplifier.h:66
The Rig structure.
Definition: rig.h:2121
This is the master data structure, acting as a handle for the controlled amplifier.
Definition: amplifier.h:283
rig_status_e
Development status of the backend.
Definition: rig.h:292
AMP * amp_init(amp_model_t amp_model)
allocate a new AMP handle
Definition: amplifier.c:177
Live data and customized fields.
Definition: amplifier.h:247
const struct confparams * amp_ext_lookup(AMP *amp, const char *name)
lookup ext token by its name, return pointer to confparams struct.
Definition: extamp.c:155
hamlib_port_t ampport
Definition: amplifier.h:256
#define RIG_SETTING_MAX
Maximum # of rig settings.
Definition: rig.h:968
const char * amp_get_info(AMP *amp)
get general information from the amplifier
Definition: amplifier.c:622
token_t token
Definition: rig.h:689
serial_parity_e
Serial parity.
Definition: rig.h:226
Definition: amplifier.h:101
Hamlib rig data structures.
struct amp_state state
Definition: amplifier.h:286
int amp_close(AMP *amp)
close the communication to the amp
Definition: amplifier.c:422
const char * amp_strlevel(setting_t level)
Convert enum AMP_LEVEL_... to alpha string.
Definition: misc.c:979
level/parm granularity definition
Definition: rig.h:1476
rig_ptr_t obj
Definition: amplifier.h:260
Definition: amplifier.h:100
gran_t level_gran[64]
Definition: amplifier.h:266
int tune_value_t
Type definition for tuning values capacitance and resistance.
Definition: amplifier.h:77
const struct confparams * amp_confparam_lookup(AMP *amp, const char *name)
lookup conf token by its name, return pointer to confparams struct.
Definition: amp_conf.c:500
int amp_get_conf(AMP *amp, token_t token, char *val)
get the value of a configuration parameter
Definition: amp_conf.c:636
struct amp_caps * caps
Definition: amplifier.h:285
rig_ptr_t priv
Definition: amplifier.h:259
uint64_t setting_t
Setting.
Definition: rig.h:962
int amp_cleanup(AMP *amp)
release a amp handle and free associated memory
Definition: amplifier.c:501
Configuration parameter structure.
Definition: rig.h:688
rig_port_e
Port type.
Definition: rig.h:205
const struct confparams * rig_ext_lookup(RIG *rig, const char *name)
lookup ext token by its name, return pointer to confparams struct.
Definition: ext.c:236