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 @@ -8,3 +8,4 @@ pub mod delay;
8
8
pub mod i2c;
9
9
pub mod serial;
10
10
pub mod spi;
11
+ pub mod rng;
Original file line number Diff line number Diff line change
1
+ //! Blocking hardware random number generator
2
+
3
+ /// Blocking read
4
+ #[ cfg( feature = "unproven" ) ]
5
+ pub trait Read {
6
+ /// Error type
7
+ type Error ;
8
+
9
+ /// Reads enough bytes from hardware random number generator to fill `buffer`
10
+ ///
11
+ /// If any error is encountered then this function immediately returns. The contents of buf are
12
+ /// unspecified in this case.
13
+ ///
14
+ /// If this function returns an error, it is unspecified how many bytes it has read, but it
15
+ /// will never read more than would be necessary to completely fill the buffer.
16
+ fn read ( & mut self , buffer : & mut [ u8 ] ) -> Result < ( ) , Self :: Error > ;
17
+ }
Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ pub use ::blocking::spi::{
23
23
Transfer as _embedded_hal_blocking_spi_Transfer,
24
24
Write as _embedded_hal_blocking_spi_Write,
25
25
} ;
26
+ #[ cfg( feature = "unproven" ) ]
27
+ pub use :: blocking:: rng:: Read as _embedded_hal_blocking_rng_Read;
26
28
pub use :: digital:: OutputPin as _embedded_hal_digital_OutputPin;
27
29
#[ cfg( feature = "unproven" ) ]
28
30
pub use :: digital:: InputPin as _embedded_hal_digital_InputPin;
You can’t perform that action at this time.
0 commit comments