zephyr/drivers/pwm/pwm_handlers.c
Anas Nashif 5843884887 cleanup: include/: move pwm.h to drivers/pwm.h
move pwm.h to drivers/pwm.h and
create a shim for backward-compatibility.

No functional changes to the headers.
A warning in the shim can be controlled with CONFIG_COMPAT_INCLUDES.

Related to #16539

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-06-27 22:55:49 -04:00

24 lines
608 B
C

/*
* Copyright (c) 2017 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <syscall_handler.h>
#include <drivers/pwm.h>
Z_SYSCALL_HANDLER(pwm_pin_set_cycles, dev, pwm, period, pulse)
{
Z_OOPS(Z_SYSCALL_DRIVER_PWM(dev, pin_set));
return z_impl_pwm_pin_set_cycles((struct device *)dev, pwm, period,
pulse);
}
Z_SYSCALL_HANDLER(pwm_get_cycles_per_sec, dev, pwm, cycles)
{
Z_OOPS(Z_SYSCALL_DRIVER_PWM(dev, get_cycles_per_sec));
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(cycles, sizeof(u64_t)));
return z_impl_pwm_get_cycles_per_sec((struct device *)dev,
pwm, (u64_t *)cycles);
}