ConOpSys V2970  P004.07
ANVILEX control operating system
Macros
UART1_STM32F429.cpp File Reference

STM32F429 on-chip UART1 module class implementation file. More...

#include <string.h>
#include <ctype.h>
#include "stm32f429xx.h"
#include "System_Resource.h"
#include "Anvilex_Library.h"
#include "UART1_STM32F429.h"
Include dependency graph for UART1_STM32F429.cpp:

Macros

#define __DIV_SAMPLING16(_PCLK_, _BAUD_)   (((_PCLK_)*25)/(4*(_BAUD_)))
 
#define __DIVMANT_SAMPLING16(_PCLK_, _BAUD_)   (__DIV_SAMPLING16((_PCLK_), (_BAUD_))/100)
 
#define __DIVFRAQ_SAMPLING16(_PCLK_, _BAUD_)   (((__DIV_SAMPLING16((_PCLK_), (_BAUD_)) - (__DIVMANT_SAMPLING16((_PCLK_), (_BAUD_)) * 100)) * 16 + 50) / 100)
 
#define __UART_BRR_SAMPLING16(_PCLK_, _BAUD_)   ((__DIVMANT_SAMPLING16((_PCLK_), (_BAUD_)) << 4)|(__DIVFRAQ_SAMPLING16((_PCLK_), (_BAUD_)) & 0x0F))
 
#define __DIV_SAMPLING8(_PCLK_, _BAUD_)   (((_PCLK_)*25)/(2*(_BAUD_)))
 
#define __DIVMANT_SAMPLING8(_PCLK_, _BAUD_)   (__DIV_SAMPLING8((_PCLK_), (_BAUD_))/100)
 
#define __DIVFRAQ_SAMPLING8(_PCLK_, _BAUD_)   (((__DIV_SAMPLING8((_PCLK_), (_BAUD_)) - (__DIVMANT_SAMPLING8((_PCLK_), (_BAUD_)) * 100)) * 16 + 50) / 100)
 
#define __UART_BRR_SAMPLING8(_PCLK_, _BAUD_)   ((__DIVMANT_SAMPLING8((_PCLK_), (_BAUD_)) << 4)|(__DIVFRAQ_SAMPLING8((_PCLK_), (_BAUD_)) & 0x0F))
 

Detailed Description

STM32F429 on-chip UART1 module class implementation file.

Attention
No special attention requered.
Revision
2875
Date
2021-10-08 12:51:43 +0500 (Fr, 08 Okt 2021)
Author
ggavrituhin

Macro Definition Documentation

◆ __DIV_SAMPLING16

#define __DIV_SAMPLING16 (   _PCLK_,
  _BAUD_ 
)    (((_PCLK_)*25)/(4*(_BAUD_)))

◆ __DIV_SAMPLING8

#define __DIV_SAMPLING8 (   _PCLK_,
  _BAUD_ 
)    (((_PCLK_)*25)/(2*(_BAUD_)))

◆ __DIVFRAQ_SAMPLING16

#define __DIVFRAQ_SAMPLING16 (   _PCLK_,
  _BAUD_ 
)    (((__DIV_SAMPLING16((_PCLK_), (_BAUD_)) - (__DIVMANT_SAMPLING16((_PCLK_), (_BAUD_)) * 100)) * 16 + 50) / 100)

◆ __DIVFRAQ_SAMPLING8

#define __DIVFRAQ_SAMPLING8 (   _PCLK_,
  _BAUD_ 
)    (((__DIV_SAMPLING8((_PCLK_), (_BAUD_)) - (__DIVMANT_SAMPLING8((_PCLK_), (_BAUD_)) * 100)) * 16 + 50) / 100)

◆ __DIVMANT_SAMPLING16

#define __DIVMANT_SAMPLING16 (   _PCLK_,
  _BAUD_ 
)    (__DIV_SAMPLING16((_PCLK_), (_BAUD_))/100)

◆ __DIVMANT_SAMPLING8

#define __DIVMANT_SAMPLING8 (   _PCLK_,
  _BAUD_ 
)    (__DIV_SAMPLING8((_PCLK_), (_BAUD_))/100)

◆ __UART_BRR_SAMPLING16

#define __UART_BRR_SAMPLING16 (   _PCLK_,
  _BAUD_ 
)    ((__DIVMANT_SAMPLING16((_PCLK_), (_BAUD_)) << 4)|(__DIVFRAQ_SAMPLING16((_PCLK_), (_BAUD_)) & 0x0F))

◆ __UART_BRR_SAMPLING8

#define __UART_BRR_SAMPLING8 (   _PCLK_,
  _BAUD_ 
)    ((__DIVMANT_SAMPLING8((_PCLK_), (_BAUD_)) << 4)|(__DIVFRAQ_SAMPLING8((_PCLK_), (_BAUD_)) & 0x0F))