FACT++  1.0
bool ConnectionFTM::SetSelectedThresholds ( const int32_t *  th)
inline

Definition at line 722 of file ftmctrl.cc.

References data, fDAC, i, FTM::kCmdConfigFTU, FTM::kCmdRegister, FTM::kCmdWrite, FTM::StaticData::kMaxDAC, and FTM::StaticData::kMaxPatchIdx.

723  {
724  for (int i=0; i<FTM::StaticData::kMaxPatchIdx; i++)
725  if (th[i]>FTM::StaticData::kMaxDAC)
726  return false;
727 
729 
730  for (int i=0; i<=FTM::StaticData::kMaxPatchIdx; i++)
731  {
732  if (th[i]<0 || fBufStaticData[i/4].fDAC[i%4]==th[i])
733  continue;
734 
735  // Calculate offset in static data block
736  const uint16_t addr = (uintptr_t(&fStaticData[i/4].fDAC[i%4])-uintptr_t(&fStaticData))/2;
737 
738  reinterpret_cast<uint16_t*>(&fBufStaticData)[addr] = th[i];
739 
740  // From CmdSetRegister
741  const array<uint16_t, 2> arr = {{ addr, uint16_t(th[i]) }};
743  PostCmd(FTM::kCmdConfigFTU, (i/40) | (((i/4)%10)<<8));
744  }
745 
746  //CmdGetRegister(addr);
747  CmdReqStatDat();
748 
749  return true;
750  }
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
FTM::StaticData fStaticData
Definition: ftmctrl.cc:53
float data[4 *1440]
Send data.
Definition: HeadersFTM.h:59
Configure single FTU board.
Definition: HeadersFTM.h:65
uint16_t fDAC[5]
enable of 4x9 pixels coded as 4x9bits
Definition: HeadersFTM.h:187