microfmt
Zero-allocation C++ formatting for constrained environments
Loading...
Searching...
No Matches
Classes | Namespaces | Enumerations | Functions
can.hpp File Reference

Format standard, extended, remote, and CAN-FD frame views. More...

#include "../microfmt.hpp"
#include <cstddef>
#include <cstdint>
#include <string_view>
Include dependency graph for can.hpp:

Go to the source code of this file.

Classes

struct  microfmt::can_frame_view
 Non-owning CAN or CAN-FD frame descriptor for formatting. More...
 
struct  microfmt::formatter< can_frame_view >
 

Namespaces

namespace  microfmt
 

Enumerations

enum class  microfmt::can_flags : uint8_t {
  microfmt::none = 0 , microfmt::extended = 1 << 0 , microfmt::rtr = 1 << 1 , microfmt::fd = 1 << 2 ,
  microfmt::brs = 1 << 3 , microfmt::esi = 1 << 4
}
 

Functions

RELOCO_BEGIN_UNSAFE_CODE constexpr can_flags microfmt::operator| (can_flags a, can_flags b) noexcept
 
RELOCO_END_UNSAFE_CODE constexpr bool microfmt::operator& (can_flags a, can_flags b) noexcept
 
constexpr can_frame_view microfmt::can_frame (uint16_t id, span< const uint8_t > payload, bool rtr=false) noexcept
 Creates a standard 11-bit CAN frame view.
 
template<size_t N>
constexpr can_frame_view microfmt::can_frame (uint16_t id, const uint8_t(&arr)[N], bool rtr=false) noexcept
 
constexpr can_frame_view microfmt::can_extended (uint32_t id, span< const uint8_t > payload, bool rtr=false) noexcept
 Creates an extended 29-bit CAN frame view.
 
constexpr can_frame_view microfmt::can_fd (uint32_t id, span< const uint8_t > payload, bool is_extended=false, bool brs=false, bool esi=false) noexcept
 Creates a CAN-FD frame view with optional extended, BRS, and ESI flags.
 

Detailed Description

Format standard, extended, remote, and CAN-FD frame views.

Use can_frame, can_extended, or can_fd to create a frame view, then format it with either the default diagnostic representation or the {:c} candump representation.