1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
//! Real-time clock.

#![feature(proc_macro_hygiene)]
#![deny(elided_lifetimes_in_paths)]
#![warn(missing_docs)]
#![warn(clippy::pedantic)]
#![allow(clippy::type_repetition_in_bounds)]
#![no_std]

#[allow(unused_imports)]
use drone_core::periph;

#[cfg(any(
    stm32_mcu = "stm32l4x1",
    stm32_mcu = "stm32l4x2",
    stm32_mcu = "stm32l4x3",
    stm32_mcu = "stm32l4x5",
    stm32_mcu = "stm32l4x6",
    stm32_mcu = "stm32l4r5",
    stm32_mcu = "stm32l4r7",
    stm32_mcu = "stm32l4r9",
    stm32_mcu = "stm32l4s5",
    stm32_mcu = "stm32l4s7",
    stm32_mcu = "stm32l4s9"
))]
periph::singular! {
    /// Extracts RTC register tokens.
    pub macro periph_rtc;

    /// RTC peripheral.
    pub struct RtcPeriph;

    drone_stm32_map_pieces::reg;
    crate;

    RCC {
        APB1ENR1 {
            RTCAPBEN;
        }
        APB1SMENR1 {
            RTCAPBSMEN;
        }
        BDCR {
            RTCEN;
            RTCSEL;
        }
    }
    RTC {
        TR;
        DR;
        CR;
        ISR;
        PRER;
        WUTR;
        ALRMAR;
        ALRMBR;
        WPR;
        SSR;
        SHIFTR;
        TSTR;
        TSDR;
        TSSSR;
        CALR;
        TAMPCR;
        ALRMASSR;
        ALRMBSSR;
        OR;
        BKP0R;
        BKP1R;
        BKP2R;
        BKP3R;
        BKP4R;
        BKP5R;
        BKP6R;
        BKP7R;
        BKP8R;
        BKP9R;
        BKP10R;
        BKP11R;
        BKP12R;
        BKP13R;
        BKP14R;
        BKP15R;
        BKP16R;
        BKP17R;
        BKP18R;
        BKP19R;
        BKP20R;
        BKP21R;
        BKP22R;
        BKP23R;
        BKP24R;
        BKP25R;
        BKP26R;
        BKP27R;
        BKP28R;
        BKP29R;
        BKP30R;
        BKP31R;
    }
}