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/TSU104/TSU104.h@23:807f66b435d6, 2017-07-13 (annotated)
- Committer:
- Davidroid
- Date:
- Thu Jul 13 15:46:02 2017 +0000
- Revision:
- 23:807f66b435d6
- Parent:
- 22:ff8d071bf79e
Adapting to ARM mbed coding style.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hemddabral | 2:19d1dcef0c0e | 1 | /** |
hemddabral | 2:19d1dcef0c0e | 2 | ****************************************************************************** |
Davidroid | 22:ff8d071bf79e | 3 | * @file TSU104.h |
hemddabral | 2:19d1dcef0c0e | 4 | * @author Central Labs |
hemddabral | 2:19d1dcef0c0e | 5 | * @version 1.0.0 |
hemddabral | 2:19d1dcef0c0e | 6 | * @date 11-February-2016 |
hemddabral | 2:19d1dcef0c0e | 7 | * @brief Portable architecture for TSU104 |
hemddabral | 2:19d1dcef0c0e | 8 | ****************************************************************************** |
hemddabral | 2:19d1dcef0c0e | 9 | * @attention |
hemddabral | 2:19d1dcef0c0e | 10 | * |
hemddabral | 2:19d1dcef0c0e | 11 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> |
hemddabral | 2:19d1dcef0c0e | 12 | * |
hemddabral | 2:19d1dcef0c0e | 13 | * Redistribution and use in source and binary forms, with or without modification, |
hemddabral | 2:19d1dcef0c0e | 14 | * are permitted provided that the following conditions are met: |
hemddabral | 2:19d1dcef0c0e | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
hemddabral | 2:19d1dcef0c0e | 16 | * this list of conditions and the following disclaimer. |
hemddabral | 2:19d1dcef0c0e | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
hemddabral | 2:19d1dcef0c0e | 18 | * this list of conditions and the following disclaimer in the documentation |
hemddabral | 2:19d1dcef0c0e | 19 | * and/or other materials provided with the distribution. |
hemddabral | 2:19d1dcef0c0e | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
hemddabral | 2:19d1dcef0c0e | 21 | * may be used to endorse or promote products derived from this software |
hemddabral | 2:19d1dcef0c0e | 22 | * without specific prior written permission. |
hemddabral | 2:19d1dcef0c0e | 23 | * |
hemddabral | 2:19d1dcef0c0e | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
hemddabral | 2:19d1dcef0c0e | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
hemddabral | 2:19d1dcef0c0e | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
hemddabral | 2:19d1dcef0c0e | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
hemddabral | 2:19d1dcef0c0e | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
hemddabral | 2:19d1dcef0c0e | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
hemddabral | 2:19d1dcef0c0e | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
hemddabral | 2:19d1dcef0c0e | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
hemddabral | 2:19d1dcef0c0e | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
hemddabral | 2:19d1dcef0c0e | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
hemddabral | 2:19d1dcef0c0e | 34 | * |
hemddabral | 2:19d1dcef0c0e | 35 | ****************************************************************************** |
hemddabral | 2:19d1dcef0c0e | 36 | */ |
hemddabral | 2:19d1dcef0c0e | 37 | |
hemddabral | 2:19d1dcef0c0e | 38 | |
hemddabral | 2:19d1dcef0c0e | 39 | /* Generated with STM32CubeTOO -----------------------------------------------*/ |
hemddabral | 2:19d1dcef0c0e | 40 | |
hemddabral | 2:19d1dcef0c0e | 41 | |
hemddabral | 2:19d1dcef0c0e | 42 | /* Revision ------------------------------------------------------------------*/ |
hemddabral | 2:19d1dcef0c0e | 43 | /* |
hemddabral | 2:19d1dcef0c0e | 44 | Repository: http://svn.x-nucleodev.codex.cro.st.com/svnroot/X-NucleoDev |
hemddabral | 2:19d1dcef0c0e | 45 | Branch/Trunk/Tag: trunk |
hemddabral | 2:19d1dcef0c0e | 46 | Based on: X-CUBE-IKA01A1/trunk/Drivers/BSP/Components/tsu104/tsu104.h |
hemddabral | 2:19d1dcef0c0e | 47 | Revision: 402 |
hemddabral | 2:19d1dcef0c0e | 48 | */ |
hemddabral | 2:19d1dcef0c0e | 49 | |
hemddabral | 2:19d1dcef0c0e | 50 | |
hemddabral | 2:19d1dcef0c0e | 51 | /* Define to prevent recursive inclusion -------------------------------------*/ |
hemddabral | 2:19d1dcef0c0e | 52 | |
hemddabral | 2:19d1dcef0c0e | 53 | #ifndef __TSU104_CLASS_H |
hemddabral | 2:19d1dcef0c0e | 54 | #define __TSU104_CLASS_H |
hemddabral | 2:19d1dcef0c0e | 55 | |
hemddabral | 2:19d1dcef0c0e | 56 | |
hemddabral | 2:19d1dcef0c0e | 57 | /* Includes ------------------------------------------------------------------*/ |
hemddabral | 2:19d1dcef0c0e | 58 | |
hemddabral | 2:19d1dcef0c0e | 59 | /* ACTION 1 ------------------------------------------------------------------* |
hemddabral | 2:19d1dcef0c0e | 60 | * Include here platform specific header files. * |
hemddabral | 2:19d1dcef0c0e | 61 | *----------------------------------------------------------------------------*/ |
hemddabral | 2:19d1dcef0c0e | 62 | #include "mbed.h" |
hemddabral | 2:19d1dcef0c0e | 63 | /* ACTION 2 ------------------------------------------------------------------* |
hemddabral | 2:19d1dcef0c0e | 64 | * Include here component specific header files. * |
hemddabral | 2:19d1dcef0c0e | 65 | *----------------------------------------------------------------------------*/ |
Davidroid | 22:ff8d071bf79e | 66 | #include "TSU104_def.h" |
hemddabral | 2:19d1dcef0c0e | 67 | /* ACTION 3 ------------------------------------------------------------------* |
hemddabral | 2:19d1dcef0c0e | 68 | * Include here interface specific header files. * |
hemddabral | 2:19d1dcef0c0e | 69 | * * |
hemddabral | 2:19d1dcef0c0e | 70 | * Example: * |
Davidroid | 22:ff8d071bf79e | 71 | * #include "HumiditySensor.h" * |
Davidroid | 22:ff8d071bf79e | 72 | * #include "TemperatureSensor.h" * |
hemddabral | 2:19d1dcef0c0e | 73 | *----------------------------------------------------------------------------*/ |
Davidroid | 22:ff8d071bf79e | 74 | #include "../Interfaces/Windcomp.h" |
Davidroid | 22:ff8d071bf79e | 75 | #include "../Interfaces/PhotoSensor.h" |
hemddabral | 2:19d1dcef0c0e | 76 | |
hemddabral | 2:19d1dcef0c0e | 77 | |
hemddabral | 2:19d1dcef0c0e | 78 | /* Classes -------------------------------------------------------------------*/ |
hemddabral | 2:19d1dcef0c0e | 79 | |
hemddabral | 2:19d1dcef0c0e | 80 | /** |
hemddabral | 13:9cecc8d66cc1 | 81 | * @brief Class representing a TSU104 operational amplifier component. The window comparator |
hemddabral | 13:9cecc8d66cc1 | 82 | * configuration allows the user to compare a signal to two threshold voltages. When the signal |
hemddabral | 13:9cecc8d66cc1 | 83 | * is out of the required voltage range, the output of the operational amplifier toggles |
hemddabral | 2:19d1dcef0c0e | 84 | */ |
hemddabral | 16:2f9443aedbe8 | 85 | class TSU104 : public Windcomp, public PhotoSensor |
hemddabral | 2:19d1dcef0c0e | 86 | { |
hemddabral | 2:19d1dcef0c0e | 87 | public: |
hemddabral | 2:19d1dcef0c0e | 88 | |
hemddabral | 2:19d1dcef0c0e | 89 | /*** Constructor and Destructor Methods ***/ |
hemddabral | 2:19d1dcef0c0e | 90 | |
hemddabral | 2:19d1dcef0c0e | 91 | /** |
hemddabral | 2:19d1dcef0c0e | 92 | * @brief Constructor. |
hemddabral | 2:19d1dcef0c0e | 93 | */ |
hemddabral | 14:8277ca0ab13a | 94 | TSU104(PinName photoSensorPin, PinName windCmpSignalPin_1,PinName windCmpSignalPin_2) : Windcomp() |
hemddabral | 2:19d1dcef0c0e | 95 | { |
hemddabral | 14:8277ca0ab13a | 96 | photo_sensor_pin = photoSensorPin; |
hemddabral | 14:8277ca0ab13a | 97 | windCmp_signal_pin_1 = windCmpSignalPin_1; |
hemddabral | 14:8277ca0ab13a | 98 | windCmp_signal_pin_2 = windCmpSignalPin_2; |
hemddabral | 2:19d1dcef0c0e | 99 | } |
hemddabral | 2:19d1dcef0c0e | 100 | |
hemddabral | 2:19d1dcef0c0e | 101 | /** |
hemddabral | 2:19d1dcef0c0e | 102 | * @brief Destructor. |
hemddabral | 2:19d1dcef0c0e | 103 | */ |
hemddabral | 2:19d1dcef0c0e | 104 | virtual ~TSU104(void) {} |
hemddabral | 2:19d1dcef0c0e | 105 | |
hemddabral | 2:19d1dcef0c0e | 106 | |
Davidroid | 22:ff8d071bf79e | 107 | /*** Public Component Related Methods ***/ |
Davidroid | 22:ff8d071bf79e | 108 | |
Davidroid | 22:ff8d071bf79e | 109 | /* ACTION 5 --------------------------------------------------------------* |
Davidroid | 22:ff8d071bf79e | 110 | * Implement here the component's public methods, as wrappers of the C * |
Davidroid | 22:ff8d071bf79e | 111 | * component's functions. * |
Davidroid | 22:ff8d071bf79e | 112 | * They should be: * |
Davidroid | 22:ff8d071bf79e | 113 | * + Methods with the same name of the C component's virtual table's * |
Davidroid | 22:ff8d071bf79e | 114 | * functions (1); * |
Davidroid | 22:ff8d071bf79e | 115 | * + Methods with the same name of the C component's extended virtual * |
Davidroid | 22:ff8d071bf79e | 116 | * table's functions, if any (2). * |
Davidroid | 22:ff8d071bf79e | 117 | * * |
Davidroid | 22:ff8d071bf79e | 118 | * Example: * |
Davidroid | 22:ff8d071bf79e | 119 | * virtual int get_value(float *p_data) //(1) * |
Davidroid | 22:ff8d071bf79e | 120 | * { * |
Davidroid | 22:ff8d071bf79e | 121 | * return COMPONENT_get_value(float *pf_data); * |
Davidroid | 22:ff8d071bf79e | 122 | * } * |
Davidroid | 22:ff8d071bf79e | 123 | * * |
Davidroid | 22:ff8d071bf79e | 124 | * virtual int enable_feature(void) //(2) * |
Davidroid | 22:ff8d071bf79e | 125 | * { * |
Davidroid | 22:ff8d071bf79e | 126 | * return COMPONENT_enable_feature(); * |
Davidroid | 22:ff8d071bf79e | 127 | * } * |
Davidroid | 22:ff8d071bf79e | 128 | *------------------------------------------------------------------------*/ |
Davidroid | 22:ff8d071bf79e | 129 | |
Davidroid | 22:ff8d071bf79e | 130 | /** |
Davidroid | 22:ff8d071bf79e | 131 | * @brief Public functions inherited from the Component Class |
Davidroid | 22:ff8d071bf79e | 132 | */ |
hemddabral | 2:19d1dcef0c0e | 133 | |
hemddabral | 13:9cecc8d66cc1 | 134 | /** |
hemddabral | 13:9cecc8d66cc1 | 135 | * @brief initialize the class for TSU104 operational amplifier component |
hemddabral | 13:9cecc8d66cc1 | 136 | * @retval COMPONENT_OK if initialization is successfull |
hemddabral | 13:9cecc8d66cc1 | 137 | * @retval suitable error code otherwise |
hemddabral | 13:9cecc8d66cc1 | 138 | */ |
Davidroid | 22:ff8d071bf79e | 139 | virtual int init(void *init = NULL) |
hemddabral | 2:19d1dcef0c0e | 140 | { |
hemddabral | 2:19d1dcef0c0e | 141 | return (int) TSU104_Init((void *) init); |
hemddabral | 2:19d1dcef0c0e | 142 | } |
hemddabral | 13:9cecc8d66cc1 | 143 | |
hemddabral | 13:9cecc8d66cc1 | 144 | /** |
hemddabral | 13:9cecc8d66cc1 | 145 | * @brief obtain component ID for TSU104 perational amplifier |
hemddabral | 13:9cecc8d66cc1 | 146 | * @retval component ID for TSU104 operational amplifier |
hemddabral | 13:9cecc8d66cc1 | 147 | */ |
Davidroid | 22:ff8d071bf79e | 148 | virtual int read_id(uint8_t *id = NULL) |
hemddabral | 2:19d1dcef0c0e | 149 | { |
hemddabral | 2:19d1dcef0c0e | 150 | return (int) TSU104_ReadID((uint8_t *) id); |
hemddabral | 2:19d1dcef0c0e | 151 | } |
Davidroid | 22:ff8d071bf79e | 152 | |
Davidroid | 22:ff8d071bf79e | 153 | /** |
Davidroid | 22:ff8d071bf79e | 154 | * @brief Public functions inherited from the LedDriver Class |
Davidroid | 22:ff8d071bf79e | 155 | */ |
Davidroid | 22:ff8d071bf79e | 156 | |
hemddabral | 13:9cecc8d66cc1 | 157 | /** |
hemddabral | 18:25dbc718084c | 158 | * @brief get digital signal value 1 in windows comparator configuration |
hemddabral | 18:25dbc718084c | 159 | * @retval digital signal value 1 |
hemddabral | 18:25dbc718084c | 160 | */ |
Davidroid | 22:ff8d071bf79e | 161 | virtual unsigned int get_signal1(void) |
hemddabral | 2:19d1dcef0c0e | 162 | { |
hemddabral | 14:8277ca0ab13a | 163 | DigitalIn windowsCompD2(windCmp_signal_pin_1); |
hemddabral | 2:19d1dcef0c0e | 164 | return windowsCompD2.read(); |
hemddabral | 2:19d1dcef0c0e | 165 | } |
hemddabral | 2:19d1dcef0c0e | 166 | |
hemddabral | 13:9cecc8d66cc1 | 167 | /** |
hemddabral | 18:25dbc718084c | 168 | * @brief get digital signal value 2 in windows comparator configuration |
hemddabral | 18:25dbc718084c | 169 | * @retval digital signal value 2 |
hemddabral | 18:25dbc718084c | 170 | */ |
Davidroid | 22:ff8d071bf79e | 171 | virtual unsigned int get_signal2(void) |
hemddabral | 2:19d1dcef0c0e | 172 | { |
hemddabral | 14:8277ca0ab13a | 173 | DigitalIn windowsCompD4(windCmp_signal_pin_2); |
hemddabral | 2:19d1dcef0c0e | 174 | return windowsCompD4.read(); |
hemddabral | 2:19d1dcef0c0e | 175 | } |
hemddabral | 13:9cecc8d66cc1 | 176 | |
hemddabral | 13:9cecc8d66cc1 | 177 | |
hemddabral | 13:9cecc8d66cc1 | 178 | /** |
hemddabral | 13:9cecc8d66cc1 | 179 | * @brief obtain the output voltage detected by photo sensor |
hemddabral | 13:9cecc8d66cc1 | 180 | * @param pin AnalogIn pin to use for detecting the voltage |
hemddabral | 13:9cecc8d66cc1 | 181 | * @retval voltage detected by photo sensor |
hemddabral | 13:9cecc8d66cc1 | 182 | */ |
Davidroid | 22:ff8d071bf79e | 183 | virtual unsigned int get_voltage(void) |
hemddabral | 2:19d1dcef0c0e | 184 | { |
hemddabral | 14:8277ca0ab13a | 185 | AnalogIn photoSensor(photo_sensor_pin); |
hemddabral | 12:ac16b9a1cad6 | 186 | double voltage = photoSensor.read(); |
hemddabral | 2:19d1dcef0c0e | 187 | voltage = voltage*3.3*1000.0; // voltage in mV |
hemddabral | 2:19d1dcef0c0e | 188 | return voltage; |
hemddabral | 2:19d1dcef0c0e | 189 | } |
hemddabral | 2:19d1dcef0c0e | 190 | |
hemddabral | 2:19d1dcef0c0e | 191 | |
hemddabral | 2:19d1dcef0c0e | 192 | /*** Public Interrupt Related Methods ***/ |
hemddabral | 2:19d1dcef0c0e | 193 | |
hemddabral | 2:19d1dcef0c0e | 194 | /* ACTION 6 --------------------------------------------------------------* |
hemddabral | 2:19d1dcef0c0e | 195 | * Implement here interrupt related methods, if any. * |
hemddabral | 2:19d1dcef0c0e | 196 | * Note that interrupt handling is platform dependent, e.g.: * |
hemddabral | 2:19d1dcef0c0e | 197 | * + mbed: * |
hemddabral | 2:19d1dcef0c0e | 198 | * InterruptIn feature_irq(pin); //Interrupt object. * |
hemddabral | 2:19d1dcef0c0e | 199 | * feature_irq.fall(callback); //Attach a callback. * |
hemddabral | 2:19d1dcef0c0e | 200 | * feature_irq.mode(PullNone); //Set interrupt mode. * |
hemddabral | 2:19d1dcef0c0e | 201 | * feature_irq.enable_irq(); //Enable interrupt. * |
hemddabral | 2:19d1dcef0c0e | 202 | * feature_irq.disable_irq(); //Disable interrupt. * |
hemddabral | 2:19d1dcef0c0e | 203 | * + Arduino: * |
hemddabral | 2:19d1dcef0c0e | 204 | * attachInterrupt(pin, callback, RISING); //Attach a callback. * |
hemddabral | 2:19d1dcef0c0e | 205 | * detachInterrupt(pin); //Detach a callback. * |
hemddabral | 2:19d1dcef0c0e | 206 | * * |
hemddabral | 2:19d1dcef0c0e | 207 | * Example (mbed): * |
Davidroid | 22:ff8d071bf79e | 208 | * void attach_feature_irq(void (*fptr) (void)) * |
Davidroid | 22:ff8d071bf79e | 209 | * { * |
Davidroid | 22:ff8d071bf79e | 210 | * feature_irq.rise(fptr); * |
Davidroid | 22:ff8d071bf79e | 211 | * } * |
Davidroid | 22:ff8d071bf79e | 212 | * * |
Davidroid | 22:ff8d071bf79e | 213 | * void enable_feature_irq(void) * |
Davidroid | 22:ff8d071bf79e | 214 | * { * |
Davidroid | 22:ff8d071bf79e | 215 | * feature_irq.enable_irq(); * |
Davidroid | 22:ff8d071bf79e | 216 | * } * |
Davidroid | 22:ff8d071bf79e | 217 | * * |
Davidroid | 22:ff8d071bf79e | 218 | * void disable_feature_irq(void) * |
Davidroid | 22:ff8d071bf79e | 219 | * { * |
Davidroid | 22:ff8d071bf79e | 220 | * feature_irq.disable_irq(); * |
Davidroid | 22:ff8d071bf79e | 221 | * } * |
hemddabral | 2:19d1dcef0c0e | 222 | *------------------------------------------------------------------------*/ |
hemddabral | 2:19d1dcef0c0e | 223 | |
hemddabral | 2:19d1dcef0c0e | 224 | |
hemddabral | 2:19d1dcef0c0e | 225 | protected: |
hemddabral | 2:19d1dcef0c0e | 226 | |
hemddabral | 2:19d1dcef0c0e | 227 | /*** Protected Component Related Methods ***/ |
hemddabral | 2:19d1dcef0c0e | 228 | |
hemddabral | 14:8277ca0ab13a | 229 | /** |
hemddabral | 14:8277ca0ab13a | 230 | * arduino pin for photosensor output voltage |
hemddabral | 14:8277ca0ab13a | 231 | */ |
hemddabral | 14:8277ca0ab13a | 232 | PinName photo_sensor_pin; |
hemddabral | 14:8277ca0ab13a | 233 | |
hemddabral | 14:8277ca0ab13a | 234 | /** |
hemddabral | 14:8277ca0ab13a | 235 | * arduino pin for signal 1 of windows comparator configuration |
hemddabral | 14:8277ca0ab13a | 236 | */ |
hemddabral | 14:8277ca0ab13a | 237 | PinName windCmp_signal_pin_1; |
hemddabral | 14:8277ca0ab13a | 238 | |
hemddabral | 14:8277ca0ab13a | 239 | /** |
hemddabral | 14:8277ca0ab13a | 240 | * arduino pin for signal 1 of windows comparator configuration |
hemddabral | 14:8277ca0ab13a | 241 | */ |
hemddabral | 14:8277ca0ab13a | 242 | PinName windCmp_signal_pin_2; |
hemddabral | 14:8277ca0ab13a | 243 | |
hemddabral | 2:19d1dcef0c0e | 244 | /* ACTION 7 --------------------------------------------------------------* |
hemddabral | 2:19d1dcef0c0e | 245 | * Declare here the component's specific methods. * |
hemddabral | 2:19d1dcef0c0e | 246 | * They should be: * |
hemddabral | 2:19d1dcef0c0e | 247 | * + Methods with the same name of the C component's virtual table's * |
hemddabral | 2:19d1dcef0c0e | 248 | * functions (1); * |
hemddabral | 2:19d1dcef0c0e | 249 | * + Methods with the same name of the C component's extended virtual * |
hemddabral | 2:19d1dcef0c0e | 250 | * table's functions, if any (2); * |
hemddabral | 2:19d1dcef0c0e | 251 | * + Helper methods, if any, like functions declared in the component's * |
hemddabral | 2:19d1dcef0c0e | 252 | * source files but not pointed by the component's virtual table (3). * |
hemddabral | 2:19d1dcef0c0e | 253 | * * |
hemddabral | 2:19d1dcef0c0e | 254 | * Example: * |
Davidroid | 22:ff8d071bf79e | 255 | * status_t COMPONENT_get_value(float *f); //(1) * |
Davidroid | 22:ff8d071bf79e | 256 | * status_t COMPONENT_enable_feature(void); //(2) * |
Davidroid | 22:ff8d071bf79e | 257 | * status_t COMPONENT_compute_average(void); //(3) * |
hemddabral | 2:19d1dcef0c0e | 258 | *------------------------------------------------------------------------*/ |
hemddabral | 2:19d1dcef0c0e | 259 | /* TSU104's generic functions. */ |
Davidroid | 22:ff8d071bf79e | 260 | status_t TSU104_Init(void *init); |
Davidroid | 22:ff8d071bf79e | 261 | status_t TSU104_ReadID(void *id); |
hemddabral | 2:19d1dcef0c0e | 262 | |
hemddabral | 2:19d1dcef0c0e | 263 | /* TSU104's interrupts related functions. */ |
Davidroid | 22:ff8d071bf79e | 264 | status_t TSU104_ConfigIT(void* a); |
hemddabral | 2:19d1dcef0c0e | 265 | |
hemddabral | 2:19d1dcef0c0e | 266 | |
hemddabral | 2:19d1dcef0c0e | 267 | /*** Component's I/O Methods ***/ |
hemddabral | 2:19d1dcef0c0e | 268 | |
hemddabral | 2:19d1dcef0c0e | 269 | /*** Component's Instance Variables ***/ |
hemddabral | 2:19d1dcef0c0e | 270 | |
hemddabral | 2:19d1dcef0c0e | 271 | /* ACTION 9 --------------------------------------------------------------* |
hemddabral | 2:19d1dcef0c0e | 272 | * Declare here interrupt related variables, if needed. * |
hemddabral | 2:19d1dcef0c0e | 273 | * Note that interrupt handling is platform dependent, see * |
hemddabral | 2:19d1dcef0c0e | 274 | * "Interrupt Related Methods" above. * |
hemddabral | 2:19d1dcef0c0e | 275 | * * |
hemddabral | 2:19d1dcef0c0e | 276 | * Example: * |
hemddabral | 2:19d1dcef0c0e | 277 | * + mbed: * |
hemddabral | 2:19d1dcef0c0e | 278 | * InterruptIn feature_irq; * |
hemddabral | 2:19d1dcef0c0e | 279 | *------------------------------------------------------------------------*/ |
hemddabral | 2:19d1dcef0c0e | 280 | |
hemddabral | 2:19d1dcef0c0e | 281 | /* ACTION 10 -------------------------------------------------------------* |
hemddabral | 2:19d1dcef0c0e | 282 | * Declare here other pin related variables, if needed. * |
hemddabral | 2:19d1dcef0c0e | 283 | * * |
hemddabral | 2:19d1dcef0c0e | 284 | * Example: * |
hemddabral | 2:19d1dcef0c0e | 285 | * + mbed: * |
hemddabral | 2:19d1dcef0c0e | 286 | * DigitalOut standby_reset; * |
hemddabral | 2:19d1dcef0c0e | 287 | *------------------------------------------------------------------------*/ |
hemddabral | 2:19d1dcef0c0e | 288 | |
hemddabral | 2:19d1dcef0c0e | 289 | /* ACTION 11 -------------------------------------------------------------* |
hemddabral | 2:19d1dcef0c0e | 290 | * Declare here communication related variables, if needed. * |
hemddabral | 2:19d1dcef0c0e | 291 | * * |
hemddabral | 2:19d1dcef0c0e | 292 | * Example: * |
hemddabral | 2:19d1dcef0c0e | 293 | * + mbed: * |
hemddabral | 2:19d1dcef0c0e | 294 | * DigitalOut address; * |
hemddabral | 2:19d1dcef0c0e | 295 | * DevI2C &dev_i2c; * |
hemddabral | 2:19d1dcef0c0e | 296 | *------------------------------------------------------------------------*/ |
hemddabral | 2:19d1dcef0c0e | 297 | |
hemddabral | 2:19d1dcef0c0e | 298 | /* ACTION 12 -------------------------------------------------------------* |
hemddabral | 2:19d1dcef0c0e | 299 | * Declare here identity related variables, if needed. * |
hemddabral | 2:19d1dcef0c0e | 300 | * Note that there should be only a unique identifier for each component, * |
hemddabral | 2:19d1dcef0c0e | 301 | * which should be the "who_am_i" parameter. * |
hemddabral | 2:19d1dcef0c0e | 302 | *------------------------------------------------------------------------*/ |
hemddabral | 2:19d1dcef0c0e | 303 | /* Identity */ |
hemddabral | 2:19d1dcef0c0e | 304 | uint8_t who_am_i; |
hemddabral | 2:19d1dcef0c0e | 305 | |
hemddabral | 2:19d1dcef0c0e | 306 | /* ACTION 13 -------------------------------------------------------------* |
hemddabral | 2:19d1dcef0c0e | 307 | * Declare here the component's static and non-static data, one variable * |
hemddabral | 2:19d1dcef0c0e | 308 | * per line. * |
hemddabral | 2:19d1dcef0c0e | 309 | * * |
hemddabral | 2:19d1dcef0c0e | 310 | * Example: * |
hemddabral | 2:19d1dcef0c0e | 311 | * float measure; * |
hemddabral | 2:19d1dcef0c0e | 312 | * int instance_id; * |
hemddabral | 2:19d1dcef0c0e | 313 | * static int number_of_instances; * |
hemddabral | 2:19d1dcef0c0e | 314 | *------------------------------------------------------------------------*/ |
hemddabral | 2:19d1dcef0c0e | 315 | }; |
hemddabral | 2:19d1dcef0c0e | 316 | |
hemddabral | 2:19d1dcef0c0e | 317 | #endif /* __TSU104_CLASS_H */ |
hemddabral | 2:19d1dcef0c0e | 318 | |
hemddabral | 2:19d1dcef0c0e | 319 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |