hc32f460_driver_sys 0.1.0

Provide driver function binding for HDSC's HC32F460 MCU.
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
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
/* automatically generated by rust-bindgen 0.72.1 */

#[repr(C)]
#[derive(Copy, Clone, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub struct __BindgenBitfieldUnit<Storage> {
    storage: Storage,
}
impl<Storage> __BindgenBitfieldUnit<Storage> {
    #[inline]
    pub const fn new(storage: Storage) -> Self {
        Self { storage }
    }
}
impl<Storage> __BindgenBitfieldUnit<Storage>
where
    Storage: AsRef<[u8]> + AsMut<[u8]>,
{
    #[inline]
    fn extract_bit(byte: u8, index: usize) -> bool {
        let bit_index = if cfg!(target_endian = "big") {
            7 - (index % 8)
        } else {
            index % 8
        };
        let mask = 1 << bit_index;
        byte & mask == mask
    }
    #[inline]
    pub fn get_bit(&self, index: usize) -> bool {
        debug_assert!(index / 8 < self.storage.as_ref().len());
        let byte_index = index / 8;
        let byte = self.storage.as_ref()[byte_index];
        Self::extract_bit(byte, index)
    }
    #[inline]
    pub unsafe fn raw_get_bit(this: *const Self, index: usize) -> bool {
        debug_assert!(index / 8 < core::mem::size_of::<Storage>());
        let byte_index = index / 8;
        let byte = unsafe {
            *(core::ptr::addr_of!((*this).storage) as *const u8).offset(byte_index as isize)
        };
        Self::extract_bit(byte, index)
    }
    #[inline]
    fn change_bit(byte: u8, index: usize, val: bool) -> u8 {
        let bit_index = if cfg!(target_endian = "big") {
            7 - (index % 8)
        } else {
            index % 8
        };
        let mask = 1 << bit_index;
        if val {
            byte | mask
        } else {
            byte & !mask
        }
    }
    #[inline]
    pub fn set_bit(&mut self, index: usize, val: bool) {
        debug_assert!(index / 8 < self.storage.as_ref().len());
        let byte_index = index / 8;
        let byte = &mut self.storage.as_mut()[byte_index];
        *byte = Self::change_bit(*byte, index, val);
    }
    #[inline]
    pub unsafe fn raw_set_bit(this: *mut Self, index: usize, val: bool) {
        debug_assert!(index / 8 < core::mem::size_of::<Storage>());
        let byte_index = index / 8;
        let byte = unsafe {
            (core::ptr::addr_of_mut!((*this).storage) as *mut u8).offset(byte_index as isize)
        };
        unsafe { *byte = Self::change_bit(*byte, index, val) };
    }
    #[inline]
    pub fn get(&self, bit_offset: usize, bit_width: u8) -> u64 {
        debug_assert!(bit_width <= 64);
        debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
        debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
        let mut val = 0;
        for i in 0..(bit_width as usize) {
            if self.get_bit(i + bit_offset) {
                let index = if cfg!(target_endian = "big") {
                    bit_width as usize - 1 - i
                } else {
                    i
                };
                val |= 1 << index;
            }
        }
        val
    }
    #[inline]
    pub unsafe fn raw_get(this: *const Self, bit_offset: usize, bit_width: u8) -> u64 {
        debug_assert!(bit_width <= 64);
        debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
        debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
        let mut val = 0;
        for i in 0..(bit_width as usize) {
            if unsafe { Self::raw_get_bit(this, i + bit_offset) } {
                let index = if cfg!(target_endian = "big") {
                    bit_width as usize - 1 - i
                } else {
                    i
                };
                val |= 1 << index;
            }
        }
        val
    }
    #[inline]
    pub fn set(&mut self, bit_offset: usize, bit_width: u8, val: u64) {
        debug_assert!(bit_width <= 64);
        debug_assert!(bit_offset / 8 < self.storage.as_ref().len());
        debug_assert!((bit_offset + (bit_width as usize)) / 8 <= self.storage.as_ref().len());
        for i in 0..(bit_width as usize) {
            let mask = 1 << i;
            let val_bit_is_set = val & mask == mask;
            let index = if cfg!(target_endian = "big") {
                bit_width as usize - 1 - i
            } else {
                i
            };
            self.set_bit(index + bit_offset, val_bit_is_set);
        }
    }
    #[inline]
    pub unsafe fn raw_set(this: *mut Self, bit_offset: usize, bit_width: u8, val: u64) {
        debug_assert!(bit_width <= 64);
        debug_assert!(bit_offset / 8 < core::mem::size_of::<Storage>());
        debug_assert!((bit_offset + (bit_width as usize)) / 8 <= core::mem::size_of::<Storage>());
        for i in 0..(bit_width as usize) {
            let mask = 1 << i;
            let val_bit_is_set = val & mask == mask;
            let index = if cfg!(target_endian = "big") {
                bit_width as usize - 1 - i
            } else {
                i
            };
            unsafe { Self::raw_set_bit(this, index + bit_offset, val_bit_is_set) };
        }
    }
}
pub const CAN_WORK_MD_NORMAL: u32 = 0;
pub const CAN_WORK_MD_SILENT: u32 = 1;
pub const CAN_WORK_MD_ILB: u32 = 2;
pub const CAN_WORK_MD_ELB: u32 = 3;
pub const CAN_WORK_MD_ELB_SILENT: u32 = 4;
pub const CAN_TX_BUF_PTB: u32 = 0;
pub const CAN_TX_BUF_STB: u32 = 1;
pub const CAN_DLC0: u32 = 0;
pub const CAN_DLC1: u32 = 1;
pub const CAN_DLC2: u32 = 2;
pub const CAN_DLC3: u32 = 3;
pub const CAN_DLC4: u32 = 4;
pub const CAN_DLC5: u32 = 5;
pub const CAN_DLC6: u32 = 6;
pub const CAN_DLC7: u32 = 7;
pub const CAN_DLC8: u32 = 8;
pub const CAN_PTB_SINGLESHOT_TX_DISABLE: u32 = 0;
pub const CAN_PTB_SINGLESHOT_TX_ENABLE: u32 = 16;
pub const CAN_STB_SINGLESHOT_TX_DISABLE: u32 = 0;
pub const CAN_STB_SINGLESHOT_TX_ENABLE: u32 = 8;
pub const CAN_TX_REQ_STB_ONE: u32 = 4;
pub const CAN_TX_REQ_STB_ALL: u32 = 2;
pub const CAN_TX_REQ_PTB: u32 = 16;
pub const CAN_STB_PRIO_MD_DISABLE: u32 = 0;
pub const CAN_STB_PRIO_MD_ENABLE: u32 = 32;
pub const CAN_TX_BUF_EMPTY: u32 = 0;
pub const CAN_TX_BUF_NOT_MORE_THAN_HALF: u32 = 1;
pub const CAN_TX_BUF_MORE_THAN_HALF: u32 = 2;
pub const CAN_TX_BUF_FULL: u32 = 3;
pub const CAN_RX_BUF_EMPTY: u32 = 0;
pub const CAN_RX_BUF_NOT_WARN: u32 = 1;
pub const CAN_RX_BUF_WARN: u32 = 2;
pub const CAN_RX_BUF_FULL: u32 = 3;
pub const CAN_RX_ALL_FRAME_DISABLE: u32 = 0;
pub const CAN_RX_ALL_FRAME_ENABLE: u32 = 8;
pub const CAN_RX_OVF_SAVE_NEW: u32 = 0;
pub const CAN_RX_OVF_DISCARD_NEW: u32 = 64;
pub const CAN_SELF_ACK_DISABLE: u32 = 0;
pub const CAN_SELF_ACK_ENABLE: u32 = 128;
pub const CAN_INT_ERR_INT: u32 = 2;
pub const CAN_INT_STB_TX: u32 = 4;
pub const CAN_INT_PTB_TX: u32 = 8;
pub const CAN_INT_RX_BUF_WARN: u32 = 16;
pub const CAN_INT_RX_BUF_FULL: u32 = 32;
pub const CAN_INT_RX_OVERRUN: u32 = 64;
pub const CAN_INT_RX: u32 = 128;
pub const CAN_INT_BUS_ERR: u32 = 512;
pub const CAN_INT_ARBITR_LOST: u32 = 2048;
pub const CAN_INT_ERR_PASSIVE: u32 = 8192;
pub const CAN_INT_ALL: u32 = 11006;
pub const CAN_FLAG_BUS_OFF: u32 = 1;
pub const CAN_FLAG_TX_GOING: u32 = 2;
pub const CAN_FLAG_RX_GOING: u32 = 4;
pub const CAN_FLAG_RX_BUF_OVF: u32 = 32;
pub const CAN_FLAG_TX_BUF_FULL: u32 = 256;
pub const CAN_FLAG_TX_ABORTED: u32 = 65536;
pub const CAN_FLAG_ERR_INT: u32 = 131072;
pub const CAN_FLAG_STB_TX: u32 = 262144;
pub const CAN_FLAG_PTB_TX: u32 = 524288;
pub const CAN_FLAG_RX_BUF_WARN: u32 = 1048576;
pub const CAN_FLAG_RX_BUF_FULL: u32 = 2097152;
pub const CAN_FLAG_RX_OVERRUN: u32 = 4194304;
pub const CAN_FLAG_RX: u32 = 8388608;
pub const CAN_FLAG_BUS_ERR: u32 = 16777216;
pub const CAN_FLAG_ARBITR_LOST: u32 = 67108864;
pub const CAN_FLAG_ERR_PASSIVE: u32 = 268435456;
pub const CAN_FLAG_ERR_PASSIVE_NODE: u32 = 1073741824;
pub const CAN_FLAG_TEC_REC_WARN: u32 = 2147483648;
pub const CAN_FLAG_ALL: u32 = 3590258983;
pub const CAN_FLAG_CLR_ALL: u32 = 369033216;
pub const CAN_ID_STD_EXT: u32 = 0;
pub const CAN_ID_STD: u32 = 1073741824;
pub const CAN_ID_EXT: u32 = 1610612736;
pub const CAN_STD_ID_MASK: u32 = 2047;
pub const CAN_EXT_ID_MASK: u32 = 536870911;
pub const CAN_ERR_NONE: u32 = 0;
pub const CAN_ERR_BIT: u32 = 1;
pub const CAN_ERR_FORM: u32 = 2;
pub const CAN_ERR_STUFF: u32 = 3;
pub const CAN_ERR_ACK: u32 = 4;
pub const CAN_ERR_CRC: u32 = 5;
pub const CAN_ERR_OTHER: u32 = 6;
pub const CAN_FILTER1: u32 = 1;
pub const CAN_FILTER2: u32 = 2;
pub const CAN_FILTER3: u32 = 4;
pub const CAN_FILTER4: u32 = 8;
pub const CAN_FILTER5: u32 = 16;
pub const CAN_FILTER6: u32 = 32;
pub const CAN_FILTER7: u32 = 64;
pub const CAN_FILTER8: u32 = 128;
pub const CAN_FILTER_ALL: u32 = 255;
pub const CAN_TTC_TX_BUF_MD_CAN: u32 = 0;
pub const CAN_TTC_TX_BUF_MD_TTCAN: u32 = 16;
pub const CAN_TTC_TX_BUF_PTB: u32 = 0;
pub const CAN_TTC_TX_BUF_STB1: u32 = 1;
pub const CAN_TTC_TX_BUF_STB2: u32 = 2;
pub const CAN_TTC_TX_BUF_STB3: u32 = 3;
pub const CAN_TTC_TX_BUF_STB4: u32 = 4;
pub const CAN_TTC_TX_BUF_MARK_EMPTY: u32 = 128;
pub const CAN_TTC_TX_BUF_MARK_FILLED: u32 = 64;
pub const CAN_TTC_INT_TIME_TRIG: u32 = 16;
pub const CAN_TTC_INT_WATCH_TRIG: u32 = 128;
pub const CAN_TTC_INT_ALL: u32 = 144;
pub const CAN_TTC_FLAG_TIME_TRIG: u32 = 8;
pub const CAN_TTC_FLAG_TRIG_ERR: u32 = 32;
pub const CAN_TTC_FLAG_WATCH_TRIG: u32 = 64;
pub const CAN_TTC_FLAG_ALL: u32 = 104;
pub const CAN_TTC_NTU_PRESCALER1: u32 = 0;
pub const CAN_TTC_NTU_PRESCALER2: u32 = 2;
pub const CAN_TTC_NTU_PRESCALER4: u32 = 4;
pub const CAN_TTC_NTU_PRESCALER8: u32 = 6;
pub const CAN_TTC_TRIG_IMMED_TRIG: u32 = 0;
pub const CAN_TTC_TRIG_TIME_TRIG: u32 = 256;
pub const CAN_TTC_TRIG_SINGLESHOT_TX_TRIG: u32 = 512;
pub const CAN_TTC_TRIG_TX_START_TRIG: u32 = 768;
pub const CAN_TTC_TRIG_TX_STOP_TRIG: u32 = 1024;
pub const en_functional_state_t_DISABLE: en_functional_state_t = 0;
pub const en_functional_state_t_ENABLE: en_functional_state_t = 1;
#[doc = " @brief Functional state"]
pub type en_functional_state_t = ::core::ffi::c_uint;
pub const en_flag_status_t_RESET: en_flag_status_t = 0;
pub const en_flag_status_t_SET: en_flag_status_t = 1;
#[doc = " @brief Flag status"]
pub type en_flag_status_t = ::core::ffi::c_uint;
#[doc = " @brief CAN"]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct CM_CAN_TypeDef {
    pub RBUF: u32,
    pub RESERVED0: [u8; 76usize],
    pub TBUF: u32,
    pub RESERVED1: [u8; 76usize],
    pub CFG_STAT: u8,
    pub TCMD: u8,
    pub TCTRL: u8,
    pub RCTRL: u8,
    pub RTIE: u8,
    pub RTIF: u8,
    pub ERRINT: u8,
    pub LIMIT: u8,
    pub SBT: u32,
    pub RESERVED2: [u8; 4usize],
    pub EALCAP: u8,
    pub RESERVED3: [u8; 1usize],
    pub RECNT: u8,
    pub TECNT: u8,
    pub ACFCTRL: u8,
    pub RESERVED4: [u8; 1usize],
    pub ACFEN: u8,
    pub RESERVED5: [u8; 1usize],
    pub ACF: u32,
    pub RESERVED6: [u8; 2usize],
    pub TBSLOT: u8,
    pub TTCFG: u8,
    pub REF_MSG: u32,
    pub TRG_CFG: u16,
    pub TT_TRIG: u16,
    pub TT_WTRIG: u16,
}
#[doc = " Global type definitions ('typedef')\n/\n/**\n @defgroup CAN_Global_Types CAN Global Types\n @{\n/\n/**\n @brief CAN bit time configuration structure.\n @note 1. TQ = u32Prescaler / CANClock.\n @note 2. Bit time = (u32TimeSeg2 + u32TimeSeg2) x TQ.\n @note 3. Baudrate = CANClock/(u32Prescaler*(u32TimeSeg1 + u32TimeSeg2))\n @note 4. See user manual of the target MCU and ISO11898-1 for more details."]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_can_bit_time_config_t {
    #[doc = "< Specifies the prescaler of CAN clock, [1, 256]."]
    pub u32Prescaler: u32,
    #[doc = "< Specifies the number of time quanta in Bit Segment 1.\nu32TimeSeg1 Contains synchronization segment,\npropagation time segment and phase buffer segment 1."]
    pub u32TimeSeg1: u32,
    #[doc = "< Specifies the number of time quanta in Bit Segment 2.\nPhase buffer segment 2."]
    pub u32TimeSeg2: u32,
    #[doc = "< Synchronization Jump Width.\nSpecifies the maximum number of time quanta the CAN hardware\nis allowed to lengthen or shorten a bit to perform resynchronization."]
    pub u32SJW: u32,
}
#[doc = " @brief CAN acceptance filter configuration structure."]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_can_filter_config_t {
    #[doc = "< Specifies the identifier(ID). 11 bits standard ID or 29 bits extended ID, depending on IDE."]
    pub u32ID: u32,
    #[doc = "< Specifies the identifier(ID) mask. The mask bits of ID will be ignored by the acceptance filter."]
    pub u32IDMask: u32,
    #[doc = "< Specifies the identifier(ID) type. This parameter can be a value of @ref CAN_ID_Type"]
    pub u32IDType: u32,
}
#[doc = " @brief TTCAN configuration structure."]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_can_ttc_config_t {
    #[doc = "< Reference message identifier."]
    pub u32RefMsgID: u32,
    #[doc = "< Reference message identifier extension bit.\n'1' to set the ID which is specified by parameter 'u32RefMsgID' as an extended ID while\n'0' to set it as a standard ID."]
    pub u32RefMsgIDE: u32,
    #[doc = "< Prescaler of NTU(network time unit). The source is the bit time which is defined by SBT.\nThis parameter can be a value of @ref TTCAN_NTU_Prescaler"]
    pub u8NTUPrescaler: u8,
    #[doc = "< TTCAN Transmit Buffer Mode.\nThis parameter can be a value of @ref TTCAN_Tx_Buf_Mode"]
    pub u8TxBufMode: u8,
    #[doc = "< Trigger type of TTCAN.\nThis parameter can be a value of @ref TTCAN_Trigger_Type"]
    pub u16TriggerType: u16,
    #[doc = "< Tx_Enable window. Time period within which the transmission of a message may be started. Range is [1, 16]"]
    pub u16TxEnableWindow: u16,
    #[doc = "< Specifies for the referred message the time window of the matrix cycle at which it is to be transmitted. Range is [0, 65535]"]
    pub u16TxTriggerTime: u16,
    #[doc = "< Time mark used to check whether the time since the last valid reference message has been too long. Range is [0, 65535]"]
    pub u16WatchTriggerTime: u16,
}
#[doc = " @brief CAN initialization structure."]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_can_init_t {
    #[doc = "< Bit time configuration of classical CAN bit. @ref stc_can_bit_time_config_t"]
    pub stcBitCfg: stc_can_bit_time_config_t,
    #[doc = "< Pointer to a @ref stc_can_filter_config_t structure that\ncontains the configuration informations for the acceptance filters."]
    pub pstcFilter: *mut stc_can_filter_config_t,
    #[doc = "< Selects acceptance filters.\nThis parameter can be values of @ref CAN_Acceptance_Filter"]
    pub u16FilterSelect: u16,
    #[doc = "< Specifies the work mode of CAN.\nThis parameter can be a value of @ref CAN_Work_Mode"]
    pub u8WorkMode: u8,
    #[doc = "< Enable or disable single shot transmission of PTB.\nThis parameter can be a value of @ref PTB_SingleShot_Tx_En"]
    pub u8PTBSingleShotTx: u8,
    #[doc = "< Enable or disable single shot transmission of STB.\nThis parameter can be a value of @ref STB_SingleShot_Tx_En"]
    pub u8STBSingleShotTx: u8,
    #[doc = "< Enable or disable the priority decision mode of STB.\nThis parameter can be a value of @ref CAN_STB_Prio_Mode_En\nNOTE: A frame in the PTB has always the highest priority regardless of the ID."]
    pub u8STBPrioMode: u8,
    #[doc = "< Specifies receive buffer almost full warning limit. Rang is [1, 8].\nEach CAN unit has 8 receive buffers. When the number of received frames reaches\nthe value specified by u8RxWarnLimit, register bit RTIF.RAFIF is set and the interrupt occurred\nif it was enabled."]
    pub u8RxWarnLimit: u8,
    #[doc = "< Specifies programmable error warning limit. Range is [0, 15].\nError warning limit = (u8ErrorWarnLimit + 1) * 8."]
    pub u8ErrorWarnLimit: u8,
    #[doc = "< Enable or disable receive all frames(includes frames with error).\nThis parameter can be a value of @ref CAN_Rx_All_En"]
    pub u8RxAllFrame: u8,
    #[doc = "< Receive buffer overflow mode. In case of a full receive buffer when a new frame is received.\nThis parameter can be a value of @ref CAN_Rx_Ovf_Mode"]
    pub u8RxOvfMode: u8,
    #[doc = "< Enable or disable self-acknowledge.\nThis parameter can be a value of @ref CAN_Self_ACK_En"]
    pub u8SelfAck: u8,
    #[doc = "< Pointer to a TTCAN configuration structure. @ref stc_can_ttc_config_t\nSet it to NULL if not needed TTCAN."]
    pub pstcCanTtc: *mut stc_can_ttc_config_t,
}
#[doc = " @brief CAN error information structure."]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_can_error_info_t {
    #[doc = "< Bit position in the frame where the arbitration has been lost."]
    pub u8ArbitrLostPos: u8,
    #[doc = "< CAN error type. This parameter can be a value of @ref CAN_Err_Type"]
    pub u8ErrorType: u8,
    #[doc = "< Receive error count."]
    pub u8RxErrorCount: u8,
    #[doc = "< Transmit error count."]
    pub u8TxErrorCount: u8,
}
#[doc = " @brief CAN TX frame data structure."]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct stc_can_tx_frame_t {
    #[doc = "< 11 bits standard ID or 29 bits extended ID, depending on IDE."]
    pub u32ID: u32,
    pub __bindgen_anon_1: stc_can_tx_frame_t__bindgen_ty_1,
    #[doc = "< TX data payload."]
    pub au8Data: [u8; 8usize],
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union stc_can_tx_frame_t__bindgen_ty_1 {
    pub u32Ctrl: u32,
    pub __bindgen_anon_1: stc_can_tx_frame_t__bindgen_ty_1__bindgen_ty_1,
}
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_can_tx_frame_t__bindgen_ty_1__bindgen_ty_1 {
    pub _bitfield_align_1: [u32; 0],
    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>,
}
impl stc_can_tx_frame_t__bindgen_ty_1__bindgen_ty_1 {
    #[inline]
    pub fn DLC(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u32) }
    }
    #[inline]
    pub fn set_DLC(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(0usize, 4u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn DLC_raw(this: *const Self) -> u32 {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                0usize,
                4u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_DLC_raw(this: *mut Self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                0usize,
                4u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn BRS(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_BRS(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(4usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn BRS_raw(this: *const Self) -> u32 {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                4usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_BRS_raw(this: *mut Self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                4usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn FDF(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_FDF(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(5usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn FDF_raw(this: *const Self) -> u32 {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                5usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_FDF_raw(this: *mut Self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                5usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn RTR(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_RTR(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(6usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn RTR_raw(this: *const Self) -> u32 {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                6usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_RTR_raw(this: *mut Self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                6usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn IDE(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_IDE(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(7usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn IDE_raw(this: *const Self) -> u32 {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                7usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_IDE_raw(this: *mut Self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                7usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn RSVD(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 24u8) as u32) }
    }
    #[inline]
    pub fn set_RSVD(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(8usize, 24u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn RSVD_raw(this: *const Self) -> u32 {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                8usize,
                24u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_RSVD_raw(this: *mut Self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                8usize,
                24u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn new_bitfield_1(
        DLC: u32,
        BRS: u32,
        FDF: u32,
        RTR: u32,
        IDE: u32,
        RSVD: u32,
    ) -> __BindgenBitfieldUnit<[u8; 4usize]> {
        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default();
        __bindgen_bitfield_unit.set(0usize, 4u8, {
            let DLC: u32 = unsafe { ::core::mem::transmute(DLC) };
            DLC as u64
        });
        __bindgen_bitfield_unit.set(4usize, 1u8, {
            let BRS: u32 = unsafe { ::core::mem::transmute(BRS) };
            BRS as u64
        });
        __bindgen_bitfield_unit.set(5usize, 1u8, {
            let FDF: u32 = unsafe { ::core::mem::transmute(FDF) };
            FDF as u64
        });
        __bindgen_bitfield_unit.set(6usize, 1u8, {
            let RTR: u32 = unsafe { ::core::mem::transmute(RTR) };
            RTR as u64
        });
        __bindgen_bitfield_unit.set(7usize, 1u8, {
            let IDE: u32 = unsafe { ::core::mem::transmute(IDE) };
            IDE as u64
        });
        __bindgen_bitfield_unit.set(8usize, 24u8, {
            let RSVD: u32 = unsafe { ::core::mem::transmute(RSVD) };
            RSVD as u64
        });
        __bindgen_bitfield_unit
    }
}
#[doc = " @brief CAN RX frame data structure."]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct stc_can_rx_frame_t {
    #[doc = "< 11 bits standard ID or 29 bits extended ID, depending on IDE."]
    pub u32ID: u32,
    pub __bindgen_anon_1: stc_can_rx_frame_t__bindgen_ty_1,
    #[doc = "< RX data payload."]
    pub au8Data: [u8; 8usize],
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union stc_can_rx_frame_t__bindgen_ty_1 {
    pub u32Ctrl: u32,
    pub __bindgen_anon_1: stc_can_rx_frame_t__bindgen_ty_1__bindgen_ty_1,
}
#[repr(C)]
#[repr(align(4))]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_can_rx_frame_t__bindgen_ty_1__bindgen_ty_1 {
    pub _bitfield_align_1: [u16; 0],
    pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>,
}
impl stc_can_rx_frame_t__bindgen_ty_1__bindgen_ty_1 {
    #[inline]
    pub fn DLC(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(0usize, 4u8) as u32) }
    }
    #[inline]
    pub fn set_DLC(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(0usize, 4u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn DLC_raw(this: *const Self) -> u32 {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                0usize,
                4u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_DLC_raw(this: *mut Self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                0usize,
                4u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn BRS(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(4usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_BRS(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(4usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn BRS_raw(this: *const Self) -> u32 {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                4usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_BRS_raw(this: *mut Self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                4usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn FDF(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(5usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_FDF(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(5usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn FDF_raw(this: *const Self) -> u32 {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                5usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_FDF_raw(this: *mut Self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                5usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn RTR(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(6usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_RTR(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(6usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn RTR_raw(this: *const Self) -> u32 {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                6usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_RTR_raw(this: *mut Self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                6usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn IDE(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_IDE(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(7usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn IDE_raw(this: *const Self) -> u32 {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                7usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_IDE_raw(this: *mut Self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                7usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn RSVD(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(8usize, 4u8) as u32) }
    }
    #[inline]
    pub fn set_RSVD(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(8usize, 4u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn RSVD_raw(this: *const Self) -> u32 {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                8usize,
                4u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_RSVD_raw(this: *mut Self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                8usize,
                4u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn TX(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(12usize, 1u8) as u32) }
    }
    #[inline]
    pub fn set_TX(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(12usize, 1u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn TX_raw(this: *const Self) -> u32 {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                12usize,
                1u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_TX_raw(this: *mut Self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                12usize,
                1u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn ERRT(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(13usize, 3u8) as u32) }
    }
    #[inline]
    pub fn set_ERRT(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(13usize, 3u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn ERRT_raw(this: *const Self) -> u32 {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                13usize,
                3u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_ERRT_raw(this: *mut Self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                13usize,
                3u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn CYCLE_TIME(&self) -> u32 {
        unsafe { ::core::mem::transmute(self._bitfield_1.get(16usize, 16u8) as u32) }
    }
    #[inline]
    pub fn set_CYCLE_TIME(&mut self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            self._bitfield_1.set(16usize, 16u8, val as u64)
        }
    }
    #[inline]
    pub unsafe fn CYCLE_TIME_raw(this: *const Self) -> u32 {
        unsafe {
            ::core::mem::transmute(<__BindgenBitfieldUnit<[u8; 4usize]>>::raw_get(
                ::core::ptr::addr_of!((*this)._bitfield_1),
                16usize,
                16u8,
            ) as u32)
        }
    }
    #[inline]
    pub unsafe fn set_CYCLE_TIME_raw(this: *mut Self, val: u32) {
        unsafe {
            let val: u32 = ::core::mem::transmute(val);
            <__BindgenBitfieldUnit<[u8; 4usize]>>::raw_set(
                ::core::ptr::addr_of_mut!((*this)._bitfield_1),
                16usize,
                16u8,
                val as u64,
            )
        }
    }
    #[inline]
    pub fn new_bitfield_1(
        DLC: u32,
        BRS: u32,
        FDF: u32,
        RTR: u32,
        IDE: u32,
        RSVD: u32,
        TX: u32,
        ERRT: u32,
        CYCLE_TIME: u32,
    ) -> __BindgenBitfieldUnit<[u8; 4usize]> {
        let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default();
        __bindgen_bitfield_unit.set(0usize, 4u8, {
            let DLC: u32 = unsafe { ::core::mem::transmute(DLC) };
            DLC as u64
        });
        __bindgen_bitfield_unit.set(4usize, 1u8, {
            let BRS: u32 = unsafe { ::core::mem::transmute(BRS) };
            BRS as u64
        });
        __bindgen_bitfield_unit.set(5usize, 1u8, {
            let FDF: u32 = unsafe { ::core::mem::transmute(FDF) };
            FDF as u64
        });
        __bindgen_bitfield_unit.set(6usize, 1u8, {
            let RTR: u32 = unsafe { ::core::mem::transmute(RTR) };
            RTR as u64
        });
        __bindgen_bitfield_unit.set(7usize, 1u8, {
            let IDE: u32 = unsafe { ::core::mem::transmute(IDE) };
            IDE as u64
        });
        __bindgen_bitfield_unit.set(8usize, 4u8, {
            let RSVD: u32 = unsafe { ::core::mem::transmute(RSVD) };
            RSVD as u64
        });
        __bindgen_bitfield_unit.set(12usize, 1u8, {
            let TX: u32 = unsafe { ::core::mem::transmute(TX) };
            TX as u64
        });
        __bindgen_bitfield_unit.set(13usize, 3u8, {
            let ERRT: u32 = unsafe { ::core::mem::transmute(ERRT) };
            ERRT as u64
        });
        __bindgen_bitfield_unit.set(16usize, 16u8, {
            let CYCLE_TIME: u32 = unsafe { ::core::mem::transmute(CYCLE_TIME) };
            CYCLE_TIME as u64
        });
        __bindgen_bitfield_unit
    }
}
unsafe extern "C" {
    #[doc = "Global function prototypes (definition in C source)\n/\n/**\n @addtogroup CAN_Global_Functions\n @{"]
    pub fn CAN_Init(CANx: *mut CM_CAN_TypeDef, pstcCanInit: *const stc_can_init_t) -> i32;
    pub fn CAN_StructInit(pstcCanInit: *mut stc_can_init_t) -> i32;
    pub fn CAN_DeInit(CANx: *mut CM_CAN_TypeDef) -> i32;
    pub fn CAN_IntCmd(
        CANx: *mut CM_CAN_TypeDef,
        u32IntType: u32,
        enNewState: en_functional_state_t,
    );
    pub fn CAN_FillTxFrame(
        CANx: *mut CM_CAN_TypeDef,
        u8TxBufType: u8,
        pstcTx: *const stc_can_tx_frame_t,
    ) -> i32;
    pub fn CAN_StartTx(CANx: *mut CM_CAN_TypeDef, u8TxRequest: u8);
    pub fn CAN_AbortTx(CANx: *mut CM_CAN_TypeDef, u8TxBufType: u8);
    pub fn CAN_GetRxFrame(CANx: *mut CM_CAN_TypeDef, pstcRx: *mut stc_can_rx_frame_t) -> i32;
    pub fn CAN_EnterLocalReset(CANx: *mut CM_CAN_TypeDef);
    pub fn CAN_ExitLocalReset(CANx: *mut CM_CAN_TypeDef);
    pub fn CAN_GetLocalResetStatus(CANx: *mut CM_CAN_TypeDef) -> en_flag_status_t;
    pub fn CAN_GetStatus(CANx: *const CM_CAN_TypeDef, u32Flag: u32) -> en_flag_status_t;
    pub fn CAN_ClearStatus(CANx: *mut CM_CAN_TypeDef, u32Flag: u32);
    pub fn CAN_GetStatusValue(CANx: *const CM_CAN_TypeDef) -> u32;
    pub fn CAN_GetErrorInfo(CANx: *const CM_CAN_TypeDef, pstcErr: *mut stc_can_error_info_t)
        -> i32;
    pub fn CAN_GetTxBufStatus(CANx: *const CM_CAN_TypeDef) -> u8;
    pub fn CAN_GetRxBufStatus(CANx: *const CM_CAN_TypeDef) -> u8;
    pub fn CAN_FilterCmd(
        CANx: *mut CM_CAN_TypeDef,
        u16FilterSelect: u16,
        enNewState: en_functional_state_t,
    );
    pub fn CAN_SetRxWarnLimit(CANx: *mut CM_CAN_TypeDef, u8RxWarnLimit: u8);
    pub fn CAN_SetErrorWarnLimit(CANx: *mut CM_CAN_TypeDef, u8ErrorWarnLimit: u8);
    pub fn CAN_TTC_StructInit(pstcCanTtc: *mut stc_can_ttc_config_t) -> i32;
    pub fn CAN_TTC_Config(
        CANx: *mut CM_CAN_TypeDef,
        pstcCanTtc: *const stc_can_ttc_config_t,
    ) -> i32;
    pub fn CAN_TTC_IntCmd(
        CANx: *mut CM_CAN_TypeDef,
        u8IntType: u8,
        enNewState: en_functional_state_t,
    );
    pub fn CAN_TTC_Cmd(CANx: *mut CM_CAN_TypeDef, enNewState: en_functional_state_t);
    pub fn CAN_TTC_GetStatus(CANx: *const CM_CAN_TypeDef, u8Flag: u8) -> en_flag_status_t;
    pub fn CAN_TTC_ClearStatus(CANx: *mut CM_CAN_TypeDef, u8Flag: u8);
    pub fn CAN_TTC_GetStatusValue(CANx: *const CM_CAN_TypeDef) -> u8;
    pub fn CAN_TTC_SetTriggerType(CANx: *mut CM_CAN_TypeDef, u16TriggerType: u16);
    pub fn CAN_TTC_SetTxEnableWindow(CANx: *mut CM_CAN_TypeDef, u16TxEnableWindow: u16);
    pub fn CAN_TTC_SetTxTriggerTime(CANx: *mut CM_CAN_TypeDef, u16TxTriggerTime: u16);
    pub fn CAN_TTC_SetWatchTriggerTime(CANx: *mut CM_CAN_TypeDef, u16WatchTriggerTime: u16);
    pub fn CAN_TTC_FillTxFrame(
        CANx: *mut CM_CAN_TypeDef,
        u8CANTTCTxBuf: u8,
        pstcTx: *const stc_can_tx_frame_t,
    ) -> i32;
    pub fn CAN_TTC_GetConfig(
        CANx: *const CM_CAN_TypeDef,
        pstcCanTtc: *mut stc_can_ttc_config_t,
    ) -> i32;
}