Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions drivers/sensors/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,17 @@ config SENSORS_NAU7802_THREAD_STACKSIZE
---help---
The stack size for the worker threads that perform measurements.

config SENSORS_NAU7802_ODR
int "NAU7802 ODR"
default 0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a range keyword to help limit to 0-7

---help---
The following are the possible values as per datasheet
0 -> 10HZ
1 -> 20HZ
2 -> 40HZ
3 -> 80HZ
7 -> 320HZ

endif # SENSORS_NAU7802

config BH1750FVI_I2C_FREQUENCY
Expand Down
2 changes: 1 addition & 1 deletion drivers/sensors/nau7802.c
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,7 @@ int nau7802_register(FAR struct i2c_master_s *i2c, int devno, uint8_t addr)
priv->lower.ops = &g_sensor_ops;
priv->lower.type = SENSOR_TYPE_FORCE;
priv->enabled = false;
priv->odr = NAU7802_ODR_10HZ; /* 10Hz (0.1s) default ODR */
priv->odr = CONFIG_SENSORS_NAU7802_ODR;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When the sensor boots, is it's default 10Hz? Because if so, you'll need to make sure that a user ODR of a different value is set on the chip, not just stored in the struct.

Also, make this configurable via the uORB interface for setting sampling frequency.


err = sensor_register(&priv->lower, devno);
if (err < 0)
Expand Down
Loading