INSAT Mini Project
Dependencies: ST_INTERFACES X_NUCLEO_COMMON
Fork of X_NUCLEO_6180XA1 by
Diff: x_nucleo_6180xa1.h
- Revision:
- 10:4954b09b72d8
- Parent:
- 7:2dc81120c917
- Child:
- 12:71d589e6fd2c
--- a/x_nucleo_6180xa1.h Tue Sep 29 15:40:08 2015 +0200 +++ b/x_nucleo_6180xa1.h Tue Oct 06 09:03:10 2015 +0200 @@ -44,47 +44,49 @@ #include "mbed.h" #include "vl6180x_class.h" #include "display_class.h" -#include "GPIO_expander_class.h" +#include "STMPE1600_class.h" #include "DevI2C.h" +/** New device addresses */ +#define NEW_SENSOR_TOP_ADDRESS 0x10 +//#define NEW_SENSOR_LEFT_ADDRESS 0x33 +//#define NEW_SENSOR_BOTTOM_ADDRESS 0x34 +//#define NEW_SENSOR_RIGHT_ADDRESS 0x35 + /* Classes--------------------------------------------------------------------*/ -/*class X_NUCLEO_6180XA1 +class X_NUCLEO_6180XA1 { - protected: - public: - X_NUCLEO_VL6180XA1(DevI2C *i2c)): dev_i2c(i2c), - vl6180x_top(new VL6180X()), - vl6180x_left(new VL6180X()), - vl6180x_bottom(new VL6180X()), - vl6180x_right(new VL6180X()), - display(new Display(i2c)), - gpio_expander(i2c)); + X_NUCLEO_6180XA1(DevI2C *ext_i2c) : dev_i2c(ext_i2c) + { + gpio0_top=new STMPE1600DigiOut(*dev_i2c, GPIO_12); + sensor_top=new VL6180X(*dev_i2c, *gpio0_top); + } - - VL6180X *vl6180x_top; - VL6180X *vl6180x_left; - VL6180X *vl6180x_bottom; - VL6180X *vl6180x_right; - Display *display; - GPIO_expander *gpio_expander; - DevI2C *dev_i2c; + ~X_NUCLEO_6180XA1() + { + if(gpio0_top!=NULL) + delete[] gpio0_top; + if(sensor_top!=NULL) + delete[] sensor_top; + } + + DevI2C *dev_i2c; + STMPE1600DigiOut *gpio0_top; + VL6180X *sensor_top; - X_NUCLEO_VL6180XA1 *Instance(DevI2C *i2c) - { - if(_instance==NULL) - _instance=new X_NUCLEO_6180XA1(i2c); - else - errore - } + //VL6180X *vl6180x_left; + //VL6180X *vl6180x_bottom; + //VL6180X *vl6180x_right; + //Display *display; + + static X_NUCLEO_6180XA1 *Instance(DevI2C *ext_i2c); + + int InitBoard(); // posso ritornare il numero dei dispositivi attivi private: static X_NUCLEO_6180XA1 *_instance; - -} -*/ - - +}; #endif /* __X_NUCLEO_6180XA1_H */