/*
* Copyright 2016-2023 NXP
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
/**
* @file MIMXRT1021_Project_uart_putty.c
* @brief Application entry point.
*/
#include <stdio.h>
#include "board.h"
#include "peripherals.h"
#include "pin_mux.h"
#include "clock_config.h"
#include "MIMXRT1021.h"
#include "fsl_debug_console.h"
#include "fsl_common.h"
#include "board.h"
#include "fsl_lpuart.h"
/* TODO: insert other include files here. */
/* TODO: insert other definitions and declarations here. */
/*
* @brief Application entry point.
*/
// LPUART modülü ve yapılandırma
lpuart_config_t config;
LPUART_Type *base = LPUART1;
// Veri gönderilecek tampon
uint8_t txData[] = "Hello, PC! This is LPUART1\r\n";
int main(void) {
/* Init board hardware. */
BOARD_ConfigMPU();
BOARD_InitBootPins();
BOARD_InitBootClocks();
BOARD_InitBootPeripherals();
#ifndef BOARD_INIT_DEBUG_CONSOLE_PERIPHERAL
/* Init FSL debug console. */
BOARD_InitDebugConsole();
#endif
// LPUART yapılandırma
LPUART_GetDefaultConfig(&config);
config.baudRate_Bps = 115200;
// LPUART başlatma
LPUART_Init(base, &config, CLOCK_GetFreq(kCLOCK_OscClk));
/* Force the counter to be placed into memory. */
/* Enter an infinite loop, just incrementing a counter. */
while(1) {
// Veriyi gönder
LPUART_WriteBlocking(base, txData, sizeof(txData) - 1);
}
return 0 ;
}