Device on a L4vbus::Vbus.
More...
Device on a L4vbus::Vbus.
Definition at line 71 of file vbus.
◆ bus_cap()
◆ dev_handle()
l4vbus_device_handle_t L4vbus::Device::dev_handle |
( |
| ) |
const |
|
inline |
Access the device handle of this device.
- Returns
- the device handle for this device.
The device handle is used to directly address the device on its virtual bus.
Definition at line 92 of file vbus.
◆ device()
Obtain detailed information about a Vbus device.
- Parameters
-
[out] | devinfo | Information structure which contains details about the device. The pointer might be NULL after a successfull call. |
- Return values
-
0 | Success. |
-L4_ENODEV | No device with the given device handle dev could be found. |
Definition at line 164 of file vbus.
References l4vbus_get_device().
◆ device_by_hid()
int L4vbus::Device::device_by_hid |
( |
Device * |
child, |
|
|
char const * |
hid, |
|
|
int |
depth = L4VBUS_MAX_DEPTH , |
|
|
l4vbus_device_t * |
devinfo = 0 |
|
) |
| const |
|
inline |
Find a device by the human interface identifier (HID).
This function searches the vbus for a device with the given HID and returns a handle to the first matching device. The HID usually conforms to an ACPI HID or a Linux device tree compatible identifier.
It is possible to have multiple devices with the same HID on a vbus. In order to find all matching devices this function has to be called repeatedly with child
pointing to the device found in the previous iteration. The iteration starts at child
that might be any device node in the tree.
- Parameters
-
[in,out] | child | Handle of the device from where in the device tree the search should start. To start searching from the beginning child must be initialized using the default (L4VBUS_NULL). If a matching device is found its handle is returned through this parameter. |
| hid | HID of the device |
| depth | Maximum depth for the recursive lookup |
[out] | devinfo | Device information structure (might be NULL) |
- Return values
-
>= | 0 A device with the given HID was found. |
-L4_ENOENT | No device with the given HID could be found on the vbus. |
-L4_EINVAL | Invalid or no HID provided. |
-L4_ENODEV | Function called on a non-existing device. |
Definition at line 124 of file vbus.
◆ get_resource()
Obtain the resource description of an individual device resource.
- Parameters
-
This function returns the resource descriptor of an individual device resource selected by the res_idx
parameter.
- Return values
-
0 | Success. |
-L4_ENOENT | Invalid resource index res_idx . |
Definition at line 184 of file vbus.
References l4vbus_get_resource().
◆ is_compatible()
int L4vbus::Device::is_compatible |
( |
char const * |
cid | ) |
const |
|
inline |
Check if the given device has a compatibility ID (CID) or HID that matches cid.
- Parameters
-
cid | the compatibility ID to test |
- Returns
- 1 when the given ID (cid) matches this device, 0 when the given ID does not match, <0 on error.
Definition at line 198 of file vbus.
References l4vbus_is_compatible().
◆ next_device()
int L4vbus::Device::next_device |
( |
Device * |
child, |
|
|
int |
depth = L4VBUS_MAX_DEPTH , |
|
|
l4vbus_device_t * |
devinfo = 0 |
|
) |
| const |
|
inline |
Find next child following child
.
- Parameters
-
[in,out] | child | Handle of the device that precedes the device that shall be found. To start from the beginning child must be initialized using the default (L4VBUS_NULL). |
| depth | Depth to look for |
[out] | devinfo | device information (might be NULL) |
- Returns
- 0 on success, else failure
Definition at line 145 of file vbus.
◆ operator!=()
bool L4vbus::Device::operator!= |
( |
Device const & |
o | ) |
const |
|
inline |
Test if two devices are not the same.
- Returns
- true if the two devices are different, false else.
Definition at line 214 of file vbus.
References _bus, and _dev.
◆ operator==()
bool L4vbus::Device::operator== |
( |
Device const & |
o | ) |
const |
|
inline |
Test if two devices are the same Vbus device.
- Returns
- true if the two devices are the same, false else.
Definition at line 205 of file vbus.
References _bus, and _dev.
◆ _bus
The Vbus capability (where this device is located on).
Definition at line 220 of file vbus.
Referenced by L4vbus::Gpio_pin::config_get(), L4vbus::Gpio_pin::config_pad(), L4vbus::Gpio_module::config_pad(), L4vbus::Gpio_pin::config_pull(), L4vbus::Gpio_pin::get(), L4vbus::Gpio_module::get(), operator!=(), operator==(), L4vbus::Gpio_pin::set(), L4vbus::Gpio_module::set(), L4vbus::Gpio_pin::setup(), L4vbus::Gpio_module::setup(), and L4vbus::Gpio_pin::to_irq().
The documentation for this class was generated from the following file: