STM32L476G-Discovery board drivers V1.0.0

Dependents:   DiscoLogger DISCO_L476VG_GlassLCD DISCO_L476VG_MicrophoneRecorder DISCO_L476VG_UART ... more

Committer:
Jerome Coutant
Date:
Wed Jul 05 10:51:49 2017 +0200
Revision:
1:917af0ca86df
Child:
3:4c7d003a8259
Update with STM32Cube_FW_L4_V1.8.0

Who changed what in which revision?

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