Skip to content
Snippets Groups Projects
Select Git revision
  • 409b098cf94cb24317cb1391a98c6a5910b3a554
  • master default protected
  • dither_on_off_disabled
  • yocto
  • pypcc2
  • pypcc3
  • 2020-12-07-the_only_working_copy
  • v2.1
  • v2.0
  • v1.0
  • v0.9
  • Working-RCU_ADC,ID
  • 2020-12-11-Holiday_Season_release
13 results

drvbase.cpp

Blame
  • 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);
    }