|
libxr
Embedded C++ framework for bare-metal, RTOS and Linux
|
基于 Linux GPIO character device uAPI 的 Linux GPIO 实现 Linux GPIO implementation based on the Linux GPIO character-device uAPI More...
#include <linux_gpio.hpp>
Public Member Functions | |
| LinuxGPIO (const std::string &chip_path, unsigned int line_offset) | |
| LinuxGPIO (const LinuxGPIO &)=delete | |
| LinuxGPIO & | operator= (const LinuxGPIO &)=delete |
| bool | Read () override |
| 读取 GPIO 引脚状态 / Reads the GPIO pin state. | |
| void | Write (bool value) override |
| 写入 GPIO 引脚状态 / Writes the GPIO pin state. | |
| ErrorCode | EnableInterrupt () override |
| 使能 GPIO 引脚中断 / Enables the GPIO pin interrupt. | |
| ErrorCode | DisableInterrupt () override |
| 禁用 GPIO 引脚中断 / Disables the GPIO pin interrupt. | |
| ErrorCode | SetConfig (Configuration config) override |
| 配置 GPIO 引脚参数 / Configures the GPIO pin settings. | |
Public Member Functions inherited from LibXR::GPIO | |
| GPIO () | |
| 默认构造函数 / Default constructor. | |
| virtual | ~GPIO ()=default |
| 虚析构函数 / Virtual destructor. | |
| ErrorCode | RegisterCallback (Callback callback) |
| 注册 GPIO 事件回调函数 / Registers a callback function for GPIO events. | |
Additional Inherited Members | |
Public Types inherited from LibXR::GPIO | |
| enum class | Direction : uint8_t { INPUT , OUTPUT_PUSH_PULL , OUTPUT_OPEN_DRAIN , FALL_INTERRUPT , RISING_INTERRUPT , FALL_RISING_INTERRUPT } |
| 定义 GPIO 引脚的方向类型 / Defines the direction types for GPIO pins. More... | |
| enum class | Pull : uint8_t { NONE , UP , DOWN } |
| 定义 GPIO 引脚的上拉/下拉模式。 Defines the pull-up/pull-down configurations for GPIO pins. More... | |
| using | Callback = LibXR::Callback<> |
Public Attributes inherited from LibXR::GPIO | |
| Callback | callback_ |
| GPIO 事件的回调函数 / Callback function for GPIO events. | |
基于 Linux GPIO character device uAPI 的 Linux GPIO 实现 Linux GPIO implementation based on the Linux GPIO character-device uAPI
Definition at line 25 of file linux_gpio.hpp.
| LibXR::LinuxGPIO::LinuxGPIO | ( | const std::string & | chip_path, |
| unsigned int | line_offset ) |
Definition at line 295 of file linux_gpio.cpp.
|
override |
Definition at line 302 of file linux_gpio.cpp.
|
overridevirtual |
禁用 GPIO 引脚中断 / Disables the GPIO pin interrupt.
Implements LibXR::GPIO.
Definition at line 421 of file linux_gpio.cpp.
|
overridevirtual |
使能 GPIO 引脚中断 / Enables the GPIO pin interrupt.
Implements LibXR::GPIO.
Definition at line 380 of file linux_gpio.cpp.
|
overridevirtual |
读取 GPIO 引脚状态 / Reads the GPIO pin state.
Implements LibXR::GPIO.
Definition at line 314 of file linux_gpio.cpp.
|
overridevirtual |
配置 GPIO 引脚参数 / Configures the GPIO pin settings.
Implements LibXR::GPIO.
Definition at line 462 of file linux_gpio.cpp.
|
overridevirtual |
写入 GPIO 引脚状态 / Writes the GPIO pin state.
| value | 要写入的状态,true 表示高电平,false 表示低电平。 The value to write, true for high, false for low. |
Implements LibXR::GPIO.
Definition at line 348 of file linux_gpio.cpp.