/
bmi090l.h
1559 lines (1454 loc) · 51.6 KB
/
bmi090l.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/**
* Copyright (c) 2021 Bosch Sensortec GmbH. All rights reserved.
*
* BSD-3-Clause
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Neither the name of the copyright holder nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
* @file bmi090l.h
* @date 2021-06-22
* @version v1.1.7
*
*/
/*! \file bmi090l.h
* \brief Sensor Driver for BMI090L family of sensors */
/*!
* @defgroup bmi090l BMI090L
*/
#ifndef BMI090L_H_
#define BMI090L_H_
#ifdef __cplusplus
extern "C" {
#endif
/*********************************************************************/
/* Header files */
#include "bmi090l_defs.h"
/*********************************************************************/
/* (Extern) Variable declarations */
/*********************************************************************/
/* Function prototype declarations */
/*********************** BMI090L Accelerometer function prototypes ************************/
/**
* \ingroup bmi090l
* \defgroup bmi090laApiInit Accel Initialization
* @brief Initialize the accel sensor and device structure
*/
/*!
* \ingroup bmi090laApiInit
* \page bmi090la_api_bmi090la_init bmi090la_init
* \code
* int8_t bmi090la_init(struct bmi090l_dev *dev);
* \endcode
* @details This API is the entry point for accel sensor.
* It performs the selection of I2C/SPI read mechanism according to the
* selected interface and reads the chip-id of accel sensor.
*
* @param[in,out] dev : Structure instance of bmi090l_dev.
* @note : Refer user guide for detailed info.
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_init(struct bmi090l_dev *dev);
/**
* \ingroup bmi090l
* \defgroup bmi090laWFconfig Accel Feature config
* @brief Writes feature configuration to the accel sensor
*/
/*!
* \ingroup bmi090laWFconfig
* \page bmi090la_api_bmi090la_write_feature_config bmi090la_write_feature_config
* \code
* int8_t bmi090la_write_feature_config(uint8_t reg_addr,
* const uint16_t *reg_data,
* uint8_t len,
* struct bmi090l_dev *dev);
*
* \endcode
* @details This API writes the feature configuration to the accel sensor.
*
* @param[in] reg_addr : Address offset of the feature setting inside the feature conf region.
* @param[in] reg_data : Feature settings.
* @param[in] len : Number of 16 bit words to be written.
* @param[in] dev : Structure instance of bmi090l_dev.
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_write_feature_config(uint8_t reg_addr, const uint16_t *reg_data, uint8_t len, struct bmi090l_dev *dev);
/**
* \ingroup bmi090l
* \defgroup bmi090laApiRegs Accel Registers
* @brief Read / Write data from the given register address of accel sensor
*/
/*!
* \ingroup bmi090laApiRegs
* \page bmi090la_api_bmi090la_get_regs bmi090la_get_regs
* \code
* int8_t bmi090la_get_regs(uint8_t reg_addr, uint8_t *reg_data, uint32_t len, struct bmi090l_dev *dev);
* \endcode
* @details This API reads the data from the given register address of accel sensor.
*
* @param[in] reg_addr : Register address from where the data to be read
* @param[out] reg_data : Pointer to data buffer to store the read data.
* @param[in] len : No. of bytes of data to be read.
* @param[in] dev : Structure instance of bmi090l_dev.
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_get_regs(uint8_t reg_addr, uint8_t *reg_data, uint32_t len, struct bmi090l_dev *dev);
/*!
* \ingroup bmi090laApiRegs
* \page bmi090la_api_bmi090la_set_regs bmi090la_set_regs
* \code
* int8_t bmi090la_set_regs(uint8_t reg_addr, const uint8_t *reg_data, uint16_t len, struct bmi090l_dev *dev);
* \endcode
* @details This API writes the given data to the register address
* of accel sensor.
*
* @param[in] reg_addr : Register address to where the data to be written.
* @param[in] reg_data : Pointer to data buffer which is to be written
* in the sensor.
* @param[in] len : No. of bytes of data to write.
* @param[in] dev : Structure instance of bmi090l_dev.
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_set_regs(uint8_t reg_addr, const uint8_t *reg_data, uint32_t len, struct bmi090l_dev *dev);
/**
* \ingroup bmi090l
* \defgroup bmi090laApiEstatus Accel Error status
* @brief Read accel error status
*/
/*!
* \ingroup bmi090laApiEstatus
* \page bmi090la_api_bmi090la_get_error_status bmi090la_get_error_status
* \code
* int8_t bmi090la_get_error_status(struct bmi090l_err_reg *err_reg, struct bmi090l_dev *dev);
* \endcode
* @details This API reads the error status from the accel sensor.
*
* Below table mention the types of error which can occur in the sensor
*
*@verbatim
*************************************************************************
* Error | Description
*************************|***********************************************
* | Fatal Error, chip is not in operational
* fatal | state (Boot-, power-system).
* | This flag will be reset only by
* | power-on-reset or soft-reset.
*************************|***********************************************
* | Value Name Description
* error_code | 000 no_error no error
* | 001 accel_err error in
* | ACCEL_CONF
*************************************************************************
*@endverbatim
*
* @param[out] err_reg : Pointer to structure variable which stores the
* error status read from the sensor.
* @param[in] dev : Structure instance of bmi090l_dev.
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_get_error_status(struct bmi090l_err_reg *err_reg, struct bmi090l_dev *dev);
/**
* \ingroup bmi090l
* \defgroup bmi090laApiStatus Accel Status
* @brief Read status of accel sensor
*/
/*!
* \ingroup bmi090laApiStatus
* \page bmi090la_api_bmi090la_get_status bmi090la_get_status
* \code
* int8_t bmi090la_get_status(uint8_t *status, struct bmi090l_dev *dev);
* \endcode
* @details This API reads the status of the accel sensor.
*
* Below table lists the sensor status flags
*
*@verbatim
*************************************************************************
* Status | Description
***********************************|*************************************
* drdy_accel | Data ready for Accel.
*************************************************************************
*@endverbatim
*
* @param[out] status : Variable used to store the sensor status flags
* which is read from the sensor.
* @param[in] dev : Structure instance of bmi090l_dev.
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*
*/
int8_t bmi090la_get_status(uint8_t *status, struct bmi090l_dev *dev);
/**
* \ingroup bmi090l
* \defgroup bmi090laApiSoftreset Accel Soft Reset
* @brief Perform accel sensor soft reset
*/
/*!
* \ingroup bmi090laApiSoftreset
* \page bmi090la_api_bmi090la_soft_reset bmi090la_soft_reset
* \code
* int8_t bmi090la_soft_reset(struct bmi090l_dev *dev);
* \endcode
* @details This API resets the accel sensor.
*
* @param[in] dev : Structure instance of bmi090l_dev.
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_soft_reset(struct bmi090l_dev *dev);
/**
* \ingroup bmi090l
* \defgroup bmi090laApiConfig Accel Configurations
* @brief Set / Get Accel sensor configurations
*/
/*!
* \ingroup bmi090laApiConfig
* \page bmi090la_api_bmi090la_get_meas_conf bmi090la_get_meas_conf
* \code
* int8_t bmi090la_get_meas_conf(struct bmi090l_dev *dev);
* \endcode
* @details This API reads the accel config values ie odr, band width and range from the sensor,
* store it in the bmi090l_dev structure instance
* passed by the user.
* @param[in,out] dev : Structure instance of bmi090l_dev.
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_get_meas_conf(struct bmi090l_dev *dev);
/*!
* \ingroup bmi090laApiConfig
* \page bmi090la_api_bmi090la_set_meas_conf bmi090la_set_meas_conf
* \code
* int8_t bmi090la_set_meas_conf(struct bmi090l_dev *dev);
* \endcode
* @details This API sets the Output data rate, range and bandwidth
* of accel sensor.
* @param[in] dev : Structure instance of bmi090l_dev.
*
* @note : The user must select one among the following macros to
* select range value for BMI09 accel
*
*@verbatim
* config | value
* -------------------------------|---------------------------
* BMI090L_ACCEL_RANGE_3G | 0x00
* BMI090L_ACCEL_RANGE_6G | 0x01
* BMI090L_ACCEL_RANGE_12G | 0x02
* BMI090L_ACCEL_RANGE_24G | 0x03
*@endverbatim
*
* @note : Refer user guide for detailed info.
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_set_meas_conf(struct bmi090l_dev *dev);
/**
* \ingroup bmi090l
* \defgroup bmi090laApiPowermode Accel Power mode
* @brief Set / Get Accel power mode
*/
/*!
* \ingroup bmi090laApiPowermode
* \page bmi090la_api_bmi090la_get_power_mode bmi090la_get_power_mode
* \code
* int8_t bmi090la_get_power_mode(struct bmi090l_dev *dev);
* \endcode
* @details This API reads the accel power mode from the sensor,
* store it in the bmi090l_dev structure instance
* passed by the user.
* @param[in,out] dev : Structure instance of bmi090l_dev.
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_get_power_mode(struct bmi090l_dev *dev);
/*!
* \ingroup bmi090laApiPowermode
* \page bmi090la_api_bmi090la_set_power_mode bmi090la_set_power_mode
* \code
* int8_t bmi090la_set_power_mode(struct bmi090l_dev *dev);
* \endcode
* @details This API sets the power mode of the accel sensor.
*
* @param[in] dev : Structure instance of bmi090l_dev.
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_set_power_mode(struct bmi090l_dev *dev);
/**
* \ingroup bmi090l
* \defgroup bmi090laApiData Accel Data
* @brief Read accel data from the sensor
*/
/*!
* \ingroup bmi090laApiData
* \page bmi090la_api_bmi090la_get_data bmi090la_get_data
* \code
* int8_t bmi090la_get_data(struct bmi090l_sensor_data *accel, struct bmi090l_dev *dev);
* \endcode
* @details This API reads the accel data from the sensor,
* store it in the bmi090l_sensor_data structure instance
* passed by the user.
*
* @param[out] accel : Structure pointer to store accel data
* @param[in] dev : Structure instance of bmi090l_dev.
*
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_get_data(struct bmi090l_sensor_data *accel, struct bmi090l_dev *dev);
/**
* \ingroup bmi090l
* \defgroup bmi090laApiIntConfig Accel Interrupt configurations
* @brief Set accel sensor interrupt configurations
*/
/*!
* \ingroup bmi090laApiIntConfig
* \page bmi090la_api_bmi090la_set_int_config bmi090la_set_int_config
* \code
* int8_t bmi090la_set_int_config(const struct bmi090l_accel_int_channel_cfg *int_config, struct bmi090l_dev *dev);
* \endcode
* @details This API configures the necessary accel interrupt
* based on the user settings in the bmi090l_accel_int_channel_cfg
* structure instance.
*
* @param[in] int_config : Structure instance of bmi090l_accel_int_channel_cfg.
* @param[in] dev : Structure instance of bmi090l_dev.
* @note : Refer user guide for detailed info.
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_set_int_config(const struct bmi090l_accel_int_channel_cfg *int_config, struct bmi090l_dev *dev);
/**
* \ingroup bmi090l
* \defgroup bmi090laApiATemp Accel Temperature
* @brief Get accel sensor temperature
*/
/*!
* \ingroup bmi090laApiATemp
* \page bmi090la_api_bmi090la_get_sensor_temperature bmi090la_get_sensor_temperature
* \code
* int8_t bmi090la_get_sensor_temperature(struct bmi090l_dev *dev, int32_t *sensor_temp);
* \endcode
* @details This API reads the temperature of the sensor in degree Celcius.
*
* @param[in] dev : Structure instance of bmi090l_dev.
* @param[out] sensor_temp : Pointer to store sensor temperature in degree Celcius
*
* @note Temperature data output must be divided by a factor of 1000
*
* Consider sensor_temp = 19520 , Then the actual temperature is 19.520 degree Celsius
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_get_sensor_temperature(struct bmi090l_dev *dev, int32_t *sensor_temp);
/**
* \ingroup bmi090l
* \defgroup bmi090laApiSensortime Accel sensor time
* @brief Get sensor time of accel sensor
*/
/*!
* \ingroup bmi090laApiSensortime
* \page bmi090la_api_bmi090la_get_sensor_time bmi090la_get_sensor_time
* \code
* int8_t bmi090la_get_sensor_time(struct bmi090l_dev *dev, uint32_t *sensor_time);
* \endcode
* @details This API reads the sensor time of the accel sensor.
*
* @param[in] dev : Structure instance of bmi090l_dev.
* @param[out] sensor_time : Pointer to store sensor time
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_get_sensor_time(struct bmi090l_dev *dev, uint32_t *sensor_time);
/**
* \ingroup bmi090l
* \defgroup bmi090laApiSelftest Accel Self test
* @brief Perform self test of accel sensor
*/
/*!
* \ingroup bmi090laApiSelftest
* \page bmi090la_api_bmi090la_perform_selftest bmi090la_perform_selftest
* \code
* int8_t bmi090la_perform_selftest(struct bmi090l_dev *dev);
* \endcode
* @details This API checks whether the self test functionality of the sensor
* is working or not
*
* @param[in] dev : Structure instance of bmi090l_dev
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_perform_selftest(struct bmi090l_dev *dev);
/**
* \ingroup bmi090l
* \defgroup bmi090laApiAConfig Upload config file
* @brief Uploads bmi09 config file onto the device
*/
/*!
* \ingroup bmi090laApiAConfig
* \page bmi090la_api_bmi090la_apply_config_file bmi090la_apply_config_file
* \code
* int8_t bmi090la_apply_config_file(struct bmi090l_dev *dev);
* \endcode
* @details This API uploads the bmi09 config file onto the device.
*
* @param[in,out] dev : Structure instance of bmi090l_dev.
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_apply_config_file(struct bmi090l_dev *dev);
/**
* \ingroup bmi090l
* \defgroup bmi090laApiSyncData Accel Data Synchronization
* @brief Enable / Disable the data synchronization
*/
/*!
* \ingroup bmi090laApiSyncData
* \page bmi090la_api_bmi090la_configure_data_synchronization bmi090la_configure_data_synchronization
* \code
* int8_t bmi090la_configure_data_synchronization(struct bmi090l_data_sync_cfg sync_cfg, struct bmi090l_dev *dev);
* \endcode
* @details This API is used to enable/disable the data synchronization
* feature.
*
* @param[in] sync_cfg : configure sync feature
* @param[in] dev : Structure instance of bmi090l_dev.
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_configure_data_synchronization(struct bmi090l_data_sync_cfg sync_cfg, struct bmi090l_dev *dev);
/**
* \ingroup bmi090l
* \defgroup bmi090laApiAnymotion Accel Anymotion
* @brief Configure anymotion of sensor
*/
/*!
* \ingroup bmi090laApiAnymotion
* \page bmi090la_api_bmi090la_configure_anymotion bmi090la_configure_anymotion
* \code
* int8_t bmi090la_configure_anymotion(struct bmi090l_anymotion_cfg anymotion_cfg, struct bmi090l_dev *dev);
* \endcode
* @details This API is used to enable/disable and configure the anymotion
* feature.
*
* @param[in] anymotion_cfg : configure anymotion feature
* @param[in] dev : Structure instance of bmi090l_dev.
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_configure_anymotion(struct bmi090l_anymotion_cfg anymotion_cfg, struct bmi090l_dev *dev);
/**
* \ingroup bmi090l
* \defgroup bmi090laApiSData Synchronized data read
* @brief Read synchronized accel and gyro data from the sensor
*/
/*!
* \ingroup bmi090laApiSData
* \page bmi090la_api_bmi090la_get_synchronized_data bmi090la_get_synchronized_data
* \code
* int8_t bmi090la_get_synchronized_data(struct bmi090l_sensor_data *accel,
* struct bmi090l_sensor_data *gyro,
* struct bmi090l_dev *dev);
*
* \endcode
* @details This API reads the synchronized accel & gyro data from the sensor,
* store it in the bmi090l_sensor_data structure instance
* passed by the user.
*
* @param[out] accel : Structure pointer to store accel data
* @param[out] gyro : Structure pointer to store gyro data
* @param[in] dev : Structure instance of bmi090l_dev.
*
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_get_synchronized_data(struct bmi090l_sensor_data *accel,
struct bmi090l_sensor_data *gyro,
struct bmi090l_dev *dev);
/**
* \ingroup bmi090l
* \defgroup bmi090laApiInt Synchronized interrupt config
* @brief Configure synchronized interrupt of the sensor
*/
/*!
* \ingroup bmi090laApiInt
* \page bmi090la_api_bmi090la_set_data_sync_int_config bmi090la_set_data_sync_int_config
* \code
* int8_t bmi090la_set_data_sync_int_config(const struct bmi090l_int_cfg *int_config, struct bmi090l_dev *dev);
* \endcode
* @details This API configures the synchronization interrupt
* based on the user settings in the bmi090l_int_cfg
* structure instance.
*
* @param[in] int_config : Structure instance of accel bmi090l_int_cfg.
* @param[in] dev : Structure instance of bmi090l_dev.
* @note : Refer user guide for detailed info.
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_set_data_sync_int_config(const struct bmi090l_int_cfg *int_config, struct bmi090l_dev *dev);
/*!
* \ingroup bmi090laApiInt
* \page bmi090la_api_bmi090la_set_high_g_config bmi090la_set_high_g_config
* \code
* int8_t bmi090la_set_high_g_config(const struct bmi090l_high_g_cfg *config, struct bmi090l_dev *dev);
* \endcode
* @details This API sets high-g configurations like threshold,
* hysteresis and duration.
*
* @param[in] config : Structure to hold low-g settings
* @param[in] dev : Structure instance of bmi090l_dev.
*
* @return Result of API execution status
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_set_high_g_config(const struct bmi090l_high_g_cfg *config, struct bmi090l_dev *dev);
/*!
* \ingroup bmi090laApiInt
* \page bmi090la_api_bmi090la_get_high_g_config bmi090la_get_high_g_config
* \code
* int8_t bmi090la_get_high_g_config(struct bmi090l_high_g_cfg *config, struct bmi090l_dev *dev);
* \endcode
* @details This API gets high-g configurations like threshold,
* hysteresis and duration.
*
* @param[in] config : Structure to hold high-g settings
* @param[in] dev : Structure instance of bmi090l_dev.
*
* @return Result of API execution status
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_get_high_g_config(struct bmi090l_high_g_cfg *config, struct bmi090l_dev *dev);
/*!
* \ingroup bmi090laApiInt
* \page bmi090la_api_bmi090la_set_low_g_config bmi090la_set_low_g_config
* \code
* int8_t bmi090la_set_low_g_config(const struct bmi090l_low_g_cfg *config, struct bmi090l_dev *dev);
* \endcode
* @details This API sets low-g configurations like threshold,
* hysteresis and duration.
*
* @param[in] config : Structure to hold low-g settings
* @param[in] dev : Structure instance of bmi090l_dev.
*
* @return Result of API execution status
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_set_low_g_config(const struct bmi090l_low_g_cfg *config, struct bmi090l_dev *dev);
/*!
* \ingroup bmi090laApiInt
* \page bmi090la_api_bmi090la_get_low_g_config bmi090la_get_low_g_config
* \code
* int8_t bmi090la_get_low_g_config(struct bmi090l_low_g_cfg *config, struct bmi090l_dev *dev);
* \endcode
* @details This API gets low-g configurations like threshold,
* hysteresis and duration.
*
* @param[in] config : Structure to hold low-g settings
* @param[in] dev : Structure instance of bmi090l_dev.
*
* @return Result of API execution status
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_get_low_g_config(struct bmi090l_low_g_cfg *config, struct bmi090l_dev *dev);
/*!
* \ingroup bmi090laApiInt
* \page bmi090la_api_bmi090la_set_no_motion_config bmi090la_set_no_motion_config
* \code
* int8_t bmi090la_set_no_motion_config(const struct bmi090l_no_motion_cfg *config, struct bmi090l_dev *dev);
* \endcode
* @details This API sets and enables no-motion parameters like threshold,
* duration,etc .,
*
* @param[in] config : Structure to hold no-motion settings
* @param[in] dev : Structure instance of bmi090l_dev.
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_set_no_motion_config(const struct bmi090l_no_motion_cfg *config, struct bmi090l_dev *dev);
/*!
* \ingroup bmi090laApiInt
* \page bmi090la_api_bmi090la_get_no_motion_config bmi090la_get_no_motion_config
* \code
* int8_t bmi090la_get_no_motion_config(struct bmi090l_no_motion_cfg *config, struct bmi090l_dev *dev);
* \endcode
* @details This API gets no-motion parameters like threshold,
* duration,etc .,
*
* @param[in] config : Structure to hold no-motion settings
* @param[in] dev : Structure instance of bmi090l_dev.
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_get_no_motion_config(struct bmi090l_no_motion_cfg *config, struct bmi090l_dev *dev);
/*!
* \ingroup bmi090laApiInt
* \page bmi090la_api_bmi090la_set_orient_config bmi090la_set_orient_config
* \code
* int8_t bmi090la_set_orient_config(const struct bmi090l_orient_cfg *config, struct bmi090l_dev *dev);
* \endcode
* @details This API sets orientation parameters like mode, hysteresis, theta, etc.,
*
* @param[in] config : Structure to hold orientation feature settings
* @param[in] dev : Structure instance of bmi090l_dev.
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_set_orient_config(const struct bmi090l_orient_cfg *config, struct bmi090l_dev *dev);
/*!
* \ingroup bmi090laApiInt
* \page bmi090la_api_bmi090la_get_orient_config bmi090la_get_orient_config
* \code
* int8_t bmi090la_get_orient_config(struct bmi090l_orient_cfg *config, struct bmi090l_dev *dev);
* \endcode
* @details This API gets orientation parameters like mode, hysteresis, theta, etc.,
*
* @param[in] config : Structure to hold orientation feature settings
* @param[in] dev : Structure instance of bmi090l_dev.
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_get_orient_config(struct bmi090l_orient_cfg *config, struct bmi090l_dev *dev);
/*!
* \ingroup bmi090laApiInt
* \page bmi090la_api_bmi090la_get_orient_output bmi090la_get_orient_output
* \code
* int8_t bmi090la_get_orient_output(struct bmi090l_orient_out *orient_out, struct bmi090l_dev *dev);
* \endcode
* @details This API gets the output values of orientation: portrait-
* landscape and face up-down.
*
* @param[out] orient_out : Structure instance of bmi090l_orient_out
* @param[in] dev : Structure instance of bmi090l_dev.
*
*
* portrait |
* landscape | Output
* -----------|------------
* 0x00 | PORTRAIT_UPRIGHT
* 0x01 | LANDSCAPE_LEFT
* 0x02 | PORTRAIT_UPSIDE_DOWN
* 0x03 | LANDSCAPE_RIGHT
*
* Face |
* up-down | Output
* -----------|------------
* 0x00 | FACE_UP
* 0x01 | FACE_DOWN
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_get_orient_output(struct bmi090l_orient_out *orient_out, struct bmi090l_dev *dev);
/*!
* \ingroup bmi090laApiInt
* \page bmi090la_api_bmi090la_get_high_g_output bmi090la_get_high_g_output
* \code
* int8_t bmi090la_get_high_g_output(struct bmi090l_high_g_out *high_g_out, struct bmi090l_dev *dev);
* \endcode
* @details This API gets the output values of high_g: Axis and Direction
*
* @param[out] high_g_out : Structure instance of bmi090l_high_g_out
* @param[in] dev : Structure instance of bmi090l_dev.
*
* Direction | Output
* -----------|-----------------
* 0x00 | Positive axis
* 0x01 | Negative axis
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_get_high_g_output(struct bmi090l_high_g_out *high_g_out, struct bmi090l_dev *dev);
/*!
* \ingroup bmi090laApiInt
* \page bmi090la_api_bmi090la_get_data_int_status bmi090la_get_data_int_status
* \code
* int8_t bmi090la_get_data_int_status(uint8_t *int_status, struct bmi090l_dev *dev);
* \endcode
* @details This API is to get accel data ready interrupt status
*
* @param[out] int_status : Variable to store interrupt status
* @param[in] dev : Structure instance of bmi090l_dev
*
*@verbatim
*-----------------------------------------
* int_status | Interrupt
*-----------------------------------------
* 0x01 | Fifo full
* 0x02 | Fifo watermark
* 0x08 | Accel data ready
*------------------------------------------
*@endverbatim
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_get_data_int_status(uint8_t *int_status, struct bmi090l_dev *dev);
/*!
* \ingroup bmi090laApiInt
* \page bmi090la_api_bmi090la_get_feat_int_status bmi090la_get_feat_int_status
* \code
* int8_t bmi090la_get_feat_int_status(uint8_t *int_status, struct bmi090l_dev *dev);
* \endcode
* @details This API is to get accel feature interrupt status
*
* @param[out] int_status : Variable to store interrupt status
* @param[in] dev : Structure instance of bmi090l_dev
*
*@verbatim
*-----------------------------------------
* int_status | Interrupt
*-----------------------------------------
* 0x01 | Data sync
* 0x02 | Any-Motion
* 0x04 | High-g
* 0x08 | Low-g
* 0x16 | Orient
* 0x32 | No-motion
*------------------------------------------
*@endverbatim
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_get_feat_int_status(uint8_t *int_status, struct bmi090l_dev *dev);
/**
* \ingroup bmi090l
* \defgroup bmi090laApiRemap Axis Remap
* @brief Functions of axis remapping of bmi09 sensor
*/
/*!
* \ingroup bmi090laApiRemap
* @brief Set / Get x, y and z axis re-mapping in the sensor
* \page bmi090la_api_bmi090la_set_remap_axes bmi090la_set_remap_axes
* \code
* int8_t bmi090la_set_remap_axes(const struct bmi090l_remap *remapped_axis, struct bmi090l_dev *dev);
* \endcode
* @details This API sets the re-mapped x, y and z axes to the sensor and
* updates them in the device structure.
*
* @param[in] remapped_axis : Pointer to store axes re-mapping data.
* @param[in] dev : Structure instance of bmi090l_dev.
*
* @return Result of API execution status.
*
* @return 0 -> Success
* @return < 0 -> Fail
*
*/
int8_t bmi090la_set_remap_axes(const struct bmi090l_remap *remapped_axis, struct bmi090l_dev *dev);
/*!
* \ingroup bmi090laApiRemap
* \page bmi090l_api_bmi090la_get_remap_axes bmi090la_get_remap_axes
* \code
* int8_t bmi090la_get_remap_axes(struct bmi090l_remap *remapped_axis, struct bmi090l_dev *dev);
* \endcode
* @details This API gets the re-mapped x, y and z axes from the sensor and
* updates the values in the device structure.
*
* @param[out] remapped_axis : Structure instance of bmi090l_remap
* @param[in] dev : Structure instance of bmi090l_dev
*
* @return Result of API execution status.
*
* @return 0 -> Success
* @return < 0 -> Fail
*
*/
int8_t bmi090la_get_remap_axes(struct bmi090l_remap *remapped_axis, struct bmi090l_dev *dev);
/**
* \ingroup bmi090l
* \defgroup bmi090laApiFIFO FIFO Operations
* @brief Various FIFO operations on bmi09 sensor
*/
/*!
* \ingroup bmi090laApiFIFO
* \page bmi090la_api_bmi090la_set_fifo_config bmi090la_set_fifo_config
* \code
* int8_t bmi090la_set_fifo_config(const struct bmi090l_accel_fifo_config *config, struct bmi090l_dev *dev);
* \endcode
* @details This API sets the FIFO configuration in the sensor.
*
* @param[in] config : Structure instance of FIFO configurations.
* @param[in] dev : Structure instance of bmi090l_dev.
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_set_fifo_config(const struct bmi090l_accel_fifo_config *config, struct bmi090l_dev *dev);
/*!
* \ingroup bmi090laApiFIFO
* \page bmi090la_api_bmi090la_get_fifo_config bmi090la_get_fifo_config
* \code
* int8_t bmi090la_get_fifo_config(struct bmi090l_accel_fifo_config *config, struct bmi090l_dev *dev);
* \endcode
* @details This API gets the FIFO configuration from the sensor.
*
* @param[out] config : Structure instance to get FIFO configuration value.
* @param[in] dev : Structure instance of bmi090l_dev.
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_get_fifo_config(struct bmi090l_accel_fifo_config *config, struct bmi090l_dev *dev);
/*!
* \ingroup bmi090laApiFIFO
* \page bmi090la_api_bmi090la_read_fifo_data bmi090la_read_fifo_data
* \code
* int8_t bmi090la_read_fifo_data(struct bmi090l_fifo_frame *fifo, struct bmi090l_dev *dev);
* \endcode
* @details This API reads FIFO data.
*
* @param[in, out] fifo : Structure instance of bmi090l_fifo_frame.
* @param[in] dev : Structure instance of bmi090l_dev.
*
* @note APS has to be disabled before calling this function.
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_read_fifo_data(struct bmi090l_fifo_frame *fifo, struct bmi090l_dev *dev);
/*!
* \ingroup bmi090laApiFIFO
* \page bmi090la_api_bmi090la_get_fifo_length bmi090la_get_fifo_length
* \code
* int8_t bmi090la_get_fifo_length(uint16_t *fifo_length, struct bmi090l_dev *dev);
* \endcode
* @details This API gets the length of FIFO data available in the sensor in
* bytes.
*
* @param[out] fifo_length : Pointer variable to store the value of FIFO byte
* counter.
* @param[in] dev : Structure instance of bmi090l_dev.
*
* @note The byte counter is updated each time a complete frame is read or
* written.
*
* @return Result of API execution status
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
int8_t bmi090la_get_fifo_length(uint16_t *fifo_length, struct bmi090l_dev *dev);
/*!
* \ingroup bmi090laApiFIFO
* \page bmi090la_api_bmi090la_get_fifo_wm bmi090la_get_fifo_wm
* \code