@@ -151,6 +151,7 @@ pub use xtensa_lx;
151
151
#[ cfg( xtensa) ]
152
152
pub use xtensa_lx_rt:: { self , entry} ;
153
153
154
+ // TODO what should we reexport stably?
154
155
#[ cfg( any( esp32, esp32s3) ) ]
155
156
pub use self :: soc:: cpu_control;
156
157
#[ cfg( efuse) ]
@@ -163,88 +164,110 @@ pub use self::soc::psram;
163
164
#[ cfg( ulp_riscv_core) ]
164
165
pub use self :: soc:: ulp_core;
165
166
166
- #[ cfg( aes) ]
167
- pub mod aes;
168
- #[ cfg( any( adc, dac) ) ]
169
- pub mod analog;
170
- #[ cfg( assist_debug) ]
171
- pub mod assist_debug;
172
167
#[ cfg( any( dport, hp_sys, pcr, system) ) ]
173
168
pub mod clock;
174
169
175
170
pub mod config;
176
171
177
172
#[ cfg( any( xtensa, all( riscv, systimer) ) ) ]
178
173
pub mod delay;
179
- #[ cfg( any( gdma, pdma) ) ]
180
- pub mod dma;
181
- #[ cfg( ecc) ]
182
- pub mod ecc;
183
- #[ cfg( soc_etm) ]
184
- pub mod etm;
185
174
#[ cfg( gpio) ]
186
175
pub mod gpio;
187
- #[ cfg( hmac) ]
188
- pub mod hmac;
189
176
#[ cfg( any( i2c0, i2c1) ) ]
190
177
pub mod i2c;
191
- #[ cfg( any( i2s0, i2s1) ) ]
192
- pub mod i2s;
193
178
#[ cfg( any( dport, interrupt_core0, interrupt_core1) ) ]
194
179
pub mod interrupt;
195
- #[ cfg( lcd_cam) ]
196
- pub mod lcd_cam;
197
- #[ cfg( ledc) ]
198
- pub mod ledc;
199
- #[ cfg( any( mcpwm0, mcpwm1) ) ]
200
- pub mod mcpwm;
201
- #[ cfg( usb0) ]
202
- pub mod otg_fs;
203
- #[ cfg( parl_io) ]
204
- pub mod parl_io;
205
- #[ cfg( pcnt) ]
206
- pub mod pcnt;
207
180
pub mod peripheral;
208
181
pub mod prelude;
209
182
#[ cfg( any( hmac, sha) ) ]
210
183
mod reg_access;
211
- #[ cfg( any( lp_clkrst, rtc_cntl) ) ]
212
- pub mod reset;
213
- #[ cfg( rmt) ]
214
- pub mod rmt;
215
- #[ cfg( rng) ]
216
- pub mod rng;
217
- pub mod rom;
218
- #[ cfg( rsa) ]
219
- pub mod rsa;
220
- #[ cfg( any( lp_clkrst, rtc_cntl) ) ]
221
- pub mod rtc_cntl;
222
- #[ cfg( sha) ]
223
- pub mod sha;
224
184
#[ cfg( any( spi0, spi1, spi2, spi3) ) ]
225
185
pub mod spi;
226
- #[ cfg( any( dport, hp_sys, pcr, system) ) ]
227
- pub mod system;
228
- pub mod time;
229
- #[ cfg( any( systimer, timg0, timg1) ) ]
230
- pub mod timer;
231
- #[ cfg( touch) ]
232
- pub mod touch;
233
- #[ cfg( trace0) ]
234
- pub mod trace;
235
- #[ cfg( any( twai0, twai1) ) ]
236
- pub mod twai;
237
186
#[ cfg( any( uart0, uart1, uart2) ) ]
238
187
pub mod uart;
239
- #[ cfg( usb_device) ]
240
- pub mod usb_serial_jtag;
241
188
242
- pub mod debugger;
189
+ pub mod macros;
190
+ pub mod rom;
243
191
192
+ pub mod debugger;
244
193
#[ doc( hidden) ]
245
194
pub mod sync;
195
+ pub mod time;
246
196
247
- pub mod macros;
197
+ // can't use instability on inline module definitions, see https://github.com/rust-lang/rust/issues/54727
198
+ #[ doc( hidden) ]
199
+ macro_rules! unstable {
200
+ ( $(
201
+ $( #[ $meta: meta] ) *
202
+ pub mod $module: ident;
203
+ ) * ) => {
204
+ $(
205
+ $( #[ $meta] ) *
206
+ #[ cfg( feature = "unstable" ) ]
207
+ pub mod $module;
208
+
209
+ $( #[ $meta] ) *
210
+ #[ cfg( not( feature = "unstable" ) ) ]
211
+ #[ allow( unused) ]
212
+ pub ( crate ) mod $module;
213
+ ) *
214
+ } ;
215
+ }
216
+
217
+ unstable ! {
218
+ #[ cfg( aes) ]
219
+ pub mod aes;
220
+ #[ cfg( any( adc, dac) ) ]
221
+ pub mod analog;
222
+ #[ cfg( assist_debug) ]
223
+ pub mod assist_debug;
224
+ #[ cfg( any( gdma, pdma) ) ]
225
+ pub mod dma;
226
+ #[ cfg( ecc) ]
227
+ pub mod ecc;
228
+ #[ cfg( soc_etm) ]
229
+ pub mod etm;
230
+ #[ cfg( hmac) ]
231
+ pub mod hmac;
232
+ #[ cfg( any( i2s0, i2s1) ) ]
233
+ pub mod i2s;
234
+ #[ cfg( lcd_cam) ]
235
+ pub mod lcd_cam;
236
+ #[ cfg( ledc) ]
237
+ pub mod ledc;
238
+ #[ cfg( any( mcpwm0, mcpwm1) ) ]
239
+ pub mod mcpwm;
240
+ #[ cfg( usb0) ]
241
+ pub mod otg_fs;
242
+ #[ cfg( parl_io) ]
243
+ pub mod parl_io;
244
+ #[ cfg( pcnt) ]
245
+ pub mod pcnt;
246
+ #[ cfg( any( lp_clkrst, rtc_cntl) ) ]
247
+ pub mod reset;
248
+ #[ cfg( rmt) ]
249
+ pub mod rmt;
250
+ #[ cfg( rng) ]
251
+ pub mod rng;
252
+ #[ cfg( rsa) ]
253
+ pub mod rsa;
254
+ #[ cfg( any( lp_clkrst, rtc_cntl) ) ]
255
+ pub mod rtc_cntl;
256
+ #[ cfg( sha) ]
257
+ pub mod sha;
258
+ #[ cfg( any( dport, hp_sys, pcr, system) ) ]
259
+ pub mod system;
260
+ #[ cfg( any( systimer, timg0, timg1) ) ]
261
+ pub mod timer;
262
+ #[ cfg( touch) ]
263
+ pub mod touch;
264
+ #[ cfg( trace0) ]
265
+ pub mod trace;
266
+ #[ cfg( any( twai0, twai1) ) ]
267
+ pub mod twai;
268
+ #[ cfg( usb_device) ]
269
+ pub mod usb_serial_jtag;
270
+ }
248
271
249
272
/// State of the CPU saved when entering exception or interrupt
250
273
pub mod trapframe {
@@ -309,6 +332,7 @@ pub(crate) mod private {
309
332
}
310
333
}
311
334
335
+ #[ cfg( feature = "unstable" ) ]
312
336
#[ doc( hidden) ]
313
337
pub use private:: Internal ;
314
338
0 commit comments