You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
572 B

  1. #pragma once
  2. #include <stdint.h>
  3. #include <stdbool.h>
  4. typedef struct ringbuffer_instance_t* ringbuffer_t;
  5. ringbuffer_t ringbuffer_create(uint32_t capacity);
  6. uint32_t ringbuffer_capacity(ringbuffer_t instance);
  7. uint32_t ringbuffer_used(ringbuffer_t instance);
  8. bool ringbuffer_enqueue(ringbuffer_t instance, uint8_t item);
  9. bool ringbuffer_dequeue(ringbuffer_t instance, uint8_t* item);
  10. void ringbuffer_destroy(ringbuffer_t instance);
  11. void ringbuffer_debug(ringbuffer_t instance);
  12. bool ringbuffer_empty(ringbuffer_t instance);
  13. bool ringbuffer_full(ringbuffer_t instance);