Skip to content

Commit fefc285

Browse files
ppryga-nordickartben
authored andcommitted
driver: clock_control: Add to nrf clock control calib in progres API
It may be required to get information if NRF LF clock control calibration is in progress. Some time sensitive operations could benefit from this information. The commit adds simple function that provides the information. The function is nRF platform specific. Signed-off-by: Piotr Pryga <piotr.pryga@nordicsemi.no>
1 parent c4d884c commit fefc285

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

drivers/clock_control/nrf_clock_calibration.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,3 +294,8 @@ int z_nrf_clock_calibration_skips_count(void)
294294

295295
return total_skips_cnt;
296296
}
297+
298+
bool z_nrf_clock_calibration_is_in_progress(void)
299+
{
300+
return cal_process_in_progress ? true : false;
301+
}

include/zephyr/drivers/clock_control/nrf_clock_control.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,13 @@ int z_nrf_clock_calibration_count(void);
117117
*/
118118
int z_nrf_clock_calibration_skips_count(void);
119119

120+
121+
/** @brief Returns information if LF clock calibration is in progress.
122+
*
123+
* @return True if calibration is in progress, false otherwise.
124+
*/
125+
bool z_nrf_clock_calibration_is_in_progress(void);
126+
120127
/** @brief Get onoff service for given clock subsystem.
121128
*
122129
* @param sys Subsystem.

0 commit comments

Comments
 (0)