Add a bunch of APNs

Fork of C027_Support by Xinlei Cao

Committer:
mazgch
Date:
Sun Nov 10 16:39:42 2013 +0000
Revision:
9:e7a5959ffae1
Parent:
2:b6012cd91657
Child:
13:e2446fcdc246
update support library (tx pipe)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mazgch 0:cb2d45baaca3 1 #pragma once
mazgch 0:cb2d45baaca3 2
mazgch 2:b6012cd91657 3 #include "mbed.h"
mazgch 0:cb2d45baaca3 4 #include "Pipe.h"
mazgch 0:cb2d45baaca3 5
mazgch 0:cb2d45baaca3 6 class SerialPipe : public Serial
mazgch 0:cb2d45baaca3 7 {
mazgch 9:e7a5959ffae1 8 public:
mazgch 9:e7a5959ffae1 9 SerialPipe(PinName tx, PinName rx, int rxSize = 128, int txSize = 128, const char* name = NULL);
mazgch 9:e7a5959ffae1 10 virtual ~SerialPipe(void);
mazgch 9:e7a5959ffae1 11 // tx channel
mazgch 9:e7a5959ffae1 12 int put(const char* b, int s, bool t = false) ;
mazgch 9:e7a5959ffae1 13 // rx channel
mazgch 9:e7a5959ffae1 14 int readable(void);
mazgch 9:e7a5959ffae1 15 int getc(void);
mazgch 9:e7a5959ffae1 16 int get(char* b, int s, bool t = false);
mazgch 0:cb2d45baaca3 17 private:
mazgch 9:e7a5959ffae1 18 void rxIrqBuf(void);
mazgch 9:e7a5959ffae1 19 void txIrqBuf(void);
mazgch 9:e7a5959ffae1 20 protected:
mazgch 9:e7a5959ffae1 21 Pipe<char> _pipeRx;
mazgch 9:e7a5959ffae1 22 Pipe<char> _pipeTx;
mazgch 9:e7a5959ffae1 23 };
mazgch 0:cb2d45baaca3 24
mazgch 9:e7a5959ffae1 25 #define WAIT -1
mazgch 9:e7a5959ffae1 26 #define NOT_FOUND 0
mazgch 9:e7a5959ffae1 27
mazgch 9:e7a5959ffae1 28 // -----------------------------------------------------------------------
mazgch 0:cb2d45baaca3 29
mazgch 9:e7a5959ffae1 30 class SerialPipeEx : public SerialPipe
mazgch 9:e7a5959ffae1 31 {
mazgch 9:e7a5959ffae1 32 public:
mazgch 9:e7a5959ffae1 33 SerialPipeEx(PinName tx, PinName rx, int rxSize = 128, int txSize = 128, const char* name = NULL);
mazgch 9:e7a5959ffae1 34 int getLine(char* b, int s);
mazgch 0:cb2d45baaca3 35 };