Пример #1
0
 /// <summary> Enables or disables the oscillator, turning the clock 'on' and 'off'.
 /// The method <code>writeDevice(byte[])</code> must be called to finalize
 /// changes to the device.  Note that multiple 'set' methods can
 /// be called before one call to <code>writeDevice(byte[])</code>.  Also note that
 /// not all clock devices can disable their oscillators.  Check to see if this device can
 /// disable its oscillator first by calling the <code>canDisableClock()</code> method.
 ///
 /// </summary>
 /// <param name="runEnable">true to enable the clock oscillator
 /// </param>
 /// <param name="state">current state of the device returned from <code>readDevice()</code>
 ///
 ///
 /// </param>
 /// <seealso cref="com.dalsemi.onewire.container.OneWireSensor.writeDevice(byte[])">
 /// </seealso>
 /// <seealso cref="canDisableClock()">
 /// </seealso>
 /// <seealso cref="isClockRunning(byte[])">
 /// </seealso>
 public virtual void  setClockRunEnable(bool runEnable, byte[] state)
 {
     /* When writing oscillator enable, both bits should have identical data. */
     Bit.arrayWriteBit(runEnable?1:0, 3, CONTROL_OFFSET, state);
     Bit.arrayWriteBit(runEnable?1:0, 2, CONTROL_OFFSET, state);
 }
Пример #2
0
 /// <summary> Enables or disables hardware interrupting.  If enabled, the
 /// device sends an interrupt at intervals defined by using the
 /// setInterruptInterval function.
 /// </summary>
 /// <param name="runEnable">true to enable interval interrupts.
 /// </param>
 /// <param name="state">current state of the device returned from <code>readDevice()</code>
 ///
 ///
 /// </param>
 /// <seealso cref="com.dalsemi.onewire.container.OneWireSensor.writeDevice(byte[])">
 /// </seealso>
 /// <seealso cref="canDisableClock()">
 /// </seealso>
 /// <seealso cref="isClockRunning(byte[])">
 /// </seealso>
 public virtual void  setInterruptEnable(bool iEnable, byte[] state)
 {
     Bit.arrayWriteBit(iEnable?1:0, 7, CONTROL_OFFSET, state);
 }
Пример #3
0
 /// <summary> Checks if the device's oscillator is enabled.  The clock
 /// will not increment if the clock oscillator is not enabled.
 ///
 /// </summary>
 /// <param name="state">current state of the device returned from <code>readDevice()</code>
 ///
 /// </param>
 /// <returns> true if the clock is running
 ///
 /// </returns>
 /// <seealso cref="com.dalsemi.onewire.container.OneWireSensor.readDevice()">
 /// </seealso>
 /// <seealso cref="canDisableClock()">
 /// </seealso>
 /// <seealso cref="setClockRunEnable(boolean,byte[])">
 /// </seealso>
 public virtual bool isClockRunning(byte[] state)
 {
     return(Bit.arrayReadBit(3, CONTROL_OFFSET, state) == 1);
 }
Пример #4
0
 /// <summary>
 /// Checks to see if interrupt mode is turned on. If so, pulses will be generated
 /// at an interval selected by setInterruptInterval.
 /// </summary>
 /// <param name="state">current state of the device returned from <code>readDevice()</code>
 ///
 /// </param>
 /// <returns> true if interrupts are enabled
 ///
 /// </returns>
 /// <seealso cref="com.dalsemi.onewire.container.OneWireSensor.readDevice()">
 /// </seealso>
 /// <seealso cref="canDisableClock()">
 /// </seealso>
 /// <seealso cref="setClockRunEnable(boolean,byte[])">
 /// </seealso>
 public virtual bool isInterruptEnabled(byte[] state)
 {
     return(Bit.arrayReadBit(7, CONTROL_OFFSET, state) == 1);
 }