📄 moto_flash_a.h
字号:
MOTO_FLASH_A_ERR_INVALID_ADDRESS : \
((EndAddress) == NULL) ? MOTO_FLASH_A_ERR_INVALID_ADDRESS : \
(((DataWidth) != MOTO_FLASH_A_2_BYTES) && \
((DataWidth) != MOTO_FLASH_A_4_BYTES)) ? \
MOTO_FLASH_A_ERR_INVALID_DATA_WIDTH : \
MOTO_FLASH_A_BlankCheck_f((StartAddress), \
(EndAddress), \
(DataWidth) ) \
) \
: \
MOTO_FLASH_A_BlankCheck_f((StartAddress), \
(EndAddress), \
(DataWidth) ) \
)/* End of MOTO_FLASH_A_BlankCheck Macro */
/**********************************************************************/
/* Function: MOTO_FLASH_A_ControlArrayAccess */
/* */
/* Purpose: Call MOTO_FLASH_A_ControlArrayAccess_f with optional */
/* parameter checking. */
/* */
/* Input: */
/* MOTO_FLASH_A_Ptr : FLASH register block base address */
/* ArrayAccess : Specifies whether array access is */
/* locked or unlocked */
/* */
/* Output: */
/* MOTO_FLASH_A_ERR_NONE : For successful completion */
/* MOTO_FLASH_A_ERR_INVALID_MODE : ArrayAccess input is invalid */
/**********************************************************************/
#define MOTO_FLASH_A_ControlArrayAccess(MOTO_FLASH_A_Ptr, \
ArrayAccess ) \
( \
(MOTO_FLASH_A_PARAM_CHECKING) ? \
( \
((MOTO_FLASH_A_Ptr) == NULL) ? MOTO_FLASH_A_ERR_INVALID_HANDLE : \
(((ArrayAccess) != MOTO_FLASH_A_ENABLE) && \
((ArrayAccess) != MOTO_FLASH_A_DISABLE)) ? \
MOTO_FLASH_A_ERR_INVALID_MODE : \
MOTO_FLASH_A_ControlArrayAccess_f( (MOTO_FLASH_A_Ptr), \
(ArrayAccess) \
) \
) \
: \
MOTO_FLASH_A_ControlArrayAccess_f( (MOTO_FLASH_A_Ptr), \
(ArrayAccess) \
) \
)/* End of MOTO_FLASH_A_ControlArrayAccess Macro */
/**********************************************************************/
/* Function: MOTO_FLASH_A_ControlWriteLock */
/* */
/* Purpose: Call MOTO_FLASH_A_ControlWriteLock_f with optional */
/* parameter checking. */
/* */
/* Input: */
/* MOTO_FLASH_A_Ptr : FLASH register block base address */
/* LockControl : Specifies lock mode of operation */
/* */
/* Output: */
/* MOTO_FLASH_A_ERR_NONE : For successful completion */
/* MOTO_FLASH_A_ERR_INVALID_MODE : ArrayAccess input is invalid */
/**********************************************************************/
#define MOTO_FLASH_A_ControlWriteLock(MOTO_FLASH_A_Ptr, \
ArrayAccess ) \
( \
(MOTO_FLASH_A_PARAM_CHECKING) ? \
( \
((MOTO_FLASH_A_Ptr) == NULL) ? MOTO_FLASH_A_ERR_INVALID_HANDLE : \
(((ArrayAccess) != MOTO_FLASH_A_LOCK) && \
((ArrayAccess) != MOTO_FLASH_A_UNLOCK)) ? \
MOTO_FLASH_A_ERR_INVALID_MODE : \
MOTO_FLASH_A_ControlWriteLock_f( (MOTO_FLASH_A_Ptr), \
(ArrayAccess) \
) \
) \
: \
MOTO_FLASH_A_ControlWriteLock_f( (MOTO_FLASH_A_Ptr), \
(ArrayAccess) \
) \
)/* End of MOTO_FLASH_A_ControlArrayAccess Macro */
/**********************************************************************/
/* Function: MOTO_FLASH_A_ControlArrayWriteMode */
/* */
/* Purpose: Call MOTO_FLASH_A_ControlArrayWriteMode_f with */
/* optional parameter checking. */
/* */
/* Input: */
/* MOTO_FLASH_A_Ptr : FLASH register block base address */
/* WriteMode : Specifies Program or erase write mode */
/* */
/* Output: */
/* MOTO_FLASH_A_ERR_NONE : For successful completion */
/* MOTO_FLASH_A_ERR_INVALID_CYCLE_TYPE : WriteMode input is invalid*/
/**********************************************************************/
#define MOTO_FLASH_A_ControlArrayWriteMode(MOTO_FLASH_A_Ptr, \
WriteMode ) \
( \
(MOTO_FLASH_A_PARAM_CHECKING) ? \
( \
((MOTO_FLASH_A_Ptr) == NULL) ? MOTO_FLASH_A_ERR_INVALID_HANDLE : \
(((WriteMode) != MOTO_FLASH_A_PROGRAM) && \
((WriteMode) != MOTO_FLASH_A_ERASE)) ? \
MOTO_FLASH_A_ERR_INVALID_CYCLE_TYPE : \
MOTO_FLASH_A_ControlArrayWriteMode_f( (MOTO_FLASH_A_Ptr), \
(WriteMode) \
) \
) \
: \
MOTO_FLASH_A_ControlArrayWriteMode_f( (MOTO_FLASH_A_Ptr), \
(WriteMode) \
) \
)/* End of MOTO_FLASH_A_ControlArrayWriteMode Macro */
/**********************************************************************/
/* Function: MOTO_FLASH_A_ControlBlockProtection */
/* */
/* Purpose: Call MOTO_FLASH_A_ControlBlockProtection_f with */
/* optional parameter checking. */
/* */
/* Input: */
/* MOTO_FLASH_A_Ptr : FLASH register block base address */
/* BlocksToProtect : Specifies block(s) to modify */
/* ReadWriteProtection : Specifies read/write mode */
/* PrivledgeProtection : Specifies block privledges */
/* TextDataProtection : Specifies block data properties */
/* */
/* Output: */
/* MOTO_FLASH_A_ERR_NONE : For successful completion */
/* MOTO_FLASH_A_ERR_INVALID_BLOCK_CONFIG : Block input invalid */
/* MOTO_FLASH_A_ERR_INVALID_PROTECTION : Protection mode invalid */
/**********************************************************************/
#define MOTO_FLASH_A_ControlBlockProtection(MOTO_FLASH_A_Ptr, \
BlocksToProtect, \
ReadWriteProtection, \
PrivledgeProtection, \
TextDataProtection) \
( \
(MOTO_FLASH_A_PARAM_CHECKING) ? \
( \
((MOTO_FLASH_A_Ptr) == NULL) ? MOTO_FLASH_A_ERR_INVALID_HANDLE : \
(((BlocksToProtect) > MOTO_FLASH_A_ALL_BLOCKS) || \
((BlocksToProtect) <= 0)) ? \
MOTO_FLASH_A_ERR_INVALID_BLOCK_CONFIG : \
(((ReadWriteProtection) != MOTO_FLASH_A_READ_ONLY) && \
((ReadWriteProtection) != MOTO_FLASH_A_READ_WRITE) && \
((ReadWriteProtection) != \
MOTO_FLASH_A_NO_READ_WRITE_PROTECTION_CHANGE)) ? \
MOTO_FLASH_A_ERR_INVALID_PROTECTION : \
(((PrivledgeProtection) != MOTO_FLASH_A_USER_ACCESS) && \
((PrivledgeProtection) != MOTO_FLASH_A_SUPERVISOR_ACCESS) && \
((PrivledgeProtection) != \
MOTO_FLASH_A_NO_PRIVILEGE_CHANGE)) ? \
MOTO_FLASH_A_ERR_INVALID_PROTECTION : \
(((TextDataProtection) != MOTO_FLASH_A_DATA_ACCESS) && \
((TextDataProtection) != MOTO_FLASH_A_TEXT_AND_DATA_ACCESS) && \
((TextDataProtection) != \
MOTO_FLASH_A_NO_TEXT_DATA_PROTECTION_CHANGE)) ? \
MOTO_FLASH_A_ERR_INVALID_PROTECTION : \
MOTO_FLASH_A_ControlBlockProtection_f( (MOTO_FLASH_A_Ptr), \
(BlocksToProtect), \
(ReadWriteProtection), \
(PrivledgeProtection), \
(TextDataProtection) \
) \
) \
: \
MOTO_FLASH_A_ControlBlockProtection_f( (MOTO_FLASH_A_Ptr), \
(BlocksToProtect), \
(ReadWriteProtection), \
(PrivledgeProtection), \
(TextDataProtection) \
) \
)/* End of MOTO_FLASH_A_ControlBlockProtection Macro */
/**********************************************************************/
/* Function: MOTO_FLASH_A_ControlDebugMode */
/* */
/* Purpose: Call MOTO_FLASH_A_ControlDebugMode_f with optional */
/* parameter checking. */
/* */
/* Input: */
/* MOTO_FLASH_A_Ptr : FLASH register block base address */
/* DebugMode : Specifies whether debug mode is on/off */
/* */
/* Output: */
/* MOTO_FLASH_A_ERR_NONE : For successful completion */
/* MOTO_FLASH_A_ERR_INVALID_MODE : DebugMode input is invalid */
/**********************************************************************/
#define MOTO_FLASH_A_ControlDebugMode(MOTO_FLASH_A_Ptr, \
DebugMode ) \
( \
(MOTO_FLASH_A_PARAM_CHECKING) ? \
( \
((MOTO_FLASH_A_Ptr) == NULL) ? MOTO_FLASH_A_ERR_INVALID_HANDLE : \
(((DebugMode) != MOTO_FLASH_A_ENABLE) && \
((DebugMode) != MOTO_FLASH_A_DISABLE)) ? \
MOTO_FLASH_A_ERR_INVALID_MODE : \
MOTO_FLASH_A_ControlDebugMode_f( (MOTO_FLASH_A_Ptr), \
(DebugMode) \
) \
) \
: \
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -