a36a478954
Reworked calibration to not use HW platform which is not available on some platforms (nrf53) and does not bring any value compared to using system timer. Switched to use k_timer. Additionally, improved calibration algorithm to request also LF clock before starting calibration. This simplifies the algorithm because it does not need to support disabling low frequency clock which in calibration. Tests has been updated and simplified. Former tests relied on HW timer event. Signed-off-by: Krzysztof Chruscinski <krzysztof.chruscinski@nordicsemi.no>
44 lines
901 B
C
44 lines
901 B
C
/*
|
|
* Copyright (c) 2019 Nordic Semiconductor ASA
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
#ifndef ZEPHYR_DRIVERS_CLOCK_CONTROL_NRF_CLOCK_CALIBRATION_H_
|
|
#define ZEPHYR_DRIVERS_CLOCK_CONTROL_NRF_CLOCK_CALIBRATION_H_
|
|
|
|
#include <device.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/**
|
|
* @brief Initialize LFCLK RC calibration.
|
|
*
|
|
* @param hfclk_dev HFCLK device.
|
|
*/
|
|
void z_nrf_clock_calibration_init(struct device *hfclk_dev);
|
|
|
|
/**
|
|
* @brief Calibration interrupts handler
|
|
*
|
|
* Must be called from clock interrupt context.
|
|
*/
|
|
void z_nrf_clock_calibration_isr(void);
|
|
|
|
/**
|
|
* @brief Notify calibration module about LF clock start
|
|
*/
|
|
void z_nrf_clock_calibration_lfclk_started(void);
|
|
|
|
/**
|
|
* @brief Notify calibration module about LF clock stop
|
|
*/
|
|
void z_nrf_clock_calibration_lfclk_stopped(void);
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* ZEPHYR_DRIVERS_CLOCK_CONTROL_NRF_CLOCK_CALIBRATION_H_ */
|