tests: drivers: adc_dma: add test for nucleo_l476rg

Add test to verify the ADC + DMA functionality works
for the STM32L476 MCU.

Signed-off-by: Hein Wessels <heinwessels93@gmail.com>
This commit is contained in:
Hein Wessels 2023-11-20 14:36:04 +01:00 committed by Carles Cufí
parent a257bcb735
commit 82a6a69b81
3 changed files with 36 additions and 0 deletions

View file

@ -0,0 +1,8 @@
#
# Copyright (c) 2023 Hein Wessels, Nobleo Technology
#
# SPDX-License-Identifier: Apache-2.0
#
CONFIG_ADC_STM32_DMA=y
CONFIG_ADC_ASYNC=y

View file

@ -0,0 +1,17 @@
/*
* Copyright (c) 2023 Hein Wessels, Nobleo Technology
*
* SPDX-License-Identifier: Apache-2.0
*/
&adc1 {
dmas = < &dma1 1 0 (STM32_DMA_PERIPH_RX | STM32_DMA_MEM_16BITS | STM32_DMA_PERIPH_16BITS) >;
dma-names = "dma";
#address-cells = <1>;
#size-cells = <0>;
};
test_dma: &dma1 {
status = "okay";
};

View file

@ -61,6 +61,17 @@
#define ADC_2ND_CHANNEL_ID 7
#define ALIGNMENT 32
#elif defined(CONFIG_BOARD_NUCLEO_L476RG)
#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