2017-10-26 02:27:37 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2017 Intel Corporation
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <syscall_handler.h>
|
|
|
|
#include <pwm.h>
|
|
|
|
|
2018-05-05 06:57:57 +08:00
|
|
|
Z_SYSCALL_HANDLER(pwm_pin_set_cycles, dev, pwm, period, pulse)
|
2017-10-26 02:27:37 +08:00
|
|
|
{
|
2018-05-05 06:57:57 +08:00
|
|
|
Z_OOPS(Z_SYSCALL_DRIVER_PWM(dev, pin_set));
|
2017-10-26 02:27:37 +08:00
|
|
|
return _impl_pwm_pin_set_cycles((struct device *)dev, pwm, period,
|
|
|
|
pulse);
|
|
|
|
}
|
|
|
|
|
2018-05-05 06:57:57 +08:00
|
|
|
Z_SYSCALL_HANDLER(pwm_get_cycles_per_sec, dev, pwm, cycles)
|
2017-10-26 02:27:37 +08:00
|
|
|
{
|
2018-05-05 06:57:57 +08:00
|
|
|
Z_OOPS(Z_SYSCALL_DRIVER_PWM(dev, get_cycles_per_sec));
|
|
|
|
Z_OOPS(Z_SYSCALL_MEMORY_WRITE(cycles, sizeof(u64_t)));
|
2017-10-26 02:27:37 +08:00
|
|
|
return _impl_pwm_get_cycles_per_sec((struct device *)dev,
|
|
|
|
pwm, (u64_t *)cycles);
|
|
|
|
}
|