/* param base The IRTC peripheral base address param integralValue Compensation integral value; twos complement value of the integer part param fractionValue Compensation fraction value expressed as number of clock cycles of a fixed 4.194304Mhz clock that have to be added. param accumulateFractional Flag indicating if we want to add to previous fractional part; true: Add to previously accumulated fractional part, false: Start afresh and overwrite current value  */
void IRTC_SetFineCompensation(RTC_Type *base, uint8_t integralValue, uint8_t fractionValue, bool accumulateFractional)
/* param base The IRTC peripheral base address param integralValue Compensation integral value; twos complement value of the integer part param fractionValue Compensation fraction value expressed as number of clock cycles of a fixed 4.194304Mhz clock that have to be added. param accumulateFractional Flag indicating if we want to add to previous fractional part; true: Add to previously accumulated fractional part, false: Start afresh and overwrite current value  */
void IRTC_SetFineCompensation(RTC_Type *base, uint8_t integralValue, uint8_t fractionValue, bool accumulateFractional)
{
    if (!accumulateFractional)
    {
        base->CTRL &= ~(((uint16_t)1U << RTC_CTRL_COMP_EN_SHIFT) | ((uint16_t)1U << RTC_CTRL_FINEEN_SHIFT));
    }
    base->COMPEN = ((uint16_t)fractionValue & 0x7FU) | (((uint16_t)integralValue & 0xFU) << 12U);
    base->CTRL |= (RTC_CTRL_COMP_EN_MASK | RTC_CTRL_FINEEN_MASK);
}