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

📄 amd_flash_b.h

📁 摩托罗拉MMC2107在ucosII的移植代码
💻 H
📖 第 1 页 / 共 3 页
字号:
                                         (TargetPtr),                   \
                                         (Word)                         \
                                        )                               \
)

/************************************************************************/
/* Macro:       AMD_FLASH_B_GetManufacturerID                           */
/*                                                                      */
/* Purpose:     Call AMD_FLASH_B_GetManufacturerID_f                    */
/*              function with optional parameter checking.              */
/*                                                                      */
/*                                                                      */
/* Input:                                                               */
/*      AMD_FLASHPtr         : AMD Flash base address                   */
/*      ResultPtr            : Result address where the ID result goes  */
/*                                                                      */
/*                                                                      */
/* Output:                                                              */
/*    AMD_FLASH_B_ERR_NONE             : For successful completion      */
/*    AMD_FLASH_B_ERR_BAD_RESULT_ADDR  : BlankPtr address is zero       */
/************************************************************************/
#define AMD_FLASH_B_GetManufacturerID(                                  \
                                       AMD_FLASHPtr,                    \
                                       ResultPtr                        \
                                     )                                  \
(                                                                       \
    (AMD_FLASH_B_PARAM_CHECKING) ?                                      \
    (                                                                   \
        ((ResultPtr) == NULL) ?                                         \
            AMD_FLASH_B_ERR_BAD_RESULT_ADDR :                           \
       AMD_FLASH_B_GetManufacturerID_f(                                 \
                                        (AMD_FLASHPtr),                 \
                                        (ResultPtr)                     \
                                      )                                 \
    )                                                                   \
    :                                                                   \
       AMD_FLASH_B_GetManufacturerID_f(                                 \
                                        (AMD_FLASHPtr),                 \
                                        (ResultPtr)                     \
                                      )                                 \
)

/************************************************************************/
/* Macro:       AMD_FLASH_B_GetDeviceID                                 */
/*                                                                      */
/* Purpose:     Call AMD_FLASH_B_GetDeviceID_f                          */
/*              function with optional parameter checking.              */
/*                                                                      */
/*                                                                      */
/* Input:                                                               */
/*      AMD_FLASHPtr         : AMD Flash base address                   */
/*      ResultPtr            : Result address where the ID result goes  */
/*                                                                      */
/*                                                                      */
/* Output:                                                              */
/*    AMD_FLASH_B_ERR_NONE             : For successful completion      */
/*    AMD_FLASH_B_ERR_BAD_RESULT_ADDR  : BlankPtr address is zero       */
/************************************************************************/
#define AMD_FLASH_B_GetDeviceID(                                        \
                                  AMD_FLASHPtr,                         \
                                  ResultPtr                             \
                                )                                       \
(                                                                       \
    (AMD_FLASH_B_PARAM_CHECKING) ?                                      \
    (                                                                   \
        ((ResultPtr) == NULL) ?                                         \
            AMD_FLASH_B_ERR_BAD_RESULT_ADDR :                           \
       AMD_FLASH_B_GetDeviceID_f(                                       \
                                  (AMD_FLASHPtr),                       \
                                  (ResultPtr)                           \
                                )                                       \
    )                                                                   \
    :                                                                   \
       AMD_FLASH_B_GetDeviceID_f(                                       \
                                  (AMD_FLASHPtr),                       \
                                  (ResultPtr)                           \
                                )                                       \
)

/************************************************************************/
/* Macro:       AMD_FLASH_B_VerifySectorProtect                         */
/*                                                                      */
/* Purpose:     Call AMD_FLASH_B_VerifySectorProtect_f                  */
/*              function with optional parameter checking.              */
/*                                                                      */
/*                                                                      */
/* Input:                                                               */
/*      AMD_FLASHPtr         : AMD Flash base address                   */
/*      Sector               : The sector to check the protection on    */
/*      ResultPtr            : Result address where Boolean result goes */
/*                                                                      */
/*                                                                      */
/* Output:                                                              */
/*    AMD_FLASH_B_ERR_NONE             : For successful completion      */
/*    AMD_FLASH_B_ERR_BAD_RESULT_ADDR  : BlankPtr address is zero       */
/*    AMD_FLASH_B_ERR_INVALID_SECTOR: Sector given is not valid         */
/************************************************************************/
#define AMD_FLASH_B_VerifySectorProtect(                                \
                                            AMD_FLASHPtr,               \
                                            Sector,                     \
                                            ResultPtr                   \
                                          )                             \
(                                                                       \
    (AMD_FLASH_B_PARAM_CHECKING) ?                                      \
    (                                                                   \
        ((ResultPtr) == NULL) ?                                         \
            AMD_FLASH_B_ERR_BAD_RESULT_ADDR :                           \
        (((Sector) <  AMD_FLASH_B_SA0) ||                               \
         ((Sector) >  AMD_FLASH_B_SA18)) ?                              \
            AMD_FLASH_B_ERR_INVALID_SECTOR :                            \
        AMD_FLASH_B_VerifySectorProtect_f(                              \
                                             (AMD_FLASHPtr),            \
                                             (Sector),                  \
                                             (ResultPtr)                \
                                             )                          \
    )                                                                   \
    :                                                                   \
        AMD_FLASH_B_VerifySectorProtect_f(                              \
                                             (AMD_FLASHPtr),            \
                                             (Sector),                  \
                                             (ResultPtr)                \
                                             )                          \
)

/************************************************************************/
/* Macro:       AMD_FLASH_B_BlankCheck                                  */
/*                                                                      */
/* Purpose:     Call AMD_FLASH_B_BlankCheck_f function                  */
/*                with optional parameter checking.                     */
/*                                                                      */
/*                                                                      */
/* Input:                                                               */
/*      AMD_FLASHPtr         : AMD Flash base address                   */
/*      TargetPtr            : Target address where blankcheck occurs   */
/*      BlankPtr             : Result address where Boolean result goes */
/*                                                                      */
/*                                                                      */
/* Output:                                                              */
/*    AMD_FLASH_B_ERR_NONE             : For successful completion      */
/*    AMD_FLASH_B_ERR_BAD_RESULT_ADDR  : BlankPtr address is zero       */
/************************************************************************/
#define AMD_FLASH_B_BlankCheck(                                         \
                                 AMD_FLASHPtr,                          \
                                 TargetPtr,                             \
                                 BlankPtr                               \
                               )                                        \
(                                                                       \
    (AMD_FLASH_B_PARAM_CHECKING) ?                                      \
    (                                                                   \
        ((BlankPtr) == NULL) ?                                          \
            AMD_FLASH_B_ERR_BAD_RESULT_ADDR :                           \
        AMD_FLASH_B_BlankCheck_f( (AMD_FLASHPtr),                       \
                                  (TargetPtr),                          \
                                  (BlankPtr)                            \
                                )                                       \
    )                                                                   \
    :                                                                   \
        AMD_FLASH_B_BlankCheck_f( (AMD_FLASHPtr),                       \
                                  (TargetPtr),                          \
                                  (BlankPtr)                            \
                                )                                       \
)

/************************************************************************/
/* Macro:       AMD_FLASH_B_GetStatus                                   */
/*                                                                      */
/* Purpose:     Call AMD_FLASH_B_BlankCheck_f function                  */
/*                with optional parameter checking.                     */
/*                                                                      */
/*                                                                      */
/* Input:                                                               */
/*      AMD_FLASHPtr     : AMD Flash base address                       */
/*      TargetPtr        : target address of word to be checked         */
/*      ExpectedValue    : expected data value at TargetPtr             */
/*      ResultPtr        : result address where verify info is written  */
/*                                                                      */
/*                                                                      */
/* Output:                                                              */
/*    AMD_FLASH_B_ERR_NONE             : For successful completion      */
/*    AMD_FLASH_B_ERR_BAD_RESULT_ADDR  : ResultPtr address is zero      */
/************************************************************************/
#define AMD_FLASH_B_GetStatus(                                          \
                                 AMD_FLASHPtr,                          \
                                 TargetPtr,                             \
                                 ExpectedValue,                         \
                                 ResultPtr                              \
                               )                                        \
(                                                                       \
    (AMD_FLASH_B_PARAM_CHECKING) ?                                      \
    (                                                                   \
        ((ResultPtr) == NULL) ?                                         \
            AMD_FLASH_B_ERR_BAD_RESULT_ADDR :                           \
        AMD_FLASH_B_GetStatus_f( (AMD_FLASHPtr),                        \
                                 (TargetPtr),                           \
                                 (ExpectedValue),                       \
                                 (ResultPtr)                            \
                               )                                        \
    )                                                                   \
    :                                                                   \
        AMD_FLASH_B_GetStatus_f( (AMD_FLASHPtr),                        \
                                 (TargetPtr),                           \
                                 (ExpectedValue),                       \
                                 (ResultPtr)                            \
                                )                                       \
)

#endif
/* END */ 

⌨️ 快捷键说明

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