Exemplo n.º 1
0
uint8_t ow_reset() {              // >= 960us 
   int present;
   owpin_output_low();
   delay_us(OW_DLY_H);            // t_RSTL
   owpin_prepare_read();
   delay_us(OW_DLY_I);            // t_MSP
   present = owpin_read();
   delay_us(OW_DLY_J);            // t_REC
   return (present==0);
}
Exemplo n.º 2
0
uint8_t ow_read_bit() {           // >= 70us
   int bit;
   owpin_output_low();
   delay_us(OW_DLY_A);            // t_RL
   owpin_prepare_read();
   delay_us(OW_DLY_E);            // near-max t_MSR
   bit = owpin_read();
   delay_us(OW_DLY_F);            // t_REC
   return bit;
}