1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
pub struct PageSize([u8; 4]);
pub struct SectorSize([u8; 4]);
impl PageSize {
pub fn new(page_size: u32) -> Self {
PageSize(page_size.to_le_bytes())
}
}
as_ref_bytes_newtype!(PageSize);
impl SectorSize {
pub fn new(sector_size: u32) -> Self {
SectorSize(sector_size.to_le_bytes())
}
}
as_ref_bytes_newtype!(SectorSize);
#[repr(u8)]
pub enum SerialClockFrequency {
NoChange = 0,
MHz30 = 1,
MHz50 = 2,
MHz60 = 3,
MHz75 = 4,
MHz80 = 5,
MHz100 = 6,
MHz120 = 7,
HMz133 = 8,
MHz166 = 9,
}
pub struct ConfigurationBlock {
pub page_size: PageSize,
pub sector_size: SectorSize,
pub ip_cmd_serial_clk_freq: SerialClockFrequency,
}