Hamlib  4.0~git
Files | Data Structures | Macros | Typedefs | Enumerations | Functions
Amp

Files

file  ext.c
 Extension request parameter interface.
 

Data Structures

struct  amp_caps
 Amplifier data structure. More...
 
struct  amp_state
 Live data and customized fields. More...
 
struct  amp
 This is the master data structure, acting as a handle for the controlled amplifier. More...
 

Macros

#define NETAMPCTL_RET   "RPRT "
 Token in the netampctl protocol for returning error code.
 
#define AMP_TYPE_MASK   (AMP_FLAG_1|AMP_FLAG_2)
 
#define AMP_TYPE_OTHER   0
 
#define AMP_TYPE_1   AMP_FLAG_1
 
#define AMP_TYPE_2   AMP_FLAG_2
 
#define AMP_TYPE_ALL   (AMP_FLAG_1|AMP_FLAG_2)
 
#define AMP_LEVEL_FLOAT_LIST   (AMP_LEVEL_SWR)
 
#define AMP_LEVEL_STRING_LIST   (AMP_LEVEL_FAULT)
 
#define AMP_LEVEL_IS_FLOAT(l)   ((l)&AMP_LEVEL_FLOAT_LIST)
 
#define AMP_LEVEL_IS_STRING(l)   ((l)&AMP_LEVEL_STRING_LIST)
 
#define AMP_MODEL(arg)   .amp_model=arg,.macro_name=#arg
 
#define amp_debug   rig_debug
 Convenience definition for debug level. More...
 

Typedefs

typedef struct amp AMP
 Amplifier structure definition (see amp for details).
 
typedef float swr_t
 Type definition for SWR. More...
 
typedef int tune_value_t
 Type definition for tuning values capacitance and resistance. More...
 

Enumerations

enum  amp_reset_t { AMP_RESET_MEM, AMP_RESET_FAULT, AMP_RESET_AMP }
 
enum  amp_type_t { AMP_FLAG_1 = (1 << 1), AMP_FLAG_2 = (1 << 2) }
 Amplifier type flags. More...
 
enum  amp_level_e {
  AMP_LEVEL_NONE = 0, AMP_LEVEL_SWR = (1 << 0), AMP_LEVEL_NH = (1 << 1), AMP_LEVEL_PF = (1 << 2),
  AMP_LEVEL_PWR_INPUT = (1 << 3), AMP_LEVEL_PWR_FWD = (1 << 4), AMP_LEVEL_PWR_REFLECTED = (1 << 5), AMP_LEVEL_PWR_PEAK = (1 << 6),
  AMP_LEVEL_FAULT = (1 << 7)
}
 

Functions

int amp_ext_level_foreach (AMP *amp, int(*cfunc)(AMP *, const struct confparams *, char *), char *data)
 Executes cfunc on all the elements stored in the extlevels table. More...
 
int amp_ext_parm_foreach (AMP *amp, int(*cfunc)(AMP *, const struct confparams *, char *), char *data)
 Executes cfunc on all the elements stored in the extparms table. More...
 
const struct confparamsamp_ext_lookup (AMP *amp, const char *name)
 lookup ext token by its name, return pointer to confparams struct. More...
 
const struct confparamsamp_ext_lookup_tok (AMP *amp, token_t token)
 lookup ext token, return pointer to confparams struct. More...
 
token_t amp_ext_token_lookup (AMP *amp, const char *name)
 Simple lookup returning token id assicated with name. More...
 
AMPamp_init ()
 
int amp_open ()
 
int amp_close ()
 
int amp_cleanup ()
 
int amp_set_conf ()
 
int amp_get_conf ()
 
int amp_set_powerstat ()
 
int amp_get_powerstat ()
 
int amp_get_freq ()
 
int amp_set_freq ()
 
int amp_reset ()
 
const char * amp_get_info ()
 
int amp_get_level ()
 
int amp_register ()
 
int amp_unregister ()
 
int amp_list_foreach ()
 
int amp_load_backend ()
 
int amp_check_backend ()
 
int amp_load_all_backends ()
 
amp_model_t amp_probe_all ()
 
int amp_token_foreach ()
 
const struct confparamsamp_confparam_lookup ()
 
token_t amp_token_lookup ()
 
const struct amp_capsamp_get_caps ()
 
setting_t amp_has_get_level ()
 
const struct confparamsamp_ext_lookup ()
 
int amp_get_ext_level ()
 
const char * amp_strlevel (setting_t)
 Convert enum AMP_LEVEL_... to alpha string. More...
 
const struct confparamsrig_ext_lookup ()
 

Detailed Description

Macro Definition Documentation

◆ amp_debug

#define amp_debug   rig_debug

Convenience definition for debug level.

This is just as convenience definition of the amplifier debug level, and is the same as for the rig debug level.

See also
rig_debug()

Typedef Documentation

◆ swr_t

typedef float swr_t

Type definition for SWR.

The swr_t type is used as a parameter for the amp_get_swr() function.

Unless specified otherwise, the unit of swr_t is 1.0 to max reported by tuner

◆ tune_value_t

typedef float tune_value_t

Type definition for tuning values capacitance and resistance.

The tune_value_t type is used as a parameter for the amp_get_level()

Unless specified otherwise, the units of tune_value_t is pF and nH

Enumeration Type Documentation

◆ amp_level_e

Enumerator
AMP_LEVEL_NONE 

'' – No Level

AMP_LEVEL_SWR 

SWR 1.0 or greater

AMP_LEVEL_NH 

Tune setting nanohenries

AMP_LEVEL_PF 

Tune setting picofarads

AMP_LEVEL_PWR_INPUT 

Power reading from amp

AMP_LEVEL_PWR_FWD 

Power reading forward

AMP_LEVEL_PWR_REFLECTED 

Power reading reverse

AMP_LEVEL_PWR_PEAK 

Power reading peak

AMP_LEVEL_FAULT 

Fault code

◆ amp_type_t

enum amp_type_t

Amplifier type flags.

Enumerator
AMP_FLAG_1 

TBD

AMP_FLAG_2 

TBD

Function Documentation

◆ amp_ext_level_foreach()

int amp_ext_level_foreach ( AMP amp,
int(*)(AMP *, const struct confparams *, char *)  cfunc,
char *  data 
)

Executes cfunc on all the elements stored in the extlevels table.

Parameters
ampThe amp handle
cfunccallback function of each extlevel
datacookie to be passed to cfunc callback The callback cfunc is called until it returns a value which is not strictly positive. A zero value means a normal end of iteration, and a negative value an abnormal end, which will be the return value of amp_ext_level_foreach.

◆ amp_ext_lookup()

const struct confparams* amp_ext_lookup ( AMP amp,
const char *  name 
)

lookup ext token by its name, return pointer to confparams struct.

Parameters
amp
nameLookup extlevels table first, then fall back to extparms.

Returns NULL if nothing found

TODO: should use Lex to speed it up, strcmp hurts!

◆ amp_ext_lookup_tok()

const struct confparams* amp_ext_lookup_tok ( AMP amp,
token_t  token 
)

lookup ext token, return pointer to confparams struct.

Parameters
amp
tokenlookup extlevels table first, then fall back to extparms.

Returns NULL if nothing found

◆ amp_ext_parm_foreach()

int amp_ext_parm_foreach ( AMP amp,
int(*)(AMP *, const struct confparams *, char *)  cfunc,
char *  data 
)

Executes cfunc on all the elements stored in the extparms table.

Parameters
ampThe amp handle
cfunccallback function of each extparm
datacookie to be passed to cfunc callback The callback cfunc is called until it returns a value which is not strictly positive. A zero value means a normal end of iteration, and a negative value an abnormal end, which will be the return value of amp_ext_parm_foreach.

◆ amp_ext_token_lookup()

token_t amp_ext_token_lookup ( AMP amp,
const char *  name 
)

Simple lookup returning token id assicated with name.

Parameters
amp
name

◆ amp_strlevel()

const char* amp_strlevel ( setting_t  level)

Convert enum AMP_LEVEL_... to alpha string.

Parameters
levelAMP_LEVEL_...
Returns
alpha string
See also
amp_level_e()

Generated by doxygen 1.8.14

Hamlib documentation for version 4.0~git -- Sat Apr 4 2020 16:42:11
Project page: http://www.hamlib.org