-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Boards:shield:added nrf5340 audio display #11909
Conversation
Thank you for your contribution! Note: This comment is automatically posted and updated by the Contribs GitHub Action. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First read through, focused on structure changes
applications/nrf5340_audio/tools/buildprog/nrf5340_audio_dk_devices.json
Outdated
Show resolved
Hide resolved
@@ -8,6 +8,9 @@ cmake_minimum_required(VERSION 3.20.0) | |||
|
|||
file(TO_CMAKE_PATH $ENV{ZEPHYR_BASE} CMAKE_STYLE_ZEPHYR) | |||
|
|||
|
|||
set(SHIELD nrf5340_audio_display) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be added even if the display is not present?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess 'if (NRF5340_AUDIO_DK_DISPLAY)' can be used here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if NRF5340_AUDIO_DK_DISPLAY, in cmake is set to late if the config is not set as a west build flag. So i have just baked the shield and kconfig in a "--display" flag in buildprog.py
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build strategy is now that the user must set both the shield and NRF5340_AUDIO_DK_DISPLAY
@@ -25,6 +25,7 @@ | |||
#include "audio_system.h" | |||
#include "channel_assignment.h" | |||
#include "streamctrl.h" | |||
#include <display/display.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Display is a very generic name. Let me read through the PR and see if I have another suggestion.
@@ -168,6 +169,11 @@ int main(void) | |||
{ | |||
int ret; | |||
|
|||
if (IS_ENABLED(CONFIG_DISPLAY)) { | |||
ret = display_init(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the display is configured as a driver: Can the display_init()
be run there instead of main?
|
||
menu "Display" | ||
|
||
config DISPLAY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would move all the display related KConfigs into the display folder.
|
||
config DISPLAY | ||
bool "True if using adafruit display" | ||
default n |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the project is compiled with the display shield, this should be set automatically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build strategy is now that the user must set both the shield and NRF5340_AUDIO_DK_DISPLAY
@@ -32,6 +32,10 @@ static cs47l63_t cs47l63_driver; | |||
|
|||
/**@brief Write to multiple registers in CS47L63 | |||
*/ | |||
uint32_t hw_codec_volume_get() | |||
{ | |||
return prev_volume_reg_val; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to look into this, but the only way to "properly" get the volume is to read it from the HW codec itself. Discuss, and see if we have another option using VCS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess this value will also be available on zbus when the "mothership" PR is merged?
|
||
ili9340: ili9340@2 { | ||
compatible = "ilitek,ili9340"; | ||
spi-max-frequency = <15151515>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This value looks strange.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Iknow, But it is the only value that seems to work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correction, done some more testing and it works for values under 17000000 (unless they are very small)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Made this value 150000. This is the highest round number the screen seems to tolerate
ngamctrl = [ 00 0e 14 03 11 07 31 c1 48 08 0f 0c 31 36 0f ]; | ||
}; | ||
|
||
adafruit_2_8_tft_touch_v2_sdhc: sdhc@3 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is likely best to just disable the SD slot here all together.
@@ -0,0 +1,64 @@ | |||
/* | |||
* Copyright (c) 2019 PHYTEC Messtechnik GmbH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need all of this for the overlay? It should be enough to define some pins, SPI speed etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of the numbers for the screen are a bit magic, even after reading the documentation. They're copied directly from the Zephyr generic overlay, and changing some of them causes the screen to not work, and others just changes the color scheme. Philip did testing for all of them and concluded they were necessary.
@@ -10,8 +10,10 @@ | |||
#include <errno.h> | |||
|
|||
#include <zephyr/logging/log.h> | |||
#include <stdlib.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should IMO be no changes to this file. We need to look for another place to put this functionality. This is a NCS global file and should only do the exact thing it says in the doc an nothing more. Unit tests are also required for changes here.
applications/nrf5340_audio/src/modules/display/Kconfig.defaults
Outdated
Show resolved
Hide resolved
applications/nrf5340_audio/src/modules/display/nrf5340_audio_dk_display.c
Outdated
Show resolved
Hide resolved
applications/nrf5340_audio/src/modules/display/nrf5340_audio_dk_display.c
Outdated
Show resolved
Hide resolved
applications/nrf5340_audio/src/modules/display/nrf5340_audio_dk_display.c
Outdated
Show resolved
Hide resolved
applications/nrf5340_audio/src/modules/display/nrf5340_audio_dk_display.c
Outdated
Show resolved
Hide resolved
f6d0223
to
7948499
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not looked closely at the logic in the .c files yet, and I have not looked at the board files
@@ -8,6 +8,9 @@ cmake_minimum_required(VERSION 3.20.0) | |||
|
|||
file(TO_CMAKE_PATH $ENV{ZEPHYR_BASE} CMAKE_STYLE_ZEPHYR) | |||
|
|||
|
|||
set(SHIELD nrf5340_audio_display) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess 'if (NRF5340_AUDIO_DK_DISPLAY)' can be used here
applications/nrf5340_audio/Kconfig
Outdated
@@ -40,6 +40,7 @@ rsource "src/drivers/Kconfig" | |||
rsource "src/modules/Kconfig" | |||
rsource "src/utils/Kconfig" | |||
rsource "dfu/conf/Kconfig.dfu" | |||
rsource "src/modules/display/Kconfig" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be removed, since it is added in src/modules/Kconfig
@@ -14,3 +14,17 @@ target_sources(app PRIVATE | |||
${CMAKE_CURRENT_SOURCE_DIR}/power_meas.c | |||
${CMAKE_CURRENT_SOURCE_DIR}/sd_card.c | |||
) | |||
|
|||
if (CONFIG_AUDIO_DFU_ENABLE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR should not add any DFU related code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dont think it does, Just a whitespace that has sneaked in...
|
||
if (CONFIG_DISPLAY) | ||
target_sources(app PRIVATE | ||
${CMAKE_CURRENT_SOURCE_DIR}/display/nrf5340_audio_dk_display.c |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is cleaner to add a CMakeLists.txt in the display folder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, is now implemented!
@@ -5,13 +5,13 @@ | |||
# | |||
|
|||
rsource "Kconfig.defaults" | |||
|
|||
rsource "display/Kconfig" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add back the newline
*/ | ||
void tab_menu_create(lv_obj_t *current_screen); | ||
/** | ||
* @brief Updates all objects on the button tab |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @brief Updates all objects on the button tab | |
* @brief Update all objects on the button tab |
@@ -123,6 +123,7 @@ static void volume_msg_sub_thread(void) | |||
/** | |||
* @brief Write to multiple registers in CS47L63. | |||
*/ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No changes to this file should be done in this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will leave this up to Andreas. This might now be possible to get as a zbus message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replied to this on the comment in the header file
@@ -21,6 +21,16 @@ | |||
*/ | |||
int hw_codec_volume_set(uint8_t set_val); | |||
|
|||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No changes to this file should be done in this PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been discussed around the office, and while this value is probably at this point, it has been agreed that a get
function here is a fair addition to the hw_coded
module
@@ -1,16 +1,16 @@ | |||
[ | |||
{ | |||
"nrf5340_audio_dk_snr": 1000, | |||
"nrf5340_audio_dk_snr": 1050133518, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the changes in this file
# Copyright (c) 2023 Nordic Semiconductor ASA | ||
# | ||
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Newline after license
Adds the nrf5340_audio_dk_display module for the audio application. This module uses the LVGL library to present information from the application to the user using an Adafruit touch display. A shield definition is added so that the Adafruit display shield can be used with the nrf5340 Audio DK. Signed-off-by: Philip Fidjeland <philipfidjeland@gmail.com> Signed-off-by: Andreas Vibeto <andreas.vibeto@nordicsemi.no>
This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time. |
I have picked some of this code into other branches. At present time we need to focus on other areas, so as it stands, I will close this PR for now. |
No description provided.