Add attach

Fork of SerialHalfDuplex by Aimen Al-Refai

Revision:
2:5ecc72a47df0
Parent:
0:7802a25daf3b
Child:
3:a5021aaf31d9
--- a/SerialHalfDuplex.h	Wed Apr 03 16:42:49 2013 +0000
+++ b/SerialHalfDuplex.h	Tue Apr 01 06:50:02 2014 +0000
@@ -25,15 +25,15 @@
 #define MBED_SERIALHALFDUPLEX_H
 
 #include "device.h"
-
+ 
 #if DEVICE_SERIAL
-
+ 
 #include "Serial.h"
 #include "PinNames.h"
 #include "PeripheralNames.h"
-
+ 
 namespace mbed {
-
+ 
 /* Class: SerialHalfDuplex
  * A serial port (UART) for communication with other devices using  
  * Half-Duplex, allowing transmit and receive on a single
@@ -75,7 +75,7 @@
  * For Simplex and Full-Duplex Serial communication, see <Serial>
  */
 class SerialHalfDuplex : public Serial {
-
+ 
 public:
     /* Constructor: SerialHalfDuplex
      * Create a half-duplex serial port, connected to the specified transmit
@@ -88,7 +88,7 @@
      *  rx - Receive pin
      */
     SerialHalfDuplex(PinName tx, PinName rx, const char *name = NULL);
-
+ 
 #if 0       // Inherited from Serial class, for documentation
     /* Function: baud
      *  Set the baud rate of the serial port
@@ -97,7 +97,7 @@
      *  baudrate - The baudrate of the serial port (default = 9600).
      */
     void baud(int baudrate);
-
+ 
     enum Parity {
         None = 0
         , Odd
@@ -105,7 +105,7 @@
         , Forced1
         , Forced0
     };
-
+ 
     /* Function: format
      *  Set the transmission format used by the Serial port
      *
@@ -117,7 +117,7 @@
      */
     void format(int bits = 8, Parity parity = Serial::None, int stop_bits 
 = 1);
-
+ 
     /* Function: putc
      *  Write a character
      *
@@ -125,7 +125,7 @@
      *  c - The character to write to the serial port
      */
     int putc(int c);
-
+ 
     /* Function: getc
      *  Read a character
      *
@@ -137,7 +137,7 @@
      *  returns - The character read from the serial port
      */
     int getc();
-
+ 
     /* Function: printf
      *  Write a formated string
      *
@@ -146,7 +146,7 @@
      *      variables to use in formating the string.
      */
     int printf(const char* format, ...);
-
+ 
     /* Function: scanf
      *  Read a formated string
      *
@@ -155,7 +155,7 @@
      *      followed by the pointers to variables to store the results.
      */
     int scanf(const char* format, ...);
-
+ 
     /* Function: readable
      *  Determine if there is a character available to read
      *
@@ -163,7 +163,7 @@
      *  returns - 1 if there is a character available to read, else 0
      */
     int readable();
-
+ 
     /* Function: writeable
      *  Determine if there is space available to write a character
      *
@@ -171,7 +171,7 @@
      *  returns - 1 if there is space to write a character, else 0
      */
     int writeable();
-
+ 
     /* Function: attach
      *  Attach a function to call whenever a serial interrupt is generated
      *
@@ -179,7 +179,7 @@
      *  fptr - A pointer to a void function, or 0 to set as none
      */
     void attach(void (*fptr)(void));
-
+ 
     /* Function: attach
      *  Attach a member function to call whenever a serial interrupt is generated
      *
@@ -189,19 +189,19 @@
      */
     template<typename T>
     void attach(T* tptr, void (T::*mptr)(void));
-
+ 
 #endif
-
+ 
 protected:
     PinName     _txpin;
-
+ 
     virtual int _putc(int c);
     virtual int _getc(void);
-
+ 
 }; // End class SerialHalfDuplex
-
+ 
 } // End namespace
-
+ 
 #endif
-
-#endif
+ 
+#endif
\ No newline at end of file