ethercat_soem/
al_status.rs1use num_derive::FromPrimitive;
2use num_traits::cast::FromPrimitive as _;
3
4#[derive(Debug, Clone, Copy, PartialEq, Eq, FromPrimitive)]
8#[repr(u16)]
9pub enum AlStatus {
10 NoError = 0x0000,
12
13 UnspecifiedError = 0x0001,
15
16 NoMemory = 0x0002,
18
19 InvalidRequestedStateChange = 0x0011,
21
22 UnknownRequestedState = 0x0012,
24
25 BootstrapNotSupported = 0x0013,
27
28 NoValidFirmware = 0x0014,
30
31 InvalidMailboxConfig = 0x0015,
35
36 InvalidMailboxConfig2 = 0x0016,
40
41 InvalidSyncManagerConfiguration = 0x0017,
43
44 NoValidInputsAvailable = 0x0018,
46
47 NoValidOutputs = 0x0019,
49
50 SynchronizationError = 0x001A,
52
53 SyncManagerWatchdog = 0x001B,
55
56 InvalidSyncManagerTypes = 0x001C,
58
59 InvalidOutputConfiguration = 0x001D,
61
62 InvalidInputConfiguration = 0x001E,
64
65 InvalidWatchdogConfiguration = 0x001F,
67
68 SlaveNeedsColdStart = 0x0020,
70
71 SlaveNeedsInit = 0x0021,
73
74 SlaveNeedsPreOp = 0x0022,
76
77 SlaveNeedsSafeOp = 0x0023,
79
80 InvalidInputMapping = 0x0024,
82
83 InvalidOutputMapping = 0x0025,
85
86 InconsistentSettings = 0x0026,
88
89 FreerunNotSupported = 0x0027,
91
92 SynchronisationNotSupported = 0x0028,
94
95 FreerunNeeds3BufferMode = 0x0029,
97
98 BackgroundWatchdog = 0x002A,
100
101 NovalidInputsAndOutputs = 0x002B,
103
104 FatalSyncError = 0x002C,
106
107 NoSyncError = 0x002D,
109
110 InvalidInputFmmuConfiguration = 0x002E,
112
113 InvalidDcSyncConfiguration = 0x0030,
115
116 InvalidDcLatchConfiguration = 0x0031,
118
119 PllError = 0x0032,
121
122 DcSyncIoError = 0x0033,
124
125 DcSyncTimeoutError = 0x0034,
127
128 DcInvalidSyncCycleTime = 0x0035,
130
131 DcInvalidSync0CycleTime = 0x0036,
133
134 DcInvalidSync1CycleTime = 0x0037,
136
137 MbxAoe = 0x0041,
139
140 MbxEoe = 0x0042,
142
143 MbxCoe = 0x0043,
145
146 MbxFoe = 0x0044,
148
149 MbxSoe = 0x0045,
151
152 MbcVoe = 0x004F,
154
155 EepromNoAccess = 0x0050,
157
158 EeepromError = 0x0051,
160
161 SlaveRestartedLocally = 0x0060,
163
164 DeviceIdValueUpdated = 0x0061,
166
167 ApplicationControllerAvailable = 0x00f0,
169
170 Unknown = 0xffff,
172}
173
174impl From<u16> for AlStatus {
175 fn from(code: u16) -> Self {
176 AlStatus::from_u16(code).unwrap_or(AlStatus::Unknown)
177 }
178}