C# Class Emlid.WindowsIot.Hardware.Components.NxpPca9685.NxpPca9685ChannelValue

NxpPca9685Device channel value.
Afficher le fichier Open project: emlid/Navio-SDK-Windows-IoT Class Usage Examples

Méthodes publiques

Méthode Description
CalculateLength ( int on, int off ) : int

Calculates PWM length from on (rising) and off (falling) delay/tick values.

CalculateMilliseconds ( float frequency, int length ) : float

Calculates PWM milliseconds from a length and frequency.

Equals ( object obj ) : bool

Compares this object with another by value.

FromByteArray ( byte data, int offset ) : NxpPca9685ChannelValue

Converts a byte array into a value of this type.

FromLength ( int length, int delay ) : NxpPca9685ChannelValue

Creates a value calculated from length and optional delay.

Automatically converts zero length to "always off" and maximum length to "always on".

FromMilliseconds ( float length, float frequency, float delay ) : NxpPca9685ChannelValue

Creates a value calculated from length (given a frequency) and optional delay.

GetHashCode ( ) : int

Returns a hashcode based on the current value of this object.

NxpPca9685ChannelValue ( byte data, int offset ) : System

Creates an instance with the values from a byte array.

NxpPca9685ChannelValue ( int on, int off ) : System

Creates an instance with the specified values

SetBytes ( byte data, int offset ) : void

Sets the value from a byte array.

ToByteArray ( ) : byte[]

Converts all values to a byte array which can be written to the channel.

operator ( ) : bool

Tests two objects of this type for inequality by value.

Méthodes protégées

Méthode Description
DoChanged ( ) : void

Fires the Changed event.

Method Details

CalculateLength() public static méthode

Calculates PWM length from on (rising) and off (falling) delay/tick values.
public static CalculateLength ( int on, int off ) : int
on int
off int
Résultat int

CalculateMilliseconds() public static méthode

Calculates PWM milliseconds from a length and frequency.
public static CalculateMilliseconds ( float frequency, int length ) : float
frequency float Frequency in Hz.
length int Length in clock ticks.
Résultat float

DoChanged() protected méthode

Fires the Changed event.
protected DoChanged ( ) : void
Résultat void

Equals() public méthode

Compares this object with another by value.
public Equals ( object obj ) : bool
obj object
Résultat bool

FromByteArray() public static méthode

Converts a byte array into a value of this type.
public static FromByteArray ( byte data, int offset ) : NxpPca9685ChannelValue
data byte
offset int
Résultat NxpPca9685ChannelValue

FromLength() public static méthode

Creates a value calculated from length and optional delay.
Automatically converts zero length to "always off" and maximum length to "always on".
public static FromLength ( int length, int delay ) : NxpPca9685ChannelValue
length int Pulse length in clock ticks, between 0 and .
delay int Optional delay in clock ticks, beteween 0 and .
Résultat NxpPca9685ChannelValue

FromMilliseconds() public static méthode

Creates a value calculated from length (given a frequency) and optional delay.
public static FromMilliseconds ( float length, float frequency, float delay ) : NxpPca9685ChannelValue
length float /// Pulse length in milliseconds. Cannot be greater than one clock interval (1000 / frequency). ///
frequency float Clock frequency of the .
delay float Optional delay in milliseconds. Cannot be greater than one clock interval (1000 / frequency).
Résultat NxpPca9685ChannelValue

GetHashCode() public méthode

Returns a hashcode based on the current value of this object.
public GetHashCode ( ) : int
Résultat int

NxpPca9685ChannelValue() public méthode

Creates an instance with the values from a byte array.
public NxpPca9685ChannelValue ( byte data, int offset ) : System
data byte
offset int
Résultat System

NxpPca9685ChannelValue() public méthode

Creates an instance with the specified values
public NxpPca9685ChannelValue ( int on, int off ) : System
on int
off int
Résultat System

SetBytes() public méthode

Sets the value from a byte array.
public SetBytes ( byte data, int offset ) : void
data byte Data buffer to read from.
offset int Optional offset to read from.
Résultat void

ToByteArray() public méthode

Converts all values to a byte array which can be written to the channel.
public ToByteArray ( ) : byte[]
Résultat byte[]

operator() public static méthode

Tests two objects of this type for inequality by value.
public static operator ( ) : bool
Résultat bool