use VL6180XA1 chip wothout X-NUCLEO-6180XA1 Board. Simple way to use the chip.

Dependents:   Check_VL6180XA1_ToF

Fork of X_NUCLEO_6180XA1 by ST

Files at this revision

API Documentation at this revision

Comitter:
mapellil
Date:
Thu Mar 03 10:43:01 2016 +0000
Parent:
40:b4d20279e312
Child:
42:692c6223dc24
Commit message:
Check if 6180 InterruptIn pin is NC do not register call back function.

Changed in this revision

Components/VL6180X/vl6180x_class.h Show annotated file Show diff for this revision Revisions of this file
--- a/Components/VL6180X/vl6180x_class.h	Wed Feb 24 14:51:25 2016 +0000
+++ b/Components/VL6180X/vl6180x_class.h	Thu Mar 03 10:43:01 2016 +0000
@@ -109,6 +109,7 @@
        MyDevice.Ready=0;
        Device=&MyDevice;;
        expgpio0=NULL;
+       gpio1Pin=pin_gpio1;
     }  
     /** Constructor 2
      * @param[in] i2c device I2C to be used for communication
@@ -122,7 +123,8 @@
        MyDevice.Present=0;
        MyDevice.Ready=0;
        Device=&MyDevice;
-       gpio0=NULL;			 		 
+       gpio0=NULL;		
+       gpio1Pin=pin_gpio1;	 		 
     }  	 
     
    /** Destructor
@@ -204,7 +206,7 @@
 	 */					     
     void EnableInterruptMeasureDetectionIRQ(void) 
     {
-       gpio1Int.enable_irq();
+       if (gpio1Pin != NC) gpio1Int.enable_irq();
     }
 
 	/**
@@ -213,7 +215,7 @@
 	 */					          
     void DisableInterruptMeasureDetectionIRQ(void) 
     {
-       gpio1Int.disable_irq();
+       if (gpio1Pin != NC) gpio1Int.disable_irq();
     }
 	/*** End High level API ***/	          
 	
@@ -224,7 +226,7 @@
 	 */					                  
     void AttachInterruptMeasureDetectionIRQ(void (*fptr)(void))
     {
-       gpio1Int.rise(fptr);
+       if (gpio1Pin != NC) gpio1Int.rise(fptr);
     }
     
 	/**
@@ -1186,6 +1188,7 @@
     STMPE1600DigiOut *expgpio0;
     /* Measure detection IRQ */
     InterruptIn gpio1Int;
+	PinName     gpio1Pin;    
     /* Device data */
     MyVL6180Dev_t MyDevice;
     VL6180xDev_t Device;