/*******************************************************/ /* */ /* Library for I-7188XB. */ /* */ /*******************************************************/ Important notice: (A) must call InitLib(); first. Ver 2.12 [2012/09/17] 1.Fixed: Fix bug for COM1/COM2. Setting the data bit of data format to 7. If the transmit data is more than 127, the transmit data will be incorrect. 2.Added: X-board support 16c850 Ver 2.10 [2011/12/08] 1.Added: Add two functions: void Delay2_1(unsigned ms); void Delay2_2(unsigned ms); [2010/09/08] 1.Enhanced: Adjust the optimization of BC++ 3.1 and re-compiler the library. 2.Enhanced: Enhance for ToComBufn_x(). [2010/08/25] 1.Enhanced: Enhance for com port ISR. ==> Add _asm cld; [2010/08/03] 1.Added: Support OS7_COM.lib Ver 1.1.0 2.Added: Add thirteen functions: void Delay0(unsigned ms); void Delay1(unsigned ms); void Delay0_1(unsigned ms); void Delay1_1(unsigned ms); void Delay0_2(unsigned ms); void Delay1_2(unsigned ms); void Delay2(unsigned ms); int InstallUserTimer0Function_us(unsigned time,void (*fun)(void)); int InstallUserTimer0Function_ms(unsigned time,void (*fun)(void)); void StopUserTimer0Fun(void); int InstallUserTimer1Function_us(unsigned time,void (*fun)(void)); int InstallUserTimer1Function_ms(unsigned time,void (*fun)(void)); void StopUserTimer1Fun(void); Ver 2.09 [2009/07/30] 1.Added: Support new data format 8N2/8M1/8S1 for COM1/COM2. Ver 2.08 [2008/01/09] 1.Fixed: Fix bug for ToComBufn()/ToComStr()/printCom. Ver 2.07 [2008/01/09] 1.Enhanced: Enhance EE_WiteProtect() Ver 2.06 [2007/09/20] 1.Added: Add a code about LSR error. [2007/09/05] 1.Modified: Change the type of trigger of interrupt of X-board to level trigger. [2007/07/24] 1.Fixed: Fix bug for the return value of ToComBufn() Ver 2.05 1.Added:Add three functions unsigned GetOsLibVersion(void); char *GetOsLibDate(void); char *GetOsLibName(void); Ver 2.04 1.Added: Add some COM port functions about MSR/trigger level/MCR... Ver 2.03 1.Fixed: Fix bug for the data loss problem of COM1/COM2 by using Com port DMA functions. Ver 2.01 [2005/07/05] [7188xb_lib_050705.zip] 1.Added:Add functions for the EEPROm on the X-board. (XEE_nnnn() series functions.) These functions will be used in the X-board library. [2005/05/27] 1.Added:Add two functions: int SetDelayTimer(int no); int SetUserTimer(int no); for seting the timer used by the delay functions: Delay()/Delay_1()/Delay_2() & InstallUserTimerFunction_us()/InstallUserTimerFunction_ms(). By defualt all these functions will use timer 0, Now it can be set to use timer 1. [2005/04/08] 1.Modified: InitLib() will not call the function "setvbuf(stdout,NULL,_IONBF,0);" Because it is compatible with MSC/MSVC++. So user want to use "printf()" with TC/BC++ must add "setvbuf(stdout,NULL,_IONBF,0);" in his program. [2005/03/04] 1.Added:Add small model version library. (7188XBS.LIB) [2004/10/13] 1.Added:Add the function GetSerialNumber(). [2004/09/09] 1.Added:Add "setvbuf(stdout,NULL,_IONBF,0);" to the function InitLib(). Then user's program can call printf()/puts() & work well. (The OS need update to the date 2004/09/09 or later. Old version also will work, but will lost the last byte it print out.) 2.Added:Add a variable "bLfMode" for Putch()/Puts()/Print(). when bLfMode is set to 1, these functions will translate '\n' to '\r'+'\n'. The default value of bLfMode is set to 0. [2004/08/02] 1.Fixed: fix bug for COM6/7/8 for put input data to input buffer. 2.Added: add function AllocateTopMemory(). 3.Added: add function CmdToArg(). 4.Added: add functions for COM3/4/5 to read MSR/set MCR on 16C550. [2004/07/05] 1.Fixed: fix bug for ReadComn_3()/ReadComn_4()/ReadComn_5()/ReadComn_6()/ReadComn_7()/ReadComn_8() [2004/06/01] 1.Fixed: fix bug for GetDi1(). [2004/03/08] [Ver 2.01] 1.Fixed: fix bug for EnableWDT()/DisableWDT(). ================================================================================ [Chinese Big5]------------------------------------------------------------------ == [改版說明] ================================================================== Ver 2.12 [2012/09/17] 1. 修正COM3/COM4的bug. 設定data bit為7,當要傳送的字元是大於127時,傳送的資料會是錯的。 2. X-board援16c850 Ver 2.10 [2011/12/08] 1.增加二個函數: void Delay2_1(unsigned ms); void Delay2_2(unsigned ms); [2010/09/08] 1.調整BC++3.1的最佳化設定和重新編譯library. 2.改善ToComBufn_x()函數. [2010/08/25] 1.在com port ISR的程式碼中加入_asm cld. [2010/08/03] 1.支援OS7_COM.lib Ver 1.1.0 2.增加13個函數: void Delay0(unsigned ms); void Delay1(unsigned ms); void Delay0_1(unsigned ms); void Delay1_1(unsigned ms); void Delay0_2(unsigned ms); void Delay1_2(unsigned ms); void Delay2(unsigned ms); int InstallUserTimer0Function_us(unsigned time,void (*fun)(void)); int InstallUserTimer0Function_ms(unsigned time,void (*fun)(void)); void StopUserTimer0Fun(void); int InstallUserTimer1Function_us(unsigned time,void (*fun)(void)); int InstallUserTimer1Function_ms(unsigned time,void (*fun)(void)); void StopUserTimer1Fun(void); Ver 2.09 [2009/07/30] 1.COM1/COM2支援新的data format 8N2/8M1/8S1. Ver 2.08 [2008/01/09] 1.修正ToComBufn()/ToComStr()/printCom的bug Ver 2.07 [2008/01/09] 1.改善EE_WiteProtect() Ver 2.06 [2007/09/20] 1.修改LSR error的程式碼. [2007/09/05] 1.X-board 的UART中斷改用level trigger. [2007/07/24] 1.ToComBufn()的return值修正為送出data的byte 數 Ver 2.05 1.增加三個函數 unsigned GetOsLibVersion(void); char *GetOsLibDate(void); char *GetOsLibName(void); Ver 2.04 1.加上一些 com port 的副程式(跟 MSR/trigger level/MCR... 等有關)。 Ver 2.03 1.修正 COM1/2 使用 DMA 可能會掉 data 的問題。 Ver 2.01 [2005/07/05] [7188xb_lib_050705.zip] 1.增加可用於X-board的EEPROM函數 (XEE_nnnn() 系列函數.) 這些函數將會使用在X-board library. [2005/05/27] 1.增加二個函數: int SetDelayTimer(int no); int SetUserTimer(int no); [2005/03/04] 1.增加small model版本的library. (7188XBS.LIB) [2004/10/13] 1.增加GetSerialNumber()函數. [2004/09/09] 1.增加一個變數"bLfMode",會影響Putch()/Puts()/Print(). 當設定bLfMode為1, Putch()/Puts()/Print()會在傳送'\n'時,變成傳送'\r'+'\n'. 預設bLfMode是設為0. [2004/08/02] 1.修正COM6/7/8接收資料的bug. 2.增加AllocateTopMemory()函數 3.a增加CmdToArg()函數. 4.增加COM3/4/5讀取和設定16c550上的MSR和MCR的函數. [2004/07/05] 1.修正ReadComn_3()/ReadComn_4()/ReadComn_5()/ReadComn_6()/ReadComn_7()/ReadComn_8()的bug [2004/06/01] 1.修正GetDi1()的bug. [2004/03/08] [Ver 2.01] 1.修正EnableWDT()/DisableWDT()的bug.