mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2024-12-25 06:13:14 +03:00
3749eb0eed
* 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.
23 lines
402 B
C
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);
|