forked from apache/nuttx
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Boiler plate driver implemented with WHO_AM_I register reading. This …
…adds support for the driver to all RP2040 devices and also adds the documentation page for the driver, to be added to as it's implemented.
- Loading branch information
Showing
6 changed files
with
619 additions
and
0 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
Documentation/components/drivers/special/sensors/lsm6dso32.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
LSM6DSO32 | ||
========= | ||
|
||
Contributed by Carleton University InSpace. | ||
|
||
The LSM6DSO32 is an inertial measurement unit that contains an accelerometer and | ||
gyroscope. | ||
|
||
Application Programming Interface | ||
================================= | ||
|
||
The header file for the LSM6DSO32 interface can be included using: | ||
|
||
.. code-block:: c | ||
#include <nuttx/sensors/lsm6dso32.h> | ||
The LSM6DSO32 registration function allows the driver to be registered as a | ||
POSIX character driver. | ||
|
||
The standard POSIX `read()` function will return the 3 axes measurements of both | ||
acceleration and angular velocity in plain-text, which is useful when | ||
debugging/testing the driver using `cat` from the shell. | ||
|
||
The `write()` operation is not implemented for this sensor. | ||
|
||
Specific operations the sensor offers can be performed via the POSIX `ioctl` | ||
operation. The supported commands are: | ||
|
||
* :c:macro:`SNIOC_WHO_AM_I` | ||
|
||
.. c:macro:: SNIOC_WHO_AM_I | ||
This command reads the `WHO_AM_I` register of the sensor. The register value is | ||
returned in the argument to the command, which must be a `uint8_t` pointer. | ||
|
||
.. code-block:: c | ||
uint8_t whoami = 0; | ||
err = ioctl(sensor, SNIOC_WHO_AM_I, &whoami); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.