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.
Dependencies: ST_INTERFACES X_NUCLEO_COMMON
Dependents: Ultrasound_And_IMU
Fork of X_NUCLEO_6180XA1 by
Diff: Components/VL6180X/vl6180x_class.h
- Revision:
- 41:2e00362bdb8e
- Parent:
- 38:18abb7f7dcb2
- Child:
- 42:692c6223dc24
--- 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;
