forked from M-Labs/zynq-rs
1
0
Fork 0

zynq::flash::spi_flash_register: doc, add BA

This commit is contained in:
Astro 2019-12-16 00:46:53 +01:00
parent b94afa1581
commit 1dbb358a4c
1 changed files with 6 additions and 4 deletions

View File

@ -6,8 +6,9 @@ pub trait SpiFlashRegister {
} }
macro_rules! u8_register { macro_rules! u8_register {
($name: ident, $inst_code: expr) => { ($name: ident, $doc: tt, $inst_code: expr) => {
#[derive(Clone)] #[derive(Clone)]
#[doc=$doc]
pub struct $name { pub struct $name {
pub inner: u8, pub inner: u8,
} }
@ -32,8 +33,8 @@ macro_rules! u8_register {
}; };
} }
u8_register!(CR, 0x35); u8_register!(CR, "Configuration Register", 0x35);
u8_register!(SR1, 0x05); u8_register!(SR1, "Status Register-1", 0x05);
impl SR1 { impl SR1 {
/// Write In Progress /// Write In Progress
pub fn wip(&self) -> bool { pub fn wip(&self) -> bool {
@ -56,4 +57,5 @@ impl SR1 {
} }
} }
u8_register!(SR2, 0x07); u8_register!(SR2, "Status Register-2", 0x07);
u8_register!(BA, "Bank Address Register", 0xB9);