STSW-STLKT01: Drivers/BSP/SensorTile/SensorTile_gyro.c Source File

STSW-STLKT01

STSW-STLKT01
SensorTile_gyro.c
Go to the documentation of this file.
1 
39 /* Includes ------------------------------------------------------------------*/
40 #include "SensorTile_gyro.h"
41 
42 
43 
62 static DrvContextTypeDef GYRO_SensorHandle[ GYRO_SENSORS_MAX_NUM ];
63 static GYRO_Data_t GYRO_Data[ GYRO_SENSORS_MAX_NUM ]; // Gyroscope - all.
64 static LSM6DSM_G_Data_t LSM6DSM_G_0_Data; // Gyroscope - sensor 0.
72 static DrvStatusTypeDef BSP_LSM6DSM_GYRO_Init( void **handle );
88 DrvStatusTypeDef BSP_GYRO_Init( GYRO_ID_t id, void **handle )
89 {
90 
91  *handle = NULL;
92 
93  switch(id)
94  {
95  case GYRO_SENSORS_AUTO:
96  default:
97  {
98  if( BSP_LSM6DSM_GYRO_Init(handle) == COMPONENT_ERROR )
99  {
100  return COMPONENT_ERROR;
101  }
102  break;
103  }
104  case LSM6DSM_G_0:
105  {
106  if( BSP_LSM6DSM_GYRO_Init(handle) == COMPONENT_ERROR )
107  {
108  return COMPONENT_ERROR;
109  }
110  break;
111  }
112  }
113 
114  return COMPONENT_OK;
115 }
116 
117 
118 
119 static DrvStatusTypeDef BSP_LSM6DSM_GYRO_Init( void **handle )
120 {
121  GYRO_Drv_t *driver = NULL;
122  uint8_t data = 0x0C;
123 
124  if(GYRO_SensorHandle[ LSM6DSM_G_0 ].isInitialized == 1)
125  {
126  /* We have reached the max num of instance for this component */
127  return COMPONENT_ERROR;
128  }
129 
130  if ( Sensor_IO_SPI_Init() == COMPONENT_ERROR )
131  {
132  return COMPONENT_ERROR;
133  }
134 
135  /* Setup sensor handle. */
136  /* Gyroscope - sensor 0 */
137  GYRO_SensorHandle[ LSM6DSM_G_0 ].who_am_i = LSM6DSM_ACC_GYRO_WHO_AM_I;
138  GYRO_SensorHandle[ LSM6DSM_G_0 ].ifType = 1; // SPI interface
139  GYRO_SensorHandle[ LSM6DSM_G_0 ].address = LSM6DSM_ACC_GYRO_I2C_ADDRESS_HIGH;
140  GYRO_SensorHandle[ LSM6DSM_G_0 ].spiDevice = LSM6DSM;
141  GYRO_SensorHandle[ LSM6DSM_G_0 ].instance = LSM6DSM_G_0;
142  GYRO_SensorHandle[ LSM6DSM_G_0 ].isInitialized = 0;
143  GYRO_SensorHandle[ LSM6DSM_G_0 ].isEnabled = 0;
144  GYRO_SensorHandle[ LSM6DSM_G_0 ].isCombo = 1;
145  GYRO_SensorHandle[ LSM6DSM_G_0 ].pData = ( void * )&GYRO_Data[ LSM6DSM_G_0 ];
146  GYRO_SensorHandle[ LSM6DSM_G_0 ].pVTable = ( void * )&LSM6DSM_G_Drv;
147  GYRO_SensorHandle[ LSM6DSM_G_0 ].pExtVTable = 0;
148 
149  LSM6DSM_G_0_Data.comboData = &LSM6DSM_Combo_Data[0];
150  GYRO_Data[ LSM6DSM_G_0 ].pComponentData = ( void * )&LSM6DSM_G_0_Data;
151  GYRO_Data[ LSM6DSM_G_0 ].pExtData = 0;
152 
153  *handle = (void *)&GYRO_SensorHandle[ LSM6DSM_G_0 ];
154 
155  Sensor_IO_SPI_CS_Init(*handle);
156 
157  if(LSM6DSM_Combo_Data[0].isAccInitialized == 0)
158  {
159  // SPI Serial Interface Mode selection --> 3Wires
160  if( Sensor_IO_Write(*handle, LSM6DSM_ACC_GYRO_CTRL3_C, &data, 1) )
161  {
162  return COMPONENT_ERROR;
163  }
164  }
165 
166  driver = ( GYRO_Drv_t * )((DrvContextTypeDef *)(*handle))->pVTable;
167 
168  if ( driver->Init == NULL )
169  {
170  memset((*handle), 0, sizeof(DrvContextTypeDef));
171  *handle = NULL;
172  return COMPONENT_ERROR;
173  }
174 
175  if ( driver->Init( (DrvContextTypeDef *)(*handle) ) == COMPONENT_ERROR )
176  {
177  memset((*handle), 0, sizeof(DrvContextTypeDef));
178  *handle = NULL;
179  return COMPONENT_ERROR;
180  }
181 
182  /* Disable I2C interface */
183  if ( LSM6DSM_ACC_GYRO_W_I2C_DISABLE( *handle, LSM6DSM_ACC_GYRO_I2C_DISABLE_SPI_ONLY ) == MEMS_ERROR )
184  {
185  return COMPONENT_ERROR;
186  }
187 
188  return COMPONENT_OK;
189 }
190 
191 
198 DrvStatusTypeDef BSP_GYRO_DeInit( void **handle )
199 {
200 
201  DrvContextTypeDef *ctx = (DrvContextTypeDef *)(*handle);
202  GYRO_Drv_t *driver = NULL;
203 
204  if(ctx == NULL)
205  {
206  return COMPONENT_ERROR;
207  }
208 
209  driver = ( GYRO_Drv_t * )ctx->pVTable;
210 
211  if ( driver->DeInit == NULL )
212  {
213  return COMPONENT_ERROR;
214  }
215 
216  if ( driver->DeInit( ctx ) == COMPONENT_ERROR )
217  {
218  return COMPONENT_ERROR;
219  }
220 
221  memset(ctx, 0, sizeof(DrvContextTypeDef));
222 
223  *handle = NULL;
224 
225  return COMPONENT_OK;
226 }
227 
228 
229 
236 DrvStatusTypeDef BSP_GYRO_Sensor_Enable( void *handle )
237 {
238 
239  DrvContextTypeDef *ctx = (DrvContextTypeDef *)handle;
240  GYRO_Drv_t *driver = NULL;
241 
242  if(ctx == NULL)
243  {
244  return COMPONENT_ERROR;
245  }
246 
247  driver = ( GYRO_Drv_t * )ctx->pVTable;
248 
249  if ( driver->Sensor_Enable == NULL )
250  {
251  return COMPONENT_ERROR;
252  }
253 
254  if ( driver->Sensor_Enable( ctx ) == COMPONENT_ERROR )
255  {
256  return COMPONENT_ERROR;
257  }
258 
259  return COMPONENT_OK;
260 }
261 
262 
263 
270 DrvStatusTypeDef BSP_GYRO_Sensor_Disable( void *handle )
271 {
272 
273  DrvContextTypeDef *ctx = (DrvContextTypeDef *)handle;
274  GYRO_Drv_t *driver = NULL;
275 
276  if(ctx == NULL)
277  {
278  return COMPONENT_ERROR;
279  }
280 
281  driver = ( GYRO_Drv_t * )ctx->pVTable;
282 
283  if ( driver->Sensor_Disable == NULL )
284  {
285  return COMPONENT_ERROR;
286  }
287 
288  if ( driver->Sensor_Disable( ctx ) == COMPONENT_ERROR )
289  {
290  return COMPONENT_ERROR;
291  }
292 
293  return COMPONENT_OK;
294 }
295 
296 
304 DrvStatusTypeDef BSP_GYRO_IsInitialized( void *handle, uint8_t *status )
305 {
306  DrvContextTypeDef *ctx = (DrvContextTypeDef *)handle;
307 
308  if(ctx == NULL)
309  {
310  return COMPONENT_ERROR;
311  }
312 
313  if ( status == NULL )
314  {
315  return COMPONENT_ERROR;
316  }
317 
318  *status = ctx->isInitialized;
319 
320  return COMPONENT_OK;
321 }
322 
323 
331 DrvStatusTypeDef BSP_GYRO_IsEnabled( void *handle, uint8_t *status )
332 {
333  DrvContextTypeDef *ctx = (DrvContextTypeDef *)handle;
334 
335  if(ctx == NULL)
336  {
337  return COMPONENT_ERROR;
338  }
339 
340  if ( status == NULL )
341  {
342  return COMPONENT_ERROR;
343  }
344 
345  *status = ctx->isEnabled;
346 
347  return COMPONENT_OK;
348 }
349 
350 
358 DrvStatusTypeDef BSP_GYRO_IsCombo( void *handle, uint8_t *status )
359 {
360  DrvContextTypeDef *ctx = (DrvContextTypeDef *)handle;
361 
362  if(ctx == NULL)
363  {
364  return COMPONENT_ERROR;
365  }
366 
367  if ( status == NULL )
368  {
369  return COMPONENT_ERROR;
370  }
371 
372  *status = ctx->isCombo;
373 
374  return COMPONENT_OK;
375 }
376 
377 
385 DrvStatusTypeDef BSP_GYRO_Get_Instance( void *handle, uint8_t *instance )
386 {
387  DrvContextTypeDef *ctx = (DrvContextTypeDef *)handle;
388 
389  if(ctx == NULL)
390  {
391  return COMPONENT_ERROR;
392  }
393 
394  if ( instance == NULL )
395  {
396  return COMPONENT_ERROR;
397  }
398 
399  *instance = ctx->instance;
400 
401  return COMPONENT_OK;
402 }
403 
404 
405 
413 DrvStatusTypeDef BSP_GYRO_Get_WhoAmI( void *handle, uint8_t *who_am_i )
414 {
415 
416  DrvContextTypeDef *ctx = (DrvContextTypeDef *)handle;
417  GYRO_Drv_t *driver = NULL;
418 
419  if(ctx == NULL)
420  {
421  return COMPONENT_ERROR;
422  }
423 
424  driver = ( GYRO_Drv_t * )ctx->pVTable;
425 
426  if ( who_am_i == NULL )
427  {
428  return COMPONENT_ERROR;
429  }
430  if ( driver->Get_WhoAmI == NULL )
431  {
432  return COMPONENT_ERROR;
433  }
434  if ( driver->Get_WhoAmI( ctx, who_am_i ) == COMPONENT_ERROR )
435  {
436  return COMPONENT_ERROR;
437  }
438 
439  return COMPONENT_OK;
440 }
441 
442 
443 
450 DrvStatusTypeDef BSP_GYRO_Check_WhoAmI( void *handle )
451 {
452 
453  DrvContextTypeDef *ctx = (DrvContextTypeDef *)handle;
454  GYRO_Drv_t *driver = NULL;
455 
456  if(ctx == NULL)
457  {
458  return COMPONENT_ERROR;
459  }
460 
461  driver = ( GYRO_Drv_t * )ctx->pVTable;
462 
463  if ( driver->Check_WhoAmI == NULL )
464  {
465  return COMPONENT_ERROR;
466  }
467  if ( driver->Check_WhoAmI( ctx ) == COMPONENT_ERROR )
468  {
469  return COMPONENT_ERROR;
470  }
471 
472  return COMPONENT_OK;
473 }
474 
475 
476 
484 DrvStatusTypeDef BSP_GYRO_Get_Axes( void *handle, SensorAxes_t *angular_velocity )
485 {
486 
487  DrvContextTypeDef *ctx = (DrvContextTypeDef *)handle;
488  GYRO_Drv_t *driver = NULL;
489 
490  if(ctx == NULL)
491  {
492  return COMPONENT_ERROR;
493  }
494 
495  driver = ( GYRO_Drv_t * )ctx->pVTable;
496 
497  if ( angular_velocity == NULL )
498  {
499  return COMPONENT_ERROR;
500  }
501  if ( driver->Get_Axes == NULL )
502  {
503  return COMPONENT_ERROR;
504  }
505  if ( driver->Get_Axes( ctx, angular_velocity ) == COMPONENT_ERROR )
506  {
507  return COMPONENT_ERROR;
508  }
509 
510  return COMPONENT_OK;
511 }
512 
513 
514 
522 DrvStatusTypeDef BSP_GYRO_Get_AxesRaw( void *handle, SensorAxesRaw_t *value )
523 {
524 
525  DrvContextTypeDef *ctx = (DrvContextTypeDef *)handle;
526  GYRO_Drv_t *driver = NULL;
527 
528  if(ctx == NULL)
529  {
530  return COMPONENT_ERROR;
531  }
532 
533  driver = ( GYRO_Drv_t * )ctx->pVTable;
534 
535  if ( value == NULL )
536  {
537  return COMPONENT_ERROR;
538  }
539 
540  if ( driver->Get_AxesRaw == NULL )
541  {
542  return COMPONENT_ERROR;
543  }
544 
545  if ( driver->Get_AxesRaw( ctx, value ) == COMPONENT_ERROR )
546  {
547  return COMPONENT_ERROR;
548  }
549 
550  return COMPONENT_OK;
551 }
552 
553 
561 DrvStatusTypeDef BSP_GYRO_Get_Sensitivity( void *handle, float *sensitivity )
562 {
563 
564  DrvContextTypeDef *ctx = (DrvContextTypeDef *)handle;
565  GYRO_Drv_t *driver = NULL;
566 
567  if(ctx == NULL)
568  {
569  return COMPONENT_ERROR;
570  }
571 
572  driver = ( GYRO_Drv_t * )ctx->pVTable;
573 
574  if ( sensitivity == NULL )
575  {
576  return COMPONENT_ERROR;
577  }
578  if ( driver->Get_Sensitivity == NULL )
579  {
580  return COMPONENT_ERROR;
581  }
582  if ( driver->Get_Sensitivity( ctx, sensitivity ) == COMPONENT_ERROR )
583  {
584  return COMPONENT_ERROR;
585  }
586 
587  return COMPONENT_OK;
588 }
589 
590 
591 
599 DrvStatusTypeDef BSP_GYRO_Get_ODR( void *handle, float *odr )
600 {
601 
602  DrvContextTypeDef *ctx = (DrvContextTypeDef *)handle;
603  GYRO_Drv_t *driver = NULL;
604 
605  if(ctx == NULL)
606  {
607  return COMPONENT_ERROR;
608  }
609 
610  driver = ( GYRO_Drv_t * )ctx->pVTable;
611 
612  if ( odr == NULL )
613  {
614  return COMPONENT_ERROR;
615  }
616  if ( driver->Get_ODR == NULL )
617  {
618  return COMPONENT_ERROR;
619  }
620  if ( driver->Get_ODR( ctx, odr ) == COMPONENT_ERROR )
621  {
622  return COMPONENT_ERROR;
623  }
624 
625  return COMPONENT_OK;
626 }
627 
628 
629 
637 DrvStatusTypeDef BSP_GYRO_Set_ODR( void *handle, SensorOdr_t odr )
638 {
639 
640  DrvContextTypeDef *ctx = (DrvContextTypeDef *)handle;
641  GYRO_Drv_t *driver = NULL;
642 
643  if(ctx == NULL)
644  {
645  return COMPONENT_ERROR;
646  }
647 
648  driver = ( GYRO_Drv_t * )ctx->pVTable;
649 
650  if ( driver->Set_ODR == NULL )
651  {
652  return COMPONENT_ERROR;
653  }
654  if ( driver->Set_ODR( ctx, odr ) == COMPONENT_ERROR )
655  {
656  return COMPONENT_ERROR;
657  }
658 
659  return COMPONENT_OK;
660 }
661 
662 
663 
671 DrvStatusTypeDef BSP_GYRO_Set_ODR_Value( void *handle, float odr )
672 {
673 
674  DrvContextTypeDef *ctx = (DrvContextTypeDef *)handle;
675  GYRO_Drv_t *driver = NULL;
676 
677  if(ctx == NULL)
678  {
679  return COMPONENT_ERROR;
680  }
681 
682  driver = ( GYRO_Drv_t * )ctx->pVTable;
683 
684  if ( driver->Set_ODR_Value == NULL )
685  {
686  return COMPONENT_ERROR;
687  }
688  if ( driver->Set_ODR_Value( ctx, odr ) == COMPONENT_ERROR )
689  {
690  return COMPONENT_ERROR;
691  }
692 
693  return COMPONENT_OK;
694 }
695 
696 
697 
705 DrvStatusTypeDef BSP_GYRO_Get_FS( void *handle, float *fullScale )
706 {
707 
708  DrvContextTypeDef *ctx = (DrvContextTypeDef *)handle;
709  GYRO_Drv_t *driver = NULL;
710 
711  if(ctx == NULL)
712  {
713  return COMPONENT_ERROR;
714  }
715 
716  driver = ( GYRO_Drv_t * )ctx->pVTable;
717 
718  if ( fullScale == NULL )
719  {
720  return COMPONENT_ERROR;
721  }
722  if ( driver->Get_FS == NULL )
723  {
724  return COMPONENT_ERROR;
725  }
726  if ( driver->Get_FS( ctx, fullScale ) == COMPONENT_ERROR )
727  {
728  return COMPONENT_ERROR;
729  }
730 
731  return COMPONENT_OK;
732 }
733 
734 
735 
743 DrvStatusTypeDef BSP_GYRO_Set_FS( void *handle, SensorFs_t fullScale )
744 {
745 
746  DrvContextTypeDef *ctx = (DrvContextTypeDef *)handle;
747  GYRO_Drv_t *driver = NULL;
748 
749  if(ctx == NULL)
750  {
751  return COMPONENT_ERROR;
752  }
753 
754  driver = ( GYRO_Drv_t * )ctx->pVTable;
755 
756  if ( driver->Set_FS == NULL )
757  {
758  return COMPONENT_ERROR;
759  }
760  if ( driver->Set_FS( ctx, fullScale ) == COMPONENT_ERROR )
761  {
762  return COMPONENT_ERROR;
763  }
764 
765  return COMPONENT_OK;
766 }
767 
768 
769 
777 DrvStatusTypeDef BSP_GYRO_Set_FS_Value( void *handle, float fullScale )
778 {
779 
780  DrvContextTypeDef *ctx = (DrvContextTypeDef *)handle;
781  GYRO_Drv_t *driver = NULL;
782 
783  if(ctx == NULL)
784  {
785  return COMPONENT_ERROR;
786  }
787 
788  driver = ( GYRO_Drv_t * )ctx->pVTable;
789 
790  if ( driver->Set_FS_Value == NULL )
791  {
792  return COMPONENT_ERROR;
793  }
794  if ( driver->Set_FS_Value( ctx, fullScale ) == COMPONENT_ERROR )
795  {
796  return COMPONENT_ERROR;
797  }
798 
799  return COMPONENT_OK;
800 }
801 
802 
803 
811 DrvStatusTypeDef BSP_GYRO_Get_Axes_Status( void *handle, uint8_t *xyz_enabled )
812 {
813 
814  DrvContextTypeDef *ctx = (DrvContextTypeDef *)handle;
815  GYRO_Drv_t *driver = NULL;
816 
817  if(ctx == NULL)
818  {
819  return COMPONENT_ERROR;
820  }
821 
822  driver = ( GYRO_Drv_t * )ctx->pVTable;
823 
824  if ( xyz_enabled == NULL )
825  {
826  return COMPONENT_ERROR;
827  }
828  if ( driver->Get_Axes_Status == NULL )
829  {
830  return COMPONENT_ERROR;
831  }
832  if ( driver->Get_Axes_Status( ctx, xyz_enabled ) == COMPONENT_ERROR )
833  {
834  return COMPONENT_ERROR;
835  }
836 
837  return COMPONENT_OK;
838 }
839 
840 
849 DrvStatusTypeDef BSP_GYRO_Read_Reg( void *handle, uint8_t reg, uint8_t *data )
850 {
851 
852  DrvContextTypeDef *ctx = (DrvContextTypeDef *)handle;
853  GYRO_Drv_t *driver = NULL;
854 
855  if(ctx == NULL)
856  {
857  return COMPONENT_ERROR;
858  }
859 
860  driver = ( GYRO_Drv_t * )ctx->pVTable;
861 
862  if(data == NULL)
863  {
864  return COMPONENT_ERROR;
865  }
866 
867  if ( driver->Read_Reg == NULL )
868  {
869  return COMPONENT_ERROR;
870  }
871 
872  if ( driver->Read_Reg( ctx, reg, data ) == COMPONENT_ERROR )
873  {
874  return COMPONENT_ERROR;
875  }
876 
877  return COMPONENT_OK;
878 }
879 
880 
889 DrvStatusTypeDef BSP_GYRO_Write_Reg( void *handle, uint8_t reg, uint8_t data )
890 {
891 
892  DrvContextTypeDef *ctx = (DrvContextTypeDef *)handle;
893  GYRO_Drv_t *driver = NULL;
894 
895  if(ctx == NULL)
896  {
897  return COMPONENT_ERROR;
898  }
899 
900  driver = ( GYRO_Drv_t * )ctx->pVTable;
901 
902  if ( driver->Write_Reg == NULL )
903  {
904  return COMPONENT_ERROR;
905  }
906 
907  if ( driver->Write_Reg( ctx, reg, data ) == COMPONENT_ERROR )
908  {
909  return COMPONENT_ERROR;
910  }
911 
912  return COMPONENT_OK;
913 }
914 
915 
923 DrvStatusTypeDef BSP_GYRO_Get_DRDY_Status( void *handle, uint8_t *status )
924 {
925 
926  DrvContextTypeDef *ctx = (DrvContextTypeDef *)handle;
927  GYRO_Drv_t *driver = NULL;
928 
929  if(ctx == NULL)
930  {
931  return COMPONENT_ERROR;
932  }
933 
934  driver = ( GYRO_Drv_t * )ctx->pVTable;
935 
936  if ( driver->Get_DRDY_Status == NULL )
937  {
938  return COMPONENT_ERROR;
939  }
940 
941  if ( driver->Get_DRDY_Status( ctx, status ) == COMPONENT_ERROR )
942  {
943  return COMPONENT_ERROR;
944  }
945 
946  return COMPONENT_OK;
947 }
948 
949 
957 DrvStatusTypeDef BSP_GYRO_Set_Axes_Status( void *handle, uint8_t *enable_xyz )
958 {
959 
960  DrvContextTypeDef *ctx = (DrvContextTypeDef *)handle;
961  GYRO_Drv_t *driver = NULL;
962 
963  if(ctx == NULL)
964  {
965  return COMPONENT_ERROR;
966  }
967 
968  driver = ( GYRO_Drv_t * )ctx->pVTable;
969 
970  if ( enable_xyz == NULL )
971  {
972  return COMPONENT_ERROR;
973  }
974  if ( driver->Set_Axes_Status == NULL )
975  {
976  return COMPONENT_ERROR;
977  }
978  if ( driver->Set_Axes_Status( ctx, enable_xyz ) == COMPONENT_ERROR )
979  {
980  return COMPONENT_ERROR;
981  }
982 
983  return COMPONENT_OK;
984 }
985 
1002 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
DrvStatusTypeDef BSP_GYRO_Get_Axes_Status(void *handle, uint8_t *xyz_enabled)
Get the gyroscope sensor axes status.
DrvStatusTypeDef BSP_GYRO_Get_WhoAmI(void *handle, uint8_t *who_am_i)
Get the WHO_AM_I ID of the gyroscope sensor.
DrvStatusTypeDef BSP_GYRO_Sensor_Disable(void *handle)
Disable gyroscope sensor.
DrvStatusTypeDef BSP_GYRO_IsEnabled(void *handle, uint8_t *status)
Check if the gyroscope sensor is enabled.
DrvStatusTypeDef BSP_GYRO_Set_FS_Value(void *handle, float fullScale)
Set the gyroscope sensor full scale.
DrvStatusTypeDef BSP_GYRO_Write_Reg(void *handle, uint8_t reg, uint8_t data)
Write the data to register.
DrvStatusTypeDef BSP_GYRO_Init(GYRO_ID_t id, void **handle)
Initialize a gyroscope sensor.
DrvStatusTypeDef BSP_GYRO_Set_FS(void *handle, SensorFs_t fullScale)
Set the gyroscope sensor full scale.
uint8_t Sensor_IO_Write(void *handle, uint8_t WriteAddr, uint8_t *pBuffer, uint16_t nBytesToWrite)
Writes a buffer to the sensor.
Definition: SensorTile.c:427
DrvStatusTypeDef BSP_GYRO_Read_Reg(void *handle, uint8_t reg, uint8_t *data)
Read the data from register.
DrvStatusTypeDef Sensor_IO_SPI_Init(void)
Configures sensor SPI interface.
Definition: SensorTile.c:293
This file contains definitions for SensorTile_gyro.c driver.
DrvStatusTypeDef BSP_GYRO_Get_Sensitivity(void *handle, float *sensitivity)
Get the gyroscope sensor sensitivity.
DrvStatusTypeDef BSP_GYRO_IsCombo(void *handle, uint8_t *status)
Check if the gyroscope sensor is combo.
DrvStatusTypeDef BSP_GYRO_Check_WhoAmI(void *handle)
Check the WHO_AM_I ID of the gyroscope sensor.
DrvStatusTypeDef BSP_GYRO_Set_ODR(void *handle, SensorOdr_t odr)
Set the gyroscope sensor output data rate.
DrvStatusTypeDef BSP_GYRO_DeInit(void **handle)
Deinitialize a gyroscope sensor.
DrvStatusTypeDef BSP_GYRO_Get_Axes(void *handle, SensorAxes_t *angular_velocity)
Get the gyroscope sensor axes.
DrvStatusTypeDef BSP_GYRO_Get_ODR(void *handle, float *odr)
Get the gyroscope sensor output data rate.
DrvStatusTypeDef BSP_GYRO_Get_Instance(void *handle, uint8_t *instance)
Get the gyroscope sensor instance.
DrvStatusTypeDef BSP_GYRO_Sensor_Enable(void *handle)
Enable gyroscope sensor.
DrvStatusTypeDef BSP_GYRO_Get_DRDY_Status(void *handle, uint8_t *status)
Get gyroscope data ready status.
DrvStatusTypeDef BSP_GYRO_Get_FS(void *handle, float *fullScale)
Get the gyroscope sensor full scale.
DrvStatusTypeDef BSP_GYRO_Set_Axes_Status(void *handle, uint8_t *enable_xyz)
Set the enabled/disabled status of the gyroscope sensor axes.
DrvStatusTypeDef BSP_GYRO_Get_AxesRaw(void *handle, SensorAxesRaw_t *value)
Get the gyroscope sensor raw axes.
DrvStatusTypeDef BSP_GYRO_Set_ODR_Value(void *handle, float odr)
Set the gyroscope sensor output data rate.
DrvStatusTypeDef BSP_GYRO_IsInitialized(void *handle, uint8_t *status)
Check if the gyroscope sensor is initialized.
Generated by   doxygen 1.8.13