⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rocket_int.h

📁 powerpc内核mpc8241linux系统下char驱动程序
💻 H
📖 第 1 页 / 共 3 页
字号:
   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->TxControl[0]); \}/***************************************************************************Function: sClrRTSPurpose:  Clr the RTS outputCall:     sClrRTS(ChP)          CHANNEL_T *ChP; Ptr to channel structure*/#define sClrRTS(ChP) \{ \   (ChP)->TxControl[3] &= ~SET_RTS; \   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->TxControl[0]); \}/***************************************************************************Function: sClrTxXOFFPurpose:  Clear any existing transmit software flow control off conditionCall:     sClrTxXOFF(ChP)          CHANNEL_T *ChP; Ptr to channel structure*/#define sClrTxXOFF(ChP) \{ \   sOutB((ChP)->Cmd,TXOVERIDE | (Byte_t)(ChP)->ChanNum); \   sOutB((ChP)->Cmd,(Byte_t)(ChP)->ChanNum); \}/***************************************************************************Function: sCtlNumToCtlPtrPurpose:  Convert a controller number to controller structure pointerCall:     sCtlNumToCtlPtr(CtlNum)          int CtlNum; Controller numberReturn:   CONTROLLER_T *: Ptr to controller structure*/#define sCtlNumToCtlPtr(CTLNUM) &sController[CTLNUM]/***************************************************************************Function: sControllerEOIPurpose:  Strobe the MUDBAC's End Of Interrupt bit.Call:     sControllerEOI(CtlP)          CONTROLLER_T *CtlP; Ptr to controller structure*/#define sControllerEOI(CTLP) sOutB((CTLP)->MReg2IO,(CTLP)->MReg2 | INT_STROB)/***************************************************************************Function: sPCIControllerEOIPurpose:  Strobe the PCI End Of Interrupt bit.Call:     sPCIControllerEOI(CtlP)          CONTROLLER_T *CtlP; Ptr to controller structure*/#define sPCIControllerEOI(CTLP) sOutW((CTLP)->PCIIO, PCI_STROB)/***************************************************************************Function: sDisAiopPurpose:  Disable I/O access to an AIOPCall:     sDisAiop(CltP)          CONTROLLER_T *CtlP; Ptr to controller structure          int AiopNum; Number of AIOP on controller*/#define sDisAiop(CTLP,AIOPNUM) \{ \   (CTLP)->MReg3 &= sBitMapClrTbl[AIOPNUM]; \   sOutB((CTLP)->MReg3IO,(CTLP)->MReg3); \}/***************************************************************************Function: sDisCTSFlowCtlPurpose:  Disable output flow control using CTSCall:     sDisCTSFlowCtl(ChP)          CHANNEL_T *ChP; Ptr to channel structure*/#define sDisCTSFlowCtl(ChP) \{ \   (ChP)->TxControl[2] &= ~CTSFC_EN; \   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->TxControl[0]); \}/***************************************************************************Function: sDisIXANYPurpose:  Disable IXANY Software Flow ControlCall:     sDisIXANY(ChP)          CHANNEL_T *ChP; Ptr to channel structure*/#define sDisIXANY(ChP) \{ \   (ChP)->R[0x0e] = 0x86; \   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->R[0x0c]); \}/***************************************************************************Function: DisParityPurpose:  Disable parityCall:     sDisParity(ChP)          CHANNEL_T *ChP; Ptr to channel structureComments: Function sSetParity() can be used in place of functions sEnParity(),          sDisParity(), sSetOddParity(), and sSetEvenParity().*/#define sDisParity(ChP) \{ \   (ChP)->TxControl[2] &= ~PARITY_EN; \   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->TxControl[0]); \}/***************************************************************************Function: sDisRxFIFOPurpose:  Disable Rx FIFOCall:     sDisRxFIFO(ChP)          CHANNEL_T *ChP; Ptr to channel structure*/#define sDisRxFIFO(ChP) \{ \   (ChP)->R[0x32] = 0x0a; \   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->R[0x30]); \}/***************************************************************************Function: sDisRxStatusModePurpose:  Disable the Rx status modeCall:     sDisRxStatusMode(ChP)          CHANNEL_T *ChP; Ptr to channel structureComments: This takes the channel out of the receive status mode.  All          subsequent reads of receive data using sReadRxWord() will return          two data bytes.*/#define sDisRxStatusMode(ChP) sOutW((ChP)->ChanStat,0)/***************************************************************************Function: sDisTransmitPurpose:  Disable transmitCall:     sDisTransmit(ChP)          CHANNEL_T *ChP; Ptr to channel structure          This disables movement of Tx data from the Tx FIFO into the 1 byte          Tx buffer.  Therefore there could be up to a 2 byte latency          between the time sDisTransmit() is called and the transmit buffer          and transmit shift register going completely empty.*/#define sDisTransmit(ChP) \{ \   (ChP)->TxControl[3] &= ~TX_ENABLE; \   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->TxControl[0]); \}/***************************************************************************Function: sDisTxSoftFlowCtlPurpose:  Disable Tx Software Flow ControlCall:     sDisTxSoftFlowCtl(ChP)          CHANNEL_T *ChP; Ptr to channel structure*/#define sDisTxSoftFlowCtl(ChP) \{ \   (ChP)->R[0x06] = 0x8a; \   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->R[0x04]); \}/***************************************************************************Function: sEnAiopPurpose:  Enable I/O access to an AIOPCall:     sEnAiop(CltP)          CONTROLLER_T *CtlP; Ptr to controller structure          int AiopNum; Number of AIOP on controller*/#define sEnAiop(CTLP,AIOPNUM) \{ \   (CTLP)->MReg3 |= sBitMapSetTbl[AIOPNUM]; \   sOutB((CTLP)->MReg3IO,(CTLP)->MReg3); \}/***************************************************************************Function: sEnCTSFlowCtlPurpose:  Enable output flow control using CTSCall:     sEnCTSFlowCtl(ChP)          CHANNEL_T *ChP; Ptr to channel structure*/#define sEnCTSFlowCtl(ChP) \{ \   (ChP)->TxControl[2] |= CTSFC_EN; \   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->TxControl[0]); \}/***************************************************************************Function: sEnIXANYPurpose:  Enable IXANY Software Flow ControlCall:     sEnIXANY(ChP)          CHANNEL_T *ChP; Ptr to channel structure*/#define sEnIXANY(ChP) \{ \   (ChP)->R[0x0e] = 0x21; \   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->R[0x0c]); \}/***************************************************************************Function: EnParityPurpose:  Enable parityCall:     sEnParity(ChP)          CHANNEL_T *ChP; Ptr to channel structureComments: Function sSetParity() can be used in place of functions sEnParity(),          sDisParity(), sSetOddParity(), and sSetEvenParity().Warnings: Before enabling parity odd or even parity should be chosen using          functions sSetOddParity() or sSetEvenParity().*/#define sEnParity(ChP) \{ \   (ChP)->TxControl[2] |= PARITY_EN; \   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->TxControl[0]); \}/***************************************************************************Function: sEnRxFIFOPurpose:  Enable Rx FIFOCall:     sEnRxFIFO(ChP)          CHANNEL_T *ChP; Ptr to channel structure*/#define sEnRxFIFO(ChP) \{ \   (ChP)->R[0x32] = 0x08; \   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->R[0x30]); \}/***************************************************************************Function: sEnRxProcessorPurpose:  Enable the receive processorCall:     sEnRxProcessor(ChP)          CHANNEL_T *ChP; Ptr to channel structureComments: This function is used to start the receive processor.  When          the channel is in the reset state the receive processor is not          running.  This is done to prevent the receive processor from          executing invalid microcode instructions prior to the          downloading of the microcode.Warnings: This function must be called after valid microcode has been          downloaded to the AIOP, and it must not be called before the          microcode has been downloaded.*/#define sEnRxProcessor(ChP) \{ \   (ChP)->RxControl[2] |= RXPROC_EN; \   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->RxControl[0]); \}/***************************************************************************Function: sEnRxStatusModePurpose:  Enable the Rx status modeCall:     sEnRxStatusMode(ChP)          CHANNEL_T *ChP; Ptr to channel structureComments: This places the channel in the receive status mode.  All subsequent          reads of receive data using sReadRxWord() will return a data byte          in the low word and a status byte in the high word.*/#define sEnRxStatusMode(ChP) sOutW((ChP)->ChanStat,STATMODE)/***************************************************************************Function: sEnTransmitPurpose:  Enable transmitCall:     sEnTransmit(ChP)          CHANNEL_T *ChP; Ptr to channel structure*/#define sEnTransmit(ChP) \{ \   (ChP)->TxControl[3] |= TX_ENABLE; \   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->TxControl[0]); \}/***************************************************************************Function: sEnTxSoftFlowCtlPurpose:  Enable Tx Software Flow ControlCall:     sEnTxSoftFlowCtl(ChP)          CHANNEL_T *ChP; Ptr to channel structure*/#define sEnTxSoftFlowCtl(ChP) \{ \   (ChP)->R[0x06] = 0xc5; \   sOutDW((ChP)->IndexAddr,*(DWord_t *)&(ChP)->R[0x04]); \}/***************************************************************************Function: sGetAiopIntStatusPurpose:  Get the AIOP interrupt statusCall:     sGetAiopIntStatus(CtlP,AiopNum)          CONTROLLER_T *CtlP; Ptr to controller structure          int AiopNum; AIOP numberReturn:   Byte_t: The AIOP interrupt status.  Bits 0 through 7                         represent channels 0 through 7 respectively.  If a                         bit is set that channel is interrupting.*/#define sGetAiopIntStatus(CTLP,AIOPNUM) sInB((CTLP)->AiopIntChanIO[AIOPNUM])/***************************************************************************Function: sGetAiopNumChanPurpose:  Get the number of channels supported by an AIOPCall:     sGetAiopNumChan(CtlP,AiopNum)          CONTROLLER_T *CtlP; Ptr to controller structure          int AiopNum; AIOP numberReturn:   int: The number of channels supported by the AIOP*/#define sGetAiopNumChan(CTLP,AIOPNUM) (CTLP)->AiopNumChan[AIOPNUM]/***************************************************************************Function: sGetChanIntIDPurpose:  Get a channel's interrupt identification byteCall:     sGetChanIntID(ChP)          CHANNEL_T *ChP; Ptr to channel structureReturn:   Byte_t: The channel interrupt ID.  Can be any             combination of the following flags:                RXF_TRIG:     Rx FIFO trigger level interrupt                TXFIFO_MT:    Tx FIFO empty interrupt                SRC_INT:      Special receive condition interrupt                DELTA_CD:     CD change interrupt                DELTA_CTS:    CTS change interrupt                DELTA_DSR:    DSR change interrupt*/#define sGetChanIntID(ChP) (sInB((ChP)->IntID) & (RXF_TRIG | TXFIFO_MT | SRC_INT | DELTA_CD | DELTA_CTS | DELTA_DSR))/***************************************************************************Function: sGetChanNumPurpose:  Get the number of a channel within an AIOPCall:     sGetChanNum(ChP)          CHANNEL_T *ChP; Ptr to channel structureReturn:   int: Channel number within AIOP, or NULLCHAN if channel does               not exist.*/#define sGetChanNum(ChP) (ChP)->ChanNum/***************************************************************************Function: sGetChanStatusPurpose:  Get the channel statusCall:     sGetChanStatus(ChP)          CHANNEL_T *ChP; Ptr to channel structureReturn:   Word_t: The channel status.  Can be any combination of             the following flags:                LOW BYTE FLAGS                CTS_ACT:      CTS input asserted                DSR_ACT:      DSR input asserted                CD_ACT:       CD input asserted                TXFIFOMT:     Tx FIFO is empty                TXSHRMT:      Tx shift register is empty                RDA:          Rx data available                HIGH BYTE FLAGS                STATMODE:     status mode enable bit                RXFOVERFL:    receive FIFO overflow                RX2MATCH:     receive compare byte 2 match                RX1MATCH:     receive compare byte 1 match                RXBREAK:      received BREAK                RXFRAME:      received framing error                RXPARITY:     received parity errorWarnings: This function will clear the high byte flags in the Channel          Status Register.*/#define sGetChanStatus(ChP) sInW((ChP)->ChanStat)/***************************************************************************Function: sGetChanStatusLoPurpose:  Get the low byte only of the channel statusCall:     sGetChanStatusLo(ChP)          CHANNEL_T *ChP; Ptr to channel structureReturn:   Byte_t: The channel status low byte.  Can be any combination             of the following flags:                CTS_ACT:      CTS input asserted                DSR_ACT:      DSR input asserted                CD_ACT:       CD input asserted                TXFIFOMT:     Tx FIFO is empty                TXSHRMT:      Tx shift register is empty                RDA:          Rx data available*/#define sGetChanStatusLo(ChP) sInB((ByteIO_t)(ChP)->ChanStat)/***************************************************************************Function: sGetControllerIntStatusPurpose:  Get the controller interrupt statusCall:     sGetControllerIntStatus(CtlP)          CONTROLLER_T *CtlP; Ptr to controller structureReturn:   Byte_t: The controller interrupt status in the lower 4                         bits.  Bits 0 through 3 represent AIOP's 0                         through 3 respectively.  If a bit is set that                         AIOP is interrupting.  Bits 4 through 7 will                         always be cleared.*/#define sGetControllerIntStatus(CTLP) (sInB((CTLP)->MReg1IO) & 0x0f)/***************************************************************************Function: sPCIGetControllerIntStatusPurpose:  Get the controller interrupt statusCall:     sPCIGetControllerIntStatus(CtlP)          CONTROLLER_T *CtlP; Ptr to controller structureReturn:   unsigned char: The controller interrupt status in the lower 4                         bits and bit 4.  Bits 0 through 3 represent AIOP's 0                         through 3 respectively. Bit 4 is set if the int 			 was generated from periodic. If a bit is set the			 AIOP is interrupting.*/#define sPCIGetControllerIntStatus(CTLP) ((sInW((CTLP)->PCIIO) >> 8) & 0x1f)/***************************************************************************Function: sGetRxCntPurpose:  Get the number of data bytes in the Rx FIFOCall:     sGetRxCnt(ChP)          CHANNEL_T *ChP; Ptr to channel structureReturn:   int: The number of data bytes in the Rx FIFO.Comments: Byte read of count register is required to obtain Rx count.*/#define sGetRxCnt(ChP) sInW((ChP)->TxRxCount)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -