mirror of https://github.com/ARMmbed/mbed-os.git
STM32L0 ADC TEMPERATURE CHANNEL rework
parent
51b8d6e59d
commit
087cd26dd4
|
@ -172,12 +172,6 @@ uint16_t adc_read(analogin_t *obj)
|
||||||
|
|
||||||
HAL_ADC_ConfigChannel(&obj->handle, &sConfig);
|
HAL_ADC_ConfigChannel(&obj->handle, &sConfig);
|
||||||
|
|
||||||
/* need to wait for some stabilization time after setting the TSEN bit in the ADC_CCR
|
|
||||||
register to wake up the temperature sensor from power down mode */
|
|
||||||
if (sConfig.Channel == ADC_CHANNEL_TEMPSENSOR) {
|
|
||||||
wait_ms(20);
|
|
||||||
}
|
|
||||||
|
|
||||||
HAL_ADC_Start(&obj->handle); // Start conversion
|
HAL_ADC_Start(&obj->handle); // Start conversion
|
||||||
|
|
||||||
// Wait end of conversion and get value
|
// Wait end of conversion and get value
|
||||||
|
|
|
@ -280,9 +280,8 @@
|
||||||
#define ADC_STAB_DELAY_US ((uint32_t) 1U)
|
#define ADC_STAB_DELAY_US ((uint32_t) 1U)
|
||||||
|
|
||||||
/* Delay for temperature sensor stabilization time. */
|
/* Delay for temperature sensor stabilization time. */
|
||||||
/* Maximum delay is 10us (refer to device datasheet, parameter tSTART). */
|
|
||||||
/* Unit: us */
|
/* Unit: us */
|
||||||
#define ADC_TEMPSENSOR_DELAY_US ((uint32_t) 10U)
|
#define ADC_TEMPSENSOR_DELAY_US ((uint32_t) 20000U)
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue