unleashed-firmware/core/ring.h
あく 3749eb0eed
USB VCP Cli (#237)
* Core: ring buffer.
* Api: usb vcp. F3: vcp glue code.
* Applications: cli draft version.
* Cli: basic working version, includes help and version commands
* HAL: vcp on f2
* Makefile: update openocd conf
* F3: vcp rx with freertos stream
* Cli: help
* Cli: standard commands, api-hal-uid
* Power: cli poweroff.
2020-11-16 13:16:34 +03:00

23 lines
402 B
C

#pragma once
#include <stdint.h>
#include <string.h>
typedef struct Ring Ring;
Ring* ring_alloc(size_t size);
void ring_free(Ring* ring);
size_t ring_size(Ring* ring);
size_t ring_read_space(Ring* ring);
size_t ring_write_space(Ring* ring);
size_t ring_push(Ring* ring, const uint8_t* data, size_t size);
size_t ring_pull(Ring* ring, uint8_t* data, size_t size);
void ring_clear(Ring* ring);