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:
10
firmware/targets/Inc/api-hal-uid.h
Normal file
10
firmware/targets/Inc/api-hal-uid.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
/* Get platform UID size in bytes */
|
||||
size_t api_hal_uid_size();
|
||||
|
||||
/* Get const pointer to UID */
|
||||
const uint8_t* api_hal_uid();
|
24
firmware/targets/Inc/api-hal-vcp.h
Normal file
24
firmware/targets/Inc/api-hal-vcp.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
/* Init VCP HAL
|
||||
* Allocates ring buffer and initializes state
|
||||
*/
|
||||
void api_hal_vcp_init();
|
||||
|
||||
/* Recieve data from VCP
|
||||
* Waits till some data arrives, never returns 0
|
||||
* @param buffer - pointer to buffer
|
||||
* @param size - buffer size
|
||||
* @return items copied in buffer, 0 if channel closed
|
||||
*/
|
||||
size_t api_hal_vcp_rx(uint8_t* buffer, size_t size);
|
||||
|
||||
/* Transmit data to VCP
|
||||
* @param buffer - pointer to buffer
|
||||
* @param size - buffer size
|
||||
*/
|
||||
void api_hal_vcp_tx(uint8_t* buffer, size_t size);
|
10
firmware/targets/Inc/api-hal.h
Normal file
10
firmware/targets/Inc/api-hal.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "api-hal-gpio.h"
|
||||
#include "api-hal-delay.h"
|
||||
#include "api-hal-pwm.h"
|
||||
#include "api-hal-task.h"
|
||||
#include "api-hal-tim.h"
|
||||
#include "api-hal-power.h"
|
||||
#include "api-hal-vcp.h"
|
||||
#include "api-hal-uid.h"
|
Reference in New Issue
Block a user