My idea for implementation is to add a new API:
Code: Select all
void extSetChannel(EXTChannelConfig *cfg);The new function would change the EXTConfig structure and immediately reprogram the HW (no need to perform a extStart() again).
There are few problems:
1) The EXTConfig structure must be in ram in order to use extSetChannel() but the option to have it in flash is still present.
2) The EXTConfig structure must not contain channel-related custom fields, everything must be in EXTChannelConfig.
About point 2, the STM32 driver would lose the "exti" field in EXTConfig, the port assignment would be ORed to the "mode" field of the EXTChannelConfig structure (saving some space in EXTConfig too).
More ideas?
Giovanni