#ifndef __RINGBSML_H
#define __RINGBSML_H

#include <stdint.h>

typedef struct {
    uint16_t* startptr;
    uint16_t size;
    uint16_t readpos;
    uint16_t writepos;
} ringbuf_t;


void ringbuf_init(ringbuf_t* rb, uint16_t* buf, uint8_t size);
uint8_t ringbuf_put(ringbuf_t *rb, uint16_t value);
int8_t ringbuf_get(ringbuf_t *rb, uint16_t* data);

#endif
