Example Application 1.0.0
A Zephyr-based example application
Loading...
Searching...
No Matches
blink.h
1/*
2 * Copyright (c) 2026 IAR Systems AB
3 * Copyright (c) 2024 Nordic Semiconductor ASA
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef APP_DRIVERS_BLINK_H_
8#define APP_DRIVERS_BLINK_H_
9
10#include <zephyr/device.h>
11#include <zephyr/toolchain.h>
12
25
37
39__subsystem struct blink_driver_api {
51 int (*set_period_ms)(const struct device *dev, unsigned int period_ms);
52};
53
55
68
80__syscall int blink_set_period_ms(const struct device *dev,
81 unsigned int period_ms);
82
83static inline int z_impl_blink_set_period_ms(const struct device *dev,
84 unsigned int period_ms)
85{
86 __ASSERT_NO_MSG(DEVICE_API_IS(blink, dev));
87
88 return DEVICE_API_GET(blink, dev)->set_period_ms(dev, period_ms);
89}
90
102static inline int blink_off(const struct device *dev)
103{
104 return blink_set_period_ms(dev, 0);
105}
106
107#include <syscalls/blink.h>
108
110
112
113#endif /* APP_DRIVERS_BLINK_H_ */