Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
SerialPipe.h
- Committer:
- mazgch
- Date:
- 2014-03-14
- Revision:
- 18:e5697801df29
- Parent:
- 17:296d94a006b4
- Child:
- 19:2b5d097ca15d
File content as of revision 18:e5697801df29:
#pragma once
#include "mbed.h"
#include "Pipe.h"
#define _SerialPipeBase SerialBase
class SerialPipe : public _SerialPipeBase
{
public:
SerialPipe(PinName tx, PinName rx, int rxSize = 128, int txSize = 128);
SerialPipe(PinName tx, PinName rx, PinName rts, PinName cts, int rxSize = 128, int txSize = 128);
virtual ~SerialPipe(void);
// tx channel
int writeable(void);
int putc(int c); // blocking
int put(const void* buffer, int length, bool blocking);
// rx channel
int readable(void);
int getc(void); // blocking
int get(void* buffer, int length, bool blocking);
protected:
void rxIrqBuf(void);
void txIrqBuf(void);
void txStart(void);
Pipe<char> _pipeRx;
Pipe<char> _pipeTx;
};