mbed library for STMicroelectronics' X-NUCLEO-IKA01A1 expansion board.
Dependents: HelloWorld_IKA01A1
Fork of X_NUCLEO_IKA01A1 by
Library for STMicroelectronics' X-NUCLEO-IKA01A1 multifunctional expansion board based on operational amplifiers.
Components/Interfaces/PhotoSensor.h@22:ff8d071bf79e, 2017-05-09 (annotated)
- Committer:
- Davidroid
- Date:
- Tue May 09 11:49:16 2017 +0000
- Revision:
- 22:ff8d071bf79e
- Parent:
- Components/Interfaces/PhotoSensor_class.h@21:8d0624950dd1
Aligned to ARM mbed coding style.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hemddabral | 16:2f9443aedbe8 | 1 | /** |
hemddabral | 16:2f9443aedbe8 | 2 | ****************************************************************************** |
Davidroid | 22:ff8d071bf79e | 3 | * @file PhotoSensor.h |
hemddabral | 16:2f9443aedbe8 | 4 | * @author AST |
hemddabral | 16:2f9443aedbe8 | 5 | * @version V1.0.0 |
hemddabral | 16:2f9443aedbe8 | 6 | * @date April 13th, 2015 |
hemddabral | 16:2f9443aedbe8 | 7 | * @brief This file contains the abstract class describing the interface of a |
hemddabral | 16:2f9443aedbe8 | 8 | * PHOTO_SENSOR component. |
hemddabral | 16:2f9443aedbe8 | 9 | ****************************************************************************** |
hemddabral | 16:2f9443aedbe8 | 10 | * @attention |
hemddabral | 16:2f9443aedbe8 | 11 | * |
hemddabral | 16:2f9443aedbe8 | 12 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> |
hemddabral | 16:2f9443aedbe8 | 13 | * |
hemddabral | 16:2f9443aedbe8 | 14 | * Redistribution and use in source and binary forms, with or without modification, |
hemddabral | 16:2f9443aedbe8 | 15 | * are permitted provided that the following conditions are met: |
hemddabral | 16:2f9443aedbe8 | 16 | * 1. Redistributions of source code must retain the above copyright notice, |
hemddabral | 16:2f9443aedbe8 | 17 | * this list of conditions and the following disclaimer. |
hemddabral | 16:2f9443aedbe8 | 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
hemddabral | 16:2f9443aedbe8 | 19 | * this list of conditions and the following disclaimer in the documentation |
hemddabral | 16:2f9443aedbe8 | 20 | * and/or other materials provided with the distribution. |
hemddabral | 16:2f9443aedbe8 | 21 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
hemddabral | 16:2f9443aedbe8 | 22 | * may be used to endorse or promote products derived from this software |
hemddabral | 16:2f9443aedbe8 | 23 | * without specific prior written permission. |
hemddabral | 16:2f9443aedbe8 | 24 | * |
hemddabral | 16:2f9443aedbe8 | 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
hemddabral | 16:2f9443aedbe8 | 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
hemddabral | 16:2f9443aedbe8 | 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
hemddabral | 16:2f9443aedbe8 | 28 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
hemddabral | 16:2f9443aedbe8 | 29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
hemddabral | 16:2f9443aedbe8 | 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
hemddabral | 16:2f9443aedbe8 | 31 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
hemddabral | 16:2f9443aedbe8 | 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
hemddabral | 16:2f9443aedbe8 | 33 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
hemddabral | 16:2f9443aedbe8 | 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
hemddabral | 16:2f9443aedbe8 | 35 | * |
hemddabral | 16:2f9443aedbe8 | 36 | ****************************************************************************** |
hemddabral | 16:2f9443aedbe8 | 37 | */ |
hemddabral | 16:2f9443aedbe8 | 38 | |
hemddabral | 16:2f9443aedbe8 | 39 | |
hemddabral | 16:2f9443aedbe8 | 40 | /* Generated with STM32CubeTOO -----------------------------------------------*/ |
hemddabral | 16:2f9443aedbe8 | 41 | |
hemddabral | 16:2f9443aedbe8 | 42 | |
hemddabral | 16:2f9443aedbe8 | 43 | /* Revision ------------------------------------------------------------------*/ |
hemddabral | 16:2f9443aedbe8 | 44 | /* |
hemddabral | 16:2f9443aedbe8 | 45 | Repository: http://svn.x-nucleodev.codex.cro.st.com/svnroot/X-NucleoDev |
hemddabral | 16:2f9443aedbe8 | 46 | Branch/Trunk/Tag: trunk |
hemddabral | 16:2f9443aedbe8 | 47 | Based on: X-CUBE-IKA01A1/trunk/Drivers/BSP/Components/Common/PHOTO_SENSOR.h |
hemddabral | 16:2f9443aedbe8 | 48 | Revision: 385 |
hemddabral | 16:2f9443aedbe8 | 49 | */ |
hemddabral | 16:2f9443aedbe8 | 50 | |
hemddabral | 16:2f9443aedbe8 | 51 | |
hemddabral | 16:2f9443aedbe8 | 52 | /* Define to prevent recursive inclusion -------------------------------------*/ |
hemddabral | 16:2f9443aedbe8 | 53 | |
hemddabral | 16:2f9443aedbe8 | 54 | #ifndef __PHOTO_SENSOR_CLASS_H |
hemddabral | 16:2f9443aedbe8 | 55 | #define __PHOTO_SENSOR_CLASS_H |
hemddabral | 16:2f9443aedbe8 | 56 | |
hemddabral | 16:2f9443aedbe8 | 57 | |
hemddabral | 16:2f9443aedbe8 | 58 | /* Includes ------------------------------------------------------------------*/ |
hemddabral | 16:2f9443aedbe8 | 59 | |
Davidroid | 22:ff8d071bf79e | 60 | #include <Component.h> |
hemddabral | 16:2f9443aedbe8 | 61 | |
hemddabral | 16:2f9443aedbe8 | 62 | |
hemddabral | 16:2f9443aedbe8 | 63 | /* Classes ------------------------------------------------------------------*/ |
hemddabral | 16:2f9443aedbe8 | 64 | |
hemddabral | 16:2f9443aedbe8 | 65 | /** An abstract class for photo sensor components. |
hemddabral | 16:2f9443aedbe8 | 66 | */ |
hemddabral | 16:2f9443aedbe8 | 67 | class PhotoSensor : public Component |
hemddabral | 16:2f9443aedbe8 | 68 | { |
hemddabral | 16:2f9443aedbe8 | 69 | public: |
hemddabral | 16:2f9443aedbe8 | 70 | /* ACTION 1 --------------------------------------------------------------* |
hemddabral | 16:2f9443aedbe8 | 71 | * Declare here the interface's methods. * |
hemddabral | 16:2f9443aedbe8 | 72 | * They should be: * |
hemddabral | 16:2f9443aedbe8 | 73 | * + Methods with the same name of the C component's virtual table * |
hemddabral | 16:2f9443aedbe8 | 74 | * (and extended virtual table, if any)'s functions, provided that * |
hemddabral | 16:2f9443aedbe8 | 75 | * the component's driver implements them (i.e.: the corresponding * |
hemddabral | 16:2f9443aedbe8 | 76 | * pointer to function is not "0"). * |
hemddabral | 16:2f9443aedbe8 | 77 | * * |
hemddabral | 16:2f9443aedbe8 | 78 | * Example: * |
Davidroid | 22:ff8d071bf79e | 79 | * virtual int get_value(float *f) = 0; * |
hemddabral | 16:2f9443aedbe8 | 80 | *------------------------------------------------------------------------*/ |
hemddabral | 18:25dbc718084c | 81 | |
hemddabral | 18:25dbc718084c | 82 | /** |
hemddabral | 18:25dbc718084c | 83 | * @brief abstract method for obtaining the output voltage detected by photo sensor |
hemddabral | 18:25dbc718084c | 84 | * @param pin AnalogIn pin to use for detecting the voltage |
hemddabral | 18:25dbc718084c | 85 | * @retval voltage detected by photo sensor |
hemddabral | 18:25dbc718084c | 86 | */ |
Davidroid | 22:ff8d071bf79e | 87 | virtual unsigned int get_voltage(void) = 0; |
Davidroid | 22:ff8d071bf79e | 88 | |
Davidroid | 22:ff8d071bf79e | 89 | /** |
Davidroid | 22:ff8d071bf79e | 90 | * @brief Destructor. |
Davidroid | 22:ff8d071bf79e | 91 | */ |
Davidroid | 22:ff8d071bf79e | 92 | virtual ~PhotoSensor() {}; |
hemddabral | 16:2f9443aedbe8 | 93 | }; |
hemddabral | 16:2f9443aedbe8 | 94 | |
hemddabral | 16:2f9443aedbe8 | 95 | #endif /* __PHOTO_SENSOR_CLASS_H */ |
hemddabral | 16:2f9443aedbe8 | 96 | |
hemddabral | 16:2f9443aedbe8 | 97 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |