File tree 3 files changed +25
-0
lines changed
3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 679
679
#![ deny( missing_docs) ]
680
680
#![ deny( warnings) ]
681
681
#![ feature( never_type) ]
682
+ #![ feature( unsize) ]
682
683
#![ no_std]
683
684
684
685
#[ macro_use]
@@ -687,6 +688,8 @@ extern crate nb;
687
688
pub mod blocking;
688
689
pub mod digital;
689
690
pub mod prelude;
691
+ #[ cfg( feature = "unproven" ) ]
692
+ pub mod rng;
690
693
pub mod serial;
691
694
pub mod spi;
692
695
pub mod timer;
Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ pub use ::blocking::spi::{
26
26
pub use :: digital:: OutputPin as _embedded_hal_digital_OutputPin;
27
27
#[ cfg( feature = "unproven" ) ]
28
28
pub use :: digital:: InputPin as _embedded_hal_digital_InputPin;
29
+ #[ cfg( feature = "unproven" ) ]
30
+ pub use :: rng:: Read as _embedded_hal_rng_Read;
29
31
pub use :: serial:: Read as _embedded_hal_serial_Read;
30
32
pub use :: serial:: Write as _embedded_hal_serial_Write;
31
33
pub use :: spi:: FullDuplex as _embedded_hal_spi_FullDuplex;
Original file line number Diff line number Diff line change
1
+ //! Random Number Generator Interface
2
+
3
+ use nb;
4
+
5
+ use core:: marker:: Unsize ;
6
+
7
+ /// Nonblocking stream of random bytes.
8
+ // reason: No implementations or users yet
9
+ pub trait Read {
10
+ /// Format of returned data
11
+ type Bytes : Unsize < [ u8 ] > ;
12
+
13
+ /// An enumeration of RNG errors
14
+ ///
15
+ /// May be `!` (`never_type`) for infallible implementations; i.e. software PRNGs
16
+ type Error ;
17
+
18
+ /// Get a single byte from the RNG
19
+ fn read ( & mut self ) -> nb:: Result < Self :: Bytes , Self :: Error > ;
20
+ }
You can’t perform that action at this time.
0 commit comments