/************************************************************/
/*  Readme for the new COM PORT driver, OS7_COM.Lib        */
/*                                                          */
/*  The readme includes FAQ1~FAQ6, and update history.      */
/*                                                          */
/*  Last updated on [2010,04,02] by Tim Tsai                */
/************************************************************/


================================================================================
FAQ1: What is OS7_COM.lib ?
================================================================================
Ans: OS7_COM.lib is a new COM port driver for MiniOS7 based controllers. 


================================================================================
FAQ2: What are the benefits of the new method/driver ?
================================================================================
Ans:
* Occupies less memory then the old driver when using many COM ports.
   old driver: the COM port APIs included in the CPU library (uPAC5000.Lib)
   new driver: the COM port APIs included in the OS7_COM.lib.
   
* Easy maintainence for the driver developer.

================================================================================
FAQ3: Can I mix old and new drivers?
================================================================================
Ans: Yes. You can mix the old and new drivers in your code.
     For example, the following case can work well.
        InstallCom(1,115200,8,0,1); //COM1 use old driver
        ToCom(1,'a');               //COM1 use old driver
        
        OS7_COM *port;
        port=_InstallCom(2,115200,8,0,1); //COM2 use new driver
        _ToCom(port,'a');               //COM2 use new driver
        
     But you can not mix old and new API to the same COM port.
     For example, the following case can not work well.
        InstallCom(1,115200,8,0,1); //COM1 use old driver
        _ToCom(port,'a');              //COM1 use new driver
      
================================================================================
FAQ4: What MiniOS7 controller is avalible for the OS7_COM.lib ?
================================================================================
Ans: avalible controllers:
    (a) avalible for uPAC-5000 series
    (b) avalible for i-7186E/7188E/7188XB/7188XC series
    (c) avalible for COM1/COM2 of iView-100 (not tested)
    (d) avalible for the controller which HW is compatilbe to uPAC-7186EX

    not avalible functions/controllers:
    (a) DMA mode to receive data are not supported 
        for COM1/2(Internal UARTs of the 80186/188 CPU)
    (b) not avalible for i-8000 
    (c) not avalible for i-7188
    (d) not avalible for i-7188XA
    (e) not avalible for iP-8000
     
================================================================================
FAQ5: How to translate my code to use the new driver/method ?
================================================================================
Ans: Just need to proceed two steps to translate the code 
        (a) add one variable (OS7_COM * port)
        (b) add under line to the begining of the functions related to COM port.
        
    Following are the codes using old and new driver.
    You can see the difference.
--------------------------------------------------------------------------------
1. The old driver/method  (all functions are delclared in the CPU head file.)
--------------------------------------------------------------------------------

long baud=115200;
int parity=0;
int stop=1;
int port=1;
int data;

InstallCom(port,baud,parity,stop);

while(IsCom(port)){
    data=ReadCom(port);
    ToCom(port,data);
    //...
}

RestoreCom(port);


--------------------------------------------------------------------------------
2. The new driver/method (all functions are delclared in OS7_COM.h .)
--------------------------------------------------------------------------------

long baud=115200;
int parity=0;
int stop=1;
OS7_COM *port;  // (a)modify the declaration
int data;

port=_InstallCom(COM_1,baud,parity,stop); // (b) add one under line.

while(_IsCom(port)){        // (b) add one under line.
    data=_ReadCom(port);    // (b) add one under line.
    _ToCom(port,data);      // (b) add one under line.
    //...
}

_RestoreCom(port);      // (b) add one under line.



================================================================================
FAQ6: How to Change input/output buffer size
================================================================================
Ans: The default size of the input/output buffers are 1024 bytes.
     To change the size, you can call _SetComPortBufferSize.
     For example: reduce the size to 256 bytes
        _SetComPortBufferSize(COM_2,256,256);
        port=_InstallCom(COM_2,baud,parity,stop);

    How to get size of the input/output buffers ?
        port->_InBufSize  <=== to kown the input buffer size.
        port->_OutBufSize <=== to know the output buffer size.



================================================================================
[OS7_COM Revision History]
================================================================================
Ver 1.0.0 [2010/04/02] first released
    (a) avalible for uPAC-5000 series
    (b) avalible for i-7186E/7188E/7188XB/7188XC series
    (c) avalible for COM1/COM2 of iView-100 (not tested)
    (d) avalible for the controller which has compatilbe HW of uPAC-7186EX
   
    Bugs Fixed:     none
    Change:         none
    New Functions:  none
    New Support:    none

--------------------------------------------------------------------------------

