From ef316c6425a4adccabe88bf01792eaabeb736052 Mon Sep 17 00:00:00 2001 From: Andrew Walbran Date: Wed, 27 Nov 2024 16:17:35 +0000 Subject: [PATCH] Add doc comments. --- src/transport/mod.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/transport/mod.rs b/src/transport/mod.rs index 2f66a916..f04fe61f 100644 --- a/src/transport/mod.rs +++ b/src/transport/mod.rs @@ -232,6 +232,8 @@ impl From for DeviceType { } } +/// Wrapper for Transport::read_config_space with an extra dummy parameter to force the correct type +/// to be inferred. #[inline(always)] pub(crate) fn read_help( transport: &T, @@ -241,6 +243,8 @@ pub(crate) fn read_help( transport.read_config_space(offset) } +/// Wrapper for Transport::write_config_space with an extra dummy parameter to force the correct +/// type to be inferred. #[inline(always)] pub(crate) fn write_help( transport: &mut T, @@ -251,6 +255,7 @@ pub(crate) fn write_help( transport.write_config_space(offset, value) } +/// Reads the given field of the given struct from the device config space via the given transport. macro_rules! read_config { ($transport:expr, $struct:ty, $field:ident) => {{ let dummy_struct: Option<$struct> = None; @@ -259,6 +264,7 @@ macro_rules! read_config { }}; } +/// Writes the given field of the given struct from the device config space via the given transport. macro_rules! write_config { ($transport:expr, $struct:ty, $field:ident, $value:expr) => {{ let dummy_struct: Option<$struct> = None;