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

📄 sci_d.h

📁 摩托罗拉MMC2107在ucosII的移植代码
💻 H
📖 第 1 页 / 共 5 页
字号:
/*                                                                      */
/*----------------------------------------------------------------------*/
#define SCI_D_ControlInterrupt( SCIPtr,                              \
                                transmitterInt,                      \
                                transCompleteInt,                    \
                                receiverInt,                         \
                                idleLineInt                          \
                              )                                      \
(                                                                    \
   (SCI_D_PARAM_CHECKING) ?                                          \
   (                                                                 \
      ((SCIPtr) == NULL) ?                                           \
        SCI_D_ERR_INVALID_HANDLE :                                   \
      (((transmitterInt) < SCI_D_DISABLE) ||                         \
       ((transmitterInt) > SCI_D_NO_CHANGE)) ?                       \
        SCI_D_ERR_INVALID_CONTROL :                                  \
      (((transCompleteInt) < SCI_D_DISABLE) ||                       \
       ((transCompleteInt) > SCI_D_NO_CHANGE)) ?                     \
        SCI_D_ERR_INVALID_CONTROL :                                  \
      (((receiverInt) < SCI_D_DISABLE) ||                            \
       ((receiverInt) > SCI_D_NO_CHANGE)) ?                          \
        SCI_D_ERR_INVALID_CONTROL :                                  \
      (((idleLineInt) < SCI_D_DISABLE) ||                            \
       ((idleLineInt) > SCI_D_NO_CHANGE)) ?                          \
        SCI_D_ERR_INVALID_CONTROL :                                  \
      SCI_D_ControlInterrupt_f ( (SCIPtr),                           \
                                 (transmitterInt),                   \
                                 (transCompleteInt),                 \
                                 (receiverInt),                      \
                                 (idleLineInt)                       \
                               )                                     \
   )                                                                 \
   :                                                                 \
      SCI_D_ControlInterrupt_f ( (SCIPtr),                           \
                                 (transmitterInt),                   \
                                 (transCompleteInt),                 \
                                 (receiverInt),                      \
                                 (idleLineInt)                       \
                               )                                     \
) /* end of SCI_D_ControlInterrupt Macro */


/*----------------------------------------------------------------------*/
/* Macro:       SCI_D_Transmit                                          */
/*                                                                      */
/* Purpose:     Call SCI_D_Transmit_f function with optional            */
/*              parameter checking.                                     */
/*                                                                      */
/* Input:                                                               */
/*   SCIPtr              : SCI base address associated with this driver */
/*   dataVal             : Data value to transmit                       */
/*   transmitDataPending : Result address for tranmission status        */
/*                                                                      */
/* Output:                                                              */
/*   SCI_D_ERR_NONE                  : No error.                        */
/*   SCI_D_ERR_INVALID_HANDLE        : SCI base address parameter is    */
/*                                   : zero.                            */
/*   SCI_D_ERR_INVALID_DATA_VALUE    : Data value to transmit           */
/*   SCI_D_ERR_BAD_RESULT_ADDR       : Result pointer is zero           */
/*                                                                      */
/*----------------------------------------------------------------------*/
#define SCI_D_Transmit( SCIPtr,                                      \
                        dataVal,                                     \
                        transmitDataPending                          \
                      )                                              \
(                                                                    \
   (SCI_D_PARAM_CHECKING) ?                                          \
   (                                                                 \
      ((SCIPtr) == NULL) ?                                           \
        SCI_D_ERR_INVALID_HANDLE :                                   \
      ((transmitDataPending) == NULL) ?                              \
        SCI_D_ERR_BAD_RESULT_ADDR :                                  \
      SCI_D_Transmit_f ( (SCIPtr),                                   \
                         (dataVal),                                  \
                         (transmitDataPending)                       \
                       )                                             \
   )                                                                 \
   :                                                                 \
      SCI_D_Transmit_f ( (SCIPtr),                                   \
                         (dataVal),                                  \
                         (transmitDataPending)                       \
                       )                                             \
) /* end of SCI_D_Transmit Macro */


/*----------------------------------------------------------------------*/
/* Macro:       SCI_D_Receive                                           */
/*                                                                      */
/* Purpose:     Call SCI_D_Receive_f function with optional             */
/*              parameter checking.                                     */
/*                                                                      */
/* Input:                                                               */
/*   SCIPtr              : SCI base address associated with this driver */
/*   dataPtr             : Result address for received data             */
/*   StatusPtr           : Result address for status structure          */
/*                                                                      */
/* Output:                                                              */
/*   SCI_D_ERR_NONE                  : No error.                        */
/*   SCI_D_ERR_INVALID_HANDLE        : SCI base address parameter is    */
/*                                   : zero.                            */
/*   SCI_D_ERR_BAD_RESULT_ADDR       : Result pointer is zero           */
/*                                                                      */
/*----------------------------------------------------------------------*/
#define SCI_D_Receive( SCIPtr,                                      \
                       dataPtr,                                     \
                       StatusPtr                                    \
                     )                                              \
(                                                                   \
   (SCI_D_PARAM_CHECKING) ?                                         \
   (                                                                \
      ((SCIPtr) == NULL) ?                                          \
        SCI_D_ERR_INVALID_HANDLE :                                  \
      ((dataPtr) == NULL) ?                                         \
        SCI_D_ERR_BAD_RESULT_ADDR :                                 \
      ((StatusPtr) == NULL) ?                                       \
        SCI_D_ERR_BAD_RESULT_ADDR :                                 \
      SCI_D_Receive_f ( (SCIPtr),                                   \
                         (dataPtr),                                 \
                         (StatusPtr)                                \
                       )                                            \
   )                                                                \
   :                                                                \
      SCI_D_Receive_f ( (SCIPtr),                                   \
                         (dataPtr),                                 \
                         (StatusPtr)                                \
                       )                                            \
) /* end of SCI_D_Receive Macro */




/*----------------------------------------------------------------------*/
/* Macro:       SCI_D_ControlBreak                                      */
/*                                                                      */
/* Purpose:     Call SCI_D_ControlBreak_f function with optional        */
/*              parameter checking.                                     */
/*                                                                      */
/* Input:                                                               */
/*   SCIPtr              : SCI base address associated with this driver */
/*   controlBreak        : Control sending of break characters          */
/*                                                                      */
/* Output:                                                              */
/*   SCI_D_ERR_NONE                  : No error.                        */
/*   SCI_D_ERR_INVALID_HANDLE        : SCI base address parameter is    */
/*                                   : zero.                            */
/*   SCI_D_ERR_INVALID_CONTROL       : Not a valid control selection    */
/*                                                                      */
/*----------------------------------------------------------------------*/
#define SCI_D_ControlBreak( SCIPtr,                                 \
                            controlBreak                            \
                          )                                         \
(                                                                   \
   (SCI_D_PARAM_CHECKING) ?                                         \
   (                                                                \
      ((SCIPtr) == NULL) ?                                          \
        SCI_D_ERR_INVALID_HANDLE :                                  \
      (((controlBreak) < SCI_D_DISABLE) ||                          \
       ((controlBreak) > SCI_D_ENABLE)) ?                           \
        SCI_D_ERR_INVALID_CONTROL :                                 \
      SCI_D_ControlBreak_f ( (SCIPtr),                              \
                             (controlBreak)                         \
                           )                                        \
   )                                                                \
   :                                                                \
      SCI_D_ControlBreak_f ( (SCIPtr),                              \
                             (controlBreak)                         \
                           )                                        \
) /* end of SCI_D_ControlBreak Macro */


/*----------------------------------------------------------------------*/
/* Macro:       SCI_D_ControlLoopback                                   */
/*                                                                      */
/* Purpose:     Call SCI_D_ControlLoopback_f function with optional     */
/*              parameter checking.                                     */
/*                                                                      */
/* Input:                                                               */
/*   SCIPtr              : SCI base address associated with this driver */
/*   controlLoopback     : Control sending of break characters          */
/*   recSourceValue      : Receiver source type                         */
/*   transDirValue       : Transmitter direction value                  */
/*   recDirValue         : Receiver direction value                     */
/*   pinModeValue        : Pin mode value                               */
/*                                                                      */
/* Output:                                                              */
/*   SCI_D_ERR_NONE                    : No error.                      */
/*   SCI_D_ERR_INVALID_HANDLE          : SCI base address parameter is  */
/*                                     : zero.                          */
/*   SCI_D_ERR_INVALID_CONTROL         : Not a valid control selection  */
/*   SCI_D_ERR_INVALID_RECEIVER_SOURCE : Receiver source is invalid     */
/*   SCI_D_ERR_INVALID_DATA_DIRECTION  : Port data direction is invalid */
/*   SCI_D_ERR_INVALID_PIN_MODE        : Pin mode is invalid            */
/*                                                                      */
/*----------------------------------------------------------------------*/
#define SCI_D_ControlLoopback( SCIPtr,                              \
                               controlLoopback,                     \
                               recSourceValue,                      \
                               transDirValue,                       \
                               recDirValue,                         \
                               pinModeValue                         \
                             )                                      \
(                                                                   \
   (SCI_D_PARAM_CHECKING) ?                                         \
   (                                                                \
      ((SCIPtr) == NULL) ?                                          \
        SCI_D_ERR_INVALID_HANDLE :                                  \
      (((controlLoopback) < SCI_D_DISABLE) ||                       \
       ((controlLoopback) > SCI_D_NO_CHANGE)) ?                     \
        SCI_D_ERR_INVALID_CONTROL :                                 \
      (((recSourceValue) < SCI_D_RECSOURCE_LOOP) ||                 \
       ((recSourceValue) > SCI_D_RECSOURCE_WIRE)) ?                 \
        SCI_D_ERR_INVALID_RECEIVER_SOURCE :                         \
      (((transDirValue) < SCI_D_DATADIR_INPUT) ||                   \
       ((transDirValue) > SCI_D_DATADIR_OUTPUT)) ?                  \
        SCI_D_ERR_INVALID_DATA_DIRECTION :                          \
      (((recDirValue) < SCI_D_DATADIR_INPUT) ||                     \
       ((recDirValue) > SCI_D_DATADIR_OUTPUT)) ?                    \
        SCI_D_ERR_INVALID_DATA_DIRECTION :                          \
      (((pinModeValue) < SCI_D_PINMODE_CMOS) ||                     \
       ((pinModeValue) > SCI_D_PINMODE_OPEN_DRAIN)) ?               \
        SCI_D_ERR_INVALID_PIN_MODE :                                \
      SCI_D_ControlLoopback_f ( (SCIPtr),                           \
                                (controlLoopback),                  \
                                (recSourceValue),                   \
                                (transDirValue),                    \
                                (recDirValue),                      \
                                (pinModeValue)                      \
                              )                                     \
   )                                                                \
   :                                                                \
      SCI_D_ControlLoopback_f ( (SCIPtr),                           \
                                (controlLoopback),                  \
                                (recSourceValue),                   \
                                (transDirValue),                    \
                                (recDirValue),                      \
                                (pinModeValue)                      \
                              )                                     \
) /* end of SCI_D_ControlLoopback Macro */


⌨️ 快捷键说明

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