摘要: 复位模式 在硬件设备被置于复位模式时,通常会限制或禁止对设备寄存器的读写操作。这是为了确保在复位模式下设备能够以可控和可预测的方式进行初始化和复位操作。具体而言,当设备被置于复位模式时,其内部状态和寄存器值可能会被清零或设置为初始状态。此时,外部对设备的读写操作可能会受到限制或无效。 linux r 阅读全文
posted @ 2024-03-23 23:21 lethe1203 阅读(98) 评论(0) 推荐(0) 编辑
摘要: 参考博客: https://blog.csdn.net/yangguoyu8023/article/details/121892008 https://blog.csdn.net/yangguoyu8023/category_11576708.html gpiolib相关数据结构: 数据结构主要定义 阅读全文
posted @ 2024-03-23 23:04 lethe1203 阅读(56) 评论(0) 推荐(0) 编辑
摘要: 不同半导体厂商的pinctrl设计均不同,这里以高通的pinctrl使用举例: dts修改: // mtp-pinctrl.dtsi leds_redon:leds_redon{ mux { pins = "gpio161"; function = "gpio"; }; config { pins 阅读全文
posted @ 2024-03-23 22:44 lethe1203 阅读(28) 评论(0) 推荐(0) 编辑
摘要: 此篇不涉及gpio子系统和pinctrl原理解释,只列举相关操作函数: 通用的GPIO操作: 1. gpio_request(unsigned gpio, const char *label):向内核申请指定gpio,所申请的IO口会被内核记录 参数:gpio:申请IO口编号 ,label:申请者的 阅读全文
posted @ 2024-03-23 22:40 lethe1203 阅读(43) 评论(0) 推荐(0) 编辑
摘要: 参考资料:https://www.bilibili.com/video/BV1fJ411i7PB?p=25&vd_source=432ba293ecfc949a4174ab91ccc526d6 dts节点: dtsled { #address-cells = <1>; #size-cells = < 阅读全文
posted @ 2024-03-23 21:55 lethe1203 阅读(10) 评论(0) 推荐(0) 编辑
摘要: 参考资料: https://blog.csdn.net/weixin_45668170/article/details/130967094 https://wenku.csdn.net/column/5s90hefd57 一个常规的设备树主要由源文件 .dts 和头文件 .dtsi 以及一些 .h 阅读全文
posted @ 2024-03-23 20:57 lethe1203 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 参考资料: https://www.bilibili.com/video/BV1fJ411i7PB?p=23&vd_source=432ba293ecfc949a4174ab91ccc526d6 https://blog.csdn.net/qq_40937426/article/details/10 阅读全文
posted @ 2024-03-23 20:40 lethe1203 阅读(101) 评论(0) 推荐(0) 编辑
摘要: 参考资料: https://www.bilibili.com/video/BV1fJ411i7PB?p=16&vd_source=432ba293ecfc949a4174ab91ccc526d6 在linux3.1版本引入设备树 设备树用来描述板级信息 编译设备树: make all // 全编译, 阅读全文
posted @ 2024-03-23 19:59 lethe1203 阅读(367) 评论(0) 推荐(0) 编辑
摘要: 代码参考正点原子 在https://www.cnblogs.com/lethe1203/p/18091283一文中,存在以下的几个问题: 1、使用register_chrdev函数注册字符设备,浪费了大量的次设备号,而且需要手动指定主设备号,还需要事先确认好哪一个主设备号没用 2、需要手动mknod 阅读全文
posted @ 2024-03-23 18:23 lethe1203 阅读(14) 评论(0) 推荐(0) 编辑
摘要: 基本概念可参考https://www.cnblogs.com/lethe1203/p/18091326、 代码参考正点原子 led驱动文件led.c: #include <linux/types.h> #include <linux/kernel.h> #include <linux/delay.h 阅读全文
posted @ 2024-03-23 17:24 lethe1203 阅读(6) 评论(0) 推荐(0) 编辑
摘要: MMU的相关概念可参考:https://www.cnblogs.com/lethe1203/p/18064515 Linux驱动开发在某些情况也会直接操作寄存器 MMU主要完成的功能: 1、完成虚拟空间到物理空间的映射 2、内存保护,设置存储器的访问权限,设置虚拟存储空间的缓冲特性 对于32位的处理 阅读全文
posted @ 2024-03-23 17:00 lethe1203 阅读(15) 评论(0) 推荐(0) 编辑
摘要: 参考资料: https://www.bilibili.com/video/BV1fJ411i7PB?p=3&vd_source=432ba293ecfc949a4174ab91ccc526d6 基本概念: 字符设备是Linux驱动中最基本的一类设备驱动,字符设备就是一个一个字节,按照字节流进行读写操 阅读全文
posted @ 2024-03-23 16:33 lethe1203 阅读(18) 评论(0) 推荐(0) 编辑
摘要: 注:跟随笔完全跟随正点原子buildroot构建根文件系统操作 buildroot官网:https://buildroot.org/ 参考:buildroot编译问题解决 package has no installation candidate 【已解决】“you should not run c 阅读全文
posted @ 2024-03-23 01:40 lethe1203 阅读(96) 评论(0) 推荐(0) 编辑