- MyLibs - максимально платформонезависимые библиотеки (кроме разве что RTT) - RTT - STM32_General - библиотеки для периферии stm32
101 lines
6.1 KiB
TeX
101 lines
6.1 KiB
TeX
\doxysection{E\+:/.WORK/\+STM32/\+STM32\+\_\+\+Extended\+Libs/\+STM32\+\_\+\+General/\+Src/general\+\_\+uart.c File Reference}
|
||
\hypertarget{general__uart_8c}{}\label{general__uart_8c}\index{E:/.WORK/STM32/STM32\_ExtendedLibs/STM32\_General/Src/general\_uart.c@{E:/.WORK/STM32/STM32\_ExtendedLibs/STM32\_General/Src/general\_uart.c}}
|
||
|
||
|
||
Модуль для инициализации UART.
|
||
|
||
|
||
{\ttfamily \#include "{}general\+\_\+uart.\+h"{}}\newline
|
||
{\ttfamily \#include "{}general\+\_\+gpio.\+h"{}}\newline
|
||
Include dependency graph for general\+\_\+uart.\+c\+:
|
||
\nopagebreak
|
||
\begin{figure}[H]
|
||
\begin{center}
|
||
\leavevmode
|
||
\includegraphics[width=254pt]{general__uart_8c__incl}
|
||
\end{center}
|
||
\end{figure}
|
||
\doxysubsubsection*{Functions}
|
||
\begin{DoxyCompactItemize}
|
||
\item
|
||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y___l_i_b_s___u_a_r_t_gab9f07396b778505c934143e89953e154}{UART\+\_\+\+Base\+\_\+\+Init}} (\mbox{\hyperlink{struct_u_a_r_t___settings_type_def}{UART\+\_\+\+Settings\+Type\+Def}} \texorpdfstring{$\ast$}{*}suart)
|
||
\begin{DoxyCompactList}\small\item\em Инициализация UART с помощью структуры \doxylink{struct_u_a_r_t___settings_type_def}{UART\+\_\+\+Settings\+Type\+Def}. \end{DoxyCompactList}\item
|
||
void \mbox{\hyperlink{general__uart_8c_a3abae05bbde5f3b402bf18ca13dc6a0b}{UART\+\_\+\+GPIO\+\_\+\+Init}} (GPIO\+\_\+\+Type\+Def \texorpdfstring{$\ast$}{*}GPIOx, uint16\+\_\+t GPIO\+\_\+\+PIN\+\_\+\+RX, uint16\+\_\+t GPIO\+\_\+\+PIN\+\_\+\+TX)
|
||
\begin{DoxyCompactList}\small\item\em Инициализация GPIO для UART. \end{DoxyCompactList}\item
|
||
void \mbox{\hyperlink{general__uart_8c_ad82d0cbd19151675135fd75dad315d05}{UART\+\_\+\+DMA\+\_\+\+Init}} (UART\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}huart, DMA\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}hdma\+\_\+rx, DMA\+\_\+\+Stream\+\_\+\+Type\+Def \texorpdfstring{$\ast$}{*}DMAChannel, uint32\+\_\+t DMA\+\_\+\+CHANNEL\+\_\+X)
|
||
\begin{DoxyCompactList}\small\item\em Инициализация DMA для UART. \end{DoxyCompactList}\item
|
||
void \mbox{\hyperlink{group___m_y___l_i_b_s___u_a_r_t_gab9313fd2f9fc6873ca6bfbc5b96edbbb}{UART\+\_\+\+Msp\+Init}} (UART\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}huart)
|
||
\begin{DoxyCompactList}\small\item\em Настройка тактирования и прерываний UART. \end{DoxyCompactList}\item
|
||
void \mbox{\hyperlink{group___m_y___l_i_b_s___u_a_r_t_ga93ed6ceef4e3b5e7885786125cce93bc}{UART\+\_\+\+Msp\+De\+Init}} (UART\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}huart)
|
||
\begin{DoxyCompactList}\small\item\em Деинициализация тактирования и прерываний UART. \end{DoxyCompactList}\item
|
||
HAL\+\_\+\+Status\+Type\+Def \mbox{\hyperlink{group___m_y___l_i_b_s___u_a_r_t_ga2a22e46ecb9e04b2ce197a0e9c09044a}{UART\+\_\+\+Check\+\_\+\+Init\+\_\+\+Struct}} (\mbox{\hyperlink{struct_u_a_r_t___settings_type_def}{UART\+\_\+\+Settings\+Type\+Def}} \texorpdfstring{$\ast$}{*}suart)
|
||
\begin{DoxyCompactList}\small\item\em Проверка корректности структуры инициализации UART. \end{DoxyCompactList}\end{DoxyCompactItemize}
|
||
|
||
|
||
\doxysubsection{Detailed Description}
|
||
Модуль для инициализации UART.
|
||
|
||
Реализация функций для работы с UART\+:
|
||
\begin{DoxyItemize}
|
||
\item Инициализация UART и его линий RX/\+TX
|
||
\item Настройка DMA для UART
|
||
\item Настройка GPIO для UART
|
||
\item Настройка NVIC и тактирования UART
|
||
\end{DoxyItemize}
|
||
|
||
Definition in file \mbox{\hyperlink{general__uart_8c_source}{general\+\_\+uart.\+c}}.
|
||
|
||
|
||
|
||
\label{doc-func-members}
|
||
\Hypertarget{general__uart_8c_doc-func-members}
|
||
\doxysubsection{Function Documentation}
|
||
\Hypertarget{general__uart_8c_a3abae05bbde5f3b402bf18ca13dc6a0b}\index{general\_uart.c@{general\_uart.c}!UART\_GPIO\_Init@{UART\_GPIO\_Init}}
|
||
\index{UART\_GPIO\_Init@{UART\_GPIO\_Init}!general\_uart.c@{general\_uart.c}}
|
||
\doxysubsubsection{\texorpdfstring{UART\_GPIO\_Init()}{UART\_GPIO\_Init()}}
|
||
{\footnotesize\ttfamily \label{general__uart_8c_a3abae05bbde5f3b402bf18ca13dc6a0b}
|
||
void UART\+\_\+\+GPIO\+\_\+\+Init (\begin{DoxyParamCaption}\item[{GPIO\+\_\+\+Type\+Def \texorpdfstring{$\ast$}{*}}]{GPIOx}{, }\item[{uint16\+\_\+t}]{GPIO\+\_\+\+PIN\+\_\+\+RX}{, }\item[{uint16\+\_\+t}]{GPIO\+\_\+\+PIN\+\_\+\+TX}{}\end{DoxyParamCaption})}
|
||
|
||
|
||
|
||
Инициализация GPIO для UART.
|
||
|
||
|
||
\begin{DoxyParams}{Parameters}
|
||
{\em GPIOx} & Порт для настройки. \\
|
||
\hline
|
||
{\em GPIO\+\_\+\+PIN\+\_\+\+RX} & Пин для приема. \\
|
||
\hline
|
||
{\em GPIO\+\_\+\+PIN\+\_\+\+TX} & Пин для передачи. \\
|
||
\hline
|
||
\end{DoxyParams}
|
||
|
||
|
||
Definition at line \mbox{\hyperlink{general__uart_8c_source_l00069}{69}} of file \mbox{\hyperlink{general__uart_8c_source}{general\+\_\+uart.\+c}}.
|
||
|
||
\Hypertarget{general__uart_8c_ad82d0cbd19151675135fd75dad315d05}\index{general\_uart.c@{general\_uart.c}!UART\_DMA\_Init@{UART\_DMA\_Init}}
|
||
\index{UART\_DMA\_Init@{UART\_DMA\_Init}!general\_uart.c@{general\_uart.c}}
|
||
\doxysubsubsection{\texorpdfstring{UART\_DMA\_Init()}{UART\_DMA\_Init()}}
|
||
{\footnotesize\ttfamily \label{general__uart_8c_ad82d0cbd19151675135fd75dad315d05}
|
||
void UART\+\_\+\+DMA\+\_\+\+Init (\begin{DoxyParamCaption}\item[{UART\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}}]{huart}{, }\item[{DMA\+\_\+\+Handle\+Type\+Def \texorpdfstring{$\ast$}{*}}]{hdma\+\_\+rx}{, }\item[{DMA\+\_\+\+Stream\+\_\+\+Type\+Def \texorpdfstring{$\ast$}{*}}]{DMAChannel}{, }\item[{uint32\+\_\+t}]{DMA\+\_\+\+CHANNEL\+\_\+X}{}\end{DoxyParamCaption})}
|
||
|
||
|
||
|
||
Инициализация DMA для UART.
|
||
|
||
|
||
\begin{DoxyParams}{Parameters}
|
||
{\em huart} & Указатель на хендл UART. \\
|
||
\hline
|
||
{\em hdma\+\_\+rx} & Указатель на хендл DMA для линии приема UART. \\
|
||
\hline
|
||
{\em DMAChannel} & Указатель на канал DMA/поток DMA в STM32\+F407. \\
|
||
\hline
|
||
{\em DMA\+\_\+\+CHANNEL\+\_\+X} & Канал DMA. \\
|
||
\hline
|
||
\end{DoxyParams}
|
||
|
||
|
||
Definition at line \mbox{\hyperlink{general__uart_8c_source_l00109}{109}} of file \mbox{\hyperlink{general__uart_8c_source}{general\+\_\+uart.\+c}}.
|
||
|