Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Check_VL6180XA1_ToF
Fork of X_NUCLEO_6180XA1 by
Diff: x_nucleo_6180xa1.h
- Revision:
- 33:1573db91352c
- Parent:
- 27:22c6f69967d9
- Child:
- 36:f6278b3e7c82
diff -r ef97c377d27b -r 1573db91352c x_nucleo_6180xa1.h
--- a/x_nucleo_6180xa1.h Tue Nov 10 10:46:15 2015 +0000
+++ b/x_nucleo_6180xa1.h Tue Nov 17 17:15:47 2015 +0100
@@ -46,6 +46,7 @@
#include "Display_class.h"
#include "stmpe1600_class.h"
#include "DevI2C.h"
+#include "Switch_class.h"
/** New device addresses */
#define NEW_SENSOR_TOP_ADDRESS 0x10
@@ -60,7 +61,12 @@
public:
X_NUCLEO_6180XA1(DevI2C *ext_i2c) : dev_i2c(ext_i2c)
{
- digit1=new STMPE1600DigiOut(*dev_i2c, GPIO_7);
+ stmpe1600 = new STMPE1600(*ext_i2c);
+ stmpe1600->writeSYS_CTRL (SOFT_RESET);
+ Switch = new SWITCH (*stmpe1600, GPIO_11);
+ display = new Display(*stmpe1600);
+
+ /*digit1=new STMPE1600DigiOut(*dev_i2c, GPIO_7);
digit2=new STMPE1600DigiOut(*dev_i2c, GPIO_8);
digit3=new STMPE1600DigiOut(*dev_i2c, GPIO_9);
digit4=new STMPE1600DigiOut(*dev_i2c, GPIO_10);
@@ -71,9 +77,9 @@
dispD=new STMPE1600DigiOut(*dev_i2c, GPIO_3);
dispE=new STMPE1600DigiOut(*dev_i2c, GPIO_4);
dispF=new STMPE1600DigiOut(*dev_i2c, GPIO_5);
- dispG=new STMPE1600DigiOut(*dev_i2c, GPIO_6);
+ dispG=new STMPE1600DigiOut(*dev_i2c, GPIO_6);*/
//display=new Display(*digit1,*digit2,*digit3,*digit4,*dispA,*dispB,*dispC,*dispD,*dispE,*dispF,*dispG);
- display=new Display(*ext_i2c);
+ //display=new Display(*ext_i2c);
gpio0_top=new STMPE1600DigiOut(*dev_i2c, GPIO_12);
sensor_top=new VL6180X(*dev_i2c, *gpio0_top, PB_0);
@@ -98,7 +104,7 @@
if(sensor_top!=NULL)
{
delete sensor_top;
- sensor_top=NULL;
+ sensor_top=NULL;
}
if(gpio0_bottom!=NULL)
{
@@ -108,7 +114,7 @@
if(sensor_bottom!=NULL)
{
delete sensor_bottom;
- sensor_bottom=NULL;
+ sensor_bottom=NULL;
}
if(gpio0_left!=NULL)
{
@@ -118,7 +124,7 @@
if(sensor_left!=NULL)
{
delete sensor_left;
- sensor_left=NULL;
+ sensor_left=NULL;
}
if(gpio0_right!=NULL)
{
@@ -128,9 +134,9 @@
if(sensor_right!=NULL)
{
delete sensor_right;
- sensor_right=NULL;
+ sensor_right=NULL;
}
- delete digit1;
+ /*delete digit1;
delete digit2;
delete digit3;
delete digit4;
@@ -140,18 +146,27 @@
delete dispD;
delete dispE;
delete dispF;
- delete dispG;
- delete display;
+ delete dispG;*/
+ delete stmpe1600;
+ delete Switch;
+ delete display;
_instance=NULL;
}
-
+
+ bool RdSwitch () {
+ return Switch->RdSwitch();
+ }
+
DevI2C *dev_i2c;
VL6180X *sensor_top;
VL6180X *sensor_bottom;
VL6180X *sensor_left;
VL6180X *sensor_right;
-
+
+ STMPE1600 * stmpe1600;
+ SWITCH * Switch;
+
STMPE1600DigiOut *gpio0_top;
STMPE1600DigiOut *gpio0_bottom;
STMPE1600DigiOut *gpio0_left;
