FDCANPack

Trait FDCANPack 

Source
pub trait FDCANPack: Encode + Clone {
    const FDCAN_BYTES: FDCANLength;
    const FDCAN_ID: u16;
}
Expand description

Prerequisite trait for FDCAN Packages

Sets the ID and number of bytes for a CAN package. Note that associated constants do not increase the size of a struct’s memory.

Required Associated Constants§

Source

const FDCAN_BYTES: FDCANLength

The length of the package in bytes, can be up to 64 bytes.

pub structs must be a certain size for FDCAN to transfer The following package sizes (in bytes) are 0, 1, 2, 3, 4, 5, 6, 7, 8, 12, 16, 20, 24, 32, 48, 64.

Source

const FDCAN_ID: u16

12 bit ID

Reserved IDs up to 0x01F

0x010 = 0b00000010000

0x01F = 0b00000011111

To receive all can filter ids within this range you must set the mask to 0x7F0 = 0b11111110000

because you care that the bits [10:4] of the can id are exactly the same as bits [10:4] in 0x010/0x01F but the last four bits [3:0] can be 0 or 1 The same logic will be applied henceforth

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl FDCANPack for ECOCAN_H2Pack1_t

Source§

const FDCAN_BYTES: FDCANLength = FDCANLength::BYTES_8

Source§

const FDCAN_ID: u16 = 48u16

Source§

impl FDCANPack for ECOCAN_H2Pack2_t

Source§

const FDCAN_BYTES: FDCANLength = FDCANLength::BYTES_8

Source§

const FDCAN_ID: u16 = 49u16

Source§

impl FDCANPack for ECOCAN_H2_ARM_ALARM_t

Source§

const FDCAN_BYTES: FDCANLength = FDCANLength::BYTES_1

Source§

const FDCAN_ID: u16 = 50u16

Source§

impl FDCANPack for ECOCAN_RelPackChrg_t

Source§

const FDCAN_BYTES: FDCANLength = FDCANLength::BYTES_8

Source§

const FDCAN_ID: u16 = 19u16

Source§

impl FDCANPack for FDCAN_BATTPack2_t

Source§

const FDCAN_BYTES: FDCANLength = FDCANLength::BYTES_4

Source§

const FDCAN_ID: u16 = 80u16

Source§

impl FDCANPack for FDCAN_BOOSTPack2_t

Source§

const FDCAN_BYTES: FDCANLength = FDCANLength::BYTES_8

Source§

const FDCAN_ID: u16 = 65u16

Source§

impl FDCANPack for FDCAN_BOOSTPack3_t

Source§

const FDCAN_BYTES: FDCANLength = FDCANLength::BYTES_8

Source§

const FDCAN_ID: u16 = 66u16

Source§

impl FDCANPack for FDCAN_BOOSTPack_t

Source§

const FDCAN_BYTES: FDCANLength = FDCANLength::BYTES_8

Source§

const FDCAN_ID: u16 = 64u16

Source§

impl FDCANPack for FDCAN_FccPack1_t

Source§

const FDCAN_BYTES: FDCANLength = FDCANLength::BYTES_8

Source§

const FDCAN_ID: u16 = 32u16

Source§

impl FDCANPack for FDCAN_FccPack2_t

Source§

const FDCAN_BYTES: FDCANLength = FDCANLength::BYTES_8

Source§

const FDCAN_ID: u16 = 33u16

Source§

impl FDCANPack for FDCAN_FccPack3_t

Source§

const FDCAN_BYTES: FDCANLength = FDCANLength::BYTES_8

Source§

const FDCAN_ID: u16 = 34u16

Source§

impl FDCANPack for FDCAN_FetPack_t

Source§

const FDCAN_BYTES: FDCANLength = FDCANLength::BYTES_24

Source§

const FDCAN_ID: u16 = 16u16

Source§

impl FDCANPack for FDCAN_RelPackCap_t

Source§

const FDCAN_BYTES: FDCANLength = FDCANLength::BYTES_8

Source§

const FDCAN_ID: u16 = 22u16

Source§

impl FDCANPack for FDCAN_RelPackFc_t

Source§

const FDCAN_BYTES: FDCANLength = FDCANLength::BYTES_8

Source§

const FDCAN_ID: u16 = 23u16

Source§

impl FDCANPack for FDCAN_RelPackMtr_t

Source§

const FDCAN_BYTES: FDCANLength = FDCANLength::BYTES_8

Source§

const FDCAN_ID: u16 = 21u16

Source§

impl FDCANPack for FDCAN_RelPackNrg_t

Source§

const FDCAN_BYTES: FDCANLength = FDCANLength::BYTES_8

Source§

const FDCAN_ID: u16 = 20u16