Now you can use NC as InterruptIn

Dependencies:   X_NUCLEO_COMMON

Fork of X_NUCLEO_6180XA1 by ST

Revision:
10:4954b09b72d8
Parent:
8:f943a1fca15f
diff -r 9cbc1736f148 -r 4954b09b72d8 Components/VL6180X/vl6180x_def.h
--- a/Components/VL6180X/vl6180x_def.h	Tue Sep 29 15:40:08 2015 +0200
+++ b/Components/VL6180X/vl6180x_def.h	Tue Oct 06 09:03:10 2015 +0200
@@ -127,7 +127,7 @@
 
 
 #if VL6180x_WRAP_AROUND_FILTER_SUPPORT || VL6180x_HAVE_DMAX_RANGING
-    #define VL6180x_HAVE_RATE_DATA
+	#define	VL6180x_HAVE_RATE_DATA
 #endif
 
 /** Error and warning code returned by API
@@ -136,7 +136,7 @@
  * positive value  are warning most of time it's ok to continue\n
  */
 enum VL6180x_ErrCode_t{
-    API_NO_ERROR        = 0,
+	API_NO_ERROR        = 0,
     CALIBRATION_WARNING = 1,  /*!< warning invalid calibration data may be in used \a  VL6180x_InitData() \a VL6180x_GetOffsetCalibrationData \a VL6180x_SetOffsetCalibrationData*/
     MIN_CLIPED          = 2,  /*!< warning parameter passed was clipped to min before to be applied */
     NOT_GUARANTEED      = 3,  /*!< Correct operation is not guaranteed typically using extended ranging on vl6180x */
@@ -238,6 +238,13 @@
     int8_t  Part2PartOffsetNVM;     /*!< backed up NVM value */
 };
 
+#if VL6180x_SINGLE_DEVICE_DRIVER
+extern  struct VL6180xDevData_t SingleVL6180xDevData;
+#define VL6180xDevDataGet(dev, field) (SingleVL6180xDevData.field)
+/* is also used as direct accessor like VL6180xDevDataGet(dev, x)++*/
+#define VL6180xDevDataSet(dev, field, data) (SingleVL6180xDevData.field)=(data)
+#endif
+
 
 /**
  * @struct VL6180x_RangeData_t
@@ -327,15 +334,15 @@
 /**
  * The device model ID
  */
-#define IDENTIFICATION_MODEL_ID                 (uint16_t) 0x000
+#define IDENTIFICATION_MODEL_ID                 0x000
 /**
  * Revision identifier of the Device for major change.
  */
-#define IDENTIFICATION_MODULE_REV_MAJOR         (uint16_t) 0x003
+#define IDENTIFICATION_MODULE_REV_MAJOR         0x003
 /**
  * Revision identifier of the Device for minor change.
  */
-#define IDENTIFICATION_MODULE_REV_MINOR         (uint16_t) 0x004
+#define IDENTIFICATION_MODULE_REV_MINOR         0x004
 
 
 /**
@@ -345,7 +352,7 @@
  *  Same definition as #SYSTEM_MODE_GPIO1
  * @ingroup device_regdef
  */
-#define SYSTEM_MODE_GPIO0                       (uint16_t) 0x010
+#define SYSTEM_MODE_GPIO0                       0x010
 /**
  * @def SYSTEM_MODE_GPIO1
  * @brief Configures polarity and select what als or ranging functionality gpio pin serves.
@@ -354,7 +361,7 @@
  * Same definition apply to register GPIO0 that is used as chip enable at power up.
  * @ingroup device_regdef
  */
-#define SYSTEM_MODE_GPIO1                       (uint16_t) 0x011
+#define SYSTEM_MODE_GPIO1                       0x011
     /** gpio pad POLARITY mask in #SYSTEM_MODE_GPIO1 (and/or 0) write  1  to set active high polarity (positive edge) */
     #define GPIOx_POLARITY_SELECT_MASK              0x20
     /** gpio pad Function select shift in #SYSTEM_MODE_GPIO1 or 0 */
@@ -390,7 +397,7 @@
  * \sa GPIO use for interrupt #SYSTEM_MODE_GPIO0 or #SYSTEM_MODE_GPIO1\n
  * @ingroup device_regdef
  */
-#define SYSTEM_INTERRUPT_CONFIG_GPIO           (uint16_t) 0x014
+#define SYSTEM_INTERRUPT_CONFIG_GPIO           0x014
     /** RANGE bits shift in #SYSTEM_INTERRUPT_CONFIG_GPIO */
     #define CONFIG_GPIO_RANGE_SHIFT            0
     /** RANGE bits mask in #SYSTEM_INTERRUPT_CONFIG_GPIO  (unshifted)*/
@@ -417,7 +424,7 @@
  *  Use or combination of any #INTERRUPT_CLEAR_RANGING , #INTERRUPT_CLEAR_ALS , #INTERRUPT_CLEAR_ERROR
  *  @ingroup device_regdef
  */
-#define SYSTEM_INTERRUPT_CLEAR                (uint16_t) 0x015
+#define SYSTEM_INTERRUPT_CLEAR                0x015
     /** clear ranging interrupt in write to #SYSTEM_INTERRUPT_CLEAR */
     #define INTERRUPT_CLEAR_RANGING                0x01
     /** clear als interrupt  in write to #SYSTEM_INTERRUPT_CLEAR */
@@ -426,7 +433,7 @@
     #define INTERRUPT_CLEAR_ERROR                  0x04
 
 /** After power up or reset this register will start reading 1 when device is ready */
-#define SYSTEM_FRESH_OUT_OF_RESET             (uint16_t) 0x016
+#define SYSTEM_FRESH_OUT_OF_RESET             0x016
 
 /**
  * @def SYSTEM_GROUPED_PARAMETER_HOLD
@@ -443,7 +450,7 @@
  * #SYSALS_THRESH_LOW
  * @ingroup device_regdef
  */
-#define SYSTEM_GROUPED_PARAMETER_HOLD         (uint16_t) 0x017
+#define SYSTEM_GROUPED_PARAMETER_HOLD         0x017
 
 
 /**
@@ -454,7 +461,7 @@
  *
  * @ingroup device_regdef
  */
-#define SYSRANGE_START                        (uint16_t) 0x018
+#define SYSRANGE_START                        0x018
     /** mask existing bit in #SYSRANGE_START*/
     #define MODE_MASK          0x03
     /** bit 0 in #SYSRANGE_START write 1 toggle state in continuous mode and arm next shot in single shot mode */
@@ -469,14 +476,14 @@
  * High level range  threshold (must be scaled)
  * @ingroup device_regdef
  */
-#define SYSRANGE_THRESH_HIGH                  (uint16_t) 0x019
+#define SYSRANGE_THRESH_HIGH                  0x019
 
 /**
  * @def SYSRANGE_THRESH_LOW
  * Low level range  threshold (must be scaled)
  * @ingroup device_regdef
  */
-#define SYSRANGE_THRESH_LOW                   (uint16_t) 0x01A
+#define SYSRANGE_THRESH_LOW                   0x01A
 
 /**
  * @def SYSRANGE_INTERMEASUREMENT_PERIOD
@@ -487,7 +494,7 @@
  *
  * @ingroup device_regdef
  */
-#define SYSRANGE_INTERMEASUREMENT_PERIOD      (uint16_t) 0x01B
+#define SYSRANGE_INTERMEASUREMENT_PERIOD      0x01B
 
 /**
  * @brief Maximum time to run measurement in Ranging modes.
@@ -499,33 +506,33 @@
  *
  * @ingroup device_regdef
  */
-#define SYSRANGE_MAX_CONVERGENCE_TIME         (uint16_t) 0x01C
+#define SYSRANGE_MAX_CONVERGENCE_TIME         0x01C
 /**@brief Cross talk compensation rate
  * @warning  never write register directly use @a VL6180x_SetXTalkCompensationRate()
  * refer to manual for calibration procedure and computation
  * @ingroup device_regdef
  */
-#define SYSRANGE_CROSSTALK_COMPENSATION_RATE  (uint16_t) 0x01E
+#define SYSRANGE_CROSSTALK_COMPENSATION_RATE  0x01E
 /**
  * @brief Minimum range value in mm to qualify for crosstalk compensation
  */
-#define SYSRANGE_CROSSTALK_VALID_HEIGHT       (uint16_t) 0x021
-#define SYSRANGE_EARLY_CONVERGENCE_ESTIMATE   (uint16_t) 0x022
-#define SYSRANGE_PART_TO_PART_RANGE_OFFSET    (uint16_t) 0x024
-#define SYSRANGE_RANGE_IGNORE_VALID_HEIGHT    (uint16_t) 0x025
-#define SYSRANGE_RANGE_IGNORE_THRESHOLD       (uint16_t) 0x026
-#define SYSRANGE_EMITTER_BLOCK_THRESHOLD      (uint16_t) 0x028
-#define SYSRANGE_MAX_AMBIENT_LEVEL_THRESH     (uint16_t) 0x02A
-#define SYSRANGE_MAX_AMBIENT_LEVEL_MULT       (uint16_t) 0x02C
+#define SYSRANGE_CROSSTALK_VALID_HEIGHT       0x021
+#define SYSRANGE_EARLY_CONVERGENCE_ESTIMATE   0x022
+#define SYSRANGE_PART_TO_PART_RANGE_OFFSET    0x024
+#define SYSRANGE_RANGE_IGNORE_VALID_HEIGHT    0x025
+#define SYSRANGE_RANGE_IGNORE_THRESHOLD       0x026
+#define SYSRANGE_EMITTER_BLOCK_THRESHOLD      0x028
+#define SYSRANGE_MAX_AMBIENT_LEVEL_THRESH     0x02A
+#define SYSRANGE_MAX_AMBIENT_LEVEL_MULT       0x02C
 /** @brief  various Enable check enabel register
  *  @a VL6180x_RangeSetEceState()
  */
-#define SYSRANGE_RANGE_CHECK_ENABLES          (uint16_t) 0x02D
+#define SYSRANGE_RANGE_CHECK_ENABLES          0x02D
     #define RANGE_CHECK_ECE_ENABLE_MASK      0x01
     #define RANGE_CHECK_RANGE_ENABLE_MASK    0x02
     #define RANGE_CHECK_SNR_ENABLKE          0x10
 
-#define SYSRANGE_VHV_RECALIBRATE              (uint16_t) 0x02E
+#define SYSRANGE_VHV_RECALIBRATE              0x02E
 #define SYSRANGE_VHV_REPEAT_RATE              0x031
 
 /**
@@ -534,26 +541,26 @@
  *
  * same bit definition as range \a #SYSRANGE_START \n
  */
-#define SYSALS_START                          (uint16_t) 0x038
+#define SYSALS_START                          0x038
 
 /** ALS low Threshold high */
-#define SYSALS_THRESH_HIGH                    (uint16_t) 0x03A
+#define SYSALS_THRESH_HIGH                    0x03A
 /** ALS low Threshold low */
-#define SYSALS_THRESH_LOW                     (uint16_t) 0x03C
+#define SYSALS_THRESH_LOW                     0x03C
 /** ALS intermeasurement period */
-#define SYSALS_INTERMEASUREMENT_PERIOD        (uint16_t) 0x03E
+#define SYSALS_INTERMEASUREMENT_PERIOD        0x03E
 /** 
  * @warning or value with 0x40 when writing to these register*/
-#define SYSALS_ANALOGUE_GAIN                  (uint16_t) 0x03F
+#define SYSALS_ANALOGUE_GAIN                  0x03F
 /** ALS integration period */
-#define SYSALS_INTEGRATION_PERIOD             (uint16_t) 0x040
+#define SYSALS_INTEGRATION_PERIOD             0x040
 
 /**
  * @brief Result range status
  *
  *  Hold the various range interrupt flags and error Specific error codes
  */
-#define RESULT_RANGE_STATUS                   (uint16_t) 0x04D
+#define RESULT_RANGE_STATUS                   0x04D
     /** Device ready for new command bit 0*/
     #define RANGE_DEVICE_READY_MASK       0x01
     /** mask for error status covers bits [7:4]  in #RESULT_RANGE_STATUS @a ::RangeError_u */
@@ -566,7 +573,7 @@
  * @brief Result  als status \n
  *  Hold the various als interrupt flags and Specific error codes
  */
-#define RESULT_ALS_STATUS                     (uint16_t) 0x4E
+#define RESULT_ALS_STATUS                     0x4E
     /** Device ready for new command bit 0*/
    #define ALS_DEVICE_READY_MASK       0x01
 
@@ -577,7 +584,7 @@
  * Lux value depends on Gain and integration settings and calibrated lux/count setting
  * \a VL6180x_AlsGetLux() \a VL6180x_AlsGetMeasurement()
  */
-#define RESULT_ALS_VAL                        (uint16_t) 0x50
+#define RESULT_ALS_VAL                        0x50
 
 /**
  * @def FW_ALS_RESULT_SCALER
@@ -585,7 +592,7 @@
  * these register content is cached by API in \a VL6180xDevData_t::AlsScaler
  * for lux computation acceleration
  */
-#define FW_ALS_RESULT_SCALER                  (uint16_t) 0x120
+#define FW_ALS_RESULT_SCALER                  0x120
 
 
 /**
@@ -617,7 +624,7 @@
  *
  * @ingroup device_regdef
  */
-#define RESULT_INTERRUPT_STATUS_GPIO          (uint16_t) 0x4F
+#define RESULT_INTERRUPT_STATUS_GPIO          0x4F
     /** ranging interrupt 1st bit position in #RESULT_INTERRUPT_STATUS_GPIO */
     #define RES_INT_RANGE_SHIFT  0
     /** ALS interrupt 1st bit position in #RESULT_INTERRUPT_STATUS_GPIO */
@@ -647,33 +654,33 @@
 /**
  * Final range result value presented to the user for use. Unit is in mm.
  */
-#define RESULT_RANGE_VAL                        (uint16_t) 0x062
+#define RESULT_RANGE_VAL                        0x062
 
 /**
  * Raw Range result value with offset applied (no cross talk compensation applied). Unit is in mm.
  */
-#define RESULT_RANGE_RAW                        (uint16_t) 0x064
+#define RESULT_RANGE_RAW                        0x064
 
 /**
  * @brief Sensor count rate of signal returns correlated to IR emitter.
  *
  * Computed from RETURN_SIGNAL_COUNT / RETURN_CONV_TIME. Mcps 9.7 format
  */
-#define RESULT_RANGE_SIGNAL_RATE                (uint16_t) 0x066
+#define RESULT_RANGE_SIGNAL_RATE                0x066
 
 /**
  * @brief Return signal count
  *
  *  Sensor count output value attributed to signal correlated to IR emitter on the Return array.
  */
-#define RESULT_RANGE_RETURN_SIGNAL_COUNT        (uint16_t) 0x06C
+#define RESULT_RANGE_RETURN_SIGNAL_COUNT        0x06C
 
 /**
  * @brief Reference signal count
  *
  * sensor count output value attributed to signal correlated to IR emitter on the Reference array.
  */
-#define RESULT_RANGE_REFERENCE_SIGNAL_COUNT     (uint16_t) 0x070
+#define RESULT_RANGE_REFERENCE_SIGNAL_COUNT     0x070
 
 /**
  * @brief Return ambient count
@@ -681,24 +688,24 @@
  * sensor count output value attributed to uncorrelated ambient signal on the Return array.
  * Must be multiplied by 6 if used to calculate the ambient to signal threshold
  */
-#define RESULT_RANGE_RETURN_AMB_COUNT           (uint16_t) 0x074
+#define RESULT_RANGE_RETURN_AMB_COUNT           0x074
 
 /**
  * @brief   Reference ambient count
  *
  * Sensor count output value attributed to uncorrelated ambient signal on the Reference array.
  */
-#define RESULT_RANGE_REFERENCE_AMB_COUNT        (uint16_t) 0x078
+#define RESULT_RANGE_REFERENCE_AMB_COUNT        0x078
 
 /**
  * sensor count output value attributed to signal on the Return array.
  */
-#define RESULT_RANGE_RETURN_CONV_TIME           (uint16_t) 0x07C
+#define RESULT_RANGE_RETURN_CONV_TIME           0x07C
 
 /**
  * sensor count output value attributed to signal on the Reference array.
  */
-#define RESULT_RANGE_REFERENCE_CONV_TIME        (uint16_t) 0x080
+#define RESULT_RANGE_REFERENCE_CONV_TIME        0x080
 
 
 /**
@@ -707,7 +714,7 @@
  *
  * Never should  user write directly onto that register directly \a VL6180x_UpscaleSetScaling()
  */
-#define RANGE_SCALER                            (uint16_t) 0x096
+#define RANGE_SCALER                            0x096
 
 /**
  * @def READOUT_AVERAGING_SAMPLE_PERIOD
@@ -722,7 +729,7 @@
  *
  * see datasheet for more detail
  */
-#define READOUT_AVERAGING_SAMPLE_PERIOD     (uint16_t) 0x10A
+#define READOUT_AVERAGING_SAMPLE_PERIOD     0x10A
 
 /**
  * @def I2C_SLAVE_DEVICE_ADDRESS
@@ -731,6 +738,6 @@
  * so what prohamd is commonly whar ergfer as adrerss /2
  * @sa VL6180x_SetI2CAddress()
  */
-#define I2C_SLAVE_DEVICE_ADDRESS               (uint16_t) 0x212
+#define I2C_SLAVE_DEVICE_ADDRESS               0x212
 
 #endif /* _VL6180x_DEF */