Dependencies:   X_NUCLEO_COMMON

Dependents:   Giroscopio_main

Fork of X_NUCLEO_IKS01A1-f2df by Ant Robinson

Committer:
Salvatore94
Date:
Thu Feb 09 16:40:33 2017 +0000
Revision:
1:7f97780b8ad4
Parent:
0:5a49275457c6
Per peppe;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
antseggs 0:5a49275457c6 1 /**
antseggs 0:5a49275457c6 2 ******************************************************************************
antseggs 0:5a49275457c6 3 * @file pressure.h
antseggs 0:5a49275457c6 4 * @author MEMS Application Team
antseggs 0:5a49275457c6 5 * @version V1.2.0
antseggs 0:5a49275457c6 6 * @date 28-January-2015
antseggs 0:5a49275457c6 7 * @brief This header file contains the functions prototypes for the
antseggs 0:5a49275457c6 8 * pressure driver.
antseggs 0:5a49275457c6 9 ******************************************************************************
antseggs 0:5a49275457c6 10 * @attention
antseggs 0:5a49275457c6 11 *
antseggs 0:5a49275457c6 12 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
antseggs 0:5a49275457c6 13 *
antseggs 0:5a49275457c6 14 * Redistribution and use in source and binary forms, with or without modification,
antseggs 0:5a49275457c6 15 * are permitted provided that the following conditions are met:
antseggs 0:5a49275457c6 16 * 1. Redistributions of source code must retain the above copyright notice,
antseggs 0:5a49275457c6 17 * this list of conditions and the following disclaimer.
antseggs 0:5a49275457c6 18 * 2. Redistributions in binary form must reproduce the above copyright notice,
antseggs 0:5a49275457c6 19 * this list of conditions and the following disclaimer in the documentation
antseggs 0:5a49275457c6 20 * and/or other materials provided with the distribution.
antseggs 0:5a49275457c6 21 * 3. Neither the name of STMicroelectronics nor the names of its contributors
antseggs 0:5a49275457c6 22 * may be used to endorse or promote products derived from this software
antseggs 0:5a49275457c6 23 * without specific prior written permission.
antseggs 0:5a49275457c6 24 *
antseggs 0:5a49275457c6 25 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
antseggs 0:5a49275457c6 26 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
antseggs 0:5a49275457c6 27 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
antseggs 0:5a49275457c6 28 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
antseggs 0:5a49275457c6 29 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
antseggs 0:5a49275457c6 30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
antseggs 0:5a49275457c6 31 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
antseggs 0:5a49275457c6 32 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
antseggs 0:5a49275457c6 33 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
antseggs 0:5a49275457c6 34 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
antseggs 0:5a49275457c6 35 *
antseggs 0:5a49275457c6 36 ******************************************************************************
antseggs 0:5a49275457c6 37 */
antseggs 0:5a49275457c6 38
antseggs 0:5a49275457c6 39
antseggs 0:5a49275457c6 40 /* Define to prevent recursive inclusion -------------------------------------*/
antseggs 0:5a49275457c6 41 #ifndef __PRESSURE_H
antseggs 0:5a49275457c6 42 #define __PRESSURE_H
antseggs 0:5a49275457c6 43
antseggs 0:5a49275457c6 44 #ifdef __cplusplus
antseggs 0:5a49275457c6 45 extern "C" {
antseggs 0:5a49275457c6 46 #endif
antseggs 0:5a49275457c6 47
antseggs 0:5a49275457c6 48 /* Includes ------------------------------------------------------------------*/
antseggs 0:5a49275457c6 49 #include <stdint.h>
antseggs 0:5a49275457c6 50
antseggs 0:5a49275457c6 51 /** @addtogroup BSP
antseggs 0:5a49275457c6 52 * @{
antseggs 0:5a49275457c6 53 */
antseggs 0:5a49275457c6 54
antseggs 0:5a49275457c6 55 /** @addtogroup Components
antseggs 0:5a49275457c6 56 * @{
antseggs 0:5a49275457c6 57 */
antseggs 0:5a49275457c6 58
antseggs 0:5a49275457c6 59 /** @addtogroup PRESSURE
antseggs 0:5a49275457c6 60 * @{
antseggs 0:5a49275457c6 61 */
antseggs 0:5a49275457c6 62
antseggs 0:5a49275457c6 63 /** @defgroup PRESSURE_Exported_Types
antseggs 0:5a49275457c6 64 * @{
antseggs 0:5a49275457c6 65 */
antseggs 0:5a49275457c6 66
antseggs 0:5a49275457c6 67 /**
antseggs 0:5a49275457c6 68 * @brief PRESSURE init structure definition
antseggs 0:5a49275457c6 69 */
antseggs 0:5a49275457c6 70 typedef struct
antseggs 0:5a49275457c6 71 {
antseggs 0:5a49275457c6 72 uint8_t OutputDataRate;
antseggs 0:5a49275457c6 73 uint8_t PressureResolution;
antseggs 0:5a49275457c6 74 uint8_t TemperatureResolution;
antseggs 0:5a49275457c6 75 uint8_t DiffEnable;
antseggs 0:5a49275457c6 76 uint8_t BlockDataUpdate;
antseggs 0:5a49275457c6 77 uint8_t SPIMode;
antseggs 0:5a49275457c6 78 } PRESSURE_InitTypeDef;
antseggs 0:5a49275457c6 79
antseggs 0:5a49275457c6 80 /**
antseggs 0:5a49275457c6 81 * @brief PRESSURE status enumerator definition
antseggs 0:5a49275457c6 82 */
antseggs 0:5a49275457c6 83 typedef enum
antseggs 0:5a49275457c6 84 {
antseggs 0:5a49275457c6 85 PRESSURE_OK = 0,
antseggs 0:5a49275457c6 86 PRESSURE_ERROR = 1,
antseggs 0:5a49275457c6 87 PRESSURE_TIMEOUT = 2,
antseggs 0:5a49275457c6 88 PRESSURE_NOT_IMPLEMENTED = 3
antseggs 0:5a49275457c6 89 } PRESSURE_StatusTypeDef;
antseggs 0:5a49275457c6 90
antseggs 0:5a49275457c6 91 /**
antseggs 0:5a49275457c6 92 * @brief PRESSURE component id enumerator definition
antseggs 0:5a49275457c6 93 */
antseggs 0:5a49275457c6 94 typedef enum
antseggs 0:5a49275457c6 95 {
antseggs 0:5a49275457c6 96 PRESSURE_NONE_COMPONENT = 0,
antseggs 0:5a49275457c6 97 PRESSURE_LPS25H_COMPONENT = 1,
antseggs 0:5a49275457c6 98 PRESSURE_LPS25HB_DIL24_COMPONENT = 2
antseggs 0:5a49275457c6 99 } PRESSURE_ComponentTypeDef;
antseggs 0:5a49275457c6 100
antseggs 0:5a49275457c6 101 /**
antseggs 0:5a49275457c6 102 * @brief PRESSURE driver extended structure definition
antseggs 0:5a49275457c6 103 */
antseggs 0:5a49275457c6 104 typedef struct
antseggs 0:5a49275457c6 105 {
antseggs 0:5a49275457c6 106 PRESSURE_ComponentTypeDef
antseggs 0:5a49275457c6 107 id; /* This id must be unique for each component belonging to this class that wants to extend common class */
antseggs 0:5a49275457c6 108 void *pData; /* This pointer is specific for each component */
antseggs 0:5a49275457c6 109 } PRESSURE_DrvExtTypeDef;
antseggs 0:5a49275457c6 110
antseggs 0:5a49275457c6 111 /**
antseggs 0:5a49275457c6 112 * @brief PRESSURE driver structure definition
antseggs 0:5a49275457c6 113 */
antseggs 0:5a49275457c6 114 typedef struct
antseggs 0:5a49275457c6 115 {
antseggs 0:5a49275457c6 116 PRESSURE_StatusTypeDef (*Init)(PRESSURE_InitTypeDef *);
antseggs 0:5a49275457c6 117 PRESSURE_StatusTypeDef (*PowerOff)(void);
antseggs 0:5a49275457c6 118 PRESSURE_StatusTypeDef (*ReadID)(uint8_t *);
antseggs 0:5a49275457c6 119 PRESSURE_StatusTypeDef (*Reset)(void);
antseggs 0:5a49275457c6 120 void (*ConfigIT)(uint16_t);
antseggs 0:5a49275457c6 121 void (*EnableIT)(uint8_t);
antseggs 0:5a49275457c6 122 void (*DisableIT)(uint8_t);
antseggs 0:5a49275457c6 123 uint8_t (*ITStatus)(uint16_t, uint16_t);
antseggs 0:5a49275457c6 124 void (*ClearIT)(uint16_t, uint16_t);
antseggs 0:5a49275457c6 125 PRESSURE_StatusTypeDef (*GetPressure)(float *);
antseggs 0:5a49275457c6 126 PRESSURE_StatusTypeDef (*GetTemperature)(float *);
antseggs 0:5a49275457c6 127 void (*SlaveAddrRemap)(uint8_t);
antseggs 0:5a49275457c6 128 PRESSURE_DrvExtTypeDef *extData;
antseggs 0:5a49275457c6 129 } PRESSURE_DrvTypeDef;
antseggs 0:5a49275457c6 130
antseggs 0:5a49275457c6 131 /**
antseggs 0:5a49275457c6 132 * @}
antseggs 0:5a49275457c6 133 */
antseggs 0:5a49275457c6 134
antseggs 0:5a49275457c6 135 /**
antseggs 0:5a49275457c6 136 * @}
antseggs 0:5a49275457c6 137 */
antseggs 0:5a49275457c6 138
antseggs 0:5a49275457c6 139 /**
antseggs 0:5a49275457c6 140 * @}
antseggs 0:5a49275457c6 141 */
antseggs 0:5a49275457c6 142
antseggs 0:5a49275457c6 143 /**
antseggs 0:5a49275457c6 144 * @}
antseggs 0:5a49275457c6 145 */
antseggs 0:5a49275457c6 146
antseggs 0:5a49275457c6 147 #ifdef __cplusplus
antseggs 0:5a49275457c6 148 }
antseggs 0:5a49275457c6 149 #endif
antseggs 0:5a49275457c6 150
antseggs 0:5a49275457c6 151 #endif /* __PRESSURE_H */
antseggs 0:5a49275457c6 152
antseggs 0:5a49275457c6 153 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/