|
DUDS
|
Distributed Update of Data from Something
|
A Linux specific library for communicating with external hardware. More...
Classes | |
| class | DevI2c |
| Implementation of the I2c interface using the Linux kernel's user-space support. More... | |
| class | DevSmbus |
| Implementation of the Smbus interface using the Linux kernel's user-space support. More... | |
| struct | GpioDevGetLinehandleError |
| An error was reported from a GPIO_GET_LINEHANDLE_IOCTL operation. More... | |
| struct | GpioDevGetLineValuesError |
| An error was reported from a GPIOHANDLE_GET_LINE_VALUES_IOCTL operation. More... | |
| class | GpioDevPort |
| A GPIO implementation using the Linux kernel's GPIO character devices. More... | |
| struct | GpioDevPortError |
| Base class for all errors specific to using the Linux GPIO character device. More... | |
| struct | GpioDevSetLineValuesError |
| An error was reported from a GPIOHANDLE_SET_LINE_VALUES_IOCTL operation. More... | |
| class | GpioRequest |
| An abstraction for using gpiohandle_request object(s). More... | |
| class | IoGpioRequest |
| Implements using two gpiohandle_requests object for working with multiple pins. More... | |
| struct | PwmError |
| class | SingleGpioRequest |
| Implements using a single gpiohandle_request object for working with a single pin. More... | |
| class | SpiMasterSyncSerial |
| A synchronous serial implementation using the SPI userspace interface provided by the Linux kernel. More... | |
| class | SysFsPort |
| A GPIO implementation using the Linux kernel's userspace interface in syfs. More... | |
| class | SysPwm |
| This is a Linux-only PWM driver that I need for my eclipse project. More... | |
Typedefs | |
| typedef boost::error_info< struct Info_SysPwmChannel, int > | SysPwmChannel |
| typedef boost::error_info< struct Info_SysPwmChip, int > | SysPwmChip |
| typedef boost::error_info< struct Info_SysPwmDutyNs, long > | SysPwmDutyNs |
| typedef boost::error_info< struct Info_SysPwmPeriodNs, long > | SysPwmPeriodNs |
Functions | |
| static void | AddOffset (gpiohandle_request &req, std::uint32_t offset) |
| Adds a GPIO line offset to a gpiohandle_request object. More... | |
| static void | CloseIfOpen (gpiohandle_request &req) |
| Closes the file descriptor in the request object if it appears to have a file, and then sets the descriptor to zero. More... | |
| static int | FindOffset (gpiohandle_request &req, std::uint32_t offset) |
| Finds the array index that corresponds to the given offset. More... | |
| static void | GetInput (int chipFd, gpiohandle_data &result, gpiohandle_request &req) |
| Requests input states from the kernel. More... | |
| static void | InitGpioHandleReq (gpiohandle_request &req, const std::string &consumer) |
| Initializes a gpiohandle_request structure. More... | |
| static bool | RemoveOffset (gpiohandle_request &req, std::uint32_t offset) |
| Removes a GPIO line offset from a gpiohandle_request object. More... | |
| static void | SetOutput (int chipFd, gpiohandle_request &req) |
| Sets the output states for all the pins in the request object. More... | |
Variables | |
| static const char * | prefix = "/sys/class/gpio/gpio" |
| static const char * | prefix = "/sys/class/pwm/pwmchip" |
A Linux specific library for communicating with external hardware.
Any code that is specific to both Linux and some particular processor or other hardware not abstracted by the kernel should be placed in a namespace named for that hardware under this namespace. Code directly in this name space must not be specific to any particular hardware by using user-space kernel interfaces.
Many of Linux's user-space interfaces are file based, like the sysfs filesystem. Should an I/O error occur while using a file, and the error requires an exception to be thrown, boost::exception should be used (all duds exceptions do), and boost::errinfo_file_name should be added with the name of the file.
| typedef boost::error_info<struct Info_SysPwmChannel, int> duds::hardware::interface::linux::SysPwmChannel |
Definition at line 23 of file SysPwm.hpp.
| typedef boost::error_info<struct Info_SysPwmChip, int> duds::hardware::interface::linux::SysPwmChip |
Definition at line 22 of file SysPwm.hpp.
| typedef boost::error_info<struct Info_SysPwmDutyNs, long> duds::hardware::interface::linux::SysPwmDutyNs |
Definition at line 27 of file SysPwm.hpp.
| typedef boost::error_info<struct Info_SysPwmPeriodNs, long> duds::hardware::interface::linux::SysPwmPeriodNs |
Definition at line 25 of file SysPwm.hpp.
|
static |
Adds a GPIO line offset to a gpiohandle_request object.
| req | The request object that will hold the offset. |
| offset | The offset to add. It will be placed at the end. |
Definition at line 38 of file GpioDevPort.cpp.
Referenced by duds::hardware::interface::linux::IoGpioRequest::addInputOffset(), duds::hardware::interface::linux::IoGpioRequest::addOutputOffset(), duds::hardware::interface::linux::IoGpioRequest::inputOffset(), duds::hardware::interface::linux::IoGpioRequest::outputOffset(), and duds::hardware::interface::linux::IoGpioRequest::outputState().
|
static |
Closes the file descriptor in the request object if it appears to have a file, and then sets the descriptor to zero.
| req | The request object to modify. |
Definition at line 98 of file GpioDevPort.cpp.
Referenced by duds::hardware::interface::linux::SingleGpioRequest::inputOffset(), duds::hardware::interface::linux::IoGpioRequest::inputOffset(), duds::hardware::interface::linux::SingleGpioRequest::inputState(), duds::hardware::interface::linux::SingleGpioRequest::outputOffset(), duds::hardware::interface::linux::IoGpioRequest::outputOffset(), duds::hardware::interface::linux::IoGpioRequest::outputState(), duds::hardware::interface::linux::SingleGpioRequest::write(), duds::hardware::interface::linux::IoGpioRequest::~IoGpioRequest(), and duds::hardware::interface::linux::SingleGpioRequest::~SingleGpioRequest().
|
static |
Finds the array index that corresponds to the given offset.
Useful in cases where the two do not match, such as with IoGpioRequest.
| req | The request object to search. |
| offset | The pin offset to find. |
Definition at line 58 of file GpioDevPort.cpp.
Referenced by duds::hardware::interface::linux::IoGpioRequest::inputState(), duds::hardware::interface::linux::IoGpioRequest::outputState(), and duds::hardware::interface::linux::IoGpioRequest::write().
|
static |
Requests input states from the kernel.
If the request for using input rather than output has not yet been made, it will be made here. This is because it is valid to have set an input state, lose the access object, then create a new access object for the same pins, and assume the pins are still inputs. The request to use them as inputs, however, must be made again to the kernel.
| chipFd | The file descriptor for the GPIO device. Needed for the GPIO_GET_LINEHANDLE_IOCTL operation that will occur if any of the pins has not yet been configured as an input. |
| result | The input states. |
| req | The request object with the input pins. |
Definition at line 118 of file GpioDevPort.cpp.
Referenced by duds::hardware::interface::linux::SingleGpioRequest::inputState(), duds::hardware::interface::linux::IoGpioRequest::inputState(), duds::hardware::interface::linux::SingleGpioRequest::read(), and duds::hardware::interface::linux::IoGpioRequest::read().
|
static |
Initializes a gpiohandle_request structure.
| req | The gpiohandle_request structure to be initialized. |
| consumer | The consumer name to place inside the gpiohandle_request. |
Definition at line 25 of file GpioDevPort.cpp.
Referenced by duds::hardware::interface::linux::IoGpioRequest::IoGpioRequest(), and duds::hardware::interface::linux::SingleGpioRequest::SingleGpioRequest().
|
static |
Removes a GPIO line offset from a gpiohandle_request object.
| req | The request object that holds the offset. |
| offset | The offset to remove. The offset at the end will take its place. |
Definition at line 74 of file GpioDevPort.cpp.
Referenced by duds::hardware::interface::linux::IoGpioRequest::inputOffset(), duds::hardware::interface::linux::IoGpioRequest::outputOffset(), and duds::hardware::interface::linux::IoGpioRequest::outputState().
|
static |
Sets the output states for all the pins in the request object.
If the request for using output rather than input has not yet been made, it will be made here. This is because it is valid to have set an output state, lose the access object, then create a new access object for the same pins, and assume the pins are still outputs. The request to use them as outputs, however, must be made again to the kernel.
| chipFd | The file descriptor for the GPIO device. Needed for the GPIO_GET_LINEHANDLE_IOCTL operation that will occur if any of the pins has not yet been configured as an output. |
| req | The request object with the output pins and states. The default_values field is used for the output states, even when the pins are already configured as outputs. |
Definition at line 151 of file GpioDevPort.cpp.
Referenced by duds::hardware::interface::linux::SingleGpioRequest::write(), and duds::hardware::interface::linux::IoGpioRequest::write().
|
static |
Definition at line 17 of file SysFsPort.cpp.
|
static |
Definition at line 20 of file SysPwm.cpp.