HardFOC Core
API reference
Loading...
Searching...
No Matches
Classes | Functions
AlicatBasis2Handler.h File Reference

HAL-level handler for the Alicat BASIS-2 mass-flow instrument. More...

#include <atomic>
#include <cstddef>
#include <cstdint>
#include <functional>
#include <memory>
#include "RtosMutex.h"
#include "base/BaseUart.h"
#include "core/hf-core-drivers/external/hf-alicat-basis2-driver/inc/alicat_basis2.hpp"
#include "core/hf-core-drivers/external/hf-alicat-basis2-driver/inc/alicat_basis2_uart_interface.hpp"

Go to the source code of this file.

Classes

class  HalUartAlicatBasis2Comm
 CRTP adapter that turns a BaseUart& into a transport the alicat_basis2::Driver can drive. More...
 
struct  AlicatBasis2HandlerConfig
 Construction-time configuration for a single BASIS-2 slave. More...
 
class  AlicatBasis2Handler
 Thread-safe access layer to one BASIS-2 instrument on a shared bus. More...
 
struct  AlicatBasis2Handler::DiscoveredDevice
 One discovered instrument and the baud rate it was found at. More...
 

Functions

constexpr AlicatBasis2HandlerConfig MakeDefaultBasis2Config (std::uint8_t addr, std::uint8_t idx) noexcept
 

Detailed Description

HAL-level handler for the Alicat BASIS-2 mass-flow instrument.

Bridges the platform-agnostic alicat_basis2::Driver<UartT> to a BaseUart reference so any project that already owns a configured UART (in RS-485 half-duplex mode if needed) can talk to one or more BASIS-2 instruments on a shared bus.

Each handler instance corresponds to one BASIS-2 slave on the shared bus. Multiple handlers can share a single BaseUart — they coordinate access through the per-bus RtosMutex shared via bus_mutex_. The first handler created for a given UART seeds the mutex; later handlers must be constructed with a pointer to the same mutex object.

Pattern follows the rest of the HAL handler family (Ads7952Handler, Tle92466edHandler, Max22200Handler).

Function Documentation

◆ MakeDefaultBasis2Config()

constexpr AlicatBasis2HandlerConfig MakeDefaultBasis2Config ( std::uint8_t  addr,
std::uint8_t  idx 
)
inlineconstexprnoexcept