From f362f81e6b2f90358084c7cbc945dfeca8c100ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Nogueira?= Date: Wed, 9 Aug 2023 15:12:18 -0300 Subject: [PATCH] modules: standardize encode_params and write_params. The other alternative in use was encode_config and write_config. --- include/modules/acq.h | 4 ++-- include/modules/afc_timing.h | 2 +- include/modules/fofb_cc.h | 2 +- include/modules/fofb_processing.h | 2 +- include/modules/lamp.h | 4 ++-- include/modules/sysid.h | 2 +- include/modules/trigger_iface.h | 2 +- include/modules/trigger_mux.h | 2 +- modules/acq.cc | 8 ++++---- modules/afc_timing.cc | 4 ++-- modules/fofb_cc.cc | 4 ++-- modules/fofb_processing.cc | 4 ++-- modules/lamp.cc | 4 ++-- modules/sysid.cc | 4 ++-- modules/trigger_iface.cc | 4 ++-- modules/trigger_mux.cc | 4 ++-- 16 files changed, 28 insertions(+), 28 deletions(-) diff --git a/include/modules/acq.h b/include/modules/acq.h index 9b59d1b..cdca543 100644 --- a/include/modules/acq.h +++ b/include/modules/acq.h @@ -64,8 +64,8 @@ class Controller: public RegisterController { struct acq_core ®s; void get_internal_values(); - void encode_config(); - void write_config(); + void encode_params(); + void write_params(); bool acquisition_ready(); void set_devinfo_callback() override; diff --git a/include/modules/afc_timing.h b/include/modules/afc_timing.h index c7f794c..af60c6f 100644 --- a/include/modules/afc_timing.h +++ b/include/modules/afc_timing.h @@ -37,7 +37,7 @@ class Controller: public RegisterController { struct afc_timing ®s; void set_devinfo_callback() override; - void encode_config(); + void encode_params(); public: Controller(struct pcie_bars &); diff --git a/include/modules/fofb_cc.h b/include/modules/fofb_cc.h index 3c4c9a6..7ef5816 100644 --- a/include/modules/fofb_cc.h +++ b/include/modules/fofb_cc.h @@ -36,7 +36,7 @@ class Controller: public RegisterController { struct fofb_cc_regs ®s; void get_internal_values(); - void encode_config(); + void encode_params(); public: Controller(struct pcie_bars &); diff --git a/include/modules/fofb_processing.h b/include/modules/fofb_processing.h index 1d05931..4c43d4c 100644 --- a/include/modules/fofb_processing.h +++ b/include/modules/fofb_processing.h @@ -41,7 +41,7 @@ class Controller: public RegisterController { struct wb_fofb_processing_regs ®s; void set_devinfo_callback() override; - void encode_config(); + void encode_params(); unsigned fixed_point_coeff, fixed_point_gains; diff --git a/include/modules/lamp.h b/include/modules/lamp.h index 7278972..e63842a 100644 --- a/include/modules/lamp.h +++ b/include/modules/lamp.h @@ -34,7 +34,7 @@ class CoreV2: public RegisterDecoder { class Controller: public RegisterController { protected: - virtual void encode_config() = 0; + virtual void encode_params() = 0; public: Controller(struct pcie_bars &); @@ -60,7 +60,7 @@ class ControllerV2: public Controller { /* control registers */ std::unique_ptr channel_regs; - void encode_config() override; + void encode_params() override; public: ControllerV2(struct pcie_bars &); diff --git a/include/modules/sysid.h b/include/modules/sysid.h index 404c42c..063a187 100644 --- a/include/modules/sysid.h +++ b/include/modules/sysid.h @@ -49,7 +49,7 @@ class Controller: public RegisterController { struct wb_fofb_sys_id_regs ®s; void set_devinfo_callback() override; - void encode_config(); + void encode_params(); public: Controller(struct pcie_bars &); diff --git a/include/modules/trigger_iface.h b/include/modules/trigger_iface.h index d8bcb9f..c998bcf 100644 --- a/include/modules/trigger_iface.h +++ b/include/modules/trigger_iface.h @@ -37,7 +37,7 @@ class Controller: public RegisterController { struct trigger_iface_regs ®s; void get_internal_values(); - void encode_config(); + void encode_params(); public: Controller(struct pcie_bars &); diff --git a/include/modules/trigger_mux.h b/include/modules/trigger_mux.h index e377a4f..aa2649b 100644 --- a/include/modules/trigger_mux.h +++ b/include/modules/trigger_mux.h @@ -37,7 +37,7 @@ class Controller: public RegisterController { struct trigger_mux_regs ®s; void get_internal_values(); - void encode_config(); + void encode_params(); public: Controller(struct pcie_bars &); diff --git a/modules/acq.cc b/modules/acq.cc index 7d9edad..7cf6347 100644 --- a/modules/acq.cc +++ b/modules/acq.cc @@ -267,7 +267,7 @@ void Controller::get_internal_values() throw BadAtomWidth(); } -void Controller::encode_config() +void Controller::encode_params() { get_internal_values(); acq_pre_samples = pre_samples; @@ -331,9 +331,9 @@ void Controller::encode_config() regs.ddr3_end_addr = ram_end_addr - sample_size; } -void Controller::write_config() +void Controller::write_params() { - encode_config(); + encode_params(); bar4_write_v(&bars, addr, ®s, sizeof regs); } @@ -343,7 +343,7 @@ acq_error Controller::start_acquisition() throw std::logic_error("acquisition should only be started if it's not currently running"); try { - write_config(); + write_params(); } catch (BadPostSamples &e) { return acq_error::bad_post_samples; } catch (TooManySamples &e) { diff --git a/modules/afc_timing.cc b/modules/afc_timing.cc index f60b043..0a753a1 100644 --- a/modules/afc_timing.cc +++ b/modules/afc_timing.cc @@ -242,7 +242,7 @@ bool Controller::set_freq(double freq, struct clock &clock) return true; } -void Controller::encode_config() +void Controller::encode_params() { insert_bit(regs.stat, event_receiver_enable, TIMING_STAT_EVREN); insert_bit(regs.stat, reset_latches, TIMING_STAT_RST_LATCH); @@ -294,7 +294,7 @@ void Controller::encode_config() void Controller::write_params() { - encode_config(); + encode_params(); bar4_write_v(&bars, addr, ®s, sizeof regs); diff --git a/modules/fofb_cc.cc b/modules/fofb_cc.cc index 339bb1f..01adec4 100644 --- a/modules/fofb_cc.cc +++ b/modules/fofb_cc.cc @@ -193,7 +193,7 @@ void Controller::get_internal_values() bar4_read_v(&bars, addr, ®s, sizeof regs); } -void Controller::encode_config() +void Controller::encode_params() { get_internal_values(); @@ -239,7 +239,7 @@ void Controller::encode_config() void Controller::write_params() { - encode_config(); + encode_params(); bar4_write_v(&bars, addr, ®s, sizeof regs); diff --git a/modules/fofb_processing.cc b/modules/fofb_processing.cc index ca4bd13..25e7d6c 100644 --- a/modules/fofb_processing.cc +++ b/modules/fofb_processing.cc @@ -181,7 +181,7 @@ void Controller::set_devinfo_callback() fixed_point_gains = extract_value(regs.fixed_point_pos.accs_gains, WB_FOFB_PROCESSING_REGS_FIXED_POINT_POS_ACCS_GAINS_VAL_MASK); } -void Controller::encode_config() +void Controller::encode_params() { insert_bit(regs.loop_intlk.ctl, intlk_sta_clr, WB_FOFB_PROCESSING_REGS_LOOP_INTLK_CTL_STA_CLR); insert_bit(regs.loop_intlk.ctl, intlk_en_orb_distort, WB_FOFB_PROCESSING_REGS_LOOP_INTLK_CTL_SRC_EN_ORB_DISTORT); @@ -216,7 +216,7 @@ void Controller::encode_config() void Controller::write_params() { - encode_config(); + encode_params(); bar4_write_v(&bars, addr, ®s, sizeof regs); diff --git a/modules/lamp.cc b/modules/lamp.cc index 46027b4..b7241c8 100644 --- a/modules/lamp.cc +++ b/modules/lamp.cc @@ -163,7 +163,7 @@ ControllerV2::ControllerV2(struct pcie_bars &bars): } ControllerV2::~ControllerV2() = default; -void ControllerV2::encode_config() +void ControllerV2::encode_params() { static const std::unordered_map mode_options({ {"open-loop-dac", 0}, @@ -212,7 +212,7 @@ void ControllerV2::encode_config() void ControllerV2::write_params() { - encode_config(); + encode_params(); bar4_write_v(&bars, addr + WB_RTMLAMP_OHWR_REGS_CH + channel * CHANNEL_DISTANCE, channel_regs.get(), CHANNEL_DISTANCE); diff --git a/modules/sysid.cc b/modules/sysid.cc index 7ea849c..929290e 100644 --- a/modules/sysid.cc +++ b/modules/sysid.cc @@ -138,7 +138,7 @@ void Controller::set_devinfo_callback() bar4_read_v(&bars, addr, ®s, sizeof regs); } -void Controller::encode_config() +void Controller::encode_params() { if (step_duration < 1 || step_duration > 0x3FF + 1) throw std::runtime_error("step duration is outside of valid range"); @@ -172,7 +172,7 @@ void Controller::encode_config() void Controller::write_params() { - encode_config(); + encode_params(); bar4_write_v(&bars, addr, ®s, sizeof regs); } diff --git a/modules/trigger_iface.cc b/modules/trigger_iface.cc index 2ed4b56..bfd354c 100644 --- a/modules/trigger_iface.cc +++ b/modules/trigger_iface.cc @@ -88,7 +88,7 @@ void Controller::get_internal_values() bar4_read_v(&bars, addr, ®s, sizeof regs); } -void Controller::encode_config() +void Controller::encode_params() { get_internal_values(); @@ -108,7 +108,7 @@ void Controller::encode_config() void Controller::write_params() { - encode_config(); + encode_params(); bar4_write_v(&bars, addr, ®s, sizeof regs); diff --git a/modules/trigger_mux.cc b/modules/trigger_mux.cc index 6353789..f0f9ac6 100644 --- a/modules/trigger_mux.cc +++ b/modules/trigger_mux.cc @@ -80,7 +80,7 @@ void Controller::get_internal_values() bar4_read_v(&bars, addr, ®s, sizeof regs); } -void Controller::encode_config() +void Controller::encode_params() { get_internal_values(); @@ -101,7 +101,7 @@ void Controller::encode_config() void Controller::write_params() { - encode_config(); + encode_params(); bar4_write_v(&bars, addr, ®s, sizeof regs); }