Select Git revision
Forked from
ResearchAndDevelopment / EveryBeam
Source project has a limited visibility.
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
drvbase.cpp 587 B
#include "drvbase.h"
#include <iostream>
drvbase::drvbase(const t_driver config1) : config (config1){};
bool drvbase::I2Csend(int addr,int reg,int len,t_buffer* data,int direction){
// std::cout << "I2Csend "<<config.name <<" not implemented!\n";
return false;
};
int ApplyMask(int value,int width,int bitoffset,int old){
t_buffer mask=(1<<width)-1;
value<<=bitoffset;
mask<<=bitoffset;
return (value & mask)+(old - (old & mask));
}
int UnMask(int value,int width,int bitoffset){
t_buffer mask=(1<<width)-1;
value>>=bitoffset;
return (value & mask);
}