class PDev

Defined at line 28 of file ../../sdk/lib/driver/platform-device/cpp/pdev.h

A helper class that wraps the `fuchsia.hardware.platform.device/Device` FIDL calls.

This class exists to make it simpler for clients to move onto the platform device FIDL.

Public Members

static const char[] kFragmentName

Public Methods

void PDev (fidl::ClientEnd<fuchsia_hardware_platform_device::Device> client)

Defined at line 11 of file ../../sdk/lib/driver/platform-device/cpp/pdev.cc

zx::result<PDev> Connect (const std::shared_ptr<Namespace> & incoming, std::string_view instance)

Connect to the platform device in the given namespace.

If the fragment_name is not provided, it will be set to the default value of `pdev`.

Defined at line 14 of file ../../sdk/lib/driver/platform-device/cpp/pdev.cc

fidl::UnownedClientEnd<fuchsia_hardware_platform_device::Device> borrow ()

Defined at line 24 of file ../../sdk/lib/driver/platform-device/cpp/pdev.cc

zx::result<fdf::MmioBuffer> MapMmio (uint32_t index, uint32_t cache_policy)

Defined at line 28 of file ../../sdk/lib/driver/platform-device/cpp/pdev.cc

void PDev ()

Defined at line 32 of file ../../sdk/lib/driver/platform-device/cpp/pdev.h

zx::result<fdf::MmioBuffer> MapMmio (std::string_view name, uint32_t cache_policy)

Defined at line 36 of file ../../sdk/lib/driver/platform-device/cpp/pdev.cc

zx::result<MmioInfo> GetMmio (uint32_t index)

Defined at line 44 of file ../../sdk/lib/driver/platform-device/cpp/pdev.cc

template <typename FidlType>
zx::result<FidlType> GetFidlMetadata (std::string_view metadata_id)

Defined at line 55 of file ../../sdk/lib/driver/platform-device/cpp/pdev.h

zx::result<MmioInfo> GetMmio (std::string_view name)

Defined at line 66 of file ../../sdk/lib/driver/platform-device/cpp/pdev.cc

zx::result<zx::interrupt> GetInterrupt (uint32_t index, uint32_t flags)

Defined at line 88 of file ../../sdk/lib/driver/platform-device/cpp/pdev.cc

zx::result<zx::interrupt> GetInterrupt (std::string_view name, uint32_t flags)

Defined at line 100 of file ../../sdk/lib/driver/platform-device/cpp/pdev.cc

zx::result<zx::bti> GetBti (uint32_t index)

Defined at line 112 of file ../../sdk/lib/driver/platform-device/cpp/pdev.cc

bool is_valid ()

Defined at line 120 of file ../../sdk/lib/driver/platform-device/cpp/pdev.h

zx::result<zx::resource> GetSmc (uint32_t index)

Defined at line 124 of file ../../sdk/lib/driver/platform-device/cpp/pdev.cc

zx::result<DeviceInfo> GetDeviceInfo ()

Defined at line 136 of file ../../sdk/lib/driver/platform-device/cpp/pdev.cc

zx::result<BoardInfo> GetBoardInfo ()

Defined at line 178 of file ../../sdk/lib/driver/platform-device/cpp/pdev.cc

zx::result<std::vector<fdf_power::PowerElementConfiguration>> GetPowerConfiguration ()

Defined at line 204 of file ../../sdk/lib/driver/platform-device/cpp/pdev.cc

fit::result<fdf_power::Error, std::vector<fdf_power::ElementDesc>> GetAndApplyPowerConfiguration (const fdf::Namespace & ns, bool use_element_runner)

Uses the provided namespace and platform device instance to get a power

configuration, add corresponding power elements to the power topology, and

return `fdf_power::ElementDesc` objects equivalent to the power configuration.

This function retrieves the config via |dev| and then calls

`fdf_power::ApplyPowerConfiguration`, see its documentation for additional

information.

Defined at line 226 of file ../../sdk/lib/driver/platform-device/cpp/pdev.cc

Records