blob: d41b743e0460e0dab578b7625526c0191fba4e37 [file] [log] [blame]
#[cfg(feature = "Devices_Adc_Provider")]
pub mod Provider;
#[doc(hidden)]
#[repr(transparent)]
pub struct IAdcChannel(::windows_core::IUnknown);
unsafe impl ::windows_core::Interface for IAdcChannel {
type Vtable = IAdcChannel_Vtbl;
}
impl ::core::clone::Clone for IAdcChannel {
fn clone(&self) -> Self {
Self(self.0.clone())
}
}
unsafe impl ::windows_core::ComInterface for IAdcChannel {
const IID: ::windows_core::GUID = ::windows_core::GUID::from_u128(0x040bf414_2588_4a56_abef_73a260acc60a);
}
#[repr(C)]
#[doc(hidden)]
pub struct IAdcChannel_Vtbl {
pub base__: ::windows_core::IInspectable_Vtbl,
pub Controller: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut *mut ::core::ffi::c_void) -> ::windows_core::HRESULT,
pub ReadValue: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut i32) -> ::windows_core::HRESULT,
pub ReadRatio: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut f64) -> ::windows_core::HRESULT,
}
#[doc(hidden)]
#[repr(transparent)]
pub struct IAdcController(::windows_core::IUnknown);
unsafe impl ::windows_core::Interface for IAdcController {
type Vtable = IAdcController_Vtbl;
}
impl ::core::clone::Clone for IAdcController {
fn clone(&self) -> Self {
Self(self.0.clone())
}
}
unsafe impl ::windows_core::ComInterface for IAdcController {
const IID: ::windows_core::GUID = ::windows_core::GUID::from_u128(0x2a76e4b0_a896_4219_86b6_ea8cdce98f56);
}
#[repr(C)]
#[doc(hidden)]
pub struct IAdcController_Vtbl {
pub base__: ::windows_core::IInspectable_Vtbl,
pub ChannelCount: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut i32) -> ::windows_core::HRESULT,
pub ResolutionInBits: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut i32) -> ::windows_core::HRESULT,
pub MinValue: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut i32) -> ::windows_core::HRESULT,
pub MaxValue: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut i32) -> ::windows_core::HRESULT,
pub ChannelMode: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut AdcChannelMode) -> ::windows_core::HRESULT,
pub SetChannelMode: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, value: AdcChannelMode) -> ::windows_core::HRESULT,
pub IsChannelModeSupported: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, channelmode: AdcChannelMode, result__: *mut bool) -> ::windows_core::HRESULT,
pub OpenChannel: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, channelnumber: i32, result__: *mut *mut ::core::ffi::c_void) -> ::windows_core::HRESULT,
}
#[doc(hidden)]
#[repr(transparent)]
pub struct IAdcControllerStatics(::windows_core::IUnknown);
unsafe impl ::windows_core::Interface for IAdcControllerStatics {
type Vtable = IAdcControllerStatics_Vtbl;
}
impl ::core::clone::Clone for IAdcControllerStatics {
fn clone(&self) -> Self {
Self(self.0.clone())
}
}
unsafe impl ::windows_core::ComInterface for IAdcControllerStatics {
const IID: ::windows_core::GUID = ::windows_core::GUID::from_u128(0xcce98e0c_01f8_4891_bc3b_be53ef279ca4);
}
#[repr(C)]
#[doc(hidden)]
pub struct IAdcControllerStatics_Vtbl {
pub base__: ::windows_core::IInspectable_Vtbl,
#[cfg(all(feature = "Devices_Adc_Provider", feature = "Foundation_Collections"))]
pub GetControllersAsync: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, provider: *mut ::core::ffi::c_void, result__: *mut *mut ::core::ffi::c_void) -> ::windows_core::HRESULT,
#[cfg(not(all(feature = "Devices_Adc_Provider", feature = "Foundation_Collections")))]
GetControllersAsync: usize,
}
#[doc(hidden)]
#[repr(transparent)]
pub struct IAdcControllerStatics2(::windows_core::IUnknown);
unsafe impl ::windows_core::Interface for IAdcControllerStatics2 {
type Vtable = IAdcControllerStatics2_Vtbl;
}
impl ::core::clone::Clone for IAdcControllerStatics2 {
fn clone(&self) -> Self {
Self(self.0.clone())
}
}
unsafe impl ::windows_core::ComInterface for IAdcControllerStatics2 {
const IID: ::windows_core::GUID = ::windows_core::GUID::from_u128(0xa2b93b1d_977b_4f5a_a5fe_a6abaffe6484);
}
#[repr(C)]
#[doc(hidden)]
pub struct IAdcControllerStatics2_Vtbl {
pub base__: ::windows_core::IInspectable_Vtbl,
#[cfg(feature = "Foundation")]
pub GetDefaultAsync: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut *mut ::core::ffi::c_void) -> ::windows_core::HRESULT,
#[cfg(not(feature = "Foundation"))]
GetDefaultAsync: usize,
}
#[doc = "*Required features: `\"Devices_Adc\"`*"]
#[repr(transparent)]
pub struct AdcChannel(::windows_core::IUnknown);
impl AdcChannel {
pub fn Controller(&self) -> ::windows_core::Result<AdcController> {
let this = self;
unsafe {
let mut result__ = ::std::mem::zeroed();
(::windows_core::Interface::vtable(this).Controller)(::windows_core::Interface::as_raw(this), &mut result__).from_abi(result__)
}
}
pub fn ReadValue(&self) -> ::windows_core::Result<i32> {
let this = self;
unsafe {
let mut result__ = ::std::mem::zeroed();
(::windows_core::Interface::vtable(this).ReadValue)(::windows_core::Interface::as_raw(this), &mut result__).from_abi(result__)
}
}
pub fn ReadRatio(&self) -> ::windows_core::Result<f64> {
let this = self;
unsafe {
let mut result__ = ::std::mem::zeroed();
(::windows_core::Interface::vtable(this).ReadRatio)(::windows_core::Interface::as_raw(this), &mut result__).from_abi(result__)
}
}
#[doc = "*Required features: `\"Foundation\"`*"]
#[cfg(feature = "Foundation")]
pub fn Close(&self) -> ::windows_core::Result<()> {
let this = &::windows_core::ComInterface::cast::<super::super::Foundation::IClosable>(self)?;
unsafe { (::windows_core::Interface::vtable(this).Close)(::windows_core::Interface::as_raw(this)).ok() }
}
}
impl ::core::cmp::PartialEq for AdcChannel {
fn eq(&self, other: &Self) -> bool {
self.0 == other.0
}
}
impl ::core::cmp::Eq for AdcChannel {}
impl ::core::fmt::Debug for AdcChannel {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_tuple("AdcChannel").field(&self.0).finish()
}
}
impl ::windows_core::RuntimeType for AdcChannel {
const SIGNATURE: ::windows_core::imp::ConstBuffer = ::windows_core::imp::ConstBuffer::from_slice(b"rc(Windows.Devices.Adc.AdcChannel;{040bf414-2588-4a56-abef-73a260acc60a})");
}
impl ::core::clone::Clone for AdcChannel {
fn clone(&self) -> Self {
Self(self.0.clone())
}
}
unsafe impl ::windows_core::Interface for AdcChannel {
type Vtable = IAdcChannel_Vtbl;
}
unsafe impl ::windows_core::ComInterface for AdcChannel {
const IID: ::windows_core::GUID = <IAdcChannel as ::windows_core::ComInterface>::IID;
}
impl ::windows_core::RuntimeName for AdcChannel {
const NAME: &'static str = "Windows.Devices.Adc.AdcChannel";
}
::windows_core::imp::interface_hierarchy!(AdcChannel, ::windows_core::IUnknown, ::windows_core::IInspectable);
#[cfg(feature = "Foundation")]
impl ::windows_core::CanTryInto<super::super::Foundation::IClosable> for AdcChannel {}
unsafe impl ::core::marker::Send for AdcChannel {}
unsafe impl ::core::marker::Sync for AdcChannel {}
#[doc = "*Required features: `\"Devices_Adc\"`*"]
#[repr(transparent)]
pub struct AdcController(::windows_core::IUnknown);
impl AdcController {
pub fn ChannelCount(&self) -> ::windows_core::Result<i32> {
let this = self;
unsafe {
let mut result__ = ::std::mem::zeroed();
(::windows_core::Interface::vtable(this).ChannelCount)(::windows_core::Interface::as_raw(this), &mut result__).from_abi(result__)
}
}
pub fn ResolutionInBits(&self) -> ::windows_core::Result<i32> {
let this = self;
unsafe {
let mut result__ = ::std::mem::zeroed();
(::windows_core::Interface::vtable(this).ResolutionInBits)(::windows_core::Interface::as_raw(this), &mut result__).from_abi(result__)
}
}
pub fn MinValue(&self) -> ::windows_core::Result<i32> {
let this = self;
unsafe {
let mut result__ = ::std::mem::zeroed();
(::windows_core::Interface::vtable(this).MinValue)(::windows_core::Interface::as_raw(this), &mut result__).from_abi(result__)
}
}
pub fn MaxValue(&self) -> ::windows_core::Result<i32> {
let this = self;
unsafe {
let mut result__ = ::std::mem::zeroed();
(::windows_core::Interface::vtable(this).MaxValue)(::windows_core::Interface::as_raw(this), &mut result__).from_abi(result__)
}
}
pub fn ChannelMode(&self) -> ::windows_core::Result<AdcChannelMode> {
let this = self;
unsafe {
let mut result__ = ::std::mem::zeroed();
(::windows_core::Interface::vtable(this).ChannelMode)(::windows_core::Interface::as_raw(this), &mut result__).from_abi(result__)
}
}
pub fn SetChannelMode(&self, value: AdcChannelMode) -> ::windows_core::Result<()> {
let this = self;
unsafe { (::windows_core::Interface::vtable(this).SetChannelMode)(::windows_core::Interface::as_raw(this), value).ok() }
}
pub fn IsChannelModeSupported(&self, channelmode: AdcChannelMode) -> ::windows_core::Result<bool> {
let this = self;
unsafe {
let mut result__ = ::std::mem::zeroed();
(::windows_core::Interface::vtable(this).IsChannelModeSupported)(::windows_core::Interface::as_raw(this), channelmode, &mut result__).from_abi(result__)
}
}
pub fn OpenChannel(&self, channelnumber: i32) -> ::windows_core::Result<AdcChannel> {
let this = self;
unsafe {
let mut result__ = ::std::mem::zeroed();
(::windows_core::Interface::vtable(this).OpenChannel)(::windows_core::Interface::as_raw(this), channelnumber, &mut result__).from_abi(result__)
}
}
#[doc = "*Required features: `\"Devices_Adc_Provider\"`, `\"Foundation_Collections\"`*"]
#[cfg(all(feature = "Devices_Adc_Provider", feature = "Foundation_Collections"))]
pub fn GetControllersAsync<P0>(provider: P0) -> ::windows_core::Result<super::super::Foundation::IAsyncOperation<super::super::Foundation::Collections::IVectorView<AdcController>>>
where
P0: ::windows_core::TryIntoParam<Provider::IAdcProvider>,
{
Self::IAdcControllerStatics(|this| unsafe {
let mut result__ = ::std::mem::zeroed();
(::windows_core::Interface::vtable(this).GetControllersAsync)(::windows_core::Interface::as_raw(this), provider.try_into_param()?.abi(), &mut result__).from_abi(result__)
})
}
#[doc = "*Required features: `\"Foundation\"`*"]
#[cfg(feature = "Foundation")]
pub fn GetDefaultAsync() -> ::windows_core::Result<super::super::Foundation::IAsyncOperation<AdcController>> {
Self::IAdcControllerStatics2(|this| unsafe {
let mut result__ = ::std::mem::zeroed();
(::windows_core::Interface::vtable(this).GetDefaultAsync)(::windows_core::Interface::as_raw(this), &mut result__).from_abi(result__)
})
}
#[doc(hidden)]
pub fn IAdcControllerStatics<R, F: FnOnce(&IAdcControllerStatics) -> ::windows_core::Result<R>>(callback: F) -> ::windows_core::Result<R> {
static SHARED: ::windows_core::imp::FactoryCache<AdcController, IAdcControllerStatics> = ::windows_core::imp::FactoryCache::new();
SHARED.call(callback)
}
#[doc(hidden)]
pub fn IAdcControllerStatics2<R, F: FnOnce(&IAdcControllerStatics2) -> ::windows_core::Result<R>>(callback: F) -> ::windows_core::Result<R> {
static SHARED: ::windows_core::imp::FactoryCache<AdcController, IAdcControllerStatics2> = ::windows_core::imp::FactoryCache::new();
SHARED.call(callback)
}
}
impl ::core::cmp::PartialEq for AdcController {
fn eq(&self, other: &Self) -> bool {
self.0 == other.0
}
}
impl ::core::cmp::Eq for AdcController {}
impl ::core::fmt::Debug for AdcController {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_tuple("AdcController").field(&self.0).finish()
}
}
impl ::windows_core::RuntimeType for AdcController {
const SIGNATURE: ::windows_core::imp::ConstBuffer = ::windows_core::imp::ConstBuffer::from_slice(b"rc(Windows.Devices.Adc.AdcController;{2a76e4b0-a896-4219-86b6-ea8cdce98f56})");
}
impl ::core::clone::Clone for AdcController {
fn clone(&self) -> Self {
Self(self.0.clone())
}
}
unsafe impl ::windows_core::Interface for AdcController {
type Vtable = IAdcController_Vtbl;
}
unsafe impl ::windows_core::ComInterface for AdcController {
const IID: ::windows_core::GUID = <IAdcController as ::windows_core::ComInterface>::IID;
}
impl ::windows_core::RuntimeName for AdcController {
const NAME: &'static str = "Windows.Devices.Adc.AdcController";
}
::windows_core::imp::interface_hierarchy!(AdcController, ::windows_core::IUnknown, ::windows_core::IInspectable);
unsafe impl ::core::marker::Send for AdcController {}
unsafe impl ::core::marker::Sync for AdcController {}
#[doc = "*Required features: `\"Devices_Adc\"`*"]
#[repr(transparent)]
#[derive(::core::cmp::PartialEq, ::core::cmp::Eq)]
pub struct AdcChannelMode(pub i32);
impl AdcChannelMode {
pub const SingleEnded: Self = Self(0i32);
pub const Differential: Self = Self(1i32);
}
impl ::core::marker::Copy for AdcChannelMode {}
impl ::core::clone::Clone for AdcChannelMode {
fn clone(&self) -> Self {
*self
}
}
impl ::core::default::Default for AdcChannelMode {
fn default() -> Self {
Self(0)
}
}
impl ::windows_core::TypeKind for AdcChannelMode {
type TypeKind = ::windows_core::CopyType;
}
impl ::core::fmt::Debug for AdcChannelMode {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_tuple("AdcChannelMode").field(&self.0).finish()
}
}
impl ::windows_core::RuntimeType for AdcChannelMode {
const SIGNATURE: ::windows_core::imp::ConstBuffer = ::windows_core::imp::ConstBuffer::from_slice(b"enum(Windows.Devices.Adc.AdcChannelMode;i4)");
}