You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
490 B
C++
29 lines
490 B
C++
4 years ago
|
#ifndef STMDSP_USBSERIAL_HPP_
|
||
|
#define STMDSP_USBSERIAL_HPP_
|
||
|
|
||
|
#include "usbcfg.h"
|
||
|
|
||
|
#include <cstddef>
|
||
|
|
||
|
class USBSeriald
|
||
|
{
|
||
|
public:
|
||
|
constexpr explicit USBSeriald(SerialUSBDriver& driver) :
|
||
|
m_driver(&driver) {}
|
||
|
|
||
|
void start();
|
||
|
|
||
|
bool active() const;
|
||
|
|
||
|
std::size_t read(void *buffer, std::size_t count = 1);
|
||
|
std::size_t write(const void *buffer, std::size_t count = 1);
|
||
|
|
||
|
private:
|
||
|
SerialUSBDriver *m_driver;
|
||
|
|
||
|
void initPins();
|
||
|
};
|
||
|
|
||
|
#endif // STMDSP_USBSERIAL_HPP_
|
||
|
|