ESP8266
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
OneWire Class Reference

Public Member Functions

 OneWire (uint8_t pin, bool pullup=true)
 
uint8_t reset (void)
 
void select (const uint8_t rom[8])
 
void skip (void)
 
void write (uint8_t v, uint8_t power=0)
 
void write_bytes (const uint8_t *buf, uint16_t count, bool power=0)
 
uint8_t read (void)
 
void read_bytes (uint8_t *buf, uint16_t count)
 
void write_bit (uint8_t v)
 
uint8_t read_bit (void)
 
void depower (void)
 
void reset_search ()
 
void target_search (uint8_t family_code)
 
uint8_t search (uint8_t *newAddr)
 

Static Public Member Functions

static uint8_t crc8 (const uint8_t *addr, uint8_t len)
 
static bool check_crc16 (const uint8_t *input, uint16_t len, const uint8_t *inverted_crc, uint16_t crc=0)
 
static uint16_t crc16 (const uint8_t *input, uint16_t len, uint16_t crc=0)
 

Private Attributes

IO_REG_TYPE bitmask
 
volatile IO_REG_TYPE * baseReg
 
unsigned char ROM_NO [8]
 
uint8_t LastDiscrepancy
 
uint8_t LastFamilyDiscrepancy
 
uint8_t LastDeviceFlag
 

Constructor & Destructor Documentation

OneWire::OneWire ( uint8_t  pin,
bool  pullup = true 
)

Member Function Documentation

bool OneWire::check_crc16 ( const uint8_t *  input,
uint16_t  len,
const uint8_t *  inverted_crc,
uint16_t  crc = 0 
)
static
uint16_t OneWire::crc16 ( const uint8_t *  input,
uint16_t  len,
uint16_t  crc = 0 
)
static
uint8_t OneWire::crc8 ( const uint8_t *  addr,
uint8_t  len 
)
static
void OneWire::depower ( void  )
uint8_t OneWire::read ( void  )
uint8_t OneWire::read_bit ( void  )
void OneWire::read_bytes ( uint8_t *  buf,
uint16_t  count 
)
uint8_t OneWire::reset ( void  )
void OneWire::reset_search ( )
uint8_t OneWire::search ( uint8_t *  newAddr)
void OneWire::select ( const uint8_t  rom[8])
void OneWire::skip ( void  )
void OneWire::target_search ( uint8_t  family_code)
void OneWire::write ( uint8_t  v,
uint8_t  power = 0 
)
void OneWire::write_bit ( uint8_t  v)
void OneWire::write_bytes ( const uint8_t *  buf,
uint16_t  count,
bool  power = 0 
)

Member Data Documentation

volatile IO_REG_TYPE* OneWire::baseReg
private
IO_REG_TYPE OneWire::bitmask
private
uint8_t OneWire::LastDeviceFlag
private
uint8_t OneWire::LastDiscrepancy
private
uint8_t OneWire::LastFamilyDiscrepancy
private
unsigned char OneWire::ROM_NO[8]
private