mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-29 18:27:20 +02:00
change(esp_hw_support): add interface to calculate slow clock period by clock frequency
This commit is contained in:
@ -481,6 +481,14 @@ bool rtc_dig_8m_enabled(void);
|
||||
*/
|
||||
uint32_t rtc_clk_freq_cal(uint32_t cal_val);
|
||||
|
||||
/**
|
||||
* @brief Calculate the slow clock period value by slow clock frequency
|
||||
*
|
||||
* @param freq_hz Frequency of the slow clock in Hz
|
||||
* @return Fixed point value of slow clock period in microseconds
|
||||
*/
|
||||
uint32_t rtc_clk_freq_to_period(uint32_t freq_hz);
|
||||
|
||||
/**
|
||||
* @brief sleep configuration for rtc_sleep_init function
|
||||
*/
|
||||
|
@ -191,6 +191,8 @@ uint32_t rtc_clk_freq_cal(uint32_t cal_val)
|
||||
return 1000000ULL * (1 << RTC_CLK_CAL_FRACT) / cal_val;
|
||||
}
|
||||
|
||||
uint32_t rtc_clk_freq_to_period(uint32_t) __attribute__((alias("rtc_clk_freq_cal")));
|
||||
|
||||
/// @brief if the calibration is used, we need to enable the timer group0 first
|
||||
__attribute__((constructor))
|
||||
static void enable_timer_group0_for_calibration(void)
|
||||
|
@ -508,6 +508,14 @@ bool rtc_dig_8m_enabled(void);
|
||||
*/
|
||||
uint32_t rtc_clk_freq_cal(uint32_t cal_val);
|
||||
|
||||
/**
|
||||
* @brief Calculate the slow clock period value by slow clock frequency
|
||||
*
|
||||
* @param freq_hz Frequency of the slow clock in Hz
|
||||
* @return Fixed point value of slow clock period in microseconds
|
||||
*/
|
||||
uint32_t rtc_clk_freq_to_period(uint32_t freq_hz);
|
||||
|
||||
/**
|
||||
* @brief Power down flags for rtc_sleep_pd function
|
||||
*/
|
||||
|
@ -191,6 +191,8 @@ uint32_t rtc_clk_freq_cal(uint32_t cal_val)
|
||||
return 1000000ULL * (1 << RTC_CLK_CAL_FRACT) / cal_val;
|
||||
}
|
||||
|
||||
uint32_t rtc_clk_freq_to_period(uint32_t) __attribute__((alias("rtc_clk_freq_cal")));
|
||||
|
||||
/// @brief if the calibration is used, we need to enable the timer group0 first
|
||||
__attribute__((constructor))
|
||||
static void enable_timer_group0_for_calibration(void)
|
||||
|
@ -536,6 +536,14 @@ bool rtc_dig_8m_enabled(void);
|
||||
*/
|
||||
uint32_t rtc_clk_freq_cal(uint32_t cal_val);
|
||||
|
||||
/**
|
||||
* @brief Calculate the slow clock period value by slow clock frequency
|
||||
*
|
||||
* @param freq_hz Frequency of the slow clock in Hz
|
||||
* @return Fixed point value of slow clock period in microseconds
|
||||
*/
|
||||
uint32_t rtc_clk_freq_to_period(uint32_t freq_hz);
|
||||
|
||||
/**
|
||||
* @brief Power down flags for rtc_sleep_pd function
|
||||
*/
|
||||
|
@ -194,6 +194,8 @@ uint32_t rtc_clk_freq_cal(uint32_t cal_val)
|
||||
return 1000000ULL * (1 << RTC_CLK_CAL_FRACT) / cal_val;
|
||||
}
|
||||
|
||||
uint32_t rtc_clk_freq_to_period(uint32_t) __attribute__((alias("rtc_clk_freq_cal")));
|
||||
|
||||
/// @brief if the calibration is used, we need to enable the timer group0 first
|
||||
__attribute__((constructor))
|
||||
static void enable_timer_group0_for_calibration(void)
|
||||
|
@ -416,6 +416,14 @@ bool rtc_dig_8m_enabled(void);
|
||||
*/
|
||||
uint32_t rtc_clk_freq_cal(uint32_t cal_val);
|
||||
|
||||
/**
|
||||
* @brief Calculate the slow clock period value by slow clock frequency
|
||||
*
|
||||
* @param freq_hz Frequency of the slow clock in Hz
|
||||
* @return Fixed point value of slow clock period in microseconds
|
||||
*/
|
||||
uint32_t rtc_clk_freq_to_period(uint32_t freq_hz);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -196,6 +196,8 @@ uint32_t rtc_clk_freq_cal(uint32_t cal_val)
|
||||
return 1000000ULL * (1 << RTC_CLK_CAL_FRACT) / cal_val;
|
||||
}
|
||||
|
||||
uint32_t rtc_clk_freq_to_period(uint32_t) __attribute__((alias("rtc_clk_freq_cal")));
|
||||
|
||||
/// @brief if the calibration is used, we need to enable the timer group0 first
|
||||
__attribute__((constructor))
|
||||
static void enable_timer_group0_for_calibration(void)
|
||||
|
@ -447,6 +447,14 @@ bool rtc_dig_8m_enabled(void);
|
||||
*/
|
||||
uint32_t rtc_clk_freq_cal(uint32_t cal_val);
|
||||
|
||||
/**
|
||||
* @brief Calculate the slow clock period value by slow clock frequency
|
||||
*
|
||||
* @param freq_hz Frequency of the slow clock in Hz
|
||||
* @return Fixed point value of slow clock period in microseconds
|
||||
*/
|
||||
uint32_t rtc_clk_freq_to_period(uint32_t freq_hz);
|
||||
|
||||
|
||||
// -------------------------- CLOCK TREE DEFS ALIAS ----------------------------
|
||||
// **WARNING**: The following are only for backwards compatibility.
|
||||
|
@ -271,6 +271,8 @@ uint32_t rtc_clk_freq_cal(uint32_t cal_val)
|
||||
return 1000000ULL * (1 << RTC_CLK_CAL_FRACT) / cal_val;
|
||||
}
|
||||
|
||||
uint32_t rtc_clk_freq_to_period(uint32_t) __attribute__((alias("rtc_clk_freq_cal")));
|
||||
|
||||
/// @brief if the calibration is used, we need to enable the timer group0 first
|
||||
__attribute__((constructor))
|
||||
static void enable_timer_group0_for_calibration(void)
|
||||
|
@ -416,6 +416,14 @@ bool rtc_dig_8m_enabled(void);
|
||||
*/
|
||||
uint32_t rtc_clk_freq_cal(uint32_t cal_val);
|
||||
|
||||
/**
|
||||
* @brief Calculate the slow clock period value by slow clock frequency
|
||||
*
|
||||
* @param freq_hz Frequency of the slow clock in Hz
|
||||
* @return Fixed point value of slow clock period in microseconds
|
||||
*/
|
||||
uint32_t rtc_clk_freq_to_period(uint32_t freq_hz);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@ -196,6 +196,8 @@ uint32_t rtc_clk_freq_cal(uint32_t cal_val)
|
||||
return 1000000ULL * (1 << RTC_CLK_CAL_FRACT) / cal_val;
|
||||
}
|
||||
|
||||
uint32_t rtc_clk_freq_to_period(uint32_t) __attribute__((alias("rtc_clk_freq_cal")));
|
||||
|
||||
/// @brief if the calibration is used, we need to enable the timer group0 first
|
||||
__attribute__((constructor))
|
||||
static void enable_timer_group0_for_calibration(void)
|
||||
|
@ -445,6 +445,14 @@ bool rtc_dig_8m_enabled(void);
|
||||
*/
|
||||
uint32_t rtc_clk_freq_cal(uint32_t cal_val);
|
||||
|
||||
/**
|
||||
* @brief Calculate the slow clock period value by slow clock frequency
|
||||
*
|
||||
* @param freq_hz Frequency of the slow clock in Hz
|
||||
* @return Fixed point value of slow clock period in microseconds
|
||||
*/
|
||||
uint32_t rtc_clk_freq_to_period(uint32_t freq_hz);
|
||||
|
||||
// -------------------------- CLOCK TREE DEFS ALIAS ----------------------------
|
||||
// **WARNING**: The following are only for backwards compatibility.
|
||||
// Please use the declarations in soc/clk_tree_defs.h instead.
|
||||
|
@ -271,6 +271,8 @@ uint32_t rtc_clk_freq_cal(uint32_t cal_val)
|
||||
return 1000000ULL * (1 << RTC_CLK_CAL_FRACT) / cal_val;
|
||||
}
|
||||
|
||||
uint32_t rtc_clk_freq_to_period(uint32_t) __attribute__((alias("rtc_clk_freq_cal")));
|
||||
|
||||
/// @brief if the calibration is used, we need to enable the timer group0 first
|
||||
__attribute__((constructor))
|
||||
static void enable_timer_group0_for_calibration(void)
|
||||
|
@ -460,6 +460,14 @@ bool rtc_dig_8m_enabled(void);
|
||||
*/
|
||||
uint32_t rtc_clk_freq_cal(uint32_t cal_val);
|
||||
|
||||
/**
|
||||
* @brief Calculate the slow clock period value by slow clock frequency
|
||||
*
|
||||
* @param freq_hz Frequency of the slow clock in Hz
|
||||
* @return Fixed point value of slow clock period in microseconds
|
||||
*/
|
||||
uint32_t rtc_clk_freq_to_period(uint32_t freq_hz);
|
||||
|
||||
/**
|
||||
* @brief Enable or disable APLL
|
||||
*
|
||||
|
@ -222,6 +222,8 @@ uint32_t rtc_clk_freq_cal(uint32_t cal_val)
|
||||
return 1000000ULL * (1 << RTC_CLK_CAL_FRACT) / cal_val;
|
||||
}
|
||||
|
||||
uint32_t rtc_clk_freq_to_period(uint32_t) __attribute__((alias("rtc_clk_freq_cal")));
|
||||
|
||||
/// @brief if the calibration is used, we need to enable the timer group0 first
|
||||
__attribute__((constructor))
|
||||
static void enable_timer_group0_for_calibration(void)
|
||||
|
@ -569,6 +569,14 @@ bool rtc_dig_8m_enabled(void);
|
||||
*/
|
||||
uint32_t rtc_clk_freq_cal(uint32_t cal_val);
|
||||
|
||||
/**
|
||||
* @brief Calculate the slow clock period value by slow clock frequency
|
||||
*
|
||||
* @param freq_hz Frequency of the slow clock in Hz
|
||||
* @return Fixed point value of slow clock period in microseconds
|
||||
*/
|
||||
uint32_t rtc_clk_freq_to_period(uint32_t freq_hz);
|
||||
|
||||
/**
|
||||
* @brief Power down flags for rtc_sleep_pd function
|
||||
*/
|
||||
|
@ -259,6 +259,8 @@ uint32_t rtc_clk_freq_cal(uint32_t cal_val)
|
||||
return 1000000ULL * (1 << RTC_CLK_CAL_FRACT) / cal_val;
|
||||
}
|
||||
|
||||
uint32_t rtc_clk_freq_to_period(uint32_t) __attribute__((alias("rtc_clk_freq_cal")));
|
||||
|
||||
/// @brief if the calibration is used, we need to enable the timer group0 first
|
||||
__attribute__((constructor))
|
||||
static void enable_timer_group0_for_calibration(void)
|
||||
|
@ -547,6 +547,14 @@ bool rtc_dig_8m_enabled(void);
|
||||
*/
|
||||
uint32_t rtc_clk_freq_cal(uint32_t cal_val);
|
||||
|
||||
/**
|
||||
* @brief Calculate the slow clock period value by slow clock frequency
|
||||
*
|
||||
* @param freq_hz Frequency of the slow clock in Hz
|
||||
* @return Fixed point value of slow clock period in microseconds
|
||||
*/
|
||||
uint32_t rtc_clk_freq_to_period(uint32_t freq_hz);
|
||||
|
||||
/**
|
||||
* @brief Power up flags for rtc_sleep_pd function
|
||||
*/
|
||||
|
@ -193,6 +193,8 @@ uint32_t rtc_clk_freq_cal(uint32_t cal_val)
|
||||
return 1000000ULL * (1 << RTC_CLK_CAL_FRACT) / cal_val;
|
||||
}
|
||||
|
||||
uint32_t rtc_clk_freq_to_period(uint32_t) __attribute__((alias("rtc_clk_freq_cal")));
|
||||
|
||||
/// @brief if the calibration is used, we need to enable the timer group0 first
|
||||
__attribute__((constructor))
|
||||
static void enable_timer_group0_for_calibration(void)
|
||||
|
Reference in New Issue
Block a user