File tree 3 files changed +20
-0
lines changed
3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -687,6 +687,7 @@ extern crate nb;
687
687
pub mod blocking;
688
688
pub mod digital;
689
689
pub mod prelude;
690
+ pub mod rng;
690
691
pub mod serial;
691
692
pub mod spi;
692
693
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
+ #[ cfg( feature = "unproven" ) ]
4
+ use nb;
5
+
6
+ /// Nonblocking stream of random bytes.
7
+ #[ cfg( feature = "unproven" ) ]
8
+ // reason: No implementations or users yet
9
+ pub trait Read {
10
+ /// An enumeration of RNG errors
11
+ ///
12
+ /// May be `!` (`never_type`) for infallible implementations; i.e. software PRNGs
13
+ type Error ;
14
+
15
+ /// Get a single byte from the RNG
16
+ fn read ( & mut self ) -> nb:: Result < u8 , Self :: Error > ;
17
+ }
You can’t perform that action at this time.
0 commit comments