GPIOPinIO Manual
Introduction
This manual describes the GPIOPinLib library and explains the purpose and usages of the library models - GPIOServer and GPIOPin.
GPIOServer
The GPIOServer is an I/O server that handles the updating (periodic reading/writing) of the GPIO pins. From the user experience perspective, it is a container for all the GPIOPin channels and a place where the user can conveniently configure them. For this purpose the GPIOServer component has a Section specifically for listing all the GPIOPins that have been added to it.
Usage
To set up a GPIOServer for an application simply add it as a subcomponent. To add a GPIOPin to the server navigate into it and add the GPIOPin from the resource tree or by using the in the Configuration editor.
GPIOPin
The GPIOPin represents a single physical input/output pin of an integrated circuit board.
Usage
When working with GPIOPins the most important properties are the following:
Property | Description |
---|---|
Nr | Specifies the GPIO pin number (sometimes also referred to as the GPIO line number) that you wish to interact with (see the circuit board's documentation to determine the pin number). |
Device | Specifies the device name in the operating system via the GPIO chip of the pin can be accessed (see the operating system documentation to determine the device name). Defaults to /dev/gpiochip0, which is the device for accessing the GPIO pins in older versions of Raspberry PI. Use device /dev/gpiochip4 to access GPIO-s in Raspberry PI 5 and newer. |
Input | Specifies the pin direction from CDP. Set to True for controlling the output GPIO pin state from CDP. Set to False for reading the input GPIO pin state into CDP. |
Routing | Specifies the signal routing that can be used for controlling the pin (if it is set as an input) or passing the pin's state to CDP. |
To interact (read/write) with a physical I/O pin the user must:
- Add a GPIOPin channel to a GPIOServer. See GPIOServer usage.
- Set the Nr property of the GPIOPin to the pin number of the circuit board.
- If the desire is to control the pin state with CDP, check the Input property checkbox to define that the GPIOPin accepts inputs from CDP. Otherwise, leave the Input property unchecked.
- Set the Routing property to point to a desired signal or another IOServer channel.
Warning: GPIOPin has a meaningful implementation on Linux only. On Windows it has just a dummy implementation.
See also GPIOServer, GPIOPin, and GPIO Setup Guide.
Get started with CDP Studio today
Let us help you take your great ideas and turn them into the products your customer will love.