uTL
micro Template library
|
A virtual base class interface implementation. Using the private virtual interface we provide the interface from _1wire_i<virtual_tag> More...
#include <_1wire_uart.h>
Public Types | |
using | type = _1wire_uart_i< virtual_tag > |
Export type as identity meta-function. More... | |
using | Speed = typename _1wire_i< virtual_tag >::Speed |
Bring bus speed. More... | |
![]() | |
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... | |
Protected Member Functions | |
Object lifetime | |
_1wire_uart_i ()=default | |
Allow constructor from derived only. More... | |
~_1wire_uart_i ()=default | |
![]() | |
_1wire_i ()=default | |
Allow constructor from derived only. More... | |
_1wire_i (const type &)=delete | |
No copies. More... | |
type & | operator= (const type &)=delete |
Private Member Functions | |
Implementation requirements | |
virtual byte_t | UART_RW (byte_t byte)=0 |
Implementers's (driver) read-write function. We use the following USART configuration: More... | |
virtual void | UART_BR (uint32_t br)=0 |
Implementers's (driver) baudrate function. More... | |
Implementation of base requirements | |
enum | BR { BR_STD_RST =9600, BR_OVR_RST =57600, BR_STD =115200, BR_OVR =921600 } |
1-wire UART baudrates More... | |
Speed | _speed {Speed::STD} |
Speed | speed () const |
Get the 1-wire bus speed. More... | |
void | speed (Speed s) |
Set the 1-wire bus speed. More... | |
bool | bit (bool b) |
Send a 1-Wire write bit and read the response. More... | |
bool | _reset (Speed s) |
Generate a 1-wire reset Reset \ / \ X X X / RS: | | | | | | | | | | | bit: ST 0 1 2 3 4 5 6 7 SP < -------— 1024/174 usec ----------—> More... | |
Additional Inherited Members | |
![]() | |
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... | |
virtual | ~_1wire_i ()=default |
A virtual base class interface implementation. Using the private virtual interface we provide the interface from _1wire_i<virtual_tag>
impl_t | = virtual_tag |
Definition at line 198 of file _1wire_uart.h.
using utl::_1wire_uart_i< virtual_tag >::Speed = typename _1wire_i<virtual_tag>::Speed |
Bring bus speed.
Definition at line 201 of file _1wire_uart.h.
using utl::_1wire_uart_i< virtual_tag >::type = _1wire_uart_i<virtual_tag> |
Export type as identity meta-function.
Definition at line 200 of file _1wire_uart.h.
|
private |
1-wire UART baudrates
Enumerator | |
---|---|
BR_STD_RST | |
BR_OVR_RST | |
BR_STD | |
BR_OVR |
Definition at line 244 of file _1wire_uart.h.
|
protecteddefault |
Allow constructor from derived only.
|
protecteddefault |
Allow destructor from derived only
|
privatevirtual |
Generate a 1-wire reset
Reset \ / \ X X X /
RS: | | | | | | | | | | | bit: ST 0 1 2 3 4 5 6 7 SP < -------— 1024/174 usec ----------—>
TX: (STD)0xF0, (OVDR)0xF8 RX: less if present
t | Timing |
Implements utl::_1wire_i< virtual_tag >.
Definition at line 320 of file _1wire_uart.h.
|
inlineprivatevirtual |
Send a 1-Wire write bit and read the response.
Write 1 — -----------------------------------—
RS: | | | | | | | | | | | bit: ST 0 1 2 3 4 5 6 7 SP TX: 0xFF RX: 0xFF->1, less->0
Write 0 — ---—
RS: | | | | | | | | | | | bit: ST 0 1 2 3 4 5 6 7 SP < ----------— 87/11 usec ----------—> TX: 0x00 RX: 0x00
b | The bit to send |
Implements utl::_1wire_i< virtual_tag >.
Definition at line 277 of file _1wire_uart.h.
|
inlineprivatevirtual |
Get the 1-wire bus speed.
Implements utl::_1wire_i< virtual_tag >.
Definition at line 252 of file _1wire_uart.h.
|
privatevirtual |
Set the 1-wire bus speed.
Set the 1-wire bus speed for normal operation only
s | The desired speed |
Implements utl::_1wire_i< virtual_tag >.
Definition at line 296 of file _1wire_uart.h.
|
privatepure virtual |
Implementers's (driver) baudrate function.
The | desired Baudrate |
|
privatepure virtual |
Implementers's (driver) read-write function. We use the following USART configuration:
The | byte to send |
|
private |
Definition at line 250 of file _1wire_uart.h.