RK3568-GIC中断控制器

RK3568-GIC中断控制器

中断驱动程序

# include 
# include 
# include 
# include 
int irq;
irqreturn_t test interrupt ( int irq , void * args ){
	printk (" This is test interrupt \ n ");
	return IRQ RETVAL ( IRQ HANDLED );
}
static int interrupt_irq_init(void){
	int ret;
	irq = gpio_to_irq(13);
	printk ("irq is %d\n", irq);
	ret = request_irq(irq, test interrupt, IRQF TRIGGER RISING, "test", NULL);
	if (ret < 0){
		printk ("request_irq is error\n");
		return -1;
	}
	return 0;
}
static void interrupt_irq_exit (void)
{
	free_irq(irq, NULL);
	printk("bye bye\n");
}
module_init(interrupt_irq_init);
module_exit(interrupt_irq_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("CHEN");

相关API函数

中断
	中断标志位 include/linux/interrupt.h
	中断号 unsign

你可能感兴趣的:(RK3568,单片机,嵌入式硬件)