当前位置: 首页 > article >正文

16002.orin nano平台 linux gpio 学习记录

文章目录

  • 1 查看当前系统gpio配置信息
  • 2 orin / nano gpio
    • 2.1 GPIO 映射表
    • 2.2 nano 平台对外提供的2排端口表
  • 3 配置GPIO 电平
    • 3.1 通过指令配置普通GPIO高电平
    • 3.2 通过设备树配置普通GPIO高电平
    • 3.3 配置特定 gpio 高电平

1 查看当前系统gpio配置信息

sudo cat /sys/kernel/debug/gpio

在这里插入图片描述

2 orin / nano gpio

2.1 GPIO 映射表

orin 平台提供了一个 xls 表,可通过它生成dtb 设备树,同样可以看到管脚的定义:

Jetson_Orin_NX_and_Orin_Nano_series_Pinmux_Config_Template.xlsm

在这里插入图片描述在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

2.2 nano 平台对外提供的2排端口表

https://jetsonhacks.com/nvidia-jetson-orin-nano-gpio-header-pinout/
在这里插入图片描述
在这里插入图片描述

3 配置GPIO 电平

3.1 通过指令配置普通GPIO高电平

  • 配置gpio 9为高电平
nano@orin-nano:/sys/class/gpio$ sudo -s
[sudo] password for nano: 
root@orin-nano:/sys/class/gpio# echo 492 > /sys/class/gpio/export    
root@orin-nano:/sys/class/gpio# ls
export  gpiochip316  gpiochip348  PAC.06  unexport
root@orin-nano:/sys/class/gpio/PAC.06# echo out > direction 
root@orin-nano:/sys/class/gpio/PAC.06# echo 1 > value
root@orin-nano:/sys/class/gpio/PAC.06# 
  • cat /sys/kernel/debug/gpio
    在这里插入图片描述

3.2 通过设备树配置普通GPIO高电平

在这里插入图片描述

3.3 配置特定 gpio 高电平

  • AON 特定管脚,使用的宏, GPIO6 代表的就是 CC , 3
/*
 * Copyright (c) 2022, NVIDIA CORPORATION.  All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include "tegra234-camera-rbpcv3-imx477.dtsi"

#define CAM0_PWDN	TEGRA234_MAIN_GPIO(H, 6)
#define CAM1_PWDN	TEGRA234_MAIN_GPIO(AC, 0)
#define CAM_I2C_MUX 	TEGRA234_AON_GPIO(CC, 3)

/ {
	cam_i2cmux {
		compatible = "i2c-mux-gpio";
		#address-cells = <1>;
		#size-cells = <0>;
		mux-gpios = <&tegra_aon_gpio CAM_I2C_MUX GPIO_ACTIVE_HIGH>;
		i2c-parent = <&cam_i2c>;
		i2c@0 {
			reg = <0>;
			#address-cells = <1>;
			#size-cells = <0>;
			rbpcv3_imx477_a@1a {
				status = "disabled";
				reset-gpios = <&tegra_main_gpio CAM0_PWDN GPIO_ACTIVE_HIGH>;
			};
		};
		i2c@1 {
			reg = <1>;
			#address-cells = <1>;
			#size-cells = <0>;
			rbpcv3_imx477_c@1a {
				status = "disabled";
				reset-gpios = <&tegra_main_gpio CAM1_PWDN GPIO_ACTIVE_HIGH>;
			};
		};
	};

	gpio@6000d000 {
		camera-control-output-low {
			gpio-hog;
			output-low;
			gpios = < CAM1_PWDN 0  CAM0_PWDN 0>;
			label = "cam1-pwdn", "cam0-pwdn";
		};
	};
};


http://www.kler.cn/a/281391.html

相关文章:

  • UniApp微信小程序登录实战指南
  • 掌握CSS的@import:跨文件样式的艺术
  • 【设计模式】组合模式和(宏)命令模式
  • LeetCode 热题100-36 二叉树的中序遍历
  • 采购订单抬头屏幕增加字段的增强实施步骤 (SMOD:MM06E005) <转载>
  • BeautifulSoup4通过lxml使用Xpath定位实例
  • linux文件——文件系统——文件系统深度理解、学习inode
  • fjfjfggjhgjgjjf
  • 集合及数据结构第十节(下)————常用接口介绍、堆的应用和java对象的比较
  • 基于Java的C语言课程教学实践小程序的设计与实现(论文+源码)_kaic
  • UE5如何为《黑神话:悟空》提供逼真的渲染效果?
  • DHU 二维数组 暗恋
  • Spring Cloud(面试篇)
  • Agent实际落地的应用 未来生活的无形助手
  • 2022SHBW(服务器部分)
  • 深度学习-OpenCV运用(2)
  • 记一次SQL注入漏洞获取管理员账号密码
  • Python算法工程师面试整理-线性代数
  • 合宙LuatOS产品规格书——Air700EAQ
  • error:0308010C:digital envelope routines::unsupported【超详细图解】