2017-10-26 02:27:37 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2017 Intel Corporation
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <syscall_handler.h>
|
2019-06-26 03:53:58 +08:00
|
|
|
#include <drivers/pwm.h>
|
2017-10-26 02:27:37 +08:00
|
|
|
|
2019-08-14 02:34:34 +08:00
|
|
|
static inline int z_vrfy_pwm_pin_set_cycles(struct device *dev, u32_t pwm,
|
|
|
|
u32_t period, u32_t 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));
|
2019-03-09 05:19:05 +08:00
|
|
|
return z_impl_pwm_pin_set_cycles((struct device *)dev, pwm, period,
|
2017-10-26 02:27:37 +08:00
|
|
|
pulse);
|
|
|
|
}
|
2019-08-14 02:34:34 +08:00
|
|
|
#include <syscalls/pwm_pin_set_cycles_mrsh.c>
|
2017-10-26 02:27:37 +08:00
|
|
|
|
2019-08-14 02:34:34 +08:00
|
|
|
static inline int z_vrfy_pwm_get_cycles_per_sec(struct device *dev, u32_t pwm,
|
|
|
|
u64_t *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)));
|
2019-03-09 05:19:05 +08:00
|
|
|
return z_impl_pwm_get_cycles_per_sec((struct device *)dev,
|
2017-10-26 02:27:37 +08:00
|
|
|
pwm, (u64_t *)cycles);
|
|
|
|
}
|
2019-08-14 02:34:34 +08:00
|
|
|
#include <syscalls/pwm_get_cycles_per_sec_mrsh.c>
|