1 /* 2 * Copyright (c) 2018 Intel Corporation. 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #include <zephyr/sys/printk.h> 8 #include "dummy_driver.h" 9 10 /* Application main Thread */ main(void)11int main(void) 12 { 13 const struct device *dev; 14 struct dummy_driver_api *api; 15 int ret, val; 16 17 printk("Device PM sample app start\n"); 18 dev = device_get_binding(DUMMY_DRIVER_NAME); 19 api = (struct dummy_driver_api *)dev->api; 20 ret = api->open(dev); 21 val = 10; 22 ret = api->write(dev, val); 23 ret = api->read(dev, &val); 24 ret = api->close(dev); 25 printk("Device PM sample app complete\n"); 26 return 0; 27 } 28