Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NAND FLASH 读写相关 #908

Open
cisen opened this issue Jun 6, 2020 · 0 comments
Open

NAND FLASH 读写相关 #908

cisen opened this issue Jun 6, 2020 · 0 comments

Comments

@cisen
Copy link
Owner

cisen commented Jun 6, 2020

总结

指令相关

capsules\src\nonvolatile_to_pages.rs

// 有NAND FLASH Datasheet的介绍
#[derive(Clone, Copy, PartialEq)]
#[allow(dead_code)]
enum FlashCMD {
    NOP,
    // WP=write protect ,用与NAND的写保护,这些在NAND的Datasheet中都会有
    WP,
    EP,
    CPB,
    LP,
    UP,
    EA,
    WGPB,
    EGPB,
    SSB,
    PGPFB,
    EAGPF,
    QPR,
    WUP,
    EUP,
    QPRUP,
    HSEN,
    HSDIS,
}

/// FlashState is used to track the current state and command of the flash.
#[derive(Clone, Copy, PartialEq)]
enum FlashState {
    Unconfigured,                 // Flash is unconfigured, call configure().
    Ready,                        // Flash is ready to complete a command.
    Read,                         // Performing a read operation.
    WriteUnlocking { page: i32 }, // Started a write operation. 开始写操作。
    WriteErasing { page: i32 },   // Waiting on the page to erase. 等待页面擦除。
    WriteWriting, // Waiting on the page to actually be written. 等待页面上实际被写入。
    EraseUnlocking { page: i32 }, // Started an erase operation.
    EraseErasing, // Waiting on the erase to finish.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant