硬件信息怎样传送给软件系统
其中与注册 IRQ 中断号相关的语句为:/* Get IRQ for the device */r_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);if (!r_irq) {dev_info(dev, "no IRQ found\n");dev_info(dev, "mymodule at 0x%08x mapped to 0x%08x\n",(unsigned int __force)lp->mem_start,(unsigned int __force)lp->base_addr);return 0;}lp->irq = r_irq->start;rc = request_irq(lp->irq, &mymodule_irq, 0, DRIVER_NAME, lp);if (rc) {dev_err(dev, "testmodule: Could not allocate interrupt %d.\n",lp-> 其中与注册 IRQ 中断号相关的语句为:/* Get IRQ for the device */r_irq = platform_get_resource(pdev, IORESOURCE_IRQ, 0);if (!r_irq) {dev_info(dev, "no IRQ found\n");dev_info(dev, "mymodule at 0x%08x mapped to 0x%08x\n",(unsigned int __force)lp->mem_start,(unsigned int __force)lp->base_addr);return 0;}lp->irq = r_irq->start;rc = request_irq(lp->irq, &mymodule_irq, 0, DRIVER_NAME, lp);if (rc) {dev_err(dev, "testmodule: Could not allocate interrupt %d.\n",lp->irq);goto error3;}
注意上面的程序是通过读取 dts 获取中断的信息,然后让操作系统分配一个虚拟中断号。以前注册中断号是通过手工在 C 代码中填入中断号,现在这种方法不可行了,请使用虚拟中断号的方法。
- 灵活PSoC架构!单点、多点触控识别不是事(05-07)
- 千万门级国产FPGA芯片突破还待时日(02-18)
- 从Flash和SRAM中触发中断的过程示例(08-28)
- 德州仪器DSP开发常见问题宝典(04-22)
- 教你选择合适的微控制器(06-22)
- ARM单片机三种中断返回情况的分析与解决(03-28)