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.
This commit is contained in:
あく
2020-11-16 13:16:34 +03:00
committed by GitHub
parent 466ea087a0
commit 3749eb0eed
30 changed files with 837 additions and 242 deletions

22
core/ring.h Normal file
View File

@@ -0,0 +1,22 @@
#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);