C# Class BrrrBayBay.LogicPWMLib.LogicPwmDataGenerator

Inheritance: IDisposable
Afficher le fichier Open project: joosthaverkort/PWMLogic Class Usage Examples

Méthodes publiques

Méthode Description
Dispose ( ) : void
LogicPwmDataGenerator ( ) : System

Constructor

applyChannelSettings ( ) : void

Applies the PWM channel settings for a single channel. Calling this method in any other mode than asynchronous mode, will raise an exception.

In asynchronous mode this method will update all channels

applyChannelSettings ( int channel ) : void

Applies te PWM channel settings for a single channel. Calling this method in any other mode than asynchronous mode, will raise an exception.

calculateRealDutyCycle ( double desiredDutyCycle ) : double

Calculates the real duty cycle when using the current sample rate

calculateRealFrequency ( int desiredFrequency ) : double

Calculates the real frequency when using the current sample rate

fillBufferWithPwmStream ( byte buffer ) : void

Fills the provided byte array with pwm stream data

resetChannelSettings ( ) : void

Resets all channel settings to their default values

resetState ( ) : void

Resets the internal PWM control values

Private Methods

Méthode Description
applySynchronousChannelSettings ( ) : void

Applies the channel settings for synchronous mode

calculateSampleTickTime ( ) : double

Returns the time (in seconds) for a single sample tick

calculateSinglePeriodSampleCount ( int frequency ) : int

Calculates the number of samples needed for a single period of the given frequency

fillBufferAsyncMode ( byte buffer ) : void

Fills the provided byte array with pwm stream data in asynchronous mode

fillBufferSyncMode ( byte buffer ) : void

Fills the provided byte array with pwm stream data in synchronous mode

Method Details

Dispose() public méthode

public Dispose ( ) : void
Résultat void

LogicPwmDataGenerator() public méthode

Constructor
public LogicPwmDataGenerator ( ) : System
Résultat System

applyChannelSettings() public méthode

Applies the PWM channel settings for a single channel. Calling this method in any other mode than asynchronous mode, will raise an exception.
In asynchronous mode this method will update all channels
public applyChannelSettings ( ) : void
Résultat void

applyChannelSettings() public méthode

Applies te PWM channel settings for a single channel. Calling this method in any other mode than asynchronous mode, will raise an exception.
public applyChannelSettings ( int channel ) : void
channel int The channel number
Résultat void

calculateRealDutyCycle() public méthode

Calculates the real duty cycle when using the current sample rate
public calculateRealDutyCycle ( double desiredDutyCycle ) : double
desiredDutyCycle double
Résultat double

calculateRealFrequency() public méthode

Calculates the real frequency when using the current sample rate
public calculateRealFrequency ( int desiredFrequency ) : double
desiredFrequency int The desired frequency in Hz
Résultat double

fillBufferWithPwmStream() public méthode

Fills the provided byte array with pwm stream data
public fillBufferWithPwmStream ( byte buffer ) : void
buffer byte the byte array that should be filled
Résultat void

resetChannelSettings() public méthode

Resets all channel settings to their default values
public resetChannelSettings ( ) : void
Résultat void

resetState() public méthode

Resets the internal PWM control values
public resetState ( ) : void
Résultat void