当前位置: 技术问答>linux和unix
关于一个中断驱动,请求支援,谢!!!!
来源: 互联网 发布时间:2016-07-29
本文导语: 写了一个模拟SPI驱动,里面嵌入了中断,静态编译进内核2.4,发现中断没有响应,也不会调试。那位大侠指点一下,感激不尽!!!!比较急,谢谢!!! static int major = 229; static volatile int dataSPI = 0; sta...
写了一个模拟SPI驱动,里面嵌入了中断,静态编译进内核2.4,发现中断没有响应,也不会调试。那位大侠指点一下,感激不尽!!!!比较急,谢谢!!!
static int major = 229;
static volatile int dataSPI = 0;
static int spi_drv_open(struct inode* inode, struct file *file)
{
MOD_INC_USE_COUNT;
return 0;
}
static int spi_drv_release(struct inode* inode, struct file *file)
{
MOD_DEC_USE_COUNT;
return 0;
}
static int spi_drv_ioctl(struct inode* inode, struct file *file, int DEVICE_SPI, unsigned int arg)
{
这个函数操作起来没有问题,是用SPI输出数据的!
}
static int spi_drv_read(struct file *filp, int *buff, size_t count, loff_t *offp)
{
buff = &(dataSPI);
printk("dataSPI = %dn", *buff);
return 0;
}
static int spi_drv_interrupt(int irq, void *dev_id)
{
volatile int temp = 0;
int power = 1;
int i = 7;
printk("here is in interruptn");
for (; i >= 0; i--){
while ((GPEDAT & (1
static int major = 229;
static volatile int dataSPI = 0;
static int spi_drv_open(struct inode* inode, struct file *file)
{
MOD_INC_USE_COUNT;
return 0;
}
static int spi_drv_release(struct inode* inode, struct file *file)
{
MOD_DEC_USE_COUNT;
return 0;
}
static int spi_drv_ioctl(struct inode* inode, struct file *file, int DEVICE_SPI, unsigned int arg)
{
这个函数操作起来没有问题,是用SPI输出数据的!
}
static int spi_drv_read(struct file *filp, int *buff, size_t count, loff_t *offp)
{
buff = &(dataSPI);
printk("dataSPI = %dn", *buff);
return 0;
}
static int spi_drv_interrupt(int irq, void *dev_id)
{
volatile int temp = 0;
int power = 1;
int i = 7;
printk("here is in interruptn");
for (; i >= 0; i--){
while ((GPEDAT & (1