On 09/10/2013, at 1:03 PM, Paul Sokolovsky <[email protected]> wrote:
>> void rcc_peripheral_enable_clock(clock_enable_reg_t clock_enable_reg,
>> uint32_t en);
>
> Would it change *that* much? There still will be a function which needs
> to be called, do the dynamic bit manipulation and return. Shouldn't it
> be something like:
>
> peripheral_enable_clock<clock_enable_reg_t, uint32_t>() to emphasize
> that it should be compile-time constants?
No, that's still awful. Nobody wants to care which register they're fiddling
with, they just want the peripheral on / off.
peripheral.clock_enable = true;
would be better if you're going to do the C++ thing.
periperhal_clock_enable(<peripheral identifier>,<clock state>)
if you want to stick to C (note verb-subject re-ordering to maintain
widest-to-narrowest ordering in the function name).
= Mike
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60134071&iu=/4140/ostg.clktrk
_______________________________________________
libopencm3-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libopencm3-devel