@@ -122,7 +122,6 @@ impl UartDevice {
122
122
. map_err ( UartDeviceError :: from_c)
123
123
}
124
124
125
-
126
125
/// Tries to initialize the given `UART`. Returns a Result with rather `Ok<RMain>` where `RMain` is the value returned by the scoped main function
127
126
/// or a `Err<UartDeviceStatus>` containing the error
128
127
///
@@ -141,7 +140,7 @@ impl UartDevice {
141
140
/// ```
142
141
/// use riot_wrappers::uart::UartDevice;
143
142
/// let mut cb = |new_data| {
144
- /// //do something here with the received data
143
+ /// println!("Received {:02x}", new_data);
145
144
/// };
146
145
/// let mut scoped_main = |self_: &mut UartDevice| loop {
147
146
/// self_.write(b"Hello from UART")
@@ -204,7 +203,7 @@ impl UartDevice {
204
203
/// ```
205
204
/// use riot_wrappers::uart::UartDevice;
206
205
/// static mut CB: fn(u8) = |new_data| {
207
- /// //do something here with the received data
206
+ /// println!("Received {:02x}", new_data);
208
207
/// };
209
208
/// let mut uart = UartDevice::new_with_static_cb(0, 115200, unsafe { &mut CB })
210
209
/// .unwrap_or_else(|e| panic!("Error initializing UART: {e:?}"));
@@ -307,36 +306,6 @@ impl UartDevice {
307
306
crate :: gpio:: GPIO :: from_c ( unsafe { uart_pin_tx ( self . dev ) } )
308
307
}
309
308
310
- /// Configure the function that will be called when a start condition is detected
311
- /// This will not enable / disable the generation of the RX start interrupt
312
- /// # Arguments
313
- /// * `user_fxopt` - The user defined callback function that gets called when a start condition is detected
314
- #[ cfg( riot_module_periph_uart_rxstart_irq) ]
315
- pub fn rxstart_irq_configure < F > ( & mut self , user_fxopt : & ' a mut F )
316
- where
317
- F : FnMut ( ) + Send + ' static ,
318
- {
319
- unsafe {
320
- uart_rxstart_irq_configure (
321
- dev,
322
- Self :: rxstart_callback :: < F > ,
323
- user_fxopt as * mut _ as * mut c_void ,
324
- )
325
- } ;
326
- }
327
-
328
- /// Enable the RX start interrupt
329
- #[ cfg( riot_module_periph_uart_rxstart_irq) ]
330
- pub fn rxstart_irq_enable ( & mut self ) {
331
- unsafe { uart_rxstart_irq_enable ( self . dev ) } ;
332
- }
333
-
334
- /// Disable the RX start interrupt
335
- #[ cfg( riot_module_periph_uart_rxstart_irq) ]
336
- pub fn rxstart_irq_disable ( & mut self ) {
337
- unsafe { uart_rxstart_irq_disable ( self . dev ) } ;
338
- }
339
-
340
309
/// This is the callback that gets called directly from the kernel if new data from the `UART` is received
341
310
/// # Arguments
342
311
/// * `user_callback` - The address pointing to the user defined callback
@@ -347,17 +316,6 @@ impl UartDevice {
347
316
{
348
317
( * ( user_callback as * mut F ) ) ( data) ; // We cast the void* back to the closure and call it
349
318
}
350
-
351
- /// This is the callback that gets called directly from the kernel when a start condition is detected
352
- /// # Arguments
353
- /// * `user_callback` - The address pointing to the user defined callback
354
- #[ cfg( riot_module_periph_uart_rxstart_irq) ]
355
- unsafe extern "C" fn rxstart_callback < F > ( user_callback : * mut c_void )
356
- where
357
- F : FnMut ( ) + ' scope ,
358
- {
359
- ( * ( user_callback as * mut F ) ) ( ) ; // We cast the void* back to the closure and call it
360
- }
361
319
}
362
320
363
321
impl Drop for UartDevice {
0 commit comments