[Hamlib-cvs-digest] CVS: hamlib/include/hamlib rig.h,1.10,1.11
Library to control radio transceivers and receivers
Brought to you by:
n0nb
From: Stephane F. <f4...@us...> - 2000-12-05 22:01:06
|
Update of /cvsroot/hamlib/hamlib/include/hamlib In directory slayer.i.sourceforge.net:/tmp/cvs-serv3805/include/hamlib Modified Files: rig.h Log Message: * all the API functions are now targetted to a particular VFO. This is a major change in the library interface, and the implementation is not complete yet (especially in the backends), but the API should be fine. Anyway, at this stage of developement, interface design experimenting matters more than completeness. * added new shortfreq_t type for frequencies on 31bits (up to 2GHz) for use by offset/shifts/etc. Index: rig.h =================================================================== RCS file: /cvsroot/hamlib/hamlib/include/hamlib/rig.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** rig.h 2000/12/04 23:39:17 1.10 --- rig.h 2000/12/05 22:01:03 1.11 *************** *** 143,147 **** RIG_VFO_A = RIG_VFO_MAIN, RIG_VFO_B = RIG_VFO_SUB, ! RIG_VFO_C = RIG_VFO_SAT }; --- 143,149 ---- RIG_VFO_A = RIG_VFO_MAIN, RIG_VFO_B = RIG_VFO_SUB, ! RIG_VFO_C = RIG_VFO_SAT, ! RIG_VFO_CURR, /* current VFO */ ! RIG_VFO_ALL /* apply to all VFO (when used as target) */ }; *************** *** 267,273 **** /* ! * frequency type in Hz, must be >32bits for SHF! */ typedef long long freq_t; #define Hz(f) ((freq_t)(f)) --- 269,277 ---- /* ! * freq_t: frequency type in Hz, must be >32bits for SHF! ! * shortfreq_t: frequency on 31bits, suitable for offsets, shifts, etc.. */ typedef long long freq_t; + typedef signed long shortfreq_t; #define Hz(f) ((freq_t)(f)) *************** *** 282,285 **** --- 286,290 ---- #define Watts(p) ((int)((p)*1000)) #define KW(p) ((int)((p)*1000000L)) + #define MW(p) ((int)((p)*1000000000L)) /* geeez! :) */ typedef unsigned int rmode_t; /* radio mode */ *************** *** 326,330 **** struct tuning_step_list { rmode_t modes; /* bitwise OR'ed RIG_MODE_* */ ! unsigned long ts; /* tuning step in Hz */ }; --- 331,335 ---- struct tuning_step_list { rmode_t modes; /* bitwise OR'ed RIG_MODE_* */ ! shortfreq_t ts; /* tuning step in Hz */ }; *************** *** 341,344 **** --- 346,350 ---- freq_t freq; rmode_t mode; + pbwidth_t width; vfo_t vfo; int power; /* in mW */ *************** *** 346,350 **** int preamp; /* in db */ int ant; /* antenna number */ ! unsigned long tuning_step; /* */ unsigned char channel_desc[MAXCHANDESC]; }; --- 352,356 ---- int preamp; /* in db */ int ant; /* antenna number */ ! shortfreq_t tuning_step; /* */ unsigned char channel_desc[MAXCHANDESC]; }; *************** *** 406,410 **** int (*rig_cleanup)(RIG *rig); int (*rig_open)(RIG *rig); /* called when port just opened */ ! int (*rig_close)(RIG *rig); /* called before port is to close */ int (*rig_probe)(RIG *rig); /* Experimental: may work.. */ --- 412,416 ---- int (*rig_cleanup)(RIG *rig); int (*rig_open)(RIG *rig); /* called when port just opened */ ! int (*rig_close)(RIG *rig); /* called before port is to be closed */ int (*rig_probe)(RIG *rig); /* Experimental: may work.. */ *************** *** 414,455 **** */ ! int (*set_freq)(RIG *rig, freq_t freq); /* select freq */ ! int (*get_freq)(RIG *rig, freq_t *freq); /* get freq */ ! int (*set_mode)(RIG *rig, rmode_t mode, pbwidth_t width); /* select mode */ ! int (*get_mode)(RIG *rig, rmode_t *mode, pbwidth_t *width); /* get mode */ int (*set_vfo)(RIG *rig, vfo_t vfo); /* select vfo (A,B, etc.) */ int (*get_vfo)(RIG *rig, vfo_t *vfo); /* get vfo */ ! int (*set_ptt)(RIG *rig, ptt_t ptt); /* ptt on/off */ ! int (*get_ptt)(RIG *rig, ptt_t *ptt); /* get ptt status */ ! int (*set_rptr_shift)(RIG *rig, rptr_shift_t rptr_shift); /* set repeater shift */ ! int (*get_rptr_shift)(RIG *rig, rptr_shift_t *rptr_shift); /* get repeater shift */ ! int (*set_rptr_offs)(RIG *rig, unsigned long offs);/*set duplex offset freq*/ ! int (*get_rptr_offs)(RIG *rig, unsigned long *offs);/*get duplex offset freq*/ ! int (*set_split_freq)(RIG *rig, freq_t rx_freq, freq_t tx_freq); ! int (*get_split_freq)(RIG *rig, freq_t *rx_freq, freq_t *tx_freq); ! int (*set_split)(RIG *rig, split_t split); ! int (*get_split)(RIG *rig, split_t *split); ! ! int (*set_rit)(RIG *rig, signed long rit); ! int (*get_rit)(RIG *rig, signed long *rit); ! ! int (*set_ts)(RIG *rig, unsigned long ts); /* set tuning step */ ! int (*get_ts)(RIG *rig, unsigned long *ts); /* get tuning step */ ! ! int (*set_dcs)(RIG *rig, unsigned int code); ! int (*get_dcs)(RIG *rig, unsigned int *code); ! int (*set_ctcss)(RIG *rig, unsigned int tone); ! int (*get_ctcss)(RIG *rig, unsigned int *tone); ! ! int (*set_dcs_sql)(RIG *rig, unsigned int code); ! int (*get_dcs_sql)(RIG *rig, unsigned int *code); ! int (*set_ctcss_sql)(RIG *rig, unsigned int tone); ! int (*get_ctcss_sql)(RIG *rig, unsigned int *tone); /* --- 420,461 ---- */ ! int (*set_freq)(RIG *rig, vfo_t vfo, freq_t freq); /* select freq */ ! int (*get_freq)(RIG *rig, vfo_t vfo, freq_t *freq); /* get freq */ ! int (*set_mode)(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width); /* select mode */ ! int (*get_mode)(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width); /* get mode */ int (*set_vfo)(RIG *rig, vfo_t vfo); /* select vfo (A,B, etc.) */ int (*get_vfo)(RIG *rig, vfo_t *vfo); /* get vfo */ ! int (*set_ptt)(RIG *rig, vfo_t vfo, ptt_t ptt); /* ptt on/off */ ! int (*get_ptt)(RIG *rig, vfo_t vfo, ptt_t *ptt); /* get ptt status */ ! int (*set_rptr_shift)(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift); /* set repeater shift */ ! int (*get_rptr_shift)(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift); /* get repeater shift */ ! int (*set_rptr_offs)(RIG *rig, vfo_t vfo, shortfreq_t offs);/*set duplex offset freq*/ ! int (*get_rptr_offs)(RIG *rig, vfo_t vfo, shortfreq_t *offs);/*get duplex offset freq*/ ! int (*set_split_freq)(RIG *rig, vfo_t vfo, freq_t rx_freq, freq_t tx_freq); ! int (*get_split_freq)(RIG *rig, vfo_t vfo, freq_t *rx_freq, freq_t *tx_freq); ! int (*set_split)(RIG *rig, vfo_t vfo, split_t split); ! int (*get_split)(RIG *rig, vfo_t vfo, split_t *split); ! ! int (*set_rit)(RIG *rig, vfo_t vfo, shortfreq_t rit); ! int (*get_rit)(RIG *rig, vfo_t vfo, shortfreq_t *rit); ! ! int (*set_ts)(RIG *rig, vfo_t vfo, shortfreq_t ts); /* set tuning step */ ! int (*get_ts)(RIG *rig, vfo_t vfo, shortfreq_t *ts); /* get tuning step */ ! ! int (*set_dcs)(RIG *rig, vfo_t vfo, unsigned int code); ! int (*get_dcs)(RIG *rig, vfo_t vfo, unsigned int *code); ! int (*set_ctcss)(RIG *rig, vfo_t vfo, unsigned int tone); ! int (*get_ctcss)(RIG *rig, vfo_t vfo, unsigned int *tone); ! ! int (*set_dcs_sql)(RIG *rig, vfo_t vfo, unsigned int code); ! int (*get_dcs_sql)(RIG *rig, vfo_t vfo, unsigned int *code); ! int (*set_ctcss_sql)(RIG *rig, vfo_t vfo, unsigned int tone); ! int (*get_ctcss_sql)(RIG *rig, vfo_t vfo, unsigned int *tone); /* *************** *** 465,481 **** int (*set_poweroff)(RIG *rig); ! int (*set_level)(RIG *rig, setting_t level, value_t val);/* set level setting */ ! int (*get_level)(RIG *rig, setting_t level, value_t *val);/* set level setting*/ ! int (*set_func)(RIG *rig, setting_t func, int status); /* activate the function(s) */ ! int (*get_func)(RIG *rig, setting_t *func); /* get the setting from rig */ ! int (*set_bank)(RIG *rig, int bank); /* set memory bank number */ ! int (*set_mem)(RIG *rig, int ch); /* set memory channel number */ ! int (*get_mem)(RIG *rig, int *ch); /* get memory channel number */ ! int (*mv_ctl)(RIG *rig, mv_op_t op); /* Mem/VFO operation */ ! int (*set_trn)(RIG *rig, int trn); /* activate transceive mode on radio */ ! int (*get_trn)(RIG *rig, int *trn); /* PCR-1000 can do that, ICR75 too */ --- 471,487 ---- int (*set_poweroff)(RIG *rig); ! int (*set_level)(RIG *rig, vfo_t vfo, setting_t level, value_t val);/* set level setting */ ! int (*get_level)(RIG *rig, vfo_t vfo, setting_t level, value_t *val);/* set level setting*/ ! int (*set_func)(RIG *rig, vfo_t vfo, setting_t func, int status); /* activate the function(s) */ ! int (*get_func)(RIG *rig, vfo_t vfo, setting_t *func); /* get the setting from rig */ ! int (*set_bank)(RIG *rig, vfo_t vfo, int bank); /* set memory bank number */ ! int (*set_mem)(RIG *rig, vfo_t vfo, int ch); /* set memory channel number */ ! int (*get_mem)(RIG *rig, vfo_t vfo, int *ch); /* get memory channel number */ ! int (*mv_ctl)(RIG *rig, vfo_t vfo, mv_op_t op); /* Mem/VFO operation */ ! int (*set_trn)(RIG *rig, vfo_t vfo, int trn); /* activate transceive mode on radio */ ! int (*get_trn)(RIG *rig, vfo_t vfo, int *trn); /* PCR-1000 can do that, ICR75 too */ *************** *** 546,553 **** */ struct rig_callbacks { ! int (*freq_event)(RIG *rig, freq_t freq); ! int (*mode_event)(RIG *rig, rmode_t mode, pbwidth_t width); int (*vfo_event)(RIG *rig, vfo_t vfo); ! int (*ptt_event)(RIG *rig, ptt_t mode); /* etc.. */ }; --- 552,559 ---- */ struct rig_callbacks { ! int (*freq_event)(RIG *rig, vfo_t vfo, freq_t freq); ! int (*mode_event)(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width); int (*vfo_event)(RIG *rig, vfo_t vfo); ! int (*ptt_event)(RIG *rig, vfo_t vfo, ptt_t mode); /* etc.. */ }; *************** *** 575,623 **** */ ! extern int rig_set_freq(RIG *rig, freq_t freq); /* select freq */ ! extern int rig_get_freq(RIG *rig, freq_t *freq); /* get freq */ ! extern int rig_set_mode(RIG *rig, rmode_t mode, pbwidth_t width); /* select mode */ ! extern int rig_get_mode(RIG *rig, rmode_t *mode, pbwidth_t *width); /* get mode */ extern int rig_set_vfo(RIG *rig, vfo_t vfo); /* select vfo */ extern int rig_get_vfo(RIG *rig, vfo_t *vfo); /* get vfo */ ! extern int rig_set_ptt(RIG *rig, ptt_t ptt); /* ptt on/off */ ! extern int rig_get_ptt(RIG *rig, ptt_t *ptt); /* get ptt status */ ! extern int rig_set_rptr_shift(RIG *rig, rptr_shift_t rptr_shift); /* set repeater shift */ ! extern int rig_get_rptr_shift(RIG *rig, rptr_shift_t *rptr_shift); /* get repeater shift */ ! extern int rig_set_rptr_offs(RIG *rig, unsigned long rptr_offs); /* set repeater offset */ ! extern int rig_get_rptr_offs(RIG *rig, unsigned long *rptr_offs); /* get repeater offset */ ! ! extern int rig_set_ctcss(RIG *rig, unsigned int tone); ! extern int rig_get_ctcss(RIG *rig, unsigned int *tone); ! extern int rig_set_dcs(RIG *rig, unsigned int code); ! extern int rig_get_dcs(RIG *rig, unsigned int *code); ! ! extern int rig_set_ctcss_sql(RIG *rig, unsigned int tone); ! extern int rig_get_ctcss_sql(RIG *rig, unsigned int *tone); ! extern int rig_set_dcs_sql(RIG *rig, unsigned int code); ! extern int rig_get_dcs_sql(RIG *rig, unsigned int *code); ! ! extern int rig_set_split_freq(RIG *rig, freq_t rx_freq, freq_t tx_freq); ! extern int rig_get_split_freq(RIG *rig, freq_t *rx_freq, freq_t *tx_freq); ! extern int rig_set_split(RIG *rig, split_t split); ! extern int rig_get_split(RIG *rig, split_t *split); ! extern int rig_set_rit(RIG *rig, signed long rit); ! extern int rig_get_rit(RIG *rig, signed long *rit); ! extern int rig_set_ts(RIG *rig, unsigned long ts); /* set tuning step */ ! extern int rig_get_ts(RIG *rig, unsigned long *ts); /* get tuning step */ extern int rig_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq, rmode_t mode); extern int rig_mW2power(RIG *rig, float *power, unsigned int mwpower, freq_t freq, rmode_t mode); ! extern int rig_set_level(RIG *rig, setting_t level, value_t val); ! extern int rig_get_level(RIG *rig, setting_t level, value_t *val); ! #define rig_get_strength(r,s) rig_get_level((r), RIG_LEVEL_STRENGTH, (value_t*)(s)) extern int rig_set_poweron(RIG *rig); --- 581,629 ---- */ ! extern int rig_set_freq(RIG *rig, vfo_t vfo, freq_t freq); /* select freq */ ! extern int rig_get_freq(RIG *rig, vfo_t vfo, freq_t *freq); /* get freq */ ! extern int rig_set_mode(RIG *rig, vfo_t vfo, rmode_t mode, pbwidth_t width); /* select mode */ ! extern int rig_get_mode(RIG *rig, vfo_t vfo, rmode_t *mode, pbwidth_t *width); /* get mode */ extern int rig_set_vfo(RIG *rig, vfo_t vfo); /* select vfo */ extern int rig_get_vfo(RIG *rig, vfo_t *vfo); /* get vfo */ ! extern int rig_set_ptt(RIG *rig, vfo_t vfo, ptt_t ptt); /* ptt on/off */ ! extern int rig_get_ptt(RIG *rig, vfo_t vfo, ptt_t *ptt); /* get ptt status */ ! extern int rig_set_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t rptr_shift); /* set repeater shift */ ! extern int rig_get_rptr_shift(RIG *rig, vfo_t vfo, rptr_shift_t *rptr_shift); /* get repeater shift */ ! extern int rig_set_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t rptr_offs); /* set repeater offset */ ! extern int rig_get_rptr_offs(RIG *rig, vfo_t vfo, shortfreq_t *rptr_offs); /* get repeater offset */ ! ! extern int rig_set_ctcss(RIG *rig, vfo_t vfo, unsigned int tone); ! extern int rig_get_ctcss(RIG *rig, vfo_t vfo, unsigned int *tone); ! extern int rig_set_dcs(RIG *rig, vfo_t vfo, unsigned int code); ! extern int rig_get_dcs(RIG *rig, vfo_t vfo, unsigned int *code); ! ! extern int rig_set_ctcss_sql(RIG *rig, vfo_t vfo, unsigned int tone); ! extern int rig_get_ctcss_sql(RIG *rig, vfo_t vfo, unsigned int *tone); ! extern int rig_set_dcs_sql(RIG *rig, vfo_t vfo, unsigned int code); ! extern int rig_get_dcs_sql(RIG *rig, vfo_t vfo, unsigned int *code); ! ! extern int rig_set_split_freq(RIG *rig, vfo_t vfo, freq_t rx_freq, freq_t tx_freq); ! extern int rig_get_split_freq(RIG *rig, vfo_t vfo, freq_t *rx_freq, freq_t *tx_freq); ! extern int rig_set_split(RIG *rig, vfo_t vfo, split_t split); ! extern int rig_get_split(RIG *rig, vfo_t vfo, split_t *split); ! extern int rig_set_rit(RIG *rig, vfo_t vfo, shortfreq_t rit); ! extern int rig_get_rit(RIG *rig, vfo_t vfo, shortfreq_t *rit); ! extern int rig_set_ts(RIG *rig, vfo_t vfo, shortfreq_t ts); /* set tuning step */ ! extern int rig_get_ts(RIG *rig, vfo_t vfo, shortfreq_t *ts); /* get tuning step */ extern int rig_power2mW(RIG *rig, unsigned int *mwpower, float power, freq_t freq, rmode_t mode); extern int rig_mW2power(RIG *rig, float *power, unsigned int mwpower, freq_t freq, rmode_t mode); ! extern int rig_set_level(RIG *rig, vfo_t vfo, setting_t level, value_t val); ! extern int rig_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val); ! #define rig_get_strength(r,v,s) rig_get_level((r),(v),RIG_LEVEL_STRENGTH, (value_t*)(s)) extern int rig_set_poweron(RIG *rig); *************** *** 635,651 **** extern setting_t rig_has_func(RIG *rig, setting_t func); /* is part of capabilities? */ ! extern int rig_set_func(RIG *rig, setting_t func, int status); /* activate the function(s) */ ! extern int rig_get_func(RIG *rig, setting_t *func); /* get the setting from rig */ ! extern int rig_set_bank(RIG *rig, int bank); /* set memory bank number */ ! extern int rig_set_mem(RIG *rig, int ch); /* set memory channel number */ ! extern int rig_get_mem(RIG *rig, int *ch); /* get memory channel number */ ! extern int rig_mv_ctl(RIG *rig, mv_op_t op); /* Mem/VFO operation */ extern int rig_set_channel(RIG *rig, const channel_t *chan); extern int rig_get_channel(RIG *rig, channel_t *chan); ! extern int rig_set_trn(RIG *rig, int trn); /* activate the transceive mode */ ! extern int rig_get_trn(RIG *rig, int *trn); --- 641,657 ---- extern setting_t rig_has_func(RIG *rig, setting_t func); /* is part of capabilities? */ ! extern int rig_set_func(RIG *rig, vfo_t vfo, setting_t func, int status); /* activate the function(s) */ ! extern int rig_get_func(RIG *rig, vfo_t vfo, setting_t *func); /* get the setting from rig */ ! extern int rig_set_bank(RIG *rig, vfo_t vfo, int bank); /* set memory bank number */ ! extern int rig_set_mem(RIG *rig, vfo_t vfo, int ch); /* set memory channel number */ ! extern int rig_get_mem(RIG *rig, vfo_t vfo, int *ch); /* get memory channel number */ ! extern int rig_mv_ctl(RIG *rig, vfo_t vfo, mv_op_t op); /* Mem/VFO operation */ extern int rig_set_channel(RIG *rig, const channel_t *chan); extern int rig_get_channel(RIG *rig, channel_t *chan); ! extern int rig_set_trn(RIG *rig, vfo_t vfo, int trn); /* activate the transceive mode */ ! extern int rig_get_trn(RIG *rig, vfo_t vfo, int *trn); *************** *** 671,674 **** #endif /* _RIG_H */ - --- 677,679 ---- |