uTL
micro Template library
|
A virtual base class implementation. More...
#include <_1wire.h>
Public Types | |
enum | Speed { Speed::STD =0, Speed::OVDR } |
1-wire bus speed More... | |
using | type = _1wire_i< virtual_tag > |
Export type as identity meta-function. More... | |
Public Member Functions | |
User functionality provided by the interface | |
bool | reset (Speed s=Speed::STD) |
Generate a 1-wire reset. More... | |
byte_t | tx_data (byte_t out, Speed s=Speed::STD) |
size_t | tx_data (const byte_t *out, byte_t *in, size_t n, Speed s=Speed::STD) |
byte_t | rx_data (Speed s=Speed::STD) |
size_t | rx_data (byte_t *in, size_t n, Speed s=Speed::STD) |
void | match (_1wire_id_t &id, Speed s=Speed::STD) |
void | match_n_ovdr (_1wire_id_t &id) |
void | skip (Speed s=Speed::STD) |
void | skip_n_ovdr () |
_1wire_id_t | first (Speed s=Speed::STD, bool alarm=false) |
'first' operation, to search on the 1-Wire for the first device. This is performed by setting dec_, pos_ and cur_ to zero and then doing the search. More... | |
_1wire_id_t | next (Speed s=Speed::STD, bool alarm=false) |
'next' operation, to search on the 1-Wire for the next device. This search is usually performed after a 'first' operation or another 'next' operation. Based on maxim-ic application note 187. More... | |
Private Member Functions | |
Implementation requirements | |
virtual Speed | speed () const =0 |
Get the 1-wire bus speed. More... | |
virtual void | speed (Speed)=0 |
Set the 1-wire bus speed. More... | |
virtual bool | bit ()=0 |
Read a bit from the 1-Wire bus, return it and provide the recovery time. More... | |
virtual bool | bit (bool)=0 |
Write a bit to the 1-Wire bus, return write status and provide the recovery time. More... | |
virtual bool | _reset (Speed)=0 |
Private Attributes | |
_1wire_id_t | dec_ {_1wire_id_t::nullDev()} |
_1wire_id_t | pos_ {_1wire_id_t::nullDev()} |
_1wire_id_t | cur_ {_1wire_id_t::nullDev()} |
Object lifetime | |
_1wire_i ()=default | |
Allow constructor from derived only. More... | |
_1wire_i (const type &)=delete | |
No copies. More... | |
type & | operator= (const type &)=delete |
virtual | ~_1wire_i ()=default |
Friends api to provide functionality to all class specializations | |
enum | Command { CMD_READ_ROM = 0x33, CMD_OVDR_SKIP = 0x3C, CMD_MATCH = 0x55, CMD_OVDR_MATCH = 0x69, CMD_SKIP = 0xCC, CMD_ALARM_SEARCH = 0xEC, CMD_SEARCH_ROM = 0xF0 } |
template<typename _T > | |
byte_t | _1wire_i_det::_touch (_T &, byte_t, typename _T::Speed) |
template<typename _T > | |
void | _1wire_i_det::_match (_T &obj, _1wire_id_t &id, typename _T::Speed s) |
template<typename _T > | |
void | _1wire_i_det::_match_n_ovdr (_T &obj, _1wire_id_t &id) |
template<typename _T > | |
void | _1wire_i_det::_skip (_T &obj, typename _T::Speed s) |
template<typename _T > | |
void | _1wire_i_det::_skip_n_ovdr (_T &obj) |
template<typename _T > | |
_1wire_id_t | _1wire_i_det::_first (_T &, typename _T::Speed, bool) |
template<typename _T > | |
_1wire_id_t | _1wire_i_det::_next (_T &, typename _T::Speed, bool) |
A virtual base class implementation.
impl_t | = virtual_tag |
using utl::_1wire_i< virtual_tag >::type = _1wire_i<virtual_tag> |
|
private |
|
strong |
|
protecteddefault |
Allow constructor from derived only.
|
protecteddelete |
No copies.
|
virtualdefault |
Virtual default destructor
|
privatepure virtual |
Generate a 1-wire reset and return the operation status
Implemented in utl::_1wire_uart_i< virtual_tag >.
|
privatepure virtual |
Read a bit from the 1-Wire bus, return it and provide the recovery time.
|
privatepure virtual |
Write a bit to the 1-Wire bus, return write status and provide the recovery time.
Implemented in utl::_1wire_uart_i< virtual_tag >.
|
inline |
'first' operation, to search on the 1-Wire for the first device. This is performed by setting dec_, pos_ and cur_ to zero and then doing the search.
s | The bus speed |
alarm | If set, search for alarm devices |
|
inline |
|
inline |
|
inline |
'next' operation, to search on the 1-Wire for the next device. This search is usually performed after a 'first' operation or another 'next' operation. Based on maxim-ic application note 187.
s | The bus speed |
alarm | If set, search for alarm devices |
|
protecteddelete |
|
inline |
|
inline |
size_t utl::_1wire_i< virtual_tag >::rx_data | ( | byte_t * | in, |
size_t | n, | ||
Speed | s = Speed::STD |
||
) |
|
inline |
|
inline |
|
privatepure virtual |
Get the 1-wire bus speed.
Implemented in utl::_1wire_uart_i< virtual_tag >.
|
privatepure virtual |
Set the 1-wire bus speed.
Implemented in utl::_1wire_uart_i< virtual_tag >.
|
inline |
size_t utl::_1wire_i< virtual_tag >::tx_data | ( | const byte_t * | out, |
byte_t * | in, | ||
size_t | n, | ||
Speed | s = Speed::STD |
||
) |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |
|
private |
|
private |
|
private |