📄 target.h
字号:
/*""FILE COMMENT""************************************************************** System Name : for eduction (NO TRANSFERRING)* File Name : target.h* Contents : SFR definition file for R8C/Tiny series(for C language)* Model : for OAKS8-LCD Board* CPU : R8C/Tiny series* Compiler : NC30WA(V.5.30 Release 1)* OS : not be used* Programer : RENESAS Semiconductor Training Center* Note : for OAKS8-R5F21114FP(R8C/11 group,20MHz)******************************************************************************** COPYRIGHT(C) 2004 RENESAS TECHNOLOGY CORPORATION* AND RENESAS SOLUTIONS CORPORATION ALL RIGHTS RESERVED******************************************************************************** History : ---*""FILE COMMENT END""*********************************************************/#ifndef __TARGET_H#define __TARGET_H/******************************************************************************* define SFR section type******************************************************************************/struct bit_def { /* for bit access */ unsigned char b0:1; /* bit 0(LSB) */ unsigned char b1:1; /* bit 1 */ unsigned char b2:1; /* bit 2 */ unsigned char b3:1; /* bit 3 */ unsigned char b4:1; /* bit 4 */ unsigned char b5:1; /* bit 5 */ unsigned char b6:1; /* bit 6 */ unsigned char b7:1; /* bit 7(MSB) */};union byte_def{ /* for bit/byte access */ unsigned char byte; /* for byte access */ struct bit_def bit; /* for bit access */};/*----------------------------------------------------------------------------- * protect register *---------------------------------------------------------------------------*/#define prcr_addr (*(volatile union byte_def *)0x000A)#define prcr prcr_addr.byte/* protect bit 0 */#define prc0 prcr_addr.bit.b0/* permit writing CM0,CM1,OCD, HR0,HR1 register*//* protect bit 1 */#define prc1 prcr_addr.bit.b1/* permit writing PM0,PM1 register *//* protect bit 2 */#define prc2 prcr_addr.bit.b2/* permit writing PD0 register *//*----------------------------------------------------------------------------- * INT0 input filter selection register *---------------------------------------------------------------------------*/#define int0f_addr (*(volatile unsigned char *)0x001E)#define int0f int0f_addr/*----------------------------------------------------------------------------- * timer X interrupt control register *---------------------------------------------------------------------------*/#define txic_addr (*(volatile union byte_def *)0x0056)#define txic txic_addr.byte/* timer X interrupt request bit */#define ir_txic txic_addr.bit.b3/*----------------------------------------------------------------------------- * timer Y interrupt control register *---------------------------------------------------------------------------*/#define tyic_addr (*(volatile unsigned char *)0x0057)#define tyic tyic_addr/*----------------------------------------------------------------------------- * compare 0 interrupt control register *---------------------------------------------------------------------------*/#define cmp0ic_addr (*(volatile union byte_def *)0x005C)#define cmp0ic cmp0ic_addr.byte/* compare 0 interrupt request bit */#define ir_cmp0ic cmp0ic_addr.bit.b3/*----------------------------------------------------------------------------- * INT0 interrupt control register *---------------------------------------------------------------------------*/#define int0ic_addr (*(volatile union byte_def *)0x005D)#define int0ic int0ic_addr.byte/* INT0 interrupt request bit */#define ir_int0ic int0ic_addr.bit.b3/*----------------------------------------------------------------------------- * timer Y, Z mode register *---------------------------------------------------------------------------*/#define tyzmr_addr (*(volatile union byte_def *)0x0080)#define tyzmr tyzmr_addr.byte/* timer Y count start flag */#define tys tyzmr_addr.bit.b3/*----------------------------------------------------------------------------- * prescalar Y register *---------------------------------------------------------------------------*/#define prey_addr (*(volatile unsigned char *)0x0081)#define prey prey_addr/*----------------------------------------------------------------------------- * timer Y primary register *---------------------------------------------------------------------------*/#define typr_addr (*(volatile unsigned char *)0x0083)#define typr typr_addr/*----------------------------------------------------------------------------- * timre X mode register *---------------------------------------------------------------------------*/#define txmr_addr (*(volatile union byte_def *)0x008B)#define txmr txmr_addr.byte/* timer X count start flag */#define txs txmr_addr.bit.b3/*----------------------------------------------------------------------------- *prescalar X register *---------------------------------------------------------------------------*/#define prex_addr (*(volatile unsigned char *)0x008C)#define prex prex_addr/*----------------------------------------------------------------------------- * timer X *---------------------------------------------------------------------------*/#define tx_addr (*(volatile unsigned char *)0x008D)#define tx tx_addr/*----------------------------------------------------------------------------- * timer count source selection register *---------------------------------------------------------------------------*/#define tcss_addr (*(volatile unsigned char *)0x008E)#define tcss tcss_addr/*----------------------------------------------------------------------------- * timer C *---------------------------------------------------------------------------*/#define tc_addr (*(volatile unsigned int *)0x0090)#define tc tc_addr/*----------------------------------------------------------------------------- * outer input permission register *---------------------------------------------------------------------------*/#define inten_addr (*(volatile union byte_def *)0x0096)#define inten inten_addr.byte/* INT0 input permission bit */#define int0en inten_addr.bit.b0/*----------------------------------------------------------------------------- * timer C control register 0 *---------------------------------------------------------------------------*/#define tcc0_addr (*(volatile union byte_def *)0x009A)#define tcc0 tcc0_addr.byte/* timer C count start bit */#define tcc00 tcc0_addr.bit.b0/*----------------------------------------------------------------------------- * timer C control register 1 *---------------------------------------------------------------------------*/#define tcc1_addr (*(volatile unsigned char *)0x009B)#define tcc1 tcc1_addr/*----------------------------------------------------------------------------- * capture, compare 0 register *---------------------------------------------------------------------------*/#define tm0_addr (*(volatile unsigned int *)0x009C)#define tm0 tm0_addr/*----------------------------------------------------------------------------- * A-D register *---------------------------------------------------------------------------*/#define ad_addr (*(volatile unsigned int *)0x00C0)#define ad ad_addr/*----------------------------------------------------------------------------- * A-D control register 2 *---------------------------------------------------------------------------*/#define adcon2_addr (*(volatile unsigned char *)0x00D4)#define adcon2 adcon2_addr/*----------------------------------------------------------------------------- * A-D control register 0 *---------------------------------------------------------------------------*/#define adcon0_addr (*(volatile union byte_def *)0x00D6)#define adcon0 adcon0_addr.byte/* A-D conversion start flag */#define adst adcon0_addr.bit.b6/*----------------------------------------------------------------------------- * A-D control register 1 *---------------------------------------------------------------------------*/#define adcon1_addr (*(volatile unsigned char *)0x00D7)#define adcon1 adcon1_addr/*----------------------------------------------------------------------------- * port P0 register *---------------------------------------------------------------------------*/#define p0_addr (*(volatile union byte_def *)0x00E0)#define p0 p0_addr.byte#define p0_0 p0_addr.bit.b0 /* bit 0 of port P0 */#define p0_1 p0_addr.bit.b1 /* bit 1 of port P0 */#define p0_2 p0_addr.bit.b2 /* bit 2 of port P0 */#define p0_3 p0_addr.bit.b3 /* bit 3 of port P0 */#define p0_4 p0_addr.bit.b4 /* bit 4 of port P0 */#define p0_5 p0_addr.bit.b5 /* bit 5 of port P0 */#define p0_6 p0_addr.bit.b6 /* bit 6 of port P0 */#define p0_7 p0_addr.bit.b7 /* bit 7 of port P0 *//*----------------------------------------------------------------------------- * port P1 register *---------------------------------------------------------------------------*/#define p1_addr (*(volatile union byte_def *)0x00E1)#define p1 p1_addr.byte#define p1_0 p1_addr.bit.b0 /* bit 0 of port P1 */#define p1_1 p1_addr.bit.b1 /* bit 1 of port P1 */#define p1_2 p1_addr.bit.b2 /* bit 2 of port P1 */#define p1_3 p1_addr.bit.b3 /* bit 3 of port P1 */#define p1_4 p1_addr.bit.b4 /* bit 4 of port P1 */#define p1_5 p1_addr.bit.b5 /* bit 5 of port P1 */#define p1_6 p1_addr.bit.b6 /* bit 6 of port P1 */#define p1_7 p1_addr.bit.b7 /* bit 7 of port P1 *//*----------------------------------------------------------------------------- * port P0 direction register *---------------------------------------------------------------------------*/#define pd0_addr (*(volatile union byte_def *)0x00E2)#define pd0 pd0_addr.byte#define pd0_0 pd0_addr.bit.b0 /* bit 0 of port P0 direction register */#define pd0_1 pd0_addr.bit.b1 /* bit 1 of port P0 direction register */#define pd0_2 pd0_addr.bit.b2 /* bit 2 of port P0 direction register */#define pd0_3 pd0_addr.bit.b3 /* bit 3 of port P0 direction register */#define pd0_4 pd0_addr.bit.b4 /* bit 4 of port P0 direction register */#define pd0_5 pd0_addr.bit.b5 /* bit 5 of port P0 direction register */#define pd0_6 pd0_addr.bit.b6 /* bit 6 of port P0 direction register */#define pd0_7 pd0_addr.bit.b7 /* bit 7 of port P0 direction register *//*----------------------------------------------------------------------------- * port P1 direction register *---------------------------------------------------------------------------*/#define pd1_addr (*(volatile union byte_def *)0x00E3)#define pd1 pd1_addr.byte#define pd1_0 pd1_addr.bit.b0 /* bit 0 of port P1 direction register */#define pd1_1 pd1_addr.bit.b1 /* bit 1 of port P1 direction register */#define pd1_2 pd1_addr.bit.b2 /* bit 2 of port P1 direction register */#define pd1_3 pd1_addr.bit.b3 /* bit 3 of port P1 direction register */#define pd1_4 pd1_addr.bit.b4 /* bit 4 of port P1 direction register */#define pd1_5 pd1_addr.bit.b5 /* bit 5 of port P1 direction register */#define pd1_6 pd1_addr.bit.b6 /* bit 6 of port P1 direction register */#define pd1_7 pd1_addr.bit.b7 /* bit 7 of port P1 direction register *//*----------------------------------------------------------------------------- * port P3 register *---------------------------------------------------------------------------*/#define p3_addr (*(volatile union byte_def *)0x00E5)#define p3 p3_addr.byte#define p3_0 p3_addr.bit.b0 /* bit 0 of port P3 */#define p3_1 p3_addr.bit.b1 /* bit 1 of port P3 */#define p3_2 p3_addr.bit.b2 /* bit 2 of port P3 */#define p3_3 p3_addr.bit.b3 /* bit 3 of port P3 */#define p3_7 p3_addr.bit.b7 /* bit 7 of port P3 *//*----------------------------------------------------------------------------- * port P3 direction register *---------------------------------------------------------------------------*/#define pd3_addr (*(volatile union byte_def *)0x00E7)#define pd3 pd3_addr.byte#define pd3_0 pd3_addr.bit.b0 /* bit 0 of port P3 direction register */#define pd3_1 pd3_addr.bit.b1 /* bit 1 of port P3 direction register */#define pd3_2 pd3_addr.bit.b2 /* bit 2 of port P3 direction register */#define pd3_3 pd3_addr.bit.b3 /* bit 3 of port P3 direction register */#define pd3_7 pd3_addr.bit.b7 /* bit 7 of port P3 direction register *//*----------------------------------------------------------------------------- * port P4 register *---------------------------------------------------------------------------*/#define p4_addr (*(volatile union byte_def *)0x00E8)#define p4 p4_addr.byte#define p4_5 p4_addr.bit.b5 /* bit 5 of port P4 */#define p4_6 p4_addr.bit.b6 /* bit 6 of port P4 */#define p4_7 p4_addr.bit.b7 /* bit 7 of port P4 *//*----------------------------------------------------------------------------- * port P4 direction register *---------------------------------------------------------------------------*/#define pd4_addr (*(volatile union byte_def *)0x00EA)#define pd4 pd4_addr.byte#define pd4_5 pd4_addr.bit.b5 /* bit 5 of port P4 direction register *//*----------------------------------------------------------------------------- * pull-up control register 0 *---------------------------------------------------------------------------*/#define pur0_addr (*(volatile union byte_def *)0x00FC)#define pur0 pur0_addr.byte/* pull up from bit 4 to bit 7 of port P0 *//* (valid for input mode port) */#define pu01 pur0_addr.bit.b1/* pull up from bit 0 to bit 3 of port P3 *//* (valid for input mode port) */#define pu06 pur0_addr.bit.b6/*----------------------------------------------------------------------------- * pull-up control register 1 *---------------------------------------------------------------------------*/#define pur1_addr (*(volatile union byte_def *)0x00FD)#define pur1 pur1_addr.byte/* pull up bit 5 of port P5 *//* (valid for input mode port) */#define pu11 pur1_addr.bit.b1 #endif /*__TARGET_H*//****************************************************************************** end of file******************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -