INSAT Mini Project
Dependencies: ST_INTERFACES X_NUCLEO_COMMON
Fork of X_NUCLEO_6180XA1 by
x_nucleo_6180xa1.h@4:a5abf7757947, 2015-09-17 (annotated)
- Committer:
- gallonm
- Date:
- Thu Sep 17 10:41:21 2015 +0200
- Revision:
- 4:a5abf7757947
- Parent:
- 0:1fb1f010ac84
- Child:
- 7:2dc81120c917
First compile of Init function and ReadID function
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
gallonm | 0:1fb1f010ac84 | 1 | /** |
gallonm | 0:1fb1f010ac84 | 2 | ****************************************************************************** |
gallonm | 0:1fb1f010ac84 | 3 | * @file x_nucleo_6180xa1.h |
gallonm | 0:1fb1f010ac84 | 4 | * @author AST / EST |
gallonm | 0:1fb1f010ac84 | 5 | * @version V0.0.1 |
gallonm | 0:1fb1f010ac84 | 6 | * @date 13-April-2015 |
gallonm | 0:1fb1f010ac84 | 7 | * @brief Header file for class X_NUCLEO_6180XA1 representing a X-NUCLEO-6180XA1 |
gallonm | 0:1fb1f010ac84 | 8 | * expansion board |
gallonm | 0:1fb1f010ac84 | 9 | ****************************************************************************** |
gallonm | 0:1fb1f010ac84 | 10 | * @attention |
gallonm | 0:1fb1f010ac84 | 11 | * |
gallonm | 0:1fb1f010ac84 | 12 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> |
gallonm | 0:1fb1f010ac84 | 13 | * |
gallonm | 0:1fb1f010ac84 | 14 | * Redistribution and use in source and binary forms, with or without modification, |
gallonm | 0:1fb1f010ac84 | 15 | * are permitted provided that the following conditions are met: |
gallonm | 0:1fb1f010ac84 | 16 | * 1. Redistributions of source code must retain the above copyright notice, |
gallonm | 0:1fb1f010ac84 | 17 | * this list of conditions and the following disclaimer. |
gallonm | 0:1fb1f010ac84 | 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
gallonm | 0:1fb1f010ac84 | 19 | * this list of conditions and the following disclaimer in the documentation |
gallonm | 0:1fb1f010ac84 | 20 | * and/or other materials provided with the distribution. |
gallonm | 0:1fb1f010ac84 | 21 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
gallonm | 0:1fb1f010ac84 | 22 | * may be used to endorse or promote products derived from this software |
gallonm | 0:1fb1f010ac84 | 23 | * without specific prior written permission. |
gallonm | 0:1fb1f010ac84 | 24 | * |
gallonm | 0:1fb1f010ac84 | 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
gallonm | 0:1fb1f010ac84 | 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
gallonm | 0:1fb1f010ac84 | 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
gallonm | 0:1fb1f010ac84 | 28 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
gallonm | 0:1fb1f010ac84 | 29 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
gallonm | 0:1fb1f010ac84 | 30 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
gallonm | 0:1fb1f010ac84 | 31 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
gallonm | 0:1fb1f010ac84 | 32 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
gallonm | 0:1fb1f010ac84 | 33 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
gallonm | 0:1fb1f010ac84 | 34 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
gallonm | 0:1fb1f010ac84 | 35 | * |
gallonm | 0:1fb1f010ac84 | 36 | ****************************************************************************** |
gallonm | 0:1fb1f010ac84 | 37 | */ |
gallonm | 0:1fb1f010ac84 | 38 | |
gallonm | 0:1fb1f010ac84 | 39 | /* Define to prevent from recursive inclusion --------------------------------*/ |
gallonm | 0:1fb1f010ac84 | 40 | #ifndef __X_NUCLEO_6180XA1_H |
gallonm | 0:1fb1f010ac84 | 41 | #define __X_NUCLEO_6180XA1_H |
gallonm | 0:1fb1f010ac84 | 42 | |
gallonm | 0:1fb1f010ac84 | 43 | /* Includes ------------------------------------------------------------------*/ |
gallonm | 0:1fb1f010ac84 | 44 | #include "mbed.h" |
gallonm | 0:1fb1f010ac84 | 45 | #include "vl6180x_class.h" |
gallonm | 0:1fb1f010ac84 | 46 | #include "display_class.h" |
gallonm | 0:1fb1f010ac84 | 47 | #include "GPIO_expander_class.h" |
gallonm | 0:1fb1f010ac84 | 48 | #include "DevI2C.h" |
gallonm | 0:1fb1f010ac84 | 49 | |
gallonm | 4:a5abf7757947 | 50 | /* Classes--------------------------------------------------------------------*/ |
gallonm | 0:1fb1f010ac84 | 51 | |
gallonm | 4:a5abf7757947 | 52 | /*class X_NUCLEO_6180XA1 |
gallonm | 4:a5abf7757947 | 53 | { |
gallonm | 4:a5abf7757947 | 54 | protected: |
gallonm | 4:a5abf7757947 | 55 | |
gallonm | 4:a5abf7757947 | 56 | public: |
gallonm | 4:a5abf7757947 | 57 | X_NUCLEO_VL6180XA1(); // verificare se necessario passare come argomento un dev_i2c |
gallonm | 4:a5abf7757947 | 58 | bool VL6180X_Init(); // controlla la presenza del sensore , chiamo Prepare() e setto ready |
gallonm | 4:a5abf7757947 | 59 | // modificare l'indirizzo i2c dei sensori (slave address) |
gallonm | 4:a5abf7757947 | 60 | |
gallonm | 4:a5abf7757947 | 61 | |
gallonm | 4:a5abf7757947 | 62 | VL6180X *vl6180x_sensor; |
gallonm | 4:a5abf7757947 | 63 | Display *display; |
gallonm | 4:a5abf7757947 | 64 | GPIO_expander *gpio_expander; |
gallonm | 4:a5abf7757947 | 65 | DevI2C *dev_i2c; |
gallonm | 4:a5abf7757947 | 66 | |
gallonm | 4:a5abf7757947 | 67 | //posso creare 4 puntatori a istanze di tipo VL6180X, con i nomi della board(S1, left, bottom, right) |
gallonm | 4:a5abf7757947 | 68 | //oppure posso creare un vettore di VL6180X di dimensione 4 per contenere tutti i sensori |
gallonm | 4:a5abf7757947 | 69 | //dopo tengo traccia di quali sensori sono presenti e funzionanti |
gallonm | 4:a5abf7757947 | 70 | |
gallonm | 4:a5abf7757947 | 71 | private: |
gallonm | 4:a5abf7757947 | 72 | static X_NUCLEO_IKS01A1 *instance; |
gallonm | 4:a5abf7757947 | 73 | |
gallonm | 4:a5abf7757947 | 74 | } |
gallonm | 4:a5abf7757947 | 75 | */ |
gallonm | 0:1fb1f010ac84 | 76 | |
gallonm | 0:1fb1f010ac84 | 77 | |
gallonm | 0:1fb1f010ac84 | 78 | |
gallonm | 0:1fb1f010ac84 | 79 | #endif /* __X_NUCLEO_6180XA1_H */ |