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

NxpPca9685Device channel value.
显示文件 Open project: emlid/Navio-SDK-Windows-IoT Class Usage Examples

Public Methods

Method 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.

Protected Methods

Method Description
DoChanged ( ) : void

Fires the Changed event.

Method Details

CalculateLength() public static method

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

CalculateMilliseconds() public static method

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.
return float

DoChanged() protected method

Fires the Changed event.
protected DoChanged ( ) : void
return void

Equals() public method

Compares this object with another by value.
public Equals ( object obj ) : bool
obj object
return bool

FromByteArray() public static method

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

FromLength() public static method

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 .
return NxpPca9685ChannelValue

FromMilliseconds() public static method

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).
return NxpPca9685ChannelValue

GetHashCode() public method

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

NxpPca9685ChannelValue() public method

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

NxpPca9685ChannelValue() public method

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

SetBytes() public method

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.
return void

ToByteArray() public method

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

operator() public static method

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