μHAL
|
#include <decoders.h>
Public Member Functions | |
void | get_data (bool=false) |
void | binary_dump (FILE *) const |
virtual void | print (FILE *, bool) const |
template<class T > | |
T | get_general_data (const char *name) const |
template<class T > | |
T | get_channel_data (const char *name, unsigned channel_index) const |
decoders::data_type | get_generic_data (const char *, decoders::data_key::second_type=std::nullopt) const |
void | write_general (const char *name, decoders::data_type value, void *dest) |
void | write_channel (const char *name, unsigned pos, decoders::data_type value, void *dest) |
![]() | |
void | check_devinfo_is_set () const |
virtual void | set_devinfo (const struct sdb_device_info &) |
Public Attributes | |
std::optional< unsigned > | channel |
![]() | |
const device_match_fn | match_devinfo_lambda |
Protected Member Functions | |
RegisterDecoder (struct pcie_bars &, const struct sdb_device_info &, std::unordered_map< std::string_view, Printer >) | |
void | add_general (const char *, int32_t) |
void | add_general_double (const char *, double) |
void | add_channel (const char *, unsigned, int32_t) |
void | add_channel_double (const char *, unsigned, double) |
RegisterField | rf_get_bit (uint32_t &, uint32_t) |
RegisterField | rf_extract_value (uint32_t &, uint32_t, bool=false) |
RegisterField | rf_whole_register (uint32_t &value, bool is_signed=false) |
RegisterField | rf_fixed2float (RegisterField, unsigned) |
void | add_general (const char *name, RegisterField rf) |
void | add_channel (const char *name, unsigned pos, RegisterField rf) |
virtual void | read_monitors () |
virtual void | decode ()=0 |
virtual void | decode_monitors () |
![]() | |
void | set_read_dest (auto &dest) |
RegisterDecoderBase (struct pcie_bars &, const struct sdb_device_info &) | |
virtual void | read () |
Protected Attributes | |
std::optional< unsigned > | number_of_channels |
std::unordered_map< std::string_view, Printer > | printers |
![]() | |
size_t | read_size |
void * | read_dest |
struct pcie_bars & | bars |
struct sdb_device_info | devinfo |
size_t | addr |
Private Member Functions | |
bool | is_boolean_value (const char *) const |
int32_t | try_boolean_value (const char *, int32_t) const |
template<class T > | |
void | add_data_internal (const char *, decoders::data_key::second_type, T) |
void | rf_add_data_internal (const char *, decoders::data_key::second_type, RegisterField) |
size_t | register2offset (uint32_t *) |
uint32_t * | offset2register (size_t, void *) |
void | write_internal (const char *, std::optional< unsigned >, decoders::data_type, void *) |
Private Attributes | |
std::unique_ptr< RegisterDecoderPrivate > | pvt |
This class defines a common interface to the FPGA cores on an AFC board. This class fulfils two main roles:
get_generic_data()
method;print()
method.
|
protected |
Save an int32_t (or smaller) value to a key and index. number_of_channels must be set before this can be called
|
inlineprotected |
add_channel() that takes a RegisterField
|
protected |
Save a double value to a key and index. number_of_channels must be set before this can be called
|
protected |
Save an int32_t (or smaller) value to a key
|
inlineprotected |
add_general() that takes a RegisterField
|
protected |
Save a double value to a key
|
protectedpure virtual |
Decode registers into actual values. Implemented by subclasses
Implemented in acq::Core, afc_timing::Core, bpm_swap::Core, fmc250m_4ch::Core, fmc_active_clk::Core, fmc_adc_common::Core, fmcpico1m_4ch::Core, fofb_cc::Core, fofb_processing::Core, fofb_shaper_filt::Core, lamp::Core, orbit_intlk::Core, pos_calc::Core, si57x_ctrl::Core, spi::Core, sys_id::Core, trigger_iface::Core, and trigger_mux::Core.
|
protectedvirtual |
This simply calls decode(), but can be specified by subclasses to decode only changing values
Reimplemented in fofb_shaper_filt::Core, and sys_id::Core.
void RegisterDecoder::get_data | ( | bool | only_monitors = false | ) |
Read from device and decode registers. Choose between all values or only monitors
|
protectedvirtual |
This simply calls read(), but can be specified by subclasses to read only changing values from BAR4 into RegisterDecoderBase::read_dest
Reimplemented in fofb_processing::Core, fofb_shaper_filt::Core, and sys_id::Core.
|
protected |
equivalent to rf_get_bit() for extract_value()
|
protected |
set RegisterField metadata for conversion to and from fixed point
|
protected |
get_bit() implementation which saves how to decode a register field. reg
must be within the memory region defined by RegisterDecoderBase::read_dest and RegisterDecoderBase::read_size
|
inlineprotected |
equivalent to rf_extract_value() with mask=UINT32_MAX, useful for when values take up a whole register and a MASK macro isn't defined
|
protected |
A device that has multiple channels will set this to the maximum amount of channels