pflib v3.0.0-rc1-29-g3a901ac
Pretty Fine HGCROC Interaction Library
All Classes Namespaces Files Functions Variables Typedefs Pages
register_maps_types.h
Go to the documentation of this file.
1
11#pragma once
12
13// need maps and strings for the LUTs
14#include <map>
15#include <string>
16
22 const int reg;
24 const int min_bit;
26 const int n_bits;
28 const int mask;
36 RegisterLocation(int r, int m, int n)
37 : reg{r}, min_bit{m}, n_bits{n},
38 mask{((1 << n_bits) - 1)} {}
39};
40
57
71 const int reg;
73 const int bit_location;
75 const bool def;
76};
77
90template<typename Key, typename Val>
91class NoCopyMap : public std::map<Key, Val> {
92 public:
94 NoCopyMap(const NoCopyMap&) = delete;
95 NoCopyMap& operator=(const NoCopyMap&) = delete;
110 NoCopyMap(const Mapping& contents) : Mapping(contents) {}
111};
112
115
118
121
A non-copyable mapping.
Definition register_maps_types.h:91
NoCopyMap(const Mapping &contents)
Constructor necessary to support a simpler definition syntax.
Definition register_maps_types.h:110
A direct access parameter is used to directly configure the HGCROC I2C connection in a fast but simpl...
Definition register_maps_types.h:69
const int bit_location
the bit location within the register that this parameter is in (0-7)
Definition register_maps_types.h:73
const int reg
the register this parameter is in (relative to the root I2C address of the HGCROC) (4-7)
Definition register_maps_types.h:71
const bool def
the default parameter value
Definition register_maps_types.h:75
A parameter for the HGC ROC includes one or more register locations and a default value defined in th...
Definition register_maps_types.h:45
const int def
the default parameter value
Definition register_maps_types.h:47
Parameter(int r, int m, int n, int def)
short constructor for single-location parameters
Definition register_maps_types.h:54
Parameter(std::initializer_list< RegisterLocation > r, int def)
pass locations and default value of parameter
Definition register_maps_types.h:51
const std::vector< RegisterLocation > registers
the locations that the parameter is split over
Definition register_maps_types.h:49
Structure holding a location in the registers.
Definition register_maps_types.h:20
const int n_bits
the number of bits the location has in the register (1-8)
Definition register_maps_types.h:26
const int reg
the register the parameter is in (0-31)
Definition register_maps_types.h:22
const int mask
the mask for this number of bits
Definition register_maps_types.h:28
RegisterLocation(int r, int m, int n)
Usable constructor.
Definition register_maps_types.h:36
const int min_bit
the min bit the location is in the register (0-7)
Definition register_maps_types.h:24