資源簡介
使用Windows實時擴展RTX的串口編程API及示例,大大提高了串口通信的實時性。

代碼片段和文件信息
//-----------------------------------------------------------------------------
//?Module:????????isr.c
//
//?Author:????????Dennis?De?Simone
//
//?Date:??????????November?1998
//
//?Description:???This?is?the?Interrupt?Service?Routine?of?a
//????????????????serial?port?device?driver?for?Venturcom‘s
//????????????????Real?Time?Extentions?(RTX).?
//?????????????????
//?Change?Log:
//?Date?????Person?????Code???Description
//?----?????-------????----???-----------
//?4/1/99???R.?Lee?????rl001??1)?changed?spurious?interrupt?test?in?function
//???????????????????????????????Isr()
//????????????????????????????2)?Added?Do?loop?around?interrupt?processing
//???????????????????????????????switch?to?check?for?pending?interrupt.???
//
//-----------------------------------------------------------------------------
#include?
#include?
#include?“..\inc\types.h“
#include?“..\inc\serial.h“
#include?“..\inc\serialAPI.h“
extern???UCB???ucbList[];
extern???BYTE??*pOutBuff;
COMSTATS???csb[2];
VOID??isr(?UCB?*ucb?);
VOID??SendNextFIFO?(?UCB?*ucb?);
VOID??EmptyFIFO?(?UCB?*ucb?);
void??RTFCNDCL?COM1Isr(?void?*junk)
//-----------------------------------------------------------
//?function:??????COM1Isr
//
//?description:???This?is?the?stub?ISR?for?COM1.?It?sets?up
//????????????????the?COM1?data?structures?and?registers?and
//????????????????passes?control?to?the?generic?COM?ISR
//------------------------------------------------------------
{
???isr(?&ucbList[COM1]?);
}
void??RTFCNDCL?COM2Isr(?void?*junk)
//-----------------------------------------------------------
//?function:??????COM2Isr
//
//?description:???This?is?the?styb?ISR?for?COM1.?It?sets?up
//????????????????the?COM1?data?structures?and?registers?and
//????????????????passes?control?to?the?generic?COM?ISR
//------------------------------------------------------------
{
???isr(?&ucbList[COM2]?);
}
?
void?isr(?UCB?*ucb?)
{
???BYTE??tempRegister;
??????
???//-----------------------------------------------
???//?Validate?the?interrupt?by?first?checking?if?
???//?we?had?one?pending.?If?we?did?then?handle?it
???//?in?the?appropriate?case?statement
???//------------------------------------------------
???
???tempRegister?=?RtReadPortUchar?(?ucb->baseAddress?+?UART_IIR?);
???
???//if?(??!(tempRegister?&&?IIR_NO_INT_PENDING)?)???????//**rl001
???if?(??tempRegister?&?IIR_NO_INT_PENDING?)?????????????//**rl001
???{
??????//-----------------------------------
??????//?unsolicited?interrupt?-?record?it
??????//?and?dismiss?it
??????//-----------------------------------
??????ucb->lastError?=?COM_PORT_UNSOLICITED_INTERRUPT;
??????ucb->errorCount++;
??????return;
???}
???//--------------------------------------
???//?**rl001
???//?added?‘do‘?logic?to?look?for?more?
???//?than?one?pending?interrupt
???//---------------------------------------
???do
???{
??????switch?(?tempRegister?&?0x0e??)
??????{
???
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????3470??1999-03-18?00:18??RTX?Serial?API\inc\RTXDispatch.h
?????文件???????8833??1999-04-05?04:53??RTX?Serial?API\inc\serial.h
?????文件???????5255??1999-06-11?13:40??RTX?Serial?API\inc\serialAPI.h
?????文件????????332??1998-12-13?12:26??RTX?Serial?API\inc\types.h
?????文件???????3626??1999-03-18?03:55??RTX?Serial?API\RtCOMLib\data.h
?????文件???????7293??2004-04-09?11:52??RTX?Serial?API\RtCOMLib\isr.c
?????文件???????3185??2004-04-09?13:16??RTX?Serial?API\RtCOMLib\RtCOM.dsp
?????文件????????535??2004-04-09?13:14??RTX?Serial?API\RtCOMLib\RtCOM.dsw
?????文件???????3767??2004-04-09?13:49??RTX?Serial?API\RtCOMLib\RtCOM.mak
?????文件??????23570??1999-06-11?13:41??RTX?Serial?API\RtCOMLib\serialAPI.c
?????文件?????215476??2011-08-26?23:08??RTX?Serial?API\RTX實時平臺實現RS232通訊.pdf
?????目錄??????????0??2011-08-27?01:25??RTX?Serial?API\inc
?????目錄??????????0??2011-08-27?01:25??RTX?Serial?API\RtCOMLib
?????目錄??????????0??2011-08-27?01:26??RTX?Serial?API
-----------?---------??----------?-----??----
???????????????275342????????????????????14
- 上一篇:單片機雙機通訊proteus仿真
- 下一篇:unity噴泉效果
評論
共有 條評論