Sam Walsh / X_NUCLEO_6180XA1

Dependencies:   ST_INTERFACES X_NUCLEO_COMMON

Dependents:   Ultrasound_And_IMU

Fork of X_NUCLEO_6180XA1 by ST

Committer:
mapellil
Date:
Mon Sep 12 09:10:29 2016 +0000
Revision:
51:229ea522cff8
Parent:
50:18e064bfb156
Disabled INT generation on 6180 GPIO1 pin in case of als or range single shot polling measures.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
gallonm 1:1de1ea2994d9 1 /**
gallonm 1:1de1ea2994d9 2 ******************************************************************************
mapellil 50:18e064bfb156 3 * @file DistanceSensor.h
gallonm 1:1de1ea2994d9 4 * @author AST / EST
gallonm 1:1de1ea2994d9 5 * @version V0.0.1
mapellil 50:18e064bfb156 6 * @date 08-September-2016
gallonm 1:1de1ea2994d9 7 * @brief This file contains the abstract class describing in general
mapellil 50:18e064bfb156 8 * the interfaces of a distance sensor
gallonm 1:1de1ea2994d9 9 ******************************************************************************
gallonm 1:1de1ea2994d9 10 * @attention
gallonm 1:1de1ea2994d9 11 *
gallonm 1:1de1ea2994d9 12 * <h2><center>&copy; 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 --------------------------------*/
mapellil 50:18e064bfb156 40 #ifndef __DISTANCE_SENSOR_CLASS_H
mapellil 50:18e064bfb156 41 #define __DISTANCE_SENSOR_CLASS_H
gallonm 1:1de1ea2994d9 42
gallonm 1:1de1ea2994d9 43 /* Includes ------------------------------------------------------------------*/
mapellil 50:18e064bfb156 44 #include "ComponentObject.h"
gallonm 1:1de1ea2994d9 45
gallonm 1:1de1ea2994d9 46 /* Classes ------------------------------------------------------------------*/
mapellil 50:18e064bfb156 47 /** An abstract class for distance sensors
gallonm 1:1de1ea2994d9 48 */
mapellil 50:18e064bfb156 49 class DistanceSensor : public ComponentObject
gallonm 1:1de1ea2994d9 50 {
gallonm 1:1de1ea2994d9 51 public:
gallonm 1:1de1ea2994d9 52 /**
mapellil 50:18e064bfb156 53 * @brief Get current distance [mm]
mapellil 50:18e064bfb156 54 * @param[out] piData Pointer to where to store distance to
gallonm 1:1de1ea2994d9 55 * @return 0 in case of success, an error code otherwise
gallonm 1:1de1ea2994d9 56 */
mapellil 50:18e064bfb156 57 virtual int GetDistance(uint32_t *piData) = 0;
gallonm 1:1de1ea2994d9 58 };
gallonm 1:1de1ea2994d9 59
mapellil 50:18e064bfb156 60 #endif /* __DISTANCE_SENSOR_CLASS_H */