/// <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); }
/// <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); }