2020-07-21 00:18:26 +02:00
|
|
|
==============
|
|
|
|
Device Drivers
|
|
|
|
==============
|
2020-10-18 18:48:44 +02:00
|
|
|
|
2020-09-05 23:36:36 +02:00
|
|
|
NuttX supports a variety of device drivers, which can be broadly
|
|
|
|
divided in three classes:
|
|
|
|
|
|
|
|
.. toctree::
|
|
|
|
:maxdepth: 1
|
|
|
|
|
|
|
|
character/index.rst
|
|
|
|
block/index.rst
|
2020-10-18 18:48:44 +02:00
|
|
|
special/index.rst
|
|
|
|
|
2020-09-05 23:36:36 +02:00
|
|
|
.. note::
|
|
|
|
Device driver support depends on the *in-memory*, *pseudo*
|
|
|
|
file system that is enabled by default.
|
|
|
|
|
|
|
|
Lower-half and upper-half
|
|
|
|
=========================
|
|
|
|
|
|
|
|
Drivers in NuttX generally work in two distinct layers:
|
|
|
|
|
|
|
|
* An *upper half* which registers itself to NuttX using
|
|
|
|
a call such as :c:func:`register_driver` or
|
|
|
|
:c:func:`register_blockdriver` and implements the corresponding
|
|
|
|
high-level interface (`read`, `write`, `close`, etc.).
|
|
|
|
implements the interface. This *upper half* calls into
|
|
|
|
the *lower half* via callbacks.
|
|
|
|
* A "lower half" which is typically hardware-specific. This is
|
|
|
|
usually implemented at the architecture or board level.
|
2020-07-21 00:18:26 +02:00
|
|
|
|