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

📄 _mb894xx.h

📁 Fujitsu MB89P475的应用实例
💻 H
📖 第 1 页 / 共 2 页
字号:
#define		UART1_CL	SMC11.bit.Uart1_CL
		__UCHARBIT(	Uart1_SBL,1)
#define		UART1_SBL	SMC11.bit.Uart1_SBL		
		__UCHARBIT(	Uart1_TDP,1)
#define		UART1_TDP	SMC11.bit.Uart1_TDP		
		__UCHARBIT(	Uart1_PEN,1)
#define		UART1_PEN	SMC11.bit.Uart1_PEN		
		__UCHARBIT(	Uart1_MD ,1)
#define		UART1_MD	SMC11.bit.Uart1_MD		
	__STRUCT_TYPE_E(bit)
__STRUCT_E
/* structure of SMC12 */
__UNION io_smc12 __STRUCT_B
	__BYTE_MEM
	__STRUCT_TYPE_B
		__UCHARBIT(	Uart1_TIE ,1)
#define		UART1_TIE	SMC12.bit.Uart1_TIE		
		__UCHARBIT(	Uart1_RIE,1)
#define		UART1_RIE	SMC12.bit.Uart1_RIE		
		__UCHARBIT(	Uart1_SCKE,1)
#define		UART1_SCKE	SMC12.bit.Uart1_SCKE		
		__UCHARBIT(	Uart1_SO_Fuction,1)
#define		UART1_FUC	SMC12.bit.Uart1_SO_Fuction
		__UCHARBIT(	Uart1_BGRE ,1)
#define		UART1_BRGE	SMC12.bit.Uart1_BRGE		
		__UCHARBIT(	Uart1_StartTrans,1)
#define		UART1_STARTTRANS	SMC12.bit.Uart1_StartTrans		
		__UCHARBIT(	Uart1_StartReceiv,1)
#define		UART1_STARTRECEIV	SMC12.bit.Uart1_StartReceiv		
		__UCHARBIT(	Uart1_RERC,1)
#define		UART1_RERC	SMC12.bit.Uart1_RERC		
	__STRUCT_TYPE_E(bit)
__STRUCT_E

/* structure of SSD1 */
__UNION io_ssd1 __STRUCT_B
	__BYTE_MEM
	__STRUCT_TYPE_B
		__UCHARBIT_NONAME(     3)
		__UCHARBIT(	Uart1_TDRE   ,1)
#define		UART1_TDRE	SSD1.bit.Uart1_TDRE		
		__UCHARBIT(	Uart1_RDRF   ,1)
#define		UART1_RDRF	SSD1.bit.Uart1_RDRF
		__UCHARBIT(	Uart1_FER  ,1)
#define		UART1_FER	SSD1.bit.Uart1_FER
		__UCHARBIT(	Uart1_OVE  ,1)
#define		UART1_OVE	SSD1.bit.Uart1_OVE		
		__UCHARBIT(	Uart1_PER  ,1)
#define		UART1_PER	SSD1.bit.Uart1_PER		
	__STRUCT_TYPE_E(bit)
__STRUCT_E

/* structure of SIDR1 */
__UNION io_sidr1 __STRUCT_B
	__BYTE_MEM
	__STRUCT_TYPE_B
		__UCHARBIT(	SIDR10 ,1)
		__UCHARBIT(	SIDR11 ,1)
		__UCHARBIT(	SIDR12 ,1)
		__UCHARBIT(	SIDR13 ,1)
		__UCHARBIT(	SIDR14 ,1)
		__UCHARBIT(	SIDR15 ,1)
		__UCHARBIT(	SIDR16 ,1)
		__UCHARBIT(	SIDR17 ,1)
	__STRUCT_TYPE_E(bit)
__STRUCT_E

/* structure of SRC1 */
__UNION io_src1 __STRUCT_B
	__BYTE_MEM
	__STRUCT_TYPE_B
		__UCHARBIT(	SRC10 ,1)
		__UCHARBIT(	SRC11 ,1)
		__UCHARBIT(	SRC12 ,1)
		__UCHARBIT(	SRC13 ,1)
		__UCHARBIT(	SRC14 ,1)
		__UCHARBIT(	SRC15 ,1)
		__UCHARBIT(	SRC16 ,1)
		__UCHARBIT(	SRC17 ,1)
	__STRUCT_TYPE_E(bit)
__STRUCT_E
/*********************************************/
/* Sample program for I/O variables of UART.2 */
/*********************************************/
/* structure of SMC21 */
__UNION io_smc21 __STRUCT_B
	__BYTE_MEM
	__STRUCT_TYPE_B
		__UCHARBIT(	Uart2_CLK ,3)
#define		UART2_CLK	SMC21.bit.Uart2_CLK			
		__UCHARBIT(	Uart1_CL,1)
#define		UART2_CL	SMC21.bit.Uart2_CL
		__UCHARBIT(	Uart2_SBL,1)
#define		UART2_SBL	SMC21.bit.Uart2_SBL		
		__UCHARBIT(	Uart2_TDP,1)
#define		UART2_TDP	SMC21.bit.Uart2_TDP		
		__UCHARBIT(	Uart2_PEN,1)
#define		UART2_PEN	SMC21.bit.Uart2_PEN		
		__UCHARBIT(	Uart2_MD ,1)
#define		UART2_MD	SMC21.bit.Uart2_MD		
	__STRUCT_TYPE_E(bit)
__STRUCT_E
/* structure of SMC22 */
__UNION io_smc22 __STRUCT_B
	__BYTE_MEM
	__STRUCT_TYPE_B
		__UCHARBIT(	Uart2_TIE ,1)
#define		UART2_TIE	SMC22.bit.Uart2_TIE		
		__UCHARBIT(	Uart2_RIE,1)
#define		UART2_RIE	SMC22.bit.Uart2_RIE		
		__UCHARBIT(	Uart2_SCKE,1)
#define		UART2_SCKE	SMC22.bit.Uart2_SCKE		
		__UCHARBIT(	Uart2_SO_Fuction,1)
#define		UART2_FUC	SMC22.bit.Uart2_SO_Fuction
		__UCHARBIT(	Uart2_BGRE ,1)
#define		UART2_BGRE	SMC22.bit.Uart2_BGRE		
		__UCHARBIT(	Uart2_StartTrans,1)
#define		UART2_STARTTRANS	SMC22.bit.Uart2_StartTrans		
		__UCHARBIT(	Uart2_StartReceiv,1)
#define		UART2_STARTRECEIV	SMC22.bit.Uart2_StartReceiv		
		__UCHARBIT(	Uart2_RERC,1)
#define		UART2_RERC	SMC22.bit.Uart2_RERC		
	__STRUCT_TYPE_E(bit)
__STRUCT_E

/* structure of SSD2 */
__UNION io_ssd2 __STRUCT_B
	__BYTE_MEM
	__STRUCT_TYPE_B

		__UCHARBIT_NONAME(     3)
		__UCHARBIT(	Uart2_TDRE   ,1)
#define		UART2_TDRE	SSD2.bit.Uart2_TDRE		
		__UCHARBIT(	Uart2_RDRF   ,1)
#define		UART2_RDRF	SSD2.bit.Uart2_RDRF
		__UCHARBIT(	Uart2_FER  ,1)
#define		UART2_FER	SSD2.bit.Uart2_FER
		__UCHARBIT(	Uart2_OVE  ,1)
#define		UART2_OVE	SSD2.bit.Uart2_OVE		
		__UCHARBIT(	Uart2_PER  ,1)
#define		UART2_PER	SSD2.bit.Uart2_PER		
	__STRUCT_TYPE_E(bit)
__STRUCT_E

/* structure of SIDR2 */
__UNION io_sidr2 __STRUCT_B
	__BYTE_MEM
	__STRUCT_TYPE_B
		__UCHARBIT(	SIDR20 ,1)
		__UCHARBIT(	SIDR21 ,1)
		__UCHARBIT(	SIDR22 ,1)
		__UCHARBIT(	SIDR23 ,1)
		__UCHARBIT(	SIDR24 ,1)
		__UCHARBIT(	SIDR25 ,1)
		__UCHARBIT(	SIDR26 ,1)
		__UCHARBIT(	SIDR27 ,1)
	__STRUCT_TYPE_E(bit)
__STRUCT_E

/* structure of SRC2 */
__UNION io_src2 __STRUCT_B
	__BYTE_MEM
	__STRUCT_TYPE_B
		__UCHARBIT(	SRC20 ,1)
		__UCHARBIT(	SRC21 ,1)
		__UCHARBIT(	SRC22 ,1)
		__UCHARBIT(	SRC23 ,1)
		__UCHARBIT(	SRC24 ,1)
		__UCHARBIT(	SRC25 ,1)
		__UCHARBIT(	SRC26 ,1)
		__UCHARBIT(	SRC27 ,1)
	__STRUCT_TYPE_E(bit)
__STRUCT_E





/**********************************************************************/
/* Sample program for control registers of external interrupt1(eddge) */
/**********************************************************************/
/* structure of EIC11 */
__UNION io_eic11 __STRUCT_B
	__BYTE_MEM
	__STRUCT_TYPE_B
		__UCHARBIT(	INT10_EIE,1)
#define		INT10_EIE	EIC11.bit.INT10_EIE		
		__UCHARBIT(	INT10_SEL ,2)
#define		INT10_SEL	EIC11.bit.INT10_SEL		
		__UCHARBIT(	INT10_EIR,1)
#define		INT10_EIR	EIC11.bit.INT10_EIR		

		__UCHARBIT(	INT11_EIE,1)
#define		INT11_EIE	EIC11.bit.INT11_EIE		
		__UCHARBIT(	INT11_SEL ,2)
#define		INT11_SEL	EIC11.bit.INT11_SEL		
		__UCHARBIT( INT11_EIR ,1)
#define		INT11_EIR	EIC11.bit.INT11_EIR		
	__STRUCT_TYPE_E(bit)
__STRUCT_E


/* structure of EIC12 */
__UNION io_eic12 __STRUCT_B
	__BYTE_MEM
	__STRUCT_TYPE_B
		__UCHARBIT(	INT12_EIE,1)
#define		INT12_EIE	EIC12.bit.INT12_EIE		
		__UCHARBIT(	INT12_SEL ,2)
#define		INT12_SEL	EIC12.bit.INT12_SEL		
		__UCHARBIT(	INT12_EIR,1)
#define		INT12_EIR	EIC12.bit.INT12_EIR		

		__UCHARBIT(	INT13_EIE,1)
#define		INT13_EIE	EIC12.bit.INT13_EIE		
		__UCHARBIT(	INT13_SEL ,2)
#define		INT13_SEL	EIC12.bit.INT13_SEL		
		__UCHARBIT(	INT13_EIR,1)
#define		INT13_EIR	EIC12.bit.INT13_EIR		
	__STRUCT_TYPE_E(bit)
__STRUCT_E


/**********************************************************************/
/* Sample program for control registers of external interrupt2(level) */
/**********************************************************************/
/* structure of EIC21 */
__UNION io_eic21 __STRUCT_B
	__BYTE_MEM
	__STRUCT_TYPE_B
		__UCHARBIT(	INT2_IE0,1)
#define		INT2_IE0	EIC21.bit.INT2_IE0		
		__UCHARBIT(	INT2_IE1,1)
#define		INT2_IE0	EIC21.bit.INT2_IE0		
		__UCHARBIT(	INT2_IE2,1)
#define		INT2_IE0	EIC21.bit.INT2_IE0		
		__UCHARBIT(	INT2_IE3,1)
#define		INT2_IE0	EIC21.bit.INT2_IE0		
		__UCHARBIT(	INT2_IE4,1)
#define		INT2_IE0	EIC21.bit.INT2_IE0		
		__UCHARBIT(	INT2_IE5,1)
#define		INT2_IE0	EIC21.bit.INT2_IE0		
		__UCHARBIT(	INT2_IE6,1)
#define		INT2_IE0	EIC21.bit.INT2_IE0		
		__UCHARBIT(	INT2_IE7,1)
#define		INT2_IE0	EIC21.bit.INT2_IE0		
	__STRUCT_TYPE_E(bit)
__STRUCT_E

/* structure of EIF2 */
__UNION io_eif2 __STRUCT_B
	__BYTE_MEM
	__STRUCT_TYPE_B
		__UCHARBIT(	IF20,1)
#define		IF20	EIF2.bit.IF20
		__UCHARBIT_NONAME(   7)
	__STRUCT_TYPE_E(bit)
__STRUCT_E






/* structure of PCR1*/
__UNION io_pcr1 __STRUCT_B
	__BYTE_MEM
	__STRUCT_TYPE_B
		__UCHARBIT(	PWC_BF ,1)
#define		PWC_BF		PCR1.bit.PWC_BF		
		__UCHARBIT(	PWC_IR ,1)
#define		PWC_IR		PCR1.bit.PWC_IR		
		__UCHARBIT(	PWC_UF ,1)
#define		PWC_UF		PCR1.bit.PWC_UF		
		__UCHARBIT_NONAME(   2)
		__UCHARBIT(	PWC_IE ,1)
#define		PWC_IE		PCR1.bit.PWC_IE		
		__UCHARBIT_NONAME(   1)
		__UCHARBIT(	PWC_EN ,1)
#define		PWC_EN		PCR1.bit.PWC_EN		
	__STRUCT_TYPE_E(bit)
__STRUCT_E
/* structure of PCR2*/
__UNION io_pcr2 __STRUCT_B
	__BYTE_MEM
	__STRUCT_TYPE_B
		__UCHARBIT(	PWC_W ,3)
#define		PWC_W		PCR2.bit.PWC_BF		
		__UCHARBIT(	PWC_CLK ,2)
#define		PWC_CLK		PCR2.bit.PWC_BF		
		__UCHARBIT(	PWC_TO ,1)
#define		PWC_TO		PCR2.bit.PWC_BF		
		__UCHARBIT(	PWC_RM ,1)
#define		PWC_RM		PCR2.bit.PWC_BF				
		__UCHARBIT(	PWC_FC ,1)
#define		PWC_FC		PCR2.bit.PWC_BF		
	__STRUCT_TYPE_E(bit)
__STRUCT_E

/* structure of RLBR */
__UNION io_rlbr __STRUCT_B
	__BYTE_MEM
	__STRUCT_TYPE_B
		__UCHARBIT(	RLBR0 ,1)
		__UCHARBIT(	RLBR1 ,1)
		__UCHARBIT(	RLBR2 ,1)
		__UCHARBIT(	RLBR3 ,1)
		__UCHARBIT(	RLBR4 ,1)
		__UCHARBIT(	RLBR5 ,1)
		__UCHARBIT(	RLBR6 ,1)
		__UCHARBIT(	RLBR7 ,1)
	__STRUCT_TYPE_E(bit)
__STRUCT_E


/********************************************************/
/* Sample program for I/O variables of 8-bit PWM timer. */
/********************************************************/
/* structure of CNTR */
__UNION io_cntr __STRUCT_B
	__BYTE_MEM
	__STRUCT_TYPE_B
		__UCHARBIT(	PWM_TIE,1)
#define		PWM_TIE		CNTR.bit.PWM_TIE		
		__UCHARBIT(	PWM_OE,1)
#define		PWM_TOE		CNTR.bit.PWM_TOE
		__UCHARBIT(	PWM_TIR,1)
#define		PWM_TIR		CNTR.bit.PWM_TIR		
		__UCHARBIT(	PWM_TPE,1)
#define		PWM_TPE		CNTR.bit.PWM_TPE		
		__UCHARBIT(	PWM_P,2)
#define		PWM_P		CNTR.bit.PWM_P		
		__UCHARBIT_NONAME(   1)
		__UCHARBIT(	PWM_PTX,1)
#define		PWM_PTX		CNTR.bit.PWM_PTX		
	__STRUCT_TYPE_E(bit)
__STRUCT_E


/* structure of COMR */
__UNION io_comr __STRUCT_B
	__BYTE_MEM
	__STRUCT_TYPE_B
		__UCHARBIT(	COMR0 ,1)
		__UCHARBIT(	COMR1 ,1)
		__UCHARBIT(	COMR2 ,1)
		__UCHARBIT(	COMR3 ,1)
		__UCHARBIT(	COMR4 ,1)
		__UCHARBIT(	COMR5 ,1)
		__UCHARBIT(	COMR6 ,1)
		__UCHARBIT(	COMR7 ,1)
	__STRUCT_TYPE_E(bit)
__STRUCT_E



/*******************************************************************/
/* Sample program for I/O variables of pull-up resistor registers. */
/*******************************************************************/
/* structure of PURC0 */
__UNION io_purc0 __STRUCT_B
	__BYTE_MEM
	__STRUCT_TYPE_B
		__UCHARBIT(	PURC00 ,1)
#define PURC00	PURC0.bit.PURC00		
		__UCHARBIT(	PURC01 ,1)
#define PURC00	PURC0.bit.PURC00
		__UCHARBIT(	PURC02 ,1)
#define PURC00	PURC0.bit.PURC00
		__UCHARBIT(	PURC03 ,1)
#define PURC00	PURC0.bit.PURC00
		__UCHARBIT(	PURC04 ,1)
#define PURC00	PURC0.bit.PURC00
		__UCHARBIT(	PURC05 ,1)
#define PURC00	PURC0.bit.PURC00
		__UCHARBIT(	PURC06 ,1)
#define PURC00	PURC0.bit.PURC00
		__UCHARBIT(	PURC07 ,1)
#define PURC00	PURC0.bit.PURC00
	__STRUCT_TYPE_E(bit)
__STRUCT_E
/* structure of PURC1 */
__UNION io_purc1 __STRUCT_B
	__BYTE_MEM
	__STRUCT_TYPE_B
		__UCHARBIT(	PURC10 ,1)
#define PURC10	PURC1.bit.PURC10
		__UCHARBIT(	PURC11 ,1)
#define PURC10	PURC1.bit.PURC10
		__UCHARBIT(	PURC12 ,1)
#define PURC10	PURC1.bit.PURC10
		__UCHARBIT(	PURC13 ,1)
#define PURC10	PURC1.bit.PURC10
		__UCHARBIT(	PURC14 ,1)
#define PURC10	PURC1.bit.PURC10
		__UCHARBIT(	PURC15 ,1)
#define PURC10	PURC1.bit.PURC10
		__UCHARBIT(	PURC16 ,1)
#define PURC10	PURC1.bit.PURC10
		__UCHARBIT(	PURC17 ,1)
#define PURC10	PURC1.bit.PURC10
	__STRUCT_TYPE_E(bit)
__STRUCT_E


/* structure of PURC2 */
__UNION io_purc2 __STRUCT_B
	__BYTE_MEM
	__STRUCT_TYPE_B
		__UCHARBIT(	PURC20 ,1)
#define PURC20	PURC2.bit.PURC20
		__UCHARBIT(	PURC21 ,1)
#define PURC20	PURC2.bit.PURC20
		__UCHARBIT(	PURC22 ,1)
#define PURC20	PURC2.bit.PURC20
		__UCHARBIT(	PURC23 ,1)
#define PURC20	PURC2.bit.PURC20
		__UCHARBIT(	PURC24 ,1)
#define PURC20	PURC2.bit.PURC20
		__UCHARBIT(	PURC25 ,1)
#define PURC20	PURC2.bit.PURC20
		__UCHARBIT(	PURC26 ,1)
#define PURC20	PURC2.bit.PURC20
		__UCHARBIT(	PURC27 ,1)
#define PURC20	PURC2.bit.PURC20
	__STRUCT_TYPE_E(bit)
__STRUCT_E
/* structure of PURC3 */
__UNION io_purc3 __STRUCT_B
	__BYTE_MEM
	__STRUCT_TYPE_B
		__UCHARBIT(	PURC30 ,1)
#define PURC30	PURC3.bit.PURC30
		__UCHARBIT(	PURC31 ,1)
#define PURC30	PURC3.bit.PURC30
		__UCHARBIT(	PURC32 ,1)
#define PURC30	PURC3.bit.PURC30
		__UCHARBIT(	PURC33 ,1)
#define PURC30	PURC3.bit.PURC30
		__UCHARBIT(	PURC34 ,1)
#define PURC30	PURC3.bit.PURC30
		__UCHARBIT(	PURC35 ,1)
#define PURC30	PURC3.bit.PURC30
		__UCHARBIT(	PURC36 ,1)
#define PURC30	PURC3.bit.PURC30
		__UCHARBIT_NONAME(  1)
	__STRUCT_TYPE_E(bit)
__STRUCT_E
/* structure of PURR5 */
__UNION io_purc5 __STRUCT_B
	__BYTE_MEM
	__STRUCT_TYPE_B
		__UCHARBIT(	PURC50 ,1)
#define PURC50	PURC5.bit.PURC50
		__UCHARBIT(	PURC51 ,1)
#define PURC50	PURC5.bit.PURC50
		__UCHARBIT(	PURC52 ,1)
#define PURC50	PURC5.bit.PURC50
		__UCHARBIT(	PURC53 ,1)
#define PURC50	PURC5.bit.PURC50
		__UCHARBIT(	PURC54 ,1)
#define PURC50	PURC5.bit.PURC50
		__UCHARBIT_NONAME(3 )
	__STRUCT_TYPE_E(bit)
__STRUCT_E

/* structure of ILR1 */
__UNION io_ilr1 __STRUCT_B
	__BYTE_MEM
	__STRUCT_TYPE_B
		__UCHARBIT(	ILR10 ,1)
		__UCHARBIT(	ILR11 ,1)
		__UCHARBIT(	ILR12 ,1)
		__UCHARBIT(	ILR13 ,1)
		__UCHARBIT(	ILR14 ,1)
		__UCHARBIT(	ILR15 ,1)
		__UCHARBIT(	ILR16 ,1)
		__UCHARBIT(	ILR17 ,1)
	__STRUCT_TYPE_E(bit)
__STRUCT_E
/* structure of ILR2 */
__UNION io_ilr2 __STRUCT_B
	__BYTE_MEM
	__STRUCT_TYPE_B
		__UCHARBIT(	ILR20 ,1)
		__UCHARBIT(	ILR21 ,1)
		__UCHARBIT(	ILR22 ,1)
		__UCHARBIT(	ILR23 ,1)
		__UCHARBIT(	ILR24 ,1)
		__UCHARBIT(	ILR25 ,1)
		__UCHARBIT(	ILR26 ,1)
		__UCHARBIT(	ILR27 ,1)
	__STRUCT_TYPE_E(bit)
__STRUCT_E
/* structure of ILR3 */
__UNION io_ilr3 __STRUCT_B
	__BYTE_MEM
	__STRUCT_TYPE_B
		__UCHARBIT(	ILR30 ,1)
		__UCHARBIT(	ILR31 ,1)
		__UCHARBIT(	ILR32 ,1)
		__UCHARBIT(	ILR33 ,1)
		__UCHARBIT(	ILR34 ,1)
		__UCHARBIT(	ILR35 ,1)
		__UCHARBIT(	ILR36 ,1)
		__UCHARBIT(	ILR37 ,1)
	__STRUCT_TYPE_E(bit)
__STRUCT_E
/* structure of ILR4 */
__UNION io_ilr4 __STRUCT_B
	__BYTE_MEM
	__STRUCT_TYPE_B
		__UCHARBIT(	ILR40 ,1)
		__UCHARBIT(	ILR41 ,1)
		__UCHARBIT(	ILR42 ,1)
		__UCHARBIT(	ILR43 ,1)
		__UCHARBIT(	ILR44 ,1)
		__UCHARBIT(	ILR45 ,1)
		__UCHARBIT(	ILR46 ,1)
		__UCHARBIT(	ILR47 ,1)
	__STRUCT_TYPE_E(bit)
__STRUCT_E

⌨️ 快捷键说明

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