allsensors
Fork of C027_Support by
SerialPipe Class Reference
Buffered serial interface (rtos capable/interrupt driven) More...
#include <SerialPipe.h>
Inherited by GPSSerial, and MDMSerial.
Public Member Functions | |
SerialPipe (PinName tx, PinName rx, int rxSize=128, int txSize=128) | |
Constructor. | |
virtual | ~SerialPipe (void) |
Destructor. | |
int | writeable (void) |
check if writable return the number of free bytes | |
int | putc (int c) |
send a character (blocking) | |
int | put (const void *buffer, int length, bool blocking) |
send a buffer | |
int | readable (void) |
check if readable | |
int | getc (void) |
receive one character from the serial port (blocking) | |
int | get (void *buffer, int length, bool blocking) |
read a buffer from the serial port | |
Protected Member Functions | |
void | rxIrqBuf (void) |
receive interrupt routine | |
void | txIrqBuf (void) |
transmit interrupt woutine | |
void | txStart (void) |
start transmission helper | |
void | txCopy (void) |
move bytes to hardware | |
Protected Attributes | |
Pipe< char > | _pipeRx |
receive pipe | |
Pipe< char > | _pipeTx |
transmit pipe |
Detailed Description
Buffered serial interface (rtos capable/interrupt driven)
Definition at line 10 of file SerialPipe.h.
Constructor & Destructor Documentation
SerialPipe | ( | PinName | tx, |
PinName | rx, | ||
int | rxSize = 128 , |
||
int | txSize = 128 |
||
) |
Constructor.
- Parameters:
-
tx the trasmitting pin rx the receiving pin rxSize the size of the receiving buffer txSize the size of the transmitting buffer
Definition at line 3 of file SerialPipe.cpp.
~SerialPipe | ( | void | ) | [virtual] |
Destructor.
Definition at line 12 of file SerialPipe.cpp.
Member Function Documentation
int get | ( | void * | buffer, |
int | length, | ||
bool | blocking | ||
) |
read a buffer from the serial port
- Parameters:
-
pointer to the buffer to read. length number of bytes to read blocking true if all bytes shall be read. false if only the available bytes.
- Returns:
- the number of bytes read.
Definition at line 94 of file SerialPipe.cpp.
int getc | ( | void | ) |
receive one character from the serial port (blocking)
- Parameters:
-
the character received
Definition at line 87 of file SerialPipe.cpp.
int put | ( | const void * | buffer, |
int | length, | ||
bool | blocking | ||
) |
send a buffer
- Parameters:
-
buffer the buffer to send length the size of the buffer to send blocking,if true this function will block until all bytes placed in the buffer.
- Returns:
- the number of bytes written
Definition at line 31 of file SerialPipe.cpp.
int putc | ( | int | c ) |
send a character (blocking)
- Parameters:
-
c the character to send
- Returns:
- c
Definition at line 24 of file SerialPipe.cpp.
int readable | ( | void | ) |
check if readable
- Returns:
- the size available in the buffer.
Definition at line 82 of file SerialPipe.cpp.
void rxIrqBuf | ( | void | ) | [protected] |
receive interrupt routine
Definition at line 99 of file SerialPipe.cpp.
void txCopy | ( | void | ) | [protected] |
move bytes to hardware
Definition at line 54 of file SerialPipe.cpp.
void txIrqBuf | ( | void | ) | [protected] |
transmit interrupt woutine
Definition at line 63 of file SerialPipe.cpp.
void txStart | ( | void | ) | [protected] |
start transmission helper
Definition at line 71 of file SerialPipe.cpp.
int writeable | ( | void | ) |
check if writable return the number of free bytes
Definition at line 19 of file SerialPipe.cpp.
Field Documentation
receive pipe
Definition at line 78 of file SerialPipe.h.
transmit pipe
Definition at line 79 of file SerialPipe.h.
Generated on Wed Jul 13 2022 00:19:01 by 1.7.2