1
2
3
6
7
8
9
10
11
12
13
14
15
16
17
18
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
/* ... */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include "imp.h"
extern struct flash_driver plugin_flash;
extern struct flash_driver msp432p4_flash;
extern struct flash_driver aducm302x_flash;
extern struct flash_driver aducm4x50_flash;
/* ... */
static const struct flash_driver * const flash_drivers[] = {
&aduc702x_flash,
&aducm302x_flash,
&aducm360_flash,
&aducm4x50_flash,
&ambiqmicro_flash,
&at91sam3_flash,
&at91sam4_flash,
&at91sam4l_flash,
&at91sam7_flash,
&at91samd_flash,
&ath79_flash,
&atsame5_flash,
&atsamv_flash,
&avr_flash,
&bluenrgx_flash,
&cc3220sf_flash,
&cc26xx_flash,
&cfi_flash,
&dsp5680xx_flash,
&efm32_flash,
&em357_flash,
&eneispif_flash,
&esirisc_flash,
&faux_flash,
&fm3_flash,
&fm4_flash,
&fespi_flash,
&jtagspi_flash,
&kinetis_flash,
&kinetis_ke_flash,
&lpc2000_flash,
&lpc288x_flash,
&lpc2900_flash,
&lpcspifi_flash,
&max32xxx_flash,
&mdr_flash,
&mrvlqspi_flash,
&msp432_flash,
&niietcm4_flash,
&npcx_flash,
&nrf5_flash,
&nrf51_flash,
&numicro_flash,
&ocl_flash,
&pic32mx_flash,
&pic32mm_flash,
&psoc4_flash,
&psoc5lp_flash,
&psoc5lp_eeprom_flash,
&psoc5lp_nvl_flash,
&psoc6_flash,
&qn908x_flash,
&rs14100_flash,
&renesas_rpchf_flash,
&rp2040_flash,
&sh_qspi_flash,
&sim3x_flash,
&stellaris_flash,
&stm32f1x_flash,
&stm32f2x_flash,
&stm32lx_flash,
&stm32l4x_flash,
&stm32l5x_flash,
&stm32h7x_flash,
&stm32g0x_flash,
&stm32g4x_flash,
&stmsmi_flash,
&stmqspi_flash,
&str7x_flash,
&str9x_flash,
&str9xpec_flash,
&swm050_flash,
&tms470_flash,
&virtual_flash,
&xcf_flash,
&xmc1xxx_flash,
&xmc4xxx_flash,
&w600_flash,
&rsl10_flash,
&msp432p4_flash,
&plugin_flash,
NULL,
...};
const struct flash_driver *flash_driver_find_by_name(const char *name)
{
for (unsigned i = 0; flash_drivers[i]; i++) {
if (strcmp(name, flash_drivers[i]->name) == 0)
return flash_drivers[i];
}for (unsigned i = 0; flash_drivers[i]; i++) { ... }
return NULL;
}{ ... }