?? s12_page.h
字號:
/*****************************************************************************/
/* COPYRIGHT (c) MOTOROLA 2002 */
/* */
/* File Name : $RCSfile: s12_page.h,v $ */
/* */
/* Current Revision : $Revision: 1.2 $ */
/* */
/* PURPOSE: header file for HCS12 Page (MEBI) register block */
/* */
/* *********************************************************************** */
/* * THIS CODE IS ONLY INTENDED AS AN EXAMPLE OF CODE FOR THE * */
/* * METROWERKS COMPILER AND THE STAR12 EVB AND HAS ONLY BEEN GIVEN A * */
/* * MIMIMUM LEVEL OF TEST. IT IS PROVIDED 'AS SEEN' WITH NO GUARANTEES * */
/* * AND NO PROMISE OF SUPPORT. * */
/* *********************************************************************** */
/* */
/* */
/* DESCRIPTION: Defines the paging (MEBI) register block as a datastructure */
/* of type tPAGE. */
/* */
/* PAGE module base address (out of reset) - */
/* */
/* S12DP256 : 0x0030 */
/* */
/* The datastructure compiled can be determined by the #define's S12DP256, */
/* S12xxx, etc. These definitions can be found in "s12_common.h". */
/* The MCU id can be #defined in a "target.h" header file or included as a */
/* complier command line argument as -DS12DP256. */
/* Currently only S12DP256 is supported. */
/* */
/* Multiple register descriptions are used when a differing bit structure */
/* exists between parts. In the case of additional bit definitions within */
/* the same register, then only the full register description is used. */
/* */
/* */
/* AUTHOR: R32151 LOCATION: SPSEKB LAST EDIT DATE: 14/03/02 */
/* */
/* UPDATE HISTORY */
/* REV AUTHOR DATE DESCRIPTION OF CHANGE */
/* --- ------ -------- --------------------- */
/* 1.00 r32151 28/4/00 */
/* 1.01 r32151 10/5/00 - changed bit/mask names on Port K */
/* consistant with PIM ports */
/* - Changed #include <s12_common.h> */
/* to #include "s12_common.h" */
/* 1.1 r32151 11/03/02 - Added disclaimer and reformated file info. */
/* - Modified revision numbering to match RCS */
/* 1.2 r32151 14/03/02 - Declared all registers volatile */
/* */
/*===========================================================================*/
/* Motorola reserves the right to make changes without further notice to any */
/* product herein to improve reliability, function, or design. Motorola does */
/* not assume any liability arising out of the application or use of any */
/* product, circuit, or software described herein; neither does it convey */
/* any license under its patent rights nor the rights of others. Motorola */
/* products are not designed, intended, or authorized for use as components */
/* in systems intended for surgical implant into the body, or other */
/* applications intended to support life, or for any other application in */
/* which the failure of the Motorola product could create a situation where */
/* personal injury or death may occur. Should Buyer purchase or use Motorola */
/* products for any such intended or unauthorized application, Buyer shall */
/* indemnify and hold Motorola and its officers, employees, subsidiaries, */
/* affiliates, and distributors harmless against all claims costs, damages, */
/* and expenses, and reasonable attorney fees arising out of, directly or */
/* indirectly, any claim of personal injury or death associated with such */
/* unintended or unauthorized use, even if such claim alleges that Motorola */
/* was negligent regarding the design or manufacture of the part. Motorola */
/* and the Motorola logo* are registered trademarks of Motorola Ltd. */
/*****************************************************************************/
#ifndef S12_PAGE_H /*prevent duplicated includes */
#define S12_PAGE_H
#ifndef S12_COMMON_H /*prevent duplicated includes */
#include "s12_common.h"
#endif
typedef union uPPAGE
{
tU08 byte;
struct
{
tU08 pix :6; /*active page bits */
tU08 :2; /* not used */
}bit;
}tPPAGE;
#define PIX0 0x01 /*bit masks */
#define PIX1 0x02
#define PIX2 0x04
#define PIX3 0x08
#define PIX4 0x10
#define PIX5 0x20
typedef union uPORTK
{
tU08 byte;
struct
{
tU08 ptk0 :1; /*i/o port pins */
tU08 ptk1 :1;
tU08 ptk2 :1;
tU08 ptk3 :1;
tU08 ptk4 :1;
tU08 ptk5 :1;
tU08 ptk6 :1;
tU08 ptk7 :1;
}bit;
}tPORTK;
#define PTK0 0x01 /*bit masks */
#define PTK1 0x02
#define PTK2 0x04
#define PTK3 0x08
#define PTK4 0x10
#define PTK5 0x20
#define PTK6 0x40
#define PTK7 0x80
typedef union uDDRK
{
tU08 byte;
struct
{
tU08 ddrk0 :1; /*data direction bits (0:input;1:output) */
tU08 ddrk1 :1;
tU08 ddrk2 :1;
tU08 ddrk3 :1;
tU08 ddrk4 :1;
tU08 ddrk5 :1;
tU08 ddrk6 :1;
tU08 ddrk7 :1;
}bit;
}tDDRK;
#define DDRK0 0x01 /*bit masks */
#define DDRK1 0x02
#define DDRK2 0x04
#define DDRK3 0x08
#define DDRK4 0x10
#define DDRK5 0x20
#define DDRK6 0x40
#define DDRK7 0x80
typedef struct /*page module used on the Dx256 */
{
volatile tPPAGE ppage; /*program page index register */
tU08 rsv; /*reserved (maintaining memory map) */
volatile tPORTK portk; /*port K data register */
volatile tDDRK ddrk; /*port K data direction register */
}tPAGE;
#endif /*S12_PAGE_H */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -