Now you can use NC as InterruptIn
Fork of X_NUCLEO_6180XA1 by
Components/Interfaces/RangeSensor.h@12:71d589e6fd2c, 2015-10-13 (annotated)
- Committer:
- gallonm
- Date:
- Tue Oct 13 14:22:45 2015 +0200
- Revision:
- 12:71d589e6fd2c
- Parent:
- 4:a5abf7757947
- Child:
- 38:18abb7f7dcb2
Introduced virtual functions GetRange and GetLight of the sensor classes.
Fixed as wrapper functions of VL6180x_RangeGetResult and VL6180x_AlsGetLux.
Fixed a comment of the stmpe1600_class.h
Fixed the function InitSensor.
Introduced the function StartMeasurement to choose the operating mode.
Introduced the funcions RangeMeasPollSingleShot, AlsMeasPollSingleShot,
RangeMeasPollContinuousMode, AlsMeasPollContinuousMode, RangeMeasIntContinuousMode,
AlsMeasIntContinuousMode and InterleavedMode to manage different type of operating
mode.
Introduced the functions GetRangeError and GetAlsError to verify error measurement.
Introduced the functions GetRangeMeasContinuousMode and GetAlsMeasContinuousMode
to get the result of the measure in continuous mode.
Introduced the function StartInterleavedMode to start the interleaved mode.
Introduced the function HandleIRQ to manage the interrupt request.
Introduced MeasureData_t struct that contains the results of range and als measure
and related error (range, als and gpio).
Introduced enum OperatingMode and MeasureType.
Fixed the Vl6180x constructor, introducing the parameter PinName gpio1 needed to
interrupt_measure.
Introduced the wrapper functions.
Introducede InterruptIn interrupt_measure to handle the interrupt request.
Fixed the x_nucleo_6180xa1 constructor.
Fixed the object sensor_top.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gallonm | 1:1de1ea2994d9 | 1 | /** |
gallonm | 1:1de1ea2994d9 | 2 | ****************************************************************************** |
gallonm | 3:454541a079f4 | 3 | * @file RangeSensor.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 | 3:454541a079f4 | 8 | * the interfaces of a range 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 | 3:454541a079f4 | 40 | #ifndef __RANGE_SENSOR_CLASS_H |
gallonm | 3:454541a079f4 | 41 | #define __RANGE_SENSOR_CLASS_H |
gallonm | 1:1de1ea2994d9 | 42 | |
gallonm | 1:1de1ea2994d9 | 43 | /* Includes ------------------------------------------------------------------*/ |
gallonm | 1:1de1ea2994d9 | 44 | #include <GenericSensor.h> |
gallonm | 1:1de1ea2994d9 | 45 | |
gallonm | 1:1de1ea2994d9 | 46 | /* Classes ------------------------------------------------------------------*/ |
gallonm | 3:454541a079f4 | 47 | /** An abstract class for range sensors |
gallonm | 1:1de1ea2994d9 | 48 | */ |
gallonm | 3:454541a079f4 | 49 | class RangeSensor : public GenericSensor |
gallonm | 1:1de1ea2994d9 | 50 | { |
gallonm | 1:1de1ea2994d9 | 51 | public: |
gallonm | 1:1de1ea2994d9 | 52 | /** |
gallonm | 3:454541a079f4 | 53 | * @brief Get current range [mm] |
gallonm | 3:454541a079f4 | 54 | * @param[out] piData Pointer to where to store range to |
gallonm | 1:1de1ea2994d9 | 55 | * @return 0 in case of success, an error code otherwise |
gallonm | 1:1de1ea2994d9 | 56 | */ |
gallonm | 12:71d589e6fd2c | 57 | virtual int GetRange(int32_t *piData) = 0; |
gallonm | 1:1de1ea2994d9 | 58 | }; |
gallonm | 1:1de1ea2994d9 | 59 | |
gallonm | 4:a5abf7757947 | 60 | #endif /* __RANGE_SENSOR_CLASS_H */ |