/* Sets the RTC BCD calendar month value. 
Requires unlocking the RTC write-protection (RTC_WPR)  */
void rtc_calendar_set_month(uint8_t month)
/* Sets the RTC BCD calendar month value. 
Requires unlocking the RTC write-protection (RTC_WPR)  */
void rtc_calendar_set_month(uint8_t month)
{
	uint8_t bcd_month = _rtc_dec_to_bcd(month);
	RTC_DR &= ~(RTC_DR_MT_MASK << RTC_DR_MT_SHIFT | RTC_DR_MU_MASK << RTC_DR_MU_SHIFT);
	RTC_DR |= (((bcd_month >> 4) & RTC_DR_MT_MASK) << RTC_DR_MT_SHIFT) |
		((bcd_month & RTC_DR_MU_MASK) << RTC_DR_MU_SHIFT);
}