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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/// Encodes the state of peripherals: Unknown, Enabled, or Disabled.
///
/// The default state of peripherals is `Unknown`, which is not
/// quite zero cost, but since we may have been jumped to from a
/// bootloader, we can't rely on reset state as per user manual.
///
/// The exception are peripherals which are "always on", such as `Syscon`.
pub mod init_state {
    pub trait InitState {}

    /// Indicates that the state of the peripheral is not known
    pub struct Unknown;
    impl InitState for Unknown {}

    /// Indicates that the hardware component is enabled
    ///
    /// This usually indicates that the hardware has been initialized and can be
    /// used for its intended purpose. Contains an optional payload that APIs
    /// can use to keep data that is only available while enabled.
    ///
    pub struct Enabled<T = ()>(pub T);
    impl InitState for Enabled {}

    /// Indicates that the hardware component is disabled
    pub struct Disabled;
    impl InitState for Disabled {}
}

pub mod pin;

/// Using generics for this seems quite painful
pub mod main_clock {

    #[derive(Copy, Clone, Debug, PartialEq)]
    pub enum MainClock {
        // Unknown,
        Fro12Mhz,
        Fro96Mhz,
        Pll0,
    }
    // pub trait MainClock {}

    // pub struct Unknown;
    // impl MainClock for Unknown {}

    // pub struct Fro12Mhz;
    // impl MainClock for Fro12Mhz {}

    // pub struct Fro96Mhz;
    // impl MainClock for Fro96Mhz {}
}

pub mod usbfs_mode {
    pub trait UsbfsMode {}

    pub struct Unknown;
    impl UsbfsMode for Unknown {}

    pub struct Device;
    impl UsbfsMode for Device {}

    pub struct Host;
    impl UsbfsMode for Host {}
}

pub mod usbhs_mode {
    pub trait UsbhsMode {}

    pub struct Unknown;
    impl UsbhsMode for Unknown {}

    pub struct Device;
    impl UsbhsMode for Device {}

    pub struct Host;
    impl UsbhsMode for Host {}
}



/// Application can only obtain this token from
/// a frozen Clocks (clock-tree configuration)
#[derive(Copy, Clone)]
pub struct ClocksSupportFlexcommToken {pub(crate) __: ()}

/// Application can only obtain this token from
/// a frozen Clocks (clock-tree configuration) for
/// which USB clocks have been configured properly.
#[derive(Copy, Clone)]
pub struct ClocksSupportUsbfsToken {pub(crate) __: ()}

/// Application can only obtain this token from
/// a frozen Clocks (clock-tree configuration) for
/// which USB clocks have been configured properly.
#[derive(Copy, Clone)]
pub struct ClocksSupportUsbhsToken {pub(crate) __: ()}

/// Application can only obtain this token from
/// a frozen Clocks (clock-tree configuration)
#[derive(Copy, Clone)]
pub struct ClocksSupportUtickToken {pub(crate) __: ()}

/// Application can only obtain this token from
/// a frozen Clocks (clock-tree configuration)
#[derive(Copy, Clone)]
pub struct ClocksSupportTouchToken{pub(crate) __: ()}

/// Application can only obtain this token from
/// a frozen Clocks (clock-tree configuration)
#[derive(Copy, Clone)]
pub struct ClocksSupport1MhzFroToken{pub(crate) __: ()}

/// Application can only obtain this token from
/// a frozen Clocks (clock-tree configuration)
#[derive(Copy, Clone)]
pub struct ClocksSupport32KhzFroToken{pub(crate) __: ()}

pub mod flash_state {
}

pub mod reg_proxy;