Pierre Bizouard / BSP_DISCO_F429ZI

Dependents:   DISCO-F429ZI_LCDTS_demo_richard

Fork of BSP_DISCO_F429ZI by ST

Committer:
pierrebizouard
Date:
Fri Mar 16 09:50:17 2018 +0000
Revision:
5:a76cfea518cc
Parent:
1:2371382139dd
final version 1.0

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Jerome Coutant 1:2371382139dd 1 /**
Jerome Coutant 1:2371382139dd 2 ******************************************************************************
Jerome Coutant 1:2371382139dd 3 * @file gyro.h
Jerome Coutant 1:2371382139dd 4 * @author MCD Application Team
Jerome Coutant 1:2371382139dd 5 * @version V4.0.1
Jerome Coutant 1:2371382139dd 6 * @date 21-July-2015
Jerome Coutant 1:2371382139dd 7 * @brief This header file contains the functions prototypes for the gyroscope driver.
Jerome Coutant 1:2371382139dd 8 ******************************************************************************
Jerome Coutant 1:2371382139dd 9 * @attention
Jerome Coutant 1:2371382139dd 10 *
Jerome Coutant 1:2371382139dd 11 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
Jerome Coutant 1:2371382139dd 12 *
Jerome Coutant 1:2371382139dd 13 * Redistribution and use in source and binary forms, with or without modification,
Jerome Coutant 1:2371382139dd 14 * are permitted provided that the following conditions are met:
Jerome Coutant 1:2371382139dd 15 * 1. Redistributions of source code must retain the above copyright notice,
Jerome Coutant 1:2371382139dd 16 * this list of conditions and the following disclaimer.
Jerome Coutant 1:2371382139dd 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Jerome Coutant 1:2371382139dd 18 * this list of conditions and the following disclaimer in the documentation
Jerome Coutant 1:2371382139dd 19 * and/or other materials provided with the distribution.
Jerome Coutant 1:2371382139dd 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Jerome Coutant 1:2371382139dd 21 * may be used to endorse or promote products derived from this software
Jerome Coutant 1:2371382139dd 22 * without specific prior written permission.
Jerome Coutant 1:2371382139dd 23 *
Jerome Coutant 1:2371382139dd 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Jerome Coutant 1:2371382139dd 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Jerome Coutant 1:2371382139dd 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Jerome Coutant 1:2371382139dd 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Jerome Coutant 1:2371382139dd 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Jerome Coutant 1:2371382139dd 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Jerome Coutant 1:2371382139dd 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Jerome Coutant 1:2371382139dd 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Jerome Coutant 1:2371382139dd 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Jerome Coutant 1:2371382139dd 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Jerome Coutant 1:2371382139dd 34 *
Jerome Coutant 1:2371382139dd 35 ******************************************************************************
Jerome Coutant 1:2371382139dd 36 */
Jerome Coutant 1:2371382139dd 37
Jerome Coutant 1:2371382139dd 38
Jerome Coutant 1:2371382139dd 39 /* Define to prevent recursive inclusion -------------------------------------*/
Jerome Coutant 1:2371382139dd 40 #ifndef __GYRO_H
Jerome Coutant 1:2371382139dd 41 #define __GYRO_H
Jerome Coutant 1:2371382139dd 42
Jerome Coutant 1:2371382139dd 43 #ifdef __cplusplus
Jerome Coutant 1:2371382139dd 44 extern "C" {
Jerome Coutant 1:2371382139dd 45 #endif
Jerome Coutant 1:2371382139dd 46
Jerome Coutant 1:2371382139dd 47 /* Includes ------------------------------------------------------------------*/
Jerome Coutant 1:2371382139dd 48 #include <stdint.h>
Jerome Coutant 1:2371382139dd 49
Jerome Coutant 1:2371382139dd 50 /** @addtogroup BSP
Jerome Coutant 1:2371382139dd 51 * @{
Jerome Coutant 1:2371382139dd 52 */
Jerome Coutant 1:2371382139dd 53
Jerome Coutant 1:2371382139dd 54 /** @addtogroup Components
Jerome Coutant 1:2371382139dd 55 * @{
Jerome Coutant 1:2371382139dd 56 */
Jerome Coutant 1:2371382139dd 57
Jerome Coutant 1:2371382139dd 58 /** @addtogroup GYRO
Jerome Coutant 1:2371382139dd 59 * @{
Jerome Coutant 1:2371382139dd 60 */
Jerome Coutant 1:2371382139dd 61
Jerome Coutant 1:2371382139dd 62 /** @defgroup GYRO_Exported_Types
Jerome Coutant 1:2371382139dd 63 * @{
Jerome Coutant 1:2371382139dd 64 */
Jerome Coutant 1:2371382139dd 65
Jerome Coutant 1:2371382139dd 66 /** @defgroup GYRO_Driver_structure Gyroscope Driver structure
Jerome Coutant 1:2371382139dd 67 * @{
Jerome Coutant 1:2371382139dd 68 */
Jerome Coutant 1:2371382139dd 69 typedef struct
Jerome Coutant 1:2371382139dd 70 {
Jerome Coutant 1:2371382139dd 71 void (*Init)(uint16_t);
Jerome Coutant 1:2371382139dd 72 void (*DeInit)(void);
Jerome Coutant 1:2371382139dd 73 uint8_t (*ReadID)(void);
Jerome Coutant 1:2371382139dd 74 void (*Reset)(void);
Jerome Coutant 1:2371382139dd 75 void (*LowPower)(uint16_t);
Jerome Coutant 1:2371382139dd 76 void (*ConfigIT)(uint16_t);
Jerome Coutant 1:2371382139dd 77 void (*EnableIT)(uint8_t);
Jerome Coutant 1:2371382139dd 78 void (*DisableIT)(uint8_t);
Jerome Coutant 1:2371382139dd 79 uint8_t (*ITStatus)(uint16_t, uint16_t);
Jerome Coutant 1:2371382139dd 80 void (*ClearIT)(uint16_t, uint16_t);
Jerome Coutant 1:2371382139dd 81 void (*FilterConfig)(uint8_t);
Jerome Coutant 1:2371382139dd 82 void (*FilterCmd)(uint8_t);
Jerome Coutant 1:2371382139dd 83 void (*GetXYZ)(float *);
Jerome Coutant 1:2371382139dd 84 }GYRO_DrvTypeDef;
Jerome Coutant 1:2371382139dd 85 /**
Jerome Coutant 1:2371382139dd 86 * @}
Jerome Coutant 1:2371382139dd 87 */
Jerome Coutant 1:2371382139dd 88
Jerome Coutant 1:2371382139dd 89 /** @defgroup GYRO_Config_structure Gyroscope Configuration structure
Jerome Coutant 1:2371382139dd 90 * @{
Jerome Coutant 1:2371382139dd 91 */
Jerome Coutant 1:2371382139dd 92
Jerome Coutant 1:2371382139dd 93 typedef struct
Jerome Coutant 1:2371382139dd 94 {
Jerome Coutant 1:2371382139dd 95 uint8_t Power_Mode; /* Power-down/Sleep/Normal Mode */
Jerome Coutant 1:2371382139dd 96 uint8_t Output_DataRate; /* OUT data rate */
Jerome Coutant 1:2371382139dd 97 uint8_t Axes_Enable; /* Axes enable */
Jerome Coutant 1:2371382139dd 98 uint8_t Band_Width; /* Bandwidth selection */
Jerome Coutant 1:2371382139dd 99 uint8_t BlockData_Update; /* Block Data Update */
Jerome Coutant 1:2371382139dd 100 uint8_t Endianness; /* Endian Data selection */
Jerome Coutant 1:2371382139dd 101 uint8_t Full_Scale; /* Full Scale selection */
Jerome Coutant 1:2371382139dd 102 }GYRO_InitTypeDef;
Jerome Coutant 1:2371382139dd 103
Jerome Coutant 1:2371382139dd 104 /* GYRO High Pass Filter struct */
Jerome Coutant 1:2371382139dd 105 typedef struct
Jerome Coutant 1:2371382139dd 106 {
Jerome Coutant 1:2371382139dd 107 uint8_t HighPassFilter_Mode_Selection; /* Internal filter mode */
Jerome Coutant 1:2371382139dd 108 uint8_t HighPassFilter_CutOff_Frequency; /* High pass filter cut-off frequency */
Jerome Coutant 1:2371382139dd 109 }GYRO_FilterConfigTypeDef;
Jerome Coutant 1:2371382139dd 110
Jerome Coutant 1:2371382139dd 111 /*GYRO Interrupt struct */
Jerome Coutant 1:2371382139dd 112 typedef struct
Jerome Coutant 1:2371382139dd 113 {
Jerome Coutant 1:2371382139dd 114 uint8_t Latch_Request; /* Latch interrupt request into CLICK_SRC register */
Jerome Coutant 1:2371382139dd 115 uint8_t Interrupt_Axes; /* X, Y, Z Axes Interrupts */
Jerome Coutant 1:2371382139dd 116 uint8_t Interrupt_ActiveEdge; /* Interrupt Active edge */
Jerome Coutant 1:2371382139dd 117 }GYRO_InterruptConfigTypeDef;
Jerome Coutant 1:2371382139dd 118
Jerome Coutant 1:2371382139dd 119 /**
Jerome Coutant 1:2371382139dd 120 * @}
Jerome Coutant 1:2371382139dd 121 */
Jerome Coutant 1:2371382139dd 122
Jerome Coutant 1:2371382139dd 123 /**
Jerome Coutant 1:2371382139dd 124 * @}
Jerome Coutant 1:2371382139dd 125 */
Jerome Coutant 1:2371382139dd 126
Jerome Coutant 1:2371382139dd 127 /**
Jerome Coutant 1:2371382139dd 128 * @}
Jerome Coutant 1:2371382139dd 129 */
Jerome Coutant 1:2371382139dd 130
Jerome Coutant 1:2371382139dd 131 /**
Jerome Coutant 1:2371382139dd 132 * @}
Jerome Coutant 1:2371382139dd 133 */
Jerome Coutant 1:2371382139dd 134
Jerome Coutant 1:2371382139dd 135 /**
Jerome Coutant 1:2371382139dd 136 * @}
Jerome Coutant 1:2371382139dd 137 */
Jerome Coutant 1:2371382139dd 138
Jerome Coutant 1:2371382139dd 139 #ifdef __cplusplus
Jerome Coutant 1:2371382139dd 140 }
Jerome Coutant 1:2371382139dd 141 #endif
Jerome Coutant 1:2371382139dd 142
Jerome Coutant 1:2371382139dd 143 #endif /* __GYRO_H */
Jerome Coutant 1:2371382139dd 144
Jerome Coutant 1:2371382139dd 145 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/