summaryrefslogtreecommitdiff
path: root/components/drivers/spi/Kconfig
blob: 455db9e3bed4d6962819e6515adc10ae417bfc2e (plain)
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
menuconfig RT_USING_SPI
    bool "Using SPI Bus/Device device drivers"
    default n

    if RT_USING_SPI

        menuconfig RT_USING_SPI_ISR
            bool "Enable interrupt-safe SPI operations (using spinlocks in ISR context)"
            default y
        
        config RT_USING_SPI_BITOPS
            bool "Enable SPI bit-bang operation functions"
            default n

        menuconfig RT_USING_SOFT_SPI
            bool "Use GPIO to simulate SPI (swspi)"
            default n
            select RT_USING_PIN
            select RT_USING_SPI_BITOPS
            if RT_USING_SOFT_SPI
                config RT_SOFT_SPI0_HAS_PIN_DEFAULT
                    bool

                config RT_SOFT_SPI0_SCK_PIN_DEFAULT
                    int

                config RT_SOFT_SPI0_MISO_PIN_DEFAULT
                    int

                config RT_SOFT_SPI0_MOSI_PIN_DEFAULT
                    int

                config RT_SOFT_SPI0_HAS_BUS_NAME_DEFAULT
                    bool

                config RT_SOFT_SPI0_BUS_NAME_DEFAULT
                    string

                menuconfig RT_USING_SOFT_SPI0
                    bool "Enable software SPI0 Bus (swspi0)"
                    default n
                    if RT_USING_SOFT_SPI0
                        config RT_SOFT_SPI0_SCK_PIN
                            int "SCK pin number"
                            range 0 32767
                            default RT_SOFT_SPI0_SCK_PIN_DEFAULT if RT_SOFT_SPI0_HAS_PIN_DEFAULT
                            default 1
                        config RT_SOFT_SPI0_MISO_PIN
                            int "MISO pin number"
                            range 0 32767
                            default RT_SOFT_SPI0_MISO_PIN_DEFAULT if RT_SOFT_SPI0_HAS_PIN_DEFAULT
                            default 2
                        config RT_SOFT_SPI0_MOSI_PIN
                            int "MOSI pin number"
                            range 0 32767
                            default RT_SOFT_SPI0_MOSI_PIN_DEFAULT if RT_SOFT_SPI0_HAS_PIN_DEFAULT
                            default 3
                        config RT_SOFT_SPI0_BUS_NAME
                            string "Bus name"
                            default RT_SOFT_SPI0_BUS_NAME_DEFAULT if RT_SOFT_SPI0_HAS_BUS_NAME_DEFAULT
                            default "swspi0"
                        config RT_SOFT_SPI0_TIMING_DELAY
                            int "Timing delay (us)"
                            range 0 32767
                            default 1
                    endif
                config RT_SOFT_SPI1_HAS_PIN_DEFAULT
                    bool

                config RT_SOFT_SPI1_SCK_PIN_DEFAULT
                    int

                config RT_SOFT_SPI1_MISO_PIN_DEFAULT
                    int

                config RT_SOFT_SPI1_MOSI_PIN_DEFAULT
                    int

                config RT_SOFT_SPI1_HAS_BUS_NAME_DEFAULT
                    bool

                config RT_SOFT_SPI1_BUS_NAME_DEFAULT
                    string

                menuconfig RT_USING_SOFT_SPI1
                    bool "Enable software SPI1 Bus (swspi1)"
                    default n
                    if RT_USING_SOFT_SPI1
                        config RT_SOFT_SPI1_SCK_PIN
                            int "SCK pin number"
                            range 0 32767
                            default RT_SOFT_SPI1_SCK_PIN_DEFAULT if RT_SOFT_SPI1_HAS_PIN_DEFAULT
                            default 4
                        config RT_SOFT_SPI1_MISO_PIN
                            int "MISO pin number"
                            range 0 32767
                            default RT_SOFT_SPI1_MISO_PIN_DEFAULT if RT_SOFT_SPI1_HAS_PIN_DEFAULT
                            default 5
                        config RT_SOFT_SPI1_MOSI_PIN
                            int "MOSI pin number"
                            range 0 32767
                            default RT_SOFT_SPI1_MOSI_PIN_DEFAULT if RT_SOFT_SPI1_HAS_PIN_DEFAULT
                            default 6
                        config RT_SOFT_SPI1_BUS_NAME
                            string "Bus name"
                            default RT_SOFT_SPI1_BUS_NAME_DEFAULT if RT_SOFT_SPI1_HAS_BUS_NAME_DEFAULT
                            default "swspi1"
                        config RT_SOFT_SPI1_TIMING_DELAY
                            int "Timing delay (us)"
                            range 0 32767
                            default 1
                    endif
                config RT_SOFT_SPI2_HAS_PIN_DEFAULT
                    bool

                config RT_SOFT_SPI2_SCK_PIN_DEFAULT
                    int

                config RT_SOFT_SPI2_MISO_PIN_DEFAULT
                    int

                config RT_SOFT_SPI2_MOSI_PIN_DEFAULT
                    int

                config RT_SOFT_SPI2_HAS_BUS_NAME_DEFAULT
                    bool

                config RT_SOFT_SPI2_BUS_NAME_DEFAULT
                    string

                menuconfig RT_USING_SOFT_SPI2
                    bool "Enable software SPI2 Bus (swspi2)"
                    default n
                    if RT_USING_SOFT_SPI2
                        config RT_SOFT_SPI2_SCK_PIN
                            int "SCK pin number"
                            range 0 32767
                            default RT_SOFT_SPI2_SCK_PIN_DEFAULT if RT_SOFT_SPI2_HAS_PIN_DEFAULT
                            default 7
                        config RT_SOFT_SPI2_MISO_PIN
                            int "MISO pin number"
                            range 0 32767
                            default RT_SOFT_SPI2_MISO_PIN_DEFAULT if RT_SOFT_SPI2_HAS_PIN_DEFAULT
                            default 8
                        config RT_SOFT_SPI2_MOSI_PIN
                            int "MOSI pin number"
                            range 0 32767
                            default RT_SOFT_SPI2_MOSI_PIN_DEFAULT if RT_SOFT_SPI2_HAS_PIN_DEFAULT
                            default 9
                        config RT_SOFT_SPI2_BUS_NAME
                            string "Bus name"
                            default RT_SOFT_SPI2_BUS_NAME_DEFAULT if RT_SOFT_SPI2_HAS_BUS_NAME_DEFAULT
                            default "swspi2"
                        config RT_SOFT_SPI2_TIMING_DELAY
                            int "Timing delay (us)"
                            range 0 32767
                            default 1
                    endif
                config RT_SOFT_SPI3_HAS_PIN_DEFAULT
                    bool

                config RT_SOFT_SPI3_SCK_PIN_DEFAULT
                    int

                config RT_SOFT_SPI3_MISO_PIN_DEFAULT
                    int

                config RT_SOFT_SPI3_MOSI_PIN_DEFAULT
                    int

                config RT_SOFT_SPI3_HAS_BUS_NAME_DEFAULT
                    bool

                config RT_SOFT_SPI3_BUS_NAME_DEFAULT
                    string

                menuconfig RT_USING_SOFT_SPI3
                    bool "Enable software SPI3 Bus (swspi3)"
                    default n
                    if RT_USING_SOFT_SPI3
                        config RT_SOFT_SPI3_SCK_PIN
                            int "SCK pin number"
                            range 0 32767
                            default RT_SOFT_SPI3_SCK_PIN_DEFAULT if RT_SOFT_SPI3_HAS_PIN_DEFAULT
                            default 10
                        config RT_SOFT_SPI3_MISO_PIN
                            int "MISO pin number"
                            range 0 32767
                            default RT_SOFT_SPI3_MISO_PIN_DEFAULT if RT_SOFT_SPI3_HAS_PIN_DEFAULT
                            default 11
                        config RT_SOFT_SPI3_MOSI_PIN
                            int "MOSI pin number"
                            range 0 32767
                            default RT_SOFT_SPI3_MOSI_PIN_DEFAULT if RT_SOFT_SPI3_HAS_PIN_DEFAULT
                            default 12
                        config RT_SOFT_SPI3_BUS_NAME
                            string "Bus name"
                            default RT_SOFT_SPI3_BUS_NAME_DEFAULT if RT_SOFT_SPI3_HAS_BUS_NAME_DEFAULT
                            default "swspi3"
                        config RT_SOFT_SPI3_TIMING_DELAY
                            int "Timing delay (us)"
                            range 0 32767
                            default 1
                    endif
                config RT_SOFT_SPI4_HAS_PIN_DEFAULT
                    bool

                config RT_SOFT_SPI4_SCK_PIN_DEFAULT
                    int

                config RT_SOFT_SPI4_MISO_PIN_DEFAULT
                    int

                config RT_SOFT_SPI4_MOSI_PIN_DEFAULT
                    int

                config RT_SOFT_SPI4_HAS_BUS_NAME_DEFAULT
                    bool

                config RT_SOFT_SPI4_BUS_NAME_DEFAULT
                    string

                menuconfig RT_USING_SOFT_SPI4
                    bool "Enable software SPI4 Bus (swspi4)"
                    default n
                    if RT_USING_SOFT_SPI4
                        config RT_SOFT_SPI4_SCK_PIN
                            int "SCK pin number"
                            range 0 32767
                            default RT_SOFT_SPI4_SCK_PIN_DEFAULT if RT_SOFT_SPI4_HAS_PIN_DEFAULT
                            default 13
                        config RT_SOFT_SPI4_MISO_PIN
                            int "MISO pin number"
                            range 0 32767
                            default RT_SOFT_SPI4_MISO_PIN_DEFAULT if RT_SOFT_SPI4_HAS_PIN_DEFAULT
                            default 14
                        config RT_SOFT_SPI4_MOSI_PIN
                            int "MOSI pin number"
                            range 0 32767
                            default RT_SOFT_SPI4_MOSI_PIN_DEFAULT if RT_SOFT_SPI4_HAS_PIN_DEFAULT
                            default 15
                        config RT_SOFT_SPI4_BUS_NAME
                            string "Bus name"
                            default RT_SOFT_SPI4_BUS_NAME_DEFAULT if RT_SOFT_SPI4_HAS_BUS_NAME_DEFAULT
                            default "swspi4"
                        config RT_SOFT_SPI4_TIMING_DELAY
                            int "Timing delay (us)"
                            range 0 32767
                            default 1
                    endif
                config RT_SOFT_SPI5_HAS_PIN_DEFAULT
                    bool

                config RT_SOFT_SPI5_SCK_PIN_DEFAULT
                    int

                config RT_SOFT_SPI5_MISO_PIN_DEFAULT
                    int

                config RT_SOFT_SPI5_MOSI_PIN_DEFAULT
                    int

                config RT_SOFT_SPI5_HAS_BUS_NAME_DEFAULT
                    bool

                config RT_SOFT_SPI5_BUS_NAME_DEFAULT
                    string

                menuconfig RT_USING_SOFT_SPI5
                    bool "Enable software SPI5 Bus (swspi5)"
                    default n
                    if RT_USING_SOFT_SPI5
                        config RT_SOFT_SPI5_SCK_PIN
                            int "SCK pin number"
                            range 0 32767
                            default RT_SOFT_SPI5_SCK_PIN_DEFAULT if RT_SOFT_SPI5_HAS_PIN_DEFAULT
                            default 16
                        config RT_SOFT_SPI5_MISO_PIN
                            int "MISO pin number"
                            range 0 32767
                            default RT_SOFT_SPI5_MISO_PIN_DEFAULT if RT_SOFT_SPI5_HAS_PIN_DEFAULT
                            default 17
                        config RT_SOFT_SPI5_MOSI_PIN
                            int "MOSI pin number"
                            range 0 32767
                            default RT_SOFT_SPI5_MOSI_PIN_DEFAULT if RT_SOFT_SPI5_HAS_PIN_DEFAULT
                            default 18
                        config RT_SOFT_SPI5_BUS_NAME
                            string "Bus name"
                            default RT_SOFT_SPI5_BUS_NAME_DEFAULT if RT_SOFT_SPI5_HAS_BUS_NAME_DEFAULT
                            default "swspi5"
                        config RT_SOFT_SPI5_TIMING_DELAY
                            int "Timing delay (us)"
                            range 0 32767
                            default 1
                    endif
                config RT_SOFT_SPI6_HAS_PIN_DEFAULT
                    bool

                config RT_SOFT_SPI6_SCK_PIN_DEFAULT
                    int

                config RT_SOFT_SPI6_MISO_PIN_DEFAULT
                    int

                config RT_SOFT_SPI6_MOSI_PIN_DEFAULT
                    int

                config RT_SOFT_SPI6_HAS_BUS_NAME_DEFAULT
                    bool

                config RT_SOFT_SPI6_BUS_NAME_DEFAULT
                    string

                menuconfig RT_USING_SOFT_SPI6
                    bool "Enable software SPI6 Bus (swspi6)"
                    default n
                    if RT_USING_SOFT_SPI6
                        config RT_SOFT_SPI6_SCK_PIN
                            int "SCK pin number"
                            range 0 32767
                            default RT_SOFT_SPI6_SCK_PIN_DEFAULT if RT_SOFT_SPI6_HAS_PIN_DEFAULT
                            default 19
                        config RT_SOFT_SPI6_MISO_PIN
                            int "MISO pin number"
                            range 0 32767
                            default RT_SOFT_SPI6_MISO_PIN_DEFAULT if RT_SOFT_SPI6_HAS_PIN_DEFAULT
                            default 20
                        config RT_SOFT_SPI6_MOSI_PIN
                            int "MOSI pin number"
                            range 0 32767
                            default RT_SOFT_SPI6_MOSI_PIN_DEFAULT if RT_SOFT_SPI6_HAS_PIN_DEFAULT
                            default 21
                        config RT_SOFT_SPI6_BUS_NAME
                            string "Bus name"
                            default RT_SOFT_SPI6_BUS_NAME_DEFAULT if RT_SOFT_SPI6_HAS_BUS_NAME_DEFAULT
                            default "swspi6"
                        config RT_SOFT_SPI6_TIMING_DELAY
                            int "Timing delay (us)"
                            range 0 32767
                            default 1
                    endif
            endif

        config RT_SPI_BITOPS_DEBUG
            bool "Use simulate SPI debug message"
            depends on RT_USING_SOFT_SPI
            default n

        config RT_USING_QSPI
            bool "Enable QSPI mode"
            default n

        config RT_USING_SPI_MSD
            bool "Using SD/TF card driver with spi"
            select RT_USING_DFS
            default n

        config RT_USING_SFUD
            bool "Using Serial Flash Universal Driver"
            default n
            help
                An using JEDEC's SFDP standard serial (SPI) flash universal driver library

            if RT_USING_SFUD
                config RT_SFUD_USING_SFDP
                bool "Using auto probe flash JEDEC SFDP parameter"
                default y

                config RT_SFUD_USING_FLASH_INFO_TABLE
                bool "Using defined supported flash chip information table"
                default y

                config RT_SFUD_USING_QSPI
                bool "Using QSPI mode support"
                select RT_USING_QSPI
                default n

                config RT_SFUD_SPI_MAX_HZ
                int "Default spi maximum speed(HZ)"
                range 0 50000000
                default 50000000
                help
                    Read the JEDEC SFDP command must run at 50 MHz or less,and you also can use rt_spi_configure(); to config spi speed.

                config RT_DEBUG_SFUD
                bool "Show more SFUD debug information"
                default n
            endif

        config RT_USING_ENC28J60
            bool "Using ENC28J60 SPI Ethernet network interface"
            select RT_USING_LWIP
            default n

        config RT_USING_SPI_WIFI
            bool "Using RW009/007 SPI Wi-Fi wireless interface"
            select RT_USING_LWIP
            default n
    endif

if RT_USING_DM && RT_USING_SPI
    osource "$(SOC_DM_SPI_DIR)/Kconfig"
endif