SDFat and LowLatencyLogger

HI,

I'm trying to get something working with the LowLatencyLogger. I want to record one analogue value and 4 digital values.

Since the Aruduino Due I'm using has a 12 bit A2D is it possible to use the upper 4 bits of the 16bit variable in the data struct to store the discreets?

Something like this in UserTypes.h

struct data_t {
  uint32_t time;
  uint16_t adc;
 };

and this in the acquiredData ()?

// Acquire a data record.
void acquireData(data_t* data) {
        
uint16_t tempword = analogRead(0);
	tempword |= digitalRead(PinA) << 15;
	tempword |= digitalRead(PinB) << 14;
	tempword |= digitalRead(PinC) << 13;
	tempword |= digitalRead(PinD) << 12;
	
        data->time = micros();
	data->adc = tempword;	  
	}

I have done it successfully.
Not with a structure, but with just a plain integer.
You need an "analogue" integer and a "digital" integer variable.

The "digital" int starts with "0" and is incremented if the corresponding digitalRead(Pinx) is true.
Then you shift the result by one and increment the result if the next digitalRead(Pinx) is true.
repeat it for the next two bits.
You finish by shifting everything by 12 and OR it with the "analogue" int.
That's it.