AD9552Controller
- class rfblocks.AD9552Controller(controller_id: str, device: ad9552, config: Dict | None = None)[source]
Higher level control for the AD9552 clock generator.
Documentation for the clock generator rfblocks module which uses the AD9552 can be found here: A Low Jitter Variable Rate Clock Generator to 1000 MHz
- Parameters:
controller_id (str) – The controller name.
device (
rfblocks.ad9552
) – An instance ofrfblocks.ad9552
.config – Initial configuration for the AD9552 clock generator board. If this is None the default configuration will be used. See
AD9552Controller.DEFAULT_DEVICE_CONFIG
for a brief description of the structure forconfig
.
AD9552Controller
maintains the state configuration for an AD9552 clock generator board. The following signals are defined:freq_changed(float)
refsrc_changed(str)
- configure(ser: Serial) bool [source]
Update the clock module hardware using the currently set configuration.
- Parameters:
ser (serial.Serial) – Device update commands will be sent via this serial device.
- Returns:
A boolean value indicating the clock generator PLL lock status.
True
for locked.
- configure_freq(ser: Serial) bool [source]
Update the clock module hardware with the currently set output frequency.
- Parameters:
ser (serial.Serial) – Device update commands will be sent via this serial device.
- Returns:
A boolean value indicating the clock generator PLL lock status.
True
for locked.
- dump_config() Dict [source]
Return the current configuration for this clock module.
- Returns:
A dictionary containing the current clock modules configuration:
- freq:
The currently set output frequency (in MHz).
- channels:
A dictionary containing the channel configurations keyed using the channel id.
>>> clk = ad9552('d0', 'c4', 'c5') >>> clk_ctl = AD9552Controller('Clk 1', clk) >>> from pprint import pprint as pp >>> pp(clk_ctl.dump_config()) {'channels': {'1': {'drive': <DriveStrength.STRONG: 1>, 'mode': <OutputMode.LVPECL: 5>, 'polarity': <CmosPolarity.DIFF_POS: 0>, 'source': <SourceControl.PLL: 0>, 'state': <OutputState.POWERED_DOWN: 1>}, '2': {'drive': <DriveStrength.STRONG: 1>, 'mode': <OutputMode.LVPECL: 5>, 'polarity': <CmosPolarity.DIFF_POS: 0>, 'source': <SourceControl.PLL: 0>, 'state': <OutputState.POWERED_DOWN: 1>}}, 'freq': 250.0}
- property freq: float
Returns the current output frequency (in MHz)
- load_config(config: Dict) None [source]
Set the current configuration for this clock module.
- Parameters:
config (Dict) – A dictionary containing the module configuration to be set.
>>> clk = ad9552('d0', 'c4', 'c5') >>> clk_ctl = AD9552Controller('Clk 1', clk) >>> chan1 = clk_ctl.channels['1'] >>> import copy >>> ch_config = copy.deepcopy(chan1.dump_config()) >>> ch_config['mode'] = ad9552.OutputMode.LVDS >>> ch_config['drive'] = ad9552.DriveStrength.WEAK >>> config = copy.deepcopy(clk_ctl.dump_config()) >>> config['channels']['1'] = ch_config >>> config['freq'] = 644.1 >>> clk_ctl.load_config(config) >>> pp(clk_ctl.dump_config()) {'channels': {'1': {'drive': <DriveStrength.WEAK: 0>, 'mode': <OutputMode.LVDS: 4>, 'polarity': <CmosPolarity.DIFF_POS: 0>, 'source': <SourceControl.PLL: 0>, 'state': <OutputState.POWERED_DOWN: 1>}, '2': {'drive': <DriveStrength.STRONG: 1>, 'mode': <OutputMode.LVPECL: 5>, 'polarity': <CmosPolarity.DIFF_POS: 0>, 'source': <SourceControl.PLL: 0>, 'state': <OutputState.POWERED_DOWN: 1>}}, 'freq': 644.1}
- property refsrc: str
The reference source for the module.
AD9552Channel
- class rfblocks.AD9552Channel(chan_id: str, chan_config: Dict | None = None)[source]
Higher level control for an AD9552 clock generator channel.
AD9552Channel
maintains the state configuration for a single ad9552 clock generator channel. The following signals are defined:state_changed(int, int)
mode_changed(int, int)
drive_changed(int, int)
polarity_changed(int, int)
source_changed(int, int)
- Parameters:
chan_id (str) – Channel identifier (for example: ‘1’).
chan_config (Dict) – Initial configuration for the clock channel. If this is None the default configuration will be used. See
AD9552Channel.DEFAULT_CHAN_CONFIG
for a brief description of the structure forchan_config
.
- property drive: DriveStrength
The channel drive strength.
Note that this will set the value of the
drive
property only. Updating the clock channel hardware should be done separately. See, for example,AD9552Controller.configure()
.
- dump_config() Dict [source]
Return the current configuration for this channel.
- Returns:
A dictionary containing the current clock channel configuration:
- mode:
channel mode (
rfblocks.ad9552.OutputMode
)- state:
channel output state (
rfblocks.ad9552.OutputState
)- drive:
channel drive strength (
rfblocks.ad9552.DriveStrength
)- polarity:
channel CMOS polarity (
rfblocks.ad9552.CmosPolarity
)- source:
channel source (
rfblocks.ad9552.SourceControl
)
>>> clk = ad9552('d0', 'c4', 'c5') >>> clk_ctl = AD9552Controller('Clk 1', clk) >>> chan1 = clk_ctl.channels['1'] >>> from pprint import pprint as pp >>> pp(chan1.dump_config()) {'drive': <DriveStrength.STRONG: 1>, 'mode': <OutputMode.LVPECL: 5>, 'polarity': <CmosPolarity.DIFF_POS: 0>, 'source': <SourceControl.PLL: 0>, 'state': <OutputState.POWERED_DOWN: 1>}
- property initial_config: Dict
Return a dictionary containing the initial channel configuration.
- load_config(config: Dict) None [source]
Set the current configuration for this channel.
- Parameters:
config (Dict) – A dictionary containing the channel configuration to be set.
>>> clk = ad9552('d0', 'c4', 'c5') >>> clk_ctl = AD9552Controller('Clk 1', clk) >>> chan1 = clk_ctl.channels['1'] >>> import copy >>> config = copy.deepcopy(chan1.dump_config()) >>> config['mode'] = ad9552.OutputMode.LVDS >>> config['drive'] = ad9552.DriveStrength.WEAK >>> chan1.load_config(config) >>> pp(chan1.dump_config()) {'drive': <DriveStrength.WEAK: 0>, 'mode': <OutputMode.LVDS: 4>, 'polarity': <CmosPolarity.DIFF_POS: 0>, 'source': <SourceControl.PLL: 0>, 'state': <OutputState.POWERED_DOWN: 1>}
- property mode: OutputMode
The channel output mode.
Note that this will set the value of the
mode
property only. Updating the clock channel hardware should be done separately. See, for example,AD9552Controller.configure()
.
- property polarity: CmosPolarity
The channel CMOS polarity
Note that this will set the value of the
polarity
property only. Updating the clock channel hardware should be done separately. See, for example,AD9552Controller.configure()
.
- property source: SourceControl
The channel source control setting
Note that this will set the value of the
source
property only. Updating the clock channel hardware should be done separately. See, for example,AD9552Controller.configure()
.
- property state: OutputState
The state of the clock channel.
This should be either
ad9552.OutputState.ACTIVE
orad9552.OutputState.POWERED_DOWN
.