📄 vme.h
字号:
/*
* linux/drivers/char/vme.h
*
* Copyright (C) 2006 - 2007 yang xu
*
* VME Bus Control Driver 0.1
*/
#ifndef _VME_H
#define _VME_H
#define MAJOR_NUM 232
#define IOCTL_WRITE _IOWR(MAJOR_NUM,0,unsigned int )
#define IOCTL_READ _IOWR(MAJOR_NUM,1,unsigned int )
//--------------------------------------------------------------------
#define VME_PHYSICAL_REG_ADDR 0x80100000
#define VME_PHYSICAL_REG_SIZE 0x1000
unsigned int *vme_RegAddr,*vme_RegAddr_temp;
static unsigned int vme_off;static int addr_tmp;
// the following are control register address
#define VME_BASE1 0x80100000
#define VME_CSR_OFF 0x00000000
#define VME_CSRL_OFF 0x00000000
#define VME_CSRH_OFF 0x00000002
#define VME_ADDR_OFF 0x00000004
#define VME_ADDRL_OFF 0x00000004
#define VME_ADDRH_OFF 0x00000006
#define VME_DATA_OFF 0x00000008
#define VME_READ_CTRL 0x3e290000#define VME_WRITE_CTRL 0x3e190000#define IRQ_NUMBER 30//define command#define CTRL_CMD 1#define ADDR_CMD 2#define DATA_CMD 4/* * Macros to help debugging */#undef VME_DEBUG#ifdef VME_DEBUG# ifdef __KERNEL__ /* This one if debugging is on, and kernel space */# define PDEBUG(fmt, args...) printk( KERN_DEBUG "scull: " fmt, ## args)# else /* This one for user space */# define PDEBUG(fmt, args...) fprintf(stderr, fmt, ## args)# endif#else# define PDEBUG(fmt, args...) /* not debugging: nothing */#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -