2
0

Kconfig.projbuild 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470
  1. # This is a hack but it overrides some LWIP Kconfig
  2. # parameters because we are first
  3. config LWIP_MAX_SOCKETS
  4. range 1 32
  5. menu "Squeezelite-ESP32"
  6. menu "Logging"
  7. config LOGGING_SLIMPROTO
  8. string "logging level for slimproto"
  9. default "info"
  10. help
  11. Set logging level info|debug|sdebug
  12. config LOGGING_STREAM
  13. string "logging level for stream"
  14. default "info"
  15. help
  16. Set logging level info|debug|sdebug
  17. config LOGGING_DECODE
  18. string "logging level for decode"
  19. default "info"
  20. help
  21. Set logging level info|debug|sdebug
  22. config LOGGING_OUTPUT
  23. string "logging level for output"
  24. default "info"
  25. help
  26. Set logging level info|debug|sdebug
  27. endmenu
  28. config AMP_LOCKED
  29. bool
  30. config JACK_LOCKED
  31. bool
  32. config BAT_LOCKED
  33. bool
  34. config I2C_LOCKED
  35. bool
  36. config SPDIF_LOCKED
  37. bool
  38. config LED_LOCKED
  39. bool
  40. config SPKFAULT_LOCKED
  41. bool
  42. config MUTE_GPIO_LEVEL
  43. int
  44. default 0
  45. config TARGET_LOCKED
  46. bool
  47. default n
  48. menu "Target"
  49. choice OUTPUT_TYPE
  50. prompt "Main system"
  51. default BASIC_I2C_BT
  52. help
  53. Type of hardware platform
  54. config SQUEEZEAMP
  55. bool "SqueezeAMP"
  56. select JACK_LOCKED
  57. select BAT_LOCKED
  58. select I2C_LOCKED
  59. select LED_LOCKED
  60. select SPKFAULT_LOCKED
  61. select TARGET_LOCKED
  62. config MUSE
  63. bool "Muse"
  64. select JACK_LOCKED
  65. select BAT_LOCKED
  66. select I2C_LOCKED
  67. select AMP_LOCKED
  68. select TARGET_LOCKED
  69. config BASIC_I2C_BT
  70. bool "Generic I2S & Bluetooth"
  71. config TWATCH2020
  72. bool "T-WATCH2020 by LilyGo"
  73. select I2C_LOCKED
  74. select TARGET_LOCKED
  75. endchoice
  76. config WITH_CONFIG_UI
  77. bool "Enable config UI"
  78. default n
  79. help
  80. Enable configuring system options with the UI
  81. config WITH_METRICS
  82. bool "Enable Metrics"
  83. default n
  84. help
  85. Enable capturing and reporting anonymous metrics
  86. config RELEASE_API
  87. string "Software update URL"
  88. default "https://api.github.com/repos/sle118/squeezelite-esp32/releases"
  89. help
  90. Set the URL of the API that the front-end UI will use to fetch software updates
  91. config SQUEEZELITE_ESP32_RELEASE_URL
  92. string "Release URL"
  93. default "https://github.com/sle118/squeezelite-esp32/releases"
  94. help
  95. Set the URL where users can see a list of releases
  96. # you can't change default values once they are set so changing "Target" will not reset
  97. # project name if they are visible config - they have to be silent strings
  98. config PROJECT_NAME
  99. string
  100. default "SqueezeAMP" if SQUEEZEAMP
  101. default "Squeezelite-TWATCH" if TWATCH2020
  102. default "Muse" if MUSE
  103. default "Squeezelite-ESP32"
  104. config FW_PLATFORM_NAME
  105. string
  106. default "SqueezeAmp" if SQUEEZEAMP
  107. default "TWATCH" if TWATCH2020
  108. default "Muse" if MUSE
  109. default "ESP32"
  110. # AGGREGATES - begin
  111. # these parameters are "aggregates" that take precedence. They must have a default value
  112. config DAC_CONFIG
  113. string
  114. default "model=TAS57xx,bck=33,ws=25,do=32,sda=27,scl=26,mute=14:0" if SQUEEZEAMP
  115. default "model=I2S,bck=26,ws=25,do=33,i2c=53,sda=21,scl=22" if TWATCH2020
  116. default "model=I2S,bck=5,ws=25,do=26,di=35,i2c=16,sda=18,scl=23,mck" if MUSE
  117. default ""
  118. config SPDIF_CONFIG
  119. string
  120. default "bck=33,ws=25,do=15" if SQUEEZEAMP
  121. default ""
  122. config GPIO_EXP_CONFIG
  123. string
  124. default ""
  125. config SPI_CONFIG
  126. string
  127. default "dc=27,data=19,clk=18" if TWATCH2020
  128. default "mosi=15,miso=2,clk=14" if MUSE
  129. default ""
  130. config DISPLAY_CONFIG
  131. string
  132. default "SPI,driver=ST7789,width=240,height=240,cs=5,back=12,speed=16000000,HFlip,VFlip" if TWATCH2020
  133. default ""
  134. config ETH_CONFIG
  135. string
  136. default ""
  137. # AGGREGATES - end
  138. config DAC_CONTROLSET
  139. string
  140. default "{ \"init\": [ {\"reg\":41, \"val\":128}, {\"reg\":18, \"val\":255} ], \"poweron\": [ {\"reg\":18, \"val\":64, \"mode\":\"or\"} ], \"poweroff\": [ {\"reg\":18, \"val\":191, \"mode\":\"and\"} ] }" if TWATCH2020
  141. default "{\"init\":[ {\"reg\":0,\"val\":128}, {\"reg\":0,\"val\":0}, {\"reg\":25,\"val\":4}, {\"reg\":1,\"val\":80}, {\"reg\":2,\"val\":0}, {\"reg\":8,\"val\":0}, {\"reg\":4,\"val\":192}, {\"reg\":0,\"val\":18}, {\"reg\":1,\"val\":0}, {\"reg\":23,\"val\":24}, {\"reg\":24,\"val\":2}, {\"reg\":38,\"val\":9}, {\"reg\":39,\"val\":144}, {\"reg\":42,\"val\":144}, {\"reg\":43,\"val\":128}, {\"reg\":45,\"val\":128}, {\"reg\":27,\"val\":0}, {\"reg\":26,\"val\":0}, {\"reg\":2,\"val\":240}, {\"reg\":2,\"val\":0}, {\"reg\":29,\"val\":28}, {\"reg\":4,\"val\":48}, {\"reg\":25,\"val\":0}, {\"reg\":46,\"val\":33}, {\"reg\":47,\"val\":33} ]}" if MUSE
  142. default ""
  143. config AUDIO_CONTROLS
  144. string
  145. default "[{\"gpio\":32, \"pull\":true, \"long_press\":1000, \"normal\":{\"pressed\":\"ACTRLS_VOLDOWN\"}, \"longpress\":{\"pressed\":\"ACTRLS_PREV\"}}, {\"gpio\":19, \"pull\":true, \"long_press\":1000, \"normal\":{\"pressed\":\"ACTRLS_VOLUP\"}, \"longpress\":{\"pressed\":\"ACTRLS_NEXT\"}}, {\"gpio\":12, \"pull\":true, \"long_press\":1000, \"normal\":{\"pressed\":\"ACTRLS_TOGGLE\"},\"longpress\":{\"pressed\":\"ACTRLS_POWER\"}}]" if MUSE
  146. default ""
  147. config BAT_CONFIG
  148. string
  149. default "channel=7,scale=20.24,atten=0" if SQUEEZEAMP
  150. default "channel=5,scale=7.00,atten=3,cells=1" if MUSE
  151. default ""
  152. config TARGET
  153. string
  154. default "muse" if MUSE
  155. default ""
  156. config AMP_GPIO
  157. int
  158. default 21 if MUSE
  159. default -1
  160. config POWER_GPIO
  161. int
  162. default -1
  163. config JACK_GPIO
  164. int
  165. default 34 if SQUEEZEAMP || MUSE
  166. default -1
  167. config SPKFAULT_GPIO
  168. int
  169. default 2 if SQUEEZEAMP
  170. default -1
  171. config BAT_CHANNEL
  172. int
  173. default 7 if SQUEEZEAMP
  174. default -1
  175. config LED_GREEN_GPIO
  176. int
  177. default 12 if SQUEEZEAMP
  178. default -1
  179. config LED_RED_GPIO
  180. int
  181. default 13 if SQUEEZEAMP
  182. default -1
  183. config SET_GPIO
  184. string
  185. default "0=ir" if SQUEEZEAMP
  186. default "" if TWATCH2020
  187. endmenu
  188. menu "Audio settings"
  189. menu "DAC settings"
  190. visible if BASIC_I2C_BT
  191. menu "I2S settings"
  192. config I2S_NUM
  193. int "I2S channel (0 or 1)"
  194. default 0
  195. help
  196. I2S dma channel to use.
  197. config I2S_BCK_IO
  198. int "I2S Bit clock GPIO number"
  199. default -1
  200. help
  201. I2S Bit Clock gpio pin to use.
  202. config I2S_WS_IO
  203. int "I2S Word Select GPIO number"
  204. default -1
  205. help
  206. I2S Word Select gpio pin to use.
  207. config I2S_DO_IO
  208. int "I2S Data Output GPIO number"
  209. default -1
  210. help
  211. I2S data output gpio pin to use.
  212. config I2S_DI_IO
  213. int "I2S Data Input GPIO number"
  214. default -1
  215. help
  216. I2S data input gpio pin to use (not used mostly, leave it to -1).
  217. config I2S_MCK_IO
  218. int "I2S Master Clock GPIO number"
  219. default -1
  220. help
  221. I2S data output gpio pin to use (not used mostly, leave it to -1).
  222. endmenu
  223. menu "I2C settings"
  224. config I2C_SDA
  225. int "I2C SDA GPIO number for DAC control"
  226. default -1
  227. help
  228. I2C data gpio pin to use with DAC (not used mostly, leave it to -1).
  229. config I2C_SCL
  230. int "I2C SCL GPIO number for DAC control"
  231. default -1
  232. help
  233. I2C clock gpio pin to use with DAC (not used mostly, leave it to -1).
  234. endmenu
  235. config MUTE_GPIO
  236. int "GPIO for muting DAC"
  237. default -1
  238. help
  239. GPIO used to mute DAC (not used mostly, leave it to -1).
  240. config MUTE_GPIO_LEVEL
  241. int "Mute GPIO active level"
  242. depends on MUTE_GPIO != -1
  243. default 1
  244. endmenu
  245. menu "SPDIF settings"
  246. visible if BASIC_I2C_BT
  247. config SDIF_NUM
  248. int "I2S channel for SDPIF (0 or 1)"
  249. default 0
  250. help
  251. I2S dma channel to use.
  252. config SPDIF_BCK_IO
  253. int "SDPIF Bit clock GPIO number"
  254. default I2S_BCK_IO
  255. help
  256. Must be set as SPDIF re-uses I2S but only needs DO (recommendation: set it to I2S Bit clock value)
  257. config SPDIF_WS_IO
  258. int "SPDIF Word Select GPIO number"
  259. default I2S_WS_IO
  260. help
  261. Must be set as SPDIF re-uses I2S but only needs DO (recommendation: set it to I2S Word select value)
  262. config SPDIF_DO_IO
  263. int "SPDIF Data I/O GPIO number"
  264. default -1
  265. help
  266. I2S data output IO use to simulate SPDIF
  267. endmenu
  268. menu "A2DP settings"
  269. config A2DP_SINK_NAME
  270. string "Name of Bluetooth A2DP device"
  271. default "SMSL BT4.2"
  272. help
  273. This is the name of the bluetooth speaker that Squeezelite will try connecting to.
  274. config A2DP_DEV_NAME
  275. string "Name of Squeezelite device to use when connecting to A2DP device"
  276. default "Squeezelite"
  277. help
  278. This is the name of the device that the Bluetooth speaker will see when it is connected to.
  279. config A2DP_CONTROL_DELAY_MS
  280. int "Control loop delay"
  281. default 500
  282. help
  283. Decreasing this will lead to a more responsive BT control, but might lead to noisy log files if debug is enabled.
  284. config A2DP_CONNECT_TIMEOUT_MS
  285. int "Time out duration when trying to connect to an A2DP audio sink"
  286. default 1000
  287. help
  288. Increasing this value will give more chance for less stable connections to be established.
  289. endmenu
  290. endmenu
  291. menu "Audio Input"
  292. config BT_SINK
  293. bool "Bluetooth receiver"
  294. default y
  295. help
  296. Enable bluetooth sink (Note that you obviously can't at the same time be a Bluetooth receiver and transmitter)
  297. config BT_NAME
  298. depends on BT_SINK
  299. string "Name of Bluetooth A2DP device"
  300. default "ESP32-BT"
  301. help
  302. This is the name of the bluetooth speaker that will be broadcasted
  303. config BT_SINK_PIN
  304. depends on BT_SINK
  305. int "Bluetooth PIN code"
  306. default 1234
  307. config AIRPLAY_SINK
  308. bool "AirPlay receiver"
  309. default y
  310. config AIRPLAY_NAME
  311. depends on AIRPLAY_SINK
  312. string "Name of AirPlay device"
  313. default "ESP32-AirPlay"
  314. help
  315. This is the name of the AirPlay speaker that will be broadcasted
  316. config AIRPLAY_PORT
  317. depends on AIRPLAY_SINK
  318. string "AirPlay listening port"
  319. default "5000"
  320. help
  321. AirPlay service listening port
  322. config CSPOT_SINK
  323. bool "Spotify (cspot) receiver"
  324. default y
  325. help
  326. Enable Spotify connect using CSpot
  327. endmenu
  328. menu "Controls"
  329. depends on !MUSE
  330. config AUDIO_CONTROLS
  331. string "Audio buttons set (JSON)"
  332. help
  333. Configuration of buttons (see README for syntax)
  334. endmenu
  335. menu "Display Screen"
  336. depends on !TWATCH2020
  337. config DISPLAY_CONFIG
  338. string "Screen configuraton"
  339. help
  340. Set parameters for display screen, leave empty for no screen
  341. I2C,driver=<model>,width=<pixels>,height=<pixels>[address=<i2c_address>][,HFlip][,VFlip][,rotate]
  342. SPI,driver=<model>,width=<pixels>,height=<pixels>,cs=<gpio>[,HFlip][,VFlip][,rotate]
  343. endmenu
  344. menu "Various I/O"
  345. visible if !TWATCH2020
  346. config I2C_CONFIG
  347. string "I2C system configuration"
  348. default ""
  349. help
  350. Set parameters of shared I2C interface
  351. sda=<gpio>,scl=<gpio>[,speed=<num>][,port=<0|1>]
  352. config SPI_CONFIG
  353. string "SPI system configuration"
  354. help
  355. Set parameters of shared SPI interface
  356. data=<gpio>,clk=<gpio>[,d/c=<num>][,host=<0|1|2>]
  357. config SET_GPIO
  358. string "Special GPIO configuration"
  359. help
  360. Set parameters of shared GPIO with special values.
  361. <gpio_1>=Vcc|GND|amp[:0|1]|jack[:0|1][ir][spkfault[:0|1][,<gpio_n>=Vcc|GND|amp[:0|1]|jack[:0|1]]
  362. 'amp' => GPIO that is set when playback starts
  363. 'jack' => GPIO used for audio jack detection
  364. 'green', 'red' => GPIO for status LED
  365. 'spkfault' => GPIO used for speaker fault detection
  366. 'ir' => GPIO used for Infrared Receiver
  367. [:0|1] means set the active value for that GPIO can be low or high
  368. config ROTARY_ENCODER
  369. string "Rotary Encoder configuration"
  370. default ""
  371. help
  372. Set GPIO for rotary encoder (quadrature phase). See README on SqueezeESP32 project's GitHub for more details
  373. A=<gpio>,B=<gpio>[,SW=gpio>[[,knobonly[=<ms>]|[,volume][,longpress]]
  374. config GPIO_EXP_CONFIG
  375. string "GPIO expander configuration"
  376. help
  377. Set parameters of GPIO extender
  378. model=<model>[,addr=<addr>][,base=<100..N>][,count=<0..32>][,intr=<gpio>][,port=dac|system]
  379. endmenu
  380. menu "LED configuration"
  381. visible if !SQUEEZEAMP && !TWATCH2020 && !MUSE
  382. config LED_GREEN_GPIO
  383. int "Green led GPIO"
  384. help
  385. Set to -1 for no LED
  386. config LED_GREEN_GPIO_LEVEL
  387. int "Green led ON level"
  388. depends on LED_GREEN_GPIO != -1
  389. config LED_RED_GPIO
  390. int "Red led GPIO"
  391. help
  392. Set to -1 for no LED
  393. config LED_RED_GPIO_LEVEL
  394. int "Red led ON level"
  395. depends on LED_RED_GPIO != -1
  396. default 0 if SQUEEZEAMP
  397. default 1
  398. endmenu
  399. menu "Audio JACK"
  400. visible if !TARGET_LOCKED
  401. config JACK_GPIO
  402. int "Jack insertion GPIO"
  403. help
  404. GPIO to detect speaker jack insertion. Set to -1 for no detection.
  405. config JACK_GPIO_LEVEL
  406. depends on JACK_GPIO != -1
  407. int "Level when inserted (0/1)"
  408. default 0
  409. endmenu
  410. menu "External amplifier control"
  411. visible if !AMP_LOCKED
  412. config AMP_GPIO
  413. int "Amplifier GPIO"
  414. help
  415. GPIO to switch on/off external amplifier. Set to -1 for no amplifier.
  416. config AMP_GPIO_LEVEL
  417. depends on AMP_GPIO != -1
  418. int "Active level(0/1)"
  419. default 1
  420. endmenu
  421. menu "Power on/off status"
  422. config POWER_GPIO
  423. int "Power on/off GPIO"
  424. help
  425. GPIO that is switched when LMS turns player one. Set to -1 to disable
  426. config POWER_GPIO_LEVEL
  427. depends on POWER_GPIO != -1
  428. int "Active level(0/1)"
  429. default 1
  430. endmenu
  431. menu "Speaker Fault"
  432. visible if !TARGET_LOCKED
  433. config SPKFAULT_GPIO
  434. int "Speaker fault GPIO"
  435. help
  436. GPIO to detect speaker fault condition. Set to -1 for no detection.
  437. config SPKFAULT_GPIO_LEVEL
  438. depends on SPKFAULT_GPIO != -1
  439. int "Level when fault (0/1)"
  440. default 0
  441. endmenu
  442. menu "Battery measure"
  443. visible if !TARGET_LOCKED
  444. config BAT_CONFIG
  445. string "Battery acquisition configuration"
  446. help
  447. Sets parameters for battery voltage measure
  448. channel=<0..7>,scale=<ratio_to_4096>,atten=<adc_atten>,cells=<1..3>
  449. endmenu
  450. config DEFAULT_COMMAND_LINE
  451. string "Default command line to execute"
  452. default "squeezelite -o I2S -b 500:2000 -d all=info -C 30"
  453. help
  454. This is the command to run when starting the device
  455. endmenu