메소드 | 설명 | |
---|---|---|
CalcOffPosForPulseDuration ( |
Calculates the OFF position for the specified pulse duration.
|
|
Dispose ( ) : void |
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. Call Dispose when you are finished using the CyrusBuilt.MonoPi.IO.PCA.PCA9685GpioProvider. The Dispose method leaves the CyrusBuilt.MonoPi.IO.PCA.PCA9685GpioProvider in an unusable state. After calling Dispose, you must release all references to the CyrusBuilt.MonoPi.IO.PCA.PCA9685GpioProvider so the garbage collector can reclaim the memory that the CyrusBuilt.MonoPi.IO.PCA.PCA9685GpioProvider was occupying. |
|
GetPin ( IPCA9685Pin pin ) : IPCA9685Pin |
Gets the specified pin from the pin cache. If the specified pin does not already exist in the cache, it will be cached first, then returned to the caller.
|
|
GetPwmOnOffValues ( IPCA9685Pin pin ) : Int32>.Tuple |
Gets the PWM on/off values for the specified pin.
|
|
HasPin ( IPCA9685Pin pin ) : System.Boolean |
Determines whether this instance has pin the specified pin in the internal pin cache.
|
|
PCA9685GpioProvider ( BoardRevision rev, |
Initializes a new instance of the CyrusBuilt.MonoPi.IO.PCA.PCA9685GpioProvider class with the Raspberry Pi board revision and address of the PCA9685 on the I2C bus.
|
|
PCA9685GpioProvider ( II2CBus bus, |
Initializes a new instance of the CyrusBuilt.MonoPi.IO.PCA.PCA9685GpioProvider class with the I2C bus device and bus address of PCA9685 device. This overload uses the default target frequency value.
|
|
PCA9685GpioProvider ( II2CBus bus, |
Initializes a new instance of the CyrusBuilt.MonoPi.IO.PCA.PCA9685GpioProvider class with the I2C bus device, bus address of PCA9685 device, and target frequency.
|
|
PCA9685GpioProvider ( II2CBus bus, |
Initializes a new instance of the CyrusBuilt.MonoPi.IO.PCA.PCA9685GpioProvider class with the I2C bus device, bus address of PCA9685 device, target frequency, and frequency correction factor.
|
|
Reset ( ) : void |
Resets all outputs (set to always OFF).
|
|
SetAlwaysOff ( IPCA9685Pin pin ) : void |
Sets the always off.
|
|
SetAlwaysOn ( IPCA9685Pin pin ) : void |
Permanently sets the output to HIGH (no PWM anymore).
|
|
SetFrequency ( Decimal freq ) : void |
Sets the target frequency (accuracy is around +/- 5%!).
|
|
SetFrequency ( Decimal targetFreq, Decimal freqCorrectionFactor ) : void |
The built-in oscillator runs at ~25MHz. For better accuracy, this method can be used to provide a correction factor to meet desired frequency. Note: Correction is limited to a certain degree because the calculated prescale value has to be rounded to an integer value! |
|
SetPWM ( IPCA9685Pin pin, |
Sets the pulse duration in microseconds.
|
|
SetPWM ( IPCA9685Pin pin, |
Sets the PWM values for the specified pin. The LEDn_ON and LEDn_OFF counts can vary from 0 to 4095 max.
|
메소드 | 설명 | |
---|---|---|
CachePinValues ( IPCA9685Pin pin, |
Caches the pin values.
|
|
CalcPeriodDuration ( ) : |
Calculates the duration of the period.
|
|
CalcPrescale ( Decimal freqCorrectionFactor ) : |
Calculates the prescale based on the internal clock frequency and the specified frequency correction factor.
|
|
ValidateFrequency ( Decimal freq ) : void |
Validates the frequency. Throws an ArgumentOutOfRangeException if the frequency is not in range.
|
|
ValidatePin ( IPCA9685Pin pin, |
Validates the specified pin and throws an exception if invalid.
|
|
ValidatePwmDuration ( |
Validates the duration of the PWM.
|
|
ValidatePwmValueInRange ( |
Validates the specified PWM value and throws an ArgumentOutOfRangeException if the value is not in range..
|
public CalcOffPosForPulseDuration ( |
||
duration | /// Pulse duration in microseconds. /// | |
리턴 |
public GetPin ( IPCA9685Pin pin ) : IPCA9685Pin | ||
pin | IPCA9685Pin | /// The pin to get from the cache. /// |
리턴 | IPCA9685Pin |
public GetPwmOnOffValues ( IPCA9685Pin pin ) : Int32>.Tuple |
||
pin | IPCA9685Pin | /// The pin to get the on/off values for (Channel 0 .. 15). /// |
리턴 | Int32>.Tuple |
public HasPin ( IPCA9685Pin pin ) : System.Boolean | ||
pin | IPCA9685Pin | /// The pin to check for. /// |
리턴 | System.Boolean |
public PCA9685GpioProvider ( BoardRevision rev, |
||
rev | BoardRevision | /// The Raspiberry Pi board revision being used. This is used to determine /// which bus to use for I2C. /// |
address | /// The address of the PCA9685 on the I2C bus. /// | |
리턴 | System |
public PCA9685GpioProvider ( II2CBus bus, |
||
bus | II2CBus | /// The I2C bus device used to communicate with the PCA9685 chip. /// |
address | /// The address of the PCA9685 on the I2C bus. /// | |
리턴 | System |
public PCA9685GpioProvider ( II2CBus bus, |
||
bus | II2CBus | /// The I2C bus device used to communicate with the PCA9685 chip. /// |
address | /// The address of the PCA9685 on the I2C bus. /// | |
targetFreq | Decimal | /// The target PWM frequency to set. /// |
리턴 | System |
public PCA9685GpioProvider ( II2CBus bus, |
||
bus | II2CBus | /// The I2C bus device used to communicate with the PCA9685 chip. /// |
address | /// The address of the PCA9685 on the I2C bus. /// | |
targetFreq | Decimal | /// The target PWM frequency to set. /// |
freqCorrectionFactor | Decimal | /// The PWM frequency correction factor. /// |
리턴 | System |
public SetAlwaysOff ( IPCA9685Pin pin ) : void | ||
pin | IPCA9685Pin | /// The pin to set always off (Channel 0 .. 15). /// |
리턴 | void |
public SetAlwaysOn ( IPCA9685Pin pin ) : void | ||
pin | IPCA9685Pin | /// The pin to set always on (Channel 0 .. 15). /// |
리턴 | void |
public SetFrequency ( Decimal freq ) : void | ||
freq | Decimal | /// The desired PWM frequency. /// |
리턴 | void |
public SetFrequency ( Decimal targetFreq, Decimal freqCorrectionFactor ) : void | ||
targetFreq | Decimal | /// The desired frequency. /// |
freqCorrectionFactor | Decimal | /// Actual frequency/target frequency. /// |
리턴 | void |
public SetPWM ( IPCA9685Pin pin, |
||
pin | IPCA9685Pin | /// The pin to set the pulse duration for (Channel 0 .. 15). /// |
duration | /// Pulse duration in microseconds. /// | |
리턴 | void |
public SetPWM ( IPCA9685Pin pin, |
||
pin | IPCA9685Pin | /// The pin to set the PWM values for (Channel 0 .. 15). /// |
onPos | /// The PWM threshold to consider the pin "on" (value between 0 and 4095). /// | |
offPos | /// The PWM threshold to consider the pin "off" (value between 0 and 4095). /// | |
리턴 | void |