📄 port_a.h
字号:
#define PORTxP_SETx_PORTxP5_SETx5_MASK (1<< PORTxP_SETx_PORTxP5_SETx5_BITNO)
#define PORTxP_SETx_PORTxP6_SETx6_BITNO 6
#define PORTxP_SETx_PORTxP6_SETx6_MASK (1<<PORTxP_SETx_PORTxP6_SETx6_BITNO)
#define PORTxP_SETx_PORTxP7_SETx7_BITNO 7
#define PORTxP_SETx_PORTxP7_SETx7_MASK (1<<PORTxP_SETx_PORTxP7_SETx7_BITNO)
#define PORTxP_SETx_PORTxP_SETx_BITNO 0
#define PORTxP_SETx_PORTxP_SETx_MAX (0xFF)
#define PORTxP_SETx_PORTxP_SETx_MASK (PORTxP_SETx_PORTxP_SETx_MAX<< PORTxP_SETx_PORTxP_SETx_BITNO)
/* Port Clear Output Data Register A Macro */
#define CLRx_CLRx0_BITNO 0
#define CLRx_CLRx0_MASK (1<<CLRx_CLRx0_BITNO)
#define CLRx_CLRx1_BITNO 1
#define CLRx_CLRx1_MASK (1<<CLRx_CLRx1_BITNO)
#define CLRx_CLRx2_BITNO 2
#define CLRx_CLRx2_MASK (1<<CLRx_CLRx2_BITNO)
#define CLRx_CLRx3_BITNO 3
#define CLRx_CLRx3_MASK (1<<CLRx_CLRx3_BITNO)
#define CLRx_CLRx4_BITNO 4
#define CLRx_CLRx4_MASK (1<<CLRx_CLRx4_BITNO)
#define CLRx_CLRx5_BITNO 5
#define CLRx_CLRx5_MASK (1<<CLRx_CLRx5_BITNO)
#define CLRx_CLRx6_BITNO 6
#define CLRx_CLRx6_MASK (1<<CLRx_CLRx6_BITNO)
#define CLRx_CLRx7_BITNO 7
#define CLRx_CLRx7_MASK (1<<CLRx_CLRx7_BITNO)
#define CLRx_CLRx_BITNO 0
#define CLRx_CLRx_MAX (0XFF)
#define CLRx_CLRx_MASK (CLRx_CLRx_MAX<< CLRx_CLRx_BITNO)
#define CLRx_RESET_MASK (0x00)
/* Port CD Pin Assignment Register Macro */
#define PCDPAR_PCDPA_BITNO 7
#define PCDPAR_PCDPA_MASK (1<<PCDPAR_PCDPA_BITNO)
#define PCDPAR_RESET_MASTER_MASK (0x80)
#define PCDPAR_RESET_SINGLE_MASK (0x00)
#define PCDPAR_RESET_EMULATION_MASK (0x00)
/* Port E Pin Assignment Register Macro */
#define PEPAR_PEPA0_BITNO 0
#define PEPAR_PEPA0_MASK (1<<PEPAR_PEPA0_BITNO)
#define PEPAR_PEPA1_BITNO 1
#define PEPAR_PEPA1_MASK (1<<PEPAR_PEPA1_BITNO)
#define PEPAR_PEPA2_BITNO 2
#define PEPAR_PEPA2_MASK (1<<PEPAR_PEPA2_BITNO)
#define PEPAR_PEPA3_BITNO 3
#define PEPAR_PEPA3_MASK (1<<PEPAR_PEPA3_BITNO)
#define PEPAR_PEPA4_BITNO 4
#define PEPAR_PEPA4_MASK (1<<PEPAR_PEPA4_BITNO)
#define PEPAR_PEPA5_BITNO 5
#define PEPAR_PEPA5_MASK (1<<PEPAR_PEPA5_BITNO)
#define PEPAR_PEPA6_BITNO 6
#define PEPAR_PEPA6_MASK (1<<PEPAR_PEPA6_BITNO)
#define PEPAR_PEPA7_BITNO 7
#define PEPAR_PEPA7_MASK (1<<PEPAR_PEPA7_BITNO)
#define PEPAR_PEPA_BITNO 0
#define PEPAR_PEPA_MASK (0XFF)
#define PEPAR_RESET_MASTER_MASK (0XE0)
#define PEPAR_RESET_SINGLE_MASK (0X00)
#define PEPAR_RESET_EMULATION_MASK (0XFF)
/*-------------------------------------------------------------------*/
/* Prototypes */
/*-------------------------------------------------------------------*/
Port_A_ReturnCode_t Port_A_Reset_f (pPort_A_t
);
Port_A_ReturnCode_t Port_A_ConfigureDataDirection_f (
pPort_A_t,
Port_A_Port_t,
UINT8
);
Port_A_ReturnCode_t Port_A_WritePortData_f (
pPort_A_t,
Port_A_Port_t,
UINT8
);
Port_A_ReturnCode_t Port_A_ReadPortData_f (
pPort_A_t,
Port_A_Port_t,
UINT8 *
);
Port_A_ReturnCode_t Port_A_ConfigureGPIO_f (
pPort_A_t,
Port_A_Selection_t,
Port_A_Function_t
);
Port_A_ReturnCode_t Port_A_SetRegister_f (
pPort_A_t,
Port_A_Register_t,
UINT8
);
Port_A_ReturnCode_t Port_A_GetRegister_f (
pPort_A_t,
Port_A_Register_t,
UINT8*
);
Port_A_ReturnCode_t Port_A_WritePin_f (
pPort_A_t,
Port_A_Port_t,
Port_A_Pin_t,
Port_A_DataVal_t
);
/*-------------------------------------------------------------------*/
/* Macro: Port_A_Reset */
/* */
/* Purpose: Call Port_A_Reset_f function with optional parameter */
/* checking. */
/* */
/* Input: */
/* PortPtr : Port_A base address associated with this driver.*/
/* */
/* Output: */
/* PORT_A_ERR_NONE : No error */
/* PORT_A_ERR_INVALID_HANDLE : Port base address parameter is */
/* zero. */
/*-------------------------------------------------------------------*/
#define Port_A_Reset( PortPtr \
) \
( \
(PORT_A_PARAM_CHECKING) ? \
( \
((PortPtr) == NULL) ? \
PORT_A_ERR_INVALID_HANDLE: \
Port_A_Reset_f ( (PortPtr) \
) \
) \
: \
Port_A_Reset_f ( (PortPtr) \
) \
) /* end of Port_A_Reset Macro */
/*-------------------------------------------------------------------*/
/* Macro: Port_A_ConfigureDataDirection */
/* */
/* Purpose: Call Port_A_ConfigureDataDirection_f function with */
/* optional parameter checking. */
/* */
/* Input: */
/* PortPtr : Port base address associated with */
/* this driver. */
/* Port : Select a Port A-I. */
/* DataDirMask : Data to copy into register */
/* */
/* Output: */
/* PORT_A_ERR_NONE : No error. */
/* PORT_A_ERR_INVALID_HANDLE : Port base address parmeter */
/* is zero. */
/* PORT_A_ERR_INVALID_PORT : Port selection invalid. */
/* is invalid. */
/*-------------------------------------------------------------------*/
#define Port_A_ConfigureDataDirection( PortPtr, \
Port, \
DataDirMask \
) \
( \
(PORT_A_PARAM_CHECKING) ? \
( \
((PortPtr) == NULL) ? \
PORT_A_ERR_INVALID_HANDLE : \
(((Port) < PORT_A_PORT_A) || \
((Port) > PORT_A_PORT_I)) ? \
PORT_A_ERR_INVALID_PORT : \
Port_A_ConfigureDataDirection_f ( (PortPtr), \
(Port), \
(DataDirMask) \
) \
) \
: \
Port_A_ConfigureDataDirection_f ( (PortPtr), \
(Port), \
(DataDirMask) \
) \
) /* end of PORT_A_ConfigureDataDirection Macro */
/*-------------------------------------------------------------------*/
/* Macro: Port_A_WritePortData */
/* */
/* Purpose: Call Port_A_WritePortData_f function with optional */
/* parameter checking. */
/* */
/* Input: */
/* PortPtr : Port base address associated with */
/* this driver. */
/* Port : Select a Port A-I. */
/* WriteMask : Data to copy into register */
/* */
/* Output: */
/* PORT_A_ERR_NONE : No error. */
/* PORT_A_ERR_INVALID_HANDLE : Port base address parmeter */
/* is zero. */
/* PORT_A_ERR_INVALID_PORT : Port selection is invalid. */
/*-------------------------------------------------------------------*/
#define Port_A_WritePortData( PortPtr, \
Port, \
WriteMask \
) \
( \
(PORT_A_PARAM_CHECKING) ? \
( \
((PortPtr) == NULL) ? \
PORT_A_ERR_INVALID_HANDLE : \
(((Port) < PORT_A_PORT_A) || \
((Port) > PORT_A_PORT_I)) ? \
PORT_A_ERR_INVALID_PORT : \
Port_A_WritePortData_f ( (PortPtr), \
(Port), \
(WriteMask) \
) \
) \
: \
Port_A_WritePortData_f ( (PortPtr), \
(Port), \
(WriteMask) \
) \
) /* end of Port_A_WritePortData Macro */
/*-------------------------------------------------------------------*/
/* Macro: Port_A_ReadPortData */
/* */
/* Purpose: Call Port_A_ReadPortData_f function with optional */
/* parameter checking. */
/* */
/* Input: */
/* PortPtr : Port base address associated with */
/* this driver. */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -