3.4.6 SAM Printf Queue Sampler

Used to read out data from a queue on a SAM device.

The printf queue is a circular buffer stored in the SAM's SRAM space along with some administrative functions. It consists of:
  1. 1 word token+size ("SAM"+size_bytes).
  2. 1 word write pointer.
  3. 1 word read pointer.
  4. (2^size)-12 bytes circular buffer.

The printf queue sampler reads available bytes from the read pointer and sends data to the host computer.

Table 3-47. SAM Printf Queue Sampler
FieldSizeDescription
DATA_SAMPLER1 byte0x8A
SAMPLE_PRINTF_QUEUE1 byte0x04
ENABLE1 byte

0x00: disable

0x01: enable

ADDRESS4 byteStart address of queue structure to poll, MSB first
FLAGS4 byte
Bits 1:0: destination:
  • b00: send to DGI as data
  • b01: send to HID (reserved)
  • b10: send to DGI as print
  • b11: reserved

Response:

Table 3-48. SAM Printf Queue Sampler Response
FieldSizeDescription
DATA_SAMPLER1 byte0x8A
SAMPLE_PRINTF_QUEUE1 byte0x04
Status1 byte

Status code

0x00: OK

0xFF: Error

Note: This feature is in a beta stage and should be used with caution.