 
   return inByte;
 }
-
-


// Initial config for TDC7200

int TDC_setup(chanTDC7200* channel) {
  digitalWrite(channel->ENABLE, HIGH);
}


// Fetch and calculate results from TDC7200
int TDC_calc(chanTDC7200* channel) {
    TDC_read(channel);
    // calc the values (John...)
}

// Read TDC for channel
void TDC_read(chanTDC7200* channel) {

  byte inByte = 0;
  int timeResult = 0;
  int clockResult = 0;
  int calResult = 0;

  // read the TIMER1 register
    // take the chip select low to select the device:
  digitalWrite(channel->CSB, LOW);

  SPI.transfer(TIME1);

  
  digitalWrite(channel->CSB, HIGH);

  // read the CLOCK1 register
  // take the chip select low to select the device:
  digitalWrite(channel->CSB, LOW);

  SPI.transfer(CLOCK_COUNT1);
