4.1 Output Structure crono_packet

struct crono_packet
uint8_t channel

Source channel of the data.

Values correspond to the following:

0x00x3: ADC A – D
0x4: TDC channels. Which specific TDC channel is encoded in crono_packet::data.
uint8_t card

ID of the card.

uint8_t type

Type of the packet.

Different packet types correspond to different encodings of crono_packet::data.

Is one of the following:

CRONO_PACKET_TYPE_16_BIT_SIGNED

Used for ADC data.

crono_packet::data must be cast to int16_t and crono_packet::length must be multiplied by 4.

CRONO_PACKET_TYPE_TDC_DATA

Used for TDC data.

crono_packet::data must be cast to uint32_t and crono_packet::length must be multiplied by 2.

CRONO_PACKET_TYPE_AVRG_DATA

Used for averaged ADC data.

crono_packet::data must be cast to uint32_t and crono_packet::length must be multiplied by 2.

uint8_t flags

Bit field of the following flags:

CRONO_PACKET_FLAG_SHORTENED

Packet was truncated because internal FIFO was full.

This means that less than the requested number of samples have been written.

CRONO_PACKET_FLAG_PACKETS_LOST

Lost triggers preceeded this packet due to insufficient DMA buffers.

The DMA controller has discarded packets due to the full host buffer.

CRONO_PACKET_FLAG_OVERFLOW

The packet contains ADC sample overflows.

CRONO_PACKET_FLAG_TRIGGER_MISSED

Lost triggers preceeded this packet due to insufficient buffers.

The trigger unit has discarded packets due to a full FIFO.

CRONO_PACKET_FLAG_DMA_FIFO_FULL

The internal DMA FIFO was full.

Triggers only got lost if a subsequent package has crono_packet::flags with a bit weight CRONO_PACKET_FLAG_TRIGGER_MISSED set.

CRONO_PACKET_FLAG_HOST_BUFFER_FULL

The host buffer was full.

Triggers only got lost if a subsequent package has crono_packet::flags with a bit weight CRONO_PACKET_FLAG_TRIGGER_MISSED set.

CRONO_PACKET_FLAG_TDC_NO_EDGE

The packet from a TDC does not contain valid data.

Hence, the timestamp is not corrected. No valid edge was found for the TDC.

For TDC data, can also be one of the following:

NDIGO6G12_TDC_PACKET_FLAG_RESERVED
NDIGO6G12_TDC_PACKET_FLAG_CONTAINS_DATA

Packet contains at least one TDC event.

NDIGO6G12_TDC_PACKET_FLAG_LOST

At least one packet was lost due to full FIFO.

NDIGO6G12_TDC_PACKET_FLAG_SHORTENED

The trigger unit has shortend the current packet due to full FIFO.

NDIGO6G12_TDC_PACKET_FLAG_DMA_FIFO_FULL

The DMA FIFO was full.

Trigger only got lost if a subsequent package has crono_packet::flags with a bit weight NDIGO6G12_TDC_PACKET_FLAG_LOST set.

NDIGO6G12_TDC_PACKET_FLAG_HOST_BUFFER_FULL

The host buffer was full.

Trigger only got lost if a subsequent package has crono_packet::flags with a bit weight NDIGO6G12_TDC_PACKET_FLAG_LOST set.

uint32_t length

Length of crono_packet::data in multiples of 64 bits. The actual length of crono_packet::data depends on crono_packet::type.

uint64_t timestamp

Timestamp of the packet.

For the Ndigo6G-12, this corresponds to the beginning of the packet data.

uint64_t data[1]

Payload data of the packet.

The length of data corresponds to crono_packet::length.

The data type must be cast according to crono_packet::type, and the data encoding also depends on crono_packet::type.

See Section 4.3 for the data encoding of ADC data.

See Section 4.4 for the data encoding of TDC data.

See Section 4.5 for the data encoding of averaged ADC data.