61 USBSerial(
bool connect_blocking =
true, uint16_t vendor_id = 0x1f00, uint16_t product_id = 0x2012, uint16_t product_release = 0x0001);
80 USBSerial(
USBPhy *phy, uint16_t vendor_id = 0x1f00, uint16_t product_id = 0x2012, uint16_t product_release = 0x0001);
96 virtual int _putc(
int c);
148 void attach(T *tptr,
void (T::*mptr)(
void))
152 if ((mptr != NULL) && (tptr != NULL)) {
194 void attach(
void (*fptr)(
int baud,
int bits,
int parity,
int stop))
198 _settings_changed_callback = fptr;
204 virtual void data_rx();
205 virtual void line_coding_changed(
int baud,
int bits,
int parity,
int stop)
209 if (_settings_changed_callback) {
210 _settings_changed_callback(baud, bits, parity, stop);
216 void (*_settings_changed_callback)(
int baud,
int bits,
int parity,
int stop);
void attach(T *tptr, void(T::*mptr)(void))
Attach a member function to call when a packet is received.
void attach(void(*fptr)(void))
Attach a callback called when a packet is received.
void attach(void(*fptr)(int baud, int bits, int parity, int stop))
Attach a callback to call when serial's settings are changed.
void attach(mbed::Callback< void()> &cb)
Attach a Callback called when a packet is received.
Abstract interface to physical USB hardware.
uint8_t available()
Check the number of bytes available.
virtual int _putc(int c)
Send a character.
bool connected()
Check if the terminal is connected.
virtual int _getc()
Read a character: blocking.
int readable()
Determine if there is a character available to read.
int writeable()
Determine if there is space available to write a character.
virtual void lock()
Acquire exclusive access to this instance USBDevice.
virtual void unlock()
Release exclusive access to this instance USBDevice.
USBSerial(bool connect_blocking=true, uint16_t vendor_id=0x1f00, uint16_t product_id=0x2012, uint16_t product_release=0x0001)
Basic constructor.
virtual ~USBSerial()
Destroy this object.
virtual void assert_locked()
Assert that the current thread of execution holds the lock.