pub enum ClockRequest {
Enable {
responder: ClockEnableResponder,
},
Disable {
responder: ClockDisableResponder,
},
IsEnabled {
responder: ClockIsEnabledResponder,
},
SetRate {
hz: u64,
responder: ClockSetRateResponder,
},
QuerySupportedRate {
hz_in: u64,
responder: ClockQuerySupportedRateResponder,
},
GetRate {
responder: ClockGetRateResponder,
},
SetInput {
idx: u32,
responder: ClockSetInputResponder,
},
GetNumInputs {
responder: ClockGetNumInputsResponder,
},
GetInput {
responder: ClockGetInputResponder,
},
GetProperties {
responder: ClockGetPropertiesResponder,
},
#[non_exhaustive] _UnknownMethod {
ordinal: u64,
control_handle: ClockControlHandle,
method_type: MethodType,
},
}Expand description
Used for driver-to-driver communication.
Variants§
Enable
Enables (ungates) this clock.
Drivers must call enable on all clocks they depend upon.
Returns ZX_ERR_NOT_SUPPORTED if this clock type does not support Enable.
Returns ZX_ERR_TIMED_OUT if an operation timed out (for instance, a PLL was unable to lock).
Returns ZX_ERR_INTERNAL if the operation failed for any other reason.
Fields
responder: ClockEnableResponderDisable
Disables (gates) this clock.
Drivers should call this method to indicate to the clock subsystem that
a particular clock signal is no longer necessary.
Returns ZX_ERR_NOT_SUPPORTED if this clock type does not support Disable
Returns ZX_ERR_INTERNAL if the operation failed for any other reason.
Fields
responder: ClockDisableResponderIsEnabled
Returns true if a given clock is running.
May query the hardware or return a cached value.
IsEnabled shall not alter the state of the clock tree in any way.
Returns ZX_ERR_NOT_SUPPORTED if this clock type does not support IsEnabled.
Fields
responder: ClockIsEnabledResponderSetRate
Attempt to set the rate of the clock provider.
Returns ZX_ERR_NOT_SUPPORTED if this clock type does not support SetRate
Returns ZX_ERR_INVALID_ARGS if the requested rate is not one that is reported as supported by QuerySupportedRate.
Returns ZX_ERR_TIMED_OUT if an operation timed out (for instance, a PLL was unable to lock).
Returns ZX_ERR_INTERNAL if the operation failed for any other reason.
QuerySupportedRate
Query the hardware for the highest supported rate that does not
exceed hz_in.
QuerySupportedRate shall not alter the state of the clock tree in any way.
Returns ZX_ERR_NOT_SUPPORTED if this clock type does not support QuerySupportedRate.
Returns ZX_ERR_OUT_OF_RANGE if a suitable rate could not be found.
GetRate
Returns the current rate that a given clock is running at.
GetRate shall not alter the state of the clock tree in any way.
Returns ZX_ERR_NOT_SUPPORTED if this clock type does not support GetRate .
Fields
responder: ClockGetRateResponderSetInput
Sets the input of this clock by index. I.e. by selecting a mux.
This clock has N inputs defined 0 through N-1, which are valid arguemts
as the index to SetInput.
Returns ZX_ERR_NOT_SUPPORTED if this clock type does not support SetInput
Returns ZX_ERR_OUT_OF_RANGE if idx is outside of the range supplied by GetNumInputs.
Returns ZX_ERR_INTERNAL if the operation failed for any other reason.
GetNumInputs
Returns the number of inputs this clock has.
Any value between 0 and UINT32_MAX is a valid return for this method.
A Root Oscillator may return 0 for instance, if it has no inputs.
GetNumInputs shall not alter the state of the clock tree in any way.
Returns ZX_ERR_NOT_SUPPORTED if this clock type does not support GetNumInputs.
Fields
responder: ClockGetNumInputsResponderGetInput
Returns the index of the current input of this clock.
GetInput shall not alter the state of the clock tree in any way.
Returns ZX_ERR_NOT_SUPPORTED if this clock type does not support GetInput.
Fields
responder: ClockGetInputResponderGetProperties
Returns the static properties of a clock.
Fields
responder: ClockGetPropertiesResponder#[non_exhaustive]_UnknownMethod
An interaction was received which does not match any known method.
Fields
This variant is marked as non-exhaustive
control_handle: ClockControlHandlemethod_type: MethodTypeImplementations§
Source§impl ClockRequest
impl ClockRequest
pub fn into_enable(self) -> Option<ClockEnableResponder>
pub fn into_disable(self) -> Option<ClockDisableResponder>
pub fn into_is_enabled(self) -> Option<ClockIsEnabledResponder>
pub fn into_set_rate(self) -> Option<(u64, ClockSetRateResponder)>
pub fn into_query_supported_rate( self, ) -> Option<(u64, ClockQuerySupportedRateResponder)>
pub fn into_get_rate(self) -> Option<ClockGetRateResponder>
pub fn into_set_input(self) -> Option<(u32, ClockSetInputResponder)>
pub fn into_get_num_inputs(self) -> Option<ClockGetNumInputsResponder>
pub fn into_get_input(self) -> Option<ClockGetInputResponder>
pub fn into_get_properties(self) -> Option<ClockGetPropertiesResponder>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL