当前位置:网站首页>STM32MP157A驱动开发 | 01- 板载LED作为系统心跳指示灯
STM32MP157A驱动开发 | 01- 板载LED作为系统心跳指示灯
2022-08-04 21:00:00 【Mculover666】
一、板载LED

此用户LED连接到PA13。
二、作为用户LED
1. 设备树描述
添加pinctrl描述,将PA13作为普通gpio:
&pinctrl {
led_pins_a: led-0 {
pins {
pinmux = <STM32_PINMUX('A', 13, GPIO)>; /* USER_LED */
};
};
};
添加led节点描述:
led {
compatible = "gpio-leds";
pinctrl-0 = <&led_pins_a>;
blue {
label = "blue";
gpios = <&gpioa 13 GPIO_ACTIVE_LOW>;
default-state = "off";
};
};
2. 测试
重新编译设备树,启动。
三、作为系统心跳LED
led {
compatible = "gpio-leds";
pinctrl-0 = <&led_pins_a>;
heartled {
label = "heartled";
gpios = <&gpioa 13 GPIO_ACTIVE_LOW>;
linux,default-trigger = "heartbeat";
default-state = "off";
};
};
边栏推荐
- 2022-8-4 第七组 ptz 锁与线程池和工具类
- mdk5.14无法烧录
- QT(42)-QT线程-线程调用槽函数
- 基于单向链表结构的软件虚拟定时器的设计与构建
- Feign 与 OpenFeign
- Retrofit的使用及原理详解
- Qt Designer生成的图形可以自适应窗口的大小变化
- 无代码平台字段设置:基础设置入门教程
- [21 days learning challenge - kernel notes] (2), based in the device tree
- Oreo domain name authorization verification system v1.0.6 public open source version website source code
猜你喜欢
随机推荐
DICOM医学影像协议
3. Byte stream and character stream of IO stream
2、字符集-编码-解码
Tear down the underlying mechanism of the five JOINs of SparkSQL
vs Code runs a local web server
STP基本配置及802.1D生成树协议的改进
PRIMAL: Pathfinding via Reinforcement and Imitation Multi-Agent Learning 代码解析
Interviewer: How is the expired key in Redis deleted?
bracket matching
【TypeScript】深入学习TypeScript枚举
mdk5.14 cannot be burned
idea2021版本添加上一步和下一步操作到工具栏
嵌入式分享合集28
【一起学Rust | 进阶篇 | Service Manager库】Rust专用跨平台服务管理库
win10 uwp 使用 ScaleTransform 放大某个元素
面试官:索引为什么会失效?
[AGC] Build Service 1 - Cloud Function Example
Getting Started with Lattice Passwords
如何用好建造者模式
宝塔实测-搭建中小型民宿酒店管理源码





![[TypeScript] In-depth study of TypeScript enumeration](/img/27/4836e59528bb5a51ffc1cf9961c6b6.png)



