Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DA1469x: Clock time shifts on reboots #3321

Merged
merged 6 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 57 additions & 2 deletions hw/mcu/dialog/da1469x/include/mcu/da1469x_clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,21 @@ void da1469x_clock_sys_xtal32m_switch_safe(void);
*/
void da1469x_clock_sys_rc32m_disable(void);

/**
* Enable RC32M
*/
void da1469x_clock_sys_rc32m_enable(void);

/**
* Switch sys_clk to RC32M
*/
void da1469x_clock_sys_rc32m_switch(void);

/**
* Disable XTAL32K
*/
void da1469x_clock_lp_xtal32k_disable(void);

/**
* Enable XTAL32K
*/
Expand All @@ -73,6 +88,21 @@ void da1469x_clock_lp_xtal32k_enable(void);
*/
void da1469x_clock_lp_xtal32k_switch(void);

/**
* Disable RC32K
*/
void da1469x_clock_lp_rc32k_disable(void);

/**
* Enable RC32K
*/
void da1469x_clock_lp_rc32k_enable(void);

/**
* Switch lp_clk to RC32K
*/
void da1469x_clock_lp_rc32k_switch(void);

/**
* Enable RCX
*/
Expand All @@ -95,10 +125,20 @@ void da1469x_clock_lp_rcx_calibrate(void);
*/
void da1469x_clock_lp_rc32k_calibrate(void);

/**
* Calibrate XTAL32K
*/
void da1469x_clock_lp_xtal32k_calibrate(void);

/**
* Calibrate selected LP clock
*/
void da1469x_clock_lp_calibrate(void);

/**
* Calibrate RC32M
*/
void da1469x_clock_lp_rc32m_calibrate(void);
void da1469x_clock_sys_rc32m_calibrate(void);

/**
* Get calibrated (measured) RCX frequency
Expand All @@ -110,16 +150,31 @@ uint32_t da1469x_clock_lp_rcx_freq_get(void);
*/
uint32_t da1469x_clock_lp_rc32k_freq_get(void);

/**
* Get calibrated XTAL32K frequency
*/
uint32_t da1469x_clock_lp_xtal32k_freq_get(void);

/**
* Get seleted LP clock's frequency
*/
uint32_t da1469x_clock_lp_freq_get(void);

/**
* Get calibrated (measured) RC32M frequency
*/
uint32_t da1469x_clock_lp_rc32m_freq_get(void);
uint32_t da1469x_clock_sys_rc32m_freq_get(void);

/**
* Disable RCX
*/
void da1469x_clock_lp_rcx_disable(void);

/**
* Set the RTC dividers
*/
void da1469x_clock_lp_set_rtc_divs(uint32_t rtc_clock_freq);

/**
* Enable AMBA clock(s)
*
Expand Down
7 changes: 7 additions & 0 deletions hw/mcu/dialog/da1469x/include/mcu/da1469x_hal.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ extern const int qspi_flash_config_array_size;

const struct qspi_flash_config *da1469x_qspi_get_config(void);

/**
* Calculate the OS tick parameters.
*
* @param cycles_per_sec Input frequency of timer generating OS ticks
*/
void hal_os_tick_calc_params(uint32_t cycles_per_sec);

#ifdef __cplusplus
}
#endif
Expand Down
3 changes: 3 additions & 0 deletions hw/mcu/dialog/da1469x/include/mcu/da1469x_lpclk.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ void da1469x_lpclk_register_cmac_cb(da1469x_lpclk_cb *cb);
void da1469x_lpclk_enabled(void);
/* Frequency of lp clock changed (e.g. after RCX recalibration) */
void da1469x_lpclk_updated(void);
/* Initialize selected LP RC clock */
void da1469x_lpclk_rc_init();


#ifdef __cplusplus
}
Expand Down
Loading
Loading