OneWire/OneWire.cpp
void OneWire::write(uint8_t v, uint8_t power /* = 0 */) {
    uint8_t bitMask;

    for (bitMask = 0x01; bitMask; bitMask <<= 1) {
	OneWire::write_bit( (bitMask & v)?1:0);
    }
    if ( !power) {
	cli();
	DIRECT_MODE_INPUT(baseReg, bitmask);
	DIRECT_WRITE_LOW(baseReg, bitmask);
	sei();
    }
}
//
// Write a byte. The writing code uses the active drivers to raise the
// pin high, if you need power after the write (e.g. DS18S20 in
// parasite power mode) then set 'power' to 1, otherwise the pin will
// go tri-state at the end of the write to avoid heating in a short or
// other mishap.
//

Write a byte. The writing code uses the active drivers to raise the
pin high, if you need power after the write  then set 'power' to 1, otherwise the pin will
go tri-state at the end of the write to avoid heating in a short or
other mishap.
Write a byte . The writing code uses the active drivers to raise the pin high if you need power after the write then set ' power ' to 1 otherwise the pin will go tri - state at the end of the write to avoid heating in a short or other mishap .
void OneWire::write(uint8_t v, uint8_t power ) {
    uint8_t bitMask;
    for (bitMask = 0x01; bitMask; bitMask <<= 1) {
	OneWire::write_bit( (bitMask & v)?1:0);
    }
    if ( !power) {
	cli();
	DIRECT_MODE_INPUT(baseReg, bitmask);
	DIRECT_WRITE_LOW(baseReg, bitmask);
	sei();
    }
}
void OneWire :: write ( uint8_t v , uint8_t power ) { uint8_t bitMask ; for ( bitMask = 0x01 ; bitMask ; bitMask <<= 1 ) { OneWire :: write_bit ( ( bitMask & v ) ? 1 : 0 ) ; } if ( ! power ) { cli ( ) ; DIRECT_MODE_INPUT ( baseReg , bitmask ) ; DIRECT_WRITE_LOW ( baseReg , bitmask ) ; sei ( ) ; } }
Write a byte.
Write a byte .
/* = 0 */