1) naimportovat do projektu (repository):
/////////////////////////////////////////

RCC
GPIO
USART
MISC


2) naimportovat do main.c:
///////////////////////

#include "usart.h"



3) inicializan sekvence v main.c:	
///////////////////////

SystemInit();
init_USART1(115200);


4) vloit do knihovny "startup_stm32f4xx.c" voln funkce "SystemInit();"
//////////////////////////////////////////////////////////////////////////

void Default_Reset_Handler(void)
{
.
.
.
.
#endif	

  /* Call the application's entry point.*/
  SystemInit();  <<<<<// tohle
  main();
}


Pozn.: Pro pouit funkce SystemInit() mus bt sprvn nastavena hodnota osciltoru v knihovn "system_stm32f4xx.c"


5) pklad pout funkce "printf2":
//////////////////////////////////

int main(void)
{

	SystemInit();
	init_USART1(115200);
	printf2("USART test:\r\n");

	int integer = 12541;
	printf2("Integer: %d\r\n",integer);

	float floatNumber = 145.1278;
	printf2("float: %.4f\r\n",floatNumber);

	double doubleNumber = 145.1278;
	printf2("Double: %.4f\r\n",doubleNumber);

	char *string = "retezec";
	printf2("String: %s\r\n",string);


	int temp = 0;
    while(1)
    {
    	Delay(10000000);
    	temp++;
    	printf2("%d\r\n",temp);
    }
}



