drivers/sensor: lis2dw12: add bw_filt support
Add bandwidth filter support. (BW_FILT in CTRL6) Value is configurable through DT per instance. Signed-off-by: Maxime Vincent <maxime@veemax.be>
This commit is contained in:
parent
089f70d4b3
commit
47021a608d
3 changed files with 24 additions and 0 deletions
|
@ -289,6 +289,9 @@ static int lis2dw12_init(const struct device *dev)
|
|||
return ret;
|
||||
}
|
||||
|
||||
LOG_DBG("bandwidth filter is %u", (int)cfg->bw_filt);
|
||||
lis2dw12_filter_bandwidth_set(ctx, cfg->bw_filt);
|
||||
|
||||
#ifdef CONFIG_LIS2DW12_TRIGGER
|
||||
if (lis2dw12_init_interrupt(dev) < 0) {
|
||||
LOG_ERR("Failed to initialize interrupts");
|
||||
|
@ -363,6 +366,7 @@ static int lis2dw12_init(const struct device *dev)
|
|||
}, \
|
||||
.pm = DT_INST_PROP(inst, power_mode), \
|
||||
.range = DT_INST_PROP(inst, range), \
|
||||
.bw_filt = DT_INST_PROP(inst, bw_filt), \
|
||||
LIS2DW12_CONFIG_TAP(inst) \
|
||||
COND_CODE_1(DT_INST_NODE_HAS_PROP(inst, irq_gpios), \
|
||||
(LIS2DW12_CFG_IRQ(inst)), ()) \
|
||||
|
@ -387,6 +391,7 @@ static int lis2dw12_init(const struct device *dev)
|
|||
}, \
|
||||
.pm = DT_INST_PROP(inst, power_mode), \
|
||||
.range = DT_INST_PROP(inst, range), \
|
||||
.bw_filt = DT_INST_PROP(inst, bw_filt), \
|
||||
LIS2DW12_CONFIG_TAP(inst) \
|
||||
COND_CODE_1(DT_INST_NODE_HAS_PROP(inst, irq_gpios), \
|
||||
(LIS2DW12_CFG_IRQ(inst)), ()) \
|
||||
|
|
|
@ -68,6 +68,7 @@ struct lis2dw12_device_config {
|
|||
} stmemsc_cfg;
|
||||
lis2dw12_mode_t pm;
|
||||
uint8_t range;
|
||||
uint8_t bw_filt;
|
||||
#ifdef CONFIG_LIS2DW12_TRIGGER
|
||||
struct gpio_dt_spec gpio_int;
|
||||
uint8_t int_pin;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue