mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
drivers/tmp00x : Add CONFIG_
Add CONFIG_ prefix to compile configurations
This commit is contained in:
parent
99e7b81d10
commit
94d6b898fc
@ -103,15 +103,15 @@ extern "C"
|
|||||||
* I2C Address depends on the state of ADR0 and ADR1 Pins
|
* I2C Address depends on the state of ADR0 and ADR1 Pins
|
||||||
* For more information, please refer to section 7.3.6.2 of TMP007 datasheet (SBOS685B).
|
* For more information, please refer to section 7.3.6.2 of TMP007 datasheet (SBOS685B).
|
||||||
*/
|
*/
|
||||||
#ifndef TMP00X_I2C_ADDRESS
|
#ifndef CONFIG_TMP00X_I2C_ADDRESS
|
||||||
#define TMP00X_I2C_ADDRESS (0x40)
|
#define CONFIG_TMP00X_I2C_ADDRESS (0x40)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Default Conversion Time in us
|
* @brief Default Conversion Time in us
|
||||||
*/
|
*/
|
||||||
#ifndef TMP00X_CONVERSION_TIME
|
#ifndef CONFIG_TMP00X_CONVERSION_TIME
|
||||||
#define TMP00X_CONVERSION_TIME (1E6)
|
#define CONFIG_TMP00X_CONVERSION_TIME (1E6)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -119,11 +119,11 @@ extern "C"
|
|||||||
*
|
*
|
||||||
* If set to 0, the device will be always-on
|
* If set to 0, the device will be always-on
|
||||||
* If set to 1, the device will be put in low power mode between measurements.
|
* If set to 1, the device will be put in low power mode between measurements.
|
||||||
* This adds a @c TMP00X_CONVERSION_TIME us delay to each measurement call
|
* This adds a @c CONFIG_TMP00X_CONVERSION_TIME us delay to each measurement call
|
||||||
* for bringing the device out of standby.
|
* for bringing the device out of standby.
|
||||||
*/
|
*/
|
||||||
#ifndef TMP00X_USE_LOW_POWER
|
#ifndef CONFIG_TMP00X_USE_LOW_POWER
|
||||||
#define TMP00X_USE_LOW_POWER (0)
|
#define CONFIG_TMP00X_USE_LOW_POWER (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -132,8 +132,8 @@ extern "C"
|
|||||||
* If set to 0, measurements will be converted to Celsius.
|
* If set to 0, measurements will be converted to Celsius.
|
||||||
* If set to 1, raw adc readings will be returned.
|
* If set to 1, raw adc readings will be returned.
|
||||||
*/
|
*/
|
||||||
#ifndef TMP00X_USE_RAW_VALUES
|
#ifndef CONFIG_TMP00X_USE_RAW_VALUES
|
||||||
#define TMP00X_USE_RAW_VALUES (0)
|
#define CONFIG_TMP00X_USE_RAW_VALUES (0)
|
||||||
#endif
|
#endif
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ extern "C" {
|
|||||||
#define TMP00X_PARAM_I2C I2C_DEV(0)
|
#define TMP00X_PARAM_I2C I2C_DEV(0)
|
||||||
#endif
|
#endif
|
||||||
#ifndef TMP00X_PARAM_ADDR
|
#ifndef TMP00X_PARAM_ADDR
|
||||||
#define TMP00X_PARAM_ADDR (TMP00X_I2C_ADDRESS)
|
#define TMP00X_PARAM_ADDR (CONFIG_TMP00X_I2C_ADDRESS)
|
||||||
#endif
|
#endif
|
||||||
#ifndef TMP00X_PARAM_RATE
|
#ifndef TMP00X_PARAM_RATE
|
||||||
#define TMP00X_PARAM_RATE TMP00X_CONFIG_CR_DEF
|
#define TMP00X_PARAM_RATE TMP00X_CONFIG_CR_DEF
|
||||||
|
@ -211,7 +211,7 @@ int tmp00x_read_temperature(const tmp00x_t *dev, int16_t *ta, int16_t *to)
|
|||||||
if (tmp00x_set_active(dev)) {
|
if (tmp00x_set_active(dev)) {
|
||||||
return TMP00X_ERROR;
|
return TMP00X_ERROR;
|
||||||
}
|
}
|
||||||
xtimer_usleep(TMP00X_CONVERSION_TIME);
|
xtimer_usleep(CONFIG_TMP00X_CONVERSION_TIME);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -46,7 +46,7 @@ int main(void)
|
|||||||
puts("start measurement [ERROR]");
|
puts("start measurement [ERROR]");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
xtimer_usleep(TMP00X_CONVERSION_TIME);
|
xtimer_usleep(CONFIG_TMP00X_CONVERSION_TIME);
|
||||||
puts("[SUCCESS]\n");
|
puts("[SUCCESS]\n");
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
@ -60,7 +60,7 @@ int main(void)
|
|||||||
else {
|
else {
|
||||||
puts("conversion in progress ... ");
|
puts("conversion in progress ... ");
|
||||||
}
|
}
|
||||||
xtimer_usleep(TMP00X_CONVERSION_TIME);
|
xtimer_usleep(CONFIG_TMP00X_CONVERSION_TIME);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user