Nut/OS  5.0.5
API Reference
_RINGBUF Struct Reference

Character device ring buffer structure. More...

#include <dev/usart.h>

Collaboration diagram for _RINGBUF:
[legend]

Data Fields

uint8_t *volatile rbf_head
 Buffer head pointer.
uint8_t *volatile rbf_tail
 Buffer tail pointer.
uint8_trbf_start
 First buffer address.
uint8_trbf_last
 Last buffer address.
size_t rbf_siz
 Total buffer size.
volatile size_t rbf_cnt
 Number of bytes in the buffer.
size_t rbf_lwm
 Buffer low watermark.
size_t rbf_hwm
 Buffer high watermark.
HANDLE rbf_que
 Queue of waiting threads.
size_t volatile rbf_blockcnt
 Number of bytes for block-read.
uint8_t *volatile rbf_blockptr
 Address for block-read.

Detailed Description

Character device ring buffer structure.


Field Documentation

Buffer head pointer.

Changed by the receiver interrupt.

Referenced by EP3_OUT_Callback().

Buffer tail pointer.

Changed by the transmitter interrupt.

Referenced by UsartRead().

First buffer address.

Referenced by EP3_OUT_Callback(), UsartOpen(), and UsartRead().

Last buffer address.

Referenced by EP3_OUT_Callback(), and UsartRead().

Total buffer size.

Zero, if no buffer available.

Referenced by UsartIOCtl(), and UsartRead().

volatile size_t _RINGBUF::rbf_cnt

Number of bytes in the buffer.

Changed by receiver and transmitter interrupts.

Referenced by EP3_OUT_Callback(), UsartIOCtl(), UsartRead(), and UsartSize().

Buffer low watermark.

If the number of bytes in the buffer reaches this value, then the previously disabled buffer input is enabled again.

Referenced by UsartIOCtl(), and UsartRead().

Buffer high watermark.

If the number of bytes in the buffer reaches this value, then buffer input is disabled.

Referenced by UsartIOCtl(), and UsartRead().

Queue of waiting threads.

Consuming threads are added to this queue when the buffer is empty. Producing threads are added to this queue when the buffer is full.

Referenced by EP3_OUT_Callback(), UsartClose(), and UsartRead().

size_t volatile _RINGBUF::rbf_blockcnt

Number of bytes for block-read.

If this is zero, incoming bytes are stored in ringbuffer If this not zero, incoming bytes are stored in rbf_blockptr Changed by the receiver interrupt.

Referenced by UsartRead().

Address for block-read.

If bf_blockbytes is not zero, incoming bytes are stored here Changed by the receiver interrupt.

Referenced by UsartRead().


The documentation for this struct was generated from the following file: