Serial Communicate Control Class. This has printf() and Tx & Rx buffer with (RxIRQ) RingBuffer, andmore can add user rxFunc to RxIrq.

Dependencies:   RingBuffer

Files at this revision

API Documentation at this revision

Comitter:
AkinoriHashimoto
Date:
Tue Nov 15 06:27:34 2016 +0000
Parent:
2:d234f6f65fb9
Commit message:
add comments.

Changed in this revision

mySerial.h Show annotated file Show diff for this revision Revisions of this file
diff -r d234f6f65fb9 -r 3658415b257b mySerial.h
--- a/mySerial.h	Fri Jun 10 04:37:11 2016 +0000
+++ b/mySerial.h	Tue Nov 15 06:27:34 2016 +0000
@@ -1,4 +1,5 @@
-/**     Bluetooth module mySerial control class with using RTOS.
+/**     Serial control class with using RTOS.
+ *  You can use printf(), rxIrq();
  *
  */
 /**
@@ -58,13 +59,31 @@
      */
     void init(int baudrate= 115200, int bit=8, int parity=SerialBase::None, int stop=1, bool CRLN=true);
 
-
+    /** add rxFuncPtr to AttachRxIrq.
+     *  @param (*fptr)(char chr)
+     */
     void setAttachRx(void (*fptr)(char));
     
+    /**  check Buffer
+     *  @return bool; true->readable.
+    */
     bool readable();
+    
+    /** get string in Rx-RingBuffer.
+     *  return string; all chars in ringBuffer.
+    */
     string get();
+    
+    /** get string 1 line in Rx-RingBuffer.
+     * 1 line is string until CR (or CR&LN <- cf.init()).
+     *  @return string; 1 line chars.
+    */
     string getLine();
     
+    /** send Line with add CR lineEnd.
+     *  @param str; strings
+     *  @param addCR; true -> add CR str's end.
+    */
     void sendLine(string str, bool addCR=true);
 
 private: