odrive_cansimple/enumerations/
error.rs

1bitflags! {
2    #[derive(Default)]
3    pub struct AxisError: u32 {
4        const ERROR_NONE = 0x00;
5        const ERROR_INVALID_STATE = 0x01;
6        const ERROR_DC_BUS_UNDER_VOLTAGE = 0x02;
7        const ERROR_DC_BUS_OVER_VOLTAGE = 0x04;
8        const ERROR_CURRENT_MEASUREMENT_TIMEOUT = 0x08;
9        const ERROR_BRAKE_RESISTOR_DISARMED = 0x10;
10        const ERROR_MOTOR_DISARMED = 0x20;
11        const ERROR_MOTOR_FAILED = 0x40;
12        const ERROR_SENSORLESS_ESTIMATOR_FAILED = 0x80;
13        const ERROR_ENCODER_FAILED = 0x100;
14        const ERROR_CONTROLLER_FAILED = 0x200;
15        const ERROR_POS_CTRL_DURING_SENSORLESS = 0x400;
16        const ERROR_WATCHDOG_TIMER_EXPIRED = 0x800;
17        const ERROR_MIN_ENDSTOP_PRESSED = 0x1000;
18        const ERROR_MAX_ENDSTOP_PRESSED = 0x2000;
19        const ERROR_ESTOP_REQUESTED = 0x4000;
20        const ERROR_DC_BUS_UNDER_CURRENT = 0x8000;
21        const ERROR_DC_BUS_OVER_CURRENT = 0x10000;
22        const ERROR_HOMING_WITHOUT_ENDSTOP = 0x20000;
23    }
24}
25
26bitflags! {
27    #[derive(Default)]
28    pub struct EncoderError: u32 {
29        const ERROR_NONE = 0x00;
30        const ERROR_UNSTABLE_GAIN = 0x01;
31        const ERROR_CPR_OUT_OF_RANGE = 0x02;
32        const ERROR_NO_RESPONSE = 0x04;
33        const ERROR_UNSUPPORTED_ENCODER_MODE = 0x08;
34        const ERROR_ILLEGAL_HALL_STATE = 0x10;
35        const ERROR_INDEX_NOT_FOUND_YET = 0x20;
36    }
37}
38
39bitflags! {
40    #[derive(Default)]
41    pub struct MotorError: u32 {
42        const ERROR_NONE = 0x0000;
43        const ERROR_PHASE_RESISTANCE_OUT_OF_RANGE = 0x0001;
44        const ERROR_PHASE_INDUCTANCE_OUT_OF_RANGE = 0x0002;
45        const ERROR_ADC_FAILED = 0x0004;
46        const ERROR_DRV_FAULT = 0x0008;
47        const ERROR_CONTROL_DEADLINE_MISSED = 0x0010;
48        const ERROR_NOT_IMPLEMENTED_MOTOR_TYPE = 0x0020;
49        const ERROR_BRAKE_CURRENT_OUT_OF_RANGE = 0x0040;
50        const ERROR_MODULATION_MAGNITUDE = 0x0080;
51        const ERROR_BRAKE_DEADTIME_VIOLATION = 0x0100;
52        const ERROR_UNEXPECTED_TIMER_CALLBACK = 0x0200;
53        const ERROR_CURRENT_SENSE_SATURATION = 0x0400;
54        const ERROR_INVERTER_OVER_TEMP = 0x0800;
55        const ERROR_CURRENT_UNSTABLE = 0x1000;
56    }
57}