1 /*
2  * Copyright (c) 2022, Basalte bv
3  * Copyright (c) 2023 Nordic Semiconductor
4  *
5  * SPDX-License-Identifier: Apache-2.0
6  *
7  * "Bottom" of the SDL GPIO emulator.
8  * When built with the native_simulator this will be built in the runner context,
9  * that is, with the host C library, and with the host include paths.
10  */
11 
12 #ifndef DRIVERS_GPIO_GPIO_EMUL_SDL_BOTTOM_H
13 #define DRIVERS_GPIO_GPIO_EMUL_SDL_BOTTOM_H
14 
15 #include <stdbool.h>
16 #include <stdint.h>
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
22 /* Note: None of these are public interfaces. But internal to the SDL GPIO emulator */
23 
24 #define GPIOEMULSDL_SCANCODE_UNKNOWN 0
25 
26 struct gpio_sdl_data {
27 	void *dev;
28 	int (*callback)(struct gpio_sdl_data *data);
29 	int event_scan_code;
30 	bool key_down;
31 };
32 
33 void gpio_sdl_init_bottom(struct gpio_sdl_data *data);
34 
35 #ifdef __cplusplus
36 }
37 #endif
38 
39 #endif /* DRIVERS_GPIO_GPIO_EMUL_SDL_BOTTOM_H */
40