tests: drivers: test fake-pwm on native_sim for pwm_api test

create native_sim overlay to use fake pwm for test of pwm_api

Signed-off-by: Nathan Olff <nathan@kickmaker.net>
This commit is contained in:
Nathan Olff 2024-10-15 15:20:13 +02:00 committed by Benjamin Cabé
commit 85e8303861
3 changed files with 28 additions and 0 deletions

View file

@ -0,0 +1,18 @@
/*
* Copyright (c) 2024 Kickmaker
*
* SPDX-License-Identifier: Apache-2.0
*/
/{
pwm0: pwm0 {
compatible = "zephyr,fake-pwm";
status = "okay";
#pwm-cells = <2>;
frequency = <10000000>;
};
aliases {
pwm-0 = &pwm0;
};
};

View file

@ -79,6 +79,11 @@
#define DEFAULT_PULSE_NSEC 1000000 #define DEFAULT_PULSE_NSEC 1000000
#endif #endif
#if DT_HAS_COMPAT_STATUS_OKAY(zephyr_fake_pwm)
#include <zephyr/fff.h>
DEFINE_FFF_GLOBALS;
#endif
#if defined CONFIG_BOARD_SAM_E70_XPLAINED #if defined CONFIG_BOARD_SAM_E70_XPLAINED
#define DEFAULT_PWM_PORT 2 /* PWM on EXT2 connector, pin 8 */ #define DEFAULT_PWM_PORT 2 /* PWM on EXT2 connector, pin 8 */
#elif defined CONFIG_PWM_NRFX #elif defined CONFIG_PWM_NRFX

View file

@ -30,3 +30,8 @@ tests:
platform_allow: platform_allow:
- frdm_mcxn947/mcxn947/cpu0 - frdm_mcxn947/mcxn947/cpu0
- frdm_mcxn947/mcxn947/cpu0/qspi - frdm_mcxn947/mcxn947/cpu0/qspi
drivers.pwm.native_sim:
platform_allow:
- native_sim
integration_platforms:
- native_sim