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

Handle register access rules #3

Open
crawfxrd opened this issue Jul 1, 2021 · 0 comments
Open

Handle register access rules #3

crawfxrd opened this issue Jul 1, 2021 · 0 comments

Comments

@crawfxrd
Copy link
Member

crawfxrd commented Jul 1, 2021

Each bit of a register are one of the following:

  • R (read-only)
    • Can be read. Writing has no effect.
  • W (write-only)
    • Reading return 0. Writing sets the value.
  • R/W (read-write)
    • Can be read. Writing sets the value.
  • RC (read-clear)
    • Reading clears the bit. Writing has no effect.
  • R/WC (read/write-clear)
    • Can be read. Writing 1 clears the bit. Writing 0 has no effect.

ecsim assumes all bits of a register are R/W, as it writes the new value to the register.

ecsim/src/xram.rs

Lines 640 to 643 in 6ba94d8

if let Some(new) = new_opt {
debug!(" store 0x{:02X}", new);
mcu.store(Addr::XRam(address), new);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant