HardFOC Core
API reference
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
hf::can Namespace Reference

Namespaces

namespace  anonymous_namespace{PipePort.cpp}
 
namespace  frame_flag
 Bits of CanFrame::flags.
 
namespace  record
 

Classes

struct  CanFrame
 One CAN or CAN FD frame; len is a byte count, never a DLC code. More...
 
class  CoPortBinding
 One ICanPort attached to one CO driver port slot. More...
 
class  EspTwaiPort
 
class  ICanPort
 One CAN transport binding. More...
 
class  LinuxSocketCanPort
 
class  PipeHub
 The bus: forwards datagrams between participants. More...
 
class  PipePort
 ICanPort over a PipeHub. More...
 
struct  PortCaps
 What a port binding can carry. More...
 
struct  PortStatus
 Error counters and statistics of one port. More...
 

Typedefs

using RxSink = bool(*)(void *ctx, const CanFrame &frame)
 RX sink; may run in ISR context (copy and return). Returns false if it could not take the frame.
 
using TxDoneSink = void(*)(void *ctx)
 TX-done sink: the port has room again; may run in ISR context.
 

Enumerations

enum class  TxResult : uint8_t { Ok = 0 , QueueFull , BusOff , NotAllowed }
 Result of a non-blocking ICanPort::Send. More...
 
enum class  BusState : uint8_t {
  Stopped = 0 , ErrorActive , ErrorWarning , ErrorPassive ,
  BusOff
}
 Controller error state. More...
 

Functions

constexpr bool IsExactFdLength (uint8_t len) noexcept
 Is len an exact FD payload size (0..8, 12, 16, 20, 24, 32, 48, 64)?
 
constexpr bool IsWellFormed (const CanFrame &f) noexcept
 Structurally valid frame (flags, id range, length for the frame kind)?
 
void ToC (const CanFrame &in, hf_co_frame_t &out) noexcept
 Copy between the C++ and C frame types (identical layout).
 
void FromC (const hf_co_frame_t &in, CanFrame &out) noexcept
 

Variables

constexpr uint8_t kClassicMaxLen = 8U
 Largest classic CAN payload in bytes.
 
constexpr uint8_t kFdMaxLen = 64U
 Largest CAN FD payload in bytes.
 
constexpr uint32_t kMaxStdId = 0x7FFU
 Largest 11-bit identifier.
 
constexpr uint32_t kMaxExtId = 0x1FFFFFFFU
 Largest 29-bit identifier.
 

Typedef Documentation

◆ RxSink

using hf::can::RxSink = typedef bool (*)(void* ctx, const CanFrame& frame)

RX sink; may run in ISR context (copy and return). Returns false if it could not take the frame.

◆ TxDoneSink

using hf::can::TxDoneSink = typedef void (*)(void* ctx)

TX-done sink: the port has room again; may run in ISR context.

Enumeration Type Documentation

◆ BusState

enum class hf::can::BusState : uint8_t
strong

Controller error state.

Enumerator
Stopped 
ErrorActive 
ErrorWarning 
ErrorPassive 
BusOff 

◆ TxResult

enum class hf::can::TxResult : uint8_t
strong

Result of a non-blocking ICanPort::Send.

Enumerator
Ok 
QueueFull 
BusOff 
NotAllowed 

Function Documentation

◆ FromC()

void hf::can::FromC ( const hf_co_frame_t &  in,
CanFrame &  out 
)
inlinenoexcept

◆ IsExactFdLength()

constexpr bool hf::can::IsExactFdLength ( uint8_t  len)
constexprnoexcept

Is len an exact FD payload size (0..8, 12, 16, 20, 24, 32, 48, 64)?

◆ IsWellFormed()

constexpr bool hf::can::IsWellFormed ( const CanFrame &  f)
constexprnoexcept

Structurally valid frame (flags, id range, length for the frame kind)?

◆ ToC()

void hf::can::ToC ( const CanFrame &  in,
hf_co_frame_t &  out 
)
inlinenoexcept

Copy between the C++ and C frame types (identical layout).

Variable Documentation

◆ kClassicMaxLen

constexpr uint8_t hf::can::kClassicMaxLen = 8U
inlineconstexpr

Largest classic CAN payload in bytes.

◆ kFdMaxLen

constexpr uint8_t hf::can::kFdMaxLen = 64U
inlineconstexpr

Largest CAN FD payload in bytes.

◆ kMaxExtId

constexpr uint32_t hf::can::kMaxExtId = 0x1FFFFFFFU
inlineconstexpr

Largest 29-bit identifier.

◆ kMaxStdId

constexpr uint32_t hf::can::kMaxStdId = 0x7FFU
inlineconstexpr

Largest 11-bit identifier.