Skip to content

Commit

Permalink
tests: Add MAX78000FTHR test overlay files
Browse files Browse the repository at this point in the history
Enable the following tests for MAX78000FTHR:

 - tests/drivers/adc/adc_api
 - tests/drivers/counter/counter_basic_api
 - tests/drivers/dma/chan_blen_transfer
 - tests/drivers/dma/loop_transfer
 - tests/drivers/gpio/gpio_basic_api
 - tests/drivers/pwm/pwm_api
 - tests/drivers/spi/spi_loopback
 - tests/drivers/w1/w1_api

Signed-off-by: Yasin Ustuner <[email protected]>
  • Loading branch information
yasin-ADI committed Jan 15, 2025
1 parent 99143df commit b551ac3
Show file tree
Hide file tree
Showing 10 changed files with 202 additions and 0 deletions.
36 changes: 36 additions & 0 deletions tests/drivers/adc/adc_api/boards/max78000fthr_max78000_m4.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright (c) 2025 Analog Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

/ {
zephyr,user {
/* adjust channel number according to pinmux in board.dts */
io-channels = <&adc 3>, <&adc 4>;
};
};

&adc {
status = "okay";
pinctrl-0 = <&ain3_p2_3 &ain4_p2_4>;
pinctrl-names = "default";
#address-cells = <1>;
#size-cells = <0>;

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

channel@4 {
reg = <4>;
zephyr,gain = "ADC_GAIN_1";
zephyr,reference = "ADC_REF_INTERNAL";
zephyr,acquisition-time = <ADC_ACQ_TIME_DEFAULT>;
zephyr,resolution = <10>;
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* Copyright (c) 2025 Analog Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

&timer0 {
status = "okay";
prescaler = <2>;
counter {
status = "okay";
};
};

&timer1 {
status = "okay";
prescaler = <2>;
counter {
status = "okay";
};
};

&timer2 {
status = "okay";
prescaler = <2>;
counter {
status = "okay";
};
};

&timer3 {
status = "okay";
prescaler = <2>;
counter {
status = "okay";
};
};

&lptimer0 {
status = "okay";
clock-source = <ADI_MAX32_PRPH_CLK_SRC_ERTCO>;
counter {
status = "okay";
};
};

&lptimer1 {
status = "okay";
clock-source = <ADI_MAX32_PRPH_CLK_SRC_INRO>;
counter {
status = "okay";
};
};

&clk_ertco {
status = "okay";
};

&clk_inro {
status = "okay";
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright (c) 2025 Analog Devices, Inc.
# SPDX-License-Identifier: Apache-2.0

CONFIG_CODE_DATA_RELOCATION=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright (c) 2025 Analog Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

tst_dma0: &dma0 { };
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/*
* Copyright (c) 2025 Analog Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

tst_dma0: &dma0 { };
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
* Copyright (c) 2025 Analog Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

/ {
resources {
compatible = "test-gpio-basic-api";
out-gpios = <&gpio1 0 0>;
in-gpios = <&gpio1 1 0>;
};
};
22 changes: 22 additions & 0 deletions tests/drivers/pwm/pwm_api/boards/max78000fthr_max78000_m4.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Copyright (c) 2025 Analog Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

/ {
aliases {
pwm-0 = &pwm0;
};
};

&tmr0a_ioa_p0_2 {
power-source=<MAX32_VSEL_VDDIOH>;
};

&timer0 {
status = "okay";
pwm0: pwm {
status = "okay";
};
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#
# Copyright (c) 2025 Analog Devices, Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
CONFIG_SPI_ASYNC=y
CONFIG_SPI_MAX32_INTERRUPT=y
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright (c) 2025 Analog Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

&spi0 {
dmas = <&dma0 1 MAX78_DMA_SLOT_SPI0_TX>, <&dma0 2 MAX78_DMA_SLOT_SPI0_RX>;
dma-names = "tx", "rx";

slow@0 {
compatible = "test-spi-loopback-slow";
reg = <0>;
spi-max-frequency = <128000>;
};
fast@0 {
compatible = "test-spi-loopback-fast";
reg = <0>;
spi-max-frequency = <400000>;
};
};
24 changes: 24 additions & 0 deletions tests/drivers/w1/w1_api/boards/max78000fthr_max78000_m4.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (c) 2025 Analog Devices, Inc.
*
* SPDX-License-Identifier: Apache-2.0
*/

&owm_io_p0_6 {
power-source=<MAX32_VSEL_VDDIOH>;
};

&owm_pe_p0_7 {
power-source=<MAX32_VSEL_VDDIOH>;
};

w1_0: &w1 {
status = "okay";
pinctrl-0 = <&owm_io_p0_6 &owm_pe_p0_7>;
pinctrl-names = "default";
internal-pullup = <1>;
external-pullup = <0>;
long-line-mode;
};

#include "../w1_devices.dtsi"

0 comments on commit b551ac3

Please sign in to comment.