I am trying to build a custom joystick/gamepad device for an embedded Linux system. I am looking for a library or system API that will allow me to create a node in /dev/input from userspace code.
I would like this because:
The custom hardware can communicate with the system using the existing SPI or I2C drivers (it's my hardware design so I can do whatever makes the most technical sense)
Kernel modules can't utilize other drivers, only exported symbols from other modules
I understand the only way to make a kernel module is with kernel code and compiling that as a kernel module. I am not trying to achieve a kernel module with userspace code.
I am looking for an API that allows me to create a file, and when that file is read from or written to, functions get called. That's the general concept of a character driver. I don't need the privileges or restrictions that the kernel provides or imposes.
There must be some way to emulate file I/O that doesn't involve writing a brand new kernel module.
Thanks!
udev
? – Civilizationudev
can be configured to make a/dev/input/js0
(which may be a symlink) – Civilizationudev
rule system. If possible, avoid doing things in kernel.... – Civilization