MKM34Z256VLx7 Bare Metal Software Drivers  R4.1.6
Reference Manual
UART Polling Mode

This example shows typical use of the Universal Asynchronous Receiver/Transmitter (UART) module in polling mode.

Source code:
/******************************************************************************
* (c) Copyright 2010-2015, Freescale Semiconductor Inc.
* ALL RIGHTS RESERVED.
******************************************************************************
* uart_test.c
******************************************************************************/
#include "drivers.h"
void main (void)
{
char c;
/* route core clock to PTF7 */
/* clock mode 1:1:1, 24MHz */
/* UART2 init 9600bd */
UART_PutStr (UART2,"\n\rCharacters will be echoed on the screen:\n");
while(1)
{
/* read and echo character */
while (!UART_RxFull(UART2));
c = UART_GetChar (UART2);
while (!UART_TxIdle(UART2));
UART_PutChar (UART2,c);
}
}
Toolchain support:
IAR EWARM 7.40.7KEIL uVision 5.15CrossWorks 3.6ATOLLIC TrueStudio 5.3.0Kinetis Design Studio 3.0.0