C027_SupportTest_xively_locationで使用しているC027用ライブラリ
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 5 of file SerialPipe.cpp.
~SerialPipe | ( | void | ) | [virtual] |
Destructor.
Definition at line 14 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 96 of file SerialPipe.cpp.
int getc | ( | void | ) |
receive one character from the serial port (blocking)
- Parameters:
-
the character received
Definition at line 89 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 33 of file SerialPipe.cpp.
int putc | ( | int | c ) |
send a character (blocking)
- Parameters:
-
c the character to send
- Returns:
- c
Definition at line 26 of file SerialPipe.cpp.
int readable | ( | void | ) |
check if readable
- Returns:
- the size available in the buffer.
Definition at line 84 of file SerialPipe.cpp.
void rxIrqBuf | ( | void | ) | [protected] |
receive interrupt routine
Definition at line 101 of file SerialPipe.cpp.
void txCopy | ( | void | ) | [protected] |
move bytes to hardware
Definition at line 56 of file SerialPipe.cpp.
void txIrqBuf | ( | void | ) | [protected] |
transmit interrupt woutine
Definition at line 65 of file SerialPipe.cpp.
void txStart | ( | void | ) | [protected] |
start transmission helper
Definition at line 73 of file SerialPipe.cpp.
int writeable | ( | void | ) |
check if writable return the number of free bytes
Definition at line 21 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 Thu Jul 14 2022 11:08:16 by 1.7.2