diff options
author | Martin Braun <martin.braun@ettus.com> | 2015-07-01 13:52:11 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2015-07-14 14:51:32 -0700 |
commit | 4b1034b29e57a0b405fc89de4602819a4b8cc970 (patch) | |
tree | abdb2918d100cb2e959165013bffbd461a66b2c4 /host/lib/ic_reg_maps/gen_adf4351_regs.py | |
parent | 7c6bc34f625e3945458a0a2a281850513a02ef08 (diff) | |
download | uhd-4b1034b29e57a0b405fc89de4602819a4b8cc970.tar.gz uhd-4b1034b29e57a0b405fc89de4602819a4b8cc970.tar.bz2 uhd-4b1034b29e57a0b405fc89de4602819a4b8cc970.zip |
uhd: Replacing Cheetah w/ Mako 0.4.2 (allows Python 3 compat)
Diffstat (limited to 'host/lib/ic_reg_maps/gen_adf4351_regs.py')
-rwxr-xr-x | host/lib/ic_reg_maps/gen_adf4351_regs.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/host/lib/ic_reg_maps/gen_adf4351_regs.py b/host/lib/ic_reg_maps/gen_adf4351_regs.py index 4b0ef788c..6699e5137 100755 --- a/host/lib/ic_reg_maps/gen_adf4351_regs.py +++ b/host/lib/ic_reg_maps/gen_adf4351_regs.py @@ -44,8 +44,8 @@ power_down 2[5] 0 disabled, enabled pd_polarity 2[6] 1 negative, positive ldp 2[7] 0 10ns, 6ns ldf 2[8] 0 frac_n, int_n -#set $current_setting_enums = ', '.join(map(lambda x: '_'.join(("%0.2fma"%(round(x*31.27 + 31.27)/100)).split('.')), range(0,16))) -charge_pump_current 2[9:12] 5 $current_setting_enums +<% current_setting_enums = ', '.join(map(lambda x: '_'.join(("%0.2fma"%(round(x*31.27 + 31.27)/100)).split('.')), range(0,16))) %>\ +charge_pump_current 2[9:12] 5 ${current_setting_enums} double_buffer 2[13] 0 disabled, enabled r_counter_10_bit 2[14:23] 0 reference_divide_by_2 2[24] 1 disabled, enabled @@ -105,13 +105,13 @@ enum addr_t{ boost::uint32_t get_reg(boost::uint8_t addr){ boost::uint32_t reg = addr & 0x7; switch(addr){ - #for $addr in range(5+1) - case $addr: - #for $reg in filter(lambda r: r.get_addr() == addr, $regs) - reg |= (boost::uint32_t($reg.get_name()) & $reg.get_mask()) << $reg.get_shift(); - #end for + % for addr in range(5+1): + case ${addr}: + % for reg in filter(lambda r: r.get_addr() == addr, regs): + reg |= (boost::uint32_t(${reg.get_name()}) & ${reg.get_mask()}) << ${reg.get_shift()}; + % endfor break; - #end for + % endfor } return reg; } |