Jamie Satchell
/
JSatchell_SOFT253ReferredCoursework
Finished project.
Fork of ReferredCoursework2016 by
Components/Interfaces/GyroSensor.h@64:d99148a36403, 2015-06-17 (annotated)
- Committer:
- Wolfgang Betz
- Date:
- Wed Jun 17 15:04:13 2015 +0200
- Revision:
- 64:d99148a36403
- Parent:
- 46:badcff0675e8
Handle "i.e." to make it pass doxygen with correct outcome
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Wolfgang Betz |
43:2544d064d528 | 1 | /** |
Wolfgang Betz |
43:2544d064d528 | 2 | ****************************************************************************** |
Wolfgang Betz |
43:2544d064d528 | 3 | * @file GyroSensor.h |
Wolfgang Betz |
43:2544d064d528 | 4 | * @author AST / EST |
Wolfgang Betz |
43:2544d064d528 | 5 | * @version V0.0.1 |
Wolfgang Betz |
43:2544d064d528 | 6 | * @date 13-April-2015 |
Wolfgang Betz |
43:2544d064d528 | 7 | * @brief This file contains the abstract class describing in general |
Wolfgang Betz |
43:2544d064d528 | 8 | * the interfaces of a gyroscope |
Wolfgang Betz |
43:2544d064d528 | 9 | ****************************************************************************** |
Wolfgang Betz |
43:2544d064d528 | 10 | * @attention |
Wolfgang Betz |
43:2544d064d528 | 11 | * |
Wolfgang Betz |
43:2544d064d528 | 12 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> |
Wolfgang Betz |
43:2544d064d528 | 13 | * |
Wolfgang Betz |
43:2544d064d528 | 14 | * Redistribution and use in source and binary forms, with or without modification, |
Wolfgang Betz |
43:2544d064d528 | 15 | * are permitted provided that the following conditions are met: |
Wolfgang Betz |
43:2544d064d528 | 16 | * 1. Redistributions of source code must retain the above copyright notice, |
Wolfgang Betz |
43:2544d064d528 | 17 | * this list of conditions and the following disclaimer. |
Wolfgang Betz |
43:2544d064d528 | 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
Wolfgang Betz |
43:2544d064d528 | 19 | * this list of conditions and the following disclaimer in the documentation |
Wolfgang Betz |
43:2544d064d528 | 20 | * and/or other materials provided with the distribution. |
Wolfgang Betz |
43:2544d064d528 | 21 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
Wolfgang Betz |
43:2544d064d528 | 22 | * may be used to endorse or promote products derived from this software |
Wolfgang Betz |
43:2544d064d528 | 23 | * without specific prior written permission. |
Wolfgang Betz |
43:2544d064d528 | 24 | * |
Wolfgang Betz |
43:2544d064d528 | 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
Wolfgang Betz |
43:2544d064d528 | 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
Wolfgang Betz |
43:2544d064d528 | 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
Wolfgang Betz |
43:2544d064d528 | 28 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
Wolfgang Betz |
43:2544d064d528 | 29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
Wolfgang Betz |
43:2544d064d528 | 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
Wolfgang Betz |
43:2544d064d528 | 31 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
Wolfgang Betz |
43:2544d064d528 | 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
Wolfgang Betz |
43:2544d064d528 | 33 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
Wolfgang Betz |
43:2544d064d528 | 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Wolfgang Betz |
43:2544d064d528 | 35 | * |
Wolfgang Betz |
43:2544d064d528 | 36 | ****************************************************************************** |
Wolfgang Betz |
43:2544d064d528 | 37 | */ |
Wolfgang Betz |
43:2544d064d528 | 38 | |
Wolfgang Betz |
43:2544d064d528 | 39 | /* Define to prevent from recursive inclusion --------------------------------*/ |
Wolfgang Betz |
43:2544d064d528 | 40 | #ifndef __GYRO_SENSOR_CLASS_H |
Wolfgang Betz |
43:2544d064d528 | 41 | #define __GYRO_SENSOR_CLASS_H |
Wolfgang Betz |
43:2544d064d528 | 42 | |
Wolfgang Betz |
43:2544d064d528 | 43 | /* Includes ------------------------------------------------------------------*/ |
Wolfgang Betz |
46:badcff0675e8 | 44 | #include <GenericSensor.h> |
Wolfgang Betz |
43:2544d064d528 | 45 | |
Wolfgang Betz |
43:2544d064d528 | 46 | /* Classes ------------------------------------------------------------------*/ |
Wolfgang Betz |
43:2544d064d528 | 47 | /** An abstract class for a Gyroscope |
Wolfgang Betz |
43:2544d064d528 | 48 | */ |
Wolfgang Betz |
46:badcff0675e8 | 49 | class GyroSensor : public GenericSensor |
Wolfgang Betz |
43:2544d064d528 | 50 | { |
Wolfgang Betz |
43:2544d064d528 | 51 | public: |
Wolfgang Betz |
43:2544d064d528 | 52 | /** |
Wolfgang Betz |
43:2544d064d528 | 53 | * @brief Get current gyroscope angular rate X/Y/Z-axes values |
Wolfgang Betz |
43:2544d064d528 | 54 | * in standard data units [mdps] |
Wolfgang Betz |
43:2544d064d528 | 55 | * @param[out] pData Pointer to where to store angular rates to. |
Wolfgang Betz |
43:2544d064d528 | 56 | * pData must point to an array of (at least) three elements, where: |
Wolfgang Betz |
43:2544d064d528 | 57 | * pData[0] corresponds to X-axis, |
Wolfgang Betz |
43:2544d064d528 | 58 | * pData[1] corresponds to Y-axis, and |
Wolfgang Betz |
43:2544d064d528 | 59 | * pData[2] corresponds to Z-axis. |
Wolfgang Betz |
43:2544d064d528 | 60 | * @return 0 in case of success, an error code otherwise |
Wolfgang Betz |
43:2544d064d528 | 61 | */ |
Wolfgang Betz |
43:2544d064d528 | 62 | virtual int Get_G_Axes(int32_t *pData) = 0; |
Wolfgang Betz |
43:2544d064d528 | 63 | |
Wolfgang Betz |
43:2544d064d528 | 64 | /** |
Wolfgang Betz |
43:2544d064d528 | 65 | * @brief Get current gyroscope raw data X/Y/Z-axes values |
Wolfgang Betz |
43:2544d064d528 | 66 | * in device sepcific LSB units |
Wolfgang Betz |
43:2544d064d528 | 67 | * @param[out] pData Pointer to where to store gyroscope raw data to. |
Wolfgang Betz |
43:2544d064d528 | 68 | * pData must point to an array of (at least) three elements, where: |
Wolfgang Betz |
43:2544d064d528 | 69 | * pData[0] corresponds to X-axis, |
Wolfgang Betz |
43:2544d064d528 | 70 | * pData[1] corresponds to Y-axis, and |
Wolfgang Betz |
43:2544d064d528 | 71 | * pData[2] corresponds to Z-axis. |
Wolfgang Betz |
43:2544d064d528 | 72 | * @return 0 in case of success, an error code otherwise |
Wolfgang Betz |
43:2544d064d528 | 73 | */ |
Wolfgang Betz |
43:2544d064d528 | 74 | virtual int Get_G_AxesRaw(int16_t *pData) = 0; |
Wolfgang Betz |
43:2544d064d528 | 75 | |
Wolfgang Betz |
43:2544d064d528 | 76 | /** |
Wolfgang Betz |
43:2544d064d528 | 77 | * @brief Get gyroscope's current sensitivity [mdps/LSB] |
Wolfgang Betz |
43:2544d064d528 | 78 | * @param[out] pfData Pointer to where the gyroscope's sensitivity is stored to |
Wolfgang Betz |
43:2544d064d528 | 79 | * @return 0 in case of success, an error code otherwise |
Wolfgang Betz |
43:2544d064d528 | 80 | */ |
Wolfgang Betz |
43:2544d064d528 | 81 | virtual int Get_G_Sensitivity(float *pfData) = 0; |
Wolfgang Betz |
43:2544d064d528 | 82 | |
Wolfgang Betz |
43:2544d064d528 | 83 | /** |
Wolfgang Betz |
43:2544d064d528 | 84 | * @brief Get gyroscope's current output data rate [Hz] |
Wolfgang Betz |
43:2544d064d528 | 85 | * @param[out] pfData Pointer to where the gyroscope output data rate is stored to |
Wolfgang Betz |
43:2544d064d528 | 86 | * @return 0 in case of success, an error code otherwise |
Wolfgang Betz |
43:2544d064d528 | 87 | */ |
Wolfgang Betz |
43:2544d064d528 | 88 | virtual int Get_G_ODR(float *pfData) = 0; |
Wolfgang Betz |
43:2544d064d528 | 89 | |
Wolfgang Betz |
43:2544d064d528 | 90 | /** |
Wolfgang Betz |
43:2544d064d528 | 91 | * @brief Set gyroscope's output data rate |
Wolfgang Betz |
43:2544d064d528 | 92 | * @param[in] odr New value for gyroscope's output data rate in [Hz] |
Wolfgang Betz |
43:2544d064d528 | 93 | * @return 0 in case of success, an error code otherwise |
Wolfgang Betz |
43:2544d064d528 | 94 | */ |
Wolfgang Betz |
43:2544d064d528 | 95 | virtual int Set_G_ODR(float odr) = 0; |
Wolfgang Betz |
43:2544d064d528 | 96 | |
Wolfgang Betz |
43:2544d064d528 | 97 | /** |
Wolfgang Betz |
43:2544d064d528 | 98 | * @brief Get gyroscope's full scale value |
Wolfgang Betz |
64:d99148a36403 | 99 | * i.e.\ min/max measurable value [dps] |
Wolfgang Betz |
43:2544d064d528 | 100 | * @param[out] pfData Pointer to where the gyroscope full scale value is stored to |
Wolfgang Betz |
43:2544d064d528 | 101 | * @return 0 in case of success, an error code otherwise |
Wolfgang Betz |
43:2544d064d528 | 102 | */ |
Wolfgang Betz |
43:2544d064d528 | 103 | virtual int Get_G_FS(float *pfData) = 0; |
Wolfgang Betz |
43:2544d064d528 | 104 | |
Wolfgang Betz |
43:2544d064d528 | 105 | /** |
Wolfgang Betz |
43:2544d064d528 | 106 | * @brief Set gyroscope's full scale value |
Wolfgang Betz |
64:d99148a36403 | 107 | * i.e.\ min/max measurable value |
Wolfgang Betz |
43:2544d064d528 | 108 | * @param[in] fs New full scale value for gyroscope in [dps] |
Wolfgang Betz |
43:2544d064d528 | 109 | * @return 0 in case of success, an error code otherwise |
Wolfgang Betz |
43:2544d064d528 | 110 | */ |
Wolfgang Betz |
43:2544d064d528 | 111 | virtual int Set_G_FS(float fs) = 0; |
Wolfgang Betz |
43:2544d064d528 | 112 | }; |
Wolfgang Betz |
43:2544d064d528 | 113 | |
Wolfgang Betz |
43:2544d064d528 | 114 | #endif /* __GYRO_SENSOR_CLASS_H */ |