File tree 4 files changed +29
-1
lines changed
4 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,9 @@ version = "1.0.2"
20
20
[dependencies .nb ]
21
21
version = " 0.1.1"
22
22
23
+ [dependencies .generic-array ]
24
+ version = " 0.11.0"
25
+
23
26
[dev-dependencies ]
24
27
stm32f30x = " 0.6.0"
25
28
futures = " 0.1.17"
@@ -28,4 +31,4 @@ futures = "0.1.17"
28
31
unproven = [" nb/unstable" ]
29
32
30
33
[package .metadata .docs .rs ]
31
- features = [" unproven" ]
34
+ features = [" unproven" ]
Original file line number Diff line number Diff line change 688
688
#[ macro_use]
689
689
extern crate nb;
690
690
extern crate void;
691
+ extern crate generic_array;
691
692
692
693
pub mod blocking;
693
694
pub mod digital;
694
695
pub mod prelude;
696
+ #[ cfg( feature = "unproven" ) ]
697
+ pub mod rng;
695
698
pub mod serial;
696
699
pub mod spi;
697
700
pub mod timer;
Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ pub use digital::InputPin as _embedded_hal_digital_InputPin;
20
20
pub use digital:: OutputPin as _embedded_hal_digital_OutputPin;
21
21
#[ cfg( feature = "unproven" ) ]
22
22
pub use digital:: ToggleableOutputPin as _embedded_hal_digital_ToggleableOutputPin;
23
+ #[ cfg( feature = "unproven" ) ]
24
+ pub use rng:: Read as _embedded_hal_rng_Read;
23
25
pub use serial:: Read as _embedded_hal_serial_Read;
24
26
pub use serial:: Write as _embedded_hal_serial_Write;
25
27
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 generic_array:: { ArrayLength , GenericArray } ;
4
+ use nb;
5
+
6
+ /// Nonblocking stream of random bytes.
7
+ #[ cfg( feature = "unproven" ) ]
8
+ // reason: No implementation or users yet
9
+ pub trait Read < N >
10
+ where
11
+ N : ArrayLength < u8 >
12
+ {
13
+ /// An enumeration of RNG errors.
14
+ ///
15
+ /// For infallible implementations, will be `Void`
16
+ type Error ;
17
+
18
+ /// Get a number of bytes from the RNG.
19
+ fn read ( & mut self ) -> nb:: Result < GenericArray < u8 , N > , Self :: Error > ;
20
+ }
You can’t perform that action at this time.
0 commit comments