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

📄 mscanreg.h

📁 freescale最新的16位单片机
💻 H
字号:
/******************************************************************************    
Copyright (c) Motorola 2000
File Name                :      $RCSfile: msCANreg.h,v $                
        
Engineer                 :      $Author: r52458 $

Location                 :      EKB

Date Created     :      21/06/00

Current Revision :      $Revision: 1.1 $

Notes            :  Define msCAN registers.

*******************************************************************************
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 ot 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 unintended
or unauthorized application, Buyer shall idemnify 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 unathorized 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 MSCANREG_H
#define MSCANREG_H           /* This header file */

#include "msCANstd.h"

/******************************************************************************
msCAN module registers 
******************************************************************************/
#define CANCTL0  		(*((volatile UINT8  *const)(CAN_BaseAddress)))
#define CANCTL1  		(*((volatile UINT8  *const)(CAN_BaseAddress + 0x01)))
#define CANBTR0  		(*((         UINT8  *const)(CAN_BaseAddress + 0x02)))
#define CANBTR1  		(*((         UINT8  *const)(CAN_BaseAddress + 0x03)))
#define CANRFLG  		(*((volatile UINT8  *const)(CAN_BaseAddress + 0x04)))
#define CANRIER  		(*((volatile UINT8  *const)(CAN_BaseAddress + 0x05)))
#define CANTFLG  		(*((volatile UINT8  *const)(CAN_BaseAddress + 0x06)))
#define CANTIER  		(*((volatile UINT8  *const)(CAN_BaseAddress + 0x07)))
#define CANTARQ  		(*((volatile UINT8  *const)(CAN_BaseAddress + 0x08)))
#define CANTAAK  		(*((volatile UINT8  *const)(CAN_BaseAddress + 0x09)))
#define CANTBSEL 		(*((volatile UINT8  *const)(CAN_BaseAddress + 0x0A)))
#define CANIDAC  		(*((volatile UINT8  *const)(CAN_BaseAddress + 0x0B)))

#define CANRXERR 		(*((volatile UINT8  *const)(CAN_BaseAddress + 0x0E)))
#define CANTXERR 		(*((volatile UINT8  *const)(CAN_BaseAddress + 0x0F)))
#define CANIDAR0 		(*((         UINT8  *const)(CAN_BaseAddress + 0x10)))
#define CANIDAR1 		(*((         UINT8  *const)(CAN_BaseAddress + 0x11)))
#define CANIDAR2 		(*((         UINT8  *const)(CAN_BaseAddress + 0x12)))
#define CANIDAR3 		(*((         UINT8  *const)(CAN_BaseAddress + 0x13)))
#define CANIDMR0 		(*((         UINT8  *const)(CAN_BaseAddress + 0x14)))
#define CANIDMR1 		(*((         UINT8  *const)(CAN_BaseAddress + 0x15)))
#define CANIDMR2 		(*((         UINT8  *const)(CAN_BaseAddress + 0x16)))
#define CANIDMR3 		(*((         UINT8  *const)(CAN_BaseAddress + 0x17)))
#define CANIDAR4 		(*((         UINT8  *const)(CAN_BaseAddress + 0x18)))
#define CANIDAR5 		(*((         UINT8  *const)(CAN_BaseAddress + 0x19)))
#define CANIDAR6 		(*((         UINT8  *const)(CAN_BaseAddress + 0x1A)))
#define CANIDAR7 		(*((         UINT8  *const)(CAN_BaseAddress + 0x1B)))
#define CANIDMR4 		(*((         UINT8  *const)(CAN_BaseAddress + 0x1C)))
#define CANIDMR5 		(*((         UINT8  *const)(CAN_BaseAddress + 0x1D)))
#define CANIDMR6 		(*((         UINT8  *const)(CAN_BaseAddress + 0x1E)))
#define CANIDMR7 		(*((         UINT8  *const)(CAN_BaseAddress + 0x1F)))
                	
#define RX_BUFF  		  ((	 CAN_RX_MB  *const)(CAN_BaseAddress + 0x20))
#define RX_BUFF_IDR0    (*((volatile UINT8  *const)(CAN_BaseAddress + 0x20)))
#define RX_BUFF_IDR1    (*((volatile UINT8  *const)(CAN_BaseAddress + 0x21)))
#define RX_BUFF_IDR2    (*((volatile UINT8  *const)(CAN_BaseAddress + 0x22)))
#define RX_BUFF_IDR3    (*((volatile UINT8  *const)(CAN_BaseAddress + 0x23)))
#define RX_BUFF_DSR_Ptr   ((volatile UINT8  *const)(CAN_BaseAddress + 0x24))
#define RX_BUFF_DLR     (*((volatile UINT8  *const)(CAN_BaseAddress + 0x2C)))
#define RX_BUFF_TSR     (*((volatile UINT16 *const)(CAN_BaseAddress + 0x2E)))

#define TX_BUFF_IDR_Ptr   ((volatile UINT32 *const)(CAN_BaseAddress + 0x30))
#define TX_BUFF_IDR0    (*((volatile UINT8  *const)(CAN_BaseAddress + 0x30)))
#define TX_BUFF_IDR1    (*((volatile UINT8  *const)(CAN_BaseAddress + 0x31)))
#define TX_BUFF_IDR2    (*((volatile UINT8  *const)(CAN_BaseAddress + 0x32)))
#define TX_BUFF_IDR3    (*((volatile UINT8  *const)(CAN_BaseAddress + 0x33)))
#define TX_BUFF_DSR_Ptr   ((volatile UINT8  *const)(CAN_BaseAddress + 0x34))
#define TX_BUFF_DLR     (*((volatile UINT8  *const)(CAN_BaseAddress + 0x3C)))
#define TX_BUFF_TBPR    (*((volatile UINT8  *const)(CAN_BaseAddress + 0x3D)))
#define TX_BUFF_TSR     (*((volatile UINT16 *const)(CAN_BaseAddress + 0x3E)))


/******************************************************************************
msCAN module bit defines 
******************************************************************************/
/* CANCTL0 */
#define INITRQ  0x01
#define SLPRQ   0x02
#define WUPE    0x04
#define TIME    0x08
#define SYNCH   0x10
#define CSWAI   0x20
#define RXACT   0x40
#define RXFRM   0x80

/* CANCTL1 */
#define INITAK  0x01
#define SLPAK   0x02

/* CANRFLG */
#define RXF     0x01
#define OVRIF   0x02
#define TSTAT0  0x04
#define TSTAT1  0x08
#define RSTAT0  0x10
#define RSTAT1  0x20
#define CSCIF   0x40
#define WUPIF   0x80
#define BUSOFF  0x0C

/* CANRIER */
#define RXFIE   0x01
#define OVRIE   0x02
#define TSTATE0 0x04
#define TSTATE1 0x08
#define RSTATE0 0x10
#define RSTATE1 0x20
#define CSCIE   0x40
#define WUPIE   0x80

/* TX BUFFERS */
#define IDR0    0x00
#define IDR1    0x01
#define IDR2    0x02
#define IDR3    0x03
#define DSR     0x04
#define DLR     0x0C
#define TBPR    0x0D
/*****************************************************************************/
#endif        /* end msCANreg.h */ 

⌨️ 快捷键说明

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