Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of X_NUCLEO_6180XA1 by
Components/Interfaces/GenericSensor.h@42:692c6223dc24, 2016-03-11 (annotated)
- Committer:
- fabiombed
- Date:
- Fri Mar 11 09:47:43 2016 +0000
- Revision:
- 42:692c6223dc24
- Parent:
- 4:a5abf7757947
Now you can use NC as InterruptIn
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gallonm | 1:1de1ea2994d9 | 1 | /** |
gallonm | 1:1de1ea2994d9 | 2 | ****************************************************************************** |
gallonm | 1:1de1ea2994d9 | 3 | * @file GenericSensor.h |
gallonm | 1:1de1ea2994d9 | 4 | * @author AST / EST |
gallonm | 1:1de1ea2994d9 | 5 | * @version V0.0.1 |
gallonm | 1:1de1ea2994d9 | 6 | * @date 13-April-2015 |
gallonm | 1:1de1ea2994d9 | 7 | * @brief This file contains the abstract class describing in general |
gallonm | 1:1de1ea2994d9 | 8 | * the interfaces of a generic sensor |
gallonm | 1:1de1ea2994d9 | 9 | ****************************************************************************** |
gallonm | 1:1de1ea2994d9 | 10 | * @attention |
gallonm | 1:1de1ea2994d9 | 11 | * |
gallonm | 1:1de1ea2994d9 | 12 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> |
gallonm | 1:1de1ea2994d9 | 13 | * |
gallonm | 1:1de1ea2994d9 | 14 | * Redistribution and use in source and binary forms, with or without modification, |
gallonm | 1:1de1ea2994d9 | 15 | * are permitted provided that the following conditions are met: |
gallonm | 1:1de1ea2994d9 | 16 | * 1. Redistributions of source code must retain the above copyright notice, |
gallonm | 1:1de1ea2994d9 | 17 | * this list of conditions and the following disclaimer. |
gallonm | 1:1de1ea2994d9 | 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
gallonm | 1:1de1ea2994d9 | 19 | * this list of conditions and the following disclaimer in the documentation |
gallonm | 1:1de1ea2994d9 | 20 | * and/or other materials provided with the distribution. |
gallonm | 1:1de1ea2994d9 | 21 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
gallonm | 1:1de1ea2994d9 | 22 | * may be used to endorse or promote products derived from this software |
gallonm | 1:1de1ea2994d9 | 23 | * without specific prior written permission. |
gallonm | 1:1de1ea2994d9 | 24 | * |
gallonm | 1:1de1ea2994d9 | 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
gallonm | 1:1de1ea2994d9 | 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
gallonm | 1:1de1ea2994d9 | 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
gallonm | 1:1de1ea2994d9 | 28 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
gallonm | 1:1de1ea2994d9 | 29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
gallonm | 1:1de1ea2994d9 | 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
gallonm | 1:1de1ea2994d9 | 31 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
gallonm | 1:1de1ea2994d9 | 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
gallonm | 1:1de1ea2994d9 | 33 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
gallonm | 1:1de1ea2994d9 | 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
gallonm | 1:1de1ea2994d9 | 35 | * |
gallonm | 1:1de1ea2994d9 | 36 | ****************************************************************************** |
gallonm | 1:1de1ea2994d9 | 37 | */ |
gallonm | 1:1de1ea2994d9 | 38 | |
gallonm | 1:1de1ea2994d9 | 39 | /* Define to prevent from recursive inclusion --------------------------------*/ |
gallonm | 1:1de1ea2994d9 | 40 | #ifndef __GENERIC_SENSOR_CLASS_H |
gallonm | 1:1de1ea2994d9 | 41 | #define __GENERIC_SENSOR_CLASS_H |
gallonm | 1:1de1ea2994d9 | 42 | |
gallonm | 1:1de1ea2994d9 | 43 | /* Includes ------------------------------------------------------------------*/ |
gallonm | 1:1de1ea2994d9 | 44 | #include <stdint.h> |
gallonm | 1:1de1ea2994d9 | 45 | |
gallonm | 1:1de1ea2994d9 | 46 | /* Classes ------------------------------------------------------------------*/ |
gallonm | 1:1de1ea2994d9 | 47 | /** An abstract class for Generic sensors |
gallonm | 1:1de1ea2994d9 | 48 | */ |
gallonm | 1:1de1ea2994d9 | 49 | class GenericSensor |
gallonm | 1:1de1ea2994d9 | 50 | { |
gallonm | 1:1de1ea2994d9 | 51 | public: |
gallonm | 1:1de1ea2994d9 | 52 | /** |
gallonm | 1:1de1ea2994d9 | 53 | * @brief Initialization of sensor |
gallonm | 1:1de1ea2994d9 | 54 | * @param[out] ptr Pointer to device specific initalization structure |
gallonm | 1:1de1ea2994d9 | 55 | * @return 0 in case of success, an error code otherwise |
gallonm | 1:1de1ea2994d9 | 56 | */ |
gallonm | 4:a5abf7757947 | 57 | virtual int Init() = 0; |
gallonm | 1:1de1ea2994d9 | 58 | |
gallonm | 1:1de1ea2994d9 | 59 | /** |
gallonm | 1:1de1ea2994d9 | 60 | * @brief Get ID of sensor |
gallonm | 1:1de1ea2994d9 | 61 | * @param[out] id Pointer to where to store the ID to |
gallonm | 1:1de1ea2994d9 | 62 | * @return 0 in case of success, an error code otherwise |
gallonm | 1:1de1ea2994d9 | 63 | */ |
gallonm | 4:a5abf7757947 | 64 | virtual int ReadID() = 0; |
gallonm | 1:1de1ea2994d9 | 65 | }; |
gallonm | 1:1de1ea2994d9 | 66 | |
gallonm | 4:a5abf7757947 | 67 | #endif /* __GENERIC_SENSOR_CLASS_H */ |