16#ifndef ZEPHYR_INCLUDE_DRIVERS_KB_SCAN_H_
17#define ZEPHYR_INCLUDE_DRIVERS_KB_SCAN_H_
54typedef int (*kscan_config_t)(
const struct device *dev,
56typedef int (*kscan_disable_callback_t)(
const struct device *dev);
57typedef int (*kscan_enable_callback_t)(
const struct device *dev);
59__subsystem
struct kscan_driver_api {
60 kscan_config_t config;
61 kscan_disable_callback_t disable_callback;
62 kscan_enable_callback_t enable_callback;
81static inline int z_impl_kscan_config(
const struct device *dev,
84 const struct kscan_driver_api *api =
85 (
struct kscan_driver_api *)dev->
api;
87 return api->config(dev, callback);
98static inline int z_impl_kscan_enable_callback(
const struct device *dev)
100 const struct kscan_driver_api *api =
101 (
const struct kscan_driver_api *)dev->
api;
103 if (api->enable_callback == NULL) {
107 return api->enable_callback(dev);
119static inline int z_impl_kscan_disable_callback(
const struct device *dev)
121 const struct kscan_driver_api *api =
122 (
const struct kscan_driver_api *)dev->
api;
124 if (api->disable_callback == NULL) {
128 return api->disable_callback(dev);
139#include <syscalls/kscan.h>
void
Definition: eswifi_shell.c:15
int kscan_disable_callback(const struct device *dev)
Disables callback.
int kscan_config(const struct device *dev, kscan_callback_t callback)
Configure a Keyboard scan instance.
int kscan_enable_callback(const struct device *dev)
Enables callback.
void(* kscan_callback_t)(const struct device *dev, uint32_t row, uint32_t column, bool pressed)
Keyboard scan callback called when user press/release a key on a matrix keyboard.
Definition: kscan.h:43
#define ENOSYS
Definition: errno.h:83
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
Runtime device structure (in ROM) per driver instance.
Definition: device.h:367
const void * api
Definition: device.h:373