A simple example of how to develop a portable driver api - based on Zephyr device driver model.
You can build to three different architectures:
$ make arm
$ make ppc
$ make x86
To clean
$ make clean
$ ./driver_api_exe
The output depends on the builded target:
-
ARM:
$ ./driver_api_exe my_driver_init, foo: 10 and bar: 20 arm driver my_driver_get arm driver
-
PPC:
$ ./driver_api_exe my_driver_init, foo: 10 and bar: 20 ppc driver my_driver_get ppc driver
-
X86:
$ ./driver_api_exe Not implemented Not implemented
The API initialization requires an up to date toolchain (C99 or newer). Using older toolchain requires change the the API initialization.