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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
//! HAL for the STM32F7xx family of microcontrollers

#![cfg_attr(not(test), no_std)]
#![allow(non_camel_case_types)]

#[cfg(not(feature = "device-selected"))]
compile_error!(
    "This crate requires one of the following device features enabled:
        stm32f722
        stm32f723
        stm32f730
        stm32f732
        stm32f733
        stm32f745
        stm32f746
        stm32f756
        stm32f765
        stm32f767
        stm32f769
        stm32f777
        stm32f778
        stm32f779
                "
);

pub(crate) use embedded_hal as hal;
pub use embedded_time;

#[cfg(feature = "stm32f722")]
pub use stm32f7::stm32f7x2 as pac;

#[cfg(feature = "stm32f723")]
pub use stm32f7::stm32f7x3 as pac;

#[cfg(feature = "stm32f730")]
pub use stm32f7::stm32f730 as pac;

#[cfg(feature = "stm32f732")]
pub use stm32f7::stm32f7x2 as pac;

#[cfg(feature = "stm32f733")]
pub use stm32f7::stm32f7x3 as pac;

#[cfg(feature = "stm32f745")]
pub use stm32f7::stm32f745 as pac;

#[cfg(feature = "stm32f746")]
pub use stm32f7::stm32f7x6 as pac;

#[cfg(feature = "stm32f756")]
pub use stm32f7::stm32f7x6 as pac;

#[cfg(feature = "stm32f765")]
pub use stm32f7::stm32f765 as pac;

#[cfg(feature = "stm32f767")]
pub use stm32f7::stm32f7x7 as pac;

#[cfg(feature = "stm32f769")]
pub use stm32f7::stm32f7x9 as pac;

#[cfg(feature = "stm32f777")]
pub use stm32f7::stm32f7x7 as pac;

#[cfg(feature = "stm32f778")]
pub use stm32f7::stm32f7x9 as pac;

#[cfg(feature = "stm32f779")]
pub use stm32f7::stm32f7x9 as pac;

// Enable use of interrupt macro
#[cfg(feature = "rt")]
pub use crate::pac::interrupt;

#[cfg(all(feature = "device-selected", feature = "has-can"))]
pub mod can;

#[cfg(feature = "device-selected")]
pub mod delay;

#[cfg(feature = "device-selected")]
pub mod dma;

#[cfg(all(feature = "device-selected", feature = "fmc"))]
pub mod fmc;

#[cfg(all(feature = "fmc_lcd", feature = "device-selected", feature = "fmc"))]
pub mod fmc_lcd;

#[cfg(feature = "device-selected")]
pub mod gpio;

#[cfg(feature = "device-selected")]
pub mod dac;

#[cfg(all(
    feature = "usb_fs",
    any(
        feature = "stm32f722",
        feature = "stm32f723",
        feature = "stm32f730",
        feature = "stm32f732",
        feature = "stm32f733",
        feature = "stm32f746",
        feature = "stm32f767",
    )
))]
pub mod otg_fs;

#[cfg(all(
    feature = "usb_hs",
    any(
        feature = "stm32f722",
        feature = "stm32f723",
        feature = "stm32f730",
        feature = "stm32f732",
        feature = "stm32f733",
        feature = "stm32f746",
        feature = "stm32f767",
    )
))]
pub mod otg_hs;

#[cfg(feature = "device-selected")]
pub mod prelude;

#[cfg(feature = "device-selected")]
pub mod rcc;

#[cfg(feature = "device-selected")]
pub mod rtc;

#[cfg(feature = "device-selected")]
pub mod serial;

#[cfg(feature = "device-selected")]
pub mod spi;

#[cfg(feature = "device-selected")]
pub mod timer;

#[cfg(feature = "device-selected")]
pub mod signature;

#[cfg(feature = "device-selected")]
pub mod i2c;

#[cfg(feature = "device-selected")]
pub mod rng;

#[cfg(feature = "device-selected")]
pub mod qspi;

#[cfg(any(feature = "stm32f765", feature = "stm32f767", feature = "stm32f769"))]
pub mod adc;

#[cfg(any(feature = "stm32f767", feature = "stm32f769"))]
pub mod qei;

#[cfg(feature = "ltdc")]
pub mod ltdc;

#[cfg(all(
    feature = "device-selected",
    not(any(
        feature = "stm32f765",
        feature = "stm32f767",
        feature = "stm32f769",
        feature = "stm32f777",
        feature = "stm32f778",
        feature = "stm32f779",
    ))
))]
pub mod flash;

pub mod state {
    /// Indicates that a peripheral is enabled
    pub struct Enabled;

    /// Indicates that a peripheral is disabled
    pub struct Disabled;
}