RK3399 android7.1 u-boot中对GPIO口操作

这篇博客介绍了在common/board_f.c文件中新增的GPIO配置函数my_set_gpio,涉及GPIO2引脚的输出设置。开发者可以了解如何在初始化过程中增加自定义GPIO操作,适用于嵌入式或硬件相关的系统。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

diff --git a/common/board_f.c b/common/board_f.c
old mode 100644
new mode 100755
index c1825d8..53fb652
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -836,6 +836,24 @@ static int initf_dm(void)
 	return 0;
 }
 
+static int my_set_gpio(void)
+{
+//gpio2_B1
+	gpio_direction_output((GPIO_BANK2 | GPIO_B1), 1);
+
+//gpio2_A5
+	gpio_direction_output((GPIO_BANK2 | GPIO_A5), 1);
+
+//gpio2_A4
+	gpio_direction_output((GPIO_BANK2 | GPIO_A4), 1);
+
+//gpio2_B4
+	gpio_direction_output((GPIO_BANK2 | GPIO_B4), 1);
+
+//gpio2_B2
+	gpio_direction_output((GPIO_BANK2 | GPIO_B2), 1);
+}
+
 static init_fnc_t init_sequence_f[] = {
 #ifdef CONFIG_SANDBOX
 	setup_ram_buf,
@@ -1030,6 +1048,7 @@ static init_fnc_t init_sequence_f[] = {
 #if !defined(CONFIG_ARM) && !defined(CONFIG_SANDBOX)
 	jump_to_copy,
 #endif
+	my_set_gpio,  //@add for gpio
 	NULL,
 };
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值