C# Класс BrrrBayBay.LogicPWMLib.LogicPwmDataGenerator

Наследование: IDisposable
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
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

Описание методов

Dispose() публичный Метод

public Dispose ( ) : void
Результат void

LogicPwmDataGenerator() публичный Метод

Constructor
public LogicPwmDataGenerator ( ) : System
Результат System

applyChannelSettings() публичный Метод

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
Результат void

applyChannelSettings() публичный Метод

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
Результат void

calculateRealDutyCycle() публичный Метод

Calculates the real duty cycle when using the current sample rate
public calculateRealDutyCycle ( double desiredDutyCycle ) : double
desiredDutyCycle double
Результат double

calculateRealFrequency() публичный Метод

Calculates the real frequency when using the current sample rate
public calculateRealFrequency ( int desiredFrequency ) : double
desiredFrequency int The desired frequency in Hz
Результат double

fillBufferWithPwmStream() публичный Метод

Fills the provided byte array with pwm stream data
public fillBufferWithPwmStream ( byte buffer ) : void
buffer byte the byte array that should be filled
Результат void

resetChannelSettings() публичный Метод

Resets all channel settings to their default values
public resetChannelSettings ( ) : void
Результат void

resetState() публичный Метод

Resets the internal PWM control values
public resetState ( ) : void
Результат void