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

📄 mc68hc908jb8.h

📁 HCS08仿真器资料(资料详细)
💻 H
📖 第 1 页 / 共 5 页
字号:
#ifndef _MC68HC908JB8_H
#define _MC68HC908JB8_H

/* Types definition */
typedef unsigned char byte;
typedef unsigned int word;
typedef unsigned long dword;
typedef unsigned long dlong[2];

#ifndef __RESET_WATCHDOG_MACRO
#define __RESET_WATCHDOG_MACRO
/* Watchdog reset macro */
#ifdef _lint
  #define __RESET_WATCHDOG()  /* empty */
#else
  #define __RESET_WATCHDOG() {asm sta COPCTL;}  /* Just write a byte to feed the dog */
#endif
#endif /* __RESET_WATCHDOG_MACRO */

#define REG_BASE 0x0000                /* Base address for the I/O register block */


#pragma MESSAGE DISABLE C1106 /* WARNING C1106: Non-standard bitfield type */

/**************** interrupt vector table ****************/
#define INT_KBI                 0x0000FFF0
#define INT_TIMOvr              0x0000FFF2
#define INT_TIMCH1              0x0000FFF4
#define INT_TIMCH0              0x0000FFF6
#define INT_IRQ                 0x0000FFF8
#define INT_USB                 0x0000FFFA
#define INT_SWI                 0x0000FFFC
#define INT_RESET               0x0000FFFE

/**************** registers I/O map ****************/

/*** PTA - Port A Data Register; 0x00000000 ***/
typedef union {
  byte Byte;
  struct {
    byte PTA0        :1;                                       /* Port A Data Bit 0 */
    byte PTA1        :1;                                       /* Port A Data Bit 1 */
    byte PTA2        :1;                                       /* Port A Data Bit 2 */
    byte PTA3        :1;                                       /* Port A Data Bit 3 */
    byte PTA4        :1;                                       /* Port A Data Bit 4 */
    byte PTA5        :1;                                       /* Port A Data Bit 5 */
    byte PTA6        :1;                                       /* Port A Data Bit 6 */
    byte PTA7        :1;                                       /* Port A Data Bit 7 */
  } Bits;
  struct {
    byte grpPTA  :8;
  } MergedBits;
} PTASTR;
extern volatile PTASTR _PTA @0x00000000;
#define PTA _PTA.Byte
#define PTA_PTA0 _PTA.Bits.PTA0
#define PTA_PTA1 _PTA.Bits.PTA1
#define PTA_PTA2 _PTA.Bits.PTA2
#define PTA_PTA3 _PTA.Bits.PTA3
#define PTA_PTA4 _PTA.Bits.PTA4
#define PTA_PTA5 _PTA.Bits.PTA5
#define PTA_PTA6 _PTA.Bits.PTA6
#define PTA_PTA7 _PTA.Bits.PTA7
#define PTA_PTA _PTA.MergedBits.grpPTA

#define PTA_PTA0_MASK   1
#define PTA_PTA0_BITNUM 0
#define PTA_PTA1_MASK   2
#define PTA_PTA1_BITNUM 1
#define PTA_PTA2_MASK   4
#define PTA_PTA2_BITNUM 2
#define PTA_PTA3_MASK   8
#define PTA_PTA3_BITNUM 3
#define PTA_PTA4_MASK   16
#define PTA_PTA4_BITNUM 4
#define PTA_PTA5_MASK   32
#define PTA_PTA5_BITNUM 5
#define PTA_PTA6_MASK   64
#define PTA_PTA6_BITNUM 6
#define PTA_PTA7_MASK   128
#define PTA_PTA7_BITNUM 7
#define PTA_PTA_MASK  255
#define PTA_PTA_BITNUM  0


/*** PTB - Port B Data Register; 0x00000001 ***/
typedef union {
  byte Byte;
  struct {
    byte PTB0        :1;                                       /* Port B Data Bit 0 */
    byte PTB1        :1;                                       /* Port B Data Bit 1 */
    byte PTB2        :1;                                       /* Port B Data Bit 2 */
    byte PTB3        :1;                                       /* Port B Data Bit 3 */
    byte PTB4        :1;                                       /* Port B Data Bit 4 */
    byte PTB5        :1;                                       /* Port B Data Bit 5 */
    byte PTB6        :1;                                       /* Port B Data Bit 6 */
    byte PTB7        :1;                                       /* Port B Data Bit 7 */
  } Bits;
  struct {
    byte grpPTB  :8;
  } MergedBits;
} PTBSTR;
extern volatile PTBSTR _PTB @0x00000001;
#define PTB _PTB.Byte
#define PTB_PTB0 _PTB.Bits.PTB0
#define PTB_PTB1 _PTB.Bits.PTB1
#define PTB_PTB2 _PTB.Bits.PTB2
#define PTB_PTB3 _PTB.Bits.PTB3
#define PTB_PTB4 _PTB.Bits.PTB4
#define PTB_PTB5 _PTB.Bits.PTB5
#define PTB_PTB6 _PTB.Bits.PTB6
#define PTB_PTB7 _PTB.Bits.PTB7
#define PTB_PTB _PTB.MergedBits.grpPTB

#define PTB_PTB0_MASK   1
#define PTB_PTB0_BITNUM 0
#define PTB_PTB1_MASK   2
#define PTB_PTB1_BITNUM 1
#define PTB_PTB2_MASK   4
#define PTB_PTB2_BITNUM 2
#define PTB_PTB3_MASK   8
#define PTB_PTB3_BITNUM 3
#define PTB_PTB4_MASK   16
#define PTB_PTB4_BITNUM 4
#define PTB_PTB5_MASK   32
#define PTB_PTB5_BITNUM 5
#define PTB_PTB6_MASK   64
#define PTB_PTB6_BITNUM 6
#define PTB_PTB7_MASK   128
#define PTB_PTB7_BITNUM 7
#define PTB_PTB_MASK  255
#define PTB_PTB_BITNUM  0


/*** PTC - Port C Data Register; 0x00000002 ***/
typedef union {
  byte Byte;
  struct {
    byte PTC0        :1;                                       /* Port C Data Bit 0 */
    byte PTC1        :1;                                       /* Port C Data Bit 1 */
    byte PTC2        :1;                                       /* Port C Data Bit 2 */
    byte PTC3        :1;                                       /* Port C Data Bit 3 */
    byte PTC4        :1;                                       /* Port C Data Bit 4 */
    byte PTC5        :1;                                       /* Port C Data Bit 5 */
    byte PTC6        :1;                                       /* Port C Data Bit 6 */
    byte PTC7        :1;                                       /* Port C Data Bit 7 */
  } Bits;
  struct {
    byte grpPTC  :8;
  } MergedBits;
} PTCSTR;
extern volatile PTCSTR _PTC @0x00000002;
#define PTC _PTC.Byte
#define PTC_PTC0 _PTC.Bits.PTC0
#define PTC_PTC1 _PTC.Bits.PTC1
#define PTC_PTC2 _PTC.Bits.PTC2
#define PTC_PTC3 _PTC.Bits.PTC3
#define PTC_PTC4 _PTC.Bits.PTC4
#define PTC_PTC5 _PTC.Bits.PTC5
#define PTC_PTC6 _PTC.Bits.PTC6
#define PTC_PTC7 _PTC.Bits.PTC7
#define PTC_PTC _PTC.MergedBits.grpPTC

#define PTC_PTC0_MASK   1
#define PTC_PTC0_BITNUM 0
#define PTC_PTC1_MASK   2
#define PTC_PTC1_BITNUM 1
#define PTC_PTC2_MASK   4
#define PTC_PTC2_BITNUM 2
#define PTC_PTC3_MASK   8
#define PTC_PTC3_BITNUM 3
#define PTC_PTC4_MASK   16
#define PTC_PTC4_BITNUM 4
#define PTC_PTC5_MASK   32
#define PTC_PTC5_BITNUM 5
#define PTC_PTC6_MASK   64
#define PTC_PTC6_BITNUM 6
#define PTC_PTC7_MASK   128
#define PTC_PTC7_BITNUM 7
#define PTC_PTC_MASK  255
#define PTC_PTC_BITNUM  0


/*** PTD - Port D Data Register; 0x00000003 ***/
typedef union {
  byte Byte;
  struct {
    byte PTD0        :1;                                       /* Port D Data Bit 0 */
    byte PTD1        :1;                                       /* Port D Data Bit 1 */
    byte PTD2        :1;                                       /* Port D Data Bit 2 */
    byte PTD3        :1;                                       /* Port D Data Bit 3 */
    byte PTD4        :1;                                       /* Port D Data Bit 4 */
    byte PTD5        :1;                                       /* Port D Data Bit 5 */
    byte PTD6        :1;                                       /* Port D Data Bit 6 */
    byte PTD7        :1;                                       /* Port D Data Bit 7 */
  } Bits;
  struct {
    byte grpPTD  :8;
  } MergedBits;
} PTDSTR;
extern volatile PTDSTR _PTD @0x00000003;
#define PTD _PTD.Byte
#define PTD_PTD0 _PTD.Bits.PTD0
#define PTD_PTD1 _PTD.Bits.PTD1
#define PTD_PTD2 _PTD.Bits.PTD2
#define PTD_PTD3 _PTD.Bits.PTD3
#define PTD_PTD4 _PTD.Bits.PTD4
#define PTD_PTD5 _PTD.Bits.PTD5
#define PTD_PTD6 _PTD.Bits.PTD6
#define PTD_PTD7 _PTD.Bits.PTD7
#define PTD_PTD _PTD.MergedBits.grpPTD

#define PTD_PTD0_MASK   1
#define PTD_PTD0_BITNUM 0
#define PTD_PTD1_MASK   2
#define PTD_PTD1_BITNUM 1
#define PTD_PTD2_MASK   4
#define PTD_PTD2_BITNUM 2
#define PTD_PTD3_MASK   8
#define PTD_PTD3_BITNUM 3
#define PTD_PTD4_MASK   16
#define PTD_PTD4_BITNUM 4
#define PTD_PTD5_MASK   32
#define PTD_PTD5_BITNUM 5
#define PTD_PTD6_MASK   64
#define PTD_PTD6_BITNUM 6
#define PTD_PTD7_MASK   128
#define PTD_PTD7_BITNUM 7
#define PTD_PTD_MASK  255
#define PTD_PTD_BITNUM  0


/*** DDRA - Data Direction Register A; 0x00000004 ***/
typedef union {
  byte Byte;
  struct {
    byte DDRA0       :1;                                       /* Data Direction Register A Bit 0 */
    byte DDRA1       :1;                                       /* Data Direction Register A Bit 1 */
    byte DDRA2       :1;                                       /* Data Direction Register A Bit 2 */
    byte DDRA3       :1;                                       /* Data Direction Register A Bit 3 */
    byte DDRA4       :1;                                       /* Data Direction Register A Bit 4 */
    byte DDRA5       :1;                                       /* Data Direction Register A Bit 5 */
    byte DDRA6       :1;                                       /* Data Direction Register A Bit 6 */
    byte DDRA7       :1;                                       /* Data Direction Register A Bit 7 */
  } Bits;
  struct {
    byte grpDDRA :8;
  } MergedBits;
} DDRASTR;
extern volatile DDRASTR _DDRA @0x00000004;
#define DDRA _DDRA.Byte
#define DDRA_DDRA0 _DDRA.Bits.DDRA0
#define DDRA_DDRA1 _DDRA.Bits.DDRA1
#define DDRA_DDRA2 _DDRA.Bits.DDRA2
#define DDRA_DDRA3 _DDRA.Bits.DDRA3
#define DDRA_DDRA4 _DDRA.Bits.DDRA4
#define DDRA_DDRA5 _DDRA.Bits.DDRA5
#define DDRA_DDRA6 _DDRA.Bits.DDRA6
#define DDRA_DDRA7 _DDRA.Bits.DDRA7
#define DDRA_DDRA _DDRA.MergedBits.grpDDRA

#define DDRA_DDRA0_MASK   1
#define DDRA_DDRA0_BITNUM 0
#define DDRA_DDRA1_MASK   2
#define DDRA_DDRA1_BITNUM 1
#define DDRA_DDRA2_MASK   4
#define DDRA_DDRA2_BITNUM 2
#define DDRA_DDRA3_MASK   8
#define DDRA_DDRA3_BITNUM 3
#define DDRA_DDRA4_MASK   16
#define DDRA_DDRA4_BITNUM 4
#define DDRA_DDRA5_MASK   32
#define DDRA_DDRA5_BITNUM 5
#define DDRA_DDRA6_MASK   64
#define DDRA_DDRA6_BITNUM 6
#define DDRA_DDRA7_MASK   128
#define DDRA_DDRA7_BITNUM 7
#define DDRA_DDRA_MASK  255
#define DDRA_DDRA_BITNUM  0


/*** DDRB - Data Direction Register B; 0x00000005 ***/
typedef union {
  byte Byte;
  struct {
    byte DDRB0       :1;                                       /* Data Direction Register B Bit 0 */
    byte DDRB1       :1;                                       /* Data Direction Register B Bit 1 */
    byte DDRB2       :1;                                       /* Data Direction Register B Bit 2 */
    byte DDRB3       :1;                                       /* Data Direction Register B Bit 3 */
    byte DDRB4       :1;                                       /* Data Direction Register B Bit 4 */
    byte DDRB5       :1;                                       /* Data Direction Register B Bit 5 */
    byte DDRB6       :1;                                       /* Data Direction Register B Bit 6 */
    byte DDRB7       :1;                                       /* Data Direction Register B Bit 7 */
  } Bits;
  struct {
    byte grpDDRB :8;
  } MergedBits;
} DDRBSTR;
extern volatile DDRBSTR _DDRB @0x00000005;
#define DDRB _DDRB.Byte
#define DDRB_DDRB0 _DDRB.Bits.DDRB0
#define DDRB_DDRB1 _DDRB.Bits.DDRB1
#define DDRB_DDRB2 _DDRB.Bits.DDRB2
#define DDRB_DDRB3 _DDRB.Bits.DDRB3
#define DDRB_DDRB4 _DDRB.Bits.DDRB4
#define DDRB_DDRB5 _DDRB.Bits.DDRB5
#define DDRB_DDRB6 _DDRB.Bits.DDRB6
#define DDRB_DDRB7 _DDRB.Bits.DDRB7
#define DDRB_DDRB _DDRB.MergedBits.grpDDRB

#define DDRB_DDRB0_MASK   1
#define DDRB_DDRB0_BITNUM 0
#define DDRB_DDRB1_MASK   2
#define DDRB_DDRB1_BITNUM 1
#define DDRB_DDRB2_MASK   4
#define DDRB_DDRB2_BITNUM 2
#define DDRB_DDRB3_MASK   8
#define DDRB_DDRB3_BITNUM 3
#define DDRB_DDRB4_MASK   16
#define DDRB_DDRB4_BITNUM 4
#define DDRB_DDRB5_MASK   32
#define DDRB_DDRB5_BITNUM 5
#define DDRB_DDRB6_MASK   64
#define DDRB_DDRB6_BITNUM 6
#define DDRB_DDRB7_MASK   128
#define DDRB_DDRB7_BITNUM 7
#define DDRB_DDRB_MASK  255
#define DDRB_DDRB_BITNUM  0


⌨️ 快捷键说明

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