Skip to content

Commit

Permalink
tests: drivers: pwm: Add overlay for Milk-V boards
Browse files Browse the repository at this point in the history
This commit adds an overlay to the PWM driver tests for Milk-V boards.

Signed-off-by: Chen Xingyu <[email protected]>
  • Loading branch information
xingrz committed Sep 16, 2024
1 parent 825d8a5 commit f0bad4b
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/drivers/pwm/pwm_api/boards/milkv_duo.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (c) 2023-2024 Chen Xingyu <[email protected]>
* SPDX-License-Identifier: Apache-2.0
*/

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

&pinctrl {
pwm1_default: pwm1_default {
group1 {
pinmux = <CVI_PINMUX(SD1_D2, PWM_5)>; /* GP4 */
};
};
};

&pwm1 {
status = "okay";
pinctrl-0 = <&pwm1_default>;
pinctrl-names = "default";
};
24 changes: 24 additions & 0 deletions tests/drivers/pwm/pwm_api/boards/milkv_duo256m.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (c) 2024 Chen Xingyu <[email protected]>
* SPDX-License-Identifier: Apache-2.0
*/

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

&pinctrl {
pwm1_default: pwm1_default {
group1 {
pinmux = <CVI_PINMUX(SD1_D2, PWM_5)>; /* GP4 */
};
};
};

&pwm1 {
status = "okay";
pinctrl-0 = <&pwm1_default>;
pinctrl-names = "default";
};
24 changes: 24 additions & 0 deletions tests/drivers/pwm/pwm_api/boards/milkv_duos.overlay
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (c) 2024 Chen Xingyu <[email protected]>
* SPDX-License-Identifier: Apache-2.0
*/

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

&pinctrl {
pwm0_default: pwm0_default {
group1 {
pinmux = <CVI_PINMUX(VIVO_D1, PWM_3)>; /* B20 */
};
};
};

&pwm0 {
status = "okay";
pinctrl-0 = <&pwm0_default>;
pinctrl-names = "default";
};
4 changes: 4 additions & 0 deletions tests/drivers/pwm/pwm_api/src/test_pwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@
#elif defined(CONFIG_BOARD_LPCXPRESSO55S69_LPC55S69_CPU0_NS) || \
defined(CONFIG_BOARD_LPCXPRESSO55S69_LPC55S69_CPU0)
#define DEFAULT_PWM_PORT 2 /* D2 on Arduino connector P18 */
#elif defined(CONFIG_BOARD_MILKV_DUO) || defined(CONFIG_BOARD_MILKV_DUO256M)
#define DEFAULT_PWM_PORT 1
#elif defined CONFIG_BOARD_MILKV_DUOS
#define DEFAULT_PWM_PORT 3
#elif DT_HAS_COMPAT_STATUS_OKAY(st_stm32_pwm)
/* Default port should be adapted per board to fit the channel
* associated to the PWM pin. For intsance, for following device,
Expand Down

0 comments on commit f0bad4b

Please sign in to comment.