Expand description
Contains structs for CAN packages
§CAN Package Information
A CAN package is setup like this:
#[allow(non_camel_case_types)]
#[derive(bincode::Encode, bincode::Decode, PartialEq, Clone, Debug, Format, Default)]
#[repr(C)]
pub struct FDCAN_PACKAGE_NAME {
// Package Data
}
impl FDCANPack for FDCAN_FetPack_t {
const FDCAN_BYTES: FDCANLength = BYTE_LENGTH; // set this to the size of the package in bytes
const FDCAN_ID: u32 = CAN_ID; // the ID of the CAN package
}#[allow(non_camel_case_types)] allows non-camel-case names for FDCAN packages
#[derive(bincode::Encode, bincode::Decode)] makes the
package able to be encoded to and decoded from bytes.
#[derive(Clone)] allows the package to be copied.
#[derive(Debug)] allows the package to be formatted in log messages.
#[derive(Default)] allows the package to be inialized with default variables (usually 0).
#[repr(C)] Make Rust use the same memory layout for this struct as C to ensure compatility.
For more information: https://doc.rust-lang.org/nomicon/other-reprs.html
Structs§
- ECOCAN_
H2Pack1_ t - ECOCAN_
H2Pack2_ t - ECOCAN_
H2_ ARM_ ALARM_ t - ECOCAN_
RelPack Chrg_ t - FDCAN_
BATT Pack2_ t - FDCAN_
BOOST Pack1_ t - FDCAN_
BOOST Pack2_ t - FDCAN_
BOOST Pack3_ t - FDCAN_
FccPack1_ t - FDCAN_
FccPack2_ t - FDCAN_
FccPack3_ t - FDCAN_
FetPack_ t - FDCAN_
RelPack Cap_ t - FDCAN_
RelPack Fc_ t - FDCAN_
RelPack Mtr_ t - FDCAN_
RelPack Nrg_ t
Enums§
- FDCAN
Length - The length of the package in bytes, can be up to 64 bytes.
- FetBit
- Bit Definitions for FET State
- FetState
- FET States
- Relay
Bit - Bit Definitions for REL Board State
- Relay
State - Relay Board State
Constants§
- FDCAN_
H2ALARM_ ID - 1 indicates tripped alarm
- FDCAN_
SYNCLED_ ID - 1 indicates led on
Traits§
- FDCAN
Pack - Prerequisite trait for FDCAN Packages