Hi @JoDo,
One more ting you need to consider is the communication mode (it is also defined in freemaster_cfg.h)
//! Select interrupt or poll-driven serial communication
#define FMSTR_LONG_INTR 0 // Complete message processing in interrupt
#define FMSTR_SHORT_INTR 0 // Queuing done in interrupt
#define FMSTR_POLL_DRIVEN 1 // No interrupt needed, polling only
I will assume that it is Poll Driven (as in the snippet above) - it is easier to use as it does not require setting up any interrupts. Note: in case of the other two, you would need to install `FMSTR_SerialIsr` as LPUART callback function.
Note that FMSTR_LPUART_BASE, FMSTR_TRANSPORT, FMSTR_SERIAL_DRV only "inform" FreeMASTER Driver what communication will be used. You still need to configure the uart peripheral (clock, pin muxing) in your code.
Regarding FMSTR_Init and FMSTR_Poll functions:
* FMSTR_Init should be called once in your main function after the peripheral configuration
* FMSTR_Poll should be called periodically (either in a loop or a timed interrupt) depending when you want FreeMASTER driver to process the data it receivers over UART. Here is a simple template of how your main function may look like:
int main(void) {
/* Initialize chip clock */
CLOCK_Init(...);
/* Enable all on-chip peripherals */
MCME_PeriphCtrl(...);
/* Pin muxing */
SIUL_Init(...); /* LPUART13_RX */
SIUL_Init(...); /* LPUART13_TX */
/* LPUART13 Init */
LPUART_Init(LPUART13, ...);
/* Initialize FreeMASTER */
FMSTR_Init();
for (;;) {
/* FreeMASTER poll function */
FMSTR_Poll();
}
return 0;
}