5 #include "fisch/vx/constants.h"
6 #include "halco/common/geometry.h"
7 #include "halco/common/typed_array.h"
8 #include "halco/hicann-dls/vx/dac.h"
9 #include "halco/hicann-dls/vx/xboard.h"
13 #include "hate/visibility.h"
16 class SPIShiftRegisterOnBoard;
17 class SPIDACDataRegisterOnBoard;
18 class SPIDACControlRegisterOnBoard;
69 GENPYBIND(getter_for(enable_i_ref_board))
70 bool get_enable_i_ref_board() const SYMBOL_VISIBLE;
77 GENPYBIND(setter_for(enable_i_ref_board))
78 void set_enable_i_ref_board(
bool value) SYMBOL_VISIBLE;
85 GENPYBIND(getter_for(enable_measure_i_ref))
86 bool get_enable_measure_i_ref() const SYMBOL_VISIBLE;
93 GENPYBIND(setter_for(enable_measure_i_ref))
94 void set_enable_measure_i_ref(
bool value) SYMBOL_VISIBLE;
100 GENPYBIND(getter_for(select_analog_readout_mux_1_input))
107 GENPYBIND(setter_for(select_analog_readout_mux_1_input))
114 GENPYBIND(getter_for(select_analog_readout_mux_2_input))
121 GENPYBIND(setter_for(select_analog_readout_mux_2_input))
128 GENPYBIND(getter_for(select_analog_readout_mux_3_input))
135 GENPYBIND(setter_for(select_analog_readout_mux_3_input))
142 GENPYBIND(getter_for(enable_dac_to_readout_0))
143 bool get_enable_dac_to_readout_0() const SYMBOL_VISIBLE;
149 GENPYBIND(setter_for(enable_dac_to_readout_0))
150 void set_enable_dac_to_readout_0(
bool value) SYMBOL_VISIBLE;
156 GENPYBIND(getter_for(enable_dac_to_readout_1))
157 bool get_enable_dac_to_readout_1() const SYMBOL_VISIBLE;
163 GENPYBIND(setter_for(enable_dac_to_readout_1))
164 void set_enable_dac_to_readout_1(
bool value) SYMBOL_VISIBLE;
171 bool get_enable_led(
halco::hicann_dls::vx::LEDOnBoard const& coord) const SYMBOL_VISIBLE;
178 void set_enable_led(
halco::hicann_dls::vx::LEDOnBoard const& coord,
bool value) SYMBOL_VISIBLE;
186 GENPYBIND(getter_for(enable_adc_power_down))
187 bool get_enable_adc_power_down() const SYMBOL_VISIBLE;
195 GENPYBIND(setter_for(enable_adc_power_down))
196 void set_enable_adc_power_down(
bool value) SYMBOL_VISIBLE;
203 GENPYBIND(getter_for(enable_adc_reset))
204 bool get_enable_adc_reset() const SYMBOL_VISIBLE;
211 GENPYBIND(setter_for(enable_adc_reset))
212 void set_enable_adc_reset(
bool value) SYMBOL_VISIBLE;
219 bool get_enable_vdd(
halco::hicann_dls::vx::VDDOnBoard const& coord) const SYMBOL_VISIBLE;
226 void set_enable_vdd(
halco::hicann_dls::vx::VDDOnBoard const& coord,
bool value) SYMBOL_VISIBLE;
231 GENPYBIND(stringstream)
232 friend std::ostream& operator<<(std::ostream& os,
ShiftRegister const& config) SYMBOL_VISIBLE;
234 static
size_t constexpr write_config_size_in_words GENPYBIND(hidden) = 1;
235 static
size_t constexpr read_config_size_in_words GENPYBIND(hidden) = 0;
236 static std::array<
halco::hicann_dls::vx::SPIShiftRegisterOnBoard, write_config_size_in_words>
238 static std::array<
halco::hicann_dls::vx::SPIShiftRegisterOnBoard, read_config_size_in_words>
240 std::array<
fisch::vx::word_access_type::SPIShiftRegister, write_config_size_in_words> encode()
241 const SYMBOL_VISIBLE GENPYBIND(hidden);
243 std::array<
fisch::vx::word_access_type::SPIShiftRegister, read_config_size_in_words> const&
244 data) SYMBOL_VISIBLE GENPYBIND(hidden);
248 template <typename Archive>
249 void serialize(Archive& ar, std::uint32_t const version) SYMBOL_VISIBLE;
254 bool m_enable_i_ref_board;
255 bool m_enable_measure_i_ref;
256 bool m_enable_dac_to_readout_0;
257 bool m_enable_dac_to_readout_1;
258 halco::common::typed_array<
bool,
halco::hicann_dls::vx::LEDOnBoard> m_enable_led;
259 bool m_enable_adc_power_down;
260 bool m_enable_adc_reset;
261 halco::common::typed_array<
bool,
halco::hicann_dls::vx::VDDOnBoard> m_enable_vdd;
264 std::ostream& operator<<(std::ostream& os,
ShiftRegister::AnalogReadoutMux1Input const& config)
266 std::ostream& operator<<(std::ostream& os,
ShiftRegister::AnalogReadoutMux2Input const& config)
268 std::ostream& operator<<(std::ostream& os,
ShiftRegister::AnalogReadoutMux3Input const& config)
292 struct GENPYBIND(inline_base("*
")) Value
293 : public halco::common::detail::
294 RantWrapper<Value, uint_fast32_t, fisch::vx::dac_value_max, fisch::vx::dac_value_min>
296 constexpr explicit Value(uintmax_t const val = 0) GENPYBIND(implicit_conversion) :
305 DACChannel(Value const& value = Value()) : m_value(value) {}
311 GENPYBIND(setter_for(value))
312 void set_value(Value value) SYMBOL_VISIBLE;
318 GENPYBIND(getter_for(value))
319 Value get_value() const SYMBOL_VISIBLE;
321 bool operator==(DACChannel const& other) const SYMBOL_VISIBLE;
322 bool operator!=(DACChannel const& other) const SYMBOL_VISIBLE;
324 GENPYBIND(stringstream)
325 friend std::ostream& operator<<(std::ostream& os, DACChannel const& config) SYMBOL_VISIBLE;
327 static size_t constexpr write_config_size_in_words GENPYBIND(hidden) = 1;
328 static size_t constexpr read_config_size_in_words GENPYBIND(hidden) = 0;
329 static std::array<halco::hicann_dls::vx::SPIDACDataRegisterOnBoard, write_config_size_in_words>
330 write_addresses(coordinate_type const& coord) SYMBOL_VISIBLE GENPYBIND(hidden);
331 static std::array<halco::hicann_dls::vx::SPIDACDataRegisterOnBoard, read_config_size_in_words>
332 read_addresses(coordinate_type const& coord) SYMBOL_VISIBLE GENPYBIND(hidden);
333 std::array<fisch::vx::word_access_type::SPIDACDataRegister, write_config_size_in_words> encode()
334 const SYMBOL_VISIBLE GENPYBIND(hidden);
335 void decode(std::array<
336 fisch::vx::word_access_type::SPIDACDataRegister,
337 read_config_size_in_words> const& data) SYMBOL_VISIBLE GENPYBIND(hidden);
340 friend class cereal::access;
341 template <typename Archive>
342 void serialize(Archive& ar, std::uint32_t const version) SYMBOL_VISIBLE;
347 EXTERN_INSTANTIATE_CEREAL_SERIALIZE(DACChannel)
352 struct BackendContainerTrait<DACChannel>
353 : public BackendContainerBase<DACChannel, fisch::vx::word_access_type::SPIDACDataRegister>
356 } // namespace detail
362 class GENPYBIND(visible) DACControl : public DifferentialWriteTrait
365 typedef halco::hicann_dls::vx::DACOnBoard coordinate_type;
366 typedef std::true_type is_leaf_node;
369 DACControl() SYMBOL_VISIBLE;
376 void set_enable_channel(halco::hicann_dls::vx::DACChannelOnDAC const& channel, bool value)
384 bool get_enable_channel(halco::hicann_dls::vx::DACChannelOnDAC const& channel) const
387 bool operator==(DACControl const& other) const SYMBOL_VISIBLE;
388 bool operator!=(DACControl const& other) const SYMBOL_VISIBLE;
390 GENPYBIND(stringstream)
391 friend std::ostream& operator<<(std::ostream& os, DACControl const& config) SYMBOL_VISIBLE;
393 static size_t constexpr write_config_size_in_words GENPYBIND(hidden) = 2;
394 static size_t constexpr read_config_size_in_words GENPYBIND(hidden) = 0;
396 array<halco::hicann_dls::vx::SPIDACControlRegisterOnBoard, write_config_size_in_words>
397 write_addresses(coordinate_type const& coord) SYMBOL_VISIBLE GENPYBIND(hidden);
399 array<halco::hicann_dls::vx::SPIDACControlRegisterOnBoard, read_config_size_in_words>
400 read_addresses(coordinate_type const& coord) SYMBOL_VISIBLE GENPYBIND(hidden);
401 std::array<fisch::vx::word_access_type::SPIDACControlRegister, write_config_size_in_words>
402 encode() const SYMBOL_VISIBLE GENPYBIND(hidden);
403 void decode(std::array<
404 fisch::vx::word_access_type::SPIDACControlRegister,
405 read_config_size_in_words> const& data) SYMBOL_VISIBLE GENPYBIND(hidden);
408 friend class cereal::access;
409 template <typename Archive>
410 void serialize(Archive& ar, std::uint32_t const version) SYMBOL_VISIBLE;
412 halco::common::typed_array<bool, halco::hicann_dls::vx::DACChannelOnDAC> m_enable_channel;
415 EXTERN_INSTANTIATE_CEREAL_SERIALIZE(DACControl)
420 struct BackendContainerTrait<DACControl>
421 : public BackendContainerBase<DACControl, fisch::vx::word_access_type::SPIDACControlRegister>
424 } // namespace detail
427 } // namespace haldls
431 HALCO_GEOMETRY_HASH_CLASS(haldls::vx::DACChannel::Value)
#define EXTERN_INSTANTIATE_CEREAL_SERIALIZE(CLASS_NAME)
Container for individual configuration of the value of a DAC channel of the xBoard DACs.
std::true_type is_leaf_node
halco::hicann_dls::vx::DACChannelOnBoard coordinate_type
Trait signalling derived-from container type support differential write operation.
Container for configuration of the 24-bit wide shift register controlling six VDD switches,...
halco::hicann_dls::vx::ShiftRegisterOnBoard coordinate_type
ShiftRegister() SYMBOL_VISIBLE
Default constructor.
std::true_type is_leaf_node
#define GENPYBIND_TAG_HALDLS_VX
Backend container trait base.