ble
Dependencies: HC_SR04_Ultrasonic_Library Servo mbed
Fork of FIP_REV1 by
Sensor_Shield/pressure.h@1:bdbf36f8408d, 2015-05-19 (annotated)
- Committer:
- julientiron
- Date:
- Tue May 19 16:53:44 2015 +0000
- Revision:
- 1:bdbf36f8408d
ddd; ;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
julientiron | 1:bdbf36f8408d | 1 | /** |
julientiron | 1:bdbf36f8408d | 2 | ****************************************************************************** |
julientiron | 1:bdbf36f8408d | 3 | * @file pressure.c |
julientiron | 1:bdbf36f8408d | 4 | * @author MEMS Application Team |
julientiron | 1:bdbf36f8408d | 5 | * @version V1.0.0 |
julientiron | 1:bdbf36f8408d | 6 | * @date 30-July-2014 |
julientiron | 1:bdbf36f8408d | 7 | * @brief This header file contains the functions prototypes for the |
julientiron | 1:bdbf36f8408d | 8 | * pressure driver. |
julientiron | 1:bdbf36f8408d | 9 | ****************************************************************************** |
julientiron | 1:bdbf36f8408d | 10 | * @attention |
julientiron | 1:bdbf36f8408d | 11 | * |
julientiron | 1:bdbf36f8408d | 12 | * <h2><center>© COPYRIGHT(c) 2014 STMicroelectronics</center></h2> |
julientiron | 1:bdbf36f8408d | 13 | * |
julientiron | 1:bdbf36f8408d | 14 | * Redistribution and use in source and binary forms, with or without modification, |
julientiron | 1:bdbf36f8408d | 15 | * are permitted provided that the following conditions are met: |
julientiron | 1:bdbf36f8408d | 16 | * 1. Redistributions of source code must retain the above copyright notice, |
julientiron | 1:bdbf36f8408d | 17 | * this list of conditions and the following disclaimer. |
julientiron | 1:bdbf36f8408d | 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
julientiron | 1:bdbf36f8408d | 19 | * this list of conditions and the following disclaimer in the documentation |
julientiron | 1:bdbf36f8408d | 20 | * and/or other materials provided with the distribution. |
julientiron | 1:bdbf36f8408d | 21 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
julientiron | 1:bdbf36f8408d | 22 | * may be used to endorse or promote products derived from this software |
julientiron | 1:bdbf36f8408d | 23 | * without specific prior written permission. |
julientiron | 1:bdbf36f8408d | 24 | * |
julientiron | 1:bdbf36f8408d | 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
julientiron | 1:bdbf36f8408d | 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
julientiron | 1:bdbf36f8408d | 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
julientiron | 1:bdbf36f8408d | 28 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
julientiron | 1:bdbf36f8408d | 29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
julientiron | 1:bdbf36f8408d | 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
julientiron | 1:bdbf36f8408d | 31 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
julientiron | 1:bdbf36f8408d | 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
julientiron | 1:bdbf36f8408d | 33 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
julientiron | 1:bdbf36f8408d | 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
julientiron | 1:bdbf36f8408d | 35 | * |
julientiron | 1:bdbf36f8408d | 36 | ****************************************************************************** |
julientiron | 1:bdbf36f8408d | 37 | */ |
julientiron | 1:bdbf36f8408d | 38 | |
julientiron | 1:bdbf36f8408d | 39 | |
julientiron | 1:bdbf36f8408d | 40 | /* Define to prevent recursive inclusion -------------------------------------*/ |
julientiron | 1:bdbf36f8408d | 41 | #ifndef __PRESSURE_H |
julientiron | 1:bdbf36f8408d | 42 | #define __PRESSURE_H |
julientiron | 1:bdbf36f8408d | 43 | |
julientiron | 1:bdbf36f8408d | 44 | #ifdef __cplusplus |
julientiron | 1:bdbf36f8408d | 45 | extern "C" { |
julientiron | 1:bdbf36f8408d | 46 | #endif |
julientiron | 1:bdbf36f8408d | 47 | |
julientiron | 1:bdbf36f8408d | 48 | /* Includes ------------------------------------------------------------------*/ |
julientiron | 1:bdbf36f8408d | 49 | #include <stdint.h> |
julientiron | 1:bdbf36f8408d | 50 | |
julientiron | 1:bdbf36f8408d | 51 | /** |
julientiron | 1:bdbf36f8408d | 52 | * @brief PRESSURE init structure definition |
julientiron | 1:bdbf36f8408d | 53 | */ |
julientiron | 1:bdbf36f8408d | 54 | typedef struct |
julientiron | 1:bdbf36f8408d | 55 | { |
julientiron | 1:bdbf36f8408d | 56 | uint8_t OutputDataRate; |
julientiron | 1:bdbf36f8408d | 57 | uint8_t PressureResolution; |
julientiron | 1:bdbf36f8408d | 58 | uint8_t TemperatureResolution; |
julientiron | 1:bdbf36f8408d | 59 | uint8_t DiffEnable; |
julientiron | 1:bdbf36f8408d | 60 | uint8_t BlockDataUpdate; |
julientiron | 1:bdbf36f8408d | 61 | uint8_t SPIMode; |
julientiron | 1:bdbf36f8408d | 62 | }PRESSURE_InitTypeDef; |
julientiron | 1:bdbf36f8408d | 63 | |
julientiron | 1:bdbf36f8408d | 64 | /** |
julientiron | 1:bdbf36f8408d | 65 | * @brief PRESSURE status enumerator definition |
julientiron | 1:bdbf36f8408d | 66 | */ |
julientiron | 1:bdbf36f8408d | 67 | typedef enum { |
julientiron | 1:bdbf36f8408d | 68 | PRESSURE_OK = 0, |
julientiron | 1:bdbf36f8408d | 69 | PRESSURE_ERROR = 1, |
julientiron | 1:bdbf36f8408d | 70 | PRESSURE_TIMEOUT = 2 |
julientiron | 1:bdbf36f8408d | 71 | } PRESSURE_StatusTypeDef; |
julientiron | 1:bdbf36f8408d | 72 | |
julientiron | 1:bdbf36f8408d | 73 | /** |
julientiron | 1:bdbf36f8408d | 74 | * @brief PRESSURE driver structure definition |
julientiron | 1:bdbf36f8408d | 75 | */ |
julientiron | 1:bdbf36f8408d | 76 | typedef struct |
julientiron | 1:bdbf36f8408d | 77 | { |
julientiron | 1:bdbf36f8408d | 78 | void (*Init)(PRESSURE_InitTypeDef *); |
julientiron | 1:bdbf36f8408d | 79 | void (*PowerOff)(void); |
julientiron | 1:bdbf36f8408d | 80 | uint8_t (*ReadID)(void); |
julientiron | 1:bdbf36f8408d | 81 | void (*Reset)(void); |
julientiron | 1:bdbf36f8408d | 82 | void (*ConfigIT)(uint16_t); |
julientiron | 1:bdbf36f8408d | 83 | void (*EnableIT)(uint8_t); |
julientiron | 1:bdbf36f8408d | 84 | void (*DisableIT)(uint8_t); |
julientiron | 1:bdbf36f8408d | 85 | uint8_t (*ITStatus)(uint16_t, uint16_t); |
julientiron | 1:bdbf36f8408d | 86 | void (*ClearIT)(uint16_t, uint16_t); |
julientiron | 1:bdbf36f8408d | 87 | void (*GetPressure)(float *); |
julientiron | 1:bdbf36f8408d | 88 | void (*GetTemperature)(float *); |
julientiron | 1:bdbf36f8408d | 89 | void (*SlaveAddrRemap)(uint8_t); |
julientiron | 1:bdbf36f8408d | 90 | }PRESSURE_DrvTypeDef; |
julientiron | 1:bdbf36f8408d | 91 | |
julientiron | 1:bdbf36f8408d | 92 | |
julientiron | 1:bdbf36f8408d | 93 | #ifdef __cplusplus |
julientiron | 1:bdbf36f8408d | 94 | } |
julientiron | 1:bdbf36f8408d | 95 | #endif |
julientiron | 1:bdbf36f8408d | 96 | |
julientiron | 1:bdbf36f8408d | 97 | #endif /* __PRESSURE_H */ |
julientiron | 1:bdbf36f8408d | 98 | /** |
julientiron | 1:bdbf36f8408d | 99 | * @} |
julientiron | 1:bdbf36f8408d | 100 | */ |
julientiron | 1:bdbf36f8408d | 101 | |
julientiron | 1:bdbf36f8408d | 102 | /** |
julientiron | 1:bdbf36f8408d | 103 | * @} |
julientiron | 1:bdbf36f8408d | 104 | */ |
julientiron | 1:bdbf36f8408d | 105 | |
julientiron | 1:bdbf36f8408d | 106 | /** |
julientiron | 1:bdbf36f8408d | 107 | * @} |
julientiron | 1:bdbf36f8408d | 108 | */ |
julientiron | 1:bdbf36f8408d | 109 | |
julientiron | 1:bdbf36f8408d | 110 | |
julientiron | 1:bdbf36f8408d | 111 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
julientiron | 1:bdbf36f8408d | 112 |