Lines Matching +full:kscan +full:- +full:input
4 * SPDX-License-Identifier: Apache-2.0
8 #include <zephyr/drivers/kscan.h>
9 #include <zephyr/input/input.h>
29 struct kscan_input_data *data = dev->data; in kscan_input_cb()
31 switch (evt->code) { in kscan_input_cb()
33 data->col = evt->value; in kscan_input_cb()
36 data->row = evt->value; in kscan_input_cb()
39 data->pressed = evt->value; in kscan_input_cb()
43 if (evt->sync) { in kscan_input_cb()
44 LOG_DBG("input event: %3d %3d %d", in kscan_input_cb()
45 data->row, data->col, data->pressed); in kscan_input_cb()
46 if (data->callback) { in kscan_input_cb()
47 data->callback(dev, data->row, data->col, data->pressed); in kscan_input_cb()
55 struct kscan_input_data *data = dev->data; in kscan_input_configure()
59 return -EINVAL; in kscan_input_configure()
62 data->callback = callback; in kscan_input_configure()
69 struct kscan_input_data *data = dev->data; in kscan_input_enable_callback()
71 data->enabled = true; in kscan_input_enable_callback()
78 struct kscan_input_data *data = dev->data; in kscan_input_disable_callback()
80 data->enabled = false; in kscan_input_disable_callback()
87 const struct kscan_input_config *cfg = dev->config; in kscan_input_init()
89 if (!device_is_ready(cfg->input_dev)) { in kscan_input_init()
90 LOG_ERR("Input device not ready"); in kscan_input_init()
91 return -ENODEV; in kscan_input_init()
97 static DEVICE_API(kscan, kscan_input_driver_api) = {