Skip to content

Commit

Permalink
tests: drivers: adc: adc_dma: add nucleo_u575zi_q
Browse files Browse the repository at this point in the history
Add the nucleo_u575zi_q board to the ADC DMA tests.

Signed-off-by: Brett Witherspoon <[email protected]>
  • Loading branch information
bwitherspoon authored and carlescufi committed Jul 11, 2023
1 parent 6d9d44e commit 3bb5062
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/drivers/adc/adc_dma/boards/nucleo_u575zi_q.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#
# Copyright (c) 2023 Brett Witherspoon
#
# SPDX-License-Identifier: Apache-2.0
#

CONFIG_ADC_STM32_DMA=y
CONFIG_ADC_ASYNC=y
26 changes: 26 additions & 0 deletions tests/drivers/adc/adc_dma/boards/nucleo_u575zi_q.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* Copyright (c) 2023 Brett Witherspoon
*
* SPDX-License-Identifier: Apache-2.0
*/

&adc1 {
dmas = <&gpdma1 0 0 (STM32_DMA_PERIPH_TO_MEMORY |
STM32_DMA_MEM_INC | STM32_DMA_MEM_16BITS | STM32_DMA_PERIPH_16BITS) >;
dma-names = "dmamux";

#address-cells = <1>;
#size-cells = <0>;

channel@1 {
reg = <1>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_INTERNAL";
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
zephyr,resolution = <12>;
};
};

test_dma: &gpdma1 {
status = "okay";
};
11 changes: 11 additions & 0 deletions tests/drivers/adc/adc_dma/src/test_adc.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,17 @@
#define ALIGNMENT 32
#define BUFFER_MEM_REGION __attribute__((__section__("SRAM4.dma")))

#elif defined(CONFIG_BOARD_NUCLEO_U575ZI_Q)

#define ADC_DEVICE_NODE DT_INST(0, st_stm32_adc)
#define ADC_RESOLUTION 12
#define ADC_GAIN ADC_GAIN_1
#define ADC_REFERENCE ADC_REF_INTERNAL
#define ADC_ACQUISITION_TIME ADC_ACQ_TIME_DEFAULT
#define ADC_1ST_CHANNEL_ID 1
#define ADC_2ND_CHANNEL_ID 7
#define ALIGNMENT 32

#endif

/* Invalid value that is not supposed to be written by the driver. It is used
Expand Down
1 change: 1 addition & 0 deletions tests/drivers/adc/adc_dma/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ tests:
- frdm_k82f
- frdm_k64f
- nucleo_h743zi
- nucleo_u575zi_q
integration_platforms:
- frdm_k82f

0 comments on commit 3bb5062

Please sign in to comment.