HardFOC Core
API reference
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
HalUartAlicatBasis2Comm Class Reference

CRTP adapter that turns a BaseUart& into a transport the alicat_basis2::Driver can drive. More...

#include <AlicatBasis2Handler.h>

Inheritance diagram for HalUartAlicatBasis2Comm:

Public Member Functions

 HalUartAlicatBasis2Comm (BaseUart &uart) noexcept
 
void write (const std::uint8_t *data, std::size_t length) noexcept
 
std::size_t read (std::uint8_t *out, std::size_t max, std::uint32_t timeout_ms) noexcept
 
void flush_rx () noexcept
 
void delay_ms_impl (std::uint32_t ms) noexcept
 

Private Attributes

BaseUart & uart_
 

Detailed Description

CRTP adapter that turns a BaseUart& into a transport the alicat_basis2::Driver can drive.

Notes
  • BaseUart::Read returns an error code, not a byte count, so we trust the contract that the underlying driver fulfills the request completely or returns a non-success error (timeout / no data).
  • delay_ms_impl uses vTaskDelay so the driver can satisfy the Modbus-RTU 3.5-character idle gap when needed.

Constructor & Destructor Documentation

◆ HalUartAlicatBasis2Comm()

HalUartAlicatBasis2Comm::HalUartAlicatBasis2Comm ( BaseUart &  uart)
inlineexplicitnoexcept

Member Function Documentation

◆ delay_ms_impl()

void HalUartAlicatBasis2Comm::delay_ms_impl ( std::uint32_t  ms)
noexcept

◆ flush_rx()

void HalUartAlicatBasis2Comm::flush_rx ( )
noexcept

◆ read()

std::size_t HalUartAlicatBasis2Comm::read ( std::uint8_t *  out,
std::size_t  max,
std::uint32_t  timeout_ms 
)
noexcept

◆ write()

void HalUartAlicatBasis2Comm::write ( const std::uint8_t *  data,
std::size_t  length 
)
noexcept

Member Data Documentation

◆ uart_

BaseUart& HalUartAlicatBasis2Comm::uart_
private

The documentation for this class was generated from the following files: