Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c969f92

Browse filesBrowse files
committed
Get the LSM6DSOX FIFO watermark status
added support for direct FIFO_STATUS2:FIFO_ WTM_IA access
1 parent 261c03d commit c969f92
Copy full SHA for c969f92

File tree

Expand file treeCollapse file tree

2 files changed

+20
-0
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+20
-0
lines changed

‎src/LSM6DSOXSensor.cpp

Copy file name to clipboardExpand all lines: src/LSM6DSOXSensor.cpp
+19Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2735,6 +2735,25 @@ LSM6DSOXStatusTypeDef LSM6DSOXSensor::Get_FIFO_Full_Status(uint8_t *Status)
27352735
return LSM6DSOX_OK;
27362736
}
27372737

2738+
/**
2739+
* @brief Get the LSM6DSOX FIFO watermark status
2740+
* @param Status FIFO watermark status
2741+
* @retval 0 in case of success, an error code otherwise
2742+
*/
2743+
LSM6DSOXStatusTypeDef LSM6DSOXSensor::Get_FIFO_Watermark_Status(uint8_t *Status)
2744+
{
2745+
lsm6dsox_reg_t reg;
2746+
2747+
if (lsm6dsox_read_reg(&reg_ctx, LSM6DSOX_FIFO_STATUS2, &reg.byte, 1) != LSM6DSOX_OK)
2748+
{
2749+
return LSM6DSOX_ERROR;
2750+
}
2751+
2752+
*Status = reg.fifo_status2.fifo_wtm_ia;
2753+
2754+
return LSM6DSOX_OK;
2755+
}
2756+
27382757
/**
27392758
* @brief Set the LSM6DSOX FIFO full interrupt on INT1 pin
27402759
* @param Status FIFO full interrupt on INT1 pin status

‎src/LSM6DSOXSensor.h

Copy file name to clipboardExpand all lines: src/LSM6DSOXSensor.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ class LSM6DSOXSensor
200200

201201
LSM6DSOXStatusTypeDef Get_FIFO_Num_Samples(uint16_t *NumSamples);
202202
LSM6DSOXStatusTypeDef Get_FIFO_Full_Status(uint8_t *Status);
203+
LSM6DSOXStatusTypeDef Get_FIFO_Watermark_Status(uint8_t *Status);
203204
LSM6DSOXStatusTypeDef Set_FIFO_INT1_FIFO_Full(uint8_t Status);
204205
LSM6DSOXStatusTypeDef Set_FIFO_Watermark_Level(uint16_t Watermark);
205206
LSM6DSOXStatusTypeDef Set_FIFO_Stop_On_Fth(uint8_t Status);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.