Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

philipfidjeland
Copy link

No description provided.

@github-actions github-actions bot added the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Jul 31, 2023
@NordicBuilder
Copy link
Contributor

Thank you for your contribution!
It seems you are not a member of the nrfconnect GitHub organization. External contributions are handled as follows:
Large contributions, affecting multiple subsystems for example, may be rejected if they are complex, may introduce regressions due to lack of test coverage, or if they are not consistent with the architecture of nRF Connect SDK.
PRs will be run in our continuous integration (CI) test system.
If CI passes, PRs will be tagged for review and merged on successful completion of review. You may be asked to make some modifications to your contribution during review.
If CI fails, PRs may be rejected or may be tagged for review and rework.
PRs that become outdated due to other changes in the repository may be rejected or rework requested.
External contributions will be prioritized for review based on the relevance to current development efforts in nRF Connect SDK. Bug fix PRs will be prioritized.
You may raise issues or ask for help from our Technical Support team by visiting https://devzone.nordicsemi.com/.

Note: This comment is automatically posted and updated by the Contribs GitHub Action.

@NordicBuilder NordicBuilder added the external External contribution label Jul 31, 2023
@andvib andvib added the DNM label Jul 31, 2023
@andvib andvib self-requested a review July 31, 2023 08:59
@CLAassistant
Copy link

CLAassistant commented Jul 31, 2023

CLA assistant check
All committers have signed the CLA.

@andvib andvib added the CI-Requested Approves single commit for CI tests on Internal HW label Jul 31, 2023
Copy link
Contributor

@andvib andvib left a 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/CMakeLists.txt Outdated Show resolved Hide resolved
applications/nrf5340_audio/prj.conf Outdated Show resolved Hide resolved
applications/nrf5340_audio/src/main.c Outdated Show resolved Hide resolved
applications/nrf5340_audio/src/modules/CMakeLists.txt Outdated Show resolved Hide resolved
applications/nrf5340_audio/src/modules/display/display.c Outdated Show resolved Hide resolved
applications/nrf5340_audio/src/modules/display/log_tab.c Outdated Show resolved Hide resolved
applications/nrf5340_audio/src/modules/hw_codec.h Outdated Show resolved Hide resolved
boards/shields/nrf5340_audio_display/Kconfig.shield Outdated Show resolved Hide resolved
@koffes koffes self-requested a review July 31, 2023 12:07
@andvib andvib added CI-Requested Approves single commit for CI tests on Internal HW and removed CI-Requested Approves single commit for CI tests on Internal HW labels Jul 31, 2023
@@ -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)
Copy link
Contributor

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?

Copy link
Contributor

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

Copy link
Author

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

Copy link
Contributor

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>
Copy link
Contributor

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();
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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.

Copy link
Contributor

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;
Copy link
Contributor

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.

Copy link
Author

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>;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This value looks strange.

Copy link
Author

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?

Copy link
Author

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)

Copy link
Author

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 {
Copy link
Contributor

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
Copy link
Contributor

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.

Copy link
Contributor

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>
Copy link
Contributor

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.

@github-actions github-actions bot removed the CI-Requested Approves single commit for CI tests on Internal HW label Aug 1, 2023
applications/nrf5340_audio/src/modules/display/log_tab.c Outdated Show resolved Hide resolved
include/pcm_stream_channel_modifier.h Outdated Show resolved Hide resolved
include/pcm_stream_channel_modifier.h Outdated Show resolved Hide resolved
applications/nrf5340_audio/src/modules/display/log_tab.c Outdated Show resolved Hide resolved
@andvib andvib removed the external External contribution label Aug 15, 2023
Copy link
Contributor

@erikrobstad erikrobstad left a 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)
Copy link
Contributor

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

@@ -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"
Copy link
Contributor

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)
Copy link
Contributor

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

Copy link
Author

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
Copy link
Contributor

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

Copy link
Author

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"
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @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.
*/

Copy link
Contributor

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?

Copy link
Author

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?

Copy link
Contributor

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);

/**
Copy link
Contributor

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?

Copy link
Contributor

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,
Copy link
Contributor

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
#
Copy link
Contributor

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>
@andvib andvib requested review from andvib and removed request for andvib September 15, 2023 14:04
Copy link

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.

@github-actions github-actions bot added the Stale label Nov 15, 2023
@koffes
Copy link
Contributor

koffes commented Nov 21, 2023

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.

@koffes koffes closed this Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants