📄 mc68hc908jb8.h
字号:
/*------------------------------------------------------------------------- Register Declarations for Motorola MC68HC908JB8 Copyright (c) 2004, Bjorn Bringert <bjorn@bringert.net> Based on mc68hc908qy.h, Written By - Erik Petrich epetrich@users.sourceforge.net (2003) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. In other words, you are welcome to use, share and improve this program. You are forbidden to forbid anyone else to use, share and improve what you give them. Help stamp out software-hoarding!-------------------------------------------------------------------------*/#ifndef _MC68HC908JB8_H#define _MC68HC908JB8_H#ifndef _UINT8 #define _UINT8 unsigned char#endif#ifndef _UINT16 #define _UINT16 unsigned int#endif#ifndef _VOLDATA #define _VOLDATA volatile __data#endif#ifndef _VOLXDATA #define _VOLXDATA volatile __xdata#endifstruct __hc08_bits{ unsigned int bit0:1; unsigned int bit1:1; unsigned int bit2:1; unsigned int bit3:1; unsigned int bit4:1; unsigned int bit5:1; unsigned int bit6:1; unsigned int bit7:1;};_VOLDATA _UINT8 __at 0x00 PTA; /* Port A Data Register */ #define PTA0 ((struct __hc08_bits *)(&PTA))->bit0 #define PTA1 ((struct __hc08_bits *)(&PTA))->bit1 #define PTA2 ((struct __hc08_bits *)(&PTA))->bit2 #define PTA3 ((struct __hc08_bits *)(&PTA))->bit3 #define PTA4 ((struct __hc08_bits *)(&PTA))->bit4 #define PTA5 ((struct __hc08_bits *)(&PTA))->bit5 #define PTA6 ((struct __hc08_bits *)(&PTA))->bit6 #define PTA7 ((struct __hc08_bits *)(&PTA))->bit7_VOLDATA _UINT8 __at 0x01 PTB; /* Port B Data Register */ #define PTB0 ((struct __hc08_bits *)(&PTB))->bit0 #define PTB1 ((struct __hc08_bits *)(&PTB))->bit1 #define PTB2 ((struct __hc08_bits *)(&PTB))->bit2 #define PTB3 ((struct __hc08_bits *)(&PTB))->bit3 #define PTB4 ((struct __hc08_bits *)(&PTB))->bit4 #define PTB5 ((struct __hc08_bits *)(&PTB))->bit5 #define PTB6 ((struct __hc08_bits *)(&PTB))->bit6 #define PTB7 ((struct __hc08_bits *)(&PTB))->bit7_VOLDATA _UINT8 __at 0x02 PTC; /* Port C Data Register */ #define PTC0 ((struct __hc08_bits *)(&PTC))->bit0 #define PTC1 ((struct __hc08_bits *)(&PTC))->bit1 #define PTC2 ((struct __hc08_bits *)(&PTC))->bit2 #define PTC3 ((struct __hc08_bits *)(&PTC))->bit3 #define PTC4 ((struct __hc08_bits *)(&PTC))->bit4 #define PTC5 ((struct __hc08_bits *)(&PTC))->bit5 #define PTC6 ((struct __hc08_bits *)(&PTC))->bit6 #define PTC7 ((struct __hc08_bits *)(&PTC))->bit7_VOLDATA _UINT8 __at 0x03 PTD; /* Port D Data Register */ #define PTD0 ((struct __hc08_bits *)(&PTD))->bit0 #define PTD1 ((struct __hc08_bits *)(&PTD))->bit1 #define PTD2 ((struct __hc08_bits *)(&PTD))->bit2 #define PTD3 ((struct __hc08_bits *)(&PTD))->bit3 #define PTD4 ((struct __hc08_bits *)(&PTD))->bit4 #define PTD5 ((struct __hc08_bits *)(&PTD))->bit5 #define PTD6 ((struct __hc08_bits *)(&PTD))->bit6 #define PTD7 ((struct __hc08_bits *)(&PTD))->bit7_VOLDATA _UINT8 __at 0x04 DDRA; /* Data Direction Register A */ #define DDRA0 ((struct __hc08_bits *)(&DDRA))->bit0 #define DDRA1 ((struct __hc08_bits *)(&DDRA))->bit1 #define DDRA2 ((struct __hc08_bits *)(&DDRA))->bit2 #define DDRA3 ((struct __hc08_bits *)(&DDRA))->bit3 #define DDRA4 ((struct __hc08_bits *)(&DDRA))->bit4 #define DDRA5 ((struct __hc08_bits *)(&DDRA))->bit5 #define DDRA6 ((struct __hc08_bits *)(&DDRA))->bit6 #define DDRA7 ((struct __hc08_bits *)(&DDRA))->bit7_VOLDATA _UINT8 __at 0x05 DDRB; /* Data Direction Register B */ #define DDRB0 ((struct __hc08_bits *)(&DDRB))->bit0 #define DDRB1 ((struct __hc08_bits *)(&DDRB))->bit1 #define DDRB2 ((struct __hc08_bits *)(&DDRB))->bit2 #define DDRB3 ((struct __hc08_bits *)(&DDRB))->bit3 #define DDRB4 ((struct __hc08_bits *)(&DDRB))->bit4 #define DDRB5 ((struct __hc08_bits *)(&DDRB))->bit5 #define DDRB6 ((struct __hc08_bits *)(&DDRB))->bit6 #define DDRB7 ((struct __hc08_bits *)(&DDRB))->bit7_VOLDATA _UINT8 __at 0x06 DDRC; /* Data Direction Register C */ #define DDRC0 ((struct __hc08_bits *)(&DDRC))->bit0 #define DDRC1 ((struct __hc08_bits *)(&DDRC))->bit1 #define DDRC2 ((struct __hc08_bits *)(&DDRC))->bit2 #define DDRC3 ((struct __hc08_bits *)(&DDRC))->bit3 #define DDRC4 ((struct __hc08_bits *)(&DDRC))->bit4 #define DDRC5 ((struct __hc08_bits *)(&DDRC))->bit5 #define DDRC6 ((struct __hc08_bits *)(&DDRC))->bit6 #define DDRC7 ((struct __hc08_bits *)(&DDRC))->bit7_VOLDATA _UINT8 __at 0x07 DDRD; /* Data Direction Register D */ #define DDRD0 ((struct __hc08_bits *)(&DDRD))->bit0 #define DDRD1 ((struct __hc08_bits *)(&DDRD))->bit1 #define DDRD2 ((struct __hc08_bits *)(&DDRD))->bit2 #define DDRD3 ((struct __hc08_bits *)(&DDRD))->bit3 #define DDRD4 ((struct __hc08_bits *)(&DDRD))->bit4 #define DDRD5 ((struct __hc08_bits *)(&DDRD))->bit5 #define DDRD6 ((struct __hc08_bits *)(&DDRD))->bit6 #define DDRD7 ((struct __hc08_bits *)(&DDRD))->bit7_VOLDATA _UINT8 __at 0x08 PTE; /* Port E Data Register */ #define PTE0 ((struct __hc08_bits *)(&PTE))->bit0 #define PTE1 ((struct __hc08_bits *)(&PTE))->bit1 #define PTE2 ((struct __hc08_bits *)(&PTE))->bit2 #define PTE3 ((struct __hc08_bits *)(&PTE))->bit3 #define PTE4 ((struct __hc08_bits *)(&PTE))->bit4 #define PTE5 ((struct __hc08_bits *)(&PTE))->bit5 #define PTE6 ((struct __hc08_bits *)(&PTE))->bit6 #define PTE7 ((struct __hc08_bits *)(&PTE))->bit7_VOLDATA _UINT8 __at 0x09 DDRE; /* Data Direction Register E */ #define DDRE0 ((struct __hc08_bits *)(&DDRE))->bit0 #define DDRE1 ((struct __hc08_bits *)(&DDRE))->bit1 #define DDRE2 ((struct __hc08_bits *)(&DDRE))->bit2 #define DDRE3 ((struct __hc08_bits *)(&DDRE))->bit3 #define DDRE4 ((struct __hc08_bits *)(&DDRE))->bit4 #define DDRE5 ((struct __hc08_bits *)(&DDRE))->bit5 #define DDRE6 ((struct __hc08_bits *)(&DDRE))->bit6 #define DDRE7 ((struct __hc08_bits *)(&DDRE))->bit7_VOLDATA _UINT8 __at 0x0a TSC; /* TIM Status and Control */ #define PS0 ((struct __hc08_bits *)(&TSC))->bit0 #define PS1 ((struct __hc08_bits *)(&TSC))->bit1 #define PS2 ((struct __hc08_bits *)(&TSC))->bit2 #define TRST ((struct __hc08_bits *)(&TSC))->bit4 #define TSTOP ((struct __hc08_bits *)(&TSC))->bit5 #define TOIE ((struct __hc08_bits *)(&TSC))->bit6 #define TOF ((struct __hc08_bits *)(&TSC))->bit7_VOLDATA _UINT16 __at 0x0c TCNT; /* TIM Counter High & Low Registers */_VOLDATA _UINT8 __at 0x0c TCNTH; /* TIM Counter Register High */_VOLDATA _UINT8 __at 0x0d TCNTL; /* TIM Counter Register Low */_VOLDATA _UINT16 __at 0x0e TMOD; /* TIM Counter Modulo High & Low Registers */_VOLDATA _UINT8 __at 0x0e TMODH; /* TIM Counter Modulo Register High */_VOLDATA _UINT8 __at 0x0f TMODL; /* TIM Counter Modulo Register Low */_VOLDATA _UINT8 __at 0x10 TSC0; /* TIM Channel 0 Status and Control Register */ #define CH0MAX ((struct __hc08_bits *)(&TSC0))->bit0 #define TOV0 ((struct __hc08_bits *)(&TSC0))->bit1 #define ELS0A ((struct __hc08_bits *)(&TSC0))->bit2 #define ELS0B ((struct __hc08_bits *)(&TSC0))->bit3 #define MS0A ((struct __hc08_bits *)(&TSC0))->bit4 #define MS0B ((struct __hc08_bits *)(&TSC0))->bit5 #define CH0IE ((struct __hc08_bits *)(&TSC0))->bit6 #define CH0F ((struct __hc08_bits *)(&TSC0))->bit7_VOLDATA _UINT16 __at 0x11 TCH0; /* TIM Channel 0 High & Low Registers */_VOLDATA _UINT8 __at 0x11 TCH0H; /* TIM Channel 0 Register High */_VOLDATA _UINT8 __at 0x12 TCH0L; /* TIM Channel 0 Register Low */_VOLDATA _UINT8 __at 0x13 TSC1; /* TIM Channel 1 Status and Control Register */ #define CH1MAX ((struct __hc08_bits *)(&TSC1))->bit0 #define TOV1 ((struct __hc08_bits *)(&TSC1))->bit1 #define ELS1A ((struct __hc08_bits *)(&TSC1))->bit2 #define ELS1B ((struct __hc08_bits *)(&TSC1))->bit3 #define MS1A ((struct __hc08_bits *)(&TSC1))->bit4 #define CH1IE ((struct __hc08_bits *)(&TSC1))->bit6 #define CH1F ((struct __hc08_bits *)(&TSC1))->bit7_VOLDATA _UINT16 __at 0x14 TCH1; /* TIM Channel 1 High & Low Registers */_VOLDATA _UINT8 __at 0x14 TCH1H; /* TIM Channel 1 Register High */_VOLDATA _UINT8 __at 0x15 TCH1L; /* TIM Channel 1 Register Low */_VOLDATA _UINT8 __at 0x16 KBSCR; /* Keyboard Status and Control Register */ #define MODEK ((struct __hc08_bits *)(&KBSCR))->bit0 #define IMASKK ((struct __hc08_bits *)(&KBSCR))->bit1 #define ACKK ((struct __hc08_bits *)(&KBSCR))->bit2 #define KEYF ((struct __hc08_bits *)(&KBSCR))->bit3
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -