Kconfig.projbuild 13 KB

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