I am using mkw01z128 boar. It has default baud rate on uart0,1,2 - 115200. But I need another baud rate. How to change it ?
Hello Odilbek
In App.c file you can find the App_init function (line 208) in which serial interface is initialized:
/* Initialize the serial terminal interface so that we can print out status messages */
Serial_InitInterface(&interfaceId, APP_SERIAL_INTERFACE_TYPE, APP_SERIAL_INTERFACE_INSTANCE);
Serial_SetBaudRate(interfaceId, gUARTBaudRate115200_c);
Serial_SetRxCallBack(interfaceId, UartRxCallBack, NULL);
Serial_SetBaudRate function does configure baud rate, if you want to change baud rate, you should replace gUARTBaudRate115200_c parameter by anyone of followings:
typedef enum{
gUARTBaudRate1200_c = 1200UL,
gUARTBaudRate2400_c = 2400UL,
gUARTBaudRate4800_c = 4800UL,
gUARTBaudRate9600_c = 9600UL,
gUARTBaudRate19200_c = 19200UL,
gUARTBaudRate38400_c = 38400UL,
gUARTBaudRate57600_c = 57600UL,
gUARTBaudRate115200_c = 115200UL,
gUARTBaudRate230400_c = 230400UL
}serialUartBaudRate_t;
Save changes and re-compile the project.
I hope this can help you!
Best Regards
Isaac Avila