st3215 0.0.2

A crate for communicating with Feetech/Waveshare branded ST3215 serial bus servos
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
/** Auto-generated code. Do not modify. See build.rs for details. */

#[derive(Debug, Copy, Clone, PartialEq, Eq)]
pub enum Register {
    /**
     * Firmware major version number
     *
     * initial_value: 3
     * storage_area: EPROM
     * authority: read
     * minimum_value: -1
     * maximum_value: -1
     * unit:
     */
    FirmwareMajorVersionNumber = 0,

    /**
     * Firmware sub version number
     *
     * initial_value: 6
     * storage_area: EPROM
     * authority: read
     * minimum_value: -1
     * maximum_value: -1
     * unit:
     */
    FirmwareSubVersionNumber = 1,

    /**
     * servo Main Version Number
     *
     * initial_value: 9
     * storage_area: EPROM
     * authority: read
     * minimum_value: -1
     * maximum_value: -1
     * unit:
     */
    ServoMainVersionNumber = 3,

    /**
     * servo sub version number
     *
     * initial_value: 3
     * storage_area: EPROM
     * authority: read
     * minimum_value: -1
     * maximum_value: -1
     * unit:
     */
    ServoSubVersionNumber = 4,

    /**
     * ID
     *
     * Unique identification code on the bus. Duplicate ID number is not allowed on the same bus,254 (oxfe) is the broadcast ID, broadcast does not return a reply packet“
     *
     * initial_value: 1
     * storage_area: EPROM
     * authority: read&write
     * minimum_value: 0
     * maximum_value: 253
     * unit: number
     */
    ID = 5,

    /**
     * Baud rate
     *
     * 0-7 represents baud rate as follows: 1000000 500000 250000 128000 115200 76800 57600 38400
     *
     * initial_value: 0
     * storage_area: EPROM
     * authority: read&write
     * minimum_value: 0
     * maximum_value: 7
     * unit: no
     */
    BaudRate = 6,

    /**
     * Return delay
     *
     * The minimum unit is 2us, and the maximum set return delay is 254 * 2 = 508us
     *
     * initial_value: 0
     * storage_area: EPROM
     * authority: read&write
     * minimum_value: 0
     * maximum_value: 254
     * unit: 2us
     */
    ReturnDelay = 7,

    /**
     * Response status level
     *
     * 0: except for read instruction and Ping instruction, other instructions do not return reply packet;1: Returns a reply packet for all instructions“
     *
     * initial_value: 1
     * storage_area: EPROM
     * authority: read&write
     * minimum_value: 0
     * maximum_value: 1
     * unit: no
     */
    ResponseStatusLevel = 8,

    /**
     * Minimum Angle Limitation
     *
     * Set the minimum limit of motion stroke, the value is less than the maximum angle limit, and this value is 0 when the multi cycle absolute position control is carried out
     *
     * initial_value: 0
     * storage_area: EPROM
     * authority: read&write
     * minimum_value: 0
     * maximum_value: 4094
     * unit: step
     */
    MinimumAngleLimitation = 9,

    /**
     * Maximum Angle Limitation
     *
     * Set the maximum limit of motion stroke, which is greater than the minimum angle limit, and the value is 0 when the multi turn absolute position control is adopted.
     *
     * initial_value: 4095
     * storage_area: EPROM
     * authority: read&write
     * minimum_value: 1
     * maximum_value: 4095
     * unit: step
     */
    MaximumAngleLimitation = 11,

    /**
     * Maximum Temperature Limit
     *
     * The maximum operating temperature limit, if set to 70, the maximum temperature is 70 ℃, and the setting accuracy is 1 ℃
     *
     * initial_value: 70
     * storage_area: EPROM
     * authority: read&write
     * minimum_value: 0
     * maximum_value: 100
     * unit: °C
     */
    MaximumTemperatureLimit = 13,

    /**
     * Maximum input voltage
     *
     * If the maximum input voltage is set to 80, the maximum working voltage is limited to 8.0V and the setting accuracy is 0.1V
     *
     * initial_value: 80
     * storage_area: EPROM
     * authority: read&write
     * minimum_value: 0
     * maximum_value: 254
     * unit: 0.1V
     */
    MaximumInputVoltage = 14,

    /**
     * Minimum input voltage
     *
     * If the minimum input voltage is set to 40, the minimum working voltage is limited to 4.0V and the setting accuracy is 0.1V
     *
     * initial_value: 40
     * storage_area: EPROM
     * authority: read&write
     * minimum_value: 0
     * maximum_value: 254
     * unit: 0.1V
     */
    MinimumInputVoltage = 15,

    /**
     * Maximum torque
     *
     * Set the maximum output torque limit of the servo, and set 1000 = 100% * locked torque,Power on assigned to address 48 torque limit“
     *
     * initial_value: 1000
     * storage_area: EPROM
     * authority: read&write
     * minimum_value: 0
     * maximum_value: 1000
     * unit: 0.10%
     */
    MaximumTorque = 16,

    /**
     * phase
     *
     * Special function byte, which cannot be modified without special requirements. See special byte bit analysis for details
     *
     * initial_value: 12
     * storage_area: EPROM
     * authority: read&write
     * minimum_value: 0
     * maximum_value: 254
     * unit: no
     */
    Phase = 18,

    /**
     * Unloading condition
     *
     * Bit0 Bit1 bit2 bit3 bit4 bit5 corresponding bit is set to enable corresponding protection
     *
     * initial_value: 44
     * storage_area: EPROM
     * authority: read&write
     * minimum_value: 0
     * maximum_value: 254
     * unit: no
     */
    UnloadingCondition = 19,

    /**
     * LED Alarm condition
     *
     * The corresponding bit of temperature current angle overload of voltage sensor is set to 0 to close the corresponding protection“Bit0 Bit1 bit2 bit3 bit4 bit5 corresponding bit is set to enable flashing alarm. The corresponding bit of temperature current angle overload of voltage sensor is set to 0 to turn off flashing light alarm“
     *
     * initial_value: 47
     * storage_area: EPROM
     * authority: read&write
     * minimum_value: 0
     * maximum_value: 254
     * unit: no
     */
    LEDAlarmCondition = 20,

    /**
     * P Proportionality coefficient
     *
     * Proportional factor of control motor
     *
     * initial_value: 32
     * storage_area: EPROM
     * authority: read&write
     * minimum_value: 0
     * maximum_value: 254
     * unit: no
     */
    ProportionalityCoefficient = 21,

    /**
     * D Differential coefficient
     *
     * Differential coefficient of control motor
     *
     * initial_value: 32
     * storage_area: EPROM
     * authority: read&write
     * minimum_value: 0
     * maximum_value: 254
     * unit: no
     */
    DifferentialCoefficient = 22,

    /**
     * I Integral coefficient
     *
     * Integral coefficient of control motor
     *
     * initial_value: 0
     * storage_area: EPROM
     * authority: read&write
     * minimum_value: 0
     * maximum_value: 254
     * unit: no
     */
    IntegralCoefficient = 23,

    /**
     * Minimum startup force
     *
     * Set the minimum output starting torque of servo and set 1000 = 100% * locked torque
     *
     * initial_value: 16
     * storage_area: EPROM
     * authority: read&write
     * minimum_value: 0
     * maximum_value: 1000
     * unit: 0.1%
     */
    MinimumStartupForce = 24,

    /**
     * Clockwise insensitive area
     *
     * The minimum unit is a minimum resolution angle
     *
     * initial_value: 1
     * storage_area: EPROM
     * authority: read&write
     * minimum_value: 0
     * maximum_value: 32
     * unit: step
     */
    ClockwiseInsensitiveArea = 26,

    /**
     * Counterclockwise insensitive region
     *
     * The minimum unit is a minimum resolution angle
     *
     * initial_value: 1
     * storage_area: EPROM
     * authority: read&write
     * minimum_value: 0
     * maximum_value: 32
     * unit: step
     */
    CounterclockwiseInsensitiveRegion = 27,

    /**
     * Protection current
     *
     * The maximum current can be set at 3255ma
     *
     * initial_value: 500
     * storage_area: EPROM
     * authority: read&write
     * minimum_value: 0
     * maximum_value: 511
     * unit: 6.5mA
     */
    ProtectionCurrent = 28,

    /**
     * Angular resolution
     *
     * For the amplification factor of minimum resolution angle (degree / step), the number of control turns can be extended by modifying this value
     *
     * initial_value: 1
     * storage_area: EPROM
     * authority: read&write
     * minimum_value: 1
     * maximum_value: 100
     * unit: no
     */
    AngularResolution = 30,

    /**
     * Position correction
     *
     * Bit11 is the direction bit, indicating the positive and negative directions. Other bits can represent the range of 0-2047 steps
     *
     * initial_value: 0
     * storage_area: EPROM
     * authority: read&write
     * minimum_value: -2047
     * maximum_value: 2047
     * unit: step
     */
    PositionCorrection = 31,

    /**
     * Operation mode
     *
     * 0: position servo mode
     * 1: The motor is in constant speed mode, which is controlled by parameter 0x2e, and the highest bit 15 is the direction bit
     * 2: PWM open-loop speed regulation mode, with parameter 0x2c running time parameter control, bit11 as direction bit
     * 3: In step servo mode, the number of step progress is represented by parameter 0x2a, and the highest bit 15 is the direction bit“
     *
     * initial_value: 0
     * storage_area: EPROM
     * authority: read&write
     * minimum_value: 0
     * maximum_value: 2
     * unit: no
     */
    OperationMode = 33,

    /**
     * Protective torque
     *
     * After entering the overload protection, the output torque, if set to 20, means 20% of the maximum torque
     *
     * initial_value: 20
     * storage_area: EPROM
     * authority: read&write
     * minimum_value: 0
     * maximum_value: 254
     * unit: 1.0%
     */
    ProtectiveTorque = 34,

    /**
     * Protection time
     *
     * The timing time when the current load output exceeds the overload torque and remains. If 200 is set to 2 seconds, the maximum can be set to 2.5 seconds
     *
     * initial_value: 200
     * storage_area: EPROM
     * authority: read&write
     * minimum_value: 0
     * maximum_value: 254
     * unit: 10ms
     */
    ProtectionTime = 35,

    /**
     * Overload torque
     *
     * The maximum torque threshold of starting overload protection time meter, if set to 80, means 80% of the maximum torque
     *
     * initial_value: 80
     * storage_area: EPROM
     * authority: read&write
     * minimum_value: 0
     * maximum_value: 254
     * unit: 1.0%
     */
    OverloadTorque = 36,

    /**
     * Speed closed loop P proportional coefficient
     *
     * In the motor constant speed mode (mode 1), the speed loop proportional coefficient
     *
     * initial_value: 10
     * storage_area: EPROM
     * authority: read&write
     * minimum_value: 0
     * maximum_value: 254
     * unit: no
     */
    SpeedClosedLoopPProportionalCoefficient = 37,

    /**
     * Over current protection time
     *
     * The maximum setting is 254 * 10ms = 2540ms
     *
     * initial_value: 200
     * storage_area: EPROM
     * authority: read&write
     * minimum_value: 0
     * maximum_value: 254
     * unit: 10ms
     */
    OverCurrentProtectionTime = 38,

    /**
     * Velocity closed loop I integral coefficient
     *
     * In the motor constant speed mode (mode 1), the speed loop integral coefficient
     *
     * initial_value: 10
     * storage_area: EPROM
     * authority: read&write
     * minimum_value: 0
     * maximum_value: 254
     * unit: no
     */
    VelocityClosedLoopIIntegralCoefficient = 39,

    /**
     * Torque switch
     *
     * Write 0: turn off torque output; write 1: turn on torque output; write 128: current position correction is 2048
     *
     * initial_value: 0
     * storage_area: SRAM
     * authority: read&write
     * minimum_value: 0
     * maximum_value: 2
     * unit: no
     */
    TorqueSwitch = 40,

    /**
     * acceleration
     *
     * If it is set to 10, the speed will be changed by 1000 steps per second
     *
     * initial_value: 0
     * storage_area: SRAM
     * authority: read&write
     * minimum_value: 0
     * maximum_value: 254
     * unit: 100step/s^2
     */
    Acceleration = 41,

    /**
     * Target location
     *
     * Each step is a minimum resolution angle, absolute position control mode, the maximum corresponding to the maximum effective angle
     *
     * initial_value: 0
     * storage_area: SRAM
     * authority: read&write
     * minimum_value: -32766
     * maximum_value: 32766
     * unit: step
     */
    TargetLocation = 42,

    /**
     * Running time
     *
     * initial_value: 0
     * storage_area: SRAM
     * authority: read&write
     * minimum_value: 0
     * maximum_value: 1000
     * unit: 0.10%
     */
    RunningTime = 44,

    /**
     * running speed
     *
     * Number of steps in unit time (per second), 50 steps / second = 0.732 RPM (cycles per minute)
     *
     * initial_value: 0
     * storage_area: SRAM
     * authority: read&write
     * minimum_value: 0
     * maximum_value: 254
     * unit: step/s
     */
    RunningSpeed = 46,

    /**
     * Torque limit
     *
     * The initial value of power on is assigned by the maximum torque (0x10), which can be modified by the user to control the output of the maximum torque
     *
     * initial_value: 1000
     * storage_area: SRAM
     * authority: read&write
     * minimum_value: 0
     * maximum_value: 1000
     * unit: 1.0%
     */
    TorqueLimit = 48,

    /**
     * Lock mark
     *
     * Write 0 closes the write lock, and the value written to EPROM address is saved after power failure.
     * Write 1 opens the write lock, and the value written to EPROM address is not saved after power failure
     *
     * initial_value: 0
     * storage_area: SRAM
     * authority: read&write
     * minimum_value: 0
     * maximum_value: 1
     * unit: no
     */
    LockMark = 55,

    /**
     * current location
     *
     * In the absolute position control mode, the maximum value corresponds to the maximum effective angle
     *
     * initial_value: 0
     * storage_area: SRAM
     * authority: read-only
     * minimum_value: -1
     * maximum_value: -1
     * unit: step
     */
    CurrentLocation = 56,

    /**
     * Current speed
     *
     * Feedback the current speed of motor rotation, the number of steps in unit time (per second)
     *
     * initial_value: 0
     * storage_area: SRAM
     * authority: read-only
     * minimum_value: -1
     * maximum_value: -1
     * unit: step/s
     */
    CurrentSpeed = 58,

    /**
     * Current load
     *
     * Voltage duty cycle of current control output drive motor
     *
     * initial_value: 0
     * storage_area: SRAM
     * authority: read-only
     * minimum_value: -1
     * maximum_value: -1
     * unit: 0.1%
     */
    CurrentLoad = 60,

    /**
     * Current voltage
     *
     * Current servo working voltage
     *
     * initial_value: 0
     * storage_area: SRAM
     * authority: read-only
     * minimum_value: -1
     * maximum_value: -1
     * unit: 0.1V
     */
    CurrentVoltage = 62,

    /**
     * Current temperature
     *
     * Current internal operating temperature of the servo
     *
     * initial_value: 0
     * storage_area: SRAM
     * authority: read-only
     * minimum_value: -1
     * maximum_value: -1
     * unit: °C
     */
    CurrentTemperature = 63,

    /**
     * Asynchronous write flag
     *
     * When using asynchronous write instruction, flag bit
     *
     * initial_value: 0
     * storage_area: SRAM
     * authority: read-only
     * minimum_value: -1
     * maximum_value: -1
     * unit: no
     */
    AsynchronousWriteFlag = 64,

    /**
     * Servo status
     *
     * Bit0 Bit1 bit2 bit3 bit4 bit5 corresponding bit is set to 1, indicating that the corresponding error occurs,Voltage sensor temperature current angle overload corresponding bit 0 is no phase error.
     *
     * initial_value: 0
     * storage_area: SRAM
     * authority: read-only
     * minimum_value: -1
     * maximum_value: -1
     * unit: no
     */
    ServoStatus = 65,

    /**
     * Mobile sign
     *
     * When the servo is moving, it is marked as 1, and when the servo is stopped, it is 0
     *
     * initial_value: 0
     * storage_area: SRAM
     * authority: read-only
     * minimum_value: -1
     * maximum_value: -1
     * unit: no
     */
    MobileSign = 66,

    /**
     * Current current
     *
     * The maximum measurable current is 500 * 6.5ma = 3250ma
     *
     * initial_value: 0
     * storage_area: SRAM
     * authority: read-only
     * minimum_value: -1
     * maximum_value: -1
     * unit: 6.5mA
     */
    CurrentCurrent = 69,
}

impl Register {
    pub fn from_memory_address(memory_address: u8) -> Option<Self> {
        match memory_address {
            0 => Some(Self::FirmwareMajorVersionNumber),
            1 => Some(Self::FirmwareSubVersionNumber),
            3 => Some(Self::ServoMainVersionNumber),
            4 => Some(Self::ServoSubVersionNumber),
            5 => Some(Self::ID),
            6 => Some(Self::BaudRate),
            7 => Some(Self::ReturnDelay),
            8 => Some(Self::ResponseStatusLevel),
            9 => Some(Self::MinimumAngleLimitation),
            11 => Some(Self::MaximumAngleLimitation),
            13 => Some(Self::MaximumTemperatureLimit),
            14 => Some(Self::MaximumInputVoltage),
            15 => Some(Self::MinimumInputVoltage),
            16 => Some(Self::MaximumTorque),
            18 => Some(Self::Phase),
            19 => Some(Self::UnloadingCondition),
            20 => Some(Self::LEDAlarmCondition),
            21 => Some(Self::ProportionalityCoefficient),
            22 => Some(Self::DifferentialCoefficient),
            23 => Some(Self::IntegralCoefficient),
            24 => Some(Self::MinimumStartupForce),
            26 => Some(Self::ClockwiseInsensitiveArea),
            27 => Some(Self::CounterclockwiseInsensitiveRegion),
            28 => Some(Self::ProtectionCurrent),
            30 => Some(Self::AngularResolution),
            31 => Some(Self::PositionCorrection),
            33 => Some(Self::OperationMode),
            34 => Some(Self::ProtectiveTorque),
            35 => Some(Self::ProtectionTime),
            36 => Some(Self::OverloadTorque),
            37 => Some(Self::SpeedClosedLoopPProportionalCoefficient),
            38 => Some(Self::OverCurrentProtectionTime),
            39 => Some(Self::VelocityClosedLoopIIntegralCoefficient),
            40 => Some(Self::TorqueSwitch),
            41 => Some(Self::Acceleration),
            42 => Some(Self::TargetLocation),
            44 => Some(Self::RunningTime),
            46 => Some(Self::RunningSpeed),
            48 => Some(Self::TorqueLimit),
            55 => Some(Self::LockMark),
            56 => Some(Self::CurrentLocation),
            58 => Some(Self::CurrentSpeed),
            60 => Some(Self::CurrentLoad),
            62 => Some(Self::CurrentVoltage),
            63 => Some(Self::CurrentTemperature),
            64 => Some(Self::AsynchronousWriteFlag),
            65 => Some(Self::ServoStatus),
            66 => Some(Self::MobileSign),
            69 => Some(Self::CurrentCurrent),
            _ => None,
        }
    }

    pub fn to_memory_address(&self) -> u8 {
        match self {
            Self::FirmwareMajorVersionNumber => 0,
            Self::FirmwareSubVersionNumber => 1,
            Self::ServoMainVersionNumber => 3,
            Self::ServoSubVersionNumber => 4,
            Self::ID => 5,
            Self::BaudRate => 6,
            Self::ReturnDelay => 7,
            Self::ResponseStatusLevel => 8,
            Self::MinimumAngleLimitation => 9,
            Self::MaximumAngleLimitation => 11,
            Self::MaximumTemperatureLimit => 13,
            Self::MaximumInputVoltage => 14,
            Self::MinimumInputVoltage => 15,
            Self::MaximumTorque => 16,
            Self::Phase => 18,
            Self::UnloadingCondition => 19,
            Self::LEDAlarmCondition => 20,
            Self::ProportionalityCoefficient => 21,
            Self::DifferentialCoefficient => 22,
            Self::IntegralCoefficient => 23,
            Self::MinimumStartupForce => 24,
            Self::ClockwiseInsensitiveArea => 26,
            Self::CounterclockwiseInsensitiveRegion => 27,
            Self::ProtectionCurrent => 28,
            Self::AngularResolution => 30,
            Self::PositionCorrection => 31,
            Self::OperationMode => 33,
            Self::ProtectiveTorque => 34,
            Self::ProtectionTime => 35,
            Self::OverloadTorque => 36,
            Self::SpeedClosedLoopPProportionalCoefficient => 37,
            Self::OverCurrentProtectionTime => 38,
            Self::VelocityClosedLoopIIntegralCoefficient => 39,
            Self::TorqueSwitch => 40,
            Self::Acceleration => 41,
            Self::TargetLocation => 42,
            Self::RunningTime => 44,
            Self::RunningSpeed => 46,
            Self::TorqueLimit => 48,
            Self::LockMark => 55,
            Self::CurrentLocation => 56,
            Self::CurrentSpeed => 58,
            Self::CurrentLoad => 60,
            Self::CurrentVoltage => 62,
            Self::CurrentTemperature => 63,
            Self::AsynchronousWriteFlag => 64,
            Self::ServoStatus => 65,
            Self::MobileSign => 66,
            Self::CurrentCurrent => 69,
        }
    }

    pub fn length(&self) -> u8 {
        match self {
            Self::FirmwareMajorVersionNumber => 1,
            Self::FirmwareSubVersionNumber => 1,
            Self::ServoMainVersionNumber => 1,
            Self::ServoSubVersionNumber => 1,
            Self::ID => 1,
            Self::BaudRate => 1,
            Self::ReturnDelay => 1,
            Self::ResponseStatusLevel => 1,
            Self::MinimumAngleLimitation => 2,
            Self::MaximumAngleLimitation => 2,
            Self::MaximumTemperatureLimit => 1,
            Self::MaximumInputVoltage => 1,
            Self::MinimumInputVoltage => 1,
            Self::MaximumTorque => 2,
            Self::Phase => 1,
            Self::UnloadingCondition => 1,
            Self::LEDAlarmCondition => 1,
            Self::ProportionalityCoefficient => 1,
            Self::DifferentialCoefficient => 1,
            Self::IntegralCoefficient => 1,
            Self::MinimumStartupForce => 2,
            Self::ClockwiseInsensitiveArea => 1,
            Self::CounterclockwiseInsensitiveRegion => 1,
            Self::ProtectionCurrent => 2,
            Self::AngularResolution => 1,
            Self::PositionCorrection => 2,
            Self::OperationMode => 1,
            Self::ProtectiveTorque => 1,
            Self::ProtectionTime => 1,
            Self::OverloadTorque => 1,
            Self::SpeedClosedLoopPProportionalCoefficient => 1,
            Self::OverCurrentProtectionTime => 1,
            Self::VelocityClosedLoopIIntegralCoefficient => 1,
            Self::TorqueSwitch => 1,
            Self::Acceleration => 1,
            Self::TargetLocation => 2,
            Self::RunningTime => 2,
            Self::RunningSpeed => 2,
            Self::TorqueLimit => 2,
            Self::LockMark => 1,
            Self::CurrentLocation => 2,
            Self::CurrentSpeed => 2,
            Self::CurrentLoad => 2,
            Self::CurrentVoltage => 1,
            Self::CurrentTemperature => 1,
            Self::AsynchronousWriteFlag => 1,
            Self::ServoStatus => 1,
            Self::MobileSign => 1,
            Self::CurrentCurrent => 2,
        }
    }
}