-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathKconfig
613 lines (511 loc) · 12.7 KB
/
Kconfig
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
choice
prompt "AVR MCU selection"
default MCU_T85
config MCU_T25
bool "ATtiny25"
config MCU_T45
bool "ATtiny45"
config MCU_T85
bool "ATtiny85"
endchoice
config F_CPU
int "MCU clock frequency (Hz)"
default 16000000
comment "Feature selection"
config FEAT_ANALOG
bool "Use Analog PCB"
default y
config FEAT_AUXDET
bool "Enable AUX input signal detection"
depends on FEAT_ANALOG
default y
config FEAT_HS_BTN
bool "Enable headset button emulation"
depends on FEAT_ANALOG
select FEAT_AUXDET
default y
config FEAT_BT
bool "Enable Bluetooth module support"
depends on FEAT_ANALOG
default y
config FEAT_BT_RADIO_CONTROLS
bool "Support changing tracks on Bluetooth with radio panel"
depends on FEAT_BT
default y
config FEAT_AUX_RADIO_CONTROLS
bool "Support changing tracks on AUX with radio panel"
depends on FEAT_ANALOG && FEAT_HS_BTN
default y
comment "Protocol settings"
menu "UART config"
config DEBUG
bool "Enable debugging output"
default y
help
Enable printing various debugging messages to the UART port.
Will increase flash memory footprint and may confuse the Bluetooth module.
config UART_RXBUF_SIZE
int "RX buffer size"
default 16
help
RX buffer size to use for UART messages (bytes).
config UART_TXBUF_SIZE
int "TX buffer size"
default 16
help
TX buffer size to use for UART messages (bytes).
comment "Single-wire UART config"
choice
prompt "Port number"
default SWU_PORTB
help
MCU port number for communication.
config SWU_PORTA
bool "Port A"
config SWU_PORTB
bool "Port B"
config SWU_PORTC
bool "Port C"
config SWU_PORTD
bool "Port D"
endchoice
config SWU_PIN
int "Pin number"
range 0 7
default 4
help
Pin number within the port.
config SWU_WAIT_ONE
int "WAIT_ONE value"
range 0 255
default 26
help
Half bit period compare setting. See the [AVR274] application note for calculation of this value. Make sure timer prescaler is set to the intended value.
choice
prompt "Prescaler value"
default SWU_PRESCALER_64
help
Prescaler setting. Must be set according to the baud rate setting.
config SWU_PRESCALER_1
bool "1"
config SWU_PRESCALER_8
bool "8"
config SWU_PRESCALER_64
bool "64"
endchoice
# choice
# prompt "Prescaler control register"
# default SWU_TCCR0B
# help
# Define the timer control register according to the timer used for the UART.
# config SWU_TCCR0B
# bool "TCCR0B"
# endchoice
# choice
# prompt "Timer compare vector"
# default SWU_TIMER0_COMPA
# help
# UART compare interrupt vector.
# config SWU_TIMER0_COMPA
# bool "TIMER0_COMPA_vect"
# endchoice
# choice
# prompt "External interrupt vector"
# default SWU_PCINT0
# help
# UART external interrupt vector. Make sure this is in accordance to the defined UART pin.
# config SWU_PCINT0
# bool "PCINT0_vect"
# endchoice
endmenu
menu "I2C config"
comment "SDA pin"
choice
prompt "I2C SDA port number"
default I2C_SDA_PORTB
help
Port number for I2C SDA line.
config I2C_SDA_PORTA
bool "Port A"
config I2C_SDA_PORTB
bool "Port B"
config I2C_SDA_PORTC
bool "Port C"
config I2C_SDA_PORTD
bool "Port D"
endchoice
config I2C_SDA_PIN
int "I2C SDA pin number"
range 0 7
default 1
help
Pin number within the port.
comment "SCL pin"
choice
prompt "I2C SCL port number"
default I2C_SCL_PORTB
help
Port number for I2C SCL line.
config I2C_SCL_PORTA
bool "Port A"
config I2C_SCL_PORTB
bool "Port B"
config I2C_SCL_PORTC
bool "Port C"
config I2C_SCL_PORTD
bool "Port D"
endchoice
config I2C_SCL_PIN
int "I2C SCL pin number"
range 0 7
default 3
help
Pin number within the port.
endmenu
menu "SPI config"
comment "Options for tinySPI"
choice
prompt "SPI port number"
default SPI_PORTB
help
Port number for all SPI lines.
config SPI_PORTA
bool "Port A"
config SPI_PORTB
bool "Port B"
config SPI_PORTC
bool "Port C"
config SPI_PORTD
bool "Port D"
endchoice
config SPI_SCK_PIN
int "SCK pin number"
range 0 7
default 2
help
Pin number within the port.
config SPI_DO_PIN
int "DO/MOSI pin number"
range 0 7
default 1
help
Pin number within the port.
config SPI_DI_PIN
int "DI/MISO pin number"
range 0 7
default 0
help
Pin number within the port.
endmenu
menu "CAN config"
choice
prompt "Bus speed"
default MCP_125K
config MCP_5K
bool "5 kbps"
depends on !MCP_20M
config MCP_10K
bool "10 kbps"
depends on !MCP_20M
config MCP_20K
bool "20 kbps"
depends on !MCP_20M
config MCP_31K25
bool "31.25 kbps"
depends on MCP_8M
config MCP_33K
bool "33 kbps"
config MCP_40K
bool "40 kbps"
config MCP_50K
bool "50 kbps"
config MCP_80K
bool "80 kbps"
config MCP_83K3
bool "83.3 kbps"
depends on !MCP_8M
config MCP_100K
bool "100 kbps"
config MCP_125K
bool "125 kbps"
config MCP_200K
bool "200 kbps"
config MCP_250K
bool "250 kbps"
config MCP_500K
bool "500 kbps"
config MCP_1000K
bool "1000 kbps"
endchoice
choice
prompt "MCP2515 clock frequency"
default MCP_8M
config MCP_8M
bool "8 MHz"
config MCP_16M
bool "16 MHz"
config MCP_20M
bool "20 MHz"
endchoice
choice
prompt "MCP2515 CS port number"
default MCP_CS_PORTB
help
Port number for MCP2515 chip select.
config MCP_CS_PORTA
bool "Port A"
config MCP_CS_PORTB
bool "Port B"
config MCP_CS_PORTC
bool "Port C"
config MCP_CS_PORTD
bool "Port D"
endchoice
config MCP_CS_PIN
int "MCP2515 CS pin number"
range 0 7
default 3
help
Pin number within the port.
endmenu
comment "Feature settings"
menu "GPIO config"
comment "PCF8574 options"
config PCF_SCAN
bool "Auto scan for PCF8574 on I2C bus"
help
Auto scan the I2C bus to detect whether the I/O expander is a PCF8574 or a PCF8574A.
Will increase flash memory footprint.
config PCF_ADDR
hex "PCF8574 address on I2C bus"
depends on !PCF_SCAN
default 0x22
comment "Pin assignments"
config PIN_LED_RED
int "Red LED pin"
default 6
help
LED for signalling ignition and radio status.
config PIN_LED_GREEN
int "Green LED pin"
default 5
help
LED for signalling audio signal playback status.
config PIN_LED_BLUE
int "Blue LED pin"
default 4
help
LED for signalling Bluetooth connection/playback status.
config PIN_ANALOG_PWR
int "Analog PCB power pin"
depends on FEAT_ANALOG
default 0
config PIN_AUXDET
int "Audio signal detection pin"
depends on FEAT_AUXDET
default 1
config PIN_BTN1
int "Headset button 1 pin"
depends on FEAT_HS_BTN
default 3
config PIN_BTN2
int "Headset button 2 pin"
depends on FEAT_HS_BTN
default 7
endmenu
menu "Bluetooth module AT commands"
depends on FEAT_BT
comment "AT commands"
config BT_AT_PAIR_ON
string "Enter pairing mode"
default "AT+CA"
config BT_AT_PAIR_OFF
string "Exit pairing mode"
default "AT+CB"
config BT_AT_CONNECT
string "Connect to last remembered device"
default "AT+CC"
config BT_AT_DISCONNECT
string "Disconnect"
default "AT+CD"
config BT_AT_SHUTDOWN
string "Shutdown"
default "AT+CP"
config BT_AT_PLAY
string "Play/pause music playback"
default "AT+MA"
config BT_AT_STOP
string "Stop music playback"
default "AT+MC"
config BT_AT_NEXT
string "Play next track"
default "AT+MD"
config BT_AT_PREV
string "Play previous track"
default "AT+ME"
config BT_AT_FF
string "Seek forward"
default "AT+MF"
config BT_AT_REW
string "Seek backward"
default "AT+MH"
config BT_AT_CONN_STATUS
string "Read connection status"
default "AT+MO"
config BT_AT_PLAY_STATUS
string "Read playback status"
default "AT+MV"
comment "Response commands"
config BT_AT_CONN_START
string "Event: connection started"
default "II"
config BT_AT_CONN_END
string "Event: connection ended"
default "IA"
config BT_AT_PLAY_START
string "Event: playback started"
default "MB"
config BT_AT_PLAY_END
string "Event: playback ended"
default "MA"
config BT_AT_CONN_YES
string "Status: connection established"
default "C1"
config BT_AT_CONN_NO
string "Status: no connection"
default "C0"
config BT_AT_PLAY_YES
string "Status: playback"
default "MB"
config BT_AT_PLAY_NO
string "Status: no playback, connected"
default "MA"
config BT_AT_PLAY_DISCONN
string "Status: no playback, disconnected"
default "M0"
endmenu
menu "Events & actions"
depends on FEAT_ANALOG
comment "BSI Ignition enabled"
config BSI_ON_ANALOG_PWR
bool "Power on Analog PCB"
select RADIO_ON_ANALOG_PWR
config BSI_ON_BT_PAIRING
bool "Enable pairing mode"
depends on FEAT_BT && BSI_ON_ANALOG_PWR
config BSI_ON_BT_CONNECT
bool "Connect to last Bluetooth device"
depends on FEAT_BT && BSI_ON_ANALOG_PWR
comment "Radio enabled"
config RADIO_ON_ANALOG_PWR
bool "Power on Analog PCB"
select RADIO_PLAY_ANALOG_PWR
config RADIO_ON_BT_PAIRING
bool "Enable pairing mode"
depends on FEAT_BT && (BSI_ON_ANALOG_PWR || RADIO_ON_ANALOG_PWR)
config RADIO_ON_BT_CONNECT
bool "Connect to last Bluetooth device"
depends on FEAT_BT && (BSI_ON_ANALOG_PWR || RADIO_ON_ANALOG_PWR) && !BSI_ON_BT_CONNECT
# config RADIO_ON_BT_PLAY
# bool "Play Bluetooth music (if connected)"
# depends on FEAT_BT && (BSI_ON_ANALOG_PWR || RADIO_ON_ANALOG_PWR)
config RADIO_ON_AUX_PLAY
bool "Play AUX music"
depends on (BSI_ON_ANALOG_PWR || RADIO_ON_ANALOG_PWR) && FEAT_HS_BTN
comment "Radio playing (source changed to CDC)"
config RADIO_PLAY_ANALOG_PWR
bool "Power on Analog PCB"
config RADIO_PLAY_BT_PAIRING
bool "Enable pairing mode"
depends on FEAT_BT && (BSI_ON_ANALOG_PWR || RADIO_ON_ANALOG_PWR || RADIO_PLAY_ANALOG_PWR)
config RADIO_PLAY_BT_CONNECT
bool "Connect to last Bluetooth device"
depends on FEAT_BT && (BSI_ON_ANALOG_PWR || RADIO_ON_ANALOG_PWR || RADIO_PLAY_ANALOG_PWR) && !BSI_ON_BT_CONNECT && !RADIO_ON_BT_CONNECT
# config RADIO_PLAY_BT_PLAY
# bool "Play Bluetooth music (if connected)"
# depends on FEAT_BT && (BSI_ON_ANALOG_PWR || RADIO_ON_ANALOG_PWR || RADIO_PLAY_ANALOG_PWR)
config RADIO_PLAY_AUX_PLAY
bool "Play AUX music"
depends on (BSI_ON_ANALOG_PWR || RADIO_ON_ANALOG_PWR || RADIO_PLAY_ANALOG_PWR) && FEAT_HS_BTN
comment "Bluetooth device connected"
config BT_CONN_RADIO_EN_PLAY
bool "Play music if radio enabled"
depends on FEAT_BT
config BT_CONN_RADIO_SRC_PLAY
bool "Play music if radio playing"
depends on FEAT_BT
comment "Bluetooth device disconnected"
config BT_DISCONN_PAIRING
bool "Enable pairing mode"
depends on FEAT_BT
comment "Bluetooth music playing"
config BT_PLAY_AUX_PAUSE
bool "Pause AUX music"
depends on FEAT_BT && FEAT_HS_BTN
comment "AUX music playing"
config AUX_PLAY_BT_PAUSE
bool "Pause Bluetooth music"
depends on FEAT_BT && FEAT_AUXDET
comment "Radio paused (source changed to FM/CD)"
config RADIO_PAUSE_BT_PAUSE
bool "Pause Bluetooth music"
depends on FEAT_BT
config RADIO_PAUSE_AUX_PAUSE
bool "Pause AUX music"
depends on FEAT_HS_BTN
config RADIO_PAUSE_BT_DISCONNECT
bool "Disconnect Bluetooth device"
depends on FEAT_BT
config RADIO_PAUSE_BT_PAIRING_OFF
bool "Disable pairing mode"
depends on FEAT_BT
config RADIO_PAUSE_ANALOG_PWR
bool "Power off Analog PCB"
select RADIO_OFF_ANALOG_PWR
comment "Radio disabled"
config RADIO_OFF_BT_PAUSE
bool "Pause Bluetooth music"
depends on FEAT_BT
config RADIO_OFF_AUX_PAUSE
bool "Pause AUX music"
depends on FEAT_HS_BTN
config RADIO_OFF_BT_DISCONNECT
bool "Disconnect Bluetooth device"
depends on FEAT_BT
config RADIO_OFF_BT_PAIRING_OFF
bool "Disable pairing mode"
depends on FEAT_BT
config RADIO_OFF_ANALOG_PWR
bool "Power off Analog PCB"
select BSI_OFF_ANALOG_PWR
comment "BSI Ignition disabled"
config BSI_OFF_ANALOG_PWR
bool "Power off Analog PCB"
endmenu
comment "Bluetooth connection (intervals in seconds; 0 to disable)"
config BT_POLL_CONN_STATE
int "Connection state polling interval"
default 10
config BT_POLL_PLAY_STATE
int "Playback state polling interval"
default 10
config BT_RECONNECT_INTERVAL
int "Automatic reconnection interval"
default 20
config BT_RECONNECT_AUX_WAIT
int "Wait for Bluetooth reconnection when using AUX"
depends on FEAT_BT && FEAT_AUXDET && (BSI_ON_BT_CONNECT || RADIO_ON_BT_CONNECT || RADIO_PLAY_BT_CONNECT)
default 10
help
When playing music on AUX, delay automatic Bluetooth reconnection.
If disabled, even a 1-second silence in AUX input can cause a BT reconnection attempt, which
will probably play "pairing mode" sound, which may be undesired.
comment "Miscellaneous options"
config GPIO_TICK_MS
int "Headset emulation & AUX detection base interval (ms)"
depends on FEAT_AUXDET || FEAT_HS_BTN
default 200
help
Base interval for a GPIO tick.
Headset buttons will be pressed for this period.
AUX signal detection will be performed every 5th tick.