Fork of the USBHost library by mbed.
Dependencies: FATFileSystem mbed-rtos
Fork of USBHost by
USBHostSerialPort Class Reference
A class to communicate a USB virtual serial port. More...
#include <USBHostSerial.h>
Inherited by USBHostSerial.
Public Member Functions | |
USBHostSerialPort () | |
Constructor. | |
uint8_t | available () |
Check the number of bytes available. | |
template<typename T > | |
void | attach (T *tptr, void(T::*mptr)(void), IrqType irq=RxIrq) |
Attach a member function to call when a packet is received. | |
void | attach (void(*fn)(void), IrqType irq=RxIrq) |
Attach a callback called when a packet is received. | |
void | baud (int baudrate=9600) |
Set the baud rate of the serial port. | |
void | format (int bits=8, Parity parity=USBHostSerialPort::None, int stop_bits=1) |
Set the transmission format used by the Serial port. |
Detailed Description
A class to communicate a USB virtual serial port.
Definition at line 31 of file USBHostSerial.h.
Constructor & Destructor Documentation
Constructor.
Definition at line 214 of file USBHostSerial.cpp.
Member Function Documentation
void attach | ( | void(*)(void) | fn, |
IrqType | irq = RxIrq |
||
) |
Attach a callback called when a packet is received.
- Parameters:
-
ptr function pointer
Definition at line 84 of file USBHostSerial.h.
void attach | ( | T * | tptr, |
void(T::*)(void) | mptr, | ||
IrqType | irq = RxIrq |
||
) |
Attach a member function to call when a packet is received.
- Parameters:
-
tptr pointer to the object to call the member function on mptr pointer to the member function to be called irq irq type
Definition at line 69 of file USBHostSerial.h.
uint8_t available | ( | ) |
Check the number of bytes available.
- Returns:
- the number of bytes available
Definition at line 339 of file USBHostSerial.cpp.
void baud | ( | int | baudrate = 9600 ) |
Set the baud rate of the serial port.
- Parameters:
-
baudrate The baudrate of the serial port (default = 9600).
Definition at line 285 of file USBHostSerial.cpp.
void format | ( | int | bits = 8 , |
Parity | parity = USBHostSerialPort::None , |
||
int | stop_bits = 1 |
||
) |
Set the transmission format used by the Serial port.
- Parameters:
-
bits The number of bits in a word (default = 8) parity The parity used (USBHostSerialPort::None, USBHostSerialPort::Odd, USBHostSerialPort::Even, USBHostSerialPort::Mark, USBHostSerialPort::Space; default = USBHostSerialPort::None) stop The number of stop bits (1 or 2; default = 1)
Definition at line 290 of file USBHostSerial.cpp.
Generated on Tue Jul 12 2022 20:10:20 by 1.7.2