File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -136,3 +136,23 @@ pub trait NorFlash {
136136 /// Currently limited to 4 regions, but could be increased if necessary
137137 fn regions ( & self ) -> Vec < Self :: Region , U4 > ;
138138}
139+
140+ /// ...
141+ pub trait UniformNorFlash : NorFlash {
142+ /// The range of possible addresses within the peripheral.
143+ ///
144+ /// (start_addr, end_addr)
145+ fn range ( & self ) -> ( Address , Address ) {
146+ self . regions ( ) [ 0 ] . range ( )
147+ }
148+ /// Maximum number of bytes that can be written at once.
149+ fn page_size ( & self ) -> usize {
150+ self . regions ( ) [ 0 ] . page_size ( )
151+ }
152+ /// List of avalable erase sizes in this region.
153+ /// Should be sorted in ascending order.
154+ /// Currently limited to 5 sizes, but could be increased if necessary.
155+ fn erase_sizes ( & self ) -> Vec < usize , U5 > {
156+ self . regions ( ) [ 0 ] . erase_sizes ( )
157+ }
158+ }
You can’t perform that action at this time.
0 commit comments