67// Description for a circular buffer (also called "ring buffer")
68// which is used as up- (T->H) or down-buffer (H->T)
69//
70typedefstruct {
71constchar* sName; // Optional name. Standard names so far are: "Terminal", "SysView", "J-Scope_t4i4"
72char* pBuffer; // Pointer to start of buffer
73unsigned SizeOfBuffer; // Buffer size in bytes. Note that one byte is lost, as this implementation does not fill up the buffer in order to avoid the problem of being unable to distinguish between full and empty.
74volatileunsigned WrOff; // Position of next item to be written by either host (down-buffer) or target (up-buffer). Must be volatile since it may be modified by host (down-buffer)
75volatileunsigned RdOff; // Position of next item to be read by target (down-buffer) or host (up-buffer). Must be volatile since it may be modified by host (up-buffer)
76unsigned Flags; // Contains configuration flags
77} SEGGER_RTT_RING_BUFFER;
78
79//
80// RTT control block which describes the number of buffers available
81// as well as the configuration for each buffer
82//
83//
84typedefstruct {
85char acID[16]; // Initialized to "SEGGER RTT"
86int MaxNumUpBuffers; // Initialized to SEGGER_RTT_MAX_NUM_UP_BUFFERS (type. 2)
87int MaxNumDownBuffers; // Initialized to SEGGER_RTT_MAX_NUM_DOWN_BUFFERS (type. 2)
88 SEGGER_RTT_RING_BUFFER aUp[SEGGER_RTT_MAX_NUM_UP_BUFFERS]; // Up buffers, transferring information up from target via debug probe to host
89 SEGGER_RTT_RING_BUFFER aDown[SEGGER_RTT_MAX_NUM_DOWN_BUFFERS]; // Down buffers, transferring information down from host via debug probe to target