1#ifndef ZCU_UIO_H_INCLUDED
2#define ZCU_UIO_H_INCLUDED
26 uint32_t
read(
size_t i) {
return (i < size_) ? (ptr_[i]) : (0xDEADB33F); }
29 void write(
size_t where, uint32_t what);
33 return (
read(where) & mask) >> first_bit_set(mask);
38 rmw(where, mask, (val << first_bit_set(mask)) & mask);
42 void rmw(
size_t where, uint32_t bits_to_modify, uint32_t newval);
48 int first_bit_set(uint32_t mask) {
50 for (i = 0; i < 32; i++)
51 if ((mask & (1 << i)) != 0)
return i;
UIO(const std::string &name, size_t size=4096)
Open the UIO device given a name, mapping the amount of memory indicated.
Definition UIO.cxx:25
void writeMasked(size_t where, uint32_t mask, uint32_t val)
write with a mask (including shifts)
Definition UIO.h:37
void write(size_t where, uint32_t what)
Write the given value to the UIO device register.
Definition UIO.cxx:129
void iopen(const std::string &dev, size_t size=4096)
Open a given device file directly.
Definition UIO.cxx:99
uint32_t readMasked(size_t where, uint32_t mask)
read with a mask (including shifts)
Definition UIO.h:32
void rmw(size_t where, uint32_t bits_to_modify, uint32_t newval)
Generate an RMW cycle (read, apply INVERSE OF MASK, apply OR)
Definition UIO.cxx:139
uint32_t read(size_t i)
Read the given word from the UIO device register space.
Definition UIO.h:26
~UIO()
Open the UIO device given, mapping the amount of memory indicated.
Definition UIO.cxx:115
This version of the fast control code interfaces with the CMS Fast control library which can be contr...
Definition Backend.cxx:3