Skip to content

raw_access #841

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

raw_access #841

wants to merge 1 commit into from

Conversation

burrbull
Copy link
Member

@burrbull burrbull commented May 16, 2024

@adamgreig
Copy link
Member

I'm not sure if there's any advantage to skipping volatile_cell but still having the registers be themselves memory-mapped (with &self cast to a pointer). We still have the problem that Rust can dereference &self and perform an invalid read. Probably we have to do something similar to chiptool where the peripheral struct owns a pointer and the register methods offset it - the total memory cost is the same because instead of having reference-to-a-ZST like now, we would have an owned-pointer.

It might be hard to do this and keep vcell too, but maybe we can just remove vcell support at the same time?

@burrbull burrbull force-pushed the raw branch 2 times, most recently from 904b44e to a816243 Compare May 18, 2024 07:32
@burrbull burrbull changed the title raw_access && raw_read_write raw_access May 18, 2024
@burrbull
Copy link
Member Author

burrbull commented May 18, 2024

It might be hard to do this and keep vcell too, but maybe we can just remove vcell support at the same time?

It is not hard. svd2rust code is flexible enough.

Review yet one time, please.

P.S. Let's merge #842 first

@burrbull

This comment was marked as outdated.

This comment was marked as outdated.

@burrbull

This comment was marked as outdated.

This comment was marked as outdated.

@burrbull burrbull marked this pull request as ready for review June 4, 2024 03:12
@burrbull burrbull requested a review from a team as a code owner June 4, 2024 03:12
@burrbull

This comment was marked as outdated.

This comment was marked as outdated.

@burrbull

This comment was marked as outdated.

This comment was marked as outdated.

@burrbull

This comment was marked as outdated.

@burrbull burrbull force-pushed the raw branch 2 times, most recently from 16f62df to 1d0fea5 Compare June 16, 2024 04:19
@burrbull burrbull force-pushed the raw branch 2 times, most recently from 7c5a312 to 44ec5dc Compare November 7, 2024 17:31
@burrbull
Copy link
Member Author

burrbull commented Nov 7, 2024

/ci diff pr --current " --raw-access"

Copy link

github-actions bot commented Nov 7, 2024

Diff for comment

@romancardenas
Copy link
Contributor

Any news on this? May I help somehow?

@burrbull burrbull force-pushed the raw branch 2 times, most recently from e564d2d to 6eebb01 Compare March 14, 2025 02:49
@burrbull
Copy link
Member Author

@romancardenas I've rebased but I'm not sure there is nothing missed.

@Emilgardis
Copy link
Member

/ci diff pr --current " --raw-access"

Copy link

Diff for comment

quote! {
#[doc = #doc]
#[inline(always)]
pub const fn #name(&self) -> #ty {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we not want &#ty here? Same for the other accessors

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that, with raw access, peripherals return pointers to registers instead of a reference to one of the fields of their register block. Thus, instead of borrowing access, users are "owners" of these registers.

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

Successfully merging this pull request may close these issues.

4 participants