stm32f0: adjust wwdg threshold signatures to support 12 bit resolution
This commit is contained in:
parent
5409ce73bd
commit
854da9635e
@ -190,8 +190,8 @@ void adc_calibrate_wait_finish(uint32_t adc)
|
|||||||
void adc_enable_analog_watchdog_on_all_channels(uint32_t adc);
|
void adc_enable_analog_watchdog_on_all_channels(uint32_t adc);
|
||||||
void adc_enable_analog_watchdog_on_selected_channel(uint32_t adc, uint8_t chan);
|
void adc_enable_analog_watchdog_on_selected_channel(uint32_t adc, uint8_t chan);
|
||||||
void adc_disable_analog_watchdog(uint32_t adc);
|
void adc_disable_analog_watchdog(uint32_t adc);
|
||||||
void adc_set_watchdog_high_threshold(uint32_t adc, uint8_t threshold);
|
void adc_set_watchdog_high_threshold(uint32_t adc, uint16_t threshold);
|
||||||
void adc_set_watchdog_low_threshold(uint32_t adc, uint8_t threshold);
|
void adc_set_watchdog_low_threshold(uint32_t adc, uint16_t threshold);
|
||||||
|
|
||||||
END_DECLS
|
END_DECLS
|
||||||
|
|
||||||
|
@ -516,10 +516,10 @@ void adc_disable_analog_watchdog(uint32_t adc)
|
|||||||
/** @brief ADC Set Analog Watchdog Upper Threshold
|
/** @brief ADC Set Analog Watchdog Upper Threshold
|
||||||
*
|
*
|
||||||
* @param[in] adc Unsigned int32. ADC base address (@ref adc_reg_base)
|
* @param[in] adc Unsigned int32. ADC base address (@ref adc_reg_base)
|
||||||
* @param[in] threshold Unsigned int8. Upper threshold value
|
* @param[in] threshold. Upper threshold value
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void adc_set_watchdog_high_threshold(uint32_t adc, uint8_t threshold)
|
void adc_set_watchdog_high_threshold(uint32_t adc, uint16_t threshold)
|
||||||
{
|
{
|
||||||
ADC_TR1(adc) = (ADC_TR1(adc) & ~ADC_TR1_HT) | ADC_TR1_HT_VAL(threshold);
|
ADC_TR1(adc) = (ADC_TR1(adc) & ~ADC_TR1_HT) | ADC_TR1_HT_VAL(threshold);
|
||||||
}
|
}
|
||||||
@ -528,10 +528,10 @@ void adc_set_watchdog_high_threshold(uint32_t adc, uint8_t threshold)
|
|||||||
/** @brief ADC Set Analog Watchdog Lower Threshold
|
/** @brief ADC Set Analog Watchdog Lower Threshold
|
||||||
*
|
*
|
||||||
* @param[in] adc Unsigned int32. ADC base address (@ref adc_reg_base)
|
* @param[in] adc Unsigned int32. ADC base address (@ref adc_reg_base)
|
||||||
* @param[in] threshold Unsigned int8. Lower threshold value
|
* @param[in] threshold. Lower threshold value
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void adc_set_watchdog_low_threshold(uint32_t adc, uint8_t threshold)
|
void adc_set_watchdog_low_threshold(uint32_t adc, uint16_t threshold)
|
||||||
{
|
{
|
||||||
ADC_TR1(adc) = (ADC_TR1(adc) & ~ADC_TR1_LT) | ADC_TR1_LT_VAL(threshold);
|
ADC_TR1(adc) = (ADC_TR1(adc) & ~ADC_TR1_LT) | ADC_TR1_LT_VAL(threshold);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user