hc32f460_driver_sys 0.1.1

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
/* automatically generated by rust-bindgen 0.72.1 */

pub const SDIOC_MD_SD: u32 = 0;
pub const SDIOC_MD_MMC: u32 = 1;
pub const SDIOC_CARD_DETECT_CD_PIN_LVL: u32 = 0;
pub const SDIOC_CARD_DETECT_TEST_SIGNAL: u32 = 128;
pub const SDIOC_CARD_DETECT_TEST_LVL_LOW: u32 = 0;
pub const SDIOC_CARD_DETECT_TEST_LVL_HIGH: u32 = 64;
pub const SDIOC_SPEED_MD_NORMAL: u32 = 0;
pub const SDIOC_SPEED_MD_HIGH: u32 = 4;
pub const SDIOC_BUS_WIDTH_1BIT: u32 = 0;
pub const SDIOC_BUS_WIDTH_4BIT: u32 = 2;
pub const SDIOC_BUS_WIDTH_8BIT: u32 = 32;
pub const SDIOC_CLK_DIV1: u32 = 0;
pub const SDIOC_CLK_DIV2: u32 = 256;
pub const SDIOC_CLK_DIV4: u32 = 512;
pub const SDIOC_CLK_DIV8: u32 = 1024;
pub const SDIOC_CLK_DIV16: u32 = 2048;
pub const SDIOC_CLK_DIV32: u32 = 4096;
pub const SDIOC_CLK_DIV64: u32 = 8192;
pub const SDIOC_CLK_DIV128: u32 = 16384;
pub const SDIOC_CLK_DIV256: u32 = 32768;
pub const SDIOC_CMD_TYPE_NORMAL: u32 = 0;
pub const SDIOC_CMD_TYPE_SUSPEND: u32 = 64;
pub const SDIOC_CMD_TYPE_RESUME: u32 = 128;
pub const SDIOC_CMD_TYPE_ABORT: u32 = 192;
pub const SDIOC_DATA_LINE_DISABLE: u32 = 0;
pub const SDIOC_DATA_LINE_ENABLE: u32 = 32;
pub const SDIOC_TRANS_DIR_TO_CARD: u32 = 0;
pub const SDIOC_TRANS_DIR_TO_HOST: u32 = 16;
pub const SDIOC_AUTO_SEND_CMD12_DISABLE: u32 = 0;
pub const SDIOC_AUTO_SEND_CMD12_ENABLE: u32 = 4;
pub const SDIOC_TRANS_MD_SINGLE: u32 = 0;
pub const SDIOC_TRANS_MD_INFINITE: u32 = 32;
pub const SDIOC_TRANS_MD_MULTI: u32 = 34;
pub const SDIOC_TRANS_MD_STOP_MULTI: u32 = 32802;
pub const SDIOC_DATA_TIMEOUT_CLK_2E13: u32 = 0;
pub const SDIOC_DATA_TIMEOUT_CLK_2E14: u32 = 1;
pub const SDIOC_DATA_TIMEOUT_CLK_2E15: u32 = 2;
pub const SDIOC_DATA_TIMEOUT_CLK_2E16: u32 = 3;
pub const SDIOC_DATA_TIMEOUT_CLK_2E17: u32 = 4;
pub const SDIOC_DATA_TIMEOUT_CLK_2E18: u32 = 5;
pub const SDIOC_DATA_TIMEOUT_CLK_2E19: u32 = 6;
pub const SDIOC_DATA_TIMEOUT_CLK_2E20: u32 = 7;
pub const SDIOC_DATA_TIMEOUT_CLK_2E21: u32 = 8;
pub const SDIOC_DATA_TIMEOUT_CLK_2E22: u32 = 9;
pub const SDIOC_DATA_TIMEOUT_CLK_2E23: u32 = 10;
pub const SDIOC_DATA_TIMEOUT_CLK_2E24: u32 = 11;
pub const SDIOC_DATA_TIMEOUT_CLK_2E25: u32 = 12;
pub const SDIOC_DATA_TIMEOUT_CLK_2E26: u32 = 13;
pub const SDIOC_DATA_TIMEOUT_CLK_2E27: u32 = 14;
pub const SDIOC_RESP_REG_BIT0_31: u32 = 0;
pub const SDIOC_RESP_REG_BIT32_63: u32 = 4;
pub const SDIOC_RESP_REG_BIT64_95: u32 = 8;
pub const SDIOC_RESP_REG_BIT96_127: u32 = 12;
pub const SDIOC_SW_RST_DATA_LINE: u32 = 4;
pub const SDIOC_SW_RST_CMD_LINE: u32 = 2;
pub const SDIOC_SW_RST_ALL: u32 = 1;
pub const SDIOC_OUTPUT_CLK_FREQ_400K: u32 = 400000;
pub const SDIOC_OUTPUT_CLK_FREQ_25M: u32 = 25000000;
pub const SDIOC_OUTPUT_CLK_FREQ_26M: u32 = 26000000;
pub const SDIOC_OUTPUT_CLK_FREQ_50M: u32 = 50000000;
pub const SDIOC_OUTPUT_CLK_FREQ_52M: u32 = 52000000;
pub const SDIOC_HOST_FLAG_CMDL: u32 = 16777216;
pub const SDIOC_HOST_FLAG_DATL: u32 = 15728640;
pub const SDIOC_HOST_FLAG_DATL_D0: u32 = 1048576;
pub const SDIOC_HOST_FLAG_DATL_D1: u32 = 2097152;
pub const SDIOC_HOST_FLAG_DATL_D2: u32 = 4194304;
pub const SDIOC_HOST_FLAG_DATL_D3: u32 = 8388608;
pub const SDIOC_HOST_FLAG_WPL: u32 = 524288;
pub const SDIOC_HOST_FLAG_CDL: u32 = 262144;
pub const SDIOC_HOST_FLAG_CSS: u32 = 131072;
pub const SDIOC_HOST_FLAG_CIN: u32 = 65536;
pub const SDIOC_HOST_FLAG_BRE: u32 = 2048;
pub const SDIOC_HOST_FLAG_BWE: u32 = 1024;
pub const SDIOC_HOST_FLAG_RTA: u32 = 512;
pub const SDIOC_HOST_FLAG_WTA: u32 = 256;
pub const SDIOC_HOST_FLAG_DA: u32 = 4;
pub const SDIOC_HOST_FLAG_CID: u32 = 2;
pub const SDIOC_HOST_FLAG_CIC: u32 = 1;
pub const SDIOC_HOST_FLAG_ALL: u32 = 33492743;
pub const SDIOC_INT_FLAG_EI: u32 = 32768;
pub const SDIOC_INT_FLAG_CINT: u32 = 256;
pub const SDIOC_INT_FLAG_CRM: u32 = 128;
pub const SDIOC_INT_FLAG_CIST: u32 = 64;
pub const SDIOC_INT_FLAG_BRR: u32 = 32;
pub const SDIOC_INT_FLAG_BWR: u32 = 16;
pub const SDIOC_INT_FLAG_BGE: u32 = 4;
pub const SDIOC_INT_FLAG_TC: u32 = 2;
pub const SDIOC_INT_FLAG_CC: u32 = 1;
pub const SDIOC_NORMAL_INT_FLAG_ALL: u32 = 33271;
pub const SDIOC_INT_CINTSEN: u32 = 256;
pub const SDIOC_INT_CRMSEN: u32 = 128;
pub const SDIOC_INT_CISTSEN: u32 = 64;
pub const SDIOC_INT_BRRSEN: u32 = 32;
pub const SDIOC_INT_BWRSEN: u32 = 16;
pub const SDIOC_INT_BGESEN: u32 = 4;
pub const SDIOC_INT_TCSEN: u32 = 2;
pub const SDIOC_INT_CCSEN: u32 = 1;
pub const SDIOC_NORMAL_INT_ALL: u32 = 503;
pub const SDIOC_AUTO_CMD_ERR_FLAG_CMDE: u32 = 128;
pub const SDIOC_AUTO_CMD_ERR_FLAG_IE: u32 = 16;
pub const SDIOC_AUTO_CMD_ERR_FLAG_EBE: u32 = 8;
pub const SDIOC_AUTO_CMD_ERR_FLAG_CE: u32 = 4;
pub const SDIOC_AUTO_CMD_ERR_FLAG_TOE: u32 = 2;
pub const SDIOC_AUTO_CMD_ERR_FLAG_NE: u32 = 1;
pub const SDIOC_AUTO_CMD_ERR_FLAG_ALL: u32 = 159;
pub const SDIOC_FORCE_AUTO_CMD_ERR_FCMDE: u32 = 128;
pub const SDIOC_FORCE_AUTO_CMD_ERR_FIE: u32 = 16;
pub const SDIOC_FORCE_AUTO_CMD_ERR_FEBE: u32 = 8;
pub const SDIOC_FORCE_AUTO_CMD_ERR_FCE: u32 = 4;
pub const SDIOC_FORCE_AUTO_CMD_ERR_FTOE: u32 = 2;
pub const SDIOC_FORCE_AUTO_CMD_ERR_FNE: u32 = 1;
pub const SDIOC_FORCE_AUTO_CMD_ERR_ALL: u32 = 159;
pub const SDIOC_FORCE_ERR_INT_FACE: u32 = 256;
pub const SDIOC_FORCE_ERR_INT_FDEBE: u32 = 64;
pub const SDIOC_FORCE_ERR_INT_FDCE: u32 = 32;
pub const SDIOC_FORCE_ERR_INT_FDTOE: u32 = 16;
pub const SDIOC_FORCE_ERR_INT_FCIE: u32 = 8;
pub const SDIOC_FORCE_ERR_INT_FCEBE: u32 = 4;
pub const SDIOC_FORCE_ERR_INT_FCCE: u32 = 2;
pub const SDIOC_FORCE_ERR_INT_FCTOE: u32 = 1;
pub const SDIOC_FORCE_ERR_INT_ALL: u32 = 383;
pub const SDIOC_RESP_TYPE_NO: u32 = 0;
pub const SDIOC_RESP_TYPE_R2: u32 = 1;
pub const SDIOC_RESP_TYPE_R3_R4: u32 = 2;
pub const SDIOC_RESP_TYPE_R1_R5_R6_R7: u32 = 26;
pub const SDIOC_RESP_TYPE_R1B_R5B: u32 = 27;
pub const SDIOC_CMD0_GO_IDLE_STATE: u32 = 0;
pub const SDIOC_CMD1_SEND_OP_COND: u32 = 1;
pub const SDIOC_CMD2_ALL_SEND_CID: u32 = 2;
pub const SDIOC_CMD3_SEND_RELATIVE_ADDR: u32 = 3;
pub const SDIOC_CMD4_SET_DSR: u32 = 4;
pub const SDIOC_CMD5_IO_SEND_OP_COND: u32 = 5;
pub const SDIOC_CMD6_SWITCH_FUNC: u32 = 6;
pub const SDIOC_CMD7_SELECT_DESELECT_CARD: u32 = 7;
pub const SDIOC_CMD8_SEND_IF_COND: u32 = 8;
pub const SDIOC_CMD9_SEND_CSD: u32 = 9;
pub const SDIOC_CMD10_SEND_CID: u32 = 10;
pub const SDIOC_CMD11_READ_DAT_UNTIL_STOP: u32 = 11;
pub const SDIOC_CMD12_STOP_TRANSMISSION: u32 = 12;
pub const SDIOC_CMD13_SEND_STATUS: u32 = 13;
pub const SDIOC_CMD14_HS_BUSTEST_READ: u32 = 14;
pub const SDIOC_CMD15_GO_INACTIVE_STATE: u32 = 15;
pub const SDIOC_CMD16_SET_BLOCKLEN: u32 = 16;
pub const SDIOC_CMD17_READ_SINGLE_BLOCK: u32 = 17;
pub const SDIOC_CMD18_READ_MULTI_BLOCK: u32 = 18;
pub const SDIOC_CMD19_HS_BUSTEST_WRITE: u32 = 19;
pub const SDIOC_CMD20_WRITE_DAT_UNTIL_STOP: u32 = 20;
pub const SDIOC_CMD23_SET_BLOCK_COUNT: u32 = 23;
pub const SDIOC_CMD24_WRITE_SINGLE_BLOCK: u32 = 24;
pub const SDIOC_CMD25_WRITE_MULTI_BLOCK: u32 = 25;
pub const SDIOC_CMD26_PROGRAM_CID: u32 = 26;
pub const SDIOC_CMD27_PROGRAM_CSD: u32 = 27;
pub const SDIOC_CMD28_SET_WRITE_PROT: u32 = 28;
pub const SDIOC_CMD29_CLR_WRITE_PROT: u32 = 29;
pub const SDIOC_CMD30_SEND_WRITE_PROT: u32 = 30;
pub const SDIOC_CMD32_ERASE_WR_BLK_START: u32 = 32;
pub const SDIOC_CMD33_ERASE_WR_BLK_END: u32 = 33;
pub const SDIOC_CMD35_ERASE_GROUP_START: u32 = 35;
pub const SDIOC_CMD36_ERASE_GROUP_END: u32 = 36;
pub const SDIOC_CMD38_ERASE: u32 = 38;
pub const SDIOC_CMD39_FAST_IO: u32 = 39;
pub const SDIOC_CMD40_GO_IRQ_STATE: u32 = 40;
pub const SDIOC_CMD42_LOCK_UNLOCK: u32 = 42;
pub const SDIOC_CMD52_IO_RW_DIRECT: u32 = 52;
pub const SDIOC_CMD53_IO_RW_EXTENDED: u32 = 53;
pub const SDIOC_CMD55_APP_CMD: u32 = 55;
pub const SDIOC_CMD56_GEN_CMD: u32 = 56;
pub const SDIOC_CMD64_NO_CMD: u32 = 64;
pub const SDIOC_ACMD6_SET_BUS_WIDTH: u32 = 6;
pub const SDIOC_ACMD13_SD_STATUS: u32 = 13;
pub const SDIOC_ACMD22_SEND_NUM_WR_BLOCKS: u32 = 22;
pub const SDIOC_ACMD23_SET_WR_BLK_ERASE_COUNT: u32 = 23;
pub const SDIOC_ACMD41_SD_APP_OP_COND: u32 = 41;
pub const SDIOC_ACMD42_SET_CLR_CARD_DETECT: u32 = 42;
pub const SDIOC_ACMD51_SEND_SCR: u32 = 51;
pub const SDIOC_ACMD43_GET_MKB: u32 = 43;
pub const SDIOC_ACMD44_GET_MID: u32 = 44;
pub const SDIOC_ACMD45_SET_CER_RN1: u32 = 45;
pub const SDIOC_ACMD46_GET_CER_RN2: u32 = 46;
pub const SDIOC_ACMD47_SET_CER_RES2: u32 = 47;
pub const SDIOC_ACMD48_GET_CER_RES1: u32 = 48;
pub const SDIOC_ACMD18_SECURE_READ_MULTI_BLOCK: u32 = 18;
pub const SDIOC_ACMD25_SECURE_WRITE_MULTI_BLOCK: u32 = 25;
pub const SDIOC_ACMD38_SECURE_ERASE: u32 = 38;
pub const SDIOC_ACMD49_CHANGE_SECURE_AREA: u32 = 49;
pub const SDIOC_ACMD48_SECURE_WRITE_MKB: u32 = 48;
pub const SDMMC_ERR_NONE: u32 = 0;
pub const SDMMC_ERR_ADDR_OUT_OF_RANGE: u32 = 2147483648;
pub const SDMMC_ERR_ADDR_MISALIGNED: u32 = 1073741824;
pub const SDMMC_ERR_BLOCK_LEN_ERR: u32 = 536870912;
pub const SDMMC_ERR_ERASE_SEQ_ERR: u32 = 268435456;
pub const SDMMC_ERR_BAD_ERASE_PARAM: u32 = 134217728;
pub const SDMMC_ERR_WR_PROT_VIOLATION: u32 = 67108864;
pub const SDMMC_ERR_LOCK_UNLOCK_FAILED: u32 = 16777216;
pub const SDMMC_ERR_COM_CRC_FAILED: u32 = 8388608;
pub const SDMMC_ERR_ILLEGAL_CMD: u32 = 4194304;
pub const SDMMC_ERR_CARD_ECC_FAILED: u32 = 2097152;
pub const SDMMC_ERR_CC_ERR: u32 = 1048576;
pub const SDMMC_ERR_GENERAL_UNKNOWN_ERR: u32 = 524288;
pub const SDMMC_ERR_STREAM_RD_UNDERRUN: u32 = 262144;
pub const SDMMC_ERR_STREAM_WR_OVERRUN: u32 = 131072;
pub const SDMMC_ERR_CID_CSD_OVERWRITE: u32 = 65536;
pub const SDMMC_ERR_WP_ERASE_SKIP: u32 = 32768;
pub const SDMMC_ERR_CARD_ECC_DISABLED: u32 = 16384;
pub const SDMMC_ERR_ERASE_RST: u32 = 8192;
pub const SDMMC_ERR_CMD_AUTO_SEND: u32 = 4096;
pub const SDMMC_ERR_CMD_INDEX: u32 = 2048;
pub const SDMMC_ERR_CMD_STOP_BIT: u32 = 1024;
pub const SDMMC_ERR_CMD_CRC_FAIL: u32 = 512;
pub const SDMMC_ERR_CMD_TIMEOUT: u32 = 256;
pub const SDMMC_ERR_SWITCH_ERR: u32 = 128;
pub const SDMMC_ERR_DATA_STOP_BIT: u32 = 64;
pub const SDMMC_ERR_DATA_CRC_FAIL: u32 = 32;
pub const SDMMC_ERR_DATA_TIMEOUT: u32 = 16;
pub const SDMMC_ERR_AKE_SEQ_ERR: u32 = 8;
pub const SDMMC_ERR_INVD_VOLT: u32 = 4;
pub const SDMMC_ERR_REQ_NOT_APPLICABLE: u32 = 2;
pub const SDMMC_ERR_UNSUPPORT_FEATURE: u32 = 1;
pub const SDMMC_ERR_BITS_MASK: u32 = 4261404744;
pub const SDMMC_STATUS_CARD_IS_LOCKED_POS: u32 = 24;
pub const SDMMC_STATUS_CARD_IS_LOCKED: u32 = 33554432;
pub const SDMMC_STATUS_CURR_STATE_POS: u32 = 9;
pub const SDMMC_STATUS_CURR_STATE: u32 = 7680;
pub const SDMMC_STATUS_RDY_FOR_DATA_POS: u32 = 8;
pub const SDMMC_STATUS_RDY_FOR_DATA: u32 = 256;
pub const SDMMC_STATUS_APP_CMD_POS: u32 = 5;
pub const SDMMC_STATUS_APP_CMD: u32 = 32;
pub const SDMMC_SCR_PHY_SPEC_VER_1P0: u32 = 0;
pub const SDMMC_SCR_PHY_SPEC_VER_1P1: u32 = 16777216;
pub const SDMMC_SCR_PHY_SPEC_VER_2P0: u32 = 33554432;
pub const SDMMC_SCR_BUS_WIDTH_4BIT: u32 = 262144;
pub const SDMMC_SCR_BUS_WIDTH_1BIT: u32 = 65536;
pub const SDMMC_OCR_HIGH_CAPACITY: u32 = 1073741824;
pub const SDMMC_OCR_STD_CAPACITY: u32 = 0;
pub const SDMMC_CSD_SUPPORT_CLASS5_ERASE: u32 = 32;
pub const SDMMC_DATA_TIMEOUT: u32 = 65535;
pub const SDMMC_MAX_VOLT_TRIAL: u32 = 65535;
pub const SDIO_CMD52_ARG_RD: u32 = 0;
pub const SDIO_CMD52_ARG_WR: u32 = 2147483648;
pub const SDIO_CMD52_ARG_RAW_FLAG_0: u32 = 0;
pub const SDIO_CMD52_ARG_RAW_FLAG_1: u32 = 134217728;
pub const SDIO_CMD53_ARG_RD: u32 = 0;
pub const SDIO_CMD53_ARG_WR: u32 = 2147483648;
pub const SDIO_CMD53_ARG_TRANS_MD_BYTE: u32 = 0;
pub const SDIO_CMD53_ARG_TRANS_MD_BLOCK: u32 = 134217728;
pub const SDIO_CMD53_ARG_OP_CODE_ADDR_FIX: u32 = 0;
pub const SDIO_CMD53_ARG_OP_CODE_ADDR_INC: u32 = 67108864;
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 SDIOC"]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct CM_SDIOC_TypeDef {
    pub RESERVED0: [u8; 4usize],
    pub BLKSIZE: u16,
    pub BLKCNT: u16,
    pub ARG0: u16,
    pub ARG1: u16,
    pub TRANSMODE: u16,
    pub CMD: u16,
    pub RESP0: u16,
    pub RESP1: u16,
    pub RESP2: u16,
    pub RESP3: u16,
    pub RESP4: u16,
    pub RESP5: u16,
    pub RESP6: u16,
    pub RESP7: u16,
    pub BUF0: u16,
    pub BUF1: u16,
    pub PSTAT: u32,
    pub HOSTCON: u8,
    pub PWRCON: u8,
    pub BLKGPCON: u8,
    pub RESERVED1: [u8; 1usize],
    pub CLKCON: u16,
    pub TOUTCON: u8,
    pub SFTRST: u8,
    pub NORINTST: u16,
    pub ERRINTST: u16,
    pub NORINTSTEN: u16,
    pub ERRINTSTEN: u16,
    pub NORINTSGEN: u16,
    pub ERRINTSGEN: u16,
    pub ATCERRST: u16,
    pub RESERVED2: [u8; 18usize],
    pub FEA: u16,
    pub FEE: u16,
}
#[doc = " @brief SDIOC Init structure definition"]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_sdioc_init_t {
    #[doc = "< Specifies the SDIOC work mode.\nThis parameter can be a value of @ref SDIOC_Mode"]
    pub u32Mode: u32,
    #[doc = "< Specifies the SDIOC card detect way.\nThis parameter can be a value of @ref SDIOC_Card_Detect_Way"]
    pub u8CardDetect: u8,
    #[doc = "< Specifies the SDIOC speed mode.\nThis parameter can be a value of @ref SDIOC_Speed_Mode"]
    pub u8SpeedMode: u8,
    #[doc = "< Specifies the SDIOC bus width.\nThis parameter can be a value of @ref SDIOC_Bus_Width"]
    pub u8BusWidth: u8,
    #[doc = "< Specifies the SDIOC clock division.\nThis parameter can be a value of @ref SDIOC_Clock_Division"]
    pub u16ClockDiv: u16,
}
#[doc = " @brief SDIOC Command Configuration structure definition"]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_sdioc_cmd_config_t {
    #[doc = "< Specifies the SDIOC command argument."]
    pub u32Argument: u32,
    #[doc = "< Specifies the SDIOC command index.\nThis parameter must be a number between Min_Data = 0 and Max_Data = 63"]
    pub u16CmdIndex: u16,
    #[doc = "< Specifies the SDIOC command type.\nThis parameter can be a value of @ref SDIOC_Command_Type"]
    pub u16CmdType: u16,
    #[doc = "< Specifies whether SDIOC uses data lines in current command.\nThis parameter can be a value of @ref SDIOC_Data_Line_Valid"]
    pub u16DataLine: u16,
    #[doc = "< Specifies the SDIOC response type.\nThis parameter can be a value of @ref SDIOC_Response_Type"]
    pub u16ResponseType: u16,
}
#[doc = " @brief SDIOC Data Configuration structure definition"]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_sdioc_data_config_t {
    #[doc = "< Specifies the SDIOC data block size.\nThis parameter must be a number between Min_Data = 1 and Max_Data = 512"]
    pub u16BlockSize: u16,
    #[doc = "< Specifies the SDIOC data block count.\nThis parameter must be a number between Min_Data = 0 and Max_Data = 0xFFFF"]
    pub u16BlockCount: u16,
    #[doc = "< Specifies the SDIOC data transfer direction.\nThis parameter can be a value of @ref SDIOC_Transfer_Direction"]
    pub u16TransDir: u16,
    #[doc = "< Specifies the validity of the SDIOC Auto Send CMD12.\nThis parameter can be a value of @ref SDIOC_Auto_Send_CMD12"]
    pub u16AutoCmd12: u16,
    #[doc = "< Specifies the SDIOC data transfer mode.\nThis parameter can be a value of @ref SDIOC_Transfer_Mode"]
    pub u16TransMode: u16,
    #[doc = "< Specifies the SDIOC data timeout time.\nThis parameter can be a value of @ref SDIOC_Data_Timeout_Time"]
    pub u16DataTimeout: u8,
}
#[doc = " @brief SDIO CMD52 arguments structure definition"]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_sdio_cmd52_arg_t {
    #[doc = "< Specifies the number of the function within the I/O card.\nThis parameter must be a number between Min_Data = 0 and Max_Data = 7"]
    pub u8FuncNum: u8,
    #[doc = "< Specifies the direction of the I/O operation.\nThis parameter can be a value of @ref SDIO_CMD52_Arguments_RW_Flag"]
    pub u32RwFlag: u32,
    #[doc = "< Specifies the address of the byte of data inside of the selected function.\nThis parameter must be a number between Min_Data = 0 and Max_Data = 0x1FFFF"]
    pub u32RegAddr: u32,
    #[doc = "< Specifies the direction of the I/O operation.\nThis parameter can be a value of @ref SDIO_CMD52_Arguments_RAW_Flag"]
    pub u32RawFlag: u32,
}
#[doc = " @brief SDIO CMD53 arguments structure definition"]
#[repr(C)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub struct stc_sdio_cmd53_arg_t {
    #[doc = "< Specifies the number of the function within the I/O card.\nThis parameter must be a number between Min_Data = 0 and Max_Data = 7"]
    pub u8FuncNum: u8,
    #[doc = "< Specifies the direction of the I/O operation.\nThis parameter can be a value of @ref SDIO_CMD53_Arguments_RW_Flag"]
    pub u32RwFlag: u32,
    #[doc = "< Specifies the address of the byte of data inside of the selected function.\nThis parameter must be a number between Min_Data = 0 and Max_Data = 0x1FFFF"]
    pub u32RegAddr: u32,
    #[doc = "< Specifies the operation code.\nThis parameter can be a value of @ref SDIO_CMD53_Arguments_Operate_Code"]
    pub u32OperateCode: u32,
    #[doc = "< Specifies the operation code.\nThis parameter can be a value of @ref SDIO_CMD53_Arguments_Block_Mode"]
    pub u32BlockMode: u32,
    #[doc = "< Specifies the byte/block count.\nThis parameter must be a number between Min_Data = 0 and Max_Data = 0x1FF"]
    pub u32Count: u32,
}
unsafe extern "C" {
    #[doc = "Global function prototypes (definition in C source)\n/\n/**\n @addtogroup SDIOC_Global_Functions\n @{"]
    pub fn SDIOC_DeInit(SDIOCx: *mut CM_SDIOC_TypeDef) -> i32;
    pub fn SDIOC_Init(SDIOCx: *mut CM_SDIOC_TypeDef, pstcSdiocInit: *const stc_sdioc_init_t)
        -> i32;
    pub fn SDIOC_StructInit(pstcSdiocInit: *mut stc_sdioc_init_t) -> i32;
    pub fn SDIOC_SWReset(SDIOCx: *mut CM_SDIOC_TypeDef, u8Type: u8) -> i32;
    pub fn SDIOC_PowerCmd(SDIOCx: *mut CM_SDIOC_TypeDef, enNewState: en_functional_state_t);
    pub fn SDIOC_GetPowerState(SDIOCx: *const CM_SDIOC_TypeDef) -> en_functional_state_t;
    pub fn SDIOC_GetMode(SDIOCx: *const CM_SDIOC_TypeDef) -> u32;
    pub fn SDIOC_ClockCmd(SDIOCx: *mut CM_SDIOC_TypeDef, enNewState: en_functional_state_t);
    pub fn SDIOC_SetClockDiv(SDIOCx: *mut CM_SDIOC_TypeDef, u16Div: u16);
    pub fn SDIOC_GetOptimumClockDiv(u32ClockFreq: u32, pu16Div: *mut u16) -> i32;
    pub fn SDIOC_VerifyClockDiv(u32Mode: u32, u8SpeedMode: u8, u16ClockDiv: u16) -> i32;
    pub fn SDIOC_GetInsertStatus(SDIOCx: *const CM_SDIOC_TypeDef) -> en_flag_status_t;
    pub fn SDIOC_SetSpeedMode(SDIOCx: *mut CM_SDIOC_TypeDef, u8SpeedMode: u8);
    pub fn SDIOC_SetBusWidth(SDIOCx: *mut CM_SDIOC_TypeDef, u8BusWidth: u8);
    pub fn SDIOC_SetCardDetectSrc(SDIOCx: *mut CM_SDIOC_TypeDef, u8Src: u8);
    pub fn SDIOC_SetCardDetectTestLevel(SDIOCx: *mut CM_SDIOC_TypeDef, u8Level: u8);
    pub fn SDIOC_SendCommand(
        SDIOCx: *mut CM_SDIOC_TypeDef,
        pstcCmdConfig: *const stc_sdioc_cmd_config_t,
    ) -> i32;
    pub fn SDIOC_CommandStructInit(pstcCmdConfig: *mut stc_sdioc_cmd_config_t) -> i32;
    pub fn SDIOC_GetResponse(SDIOCx: *mut CM_SDIOC_TypeDef, u8Reg: u8, pu32Value: *mut u32) -> i32;
    pub fn SDIOC_ConfigData(
        SDIOCx: *mut CM_SDIOC_TypeDef,
        pstcDataConfig: *const stc_sdioc_data_config_t,
    ) -> i32;
    pub fn SDIOC_DataStructInit(pstcDataConfig: *mut stc_sdioc_data_config_t) -> i32;
    pub fn SDIOC_ReadBuffer(SDIOCx: *mut CM_SDIOC_TypeDef, au8Data: *mut u8, u32Len: u32) -> i32;
    pub fn SDIOC_WriteBuffer(SDIOCx: *mut CM_SDIOC_TypeDef, au8Data: *const u8, u32Len: u32)
        -> i32;
    pub fn SDIOC_BlockGapStopCmd(SDIOCx: *mut CM_SDIOC_TypeDef, enNewState: en_functional_state_t);
    pub fn SDIOC_RestartTrans(SDIOCx: *mut CM_SDIOC_TypeDef);
    pub fn SDIOC_ReadWaitCmd(SDIOCx: *mut CM_SDIOC_TypeDef, enNewState: en_functional_state_t);
    pub fn SDIOC_BlockGapIntCmd(SDIOCx: *mut CM_SDIOC_TypeDef, enNewState: en_functional_state_t);
    pub fn SDIOC_IntCmd(
        SDIOCx: *mut CM_SDIOC_TypeDef,
        u32IntType: u32,
        enNewState: en_functional_state_t,
    );
    pub fn SDIOC_GetIntEnableState(
        SDIOCx: *const CM_SDIOC_TypeDef,
        u32IntType: u32,
    ) -> en_functional_state_t;
    pub fn SDIOC_IntStatusCmd(
        SDIOCx: *mut CM_SDIOC_TypeDef,
        u32IntType: u32,
        enNewState: en_functional_state_t,
    );
    pub fn SDIOC_GetIntStatus(SDIOCx: *const CM_SDIOC_TypeDef, u32Flag: u32) -> en_flag_status_t;
    pub fn SDIOC_ClearIntStatus(SDIOCx: *mut CM_SDIOC_TypeDef, u32Flag: u32);
    pub fn SDIOC_GetHostStatus(SDIOCx: *const CM_SDIOC_TypeDef, u32Flag: u32) -> en_flag_status_t;
    pub fn SDIOC_GetAutoCmdErrorStatus(
        SDIOCx: *const CM_SDIOC_TypeDef,
        u16Flag: u16,
    ) -> en_flag_status_t;
    pub fn SDIOC_ForceAutoCmdErrorEvent(SDIOCx: *mut CM_SDIOC_TypeDef, u16Event: u16);
    pub fn SDIOC_ForceErrorIntEvent(SDIOCx: *mut CM_SDIOC_TypeDef, u16Event: u16);
    pub fn SDMMC_CMD0_GoIdleState(SDIOCx: *mut CM_SDIOC_TypeDef, pu32ErrStatus: *mut u32) -> i32;
    pub fn SDMMC_CMD2_AllSendCID(SDIOCx: *mut CM_SDIOC_TypeDef, pu32ErrStatus: *mut u32) -> i32;
    pub fn SDMMC_CMD3_SendRelativeAddr(
        SDIOCx: *mut CM_SDIOC_TypeDef,
        pu16RCA: *mut u16,
        pu32ErrStatus: *mut u32,
    ) -> i32;
    pub fn SDMMC_CMD6_SwitchFunc(
        SDIOCx: *mut CM_SDIOC_TypeDef,
        u32Argument: u32,
        pu32ErrStatus: *mut u32,
    ) -> i32;
    pub fn SDMMC_CMD7_SelectDeselectCard(
        SDIOCx: *mut CM_SDIOC_TypeDef,
        u32RCA: u32,
        pu32ErrStatus: *mut u32,
    ) -> i32;
    pub fn SDMMC_CMD8_SendInterfaceCond(
        SDIOCx: *mut CM_SDIOC_TypeDef,
        pu32ErrStatus: *mut u32,
    ) -> i32;
    pub fn SDMMC_CMD9_SendCSD(
        SDIOCx: *mut CM_SDIOC_TypeDef,
        u32RCA: u32,
        pu32ErrStatus: *mut u32,
    ) -> i32;
    pub fn SDMMC_CMD12_StopTrans(SDIOCx: *mut CM_SDIOC_TypeDef, pu32ErrStatus: *mut u32) -> i32;
    pub fn SDMMC_CMD13_SendStatus(
        SDIOCx: *mut CM_SDIOC_TypeDef,
        u32RCA: u32,
        pu32ErrStatus: *mut u32,
    ) -> i32;
    pub fn SDMMC_CMD16_SetBlockLength(
        SDIOCx: *mut CM_SDIOC_TypeDef,
        u32BlockLen: u32,
        pu32ErrStatus: *mut u32,
    ) -> i32;
    pub fn SDMMC_CMD17_ReadSingleBlock(
        SDIOCx: *mut CM_SDIOC_TypeDef,
        u32ReadAddr: u32,
        pu32ErrStatus: *mut u32,
    ) -> i32;
    pub fn SDMMC_CMD18_ReadMultipleBlock(
        SDIOCx: *mut CM_SDIOC_TypeDef,
        u32ReadAddr: u32,
        pu32ErrStatus: *mut u32,
    ) -> i32;
    pub fn SDMMC_CMD24_WriteSingleBlock(
        SDIOCx: *mut CM_SDIOC_TypeDef,
        u32WriteAddr: u32,
        pu32ErrStatus: *mut u32,
    ) -> i32;
    pub fn SDMMC_CMD25_WriteMultipleBlock(
        SDIOCx: *mut CM_SDIOC_TypeDef,
        u32WriteAddr: u32,
        pu32ErrStatus: *mut u32,
    ) -> i32;
    pub fn SDMMC_CMD32_EraseBlockStartAddr(
        SDIOCx: *mut CM_SDIOC_TypeDef,
        u32StartAddr: u32,
        pu32ErrStatus: *mut u32,
    ) -> i32;
    pub fn SDMMC_CMD33_EraseBlockEndAddr(
        SDIOCx: *mut CM_SDIOC_TypeDef,
        u32EndAddr: u32,
        pu32ErrStatus: *mut u32,
    ) -> i32;
    pub fn SDMMC_CMD38_Erase(
        SDIOCx: *mut CM_SDIOC_TypeDef,
        u32Argument: u32,
        pu32ErrStatus: *mut u32,
    ) -> i32;
    pub fn SDMMC_CMD55_AppCmd(
        SDIOCx: *mut CM_SDIOC_TypeDef,
        u32Argument: u32,
        pu32ErrStatus: *mut u32,
    ) -> i32;
    pub fn SDMMC_ACMD6_SetBusWidth(
        SDIOCx: *mut CM_SDIOC_TypeDef,
        u32BusWidth: u32,
        pu32ErrStatus: *mut u32,
    ) -> i32;
    pub fn SDMMC_ACMD13_SendStatus(SDIOCx: *mut CM_SDIOC_TypeDef, pu32ErrStatus: *mut u32) -> i32;
    pub fn SDMMC_ACMD41_SendOperateCond(
        SDIOCx: *mut CM_SDIOC_TypeDef,
        u32Argument: u32,
        pu32ErrStatus: *mut u32,
    ) -> i32;
    pub fn SDMMC_ACMD51_SendSCR(SDIOCx: *mut CM_SDIOC_TypeDef, pu32ErrStatus: *mut u32) -> i32;
    pub fn SDMMC_CMD1_SendOperateCond(
        SDIOCx: *mut CM_SDIOC_TypeDef,
        u32Argument: u32,
        pu32ErrStatus: *mut u32,
    ) -> i32;
    pub fn SDMMC_CMD35_EraseGroupStartAddr(
        SDIOCx: *mut CM_SDIOC_TypeDef,
        u32StartAddr: u32,
        pu32ErrStatus: *mut u32,
    ) -> i32;
    pub fn SDMMC_CMD36_EraseGroupEndAddr(
        SDIOCx: *mut CM_SDIOC_TypeDef,
        u32EndAddr: u32,
        pu32ErrStatus: *mut u32,
    ) -> i32;
    pub fn SDMMC_CMD5_IOSendOperateCond(
        SDIOCx: *mut CM_SDIOC_TypeDef,
        u32Argument: u32,
        pu32ErrStatus: *mut u32,
    ) -> i32;
    pub fn SDMMC_CMD52_IORwDirect(
        SDIOCx: *mut CM_SDIOC_TypeDef,
        pstcCmdArg: *const stc_sdio_cmd52_arg_t,
        u8In: u8,
        pu8Out: *mut u8,
        pu32ErrStatus: *mut u32,
    ) -> i32;
    pub fn SDMMC_CMD53_IORwExtended(
        SDIOCx: *mut CM_SDIOC_TypeDef,
        pstcCmdArg: *const stc_sdio_cmd53_arg_t,
        pu32ErrStatus: *mut u32,
    ) -> i32;
}