29 #ifndef __utl_com_1wire_uart_h__ 30 #define __utl_com_1wire_uart_h__ 51 template <
typename Impl_t>
96 void UART_BR (uint32_t br) { impl().UART_BR (br); }
138 return (
UART_RW (0xFF) < 0xFF) ? 0 : 1;
155 template <
typename Impl_t>
157 switch (_speed = s) {
158 case Speed::STD: UART_BR (BR_STD);
break;
159 case Speed::OVDR: UART_BR (BR_OVR);
break;
180 template <
typename Impl_t>
183 uint8_t w = ((_speed = s) == Speed::STD) ? 0xF0 : 0xF8;
185 impl().UART_BR ((_speed == Speed::STD) ? BR_STD_RST : BR_OVR_RST);
187 return (impl().UART_RW (w) < w);
237 virtual void UART_BR (uint32_t br) =0;
279 return (
UART_RW (0xFF) < 0xFF) ? 0 : 1;
322 uint8_t w = ((
_speed = s) == Speed::STD) ? 0xF0 : 0xF8;
bool bit(bool b)
Send a 1-Wire write bit and read the response.
typename _1wire_i< type >::Speed Speed
Bring bus speed.
void UART_BR(uint32_t br)
Implementers's (driver) baudrate function.
Speed speed() const
Get the 1-wire bus speed.
A virtual base class interface implementation. Using the private virtual interface we provide the int...
An 1-wire interface implementation.
A virtual base class implementation.
bool bit(bool b)
Send a 1-Wire write bit and read the response.
STL's core language concepts.
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 < ...
byte_t UART_RW(byte_t byte)
Implementers's (driver) read-write function. We expect the following USART configuration: ...
Template base class for 1-wire communication interface using CRTP.
uint8_t byte_t
8 bits wide
_1wire_uart_i()=default
Allow constructor from derived only.
Speed speed() const
Get the 1-wire bus speed.
1-wire UART interface template class using CRTP Using the private virtual interface we provide the in...
Implementation detail main forward header.