23 #define _AMPLIFIER_H 1
106 #define NETAMPCTL_RET "RPRT "
129 #define AMP_TYPE_MASK (AMP_FLAG_1|AMP_FLAG_2)
131 #define AMP_TYPE_OTHER 0
132 #define AMP_TYPE_1 AMP_FLAG_1
133 #define AMP_TYPE_2 AMP_FLAG_2
134 #define AMP_TYPE_ALL (AMP_FLAG_1|AMP_FLAG_2)
142 AMP_LEVEL_SWR = (1 << 0),
143 AMP_LEVEL_NH = (1 << 1),
144 AMP_LEVEL_PF = (1 << 2),
145 AMP_LEVEL_PWR_INPUT = (1 << 3),
146 AMP_LEVEL_PWR_FWD = (1 << 4),
147 AMP_LEVEL_PWR_REFLECTED = (1 << 5),
148 AMP_LEVEL_PWR_PEAK = (1 << 6),
149 AMP_LEVEL_FAULT = (1 << 7),
150 AMP_LEVEL_PWR = (1 << 8),
155 #define AMP_LEVEL_FLOAT_LIST (AMP_LEVEL_SWR)
156 #define AMP_LEVEL_STRING_LIST (AMP_LEVEL_FAULT)
157 #define AMP_LEVEL_IS_FLOAT(l) ((l)&_LEVEL_FLOAT_LIST)
158 #define AMP_LEVEL_IS_STRING(l) ((l)&_LEVEL_STRING_LIST)
167 #define AMP_MODEL(arg) .amp_model=arg,.macro_name=#arg
324 extern HAMLIB_EXPORT(
AMP *)
327 extern HAMLIB_EXPORT(
int)
330 extern HAMLIB_EXPORT(
int)
333 extern HAMLIB_EXPORT(
int)
336 extern HAMLIB_EXPORT(
int)
340 extern HAMLIB_EXPORT(
int)
341 amp_get_conf HAMLIB_PARAMS((
AMP *
amp,
344 extern HAMLIB_EXPORT(
int)
347 extern HAMLIB_EXPORT(
int)
356 extern HAMLIB_EXPORT(
int)
359 extern HAMLIB_EXPORT(
int)
363 extern HAMLIB_EXPORT(
int)
367 extern HAMLIB_EXPORT(
const char *)
370 extern HAMLIB_EXPORT(
int)
373 extern HAMLIB_EXPORT(
int)
377 extern HAMLIB_EXPORT(
int)
378 amp_register HAMLIB_PARAMS((
const struct amp_caps *caps));
380 extern HAMLIB_EXPORT(
int)
381 amp_unregister HAMLIB_PARAMS((
amp_model_t amp_model));
383 extern HAMLIB_EXPORT(
int)
384 amp_list_foreach HAMLIB_PARAMS((
int (*cfunc)(
const struct amp_caps *,
388 extern HAMLIB_EXPORT(
int)
389 amp_load_backend HAMLIB_PARAMS((
const char *be_name));
391 extern HAMLIB_EXPORT(
int)
392 amp_check_backend HAMLIB_PARAMS((
amp_model_t amp_model));
394 extern HAMLIB_EXPORT(
int)
395 amp_load_all_backends HAMLIB_PARAMS((
void));
398 amp_probe_all HAMLIB_PARAMS((hamlib_port_t *p));
400 extern HAMLIB_EXPORT(
int)
401 amp_token_foreach HAMLIB_PARAMS((
AMP *
amp,
406 extern HAMLIB_EXPORT(
const struct confparams *)
414 extern HAMLIB_EXPORT(
const struct amp_caps *)
415 amp_get_caps HAMLIB_PARAMS((
amp_model_t amp_model));
425 extern HAMLIB_EXPORT(
const struct confparams *)
429 extern HAMLIB_EXPORT(
int)
434 extern HAMLIB_EXPORT(
int)
441 extern HAMLIB_EXPORT(
const struct confparams *)
459 #define amp_debug rig_debug
Hamlib amplifier model definitions.
int amp_set_freq(AMP *amp, freq_t freq)
Set the operating frequency of the amplifier.
Definition: amplifier.c:656
const char * amp_get_info(AMP *amp)
Query general information from the amplifier.
Definition: amplifier.c:691
int amp_reset(AMP *amp, amp_reset_t reset)
Reset the amplifier.
Definition: amplifier.c:577
float swr_t
Type definition for SWR (Standing Wave Ratio).
Definition: amplifier.h:80
amp_type_t
Amplifier type flags.
Definition: amplifier.h:122
int amp_set_conf(AMP *amp, token_t token, const char *val)
Set an amplifier configuration parameter.
Definition: amp_conf.c:654
AMP * amp_init(amp_model_t amp_model)
Allocate a new AMP handle.
Definition: amplifier.c:183
setting_t amp_has_get_level(AMP *amp, setting_t level)
Check which level settings can be queried.
Definition: amp_settings.c:102
int amp_cleanup(AMP *amp)
Release an AMP handle and free associated memory.
Definition: amplifier.c:531
int tune_value_t
Type definition for the transmatch tuning values of capacitance and inductance.
Definition: amplifier.h:100
int amp_model_t
Convenience type definition for an amplifier model.
Definition: amplist.h:119
int amp_set_ext_level(AMP *amp, token_t level, value_t val)
Set the value of a requested extension levels token.
Definition: amplifier.c:802
int amp_set_level(AMP *amp, setting_t level, value_t val)
Set the value of a requested level.
Definition: amplifier.c:729
int amp_close(AMP *amp)
Close the communication channel to the amplifier.
Definition: amplifier.c:445
int amp_set_powerstat(AMP *amp, powerstat_t status)
Turn the amplifier On or Off or toggle the Standby or Operate status.
Definition: amplifier.c:875
const struct confparams * amp_ext_lookup(AMP *amp, const char *name)
Lookup an extension levels or parameters token by its name and return a pointer to the containing con...
Definition: extamp.c:176
setting_t amp_has_set_level(AMP *amp, setting_t level)
Check which level settings can be set.
Definition: amp_settings.c:69
int amp_get_powerstat(AMP *amp, powerstat_t *status)
Query the power or standby status of the amplifier.
Definition: amplifier.c:912
int amp_get_ext_level(AMP *amp, token_t level, value_t *val)
Query the value of a requested extension levels token.
Definition: amplifier.c:837
int amp_get_level(AMP *amp, setting_t level, value_t *val)
Query the value of a requested level.
Definition: amplifier.c:766
int amp_get_freq(AMP *amp, freq_t *freq)
Query the operating frequency of the amplifier.
Definition: amplifier.c:616
token_t amp_token_lookup(AMP *amp, const char *name)
Search for the token ID associated with an amplifier configuration parameter token name.
Definition: amp_conf.c:619
const struct confparams * amp_confparam_lookup(AMP *amp, const char *name)
Query an amplifier configuration parameter token by its name.
Definition: amp_conf.c:558
int amp_open(AMP *amp)
Open the communication channel to the amplifier.
Definition: amplifier.c:305
@ AMP_FLAG_1
Definition: amplifier.h:123
@ AMP_FLAG_2
Definition: amplifier.h:124
setting_t amp_parse_level(const char *s)
Convert alpha string to enum AMP_LEVEL_...
Definition: misc.c:1018
const char * amp_strlevel(setting_t level)
Convert enum AMP_LEVEL_... to alpha string.
Definition: misc.c:1109
serial_parity_e
Serial parity.
Definition: rig.h:287
uint64_t setting_t
Setting.
Definition: rig.h:1093
powerstat_t
Radio power state.
Definition: rig.h:663
double freq_t
Frequency type,.
Definition: rig.h:409
rig_port_e
Port type.
Definition: rig.h:266
serial_handshake_e
Serial handshake.
Definition: rig.h:299
#define RIG_SETTING_MAX
Maximum # of rig settings.
Definition: rig.h:1099
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:232
long token_t
configuration token
Definition: rig.h:768
rig_status_e
Development status of the backend.
Definition: rig.h:368
Hamlib rig data structures.
Amplifier capabilities.
Definition: amplifier.h:189
int(* get_freq)(AMP *amp, freq_t *val)
Definition: amplifier.h:233
const struct confparams * cfgparams
Definition: amplifier.h:212
int post_write_delay
Definition: amplifier.h:208
int(* set_freq)(AMP *amp, freq_t val)
Definition: amplifier.h:232
int(* amp_init)(AMP *amp)
Definition: amplifier.h:227
const char * macro_name
Definition: amplifier.h:263
int(* amp_open)(AMP *amp)
Definition: amplifier.h:229
int(* reset)(AMP *amp, amp_reset_t reset)
Definition: amplifier.h:244
int amp_type
Definition: amplifier.h:197
int(* get_ext_level)(AMP *amp, token_t level, value_t *val)
Definition: amplifier.h:247
int serial_rate_min
Definition: amplifier.h:200
const char * amp_model_macro_name
Definition: amplifier.h:214
int(* get_level)(AMP *amp, setting_t level, value_t *val)
Definition: amplifier.h:245
int serial_stop_bits
Definition: amplifier.h:203
int(* get_powerstat)(AMP *amp, powerstat_t *status)
Definition: amplifier.h:250
int serial_data_bits
Definition: amplifier.h:202
int write_delay
Definition: amplifier.h:207
const char * model_name
Definition: amplifier.h:191
gran_t level_gran[64]
Definition: amplifier.h:219
gran_t parm_gran[64]
Definition: amplifier.h:220
int(* get_conf)(AMP *amp, token_t token, char *val)
Definition: amplifier.h:237
int(* get_conf2)(AMP *amp, token_t token, char *val, int val_len)
Definition: amplifier.h:236
int(* amp_cleanup)(AMP *amp)
Definition: amplifier.h:228
enum rig_port_e port_type
Definition: amplifier.h:198
int serial_rate_max
Definition: amplifier.h:201
enum serial_parity_e serial_parity
Definition: amplifier.h:204
int(* set_ext_level)(AMP *amp, token_t level, value_t val)
Definition: amplifier.h:248
int retry
Definition: amplifier.h:210
const char * copyright
Definition: amplifier.h:194
enum serial_handshake_e serial_handshake
Definition: amplifier.h:205
int(* set_powerstat)(AMP *amp, powerstat_t status)
Definition: amplifier.h:249
const struct confparams * extlevels
Definition: amplifier.h:260
int(* set_level)(AMP *amp, setting_t level, value_t val)
Definition: amplifier.h:246
int(* set_conf)(AMP *amp, token_t token, const char *val)
Definition: amplifier.h:235
enum rig_status_e status
Definition: amplifier.h:195
int timeout
Definition: amplifier.h:209
int(* amp_close)(AMP *amp)
Definition: amplifier.h:230
const struct confparams * extparms
Definition: amplifier.h:261
const rig_ptr_t priv
Definition: amplifier.h:213
const char * mfg_name
Definition: amplifier.h:192
setting_t has_get_level
Definition: amplifier.h:216
amp_model_t amp_model
Definition: amplifier.h:190
const char * version
Definition: amplifier.h:193
setting_t has_set_level
Definition: amplifier.h:217
Amplifier state structure.
Definition: amplifier.h:279
gran_t level_gran[64]
Definition: amplifier.h:296
int comm_state
Definition: amplifier.h:289
hamlib_port_t ampport
Definition: amplifier.h:298
setting_t has_set_level
Definition: amplifier.h:294
gran_t parm_gran[64]
Definition: amplifier.h:297
rig_ptr_t obj
Definition: amplifier.h:291
rig_ptr_t priv
Definition: amplifier.h:290
setting_t has_get_level
Definition: amplifier.h:293
hamlib_port_t_deprecated ampport_deprecated
Definition: amplifier.h:287
Master amplifier structure.
Definition: amplifier.h:315
struct amp_caps * caps
Definition: amplifier.h:316
struct amp_state state
Definition: amplifier.h:317
Configuration parameter structure.
Definition: rig.h:807
token_t token
Definition: rig.h:808
level/parm granularity definition
Definition: rig.h:1611
The Rig structure.
Definition: rig.h:2660
Universal approach for passing values.
Definition: rig.h:932