1#ifndef ZCU_UIO_H_INCLUDED
2#define ZCU_UIO_H_INCLUDED
22 uint32_t
read(
size_t i) {
return (i<size_)?(ptr_[i]):(0xDEADB33F); }
25 void write(
size_t where, uint32_t what);
28 uint32_t
readMasked(
size_t where, uint32_t mask) {
return (
read(where)&mask)>>first_bit_set(mask); }
31 void writeMasked(
size_t where, uint32_t mask, uint32_t val) {
rmw(where,mask,(val<<first_bit_set(mask))&mask); }
34 void rmw(
size_t where, uint32_t bits_to_modify, uint32_t newval);
36 int first_bit_set(uint32_t mask) {
39 if ((mask & (1<<i))!=0)
return i;
void writeMasked(size_t where, uint32_t mask, uint32_t val)
write with a mask (including shifts)
Definition UIO.h:31
void write(size_t where, uint32_t what)
Write the given value to the UIO device register.
Definition UIO.cxx:33
UIO(const std::string &dev, size_t size=4096)
Open the UIO device given, mapping the amount of memory indicated.
Definition UIO.cxx:11
uint32_t readMasked(size_t where, uint32_t mask)
read with a mask (including shifts)
Definition UIO.h:28
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:41
uint32_t read(size_t i)
Read the given word from the UIO device register space.
Definition UIO.h:22
This version of the fast control code interfaces with the CMS Fast control library which can be contr...
Definition Backend.cxx:3