使用c ++的GPIO控制(嵌入式) [英] GPIO control with c++ (Embedded)

查看:470
本文介绍了使用c ++的GPIO控制(嵌入式)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在使用qt开发c ++嵌入式应用程序,并且必须使用我的应用程序控制gpio.

我正在研究,并随"linux/gpio.h" 一起来到了acroos.我需要的功能,但是当我包含它时

Hi everyone,

I am using qt to develop an c++ embedded application and i have to control the gpio''s with my application.

I was researching and come acroos with the "linux/gpio.h" this has every function that i need, but when i include it

#include <linux/gpio.h>



它给出了此错误



it gave this error

Could not find the linux/gpio.h



还有其他控制gpio的方法吗?还是有解决我问题的方法.

提前谢谢.



Is there other way to control gpio''s or is there solution for my problem.

Thanks in advance.

推荐答案

据我所知gpio.h仅适用于内核空间代码,请参见以下讨论C++中来自用户空间的Gpio [
As far as I know gpio.h is available only for kernel space code, see the following discussion Gpio from userspace in c++[^].


阅读嵌入式设备的文档.它应包含有关为您的设备设置Linux开发环境的部分.为了使设备使用的硬件和内核版本具有匹配的头文件,这是必需的.可能还需要安装交叉编译器和构建工具.

该文档还应包含有关为设备构建应用程序的简单示例.使用它作为您的应用程序的基础.通过正确的设置,将找到 gpio.h 头文件.
Read the documentation of your embedded device. It should contain a section about the setup of the Linux development environment for your device. This is necessary to have the matching header files for hardware and kernel version used by your device. It may be also necessary to install a cross compiler and build tools.

The documentation should also contain a simple example on building applications for your device. Use this as a base for your application. With proper setup, the gpio.h header file will be found.


这篇关于使用c ++的GPIO控制(嵌入式)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆