C# 클래스 CyrusBuilt.MonoPi.Components.Potentiometers.Microchip.MicrochipPotentiometerBase

Base class for Microchip MCP45XX and MCP46XX IC device abstraction components.
상속: ComponentBase, IMicrochipPotentiometer
파일 보기 프로젝트 열기: cyrusbuilt/MonoPi

보호된 프로퍼티들

프로퍼티 타입 설명
_nonVolMode MicrochipPotNonVolatileMode

공개 메소드들

메소드 설명
Decrease ( ) : void

Decreases the wiper's value by one step. It is not an error if the wiper already hit the lower boundary (0). In this situation, the wiper doesn't change.

Decrease ( Int32 steps ) : void

Decreases the wiper's value by the specified number of steps. It is not an error if the wiper hits or already hit the lower boundary (0). In such situations, the wiper sticks to the lower boundary or doesn't change.

Dispose ( ) : void

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Call Dispose when you are finished using the CyrusBuilt.MonoPi.Components.Potentiometers.Microchip.MicrochipPotentiometerBase. The Dispose method leaves the CyrusBuilt.MonoPi.Components.Potentiometers.Microchip.MicrochipPotentiometerBase in an unusable state. After calling Dispose, you must release all references to the CyrusBuilt.MonoPi.Components.Potentiometers.Microchip.MicrochipPotentiometerBase so the garbage collector can reclaim the memory that the CyrusBuilt.MonoPi.Components.Potentiometers.Microchip.MicrochipPotentiometerBase was occupying.

Increase ( ) : void

Increase the wiper's value by one step. It is not an error if the wiper already hit the upper boundary. In this situation, the wiper doesn't change.

Increase ( Int32 steps ) : void

Increases the wiper's value by the specified number of steps. It is not an error if the wiper hits or already hit the upper boundary. In such situations, the wiper sticks to the upper boundary or doesn't change.

IsChannelSupported ( MicrochipPotChannel channel ) : System.Boolean

Determines whether or not the specified channel is supported by the underlying device.

SetWiperLock ( System.Boolean enabled ) : void

Enables or disables the wiper lock.

SetWriteProtection ( System.Boolean enabled ) : void

Enables or disables write-protection for devices capable of non-volatile memory. Enabling write-protection does not only protect non-volatile wipers, it also protects any other non-volatile information stored (i.e. wiper-locks).

UpdateCacheFromDevice ( ) : Int32

Updates the cache to the wiper's value.

보호된 메소드들

메소드 설명
BuildI2CAddress ( System.Boolean pinA0, System.Boolean pinA1, System.Boolean pinA2 ) : Int32

Builds the I2C bus address of the device based on which which address pins are set.

GetNonVolatileValue ( ) : Int32

Gets the non-volatile wiper's value.

The visibility of this method is protected because not all devices support non-volatile wipers. Any derived class may publish this method.

Initialize ( Int32 initialValForNonVolWipers ) : void

Initializes the wiper to a defined status. For devices capable of non-volatile wipers, the non-volatile value is loaded. For devices not capable, the given value is set in the device.

MicrochipPotentiometerBase ( II2CBus device, System.Boolean pinA0, System.Boolean pinA1, System.Boolean pinA2, MicrochipPotChannel channel, MicrochipPotNonVolatileMode nonVolatileMode, Int32 initialNonVolWiperValue ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Potentiometers.Microchip.MicrochipPotentiometerBase class with the I2C device connection, pin A0,A1, and A2 states, the potentiometer (channel) provided by the device, how to do non-volatile I/O and the initial value for devices which are not capable of non-volatile wipers.

SetNonVolatileMode ( MicrochipPotNonVolatileMode mode ) : void

Sets the non-volatility mode.

The visibility of this method is protected because not all devices support non-volatile wipers. Any derived class may publish this method.

비공개 메소드들

메소드 설명
GetValueAccordingBoundaries ( Int32 val ) : Int32

Adjusts the given value according to the boundaries (0 and CyrusBuilt.MonoPi.Components.Potentiometers.Microchip.MicrochipPotentiometerBase.MaxValue).

MicrochipPotentiometerBase_WiperActionEvent ( object sender, WiperEventArgs e ) : void

The potentiometer base wiper action event handler. This sets the channel value for either volatile or non-volatile wipers (depending on volatilty mode).

OnWiperActionEvent ( WiperEventArgs e ) : void

Raises the wiper action event event.

메소드 상세

BuildI2CAddress() 보호된 정적인 메소드

Builds the I2C bus address of the device based on which which address pins are set.
protected static BuildI2CAddress ( System.Boolean pinA0, System.Boolean pinA1, System.Boolean pinA2 ) : Int32
pinA0 System.Boolean /// Whether the device's address pin A0 is high (true) or low (false). ///
pinA1 System.Boolean /// Whether the device's address pin A1 (if available) is high (true) or low (false). ///
pinA2 System.Boolean /// Whether the device's address pin A2 (if available) is high (true) or low (false). ///
리턴 System.Int32

Decrease() 공개 메소드

Decreases the wiper's value by one step. It is not an error if the wiper already hit the lower boundary (0). In this situation, the wiper doesn't change.
/// Communication with the device failed. ///
public Decrease ( ) : void
리턴 void

Decrease() 공개 메소드

Decreases the wiper's value by the specified number of steps. It is not an error if the wiper hits or already hit the lower boundary (0). In such situations, the wiper sticks to the lower boundary or doesn't change.
/// Communication with the device failed. ///
public Decrease ( Int32 steps ) : void
steps System.Int32 /// The number of steps to decrease by. ///
리턴 void

Dispose() 공개 메소드

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Call Dispose when you are finished using the CyrusBuilt.MonoPi.Components.Potentiometers.Microchip.MicrochipPotentiometerBase. The Dispose method leaves the CyrusBuilt.MonoPi.Components.Potentiometers.Microchip.MicrochipPotentiometerBase in an unusable state. After calling Dispose, you must release all references to the CyrusBuilt.MonoPi.Components.Potentiometers.Microchip.MicrochipPotentiometerBase so the garbage collector can reclaim the memory that the CyrusBuilt.MonoPi.Components.Potentiometers.Microchip.MicrochipPotentiometerBase was occupying.
public Dispose ( ) : void
리턴 void

GetNonVolatileValue() 보호된 메소드

Gets the non-volatile wiper's value.
The visibility of this method is protected because not all devices support non-volatile wipers. Any derived class may publish this method.
/// Communication with device failed or malformed result. /// /// The device is not capable of non-volatile wipers. ///
protected GetNonVolatileValue ( ) : Int32
리턴 System.Int32

Increase() 공개 메소드

Increase the wiper's value by one step. It is not an error if the wiper already hit the upper boundary. In this situation, the wiper doesn't change.
/// Communication with the device failed. ///
public Increase ( ) : void
리턴 void

Increase() 공개 메소드

Increases the wiper's value by the specified number of steps. It is not an error if the wiper hits or already hit the upper boundary. In such situations, the wiper sticks to the upper boundary or doesn't change.
/// Communication with the device failed. ///
public Increase ( Int32 steps ) : void
steps System.Int32 /// How many steps to increase. ///
리턴 void

Initialize() 보호된 메소드

Initializes the wiper to a defined status. For devices capable of non-volatile wipers, the non-volatile value is loaded. For devices not capable, the given value is set in the device.
/// Communication with device failed or malformed result. ///
protected Initialize ( Int32 initialValForNonVolWipers ) : void
initialValForNonVolWipers System.Int32 /// The initial value for devices not capable of non-volatile wipers. ///
리턴 void

IsChannelSupported() 공개 메소드

Determines whether or not the specified channel is supported by the underlying device.
public IsChannelSupported ( MicrochipPotChannel channel ) : System.Boolean
channel MicrochipPotChannel /// The channel to check. ///
리턴 System.Boolean

MicrochipPotentiometerBase() 보호된 메소드

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Potentiometers.Microchip.MicrochipPotentiometerBase class with the I2C device connection, pin A0,A1, and A2 states, the potentiometer (channel) provided by the device, how to do non-volatile I/O and the initial value for devices which are not capable of non-volatile wipers.
/// cannot be null. - or - /// cannot be null. /// /// is not supported by this device. /// /// Unable to open the I2C bus. ///
protected MicrochipPotentiometerBase ( II2CBus device, System.Boolean pinA0, System.Boolean pinA1, System.Boolean pinA2, MicrochipPotChannel channel, MicrochipPotNonVolatileMode nonVolatileMode, Int32 initialNonVolWiperValue ) : System
device II2CBus /// The I2C bus device this instance is connected to. ///
pinA0 System.Boolean /// Whether the device's address pin A0 is high (true) or low (false). ///
pinA1 System.Boolean /// Whether the device's address pin A1 is high (true) or low (false). ///
pinA2 System.Boolean /// Whether the device's address pin A2 is high (true) or low (false). ///
channel MicrochipPotChannel /// Which of the potentiometers provided by the device to control. ///
nonVolatileMode MicrochipPotNonVolatileMode /// The way non-volatile reads or writes are done. ///
initialNonVolWiperValue System.Int32 /// The value for devices which are not capable of non-volatile wipers. ///
리턴 System

SetNonVolatileMode() 보호된 메소드

Sets the non-volatility mode.
The visibility of this method is protected because not all devices support non-volatile wipers. Any derived class may publish this method.
/// This device is not capable of non-volatile wipers. ///
protected SetNonVolatileMode ( MicrochipPotNonVolatileMode mode ) : void
mode MicrochipPotNonVolatileMode /// The way non-volatile reads or writes are done. ///
리턴 void

SetWiperLock() 공개 메소드

Enables or disables the wiper lock.
/// Communication with device failed or malformed result. ///
public SetWiperLock ( System.Boolean enabled ) : void
enabled System.Boolean /// Set true to enable. ///
리턴 void

SetWriteProtection() 공개 메소드

Enables or disables write-protection for devices capable of non-volatile memory. Enabling write-protection does not only protect non-volatile wipers, it also protects any other non-volatile information stored (i.e. wiper-locks).
/// Communication with device failed or malformed result. ///
public SetWriteProtection ( System.Boolean enabled ) : void
enabled System.Boolean /// Set true to enable. ///
리턴 void

UpdateCacheFromDevice() 공개 메소드

Updates the cache to the wiper's value.
/// Communication with device failed or malformed result. ///
public UpdateCacheFromDevice ( ) : Int32
리턴 System.Int32

프로퍼티 상세

_nonVolMode 보호되어 있는 프로퍼티

protected MicrochipPotNonVolatileMode _nonVolMode
리턴 MicrochipPotNonVolatileMode