Thanks for the example that nicely illustrates what I meant.
The function declaration is:
status_t USART_Init ( USART_Type * base,
const usart_config_t * config,
uint32_t srcClock_Hz )
A) Driver documentation incomplete?
I could not find any information in SDK API reference manual whether I have to initialize Flexcom before calling USART_Init().
I had to check the source code to figure that USART_Init() does indeed initialize Flexcom.
I think this fact should mentioned in the SDK documentation.
B) Specific information missing?
I assume that the clock frequencies configured in Clocks tool are available programmatically. However, I could not find a function to retrieve the correct value for srcClock. I assume that srcClock should be the value that I configured using the Clocks tool, i.e. FXCOM0_clock. I tried CLOCK_GetFlexCommClkFreq(0) but that did not work, see here.
C) Function signature
The function signature requires the use of a register base address although the driver "knows" the base address (see fsl_flexcomm.c ). So why does every programmer have to enter it? The instance number would be more appropriate here in my opinion. Using the instance id (as in CLOCK_GetFlexCommClkFreq(0)) is a much clearer approach.
Thanks.