【Linux 驱动基础】设备树中断

news2024/9/21 16:38:56

# 前置知识

interrupts

文档

Specifying interrupt information for devices
============================================

1) Interrupt client nodes
-------------------------

Nodes that describe devices which generate interrupts must contain an
"interrupts" property, an "interrupts-extended" property, or both. If both are
present, the latter should take precedence; the former may be provided simply
for compatibility with software that does not recognize the latter. These
properties contain a list of interrupt specifiers, one per output interrupt. The
format of the interrupt specifier is determined by the interrupt controller to
which the interrupts are routed; see section 2 below for details.

  Example:
	interrupt-parent = <&intc1>;
	interrupts = <5 0>, <6 0>;

The "interrupt-parent" property is used to specify the controller to which
interrupts are routed and contains a single phandle referring to the interrupt
controller node. This property is inherited, so it may be specified in an
interrupt client node or in any of its parent nodes. Interrupts listed in the
"interrupts" property are always in reference to the node's interrupt parent.

The "interrupts-extended" property is a special form for use when a node needs
to reference multiple interrupt parents. Each entry in this property contains
both the parent phandle and the interrupt specifier. "interrupts-extended"
should only be used when a device has multiple interrupt parents.

  Example:
	interrupts-extended = <&intc1 5 1>, <&intc2 1 0>;

2) Interrupt controller nodes
-----------------------------

A device is marked as an interrupt controller with the "interrupt-controller"
property. This is a empty, boolean property. An additional "#interrupt-cells"
property defines the number of cells needed to specify a single interrupt.

It is the responsibility of the interrupt controller's binding to define the
length and format of the interrupt specifier. The following two variants are
commonly used:

  a) one cell
  -----------
  The #interrupt-cells property is set to 1 and the single cell defines the
  index of the interrupt within the controller.

  Example:

	vic: intc@10140000 {
		compatible = "arm,versatile-vic";
		interrupt-controller;
		#interrupt-cells = <1>;
		reg = <0x10140000 0x1000>;
	};

	sic: intc@10003000 {
		compatible = "arm,versatile-sic";
		interrupt-controller;
		#interrupt-cells = <1>;
		reg = <0x10003000 0x1000>;
		interrupt-parent = <&vic>;
		interrupts = <31>; /* Cascaded to vic */
	};

  b) two cells
  ------------
  The #interrupt-cells property is set to 2 and the first cell defines the
  index of the interrupt within the controller, while the second cell is used
  to specify any of the following flags:
    - bits[3:0] trigger type and level flags
        1 = low-to-high edge triggered
        2 = high-to-low edge triggered
        4 = active high level-sensitive
        8 = active low level-sensitive

  Example:

	i2c@7000c000 {
		gpioext: gpio-adnp@41 {
			compatible = "ad,gpio-adnp";
			reg = <0x41>;

			interrupt-parent = <&gpio>;
			interrupts = <160 1>;

			gpio-controller;
			#gpio-cells = <1>;

			interrupt-controller;
			#interrupt-cells = <2>;

			nr-gpios = <64>;
		};

		sx8634@2b {
			compatible = "smtc,sx8634";
			reg = <0x2b>;

			interrupt-parent = <&gpioext>;
			interrupts = <3 0x8>;

			#address-cells = <1>;
			#size-cells = <0>;

			threshold = <0x40>;
			sensitivity = <7>;
		};
	};

简要说明

节点属性:

  • interrupts // 表示要使用哪一个中断, 中断的触发类型等等。
  • interrupt-parent // 这个中断要接到哪一个设备去? 即父中断控制器是谁
  • interrupt-controller; // 表示自己是一个中断控制器
  • #interrupt-cells // 表示自己的子设备里应该用几个U32的数据来描述中断

 举例:

# 在Linux使用gpio子系统

https://www.cnblogs.com/schips/p/linux_subsystem_using_gpio_ss.htmlicon-default.png?t=N7T8https://www.cnblogs.com/schips/p/linux_subsystem_using_gpio_ss.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1597060.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【数据库】表的增删改(CUD)

目录 一、insert 插入 1.单行插入&#xff1a; 2.多行插入&#xff1a; (1) insert into 插入&#xff1a; (2) replace into 替换插入&#xff1a; (3) 图片插入 &#xff1a; 二、update 修改 三、delete 删除 一、insert 插入 语法&#xff1a; INSERT INTO table_name…

ue4打包多模块

首先&#xff0c;每个模块&#xff0c;包含插件内的模块在内&#xff0c;都要用IMPLEMENT_MODULE(类名, 模块名)的方式&#xff0c;模块名就是带.build.cs的第一个单词。 build.cs里就说了这个模块该怎么用&#xff0c;用c#编写。 打包中要考虑到target.cs,将工程中相应的模块…

go语言并发实战——日志收集系统(一) 项目前言

-goroutine- 简介 go并发编程的练手项目 项目背景 一般来说业务系统都有自己的日志,当系统出现问题时,我们一般需要通过日志信息来定位与解决问题&#xff0c;当系统机器较少时我们可以登录服务器来查看,但是当系统机器较多时,我们通过服务器来查看日志的成本就会变得很大,…

leetcode刷题日记之全排列

题目描述 题目解释 这个题类似于之前做的某一道题&#xff0c;其实算法还是要追踪到树的深度遍历&#xff0c;相当于便利叶子节点的路径记录。不过递归的过程就相当于件数根据树进行遍历了。 代码如下 class Solution:def permute(self, nums: List[int]) -> List[List[i…

电动汽车原理视频笔记

看到了一个讲的不错的系列视频 新能源维修猿老罗的个人空间-新能源维修猿老罗个人主页-哔哩哔哩视频 道路千万条&#xff0c;安全第一条&#xff01;新能源维修高压安全知识以及维修工具介绍_哔哩哔哩_bilibili 那么简单&#xff01;电动汽车高压配电和控制_哔哩哔哩_bilibili…

EasyRecovery数据恢复软件2024百度云网盘下载链接

EasyRecovery数据恢复软件是一款功能强大的数据恢复工具&#xff0c;它能够帮助用户从各种存储设备中恢复丢失或误删除的文件数据。无论是由于意外删除、格式化、病毒攻击还是其他原因导致的数据丢失&#xff0c;EasyRecovery都能提供有效的解决方案。 该软件支持多种存储介质…

创维:在博鳌论坛 叩响世界之门

出走半生&#xff0c;归来仍是少年。 2024年4月8日&#xff0c;一个离开海南近半个世纪的“少年”回到琼海博鳌&#xff0c;“下一站&#xff0c;1000亿&#xff01;”&#xff0c;他的承诺掷地有声。“1000亿”&#xff0c;意指创维集团在2025年前冲击千亿营收&#xff0c;这…

选课成绩管理系统

文章目录 员工管理系统一、项目演示二、项目介绍三、系统部分功能截图四、部分代码展示五、底部获取项目&#xff08;9.9&#xffe5;&#xff09; 员工管理系统 一、项目演示 课程管理系统 二、项目介绍 基于springbootvue的前后端分离选课成绩管理系统 该系统可做课程管理…

【Java开发指南 | 第九篇】访问实例变量和方法、继承、接口

专栏&#xff1a;Java开发指南 CSDN秋说 文章目录 访问实例变量和方法继承接口 访问实例变量和方法 通过已创建的对象来访问成员变量和成员方法&#xff0c;如下所示&#xff1a; /* 实例化对象 */ Object referenceVariable new Constructor(); /* 访问类中的变量 */ refer…

【视频异常检测】Learning Multimodal Violence Detection under Weak Supervision 论文阅读

Not only Look, but also Listen: Learning Multimodal Violence Detection under Weak Supervision 论文阅读 Abstract1 Introduction2 Related Work3 XD-Violence Dataset3.1 Selecting Violence Categories3.2 Collection and AnnotationVideo annotation.3.3 Dataset Stati…

如何下载Plugin Registration Tool

今天给大家演示一下如何使用Power Platform CLI来下载Plugin Registration Tool. 前提条件 本地需要安装.net 1. 下载并安装Power Platform CLI 可以在VS Code的Terminal中使用powershell或者直接在cmd中运行下面的命令&#xff1a; dotnet tool install --global Microsof…

【华为OD机试】围棋的气【C卷|100分】

题目描述 围棋棋盘由纵横各19条线垂直相交组成,棋盘上一共19 x 19 = 361 个交点, 对弈双方一方执白棋,一方执黑棋,落子时只能将棋子置于交点上。 “气”是围棋中很重要的一个概念,某个棋子有几口气,是指其上下左右方向四个相邻的交叉点中, 有几个交叉点没有棋子,由此可…

2024-04-15_[UPnP]:详细解析

UPnP 一、论文阅读 1.2 Theory 1.2.1 Geometry of the absolute pose problem α i f i v i R p i t , i 1.. n . \alpha_i \mathbf{f}_i \mathbf{v}_i \mathbf{R} \mathbf{p}_i \mathbf{t} ,i1..n. αi​fi​vi​Rpi​t,i1..n. 其中&#xff1a; P i ∈ R 3 P_i \i…

rhce day1

一 . 在系统中设定延迟任务要求如下 在系统中建立 easylee 用户&#xff0c;设定其密码为 easylee 延迟任务由 root 用户建立 要求在 5 小时后备份系统中的用户信息文件到 /backup 中 确保延迟任务是使用非交互模式建立 确保系统中只有 root 用户和 easylee 用户可以执行延…

直播平台主播的美颜功能是如何实现的?美颜SDK技术深度解析

时下&#xff0c;直播平台的美颜SDK则扮演着至关重要的角色。接下来&#xff0c;我们将深入探讨直播平台主播美颜功能的实现原理&#xff0c;以及美颜SDK技术的应用。 一、美颜技术的发展 随着人工智能和计算机视觉技术的不断进步&#xff0c;美颜技术逐渐实现了更加智能化的…

如何在横向渗透攻击中寻到一线生机

横向渗透&#xff0c;作为计算机网络中的一种攻击技术&#xff0c;展现出了攻击者如何巧妙地利用同一级别系统间的漏洞和弱点&#xff0c;扩大其网络访问权限。与纵向渗透不同&#xff0c;横向渗透不关注权限的垂直提升&#xff0c;而是更侧重于在同一层级内扩展影响力。 横向…

Problem #8 [Easy]

This problem was asked by Google. A unival tree (which stands for “universal value”) is a tree where all nodes under it have the same value. Given the root to a binary tree, count the number of unival subtrees. For example, the following tree has 5 un…

强烈推荐 ——电脑终端管理系统

强烈推荐&#xff01;电脑终端管理系统 电脑终端管理系统使用的目的是为了管控电脑上硬件和软件资产&#xff0c;以及员工使用电脑的行为&#xff0c;最终目的是为了保护企业资产和信息&#xff0c;以下是一些推荐的电脑终端管理系统&#xff0c;这些系统为企业提供了强大的功…

OpenHarmony南向开发案例:【智能体重秤】

一、简介 本demo基于OpenHarmony3.1Beta版本开发&#xff0c;该样例能够接入数字管家应用&#xff0c;通过数字管家应用监测体重秤上报数据&#xff0c;获得当前测量到的体重&#xff0c;身高&#xff0c;并在应用端形成一段时间内记录的体重值&#xff0c;以折线图的形式表现…

破译验证码reCAPTCHA 之 打码平台

由于登录需要验证码&#xff0c;除了日常的字符串&#xff0b;数字&#xff0c;此时就需要用第三方插件进行破译。 reCaptcha是Google公司的验证码服务&#xff0c;方便快捷&#xff0c;改变了传统验证码需要输入n位失真字符的特点。 1. reCAPTCHA 初识 reCaptcha是Google公司…