Suggestion: peripheral handle label should also generate compile-time usable definition
Hi,
peripheral handles, either the dedicated ones or the labeled ones are usable only during runtime, they're filled with data at the initialization. However, it would be practical to also get a compile-time usable definition as well.
So, for example if I label timer 3 as 'MyTimer', we'll get
#define MyTimer htim3It would be practical to also get something like this:
#define _MyTimer_ TIM3This would give access to e.g. register addresses at compile time. For example, if I want to create a pointer table to the timer CCRs, I can write:
volatile const uint32_t *TabCcrPtr[] = {
&_MyTimer_->CCR1,
&_MyTimer_->CCR2,
&_MyTimer_->CCR3,
&_MyTimer_->CCR4
};The idea is to have shorter code using tables because it's not needed to use switch statements, etc.
Regards
