diff options
Diffstat (limited to 'zephyr/emul/include')
-rw-r--r-- | zephyr/emul/include/flash_chip.h | 14 | ||||
-rw-r--r-- | zephyr/emul/include/pwm_mock.h | 33 |
2 files changed, 40 insertions, 7 deletions
diff --git a/zephyr/emul/include/flash_chip.h b/zephyr/emul/include/flash_chip.h index 0060935b98..947246867b 100644 --- a/zephyr/emul/include/flash_chip.h +++ b/zephyr/emul/include/flash_chip.h @@ -1,4 +1,4 @@ -/* Copyright 2022 The Chromium OS Authors. All rights reserved. +/* Copyright 2022 The ChromiumOS Authors * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ @@ -6,11 +6,11 @@ #ifndef __EMUL_INCLUDE_FLASH_CHIP_H #define __EMUL_INCLUDE_FLASH_CHIP_H -#define CONFIG_RO_STORAGE_OFF 0x0 -#define CONFIG_RW_STORAGE_OFF 0x0 -#define CONFIG_FLASH_WRITE_SIZE 0x1 /* minimum write size */ -#define CONFIG_FLASH_WRITE_IDEAL_SIZE 256 /* one page size for write */ -#define CONFIG_FLASH_ERASE_SIZE 0x10000 -#define CONFIG_FLASH_BANK_SIZE CONFIG_FLASH_ERASE_SIZE +#define CONFIG_RO_STORAGE_OFF 0x0 +#define CONFIG_RW_STORAGE_OFF 0x0 +#define CONFIG_FLASH_WRITE_SIZE 0x1 /* minimum write size */ +#define CONFIG_FLASH_WRITE_IDEAL_SIZE 256 /* one page size for write */ +#define CONFIG_FLASH_ERASE_SIZE 0x10000 +#define CONFIG_FLASH_BANK_SIZE CONFIG_FLASH_ERASE_SIZE #endif /* __EMUL_INCLUDE_FLASH_CHIP_H */ diff --git a/zephyr/emul/include/pwm_mock.h b/zephyr/emul/include/pwm_mock.h new file mode 100644 index 0000000000..7f5eb9eb89 --- /dev/null +++ b/zephyr/emul/include/pwm_mock.h @@ -0,0 +1,33 @@ +/* Copyright 2022 The ChromiumOS Authors + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#ifndef __EMUL_INCLUDE_PWM_MOCK_H +#define __EMUL_INCLUDE_PWM_MOCK_H + +#include <zephyr/device.h> +#include <zephyr/drivers/pwm.h> + +/* + * Get pwm duty cycle + * + * @param dev pointer to hte pwm device + * @param channel channel id + * + * @return duty duty cycle in range [0, 100] or negative on error. + */ +int pwm_mock_get_duty(const struct device *dev, uint32_t channel); + +/** + * @brief Get the flags the PWM driver was set with. See the following header + * in upstream Zephyr for possible values: + * `include/zephyr/dt-bindings/pwm/pwm.h` + * + * @param dev Pointer to PWM device + * @param channel Unused + * @return pwm_flags_t PWM flags + */ +pwm_flags_t pwm_mock_get_flags(const struct device *dev, uint32_t channel); + +#endif /*__EMUL_INCLUDE_PWM_MOCK_H */ |