mbed-drivers
|
#include <Serial.h>
Public Member Functions | |
Serial (PinName tx, PinName rx, const char *name=NULL) | |
![]() | |
void | baud (int baudrate) |
void | format (int bits=8, Parity parity=SerialBase::None, int stop_bits=1) |
int | readable () |
int | writeable () |
void | attach (void(*fptr)(void), IrqType type=RxIrq) |
template<typename T > | |
void | attach (T *tptr, void(T::*mptr)(void), IrqType type=RxIrq) |
void | send_break () |
void | set_flow_control (Flow type, PinName flow1=NC, PinName flow2=NC) |
int | write (void *buffer, int length, const event_callback_t &callback, int event=SERIAL_EVENT_TX_COMPLETE) |
int | write (const Buffer &buf, const event_callback_t &callback, int event=SERIAL_EVENT_TX_COMPLETE) |
void | abort_write () |
int | read (void *buffer, int length, const event_callback_t &callback, int event=SERIAL_EVENT_RX_COMPLETE, unsigned char char_match=SERIAL_RESERVED_CHAR_MATCH) |
int | read (const Buffer &buffer, const event_callback_t &callback, int event=SERIAL_EVENT_RX_COMPLETE, unsigned char char_match=SERIAL_RESERVED_CHAR_MATCH) |
void | abort_read () |
int | set_dma_usage_tx (DMAUsage usage) |
int | set_dma_usage_rx (DMAUsage usage) |
![]() | |
Stream (const char *name=NULL) | |
int | putc (int c) |
int | puts (const char *s) |
int | getc () |
char * | gets (char *s, int size) |
int | printf (const char *format,...) |
int | scanf (const char *format,...) |
int | vprintf (const char *format, std::va_list args) |
int | vscanf (const char *format, std::va_list args) |
operator std::FILE * () | |
![]() | |
FileLike (const char *name) | |
![]() | |
FileBase (const char *name, PathType t) | |
const char * | getName (void) |
PathType | getPathType (void) |
Protected Member Functions | |
virtual int | _getc () |
virtual int | _putc (int c) |
![]() | |
void | start_read (const Buffer &buffer, char buffer_width, const event_callback_t &callback, int event, unsigned char char_match) |
void | start_write (const Buffer &buffer, char buffer_width, const event_callback_t &callback, int event) |
void | interrupt_handler_asynch (void) |
SerialBase (PinName tx, PinName rx) | |
int | _base_getc () |
int | _base_putc (int c) |
![]() | |
virtual int | close () |
virtual ssize_t | write (const void *buffer, size_t length) |
virtual ssize_t | read (void *buffer, size_t length) |
virtual off_t | lseek (off_t offset, int whence) |
virtual int | isatty () |
virtual int | fsync () |
virtual off_t | flen () |
Additional Inherited Members | |
![]() | |
enum | Parity { None = 0, Odd, Even, Forced1, Forced0 } |
enum | IrqType { RxIrq = 0, TxIrq } |
enum | Flow { Disabled = 0, RTS, CTS, RTSCTS } |
typedef mbed::util::FunctionPointer2< void, Buffer, int > | event_callback_t |
![]() | |
static void | _irq_handler (uint32_t id, SerialIrq irq_type) |
![]() | |
static FileBase * | lookup (const char *name, unsigned int len) |
static FileBase * | get (int n) |
![]() | |
typedef OneWayTransaction< event_callback_t > | transaction_data_t |
typedef Transaction< SerialBase, transaction_data_t > | transaction_t |
![]() | |
CThunk< SerialBase > | _thunk_irq |
transaction_data_t | _current_tx_transaction |
transaction_data_t | _current_rx_transaction |
DMAUsage | _tx_usage |
DMAUsage | _rx_usage |
serial_t | _serial |
mbed::util::FunctionPointer | _irq [2] |
int | _baud |
![]() | |
std::FILE * | _file |
![]() | |
FileBase * | _next |
const char * | _name |
PathType | _path_type |
![]() | |
static FileBase * | _head = NULL |
A serial port (UART) for communication with other serial devices
Can be used for Full Duplex communication, or Simplex by specifying one pin as NC (Not Connected)
Example:
mbed::Serial::Serial | ( | PinName | tx, |
PinName | rx, | ||
const char * | name = NULL |
||
) |
Create a Serial port, connected to the specified transmit and receive pins
tx | Transmit pin |
rx | Receive pin |