aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-06-18Allow trailing commas at register macrosFinomnis
2023-01-03Merge pull request #6 from adamgreig/0.1.2Adam Greig
Release 0.1.2
2023-01-03Release 0.1.2Adam Greig
2023-01-03Merge pull request #5 from mciantyre/register-arraysAdam Greig
Add macro support for register arrays
2022-12-07Document support for register arrays in each macroIan McIntyre
Since stm32ral doesn't have register arrays, I'm using prose and pseudo-code to document each macro's support for register arrays. This seemed to be today's simplest way to document the features for users. I have another commit that implements a hidden module with a RAL-like API and register arrays. Documentation examples then reference this hidden module to demonstrate the register array feature. But, it adds more code (could be shared with the tests), and it resulted in inconsistent documentation examples when compared to the STM examples.
2022-12-07Expand macros testing for register scalars, arraysIan McIntyre
The parent commit extends the macros to support both scalar and array register access. This commit extends the macro test suite to test both scalar and array register access. It also tests that you can use things that deref to a register block, including normal references, deref smart pointers, and raw pointers. The tests cases carry over the shadowed variable tests.
2022-12-07Add macro support for register arraysIan McIntyre
I'm experimenting with a RAL code generator that collapses contiguous register arrays. The generated code would resemble pub struct RegisterBlock { pub MY_ARRAY: [RWRegister<u32>; 3], } and an individual register would be addressed like ral::read_reg!(ral::my_mod, my_inst, MY_ARRAY[1]); This commit extends the four macros so that we can specify an array offset. We simply need to match zero or more `[N]` patterns, where `N` is some expression that produces an array offset. The included test case shows that the approach should support multi-dimensional arrays.
2021-09-29Release v0.1.1.Adam Greig
2021-09-29Merge pull request #3 from mciantyre/shadowed-localsAdam Greig
Test read, modify, write macros
2021-09-29Begin testing read, write, modify macrosIan McIntyre
Ported from the imxrt-ral core test suite. Demonstrate that there are no "unused variable" warnings in tests by denying warnings for select tests. These tests show that #2 is resolved.
2021-09-23Merge pull request #4 from Disasm/prevent-maskingAdam Greig
Prevent masking value variables with imports
2021-09-23Prevent masking value variables with importsVadim Kaushan
2021-09-22Merge pull request #1 from mciantyre/repr-transparentAdam Greig
Mark all registers as transparent
2021-09-21Mark all registers as transparentIan McIntyre
Guarantees that the layout is the same as the inner type. Since UnsafeCell is also transparent, this ensures that the register has the same ABI as T. Today's registers work without this. Otherwise, RAL register blocks would have unaccounted offsets / wrong sizes. This is for completness, and a signal for others that a transmute might be OK. Requires Rust 1.28.
2021-08-15Add Github Actions and stm32ral dev-dep for doctests.Adam Greig
2021-08-15Initial commit. Import `registers.rs` from stm32ral.Adam Greig