15.6.3.1.8 Function rtc_calendar_frequency_correction()
Calibrate for too-slow or too-fast oscillator.
enum status_code rtc_calendar_frequency_correction( struct rtc_module *const module, const int8_t value)
When used, the RTC will compensate for an inaccurate oscillator. The RTC module will add or subtract cycles from the RTC prescaler to adjust the frequency in approximately 1 PPM steps. The provided correction value should be between -127 and 127, allowing for a maximum 127 PPM correction in either direction.
If no correction is needed, set value to zero.
| Data direction | Parameter name | Description |
|---|---|---|
|
[in, out] |
module |
Pointer to the software instance struct |
|
[in] |
value |
Between -127 and 127 used for the correction |
Returns
Status of the calibration procedure.
| Return value | Description |
|---|---|
|
STATUS_OK |
If calibration was done correctly |
|
STATUS_ERR_INVALID_ARG |
If invalid argument(s) were provided |
