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

Attaches an hf::can::ICanPort to a CO driver port slot (hf_co_driver_attach_port()). More...

#include <cstddef>
#include <cstring>
#include "HfCanPort.h"
#include "hf_co_driver.h"

Go to the source code of this file.

Classes

class  hf::can::CoPortBinding
 One ICanPort attached to one CO driver port slot. More...
 

Namespaces

namespace  hf
 
namespace  hf::can
 

Functions

void hf::can::ToC (const CanFrame &in, hf_co_frame_t &out) noexcept
 Copy between the C++ and C frame types (identical layout).
 
void hf::can::FromC (const hf_co_frame_t &in, CanFrame &out) noexcept
 

Detailed Description

Attaches an hf::can::ICanPort to a CO driver port slot (hf_co_driver_attach_port()).

The binding owns the C trampolines: driver → port (send, status, recover) and port → driver (RX sink → hf_co_driver_rx_push(), TX-done sink → hf_co_driver_tx_done()). Keep it alive while the port is attached.

SPDX-License-Identifier: GPL-3.0-or-later