Skip to main content

Crate kcan_core

Crate kcan_core 

Source
Expand description

No-std CAN protocol primitives for KCAN actuator tooling.

This crate intentionally stays small: fixed-size CAN frames, CubeMars Servo Direct payload builders, and RobStride status parsing. Higher-level transport, dashboards, and analytics live in sibling crates or the main kcan crate.

use kcan_core::{CanId, DirectCommand, direct_command_frame};

let id: CanId = "extended:0x301".parse()?;
let frame = direct_command_frame(0x03, DirectCommand::Velocity(1_000))?;

assert_eq!(id.raw(), 0x301);
assert_eq!(frame.to_string(), "extended 0x303 len=4 data=00 00 03 E8");

Structs§

CanFrame
DirectPayload
RobStrideFeedback

Enums§

CanId
ControlMode
DirectCommand
Error
OriginMode
RobStrideFrameKind

Constants§

CURRENT_SCALE
DUTY_SCALE
MAX_CAN_DATA_LEN
MAX_CURRENT_AMPS
MAX_DUTY_CYCLE
MAX_EXTENDED_ID
MAX_POSITION_DEGREES
MAX_PROFILE_ACCELERATION_ERPM_PER_SEC
MAX_PROFILE_ERPM
MAX_PROTOCOL_ERPM
MAX_STANDARD_ID
MIN_POSITION_DEGREES
MIN_PROFILE_ACCELERATION_ERPM_PER_SEC
MIN_PROFILE_ERPM
MIN_PROTOCOL_ERPM
POSITION_SCALE
PROFILE_ERPM_PER_UNIT
ROBSTRIDE_CONFIG_BASE_ID
ROBSTRIDE_MIT_BASE_ID
ROBSTRIDE_POSITION_BASE_ID
ROBSTRIDE_SPEED_BASE_ID
ROBSTRIDE_STATUS_BASE_ID

Functions§

direct_command_frame

Type Aliases§

Result