Use USB VCP as a normal serial driver as well

This commit is contained in:
Raphael Coeffic
2022-03-20 16:22:14 +01:00
parent 530d395204
commit b39baa2360
37 changed files with 357 additions and 248 deletions
@@ -21,6 +21,9 @@
#pragma once
#include "hal/serial_port.h"
#include "definitions.h"
#include <stdbool.h>
#include <stdint.h>
@@ -47,14 +50,9 @@ void usbStart();
void usbStop();
bool usbStarted();
int getSelectedUsbMode();
EXTERN_C(int getSelectedUsbMode());
void setSelectedUsbMode(int mode);
uint32_t usbSerialFreeSpace();
void usbSerialPutc(void*, uint8_t c);
EXTERN_C(uint32_t usbSerialFreeSpace());
uint32_t usbSerialBaudRate(void);
void usbSerialSetReceiveDataCb(void (*cb)(uint8_t* buf, uint32_t len));
void usbSerialSetCtrlLineStateCb(void (*cb)(uint16_t ctrlLineState));
void usbSerialSetBaudRateCb(void (*cb)(uint32_t baud));
extern const etx_serial_port_t UsbSerialPort;