2018-05-04 02:16:58 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2018 Linaro Ltd.
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <syscall_handler.h>
|
|
|
|
#include <led.h>
|
|
|
|
|
2018-05-05 06:57:57 +08:00
|
|
|
Z_SYSCALL_HANDLER(led_blink, dev, led, delay_on, delay_off)
|
2018-05-04 02:16:58 +08:00
|
|
|
{
|
2018-05-05 06:57:57 +08:00
|
|
|
Z_OOPS(Z_SYSCALL_DRIVER_LED(dev, blink));
|
2019-03-09 05:19:05 +08:00
|
|
|
return z_impl_led_blink((struct device *)dev, led, delay_on,
|
2018-05-04 02:16:58 +08:00
|
|
|
delay_off);
|
|
|
|
}
|
|
|
|
|
2018-05-05 06:57:57 +08:00
|
|
|
Z_SYSCALL_HANDLER(led_set_brightness, dev, led, value)
|
2018-05-04 02:16:58 +08:00
|
|
|
{
|
2018-05-05 06:57:57 +08:00
|
|
|
Z_OOPS(Z_SYSCALL_DRIVER_LED(dev, set_brightness));
|
2019-03-09 05:19:05 +08:00
|
|
|
return z_impl_led_set_brightness((struct device *)dev, led, value);
|
2018-05-04 02:16:58 +08:00
|
|
|
}
|
|
|
|
|
2018-05-05 06:57:57 +08:00
|
|
|
Z_SYSCALL_HANDLER(led_on, dev, led)
|
2018-05-04 02:16:58 +08:00
|
|
|
{
|
2018-05-05 06:57:57 +08:00
|
|
|
Z_OOPS(Z_SYSCALL_DRIVER_LED(dev, on));
|
2019-03-09 05:19:05 +08:00
|
|
|
return z_impl_led_on((struct device *)dev, led);
|
2018-05-04 02:16:58 +08:00
|
|
|
}
|
|
|
|
|
2018-05-05 06:57:57 +08:00
|
|
|
Z_SYSCALL_HANDLER(led_off, dev, led)
|
2018-05-04 02:16:58 +08:00
|
|
|
{
|
2018-05-05 06:57:57 +08:00
|
|
|
Z_OOPS(Z_SYSCALL_DRIVER_LED(dev, off));
|
2019-03-09 05:19:05 +08:00
|
|
|
return z_impl_led_off((struct device *)dev, led);
|
2018-05-04 02:16:58 +08:00
|
|
|
}
|