• 大小: 201KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-06-09
  • 语言: 其他
  • 标签: RTX  RS232  串口编程  

资源简介

使用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


评论

共有 条评论