Kconfig.projbuild 13 KB

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