mbgtools-lx  4.2.8
Synthesizer parameters

Data Structures

struct  SYNTH
 Synthesizer configuration parameters. More...
 
struct  SYNTH_STATE
 A structure used to report the synthesizer state. More...
 

Macros

#define N_SYNTH_FREQ_DIGIT   4
 number of digits to edit More...
 
#define MAX_SYNTH_FREQ   1000
 if range == MAX_SYNTH_RANGE More...
 
#define MIN_SYNTH_RANGE   0
 
#define MAX_SYNTH_RANGE   5
 
#define N_SYNTH_RANGE   ( MAX_SYNTH_RANGE - MIN_SYNTH_RANGE + 1 )
 
#define N_SYNTH_PHASE_DIGIT   4
 
#define MAX_SYNTH_PHASE   3600
 
#define MAX_SYNTH_FREQ_EDIT   9999
 max sequence of digits when editing More...
 
#define MAX_SYNTH_FREQ_VAL   10000000UL
 The maximum frequency that can be configured for the synthesizer. More...
 
#define SYNTH_PHASE_SYNC_LIMIT   10000UL
 The synthesizer's phase is only be synchronized if the frequency is below this limit. More...
 
#define _synth_dp_pos_from_range(_r)   ( ( ( N_SYNTH_RANGE - (_r) ) % ( N_SYNTH_FREQ_DIGIT - 1 ) ) + 1 )
 
#define DEFAULT_FREQ_RANGES
 Synthesizer frequency units. More...
 
#define _mbg_swab_synth(_p)
 
#define _mbg_swab_synth_state(_p)   _nop_macro_fnc()
 
#define SYNTH_FLAG_PHASE_IGNORED   0x01
 

Enumerations

enum  SYNTH_STATES {
  SYNTH_DISABLED, SYNTH_OFF, SYNTH_FREE, SYNTH_DRIFTING,
  SYNTH_SYNC, N_SYNTH_STATE
}
 Enumeration of synthesizer states. More...
 

Detailed Description

Synthesizer frequency is expressed as a four digit decimal number (freq) to be multiplied by 0.1 Hz and an base 10 exponent (range). If the effective frequency is less than 10 kHz its phase is synchronized corresponding to the variable phase. Phase may be in a range from -360 deg to +360 deg with a resolution of 0.1 deg, so the resulting numbers to be stored are in a range of -3600 to +3600.

Example:
Assume the value of freq is 2345 (decimal) and the value of phase is 900. If range == 0 the effective frequency is 234.5 Hz with a phase of +90 deg. If range == 1 the synthesizer will generate a 2345 Hz output frequency and so on.

Limitations:
If freq == 0 the synthesizer is disabled. If range == 0 the least significant digit of freq is limited to 0, 3, 5 or 6. The resulting frequency is shown in the examples below:

If range == MAX_SYNTH_RANGE the value of freq must not exceed 1000, so the output frequency is limited to 10 MHz (see MAX_SYNTH_FREQ_VAL).

Macro Definition Documentation

◆ _mbg_swab_synth

#define _mbg_swab_synth (   _p)
Value:
do \
{ \
_mbg_swab16( &(_p)->freq ); \
_mbg_swab16( &(_p)->range ); \
_mbg_swab16( &(_p)->phase ); \
} while ( 0 )

Definition at line 2864 of file gpsdefs.h.

Referenced by mbg_get_synth(), mbg_set_synth(), mbgextio_get_synth(), and mbgextio_set_synth().

◆ _mbg_swab_synth_state

#define _mbg_swab_synth_state (   _p)    _nop_macro_fnc()

Definition at line 2897 of file gpsdefs.h.

Referenced by mbg_get_synth_state().

◆ _synth_dp_pos_from_range

#define _synth_dp_pos_from_range (   _r)    ( ( ( N_SYNTH_RANGE - (_r) ) % ( N_SYNTH_FREQ_DIGIT - 1 ) ) + 1 )

A Macro used to determine the position of the decimal point when printing the synthesizer frequency as 4 digit value

Definition at line 2832 of file gpsdefs.h.

◆ DEFAULT_FREQ_RANGES

#define DEFAULT_FREQ_RANGES
Value:
{ \
"Hz", \
"kHz", \
"kHz", \
"kHz", \
"MHz", \
"MHz", \
}

Synthesizer frequency units.

An initializer for commonly displayed synthesizer frequency units (N_SYNTH_RANGE strings)

Definition at line 2841 of file gpsdefs.h.

◆ MAX_SYNTH_FREQ

#define MAX_SYNTH_FREQ   1000

if range == MAX_SYNTH_RANGE

Definition at line 2804 of file gpsdefs.h.

◆ MAX_SYNTH_FREQ_EDIT

#define MAX_SYNTH_FREQ_EDIT   9999

max sequence of digits when editing

Definition at line 2814 of file gpsdefs.h.

◆ MAX_SYNTH_FREQ_VAL

#define MAX_SYNTH_FREQ_VAL   10000000UL

The maximum frequency that can be configured for the synthesizer.

10 MHz

Definition at line 2820 of file gpsdefs.h.

◆ MAX_SYNTH_PHASE

#define MAX_SYNTH_PHASE   3600

Definition at line 2811 of file gpsdefs.h.

◆ MAX_SYNTH_RANGE

#define MAX_SYNTH_RANGE   5

Definition at line 2807 of file gpsdefs.h.

◆ MIN_SYNTH_RANGE

#define MIN_SYNTH_RANGE   0

Definition at line 2806 of file gpsdefs.h.

◆ N_SYNTH_FREQ_DIGIT

#define N_SYNTH_FREQ_DIGIT   4

number of digits to edit

Definition at line 2803 of file gpsdefs.h.

◆ N_SYNTH_PHASE_DIGIT

#define N_SYNTH_PHASE_DIGIT   4

Definition at line 2810 of file gpsdefs.h.

◆ N_SYNTH_RANGE

#define N_SYNTH_RANGE   ( MAX_SYNTH_RANGE - MIN_SYNTH_RANGE + 1 )

Definition at line 2808 of file gpsdefs.h.

◆ SYNTH_FLAG_PHASE_IGNORED

#define SYNTH_FLAG_PHASE_IGNORED   0x01

Definition at line 2899 of file gpsdefs.h.

◆ SYNTH_PHASE_SYNC_LIMIT

#define SYNTH_PHASE_SYNC_LIMIT   10000UL

The synthesizer's phase is only be synchronized if the frequency is below this limit.

10 kHz

Definition at line 2826 of file gpsdefs.h.

Enumeration Type Documentation

◆ SYNTH_STATES

Enumeration of synthesizer states.

Enumerator
SYNTH_DISABLED 

disbled by cfg, i.e. freq == 0.0

SYNTH_OFF 

not enabled after power-up

SYNTH_FREE 

enabled, but not synchronized

SYNTH_DRIFTING 

has initially been sync'd, but now running free

SYNTH_SYNC 

fully synchronized

N_SYNTH_STATE 

the number of known states

Definition at line 2876 of file gpsdefs.h.