Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Bosch BMM350 3-Axis Magnetometer. More...

Files

file  bmm350.h
 Header file for extended sensor API of BMM350 sensor.

Data Structures

struct  bmm350_self_test_result
 BMM350 user self-test result. More...

Functions

int bmm350_self_test (const struct device *dev, struct bmm350_self_test_result *result)
 Run the BMM350 built-in user self-test.
int bmm350_magnetic_reset (const struct device *dev)
 Performs a magnetic reset.

Detailed Description

Bosch BMM350 3-Axis Magnetometer.

Function Documentation

◆ bmm350_magnetic_reset()

int bmm350_magnetic_reset ( const struct device * dev)

#include <bmm350.h>

Performs a magnetic reset.

The BMM350 has measures to recover from excessively strong magnetic fields. A magnetic reset is triggered after reset by the device itself, but if excessive field exposure has occurred in suspend mode, the sensor can not detect that event. If a large offset or sensitivity drift indicates that such an event has occurred, then this function can be called by the application.

"Enhanced" Magnetic Reset supported by later BMM350 Revisions is not yet implemented.

Parameters
devPointer to the sensor device
Returns
0 if successful, negative errno code if failure.

◆ bmm350_self_test()

int bmm350_self_test ( const struct device * dev,
struct bmm350_self_test_result * result )

#include <bmm350.h>

Run the BMM350 built-in user self-test.

Re-initialises the TMR sensor and measures the response to a positive and negative excitation on the X and Y axes, following the Bosch SensorAPI sequence. The device configuration in place before the call is restored on return.

The caller is responsible for judging the result against the device's self-test limit (see the BMM350 datasheet); this function only reports the measured responses.

This must not be called while the sensor is streaming.

Parameters
devPointer to the sensor device.
resultOutput: per-axis self-test responses and deltas.
Returns
0 if successful, negative errno code on failure.