avruart
Data Fields
DirBuff Struct Reference

Presenting a circular buffer. More...

#include <uart.h>

Data Fields

char buff [BUFFSIZE]
 
char * start_ptr
 
char * end_ptr
 
char * inpos_ptr
 
char * outpos_ptr
 
size_t items
 
uint8_t full
 
void(* rx_callback )(void)
 
void(* tx_callback )(void)
 
void(* buff_empty )(void)
 

Detailed Description

Presenting a circular buffer.

The buffer is used by this UART implementation to store data that will either be send or was received. This way we can use UART interrupts and the write or read functions are not blocking.

Field Documentation

§ buff

char buff[BUFFSIZE]

The buffer holding the data that should be send or was received

§ buff_empty

void(* buff_empty) (void)

Callback when buff is empty

§ end_ptr

char* end_ptr

A pointer to theend of the buffer

§ full

uint8_t full

Indicates if the buffer is full, meaning BUFFSIZE number of items are stored

§ inpos_ptr

char* inpos_ptr

The write pointer position

§ items

size_t items

Number of items in the buffer

§ outpos_ptr

char* outpos_ptr

The read pointer position

§ rx_callback

void(* rx_callback) (void)

A callback function you can use to get notified if a byte was received

§ start_ptr

char* start_ptr

A pointer to the start of the buffer

§ tx_callback

void(* tx_callback) (void)

Callback when a byte was sent


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