#include <OWI.hh>
Driver for device connected to a one-wire bus.
Definition at line 58 of file OWI.hh.
Enumerator |
---|
FIRST |
|
ERROR |
|
LAST |
|
Definition at line 60 of file OWI.hh.
OWI::Driver::Driver |
( |
OWI * |
pin, |
|
|
const char * |
name = NULL |
|
) |
| |
|
inline |
Construct one wire device driver. Use one wire bus on given pin.
- Parameters
-
[in] | pin | one wire bus. |
[in] | name | of device driver instance. |
Definition at line 74 of file OWI.hh.
OWI::Driver::Driver |
( |
OWI * |
pin, |
|
|
const uint8_t * |
rom, |
|
|
const char * |
name = NULL |
|
) |
| |
Construct one wire device driver. Use one wire bus on given pin, given rom identity in EEPROM (or null), and device name.
- Parameters
-
[in] | pin | one wire bus. |
[in] | rom | identity. |
[in] | name | of device driver instance. |
Definition at line 161 of file OWI.cpp.
int8_t OWI::Driver::alarm_search |
( |
int8_t |
last = FIRST | ) |
|
Search alarming device given the last position of discrepancy. Negative value for start from the beginning.
- Parameters
-
[in] | last | position of discrepancy. |
- Returns
- position of difference or negative error code.
Definition at line 264 of file OWI.cpp.
bool OWI::Driver::connect |
( |
uint8_t |
family, |
|
|
uint8_t |
index |
|
) |
| |
Connect to one-wire device with given family code and index.
- Parameters
-
[in] | family | device family code. |
[in] | index | device order. |
- Returns
- true(1) if successful otherwise false(0).
Definition at line 272 of file OWI.cpp.
bool OWI::Driver::match_rom |
( |
| ) |
|
Match device rom. Address the slave device with the rom code. Device specific function command should follow. May be used to verify rom code.
- Returns
- true(1) if successful otherwise false(0).
Definition at line 244 of file OWI.cpp.
virtual void OWI::Driver::on_alarm |
( |
| ) |
|
|
inlinevirtual |
Callback on alarm dispatch. Default is empty function.
Definition at line 159 of file OWI.hh.
bool OWI::Driver::read_rom |
( |
| ) |
|
Read device rom. This can only be used when there is only one slave on the bus.
- Returns
- true(1) if successful otherwise false(0).
Definition at line 236 of file OWI.cpp.
uint8_t* OWI::Driver::rom |
( |
| ) |
|
|
inline |
Return pointer to device rom.
- Returns
- device rom buffer.
Definition at line 96 of file OWI.hh.
int8_t OWI::Driver::search |
( |
int8_t |
last = FIRST | ) |
|
|
protected |
Search device rom given the last position of discrepancy. Negative value for start from the beginning.
- Parameters
-
[in] | last | position of discrepancy. |
- Returns
- position of difference or negative error code.
Definition at line 182 of file OWI.cpp.
int8_t OWI::Driver::search_rom |
( |
int8_t |
last = FIRST | ) |
|
Search device rom given the last position of discrepancy. Negative value for start from the beginning.
- Parameters
-
[in] | last | position of discrepancy. |
- Returns
- position of difference or negative error code.
Definition at line 228 of file OWI.cpp.
bool OWI::Driver::skip_rom |
( |
| ) |
|
Skip device rom for boardcast or single device access. Device specific function command should follow.
- Returns
- true(1) if successful otherwise false(0).
Definition at line 256 of file OWI.cpp.
bool OWI::Driver::update_rom |
( |
| ) |
|
Update the rom identity (in EEPROM). Return true(1) if successful otherwise false(0). Typically used to save configuration after connect(). return bool.
Definition at line 174 of file OWI.cpp.
Print list of connected devices on given stream.
- Parameters
-
[in] | outs | stream to print device information to. |
[in] | owi | one-wire bus. |
- Returns
- output stream.
Definition at line 149 of file OWI.cpp.
Print device driver name and rom to output stream.
- Parameters
-
[in] | outs | stream to print to. |
[in] | dev | owi device driver. |
- Returns
- output stream.
Definition at line 292 of file OWI.cpp.
uint8_t OWI::Driver::m_rom[ROM_MAX] |
|
protected |
Name of device driver instance.
Definition at line 67 of file OWI.hh.
const uint8_t* OWI::Driver::ROM |
|
protected |
The documentation for this class was generated from the following files: