FACT++  1.0
bool ConnectionFTM::EnablePixel ( int16_t  idx,
bool  enable 
)
inline

Definition at line 1099 of file ftmctrl.cc.

References data, FTM::StaticData::EnablePixel(), i, FTM::kCmdConfigFTU, FTM::kCmdRegister, FTM::kCmdWrite, and FTM::StaticData::kMaxPixelIdx.

1100  {
1101  if (idx<-1 || idx>FTM::StaticData::kMaxPixelIdx)
1102  return false;
1103 
1104  if (idx==-1)
1105  {
1107 
1108  for (int i=0; i<=FTM::StaticData::kMaxPixelIdx; i++)
1109  data.EnablePixel(i, enable);
1110 
1112 
1113  return true;
1114  }
1115 
1116  /*
1117  data.EnablePixel(idx, enable);
1118  CmdSendStatDat(data);
1119  return true;
1120  */
1121 
1123 
1124  const uintptr_t base = uintptr_t(&data);
1125  const uint16_t *mem = data.EnablePixel(idx, enable);
1126 
1127  // Calculate offset in static data block
1128  const uint16_t addr = (uintptr_t(mem)-base)/2;
1129 
1130  // From CmdSetRegister
1131  const array<uint16_t, 2> cmd = {{ addr, *mem }};
1133 
1134  reinterpret_cast<uint16_t*>(&fBufStaticData)[addr] = *mem;
1135 
1136  // Now execute change before the static data is requested back
1137  PostCmd(FTM::kCmdConfigFTU, (idx/360) | (((idx/36)%10)<<8));
1138 
1139  // Now request the register back to ensure consistency
1140  //CmdGetRegister(addr);
1141  CmdReqStatDat();
1142 
1143  return true;
1144  }
int i
Definition: db_dim_client.c:21
FTM::StaticData fBufStaticData
Definition: ftmctrl.cc:57
void CmdReqStatDat()
Definition: ftmctrl.cc:505
void PostCmd(array< uint16_t, N > dat, uint16_t u1=0, uint16_t u2=0, uint16_t u3=0, uint16_t u4=0)
Definition: ftmctrl.cc:425
Specifies that a register is read/written.
Definition: HeadersFTM.h:71
float data[4 *1440]
Send data.
Definition: HeadersFTM.h:59
Configure single FTU board.
Definition: HeadersFTM.h:65
void CmdSendStatDat(const FTM::StaticData &data)
Definition: ftmctrl.cc:510

+ Here is the call graph for this function: