Prototyping driver API out of tree #50063
-
I'm structuring my project like this. This is my folder structure
Here is the API [machinehum@whitebox id01-firmware]$ cat id01_fw/include/zephyr/drivers/touch.h
/**
* @file drivers/touch.h
*
* @brief Public APIs for the touch driver.
*/
#ifndef ZEPHYR_INCLUDE_DRIVERS_TOUCH_H_
#define ZEPHYR_INCLUDE_DRIVERS_TOUCH_H_
/**
* @brief Sensor Interface
* @defgroup sensor_interface Sensor Interface
* @ingroup io_interfaces
* @{
*/
#include <zephyr/types.h>
#include <zephyr/device.h>
#include <errno.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef int (*touch_event_get_t)(const struct device *dev);
__subsystem struct touch_driver_api {
touch_event_get_t single_tap;
};
__syscall int touch_event_get(const struct device *dev);
// int touch_event_get(const struct device *dev) {
//
// }
#ifdef __cplusplus
}
#endif
#include <syscalls/touch.h>
#endif /* ZEPHYR_INCLUDE_DRIVERS_TOUCH_H_ */ This is how I've gotten it included in the driver and the application.
Here is the build output...
For some reason the build system isn't generating the required syscalls/touch.h Any help would be appreciated :) Edit: touch.h is certainly not being generated
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I've tried this list(APPEND SYSCALL_INCLUDE_DIRS include/) In my top level CMakeLists but when I print out the variable in the zephyr CMakeLists it doesn't have the path I've added. |
Beta Was this translation helpful? Give feedback.
-
I just solved this by putting my api here Not ideal but it seems to work fine. To get this into my driver I have to include
|
Beta Was this translation helpful? Give feedback.
I just solved this by putting my api here
app/zephyr/drivers/touch.h
and settingCONFIG_APPLICATION_DEFINED_SYSCALL=y
Not ideal but it seems to work fine. To get this into my driver I have to include
app
in CMakeLists.txt like this