blob: 691c62b2008ea4bdd59636b32445a94e727c9b84 [file] [log] [blame]
Christina Quast4db82e02015-04-11 18:14:41 +02001#ifndef SIMTRACE_RINGBUF_H
2#define SIMTRACE_RINGBUF_H
3
4#include <stdint.h>
5#include <stdbool.h>
6#include <sys/types.h>
7
8#define RING_BUFLEN 64
9
10typedef struct ringbuf {
11 uint8_t buf[RING_BUFLEN];
12 size_t ird;
13 size_t iwr;
14} ringbuf;
15
16void rbuf_reset(volatile ringbuf *rb);
17uint8_t rbuf_read(volatile ringbuf *rb);
18void rbuf_write(volatile ringbuf *rb, uint8_t item);
19bool rbuf_is_empty(volatile ringbuf *rb);
20bool rbuf_is_full(volatile ringbuf *rb);
21
22#endif /* end of include guard: SIMTRACE_RINGBUF_H */