Time of Flight Sensor
Dependencies: ST_INTERFACES X_NUCLEO_COMMON
Dependents: Ultrasound_And_IMU
Fork of X_NUCLEO_6180XA1 by
Revision 41:2e00362bdb8e, committed 2016-03-03
- 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;
