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

📄 mc68hc908ql4.h

📁 摩托罗拉公司发布的QL4的Lin总线kit,freescale网站上花钱买的
💻 H
📖 第 1 页 / 共 5 页
字号:
/*
** ###################################################################
**
**	MODIFIED FOR APP NOTE ON MC68HC908QL4 - NOT THE OFFICIAL BEAN MODULE
**     Filename  : MC68HC908QL4.H
**     Processor : MC68HC908QL4CP
**     Version   : Driver 00.01
**     Compiler  : Metrowerks HC08 C Compiler V-5.0.13
**     Date      :  8 Aug 2003
**     Author	 : Matt Ruff
**  Based on QY4 header file (info below)
**
**     THIS BEAN MODULE IS GENERATED BY THE TOOL. DO NOT MODIFY IT.
**
**     Filename  : MC68HC908QY4.H
** 
**     Processor : MC68HC908QY4CP
**
**     Version   : Driver 01.02
**
**     Compiler  : Metrowerks HC08 C Compiler V-5.0.13
**
**     Date/Time : 05.08.2002, 06:24
**
**     Abstract  :
**
**         This implements an IO devices mapping.
**
**     Settings  :
**
**
**
**     Contents  :
**
**         No public methods
**
**
**     (c) Copyright UNIS, spol. s r.o. 1997-2002
**
**     UNIS, spol. s r.o.
**     Jundrovska 33
**     624 00 Brno
**     Czech Republic
**
**     http      : www.processorexpert.com
**     mail      : info@processorexpert.com
**
** ###################################################################
*/

#ifndef _MC68HC908QL4_P_DW_H
#define _MC68HC908QL4_P_DW_H


typedef unsigned char byte;
typedef unsigned int word;
typedef unsigned long dword;
typedef unsigned long dlong[2];

#ifdef _lint
  #define __RESET_WATCHDOG() /* empty */
#else
  #define __RESET_WATCHDOG() {asm sta COPCTL;} /* just write a byte to feed the dog */
#endif

#pragma MESSAGE DISABLE C1106 /* WARNING C1106: Non-standard bitfield type */
/* Based on CPU DB MC68HC908QY4_P_DW, version 2.87.063 */

/*** PTA - Port A Data Register ***/
typedef union {
  byte Byte;
  struct {
    byte PTA0    :1;           /* Port A Data Bit 0, Keyboard interrupt pin 0 */
    byte PTA1    :1;           /* Port A Data Bit 1, Keyboard interrupt pin 1 */
    byte PTA2    :1;           /* Port A Data Bit 2, Keyboard interrupt pin 2 */
    byte PTA3    :1;           /* Port A Data Bit 3, Keyboard interrupt pin 3 */
    byte PTA4    :1;           /* Port A Data Bit 4, Keyboard interrupt pin 4 */
    byte PTA5    :1;           /* Port A Data Bit 5, Keyboard interrupt pin 5 */
    byte AWUL    :1;           /* Auto Wake-up Latch Data Bit */
    byte         :1; 
  } Bits;
  struct {
    byte PTA_0   :6;
    byte AWUL    :1;
    byte         :1;
  } 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_AWUL _PTA.Bits.AWUL
#define PTA_PTA _PTA.MergedBits.PTA_0

/*** PTB - Port B Data Register ***/
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 PTB     :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.PTB

/*** DDRA - Data Direction Register A ***/
typedef union {
  byte Byte;
  struct {
    byte DDRA0   :1;           /* Data Direction Register A Bit 0 */
    byte DDRA1   :1;           /* Data Direction Register A Bit 1 */
    byte         :1; 
    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         :1; 
    byte         :1; 
  } Bits;
  struct {
    byte DDRA_0  :2;
    byte         :1;
    byte DDRA_3  :3;
    byte         :1;
    byte         :1;
  } 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_DDRA3 _DDRA.Bits.DDRA3
#define DDRA_DDRA4 _DDRA.Bits.DDRA4
#define DDRA_DDRA5 _DDRA.Bits.DDRA5
#define DDRA_DDRA _DDRA.MergedBits.DDRA_0
#define DDRA_DDRA_3 _DDRA.MergedBits.DDRA_3

/*** DDRB - Data Direction Register B ***/
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 DDRB    :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.DDRB

/*** PTAPUE - Input Pull-Up Enable Register PTAPUE ***/
typedef union {
  byte Byte;
  struct {
    byte PTAPUE0 :1;           /* Pull-Up Enable bit 0, Port A */
    byte PTAPUE1 :1;           /* Pull-Up Enable bit 1, Port A */
    byte PTAPUE2 :1;           /* Pull-Up Enable bit 2, Port A */
    byte PTAPUE3 :1;           /* Pull-Up Enable bit 3, Port A */
    byte PTAPUE4 :1;           /* Pull-Up Enable bit 4, Port A */
    byte PTAPUE5 :1;           /* Pull-Up Enable bit 5, Port A */
    byte         :1; 
    byte OSC2EN  :1;           /* Enable PTA4 on OSC2 Pin */
  } Bits;
  struct {
    byte PTAPUE_0:6;
    byte         :1;
    byte OSC2EN  :1;
  } MergedBits;
} PTAPUESTR;
extern volatile PTAPUESTR _PTAPUE @0x0000000B;
#define PTAPUE _PTAPUE.Byte
#define PTAPUE_PTAPUE0 _PTAPUE.Bits.PTAPUE0
#define PTAPUE_PTAPUE1 _PTAPUE.Bits.PTAPUE1
#define PTAPUE_PTAPUE2 _PTAPUE.Bits.PTAPUE2
#define PTAPUE_PTAPUE3 _PTAPUE.Bits.PTAPUE3
#define PTAPUE_PTAPUE4 _PTAPUE.Bits.PTAPUE4
#define PTAPUE_PTAPUE5 _PTAPUE.Bits.PTAPUE5
#define PTAPUE_OSC2EN _PTAPUE.Bits.OSC2EN
#define PTAPUE_PTAPUE _PTAPUE.MergedBits.PTAPUE_0

/*** PTBPUE - Input Pull-Up Enable Register PTBPUE ***/
typedef union {
  byte Byte;
  struct {
    byte PTBPUE0 :1;           /* Pull-Up Enable bit 0, Port B */
    byte PTBPUE1 :1;           /* Pull-Up Enable bit 1, Port B */
    byte PTBPUE2 :1;           /* Pull-Up Enable bit 2, Port B */
    byte PTBPUE3 :1;           /* Pull-Up Enable bit 3, Port B */
    byte PTBPUE4 :1;           /* Pull-Up Enable bit 4, Port B */
    byte PTBPUE5 :1;           /* Pull-Up Enable bit 5, Port B */
    byte PTBPUE6 :1;           /* Pull-Up Enable bit 6, Port B */
    byte PTBPUE7 :1;           /* Pull-Up Enable bit 7, Port B */
  } Bits;
  struct {
    byte PTBPUE  :8;
  } MergedBits;
} PTBPUESTR;
extern volatile PTBPUESTR _PTBPUE @0x0000000C;
#define PTBPUE _PTBPUE.Byte
#define PTBPUE_PTBPUE0 _PTBPUE.Bits.PTBPUE0
#define PTBPUE_PTBPUE1 _PTBPUE.Bits.PTBPUE1
#define PTBPUE_PTBPUE2 _PTBPUE.Bits.PTBPUE2
#define PTBPUE_PTBPUE3 _PTBPUE.Bits.PTBPUE3
#define PTBPUE_PTBPUE4 _PTBPUE.Bits.PTBPUE4
#define PTBPUE_PTBPUE5 _PTBPUE.Bits.PTBPUE5
#define PTBPUE_PTBPUE6 _PTBPUE.Bits.PTBPUE6
#define PTBPUE_PTBPUE7 _PTBPUE.Bits.PTBPUE7
#define PTBPUE_PTBPUE _PTBPUE.MergedBits.PTBPUE

/*** KBSCR - Keyboard Status and Control Register ***/
typedef union {
  byte Byte;
  struct {
    byte MODEK   :1;           /* Keyboard Triggering Sensitivity Bit */
    byte IMASKK  :1;           /* Keyboard Interrupt Mask Bit */
    byte ACKK    :1;           /* Keyboard Acknowledge Bit */
    byte KEYF    :1;           /* Keyboard Flag Bit */
    byte         :1; 
    byte         :1; 
    byte         :1; 
    byte         :1; 
  } Bits;
} KBSCRSTR;
extern volatile KBSCRSTR _KBSCR @0x0000001A;
#define KBSCR _KBSCR.Byte
#define KBSCR_MODEK _KBSCR.Bits.MODEK
#define KBSCR_IMASKK _KBSCR.Bits.IMASKK
#define KBSCR_ACKK _KBSCR.Bits.ACKK
#define KBSCR_KEYF _KBSCR.Bits.KEYF

/*** KBIER - Keyboard Interrrupt Enable Register KBIER ***/
typedef union {
  byte Byte;
  struct {
    byte KBIE0   :1;           /* Keyboard Interrupt Enable Bit 0 */
    byte KBIE1   :1;           /* Keyboard Interrupt Enable Bit 1 */
    byte KBIE2   :1;           /* Keyboard Interrupt Enable Bit 2 */
    byte KBIE3   :1;           /* Keyboard Interrupt Enable Bit 3 */
    byte KBIE4   :1;           /* Keyboard Interrupt Enable Bit 4 */
    byte KBIE5   :1;           /* Keyboard Interrupt Enable Bit 5 */
    byte AWUIE   :1;           /* Auto Wake-up Interrupt Enable Bit */
    byte         :1; 
  } Bits;
  struct {
    byte KBIE    :6;
    byte AWUIE   :1;
    byte         :1;
  } MergedBits;
} KBIERSTR;
extern volatile KBIERSTR _KBIER @0x0000001B;
#define KBIER _KBIER.Byte
#define KBIER_KBIE0 _KBIER.Bits.KBIE0
#define KBIER_KBIE1 _KBIER.Bits.KBIE1
#define KBIER_KBIE2 _KBIER.Bits.KBIE2
#define KBIER_KBIE3 _KBIER.Bits.KBIE3
#define KBIER_KBIE4 _KBIER.Bits.KBIE4
#define KBIER_KBIE5 _KBIER.Bits.KBIE5
#define KBIER_AWUIE _KBIER.Bits.AWUIE
#define KBIER_KBIE _KBIER.MergedBits.KBIE

/*** INTSCR - IRQ Status and Control Register  -MBR ***/
typedef union {
  byte Byte;
  struct {
//    byte MODE1   :1;           /* IRQ Edge/Level Select Bit */
//    byte IMASK1  :1;           /* IRQ1 Interrupt Mask Bit */
//    byte ACK1    :1;           /* IRQ1 Interrupt Request Acknowledge Bit */
//    byte IRQF1   :1;           /* IRQ1 Flag Bit */
    byte MODE    :1;           /* IRQ Edge/Level Select Bit -MBR */
    byte IMASK   :1;           /* IRQ1 Interrupt Mask Bit */
    byte ACK     :1;           /* IRQ1 Interrupt Request Acknowledge Bit */
    byte IRQF    :1;           /* IRQ1 Flag Bit */
    byte         :1; 
    byte         :1; 
    byte         :1; 
    byte         :1; 
  } Bits;
} INTSCRSTR;
extern volatile INTSCRSTR _INTSCR @0x0000001D;
#define INTSCR _INTSCR.Byte
//#define INTSCR_MODE1 _INTSCR.Bits.MODE1
//#define INTSCR_IMASK1 _INTSCR.Bits.IMASK1
//#define INTSCR_ACK1 _INTSCR.Bits.ACK1
//#define INTSCR_IRQF1 _INTSCR.Bits.IRQF1
#define INTSCR_MODE _INTSCR.Bits.MODE
#define INTSCR_IMASK _INTSCR.Bits.IMASK
#define INTSCR_ACK _INTSCR.Bits.ACK
#define INTSCR_IRQF _INTSCR.Bits.IRQF

/*** CONFIG2 - Configuration Register 2  -MBR  ***/
typedef union {
  byte Byte;
  struct {
    byte RSTEN   :1;           /* RST Pin Function Selection */
//    byte         :1; 
//    byte         :1; 
    byte IRQEN   :1;           /* IRQ Pin Function Selection Bit */
    byte IRQPUD  :1;           /* IRQ Pin Pullup Control Bit */
    byte OSCOPT0 :1;           /* Selection Bits for Oscillator Option */
    byte OSCOPT1 :1;           /* Selection Bits for Oscillator Option */
    byte         :1; 
//    byte IRQEN   :1;           /* IRQ Pin Function Selection Bit */
//    byte IRQPUD  :1;           /* IRQ Pin Pullup Control Bit */
    byte         :1; 
    byte         :1; 
  } Bits;
  struct {
    byte RSTEN   :1;
//    byte         :1;
//    byte         :1;
    byte IRQEN   :1;
    byte IRQPUD  :1;
    byte OSCOPT  :2;
    byte         :1;
//    byte IRQEN   :1;
//    byte IRQPUD  :1;
    byte         :1;
    byte         :1;
  } MergedBits;
} CONFIG2STR;
extern volatile CONFIG2STR _CONFIG2 @0x0000001E;
#define CONFIG2 _CONFIG2.Byte
#define CONFIG2_RSTEN _CONFIG2.Bits.RSTEN
#define CONFIG2_OSCOPT0 _CONFIG2.Bits.OSCOPT0
#define CONFIG2_OSCOPT1 _CONFIG2.Bits.OSCOPT1
#define CONFIG2_IRQEN _CONFIG2.Bits.IRQEN
#define CONFIG2_IRQPUD _CONFIG2.Bits.IRQPUD
#define CONFIG2_OSCOPT _CONFIG2.MergedBits.OSCOPT

/*** CONFIG1 - Configuration Register 1 ***/
typedef union {
  byte Byte;
  struct {

⌨️ 快捷键说明

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