Commit ee79c2a4 authored by Matthieu Cattin's avatar Matthieu Cattin

fmc_adc: Add function to print trigger configuration.

parent 24a36d92
......@@ -582,6 +582,21 @@ class CFmcAdc100m:
raise FmcAdc100mOperationError(e)
# Get trigger configuration
def print_trig_config(self):
#print("trig config: 0x%08X"%self.fmc_adc_csr.get_reg('TRIG_CFG'))
#print("trig delay: 0x%08X"%self.fmc_adc_csr.get_reg('TRIG_DLY'))
DIS_EN = ['disable','enable']
HW_POL = ['rising','falling']
HW_SEL = ['internal', 'external']
hw_sel = self.fmc_adc_csr.get_field('TRIG_CFG', 'HW_TRIG_SEL')
hw_pol = self.fmc_adc_csr.get_field('TRIG_CFG', 'HW_TRIG_POL')
hw_en = self.fmc_adc_csr.get_field('TRIG_CFG', 'HW_TRIG_EN')
sw_en = self.fmc_adc_csr.get_field('TRIG_CFG', 'SW_TRIG_EN')
channel = self.fmc_adc_csr.get_field('TRIG_CFG', 'INT_TRIG_SEL') + 1
int_thres = self.fmc_adc_csr.get_field('TRIG_CFG', 'INT_TRIG_THRES')
delay = self.fmc_adc_csr.get_reg('TRIG_DLY')
print("[FmcAdc100m] Trigger config => hw_en:%s, sw_en: %s, hw_sel: %s, hw_pol: %s, int_channel: %d, int_thres: 0x%04X, delay: %d"%
(DIS_EN[hw_en], DIS_EN[sw_en], HW_SEL[hw_sel], HW_POL[hw_pol], channel, int_thres, delay))
# Internal trigger
def set_int_trig(self, channel, polarity, threshold):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment