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