@@ -3018,6 +3018,22 @@ LSM6DSOXStatusTypeDef LSM6DSOXSensor::Get_FIFO_Data(uint8_t *Data)
3018
3018
return LSM6DSOX_OK;
3019
3019
}
3020
3020
3021
+ /* *
3022
+ * @brief Get the LSM6DSOX FIFO sample
3023
+ * @param Sample FIFO sample array [multiple of 7]
3024
+ * @param Count Count of samples to get.
3025
+ * @retval 0 in case of success, an error code otherwise
3026
+ */
3027
+ LSM6DSOXStatusTypeDef LSM6DSOXSensor::Get_FIFO_Sample (uint8_t *Sample, uint16_t Count)
3028
+ {
3029
+ if (lsm6dsox_read_reg (®_ctx, LSM6DSOX_FIFO_DATA_OUT_TAG, Sample, Count * 7 ) != LSM6DSOX_OK)
3030
+ {
3031
+ return LSM6DSOX_ERROR;
3032
+ }
3033
+
3034
+ return LSM6DSOX_OK;
3035
+ }
3036
+
3021
3037
/* *
3022
3038
* @brief Get the LSM6DSOX FIFO accelero single sample (16-bit data per 3 axes) and calculate acceleration [mg]
3023
3039
* @param Acceleration FIFO accelero axes [mg]
@@ -3170,6 +3186,72 @@ LSM6DSOXStatusTypeDef LSM6DSOXSensor::Get_MLC_Output(uint8_t *Output)
3170
3186
return LSM6DSOX_OK;
3171
3187
}
3172
3188
3189
+ /* *
3190
+ * @brief Get the LSM6DSOX timestamp enable status
3191
+ * @param Status Timestamp enable status
3192
+ * @retval 0 in case of success, an error code otherwise
3193
+ */
3194
+ LSM6DSOXStatusTypeDef LSM6DSOXSensor::Get_Timestamp_Status (uint8_t *Status)
3195
+ {
3196
+ if (lsm6dsox_timestamp_get (®_ctx, Status) != LSM6DSOX_OK)
3197
+ {
3198
+ return LSM6DSOX_ERROR;
3199
+ }
3200
+
3201
+ return LSM6DSOX_OK;
3202
+ }
3203
+
3204
+ /* *
3205
+ * @brief Set the LSM6DSOX timestamp enable status
3206
+ * @param Status Timestamp enable status
3207
+ * @retval 0 in case of success, an error code otherwise
3208
+ */
3209
+ LSM6DSOXStatusTypeDef LSM6DSOXSensor::Set_Timestamp_Status (uint8_t Status)
3210
+ {
3211
+ if (lsm6dsox_timestamp_set (®_ctx, Status) != LSM6DSOX_OK)
3212
+ {
3213
+ return LSM6DSOX_ERROR;
3214
+ }
3215
+
3216
+ return LSM6DSOX_OK;
3217
+ }
3218
+
3219
+ /* *
3220
+ * @brief Set the LSM6DSOX FIFO timestamp decimation
3221
+ * @param Decimation FIFO timestamp decimation
3222
+ * @retval 0 in case of success, an error code otherwise
3223
+ */
3224
+ LSM6DSOXStatusTypeDef LSM6DSOXSensor::Set_FIFO_Timestamp_Decimation (uint8_t Decimation)
3225
+ {
3226
+ LSM6DSOXStatusTypeDef ret = LSM6DSOX_OK;
3227
+
3228
+ /* Verify that the passed parameter contains one of the valid values. */
3229
+ switch ((lsm6dsox_odr_ts_batch_t )Decimation)
3230
+ {
3231
+ case LSM6DSOX_NO_DECIMATION:
3232
+ case LSM6DSOX_DEC_1:
3233
+ case LSM6DSOX_DEC_8:
3234
+ case LSM6DSOX_DEC_32:
3235
+ break ;
3236
+
3237
+ default :
3238
+ ret = LSM6DSOX_ERROR;
3239
+ break ;
3240
+ }
3241
+
3242
+ if (ret == LSM6DSOX_ERROR)
3243
+ {
3244
+ return ret;
3245
+ }
3246
+
3247
+ if (lsm6dsox_fifo_timestamp_decimation_set (®_ctx, (lsm6dsox_odr_ts_batch_t )Decimation) != LSM6DSOX_OK)
3248
+ {
3249
+ return LSM6DSOX_ERROR;
3250
+ }
3251
+
3252
+ return ret;
3253
+ }
3254
+
3173
3255
int32_t LSM6DSOX_io_write (void *handle, uint8_t WriteAddr, uint8_t *pBuffer, uint16_t nBytesToWrite)
3174
3256
{
3175
3257
return ((LSM6DSOXSensor *)handle)->IO_Write (pBuffer, WriteAddr, nBytesToWrite);
0 commit comments